converse.js 3.0 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383603846038560386603876038860389603906039160392603936039460395603966039760398603996040060401604026040360404604056040660407604086040960410604116041260413604146041560416604176041860419604206042160422604236042460425604266042760428604296043060431604326043360434604356043660437604386043960440604416044260443604446044560446604476044860449604506045160452604536045460455604566045760458604596046060461604626046360464604656046660467604686046960470604716047260473604746047560476604776047860479604806048160482604836048460485604866048760488604896049060491604926049360494604956049660497604986049960500605016050260503605046050560506605076050860509605106051160512605136051460515605166051760518605196052060521605226052360524605256052660527605286052960530605316053260533605346053560536605376053860539605406054160542605436054460545605466054760548605496055060551605526055360554605556055660557605586055960560605616056260563605646056560566605676056860569605706057160572605736057460575605766057760578605796058060581605826058360584605856058660587605886058960590605916059260593605946059560596605976059860599606006060160602606036060460605606066060760608606096061060611606126061360614606156061660617606186061960620606216062260623606246062560626606276062860629606306063160632606336063460635606366063760638606396064060641606426064360644606456064660647606486064960650606516065260653606546065560656606576065860659606606066160662606636066460665606666066760668606696067060671606726067360674606756067660677606786067960680606816068260683606846068560686606876068860689606906069160692606936069460695606966069760698606996070060701607026070360704607056070660707607086070960710607116071260713607146071560716607176071860719607206072160722607236072460725607266072760728607296073060731607326073360734607356073660737607386073960740607416074260743607446074560746607476074860749607506075160752607536075460755607566075760758607596076060761607626076360764607656076660767607686076960770607716077260773607746077560776607776077860779607806078160782607836078460785607866078760788607896079060791607926079360794607956079660797607986079960800608016080260803608046080560806608076080860809608106081160812608136081460815608166081760818608196082060821608226082360824608256082660827608286082960830608316083260833608346083560836608376083860839608406084160842608436084460845608466084760848608496085060851608526085360854608556085660857608586085960860608616086260863608646086560866608676086860869608706087160872608736087460875608766087760878608796088060881608826088360884608856088660887608886088960890608916089260893608946089560896608976089860899609006090160902609036090460905609066090760908609096091060911609126091360914609156091660917609186091960920609216092260923609246092560926609276092860929609306093160932609336093460935609366093760938609396094060941609426094360944609456094660947609486094960950609516095260953609546095560956609576095860959609606096160962609636096460965609666096760968609696097060971609726097360974609756097660977609786097960980609816098260983609846098560986609876098860989609906099160992609936099460995609966099760998609996100061001610026100361004610056100661007610086100961010610116101261013610146101561016610176101861019610206102161022610236102461025610266102761028610296103061031610326103361034610356103661037610386103961040610416104261043610446104561046610476104861049610506105161052610536105461055610566105761058610596106061061610626106361064610656106661067610686106961070610716107261073610746107561076610776107861079610806108161082610836108461085610866108761088610896109061091610926109361094610956109661097610986109961100611016110261103611046110561106611076110861109611106111161112611136111461115611166111761118611196112061121611226112361124611256112661127611286112961130611316113261133611346113561136611376113861139611406114161142611436114461145611466114761148611496115061151611526115361154611556115661157611586115961160611616116261163611646116561166611676116861169611706117161172611736117461175611766117761178611796118061181611826118361184611856118661187611886118961190611916119261193611946119561196611976119861199612006120161202612036120461205612066120761208612096121061211612126121361214612156121661217612186121961220612216122261223612246122561226612276122861229612306123161232612336123461235612366123761238612396124061241612426124361244612456124661247612486124961250612516125261253612546125561256612576125861259612606126161262612636126461265612666126761268612696127061271612726127361274612756127661277612786127961280612816128261283612846128561286612876128861289612906129161292612936129461295612966129761298612996130061301613026130361304613056130661307613086130961310613116131261313613146131561316613176131861319613206132161322613236132461325613266132761328613296133061331613326133361334613356133661337613386133961340613416134261343613446134561346613476134861349613506135161352613536135461355613566135761358613596136061361613626136361364613656136661367613686136961370613716137261373613746137561376613776137861379613806138161382613836138461385613866138761388613896139061391613926139361394613956139661397613986139961400614016140261403614046140561406614076140861409614106141161412614136141461415614166141761418614196142061421614226142361424614256142661427614286142961430614316143261433614346143561436614376143861439614406144161442614436144461445614466144761448614496145061451614526145361454614556145661457614586145961460614616146261463614646146561466614676146861469614706147161472614736147461475614766147761478614796148061481614826148361484614856148661487614886148961490614916149261493614946149561496614976149861499615006150161502615036150461505615066150761508615096151061511615126151361514615156151661517615186151961520615216152261523615246152561526615276152861529615306153161532615336153461535615366153761538615396154061541615426154361544615456154661547615486154961550615516155261553615546155561556615576155861559615606156161562615636156461565615666156761568615696157061571615726157361574615756157661577615786157961580615816158261583615846158561586615876158861589615906159161592615936159461595615966159761598615996160061601616026160361604616056160661607616086160961610616116161261613616146161561616616176161861619616206162161622616236162461625616266162761628616296163061631616326163361634616356163661637616386163961640616416164261643616446164561646616476164861649616506165161652616536165461655616566165761658616596166061661616626166361664616656166661667616686166961670616716167261673616746167561676616776167861679616806168161682616836168461685616866168761688616896169061691616926169361694616956169661697616986169961700617016170261703617046170561706617076170861709617106171161712617136171461715617166171761718617196172061721617226172361724617256172661727617286172961730617316173261733617346173561736617376173861739617406174161742617436174461745617466174761748617496175061751617526175361754617556175661757617586175961760617616176261763617646176561766617676176861769617706177161772617736177461775617766177761778617796178061781617826178361784617856178661787617886178961790617916179261793617946179561796617976179861799618006180161802618036180461805618066180761808618096181061811618126181361814618156181661817618186181961820618216182261823618246182561826618276182861829618306183161832618336183461835618366183761838618396184061841618426184361844618456184661847618486184961850618516185261853618546185561856618576185861859618606186161862618636186461865618666186761868618696187061871618726187361874618756187661877618786187961880618816188261883618846188561886618876188861889618906189161892618936189461895618966189761898618996190061901619026190361904619056190661907619086190961910619116191261913619146191561916619176191861919619206192161922619236192461925619266192761928619296193061931619326193361934619356193661937619386193961940619416194261943619446194561946619476194861949619506195161952619536195461955619566195761958619596196061961619626196361964619656196661967619686196961970619716197261973619746197561976619776197861979619806198161982619836198461985619866198761988619896199061991619926199361994619956199661997619986199962000620016200262003620046200562006620076200862009620106201162012620136201462015620166201762018620196202062021620226202362024620256202662027620286202962030620316203262033620346203562036620376203862039620406204162042620436204462045620466204762048620496205062051620526205362054620556205662057620586205962060620616206262063620646206562066620676206862069620706207162072620736207462075620766207762078620796208062081620826208362084620856208662087620886208962090620916209262093620946209562096620976209862099621006210162102621036210462105621066210762108621096211062111621126211362114621156211662117621186211962120621216212262123621246212562126621276212862129621306213162132621336213462135621366213762138621396214062141621426214362144621456214662147621486214962150621516215262153621546215562156621576215862159621606216162162621636216462165621666216762168621696217062171621726217362174621756217662177621786217962180621816218262183621846218562186621876218862189621906219162192621936219462195621966219762198621996220062201622026220362204622056220662207622086220962210622116221262213622146221562216622176221862219622206222162222622236222462225622266222762228622296223062231622326223362234622356223662237622386223962240622416224262243622446224562246622476224862249622506225162252622536225462255622566225762258622596226062261622626226362264622656226662267622686226962270622716227262273622746227562276622776227862279622806228162282622836228462285622866228762288622896229062291622926229362294622956229662297622986229962300623016230262303623046230562306623076230862309623106231162312623136231462315623166231762318623196232062321623226232362324623256232662327623286232962330623316233262333623346233562336623376233862339623406234162342623436234462345623466234762348623496235062351623526235362354623556235662357623586235962360623616236262363623646236562366623676236862369623706237162372623736237462375623766237762378623796238062381623826238362384623856238662387623886238962390623916239262393623946239562396623976239862399624006240162402624036240462405624066240762408624096241062411624126241362414624156241662417624186241962420624216242262423624246242562426624276242862429624306243162432624336243462435624366243762438624396244062441624426244362444624456244662447624486244962450624516245262453624546245562456624576245862459624606246162462624636246462465624666246762468624696247062471624726247362474624756247662477624786247962480624816248262483624846248562486624876248862489624906249162492624936249462495624966249762498624996250062501625026250362504625056250662507625086250962510625116251262513625146251562516625176251862519625206252162522625236252462525625266252762528625296253062531625326253362534625356253662537625386253962540625416254262543625446254562546625476254862549625506255162552625536255462555625566255762558625596256062561625626256362564625656256662567625686256962570625716257262573625746257562576625776257862579625806258162582625836258462585625866258762588625896259062591625926259362594625956259662597625986259962600626016260262603626046260562606626076260862609626106261162612626136261462615626166261762618626196262062621626226262362624626256262662627626286262962630626316263262633626346263562636626376263862639626406264162642626436264462645626466264762648626496265062651626526265362654626556265662657626586265962660626616266262663626646266562666626676266862669626706267162672626736267462675626766267762678626796268062681626826268362684626856268662687626886268962690626916269262693626946269562696626976269862699627006270162702627036270462705627066270762708627096271062711627126271362714627156271662717627186271962720627216272262723627246272562726627276272862729627306273162732627336273462735627366273762738627396274062741627426274362744627456274662747627486274962750627516275262753627546275562756627576275862759627606276162762627636276462765627666276762768627696277062771627726277362774627756277662777627786277962780627816278262783627846278562786627876278862789627906279162792627936279462795627966279762798627996280062801628026280362804628056280662807628086280962810628116281262813628146281562816628176281862819628206282162822628236282462825628266282762828628296283062831628326283362834628356283662837628386283962840628416284262843628446284562846628476284862849628506285162852628536285462855628566285762858628596286062861628626286362864628656286662867628686286962870628716287262873628746287562876628776287862879628806288162882628836288462885628866288762888628896289062891628926289362894628956289662897628986289962900629016290262903629046290562906629076290862909629106291162912629136291462915629166291762918629196292062921629226292362924629256292662927629286292962930629316293262933629346293562936629376293862939629406294162942629436294462945629466294762948629496295062951629526295362954629556295662957629586295962960629616296262963629646296562966629676296862969629706297162972629736297462975629766297762978629796298062981629826298362984629856298662987629886298962990629916299262993629946299562996629976299862999630006300163002630036300463005630066300763008630096301063011630126301363014630156301663017630186301963020630216302263023630246302563026630276302863029630306303163032630336303463035630366303763038630396304063041630426304363044630456304663047630486304963050630516305263053630546305563056630576305863059630606306163062630636306463065630666306763068630696307063071630726307363074630756307663077630786307963080630816308263083630846308563086630876308863089630906309163092630936309463095630966309763098630996310063101631026310363104631056310663107631086310963110631116311263113631146311563116631176311863119631206312163122631236312463125631266312763128631296313063131631326313363134631356313663137631386313963140631416314263143631446314563146631476314863149631506315163152631536315463155631566315763158631596316063161631626316363164631656316663167631686316963170631716317263173631746317563176631776317863179631806318163182631836318463185631866318763188631896319063191631926319363194631956319663197631986319963200632016320263203632046320563206632076320863209632106321163212632136321463215632166321763218632196322063221632226322363224632256322663227632286322963230632316323263233632346323563236632376323863239632406324163242632436324463245632466324763248632496325063251632526325363254632556325663257632586325963260632616326263263632646326563266632676326863269632706327163272632736327463275632766327763278632796328063281632826328363284632856328663287632886328963290632916329263293632946329563296632976329863299633006330163302633036330463305633066330763308633096331063311633126331363314633156331663317633186331963320633216332263323633246332563326633276332863329633306333163332633336333463335633366333763338633396334063341633426334363344633456334663347633486334963350633516335263353633546335563356633576335863359633606336163362633636336463365633666336763368633696337063371633726337363374633756337663377633786337963380633816338263383633846338563386633876338863389633906339163392633936339463395633966339763398633996340063401634026340363404634056340663407634086340963410634116341263413634146341563416634176341863419634206342163422634236342463425634266342763428634296343063431634326343363434634356343663437634386343963440634416344263443634446344563446634476344863449634506345163452634536345463455634566345763458634596346063461634626346363464634656346663467634686346963470634716347263473634746347563476634776347863479634806348163482634836348463485634866348763488634896349063491634926349363494634956349663497634986349963500635016350263503635046350563506635076350863509635106351163512635136351463515635166351763518635196352063521635226352363524635256352663527635286352963530635316353263533635346353563536635376353863539635406354163542635436354463545635466354763548635496355063551635526355363554635556355663557635586355963560635616356263563635646356563566635676356863569635706357163572635736357463575635766357763578635796358063581635826358363584635856358663587635886358963590635916359263593635946359563596635976359863599636006360163602636036360463605636066360763608636096361063611636126361363614636156361663617636186361963620636216362263623636246362563626636276362863629636306363163632636336363463635636366363763638636396364063641636426364363644636456364663647636486364963650636516365263653636546365563656636576365863659636606366163662636636366463665636666366763668636696367063671636726367363674636756367663677636786367963680636816368263683636846368563686636876368863689636906369163692636936369463695636966369763698636996370063701637026370363704637056370663707637086370963710637116371263713637146371563716637176371863719637206372163722637236372463725637266372763728637296373063731637326373363734637356373663737637386373963740637416374263743637446374563746637476374863749637506375163752637536375463755637566375763758637596376063761637626376363764637656376663767637686376963770637716377263773637746377563776637776377863779637806378163782637836378463785637866378763788637896379063791637926379363794637956379663797637986379963800638016380263803638046380563806638076380863809638106381163812638136381463815638166381763818638196382063821638226382363824638256382663827638286382963830638316383263833638346383563836638376383863839638406384163842638436384463845638466384763848638496385063851638526385363854638556385663857638586385963860638616386263863638646386563866638676386863869638706387163872638736387463875638766387763878638796388063881638826388363884638856388663887638886388963890638916389263893638946389563896638976389863899639006390163902639036390463905639066390763908639096391063911639126391363914639156391663917639186391963920639216392263923639246392563926639276392863929639306393163932639336393463935639366393763938639396394063941639426394363944639456394663947639486394963950639516395263953639546395563956639576395863959639606396163962639636396463965639666396763968639696397063971639726397363974639756397663977639786397963980639816398263983639846398563986639876398863989639906399163992639936399463995639966399763998639996400064001640026400364004640056400664007640086400964010640116401264013640146401564016640176401864019640206402164022640236402464025640266402764028640296403064031640326403364034640356403664037640386403964040640416404264043640446404564046640476404864049640506405164052640536405464055640566405764058640596406064061640626406364064640656406664067640686406964070640716407264073640746407564076640776407864079640806408164082640836408464085640866408764088640896409064091640926409364094640956409664097640986409964100641016410264103641046410564106641076410864109641106411164112641136411464115641166411764118641196412064121641226412364124641256412664127641286412964130641316413264133641346413564136641376413864139641406414164142641436414464145641466414764148641496415064151641526415364154641556415664157641586415964160641616416264163641646416564166641676416864169641706417164172641736417464175641766417764178641796418064181641826418364184641856418664187641886418964190641916419264193641946419564196641976419864199642006420164202642036420464205642066420764208642096421064211642126421364214642156421664217642186421964220642216422264223642246422564226642276422864229642306423164232642336423464235642366423764238642396424064241642426424364244642456424664247642486424964250642516425264253642546425564256642576425864259642606426164262642636426464265642666426764268642696427064271642726427364274642756427664277642786427964280642816428264283642846428564286642876428864289642906429164292642936429464295642966429764298642996430064301643026430364304643056430664307643086430964310643116431264313643146431564316643176431864319643206432164322643236432464325643266432764328643296433064331643326433364334643356433664337643386433964340643416434264343643446434564346643476434864349643506435164352643536435464355643566435764358643596436064361643626436364364643656436664367643686436964370643716437264373643746437564376643776437864379643806438164382643836438464385643866438764388643896439064391643926439364394643956439664397643986439964400644016440264403644046440564406644076440864409644106441164412644136441464415644166441764418644196442064421644226442364424644256442664427644286442964430644316443264433644346443564436644376443864439644406444164442644436444464445644466444764448644496445064451644526445364454644556445664457644586445964460644616446264463644646446564466644676446864469644706447164472644736447464475644766447764478644796448064481644826448364484644856448664487644886448964490644916449264493644946449564496644976449864499645006450164502645036450464505645066450764508645096451064511645126451364514645156451664517645186451964520645216452264523645246452564526645276452864529645306453164532645336453464535645366453764538645396454064541645426454364544645456454664547645486454964550645516455264553645546455564556645576455864559645606456164562645636456464565645666456764568645696457064571645726457364574645756457664577645786457964580645816458264583645846458564586645876458864589645906459164592645936459464595645966459764598645996460064601646026460364604646056460664607646086460964610646116461264613646146461564616646176461864619646206462164622646236462464625646266462764628646296463064631646326463364634646356463664637646386463964640646416464264643646446464564646646476464864649646506465164652646536465464655646566465764658646596466064661646626466364664646656466664667646686466964670646716467264673646746467564676646776467864679646806468164682646836468464685646866468764688646896469064691646926469364694646956469664697646986469964700647016470264703647046470564706647076470864709647106471164712647136471464715647166471764718647196472064721647226472364724647256472664727647286472964730647316473264733647346473564736647376473864739647406474164742647436474464745647466474764748647496475064751647526475364754647556475664757647586475964760647616476264763647646476564766647676476864769647706477164772647736477464775647766477764778647796478064781647826478364784647856478664787647886478964790647916479264793647946479564796647976479864799648006480164802648036480464805648066480764808648096481064811648126481364814648156481664817648186481964820648216482264823648246482564826648276482864829648306483164832648336483464835648366483764838648396484064841648426484364844648456484664847648486484964850648516485264853648546485564856648576485864859648606486164862648636486464865648666486764868648696487064871648726487364874648756487664877648786487964880648816488264883648846488564886648876488864889648906489164892648936489464895648966489764898648996490064901649026490364904649056490664907649086490964910649116491264913649146491564916649176491864919649206492164922649236492464925649266492764928649296493064931649326493364934649356493664937649386493964940649416494264943649446494564946649476494864949649506495164952649536495464955649566495764958649596496064961649626496364964649656496664967649686496964970649716497264973649746497564976649776497864979649806498164982649836498464985649866498764988649896499064991649926499364994649956499664997649986499965000650016500265003650046500565006650076500865009650106501165012650136501465015650166501765018650196502065021650226502365024650256502665027650286502965030650316503265033650346503565036650376503865039650406504165042650436504465045650466504765048650496505065051650526505365054650556505665057650586505965060650616506265063650646506565066650676506865069650706507165072650736507465075650766507765078650796508065081650826508365084650856508665087650886508965090650916509265093650946509565096650976509865099651006510165102651036510465105651066510765108651096511065111651126511365114651156511665117651186511965120651216512265123651246512565126651276512865129651306513165132651336513465135651366513765138651396514065141651426514365144651456514665147651486514965150651516515265153651546515565156651576515865159651606516165162651636516465165651666516765168651696517065171651726517365174651756517665177651786517965180651816518265183651846518565186651876518865189651906519165192651936519465195651966519765198651996520065201652026520365204652056520665207652086520965210652116521265213652146521565216652176521865219652206522165222652236522465225652266522765228652296523065231652326523365234652356523665237652386523965240652416524265243652446524565246652476524865249652506525165252652536525465255652566525765258652596526065261652626526365264652656526665267652686526965270652716527265273652746527565276652776527865279652806528165282652836528465285652866528765288652896529065291652926529365294652956529665297652986529965300653016530265303653046530565306653076530865309653106531165312653136531465315653166531765318653196532065321653226532365324653256532665327653286532965330653316533265333653346533565336653376533865339653406534165342653436534465345653466534765348653496535065351653526535365354653556535665357653586535965360653616536265363653646536565366653676536865369653706537165372653736537465375653766537765378653796538065381653826538365384653856538665387653886538965390653916539265393653946539565396653976539865399654006540165402654036540465405654066540765408654096541065411654126541365414654156541665417654186541965420654216542265423654246542565426654276542865429654306543165432654336543465435654366543765438654396544065441654426544365444654456544665447654486544965450654516545265453654546545565456654576545865459654606546165462654636546465465654666546765468654696547065471654726547365474654756547665477654786547965480654816548265483654846548565486654876548865489654906549165492654936549465495654966549765498654996550065501655026550365504655056550665507655086550965510655116551265513655146551565516655176551865519655206552165522655236552465525655266552765528655296553065531655326553365534655356553665537655386553965540655416554265543655446554565546655476554865549655506555165552655536555465555655566555765558655596556065561655626556365564655656556665567655686556965570655716557265573655746557565576655776557865579655806558165582655836558465585655866558765588655896559065591655926559365594655956559665597655986559965600656016560265603656046560565606656076560865609656106561165612656136561465615656166561765618656196562065621656226562365624656256562665627656286562965630656316563265633656346563565636656376563865639656406564165642656436564465645656466564765648656496565065651656526565365654656556565665657656586565965660656616566265663656646566565666656676566865669656706567165672656736567465675656766567765678656796568065681656826568365684656856568665687656886568965690656916569265693656946569565696656976569865699657006570165702657036570465705657066570765708657096571065711657126571365714657156571665717657186571965720657216572265723657246572565726657276572865729657306573165732657336573465735657366573765738657396574065741657426574365744657456574665747657486574965750657516575265753657546575565756657576575865759657606576165762657636576465765657666576765768657696577065771657726577365774657756577665777657786577965780657816578265783657846578565786657876578865789657906579165792657936579465795657966579765798657996580065801658026580365804658056580665807658086580965810658116581265813658146581565816658176581865819658206582165822658236582465825658266582765828658296583065831658326583365834658356583665837658386583965840658416584265843658446584565846658476584865849658506585165852658536585465855658566585765858658596586065861658626586365864658656586665867658686586965870658716587265873658746587565876658776587865879658806588165882658836588465885658866588765888658896589065891658926589365894658956589665897658986589965900659016590265903659046590565906659076590865909659106591165912659136591465915659166591765918659196592065921659226592365924659256592665927659286592965930659316593265933659346593565936659376593865939659406594165942659436594465945659466594765948659496595065951659526595365954659556595665957659586595965960659616596265963659646596565966659676596865969659706597165972659736597465975659766597765978659796598065981659826598365984659856598665987659886598965990659916599265993659946599565996659976599865999660006600166002660036600466005660066600766008660096601066011660126601366014660156601666017660186601966020660216602266023660246602566026660276602866029660306603166032660336603466035660366603766038660396604066041660426604366044660456604666047660486604966050660516605266053660546605566056660576605866059660606606166062660636606466065660666606766068660696607066071660726607366074660756607666077660786607966080660816608266083660846608566086660876608866089660906609166092660936609466095660966609766098660996610066101661026610366104661056610666107661086610966110661116611266113661146611566116661176611866119661206612166122661236612466125661266612766128661296613066131661326613366134661356613666137661386613966140661416614266143661446614566146661476614866149661506615166152661536615466155661566615766158661596616066161661626616366164661656616666167661686616966170661716617266173661746617566176661776617866179661806618166182661836618466185661866618766188661896619066191661926619366194661956619666197661986619966200662016620266203662046620566206662076620866209662106621166212662136621466215662166621766218662196622066221662226622366224662256622666227662286622966230662316623266233662346623566236662376623866239662406624166242662436624466245662466624766248662496625066251662526625366254662556625666257662586625966260662616626266263662646626566266662676626866269662706627166272662736627466275662766627766278662796628066281662826628366284662856628666287662886628966290662916629266293662946629566296662976629866299663006630166302663036630466305663066630766308663096631066311663126631366314663156631666317663186631966320663216632266323663246632566326663276632866329663306633166332663336633466335663366633766338663396634066341663426634366344663456634666347663486634966350663516635266353663546635566356663576635866359663606636166362663636636466365663666636766368663696637066371663726637366374663756637666377663786637966380663816638266383663846638566386663876638866389663906639166392663936639466395663966639766398663996640066401664026640366404664056640666407664086640966410664116641266413664146641566416664176641866419664206642166422664236642466425664266642766428664296643066431664326643366434664356643666437664386643966440664416644266443664446644566446664476644866449664506645166452664536645466455664566645766458664596646066461664626646366464664656646666467664686646966470664716647266473664746647566476664776647866479664806648166482664836648466485664866648766488664896649066491664926649366494664956649666497664986649966500665016650266503665046650566506665076650866509665106651166512665136651466515665166651766518665196652066521665226652366524665256652666527665286652966530665316653266533665346653566536665376653866539665406654166542665436654466545665466654766548665496655066551665526655366554665556655666557665586655966560665616656266563665646656566566665676656866569665706657166572665736657466575665766657766578665796658066581665826658366584665856658666587665886658966590665916659266593665946659566596665976659866599666006660166602666036660466605666066660766608666096661066611666126661366614666156661666617666186661966620666216662266623666246662566626666276662866629666306663166632666336663466635666366663766638666396664066641666426664366644666456664666647666486664966650666516665266653666546665566656666576665866659666606666166662666636666466665666666666766668666696667066671666726667366674666756667666677666786667966680666816668266683666846668566686666876668866689666906669166692666936669466695666966669766698666996670066701667026670366704667056670666707667086670966710667116671266713667146671566716667176671866719667206672166722667236672466725667266672766728667296673066731667326673366734667356673666737667386673966740667416674266743667446674566746667476674866749667506675166752667536675466755667566675766758667596676066761667626676366764667656676666767667686676966770667716677266773667746677566776667776677866779667806678166782667836678466785667866678766788667896679066791667926679366794667956679666797667986679966800668016680266803668046680566806668076680866809668106681166812668136681466815668166681766818668196682066821668226682366824668256682666827668286682966830668316683266833668346683566836668376683866839668406684166842668436684466845668466684766848668496685066851668526685366854668556685666857668586685966860668616686266863668646686566866668676686866869668706687166872668736687466875668766687766878668796688066881668826688366884668856688666887668886688966890668916689266893668946689566896668976689866899669006690166902669036690466905669066690766908669096691066911669126691366914669156691666917669186691966920669216692266923669246692566926669276692866929669306693166932669336693466935669366693766938669396694066941669426694366944669456694666947669486694966950669516695266953669546695566956669576695866959669606696166962669636696466965669666696766968669696697066971669726697366974669756697666977669786697966980669816698266983669846698566986669876698866989669906699166992669936699466995669966699766998669996700067001670026700367004670056700667007670086700967010670116701267013670146701567016670176701867019670206702167022670236702467025670266702767028670296703067031670326703367034670356703667037670386703967040670416704267043670446704567046670476704867049670506705167052670536705467055670566705767058670596706067061670626706367064670656706667067670686706967070670716707267073670746707567076670776707867079670806708167082670836708467085670866708767088670896709067091670926709367094670956709667097670986709967100671016710267103671046710567106671076710867109671106711167112671136711467115671166711767118671196712067121671226712367124671256712667127671286712967130671316713267133671346713567136671376713867139671406714167142671436714467145671466714767148671496715067151671526715367154671556715667157671586715967160671616716267163671646716567166671676716867169671706717167172671736717467175671766717767178671796718067181671826718367184671856718667187671886718967190671916719267193671946719567196671976719867199672006720167202672036720467205672066720767208672096721067211672126721367214672156721667217672186721967220672216722267223672246722567226672276722867229672306723167232672336723467235672366723767238672396724067241672426724367244672456724667247672486724967250672516725267253672546725567256672576725867259672606726167262672636726467265672666726767268672696727067271672726727367274672756727667277672786727967280672816728267283672846728567286672876728867289672906729167292672936729467295672966729767298672996730067301673026730367304673056730667307673086730967310673116731267313673146731567316673176731867319673206732167322673236732467325673266732767328673296733067331673326733367334673356733667337673386733967340673416734267343673446734567346673476734867349673506735167352673536735467355673566735767358673596736067361673626736367364673656736667367673686736967370673716737267373673746737567376673776737867379673806738167382673836738467385673866738767388673896739067391673926739367394673956739667397673986739967400674016740267403674046740567406674076740867409674106741167412674136741467415674166741767418674196742067421674226742367424674256742667427674286742967430674316743267433674346743567436674376743867439674406744167442674436744467445674466744767448674496745067451674526745367454674556745667457674586745967460674616746267463674646746567466674676746867469674706747167472674736747467475674766747767478674796748067481674826748367484674856748667487674886748967490674916749267493674946749567496674976749867499675006750167502675036750467505675066750767508675096751067511675126751367514675156751667517675186751967520675216752267523675246752567526675276752867529675306753167532675336753467535675366753767538675396754067541675426754367544675456754667547675486754967550675516755267553675546755567556675576755867559675606756167562675636756467565675666756767568675696757067571675726757367574675756757667577675786757967580675816758267583675846758567586675876758867589675906759167592675936759467595675966759767598675996760067601676026760367604676056760667607676086760967610676116761267613676146761567616676176761867619676206762167622676236762467625676266762767628676296763067631676326763367634676356763667637676386763967640676416764267643676446764567646676476764867649676506765167652676536765467655676566765767658676596766067661676626766367664676656766667667676686766967670676716767267673676746767567676676776767867679676806768167682676836768467685676866768767688676896769067691676926769367694676956769667697676986769967700677016770267703677046770567706677076770867709677106771167712677136771467715677166771767718677196772067721677226772367724677256772667727677286772967730677316773267733677346773567736677376773867739677406774167742677436774467745677466774767748677496775067751677526775367754677556775667757677586775967760677616776267763677646776567766677676776867769677706777167772677736777467775677766777767778677796778067781677826778367784677856778667787677886778967790677916779267793677946779567796677976779867799678006780167802678036780467805678066780767808678096781067811678126781367814678156781667817678186781967820678216782267823678246782567826678276782867829678306783167832678336783467835678366783767838678396784067841678426784367844678456784667847678486784967850678516785267853678546785567856678576785867859678606786167862678636786467865678666786767868678696787067871678726787367874678756787667877678786787967880678816788267883678846788567886678876788867889678906789167892678936789467895678966789767898678996790067901679026790367904679056790667907679086790967910679116791267913679146791567916679176791867919679206792167922679236792467925679266792767928679296793067931679326793367934679356793667937679386793967940679416794267943679446794567946679476794867949679506795167952679536795467955679566795767958679596796067961679626796367964679656796667967679686796967970679716797267973679746797567976679776797867979679806798167982679836798467985679866798767988679896799067991679926799367994679956799667997679986799968000680016800268003680046800568006680076800868009680106801168012680136801468015680166801768018680196802068021680226802368024680256802668027680286802968030680316803268033680346803568036680376803868039680406804168042680436804468045680466804768048680496805068051680526805368054680556805668057680586805968060680616806268063680646806568066680676806868069680706807168072680736807468075680766807768078680796808068081680826808368084680856808668087680886808968090680916809268093680946809568096680976809868099681006810168102681036810468105681066810768108681096811068111681126811368114681156811668117681186811968120681216812268123681246812568126681276812868129681306813168132681336813468135681366813768138681396814068141681426814368144681456814668147681486814968150681516815268153681546815568156681576815868159681606816168162681636816468165681666816768168681696817068171681726817368174681756817668177681786817968180681816818268183681846818568186681876818868189681906819168192681936819468195681966819768198681996820068201682026820368204682056820668207682086820968210682116821268213682146821568216682176821868219682206822168222682236822468225682266822768228682296823068231682326823368234682356823668237682386823968240682416824268243682446824568246682476824868249682506825168252682536825468255682566825768258682596826068261682626826368264682656826668267682686826968270682716827268273682746827568276682776827868279682806828168282682836828468285682866828768288682896829068291682926829368294682956829668297682986829968300683016830268303683046830568306683076830868309683106831168312683136831468315683166831768318683196832068321683226832368324683256832668327683286832968330683316833268333683346833568336683376833868339683406834168342683436834468345683466834768348683496835068351683526835368354683556835668357683586835968360683616836268363683646836568366683676836868369683706837168372683736837468375683766837768378683796838068381683826838368384683856838668387683886838968390683916839268393683946839568396683976839868399684006840168402684036840468405684066840768408684096841068411684126841368414684156841668417684186841968420684216842268423684246842568426684276842868429684306843168432684336843468435684366843768438684396844068441684426844368444684456844668447684486844968450684516845268453684546845568456684576845868459684606846168462684636846468465684666846768468684696847068471684726847368474684756847668477684786847968480684816848268483684846848568486684876848868489684906849168492684936849468495684966849768498684996850068501685026850368504685056850668507685086850968510685116851268513685146851568516685176851868519685206852168522685236852468525685266852768528685296853068531685326853368534685356853668537685386853968540685416854268543685446854568546685476854868549685506855168552685536855468555685566855768558685596856068561685626856368564685656856668567685686856968570685716857268573685746857568576685776857868579685806858168582685836858468585685866858768588685896859068591685926859368594685956859668597685986859968600686016860268603686046860568606686076860868609686106861168612686136861468615686166861768618686196862068621686226862368624686256862668627686286862968630686316863268633686346863568636686376863868639686406864168642686436864468645686466864768648686496865068651686526865368654686556865668657686586865968660686616866268663686646866568666686676866868669686706867168672686736867468675686766867768678686796868068681686826868368684686856868668687686886868968690686916869268693686946869568696686976869868699687006870168702687036870468705687066870768708687096871068711687126871368714687156871668717687186871968720687216872268723687246872568726687276872868729687306873168732687336873468735687366873768738687396874068741687426874368744687456874668747687486874968750687516875268753687546875568756687576875868759687606876168762687636876468765687666876768768687696877068771687726877368774687756877668777687786877968780687816878268783687846878568786687876878868789687906879168792687936879468795687966879768798687996880068801688026880368804688056880668807688086880968810688116881268813688146881568816688176881868819688206882168822688236882468825688266882768828688296883068831688326883368834688356883668837688386883968840688416884268843688446884568846688476884868849688506885168852688536885468855688566885768858688596886068861688626886368864688656886668867688686886968870688716887268873688746887568876688776887868879688806888168882688836888468885688866888768888688896889068891688926889368894688956889668897688986889968900689016890268903689046890568906689076890868909689106891168912689136891468915689166891768918689196892068921689226892368924689256892668927689286892968930689316893268933689346893568936689376893868939689406894168942689436894468945689466894768948689496895068951689526895368954689556895668957689586895968960689616896268963689646896568966689676896868969689706897168972689736897468975689766897768978689796898068981689826898368984689856898668987689886898968990689916899268993689946899568996689976899868999690006900169002690036900469005690066900769008690096901069011690126901369014690156901669017690186901969020690216902269023690246902569026690276902869029690306903169032690336903469035690366903769038690396904069041690426904369044690456904669047690486904969050690516905269053690546905569056690576905869059690606906169062690636906469065690666906769068690696907069071690726907369074690756907669077690786907969080690816908269083690846908569086690876908869089690906909169092690936909469095690966909769098690996910069101691026910369104691056910669107691086910969110691116911269113691146911569116691176911869119691206912169122691236912469125691266912769128691296913069131691326913369134691356913669137691386913969140691416914269143691446914569146691476914869149691506915169152691536915469155691566915769158691596916069161691626916369164691656916669167691686916969170691716917269173691746917569176691776917869179691806918169182691836918469185691866918769188691896919069191691926919369194691956919669197691986919969200692016920269203692046920569206692076920869209692106921169212692136921469215692166921769218692196922069221692226922369224692256922669227692286922969230692316923269233692346923569236692376923869239692406924169242692436924469245692466924769248692496925069251692526925369254692556925669257692586925969260692616926269263692646926569266692676926869269692706927169272692736927469275692766927769278692796928069281692826928369284692856928669287692886928969290692916929269293692946929569296692976929869299693006930169302693036930469305693066930769308693096931069311693126931369314693156931669317693186931969320693216932269323693246932569326693276932869329693306933169332693336933469335693366933769338693396934069341693426934369344693456934669347693486934969350693516935269353693546935569356693576935869359693606936169362693636936469365693666936769368693696937069371693726937369374693756937669377693786937969380693816938269383693846938569386693876938869389693906939169392693936939469395693966939769398693996940069401694026940369404694056940669407694086940969410694116941269413694146941569416694176941869419694206942169422694236942469425694266942769428694296943069431694326943369434694356943669437694386943969440694416944269443694446944569446694476944869449694506945169452694536945469455694566945769458694596946069461694626946369464694656946669467694686946969470694716947269473694746947569476694776947869479694806948169482694836948469485694866948769488694896949069491694926949369494694956949669497694986949969500695016950269503695046950569506695076950869509695106951169512695136951469515695166951769518695196952069521695226952369524695256952669527695286952969530695316953269533695346953569536695376953869539695406954169542695436954469545695466954769548695496955069551695526955369554695556955669557695586955969560695616956269563695646956569566695676956869569695706957169572695736957469575695766957769578695796958069581695826958369584695856958669587695886958969590695916959269593695946959569596695976959869599696006960169602696036960469605696066960769608696096961069611696126961369614696156961669617696186961969620696216962269623696246962569626696276962869629696306963169632696336963469635696366963769638696396964069641696426964369644696456964669647696486964969650696516965269653696546965569656696576965869659696606966169662696636966469665696666966769668696696967069671696726967369674696756967669677696786967969680696816968269683696846968569686696876968869689696906969169692696936969469695696966969769698696996970069701697026970369704697056970669707697086970969710697116971269713697146971569716697176971869719697206972169722697236972469725697266972769728697296973069731697326973369734697356973669737697386973969740697416974269743697446974569746697476974869749697506975169752697536975469755697566975769758697596976069761697626976369764697656976669767697686976969770697716977269773697746977569776697776977869779697806978169782697836978469785697866978769788697896979069791697926979369794697956979669797697986979969800698016980269803698046980569806698076980869809698106981169812698136981469815698166981769818698196982069821698226982369824698256982669827698286982969830698316983269833698346983569836698376983869839698406984169842698436984469845698466984769848698496985069851698526985369854698556985669857698586985969860698616986269863698646986569866698676986869869698706987169872698736987469875698766987769878698796988069881698826988369884698856988669887698886988969890698916989269893698946989569896698976989869899699006990169902699036990469905699066990769908699096991069911699126991369914699156991669917699186991969920699216992269923699246992569926699276992869929699306993169932699336993469935699366993769938699396994069941699426994369944699456994669947699486994969950699516995269953699546995569956699576995869959699606996169962699636996469965699666996769968699696997069971699726997369974699756997669977699786997969980699816998269983699846998569986699876998869989699906999169992699936999469995699966999769998699997000070001700027000370004700057000670007700087000970010700117001270013700147001570016700177001870019700207002170022700237002470025700267002770028700297003070031700327003370034700357003670037700387003970040700417004270043700447004570046700477004870049700507005170052700537005470055700567005770058700597006070061700627006370064700657006670067700687006970070700717007270073700747007570076700777007870079700807008170082700837008470085700867008770088700897009070091700927009370094700957009670097700987009970100701017010270103701047010570106701077010870109701107011170112701137011470115701167011770118701197012070121701227012370124701257012670127701287012970130701317013270133701347013570136701377013870139701407014170142701437014470145701467014770148701497015070151701527015370154701557015670157701587015970160701617016270163701647016570166701677016870169701707017170172701737017470175701767017770178701797018070181701827018370184701857018670187701887018970190701917019270193701947019570196701977019870199702007020170202702037020470205702067020770208702097021070211702127021370214702157021670217702187021970220702217022270223702247022570226702277022870229702307023170232702337023470235702367023770238702397024070241702427024370244702457024670247702487024970250702517025270253702547025570256702577025870259702607026170262702637026470265702667026770268702697027070271702727027370274702757027670277702787027970280702817028270283702847028570286702877028870289702907029170292702937029470295702967029770298702997030070301703027030370304703057030670307703087030970310703117031270313703147031570316703177031870319703207032170322703237032470325703267032770328703297033070331703327033370334703357033670337703387033970340703417034270343703447034570346703477034870349703507035170352703537035470355703567035770358703597036070361703627036370364703657036670367703687036970370703717037270373703747037570376703777037870379703807038170382703837038470385703867038770388703897039070391703927039370394703957039670397703987039970400704017040270403704047040570406704077040870409704107041170412704137041470415704167041770418704197042070421704227042370424704257042670427704287042970430704317043270433704347043570436704377043870439704407044170442704437044470445704467044770448704497045070451704527045370454704557045670457704587045970460704617046270463704647046570466704677046870469704707047170472704737047470475704767047770478704797048070481704827048370484704857048670487704887048970490704917049270493704947049570496704977049870499705007050170502705037050470505705067050770508705097051070511705127051370514705157051670517705187051970520705217052270523705247052570526705277052870529705307053170532705337053470535705367053770538705397054070541705427054370544705457054670547705487054970550705517055270553705547055570556705577055870559705607056170562705637056470565705667056770568705697057070571705727057370574705757057670577705787057970580705817058270583705847058570586705877058870589705907059170592705937059470595705967059770598705997060070601706027060370604706057060670607706087060970610706117061270613706147061570616706177061870619706207062170622706237062470625706267062770628706297063070631706327063370634706357063670637706387063970640706417064270643706447064570646706477064870649706507065170652706537065470655706567065770658706597066070661706627066370664706657066670667706687066970670706717067270673706747067570676706777067870679706807068170682706837068470685706867068770688706897069070691706927069370694706957069670697706987069970700707017070270703707047070570706707077070870709707107071170712707137071470715707167071770718707197072070721707227072370724707257072670727707287072970730707317073270733707347073570736707377073870739707407074170742707437074470745707467074770748707497075070751707527075370754707557075670757707587075970760707617076270763707647076570766707677076870769707707077170772707737077470775707767077770778707797078070781707827078370784707857078670787707887078970790707917079270793707947079570796707977079870799708007080170802708037080470805708067080770808708097081070811708127081370814708157081670817708187081970820708217082270823708247082570826708277082870829708307083170832708337083470835708367083770838708397084070841708427084370844708457084670847708487084970850708517085270853708547085570856708577085870859708607086170862708637086470865708667086770868708697087070871708727087370874708757087670877708787087970880708817088270883708847088570886708877088870889708907089170892708937089470895708967089770898708997090070901709027090370904709057090670907709087090970910709117091270913709147091570916709177091870919709207092170922709237092470925709267092770928709297093070931709327093370934709357093670937709387093970940709417094270943709447094570946709477094870949709507095170952709537095470955709567095770958709597096070961709627096370964709657096670967709687096970970709717097270973709747097570976709777097870979709807098170982709837098470985709867098770988709897099070991709927099370994709957099670997709987099971000710017100271003710047100571006710077100871009710107101171012710137101471015710167101771018710197102071021710227102371024710257102671027710287102971030710317103271033710347103571036710377103871039710407104171042710437104471045710467104771048710497105071051710527105371054710557105671057710587105971060710617106271063710647106571066710677106871069710707107171072710737107471075710767107771078710797108071081710827108371084710857108671087710887108971090710917109271093710947109571096710977109871099711007110171102711037110471105711067110771108711097111071111711127111371114711157111671117711187111971120711217112271123711247112571126711277112871129711307113171132711337113471135711367113771138711397114071141711427114371144711457114671147711487114971150711517115271153711547115571156711577115871159711607116171162711637116471165711667116771168711697117071171711727117371174711757117671177711787117971180711817118271183711847118571186711877118871189711907119171192711937119471195711967119771198711997120071201712027120371204712057120671207712087120971210712117121271213712147121571216712177121871219712207122171222712237122471225712267122771228712297123071231712327123371234712357123671237712387123971240712417124271243712447124571246712477124871249712507125171252712537125471255712567125771258712597126071261712627126371264712657126671267712687126971270712717127271273712747127571276712777127871279712807128171282712837128471285712867128771288712897129071291712927129371294712957129671297712987129971300713017130271303713047130571306713077130871309713107131171312713137131471315713167131771318713197132071321713227132371324713257132671327713287132971330713317133271333713347133571336713377133871339713407134171342713437134471345713467134771348713497135071351713527135371354713557135671357713587135971360713617136271363713647136571366713677136871369713707137171372713737137471375713767137771378713797138071381713827138371384713857138671387713887138971390713917139271393713947139571396713977139871399714007140171402714037140471405714067140771408714097141071411714127141371414714157141671417714187141971420714217142271423714247142571426714277142871429714307143171432714337143471435714367143771438714397144071441714427144371444714457144671447714487144971450714517145271453714547145571456714577145871459714607146171462714637146471465714667146771468714697147071471714727147371474714757147671477714787147971480714817148271483714847148571486714877148871489714907149171492714937149471495714967149771498714997150071501715027150371504715057150671507715087150971510715117151271513715147151571516715177151871519715207152171522715237152471525715267152771528715297153071531715327153371534715357153671537715387153971540715417154271543715447154571546715477154871549715507155171552715537155471555715567155771558715597156071561715627156371564715657156671567715687156971570715717157271573715747157571576715777157871579715807158171582715837158471585715867158771588715897159071591715927159371594715957159671597715987159971600716017160271603716047160571606716077160871609716107161171612716137161471615716167161771618716197162071621716227162371624716257162671627716287162971630716317163271633716347163571636716377163871639716407164171642716437164471645716467164771648716497165071651716527165371654716557165671657716587165971660716617166271663716647166571666716677166871669716707167171672716737167471675716767167771678716797168071681716827168371684716857168671687716887168971690716917169271693716947169571696716977169871699717007170171702717037170471705717067170771708717097171071711717127171371714717157171671717717187171971720717217172271723717247172571726717277172871729717307173171732717337173471735717367173771738717397174071741717427174371744717457174671747717487174971750717517175271753717547175571756717577175871759717607176171762717637176471765717667176771768717697177071771717727177371774717757177671777717787177971780717817178271783717847178571786717877178871789717907179171792717937179471795717967179771798717997180071801718027180371804718057180671807718087180971810718117181271813718147181571816718177181871819718207182171822718237182471825718267182771828718297183071831718327183371834718357183671837718387183971840718417184271843718447184571846718477184871849718507185171852718537185471855718567185771858718597186071861718627186371864718657186671867718687186971870718717187271873718747187571876718777187871879718807188171882718837188471885718867188771888718897189071891718927189371894718957189671897718987189971900719017190271903719047190571906719077190871909719107191171912719137191471915719167191771918719197192071921719227192371924719257192671927719287192971930719317193271933719347193571936719377193871939719407194171942719437194471945719467194771948719497195071951719527195371954719557195671957719587195971960719617196271963719647196571966719677196871969719707197171972719737197471975719767197771978719797198071981719827198371984719857198671987719887198971990719917199271993719947199571996719977199871999720007200172002720037200472005720067200772008720097201072011720127201372014720157201672017720187201972020720217202272023720247202572026720277202872029720307203172032720337203472035720367203772038720397204072041720427204372044720457204672047720487204972050720517205272053720547205572056720577205872059720607206172062720637206472065720667206772068720697207072071720727207372074720757207672077720787207972080720817208272083720847208572086720877208872089720907209172092720937209472095720967209772098720997210072101721027210372104721057210672107721087210972110721117211272113721147211572116721177211872119721207212172122721237212472125721267212772128721297213072131721327213372134721357213672137721387213972140721417214272143721447214572146721477214872149721507215172152721537215472155721567215772158721597216072161721627216372164721657216672167721687216972170721717217272173721747217572176721777217872179721807218172182721837218472185721867218772188721897219072191721927219372194721957219672197721987219972200722017220272203722047220572206722077220872209722107221172212722137221472215722167221772218722197222072221722227222372224722257222672227722287222972230722317223272233722347223572236722377223872239722407224172242722437224472245722467224772248722497225072251722527225372254722557225672257722587225972260722617226272263722647226572266722677226872269722707227172272722737227472275722767227772278722797228072281722827228372284722857228672287722887228972290722917229272293722947229572296722977229872299723007230172302723037230472305723067230772308723097231072311723127231372314723157231672317723187231972320723217232272323723247232572326723277232872329723307233172332723337233472335723367233772338723397234072341723427234372344723457234672347723487234972350723517235272353723547235572356723577235872359723607236172362723637236472365723667236772368723697237072371723727237372374723757237672377723787237972380723817238272383723847238572386723877238872389723907239172392723937239472395723967239772398723997240072401724027240372404724057240672407724087240972410724117241272413724147241572416724177241872419724207242172422724237242472425724267242772428724297243072431724327243372434724357243672437724387243972440724417244272443724447244572446724477244872449724507245172452724537245472455724567245772458724597246072461724627246372464724657246672467724687246972470724717247272473724747247572476724777247872479724807248172482724837248472485724867248772488724897249072491724927249372494724957249672497724987249972500725017250272503725047250572506725077250872509725107251172512725137251472515725167251772518725197252072521725227252372524725257252672527725287252972530725317253272533725347253572536725377253872539725407254172542725437254472545725467254772548725497255072551725527255372554725557255672557725587255972560725617256272563725647256572566725677256872569725707257172572725737257472575725767257772578725797258072581725827258372584725857258672587725887258972590725917259272593725947259572596725977259872599726007260172602726037260472605726067260772608726097261072611726127261372614726157261672617726187261972620726217262272623726247262572626726277262872629726307263172632726337263472635726367263772638726397264072641726427264372644726457264672647726487264972650726517265272653726547265572656726577265872659726607266172662726637266472665726667266772668726697267072671726727267372674726757267672677726787267972680726817268272683726847268572686726877268872689726907269172692726937269472695726967269772698726997270072701727027270372704727057270672707727087270972710727117271272713727147271572716727177271872719727207272172722727237272472725727267272772728727297273072731727327273372734727357273672737727387273972740727417274272743727447274572746727477274872749727507275172752727537275472755727567275772758727597276072761727627276372764727657276672767727687276972770727717277272773727747277572776727777277872779727807278172782727837278472785727867278772788727897279072791727927279372794727957279672797727987279972800728017280272803728047280572806728077280872809728107281172812728137281472815728167281772818728197282072821728227282372824728257282672827728287282972830728317283272833728347283572836728377283872839728407284172842728437284472845728467284772848728497285072851728527285372854728557285672857728587285972860728617286272863728647286572866728677286872869728707287172872728737287472875728767287772878728797288072881728827288372884728857288672887728887288972890728917289272893728947289572896728977289872899729007290172902729037290472905729067290772908729097291072911729127291372914729157291672917729187291972920729217292272923729247292572926729277292872929729307293172932729337293472935729367293772938729397294072941729427294372944729457294672947729487294972950729517295272953729547295572956729577295872959729607296172962729637296472965729667296772968729697297072971729727297372974729757297672977729787297972980729817298272983729847298572986729877298872989729907299172992729937299472995729967299772998729997300073001730027300373004730057300673007730087300973010730117301273013730147301573016730177301873019730207302173022730237302473025730267302773028730297303073031730327303373034730357303673037730387303973040730417304273043730447304573046730477304873049730507305173052730537305473055730567305773058730597306073061730627306373064730657306673067730687306973070730717307273073730747307573076730777307873079730807308173082730837308473085730867308773088730897309073091730927309373094730957309673097730987309973100731017310273103731047310573106731077310873109731107311173112731137311473115731167311773118731197312073121731227312373124731257312673127731287312973130731317313273133731347313573136731377313873139731407314173142731437314473145731467314773148731497315073151731527315373154731557315673157731587315973160731617316273163731647316573166731677316873169731707317173172731737317473175731767317773178731797318073181731827318373184731857318673187731887318973190731917319273193731947319573196731977319873199732007320173202732037320473205732067320773208732097321073211732127321373214732157321673217732187321973220732217322273223732247322573226732277322873229732307323173232732337323473235732367323773238732397324073241732427324373244732457324673247732487324973250732517325273253732547325573256732577325873259732607326173262732637326473265732667326773268732697327073271732727327373274732757327673277732787327973280732817328273283732847328573286732877328873289732907329173292732937329473295732967329773298732997330073301733027330373304733057330673307733087330973310733117331273313733147331573316733177331873319733207332173322733237332473325733267332773328733297333073331733327333373334733357333673337733387333973340733417334273343733447334573346733477334873349733507335173352733537335473355733567335773358733597336073361733627336373364733657336673367733687336973370733717337273373733747337573376733777337873379733807338173382733837338473385733867338773388733897339073391733927339373394733957339673397733987339973400734017340273403734047340573406734077340873409734107341173412734137341473415734167341773418734197342073421734227342373424734257342673427734287342973430734317343273433734347343573436734377343873439734407344173442734437344473445734467344773448734497345073451734527345373454734557345673457734587345973460734617346273463734647346573466734677346873469734707347173472734737347473475734767347773478734797348073481734827348373484734857348673487734887348973490734917349273493734947349573496734977349873499735007350173502735037350473505735067350773508735097351073511735127351373514735157351673517735187351973520735217352273523735247352573526735277352873529735307353173532735337353473535735367353773538735397354073541735427354373544735457354673547735487354973550735517355273553735547355573556735577355873559735607356173562735637356473565735667356773568735697357073571735727357373574735757357673577735787357973580735817358273583735847358573586735877358873589735907359173592735937359473595735967359773598735997360073601736027360373604736057360673607736087360973610736117361273613736147361573616736177361873619736207362173622736237362473625736267362773628736297363073631736327363373634736357363673637736387363973640736417364273643736447364573646736477364873649736507365173652736537365473655736567365773658736597366073661736627366373664736657366673667736687366973670736717367273673736747367573676736777367873679736807368173682736837368473685736867368773688736897369073691736927369373694736957369673697736987369973700737017370273703737047370573706737077370873709737107371173712737137371473715737167371773718737197372073721737227372373724737257372673727737287372973730737317373273733737347373573736737377373873739737407374173742737437374473745737467374773748737497375073751737527375373754737557375673757737587375973760737617376273763737647376573766737677376873769737707377173772737737377473775737767377773778737797378073781737827378373784737857378673787737887378973790737917379273793737947379573796737977379873799738007380173802738037380473805738067380773808738097381073811738127381373814738157381673817738187381973820738217382273823738247382573826738277382873829738307383173832738337383473835738367383773838738397384073841738427384373844738457384673847738487384973850738517385273853738547385573856738577385873859738607386173862738637386473865738667386773868738697387073871738727387373874738757387673877738787387973880738817388273883738847388573886738877388873889738907389173892738937389473895738967389773898738997390073901739027390373904739057390673907739087390973910739117391273913739147391573916739177391873919739207392173922739237392473925739267392773928739297393073931739327393373934739357393673937739387393973940739417394273943739447394573946739477394873949739507395173952739537395473955739567395773958739597396073961739627396373964739657396673967739687396973970739717397273973739747397573976739777397873979739807398173982739837398473985739867398773988739897399073991739927399373994739957399673997739987399974000740017400274003740047400574006740077400874009740107401174012740137401474015740167401774018740197402074021740227402374024740257402674027740287402974030740317403274033740347403574036740377403874039740407404174042740437404474045740467404774048740497405074051740527405374054740557405674057740587405974060740617406274063740647406574066740677406874069740707407174072740737407474075740767407774078740797408074081740827408374084740857408674087740887408974090740917409274093740947409574096740977409874099741007410174102741037410474105741067410774108741097411074111741127411374114741157411674117741187411974120741217412274123741247412574126741277412874129741307413174132741337413474135741367413774138741397414074141741427414374144741457414674147741487414974150741517415274153741547415574156741577415874159741607416174162741637416474165741667416774168741697417074171741727417374174741757417674177741787417974180741817418274183741847418574186741877418874189741907419174192741937419474195741967419774198741997420074201742027420374204742057420674207742087420974210742117421274213742147421574216742177421874219742207422174222742237422474225742267422774228742297423074231742327423374234742357423674237742387423974240742417424274243742447424574246742477424874249742507425174252742537425474255742567425774258742597426074261742627426374264742657426674267742687426974270742717427274273742747427574276742777427874279742807428174282742837428474285742867428774288742897429074291742927429374294742957429674297742987429974300743017430274303743047430574306743077430874309743107431174312743137431474315743167431774318743197432074321743227432374324743257432674327743287432974330743317433274333743347433574336743377433874339743407434174342743437434474345743467434774348743497435074351743527435374354743557435674357743587435974360743617436274363743647436574366743677436874369743707437174372743737437474375743767437774378743797438074381743827438374384743857438674387743887438974390743917439274393743947439574396743977439874399744007440174402744037440474405744067440774408744097441074411744127441374414744157441674417744187441974420744217442274423744247442574426744277442874429744307443174432744337443474435744367443774438744397444074441744427444374444744457444674447744487444974450744517445274453744547445574456744577445874459744607446174462744637446474465744667446774468744697447074471744727447374474744757447674477744787447974480744817448274483744847448574486744877448874489744907449174492744937449474495744967449774498744997450074501745027450374504745057450674507745087450974510745117451274513745147451574516745177451874519745207452174522745237452474525745267452774528745297453074531745327453374534745357453674537745387453974540745417454274543745447454574546745477454874549745507455174552745537455474555745567455774558745597456074561745627456374564745657456674567745687456974570745717457274573745747457574576745777457874579745807458174582745837458474585745867458774588745897459074591745927459374594745957459674597745987459974600746017460274603746047460574606746077460874609746107461174612746137461474615746167461774618746197462074621746227462374624746257462674627746287462974630746317463274633746347463574636746377463874639746407464174642746437464474645746467464774648746497465074651746527465374654746557465674657746587465974660746617466274663746647466574666746677466874669746707467174672746737467474675746767467774678746797468074681746827468374684746857468674687746887468974690746917469274693746947469574696746977469874699747007470174702747037470474705747067470774708747097471074711747127471374714747157471674717747187471974720747217472274723747247472574726747277472874729747307473174732747337473474735747367473774738747397474074741747427474374744747457474674747747487474974750747517475274753747547475574756747577475874759747607476174762747637476474765747667476774768747697477074771747727477374774747757477674777747787477974780747817478274783747847478574786747877478874789747907479174792747937479474795747967479774798747997480074801748027480374804748057480674807748087480974810748117481274813748147481574816748177481874819748207482174822748237482474825748267482774828748297483074831748327483374834748357483674837748387483974840748417484274843748447484574846748477484874849748507485174852748537485474855748567485774858748597486074861748627486374864748657486674867748687486974870748717487274873748747487574876748777487874879748807488174882748837488474885748867488774888748897489074891748927489374894748957489674897748987489974900749017490274903749047490574906749077490874909749107491174912749137491474915749167491774918749197492074921749227492374924749257492674927749287492974930749317493274933749347493574936749377493874939749407494174942749437494474945749467494774948749497495074951749527495374954749557495674957749587495974960749617496274963749647496574966749677496874969749707497174972749737497474975749767497774978749797498074981749827498374984749857498674987749887498974990749917499274993749947499574996749977499874999750007500175002750037500475005750067500775008750097501075011750127501375014750157501675017750187501975020750217502275023750247502575026750277502875029750307503175032750337503475035750367503775038750397504075041750427504375044750457504675047750487504975050750517505275053750547505575056750577505875059750607506175062750637506475065750667506775068750697507075071750727507375074750757507675077750787507975080750817508275083750847508575086750877508875089750907509175092750937509475095750967509775098750997510075101751027510375104751057510675107751087510975110751117511275113751147511575116751177511875119751207512175122751237512475125751267512775128751297513075131751327513375134751357513675137751387513975140751417514275143751447514575146751477514875149751507515175152751537515475155751567515775158751597516075161751627516375164751657516675167751687516975170751717517275173751747517575176751777517875179751807518175182751837518475185751867518775188751897519075191751927519375194751957519675197751987519975200752017520275203752047520575206752077520875209752107521175212752137521475215752167521775218752197522075221752227522375224752257522675227752287522975230752317523275233752347523575236752377523875239752407524175242752437524475245752467524775248752497525075251752527525375254752557525675257752587525975260752617526275263752647526575266752677526875269752707527175272752737527475275752767527775278752797528075281752827528375284752857528675287752887528975290752917529275293752947529575296752977529875299753007530175302753037530475305753067530775308753097531075311753127531375314753157531675317753187531975320753217532275323753247532575326753277532875329753307533175332753337533475335753367533775338753397534075341753427534375344753457534675347753487534975350753517535275353753547535575356753577535875359753607536175362753637536475365753667536775368753697537075371753727537375374753757537675377753787537975380753817538275383753847538575386753877538875389753907539175392753937539475395753967539775398753997540075401754027540375404754057540675407754087540975410754117541275413754147541575416754177541875419754207542175422754237542475425754267542775428754297543075431754327543375434754357543675437754387543975440754417544275443754447544575446754477544875449754507545175452754537545475455754567545775458754597546075461754627546375464754657546675467754687546975470754717547275473754747547575476754777547875479754807548175482754837548475485754867548775488754897549075491754927549375494754957549675497754987549975500755017550275503755047550575506755077550875509755107551175512755137551475515755167551775518755197552075521755227552375524755257552675527755287552975530755317553275533755347553575536755377553875539755407554175542755437554475545755467554775548755497555075551755527555375554755557555675557755587555975560755617556275563755647556575566755677556875569755707557175572755737557475575755767557775578755797558075581755827558375584755857558675587755887558975590755917559275593755947559575596755977559875599756007560175602756037560475605756067560775608756097561075611756127561375614756157561675617756187561975620756217562275623756247562575626756277562875629756307563175632756337563475635756367563775638756397564075641756427564375644756457564675647756487564975650756517565275653756547565575656756577565875659756607566175662756637566475665756667566775668756697567075671756727567375674756757567675677756787567975680756817568275683756847568575686756877568875689756907569175692756937569475695756967569775698756997570075701757027570375704757057570675707757087570975710757117571275713757147571575716757177571875719757207572175722757237572475725757267572775728757297573075731757327573375734757357573675737757387573975740757417574275743757447574575746757477574875749757507575175752757537575475755757567575775758757597576075761757627576375764757657576675767757687576975770757717577275773757747577575776757777577875779757807578175782757837578475785757867578775788757897579075791757927579375794757957579675797757987579975800758017580275803758047580575806758077580875809758107581175812758137581475815758167581775818758197582075821758227582375824758257582675827758287582975830758317583275833758347583575836758377583875839758407584175842758437584475845758467584775848758497585075851758527585375854758557585675857758587585975860758617586275863758647586575866758677586875869758707587175872758737587475875758767587775878758797588075881758827588375884758857588675887758887588975890758917589275893758947589575896758977589875899759007590175902759037590475905759067590775908759097591075911759127591375914759157591675917759187591975920759217592275923759247592575926759277592875929759307593175932759337593475935759367593775938759397594075941759427594375944759457594675947759487594975950759517595275953759547595575956759577595875959759607596175962759637596475965759667596775968759697597075971759727597375974759757597675977759787597975980759817598275983759847598575986759877598875989759907599175992759937599475995759967599775998759997600076001760027600376004760057600676007760087600976010760117601276013760147601576016760177601876019760207602176022760237602476025760267602776028760297603076031760327603376034760357603676037760387603976040760417604276043760447604576046760477604876049760507605176052760537605476055760567605776058760597606076061760627606376064760657606676067760687606976070760717607276073760747607576076760777607876079760807608176082760837608476085760867608776088760897609076091760927609376094760957609676097760987609976100761017610276103761047610576106761077610876109761107611176112761137611476115761167611776118761197612076121761227612376124761257612676127761287612976130761317613276133761347613576136761377613876139761407614176142761437614476145761467614776148761497615076151761527615376154761557615676157761587615976160761617616276163761647616576166761677616876169761707617176172761737617476175761767617776178761797618076181761827618376184761857618676187761887618976190761917619276193761947619576196761977619876199762007620176202762037620476205762067620776208762097621076211762127621376214762157621676217762187621976220762217622276223762247622576226762277622876229762307623176232762337623476235762367623776238762397624076241762427624376244762457624676247762487624976250762517625276253762547625576256762577625876259762607626176262762637626476265762667626776268762697627076271762727627376274762757627676277762787627976280762817628276283762847628576286762877628876289762907629176292762937629476295762967629776298762997630076301763027630376304763057630676307763087630976310763117631276313763147631576316763177631876319763207632176322763237632476325763267632776328763297633076331763327633376334763357633676337763387633976340763417634276343763447634576346763477634876349763507635176352763537635476355763567635776358763597636076361763627636376364763657636676367763687636976370763717637276373763747637576376763777637876379763807638176382763837638476385763867638776388763897639076391763927639376394763957639676397763987639976400764017640276403764047640576406764077640876409764107641176412764137641476415764167641776418764197642076421764227642376424764257642676427764287642976430764317643276433764347643576436764377643876439764407644176442764437644476445764467644776448764497645076451764527645376454764557645676457764587645976460764617646276463764647646576466764677646876469764707647176472764737647476475764767647776478764797648076481764827648376484764857648676487764887648976490764917649276493764947649576496764977649876499765007650176502765037650476505765067650776508765097651076511765127651376514765157651676517765187651976520765217652276523765247652576526765277652876529765307653176532765337653476535765367653776538765397654076541765427654376544765457654676547765487654976550765517655276553765547655576556765577655876559765607656176562765637656476565765667656776568765697657076571765727657376574765757657676577765787657976580765817658276583765847658576586765877658876589765907659176592765937659476595765967659776598765997660076601766027660376604766057660676607766087660976610766117661276613766147661576616766177661876619766207662176622766237662476625766267662776628766297663076631766327663376634766357663676637766387663976640766417664276643766447664576646766477664876649766507665176652766537665476655766567665776658766597666076661766627666376664766657666676667766687666976670766717667276673766747667576676766777667876679766807668176682766837668476685766867668776688766897669076691766927669376694766957669676697766987669976700767017670276703767047670576706767077670876709767107671176712767137671476715767167671776718767197672076721767227672376724767257672676727767287672976730767317673276733767347673576736767377673876739767407674176742767437674476745767467674776748767497675076751767527675376754767557675676757767587675976760767617676276763767647676576766767677676876769767707677176772767737677476775767767677776778767797678076781767827678376784767857678676787767887678976790767917679276793767947679576796767977679876799768007680176802768037680476805768067680776808768097681076811768127681376814768157681676817768187681976820768217682276823768247682576826768277682876829768307683176832768337683476835768367683776838768397684076841768427684376844768457684676847768487684976850768517685276853768547685576856768577685876859768607686176862768637686476865768667686776868768697687076871768727687376874768757687676877768787687976880768817688276883768847688576886768877688876889768907689176892768937689476895768967689776898768997690076901769027690376904769057690676907769087690976910769117691276913769147691576916769177691876919769207692176922769237692476925769267692776928769297693076931769327693376934769357693676937769387693976940769417694276943769447694576946769477694876949769507695176952769537695476955769567695776958769597696076961769627696376964769657696676967769687696976970769717697276973769747697576976769777697876979769807698176982769837698476985769867698776988769897699076991769927699376994769957699676997769987699977000770017700277003770047700577006770077700877009770107701177012770137701477015770167701777018770197702077021770227702377024770257702677027770287702977030770317703277033770347703577036770377703877039770407704177042770437704477045770467704777048770497705077051770527705377054770557705677057770587705977060770617706277063770647706577066770677706877069770707707177072770737707477075770767707777078770797708077081770827708377084770857708677087770887708977090770917709277093770947709577096770977709877099771007710177102771037710477105771067710777108771097711077111771127711377114771157711677117771187711977120771217712277123771247712577126771277712877129771307713177132771337713477135771367713777138771397714077141771427714377144771457714677147771487714977150771517715277153771547715577156771577715877159771607716177162771637716477165771667716777168771697717077171771727717377174771757717677177771787717977180771817718277183771847718577186771877718877189771907719177192771937719477195771967719777198771997720077201772027720377204772057720677207772087720977210772117721277213772147721577216772177721877219772207722177222772237722477225772267722777228772297723077231772327723377234772357723677237772387723977240772417724277243772447724577246772477724877249772507725177252772537725477255772567725777258772597726077261772627726377264772657726677267772687726977270772717727277273772747727577276772777727877279772807728177282772837728477285772867728777288772897729077291772927729377294772957729677297772987729977300773017730277303773047730577306773077730877309773107731177312773137731477315773167731777318773197732077321773227732377324773257732677327773287732977330773317733277333773347733577336773377733877339773407734177342773437734477345773467734777348773497735077351773527735377354773557735677357773587735977360773617736277363773647736577366773677736877369773707737177372773737737477375773767737777378773797738077381773827738377384773857738677387773887738977390773917739277393773947739577396773977739877399774007740177402774037740477405774067740777408774097741077411774127741377414774157741677417774187741977420774217742277423774247742577426774277742877429774307743177432774337743477435774367743777438774397744077441774427744377444774457744677447774487744977450774517745277453774547745577456774577745877459774607746177462774637746477465774667746777468774697747077471774727747377474774757747677477774787747977480774817748277483774847748577486774877748877489774907749177492774937749477495774967749777498774997750077501775027750377504775057750677507775087750977510775117751277513775147751577516775177751877519775207752177522775237752477525775267752777528775297753077531775327753377534775357753677537775387753977540775417754277543775447754577546775477754877549775507755177552775537755477555775567755777558775597756077561775627756377564775657756677567775687756977570775717757277573775747757577576775777757877579775807758177582775837758477585775867758777588775897759077591775927759377594775957759677597775987759977600776017760277603776047760577606776077760877609776107761177612776137761477615776167761777618776197762077621776227762377624776257762677627776287762977630776317763277633776347763577636776377763877639776407764177642776437764477645776467764777648776497765077651776527765377654776557765677657776587765977660776617766277663776647766577666776677766877669776707767177672776737767477675776767767777678776797768077681776827768377684776857768677687776887768977690776917769277693776947769577696776977769877699777007770177702777037770477705777067770777708777097771077711777127771377714777157771677717777187771977720777217772277723777247772577726777277772877729777307773177732777337773477735777367773777738777397774077741777427774377744777457774677747777487774977750777517775277753777547775577756777577775877759777607776177762777637776477765777667776777768777697777077771777727777377774777757777677777777787777977780777817778277783777847778577786777877778877789777907779177792777937779477795777967779777798777997780077801778027780377804778057780677807778087780977810778117781277813778147781577816778177781877819778207782177822778237782477825778267782777828778297783077831778327783377834778357783677837778387783977840778417784277843778447784577846778477784877849778507785177852778537785477855778567785777858778597786077861778627786377864778657786677867778687786977870778717787277873778747787577876778777787877879778807788177882778837788477885778867788777888778897789077891778927789377894778957789677897778987789977900779017790277903779047790577906779077790877909779107791177912779137791477915779167791777918779197792077921779227792377924779257792677927779287792977930779317793277933779347793577936779377793877939779407794177942779437794477945779467794777948779497795077951779527795377954779557795677957779587795977960779617796277963779647796577966779677796877969779707797177972779737797477975779767797777978779797798077981779827798377984779857798677987779887798977990779917799277993779947799577996779977799877999780007800178002780037800478005780067800778008780097801078011780127801378014780157801678017780187801978020780217802278023780247802578026780277802878029780307803178032780337803478035780367803778038780397804078041780427804378044780457804678047780487804978050780517805278053780547805578056780577805878059780607806178062780637806478065780667806778068780697807078071780727807378074780757807678077780787807978080780817808278083780847808578086780877808878089780907809178092780937809478095780967809778098780997810078101781027810378104781057810678107781087810978110781117811278113781147811578116781177811878119781207812178122781237812478125781267812778128781297813078131781327813378134781357813678137781387813978140781417814278143781447814578146781477814878149781507815178152781537815478155781567815778158781597816078161781627816378164781657816678167781687816978170781717817278173781747817578176781777817878179781807818178182781837818478185781867818778188781897819078191781927819378194781957819678197781987819978200782017820278203782047820578206782077820878209782107821178212782137821478215782167821778218782197822078221782227822378224782257822678227782287822978230782317823278233782347823578236782377823878239782407824178242782437824478245782467824778248782497825078251782527825378254782557825678257782587825978260782617826278263782647826578266782677826878269782707827178272782737827478275782767827778278782797828078281782827828378284782857828678287782887828978290782917829278293782947829578296782977829878299783007830178302783037830478305783067830778308783097831078311783127831378314783157831678317783187831978320783217832278323783247832578326783277832878329783307833178332783337833478335783367833778338783397834078341783427834378344783457834678347783487834978350783517835278353783547835578356783577835878359783607836178362783637836478365783667836778368783697837078371783727837378374783757837678377783787837978380783817838278383783847838578386783877838878389783907839178392783937839478395783967839778398783997840078401784027840378404784057840678407784087840978410784117841278413784147841578416784177841878419784207842178422784237842478425784267842778428784297843078431784327843378434784357843678437784387843978440784417844278443784447844578446784477844878449784507845178452784537845478455784567845778458784597846078461784627846378464784657846678467784687846978470784717847278473784747847578476784777847878479784807848178482784837848478485784867848778488784897849078491784927849378494784957849678497784987849978500785017850278503785047850578506785077850878509785107851178512785137851478515785167851778518785197852078521785227852378524785257852678527785287852978530785317853278533785347853578536785377853878539785407854178542785437854478545785467854778548785497855078551785527855378554785557855678557785587855978560785617856278563785647856578566785677856878569785707857178572785737857478575785767857778578785797858078581785827858378584785857858678587785887858978590785917859278593785947859578596785977859878599786007860178602786037860478605786067860778608786097861078611786127861378614786157861678617786187861978620786217862278623786247862578626786277862878629786307863178632786337863478635786367863778638786397864078641786427864378644786457864678647786487864978650786517865278653786547865578656786577865878659786607866178662786637866478665786667866778668786697867078671786727867378674786757867678677786787867978680786817868278683786847868578686786877868878689786907869178692786937869478695786967869778698786997870078701787027870378704787057870678707787087870978710787117871278713787147871578716787177871878719787207872178722787237872478725787267872778728787297873078731787327873378734787357873678737787387873978740787417874278743787447874578746787477874878749787507875178752787537875478755787567875778758787597876078761787627876378764787657876678767787687876978770787717877278773787747877578776787777877878779787807878178782787837878478785787867878778788787897879078791787927879378794787957879678797787987879978800788017880278803788047880578806788077880878809788107881178812788137881478815788167881778818788197882078821788227882378824788257882678827788287882978830788317883278833788347883578836788377883878839788407884178842788437884478845788467884778848788497885078851788527885378854788557885678857788587885978860788617886278863788647886578866788677886878869788707887178872788737887478875788767887778878788797888078881788827888378884788857888678887788887888978890788917889278893788947889578896788977889878899789007890178902789037890478905789067890778908789097891078911789127891378914789157891678917789187891978920789217892278923789247892578926789277892878929789307893178932789337893478935789367893778938789397894078941789427894378944789457894678947789487894978950789517895278953789547895578956789577895878959789607896178962789637896478965789667896778968789697897078971789727897378974789757897678977789787897978980789817898278983789847898578986789877898878989789907899178992789937899478995789967899778998789997900079001790027900379004790057900679007790087900979010790117901279013790147901579016790177901879019790207902179022790237902479025790267902779028790297903079031790327903379034790357903679037790387903979040790417904279043790447904579046790477904879049790507905179052790537905479055790567905779058790597906079061790627906379064790657906679067790687906979070790717907279073790747907579076790777907879079790807908179082790837908479085790867908779088790897909079091790927909379094790957909679097790987909979100791017910279103791047910579106791077910879109791107911179112791137911479115791167911779118791197912079121791227912379124791257912679127791287912979130791317913279133791347913579136791377913879139791407914179142791437914479145791467914779148791497915079151791527915379154791557915679157791587915979160791617916279163791647916579166791677916879169791707917179172791737917479175791767917779178791797918079181791827918379184791857918679187791887918979190791917919279193791947919579196791977919879199792007920179202792037920479205792067920779208792097921079211792127921379214792157921679217792187921979220792217922279223792247922579226792277922879229792307923179232792337923479235792367923779238792397924079241792427924379244792457924679247792487924979250792517925279253792547925579256792577925879259792607926179262792637926479265792667926779268792697927079271792727927379274792757927679277792787927979280792817928279283792847928579286792877928879289792907929179292792937929479295792967929779298792997930079301793027930379304793057930679307793087930979310793117931279313793147931579316793177931879319793207932179322793237932479325793267932779328793297933079331793327933379334793357933679337793387933979340793417934279343793447934579346793477934879349793507935179352793537935479355793567935779358793597936079361793627936379364793657936679367793687936979370793717937279373793747937579376793777937879379793807938179382793837938479385793867938779388793897939079391793927939379394793957939679397793987939979400794017940279403794047940579406794077940879409794107941179412794137941479415794167941779418794197942079421794227942379424794257942679427794287942979430794317943279433794347943579436794377943879439794407944179442794437944479445794467944779448794497945079451794527945379454794557945679457794587945979460794617946279463794647946579466794677946879469794707947179472794737947479475794767947779478794797948079481794827948379484794857948679487794887948979490794917949279493794947949579496794977949879499795007950179502795037950479505795067950779508795097951079511795127951379514795157951679517795187951979520795217952279523795247952579526795277952879529795307953179532795337953479535795367953779538795397954079541795427954379544795457954679547795487954979550795517955279553795547955579556795577955879559795607956179562795637956479565795667956779568795697957079571795727957379574795757957679577795787957979580795817958279583795847958579586795877958879589795907959179592795937959479595795967959779598795997960079601796027960379604796057960679607796087960979610796117961279613796147961579616796177961879619796207962179622796237962479625796267962779628796297963079631796327963379634796357963679637796387963979640796417964279643796447964579646796477964879649796507965179652796537965479655796567965779658796597966079661796627966379664796657966679667796687966979670796717967279673796747967579676796777967879679796807968179682796837968479685796867968779688796897969079691796927969379694796957969679697796987969979700797017970279703797047970579706797077970879709797107971179712797137971479715797167971779718797197972079721797227972379724797257972679727797287972979730797317973279733797347973579736797377973879739797407974179742797437974479745797467974779748797497975079751797527975379754797557975679757797587975979760797617976279763797647976579766797677976879769797707977179772797737977479775797767977779778797797978079781797827978379784797857978679787797887978979790797917979279793797947979579796797977979879799798007980179802798037980479805798067980779808798097981079811798127981379814798157981679817798187981979820798217982279823798247982579826798277982879829798307983179832798337983479835798367983779838798397984079841798427984379844798457984679847798487984979850798517985279853798547985579856798577985879859798607986179862798637986479865798667986779868798697987079871798727987379874798757987679877798787987979880798817988279883798847988579886798877988879889798907989179892798937989479895798967989779898798997990079901799027990379904799057990679907799087990979910799117991279913799147991579916799177991879919799207992179922799237992479925799267992779928799297993079931799327993379934799357993679937799387993979940799417994279943799447994579946799477994879949799507995179952799537995479955799567995779958799597996079961799627996379964799657996679967799687996979970799717997279973799747997579976799777997879979799807998179982799837998479985799867998779988799897999079991799927999379994799957999679997799987999980000800018000280003800048000580006800078000880009800108001180012800138001480015800168001780018800198002080021800228002380024800258002680027800288002980030800318003280033800348003580036800378003880039800408004180042800438004480045800468004780048800498005080051800528005380054800558005680057800588005980060800618006280063800648006580066800678006880069800708007180072800738007480075800768007780078800798008080081800828008380084800858008680087800888008980090800918009280093800948009580096800978009880099801008010180102801038010480105801068010780108801098011080111801128011380114801158011680117801188011980120801218012280123801248012580126801278012880129801308013180132801338013480135801368013780138801398014080141801428014380144801458014680147801488014980150801518015280153801548015580156801578015880159801608016180162801638016480165801668016780168801698017080171801728017380174801758017680177801788017980180801818018280183801848018580186801878018880189801908019180192801938019480195801968019780198801998020080201802028020380204802058020680207802088020980210802118021280213802148021580216802178021880219802208022180222802238022480225802268022780228802298023080231802328023380234802358023680237802388023980240802418024280243802448024580246802478024880249802508025180252802538025480255802568025780258802598026080261802628026380264802658026680267802688026980270802718027280273802748027580276802778027880279802808028180282802838028480285802868028780288802898029080291802928029380294802958029680297802988029980300803018030280303803048030580306803078030880309803108031180312803138031480315803168031780318803198032080321803228032380324803258032680327803288032980330803318033280333803348033580336803378033880339803408034180342803438034480345803468034780348803498035080351803528035380354803558035680357803588035980360803618036280363803648036580366803678036880369803708037180372803738037480375803768037780378803798038080381803828038380384803858038680387803888038980390803918039280393803948039580396803978039880399804008040180402804038040480405804068040780408804098041080411804128041380414804158041680417804188041980420804218042280423804248042580426804278042880429804308043180432804338043480435804368043780438804398044080441804428044380444804458044680447804488044980450804518045280453804548045580456804578045880459804608046180462804638046480465804668046780468804698047080471804728047380474804758047680477804788047980480804818048280483804848048580486804878048880489804908049180492804938049480495804968049780498804998050080501805028050380504805058050680507805088050980510805118051280513805148051580516805178051880519805208052180522805238052480525805268052780528805298053080531805328053380534805358053680537805388053980540805418054280543805448054580546805478054880549805508055180552805538055480555805568055780558805598056080561805628056380564805658056680567805688056980570805718057280573805748057580576805778057880579805808058180582805838058480585805868058780588805898059080591805928059380594805958059680597805988059980600806018060280603806048060580606806078060880609806108061180612806138061480615806168061780618806198062080621806228062380624806258062680627806288062980630806318063280633806348063580636806378063880639806408064180642806438064480645806468064780648806498065080651806528065380654806558065680657806588065980660806618066280663806648066580666806678066880669806708067180672806738067480675806768067780678806798068080681806828068380684806858068680687806888068980690806918069280693806948069580696806978069880699807008070180702807038070480705807068070780708807098071080711807128071380714807158071680717807188071980720807218072280723807248072580726807278072880729807308073180732807338073480735807368073780738807398074080741807428074380744807458074680747807488074980750807518075280753807548075580756807578075880759807608076180762807638076480765807668076780768807698077080771807728077380774807758077680777807788077980780807818078280783807848078580786807878078880789807908079180792807938079480795807968079780798807998080080801808028080380804808058080680807808088080980810808118081280813808148081580816808178081880819808208082180822808238082480825808268082780828808298083080831808328083380834808358083680837808388083980840808418084280843808448084580846808478084880849808508085180852808538085480855808568085780858808598086080861808628086380864808658086680867808688086980870808718087280873808748087580876808778087880879808808088180882808838088480885808868088780888808898089080891808928089380894808958089680897808988089980900809018090280903809048090580906809078090880909809108091180912809138091480915809168091780918809198092080921809228092380924809258092680927809288092980930809318093280933809348093580936809378093880939809408094180942809438094480945809468094780948809498095080951809528095380954809558095680957809588095980960809618096280963809648096580966809678096880969809708097180972809738097480975809768097780978809798098080981809828098380984809858098680987809888098980990809918099280993809948099580996809978099880999810008100181002810038100481005810068100781008810098101081011810128101381014810158101681017810188101981020810218102281023810248102581026810278102881029810308103181032810338103481035810368103781038810398104081041810428104381044810458104681047810488104981050810518105281053810548105581056810578105881059810608106181062810638106481065810668106781068810698107081071810728107381074810758107681077810788107981080810818108281083810848108581086810878108881089810908109181092810938109481095810968109781098810998110081101811028110381104811058110681107811088110981110811118111281113811148111581116811178111881119811208112181122811238112481125811268112781128811298113081131811328113381134811358113681137811388113981140811418114281143811448114581146811478114881149811508115181152811538115481155811568115781158811598116081161811628116381164811658116681167811688116981170811718117281173811748117581176811778117881179811808118181182811838118481185811868118781188811898119081191811928119381194811958119681197811988119981200812018120281203812048120581206812078120881209812108121181212812138121481215812168121781218812198122081221812228122381224812258122681227812288122981230812318123281233812348123581236812378123881239812408124181242812438124481245812468124781248812498125081251812528125381254812558125681257812588125981260812618126281263812648126581266812678126881269812708127181272812738127481275812768127781278812798128081281812828128381284812858128681287812888128981290812918129281293812948129581296812978129881299813008130181302813038130481305813068130781308813098131081311813128131381314813158131681317813188131981320813218132281323813248132581326813278132881329813308133181332813338133481335813368133781338813398134081341813428134381344813458134681347813488134981350813518135281353813548135581356813578135881359813608136181362813638136481365813668136781368813698137081371813728137381374813758137681377813788137981380813818138281383813848138581386813878138881389813908139181392813938139481395813968139781398813998140081401814028140381404814058140681407814088140981410814118141281413814148141581416814178141881419814208142181422814238142481425814268142781428814298143081431814328143381434814358143681437814388143981440814418144281443814448144581446814478144881449814508145181452814538145481455814568145781458814598146081461814628146381464814658146681467814688146981470814718147281473814748147581476814778147881479814808148181482814838148481485814868148781488814898149081491814928149381494814958149681497814988149981500815018150281503815048150581506815078150881509815108151181512815138151481515815168151781518815198152081521815228152381524815258152681527815288152981530815318153281533815348153581536815378153881539815408154181542815438154481545815468154781548815498155081551815528155381554815558155681557815588155981560815618156281563815648156581566815678156881569815708157181572815738157481575815768157781578815798158081581815828158381584815858158681587815888158981590815918159281593815948159581596815978159881599816008160181602816038160481605816068160781608816098161081611816128161381614816158161681617816188161981620816218162281623816248162581626816278162881629816308163181632816338163481635816368163781638816398164081641816428164381644816458164681647816488164981650816518165281653816548165581656816578165881659816608166181662816638166481665816668166781668816698167081671816728167381674816758167681677816788167981680816818168281683816848168581686816878168881689816908169181692816938169481695816968169781698816998170081701817028170381704817058170681707817088170981710817118171281713817148171581716817178171881719817208172181722817238172481725817268172781728817298173081731817328173381734817358173681737817388173981740817418174281743817448174581746817478174881749817508175181752817538175481755817568175781758817598176081761817628176381764817658176681767817688176981770817718177281773817748177581776817778177881779817808178181782817838178481785817868178781788817898179081791817928179381794817958179681797817988179981800818018180281803818048180581806818078180881809818108181181812818138181481815818168181781818818198182081821818228182381824818258182681827818288182981830818318183281833818348183581836818378183881839818408184181842818438184481845818468184781848818498185081851818528185381854818558185681857818588185981860818618186281863818648186581866818678186881869818708187181872818738187481875818768187781878818798188081881818828188381884818858188681887818888188981890818918189281893818948189581896818978189881899819008190181902819038190481905819068190781908819098191081911819128191381914819158191681917819188191981920819218192281923819248192581926819278192881929819308193181932819338193481935819368193781938819398194081941819428194381944819458194681947819488194981950819518195281953819548195581956819578195881959819608196181962819638196481965819668196781968819698197081971819728197381974819758197681977819788197981980819818198281983819848198581986819878198881989819908199181992819938199481995819968199781998819998200082001820028200382004820058200682007820088200982010820118201282013820148201582016820178201882019820208202182022820238202482025820268202782028820298203082031820328203382034820358203682037820388203982040820418204282043820448204582046820478204882049820508205182052820538205482055820568205782058820598206082061820628206382064820658206682067820688206982070820718207282073820748207582076820778207882079820808208182082820838208482085820868208782088820898209082091820928209382094820958209682097820988209982100821018210282103821048210582106821078210882109821108211182112821138211482115821168211782118821198212082121821228212382124821258212682127821288212982130821318213282133821348213582136821378213882139821408214182142821438214482145821468214782148821498215082151821528215382154821558215682157821588215982160821618216282163821648216582166821678216882169821708217182172821738217482175821768217782178821798218082181821828218382184821858218682187821888218982190821918219282193821948219582196821978219882199822008220182202822038220482205822068220782208822098221082211822128221382214822158221682217822188221982220822218222282223822248222582226822278222882229822308223182232822338223482235822368223782238822398224082241822428224382244822458224682247822488224982250822518225282253822548225582256822578225882259822608226182262822638226482265822668226782268822698227082271822728227382274822758227682277822788227982280822818228282283822848228582286822878228882289822908229182292822938229482295822968229782298822998230082301823028230382304823058230682307823088230982310823118231282313823148231582316823178231882319823208232182322823238232482325823268232782328823298233082331823328233382334823358233682337823388233982340823418234282343823448234582346823478234882349823508235182352823538235482355823568235782358823598236082361823628236382364823658236682367823688236982370823718237282373823748237582376823778237882379823808238182382823838238482385823868238782388823898239082391823928239382394823958239682397823988239982400824018240282403824048240582406824078240882409824108241182412824138241482415824168241782418824198242082421824228242382424824258242682427824288242982430824318243282433824348243582436824378243882439824408244182442824438244482445824468244782448824498245082451824528245382454824558245682457824588245982460824618246282463824648246582466824678246882469824708247182472824738247482475824768247782478824798248082481824828248382484824858248682487824888248982490824918249282493824948249582496824978249882499825008250182502825038250482505825068250782508825098251082511825128251382514825158251682517825188251982520825218252282523825248252582526825278252882529825308253182532825338253482535825368253782538825398254082541825428254382544825458254682547825488254982550825518255282553825548255582556825578255882559825608256182562825638256482565825668256782568825698257082571825728257382574825758257682577825788257982580825818258282583825848258582586825878258882589825908259182592825938259482595825968259782598825998260082601826028260382604826058260682607826088260982610826118261282613826148261582616826178261882619826208262182622826238262482625826268262782628826298263082631826328263382634826358263682637826388263982640826418264282643826448264582646826478264882649826508265182652826538265482655826568265782658826598266082661826628266382664826658266682667826688266982670826718267282673826748267582676826778267882679826808268182682826838268482685826868268782688826898269082691826928269382694826958269682697826988269982700827018270282703827048270582706827078270882709827108271182712827138271482715827168271782718827198272082721827228272382724827258272682727827288272982730827318273282733827348273582736827378273882739827408274182742827438274482745827468274782748827498275082751827528275382754827558275682757827588275982760827618276282763827648276582766827678276882769827708277182772827738277482775827768277782778827798278082781827828278382784827858278682787827888278982790827918279282793827948279582796827978279882799828008280182802828038280482805828068280782808828098281082811828128281382814828158281682817828188281982820828218282282823828248282582826828278282882829828308283182832828338283482835828368283782838828398284082841828428284382844828458284682847828488284982850828518285282853828548285582856828578285882859828608286182862828638286482865828668286782868828698287082871828728287382874828758287682877828788287982880828818288282883828848288582886828878288882889828908289182892828938289482895828968289782898828998290082901829028290382904829058290682907829088290982910829118291282913829148291582916829178291882919829208292182922829238292482925829268292782928829298293082931829328293382934829358293682937829388293982940829418294282943829448294582946829478294882949829508295182952829538295482955829568295782958829598296082961829628296382964829658296682967829688296982970829718297282973829748297582976829778297882979829808298182982829838298482985829868298782988829898299082991829928299382994829958299682997829988299983000830018300283003830048300583006830078300883009830108301183012830138301483015830168301783018830198302083021830228302383024830258302683027830288302983030830318303283033830348303583036830378303883039830408304183042830438304483045830468304783048830498305083051830528305383054830558305683057830588305983060830618306283063830648306583066830678306883069830708307183072830738307483075830768307783078830798308083081830828308383084830858308683087830888308983090830918309283093830948309583096830978309883099831008310183102831038310483105831068310783108831098311083111831128311383114831158311683117831188311983120831218312283123831248312583126831278312883129831308313183132831338313483135831368313783138831398314083141831428314383144831458314683147831488314983150831518315283153831548315583156831578315883159831608316183162831638316483165831668316783168831698317083171831728317383174831758317683177831788317983180831818318283183831848318583186831878318883189831908319183192831938319483195831968319783198831998320083201832028320383204832058320683207832088320983210832118321283213832148321583216832178321883219832208322183222832238322483225832268322783228832298323083231832328323383234832358323683237832388323983240832418324283243832448324583246832478324883249832508325183252832538325483255832568325783258832598326083261832628326383264832658326683267832688326983270832718327283273832748327583276832778327883279832808328183282832838328483285832868328783288832898329083291832928329383294832958329683297832988329983300833018330283303833048330583306833078330883309833108331183312833138331483315833168331783318833198332083321833228332383324833258332683327833288332983330833318333283333833348333583336833378333883339833408334183342833438334483345833468334783348833498335083351833528335383354833558335683357833588335983360833618336283363833648336583366833678336883369833708337183372833738337483375833768337783378833798338083381833828338383384833858338683387833888338983390833918339283393833948339583396833978339883399834008340183402834038340483405834068340783408834098341083411834128341383414834158341683417834188341983420834218342283423834248342583426834278342883429834308343183432834338343483435834368343783438834398344083441834428344383444834458344683447834488344983450834518345283453834548345583456834578345883459834608346183462834638346483465834668346783468834698347083471834728347383474834758347683477834788347983480834818348283483834848348583486834878348883489834908349183492834938349483495834968349783498834998350083501835028350383504835058350683507835088350983510835118351283513835148351583516835178351883519835208352183522835238352483525835268352783528835298353083531835328353383534835358353683537835388353983540835418354283543835448354583546835478354883549835508355183552835538355483555835568355783558835598356083561835628356383564835658356683567835688356983570835718357283573835748357583576835778357883579835808358183582835838358483585835868358783588835898359083591835928359383594835958359683597835988359983600836018360283603836048360583606836078360883609836108361183612836138361483615836168361783618836198362083621836228362383624836258362683627836288362983630836318363283633836348363583636836378363883639836408364183642836438364483645836468364783648836498365083651836528365383654836558365683657836588365983660836618366283663836648366583666836678366883669836708367183672836738367483675836768367783678836798368083681836828368383684836858368683687836888368983690836918369283693836948369583696836978369883699837008370183702837038370483705837068370783708837098371083711837128371383714837158371683717837188371983720837218372283723837248372583726837278372883729837308373183732837338373483735837368373783738837398374083741837428374383744837458374683747837488374983750837518375283753837548375583756837578375883759837608376183762837638376483765837668376783768837698377083771837728377383774837758377683777837788377983780837818378283783837848378583786837878378883789837908379183792837938379483795837968379783798837998380083801838028380383804838058380683807838088380983810838118381283813838148381583816838178381883819838208382183822838238382483825838268382783828838298383083831838328383383834838358383683837838388383983840838418384283843838448384583846838478384883849838508385183852838538385483855838568385783858838598386083861838628386383864838658386683867838688386983870838718387283873838748387583876838778387883879838808388183882838838388483885838868388783888838898389083891838928389383894838958389683897838988389983900839018390283903839048390583906839078390883909839108391183912839138391483915839168391783918839198392083921839228392383924839258392683927839288392983930839318393283933839348393583936839378393883939839408394183942839438394483945839468394783948839498395083951839528395383954839558395683957839588395983960839618396283963839648396583966839678396883969839708397183972839738397483975839768397783978839798398083981839828398383984839858398683987839888398983990839918399283993839948399583996839978399883999840008400184002840038400484005840068400784008840098401084011840128401384014840158401684017840188401984020840218402284023840248402584026840278402884029840308403184032840338403484035840368403784038840398404084041840428404384044840458404684047840488404984050840518405284053840548405584056840578405884059840608406184062840638406484065840668406784068840698407084071840728407384074840758407684077840788407984080840818408284083840848408584086840878408884089840908409184092840938409484095840968409784098840998410084101841028410384104841058410684107841088410984110841118411284113841148411584116841178411884119841208412184122841238412484125841268412784128841298413084131841328413384134841358413684137841388413984140841418414284143841448414584146841478414884149841508415184152841538415484155841568415784158841598416084161841628416384164841658416684167841688416984170841718417284173841748417584176841778417884179841808418184182841838418484185841868418784188841898419084191841928419384194841958419684197841988419984200842018420284203842048420584206842078420884209842108421184212842138421484215842168421784218842198422084221842228422384224842258422684227842288422984230842318423284233842348423584236842378423884239842408424184242842438424484245842468424784248842498425084251842528425384254842558425684257842588425984260842618426284263842648426584266842678426884269842708427184272842738427484275842768427784278842798428084281842828428384284842858428684287842888428984290842918429284293842948429584296842978429884299843008430184302843038430484305843068430784308843098431084311843128431384314843158431684317843188431984320843218432284323843248432584326843278432884329843308433184332843338433484335843368433784338843398434084341843428434384344843458434684347843488434984350843518435284353843548435584356843578435884359843608436184362843638436484365843668436784368843698437084371843728437384374843758437684377843788437984380843818438284383843848438584386843878438884389843908439184392843938439484395843968439784398843998440084401844028440384404844058440684407844088440984410844118441284413844148441584416844178441884419844208442184422844238442484425844268442784428844298443084431844328443384434844358443684437844388443984440844418444284443844448444584446844478444884449844508445184452844538445484455844568445784458844598446084461844628446384464844658446684467844688446984470844718447284473844748447584476844778447884479844808448184482844838448484485844868448784488844898449084491844928449384494844958449684497844988449984500845018450284503845048450584506845078450884509845108451184512845138451484515845168451784518845198452084521845228452384524845258452684527845288452984530845318453284533845348453584536845378453884539845408454184542845438454484545845468454784548845498455084551845528455384554845558455684557845588455984560845618456284563845648456584566845678456884569845708457184572845738457484575845768457784578845798458084581845828458384584845858458684587845888458984590845918459284593845948459584596845978459884599846008460184602846038460484605846068460784608846098461084611846128461384614846158461684617846188461984620846218462284623846248462584626846278462884629846308463184632846338463484635846368463784638846398464084641846428464384644846458464684647846488464984650846518465284653846548465584656846578465884659846608466184662846638466484665846668466784668846698467084671846728467384674846758467684677846788467984680846818468284683846848468584686846878468884689846908469184692846938469484695846968469784698846998470084701847028470384704847058470684707847088470984710847118471284713847148471584716847178471884719847208472184722847238472484725847268472784728847298473084731847328473384734847358473684737847388473984740847418474284743847448474584746847478474884749847508475184752847538475484755847568475784758847598476084761847628476384764847658476684767847688476984770847718477284773847748477584776847778477884779847808478184782847838478484785847868478784788847898479084791847928479384794847958479684797847988479984800848018480284803848048480584806848078480884809848108481184812848138481484815848168481784818848198482084821848228482384824848258482684827848288482984830848318483284833848348483584836848378483884839848408484184842848438484484845848468484784848848498485084851848528485384854848558485684857848588485984860848618486284863848648486584866848678486884869848708487184872848738487484875848768487784878848798488084881848828488384884848858488684887848888488984890848918489284893848948489584896848978489884899849008490184902849038490484905849068490784908849098491084911849128491384914849158491684917849188491984920849218492284923849248492584926849278492884929849308493184932849338493484935849368493784938849398494084941849428494384944849458494684947849488494984950849518495284953849548495584956849578495884959849608496184962849638496484965849668496784968849698497084971849728497384974849758497684977849788497984980849818498284983849848498584986849878498884989849908499184992849938499484995849968499784998849998500085001850028500385004850058500685007850088500985010850118501285013850148501585016850178501885019850208502185022850238502485025850268502785028850298503085031850328503385034850358503685037850388503985040850418504285043850448504585046850478504885049850508505185052850538505485055850568505785058850598506085061850628506385064850658506685067850688506985070850718507285073850748507585076850778507885079850808508185082850838508485085850868508785088850898509085091850928509385094850958509685097850988509985100851018510285103851048510585106851078510885109851108511185112851138511485115851168511785118851198512085121851228512385124851258512685127851288512985130851318513285133851348513585136851378513885139851408514185142851438514485145851468514785148851498515085151851528515385154851558515685157851588515985160851618516285163851648516585166851678516885169851708517185172851738517485175851768517785178851798518085181851828518385184851858518685187851888518985190851918519285193851948519585196851978519885199852008520185202852038520485205852068520785208852098521085211852128521385214852158521685217852188521985220852218522285223852248522585226852278522885229852308523185232852338523485235852368523785238852398524085241852428524385244852458524685247852488524985250852518525285253852548525585256852578525885259852608526185262852638526485265852668526785268852698527085271852728527385274852758527685277852788527985280852818528285283852848528585286852878528885289852908529185292852938529485295852968529785298852998530085301853028530385304853058530685307853088530985310853118531285313853148531585316853178531885319853208532185322853238532485325853268532785328853298533085331853328533385334853358533685337853388533985340853418534285343853448534585346853478534885349853508535185352853538535485355853568535785358853598536085361853628536385364853658536685367853688536985370853718537285373853748537585376853778537885379853808538185382853838538485385853868538785388853898539085391853928539385394853958539685397853988539985400854018540285403854048540585406854078540885409854108541185412854138541485415854168541785418854198542085421854228542385424854258542685427854288542985430854318543285433854348543585436854378543885439854408544185442854438544485445854468544785448854498545085451854528545385454854558545685457854588545985460854618546285463854648546585466854678546885469854708547185472854738547485475854768547785478854798548085481854828548385484854858548685487854888548985490854918549285493854948549585496854978549885499855008550185502855038550485505855068550785508855098551085511855128551385514855158551685517855188551985520855218552285523855248552585526855278552885529855308553185532855338553485535855368553785538855398554085541855428554385544855458554685547855488554985550855518555285553855548555585556855578555885559855608556185562855638556485565855668556785568855698557085571855728557385574855758557685577855788557985580855818558285583855848558585586855878558885589855908559185592855938559485595855968559785598855998560085601856028560385604856058560685607856088560985610856118561285613856148561585616856178561885619856208562185622856238562485625856268562785628856298563085631856328563385634856358563685637856388563985640856418564285643856448564585646856478564885649856508565185652856538565485655856568565785658856598566085661856628566385664856658566685667856688566985670856718567285673856748567585676856778567885679856808568185682856838568485685856868568785688856898569085691856928569385694856958569685697856988569985700857018570285703857048570585706857078570885709857108571185712857138571485715857168571785718857198572085721857228572385724857258572685727857288572985730857318573285733857348573585736857378573885739857408574185742857438574485745857468574785748857498575085751857528575385754857558575685757857588575985760857618576285763857648576585766857678576885769857708577185772857738577485775857768577785778857798578085781857828578385784857858578685787857888578985790857918579285793857948579585796857978579885799858008580185802858038580485805858068580785808858098581085811858128581385814858158581685817858188581985820858218582285823858248582585826858278582885829858308583185832858338583485835858368583785838858398584085841858428584385844858458584685847858488584985850858518585285853858548585585856858578585885859858608586185862858638586485865858668586785868858698587085871858728587385874858758587685877858788587985880858818588285883858848588585886858878588885889858908589185892858938589485895858968589785898858998590085901859028590385904859058590685907859088590985910859118591285913859148591585916859178591885919859208592185922859238592485925859268592785928859298593085931859328593385934859358593685937859388593985940859418594285943859448594585946859478594885949859508595185952859538595485955859568595785958859598596085961859628596385964859658596685967859688596985970859718597285973859748597585976859778597885979859808598185982859838598485985859868598785988859898599085991859928599385994859958599685997859988599986000860018600286003860048600586006860078600886009860108601186012860138601486015860168601786018860198602086021860228602386024860258602686027860288602986030860318603286033860348603586036860378603886039860408604186042860438604486045860468604786048860498605086051860528605386054860558605686057860588605986060860618606286063860648606586066860678606886069860708607186072860738607486075860768607786078860798608086081860828608386084860858608686087860888608986090860918609286093860948609586096860978609886099861008610186102861038610486105861068610786108861098611086111861128611386114861158611686117861188611986120861218612286123861248612586126861278612886129861308613186132861338613486135861368613786138861398614086141861428614386144861458614686147861488614986150861518615286153861548615586156861578615886159861608616186162861638616486165861668616786168861698617086171861728617386174861758617686177861788617986180861818618286183861848618586186861878618886189861908619186192861938619486195861968619786198861998620086201862028620386204862058620686207862088620986210862118621286213862148621586216862178621886219862208622186222862238622486225862268622786228862298623086231862328623386234862358623686237862388623986240862418624286243862448624586246862478624886249862508625186252862538625486255862568625786258862598626086261862628626386264862658626686267862688626986270862718627286273862748627586276862778627886279862808628186282862838628486285862868628786288862898629086291862928629386294862958629686297862988629986300863018630286303863048630586306863078630886309863108631186312863138631486315863168631786318863198632086321863228632386324863258632686327863288632986330863318633286333863348633586336863378633886339863408634186342863438634486345863468634786348863498635086351863528635386354863558635686357863588635986360863618636286363863648636586366863678636886369863708637186372863738637486375863768637786378863798638086381863828638386384863858638686387863888638986390863918639286393863948639586396863978639886399864008640186402864038640486405864068640786408864098641086411864128641386414864158641686417864188641986420864218642286423864248642586426864278642886429864308643186432864338643486435864368643786438864398644086441864428644386444864458644686447864488644986450864518645286453864548645586456864578645886459864608646186462864638646486465864668646786468864698647086471864728647386474864758647686477864788647986480864818648286483864848648586486864878648886489864908649186492864938649486495864968649786498864998650086501865028650386504865058650686507865088650986510865118651286513865148651586516865178651886519865208652186522865238652486525865268652786528865298653086531865328653386534865358653686537865388653986540865418654286543865448654586546865478654886549865508655186552865538655486555865568655786558865598656086561865628656386564865658656686567865688656986570865718657286573865748657586576865778657886579865808658186582865838658486585865868658786588865898659086591865928659386594865958659686597865988659986600866018660286603866048660586606866078660886609866108661186612866138661486615866168661786618866198662086621866228662386624866258662686627866288662986630866318663286633866348663586636866378663886639866408664186642866438664486645866468664786648866498665086651866528665386654866558665686657866588665986660866618666286663866648666586666866678666886669866708667186672866738667486675866768667786678866798668086681866828668386684866858668686687866888668986690866918669286693866948669586696866978669886699867008670186702867038670486705867068670786708867098671086711867128671386714867158671686717867188671986720867218672286723867248672586726867278672886729867308673186732867338673486735867368673786738867398674086741867428674386744867458674686747867488674986750867518675286753867548675586756867578675886759867608676186762867638676486765867668676786768867698677086771867728677386774867758677686777867788677986780867818678286783867848678586786867878678886789867908679186792867938679486795867968679786798867998680086801868028680386804868058680686807868088680986810868118681286813868148681586816868178681886819868208682186822868238682486825868268682786828868298683086831868328683386834868358683686837868388683986840868418684286843868448684586846868478684886849868508685186852868538685486855868568685786858868598686086861868628686386864868658686686867868688686986870868718687286873868748687586876868778687886879868808688186882868838688486885868868688786888868898689086891868928689386894868958689686897868988689986900869018690286903869048690586906869078690886909869108691186912869138691486915869168691786918869198692086921869228692386924869258692686927869288692986930869318693286933869348693586936869378693886939869408694186942869438694486945869468694786948869498695086951869528695386954869558695686957869588695986960869618696286963869648696586966869678696886969869708697186972869738697486975869768697786978869798698086981869828698386984869858698686987869888698986990869918699286993869948699586996869978699886999870008700187002870038700487005870068700787008870098701087011870128701387014870158701687017870188701987020870218702287023870248702587026870278702887029870308703187032870338703487035870368703787038870398704087041870428704387044870458704687047870488704987050870518705287053870548705587056870578705887059870608706187062870638706487065870668706787068870698707087071870728707387074870758707687077870788707987080870818708287083870848708587086870878708887089870908709187092870938709487095870968709787098870998710087101871028710387104871058710687107871088710987110871118711287113871148711587116871178711887119871208712187122871238712487125871268712787128871298713087131871328713387134871358713687137871388713987140871418714287143871448714587146871478714887149871508715187152871538715487155871568715787158871598716087161871628716387164871658716687167871688716987170871718717287173871748717587176871778717887179871808718187182871838718487185871868718787188871898719087191871928719387194871958719687197871988719987200872018720287203872048720587206872078720887209872108721187212872138721487215872168721787218872198722087221872228722387224872258722687227872288722987230872318723287233872348723587236872378723887239872408724187242872438724487245872468724787248872498725087251872528725387254872558725687257872588725987260872618726287263872648726587266872678726887269872708727187272872738727487275872768727787278872798728087281872828728387284872858728687287872888728987290872918729287293872948729587296872978729887299873008730187302873038730487305873068730787308873098731087311873128731387314873158731687317873188731987320873218732287323873248732587326873278732887329873308733187332873338733487335873368733787338873398734087341873428734387344873458734687347873488734987350873518735287353873548735587356873578735887359873608736187362873638736487365873668736787368873698737087371873728737387374873758737687377873788737987380873818738287383873848738587386873878738887389873908739187392873938739487395873968739787398873998740087401874028740387404874058740687407874088740987410874118741287413874148741587416874178741887419874208742187422874238742487425874268742787428874298743087431874328743387434874358743687437874388743987440874418744287443874448744587446874478744887449874508745187452874538745487455874568745787458874598746087461874628746387464874658746687467874688746987470874718747287473874748747587476874778747887479874808748187482874838748487485874868748787488874898749087491874928749387494874958749687497874988749987500875018750287503875048750587506875078750887509875108751187512875138751487515875168751787518875198752087521875228752387524875258752687527875288752987530875318753287533875348753587536875378753887539875408754187542875438754487545875468754787548875498755087551875528755387554875558755687557875588755987560875618756287563875648756587566875678756887569875708757187572875738757487575875768757787578875798758087581875828758387584875858758687587875888758987590875918759287593875948759587596875978759887599876008760187602876038760487605876068760787608876098761087611876128761387614876158761687617876188761987620876218762287623876248762587626876278762887629876308763187632876338763487635876368763787638876398764087641876428764387644876458764687647876488764987650876518765287653876548765587656876578765887659876608766187662876638766487665876668766787668876698767087671876728767387674876758767687677876788767987680876818768287683876848768587686876878768887689876908769187692876938769487695876968769787698876998770087701877028770387704877058770687707877088770987710877118771287713877148771587716877178771887719877208772187722877238772487725877268772787728877298773087731877328773387734877358773687737877388773987740877418774287743877448774587746877478774887749877508775187752877538775487755877568775787758877598776087761877628776387764877658776687767877688776987770877718777287773877748777587776877778777887779877808778187782877838778487785877868778787788877898779087791877928779387794877958779687797877988779987800878018780287803878048780587806878078780887809878108781187812878138781487815878168781787818878198782087821878228782387824878258782687827878288782987830878318783287833878348783587836878378783887839878408784187842878438784487845878468784787848878498785087851878528785387854878558785687857878588785987860878618786287863878648786587866878678786887869878708787187872878738787487875878768787787878878798788087881878828788387884878858788687887878888788987890878918789287893878948789587896878978789887899879008790187902879038790487905879068790787908879098791087911879128791387914879158791687917879188791987920879218792287923879248792587926879278792887929879308793187932879338793487935879368793787938879398794087941879428794387944879458794687947879488794987950879518795287953879548795587956879578795887959879608796187962879638796487965879668796787968879698797087971879728797387974879758797687977879788797987980879818798287983879848798587986879878798887989879908799187992879938799487995879968799787998879998800088001880028800388004880058800688007880088800988010880118801288013880148801588016880178801888019880208802188022880238802488025880268802788028880298803088031880328803388034880358803688037880388803988040880418804288043880448804588046880478804888049880508805188052880538805488055880568805788058880598806088061880628806388064880658806688067880688806988070880718807288073880748807588076880778807888079880808808188082880838808488085880868808788088880898809088091880928809388094880958809688097880988809988100881018810288103881048810588106881078810888109881108811188112881138811488115881168811788118881198812088121881228812388124881258812688127881288812988130881318813288133881348813588136881378813888139881408814188142881438814488145881468814788148881498815088151881528815388154881558815688157881588815988160881618816288163881648816588166881678816888169881708817188172881738817488175881768817788178881798818088181881828818388184881858818688187881888818988190881918819288193881948819588196881978819888199882008820188202882038820488205882068820788208882098821088211882128821388214882158821688217882188821988220882218822288223882248822588226882278822888229882308823188232882338823488235882368823788238882398824088241882428824388244882458824688247882488824988250882518825288253882548825588256882578825888259882608826188262882638826488265882668826788268882698827088271882728827388274882758827688277882788827988280882818828288283882848828588286882878828888289882908829188292882938829488295882968829788298882998830088301883028830388304883058830688307883088830988310883118831288313883148831588316883178831888319883208832188322883238832488325883268832788328883298833088331883328833388334883358833688337883388833988340883418834288343883448834588346883478834888349883508835188352883538835488355883568835788358883598836088361883628836388364883658836688367883688836988370883718837288373883748837588376883778837888379883808838188382883838838488385883868838788388883898839088391883928839388394883958839688397883988839988400884018840288403884048840588406884078840888409884108841188412884138841488415884168841788418884198842088421884228842388424884258842688427884288842988430884318843288433884348843588436884378843888439884408844188442884438844488445884468844788448884498845088451884528845388454884558845688457884588845988460884618846288463884648846588466884678846888469884708847188472884738847488475884768847788478884798848088481884828848388484884858848688487884888848988490884918849288493884948849588496884978849888499885008850188502885038850488505885068850788508885098851088511885128851388514885158851688517885188851988520885218852288523885248852588526885278852888529885308853188532885338853488535885368853788538885398854088541885428854388544885458854688547885488854988550885518855288553885548855588556885578855888559885608856188562885638856488565885668856788568885698857088571885728857388574885758857688577885788857988580885818858288583885848858588586885878858888589885908859188592885938859488595885968859788598885998860088601886028860388604886058860688607886088860988610886118861288613886148861588616886178861888619886208862188622886238862488625886268862788628886298863088631886328863388634886358863688637886388863988640886418864288643886448864588646886478864888649886508865188652886538865488655886568865788658886598866088661886628866388664886658866688667886688866988670886718867288673886748867588676886778867888679886808868188682886838868488685886868868788688886898869088691886928869388694886958869688697886988869988700887018870288703887048870588706887078870888709887108871188712887138871488715887168871788718887198872088721887228872388724887258872688727887288872988730887318873288733887348873588736887378873888739887408874188742887438874488745887468874788748887498875088751887528875388754887558875688757887588875988760887618876288763887648876588766887678876888769887708877188772887738877488775887768877788778887798878088781887828878388784887858878688787887888878988790887918879288793887948879588796887978879888799888008880188802888038880488805888068880788808888098881088811888128881388814888158881688817888188881988820888218882288823888248882588826888278882888829888308883188832888338883488835888368883788838888398884088841888428884388844888458884688847888488884988850888518885288853888548885588856888578885888859888608886188862888638886488865888668886788868888698887088871888728887388874888758887688877888788887988880888818888288883888848888588886888878888888889888908889188892888938889488895888968889788898888998890088901889028890388904889058890688907889088890988910889118891288913889148891588916889178891888919889208892188922889238892488925889268892788928889298893088931889328893388934889358893688937889388893988940889418894288943889448894588946889478894888949889508895188952889538895488955889568895788958889598896088961889628896388964889658896688967889688896988970889718897288973889748897588976889778897888979889808898188982889838898488985889868898788988889898899088991889928899388994889958899688997889988899989000890018900289003890048900589006890078900889009890108901189012890138901489015890168901789018890198902089021890228902389024890258902689027890288902989030890318903289033890348903589036890378903889039890408904189042890438904489045890468904789048890498905089051890528905389054890558905689057890588905989060890618906289063890648906589066890678906889069890708907189072890738907489075890768907789078890798908089081890828908389084890858908689087890888908989090890918909289093890948909589096890978909889099891008910189102891038910489105891068910789108891098911089111891128911389114891158911689117891188911989120891218912289123891248912589126891278912889129891308913189132891338913489135891368913789138891398914089141891428914389144891458914689147891488914989150891518915289153891548915589156891578915889159891608916189162891638916489165891668916789168891698917089171891728917389174891758917689177891788917989180891818918289183891848918589186891878918889189891908919189192891938919489195891968919789198891998920089201892028920389204892058920689207892088920989210892118921289213892148921589216892178921889219892208922189222892238922489225892268922789228892298923089231892328923389234892358923689237892388923989240892418924289243892448924589246892478924889249892508925189252892538925489255892568925789258892598926089261892628926389264892658926689267892688926989270892718927289273892748927589276892778927889279892808928189282892838928489285892868928789288892898929089291892928929389294892958929689297892988929989300893018930289303893048930589306893078930889309893108931189312893138931489315893168931789318893198932089321893228932389324893258932689327893288932989330893318933289333893348933589336893378933889339893408934189342893438934489345893468934789348893498935089351893528935389354893558935689357893588935989360893618936289363893648936589366893678936889369893708937189372893738937489375893768937789378893798938089381893828938389384893858938689387893888938989390893918939289393893948939589396893978939889399894008940189402894038940489405894068940789408894098941089411894128941389414894158941689417894188941989420894218942289423894248942589426894278942889429894308943189432894338943489435894368943789438894398944089441894428944389444894458944689447894488944989450894518945289453894548945589456894578945889459894608946189462894638946489465894668946789468894698947089471894728947389474894758947689477894788947989480894818948289483894848948589486894878948889489894908949189492894938949489495894968949789498894998950089501895028950389504895058950689507895088950989510895118951289513895148951589516895178951889519895208952189522895238952489525895268952789528895298953089531895328953389534895358953689537895388953989540895418954289543895448954589546895478954889549895508955189552895538955489555895568955789558895598956089561895628956389564895658956689567895688956989570895718957289573895748957589576895778957889579895808958189582895838958489585895868958789588895898959089591895928959389594895958959689597895988959989600896018960289603896048960589606896078960889609896108961189612896138961489615896168961789618896198962089621896228962389624896258962689627896288962989630896318963289633896348963589636896378963889639896408964189642896438964489645896468964789648896498965089651896528965389654896558965689657896588965989660896618966289663896648966589666896678966889669896708967189672896738967489675896768967789678896798968089681896828968389684896858968689687896888968989690896918969289693896948969589696896978969889699897008970189702897038970489705897068970789708897098971089711897128971389714897158971689717897188971989720897218972289723897248972589726897278972889729897308973189732897338973489735897368973789738897398974089741897428974389744897458974689747897488974989750897518975289753897548975589756897578975889759897608976189762897638976489765897668976789768897698977089771897728977389774897758977689777897788977989780897818978289783897848978589786897878978889789897908979189792897938979489795897968979789798897998980089801898028980389804898058980689807898088980989810898118981289813898148981589816898178981889819898208982189822898238982489825898268982789828898298983089831898328983389834898358983689837898388983989840898418984289843898448984589846898478984889849898508985189852898538985489855898568985789858898598986089861898628986389864898658986689867898688986989870898718987289873898748987589876898778987889879898808988189882898838988489885898868988789888898898989089891898928989389894898958989689897898988989989900899018990289903899048990589906899078990889909899108991189912899138991489915899168991789918899198992089921899228992389924899258992689927899288992989930899318993289933899348993589936899378993889939899408994189942899438994489945899468994789948899498995089951899528995389954899558995689957899588995989960899618996289963899648996589966899678996889969899708997189972899738997489975899768997789978899798998089981899828998389984899858998689987899888998989990899918999289993899948999589996899978999889999900009000190002900039000490005900069000790008900099001090011900129001390014900159001690017900189001990020900219002290023900249002590026900279002890029900309003190032900339003490035900369003790038900399004090041900429004390044900459004690047900489004990050900519005290053900549005590056900579005890059900609006190062900639006490065900669006790068900699007090071900729007390074900759007690077900789007990080900819008290083900849008590086900879008890089900909009190092900939009490095900969009790098900999010090101901029010390104901059010690107901089010990110901119011290113901149011590116901179011890119901209012190122901239012490125901269012790128901299013090131901329013390134901359013690137901389013990140901419014290143901449014590146901479014890149901509015190152901539015490155901569015790158901599016090161901629016390164901659016690167901689016990170901719017290173901749017590176901779017890179901809018190182901839018490185901869018790188901899019090191901929019390194901959019690197901989019990200902019020290203902049020590206902079020890209902109021190212902139021490215902169021790218902199022090221902229022390224902259022690227902289022990230902319023290233902349023590236902379023890239902409024190242902439024490245902469024790248902499025090251902529025390254902559025690257902589025990260902619026290263902649026590266902679026890269902709027190272902739027490275902769027790278902799028090281902829028390284902859028690287902889028990290902919029290293902949029590296902979029890299903009030190302903039030490305903069030790308903099031090311903129031390314903159031690317903189031990320903219032290323903249032590326903279032890329903309033190332903339033490335903369033790338903399034090341903429034390344903459034690347903489034990350903519035290353903549035590356903579035890359903609036190362903639036490365903669036790368903699037090371903729037390374903759037690377903789037990380903819038290383903849038590386903879038890389903909039190392903939039490395903969039790398903999040090401904029040390404904059040690407904089040990410904119041290413904149041590416904179041890419904209042190422904239042490425904269042790428904299043090431904329043390434904359043690437904389043990440904419044290443904449044590446904479044890449904509045190452904539045490455904569045790458904599046090461904629046390464904659046690467904689046990470904719047290473904749047590476904779047890479904809048190482904839048490485904869048790488904899049090491904929049390494904959049690497904989049990500905019050290503905049050590506905079050890509905109051190512905139051490515905169051790518905199052090521905229052390524905259052690527905289052990530905319053290533905349053590536905379053890539905409054190542905439054490545905469054790548905499055090551905529055390554905559055690557905589055990560905619056290563905649056590566905679056890569905709057190572905739057490575905769057790578905799058090581905829058390584905859058690587905889058990590905919059290593905949059590596905979059890599906009060190602906039060490605906069060790608906099061090611906129061390614906159061690617906189061990620906219062290623906249062590626906279062890629906309063190632906339063490635906369063790638906399064090641906429064390644906459064690647906489064990650906519065290653906549065590656906579065890659906609066190662906639066490665906669066790668906699067090671906729067390674906759067690677906789067990680906819068290683906849068590686906879068890689906909069190692906939069490695906969069790698906999070090701907029070390704907059070690707907089070990710907119071290713907149071590716907179071890719907209072190722907239072490725907269072790728907299073090731907329073390734907359073690737907389073990740907419074290743907449074590746907479074890749907509075190752907539075490755907569075790758907599076090761907629076390764907659076690767907689076990770907719077290773907749077590776907779077890779907809078190782907839078490785907869078790788907899079090791907929079390794907959079690797907989079990800908019080290803908049080590806908079080890809908109081190812908139081490815908169081790818908199082090821908229082390824908259082690827908289082990830908319083290833908349083590836908379083890839908409084190842908439084490845908469084790848908499085090851908529085390854908559085690857908589085990860908619086290863908649086590866908679086890869908709087190872908739087490875908769087790878908799088090881908829088390884908859088690887908889088990890908919089290893908949089590896908979089890899909009090190902909039090490905909069090790908909099091090911909129091390914909159091690917909189091990920909219092290923909249092590926909279092890929909309093190932909339093490935909369093790938909399094090941909429094390944909459094690947909489094990950909519095290953909549095590956909579095890959909609096190962909639096490965909669096790968909699097090971909729097390974909759097690977909789097990980909819098290983909849098590986909879098890989909909099190992909939099490995909969099790998909999100091001910029100391004910059100691007910089100991010910119101291013910149101591016910179101891019910209102191022910239102491025910269102791028910299103091031910329103391034910359103691037910389103991040910419104291043910449104591046910479104891049910509105191052910539105491055910569105791058910599106091061910629106391064910659106691067910689106991070910719107291073910749107591076910779107891079910809108191082910839108491085910869108791088910899109091091910929109391094910959109691097910989109991100911019110291103911049110591106911079110891109911109111191112911139111491115911169111791118911199112091121911229112391124911259112691127911289112991130911319113291133911349113591136911379113891139911409114191142911439114491145911469114791148911499115091151911529115391154911559115691157911589115991160911619116291163911649116591166911679116891169911709117191172911739117491175911769117791178911799118091181911829118391184911859118691187911889118991190911919119291193911949119591196911979119891199912009120191202912039120491205912069120791208912099121091211912129121391214912159121691217912189121991220912219122291223912249122591226912279122891229912309123191232912339123491235912369123791238912399124091241912429124391244912459124691247912489124991250912519125291253912549125591256912579125891259912609126191262912639126491265912669126791268912699127091271912729127391274912759127691277912789127991280912819128291283912849128591286912879128891289912909129191292912939129491295912969129791298912999130091301913029130391304913059130691307913089130991310913119131291313913149131591316913179131891319913209132191322913239132491325913269132791328913299133091331913329133391334913359133691337913389133991340913419134291343913449134591346913479134891349913509135191352913539135491355913569135791358913599136091361913629136391364913659136691367913689136991370913719137291373913749137591376913779137891379913809138191382913839138491385913869138791388913899139091391913929139391394913959139691397913989139991400914019140291403914049140591406914079140891409914109141191412914139141491415914169141791418914199142091421914229142391424914259142691427914289142991430914319143291433914349143591436914379143891439914409144191442914439144491445914469144791448914499145091451914529145391454914559145691457914589145991460914619146291463914649146591466914679146891469914709147191472914739147491475914769147791478914799148091481914829148391484914859148691487914889148991490914919149291493914949149591496914979149891499915009150191502915039150491505915069150791508915099151091511915129151391514915159151691517915189151991520915219152291523915249152591526915279152891529915309153191532915339153491535915369153791538915399154091541915429154391544915459154691547915489154991550915519155291553915549155591556915579155891559915609156191562915639156491565915669156791568915699157091571915729157391574915759157691577915789157991580915819158291583915849158591586915879158891589915909159191592915939159491595915969159791598915999160091601916029160391604916059160691607916089160991610916119161291613916149161591616916179161891619916209162191622916239162491625916269162791628916299163091631916329163391634916359163691637916389163991640916419164291643916449164591646916479164891649916509165191652916539165491655916569165791658916599166091661916629166391664916659166691667916689166991670916719167291673916749167591676916779167891679916809168191682916839168491685916869168791688916899169091691916929169391694916959169691697916989169991700917019170291703917049170591706917079170891709917109171191712917139171491715917169171791718917199172091721917229172391724917259172691727917289172991730917319173291733917349173591736917379173891739917409174191742917439174491745917469174791748917499175091751917529175391754917559175691757917589175991760917619176291763917649176591766917679176891769917709177191772917739177491775917769177791778917799178091781917829178391784917859178691787917889178991790917919179291793917949179591796917979179891799918009180191802918039180491805918069180791808918099181091811918129181391814918159181691817918189181991820918219182291823918249182591826918279182891829918309183191832918339183491835918369183791838918399184091841918429184391844918459184691847918489184991850918519185291853918549185591856918579185891859918609186191862918639186491865918669186791868918699187091871918729187391874918759187691877918789187991880918819188291883918849188591886918879188891889918909189191892918939189491895918969189791898918999190091901919029190391904919059190691907919089190991910919119191291913919149191591916919179191891919919209192191922919239192491925919269192791928919299193091931919329193391934919359193691937919389193991940919419194291943919449194591946919479194891949919509195191952919539195491955919569195791958919599196091961919629196391964919659196691967919689196991970919719197291973919749197591976919779197891979919809198191982919839198491985919869198791988919899199091991919929199391994919959199691997919989199992000920019200292003920049200592006920079200892009920109201192012920139201492015920169201792018920199202092021920229202392024920259202692027920289202992030920319203292033920349203592036920379203892039920409204192042920439204492045920469204792048920499205092051920529205392054920559205692057920589205992060920619206292063920649206592066920679206892069920709207192072920739207492075920769207792078920799208092081920829208392084920859208692087920889208992090920919209292093920949209592096920979209892099921009210192102921039210492105921069210792108921099211092111921129211392114921159211692117921189211992120921219212292123921249212592126921279212892129921309213192132921339213492135921369213792138921399214092141921429214392144921459214692147921489214992150921519215292153921549215592156921579215892159921609216192162921639216492165921669216792168921699217092171921729217392174921759217692177921789217992180921819218292183921849218592186921879218892189921909219192192921939219492195921969219792198921999220092201922029220392204922059220692207922089220992210922119221292213922149221592216922179221892219922209222192222922239222492225922269222792228922299223092231922329223392234922359223692237922389223992240922419224292243922449224592246922479224892249922509225192252922539225492255922569225792258922599226092261922629226392264922659226692267922689226992270922719227292273922749227592276922779227892279922809228192282922839228492285922869228792288922899229092291922929229392294922959229692297922989229992300923019230292303923049230592306923079230892309923109231192312923139231492315923169231792318923199232092321923229232392324923259232692327923289232992330923319233292333923349233592336923379233892339923409234192342923439234492345923469234792348923499235092351923529235392354923559235692357923589235992360923619236292363923649236592366923679236892369923709237192372923739237492375923769237792378923799238092381923829238392384923859238692387923889238992390923919239292393923949239592396923979239892399924009240192402924039240492405924069240792408924099241092411924129241392414924159241692417924189241992420924219242292423924249242592426924279242892429924309243192432924339243492435924369243792438924399244092441924429244392444924459244692447924489244992450924519245292453924549245592456924579245892459924609246192462924639246492465924669246792468924699247092471924729247392474924759247692477924789247992480924819248292483924849248592486924879248892489924909249192492924939249492495924969249792498924999250092501925029250392504925059250692507925089250992510925119251292513925149251592516925179251892519925209252192522925239252492525925269252792528925299253092531925329253392534925359253692537925389253992540925419254292543925449254592546925479254892549925509255192552925539255492555925569255792558925599256092561925629256392564925659256692567925689256992570925719257292573925749257592576925779257892579925809258192582925839258492585925869258792588925899259092591925929259392594925959259692597925989259992600926019260292603926049260592606926079260892609926109261192612926139261492615926169261792618926199262092621926229262392624926259262692627926289262992630926319263292633926349263592636926379263892639926409264192642926439264492645926469264792648926499265092651926529265392654926559265692657926589265992660926619266292663926649266592666926679266892669926709267192672926739267492675926769267792678926799268092681926829268392684926859268692687926889268992690926919269292693926949269592696926979269892699927009270192702927039270492705927069270792708927099271092711927129271392714927159271692717927189271992720927219272292723927249272592726927279272892729927309273192732927339273492735927369273792738927399274092741927429274392744927459274692747927489274992750927519275292753927549275592756927579275892759927609276192762927639276492765927669276792768927699277092771927729277392774927759277692777927789277992780927819278292783927849278592786927879278892789927909279192792927939279492795927969279792798927999280092801928029280392804928059280692807928089280992810928119281292813928149281592816928179281892819928209282192822928239282492825928269282792828928299283092831928329283392834928359283692837928389283992840928419284292843928449284592846928479284892849928509285192852928539285492855928569285792858928599286092861928629286392864928659286692867928689286992870928719287292873928749287592876928779287892879928809288192882928839288492885928869288792888928899289092891928929289392894928959289692897928989289992900929019290292903929049290592906929079290892909929109291192912929139291492915929169291792918929199292092921929229292392924929259292692927929289292992930929319293292933929349293592936929379293892939929409294192942929439294492945929469294792948929499295092951929529295392954929559295692957929589295992960929619296292963929649296592966929679296892969929709297192972929739297492975929769297792978929799298092981929829298392984929859298692987929889298992990929919299292993929949299592996929979299892999930009300193002930039300493005930069300793008930099301093011930129301393014930159301693017930189301993020930219302293023930249302593026930279302893029930309303193032930339303493035930369303793038930399304093041930429304393044930459304693047930489304993050930519305293053930549305593056930579305893059930609306193062930639306493065930669306793068930699307093071930729307393074930759307693077930789307993080930819308293083930849308593086930879308893089930909309193092930939309493095930969309793098930999310093101931029310393104931059310693107931089310993110931119311293113931149311593116931179311893119931209312193122931239312493125931269312793128931299313093131931329313393134931359313693137931389313993140931419314293143931449314593146931479314893149931509315193152931539315493155931569315793158931599316093161931629316393164931659316693167931689316993170931719317293173931749317593176931779317893179931809318193182931839318493185931869318793188931899319093191931929319393194931959319693197931989319993200932019320293203932049320593206932079320893209932109321193212932139321493215932169321793218932199322093221932229322393224932259322693227932289322993230932319323293233932349323593236932379323893239932409324193242932439324493245932469324793248932499325093251932529325393254932559325693257932589325993260932619326293263932649326593266932679326893269932709327193272932739327493275932769327793278932799328093281932829328393284932859328693287932889328993290932919329293293932949329593296932979329893299933009330193302933039330493305933069330793308933099331093311933129331393314933159331693317933189331993320933219332293323933249332593326933279332893329933309333193332933339333493335933369333793338933399334093341933429334393344933459334693347933489334993350933519335293353933549335593356933579335893359933609336193362933639336493365933669336793368933699337093371933729337393374933759337693377933789337993380933819338293383933849338593386933879338893389933909339193392933939339493395933969339793398933999340093401934029340393404934059340693407934089340993410934119341293413934149341593416934179341893419934209342193422934239342493425934269342793428934299343093431934329343393434934359343693437934389343993440934419344293443934449344593446934479344893449934509345193452934539345493455934569345793458934599346093461934629346393464934659346693467934689346993470934719347293473934749347593476934779347893479934809348193482934839348493485934869348793488934899349093491934929349393494934959349693497934989349993500935019350293503935049350593506935079350893509935109351193512935139351493515935169351793518935199352093521935229352393524935259352693527935289352993530935319353293533935349353593536935379353893539935409354193542935439354493545935469354793548935499355093551935529355393554935559355693557935589355993560935619356293563935649356593566935679356893569935709357193572935739357493575935769357793578935799358093581935829358393584935859358693587935889358993590935919359293593935949359593596935979359893599936009360193602936039360493605936069360793608936099361093611936129361393614936159361693617936189361993620936219362293623936249362593626936279362893629936309363193632936339363493635936369363793638936399364093641936429364393644936459364693647936489364993650936519365293653936549365593656936579365893659936609366193662936639366493665936669366793668936699367093671936729367393674936759367693677936789367993680936819368293683936849368593686936879368893689936909369193692936939369493695936969369793698936999370093701937029370393704937059370693707937089370993710937119371293713937149371593716937179371893719937209372193722937239372493725937269372793728937299373093731937329373393734937359373693737937389373993740937419374293743937449374593746937479374893749937509375193752937539375493755937569375793758937599376093761937629376393764937659376693767937689376993770937719377293773937749377593776937779377893779937809378193782937839378493785937869378793788937899379093791937929379393794937959379693797937989379993800938019380293803938049380593806938079380893809938109381193812938139381493815938169381793818938199382093821938229382393824938259382693827938289382993830938319383293833938349383593836938379383893839938409384193842938439384493845938469384793848938499385093851938529385393854938559385693857938589385993860938619386293863938649386593866938679386893869938709387193872938739387493875938769387793878938799388093881938829388393884938859388693887938889388993890938919389293893938949389593896938979389893899939009390193902939039390493905939069390793908939099391093911939129391393914939159391693917939189391993920939219392293923939249392593926939279392893929939309393193932939339393493935939369393793938939399394093941939429394393944939459394693947939489394993950939519395293953939549395593956939579395893959939609396193962939639396493965939669396793968939699397093971939729397393974939759397693977939789397993980939819398293983939849398593986939879398893989939909399193992939939399493995939969399793998939999400094001940029400394004940059400694007940089400994010940119401294013940149401594016940179401894019940209402194022940239402494025940269402794028940299403094031940329403394034940359403694037940389403994040940419404294043940449404594046940479404894049940509405194052940539405494055940569405794058940599406094061940629406394064940659406694067940689406994070940719407294073940749407594076940779407894079940809408194082940839408494085940869408794088940899409094091940929409394094940959409694097940989409994100941019410294103941049410594106941079410894109941109411194112941139411494115941169411794118941199412094121941229412394124941259412694127941289412994130941319413294133941349413594136941379413894139941409414194142941439414494145941469414794148941499415094151941529415394154941559415694157941589415994160941619416294163941649416594166941679416894169941709417194172941739417494175941769417794178941799418094181941829418394184941859418694187941889418994190941919419294193941949419594196941979419894199942009420194202942039420494205942069420794208942099421094211942129421394214942159421694217942189421994220942219422294223942249422594226942279422894229942309423194232942339423494235942369423794238942399424094241942429424394244942459424694247942489424994250942519425294253942549425594256942579425894259942609426194262942639426494265942669426794268942699427094271942729427394274942759427694277942789427994280942819428294283942849428594286942879428894289942909429194292942939429494295942969429794298942999430094301943029430394304943059430694307943089430994310943119431294313943149431594316943179431894319943209432194322943239432494325943269432794328943299433094331943329433394334943359433694337943389433994340943419434294343943449434594346943479434894349943509435194352943539435494355943569435794358943599436094361943629436394364943659436694367943689436994370943719437294373943749437594376943779437894379943809438194382943839438494385943869438794388943899439094391943929439394394943959439694397943989439994400944019440294403944049440594406944079440894409944109441194412944139441494415944169441794418944199442094421944229442394424944259442694427944289442994430944319443294433944349443594436944379443894439944409444194442944439444494445944469444794448944499445094451944529445394454944559445694457944589445994460944619446294463944649446594466944679446894469944709447194472944739447494475944769447794478944799448094481944829448394484944859448694487944889448994490944919449294493944949449594496944979449894499945009450194502945039450494505945069450794508945099451094511945129451394514945159451694517945189451994520945219452294523945249452594526945279452894529945309453194532945339453494535945369453794538945399454094541945429454394544945459454694547945489454994550945519455294553945549455594556945579455894559945609456194562945639456494565945669456794568945699457094571945729457394574945759457694577945789457994580945819458294583945849458594586945879458894589945909459194592945939459494595945969459794598945999460094601946029460394604946059460694607946089460994610946119461294613946149461594616946179461894619946209462194622946239462494625946269462794628946299463094631946329463394634946359463694637946389463994640946419464294643946449464594646946479464894649946509465194652946539465494655946569465794658946599466094661946629466394664946659466694667946689466994670946719467294673946749467594676946779467894679946809468194682946839468494685946869468794688946899469094691946929469394694946959469694697946989469994700947019470294703947049470594706947079470894709947109471194712947139471494715947169471794718947199472094721947229472394724947259472694727947289472994730947319473294733947349473594736947379473894739947409474194742947439474494745947469474794748947499475094751947529475394754947559475694757947589475994760947619476294763947649476594766947679476894769947709477194772947739477494775947769477794778947799478094781947829478394784947859478694787947889478994790947919479294793947949479594796947979479894799948009480194802948039480494805948069480794808948099481094811948129481394814948159481694817948189481994820948219482294823948249482594826948279482894829948309483194832948339483494835948369483794838948399484094841948429484394844948459484694847948489484994850948519485294853948549485594856948579485894859948609486194862948639486494865948669486794868948699487094871948729487394874948759487694877948789487994880948819488294883948849488594886948879488894889948909489194892948939489494895948969489794898948999490094901949029490394904949059490694907949089490994910949119491294913949149491594916949179491894919949209492194922949239492494925949269492794928949299493094931949329493394934949359493694937949389493994940949419494294943949449494594946949479494894949949509495194952949539495494955949569495794958949599496094961949629496394964949659496694967949689496994970949719497294973949749497594976949779497894979949809498194982949839498494985949869498794988949899499094991949929499394994949959499694997949989499995000950019500295003950049500595006950079500895009950109501195012950139501495015950169501795018950199502095021950229502395024950259502695027950289502995030950319503295033950349503595036950379503895039950409504195042950439504495045950469504795048950499505095051950529505395054950559505695057950589505995060950619506295063950649506595066950679506895069950709507195072950739507495075950769507795078950799508095081950829508395084950859508695087950889508995090950919509295093950949509595096950979509895099951009510195102951039510495105951069510795108951099511095111951129511395114951159511695117951189511995120951219512295123951249512595126951279512895129951309513195132951339513495135951369513795138951399514095141951429514395144951459514695147951489514995150951519515295153951549515595156951579515895159951609516195162951639516495165951669516795168951699517095171951729517395174951759517695177951789517995180951819518295183951849518595186951879518895189951909519195192951939519495195951969519795198951999520095201952029520395204952059520695207952089520995210952119521295213952149521595216952179521895219952209522195222952239522495225952269522795228952299523095231952329523395234952359523695237952389523995240952419524295243952449524595246952479524895249952509525195252952539525495255952569525795258952599526095261952629526395264952659526695267952689526995270952719527295273952749527595276952779527895279952809528195282952839528495285952869528795288952899529095291952929529395294952959529695297952989529995300953019530295303953049530595306953079530895309953109531195312953139531495315953169531795318953199532095321953229532395324953259532695327953289532995330953319533295333953349533595336953379533895339953409534195342953439534495345953469534795348953499535095351953529535395354953559535695357953589535995360953619536295363953649536595366953679536895369953709537195372953739537495375953769537795378953799538095381953829538395384953859538695387953889538995390953919539295393953949539595396953979539895399954009540195402954039540495405954069540795408954099541095411954129541395414954159541695417954189541995420954219542295423954249542595426954279542895429954309543195432954339543495435954369543795438954399544095441954429544395444954459544695447954489544995450954519545295453954549545595456954579545895459954609546195462954639546495465954669546795468954699547095471954729547395474954759547695477954789547995480954819548295483954849548595486954879548895489954909549195492954939549495495954969549795498954999550095501955029550395504955059550695507955089550995510955119551295513955149551595516955179551895519955209552195522955239552495525955269552795528955299553095531955329553395534955359553695537955389553995540955419554295543955449554595546955479554895549955509555195552955539555495555955569555795558955599556095561955629556395564955659556695567955689556995570955719557295573955749557595576955779557895579955809558195582955839558495585955869558795588955899559095591955929559395594955959559695597955989559995600956019560295603956049560595606956079560895609956109561195612956139561495615956169561795618956199562095621956229562395624956259562695627956289562995630956319563295633956349563595636956379563895639956409564195642956439564495645956469564795648956499565095651956529565395654956559565695657956589565995660956619566295663956649566595666956679566895669956709567195672956739567495675956769567795678956799568095681956829568395684
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId]) {
  10. /******/ return installedModules[moduleId].exports;
  11. /******/ }
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ i: moduleId,
  15. /******/ l: false,
  16. /******/ exports: {}
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.l = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // define getter function for harmony exports
  37. /******/ __webpack_require__.d = function(exports, name, getter) {
  38. /******/ if(!__webpack_require__.o(exports, name)) {
  39. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  40. /******/ }
  41. /******/ };
  42. /******/
  43. /******/ // define __esModule on exports
  44. /******/ __webpack_require__.r = function(exports) {
  45. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  46. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  47. /******/ }
  48. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  49. /******/ };
  50. /******/
  51. /******/ // create a fake namespace object
  52. /******/ // mode & 1: value is a module id, require it
  53. /******/ // mode & 2: merge all properties of value into the ns
  54. /******/ // mode & 4: return value when already ns object
  55. /******/ // mode & 8|1: behave like require
  56. /******/ __webpack_require__.t = function(value, mode) {
  57. /******/ if(mode & 1) value = __webpack_require__(value);
  58. /******/ if(mode & 8) return value;
  59. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  60. /******/ var ns = Object.create(null);
  61. /******/ __webpack_require__.r(ns);
  62. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  63. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  64. /******/ return ns;
  65. /******/ };
  66. /******/
  67. /******/ // getDefaultExport function for compatibility with non-harmony modules
  68. /******/ __webpack_require__.n = function(module) {
  69. /******/ var getter = module && module.__esModule ?
  70. /******/ function getDefault() { return module['default']; } :
  71. /******/ function getModuleExports() { return module; };
  72. /******/ __webpack_require__.d(getter, 'a', getter);
  73. /******/ return getter;
  74. /******/ };
  75. /******/
  76. /******/ // Object.prototype.hasOwnProperty.call
  77. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  78. /******/
  79. /******/ // __webpack_public_path__
  80. /******/ __webpack_require__.p = "";
  81. /******/
  82. /******/
  83. /******/ // Load entry module and return exports
  84. /******/ return __webpack_require__(__webpack_require__.s = "./src/converse.js");
  85. /******/ })
  86. /************************************************************************/
  87. /******/ ({
  88. /***/ "./node_modules/awesomplete-avoid-xss/awesomplete.js":
  89. /*!***********************************************************!*\
  90. !*** ./node_modules/awesomplete-avoid-xss/awesomplete.js ***!
  91. \***********************************************************/
  92. /*! no static exports found */
  93. /***/ (function(module, exports) {
  94. /**
  95. * Simple, lightweight, usable local autocomplete library for modern browsers
  96. * Because there weren’t enough autocomplete scripts in the world? Because I’m completely insane and have NIH syndrome? Probably both. :P
  97. * @author Lea Verou http://leaverou.github.io/awesomplete
  98. * MIT license
  99. */
  100. (function () {
  101. var _ = function (input, o) {
  102. var me = this;
  103. // Setup
  104. this.isOpened = false;
  105. this.input = $(input);
  106. this.input.setAttribute("autocomplete", "off");
  107. this.input.setAttribute("aria-autocomplete", "list");
  108. o = o || {};
  109. configure(this, {
  110. minChars: 2,
  111. maxItems: 10,
  112. autoFirst: false,
  113. data: _.DATA,
  114. filter: _.FILTER_CONTAINS,
  115. sort: o.sort === false ? false : _.SORT_BYLENGTH,
  116. item: _.ITEM,
  117. replace: _.REPLACE
  118. }, o);
  119. this.index = -1;
  120. // Create necessary elements
  121. this.container = $.create("div", {
  122. className: "awesomplete",
  123. around: input
  124. });
  125. this.ul = $.create("ul", {
  126. hidden: "hidden",
  127. inside: this.container
  128. });
  129. this.status = $.create("span", {
  130. className: "visually-hidden",
  131. role: "status",
  132. "aria-live": "assertive",
  133. "aria-relevant": "additions",
  134. inside: this.container
  135. });
  136. // Bind events
  137. this._events = {
  138. input: {
  139. "input": this.evaluate.bind(this),
  140. "blur": this.close.bind(this, { reason: "blur" }),
  141. "keydown": function(evt) {
  142. var c = evt.keyCode;
  143. // If the dropdown `ul` is in view, then act on keydown for the following keys:
  144. // Enter / Esc / Up / Down
  145. if(me.opened) {
  146. if (c === 13 && me.selected) { // Enter
  147. evt.preventDefault();
  148. me.select();
  149. }
  150. else if (c === 27) { // Esc
  151. me.close({ reason: "esc" });
  152. }
  153. else if (c === 38 || c === 40) { // Down/Up arrow
  154. evt.preventDefault();
  155. me[c === 38? "previous" : "next"]();
  156. }
  157. }
  158. }
  159. },
  160. form: {
  161. "submit": this.close.bind(this, { reason: "submit" })
  162. },
  163. ul: {
  164. "mousedown": function(evt) {
  165. var li = evt.target;
  166. if (li !== this) {
  167. while (li && !/li/i.test(li.nodeName)) {
  168. li = li.parentNode;
  169. }
  170. if (li && evt.button === 0) { // Only select on left click
  171. evt.preventDefault();
  172. me.select(li, evt.target);
  173. }
  174. }
  175. }
  176. }
  177. };
  178. $.bind(this.input, this._events.input);
  179. $.bind(this.input.form, this._events.form);
  180. $.bind(this.ul, this._events.ul);
  181. if (this.input.hasAttribute("list")) {
  182. this.list = "#" + this.input.getAttribute("list");
  183. this.input.removeAttribute("list");
  184. }
  185. else {
  186. this.list = this.input.getAttribute("data-list") || o.list || [];
  187. }
  188. _.all.push(this);
  189. };
  190. _.prototype = {
  191. set list(list) {
  192. if (Array.isArray(list)) {
  193. this._list = list;
  194. }
  195. else if (typeof list === "string" && list.indexOf(",") > -1) {
  196. this._list = list.split(/\s*,\s*/);
  197. }
  198. else { // Element or CSS selector
  199. list = $(list);
  200. if (list && list.children) {
  201. var items = [];
  202. slice.apply(list.children).forEach(function (el) {
  203. if (!el.disabled) {
  204. var text = el.textContent.trim();
  205. var value = el.value || text;
  206. var label = el.label || text;
  207. if (value !== "") {
  208. items.push({ label: label, value: value });
  209. }
  210. }
  211. });
  212. this._list = items;
  213. }
  214. }
  215. if (document.activeElement === this.input) {
  216. this.evaluate();
  217. }
  218. },
  219. get selected() {
  220. return this.index > -1;
  221. },
  222. get opened() {
  223. return this.isOpened;
  224. },
  225. close: function (o) {
  226. if (!this.opened) {
  227. return;
  228. }
  229. this.ul.setAttribute("hidden", "");
  230. this.isOpened = false;
  231. this.index = -1;
  232. $.fire(this.input, "awesomplete-close", o || {});
  233. },
  234. open: function () {
  235. this.ul.removeAttribute("hidden");
  236. this.isOpened = true;
  237. if (this.autoFirst && this.index === -1) {
  238. this.goto(0);
  239. }
  240. $.fire(this.input, "awesomplete-open");
  241. },
  242. destroy: function() {
  243. //remove events from the input and its form
  244. $.unbind(this.input, this._events.input);
  245. $.unbind(this.input.form, this._events.form);
  246. //move the input out of the awesomplete container and remove the container and its children
  247. var parentNode = this.container.parentNode;
  248. parentNode.insertBefore(this.input, this.container);
  249. parentNode.removeChild(this.container);
  250. //remove autocomplete and aria-autocomplete attributes
  251. this.input.removeAttribute("autocomplete");
  252. this.input.removeAttribute("aria-autocomplete");
  253. //remove this awesomeplete instance from the global array of instances
  254. var indexOfAwesomplete = _.all.indexOf(this);
  255. if (indexOfAwesomplete !== -1) {
  256. _.all.splice(indexOfAwesomplete, 1);
  257. }
  258. },
  259. next: function () {
  260. var count = this.ul.children.length;
  261. this.goto(this.index < count - 1 ? this.index + 1 : (count ? 0 : -1) );
  262. },
  263. previous: function () {
  264. var count = this.ul.children.length;
  265. var pos = this.index - 1;
  266. this.goto(this.selected && pos !== -1 ? pos : count - 1);
  267. },
  268. // Should not be used, highlights specific item without any checks!
  269. goto: function (i) {
  270. var lis = this.ul.children;
  271. if (this.selected) {
  272. lis[this.index].setAttribute("aria-selected", "false");
  273. }
  274. this.index = i;
  275. if (i > -1 && lis.length > 0) {
  276. lis[i].setAttribute("aria-selected", "true");
  277. this.status.textContent = lis[i].textContent;
  278. // scroll to highlighted element in case parent's height is fixed
  279. this.ul.scrollTop = lis[i].offsetTop - this.ul.clientHeight + lis[i].clientHeight;
  280. $.fire(this.input, "awesomplete-highlight", {
  281. text: this.suggestions[this.index]
  282. });
  283. }
  284. },
  285. select: function (selected, origin) {
  286. if (selected) {
  287. this.index = $.siblingIndex(selected);
  288. } else {
  289. selected = this.ul.children[this.index];
  290. }
  291. if (selected) {
  292. var suggestion = this.suggestions[this.index];
  293. var allowed = $.fire(this.input, "awesomplete-select", {
  294. text: suggestion,
  295. origin: origin || selected
  296. });
  297. if (allowed) {
  298. this.replace(suggestion);
  299. this.close({ reason: "select" });
  300. $.fire(this.input, "awesomplete-selectcomplete", {
  301. text: suggestion
  302. });
  303. }
  304. }
  305. },
  306. evaluate: function() {
  307. var me = this;
  308. var value = this.input.value;
  309. if (value.length >= this.minChars && this._list.length > 0) {
  310. this.index = -1;
  311. // Populate list with options that match
  312. this.ul.innerHTML = "";
  313. this.suggestions = this._list
  314. .map(function(item) {
  315. return new Suggestion(me.data(item, value));
  316. })
  317. .filter(function(item) {
  318. return me.filter(item, value);
  319. });
  320. if (this.sort !== false) {
  321. this.suggestions = this.suggestions.sort(this.sort);
  322. }
  323. this.suggestions = this.suggestions.slice(0, this.maxItems);
  324. this.suggestions.forEach(function(text) {
  325. me.ul.appendChild(me.item(text, value));
  326. });
  327. if (this.ul.children.length === 0) {
  328. this.close({ reason: "nomatches" });
  329. } else {
  330. this.open();
  331. }
  332. }
  333. else {
  334. this.close({ reason: "nomatches" });
  335. }
  336. }
  337. };
  338. // Static methods/properties
  339. _.all = [];
  340. _.FILTER_CONTAINS = function (text, input) {
  341. return RegExp($.regExpEscape(input.trim()), "i").test(text);
  342. };
  343. _.FILTER_STARTSWITH = function (text, input) {
  344. return RegExp("^" + $.regExpEscape(input.trim()), "i").test(text);
  345. };
  346. _.SORT_BYLENGTH = function (a, b) {
  347. if (a.length !== b.length) {
  348. return a.length - b.length;
  349. }
  350. return a < b? -1 : 1;
  351. };
  352. _.ITEM = function (text, input) {
  353. input = input.trim();
  354. var element = document.createElement("li");
  355. element.setAttribute("aria-selected", "false");
  356. var regex = new RegExp("("+input+")", "ig");
  357. var parts = input ? text.split(regex) : [text];
  358. parts.forEach(function (txt) {
  359. if (input && txt.match(regex)) {
  360. var match = document.createElement("mark");
  361. match.textContent = txt;
  362. element.appendChild(match);
  363. } else {
  364. element.appendChild(document.createTextNode(txt));
  365. }
  366. });
  367. return element;
  368. };
  369. _.REPLACE = function (text) {
  370. this.input.value = text.value;
  371. };
  372. _.DATA = function (item/*, input*/) { return item; };
  373. // Private functions
  374. function Suggestion(data) {
  375. var o = Array.isArray(data)
  376. ? { label: data[0], value: data[1] }
  377. : typeof data === "object" && "label" in data && "value" in data ? data : { label: data, value: data };
  378. this.label = o.label || o.value;
  379. this.value = o.value;
  380. }
  381. Object.defineProperty(Suggestion.prototype = Object.create(String.prototype), "length", {
  382. get: function() { return this.label.length; }
  383. });
  384. Suggestion.prototype.toString = Suggestion.prototype.valueOf = function () {
  385. return "" + this.label;
  386. };
  387. function configure(instance, properties, o) {
  388. for (var i in properties) {
  389. var initial = properties[i],
  390. attrValue = instance.input.getAttribute("data-" + i.toLowerCase());
  391. if (typeof initial === "number") {
  392. instance[i] = parseInt(attrValue);
  393. }
  394. else if (initial === false) { // Boolean options must be false by default anyway
  395. instance[i] = attrValue !== null;
  396. }
  397. else if (initial instanceof Function) {
  398. instance[i] = null;
  399. }
  400. else {
  401. instance[i] = attrValue;
  402. }
  403. if (!instance[i] && instance[i] !== 0) {
  404. instance[i] = (i in o)? o[i] : initial;
  405. }
  406. }
  407. }
  408. // Helpers
  409. var slice = Array.prototype.slice;
  410. function $(expr, con) {
  411. return typeof expr === "string"? (con || document).querySelector(expr) : expr || null;
  412. }
  413. function $$(expr, con) {
  414. return slice.call((con || document).querySelectorAll(expr));
  415. }
  416. $.create = function(tag, o) {
  417. var element = document.createElement(tag);
  418. for (var i in o) {
  419. var val = o[i];
  420. if (i === "inside") {
  421. $(val).appendChild(element);
  422. }
  423. else if (i === "around") {
  424. var ref = $(val);
  425. ref.parentNode.insertBefore(element, ref);
  426. element.appendChild(ref);
  427. }
  428. else if (i in element) {
  429. element[i] = val;
  430. }
  431. else {
  432. element.setAttribute(i, val);
  433. }
  434. }
  435. return element;
  436. };
  437. $.bind = function(element, o) {
  438. if (element) {
  439. for (var event in o) {
  440. var callback = o[event];
  441. event.split(/\s+/).forEach(function (event) {
  442. element.addEventListener(event, callback);
  443. });
  444. }
  445. }
  446. };
  447. $.unbind = function(element, o) {
  448. if (element) {
  449. for (var event in o) {
  450. var callback = o[event];
  451. event.split(/\s+/).forEach(function(event) {
  452. element.removeEventListener(event, callback);
  453. });
  454. }
  455. }
  456. };
  457. $.fire = function(target, type, properties) {
  458. var evt = document.createEvent("HTMLEvents");
  459. evt.initEvent(type, true, true );
  460. for (var j in properties) {
  461. evt[j] = properties[j];
  462. }
  463. return target.dispatchEvent(evt);
  464. };
  465. $.regExpEscape = function (s) {
  466. return s.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&");
  467. };
  468. $.siblingIndex = function (el) {
  469. /* eslint-disable no-cond-assign */
  470. for (var i = 0; el = el.previousElementSibling; i++);
  471. return i;
  472. };
  473. // Initialization
  474. function init() {
  475. $$("input.awesomplete").forEach(function (input) {
  476. new _(input);
  477. });
  478. }
  479. // Are we in a browser? Check for Document constructor
  480. if (typeof Document !== "undefined") {
  481. // DOM already loaded?
  482. if (document.readyState !== "loading") {
  483. init();
  484. }
  485. else {
  486. // Wait for it
  487. document.addEventListener("DOMContentLoaded", init);
  488. }
  489. }
  490. _.$ = $;
  491. _.$$ = $$;
  492. // Make sure to export Awesomplete on self when in a browser
  493. if (typeof self !== "undefined") {
  494. self.Awesomplete = _;
  495. }
  496. // Expose Awesomplete as a CJS module
  497. if (typeof module === "object" && module.exports) {
  498. module.exports = _;
  499. }
  500. return _;
  501. }());
  502. /*** EXPORTS FROM exports-loader ***/
  503. module.exports = Awesomplete;
  504. /***/ }),
  505. /***/ "./node_modules/backbone.browserStorage/backbone.browserStorage.js":
  506. /*!*************************************************************************!*\
  507. !*** ./node_modules/backbone.browserStorage/backbone.browserStorage.js ***!
  508. \*************************************************************************/
  509. /*! no static exports found */
  510. /***/ (function(module, exports, __webpack_require__) {
  511. /**
  512. * Backbone localStorage and sessionStorage Adapter
  513. * Version 0.0.5
  514. *
  515. * https://github.com/jcbrand/Backbone.browserStorage
  516. */
  517. (function (root, factory) {
  518. if (true) {
  519. module.exports = factory(__webpack_require__(/*! backbone */ "./node_modules/backbone/backbone.js"), __webpack_require__(/*! underscore */ "./src/underscore-shim.js"));
  520. } else {}
  521. }(this, function(Backbone, _) {
  522. // A simple module to replace `Backbone.sync` with *browser storage*-based
  523. // persistence. Models are given GUIDS, and saved into a JSON object. Simple
  524. // as that.
  525. // Hold reference to Underscore.js and Backbone.js in the closure in order
  526. // to make things work even if they are removed from the global namespace
  527. // Generate four random hex digits.
  528. function S4() {
  529. return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
  530. }
  531. // Generate a pseudo-GUID by concatenating random hexadecimal.
  532. function guid() {
  533. return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
  534. }
  535. function contains(array, item) {
  536. var i = array.length;
  537. while (i--) if (array[i] === item) return true;
  538. return false;
  539. }
  540. function extend(obj, props) {
  541. for (var key in props) { obj[key] = props[key]; }
  542. return obj;
  543. }
  544. function _browserStorage (name, serializer, type) {
  545. var _store;
  546. if (type === 'local' && !window.localStorage ) {
  547. throw "Backbone.browserStorage: Environment does not support localStorage.";
  548. } else if (type === 'session' && !window.sessionStorage ) {
  549. throw "Backbone.browserStorage: Environment does not support sessionStorage.";
  550. }
  551. this.name = name;
  552. this.serializer = serializer || {
  553. serialize: function(item) {
  554. return _.isObject(item) ? JSON.stringify(item) : item;
  555. },
  556. // fix for "illegal access" error on Android when JSON.parse is passed null
  557. deserialize: function (data) {
  558. return data && JSON.parse(data);
  559. }
  560. };
  561. if (type === 'session') {
  562. this.store = window.sessionStorage;
  563. } else if (type === 'local') {
  564. this.store = window.localStorage;
  565. } else {
  566. throw "Backbone.browserStorage: No storage type was specified";
  567. }
  568. _store = this.store.getItem(this.name);
  569. this.records = (_store && _store.split(",")) || [];
  570. }
  571. // Our Store is represented by a single JS object in *localStorage* or *sessionStorage*.
  572. // Create it with a meaningful name, like the name you'd give a table.
  573. Backbone.BrowserStorage = {
  574. local: function (name, serializer) {
  575. return _browserStorage.bind(this, name, serializer, 'local')();
  576. },
  577. session: function (name, serializer) {
  578. return _browserStorage.bind(this, name, serializer, 'session')();
  579. }
  580. };
  581. // The browser's local and session stores will be extended with this obj.
  582. var _extension = {
  583. // Save the current state of the **Store**
  584. save: function() {
  585. this.store.setItem(this.name, this.records.join(","));
  586. },
  587. // Add a model, giving it a (hopefully)-unique GUID, if it doesn't already
  588. // have an id of it's own.
  589. create: function(model, options) {
  590. if (!model.id) {
  591. model.id = guid();
  592. model.set(model.idAttribute, model.id, options);
  593. }
  594. this.store.setItem(this._itemName(model.id), this.serializer.serialize(model));
  595. this.records.push(model.id.toString());
  596. this.save();
  597. return this.find(model);
  598. },
  599. // Update a model by replacing its copy in `this.data`.
  600. update: function(model) {
  601. this.store.setItem(this._itemName(model.id), this.serializer.serialize(model));
  602. var modelId = model.id.toString();
  603. if (!contains(this.records, modelId)) {
  604. this.records.push(modelId);
  605. this.save();
  606. }
  607. return this.find(model);
  608. },
  609. // Retrieve a model from `this.data` by id.
  610. find: function(model) {
  611. return this.serializer.deserialize(this.store.getItem(this._itemName(model.id)));
  612. },
  613. // Return the array of all models currently in storage.
  614. findAll: function() {
  615. var result = [];
  616. for (var i = 0, id, data; i < this.records.length; i++) {
  617. id = this.records[i];
  618. data = this.serializer.deserialize(this.store.getItem(this._itemName(id)));
  619. if (data !== null) result.push(data);
  620. }
  621. return result;
  622. },
  623. // Delete a model from `this.data`, returning it.
  624. destroy: function(model) {
  625. this.store.removeItem(this._itemName(model.id));
  626. var modelId = model.id.toString();
  627. for (var i = 0, id; i < this.records.length; i++) {
  628. if (this.records[i] === modelId) {
  629. this.records.splice(i, 1);
  630. }
  631. }
  632. this.save();
  633. return model;
  634. },
  635. browserStorage: function() {
  636. return {
  637. session: sessionStorage,
  638. local: localStorage
  639. };
  640. },
  641. // Clear browserStorage for specific collection.
  642. _clear: function() {
  643. var local = this.store, itemRe;
  644. // Escape special regex characters in id.
  645. itemRe = new RegExp("^" + this.name.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") + "-");
  646. // Remove id-tracking item (e.g., "foo").
  647. local.removeItem(this.name);
  648. // Match all data items (e.g., "foo-ID") and remove.
  649. for (var k in local) {
  650. if (itemRe.test(k)) {
  651. local.removeItem(k);
  652. }
  653. }
  654. this.records.length = 0;
  655. },
  656. // Size of browserStorage.
  657. _storageSize: function() {
  658. return this.store.length;
  659. },
  660. _itemName: function(id) {
  661. return this.name+"-"+id;
  662. }
  663. };
  664. extend(Backbone.BrowserStorage.session.prototype, _extension);
  665. extend(Backbone.BrowserStorage.local.prototype, _extension);
  666. // localSync delegate to the model or collection's
  667. // *browserStorage* property, which should be an instance of `Store`.
  668. // window.Store.sync and Backbone.localSync is deprecated, use Backbone.BrowserStorage.sync instead
  669. Backbone.BrowserStorage.sync = Backbone.localSync = function(method, model, options) {
  670. var store = model.browserStorage || model.collection.browserStorage;
  671. var resp, errorMessage;
  672. //If $ is having Deferred - use it.
  673. var syncDfd = Backbone.$ ?
  674. (Backbone.$.Deferred && Backbone.$.Deferred()) :
  675. (Backbone.Deferred && Backbone.Deferred());
  676. try {
  677. switch (method) {
  678. case "read":
  679. resp = model.id !== undefined ? store.find(model) : store.findAll();
  680. break;
  681. case "create":
  682. resp = store.create(model, options);
  683. break;
  684. case "update":
  685. resp = store.update(model, options);
  686. break;
  687. case "delete":
  688. resp = store.destroy(model, options);
  689. break;
  690. }
  691. } catch(error) {
  692. if (error.code === 22 && store._storageSize() === 0)
  693. errorMessage = "Private browsing is unsupported";
  694. else
  695. errorMessage = error.message;
  696. }
  697. if (resp) {
  698. if (options && options.success) {
  699. options.success(resp, options);
  700. }
  701. if (syncDfd) {
  702. syncDfd.resolve(resp);
  703. }
  704. } else {
  705. errorMessage = errorMessage ? errorMessage : "Record Not Found";
  706. if (options && options.error) {
  707. options.error(errorMessage);
  708. }
  709. if (syncDfd) {
  710. syncDfd.reject(errorMessage);
  711. }
  712. }
  713. // add compatibility with $.ajax
  714. // always execute callback for success and error
  715. if (options && options.complete) options.complete(resp);
  716. return syncDfd && syncDfd.promise();
  717. };
  718. Backbone.ajaxSync = Backbone.sync;
  719. Backbone.getSyncMethod = function(model) {
  720. if(model.browserStorage || (model.collection && model.collection.browserStorage)) {
  721. return Backbone.localSync;
  722. }
  723. return Backbone.ajaxSync;
  724. };
  725. // Override 'Backbone.sync' to default to localSync,
  726. // the original 'Backbone.sync' is still available in 'Backbone.ajaxSync'
  727. Backbone.sync = function(method, model, options) {
  728. return Backbone.getSyncMethod(model).apply(this, [method, model, options]);
  729. };
  730. return Backbone.BrowserStorage;
  731. }));
  732. /***/ }),
  733. /***/ "./node_modules/backbone.nativeview/backbone.nativeview.js":
  734. /*!*****************************************************************!*\
  735. !*** ./node_modules/backbone.nativeview/backbone.nativeview.js ***!
  736. \*****************************************************************/
  737. /*! no static exports found */
  738. /***/ (function(module, exports, __webpack_require__) {
  739. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Backbone.NativeView.js 0.3.3
  740. // ---------------
  741. // (c) 2015 Adam Krebs, Jimmy Yuen Ho Wong
  742. // Backbone.NativeView may be freely distributed under the MIT license.
  743. // For all details and documentation:
  744. // https://github.com/akre54/Backbone.NativeView
  745. (function (factory) {
  746. if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! backbone */ "./node_modules/backbone/backbone.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  747. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  748. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  749. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  750. } else {}
  751. }(function (Backbone) {
  752. // Cached regex to match an opening '<' of an HTML tag, possibly left-padded
  753. // with whitespace.
  754. var paddedLt = /^\s*</;
  755. // Caches a local reference to `Element.prototype` for faster access.
  756. var ElementProto = (typeof Element !== 'undefined' && Element.prototype) || {};
  757. // Cross-browser event listener shims
  758. var elementAddEventListener = ElementProto.addEventListener || function(eventName, listener) {
  759. return this.attachEvent('on' + eventName, listener);
  760. }
  761. var elementRemoveEventListener = ElementProto.removeEventListener || function(eventName, listener) {
  762. return this.detachEvent('on' + eventName, listener);
  763. }
  764. var indexOf = function(array, item) {
  765. for (var i = 0, len = array.length; i < len; i++) if (array[i] === item) return i;
  766. return -1;
  767. }
  768. // Find the right `Element#matches` for IE>=9 and modern browsers.
  769. var matchesSelector = ElementProto.matches ||
  770. ElementProto.webkitMatchesSelector ||
  771. ElementProto.mozMatchesSelector ||
  772. ElementProto.msMatchesSelector ||
  773. ElementProto.oMatchesSelector ||
  774. // Make our own `Element#matches` for IE8
  775. function(selector) {
  776. // Use querySelectorAll to find all elements matching the selector,
  777. // then check if the given element is included in that list.
  778. // Executing the query on the parentNode reduces the resulting nodeList,
  779. // (document doesn't have a parentNode).
  780. var nodeList = (this.parentNode || document).querySelectorAll(selector) || [];
  781. return ~indexOf(nodeList, this);
  782. };
  783. // Cache Backbone.View for later access in constructor
  784. var BBView = Backbone.View;
  785. // To extend an existing view to use native methods, extend the View prototype
  786. // with the mixin: _.extend(MyView.prototype, Backbone.NativeViewMixin);
  787. Backbone.NativeViewMixin = {
  788. _domEvents: null,
  789. constructor: function() {
  790. this._domEvents = [];
  791. return BBView.apply(this, arguments);
  792. },
  793. $: function(selector) {
  794. return this.el.querySelectorAll(selector);
  795. },
  796. _removeElement: function() {
  797. this.undelegateEvents();
  798. if (this.el.parentNode) this.el.parentNode.removeChild(this.el);
  799. },
  800. // Apply the `element` to the view. `element` can be a CSS selector,
  801. // a string of HTML, or an Element node.
  802. _setElement: function(element) {
  803. if (typeof element == 'string') {
  804. if (paddedLt.test(element)) {
  805. var el = document.createElement('div');
  806. el.innerHTML = element;
  807. this.el = el.firstChild;
  808. } else {
  809. this.el = document.querySelector(element);
  810. }
  811. } else {
  812. this.el = element;
  813. }
  814. },
  815. // Set a hash of attributes to the view's `el`. We use the "prop" version
  816. // if available, falling back to `setAttribute` for the catch-all.
  817. _setAttributes: function(attrs) {
  818. for (var attr in attrs) {
  819. attr in this.el ? this.el[attr] = attrs[attr] : this.el.setAttribute(attr, attrs[attr]);
  820. }
  821. },
  822. // Make a event delegation handler for the given `eventName` and `selector`
  823. // and attach it to `this.el`.
  824. // If selector is empty, the listener will be bound to `this.el`. If not, a
  825. // new handler that will recursively traverse up the event target's DOM
  826. // hierarchy looking for a node that matches the selector. If one is found,
  827. // the event's `delegateTarget` property is set to it and the return the
  828. // result of calling bound `listener` with the parameters given to the
  829. // handler.
  830. delegate: function(eventName, selector, listener) {
  831. if (typeof selector === 'function') {
  832. listener = selector;
  833. selector = null;
  834. }
  835. var root = this.el;
  836. var handler = selector ? function (e) {
  837. var node = e.target || e.srcElement;
  838. for (; node && node != root; node = node.parentNode) {
  839. if (matchesSelector.call(node, selector)) {
  840. e.delegateTarget = node;
  841. listener(e);
  842. }
  843. }
  844. } : listener;
  845. elementAddEventListener.call(this.el, eventName, handler, false);
  846. this._domEvents.push({eventName: eventName, handler: handler, listener: listener, selector: selector});
  847. return handler;
  848. },
  849. // Remove a single delegated event. Either `eventName` or `selector` must
  850. // be included, `selector` and `listener` are optional.
  851. undelegate: function(eventName, selector, listener) {
  852. if (typeof selector === 'function') {
  853. listener = selector;
  854. selector = null;
  855. }
  856. if (this.el) {
  857. var handlers = this._domEvents.slice();
  858. for (var i = 0, len = handlers.length; i < len; i++) {
  859. var item = handlers[i];
  860. var match = item.eventName === eventName &&
  861. (listener ? item.listener === listener : true) &&
  862. (selector ? item.selector === selector : true);
  863. if (!match) continue;
  864. elementRemoveEventListener.call(this.el, item.eventName, item.handler, false);
  865. this._domEvents.splice(indexOf(handlers, item), 1);
  866. }
  867. }
  868. return this;
  869. },
  870. // Remove all events created with `delegate` from `el`
  871. undelegateEvents: function() {
  872. if (this.el) {
  873. for (var i = 0, len = this._domEvents.length; i < len; i++) {
  874. var item = this._domEvents[i];
  875. elementRemoveEventListener.call(this.el, item.eventName, item.handler, false);
  876. };
  877. this._domEvents.length = 0;
  878. }
  879. return this;
  880. }
  881. };
  882. Backbone.NativeView = Backbone.View.extend(Backbone.NativeViewMixin);
  883. return Backbone.NativeView;
  884. }));
  885. /***/ }),
  886. /***/ "./node_modules/backbone.overview/backbone.orderedlistview.js":
  887. /*!********************************************************************!*\
  888. !*** ./node_modules/backbone.overview/backbone.orderedlistview.js ***!
  889. \********************************************************************/
  890. /*! no static exports found */
  891. /***/ (function(module, exports, __webpack_require__) {
  892. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*** IMPORTS FROM imports-loader ***/
  893. var backbone = (backbone || {});
  894. backbone.nativeview = __webpack_require__(/*! backbone.nativeview */ "./node_modules/backbone.nativeview/backbone.nativeview.js");
  895. /*!
  896. * Backbone.OrderedListView
  897. *
  898. * Copyright (c) 2017, JC Brand <jc@opkode.com>
  899. * Licensed under the Mozilla Public License (MPL)
  900. */
  901. (function (root, factory) {
  902. if (true) {
  903. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! underscore */ "./src/underscore-shim.js"), __webpack_require__(/*! backbone */ "./node_modules/backbone/backbone.js"), __webpack_require__(/*! backbone.overview */ "./node_modules/backbone.overview/backbone.overview.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  904. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  905. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  906. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  907. } else {}
  908. }(this, function (_, Backbone) {
  909. "use strict";
  910. Backbone.OrderedListView = Backbone.Overview.extend({
  911. /* An OrderedListView is a special type of Overview which adds some
  912. * methods and conventions for rendering an ordered list of elements.
  913. */
  914. // The `listItems` attribute denotes the path (from this View) to the
  915. // list of items.
  916. listItems: 'model',
  917. // The `sortEvent` attribute specifies the event which should cause the
  918. // ordered list to be sorted.
  919. sortEvent: 'change',
  920. // The `listSelector` is the selector used to query for the DOM list
  921. // element which contains the ordered items.
  922. listSelector: '.ordered-items',
  923. // The `itemView` is constructor which should be called to create a
  924. // View for a new item.
  925. ItemView: undefined,
  926. // The `subviewIndex` is the attribute of the list element model which
  927. // acts as the index of the subview in the overview.
  928. // An overview is a "Collection" of views, and they can be retrieved
  929. // via an index. By default this is the 'id' attribute, but it could be
  930. // set to something else.
  931. subviewIndex: 'id',
  932. initialize () {
  933. this.sortEventually = _.debounce(
  934. this.sortAndPositionAllItems.bind(this), 500);
  935. this.items = _.get(this, this.listItems);
  936. this.items.on('add', this.sortAndPositionAllItems, this);
  937. this.items.on('remove', this.removeView, this);
  938. if (!_.isNil(this.sortEvent)) {
  939. this.items.on(this.sortEvent, this.sortEventually, this);
  940. }
  941. },
  942. createItemView (item) {
  943. let item_view = this.get(item.get(this.subviewIndex));
  944. if (!item_view) {
  945. item_view = new this.ItemView({model: item});
  946. this.add(item.get(this.subviewIndex), item_view);
  947. } else {
  948. item_view.model = item;
  949. item_view.initialize();
  950. }
  951. item_view.render();
  952. return item_view;
  953. },
  954. removeView (item) {
  955. this.remove(item.get(this.subviewIndex));
  956. },
  957. sortAndPositionAllItems () {
  958. if (!this.items.length) {
  959. return;
  960. }
  961. this.items.sort();
  962. const list_el = this.el.querySelector(this.listSelector);
  963. const div = document.createElement('div');
  964. list_el.parentNode.replaceChild(div, list_el);
  965. this.items.each((item) => {
  966. let view = this.get(item.get(this.subviewIndex));
  967. if (_.isUndefined(view)) {
  968. view = this.createItemView(item)
  969. }
  970. list_el.insertAdjacentElement('beforeend', view.el);
  971. });
  972. div.parentNode.replaceChild(list_el, div);
  973. }
  974. });
  975. return Backbone.OrderedListView;
  976. }));
  977. /***/ }),
  978. /***/ "./node_modules/backbone.overview/backbone.overview.js":
  979. /*!*************************************************************!*\
  980. !*** ./node_modules/backbone.overview/backbone.overview.js ***!
  981. \*************************************************************/
  982. /*! no static exports found */
  983. /***/ (function(module, exports, __webpack_require__) {
  984. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*** IMPORTS FROM imports-loader ***/
  985. var backbone = (backbone || {});
  986. backbone.nativeview = __webpack_require__(/*! backbone.nativeview */ "./node_modules/backbone.nativeview/backbone.nativeview.js");
  987. /*!
  988. * Backbone.Overview
  989. *
  990. * Copyright (c) 2018, JC Brand <jc@opkode.com>
  991. * Licensed under the Mozilla Public License (MPL)
  992. */
  993. (function (root, factory) {
  994. if (true) {
  995. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! underscore */ "./src/underscore-shim.js"), __webpack_require__(/*! backbone */ "./node_modules/backbone/backbone.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  996. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  997. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  998. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  999. } else {}
  1000. }(this, function (_, Backbone) {
  1001. "use strict";
  1002. const View = _.isUndefined(Backbone.NativeView) ? Backbone.View : Backbone.NativeView;
  1003. const Overview = Backbone.Overview = function (options) {
  1004. /* An Overview is a View that contains and keeps track of sub-views.
  1005. * Kind of like what a Collection is to a Model.
  1006. */
  1007. var that = this;
  1008. this.views = {};
  1009. this.keys = _.partial(_.keys, this.views);
  1010. this.getAll = _.partial(_.identity, this.views);
  1011. this.get = function (id) {
  1012. return that.views[id];
  1013. };
  1014. this.xget = function (id) {
  1015. /* Exclusive get. Returns all instances except the given id. */
  1016. return _.filter(that.views, function (view, vid) {
  1017. return vid !== id;
  1018. });
  1019. };
  1020. this.add = function (id, view) {
  1021. that.views[id] = view;
  1022. return view;
  1023. };
  1024. this.remove = function (id) {
  1025. if (typeof id === "undefined") {
  1026. new View().remove.apply(that);
  1027. }
  1028. var view = that.views[id];
  1029. if (view) {
  1030. delete that.views[id];
  1031. view.remove();
  1032. return view;
  1033. }
  1034. };
  1035. this.removeAll = function () {
  1036. _.each(_.keys(that.views), that.remove);
  1037. return that;
  1038. };
  1039. View.apply(this, Array.prototype.slice.apply(arguments));
  1040. };
  1041. var methods = [
  1042. 'all', 'any', 'chain', 'collect', 'contains', 'detect',
  1043. 'difference', 'drop', 'each', 'every', 'filter', 'find',
  1044. 'first', 'foldl', 'foldr', 'forEach', 'head', 'include',
  1045. 'indexOf', 'initial', 'inject', 'invoke', 'isEmpty',
  1046. 'last', 'lastIndexOf', 'map', 'max', 'min', 'reduce',
  1047. 'reduceRight', 'reject', 'rest', 'sample', 'select',
  1048. 'shuffle', 'size', 'some', 'sortBy', 'tail', 'take',
  1049. 'toArray', 'without',
  1050. ];
  1051. // Mix in each Underscore method as a proxy to `Overview#view`.
  1052. _.each(methods, function(method) {
  1053. Overview.prototype[method] = function() {
  1054. var args = Array.prototype.slice.call(arguments);
  1055. args.unshift(this.views);
  1056. return _[method].apply(_, args);
  1057. };
  1058. });
  1059. _.extend(Overview.prototype, View.prototype);
  1060. Overview.extend = View.extend;
  1061. Backbone.OrderedListView = Backbone.Overview.extend({
  1062. // The `listItems` attribute denotes the path (from this View) to the
  1063. // list of items.
  1064. listItems: 'model',
  1065. // The `sortEvent` attribute specifies the event which should cause the
  1066. // ordered list to be sorted.
  1067. sortEvent: 'change',
  1068. // The `listSelector` is the selector used to query for the DOM list
  1069. // element which contains the ordered items.
  1070. listSelector: '.ordered-items',
  1071. // The `itemView` is constructor which should be called to create a
  1072. // View for a new item.
  1073. ItemView: undefined,
  1074. initialize () {
  1075. this.sortEventually = _.debounce(this.sortAndPositionAllItems.bind(this), 500);
  1076. this.items = _.get(this, this.listItems);
  1077. this.items.on('add', this.createItemView, this);
  1078. this.items.on('add', this.sortEventually, this);
  1079. this.items.on(this.sortEvent, this.sortEventually, this);
  1080. },
  1081. createItemView (item) {
  1082. let item_view = this.get(item.get('id'));
  1083. if (!item_view) {
  1084. item_view = new this.ItemView({model: item});
  1085. this.add(item.get('id'), item_view);
  1086. } else {
  1087. item_view.model = item;
  1088. item_view.initialize();
  1089. }
  1090. item_view.render();
  1091. return item_view;
  1092. },
  1093. sortAndPositionAllItems () {
  1094. this.items.sort();
  1095. this.items.each((item) => {
  1096. if (_.isUndefined(this.get(item.get('id')))) {
  1097. this.createItemView(item)
  1098. }
  1099. this.positionItem(item, this.el.querySelector(this.listSelector));
  1100. });
  1101. },
  1102. positionItem (item, list_el) {
  1103. /* Place the View's DOM element in the correct alphabetical
  1104. * position in the list.
  1105. *
  1106. * IMPORTANT: there's an important implicit assumption being
  1107. * made here. And that is that initially this method gets called
  1108. * for each item in the right positional order.
  1109. *
  1110. * In other words, it gets called for the 0th, then the
  1111. * 1st, then the 2nd, 3rd and so on.
  1112. *
  1113. * That's why we call it in the "success" handler after
  1114. * fetching the items, so that we know we have ALL of
  1115. * them and that they're sorted.
  1116. */
  1117. const view = this.get(item.get('id')),
  1118. index = this.items.indexOf(item);
  1119. if (index === 0) {
  1120. list_el.insertAdjacentElement('afterbegin', view.el);
  1121. } else if (index === (this.items.length-1)) {
  1122. list_el.insertAdjacentElement('beforeend', view.el);
  1123. } else {
  1124. const neighbour_el = list_el.querySelector('li:nth-child('+index+')');
  1125. neighbour_el.insertAdjacentElement('afterend', view.el);
  1126. }
  1127. return view;
  1128. }
  1129. });
  1130. return Backbone.Overview;
  1131. }));
  1132. /***/ }),
  1133. /***/ "./node_modules/backbone.vdomview/backbone.vdomview.js":
  1134. /*!*************************************************************!*\
  1135. !*** ./node_modules/backbone.vdomview/backbone.vdomview.js ***!
  1136. \*************************************************************/
  1137. /*! no static exports found */
  1138. /***/ (function(module, exports, __webpack_require__) {
  1139. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*** IMPORTS FROM imports-loader ***/
  1140. var backbone = (backbone || {});
  1141. backbone.nativeview = __webpack_require__(/*! backbone.nativeview */ "./node_modules/backbone.nativeview/backbone.nativeview.js");
  1142. /*!
  1143. * Backbone.VDOMView
  1144. *
  1145. * MIT Licensed. Copyright (c) 2017, JC Brand <jc@opkode.com>
  1146. */
  1147. (function (root, factory) {
  1148. if (true) {
  1149. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [
  1150. __webpack_require__(/*! snabbdom */ "./node_modules/snabbdom/dist/snabbdom.js"),
  1151. __webpack_require__(/*! snabbdom-attributes */ "./node_modules/snabbdom/dist/snabbdom-attributes.js"),
  1152. __webpack_require__(/*! snabbdom-class */ "./node_modules/snabbdom/dist/snabbdom-class.js"),
  1153. __webpack_require__(/*! snabbdom-dataset */ "./node_modules/snabbdom/dist/snabbdom-dataset.js"),
  1154. __webpack_require__(/*! snabbdom-props */ "./node_modules/snabbdom/dist/snabbdom-props.js"),
  1155. __webpack_require__(/*! snabbdom-style */ "./node_modules/snabbdom/dist/snabbdom-style.js"),
  1156. __webpack_require__(/*! tovnode */ "./node_modules/snabbdom/dist/tovnode.js"),
  1157. __webpack_require__(/*! underscore */ "./src/underscore-shim.js"),
  1158. __webpack_require__(/*! backbone */ "./node_modules/backbone/backbone.js")
  1159. ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  1160. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  1161. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  1162. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  1163. } else {}
  1164. }(this, function (
  1165. snabbdom,
  1166. snabbdom_attributes,
  1167. snabbdom_class,
  1168. snabbdom_dataset,
  1169. snabbdom_props,
  1170. snabbdom_style,
  1171. tovnode,
  1172. _,
  1173. Backbone) {
  1174. "use strict";
  1175. let domParser = new DOMParser();
  1176. const patch = snabbdom.init([
  1177. snabbdom_attributes.default,
  1178. snabbdom_class.default,
  1179. snabbdom_dataset.default,
  1180. snabbdom_props.default,
  1181. snabbdom_style.default
  1182. ]);
  1183. const View = _.isUndefined(Backbone.NativeView) ? Backbone.View : Backbone.NativeView;
  1184. function parseHTMLToDOM (html_str) {
  1185. /* Parses a string with HTML and returns a DOM element.
  1186. *
  1187. * Forked from vdom_parser:
  1188. * https://github.com/bitinn/vdom-parser
  1189. */
  1190. if (typeof html_str !== 'string') {
  1191. throw new Error('Invalid parameter type in parseHTMLToDOM');
  1192. }
  1193. if ( !('DOMParser' in window) ) {
  1194. throw new Error(
  1195. 'DOMParser is not available, '+
  1196. 'so parsing string to DOM node is not possible.');
  1197. }
  1198. if (!html_str) {
  1199. return document.createTextNode('');
  1200. }
  1201. domParser = domParser || new DOMParser();
  1202. const doc = domParser.parseFromString(html_str, 'text/html');
  1203. // most tags default to body
  1204. if (doc.body.firstChild) {
  1205. return doc.getElementsByTagName('body')[0].firstChild;
  1206. // some tags, like script and style, default to head
  1207. } else if (doc.head.firstChild && (doc.head.firstChild.tagName !== 'TITLE' || doc.title)) {
  1208. return doc.head.firstChild;
  1209. // special case for html comment, cdata, doctype
  1210. } else if (doc.firstChild && doc.firstChild.tagName !== 'HTML') {
  1211. return doc.firstChild;
  1212. // other element, such as whitespace, or html/body/head tag, fallback to empty text node
  1213. } else {
  1214. return document.createTextNode('');
  1215. }
  1216. }
  1217. Backbone.VDOMView = View.extend({
  1218. updateEventListeners (old_vnode, new_vnode) {
  1219. this.setElement(new_vnode.elm);
  1220. },
  1221. render () {
  1222. if (_.isFunction(this.beforeRender)) {
  1223. this.beforeRender();
  1224. }
  1225. const new_vnode = tovnode.toVNode(parseHTMLToDOM(this.toHTML()));
  1226. new_vnode.data.hook = _.extend({
  1227. create: this.updateEventListeners.bind(this),
  1228. update: this.updateEventListeners.bind(this)
  1229. });
  1230. const el = this.vnode ? this.vnode.elm : this.el;
  1231. if (el.outerHTML !== new_vnode.elm.outerHTML) {
  1232. this.vnode = patch(this.vnode || this.el, new_vnode);
  1233. }
  1234. if (_.isFunction(this.afterRender)) {
  1235. this.afterRender();
  1236. }
  1237. return this;
  1238. }
  1239. });
  1240. return Backbone.VDOMView;
  1241. }));
  1242. /***/ }),
  1243. /***/ "./node_modules/backbone/backbone.js":
  1244. /*!*******************************************!*\
  1245. !*** ./node_modules/backbone/backbone.js ***!
  1246. \*******************************************/
  1247. /*! no static exports found */
  1248. /***/ (function(module, exports, __webpack_require__) {
  1249. /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Backbone.js 1.3.3
  1250. // (c) 2010-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1251. // Backbone may be freely distributed under the MIT license.
  1252. // For all details and documentation:
  1253. // http://backbonejs.org
  1254. (function(factory) {
  1255. // Establish the root object, `window` (`self`) in the browser, or `global` on the server.
  1256. // We use `self` instead of `window` for `WebWorker` support.
  1257. var root = (typeof self == 'object' && self.self === self && self) ||
  1258. (typeof global == 'object' && global.global === global && global);
  1259. // Set up Backbone appropriately for the environment. Start with AMD.
  1260. if (true) {
  1261. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! underscore */ "./src/underscore-shim.js"), __webpack_require__(/*! jquery */ "./src/jquery-stub.js"), exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function(_, $, exports) {
  1262. // Export global even in AMD case in case this script is loaded with
  1263. // others that may still expect a global Backbone.
  1264. root.Backbone = factory(root, exports, _, $);
  1265. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  1266. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  1267. // Next for Node.js or CommonJS. jQuery may not be needed as a module.
  1268. } else { var _, $; }
  1269. })(function(root, Backbone, _, $) {
  1270. // Initial Setup
  1271. // -------------
  1272. // Save the previous value of the `Backbone` variable, so that it can be
  1273. // restored later on, if `noConflict` is used.
  1274. var previousBackbone = root.Backbone;
  1275. // Create a local reference to a common array method we'll want to use later.
  1276. var slice = Array.prototype.slice;
  1277. // Current version of the library. Keep in sync with `package.json`.
  1278. Backbone.VERSION = '1.3.3';
  1279. // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
  1280. // the `$` variable.
  1281. Backbone.$ = $;
  1282. // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
  1283. // to its previous owner. Returns a reference to this Backbone object.
  1284. Backbone.noConflict = function() {
  1285. root.Backbone = previousBackbone;
  1286. return this;
  1287. };
  1288. // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
  1289. // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and
  1290. // set a `X-Http-Method-Override` header.
  1291. Backbone.emulateHTTP = false;
  1292. // Turn on `emulateJSON` to support legacy servers that can't deal with direct
  1293. // `application/json` requests ... this will encode the body as
  1294. // `application/x-www-form-urlencoded` instead and will send the model in a
  1295. // form param named `model`.
  1296. Backbone.emulateJSON = false;
  1297. // Proxy Backbone class methods to Underscore functions, wrapping the model's
  1298. // `attributes` object or collection's `models` array behind the scenes.
  1299. //
  1300. // collection.filter(function(model) { return model.get('age') > 10 });
  1301. // collection.each(this.addView);
  1302. //
  1303. // `Function#apply` can be slow so we use the method's arg count, if we know it.
  1304. var addMethod = function(length, method, attribute) {
  1305. switch (length) {
  1306. case 1: return function() {
  1307. return _[method](this[attribute]);
  1308. };
  1309. case 2: return function(value) {
  1310. return _[method](this[attribute], value);
  1311. };
  1312. case 3: return function(iteratee, context) {
  1313. return _[method](this[attribute], cb(iteratee, this), context);
  1314. };
  1315. case 4: return function(iteratee, defaultVal, context) {
  1316. return _[method](this[attribute], cb(iteratee, this), defaultVal, context);
  1317. };
  1318. default: return function() {
  1319. var args = slice.call(arguments);
  1320. args.unshift(this[attribute]);
  1321. return _[method].apply(_, args);
  1322. };
  1323. }
  1324. };
  1325. var addUnderscoreMethods = function(Class, methods, attribute) {
  1326. _.each(methods, function(length, method) {
  1327. if (_[method]) Class.prototype[method] = addMethod(length, method, attribute);
  1328. });
  1329. };
  1330. // Support `collection.sortBy('attr')` and `collection.findWhere({id: 1})`.
  1331. var cb = function(iteratee, instance) {
  1332. if (_.isFunction(iteratee)) return iteratee;
  1333. if (_.isObject(iteratee) && !instance._isModel(iteratee)) return modelMatcher(iteratee);
  1334. if (_.isString(iteratee)) return function(model) { return model.get(iteratee); };
  1335. return iteratee;
  1336. };
  1337. var modelMatcher = function(attrs) {
  1338. var matcher = _.matches(attrs);
  1339. return function(model) {
  1340. return matcher(model.attributes);
  1341. };
  1342. };
  1343. // Backbone.Events
  1344. // ---------------
  1345. // A module that can be mixed in to *any object* in order to provide it with
  1346. // a custom event channel. You may bind a callback to an event with `on` or
  1347. // remove with `off`; `trigger`-ing an event fires all callbacks in
  1348. // succession.
  1349. //
  1350. // var object = {};
  1351. // _.extend(object, Backbone.Events);
  1352. // object.on('expand', function(){ alert('expanded'); });
  1353. // object.trigger('expand');
  1354. //
  1355. var Events = Backbone.Events = {};
  1356. // Regular expression used to split event strings.
  1357. var eventSplitter = /\s+/;
  1358. // Iterates over the standard `event, callback` (as well as the fancy multiple
  1359. // space-separated events `"change blur", callback` and jQuery-style event
  1360. // maps `{event: callback}`).
  1361. var eventsApi = function(iteratee, events, name, callback, opts) {
  1362. var i = 0, names;
  1363. if (name && typeof name === 'object') {
  1364. // Handle event maps.
  1365. if (callback !== void 0 && 'context' in opts && opts.context === void 0) opts.context = callback;
  1366. for (names = _.keys(name); i < names.length ; i++) {
  1367. events = eventsApi(iteratee, events, names[i], name[names[i]], opts);
  1368. }
  1369. } else if (name && eventSplitter.test(name)) {
  1370. // Handle space-separated event names by delegating them individually.
  1371. for (names = name.split(eventSplitter); i < names.length; i++) {
  1372. events = iteratee(events, names[i], callback, opts);
  1373. }
  1374. } else {
  1375. // Finally, standard events.
  1376. events = iteratee(events, name, callback, opts);
  1377. }
  1378. return events;
  1379. };
  1380. // Bind an event to a `callback` function. Passing `"all"` will bind
  1381. // the callback to all events fired.
  1382. Events.on = function(name, callback, context) {
  1383. return internalOn(this, name, callback, context);
  1384. };
  1385. // Guard the `listening` argument from the public API.
  1386. var internalOn = function(obj, name, callback, context, listening) {
  1387. obj._events = eventsApi(onApi, obj._events || {}, name, callback, {
  1388. context: context,
  1389. ctx: obj,
  1390. listening: listening
  1391. });
  1392. if (listening) {
  1393. var listeners = obj._listeners || (obj._listeners = {});
  1394. listeners[listening.id] = listening;
  1395. }
  1396. return obj;
  1397. };
  1398. // Inversion-of-control versions of `on`. Tell *this* object to listen to
  1399. // an event in another object... keeping track of what it's listening to
  1400. // for easier unbinding later.
  1401. Events.listenTo = function(obj, name, callback) {
  1402. if (!obj) return this;
  1403. var id = obj._listenId || (obj._listenId = _.uniqueId('l'));
  1404. var listeningTo = this._listeningTo || (this._listeningTo = {});
  1405. var listening = listeningTo[id];
  1406. // This object is not listening to any other events on `obj` yet.
  1407. // Setup the necessary references to track the listening callbacks.
  1408. if (!listening) {
  1409. var thisId = this._listenId || (this._listenId = _.uniqueId('l'));
  1410. listening = listeningTo[id] = {obj: obj, objId: id, id: thisId, listeningTo: listeningTo, count: 0};
  1411. }
  1412. // Bind callbacks on obj, and keep track of them on listening.
  1413. internalOn(obj, name, callback, this, listening);
  1414. return this;
  1415. };
  1416. // The reducing API that adds a callback to the `events` object.
  1417. var onApi = function(events, name, callback, options) {
  1418. if (callback) {
  1419. var handlers = events[name] || (events[name] = []);
  1420. var context = options.context, ctx = options.ctx, listening = options.listening;
  1421. if (listening) listening.count++;
  1422. handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening});
  1423. }
  1424. return events;
  1425. };
  1426. // Remove one or many callbacks. If `context` is null, removes all
  1427. // callbacks with that function. If `callback` is null, removes all
  1428. // callbacks for the event. If `name` is null, removes all bound
  1429. // callbacks for all events.
  1430. Events.off = function(name, callback, context) {
  1431. if (!this._events) return this;
  1432. this._events = eventsApi(offApi, this._events, name, callback, {
  1433. context: context,
  1434. listeners: this._listeners
  1435. });
  1436. return this;
  1437. };
  1438. // Tell this object to stop listening to either specific events ... or
  1439. // to every object it's currently listening to.
  1440. Events.stopListening = function(obj, name, callback) {
  1441. var listeningTo = this._listeningTo;
  1442. if (!listeningTo) return this;
  1443. var ids = obj ? [obj._listenId] : _.keys(listeningTo);
  1444. for (var i = 0; i < ids.length; i++) {
  1445. var listening = listeningTo[ids[i]];
  1446. // If listening doesn't exist, this object is not currently
  1447. // listening to obj. Break out early.
  1448. if (!listening) break;
  1449. listening.obj.off(name, callback, this);
  1450. }
  1451. return this;
  1452. };
  1453. // The reducing API that removes a callback from the `events` object.
  1454. var offApi = function(events, name, callback, options) {
  1455. if (!events) return;
  1456. var i = 0, listening;
  1457. var context = options.context, listeners = options.listeners;
  1458. // Delete all events listeners and "drop" events.
  1459. if (!name && !callback && !context) {
  1460. var ids = _.keys(listeners);
  1461. for (; i < ids.length; i++) {
  1462. listening = listeners[ids[i]];
  1463. delete listeners[listening.id];
  1464. delete listening.listeningTo[listening.objId];
  1465. }
  1466. return;
  1467. }
  1468. var names = name ? [name] : _.keys(events);
  1469. for (; i < names.length; i++) {
  1470. name = names[i];
  1471. var handlers = events[name];
  1472. // Bail out if there are no events stored.
  1473. if (!handlers) break;
  1474. // Replace events if there are any remaining. Otherwise, clean up.
  1475. var remaining = [];
  1476. for (var j = 0; j < handlers.length; j++) {
  1477. var handler = handlers[j];
  1478. if (
  1479. callback && callback !== handler.callback &&
  1480. callback !== handler.callback._callback ||
  1481. context && context !== handler.context
  1482. ) {
  1483. remaining.push(handler);
  1484. } else {
  1485. listening = handler.listening;
  1486. if (listening && --listening.count === 0) {
  1487. delete listeners[listening.id];
  1488. delete listening.listeningTo[listening.objId];
  1489. }
  1490. }
  1491. }
  1492. // Update tail event if the list has any events. Otherwise, clean up.
  1493. if (remaining.length) {
  1494. events[name] = remaining;
  1495. } else {
  1496. delete events[name];
  1497. }
  1498. }
  1499. return events;
  1500. };
  1501. // Bind an event to only be triggered a single time. After the first time
  1502. // the callback is invoked, its listener will be removed. If multiple events
  1503. // are passed in using the space-separated syntax, the handler will fire
  1504. // once for each event, not once for a combination of all events.
  1505. Events.once = function(name, callback, context) {
  1506. // Map the event into a `{event: once}` object.
  1507. var events = eventsApi(onceMap, {}, name, callback, _.bind(this.off, this));
  1508. if (typeof name === 'string' && context == null) callback = void 0;
  1509. return this.on(events, callback, context);
  1510. };
  1511. // Inversion-of-control versions of `once`.
  1512. Events.listenToOnce = function(obj, name, callback) {
  1513. // Map the event into a `{event: once}` object.
  1514. var events = eventsApi(onceMap, {}, name, callback, _.bind(this.stopListening, this, obj));
  1515. return this.listenTo(obj, events);
  1516. };
  1517. // Reduces the event callbacks into a map of `{event: onceWrapper}`.
  1518. // `offer` unbinds the `onceWrapper` after it has been called.
  1519. var onceMap = function(map, name, callback, offer) {
  1520. if (callback) {
  1521. var once = map[name] = _.once(function() {
  1522. offer(name, once);
  1523. callback.apply(this, arguments);
  1524. });
  1525. once._callback = callback;
  1526. }
  1527. return map;
  1528. };
  1529. // Trigger one or many events, firing all bound callbacks. Callbacks are
  1530. // passed the same arguments as `trigger` is, apart from the event name
  1531. // (unless you're listening on `"all"`, which will cause your callback to
  1532. // receive the true name of the event as the first argument).
  1533. Events.trigger = function(name) {
  1534. if (!this._events) return this;
  1535. var length = Math.max(0, arguments.length - 1);
  1536. var args = Array(length);
  1537. for (var i = 0; i < length; i++) args[i] = arguments[i + 1];
  1538. eventsApi(triggerApi, this._events, name, void 0, args);
  1539. return this;
  1540. };
  1541. // Handles triggering the appropriate event callbacks.
  1542. var triggerApi = function(objEvents, name, callback, args) {
  1543. if (objEvents) {
  1544. var events = objEvents[name];
  1545. var allEvents = objEvents.all;
  1546. if (events && allEvents) allEvents = allEvents.slice();
  1547. if (events) triggerEvents(events, args);
  1548. if (allEvents) triggerEvents(allEvents, [name].concat(args));
  1549. }
  1550. return objEvents;
  1551. };
  1552. // A difficult-to-believe, but optimized internal dispatch function for
  1553. // triggering events. Tries to keep the usual cases speedy (most internal
  1554. // Backbone events have 3 arguments).
  1555. var triggerEvents = function(events, args) {
  1556. var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
  1557. switch (args.length) {
  1558. case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
  1559. case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
  1560. case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
  1561. case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
  1562. default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;
  1563. }
  1564. };
  1565. // Aliases for backwards compatibility.
  1566. Events.bind = Events.on;
  1567. Events.unbind = Events.off;
  1568. // Allow the `Backbone` object to serve as a global event bus, for folks who
  1569. // want global "pubsub" in a convenient place.
  1570. _.extend(Backbone, Events);
  1571. // Backbone.Model
  1572. // --------------
  1573. // Backbone **Models** are the basic data object in the framework --
  1574. // frequently representing a row in a table in a database on your server.
  1575. // A discrete chunk of data and a bunch of useful, related methods for
  1576. // performing computations and transformations on that data.
  1577. // Create a new model with the specified attributes. A client id (`cid`)
  1578. // is automatically generated and assigned for you.
  1579. var Model = Backbone.Model = function(attributes, options) {
  1580. var attrs = attributes || {};
  1581. options || (options = {});
  1582. this.cid = _.uniqueId(this.cidPrefix);
  1583. this.attributes = {};
  1584. if (options.collection) this.collection = options.collection;
  1585. if (options.parse) attrs = this.parse(attrs, options) || {};
  1586. var defaults = _.result(this, 'defaults');
  1587. attrs = _.defaults(_.extend({}, defaults, attrs), defaults);
  1588. this.set(attrs, options);
  1589. this.changed = {};
  1590. this.initialize.apply(this, arguments);
  1591. };
  1592. // Attach all inheritable methods to the Model prototype.
  1593. _.extend(Model.prototype, Events, {
  1594. // A hash of attributes whose current and previous value differ.
  1595. changed: null,
  1596. // The value returned during the last failed validation.
  1597. validationError: null,
  1598. // The default name for the JSON `id` attribute is `"id"`. MongoDB and
  1599. // CouchDB users may want to set this to `"_id"`.
  1600. idAttribute: 'id',
  1601. // The prefix is used to create the client id which is used to identify models locally.
  1602. // You may want to override this if you're experiencing name clashes with model ids.
  1603. cidPrefix: 'c',
  1604. // Initialize is an empty function by default. Override it with your own
  1605. // initialization logic.
  1606. initialize: function(){},
  1607. // Return a copy of the model's `attributes` object.
  1608. toJSON: function(options) {
  1609. return _.clone(this.attributes);
  1610. },
  1611. // Proxy `Backbone.sync` by default -- but override this if you need
  1612. // custom syncing semantics for *this* particular model.
  1613. sync: function() {
  1614. return Backbone.sync.apply(this, arguments);
  1615. },
  1616. // Get the value of an attribute.
  1617. get: function(attr) {
  1618. return this.attributes[attr];
  1619. },
  1620. // Get the HTML-escaped value of an attribute.
  1621. escape: function(attr) {
  1622. return _.escape(this.get(attr));
  1623. },
  1624. // Returns `true` if the attribute contains a value that is not null
  1625. // or undefined.
  1626. has: function(attr) {
  1627. return this.get(attr) != null;
  1628. },
  1629. // Special-cased proxy to underscore's `_.matches` method.
  1630. matches: function(attrs) {
  1631. return !!_.iteratee(attrs, this)(this.attributes);
  1632. },
  1633. // Set a hash of model attributes on the object, firing `"change"`. This is
  1634. // the core primitive operation of a model, updating the data and notifying
  1635. // anyone who needs to know about the change in state. The heart of the beast.
  1636. set: function(key, val, options) {
  1637. if (key == null) return this;
  1638. // Handle both `"key", value` and `{key: value}` -style arguments.
  1639. var attrs;
  1640. if (typeof key === 'object') {
  1641. attrs = key;
  1642. options = val;
  1643. } else {
  1644. (attrs = {})[key] = val;
  1645. }
  1646. options || (options = {});
  1647. // Run validation.
  1648. if (!this._validate(attrs, options)) return false;
  1649. // Extract attributes and options.
  1650. var unset = options.unset;
  1651. var silent = options.silent;
  1652. var changes = [];
  1653. var changing = this._changing;
  1654. this._changing = true;
  1655. if (!changing) {
  1656. this._previousAttributes = _.clone(this.attributes);
  1657. this.changed = {};
  1658. }
  1659. var current = this.attributes;
  1660. var changed = this.changed;
  1661. var prev = this._previousAttributes;
  1662. // For each `set` attribute, update or delete the current value.
  1663. for (var attr in attrs) {
  1664. val = attrs[attr];
  1665. if (!_.isEqual(current[attr], val)) changes.push(attr);
  1666. if (!_.isEqual(prev[attr], val)) {
  1667. changed[attr] = val;
  1668. } else {
  1669. delete changed[attr];
  1670. }
  1671. unset ? delete current[attr] : current[attr] = val;
  1672. }
  1673. // Update the `id`.
  1674. if (this.idAttribute in attrs) this.id = this.get(this.idAttribute);
  1675. // Trigger all relevant attribute changes.
  1676. if (!silent) {
  1677. if (changes.length) this._pending = options;
  1678. for (var i = 0; i < changes.length; i++) {
  1679. this.trigger('change:' + changes[i], this, current[changes[i]], options);
  1680. }
  1681. }
  1682. // You might be wondering why there's a `while` loop here. Changes can
  1683. // be recursively nested within `"change"` events.
  1684. if (changing) return this;
  1685. if (!silent) {
  1686. while (this._pending) {
  1687. options = this._pending;
  1688. this._pending = false;
  1689. this.trigger('change', this, options);
  1690. }
  1691. }
  1692. this._pending = false;
  1693. this._changing = false;
  1694. return this;
  1695. },
  1696. // Remove an attribute from the model, firing `"change"`. `unset` is a noop
  1697. // if the attribute doesn't exist.
  1698. unset: function(attr, options) {
  1699. return this.set(attr, void 0, _.extend({}, options, {unset: true}));
  1700. },
  1701. // Clear all attributes on the model, firing `"change"`.
  1702. clear: function(options) {
  1703. var attrs = {};
  1704. for (var key in this.attributes) attrs[key] = void 0;
  1705. return this.set(attrs, _.extend({}, options, {unset: true}));
  1706. },
  1707. // Determine if the model has changed since the last `"change"` event.
  1708. // If you specify an attribute name, determine if that attribute has changed.
  1709. hasChanged: function(attr) {
  1710. if (attr == null) return !_.isEmpty(this.changed);
  1711. return _.has(this.changed, attr);
  1712. },
  1713. // Return an object containing all the attributes that have changed, or
  1714. // false if there are no changed attributes. Useful for determining what
  1715. // parts of a view need to be updated and/or what attributes need to be
  1716. // persisted to the server. Unset attributes will be set to undefined.
  1717. // You can also pass an attributes object to diff against the model,
  1718. // determining if there *would be* a change.
  1719. changedAttributes: function(diff) {
  1720. if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
  1721. var old = this._changing ? this._previousAttributes : this.attributes;
  1722. var changed = {};
  1723. for (var attr in diff) {
  1724. var val = diff[attr];
  1725. if (_.isEqual(old[attr], val)) continue;
  1726. changed[attr] = val;
  1727. }
  1728. return _.size(changed) ? changed : false;
  1729. },
  1730. // Get the previous value of an attribute, recorded at the time the last
  1731. // `"change"` event was fired.
  1732. previous: function(attr) {
  1733. if (attr == null || !this._previousAttributes) return null;
  1734. return this._previousAttributes[attr];
  1735. },
  1736. // Get all of the attributes of the model at the time of the previous
  1737. // `"change"` event.
  1738. previousAttributes: function() {
  1739. return _.clone(this._previousAttributes);
  1740. },
  1741. // Fetch the model from the server, merging the response with the model's
  1742. // local attributes. Any changed attributes will trigger a "change" event.
  1743. fetch: function(options) {
  1744. options = _.extend({parse: true}, options);
  1745. var model = this;
  1746. var success = options.success;
  1747. options.success = function(resp) {
  1748. var serverAttrs = options.parse ? model.parse(resp, options) : resp;
  1749. if (!model.set(serverAttrs, options)) return false;
  1750. if (success) success.call(options.context, model, resp, options);
  1751. model.trigger('sync', model, resp, options);
  1752. };
  1753. wrapError(this, options);
  1754. return this.sync('read', this, options);
  1755. },
  1756. // Set a hash of model attributes, and sync the model to the server.
  1757. // If the server returns an attributes hash that differs, the model's
  1758. // state will be `set` again.
  1759. save: function(key, val, options) {
  1760. // Handle both `"key", value` and `{key: value}` -style arguments.
  1761. var attrs;
  1762. if (key == null || typeof key === 'object') {
  1763. attrs = key;
  1764. options = val;
  1765. } else {
  1766. (attrs = {})[key] = val;
  1767. }
  1768. options = _.extend({validate: true, parse: true}, options);
  1769. var wait = options.wait;
  1770. // If we're not waiting and attributes exist, save acts as
  1771. // `set(attr).save(null, opts)` with validation. Otherwise, check if
  1772. // the model will be valid when the attributes, if any, are set.
  1773. if (attrs && !wait) {
  1774. if (!this.set(attrs, options)) return false;
  1775. } else if (!this._validate(attrs, options)) {
  1776. return false;
  1777. }
  1778. // After a successful server-side save, the client is (optionally)
  1779. // updated with the server-side state.
  1780. var model = this;
  1781. var success = options.success;
  1782. var attributes = this.attributes;
  1783. options.success = function(resp) {
  1784. // Ensure attributes are restored during synchronous saves.
  1785. model.attributes = attributes;
  1786. var serverAttrs = options.parse ? model.parse(resp, options) : resp;
  1787. if (wait) serverAttrs = _.extend({}, attrs, serverAttrs);
  1788. if (serverAttrs && !model.set(serverAttrs, options)) return false;
  1789. if (success) success.call(options.context, model, resp, options);
  1790. model.trigger('sync', model, resp, options);
  1791. };
  1792. wrapError(this, options);
  1793. // Set temporary attributes if `{wait: true}` to properly find new ids.
  1794. if (attrs && wait) this.attributes = _.extend({}, attributes, attrs);
  1795. var method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
  1796. if (method === 'patch' && !options.attrs) options.attrs = attrs;
  1797. var xhr = this.sync(method, this, options);
  1798. // Restore attributes.
  1799. this.attributes = attributes;
  1800. return xhr;
  1801. },
  1802. // Destroy this model on the server if it was already persisted.
  1803. // Optimistically removes the model from its collection, if it has one.
  1804. // If `wait: true` is passed, waits for the server to respond before removal.
  1805. destroy: function(options) {
  1806. options = options ? _.clone(options) : {};
  1807. var model = this;
  1808. var success = options.success;
  1809. var wait = options.wait;
  1810. var destroy = function() {
  1811. model.stopListening();
  1812. model.trigger('destroy', model, model.collection, options);
  1813. };
  1814. options.success = function(resp) {
  1815. if (wait) destroy();
  1816. if (success) success.call(options.context, model, resp, options);
  1817. if (!model.isNew()) model.trigger('sync', model, resp, options);
  1818. };
  1819. var xhr = false;
  1820. if (this.isNew()) {
  1821. _.defer(options.success);
  1822. } else {
  1823. wrapError(this, options);
  1824. xhr = this.sync('delete', this, options);
  1825. }
  1826. if (!wait) destroy();
  1827. return xhr;
  1828. },
  1829. // Default URL for the model's representation on the server -- if you're
  1830. // using Backbone's restful methods, override this to change the endpoint
  1831. // that will be called.
  1832. url: function() {
  1833. var base =
  1834. _.result(this, 'urlRoot') ||
  1835. _.result(this.collection, 'url') ||
  1836. urlError();
  1837. if (this.isNew()) return base;
  1838. var id = this.get(this.idAttribute);
  1839. return base.replace(/[^\/]$/, '$&/') + encodeURIComponent(id);
  1840. },
  1841. // **parse** converts a response into the hash of attributes to be `set` on
  1842. // the model. The default implementation is just to pass the response along.
  1843. parse: function(resp, options) {
  1844. return resp;
  1845. },
  1846. // Create a new model with identical attributes to this one.
  1847. clone: function() {
  1848. return new this.constructor(this.attributes);
  1849. },
  1850. // A model is new if it has never been saved to the server, and lacks an id.
  1851. isNew: function() {
  1852. return !this.has(this.idAttribute);
  1853. },
  1854. // Check if the model is currently in a valid state.
  1855. isValid: function(options) {
  1856. return this._validate({}, _.extend({}, options, {validate: true}));
  1857. },
  1858. // Run validation against the next complete set of model attributes,
  1859. // returning `true` if all is well. Otherwise, fire an `"invalid"` event.
  1860. _validate: function(attrs, options) {
  1861. if (!options.validate || !this.validate) return true;
  1862. attrs = _.extend({}, this.attributes, attrs);
  1863. var error = this.validationError = this.validate(attrs, options) || null;
  1864. if (!error) return true;
  1865. this.trigger('invalid', this, error, _.extend(options, {validationError: error}));
  1866. return false;
  1867. }
  1868. });
  1869. // Underscore methods that we want to implement on the Model, mapped to the
  1870. // number of arguments they take.
  1871. var modelMethods = {keys: 1, values: 1, pairs: 1, invert: 1, pick: 0,
  1872. omit: 0, chain: 1, isEmpty: 1};
  1873. // Mix in each Underscore method as a proxy to `Model#attributes`.
  1874. addUnderscoreMethods(Model, modelMethods, 'attributes');
  1875. // Backbone.Collection
  1876. // -------------------
  1877. // If models tend to represent a single row of data, a Backbone Collection is
  1878. // more analogous to a table full of data ... or a small slice or page of that
  1879. // table, or a collection of rows that belong together for a particular reason
  1880. // -- all of the messages in this particular folder, all of the documents
  1881. // belonging to this particular author, and so on. Collections maintain
  1882. // indexes of their models, both in order, and for lookup by `id`.
  1883. // Create a new **Collection**, perhaps to contain a specific type of `model`.
  1884. // If a `comparator` is specified, the Collection will maintain
  1885. // its models in sort order, as they're added and removed.
  1886. var Collection = Backbone.Collection = function(models, options) {
  1887. options || (options = {});
  1888. if (options.model) this.model = options.model;
  1889. if (options.comparator !== void 0) this.comparator = options.comparator;
  1890. this._reset();
  1891. this.initialize.apply(this, arguments);
  1892. if (models) this.reset(models, _.extend({silent: true}, options));
  1893. };
  1894. // Default options for `Collection#set`.
  1895. var setOptions = {add: true, remove: true, merge: true};
  1896. var addOptions = {add: true, remove: false};
  1897. // Splices `insert` into `array` at index `at`.
  1898. var splice = function(array, insert, at) {
  1899. at = Math.min(Math.max(at, 0), array.length);
  1900. var tail = Array(array.length - at);
  1901. var length = insert.length;
  1902. var i;
  1903. for (i = 0; i < tail.length; i++) tail[i] = array[i + at];
  1904. for (i = 0; i < length; i++) array[i + at] = insert[i];
  1905. for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i];
  1906. };
  1907. // Define the Collection's inheritable methods.
  1908. _.extend(Collection.prototype, Events, {
  1909. // The default model for a collection is just a **Backbone.Model**.
  1910. // This should be overridden in most cases.
  1911. model: Model,
  1912. // Initialize is an empty function by default. Override it with your own
  1913. // initialization logic.
  1914. initialize: function(){},
  1915. // The JSON representation of a Collection is an array of the
  1916. // models' attributes.
  1917. toJSON: function(options) {
  1918. return this.map(function(model) { return model.toJSON(options); });
  1919. },
  1920. // Proxy `Backbone.sync` by default.
  1921. sync: function() {
  1922. return Backbone.sync.apply(this, arguments);
  1923. },
  1924. // Add a model, or list of models to the set. `models` may be Backbone
  1925. // Models or raw JavaScript objects to be converted to Models, or any
  1926. // combination of the two.
  1927. add: function(models, options) {
  1928. return this.set(models, _.extend({merge: false}, options, addOptions));
  1929. },
  1930. // Remove a model, or a list of models from the set.
  1931. remove: function(models, options) {
  1932. options = _.extend({}, options);
  1933. var singular = !_.isArray(models);
  1934. models = singular ? [models] : models.slice();
  1935. var removed = this._removeModels(models, options);
  1936. if (!options.silent && removed.length) {
  1937. options.changes = {added: [], merged: [], removed: removed};
  1938. this.trigger('update', this, options);
  1939. }
  1940. return singular ? removed[0] : removed;
  1941. },
  1942. // Update a collection by `set`-ing a new list of models, adding new ones,
  1943. // removing models that are no longer present, and merging models that
  1944. // already exist in the collection, as necessary. Similar to **Model#set**,
  1945. // the core operation for updating the data contained by the collection.
  1946. set: function(models, options) {
  1947. if (models == null) return;
  1948. options = _.extend({}, setOptions, options);
  1949. if (options.parse && !this._isModel(models)) {
  1950. models = this.parse(models, options) || [];
  1951. }
  1952. var singular = !_.isArray(models);
  1953. models = singular ? [models] : models.slice();
  1954. var at = options.at;
  1955. if (at != null) at = +at;
  1956. if (at > this.length) at = this.length;
  1957. if (at < 0) at += this.length + 1;
  1958. var set = [];
  1959. var toAdd = [];
  1960. var toMerge = [];
  1961. var toRemove = [];
  1962. var modelMap = {};
  1963. var add = options.add;
  1964. var merge = options.merge;
  1965. var remove = options.remove;
  1966. var sort = false;
  1967. var sortable = this.comparator && at == null && options.sort !== false;
  1968. var sortAttr = _.isString(this.comparator) ? this.comparator : null;
  1969. // Turn bare objects into model references, and prevent invalid models
  1970. // from being added.
  1971. var model, i;
  1972. for (i = 0; i < models.length; i++) {
  1973. model = models[i];
  1974. // If a duplicate is found, prevent it from being added and
  1975. // optionally merge it into the existing model.
  1976. var existing = this.get(model);
  1977. if (existing) {
  1978. if (merge && model !== existing) {
  1979. var attrs = this._isModel(model) ? model.attributes : model;
  1980. if (options.parse) attrs = existing.parse(attrs, options);
  1981. existing.set(attrs, options);
  1982. toMerge.push(existing);
  1983. if (sortable && !sort) sort = existing.hasChanged(sortAttr);
  1984. }
  1985. if (!modelMap[existing.cid]) {
  1986. modelMap[existing.cid] = true;
  1987. set.push(existing);
  1988. }
  1989. models[i] = existing;
  1990. // If this is a new, valid model, push it to the `toAdd` list.
  1991. } else if (add) {
  1992. model = models[i] = this._prepareModel(model, options);
  1993. if (model) {
  1994. toAdd.push(model);
  1995. this._addReference(model, options);
  1996. modelMap[model.cid] = true;
  1997. set.push(model);
  1998. }
  1999. }
  2000. }
  2001. // Remove stale models.
  2002. if (remove) {
  2003. for (i = 0; i < this.length; i++) {
  2004. model = this.models[i];
  2005. if (!modelMap[model.cid]) toRemove.push(model);
  2006. }
  2007. if (toRemove.length) this._removeModels(toRemove, options);
  2008. }
  2009. // See if sorting is needed, update `length` and splice in new models.
  2010. var orderChanged = false;
  2011. var replace = !sortable && add && remove;
  2012. if (set.length && replace) {
  2013. orderChanged = this.length !== set.length || _.some(this.models, function(m, index) {
  2014. return m !== set[index];
  2015. });
  2016. this.models.length = 0;
  2017. splice(this.models, set, 0);
  2018. this.length = this.models.length;
  2019. } else if (toAdd.length) {
  2020. if (sortable) sort = true;
  2021. splice(this.models, toAdd, at == null ? this.length : at);
  2022. this.length = this.models.length;
  2023. }
  2024. // Silently sort the collection if appropriate.
  2025. if (sort) this.sort({silent: true});
  2026. // Unless silenced, it's time to fire all appropriate add/sort/update events.
  2027. if (!options.silent) {
  2028. for (i = 0; i < toAdd.length; i++) {
  2029. if (at != null) options.index = at + i;
  2030. model = toAdd[i];
  2031. model.trigger('add', model, this, options);
  2032. }
  2033. if (sort || orderChanged) this.trigger('sort', this, options);
  2034. if (toAdd.length || toRemove.length || toMerge.length) {
  2035. options.changes = {
  2036. added: toAdd,
  2037. removed: toRemove,
  2038. merged: toMerge
  2039. };
  2040. this.trigger('update', this, options);
  2041. }
  2042. }
  2043. // Return the added (or merged) model (or models).
  2044. return singular ? models[0] : models;
  2045. },
  2046. // When you have more items than you want to add or remove individually,
  2047. // you can reset the entire set with a new list of models, without firing
  2048. // any granular `add` or `remove` events. Fires `reset` when finished.
  2049. // Useful for bulk operations and optimizations.
  2050. reset: function(models, options) {
  2051. options = options ? _.clone(options) : {};
  2052. for (var i = 0; i < this.models.length; i++) {
  2053. this._removeReference(this.models[i], options);
  2054. }
  2055. options.previousModels = this.models;
  2056. this._reset();
  2057. models = this.add(models, _.extend({silent: true}, options));
  2058. if (!options.silent) this.trigger('reset', this, options);
  2059. return models;
  2060. },
  2061. // Add a model to the end of the collection.
  2062. push: function(model, options) {
  2063. return this.add(model, _.extend({at: this.length}, options));
  2064. },
  2065. // Remove a model from the end of the collection.
  2066. pop: function(options) {
  2067. var model = this.at(this.length - 1);
  2068. return this.remove(model, options);
  2069. },
  2070. // Add a model to the beginning of the collection.
  2071. unshift: function(model, options) {
  2072. return this.add(model, _.extend({at: 0}, options));
  2073. },
  2074. // Remove a model from the beginning of the collection.
  2075. shift: function(options) {
  2076. var model = this.at(0);
  2077. return this.remove(model, options);
  2078. },
  2079. // Slice out a sub-array of models from the collection.
  2080. slice: function() {
  2081. return slice.apply(this.models, arguments);
  2082. },
  2083. // Get a model from the set by id, cid, model object with id or cid
  2084. // properties, or an attributes object that is transformed through modelId.
  2085. get: function(obj) {
  2086. if (obj == null) return void 0;
  2087. return this._byId[obj] ||
  2088. this._byId[this.modelId(obj.attributes || obj)] ||
  2089. obj.cid && this._byId[obj.cid];
  2090. },
  2091. // Returns `true` if the model is in the collection.
  2092. has: function(obj) {
  2093. return this.get(obj) != null;
  2094. },
  2095. // Get the model at the given index.
  2096. at: function(index) {
  2097. if (index < 0) index += this.length;
  2098. return this.models[index];
  2099. },
  2100. // Return models with matching attributes. Useful for simple cases of
  2101. // `filter`.
  2102. where: function(attrs, first) {
  2103. return this[first ? 'find' : 'filter'](attrs);
  2104. },
  2105. // Return the first model with matching attributes. Useful for simple cases
  2106. // of `find`.
  2107. findWhere: function(attrs) {
  2108. return this.where(attrs, true);
  2109. },
  2110. // Force the collection to re-sort itself. You don't need to call this under
  2111. // normal circumstances, as the set will maintain sort order as each item
  2112. // is added.
  2113. sort: function(options) {
  2114. var comparator = this.comparator;
  2115. if (!comparator) throw new Error('Cannot sort a set without a comparator');
  2116. options || (options = {});
  2117. var length = comparator.length;
  2118. if (_.isFunction(comparator)) comparator = _.bind(comparator, this);
  2119. // Run sort based on type of `comparator`.
  2120. if (length === 1 || _.isString(comparator)) {
  2121. this.models = this.sortBy(comparator);
  2122. } else {
  2123. this.models.sort(comparator);
  2124. }
  2125. if (!options.silent) this.trigger('sort', this, options);
  2126. return this;
  2127. },
  2128. // Pluck an attribute from each model in the collection.
  2129. pluck: function(attr) {
  2130. return this.map(attr + '');
  2131. },
  2132. // Fetch the default set of models for this collection, resetting the
  2133. // collection when they arrive. If `reset: true` is passed, the response
  2134. // data will be passed through the `reset` method instead of `set`.
  2135. fetch: function(options) {
  2136. options = _.extend({parse: true}, options);
  2137. var success = options.success;
  2138. var collection = this;
  2139. options.success = function(resp) {
  2140. var method = options.reset ? 'reset' : 'set';
  2141. collection[method](resp, options);
  2142. if (success) success.call(options.context, collection, resp, options);
  2143. collection.trigger('sync', collection, resp, options);
  2144. };
  2145. wrapError(this, options);
  2146. return this.sync('read', this, options);
  2147. },
  2148. // Create a new instance of a model in this collection. Add the model to the
  2149. // collection immediately, unless `wait: true` is passed, in which case we
  2150. // wait for the server to agree.
  2151. create: function(model, options) {
  2152. options = options ? _.clone(options) : {};
  2153. var wait = options.wait;
  2154. model = this._prepareModel(model, options);
  2155. if (!model) return false;
  2156. if (!wait) this.add(model, options);
  2157. var collection = this;
  2158. var success = options.success;
  2159. options.success = function(m, resp, callbackOpts) {
  2160. if (wait) collection.add(m, callbackOpts);
  2161. if (success) success.call(callbackOpts.context, m, resp, callbackOpts);
  2162. };
  2163. model.save(null, options);
  2164. return model;
  2165. },
  2166. // **parse** converts a response into a list of models to be added to the
  2167. // collection. The default implementation is just to pass it through.
  2168. parse: function(resp, options) {
  2169. return resp;
  2170. },
  2171. // Create a new collection with an identical list of models as this one.
  2172. clone: function() {
  2173. return new this.constructor(this.models, {
  2174. model: this.model,
  2175. comparator: this.comparator
  2176. });
  2177. },
  2178. // Define how to uniquely identify models in the collection.
  2179. modelId: function(attrs) {
  2180. return attrs[this.model.prototype.idAttribute || 'id'];
  2181. },
  2182. // Private method to reset all internal state. Called when the collection
  2183. // is first initialized or reset.
  2184. _reset: function() {
  2185. this.length = 0;
  2186. this.models = [];
  2187. this._byId = {};
  2188. },
  2189. // Prepare a hash of attributes (or other model) to be added to this
  2190. // collection.
  2191. _prepareModel: function(attrs, options) {
  2192. if (this._isModel(attrs)) {
  2193. if (!attrs.collection) attrs.collection = this;
  2194. return attrs;
  2195. }
  2196. options = options ? _.clone(options) : {};
  2197. options.collection = this;
  2198. var model = new this.model(attrs, options);
  2199. if (!model.validationError) return model;
  2200. this.trigger('invalid', this, model.validationError, options);
  2201. return false;
  2202. },
  2203. // Internal method called by both remove and set.
  2204. _removeModels: function(models, options) {
  2205. var removed = [];
  2206. for (var i = 0; i < models.length; i++) {
  2207. var model = this.get(models[i]);
  2208. if (!model) continue;
  2209. var index = this.indexOf(model);
  2210. this.models.splice(index, 1);
  2211. this.length--;
  2212. // Remove references before triggering 'remove' event to prevent an
  2213. // infinite loop. #3693
  2214. delete this._byId[model.cid];
  2215. var id = this.modelId(model.attributes);
  2216. if (id != null) delete this._byId[id];
  2217. if (!options.silent) {
  2218. options.index = index;
  2219. model.trigger('remove', model, this, options);
  2220. }
  2221. removed.push(model);
  2222. this._removeReference(model, options);
  2223. }
  2224. return removed;
  2225. },
  2226. // Method for checking whether an object should be considered a model for
  2227. // the purposes of adding to the collection.
  2228. _isModel: function(model) {
  2229. return model instanceof Model;
  2230. },
  2231. // Internal method to create a model's ties to a collection.
  2232. _addReference: function(model, options) {
  2233. this._byId[model.cid] = model;
  2234. var id = this.modelId(model.attributes);
  2235. if (id != null) this._byId[id] = model;
  2236. model.on('all', this._onModelEvent, this);
  2237. },
  2238. // Internal method to sever a model's ties to a collection.
  2239. _removeReference: function(model, options) {
  2240. delete this._byId[model.cid];
  2241. var id = this.modelId(model.attributes);
  2242. if (id != null) delete this._byId[id];
  2243. if (this === model.collection) delete model.collection;
  2244. model.off('all', this._onModelEvent, this);
  2245. },
  2246. // Internal method called every time a model in the set fires an event.
  2247. // Sets need to update their indexes when models change ids. All other
  2248. // events simply proxy through. "add" and "remove" events that originate
  2249. // in other collections are ignored.
  2250. _onModelEvent: function(event, model, collection, options) {
  2251. if (model) {
  2252. if ((event === 'add' || event === 'remove') && collection !== this) return;
  2253. if (event === 'destroy') this.remove(model, options);
  2254. if (event === 'change') {
  2255. var prevId = this.modelId(model.previousAttributes());
  2256. var id = this.modelId(model.attributes);
  2257. if (prevId !== id) {
  2258. if (prevId != null) delete this._byId[prevId];
  2259. if (id != null) this._byId[id] = model;
  2260. }
  2261. }
  2262. }
  2263. this.trigger.apply(this, arguments);
  2264. }
  2265. });
  2266. // Underscore methods that we want to implement on the Collection.
  2267. // 90% of the core usefulness of Backbone Collections is actually implemented
  2268. // right here:
  2269. var collectionMethods = {forEach: 3, each: 3, map: 3, collect: 3, reduce: 0,
  2270. foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3,
  2271. select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3,
  2272. contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3,
  2273. head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3,
  2274. without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3,
  2275. isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3,
  2276. sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3};
  2277. // Mix in each Underscore method as a proxy to `Collection#models`.
  2278. addUnderscoreMethods(Collection, collectionMethods, 'models');
  2279. // Backbone.View
  2280. // -------------
  2281. // Backbone Views are almost more convention than they are actual code. A View
  2282. // is simply a JavaScript object that represents a logical chunk of UI in the
  2283. // DOM. This might be a single item, an entire list, a sidebar or panel, or
  2284. // even the surrounding frame which wraps your whole app. Defining a chunk of
  2285. // UI as a **View** allows you to define your DOM events declaratively, without
  2286. // having to worry about render order ... and makes it easy for the view to
  2287. // react to specific changes in the state of your models.
  2288. // Creating a Backbone.View creates its initial element outside of the DOM,
  2289. // if an existing element is not provided...
  2290. var View = Backbone.View = function(options) {
  2291. this.cid = _.uniqueId('view');
  2292. _.extend(this, _.pick(options, viewOptions));
  2293. this._ensureElement();
  2294. this.initialize.apply(this, arguments);
  2295. };
  2296. // Cached regex to split keys for `delegate`.
  2297. var delegateEventSplitter = /^(\S+)\s*(.*)$/;
  2298. // List of view options to be set as properties.
  2299. var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
  2300. // Set up all inheritable **Backbone.View** properties and methods.
  2301. _.extend(View.prototype, Events, {
  2302. // The default `tagName` of a View's element is `"div"`.
  2303. tagName: 'div',
  2304. // jQuery delegate for element lookup, scoped to DOM elements within the
  2305. // current view. This should be preferred to global lookups where possible.
  2306. $: function(selector) {
  2307. return this.$el.find(selector);
  2308. },
  2309. // Initialize is an empty function by default. Override it with your own
  2310. // initialization logic.
  2311. initialize: function(){},
  2312. // **render** is the core function that your view should override, in order
  2313. // to populate its element (`this.el`), with the appropriate HTML. The
  2314. // convention is for **render** to always return `this`.
  2315. render: function() {
  2316. return this;
  2317. },
  2318. // Remove this view by taking the element out of the DOM, and removing any
  2319. // applicable Backbone.Events listeners.
  2320. remove: function() {
  2321. this._removeElement();
  2322. this.stopListening();
  2323. return this;
  2324. },
  2325. // Remove this view's element from the document and all event listeners
  2326. // attached to it. Exposed for subclasses using an alternative DOM
  2327. // manipulation API.
  2328. _removeElement: function() {
  2329. this.$el.remove();
  2330. },
  2331. // Change the view's element (`this.el` property) and re-delegate the
  2332. // view's events on the new element.
  2333. setElement: function(element) {
  2334. this.undelegateEvents();
  2335. this._setElement(element);
  2336. this.delegateEvents();
  2337. return this;
  2338. },
  2339. // Creates the `this.el` and `this.$el` references for this view using the
  2340. // given `el`. `el` can be a CSS selector or an HTML string, a jQuery
  2341. // context or an element. Subclasses can override this to utilize an
  2342. // alternative DOM manipulation API and are only required to set the
  2343. // `this.el` property.
  2344. _setElement: function(el) {
  2345. this.$el = el instanceof Backbone.$ ? el : Backbone.$(el);
  2346. this.el = this.$el[0];
  2347. },
  2348. // Set callbacks, where `this.events` is a hash of
  2349. //
  2350. // *{"event selector": "callback"}*
  2351. //
  2352. // {
  2353. // 'mousedown .title': 'edit',
  2354. // 'click .button': 'save',
  2355. // 'click .open': function(e) { ... }
  2356. // }
  2357. //
  2358. // pairs. Callbacks will be bound to the view, with `this` set properly.
  2359. // Uses event delegation for efficiency.
  2360. // Omitting the selector binds the event to `this.el`.
  2361. delegateEvents: function(events) {
  2362. events || (events = _.result(this, 'events'));
  2363. if (!events) return this;
  2364. this.undelegateEvents();
  2365. for (var key in events) {
  2366. var method = events[key];
  2367. if (!_.isFunction(method)) method = this[method];
  2368. if (!method) continue;
  2369. var match = key.match(delegateEventSplitter);
  2370. this.delegate(match[1], match[2], _.bind(method, this));
  2371. }
  2372. return this;
  2373. },
  2374. // Add a single event listener to the view's element (or a child element
  2375. // using `selector`). This only works for delegate-able events: not `focus`,
  2376. // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer.
  2377. delegate: function(eventName, selector, listener) {
  2378. this.$el.on(eventName + '.delegateEvents' + this.cid, selector, listener);
  2379. return this;
  2380. },
  2381. // Clears all callbacks previously bound to the view by `delegateEvents`.
  2382. // You usually don't need to use this, but may wish to if you have multiple
  2383. // Backbone views attached to the same DOM element.
  2384. undelegateEvents: function() {
  2385. if (this.$el) this.$el.off('.delegateEvents' + this.cid);
  2386. return this;
  2387. },
  2388. // A finer-grained `undelegateEvents` for removing a single delegated event.
  2389. // `selector` and `listener` are both optional.
  2390. undelegate: function(eventName, selector, listener) {
  2391. this.$el.off(eventName + '.delegateEvents' + this.cid, selector, listener);
  2392. return this;
  2393. },
  2394. // Produces a DOM element to be assigned to your view. Exposed for
  2395. // subclasses using an alternative DOM manipulation API.
  2396. _createElement: function(tagName) {
  2397. return document.createElement(tagName);
  2398. },
  2399. // Ensure that the View has a DOM element to render into.
  2400. // If `this.el` is a string, pass it through `$()`, take the first
  2401. // matching element, and re-assign it to `el`. Otherwise, create
  2402. // an element from the `id`, `className` and `tagName` properties.
  2403. _ensureElement: function() {
  2404. if (!this.el) {
  2405. var attrs = _.extend({}, _.result(this, 'attributes'));
  2406. if (this.id) attrs.id = _.result(this, 'id');
  2407. if (this.className) attrs['class'] = _.result(this, 'className');
  2408. this.setElement(this._createElement(_.result(this, 'tagName')));
  2409. this._setAttributes(attrs);
  2410. } else {
  2411. this.setElement(_.result(this, 'el'));
  2412. }
  2413. },
  2414. // Set attributes from a hash on this view's element. Exposed for
  2415. // subclasses using an alternative DOM manipulation API.
  2416. _setAttributes: function(attributes) {
  2417. this.$el.attr(attributes);
  2418. }
  2419. });
  2420. // Backbone.sync
  2421. // -------------
  2422. // Override this function to change the manner in which Backbone persists
  2423. // models to the server. You will be passed the type of request, and the
  2424. // model in question. By default, makes a RESTful Ajax request
  2425. // to the model's `url()`. Some possible customizations could be:
  2426. //
  2427. // * Use `setTimeout` to batch rapid-fire updates into a single request.
  2428. // * Send up the models as XML instead of JSON.
  2429. // * Persist models via WebSockets instead of Ajax.
  2430. //
  2431. // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
  2432. // as `POST`, with a `_method` parameter containing the true HTTP method,
  2433. // as well as all requests with the body as `application/x-www-form-urlencoded`
  2434. // instead of `application/json` with the model in a param named `model`.
  2435. // Useful when interfacing with server-side languages like **PHP** that make
  2436. // it difficult to read the body of `PUT` requests.
  2437. Backbone.sync = function(method, model, options) {
  2438. var type = methodMap[method];
  2439. // Default options, unless specified.
  2440. _.defaults(options || (options = {}), {
  2441. emulateHTTP: Backbone.emulateHTTP,
  2442. emulateJSON: Backbone.emulateJSON
  2443. });
  2444. // Default JSON-request options.
  2445. var params = {type: type, dataType: 'json'};
  2446. // Ensure that we have a URL.
  2447. if (!options.url) {
  2448. params.url = _.result(model, 'url') || urlError();
  2449. }
  2450. // Ensure that we have the appropriate request data.
  2451. if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
  2452. params.contentType = 'application/json';
  2453. params.data = JSON.stringify(options.attrs || model.toJSON(options));
  2454. }
  2455. // For older servers, emulate JSON by encoding the request into an HTML-form.
  2456. if (options.emulateJSON) {
  2457. params.contentType = 'application/x-www-form-urlencoded';
  2458. params.data = params.data ? {model: params.data} : {};
  2459. }
  2460. // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
  2461. // And an `X-HTTP-Method-Override` header.
  2462. if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
  2463. params.type = 'POST';
  2464. if (options.emulateJSON) params.data._method = type;
  2465. var beforeSend = options.beforeSend;
  2466. options.beforeSend = function(xhr) {
  2467. xhr.setRequestHeader('X-HTTP-Method-Override', type);
  2468. if (beforeSend) return beforeSend.apply(this, arguments);
  2469. };
  2470. }
  2471. // Don't process data on a non-GET request.
  2472. if (params.type !== 'GET' && !options.emulateJSON) {
  2473. params.processData = false;
  2474. }
  2475. // Pass along `textStatus` and `errorThrown` from jQuery.
  2476. var error = options.error;
  2477. options.error = function(xhr, textStatus, errorThrown) {
  2478. options.textStatus = textStatus;
  2479. options.errorThrown = errorThrown;
  2480. if (error) error.call(options.context, xhr, textStatus, errorThrown);
  2481. };
  2482. // Make the request, allowing the user to override any Ajax options.
  2483. var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
  2484. model.trigger('request', model, xhr, options);
  2485. return xhr;
  2486. };
  2487. // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
  2488. var methodMap = {
  2489. 'create': 'POST',
  2490. 'update': 'PUT',
  2491. 'patch': 'PATCH',
  2492. 'delete': 'DELETE',
  2493. 'read': 'GET'
  2494. };
  2495. // Set the default implementation of `Backbone.ajax` to proxy through to `$`.
  2496. // Override this if you'd like to use a different library.
  2497. Backbone.ajax = function() {
  2498. return Backbone.$.ajax.apply(Backbone.$, arguments);
  2499. };
  2500. // Backbone.Router
  2501. // ---------------
  2502. // Routers map faux-URLs to actions, and fire events when routes are
  2503. // matched. Creating a new one sets its `routes` hash, if not set statically.
  2504. var Router = Backbone.Router = function(options) {
  2505. options || (options = {});
  2506. if (options.routes) this.routes = options.routes;
  2507. this._bindRoutes();
  2508. this.initialize.apply(this, arguments);
  2509. };
  2510. // Cached regular expressions for matching named param parts and splatted
  2511. // parts of route strings.
  2512. var optionalParam = /\((.*?)\)/g;
  2513. var namedParam = /(\(\?)?:\w+/g;
  2514. var splatParam = /\*\w+/g;
  2515. var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
  2516. // Set up all inheritable **Backbone.Router** properties and methods.
  2517. _.extend(Router.prototype, Events, {
  2518. // Initialize is an empty function by default. Override it with your own
  2519. // initialization logic.
  2520. initialize: function(){},
  2521. // Manually bind a single named route to a callback. For example:
  2522. //
  2523. // this.route('search/:query/p:num', 'search', function(query, num) {
  2524. // ...
  2525. // });
  2526. //
  2527. route: function(route, name, callback) {
  2528. if (!_.isRegExp(route)) route = this._routeToRegExp(route);
  2529. if (_.isFunction(name)) {
  2530. callback = name;
  2531. name = '';
  2532. }
  2533. if (!callback) callback = this[name];
  2534. var router = this;
  2535. Backbone.history.route(route, function(fragment) {
  2536. var args = router._extractParameters(route, fragment);
  2537. if (router.execute(callback, args, name) !== false) {
  2538. router.trigger.apply(router, ['route:' + name].concat(args));
  2539. router.trigger('route', name, args);
  2540. Backbone.history.trigger('route', router, name, args);
  2541. }
  2542. });
  2543. return this;
  2544. },
  2545. // Execute a route handler with the provided parameters. This is an
  2546. // excellent place to do pre-route setup or post-route cleanup.
  2547. execute: function(callback, args, name) {
  2548. if (callback) callback.apply(this, args);
  2549. },
  2550. // Simple proxy to `Backbone.history` to save a fragment into the history.
  2551. navigate: function(fragment, options) {
  2552. Backbone.history.navigate(fragment, options);
  2553. return this;
  2554. },
  2555. // Bind all defined routes to `Backbone.history`. We have to reverse the
  2556. // order of the routes here to support behavior where the most general
  2557. // routes can be defined at the bottom of the route map.
  2558. _bindRoutes: function() {
  2559. if (!this.routes) return;
  2560. this.routes = _.result(this, 'routes');
  2561. var route, routes = _.keys(this.routes);
  2562. while ((route = routes.pop()) != null) {
  2563. this.route(route, this.routes[route]);
  2564. }
  2565. },
  2566. // Convert a route string into a regular expression, suitable for matching
  2567. // against the current location hash.
  2568. _routeToRegExp: function(route) {
  2569. route = route.replace(escapeRegExp, '\\$&')
  2570. .replace(optionalParam, '(?:$1)?')
  2571. .replace(namedParam, function(match, optional) {
  2572. return optional ? match : '([^/?]+)';
  2573. })
  2574. .replace(splatParam, '([^?]*?)');
  2575. return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$');
  2576. },
  2577. // Given a route, and a URL fragment that it matches, return the array of
  2578. // extracted decoded parameters. Empty or unmatched parameters will be
  2579. // treated as `null` to normalize cross-browser behavior.
  2580. _extractParameters: function(route, fragment) {
  2581. var params = route.exec(fragment).slice(1);
  2582. return _.map(params, function(param, i) {
  2583. // Don't decode the search params.
  2584. if (i === params.length - 1) return param || null;
  2585. return param ? decodeURIComponent(param) : null;
  2586. });
  2587. }
  2588. });
  2589. // Backbone.History
  2590. // ----------------
  2591. // Handles cross-browser history management, based on either
  2592. // [pushState](http://diveintohtml5.info/history.html) and real URLs, or
  2593. // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
  2594. // and URL fragments. If the browser supports neither (old IE, natch),
  2595. // falls back to polling.
  2596. var History = Backbone.History = function() {
  2597. this.handlers = [];
  2598. this.checkUrl = _.bind(this.checkUrl, this);
  2599. // Ensure that `History` can be used outside of the browser.
  2600. if (typeof window !== 'undefined') {
  2601. this.location = window.location;
  2602. this.history = window.history;
  2603. }
  2604. };
  2605. // Cached regex for stripping a leading hash/slash and trailing space.
  2606. var routeStripper = /^[#\/]|\s+$/g;
  2607. // Cached regex for stripping leading and trailing slashes.
  2608. var rootStripper = /^\/+|\/+$/g;
  2609. // Cached regex for stripping urls of hash.
  2610. var pathStripper = /#.*$/;
  2611. // Has the history handling already been started?
  2612. History.started = false;
  2613. // Set up all inheritable **Backbone.History** properties and methods.
  2614. _.extend(History.prototype, Events, {
  2615. // The default interval to poll for hash changes, if necessary, is
  2616. // twenty times a second.
  2617. interval: 50,
  2618. // Are we at the app root?
  2619. atRoot: function() {
  2620. var path = this.location.pathname.replace(/[^\/]$/, '$&/');
  2621. return path === this.root && !this.getSearch();
  2622. },
  2623. // Does the pathname match the root?
  2624. matchRoot: function() {
  2625. var path = this.decodeFragment(this.location.pathname);
  2626. var rootPath = path.slice(0, this.root.length - 1) + '/';
  2627. return rootPath === this.root;
  2628. },
  2629. // Unicode characters in `location.pathname` are percent encoded so they're
  2630. // decoded for comparison. `%25` should not be decoded since it may be part
  2631. // of an encoded parameter.
  2632. decodeFragment: function(fragment) {
  2633. return decodeURI(fragment.replace(/%25/g, '%2525'));
  2634. },
  2635. // In IE6, the hash fragment and search params are incorrect if the
  2636. // fragment contains `?`.
  2637. getSearch: function() {
  2638. var match = this.location.href.replace(/#.*/, '').match(/\?.+/);
  2639. return match ? match[0] : '';
  2640. },
  2641. // Gets the true hash value. Cannot use location.hash directly due to bug
  2642. // in Firefox where location.hash will always be decoded.
  2643. getHash: function(window) {
  2644. var match = (window || this).location.href.match(/#(.*)$/);
  2645. return match ? match[1] : '';
  2646. },
  2647. // Get the pathname and search params, without the root.
  2648. getPath: function() {
  2649. var path = this.decodeFragment(
  2650. this.location.pathname + this.getSearch()
  2651. ).slice(this.root.length - 1);
  2652. return path.charAt(0) === '/' ? path.slice(1) : path;
  2653. },
  2654. // Get the cross-browser normalized URL fragment from the path or hash.
  2655. getFragment: function(fragment) {
  2656. if (fragment == null) {
  2657. if (this._usePushState || !this._wantsHashChange) {
  2658. fragment = this.getPath();
  2659. } else {
  2660. fragment = this.getHash();
  2661. }
  2662. }
  2663. return fragment.replace(routeStripper, '');
  2664. },
  2665. // Start the hash change handling, returning `true` if the current URL matches
  2666. // an existing route, and `false` otherwise.
  2667. start: function(options) {
  2668. if (History.started) throw new Error('Backbone.history has already been started');
  2669. History.started = true;
  2670. // Figure out the initial configuration. Do we need an iframe?
  2671. // Is pushState desired ... is it available?
  2672. this.options = _.extend({root: '/'}, this.options, options);
  2673. this.root = this.options.root;
  2674. this._wantsHashChange = this.options.hashChange !== false;
  2675. this._hasHashChange = 'onhashchange' in window && (document.documentMode === void 0 || document.documentMode > 7);
  2676. this._useHashChange = this._wantsHashChange && this._hasHashChange;
  2677. this._wantsPushState = !!this.options.pushState;
  2678. this._hasPushState = !!(this.history && this.history.pushState);
  2679. this._usePushState = this._wantsPushState && this._hasPushState;
  2680. this.fragment = this.getFragment();
  2681. // Normalize root to always include a leading and trailing slash.
  2682. this.root = ('/' + this.root + '/').replace(rootStripper, '/');
  2683. // Transition from hashChange to pushState or vice versa if both are
  2684. // requested.
  2685. if (this._wantsHashChange && this._wantsPushState) {
  2686. // If we've started off with a route from a `pushState`-enabled
  2687. // browser, but we're currently in a browser that doesn't support it...
  2688. if (!this._hasPushState && !this.atRoot()) {
  2689. var rootPath = this.root.slice(0, -1) || '/';
  2690. this.location.replace(rootPath + '#' + this.getPath());
  2691. // Return immediately as browser will do redirect to new url
  2692. return true;
  2693. // Or if we've started out with a hash-based route, but we're currently
  2694. // in a browser where it could be `pushState`-based instead...
  2695. } else if (this._hasPushState && this.atRoot()) {
  2696. this.navigate(this.getHash(), {replace: true});
  2697. }
  2698. }
  2699. // Proxy an iframe to handle location events if the browser doesn't
  2700. // support the `hashchange` event, HTML5 history, or the user wants
  2701. // `hashChange` but not `pushState`.
  2702. if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) {
  2703. this.iframe = document.createElement('iframe');
  2704. this.iframe.src = 'javascript:0';
  2705. this.iframe.style.display = 'none';
  2706. this.iframe.tabIndex = -1;
  2707. var body = document.body;
  2708. // Using `appendChild` will throw on IE < 9 if the document is not ready.
  2709. var iWindow = body.insertBefore(this.iframe, body.firstChild).contentWindow;
  2710. iWindow.document.open();
  2711. iWindow.document.close();
  2712. iWindow.location.hash = '#' + this.fragment;
  2713. }
  2714. // Add a cross-platform `addEventListener` shim for older browsers.
  2715. var addEventListener = window.addEventListener || function(eventName, listener) {
  2716. return attachEvent('on' + eventName, listener);
  2717. };
  2718. // Depending on whether we're using pushState or hashes, and whether
  2719. // 'onhashchange' is supported, determine how we check the URL state.
  2720. if (this._usePushState) {
  2721. addEventListener('popstate', this.checkUrl, false);
  2722. } else if (this._useHashChange && !this.iframe) {
  2723. addEventListener('hashchange', this.checkUrl, false);
  2724. } else if (this._wantsHashChange) {
  2725. this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
  2726. }
  2727. if (!this.options.silent) return this.loadUrl();
  2728. },
  2729. // Disable Backbone.history, perhaps temporarily. Not useful in a real app,
  2730. // but possibly useful for unit testing Routers.
  2731. stop: function() {
  2732. // Add a cross-platform `removeEventListener` shim for older browsers.
  2733. var removeEventListener = window.removeEventListener || function(eventName, listener) {
  2734. return detachEvent('on' + eventName, listener);
  2735. };
  2736. // Remove window listeners.
  2737. if (this._usePushState) {
  2738. removeEventListener('popstate', this.checkUrl, false);
  2739. } else if (this._useHashChange && !this.iframe) {
  2740. removeEventListener('hashchange', this.checkUrl, false);
  2741. }
  2742. // Clean up the iframe if necessary.
  2743. if (this.iframe) {
  2744. document.body.removeChild(this.iframe);
  2745. this.iframe = null;
  2746. }
  2747. // Some environments will throw when clearing an undefined interval.
  2748. if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);
  2749. History.started = false;
  2750. },
  2751. // Add a route to be tested when the fragment changes. Routes added later
  2752. // may override previous routes.
  2753. route: function(route, callback) {
  2754. this.handlers.unshift({route: route, callback: callback});
  2755. },
  2756. // Checks the current URL to see if it has changed, and if it has,
  2757. // calls `loadUrl`, normalizing across the hidden iframe.
  2758. checkUrl: function(e) {
  2759. var current = this.getFragment();
  2760. // If the user pressed the back button, the iframe's hash will have
  2761. // changed and we should use that for comparison.
  2762. if (current === this.fragment && this.iframe) {
  2763. current = this.getHash(this.iframe.contentWindow);
  2764. }
  2765. if (current === this.fragment) return false;
  2766. if (this.iframe) this.navigate(current);
  2767. this.loadUrl();
  2768. },
  2769. // Attempt to load the current URL fragment. If a route succeeds with a
  2770. // match, returns `true`. If no defined routes matches the fragment,
  2771. // returns `false`.
  2772. loadUrl: function(fragment) {
  2773. // If the root doesn't match, no routes can match either.
  2774. if (!this.matchRoot()) return false;
  2775. fragment = this.fragment = this.getFragment(fragment);
  2776. return _.some(this.handlers, function(handler) {
  2777. if (handler.route.test(fragment)) {
  2778. handler.callback(fragment);
  2779. return true;
  2780. }
  2781. });
  2782. },
  2783. // Save a fragment into the hash history, or replace the URL state if the
  2784. // 'replace' option is passed. You are responsible for properly URL-encoding
  2785. // the fragment in advance.
  2786. //
  2787. // The options object can contain `trigger: true` if you wish to have the
  2788. // route callback be fired (not usually desirable), or `replace: true`, if
  2789. // you wish to modify the current URL without adding an entry to the history.
  2790. navigate: function(fragment, options) {
  2791. if (!History.started) return false;
  2792. if (!options || options === true) options = {trigger: !!options};
  2793. // Normalize the fragment.
  2794. fragment = this.getFragment(fragment || '');
  2795. // Don't include a trailing slash on the root.
  2796. var rootPath = this.root;
  2797. if (fragment === '' || fragment.charAt(0) === '?') {
  2798. rootPath = rootPath.slice(0, -1) || '/';
  2799. }
  2800. var url = rootPath + fragment;
  2801. // Strip the hash and decode for matching.
  2802. fragment = this.decodeFragment(fragment.replace(pathStripper, ''));
  2803. if (this.fragment === fragment) return;
  2804. this.fragment = fragment;
  2805. // If pushState is available, we use it to set the fragment as a real URL.
  2806. if (this._usePushState) {
  2807. this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
  2808. // If hash changes haven't been explicitly disabled, update the hash
  2809. // fragment to store history.
  2810. } else if (this._wantsHashChange) {
  2811. this._updateHash(this.location, fragment, options.replace);
  2812. if (this.iframe && fragment !== this.getHash(this.iframe.contentWindow)) {
  2813. var iWindow = this.iframe.contentWindow;
  2814. // Opening and closing the iframe tricks IE7 and earlier to push a
  2815. // history entry on hash-tag change. When replace is true, we don't
  2816. // want this.
  2817. if (!options.replace) {
  2818. iWindow.document.open();
  2819. iWindow.document.close();
  2820. }
  2821. this._updateHash(iWindow.location, fragment, options.replace);
  2822. }
  2823. // If you've told us that you explicitly don't want fallback hashchange-
  2824. // based history, then `navigate` becomes a page refresh.
  2825. } else {
  2826. return this.location.assign(url);
  2827. }
  2828. if (options.trigger) return this.loadUrl(fragment);
  2829. },
  2830. // Update the hash location, either replacing the current entry, or adding
  2831. // a new one to the browser history.
  2832. _updateHash: function(location, fragment, replace) {
  2833. if (replace) {
  2834. var href = location.href.replace(/(javascript:|#).*$/, '');
  2835. location.replace(href + '#' + fragment);
  2836. } else {
  2837. // Some browsers require that `hash` contains a leading #.
  2838. location.hash = '#' + fragment;
  2839. }
  2840. }
  2841. });
  2842. // Create the default Backbone.history.
  2843. Backbone.history = new History;
  2844. // Helpers
  2845. // -------
  2846. // Helper function to correctly set up the prototype chain for subclasses.
  2847. // Similar to `goog.inherits`, but uses a hash of prototype properties and
  2848. // class properties to be extended.
  2849. var extend = function(protoProps, staticProps) {
  2850. var parent = this;
  2851. var child;
  2852. // The constructor function for the new subclass is either defined by you
  2853. // (the "constructor" property in your `extend` definition), or defaulted
  2854. // by us to simply call the parent constructor.
  2855. if (protoProps && _.has(protoProps, 'constructor')) {
  2856. child = protoProps.constructor;
  2857. } else {
  2858. child = function(){ return parent.apply(this, arguments); };
  2859. }
  2860. // Add static properties to the constructor function, if supplied.
  2861. _.extend(child, parent, staticProps);
  2862. // Set the prototype chain to inherit from `parent`, without calling
  2863. // `parent`'s constructor function and add the prototype properties.
  2864. child.prototype = _.create(parent.prototype, protoProps);
  2865. child.prototype.constructor = child;
  2866. // Set a convenience property in case the parent's prototype is needed
  2867. // later.
  2868. child.__super__ = parent.prototype;
  2869. return child;
  2870. };
  2871. // Set up inheritance for the model, collection, router, view and history.
  2872. Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
  2873. // Throw an error when a URL is needed, and none is supplied.
  2874. var urlError = function() {
  2875. throw new Error('A "url" property or function must be specified');
  2876. };
  2877. // Wrap an optional error callback with a fallback error event.
  2878. var wrapError = function(model, options) {
  2879. var error = options.error;
  2880. options.error = function(resp) {
  2881. if (error) error.call(options.context, model, resp, options);
  2882. model.trigger('error', model, resp, options);
  2883. };
  2884. };
  2885. return Backbone;
  2886. });
  2887. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  2888. /***/ }),
  2889. /***/ "./node_modules/bootstrap.native/dist/bootstrap-native-v4.js":
  2890. /*!*******************************************************************!*\
  2891. !*** ./node_modules/bootstrap.native/dist/bootstrap-native-v4.js ***!
  2892. \*******************************************************************/
  2893. /*! no static exports found */
  2894. /***/ (function(module, exports, __webpack_require__) {
  2895. /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Native Javascript for Bootstrap 4 v2.0.23 | © dnp_theme | MIT-License
  2896. (function (root, factory) {
  2897. if (true) {
  2898. // AMD support:
  2899. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  2900. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  2901. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  2902. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  2903. } else { var bsn; }
  2904. }(this, function () {
  2905. /* Native Javascript for Bootstrap 4 | Internal Utility Functions
  2906. ----------------------------------------------------------------*/
  2907. "use strict";
  2908. // globals
  2909. var globalObject = typeof global !== 'undefined' ? global : this||window,
  2910. DOC = document, HTML = DOC.documentElement, body = 'body', // allow the library to be used in <head>
  2911. // Native Javascript for Bootstrap Global Object
  2912. BSN = globalObject.BSN = {},
  2913. supports = BSN.supports = [],
  2914. // function toggle attributes
  2915. dataToggle = 'data-toggle',
  2916. dataDismiss = 'data-dismiss',
  2917. dataSpy = 'data-spy',
  2918. dataRide = 'data-ride',
  2919. // components
  2920. stringAlert = 'Alert',
  2921. stringButton = 'Button',
  2922. stringCarousel = 'Carousel',
  2923. stringCollapse = 'Collapse',
  2924. stringDropdown = 'Dropdown',
  2925. stringModal = 'Modal',
  2926. stringPopover = 'Popover',
  2927. stringScrollSpy = 'ScrollSpy',
  2928. stringTab = 'Tab',
  2929. stringTooltip = 'Tooltip',
  2930. // options DATA API
  2931. databackdrop = 'data-backdrop',
  2932. dataKeyboard = 'data-keyboard',
  2933. dataTarget = 'data-target',
  2934. dataInterval = 'data-interval',
  2935. dataHeight = 'data-height',
  2936. dataPause = 'data-pause',
  2937. dataTitle = 'data-title',
  2938. dataOriginalTitle = 'data-original-title',
  2939. dataOriginalText = 'data-original-text',
  2940. dataDismissible = 'data-dismissible',
  2941. dataTrigger = 'data-trigger',
  2942. dataAnimation = 'data-animation',
  2943. dataContainer = 'data-container',
  2944. dataPlacement = 'data-placement',
  2945. dataDelay = 'data-delay',
  2946. dataOffsetTop = 'data-offset-top',
  2947. dataOffsetBottom = 'data-offset-bottom',
  2948. // option keys
  2949. backdrop = 'backdrop', keyboard = 'keyboard', delay = 'delay',
  2950. content = 'content', target = 'target',
  2951. interval = 'interval', pause = 'pause', animation = 'animation',
  2952. placement = 'placement', container = 'container',
  2953. // box model
  2954. offsetTop = 'offsetTop', offsetBottom = 'offsetBottom',
  2955. offsetLeft = 'offsetLeft',
  2956. scrollTop = 'scrollTop', scrollLeft = 'scrollLeft',
  2957. clientWidth = 'clientWidth', clientHeight = 'clientHeight',
  2958. offsetWidth = 'offsetWidth', offsetHeight = 'offsetHeight',
  2959. innerWidth = 'innerWidth', innerHeight = 'innerHeight',
  2960. scrollHeight = 'scrollHeight', height = 'height',
  2961. // aria
  2962. ariaExpanded = 'aria-expanded',
  2963. ariaHidden = 'aria-hidden',
  2964. // event names
  2965. clickEvent = 'click',
  2966. hoverEvent = 'hover',
  2967. keydownEvent = 'keydown',
  2968. keyupEvent = 'keyup',
  2969. resizeEvent = 'resize',
  2970. scrollEvent = 'scroll',
  2971. // originalEvents
  2972. showEvent = 'show',
  2973. shownEvent = 'shown',
  2974. hideEvent = 'hide',
  2975. hiddenEvent = 'hidden',
  2976. closeEvent = 'close',
  2977. closedEvent = 'closed',
  2978. slidEvent = 'slid',
  2979. slideEvent = 'slide',
  2980. changeEvent = 'change',
  2981. // other
  2982. getAttribute = 'getAttribute',
  2983. setAttribute = 'setAttribute',
  2984. hasAttribute = 'hasAttribute',
  2985. createElement = 'createElement',
  2986. appendChild = 'appendChild',
  2987. innerHTML = 'innerHTML',
  2988. getElementsByTagName = 'getElementsByTagName',
  2989. preventDefault = 'preventDefault',
  2990. getBoundingClientRect = 'getBoundingClientRect',
  2991. querySelectorAll = 'querySelectorAll',
  2992. getElementsByCLASSNAME = 'getElementsByClassName',
  2993. getComputedStyle = 'getComputedStyle',
  2994. indexOf = 'indexOf',
  2995. parentNode = 'parentNode',
  2996. length = 'length',
  2997. toLowerCase = 'toLowerCase',
  2998. Transition = 'Transition',
  2999. Duration = 'Duration',
  3000. Webkit = 'Webkit',
  3001. style = 'style',
  3002. push = 'push',
  3003. tabindex = 'tabindex',
  3004. contains = 'contains',
  3005. active = 'active',
  3006. showClass = 'show',
  3007. collapsing = 'collapsing',
  3008. disabled = 'disabled',
  3009. loading = 'loading',
  3010. left = 'left',
  3011. right = 'right',
  3012. top = 'top',
  3013. bottom = 'bottom',
  3014. // tooltip / popover
  3015. mouseHover = ('onmouseleave' in DOC) ? [ 'mouseenter', 'mouseleave'] : [ 'mouseover', 'mouseout' ],
  3016. tipPositions = /\b(top|bottom|left|right)+/,
  3017. // modal
  3018. modalOverlay = 0,
  3019. fixedTop = 'fixed-top',
  3020. fixedBottom = 'fixed-bottom',
  3021. // transitionEnd since 2.0.4
  3022. supportTransitions = Webkit+Transition in HTML[style] || Transition[toLowerCase]() in HTML[style],
  3023. transitionEndEvent = Webkit+Transition in HTML[style] ? Webkit[toLowerCase]()+Transition+'End' : Transition[toLowerCase]()+'end',
  3024. transitionDuration = Webkit+Duration in HTML[style] ? Webkit[toLowerCase]()+Transition+Duration : Transition[toLowerCase]()+Duration,
  3025. // set new focus element since 2.0.3
  3026. setFocus = function(element){
  3027. element.focus ? element.focus() : element.setActive();
  3028. },
  3029. // class manipulation, since 2.0.0 requires polyfill.js
  3030. addClass = function(element,classNAME) {
  3031. element.classList.add(classNAME);
  3032. },
  3033. removeClass = function(element,classNAME) {
  3034. element.classList.remove(classNAME);
  3035. },
  3036. hasClass = function(element,classNAME){ // since 2.0.0
  3037. return element.classList[contains](classNAME);
  3038. },
  3039. // selection methods
  3040. getElementsByClassName = function(element,classNAME) { // returns Array
  3041. return [].slice.call(element[getElementsByCLASSNAME]( classNAME ));
  3042. },
  3043. queryElement = function (selector, parent) {
  3044. var lookUp = parent ? parent : DOC;
  3045. return typeof selector === 'object' ? selector : lookUp.querySelector(selector);
  3046. },
  3047. getClosest = function (element, selector) { //element is the element and selector is for the closest parent element to find
  3048. // source http://gomakethings.com/climbing-up-and-down-the-dom-tree-with-vanilla-javascript/
  3049. var firstChar = selector.charAt(0), selectorSubstring = selector.substr(1);
  3050. if ( firstChar === '.' ) {// If selector is a class
  3051. for ( ; element && element !== DOC; element = element[parentNode] ) { // Get closest match
  3052. if ( queryElement(selector,element[parentNode]) !== null && hasClass(element,selectorSubstring) ) { return element; }
  3053. }
  3054. } else if ( firstChar === '#' ) { // If selector is an ID
  3055. for ( ; element && element !== DOC; element = element[parentNode] ) { // Get closest match
  3056. if ( element.id === selectorSubstring ) { return element; }
  3057. }
  3058. }
  3059. return false;
  3060. },
  3061. // event attach jQuery style / trigger since 1.2.0
  3062. on = function (element, event, handler) {
  3063. element.addEventListener(event, handler, false);
  3064. },
  3065. off = function(element, event, handler) {
  3066. element.removeEventListener(event, handler, false);
  3067. },
  3068. one = function (element, event, handler) { // one since 2.0.4
  3069. on(element, event, function handlerWrapper(e){
  3070. handler(e);
  3071. off(element, event, handlerWrapper);
  3072. });
  3073. },
  3074. getTransitionDurationFromElement = function(element) {
  3075. var duration = globalObject[getComputedStyle](element)[transitionDuration];
  3076. duration = parseFloat(duration);
  3077. duration = typeof duration === 'number' && !isNaN(duration) ? duration * 1000 : 0;
  3078. return duration + 50; // we take a short offset to make sure we fire on the next frame after animation
  3079. },
  3080. emulateTransitionEnd = function(element,handler){ // emulateTransitionEnd since 2.0.4
  3081. var called = 0, duration = getTransitionDurationFromElement(element);
  3082. supportTransitions && one(element, transitionEndEvent, function(e){ handler(e); called = 1; });
  3083. setTimeout(function() { !called && handler(); }, duration);
  3084. },
  3085. bootstrapCustomEvent = function (eventName, componentName, related) {
  3086. var OriginalCustomEvent = new CustomEvent( eventName + '.bs.' + componentName);
  3087. OriginalCustomEvent.relatedTarget = related;
  3088. this.dispatchEvent(OriginalCustomEvent);
  3089. },
  3090. // tooltip / popover stuff
  3091. getScroll = function() { // also Affix and ScrollSpy uses it
  3092. return {
  3093. y : globalObject.pageYOffset || HTML[scrollTop],
  3094. x : globalObject.pageXOffset || HTML[scrollLeft]
  3095. }
  3096. },
  3097. styleTip = function(link,element,position,parent) { // both popovers and tooltips (target,tooltip,placement,elementToAppendTo)
  3098. var elementDimensions = { w : element[offsetWidth], h: element[offsetHeight] },
  3099. windowWidth = (HTML[clientWidth] || DOC[body][clientWidth]),
  3100. windowHeight = (HTML[clientHeight] || DOC[body][clientHeight]),
  3101. rect = link[getBoundingClientRect](),
  3102. scroll = parent === DOC[body] ? getScroll() : { x: parent[offsetLeft] + parent[scrollLeft], y: parent[offsetTop] + parent[scrollTop] },
  3103. linkDimensions = { w: rect[right] - rect[left], h: rect[bottom] - rect[top] },
  3104. isPopover = hasClass(element,'popover'),
  3105. topPosition, leftPosition,
  3106. arrow = queryElement('.arrow',element),
  3107. arrowTop, arrowLeft, arrowWidth, arrowHeight,
  3108. halfTopExceed = rect[top] + linkDimensions.h/2 - elementDimensions.h/2 < 0,
  3109. halfLeftExceed = rect[left] + linkDimensions.w/2 - elementDimensions.w/2 < 0,
  3110. halfRightExceed = rect[left] + elementDimensions.w/2 + linkDimensions.w/2 >= windowWidth,
  3111. halfBottomExceed = rect[top] + elementDimensions.h/2 + linkDimensions.h/2 >= windowHeight,
  3112. topExceed = rect[top] - elementDimensions.h < 0,
  3113. leftExceed = rect[left] - elementDimensions.w < 0,
  3114. bottomExceed = rect[top] + elementDimensions.h + linkDimensions.h >= windowHeight,
  3115. rightExceed = rect[left] + elementDimensions.w + linkDimensions.w >= windowWidth;
  3116. // recompute position
  3117. position = (position === left || position === right) && leftExceed && rightExceed ? top : position; // first, when both left and right limits are exceeded, we fall back to top|bottom
  3118. position = position === top && topExceed ? bottom : position;
  3119. position = position === bottom && bottomExceed ? top : position;
  3120. position = position === left && leftExceed ? right : position;
  3121. position = position === right && rightExceed ? left : position;
  3122. // update tooltip/popover class
  3123. element.className[indexOf](position) === -1 && (element.className = element.className.replace(tipPositions,position));
  3124. // we check the computed width & height and update here
  3125. arrowWidth = arrow[offsetWidth]; arrowHeight = arrow[offsetHeight];
  3126. // apply styling to tooltip or popover
  3127. if ( position === left || position === right ) { // secondary|side positions
  3128. if ( position === left ) { // LEFT
  3129. leftPosition = rect[left] + scroll.x - elementDimensions.w - ( isPopover ? arrowWidth : 0 );
  3130. } else { // RIGHT
  3131. leftPosition = rect[left] + scroll.x + linkDimensions.w;
  3132. }
  3133. // adjust top and arrow
  3134. if (halfTopExceed) {
  3135. topPosition = rect[top] + scroll.y;
  3136. arrowTop = linkDimensions.h/2 - arrowWidth;
  3137. } else if (halfBottomExceed) {
  3138. topPosition = rect[top] + scroll.y - elementDimensions.h + linkDimensions.h;
  3139. arrowTop = elementDimensions.h - linkDimensions.h/2 - arrowWidth;
  3140. } else {
  3141. topPosition = rect[top] + scroll.y - elementDimensions.h/2 + linkDimensions.h/2;
  3142. arrowTop = elementDimensions.h/2 - (isPopover ? arrowHeight*0.9 : arrowHeight/2);
  3143. }
  3144. } else if ( position === top || position === bottom ) { // primary|vertical positions
  3145. if ( position === top) { // TOP
  3146. topPosition = rect[top] + scroll.y - elementDimensions.h - ( isPopover ? arrowHeight : 0 );
  3147. } else { // BOTTOM
  3148. topPosition = rect[top] + scroll.y + linkDimensions.h;
  3149. }
  3150. // adjust left | right and also the arrow
  3151. if (halfLeftExceed) {
  3152. leftPosition = 0;
  3153. arrowLeft = rect[left] + linkDimensions.w/2 - arrowWidth;
  3154. } else if (halfRightExceed) {
  3155. leftPosition = windowWidth - elementDimensions.w*1.01;
  3156. arrowLeft = elementDimensions.w - ( windowWidth - rect[left] ) + linkDimensions.w/2 - arrowWidth/2;
  3157. } else {
  3158. leftPosition = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2;
  3159. arrowLeft = elementDimensions.w/2 - arrowWidth/2;
  3160. }
  3161. }
  3162. // apply style to tooltip/popover and its arrow
  3163. element[style][top] = topPosition + 'px';
  3164. element[style][left] = leftPosition + 'px';
  3165. arrowTop && (arrow[style][top] = arrowTop + 'px');
  3166. arrowLeft && (arrow[style][left] = arrowLeft + 'px');
  3167. };
  3168. BSN.version = '2.0.23';
  3169. /* Native Javascript for Bootstrap 4 | Alert
  3170. -------------------------------------------*/
  3171. // ALERT DEFINITION
  3172. // ================
  3173. var Alert = function( element ) {
  3174. // initialization element
  3175. element = queryElement(element);
  3176. // bind, target alert, duration and stuff
  3177. var self = this, component = 'alert',
  3178. alert = getClosest(element,'.'+component),
  3179. triggerHandler = function(){ hasClass(alert,'fade') ? emulateTransitionEnd(alert,transitionEndHandler) : transitionEndHandler(); },
  3180. // handlers
  3181. clickHandler = function(e){
  3182. alert = getClosest(e[target],'.'+component);
  3183. element = queryElement('['+dataDismiss+'="'+component+'"]',alert);
  3184. element && alert && (element === e[target] || element[contains](e[target])) && self.close();
  3185. },
  3186. transitionEndHandler = function(){
  3187. bootstrapCustomEvent.call(alert, closedEvent, component);
  3188. off(element, clickEvent, clickHandler); // detach it's listener
  3189. alert[parentNode].removeChild(alert);
  3190. };
  3191. // public method
  3192. this.close = function() {
  3193. if ( alert && element && hasClass(alert,showClass) ) {
  3194. bootstrapCustomEvent.call(alert, closeEvent, component);
  3195. removeClass(alert,showClass);
  3196. alert && triggerHandler();
  3197. }
  3198. };
  3199. // init
  3200. if ( !(stringAlert in element ) ) { // prevent adding event handlers twice
  3201. on(element, clickEvent, clickHandler);
  3202. }
  3203. element[stringAlert] = self;
  3204. };
  3205. // ALERT DATA API
  3206. // ==============
  3207. supports[push]([stringAlert, Alert, '['+dataDismiss+'="alert"]']);
  3208. /* Native Javascript for Bootstrap 4 | Button
  3209. ---------------------------------------------*/
  3210. // BUTTON DEFINITION
  3211. // ===================
  3212. var Button = function( element ) {
  3213. // initialization element
  3214. element = queryElement(element);
  3215. // constant
  3216. var toggled = false, // toggled makes sure to prevent triggering twice the change.bs.button events
  3217. // strings
  3218. component = 'button',
  3219. checked = 'checked',
  3220. reset = 'reset',
  3221. LABEL = 'LABEL',
  3222. INPUT = 'INPUT',
  3223. // private methods
  3224. keyHandler = function(e){
  3225. var key = e.which || e.keyCode;
  3226. key === 32 && e[target] === DOC.activeElement && toggle(e);
  3227. },
  3228. preventScroll = function(e){
  3229. var key = e.which || e.keyCode;
  3230. key === 32 && e[preventDefault]();
  3231. },
  3232. toggle = function(e) {
  3233. var label = e[target].tagName === LABEL ? e[target] : e[target][parentNode].tagName === LABEL ? e[target][parentNode] : null; // the .btn label
  3234. if ( !label ) return; //react if a label or its immediate child is clicked
  3235. var eventTarget = e[target], // the button itself, the target of the handler function
  3236. labels = getElementsByClassName(eventTarget[parentNode],'btn'), // all the button group buttons
  3237. input = label[getElementsByTagName](INPUT)[0];
  3238. if ( !input ) return; //return if no input found
  3239. // manage the dom manipulation
  3240. if ( input.type === 'checkbox' ) { //checkboxes
  3241. if ( !input[checked] ) {
  3242. addClass(label,active);
  3243. input[getAttribute](checked);
  3244. input[setAttribute](checked,checked);
  3245. input[checked] = true;
  3246. } else {
  3247. removeClass(label,active);
  3248. input[getAttribute](checked);
  3249. input.removeAttribute(checked);
  3250. input[checked] = false;
  3251. }
  3252. if (!toggled) { // prevent triggering the event twice
  3253. toggled = true;
  3254. bootstrapCustomEvent.call(input, changeEvent, component); //trigger the change for the input
  3255. bootstrapCustomEvent.call(element, changeEvent, component); //trigger the change for the btn-group
  3256. }
  3257. }
  3258. if ( input.type === 'radio' && !toggled ) { // radio buttons
  3259. if ( !input[checked] ) { // don't trigger if already active
  3260. addClass(label,active);
  3261. input[setAttribute](checked,checked);
  3262. input[checked] = true;
  3263. bootstrapCustomEvent.call(input, changeEvent, component); //trigger the change for the input
  3264. bootstrapCustomEvent.call(element, changeEvent, component); //trigger the change for the btn-group
  3265. toggled = true;
  3266. for (var i = 0, ll = labels[length]; i<ll; i++) {
  3267. var otherLabel = labels[i], otherInput = otherLabel[getElementsByTagName](INPUT)[0];
  3268. if ( otherLabel !== label && hasClass(otherLabel,active) ) {
  3269. removeClass(otherLabel,active);
  3270. otherInput.removeAttribute(checked);
  3271. otherInput[checked] = false;
  3272. bootstrapCustomEvent.call(otherInput, changeEvent, component); // trigger the change
  3273. }
  3274. }
  3275. }
  3276. }
  3277. setTimeout( function() { toggled = false; }, 50 );
  3278. };
  3279. // init
  3280. if ( !( stringButton in element ) ) { // prevent adding event handlers twice
  3281. on( element, clickEvent, toggle );
  3282. queryElement('['+tabindex+']',element) && on( element, keyupEvent, keyHandler ),
  3283. on( element, keydownEvent, preventScroll );
  3284. }
  3285. // activate items on load
  3286. var labelsToACtivate = getElementsByClassName(element, 'btn'), lbll = labelsToACtivate[length];
  3287. for (var i=0; i<lbll; i++) {
  3288. !hasClass(labelsToACtivate[i],active) && queryElement('input:checked',labelsToACtivate[i])
  3289. && addClass(labelsToACtivate[i],active);
  3290. }
  3291. element[stringButton] = this;
  3292. };
  3293. // BUTTON DATA API
  3294. // =================
  3295. supports[push]( [ stringButton, Button, '['+dataToggle+'="buttons"]' ] );
  3296. /* Native Javascript for Bootstrap 4 | Carousel
  3297. ----------------------------------------------*/
  3298. // CAROUSEL DEFINITION
  3299. // ===================
  3300. var Carousel = function( element, options ) {
  3301. // initialization element
  3302. element = queryElement( element );
  3303. // set options
  3304. options = options || {};
  3305. // DATA API
  3306. var intervalAttribute = element[getAttribute](dataInterval),
  3307. intervalOption = options[interval],
  3308. intervalData = intervalAttribute === 'false' ? 0 : parseInt(intervalAttribute),
  3309. pauseData = element[getAttribute](dataPause) === hoverEvent || false,
  3310. keyboardData = element[getAttribute](dataKeyboard) === 'true' || false,
  3311. // strings
  3312. component = 'carousel',
  3313. paused = 'paused',
  3314. direction = 'direction',
  3315. carouselItem = 'carousel-item',
  3316. dataSlideTo = 'data-slide-to';
  3317. this[keyboard] = options[keyboard] === true || keyboardData;
  3318. this[pause] = (options[pause] === hoverEvent || pauseData) ? hoverEvent : false; // false / hover
  3319. this[interval] = typeof intervalOption === 'number' ? intervalOption
  3320. : intervalOption === false || intervalData === 0 || intervalData === false ? 0
  3321. : 5000; // bootstrap carousel default interval
  3322. // bind, event targets
  3323. var self = this, index = element.index = 0, timer = element.timer = 0,
  3324. isSliding = false, // isSliding prevents click event handlers when animation is running
  3325. slides = getElementsByClassName(element,carouselItem), total = slides[length],
  3326. slideDirection = this[direction] = left,
  3327. leftArrow = getElementsByClassName(element,component+'-control-prev')[0],
  3328. rightArrow = getElementsByClassName(element,component+'-control-next')[0],
  3329. indicator = queryElement( '.'+component+'-indicators', element ),
  3330. indicators = indicator && indicator[getElementsByTagName]( "LI" ) || [];
  3331. // handlers
  3332. var pauseHandler = function () {
  3333. if ( self[interval] !==false && !hasClass(element,paused) ) {
  3334. addClass(element,paused);
  3335. !isSliding && clearInterval( timer );
  3336. }
  3337. },
  3338. resumeHandler = function() {
  3339. if ( self[interval] !== false && hasClass(element,paused) ) {
  3340. removeClass(element,paused);
  3341. !isSliding && clearInterval( timer );
  3342. !isSliding && self.cycle();
  3343. }
  3344. },
  3345. indicatorHandler = function(e) {
  3346. e[preventDefault]();
  3347. if (isSliding) return;
  3348. var eventTarget = e[target]; // event target | the current active item
  3349. if ( eventTarget && !hasClass(eventTarget,active) && eventTarget[getAttribute](dataSlideTo) ) {
  3350. index = parseInt( eventTarget[getAttribute](dataSlideTo), 10 );
  3351. } else { return false; }
  3352. self.slideTo( index ); //Do the slide
  3353. },
  3354. controlsHandler = function (e) {
  3355. e[preventDefault]();
  3356. if (isSliding) return;
  3357. var eventTarget = e.currentTarget || e.srcElement;
  3358. if ( eventTarget === rightArrow ) {
  3359. index++;
  3360. } else if ( eventTarget === leftArrow ) {
  3361. index--;
  3362. }
  3363. self.slideTo( index ); //Do the slide
  3364. },
  3365. keyHandler = function (e) {
  3366. if (isSliding) return;
  3367. switch (e.which) {
  3368. case 39:
  3369. index++;
  3370. break;
  3371. case 37:
  3372. index--;
  3373. break;
  3374. default: return;
  3375. }
  3376. self.slideTo( index ); //Do the slide
  3377. },
  3378. // private methods
  3379. isElementInScrollRange = function () {
  3380. var rect = element[getBoundingClientRect](),
  3381. viewportHeight = globalObject[innerHeight] || HTML[clientHeight]
  3382. return rect[top] <= viewportHeight && rect[bottom] >= 0; // bottom && top
  3383. },
  3384. setActivePage = function( pageIndex ) { //indicators
  3385. for ( var i = 0, icl = indicators[length]; i < icl; i++ ) {
  3386. removeClass(indicators[i],active);
  3387. }
  3388. if (indicators[pageIndex]) addClass(indicators[pageIndex], active);
  3389. };
  3390. // public methods
  3391. this.cycle = function() {
  3392. timer = setInterval(function() {
  3393. isElementInScrollRange() && (index++, self.slideTo( index ) );
  3394. }, this[interval]);
  3395. };
  3396. this.slideTo = function( next ) {
  3397. if (isSliding) return; // when controled via methods, make sure to check again
  3398. var activeItem = this.getActiveIndex(), // the current active
  3399. orientation;
  3400. // determine slideDirection first
  3401. if ( (activeItem < next ) || (activeItem === 0 && next === total -1 ) ) {
  3402. slideDirection = self[direction] = left; // next
  3403. } else if ( (activeItem > next) || (activeItem === total - 1 && next === 0 ) ) {
  3404. slideDirection = self[direction] = right; // prev
  3405. }
  3406. // find the right next index
  3407. if ( next < 0 ) { next = total - 1; }
  3408. else if ( next === total ){ next = 0; }
  3409. // update index
  3410. index = next;
  3411. orientation = slideDirection === left ? 'next' : 'prev'; //determine type
  3412. bootstrapCustomEvent.call(element, slideEvent, component, slides[next]); // here we go with the slide
  3413. isSliding = true;
  3414. clearInterval(timer);
  3415. setActivePage( next );
  3416. if ( supportTransitions && hasClass(element,'slide') ) {
  3417. addClass(slides[next],carouselItem +'-'+ orientation);
  3418. slides[next][offsetWidth];
  3419. addClass(slides[next],carouselItem +'-'+ slideDirection);
  3420. addClass(slides[activeItem],carouselItem +'-'+ slideDirection);
  3421. one(slides[next], transitionEndEvent, function(e) {
  3422. var timeout = e[target] !== slides[next] ? e.elapsedTime*1000+100 : 20;
  3423. isSliding && setTimeout(function(){
  3424. isSliding = false;
  3425. addClass(slides[next],active);
  3426. removeClass(slides[activeItem],active);
  3427. removeClass(slides[next],carouselItem +'-'+ orientation);
  3428. removeClass(slides[next],carouselItem +'-'+ slideDirection);
  3429. removeClass(slides[activeItem],carouselItem +'-'+ slideDirection);
  3430. bootstrapCustomEvent.call(element, slidEvent, component, slides[next]);
  3431. if ( !DOC.hidden && self[interval] && !hasClass(element,paused) ) {
  3432. self.cycle();
  3433. }
  3434. }, timeout);
  3435. });
  3436. } else {
  3437. addClass(slides[next],active);
  3438. slides[next][offsetWidth];
  3439. removeClass(slides[activeItem],active);
  3440. setTimeout(function() {
  3441. isSliding = false;
  3442. if ( self[interval] && !hasClass(element,paused) ) {
  3443. self.cycle();
  3444. }
  3445. bootstrapCustomEvent.call(element, slidEvent, component, slides[next]);
  3446. }, 100 );
  3447. }
  3448. };
  3449. this.getActiveIndex = function () {
  3450. return slides[indexOf](getElementsByClassName(element,carouselItem+' active')[0]) || 0;
  3451. };
  3452. // init
  3453. if ( !(stringCarousel in element ) ) { // prevent adding event handlers twice
  3454. if ( self[pause] && self[interval] ) {
  3455. on( element, mouseHover[0], pauseHandler );
  3456. on( element, mouseHover[1], resumeHandler );
  3457. on( element, 'touchstart', pauseHandler );
  3458. on( element, 'touchend', resumeHandler );
  3459. }
  3460. rightArrow && on( rightArrow, clickEvent, controlsHandler );
  3461. leftArrow && on( leftArrow, clickEvent, controlsHandler );
  3462. indicator && on( indicator, clickEvent, indicatorHandler );
  3463. self[keyboard] === true && on( globalObject, keydownEvent, keyHandler );
  3464. }
  3465. if (self.getActiveIndex()<0) {
  3466. slides[length] && addClass(slides[0],active);
  3467. indicators[length] && setActivePage(0);
  3468. }
  3469. if ( self[interval] ){ self.cycle(); }
  3470. element[stringCarousel] = self;
  3471. };
  3472. // CAROUSEL DATA API
  3473. // =================
  3474. supports[push]( [ stringCarousel, Carousel, '['+dataRide+'="carousel"]' ] );
  3475. /* Native Javascript for Bootstrap 4 | Collapse
  3476. -----------------------------------------------*/
  3477. // COLLAPSE DEFINITION
  3478. // ===================
  3479. var Collapse = function( element, options ) {
  3480. // initialization element
  3481. element = queryElement(element);
  3482. // set options
  3483. options = options || {};
  3484. // event targets and constants
  3485. var accordion = null, collapse = null, self = this,
  3486. accordionData = element[getAttribute]('data-parent'),
  3487. activeCollapse, activeElement,
  3488. // component strings
  3489. component = 'collapse',
  3490. collapsed = 'collapsed',
  3491. isAnimating = 'isAnimating',
  3492. // private methods
  3493. openAction = function(collapseElement,toggle) {
  3494. bootstrapCustomEvent.call(collapseElement, showEvent, component);
  3495. collapseElement[isAnimating] = true;
  3496. addClass(collapseElement,collapsing);
  3497. removeClass(collapseElement,component);
  3498. collapseElement[style][height] = collapseElement[scrollHeight] + 'px';
  3499. emulateTransitionEnd(collapseElement, function() {
  3500. collapseElement[isAnimating] = false;
  3501. collapseElement[setAttribute](ariaExpanded,'true');
  3502. toggle[setAttribute](ariaExpanded,'true');
  3503. removeClass(collapseElement,collapsing);
  3504. addClass(collapseElement, component);
  3505. addClass(collapseElement,showClass);
  3506. collapseElement[style][height] = '';
  3507. bootstrapCustomEvent.call(collapseElement, shownEvent, component);
  3508. });
  3509. },
  3510. closeAction = function(collapseElement,toggle) {
  3511. bootstrapCustomEvent.call(collapseElement, hideEvent, component);
  3512. collapseElement[isAnimating] = true;
  3513. collapseElement[style][height] = collapseElement[scrollHeight] + 'px'; // set height first
  3514. removeClass(collapseElement,component);
  3515. removeClass(collapseElement,showClass);
  3516. addClass(collapseElement,collapsing);
  3517. collapseElement[offsetWidth]; // force reflow to enable transition
  3518. collapseElement[style][height] = '0px';
  3519. emulateTransitionEnd(collapseElement, function() {
  3520. collapseElement[isAnimating] = false;
  3521. collapseElement[setAttribute](ariaExpanded,'false');
  3522. toggle[setAttribute](ariaExpanded,'false');
  3523. removeClass(collapseElement,collapsing);
  3524. addClass(collapseElement,component);
  3525. collapseElement[style][height] = '';
  3526. bootstrapCustomEvent.call(collapseElement, hiddenEvent, component);
  3527. });
  3528. },
  3529. getTarget = function() {
  3530. var href = element.href && element[getAttribute]('href'),
  3531. parent = element[getAttribute](dataTarget),
  3532. id = href || ( parent && parent.charAt(0) === '#' ) && parent;
  3533. return id && queryElement(id);
  3534. };
  3535. // public methods
  3536. this.toggle = function(e) {
  3537. e[preventDefault]();
  3538. if (!hasClass(collapse,showClass)) { self.show(); }
  3539. else { self.hide(); }
  3540. };
  3541. this.hide = function() {
  3542. if ( collapse[isAnimating] ) return;
  3543. closeAction(collapse,element);
  3544. addClass(element,collapsed);
  3545. };
  3546. this.show = function() {
  3547. if ( accordion ) {
  3548. activeCollapse = queryElement('.'+component+'.'+showClass,accordion);
  3549. activeElement = activeCollapse && (queryElement('['+dataToggle+'="'+component+'"]['+dataTarget+'="#'+activeCollapse.id+'"]',accordion)
  3550. || queryElement('['+dataToggle+'="'+component+'"][href="#'+activeCollapse.id+'"]',accordion) );
  3551. }
  3552. if ( !collapse[isAnimating] || activeCollapse && !activeCollapse[isAnimating] ) {
  3553. if ( activeElement && activeCollapse !== collapse ) {
  3554. closeAction(activeCollapse,activeElement);
  3555. addClass(activeElement,collapsed);
  3556. }
  3557. openAction(collapse,element);
  3558. removeClass(element,collapsed);
  3559. }
  3560. };
  3561. // init
  3562. if ( !(stringCollapse in element ) ) { // prevent adding event handlers twice
  3563. on(element, clickEvent, self.toggle);
  3564. }
  3565. collapse = getTarget();
  3566. collapse[isAnimating] = false; // when true it will prevent click handlers
  3567. accordion = queryElement(options.parent) || accordionData && getClosest(element, accordionData);
  3568. element[stringCollapse] = self;
  3569. };
  3570. // COLLAPSE DATA API
  3571. // =================
  3572. supports[push]( [ stringCollapse, Collapse, '['+dataToggle+'="collapse"]' ] );
  3573. /* Native Javascript for Bootstrap 4 | Dropdown
  3574. ----------------------------------------------*/
  3575. // DROPDOWN DEFINITION
  3576. // ===================
  3577. var Dropdown = function( element, option ) {
  3578. // initialization element
  3579. element = queryElement(element);
  3580. // set option
  3581. this.persist = option === true || element[getAttribute]('data-persist') === 'true' || false;
  3582. // constants, event targets, strings
  3583. var self = this, children = 'children',
  3584. parent = element[parentNode],
  3585. component = 'dropdown', open = 'open',
  3586. relatedTarget = null,
  3587. menu = queryElement('.dropdown-menu', parent),
  3588. menuItems = (function(){
  3589. var set = menu[children], newSet = [];
  3590. for ( var i=0; i<set[length]; i++ ){
  3591. set[i][children][length] && (set[i][children][0].tagName === 'A' && newSet[push](set[i][children][0]));
  3592. set[i].tagName === 'A' && newSet[push](set[i]);
  3593. }
  3594. return newSet;
  3595. })(),
  3596. // preventDefault on empty anchor links
  3597. preventEmptyAnchor = function(anchor){
  3598. (anchor.href && anchor.href.slice(-1) === '#' || anchor[parentNode] && anchor[parentNode].href
  3599. && anchor[parentNode].href.slice(-1) === '#') && this[preventDefault]();
  3600. },
  3601. // toggle dismissible events
  3602. toggleDismiss = function(){
  3603. var type = element[open] ? on : off;
  3604. type(DOC, clickEvent, dismissHandler);
  3605. type(DOC, keydownEvent, preventScroll);
  3606. type(DOC, keyupEvent, keyHandler);
  3607. },
  3608. // handlers
  3609. dismissHandler = function(e) {
  3610. var eventTarget = e[target], hasData = eventTarget && (stringDropdown in eventTarget || stringDropdown in eventTarget[parentNode]);
  3611. if ( (eventTarget === menu || menu[contains](eventTarget)) && (self.persist || hasData) ) { return; }
  3612. else {
  3613. relatedTarget = eventTarget === element || element[contains](eventTarget) ? element : null;
  3614. hide();
  3615. }
  3616. preventEmptyAnchor.call(e,eventTarget);
  3617. },
  3618. clickHandler = function(e) {
  3619. relatedTarget = element;
  3620. show();
  3621. preventEmptyAnchor.call(e,e[target]);
  3622. },
  3623. preventScroll = function(e){
  3624. var key = e.which || e.keyCode;
  3625. if( key === 38 || key === 40 ) { e[preventDefault](); }
  3626. },
  3627. keyHandler = function(e){
  3628. var key = e.which || e.keyCode,
  3629. activeItem = DOC.activeElement,
  3630. idx = menuItems[indexOf](activeItem),
  3631. isSameElement = activeItem === element,
  3632. isInsideMenu = menu[contains](activeItem),
  3633. isMenuItem = activeItem[parentNode] === menu || activeItem[parentNode][parentNode] === menu;
  3634. if ( isMenuItem || isSameElement ) { // navigate up | down
  3635. idx = isSameElement ? 0
  3636. : key === 38 ? (idx>1?idx-1:0)
  3637. : key === 40 ? (idx<menuItems[length]-1?idx+1:idx) : idx;
  3638. menuItems[idx] && setFocus(menuItems[idx]);
  3639. }
  3640. if ( (menuItems[length] && isMenuItem // menu has items
  3641. || !menuItems[length] && (isInsideMenu || isSameElement) // menu might be a form
  3642. || !isInsideMenu ) // or the focused element is not in the menu at all
  3643. && element[open] && key === 27 // menu must be open
  3644. ) {
  3645. self.toggle();
  3646. relatedTarget = null;
  3647. }
  3648. },
  3649. // private methods
  3650. show = function() {
  3651. bootstrapCustomEvent.call(parent, showEvent, component, relatedTarget);
  3652. addClass(menu,showClass);
  3653. addClass(parent,showClass);
  3654. menu[setAttribute](ariaExpanded,true);
  3655. bootstrapCustomEvent.call(parent, shownEvent, component, relatedTarget);
  3656. element[open] = true;
  3657. off(element, clickEvent, clickHandler);
  3658. setTimeout(function(){
  3659. setFocus( menu[getElementsByTagName]('INPUT')[0] || element ); // focus the first input item | element
  3660. toggleDismiss();
  3661. },1);
  3662. },
  3663. hide = function() {
  3664. bootstrapCustomEvent.call(parent, hideEvent, component, relatedTarget);
  3665. removeClass(menu,showClass);
  3666. removeClass(parent,showClass);
  3667. menu[setAttribute](ariaExpanded,false);
  3668. bootstrapCustomEvent.call(parent, hiddenEvent, component, relatedTarget);
  3669. element[open] = false;
  3670. toggleDismiss();
  3671. setFocus(element);
  3672. setTimeout(function(){ on(element, clickEvent, clickHandler); },1);
  3673. };
  3674. // set initial state to closed
  3675. element[open] = false;
  3676. // public methods
  3677. this.toggle = function() {
  3678. if (hasClass(parent,showClass) && element[open]) { hide(); }
  3679. else { show(); }
  3680. };
  3681. // init
  3682. if ( !(stringDropdown in element) ) { // prevent adding event handlers twice
  3683. !tabindex in menu && menu[setAttribute](tabindex, '0'); // Fix onblur on Chrome | Safari
  3684. on(element, clickEvent, clickHandler);
  3685. }
  3686. element[stringDropdown] = self;
  3687. };
  3688. // DROPDOWN DATA API
  3689. // =================
  3690. supports[push]( [stringDropdown, Dropdown, '['+dataToggle+'="dropdown"]'] );
  3691. /* Native Javascript for Bootstrap 4 | Modal
  3692. -------------------------------------------*/
  3693. // MODAL DEFINITION
  3694. // ===============
  3695. var Modal = function(element, options) { // element can be the modal/triggering button
  3696. // the modal (both JavaScript / DATA API init) / triggering button element (DATA API)
  3697. element = queryElement(element);
  3698. // determine modal, triggering element
  3699. var btnCheck = element[getAttribute](dataTarget)||element[getAttribute]('href'),
  3700. checkModal = queryElement( btnCheck ),
  3701. modal = hasClass(element,'modal') ? element : checkModal,
  3702. overlayDelay,
  3703. // strings
  3704. component = 'modal',
  3705. staticString = 'static',
  3706. paddingLeft = 'paddingLeft',
  3707. paddingRight = 'paddingRight',
  3708. modalBackdropString = 'modal-backdrop';
  3709. if ( hasClass(element,'modal') ) { element = null; } // modal is now independent of it's triggering element
  3710. if ( !modal ) { return; } // invalidate
  3711. // set options
  3712. options = options || {};
  3713. this[keyboard] = options[keyboard] === false || modal[getAttribute](dataKeyboard) === 'false' ? false : true;
  3714. this[backdrop] = options[backdrop] === staticString || modal[getAttribute](databackdrop) === staticString ? staticString : true;
  3715. this[backdrop] = options[backdrop] === false || modal[getAttribute](databackdrop) === 'false' ? false : this[backdrop];
  3716. this[content] = options[content]; // JavaScript only
  3717. // bind, constants, event targets and other vars
  3718. var self = this, relatedTarget = null,
  3719. bodyIsOverflowing, modalIsOverflowing, scrollbarWidth, overlay,
  3720. // also find fixed-top / fixed-bottom items
  3721. fixedItems = getElementsByClassName(HTML,fixedTop).concat(getElementsByClassName(HTML,fixedBottom)),
  3722. // private methods
  3723. getWindowWidth = function() {
  3724. var htmlRect = HTML[getBoundingClientRect]();
  3725. return globalObject[innerWidth] || (htmlRect[right] - Math.abs(htmlRect[left]));
  3726. },
  3727. setScrollbar = function () {
  3728. var bodyStyle = globalObject[getComputedStyle](DOC[body]),
  3729. bodyPad = parseInt((bodyStyle[paddingRight]), 10), itemPad;
  3730. if (bodyIsOverflowing) {
  3731. DOC[body][style][paddingRight] = (bodyPad + scrollbarWidth) + 'px';
  3732. if (fixedItems[length]){
  3733. for (var i = 0; i < fixedItems[length]; i++) {
  3734. itemPad = globalObject[getComputedStyle](fixedItems[i])[paddingRight];
  3735. fixedItems[i][style][paddingRight] = ( parseInt(itemPad) + scrollbarWidth) + 'px';
  3736. }
  3737. }
  3738. }
  3739. },
  3740. resetScrollbar = function () {
  3741. DOC[body][style][paddingRight] = '';
  3742. if (fixedItems[length]){
  3743. for (var i = 0; i < fixedItems[length]; i++) {
  3744. fixedItems[i][style][paddingRight] = '';
  3745. }
  3746. }
  3747. },
  3748. measureScrollbar = function () { // thx walsh
  3749. var scrollDiv = DOC[createElement]('div'), scrollBarWidth;
  3750. scrollDiv.className = component+'-scrollbar-measure'; // this is here to stay
  3751. DOC[body][appendChild](scrollDiv);
  3752. scrollBarWidth = scrollDiv[offsetWidth] - scrollDiv[clientWidth];
  3753. DOC[body].removeChild(scrollDiv);
  3754. return scrollBarWidth;
  3755. },
  3756. checkScrollbar = function () {
  3757. bodyIsOverflowing = DOC[body][clientWidth] < getWindowWidth();
  3758. modalIsOverflowing = modal[scrollHeight] > HTML[clientHeight];
  3759. scrollbarWidth = measureScrollbar();
  3760. },
  3761. adjustDialog = function () {
  3762. modal[style][paddingLeft] = !bodyIsOverflowing && modalIsOverflowing ? scrollbarWidth + 'px' : '';
  3763. modal[style][paddingRight] = bodyIsOverflowing && !modalIsOverflowing ? scrollbarWidth + 'px' : '';
  3764. },
  3765. resetAdjustments = function () {
  3766. modal[style][paddingLeft] = '';
  3767. modal[style][paddingRight] = '';
  3768. },
  3769. createOverlay = function() {
  3770. modalOverlay = 1;
  3771. var newOverlay = DOC[createElement]('div');
  3772. overlay = queryElement('.'+modalBackdropString);
  3773. if ( overlay === null ) {
  3774. newOverlay[setAttribute]('class',modalBackdropString+' fade');
  3775. overlay = newOverlay;
  3776. DOC[body][appendChild](overlay);
  3777. }
  3778. },
  3779. removeOverlay = function() {
  3780. overlay = queryElement('.'+modalBackdropString);
  3781. if ( overlay && overlay !== null && typeof overlay === 'object' ) {
  3782. modalOverlay = 0;
  3783. DOC[body].removeChild(overlay); overlay = null;
  3784. }
  3785. bootstrapCustomEvent.call(modal, hiddenEvent, component);
  3786. },
  3787. keydownHandlerToggle = function() {
  3788. if (hasClass(modal,showClass)) {
  3789. on(DOC, keydownEvent, keyHandler);
  3790. } else {
  3791. off(DOC, keydownEvent, keyHandler);
  3792. }
  3793. },
  3794. resizeHandlerToggle = function() {
  3795. if (hasClass(modal,showClass)) {
  3796. on(globalObject, resizeEvent, self.update);
  3797. } else {
  3798. off(globalObject, resizeEvent, self.update);
  3799. }
  3800. },
  3801. dismissHandlerToggle = function() {
  3802. if (hasClass(modal,showClass)) {
  3803. on(modal, clickEvent, dismissHandler);
  3804. } else {
  3805. off(modal, clickEvent, dismissHandler);
  3806. }
  3807. },
  3808. // triggers
  3809. triggerShow = function() {
  3810. setFocus(modal);
  3811. bootstrapCustomEvent.call(modal, shownEvent, component, relatedTarget);
  3812. },
  3813. triggerHide = function() {
  3814. modal[style].display = '';
  3815. element && (setFocus(element));
  3816. (function(){
  3817. if (!getElementsByClassName(DOC,component+' '+showClass)[0]) {
  3818. resetAdjustments();
  3819. resetScrollbar();
  3820. removeClass(DOC[body],component+'-open');
  3821. overlay && hasClass(overlay,'fade') ? (removeClass(overlay,showClass), emulateTransitionEnd(overlay,removeOverlay))
  3822. : removeOverlay();
  3823. resizeHandlerToggle();
  3824. dismissHandlerToggle();
  3825. keydownHandlerToggle();
  3826. }
  3827. }());
  3828. },
  3829. // handlers
  3830. clickHandler = function(e) {
  3831. var clickTarget = e[target];
  3832. clickTarget = clickTarget[hasAttribute](dataTarget) || clickTarget[hasAttribute]('href') ? clickTarget : clickTarget[parentNode];
  3833. if ( clickTarget === element && !hasClass(modal,showClass) ) {
  3834. modal.modalTrigger = element;
  3835. relatedTarget = element;
  3836. self.show();
  3837. e[preventDefault]();
  3838. }
  3839. },
  3840. keyHandler = function(e) {
  3841. if (self[keyboard] && e.which == 27 && hasClass(modal,showClass)) {
  3842. self.hide();
  3843. }
  3844. },
  3845. dismissHandler = function(e) {
  3846. var clickTarget = e[target];
  3847. if ( hasClass(modal,showClass) && (clickTarget[parentNode][getAttribute](dataDismiss) === component
  3848. || clickTarget[getAttribute](dataDismiss) === component
  3849. || (clickTarget === modal && self[backdrop] !== staticString) ) ) {
  3850. self.hide(); relatedTarget = null;
  3851. e[preventDefault]();
  3852. }
  3853. };
  3854. // public methods
  3855. this.toggle = function() {
  3856. if ( hasClass(modal,showClass) ) {this.hide();} else {this.show();}
  3857. };
  3858. this.show = function() {
  3859. bootstrapCustomEvent.call(modal, showEvent, component, relatedTarget);
  3860. // we elegantly hide any opened modal
  3861. var currentOpen = getElementsByClassName(DOC,component+' '+showClass)[0];
  3862. currentOpen && currentOpen !== modal && currentOpen.modalTrigger[stringModal].hide();
  3863. if ( this[backdrop] ) {
  3864. !modalOverlay && createOverlay();
  3865. }
  3866. if ( overlay && modalOverlay && !hasClass(overlay,showClass)) {
  3867. overlay[offsetWidth]; // force reflow to enable trasition
  3868. overlayDelay = getTransitionDurationFromElement(overlay);
  3869. addClass(overlay, showClass);
  3870. }
  3871. setTimeout( function() {
  3872. modal[style].display = 'block';
  3873. checkScrollbar();
  3874. setScrollbar();
  3875. adjustDialog();
  3876. addClass(DOC[body],component+'-open');
  3877. addClass(modal,showClass);
  3878. modal[setAttribute](ariaHidden, false);
  3879. resizeHandlerToggle();
  3880. dismissHandlerToggle();
  3881. keydownHandlerToggle();
  3882. hasClass(modal,'fade') ? emulateTransitionEnd(modal, triggerShow) : triggerShow();
  3883. }, supportTransitions && overlay ? overlayDelay : 0);
  3884. };
  3885. this.hide = function() {
  3886. bootstrapCustomEvent.call(modal, hideEvent, component);
  3887. overlay = queryElement('.'+modalBackdropString);
  3888. overlayDelay = overlay && getTransitionDurationFromElement(overlay);
  3889. removeClass(modal,showClass);
  3890. modal[setAttribute](ariaHidden, true);
  3891. setTimeout(function(){
  3892. hasClass(modal,'fade') ? emulateTransitionEnd(modal, triggerHide) : triggerHide();
  3893. }, supportTransitions && overlay ? overlayDelay : 0);
  3894. };
  3895. this.setContent = function( content ) {
  3896. queryElement('.'+component+'-content',modal)[innerHTML] = content;
  3897. };
  3898. this.update = function() {
  3899. if (hasClass(modal,showClass)) {
  3900. checkScrollbar();
  3901. setScrollbar();
  3902. adjustDialog();
  3903. }
  3904. };
  3905. // init
  3906. // prevent adding event handlers over and over
  3907. // modal is independent of a triggering element
  3908. if ( !!element && !(stringModal in element) ) {
  3909. on(element, clickEvent, clickHandler);
  3910. }
  3911. if ( !!self[content] ) { self.setContent( self[content] ); }
  3912. !!element && (element[stringModal] = self);
  3913. };
  3914. // DATA API
  3915. supports[push]( [ stringModal, Modal, '['+dataToggle+'="modal"]' ] );
  3916. /* Native Javascript for Bootstrap 4 | Popover
  3917. ----------------------------------------------*/
  3918. // POPOVER DEFINITION
  3919. // ==================
  3920. var Popover = function( element, options ) {
  3921. // initialization element
  3922. element = queryElement(element);
  3923. // set options
  3924. options = options || {};
  3925. // DATA API
  3926. var triggerData = element[getAttribute](dataTrigger), // click / hover / focus
  3927. animationData = element[getAttribute](dataAnimation), // true / false
  3928. placementData = element[getAttribute](dataPlacement),
  3929. dismissibleData = element[getAttribute](dataDismissible),
  3930. delayData = element[getAttribute](dataDelay),
  3931. containerData = element[getAttribute](dataContainer),
  3932. // internal strings
  3933. component = 'popover',
  3934. template = 'template',
  3935. trigger = 'trigger',
  3936. classString = 'class',
  3937. div = 'div',
  3938. fade = 'fade',
  3939. content = 'content',
  3940. dataContent = 'data-content',
  3941. dismissible = 'dismissible',
  3942. closeBtn = '<button type="button" class="close">×</button>',
  3943. // check container
  3944. containerElement = queryElement(options[container]),
  3945. containerDataElement = queryElement(containerData),
  3946. // maybe the element is inside a modal
  3947. modal = getClosest(element,'.modal'),
  3948. // maybe the element is inside a fixed navbar
  3949. navbarFixedTop = getClosest(element,'.'+fixedTop),
  3950. navbarFixedBottom = getClosest(element,'.'+fixedBottom);
  3951. // set instance options
  3952. this[template] = options[template] ? options[template] : null; // JavaScript only
  3953. this[trigger] = options[trigger] ? options[trigger] : triggerData || hoverEvent;
  3954. this[animation] = options[animation] && options[animation] !== fade ? options[animation] : animationData || fade;
  3955. this[placement] = options[placement] ? options[placement] : placementData || top;
  3956. this[delay] = parseInt(options[delay] || delayData) || 200;
  3957. this[dismissible] = options[dismissible] || dismissibleData === 'true' ? true : false;
  3958. this[container] = containerElement ? containerElement
  3959. : containerDataElement ? containerDataElement
  3960. : navbarFixedTop ? navbarFixedTop
  3961. : navbarFixedBottom ? navbarFixedBottom
  3962. : modal ? modal : DOC[body];
  3963. // bind, content
  3964. var self = this,
  3965. titleString = element[getAttribute](dataTitle) || null,
  3966. contentString = element[getAttribute](dataContent) || null;
  3967. if ( !contentString && !this[template] ) return; // invalidate
  3968. // constants, vars
  3969. var popover = null, timer = 0, placementSetting = this[placement],
  3970. // handlers
  3971. dismissibleHandler = function(e) {
  3972. if (popover !== null && e[target] === queryElement('.close',popover)) {
  3973. self.hide();
  3974. }
  3975. },
  3976. // private methods
  3977. removePopover = function() {
  3978. self[container].removeChild(popover);
  3979. timer = null; popover = null;
  3980. },
  3981. createPopover = function() {
  3982. titleString = element[getAttribute](dataTitle); // check content again
  3983. contentString = element[getAttribute](dataContent);
  3984. popover = DOC[createElement](div);
  3985. // popover arrow
  3986. var popoverArrow = DOC[createElement](div);
  3987. popoverArrow[setAttribute](classString,'arrow');
  3988. popover[appendChild](popoverArrow);
  3989. if ( contentString !== null && self[template] === null ) { //create the popover from data attributes
  3990. popover[setAttribute]('role','tooltip');
  3991. if (titleString !== null) {
  3992. var popoverTitle = DOC[createElement]('h3');
  3993. popoverTitle[setAttribute](classString,component+'-header');
  3994. popoverTitle[innerHTML] = self[dismissible] ? titleString + closeBtn : titleString;
  3995. popover[appendChild](popoverTitle);
  3996. }
  3997. //set popover content
  3998. var popoverContent = DOC[createElement](div);
  3999. popoverContent[setAttribute](classString,component+'-body');
  4000. popoverContent[innerHTML] = self[dismissible] && titleString === null ? contentString + closeBtn : contentString;
  4001. popover[appendChild](popoverContent);
  4002. } else { // or create the popover from template
  4003. var popoverTemplate = DOC[createElement](div);
  4004. popoverTemplate[innerHTML] = self[template];
  4005. popover[innerHTML] = popoverTemplate.firstChild[innerHTML];
  4006. }
  4007. //append to the container
  4008. self[container][appendChild](popover);
  4009. popover[style].display = 'block';
  4010. popover[setAttribute](classString, component+ ' bs-' + component+'-'+placementSetting + ' ' + self[animation]);
  4011. },
  4012. showPopover = function () {
  4013. !hasClass(popover,showClass) && ( addClass(popover,showClass) );
  4014. },
  4015. updatePopover = function() {
  4016. styleTip(element,popover,placementSetting,self[container]);
  4017. },
  4018. // event toggle
  4019. dismissHandlerToggle = function(type){
  4020. if (clickEvent == self[trigger] || 'focus' == self[trigger]) {
  4021. !self[dismissible] && type( element, 'blur', self.hide );
  4022. }
  4023. self[dismissible] && type( DOC, clickEvent, dismissibleHandler );
  4024. type( globalObject, resizeEvent, self.hide );
  4025. },
  4026. // triggers
  4027. showTrigger = function() {
  4028. dismissHandlerToggle(on);
  4029. bootstrapCustomEvent.call(element, shownEvent, component);
  4030. },
  4031. hideTrigger = function() {
  4032. dismissHandlerToggle(off);
  4033. removePopover();
  4034. bootstrapCustomEvent.call(element, hiddenEvent, component);
  4035. };
  4036. // public methods / handlers
  4037. this.toggle = function() {
  4038. if (popover === null) { self.show(); }
  4039. else { self.hide(); }
  4040. };
  4041. this.show = function() {
  4042. clearTimeout(timer);
  4043. timer = setTimeout( function() {
  4044. if (popover === null) {
  4045. placementSetting = self[placement]; // we reset placement in all cases
  4046. createPopover();
  4047. updatePopover();
  4048. showPopover();
  4049. bootstrapCustomEvent.call(element, showEvent, component);
  4050. !!self[animation] ? emulateTransitionEnd(popover, showTrigger) : showTrigger();
  4051. }
  4052. }, 20 );
  4053. };
  4054. this.hide = function() {
  4055. clearTimeout(timer);
  4056. timer = setTimeout( function() {
  4057. if (popover && popover !== null && hasClass(popover,showClass)) {
  4058. bootstrapCustomEvent.call(element, hideEvent, component);
  4059. removeClass(popover,showClass);
  4060. !!self[animation] ? emulateTransitionEnd(popover, hideTrigger) : hideTrigger();
  4061. }
  4062. }, self[delay] );
  4063. };
  4064. // init
  4065. if ( !(stringPopover in element) ) { // prevent adding event handlers twice
  4066. if (self[trigger] === hoverEvent) {
  4067. on( element, mouseHover[0], self.show );
  4068. if (!self[dismissible]) { on( element, mouseHover[1], self.hide ); }
  4069. } else if (clickEvent == self[trigger] || 'focus' == self[trigger]) {
  4070. on( element, self[trigger], self.toggle );
  4071. }
  4072. }
  4073. element[stringPopover] = self;
  4074. };
  4075. // POPOVER DATA API
  4076. // ================
  4077. supports[push]( [ stringPopover, Popover, '['+dataToggle+'="popover"]' ] );
  4078. /* Native Javascript for Bootstrap 4 | ScrollSpy
  4079. -----------------------------------------------*/
  4080. // SCROLLSPY DEFINITION
  4081. // ====================
  4082. var ScrollSpy = function(element, options) {
  4083. // initialization element, the element we spy on
  4084. element = queryElement(element);
  4085. // DATA API
  4086. var targetData = queryElement(element[getAttribute](dataTarget)),
  4087. offsetData = element[getAttribute]('data-offset');
  4088. // set options
  4089. options = options || {};
  4090. if ( !options[target] && !targetData ) { return; } // invalidate
  4091. // event targets, constants
  4092. var self = this, spyTarget = options[target] && queryElement(options[target]) || targetData,
  4093. links = spyTarget && spyTarget[getElementsByTagName]('A'),
  4094. offset = parseInt(offsetData || options['offset']) || 10,
  4095. items = [], targetItems = [], scrollOffset,
  4096. scrollTarget = element[offsetHeight] < element[scrollHeight] ? element : globalObject, // determine which is the real scrollTarget
  4097. isWindow = scrollTarget === globalObject;
  4098. // populate items and targets
  4099. for (var i=0, il=links[length]; i<il; i++) {
  4100. var href = links[i][getAttribute]('href'),
  4101. targetItem = href && href.charAt(0) === '#' && href.slice(-1) !== '#' && queryElement(href);
  4102. if ( !!targetItem ) {
  4103. items[push](links[i]);
  4104. targetItems[push](targetItem);
  4105. }
  4106. }
  4107. // private methods
  4108. var updateItem = function(index) {
  4109. var item = items[index],
  4110. targetItem = targetItems[index], // the menu item targets this element
  4111. dropdown = item[parentNode][parentNode],
  4112. dropdownLink = hasClass(dropdown,'dropdown') && dropdown[getElementsByTagName]('A')[0],
  4113. targetRect = isWindow && targetItem[getBoundingClientRect](),
  4114. isActive = hasClass(item,active) || false,
  4115. topEdge = (isWindow ? targetRect[top] + scrollOffset : targetItem[offsetTop]) - offset,
  4116. bottomEdge = isWindow ? targetRect[bottom] + scrollOffset - offset : targetItems[index+1] ? targetItems[index+1][offsetTop] - offset : element[scrollHeight],
  4117. inside = scrollOffset >= topEdge && bottomEdge > scrollOffset;
  4118. if ( !isActive && inside ) {
  4119. if ( !hasClass(item,active) ) {
  4120. addClass(item,active);
  4121. if (dropdownLink && !hasClass(dropdownLink,active) ) {
  4122. addClass(dropdownLink,active);
  4123. }
  4124. bootstrapCustomEvent.call(element, 'activate', 'scrollspy', items[index]);
  4125. }
  4126. } else if ( !inside ) {
  4127. if ( hasClass(item,active) ) {
  4128. removeClass(item,active);
  4129. if (dropdownLink && hasClass(dropdownLink,active) && !getElementsByClassName(item[parentNode],active).length ) {
  4130. removeClass(dropdownLink,active);
  4131. }
  4132. }
  4133. } else if ( !inside && !isActive || isActive && inside ) {
  4134. return;
  4135. }
  4136. },
  4137. updateItems = function(){
  4138. scrollOffset = isWindow ? getScroll().y : element[scrollTop];
  4139. for (var index=0, itl=items[length]; index<itl; index++) {
  4140. updateItem(index)
  4141. }
  4142. };
  4143. // public method
  4144. this.refresh = function () {
  4145. updateItems();
  4146. }
  4147. // init
  4148. if ( !(stringScrollSpy in element) ) { // prevent adding event handlers twice
  4149. on( scrollTarget, scrollEvent, self.refresh );
  4150. on( globalObject, resizeEvent, self.refresh );
  4151. }
  4152. self.refresh();
  4153. element[stringScrollSpy] = self;
  4154. };
  4155. // SCROLLSPY DATA API
  4156. // ==================
  4157. supports[push]( [ stringScrollSpy, ScrollSpy, '['+dataSpy+'="scroll"]' ] );
  4158. /* Native Javascript for Bootstrap 4 | Tab
  4159. -----------------------------------------*/
  4160. // TAB DEFINITION
  4161. // ==============
  4162. var Tab = function( element, options ) {
  4163. // initialization element
  4164. element = queryElement(element);
  4165. // DATA API
  4166. var heightData = element[getAttribute](dataHeight),
  4167. // strings
  4168. component = 'tab', height = 'height', float = 'float', isAnimating = 'isAnimating';
  4169. // set options
  4170. options = options || {};
  4171. this[height] = supportTransitions ? (options[height] || heightData === 'true') : false;
  4172. // bind, event targets
  4173. var self = this, next,
  4174. tabs = getClosest(element,'.nav'),
  4175. tabsContentContainer = false,
  4176. dropdown = tabs && queryElement('.dropdown-toggle',tabs),
  4177. activeTab, activeContent, nextContent, containerHeight, equalContents, nextHeight,
  4178. // trigger
  4179. triggerEnd = function(){
  4180. tabsContentContainer[style][height] = '';
  4181. removeClass(tabsContentContainer,collapsing);
  4182. tabs[isAnimating] = false;
  4183. },
  4184. triggerShow = function() {
  4185. if (tabsContentContainer) { // height animation
  4186. if ( equalContents ) {
  4187. triggerEnd();
  4188. } else {
  4189. setTimeout(function(){ // enables height animation
  4190. tabsContentContainer[style][height] = nextHeight + 'px'; // height animation
  4191. tabsContentContainer[offsetWidth];
  4192. emulateTransitionEnd(tabsContentContainer, triggerEnd);
  4193. },50);
  4194. }
  4195. } else {
  4196. tabs[isAnimating] = false;
  4197. }
  4198. bootstrapCustomEvent.call(next, shownEvent, component, activeTab);
  4199. },
  4200. triggerHide = function() {
  4201. if (tabsContentContainer) {
  4202. activeContent[style][float] = left;
  4203. nextContent[style][float] = left;
  4204. containerHeight = activeContent[scrollHeight];
  4205. }
  4206. addClass(nextContent,active);
  4207. bootstrapCustomEvent.call(next, showEvent, component, activeTab);
  4208. removeClass(activeContent,active);
  4209. bootstrapCustomEvent.call(activeTab, hiddenEvent, component, next);
  4210. if (tabsContentContainer) {
  4211. nextHeight = nextContent[scrollHeight];
  4212. equalContents = nextHeight === containerHeight;
  4213. addClass(tabsContentContainer,collapsing);
  4214. tabsContentContainer[style][height] = containerHeight + 'px'; // height animation
  4215. tabsContentContainer[offsetHeight];
  4216. activeContent[style][float] = '';
  4217. nextContent[style][float] = '';
  4218. }
  4219. if ( hasClass(nextContent, 'fade') ) {
  4220. setTimeout(function(){
  4221. addClass(nextContent,showClass);
  4222. emulateTransitionEnd(nextContent,triggerShow);
  4223. },20);
  4224. } else { triggerShow(); }
  4225. };
  4226. if (!tabs) return; // invalidate
  4227. // set default animation state
  4228. tabs[isAnimating] = false;
  4229. // private methods
  4230. var getActiveTab = function() {
  4231. var activeTabs = getElementsByClassName(tabs,active), activeTab;
  4232. if ( activeTabs[length] === 1 && !hasClass(activeTabs[0][parentNode],'dropdown') ) {
  4233. activeTab = activeTabs[0];
  4234. } else if ( activeTabs[length] > 1 ) {
  4235. activeTab = activeTabs[activeTabs[length]-1];
  4236. }
  4237. return activeTab;
  4238. },
  4239. getActiveContent = function() {
  4240. return queryElement(getActiveTab()[getAttribute]('href'));
  4241. },
  4242. // handler
  4243. clickHandler = function(e) {
  4244. var href = e[target][getAttribute]('href');
  4245. e[preventDefault]();
  4246. next = e[target][getAttribute](dataToggle) === component || (href && href.charAt(0) === '#')
  4247. ? e[target] : e[target][parentNode]; // allow for child elements like icons to use the handler
  4248. !tabs[isAnimating] && !hasClass(next,active) && self.show();
  4249. };
  4250. // public method
  4251. this.show = function() { // the tab we clicked is now the next tab
  4252. next = next || element;
  4253. nextContent = queryElement(next[getAttribute]('href')); //this is the actual object, the next tab content to activate
  4254. activeTab = getActiveTab();
  4255. activeContent = getActiveContent();
  4256. tabs[isAnimating] = true;
  4257. removeClass(activeTab,active);
  4258. addClass(next,active);
  4259. if ( dropdown ) {
  4260. if ( !hasClass(element[parentNode],'dropdown-menu') ) {
  4261. if (hasClass(dropdown,active)) removeClass(dropdown,active);
  4262. } else {
  4263. if (!hasClass(dropdown,active)) addClass(dropdown,active);
  4264. }
  4265. }
  4266. bootstrapCustomEvent.call(activeTab, hideEvent, component, next);
  4267. if (hasClass(activeContent, 'fade')) {
  4268. removeClass(activeContent,showClass);
  4269. emulateTransitionEnd(activeContent, triggerHide);
  4270. } else { triggerHide(); }
  4271. };
  4272. // init
  4273. if ( !(stringTab in element) ) { // prevent adding event handlers twice
  4274. on(element, clickEvent, clickHandler);
  4275. }
  4276. if (self[height]) { tabsContentContainer = getActiveContent()[parentNode]; }
  4277. element[stringTab] = self;
  4278. };
  4279. // TAB DATA API
  4280. // ============
  4281. supports[push]( [ stringTab, Tab, '['+dataToggle+'="tab"]' ] );
  4282. /* Native Javascript for Bootstrap 4 | Tooltip
  4283. ---------------------------------------------*/
  4284. // TOOLTIP DEFINITION
  4285. // ==================
  4286. var Tooltip = function( element,options ) {
  4287. // initialization element
  4288. element = queryElement(element);
  4289. // set options
  4290. options = options || {};
  4291. // DATA API
  4292. var animationData = element[getAttribute](dataAnimation),
  4293. placementData = element[getAttribute](dataPlacement),
  4294. delayData = element[getAttribute](dataDelay),
  4295. containerData = element[getAttribute](dataContainer),
  4296. // strings
  4297. component = 'tooltip',
  4298. classString = 'class',
  4299. title = 'title',
  4300. fade = 'fade',
  4301. div = 'div',
  4302. // check container
  4303. containerElement = queryElement(options[container]),
  4304. containerDataElement = queryElement(containerData),
  4305. // maybe the element is inside a modal
  4306. modal = getClosest(element,'.modal'),
  4307. // maybe the element is inside a fixed navbar
  4308. navbarFixedTop = getClosest(element,'.'+fixedTop),
  4309. navbarFixedBottom = getClosest(element,'.'+fixedBottom);
  4310. // set instance options
  4311. this[animation] = options[animation] && options[animation] !== fade ? options[animation] : animationData || fade;
  4312. this[placement] = options[placement] ? options[placement] : placementData || top;
  4313. this[delay] = parseInt(options[delay] || delayData) || 200;
  4314. this[container] = containerElement ? containerElement
  4315. : containerDataElement ? containerDataElement
  4316. : navbarFixedTop ? navbarFixedTop
  4317. : navbarFixedBottom ? navbarFixedBottom
  4318. : modal ? modal : DOC[body];
  4319. // bind, event targets, title and constants
  4320. var self = this, timer = 0, placementSetting = this[placement], tooltip = null,
  4321. titleString = element[getAttribute](title) || element[getAttribute](dataTitle) || element[getAttribute](dataOriginalTitle);
  4322. if ( !titleString || titleString == "" ) return; // invalidate
  4323. // private methods
  4324. var removeToolTip = function() {
  4325. self[container].removeChild(tooltip);
  4326. tooltip = null; timer = null;
  4327. },
  4328. createToolTip = function() {
  4329. titleString = element[getAttribute](title) || element[getAttribute](dataTitle) || element[getAttribute](dataOriginalTitle); // read the title again
  4330. if ( !titleString || titleString == "" ) return false; // invalidate
  4331. tooltip = DOC[createElement](div);
  4332. tooltip[setAttribute]('role',component);
  4333. // tooltip arrow
  4334. var tooltipArrow = DOC[createElement](div);
  4335. tooltipArrow[setAttribute](classString,'arrow');
  4336. tooltip[appendChild](tooltipArrow);
  4337. var tooltipInner = DOC[createElement](div);
  4338. tooltipInner[setAttribute](classString,component+'-inner');
  4339. tooltip[appendChild](tooltipInner);
  4340. tooltipInner[innerHTML] = titleString;
  4341. self[container][appendChild](tooltip);
  4342. tooltip[setAttribute](classString, component + ' bs-' + component+'-'+placementSetting + ' ' + self[animation]);
  4343. },
  4344. updateTooltip = function () {
  4345. styleTip(element,tooltip,placementSetting,self[container]);
  4346. },
  4347. showTooltip = function () {
  4348. !hasClass(tooltip,showClass) && ( addClass(tooltip,showClass) );
  4349. },
  4350. // triggers
  4351. showTrigger = function() {
  4352. on( globalObject, resizeEvent, self.hide );
  4353. bootstrapCustomEvent.call(element, shownEvent, component);
  4354. },
  4355. hideTrigger = function() {
  4356. off( globalObject, resizeEvent, self.hide );
  4357. removeToolTip();
  4358. bootstrapCustomEvent.call(element, hiddenEvent, component);
  4359. };
  4360. // public methods
  4361. this.show = function() {
  4362. clearTimeout(timer);
  4363. timer = setTimeout( function() {
  4364. if (tooltip === null) {
  4365. placementSetting = self[placement]; // we reset placement in all cases
  4366. if(createToolTip() == false) return;
  4367. updateTooltip();
  4368. showTooltip();
  4369. bootstrapCustomEvent.call(element, showEvent, component);
  4370. !!self[animation] ? emulateTransitionEnd(tooltip, showTrigger) : showTrigger();
  4371. }
  4372. }, 20 );
  4373. };
  4374. this.hide = function() {
  4375. clearTimeout(timer);
  4376. timer = setTimeout( function() {
  4377. if (tooltip && hasClass(tooltip,showClass)) {
  4378. bootstrapCustomEvent.call(element, hideEvent, component);
  4379. removeClass(tooltip,showClass);
  4380. !!self[animation] ? emulateTransitionEnd(tooltip, hideTrigger) : hideTrigger();
  4381. }
  4382. }, self[delay]);
  4383. };
  4384. this.toggle = function() {
  4385. if (!tooltip) { self.show(); }
  4386. else { self.hide(); }
  4387. };
  4388. // init
  4389. if ( !(stringTooltip in element) ) { // prevent adding event handlers twice
  4390. element[setAttribute](dataOriginalTitle,titleString);
  4391. element.removeAttribute(title);
  4392. on(element, mouseHover[0], self.show);
  4393. on(element, mouseHover[1], self.hide);
  4394. }
  4395. element[stringTooltip] = self;
  4396. };
  4397. // TOOLTIP DATA API
  4398. // =================
  4399. supports[push]( [ stringTooltip, Tooltip, '['+dataToggle+'="tooltip"]' ] );
  4400. /* Native Javascript for Bootstrap 4 | Initialize Data API
  4401. --------------------------------------------------------*/
  4402. var initializeDataAPI = function( constructor, collection ){
  4403. for (var i=0, l=collection[length]; i<l; i++) {
  4404. new constructor(collection[i]);
  4405. }
  4406. },
  4407. initCallback = BSN.initCallback = function(lookUp){
  4408. lookUp = lookUp || DOC;
  4409. for (var i=0, l=supports[length]; i<l; i++) {
  4410. initializeDataAPI( supports[i][1], lookUp[querySelectorAll] (supports[i][2]) );
  4411. }
  4412. };
  4413. // bulk initialize all components
  4414. DOC[body] ? initCallback() : on( DOC, 'DOMContentLoaded', function(){ initCallback(); } );
  4415. return {
  4416. Alert: Alert,
  4417. Button: Button,
  4418. Carousel: Carousel,
  4419. Collapse: Collapse,
  4420. Dropdown: Dropdown,
  4421. Modal: Modal,
  4422. Popover: Popover,
  4423. ScrollSpy: ScrollSpy,
  4424. Tab: Tab,
  4425. Tooltip: Tooltip
  4426. };
  4427. }));
  4428. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  4429. /***/ }),
  4430. /***/ "./node_modules/es6-promise/dist/es6-promise.auto.js":
  4431. /*!***********************************************************!*\
  4432. !*** ./node_modules/es6-promise/dist/es6-promise.auto.js ***!
  4433. \***********************************************************/
  4434. /*! no static exports found */
  4435. /***/ (function(module, exports, __webpack_require__) {
  4436. /* WEBPACK VAR INJECTION */(function(process, global) {/*!
  4437. * @overview es6-promise - a tiny implementation of Promises/A+.
  4438. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  4439. * @license Licensed under MIT license
  4440. * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
  4441. * @version v4.2.4+314e4831
  4442. */
  4443. (function (global, factory) {
  4444. true ? module.exports = factory() :
  4445. undefined;
  4446. }(this, (function () { 'use strict';
  4447. function objectOrFunction(x) {
  4448. var type = typeof x;
  4449. return x !== null && (type === 'object' || type === 'function');
  4450. }
  4451. function isFunction(x) {
  4452. return typeof x === 'function';
  4453. }
  4454. var _isArray = void 0;
  4455. if (Array.isArray) {
  4456. _isArray = Array.isArray;
  4457. } else {
  4458. _isArray = function (x) {
  4459. return Object.prototype.toString.call(x) === '[object Array]';
  4460. };
  4461. }
  4462. var isArray = _isArray;
  4463. var len = 0;
  4464. var vertxNext = void 0;
  4465. var customSchedulerFn = void 0;
  4466. var asap = function asap(callback, arg) {
  4467. queue[len] = callback;
  4468. queue[len + 1] = arg;
  4469. len += 2;
  4470. if (len === 2) {
  4471. // If len is 2, that means that we need to schedule an async flush.
  4472. // If additional callbacks are queued before the queue is flushed, they
  4473. // will be processed by this flush that we are scheduling.
  4474. if (customSchedulerFn) {
  4475. customSchedulerFn(flush);
  4476. } else {
  4477. scheduleFlush();
  4478. }
  4479. }
  4480. };
  4481. function setScheduler(scheduleFn) {
  4482. customSchedulerFn = scheduleFn;
  4483. }
  4484. function setAsap(asapFn) {
  4485. asap = asapFn;
  4486. }
  4487. var browserWindow = typeof window !== 'undefined' ? window : undefined;
  4488. var browserGlobal = browserWindow || {};
  4489. var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
  4490. var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
  4491. // test for web worker but not in IE10
  4492. var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
  4493. // node
  4494. function useNextTick() {
  4495. // node version 0.10.x displays a deprecation warning when nextTick is used recursively
  4496. // see https://github.com/cujojs/when/issues/410 for details
  4497. return function () {
  4498. return process.nextTick(flush);
  4499. };
  4500. }
  4501. // vertx
  4502. function useVertxTimer() {
  4503. if (typeof vertxNext !== 'undefined') {
  4504. return function () {
  4505. vertxNext(flush);
  4506. };
  4507. }
  4508. return useSetTimeout();
  4509. }
  4510. function useMutationObserver() {
  4511. var iterations = 0;
  4512. var observer = new BrowserMutationObserver(flush);
  4513. var node = document.createTextNode('');
  4514. observer.observe(node, { characterData: true });
  4515. return function () {
  4516. node.data = iterations = ++iterations % 2;
  4517. };
  4518. }
  4519. // web worker
  4520. function useMessageChannel() {
  4521. var channel = new MessageChannel();
  4522. channel.port1.onmessage = flush;
  4523. return function () {
  4524. return channel.port2.postMessage(0);
  4525. };
  4526. }
  4527. function useSetTimeout() {
  4528. // Store setTimeout reference so es6-promise will be unaffected by
  4529. // other code modifying setTimeout (like sinon.useFakeTimers())
  4530. var globalSetTimeout = setTimeout;
  4531. return function () {
  4532. return globalSetTimeout(flush, 1);
  4533. };
  4534. }
  4535. var queue = new Array(1000);
  4536. function flush() {
  4537. for (var i = 0; i < len; i += 2) {
  4538. var callback = queue[i];
  4539. var arg = queue[i + 1];
  4540. callback(arg);
  4541. queue[i] = undefined;
  4542. queue[i + 1] = undefined;
  4543. }
  4544. len = 0;
  4545. }
  4546. function attemptVertx() {
  4547. try {
  4548. var vertx = Function('return this')().require('vertx');
  4549. vertxNext = vertx.runOnLoop || vertx.runOnContext;
  4550. return useVertxTimer();
  4551. } catch (e) {
  4552. return useSetTimeout();
  4553. }
  4554. }
  4555. var scheduleFlush = void 0;
  4556. // Decide what async method to use to triggering processing of queued callbacks:
  4557. if (isNode) {
  4558. scheduleFlush = useNextTick();
  4559. } else if (BrowserMutationObserver) {
  4560. scheduleFlush = useMutationObserver();
  4561. } else if (isWorker) {
  4562. scheduleFlush = useMessageChannel();
  4563. } else if (browserWindow === undefined && "function" === 'function') {
  4564. scheduleFlush = attemptVertx();
  4565. } else {
  4566. scheduleFlush = useSetTimeout();
  4567. }
  4568. function then(onFulfillment, onRejection) {
  4569. var parent = this;
  4570. var child = new this.constructor(noop);
  4571. if (child[PROMISE_ID] === undefined) {
  4572. makePromise(child);
  4573. }
  4574. var _state = parent._state;
  4575. if (_state) {
  4576. var callback = arguments[_state - 1];
  4577. asap(function () {
  4578. return invokeCallback(_state, child, callback, parent._result);
  4579. });
  4580. } else {
  4581. subscribe(parent, child, onFulfillment, onRejection);
  4582. }
  4583. return child;
  4584. }
  4585. /**
  4586. `Promise.resolve` returns a promise that will become resolved with the
  4587. passed `value`. It is shorthand for the following:
  4588. ```javascript
  4589. let promise = new Promise(function(resolve, reject){
  4590. resolve(1);
  4591. });
  4592. promise.then(function(value){
  4593. // value === 1
  4594. });
  4595. ```
  4596. Instead of writing the above, your code now simply becomes the following:
  4597. ```javascript
  4598. let promise = Promise.resolve(1);
  4599. promise.then(function(value){
  4600. // value === 1
  4601. });
  4602. ```
  4603. @method resolve
  4604. @static
  4605. @param {Any} value value that the returned promise will be resolved with
  4606. Useful for tooling.
  4607. @return {Promise} a promise that will become fulfilled with the given
  4608. `value`
  4609. */
  4610. function resolve$1(object) {
  4611. /*jshint validthis:true */
  4612. var Constructor = this;
  4613. if (object && typeof object === 'object' && object.constructor === Constructor) {
  4614. return object;
  4615. }
  4616. var promise = new Constructor(noop);
  4617. resolve(promise, object);
  4618. return promise;
  4619. }
  4620. var PROMISE_ID = Math.random().toString(36).substring(2);
  4621. function noop() {}
  4622. var PENDING = void 0;
  4623. var FULFILLED = 1;
  4624. var REJECTED = 2;
  4625. var TRY_CATCH_ERROR = { error: null };
  4626. function selfFulfillment() {
  4627. return new TypeError("You cannot resolve a promise with itself");
  4628. }
  4629. function cannotReturnOwn() {
  4630. return new TypeError('A promises callback cannot return that same promise.');
  4631. }
  4632. function getThen(promise) {
  4633. try {
  4634. return promise.then;
  4635. } catch (error) {
  4636. TRY_CATCH_ERROR.error = error;
  4637. return TRY_CATCH_ERROR;
  4638. }
  4639. }
  4640. function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
  4641. try {
  4642. then$$1.call(value, fulfillmentHandler, rejectionHandler);
  4643. } catch (e) {
  4644. return e;
  4645. }
  4646. }
  4647. function handleForeignThenable(promise, thenable, then$$1) {
  4648. asap(function (promise) {
  4649. var sealed = false;
  4650. var error = tryThen(then$$1, thenable, function (value) {
  4651. if (sealed) {
  4652. return;
  4653. }
  4654. sealed = true;
  4655. if (thenable !== value) {
  4656. resolve(promise, value);
  4657. } else {
  4658. fulfill(promise, value);
  4659. }
  4660. }, function (reason) {
  4661. if (sealed) {
  4662. return;
  4663. }
  4664. sealed = true;
  4665. reject(promise, reason);
  4666. }, 'Settle: ' + (promise._label || ' unknown promise'));
  4667. if (!sealed && error) {
  4668. sealed = true;
  4669. reject(promise, error);
  4670. }
  4671. }, promise);
  4672. }
  4673. function handleOwnThenable(promise, thenable) {
  4674. if (thenable._state === FULFILLED) {
  4675. fulfill(promise, thenable._result);
  4676. } else if (thenable._state === REJECTED) {
  4677. reject(promise, thenable._result);
  4678. } else {
  4679. subscribe(thenable, undefined, function (value) {
  4680. return resolve(promise, value);
  4681. }, function (reason) {
  4682. return reject(promise, reason);
  4683. });
  4684. }
  4685. }
  4686. function handleMaybeThenable(promise, maybeThenable, then$$1) {
  4687. if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
  4688. handleOwnThenable(promise, maybeThenable);
  4689. } else {
  4690. if (then$$1 === TRY_CATCH_ERROR) {
  4691. reject(promise, TRY_CATCH_ERROR.error);
  4692. TRY_CATCH_ERROR.error = null;
  4693. } else if (then$$1 === undefined) {
  4694. fulfill(promise, maybeThenable);
  4695. } else if (isFunction(then$$1)) {
  4696. handleForeignThenable(promise, maybeThenable, then$$1);
  4697. } else {
  4698. fulfill(promise, maybeThenable);
  4699. }
  4700. }
  4701. }
  4702. function resolve(promise, value) {
  4703. if (promise === value) {
  4704. reject(promise, selfFulfillment());
  4705. } else if (objectOrFunction(value)) {
  4706. handleMaybeThenable(promise, value, getThen(value));
  4707. } else {
  4708. fulfill(promise, value);
  4709. }
  4710. }
  4711. function publishRejection(promise) {
  4712. if (promise._onerror) {
  4713. promise._onerror(promise._result);
  4714. }
  4715. publish(promise);
  4716. }
  4717. function fulfill(promise, value) {
  4718. if (promise._state !== PENDING) {
  4719. return;
  4720. }
  4721. promise._result = value;
  4722. promise._state = FULFILLED;
  4723. if (promise._subscribers.length !== 0) {
  4724. asap(publish, promise);
  4725. }
  4726. }
  4727. function reject(promise, reason) {
  4728. if (promise._state !== PENDING) {
  4729. return;
  4730. }
  4731. promise._state = REJECTED;
  4732. promise._result = reason;
  4733. asap(publishRejection, promise);
  4734. }
  4735. function subscribe(parent, child, onFulfillment, onRejection) {
  4736. var _subscribers = parent._subscribers;
  4737. var length = _subscribers.length;
  4738. parent._onerror = null;
  4739. _subscribers[length] = child;
  4740. _subscribers[length + FULFILLED] = onFulfillment;
  4741. _subscribers[length + REJECTED] = onRejection;
  4742. if (length === 0 && parent._state) {
  4743. asap(publish, parent);
  4744. }
  4745. }
  4746. function publish(promise) {
  4747. var subscribers = promise._subscribers;
  4748. var settled = promise._state;
  4749. if (subscribers.length === 0) {
  4750. return;
  4751. }
  4752. var child = void 0,
  4753. callback = void 0,
  4754. detail = promise._result;
  4755. for (var i = 0; i < subscribers.length; i += 3) {
  4756. child = subscribers[i];
  4757. callback = subscribers[i + settled];
  4758. if (child) {
  4759. invokeCallback(settled, child, callback, detail);
  4760. } else {
  4761. callback(detail);
  4762. }
  4763. }
  4764. promise._subscribers.length = 0;
  4765. }
  4766. function tryCatch(callback, detail) {
  4767. try {
  4768. return callback(detail);
  4769. } catch (e) {
  4770. TRY_CATCH_ERROR.error = e;
  4771. return TRY_CATCH_ERROR;
  4772. }
  4773. }
  4774. function invokeCallback(settled, promise, callback, detail) {
  4775. var hasCallback = isFunction(callback),
  4776. value = void 0,
  4777. error = void 0,
  4778. succeeded = void 0,
  4779. failed = void 0;
  4780. if (hasCallback) {
  4781. value = tryCatch(callback, detail);
  4782. if (value === TRY_CATCH_ERROR) {
  4783. failed = true;
  4784. error = value.error;
  4785. value.error = null;
  4786. } else {
  4787. succeeded = true;
  4788. }
  4789. if (promise === value) {
  4790. reject(promise, cannotReturnOwn());
  4791. return;
  4792. }
  4793. } else {
  4794. value = detail;
  4795. succeeded = true;
  4796. }
  4797. if (promise._state !== PENDING) {
  4798. // noop
  4799. } else if (hasCallback && succeeded) {
  4800. resolve(promise, value);
  4801. } else if (failed) {
  4802. reject(promise, error);
  4803. } else if (settled === FULFILLED) {
  4804. fulfill(promise, value);
  4805. } else if (settled === REJECTED) {
  4806. reject(promise, value);
  4807. }
  4808. }
  4809. function initializePromise(promise, resolver) {
  4810. try {
  4811. resolver(function resolvePromise(value) {
  4812. resolve(promise, value);
  4813. }, function rejectPromise(reason) {
  4814. reject(promise, reason);
  4815. });
  4816. } catch (e) {
  4817. reject(promise, e);
  4818. }
  4819. }
  4820. var id = 0;
  4821. function nextId() {
  4822. return id++;
  4823. }
  4824. function makePromise(promise) {
  4825. promise[PROMISE_ID] = id++;
  4826. promise._state = undefined;
  4827. promise._result = undefined;
  4828. promise._subscribers = [];
  4829. }
  4830. function validationError() {
  4831. return new Error('Array Methods must be provided an Array');
  4832. }
  4833. var Enumerator = function () {
  4834. function Enumerator(Constructor, input) {
  4835. this._instanceConstructor = Constructor;
  4836. this.promise = new Constructor(noop);
  4837. if (!this.promise[PROMISE_ID]) {
  4838. makePromise(this.promise);
  4839. }
  4840. if (isArray(input)) {
  4841. this.length = input.length;
  4842. this._remaining = input.length;
  4843. this._result = new Array(this.length);
  4844. if (this.length === 0) {
  4845. fulfill(this.promise, this._result);
  4846. } else {
  4847. this.length = this.length || 0;
  4848. this._enumerate(input);
  4849. if (this._remaining === 0) {
  4850. fulfill(this.promise, this._result);
  4851. }
  4852. }
  4853. } else {
  4854. reject(this.promise, validationError());
  4855. }
  4856. }
  4857. Enumerator.prototype._enumerate = function _enumerate(input) {
  4858. for (var i = 0; this._state === PENDING && i < input.length; i++) {
  4859. this._eachEntry(input[i], i);
  4860. }
  4861. };
  4862. Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {
  4863. var c = this._instanceConstructor;
  4864. var resolve$$1 = c.resolve;
  4865. if (resolve$$1 === resolve$1) {
  4866. var _then = getThen(entry);
  4867. if (_then === then && entry._state !== PENDING) {
  4868. this._settledAt(entry._state, i, entry._result);
  4869. } else if (typeof _then !== 'function') {
  4870. this._remaining--;
  4871. this._result[i] = entry;
  4872. } else if (c === Promise$2) {
  4873. var promise = new c(noop);
  4874. handleMaybeThenable(promise, entry, _then);
  4875. this._willSettleAt(promise, i);
  4876. } else {
  4877. this._willSettleAt(new c(function (resolve$$1) {
  4878. return resolve$$1(entry);
  4879. }), i);
  4880. }
  4881. } else {
  4882. this._willSettleAt(resolve$$1(entry), i);
  4883. }
  4884. };
  4885. Enumerator.prototype._settledAt = function _settledAt(state, i, value) {
  4886. var promise = this.promise;
  4887. if (promise._state === PENDING) {
  4888. this._remaining--;
  4889. if (state === REJECTED) {
  4890. reject(promise, value);
  4891. } else {
  4892. this._result[i] = value;
  4893. }
  4894. }
  4895. if (this._remaining === 0) {
  4896. fulfill(promise, this._result);
  4897. }
  4898. };
  4899. Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {
  4900. var enumerator = this;
  4901. subscribe(promise, undefined, function (value) {
  4902. return enumerator._settledAt(FULFILLED, i, value);
  4903. }, function (reason) {
  4904. return enumerator._settledAt(REJECTED, i, reason);
  4905. });
  4906. };
  4907. return Enumerator;
  4908. }();
  4909. /**
  4910. `Promise.all` accepts an array of promises, and returns a new promise which
  4911. is fulfilled with an array of fulfillment values for the passed promises, or
  4912. rejected with the reason of the first passed promise to be rejected. It casts all
  4913. elements of the passed iterable to promises as it runs this algorithm.
  4914. Example:
  4915. ```javascript
  4916. let promise1 = resolve(1);
  4917. let promise2 = resolve(2);
  4918. let promise3 = resolve(3);
  4919. let promises = [ promise1, promise2, promise3 ];
  4920. Promise.all(promises).then(function(array){
  4921. // The array here would be [ 1, 2, 3 ];
  4922. });
  4923. ```
  4924. If any of the `promises` given to `all` are rejected, the first promise
  4925. that is rejected will be given as an argument to the returned promises's
  4926. rejection handler. For example:
  4927. Example:
  4928. ```javascript
  4929. let promise1 = resolve(1);
  4930. let promise2 = reject(new Error("2"));
  4931. let promise3 = reject(new Error("3"));
  4932. let promises = [ promise1, promise2, promise3 ];
  4933. Promise.all(promises).then(function(array){
  4934. // Code here never runs because there are rejected promises!
  4935. }, function(error) {
  4936. // error.message === "2"
  4937. });
  4938. ```
  4939. @method all
  4940. @static
  4941. @param {Array} entries array of promises
  4942. @param {String} label optional string for labeling the promise.
  4943. Useful for tooling.
  4944. @return {Promise} promise that is fulfilled when all `promises` have been
  4945. fulfilled, or rejected if any of them become rejected.
  4946. @static
  4947. */
  4948. function all(entries) {
  4949. return new Enumerator(this, entries).promise;
  4950. }
  4951. /**
  4952. `Promise.race` returns a new promise which is settled in the same way as the
  4953. first passed promise to settle.
  4954. Example:
  4955. ```javascript
  4956. let promise1 = new Promise(function(resolve, reject){
  4957. setTimeout(function(){
  4958. resolve('promise 1');
  4959. }, 200);
  4960. });
  4961. let promise2 = new Promise(function(resolve, reject){
  4962. setTimeout(function(){
  4963. resolve('promise 2');
  4964. }, 100);
  4965. });
  4966. Promise.race([promise1, promise2]).then(function(result){
  4967. // result === 'promise 2' because it was resolved before promise1
  4968. // was resolved.
  4969. });
  4970. ```
  4971. `Promise.race` is deterministic in that only the state of the first
  4972. settled promise matters. For example, even if other promises given to the
  4973. `promises` array argument are resolved, but the first settled promise has
  4974. become rejected before the other promises became fulfilled, the returned
  4975. promise will become rejected:
  4976. ```javascript
  4977. let promise1 = new Promise(function(resolve, reject){
  4978. setTimeout(function(){
  4979. resolve('promise 1');
  4980. }, 200);
  4981. });
  4982. let promise2 = new Promise(function(resolve, reject){
  4983. setTimeout(function(){
  4984. reject(new Error('promise 2'));
  4985. }, 100);
  4986. });
  4987. Promise.race([promise1, promise2]).then(function(result){
  4988. // Code here never runs
  4989. }, function(reason){
  4990. // reason.message === 'promise 2' because promise 2 became rejected before
  4991. // promise 1 became fulfilled
  4992. });
  4993. ```
  4994. An example real-world use case is implementing timeouts:
  4995. ```javascript
  4996. Promise.race([ajax('foo.json'), timeout(5000)])
  4997. ```
  4998. @method race
  4999. @static
  5000. @param {Array} promises array of promises to observe
  5001. Useful for tooling.
  5002. @return {Promise} a promise which settles in the same way as the first passed
  5003. promise to settle.
  5004. */
  5005. function race(entries) {
  5006. /*jshint validthis:true */
  5007. var Constructor = this;
  5008. if (!isArray(entries)) {
  5009. return new Constructor(function (_, reject) {
  5010. return reject(new TypeError('You must pass an array to race.'));
  5011. });
  5012. } else {
  5013. return new Constructor(function (resolve, reject) {
  5014. var length = entries.length;
  5015. for (var i = 0; i < length; i++) {
  5016. Constructor.resolve(entries[i]).then(resolve, reject);
  5017. }
  5018. });
  5019. }
  5020. }
  5021. /**
  5022. `Promise.reject` returns a promise rejected with the passed `reason`.
  5023. It is shorthand for the following:
  5024. ```javascript
  5025. let promise = new Promise(function(resolve, reject){
  5026. reject(new Error('WHOOPS'));
  5027. });
  5028. promise.then(function(value){
  5029. // Code here doesn't run because the promise is rejected!
  5030. }, function(reason){
  5031. // reason.message === 'WHOOPS'
  5032. });
  5033. ```
  5034. Instead of writing the above, your code now simply becomes the following:
  5035. ```javascript
  5036. let promise = Promise.reject(new Error('WHOOPS'));
  5037. promise.then(function(value){
  5038. // Code here doesn't run because the promise is rejected!
  5039. }, function(reason){
  5040. // reason.message === 'WHOOPS'
  5041. });
  5042. ```
  5043. @method reject
  5044. @static
  5045. @param {Any} reason value that the returned promise will be rejected with.
  5046. Useful for tooling.
  5047. @return {Promise} a promise rejected with the given `reason`.
  5048. */
  5049. function reject$1(reason) {
  5050. /*jshint validthis:true */
  5051. var Constructor = this;
  5052. var promise = new Constructor(noop);
  5053. reject(promise, reason);
  5054. return promise;
  5055. }
  5056. function needsResolver() {
  5057. throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
  5058. }
  5059. function needsNew() {
  5060. throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
  5061. }
  5062. /**
  5063. Promise objects represent the eventual result of an asynchronous operation. The
  5064. primary way of interacting with a promise is through its `then` method, which
  5065. registers callbacks to receive either a promise's eventual value or the reason
  5066. why the promise cannot be fulfilled.
  5067. Terminology
  5068. -----------
  5069. - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
  5070. - `thenable` is an object or function that defines a `then` method.
  5071. - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
  5072. - `exception` is a value that is thrown using the throw statement.
  5073. - `reason` is a value that indicates why a promise was rejected.
  5074. - `settled` the final resting state of a promise, fulfilled or rejected.
  5075. A promise can be in one of three states: pending, fulfilled, or rejected.
  5076. Promises that are fulfilled have a fulfillment value and are in the fulfilled
  5077. state. Promises that are rejected have a rejection reason and are in the
  5078. rejected state. A fulfillment value is never a thenable.
  5079. Promises can also be said to *resolve* a value. If this value is also a
  5080. promise, then the original promise's settled state will match the value's
  5081. settled state. So a promise that *resolves* a promise that rejects will
  5082. itself reject, and a promise that *resolves* a promise that fulfills will
  5083. itself fulfill.
  5084. Basic Usage:
  5085. ------------
  5086. ```js
  5087. let promise = new Promise(function(resolve, reject) {
  5088. // on success
  5089. resolve(value);
  5090. // on failure
  5091. reject(reason);
  5092. });
  5093. promise.then(function(value) {
  5094. // on fulfillment
  5095. }, function(reason) {
  5096. // on rejection
  5097. });
  5098. ```
  5099. Advanced Usage:
  5100. ---------------
  5101. Promises shine when abstracting away asynchronous interactions such as
  5102. `XMLHttpRequest`s.
  5103. ```js
  5104. function getJSON(url) {
  5105. return new Promise(function(resolve, reject){
  5106. let xhr = new XMLHttpRequest();
  5107. xhr.open('GET', url);
  5108. xhr.onreadystatechange = handler;
  5109. xhr.responseType = 'json';
  5110. xhr.setRequestHeader('Accept', 'application/json');
  5111. xhr.send();
  5112. function handler() {
  5113. if (this.readyState === this.DONE) {
  5114. if (this.status === 200) {
  5115. resolve(this.response);
  5116. } else {
  5117. reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
  5118. }
  5119. }
  5120. };
  5121. });
  5122. }
  5123. getJSON('/posts.json').then(function(json) {
  5124. // on fulfillment
  5125. }, function(reason) {
  5126. // on rejection
  5127. });
  5128. ```
  5129. Unlike callbacks, promises are great composable primitives.
  5130. ```js
  5131. Promise.all([
  5132. getJSON('/posts'),
  5133. getJSON('/comments')
  5134. ]).then(function(values){
  5135. values[0] // => postsJSON
  5136. values[1] // => commentsJSON
  5137. return values;
  5138. });
  5139. ```
  5140. @class Promise
  5141. @param {Function} resolver
  5142. Useful for tooling.
  5143. @constructor
  5144. */
  5145. var Promise$2 = function () {
  5146. function Promise(resolver) {
  5147. this[PROMISE_ID] = nextId();
  5148. this._result = this._state = undefined;
  5149. this._subscribers = [];
  5150. if (noop !== resolver) {
  5151. typeof resolver !== 'function' && needsResolver();
  5152. this instanceof Promise ? initializePromise(this, resolver) : needsNew();
  5153. }
  5154. }
  5155. /**
  5156. The primary way of interacting with a promise is through its `then` method,
  5157. which registers callbacks to receive either a promise's eventual value or the
  5158. reason why the promise cannot be fulfilled.
  5159. ```js
  5160. findUser().then(function(user){
  5161. // user is available
  5162. }, function(reason){
  5163. // user is unavailable, and you are given the reason why
  5164. });
  5165. ```
  5166. Chaining
  5167. --------
  5168. The return value of `then` is itself a promise. This second, 'downstream'
  5169. promise is resolved with the return value of the first promise's fulfillment
  5170. or rejection handler, or rejected if the handler throws an exception.
  5171. ```js
  5172. findUser().then(function (user) {
  5173. return user.name;
  5174. }, function (reason) {
  5175. return 'default name';
  5176. }).then(function (userName) {
  5177. // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
  5178. // will be `'default name'`
  5179. });
  5180. findUser().then(function (user) {
  5181. throw new Error('Found user, but still unhappy');
  5182. }, function (reason) {
  5183. throw new Error('`findUser` rejected and we're unhappy');
  5184. }).then(function (value) {
  5185. // never reached
  5186. }, function (reason) {
  5187. // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
  5188. // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
  5189. });
  5190. ```
  5191. If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
  5192. ```js
  5193. findUser().then(function (user) {
  5194. throw new PedagogicalException('Upstream error');
  5195. }).then(function (value) {
  5196. // never reached
  5197. }).then(function (value) {
  5198. // never reached
  5199. }, function (reason) {
  5200. // The `PedgagocialException` is propagated all the way down to here
  5201. });
  5202. ```
  5203. Assimilation
  5204. ------------
  5205. Sometimes the value you want to propagate to a downstream promise can only be
  5206. retrieved asynchronously. This can be achieved by returning a promise in the
  5207. fulfillment or rejection handler. The downstream promise will then be pending
  5208. until the returned promise is settled. This is called *assimilation*.
  5209. ```js
  5210. findUser().then(function (user) {
  5211. return findCommentsByAuthor(user);
  5212. }).then(function (comments) {
  5213. // The user's comments are now available
  5214. });
  5215. ```
  5216. If the assimliated promise rejects, then the downstream promise will also reject.
  5217. ```js
  5218. findUser().then(function (user) {
  5219. return findCommentsByAuthor(user);
  5220. }).then(function (comments) {
  5221. // If `findCommentsByAuthor` fulfills, we'll have the value here
  5222. }, function (reason) {
  5223. // If `findCommentsByAuthor` rejects, we'll have the reason here
  5224. });
  5225. ```
  5226. Simple Example
  5227. --------------
  5228. Synchronous Example
  5229. ```javascript
  5230. let result;
  5231. try {
  5232. result = findResult();
  5233. // success
  5234. } catch(reason) {
  5235. // failure
  5236. }
  5237. ```
  5238. Errback Example
  5239. ```js
  5240. findResult(function(result, err){
  5241. if (err) {
  5242. // failure
  5243. } else {
  5244. // success
  5245. }
  5246. });
  5247. ```
  5248. Promise Example;
  5249. ```javascript
  5250. findResult().then(function(result){
  5251. // success
  5252. }, function(reason){
  5253. // failure
  5254. });
  5255. ```
  5256. Advanced Example
  5257. --------------
  5258. Synchronous Example
  5259. ```javascript
  5260. let author, books;
  5261. try {
  5262. author = findAuthor();
  5263. books = findBooksByAuthor(author);
  5264. // success
  5265. } catch(reason) {
  5266. // failure
  5267. }
  5268. ```
  5269. Errback Example
  5270. ```js
  5271. function foundBooks(books) {
  5272. }
  5273. function failure(reason) {
  5274. }
  5275. findAuthor(function(author, err){
  5276. if (err) {
  5277. failure(err);
  5278. // failure
  5279. } else {
  5280. try {
  5281. findBoooksByAuthor(author, function(books, err) {
  5282. if (err) {
  5283. failure(err);
  5284. } else {
  5285. try {
  5286. foundBooks(books);
  5287. } catch(reason) {
  5288. failure(reason);
  5289. }
  5290. }
  5291. });
  5292. } catch(error) {
  5293. failure(err);
  5294. }
  5295. // success
  5296. }
  5297. });
  5298. ```
  5299. Promise Example;
  5300. ```javascript
  5301. findAuthor().
  5302. then(findBooksByAuthor).
  5303. then(function(books){
  5304. // found books
  5305. }).catch(function(reason){
  5306. // something went wrong
  5307. });
  5308. ```
  5309. @method then
  5310. @param {Function} onFulfilled
  5311. @param {Function} onRejected
  5312. Useful for tooling.
  5313. @return {Promise}
  5314. */
  5315. /**
  5316. `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
  5317. as the catch block of a try/catch statement.
  5318. ```js
  5319. function findAuthor(){
  5320. throw new Error('couldn't find that author');
  5321. }
  5322. // synchronous
  5323. try {
  5324. findAuthor();
  5325. } catch(reason) {
  5326. // something went wrong
  5327. }
  5328. // async with promises
  5329. findAuthor().catch(function(reason){
  5330. // something went wrong
  5331. });
  5332. ```
  5333. @method catch
  5334. @param {Function} onRejection
  5335. Useful for tooling.
  5336. @return {Promise}
  5337. */
  5338. Promise.prototype.catch = function _catch(onRejection) {
  5339. return this.then(null, onRejection);
  5340. };
  5341. /**
  5342. `finally` will be invoked regardless of the promise's fate just as native
  5343. try/catch/finally behaves
  5344. Synchronous example:
  5345. ```js
  5346. findAuthor() {
  5347. if (Math.random() > 0.5) {
  5348. throw new Error();
  5349. }
  5350. return new Author();
  5351. }
  5352. try {
  5353. return findAuthor(); // succeed or fail
  5354. } catch(error) {
  5355. return findOtherAuther();
  5356. } finally {
  5357. // always runs
  5358. // doesn't affect the return value
  5359. }
  5360. ```
  5361. Asynchronous example:
  5362. ```js
  5363. findAuthor().catch(function(reason){
  5364. return findOtherAuther();
  5365. }).finally(function(){
  5366. // author was either found, or not
  5367. });
  5368. ```
  5369. @method finally
  5370. @param {Function} callback
  5371. @return {Promise}
  5372. */
  5373. Promise.prototype.finally = function _finally(callback) {
  5374. var promise = this;
  5375. var constructor = promise.constructor;
  5376. return promise.then(function (value) {
  5377. return constructor.resolve(callback()).then(function () {
  5378. return value;
  5379. });
  5380. }, function (reason) {
  5381. return constructor.resolve(callback()).then(function () {
  5382. throw reason;
  5383. });
  5384. });
  5385. };
  5386. return Promise;
  5387. }();
  5388. Promise$2.prototype.then = then;
  5389. Promise$2.all = all;
  5390. Promise$2.race = race;
  5391. Promise$2.resolve = resolve$1;
  5392. Promise$2.reject = reject$1;
  5393. Promise$2._setScheduler = setScheduler;
  5394. Promise$2._setAsap = setAsap;
  5395. Promise$2._asap = asap;
  5396. /*global self*/
  5397. function polyfill() {
  5398. var local = void 0;
  5399. if (typeof global !== 'undefined') {
  5400. local = global;
  5401. } else if (typeof self !== 'undefined') {
  5402. local = self;
  5403. } else {
  5404. try {
  5405. local = Function('return this')();
  5406. } catch (e) {
  5407. throw new Error('polyfill failed because global object is unavailable in this environment');
  5408. }
  5409. }
  5410. var P = local.Promise;
  5411. if (P) {
  5412. var promiseToString = null;
  5413. try {
  5414. promiseToString = Object.prototype.toString.call(P.resolve());
  5415. } catch (e) {
  5416. // silently ignored
  5417. }
  5418. if (promiseToString === '[object Promise]' && !P.cast) {
  5419. return;
  5420. }
  5421. }
  5422. local.Promise = Promise$2;
  5423. }
  5424. // Strange compat..
  5425. Promise$2.polyfill = polyfill;
  5426. Promise$2.Promise = Promise$2;
  5427. Promise$2.polyfill();
  5428. return Promise$2;
  5429. })));
  5430. //# sourceMappingURL=es6-promise.auto.map
  5431. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  5432. /***/ }),
  5433. /***/ "./node_modules/filesize/lib/filesize.js":
  5434. /*!***********************************************!*\
  5435. !*** ./node_modules/filesize/lib/filesize.js ***!
  5436. \***********************************************/
  5437. /*! no static exports found */
  5438. /***/ (function(module, exports, __webpack_require__) {
  5439. "use strict";
  5440. /* WEBPACK VAR INJECTION */(function(global) {
  5441. /**
  5442. * filesize
  5443. *
  5444. * @copyright 2018 Jason Mulligan <jason.mulligan@avoidwork.com>
  5445. * @license BSD-3-Clause
  5446. * @version 3.6.1
  5447. */
  5448. (function (global) {
  5449. var b = /^(b|B)$/,
  5450. symbol = {
  5451. iec: {
  5452. bits: ["b", "Kib", "Mib", "Gib", "Tib", "Pib", "Eib", "Zib", "Yib"],
  5453. bytes: ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"]
  5454. },
  5455. jedec: {
  5456. bits: ["b", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"],
  5457. bytes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
  5458. }
  5459. },
  5460. fullform = {
  5461. iec: ["", "kibi", "mebi", "gibi", "tebi", "pebi", "exbi", "zebi", "yobi"],
  5462. jedec: ["", "kilo", "mega", "giga", "tera", "peta", "exa", "zetta", "yotta"]
  5463. };
  5464. /**
  5465. * filesize
  5466. *
  5467. * @method filesize
  5468. * @param {Mixed} arg String, Int or Float to transform
  5469. * @param {Object} descriptor [Optional] Flags
  5470. * @return {String} Readable file size String
  5471. */
  5472. function filesize(arg) {
  5473. var descriptor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  5474. var result = [],
  5475. val = 0,
  5476. e = void 0,
  5477. base = void 0,
  5478. bits = void 0,
  5479. ceil = void 0,
  5480. full = void 0,
  5481. fullforms = void 0,
  5482. neg = void 0,
  5483. num = void 0,
  5484. output = void 0,
  5485. round = void 0,
  5486. unix = void 0,
  5487. separator = void 0,
  5488. spacer = void 0,
  5489. standard = void 0,
  5490. symbols = void 0;
  5491. if (isNaN(arg)) {
  5492. throw new Error("Invalid arguments");
  5493. }
  5494. bits = descriptor.bits === true;
  5495. unix = descriptor.unix === true;
  5496. base = descriptor.base || 2;
  5497. round = descriptor.round !== void 0 ? descriptor.round : unix ? 1 : 2;
  5498. separator = descriptor.separator !== void 0 ? descriptor.separator || "" : "";
  5499. spacer = descriptor.spacer !== void 0 ? descriptor.spacer : unix ? "" : " ";
  5500. symbols = descriptor.symbols || descriptor.suffixes || {};
  5501. standard = base === 2 ? descriptor.standard || "jedec" : "jedec";
  5502. output = descriptor.output || "string";
  5503. full = descriptor.fullform === true;
  5504. fullforms = descriptor.fullforms instanceof Array ? descriptor.fullforms : [];
  5505. e = descriptor.exponent !== void 0 ? descriptor.exponent : -1;
  5506. num = Number(arg);
  5507. neg = num < 0;
  5508. ceil = base > 2 ? 1000 : 1024;
  5509. // Flipping a negative number to determine the size
  5510. if (neg) {
  5511. num = -num;
  5512. }
  5513. // Determining the exponent
  5514. if (e === -1 || isNaN(e)) {
  5515. e = Math.floor(Math.log(num) / Math.log(ceil));
  5516. if (e < 0) {
  5517. e = 0;
  5518. }
  5519. }
  5520. // Exceeding supported length, time to reduce & multiply
  5521. if (e > 8) {
  5522. e = 8;
  5523. }
  5524. // Zero is now a special case because bytes divide by 1
  5525. if (num === 0) {
  5526. result[0] = 0;
  5527. result[1] = unix ? "" : symbol[standard][bits ? "bits" : "bytes"][e];
  5528. } else {
  5529. val = num / (base === 2 ? Math.pow(2, e * 10) : Math.pow(1000, e));
  5530. if (bits) {
  5531. val = val * 8;
  5532. if (val >= ceil && e < 8) {
  5533. val = val / ceil;
  5534. e++;
  5535. }
  5536. }
  5537. result[0] = Number(val.toFixed(e > 0 ? round : 0));
  5538. result[1] = base === 10 && e === 1 ? bits ? "kb" : "kB" : symbol[standard][bits ? "bits" : "bytes"][e];
  5539. if (unix) {
  5540. result[1] = standard === "jedec" ? result[1].charAt(0) : e > 0 ? result[1].replace(/B$/, "") : result[1];
  5541. if (b.test(result[1])) {
  5542. result[0] = Math.floor(result[0]);
  5543. result[1] = "";
  5544. }
  5545. }
  5546. }
  5547. // Decorating a 'diff'
  5548. if (neg) {
  5549. result[0] = -result[0];
  5550. }
  5551. // Applying custom symbol
  5552. result[1] = symbols[result[1]] || result[1];
  5553. // Returning Array, Object, or String (default)
  5554. if (output === "array") {
  5555. return result;
  5556. }
  5557. if (output === "exponent") {
  5558. return e;
  5559. }
  5560. if (output === "object") {
  5561. return { value: result[0], suffix: result[1], symbol: result[1] };
  5562. }
  5563. if (full) {
  5564. result[1] = fullforms[e] ? fullforms[e] : fullform[standard][e] + (bits ? "bit" : "byte") + (result[0] === 1 ? "" : "s");
  5565. }
  5566. if (separator.length > 0) {
  5567. result[0] = result[0].toString().replace(".", separator);
  5568. }
  5569. return result.join(spacer);
  5570. }
  5571. // Partial application for functional programming
  5572. filesize.partial = function (opt) {
  5573. return function (arg) {
  5574. return filesize(arg, opt);
  5575. };
  5576. };
  5577. // CommonJS, AMD, script tag
  5578. if (true) {
  5579. module.exports = filesize;
  5580. } else {}
  5581. })(typeof window !== "undefined" ? window : global);
  5582. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  5583. /***/ }),
  5584. /***/ "./node_modules/formdata-polyfill/FormData.js":
  5585. /*!****************************************************!*\
  5586. !*** ./node_modules/formdata-polyfill/FormData.js ***!
  5587. \****************************************************/
  5588. /*! no static exports found */
  5589. /***/ (function(module, exports) {
  5590. if (typeof FormData === 'undefined' || !FormData.prototype.keys) {
  5591. const global = typeof window === 'object'
  5592. ? window : typeof self === 'object'
  5593. ? self : this
  5594. // keep a reference to native implementation
  5595. const _FormData = global.FormData
  5596. // To be monkey patched
  5597. const _send = global.XMLHttpRequest && global.XMLHttpRequest.prototype.send
  5598. const _fetch = global.Request && global.fetch
  5599. // Unable to patch Request constructor correctly
  5600. // const _Request = global.Request
  5601. // only way is to use ES6 class extend
  5602. // https://github.com/babel/babel/issues/1966
  5603. const stringTag = global.Symbol && Symbol.toStringTag
  5604. const map = new WeakMap
  5605. const wm = o => map.get(o)
  5606. const arrayFrom = Array.from || (obj => [].slice.call(obj))
  5607. // Add missing stringTags to blob and files
  5608. if (stringTag) {
  5609. if (!Blob.prototype[stringTag]) {
  5610. Blob.prototype[stringTag] = 'Blob'
  5611. }
  5612. if ('File' in global && !File.prototype[stringTag]) {
  5613. File.prototype[stringTag] = 'File'
  5614. }
  5615. }
  5616. // Fix so you can construct your own File
  5617. try {
  5618. new File([], '')
  5619. } catch (a) {
  5620. global.File = function(b, d, c) {
  5621. const blob = new Blob(b, c)
  5622. const t = c && void 0 !== c.lastModified ? new Date(c.lastModified) : new Date
  5623. Object.defineProperties(blob, {
  5624. name: {
  5625. value: d
  5626. },
  5627. lastModifiedDate: {
  5628. value: t
  5629. },
  5630. lastModified: {
  5631. value: +t
  5632. },
  5633. toString: {
  5634. value() {
  5635. return '[object File]'
  5636. }
  5637. }
  5638. })
  5639. if (stringTag) {
  5640. Object.defineProperty(blob, stringTag, {
  5641. value: 'File'
  5642. })
  5643. }
  5644. return blob
  5645. }
  5646. }
  5647. function normalizeValue([value, filename]) {
  5648. if (value instanceof Blob)
  5649. // Should always returns a new File instance
  5650. // console.assert(fd.get(x) !== fd.get(x))
  5651. value = new File([value], filename, {
  5652. type: value.type,
  5653. lastModified: value.lastModified
  5654. })
  5655. return value
  5656. }
  5657. function stringify(name) {
  5658. if (!arguments.length)
  5659. throw new TypeError('1 argument required, but only 0 present.')
  5660. return [name + '']
  5661. }
  5662. function normalizeArgs(name, value, filename) {
  5663. if (arguments.length < 2)
  5664. throw new TypeError(
  5665. `2 arguments required, but only ${arguments.length} present.`
  5666. )
  5667. return value instanceof Blob
  5668. // normalize name and filename if adding an attachment
  5669. ? [name + '', value, filename !== undefined
  5670. ? filename + '' // Cast filename to string if 3th arg isn't undefined
  5671. : typeof value.name === 'string' // if name prop exist
  5672. ? value.name // Use File.name
  5673. : 'blob'] // otherwise fallback to Blob
  5674. // If no attachment, just cast the args to strings
  5675. : [name + '', value + '']
  5676. }
  5677. /**
  5678. * @implements {Iterable}
  5679. */
  5680. class FormDataPolyfill {
  5681. /**
  5682. * FormData class
  5683. *
  5684. * @param {HTMLElement=} form
  5685. */
  5686. constructor(form) {
  5687. map.set(this, Object.create(null))
  5688. if (!form)
  5689. return this
  5690. for (let elm of arrayFrom(form.elements)) {
  5691. if (!elm.name || elm.disabled) continue
  5692. if (elm.type === 'file')
  5693. for (let file of arrayFrom(elm.files || []))
  5694. this.append(elm.name, file)
  5695. else if (elm.type === 'select-multiple' || elm.type === 'select-one')
  5696. for (let opt of arrayFrom(elm.options))
  5697. !opt.disabled && opt.selected && this.append(elm.name, opt.value)
  5698. else if (elm.type === 'checkbox' || elm.type === 'radio') {
  5699. if (elm.checked) this.append(elm.name, elm.value)
  5700. } else
  5701. this.append(elm.name, elm.value)
  5702. }
  5703. }
  5704. /**
  5705. * Append a field
  5706. *
  5707. * @param {String} name field name
  5708. * @param {String|Blob|File} value string / blob / file
  5709. * @param {String=} filename filename to use with blob
  5710. * @return {Undefined}
  5711. */
  5712. append(name, value, filename) {
  5713. const map = wm(this)
  5714. if (!map[name])
  5715. map[name] = []
  5716. map[name].push([value, filename])
  5717. }
  5718. /**
  5719. * Delete all fields values given name
  5720. *
  5721. * @param {String} name Field name
  5722. * @return {Undefined}
  5723. */
  5724. delete(name) {
  5725. delete wm(this)[name]
  5726. }
  5727. /**
  5728. * Iterate over all fields as [name, value]
  5729. *
  5730. * @return {Iterator}
  5731. */
  5732. *entries() {
  5733. const map = wm(this)
  5734. for (let name in map)
  5735. for (let value of map[name])
  5736. yield [name, normalizeValue(value)]
  5737. }
  5738. /**
  5739. * Iterate over all fields
  5740. *
  5741. * @param {Function} callback Executed for each item with parameters (value, name, thisArg)
  5742. * @param {Object=} thisArg `this` context for callback function
  5743. * @return {Undefined}
  5744. */
  5745. forEach(callback, thisArg) {
  5746. for (let [name, value] of this)
  5747. callback.call(thisArg, value, name, this)
  5748. }
  5749. /**
  5750. * Return first field value given name
  5751. * or null if non existen
  5752. *
  5753. * @param {String} name Field name
  5754. * @return {String|File|null} value Fields value
  5755. */
  5756. get(name) {
  5757. const map = wm(this)
  5758. return map[name] ? normalizeValue(map[name][0]) : null
  5759. }
  5760. /**
  5761. * Return all fields values given name
  5762. *
  5763. * @param {String} name Fields name
  5764. * @return {Array} [{String|File}]
  5765. */
  5766. getAll(name) {
  5767. return (wm(this)[name] || []).map(normalizeValue)
  5768. }
  5769. /**
  5770. * Check for field name existence
  5771. *
  5772. * @param {String} name Field name
  5773. * @return {boolean}
  5774. */
  5775. has(name) {
  5776. return name in wm(this)
  5777. }
  5778. /**
  5779. * Iterate over all fields name
  5780. *
  5781. * @return {Iterator}
  5782. */
  5783. *keys() {
  5784. for (let [name] of this)
  5785. yield name
  5786. }
  5787. /**
  5788. * Overwrite all values given name
  5789. *
  5790. * @param {String} name Filed name
  5791. * @param {String} value Field value
  5792. * @param {String=} filename Filename (optional)
  5793. * @return {Undefined}
  5794. */
  5795. set(name, value, filename) {
  5796. wm(this)[name] = [[value, filename]]
  5797. }
  5798. /**
  5799. * Iterate over all fields
  5800. *
  5801. * @return {Iterator}
  5802. */
  5803. *values() {
  5804. for (let [name, value] of this)
  5805. yield value
  5806. }
  5807. /**
  5808. * Return a native (perhaps degraded) FormData with only a `append` method
  5809. * Can throw if it's not supported
  5810. *
  5811. * @return {FormData}
  5812. */
  5813. ['_asNative']() {
  5814. const fd = new _FormData
  5815. for (let [name, value] of this)
  5816. fd.append(name, value)
  5817. return fd
  5818. }
  5819. /**
  5820. * [_blob description]
  5821. *
  5822. * @return {Blob} [description]
  5823. */
  5824. ['_blob']() {
  5825. const boundary = '----formdata-polyfill-' + Math.random()
  5826. const chunks = []
  5827. for (let [name, value] of this) {
  5828. chunks.push(`--${boundary}\r\n`)
  5829. if (value instanceof Blob) {
  5830. chunks.push(
  5831. `Content-Disposition: form-data; name="${name}"; filename="${value.name}"\r\n`,
  5832. `Content-Type: ${value.type || 'application/octet-stream'}\r\n\r\n`,
  5833. value,
  5834. '\r\n'
  5835. )
  5836. } else {
  5837. chunks.push(
  5838. `Content-Disposition: form-data; name="${name}"\r\n\r\n${value}\r\n`
  5839. )
  5840. }
  5841. }
  5842. chunks.push(`--${boundary}--`)
  5843. return new Blob(chunks, {type: 'multipart/form-data; boundary=' + boundary})
  5844. }
  5845. /**
  5846. * The class itself is iterable
  5847. * alias for formdata.entries()
  5848. *
  5849. * @return {Iterator}
  5850. */
  5851. [Symbol.iterator]() {
  5852. return this.entries()
  5853. }
  5854. /**
  5855. * Create the default string description.
  5856. *
  5857. * @return {String} [object FormData]
  5858. */
  5859. toString() {
  5860. return '[object FormData]'
  5861. }
  5862. }
  5863. if (stringTag) {
  5864. /**
  5865. * Create the default string description.
  5866. * It is accessed internally by the Object.prototype.toString().
  5867. *
  5868. * @return {String} FormData
  5869. */
  5870. FormDataPolyfill.prototype[stringTag] = 'FormData'
  5871. }
  5872. const decorations = [
  5873. ['append', normalizeArgs],
  5874. ['delete', stringify],
  5875. ['get', stringify],
  5876. ['getAll', stringify],
  5877. ['has', stringify],
  5878. ['set', normalizeArgs]
  5879. ]
  5880. decorations.forEach(arr => {
  5881. const orig = FormDataPolyfill.prototype[arr[0]]
  5882. FormDataPolyfill.prototype[arr[0]] = function() {
  5883. return orig.apply(this, arr[1].apply(this, arrayFrom(arguments)))
  5884. }
  5885. })
  5886. // Patch xhr's send method to call _blob transparently
  5887. if (_send) {
  5888. XMLHttpRequest.prototype.send = function(data) {
  5889. // I would check if Content-Type isn't already set
  5890. // But xhr lacks getRequestHeaders functionallity
  5891. // https://github.com/jimmywarting/FormData/issues/44
  5892. if (data instanceof FormDataPolyfill) {
  5893. const blob = data['_blob']()
  5894. this.setRequestHeader('Content-Type', blob.type)
  5895. _send.call(this, blob)
  5896. } else {
  5897. _send.call(this, data)
  5898. }
  5899. }
  5900. }
  5901. // Patch fetch's function to call _blob transparently
  5902. if (_fetch) {
  5903. const _fetch = global.fetch
  5904. global.fetch = function(input, init) {
  5905. if (init && init.body && init.body instanceof FormDataPolyfill) {
  5906. init.body = init.body['_blob']()
  5907. }
  5908. return _fetch(input, init)
  5909. }
  5910. }
  5911. global['FormData'] = FormDataPolyfill
  5912. }
  5913. /***/ }),
  5914. /***/ "./node_modules/jed/jed.js":
  5915. /*!*********************************!*\
  5916. !*** ./node_modules/jed/jed.js ***!
  5917. \*********************************/
  5918. /*! no static exports found */
  5919. /***/ (function(module, exports, __webpack_require__) {
  5920. /**
  5921. * @preserve jed.js https://github.com/SlexAxton/Jed
  5922. */
  5923. /*
  5924. -----------
  5925. A gettext compatible i18n library for modern JavaScript Applications
  5926. by Alex Sexton - AlexSexton [at] gmail - @SlexAxton
  5927. MIT License
  5928. A jQuery Foundation project - requires CLA to contribute -
  5929. https://contribute.jquery.org/CLA/
  5930. Jed offers the entire applicable GNU gettext spec'd set of
  5931. functions, but also offers some nicer wrappers around them.
  5932. The api for gettext was written for a language with no function
  5933. overloading, so Jed allows a little more of that.
  5934. Many thanks to Joshua I. Miller - unrtst@cpan.org - who wrote
  5935. gettext.js back in 2008. I was able to vet a lot of my ideas
  5936. against his. I also made sure Jed passed against his tests
  5937. in order to offer easy upgrades -- jsgettext.berlios.de
  5938. */
  5939. (function (root, undef) {
  5940. // Set up some underscore-style functions, if you already have
  5941. // underscore, feel free to delete this section, and use it
  5942. // directly, however, the amount of functions used doesn't
  5943. // warrant having underscore as a full dependency.
  5944. // Underscore 1.3.0 was used to port and is licensed
  5945. // under the MIT License by Jeremy Ashkenas.
  5946. var ArrayProto = Array.prototype,
  5947. ObjProto = Object.prototype,
  5948. slice = ArrayProto.slice,
  5949. hasOwnProp = ObjProto.hasOwnProperty,
  5950. nativeForEach = ArrayProto.forEach,
  5951. breaker = {};
  5952. // We're not using the OOP style _ so we don't need the
  5953. // extra level of indirection. This still means that you
  5954. // sub out for real `_` though.
  5955. var _ = {
  5956. forEach : function( obj, iterator, context ) {
  5957. var i, l, key;
  5958. if ( obj === null ) {
  5959. return;
  5960. }
  5961. if ( nativeForEach && obj.forEach === nativeForEach ) {
  5962. obj.forEach( iterator, context );
  5963. }
  5964. else if ( obj.length === +obj.length ) {
  5965. for ( i = 0, l = obj.length; i < l; i++ ) {
  5966. if ( i in obj && iterator.call( context, obj[i], i, obj ) === breaker ) {
  5967. return;
  5968. }
  5969. }
  5970. }
  5971. else {
  5972. for ( key in obj) {
  5973. if ( hasOwnProp.call( obj, key ) ) {
  5974. if ( iterator.call (context, obj[key], key, obj ) === breaker ) {
  5975. return;
  5976. }
  5977. }
  5978. }
  5979. }
  5980. },
  5981. extend : function( obj ) {
  5982. this.forEach( slice.call( arguments, 1 ), function ( source ) {
  5983. for ( var prop in source ) {
  5984. obj[prop] = source[prop];
  5985. }
  5986. });
  5987. return obj;
  5988. }
  5989. };
  5990. // END Miniature underscore impl
  5991. // Jed is a constructor function
  5992. var Jed = function ( options ) {
  5993. // Some minimal defaults
  5994. this.defaults = {
  5995. "locale_data" : {
  5996. "messages" : {
  5997. "" : {
  5998. "domain" : "messages",
  5999. "lang" : "en",
  6000. "plural_forms" : "nplurals=2; plural=(n != 1);"
  6001. }
  6002. // There are no default keys, though
  6003. }
  6004. },
  6005. // The default domain if one is missing
  6006. "domain" : "messages",
  6007. // enable debug mode to log untranslated strings to the console
  6008. "debug" : false
  6009. };
  6010. // Mix in the sent options with the default options
  6011. this.options = _.extend( {}, this.defaults, options );
  6012. this.textdomain( this.options.domain );
  6013. if ( options.domain && ! this.options.locale_data[ this.options.domain ] ) {
  6014. throw new Error('Text domain set to non-existent domain: `' + options.domain + '`');
  6015. }
  6016. };
  6017. // The gettext spec sets this character as the default
  6018. // delimiter for context lookups.
  6019. // e.g.: context\u0004key
  6020. // If your translation company uses something different,
  6021. // just change this at any time and it will use that instead.
  6022. Jed.context_delimiter = String.fromCharCode( 4 );
  6023. function getPluralFormFunc ( plural_form_string ) {
  6024. return Jed.PF.compile( plural_form_string || "nplurals=2; plural=(n != 1);");
  6025. }
  6026. function Chain( key, i18n ){
  6027. this._key = key;
  6028. this._i18n = i18n;
  6029. }
  6030. // Create a chainable api for adding args prettily
  6031. _.extend( Chain.prototype, {
  6032. onDomain : function ( domain ) {
  6033. this._domain = domain;
  6034. return this;
  6035. },
  6036. withContext : function ( context ) {
  6037. this._context = context;
  6038. return this;
  6039. },
  6040. ifPlural : function ( num, pkey ) {
  6041. this._val = num;
  6042. this._pkey = pkey;
  6043. return this;
  6044. },
  6045. fetch : function ( sArr ) {
  6046. if ( {}.toString.call( sArr ) != '[object Array]' ) {
  6047. sArr = [].slice.call(arguments, 0);
  6048. }
  6049. return ( sArr && sArr.length ? Jed.sprintf : function(x){ return x; } )(
  6050. this._i18n.dcnpgettext(this._domain, this._context, this._key, this._pkey, this._val),
  6051. sArr
  6052. );
  6053. }
  6054. });
  6055. // Add functions to the Jed prototype.
  6056. // These will be the functions on the object that's returned
  6057. // from creating a `new Jed()`
  6058. // These seem redundant, but they gzip pretty well.
  6059. _.extend( Jed.prototype, {
  6060. // The sexier api start point
  6061. translate : function ( key ) {
  6062. return new Chain( key, this );
  6063. },
  6064. textdomain : function ( domain ) {
  6065. if ( ! domain ) {
  6066. return this._textdomain;
  6067. }
  6068. this._textdomain = domain;
  6069. },
  6070. gettext : function ( key ) {
  6071. return this.dcnpgettext.call( this, undef, undef, key );
  6072. },
  6073. dgettext : function ( domain, key ) {
  6074. return this.dcnpgettext.call( this, domain, undef, key );
  6075. },
  6076. dcgettext : function ( domain , key /*, category */ ) {
  6077. // Ignores the category anyways
  6078. return this.dcnpgettext.call( this, domain, undef, key );
  6079. },
  6080. ngettext : function ( skey, pkey, val ) {
  6081. return this.dcnpgettext.call( this, undef, undef, skey, pkey, val );
  6082. },
  6083. dngettext : function ( domain, skey, pkey, val ) {
  6084. return this.dcnpgettext.call( this, domain, undef, skey, pkey, val );
  6085. },
  6086. dcngettext : function ( domain, skey, pkey, val/*, category */) {
  6087. return this.dcnpgettext.call( this, domain, undef, skey, pkey, val );
  6088. },
  6089. pgettext : function ( context, key ) {
  6090. return this.dcnpgettext.call( this, undef, context, key );
  6091. },
  6092. dpgettext : function ( domain, context, key ) {
  6093. return this.dcnpgettext.call( this, domain, context, key );
  6094. },
  6095. dcpgettext : function ( domain, context, key/*, category */) {
  6096. return this.dcnpgettext.call( this, domain, context, key );
  6097. },
  6098. npgettext : function ( context, skey, pkey, val ) {
  6099. return this.dcnpgettext.call( this, undef, context, skey, pkey, val );
  6100. },
  6101. dnpgettext : function ( domain, context, skey, pkey, val ) {
  6102. return this.dcnpgettext.call( this, domain, context, skey, pkey, val );
  6103. },
  6104. // The most fully qualified gettext function. It has every option.
  6105. // Since it has every option, we can use it from every other method.
  6106. // This is the bread and butter.
  6107. // Technically there should be one more argument in this function for 'Category',
  6108. // but since we never use it, we might as well not waste the bytes to define it.
  6109. dcnpgettext : function ( domain, context, singular_key, plural_key, val ) {
  6110. // Set some defaults
  6111. plural_key = plural_key || singular_key;
  6112. // Use the global domain default if one
  6113. // isn't explicitly passed in
  6114. domain = domain || this._textdomain;
  6115. var fallback;
  6116. // Handle special cases
  6117. // No options found
  6118. if ( ! this.options ) {
  6119. // There's likely something wrong, but we'll return the correct key for english
  6120. // We do this by instantiating a brand new Jed instance with the default set
  6121. // for everything that could be broken.
  6122. fallback = new Jed();
  6123. return fallback.dcnpgettext.call( fallback, undefined, undefined, singular_key, plural_key, val );
  6124. }
  6125. // No translation data provided
  6126. if ( ! this.options.locale_data ) {
  6127. throw new Error('No locale data provided.');
  6128. }
  6129. if ( ! this.options.locale_data[ domain ] ) {
  6130. throw new Error('Domain `' + domain + '` was not found.');
  6131. }
  6132. if ( ! this.options.locale_data[ domain ][ "" ] ) {
  6133. throw new Error('No locale meta information provided.');
  6134. }
  6135. // Make sure we have a truthy key. Otherwise we might start looking
  6136. // into the empty string key, which is the options for the locale
  6137. // data.
  6138. if ( ! singular_key ) {
  6139. throw new Error('No translation key found.');
  6140. }
  6141. var key = context ? context + Jed.context_delimiter + singular_key : singular_key,
  6142. locale_data = this.options.locale_data,
  6143. dict = locale_data[ domain ],
  6144. defaultConf = (locale_data.messages || this.defaults.locale_data.messages)[""],
  6145. pluralForms = dict[""].plural_forms || dict[""]["Plural-Forms"] || dict[""]["plural-forms"] || defaultConf.plural_forms || defaultConf["Plural-Forms"] || defaultConf["plural-forms"],
  6146. val_list,
  6147. res;
  6148. var val_idx;
  6149. if (val === undefined) {
  6150. // No value passed in; assume singular key lookup.
  6151. val_idx = 0;
  6152. } else {
  6153. // Value has been passed in; use plural-forms calculations.
  6154. // Handle invalid numbers, but try casting strings for good measure
  6155. if ( typeof val != 'number' ) {
  6156. val = parseInt( val, 10 );
  6157. if ( isNaN( val ) ) {
  6158. throw new Error('The number that was passed in is not a number.');
  6159. }
  6160. }
  6161. val_idx = getPluralFormFunc(pluralForms)(val);
  6162. }
  6163. // Throw an error if a domain isn't found
  6164. if ( ! dict ) {
  6165. throw new Error('No domain named `' + domain + '` could be found.');
  6166. }
  6167. val_list = dict[ key ];
  6168. // If there is no match, then revert back to
  6169. // english style singular/plural with the keys passed in.
  6170. if ( ! val_list || val_idx > val_list.length ) {
  6171. if (this.options.missing_key_callback) {
  6172. this.options.missing_key_callback(key, domain);
  6173. }
  6174. res = [ singular_key, plural_key ];
  6175. // collect untranslated strings
  6176. if (this.options.debug===true) {
  6177. console.log(res[ getPluralFormFunc(pluralForms)( val ) ]);
  6178. }
  6179. return res[ getPluralFormFunc()( val ) ];
  6180. }
  6181. res = val_list[ val_idx ];
  6182. // This includes empty strings on purpose
  6183. if ( ! res ) {
  6184. res = [ singular_key, plural_key ];
  6185. return res[ getPluralFormFunc()( val ) ];
  6186. }
  6187. return res;
  6188. }
  6189. });
  6190. // We add in sprintf capabilities for post translation value interolation
  6191. // This is not internally used, so you can remove it if you have this
  6192. // available somewhere else, or want to use a different system.
  6193. // We _slightly_ modify the normal sprintf behavior to more gracefully handle
  6194. // undefined values.
  6195. /**
  6196. sprintf() for JavaScript 0.7-beta1
  6197. http://www.diveintojavascript.com/projects/javascript-sprintf
  6198. Copyright (c) Alexandru Marasteanu <alexaholic [at) gmail (dot] com>
  6199. All rights reserved.
  6200. Redistribution and use in source and binary forms, with or without
  6201. modification, are permitted provided that the following conditions are met:
  6202. * Redistributions of source code must retain the above copyright
  6203. notice, this list of conditions and the following disclaimer.
  6204. * Redistributions in binary form must reproduce the above copyright
  6205. notice, this list of conditions and the following disclaimer in the
  6206. documentation and/or other materials provided with the distribution.
  6207. * Neither the name of sprintf() for JavaScript nor the
  6208. names of its contributors may be used to endorse or promote products
  6209. derived from this software without specific prior written permission.
  6210. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  6211. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  6212. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  6213. DISCLAIMED. IN NO EVENT SHALL Alexandru Marasteanu BE LIABLE FOR ANY
  6214. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  6215. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  6216. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  6217. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  6218. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  6219. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  6220. */
  6221. var sprintf = (function() {
  6222. function get_type(variable) {
  6223. return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase();
  6224. }
  6225. function str_repeat(input, multiplier) {
  6226. for (var output = []; multiplier > 0; output[--multiplier] = input) {/* do nothing */}
  6227. return output.join('');
  6228. }
  6229. var str_format = function() {
  6230. if (!str_format.cache.hasOwnProperty(arguments[0])) {
  6231. str_format.cache[arguments[0]] = str_format.parse(arguments[0]);
  6232. }
  6233. return str_format.format.call(null, str_format.cache[arguments[0]], arguments);
  6234. };
  6235. str_format.format = function(parse_tree, argv) {
  6236. var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length;
  6237. for (i = 0; i < tree_length; i++) {
  6238. node_type = get_type(parse_tree[i]);
  6239. if (node_type === 'string') {
  6240. output.push(parse_tree[i]);
  6241. }
  6242. else if (node_type === 'array') {
  6243. match = parse_tree[i]; // convenience purposes only
  6244. if (match[2]) { // keyword argument
  6245. arg = argv[cursor];
  6246. for (k = 0; k < match[2].length; k++) {
  6247. if (!arg.hasOwnProperty(match[2][k])) {
  6248. throw(sprintf('[sprintf] property "%s" does not exist', match[2][k]));
  6249. }
  6250. arg = arg[match[2][k]];
  6251. }
  6252. }
  6253. else if (match[1]) { // positional argument (explicit)
  6254. arg = argv[match[1]];
  6255. }
  6256. else { // positional argument (implicit)
  6257. arg = argv[cursor++];
  6258. }
  6259. if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) {
  6260. throw(sprintf('[sprintf] expecting number but found %s', get_type(arg)));
  6261. }
  6262. // Jed EDIT
  6263. if ( typeof arg == 'undefined' || arg === null ) {
  6264. arg = '';
  6265. }
  6266. // Jed EDIT
  6267. switch (match[8]) {
  6268. case 'b': arg = arg.toString(2); break;
  6269. case 'c': arg = String.fromCharCode(arg); break;
  6270. case 'd': arg = parseInt(arg, 10); break;
  6271. case 'e': arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential(); break;
  6272. case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break;
  6273. case 'o': arg = arg.toString(8); break;
  6274. case 's': arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg); break;
  6275. case 'u': arg = Math.abs(arg); break;
  6276. case 'x': arg = arg.toString(16); break;
  6277. case 'X': arg = arg.toString(16).toUpperCase(); break;
  6278. }
  6279. arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+'+ arg : arg);
  6280. pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' ';
  6281. pad_length = match[6] - String(arg).length;
  6282. pad = match[6] ? str_repeat(pad_character, pad_length) : '';
  6283. output.push(match[5] ? arg + pad : pad + arg);
  6284. }
  6285. }
  6286. return output.join('');
  6287. };
  6288. str_format.cache = {};
  6289. str_format.parse = function(fmt) {
  6290. var _fmt = fmt, match = [], parse_tree = [], arg_names = 0;
  6291. while (_fmt) {
  6292. if ((match = /^[^\x25]+/.exec(_fmt)) !== null) {
  6293. parse_tree.push(match[0]);
  6294. }
  6295. else if ((match = /^\x25{2}/.exec(_fmt)) !== null) {
  6296. parse_tree.push('%');
  6297. }
  6298. else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) {
  6299. if (match[2]) {
  6300. arg_names |= 1;
  6301. var field_list = [], replacement_field = match[2], field_match = [];
  6302. if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
  6303. field_list.push(field_match[1]);
  6304. while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
  6305. if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
  6306. field_list.push(field_match[1]);
  6307. }
  6308. else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) {
  6309. field_list.push(field_match[1]);
  6310. }
  6311. else {
  6312. throw('[sprintf] huh?');
  6313. }
  6314. }
  6315. }
  6316. else {
  6317. throw('[sprintf] huh?');
  6318. }
  6319. match[2] = field_list;
  6320. }
  6321. else {
  6322. arg_names |= 2;
  6323. }
  6324. if (arg_names === 3) {
  6325. throw('[sprintf] mixing positional and named placeholders is not (yet) supported');
  6326. }
  6327. parse_tree.push(match);
  6328. }
  6329. else {
  6330. throw('[sprintf] huh?');
  6331. }
  6332. _fmt = _fmt.substring(match[0].length);
  6333. }
  6334. return parse_tree;
  6335. };
  6336. return str_format;
  6337. })();
  6338. var vsprintf = function(fmt, argv) {
  6339. argv.unshift(fmt);
  6340. return sprintf.apply(null, argv);
  6341. };
  6342. Jed.parse_plural = function ( plural_forms, n ) {
  6343. plural_forms = plural_forms.replace(/n/g, n);
  6344. return Jed.parse_expression(plural_forms);
  6345. };
  6346. Jed.sprintf = function ( fmt, args ) {
  6347. if ( {}.toString.call( args ) == '[object Array]' ) {
  6348. return vsprintf( fmt, [].slice.call(args) );
  6349. }
  6350. return sprintf.apply(this, [].slice.call(arguments) );
  6351. };
  6352. Jed.prototype.sprintf = function () {
  6353. return Jed.sprintf.apply(this, arguments);
  6354. };
  6355. // END sprintf Implementation
  6356. // Start the Plural forms section
  6357. // This is a full plural form expression parser. It is used to avoid
  6358. // running 'eval' or 'new Function' directly against the plural
  6359. // forms.
  6360. //
  6361. // This can be important if you get translations done through a 3rd
  6362. // party vendor. I encourage you to use this instead, however, I
  6363. // also will provide a 'precompiler' that you can use at build time
  6364. // to output valid/safe function representations of the plural form
  6365. // expressions. This means you can build this code out for the most
  6366. // part.
  6367. Jed.PF = {};
  6368. Jed.PF.parse = function ( p ) {
  6369. var plural_str = Jed.PF.extractPluralExpr( p );
  6370. return Jed.PF.parser.parse.call(Jed.PF.parser, plural_str);
  6371. };
  6372. Jed.PF.compile = function ( p ) {
  6373. // Handle trues and falses as 0 and 1
  6374. function imply( val ) {
  6375. return (val === true ? 1 : val ? val : 0);
  6376. }
  6377. var ast = Jed.PF.parse( p );
  6378. return function ( n ) {
  6379. return imply( Jed.PF.interpreter( ast )( n ) );
  6380. };
  6381. };
  6382. Jed.PF.interpreter = function ( ast ) {
  6383. return function ( n ) {
  6384. var res;
  6385. switch ( ast.type ) {
  6386. case 'GROUP':
  6387. return Jed.PF.interpreter( ast.expr )( n );
  6388. case 'TERNARY':
  6389. if ( Jed.PF.interpreter( ast.expr )( n ) ) {
  6390. return Jed.PF.interpreter( ast.truthy )( n );
  6391. }
  6392. return Jed.PF.interpreter( ast.falsey )( n );
  6393. case 'OR':
  6394. return Jed.PF.interpreter( ast.left )( n ) || Jed.PF.interpreter( ast.right )( n );
  6395. case 'AND':
  6396. return Jed.PF.interpreter( ast.left )( n ) && Jed.PF.interpreter( ast.right )( n );
  6397. case 'LT':
  6398. return Jed.PF.interpreter( ast.left )( n ) < Jed.PF.interpreter( ast.right )( n );
  6399. case 'GT':
  6400. return Jed.PF.interpreter( ast.left )( n ) > Jed.PF.interpreter( ast.right )( n );
  6401. case 'LTE':
  6402. return Jed.PF.interpreter( ast.left )( n ) <= Jed.PF.interpreter( ast.right )( n );
  6403. case 'GTE':
  6404. return Jed.PF.interpreter( ast.left )( n ) >= Jed.PF.interpreter( ast.right )( n );
  6405. case 'EQ':
  6406. return Jed.PF.interpreter( ast.left )( n ) == Jed.PF.interpreter( ast.right )( n );
  6407. case 'NEQ':
  6408. return Jed.PF.interpreter( ast.left )( n ) != Jed.PF.interpreter( ast.right )( n );
  6409. case 'MOD':
  6410. return Jed.PF.interpreter( ast.left )( n ) % Jed.PF.interpreter( ast.right )( n );
  6411. case 'VAR':
  6412. return n;
  6413. case 'NUM':
  6414. return ast.val;
  6415. default:
  6416. throw new Error("Invalid Token found.");
  6417. }
  6418. };
  6419. };
  6420. Jed.PF.extractPluralExpr = function ( p ) {
  6421. // trim first
  6422. p = p.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
  6423. if (! /;\s*$/.test(p)) {
  6424. p = p.concat(';');
  6425. }
  6426. var nplurals_re = /nplurals\=(\d+);/,
  6427. plural_re = /plural\=(.*);/,
  6428. nplurals_matches = p.match( nplurals_re ),
  6429. res = {},
  6430. plural_matches;
  6431. // Find the nplurals number
  6432. if ( nplurals_matches.length > 1 ) {
  6433. res.nplurals = nplurals_matches[1];
  6434. }
  6435. else {
  6436. throw new Error('nplurals not found in plural_forms string: ' + p );
  6437. }
  6438. // remove that data to get to the formula
  6439. p = p.replace( nplurals_re, "" );
  6440. plural_matches = p.match( plural_re );
  6441. if (!( plural_matches && plural_matches.length > 1 ) ) {
  6442. throw new Error('`plural` expression not found: ' + p);
  6443. }
  6444. return plural_matches[ 1 ];
  6445. };
  6446. /* Jison generated parser */
  6447. Jed.PF.parser = (function(){
  6448. var parser = {trace: function trace() { },
  6449. yy: {},
  6450. symbols_: {"error":2,"expressions":3,"e":4,"EOF":5,"?":6,":":7,"||":8,"&&":9,"<":10,"<=":11,">":12,">=":13,"!=":14,"==":15,"%":16,"(":17,")":18,"n":19,"NUMBER":20,"$accept":0,"$end":1},
  6451. terminals_: {2:"error",5:"EOF",6:"?",7:":",8:"||",9:"&&",10:"<",11:"<=",12:">",13:">=",14:"!=",15:"==",16:"%",17:"(",18:")",19:"n",20:"NUMBER"},
  6452. productions_: [0,[3,2],[4,5],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,1],[4,1]],
  6453. performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
  6454. var $0 = $$.length - 1;
  6455. switch (yystate) {
  6456. case 1: return { type : 'GROUP', expr: $$[$0-1] };
  6457. break;
  6458. case 2:this.$ = { type: 'TERNARY', expr: $$[$0-4], truthy : $$[$0-2], falsey: $$[$0] };
  6459. break;
  6460. case 3:this.$ = { type: "OR", left: $$[$0-2], right: $$[$0] };
  6461. break;
  6462. case 4:this.$ = { type: "AND", left: $$[$0-2], right: $$[$0] };
  6463. break;
  6464. case 5:this.$ = { type: 'LT', left: $$[$0-2], right: $$[$0] };
  6465. break;
  6466. case 6:this.$ = { type: 'LTE', left: $$[$0-2], right: $$[$0] };
  6467. break;
  6468. case 7:this.$ = { type: 'GT', left: $$[$0-2], right: $$[$0] };
  6469. break;
  6470. case 8:this.$ = { type: 'GTE', left: $$[$0-2], right: $$[$0] };
  6471. break;
  6472. case 9:this.$ = { type: 'NEQ', left: $$[$0-2], right: $$[$0] };
  6473. break;
  6474. case 10:this.$ = { type: 'EQ', left: $$[$0-2], right: $$[$0] };
  6475. break;
  6476. case 11:this.$ = { type: 'MOD', left: $$[$0-2], right: $$[$0] };
  6477. break;
  6478. case 12:this.$ = { type: 'GROUP', expr: $$[$0-1] };
  6479. break;
  6480. case 13:this.$ = { type: 'VAR' };
  6481. break;
  6482. case 14:this.$ = { type: 'NUM', val: Number(yytext) };
  6483. break;
  6484. }
  6485. },
  6486. table: [{3:1,4:2,17:[1,3],19:[1,4],20:[1,5]},{1:[3]},{5:[1,6],6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{4:17,17:[1,3],19:[1,4],20:[1,5]},{5:[2,13],6:[2,13],7:[2,13],8:[2,13],9:[2,13],10:[2,13],11:[2,13],12:[2,13],13:[2,13],14:[2,13],15:[2,13],16:[2,13],18:[2,13]},{5:[2,14],6:[2,14],7:[2,14],8:[2,14],9:[2,14],10:[2,14],11:[2,14],12:[2,14],13:[2,14],14:[2,14],15:[2,14],16:[2,14],18:[2,14]},{1:[2,1]},{4:18,17:[1,3],19:[1,4],20:[1,5]},{4:19,17:[1,3],19:[1,4],20:[1,5]},{4:20,17:[1,3],19:[1,4],20:[1,5]},{4:21,17:[1,3],19:[1,4],20:[1,5]},{4:22,17:[1,3],19:[1,4],20:[1,5]},{4:23,17:[1,3],19:[1,4],20:[1,5]},{4:24,17:[1,3],19:[1,4],20:[1,5]},{4:25,17:[1,3],19:[1,4],20:[1,5]},{4:26,17:[1,3],19:[1,4],20:[1,5]},{4:27,17:[1,3],19:[1,4],20:[1,5]},{6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[1,28]},{6:[1,7],7:[1,29],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{5:[2,3],6:[2,3],7:[2,3],8:[2,3],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,3]},{5:[2,4],6:[2,4],7:[2,4],8:[2,4],9:[2,4],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,4]},{5:[2,5],6:[2,5],7:[2,5],8:[2,5],9:[2,5],10:[2,5],11:[2,5],12:[2,5],13:[2,5],14:[2,5],15:[2,5],16:[1,16],18:[2,5]},{5:[2,6],6:[2,6],7:[2,6],8:[2,6],9:[2,6],10:[2,6],11:[2,6],12:[2,6],13:[2,6],14:[2,6],15:[2,6],16:[1,16],18:[2,6]},{5:[2,7],6:[2,7],7:[2,7],8:[2,7],9:[2,7],10:[2,7],11:[2,7],12:[2,7],13:[2,7],14:[2,7],15:[2,7],16:[1,16],18:[2,7]},{5:[2,8],6:[2,8],7:[2,8],8:[2,8],9:[2,8],10:[2,8],11:[2,8],12:[2,8],13:[2,8],14:[2,8],15:[2,8],16:[1,16],18:[2,8]},{5:[2,9],6:[2,9],7:[2,9],8:[2,9],9:[2,9],10:[2,9],11:[2,9],12:[2,9],13:[2,9],14:[2,9],15:[2,9],16:[1,16],18:[2,9]},{5:[2,10],6:[2,10],7:[2,10],8:[2,10],9:[2,10],10:[2,10],11:[2,10],12:[2,10],13:[2,10],14:[2,10],15:[2,10],16:[1,16],18:[2,10]},{5:[2,11],6:[2,11],7:[2,11],8:[2,11],9:[2,11],10:[2,11],11:[2,11],12:[2,11],13:[2,11],14:[2,11],15:[2,11],16:[2,11],18:[2,11]},{5:[2,12],6:[2,12],7:[2,12],8:[2,12],9:[2,12],10:[2,12],11:[2,12],12:[2,12],13:[2,12],14:[2,12],15:[2,12],16:[2,12],18:[2,12]},{4:30,17:[1,3],19:[1,4],20:[1,5]},{5:[2,2],6:[1,7],7:[2,2],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,2]}],
  6487. defaultActions: {6:[2,1]},
  6488. parseError: function parseError(str, hash) {
  6489. throw new Error(str);
  6490. },
  6491. parse: function parse(input) {
  6492. var self = this,
  6493. stack = [0],
  6494. vstack = [null], // semantic value stack
  6495. lstack = [], // location stack
  6496. table = this.table,
  6497. yytext = '',
  6498. yylineno = 0,
  6499. yyleng = 0,
  6500. recovering = 0,
  6501. TERROR = 2,
  6502. EOF = 1;
  6503. //this.reductionCount = this.shiftCount = 0;
  6504. this.lexer.setInput(input);
  6505. this.lexer.yy = this.yy;
  6506. this.yy.lexer = this.lexer;
  6507. if (typeof this.lexer.yylloc == 'undefined')
  6508. this.lexer.yylloc = {};
  6509. var yyloc = this.lexer.yylloc;
  6510. lstack.push(yyloc);
  6511. if (typeof this.yy.parseError === 'function')
  6512. this.parseError = this.yy.parseError;
  6513. function popStack (n) {
  6514. stack.length = stack.length - 2*n;
  6515. vstack.length = vstack.length - n;
  6516. lstack.length = lstack.length - n;
  6517. }
  6518. function lex() {
  6519. var token;
  6520. token = self.lexer.lex() || 1; // $end = 1
  6521. // if token isn't its numeric value, convert
  6522. if (typeof token !== 'number') {
  6523. token = self.symbols_[token] || token;
  6524. }
  6525. return token;
  6526. }
  6527. var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected;
  6528. while (true) {
  6529. // retreive state number from top of stack
  6530. state = stack[stack.length-1];
  6531. // use default actions if available
  6532. if (this.defaultActions[state]) {
  6533. action = this.defaultActions[state];
  6534. } else {
  6535. if (symbol == null)
  6536. symbol = lex();
  6537. // read action for current state and first input
  6538. action = table[state] && table[state][symbol];
  6539. }
  6540. // handle parse error
  6541. _handle_error:
  6542. if (typeof action === 'undefined' || !action.length || !action[0]) {
  6543. if (!recovering) {
  6544. // Report error
  6545. expected = [];
  6546. for (p in table[state]) if (this.terminals_[p] && p > 2) {
  6547. expected.push("'"+this.terminals_[p]+"'");
  6548. }
  6549. var errStr = '';
  6550. if (this.lexer.showPosition) {
  6551. errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'";
  6552. } else {
  6553. errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " +
  6554. (symbol == 1 /*EOF*/ ? "end of input" :
  6555. ("'"+(this.terminals_[symbol] || symbol)+"'"));
  6556. }
  6557. this.parseError(errStr,
  6558. {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
  6559. }
  6560. // just recovered from another error
  6561. if (recovering == 3) {
  6562. if (symbol == EOF) {
  6563. throw new Error(errStr || 'Parsing halted.');
  6564. }
  6565. // discard current lookahead and grab another
  6566. yyleng = this.lexer.yyleng;
  6567. yytext = this.lexer.yytext;
  6568. yylineno = this.lexer.yylineno;
  6569. yyloc = this.lexer.yylloc;
  6570. symbol = lex();
  6571. }
  6572. // try to recover from error
  6573. while (1) {
  6574. // check for error recovery rule in this state
  6575. if ((TERROR.toString()) in table[state]) {
  6576. break;
  6577. }
  6578. if (state == 0) {
  6579. throw new Error(errStr || 'Parsing halted.');
  6580. }
  6581. popStack(1);
  6582. state = stack[stack.length-1];
  6583. }
  6584. preErrorSymbol = symbol; // save the lookahead token
  6585. symbol = TERROR; // insert generic error symbol as new lookahead
  6586. state = stack[stack.length-1];
  6587. action = table[state] && table[state][TERROR];
  6588. recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
  6589. }
  6590. // this shouldn't happen, unless resolve defaults are off
  6591. if (action[0] instanceof Array && action.length > 1) {
  6592. throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);
  6593. }
  6594. switch (action[0]) {
  6595. case 1: // shift
  6596. //this.shiftCount++;
  6597. stack.push(symbol);
  6598. vstack.push(this.lexer.yytext);
  6599. lstack.push(this.lexer.yylloc);
  6600. stack.push(action[1]); // push state
  6601. symbol = null;
  6602. if (!preErrorSymbol) { // normal execution/no error
  6603. yyleng = this.lexer.yyleng;
  6604. yytext = this.lexer.yytext;
  6605. yylineno = this.lexer.yylineno;
  6606. yyloc = this.lexer.yylloc;
  6607. if (recovering > 0)
  6608. recovering--;
  6609. } else { // error just occurred, resume old lookahead f/ before error
  6610. symbol = preErrorSymbol;
  6611. preErrorSymbol = null;
  6612. }
  6613. break;
  6614. case 2: // reduce
  6615. //this.reductionCount++;
  6616. len = this.productions_[action[1]][1];
  6617. // perform semantic action
  6618. yyval.$ = vstack[vstack.length-len]; // default to $$ = $1
  6619. // default location, uses first token for firsts, last for lasts
  6620. yyval._$ = {
  6621. first_line: lstack[lstack.length-(len||1)].first_line,
  6622. last_line: lstack[lstack.length-1].last_line,
  6623. first_column: lstack[lstack.length-(len||1)].first_column,
  6624. last_column: lstack[lstack.length-1].last_column
  6625. };
  6626. r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
  6627. if (typeof r !== 'undefined') {
  6628. return r;
  6629. }
  6630. // pop off stack
  6631. if (len) {
  6632. stack = stack.slice(0,-1*len*2);
  6633. vstack = vstack.slice(0, -1*len);
  6634. lstack = lstack.slice(0, -1*len);
  6635. }
  6636. stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)
  6637. vstack.push(yyval.$);
  6638. lstack.push(yyval._$);
  6639. // goto new state = table[STATE][NONTERMINAL]
  6640. newState = table[stack[stack.length-2]][stack[stack.length-1]];
  6641. stack.push(newState);
  6642. break;
  6643. case 3: // accept
  6644. return true;
  6645. }
  6646. }
  6647. return true;
  6648. }};/* Jison generated lexer */
  6649. var lexer = (function(){
  6650. var lexer = ({EOF:1,
  6651. parseError:function parseError(str, hash) {
  6652. if (this.yy.parseError) {
  6653. this.yy.parseError(str, hash);
  6654. } else {
  6655. throw new Error(str);
  6656. }
  6657. },
  6658. setInput:function (input) {
  6659. this._input = input;
  6660. this._more = this._less = this.done = false;
  6661. this.yylineno = this.yyleng = 0;
  6662. this.yytext = this.matched = this.match = '';
  6663. this.conditionStack = ['INITIAL'];
  6664. this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
  6665. return this;
  6666. },
  6667. input:function () {
  6668. var ch = this._input[0];
  6669. this.yytext+=ch;
  6670. this.yyleng++;
  6671. this.match+=ch;
  6672. this.matched+=ch;
  6673. var lines = ch.match(/\n/);
  6674. if (lines) this.yylineno++;
  6675. this._input = this._input.slice(1);
  6676. return ch;
  6677. },
  6678. unput:function (ch) {
  6679. this._input = ch + this._input;
  6680. return this;
  6681. },
  6682. more:function () {
  6683. this._more = true;
  6684. return this;
  6685. },
  6686. pastInput:function () {
  6687. var past = this.matched.substr(0, this.matched.length - this.match.length);
  6688. return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
  6689. },
  6690. upcomingInput:function () {
  6691. var next = this.match;
  6692. if (next.length < 20) {
  6693. next += this._input.substr(0, 20-next.length);
  6694. }
  6695. return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
  6696. },
  6697. showPosition:function () {
  6698. var pre = this.pastInput();
  6699. var c = new Array(pre.length + 1).join("-");
  6700. return pre + this.upcomingInput() + "\n" + c+"^";
  6701. },
  6702. next:function () {
  6703. if (this.done) {
  6704. return this.EOF;
  6705. }
  6706. if (!this._input) this.done = true;
  6707. var token,
  6708. match,
  6709. col,
  6710. lines;
  6711. if (!this._more) {
  6712. this.yytext = '';
  6713. this.match = '';
  6714. }
  6715. var rules = this._currentRules();
  6716. for (var i=0;i < rules.length; i++) {
  6717. match = this._input.match(this.rules[rules[i]]);
  6718. if (match) {
  6719. lines = match[0].match(/\n.*/g);
  6720. if (lines) this.yylineno += lines.length;
  6721. this.yylloc = {first_line: this.yylloc.last_line,
  6722. last_line: this.yylineno+1,
  6723. first_column: this.yylloc.last_column,
  6724. last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length}
  6725. this.yytext += match[0];
  6726. this.match += match[0];
  6727. this.matches = match;
  6728. this.yyleng = this.yytext.length;
  6729. this._more = false;
  6730. this._input = this._input.slice(match[0].length);
  6731. this.matched += match[0];
  6732. token = this.performAction.call(this, this.yy, this, rules[i],this.conditionStack[this.conditionStack.length-1]);
  6733. if (token) return token;
  6734. else return;
  6735. }
  6736. }
  6737. if (this._input === "") {
  6738. return this.EOF;
  6739. } else {
  6740. this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
  6741. {text: "", token: null, line: this.yylineno});
  6742. }
  6743. },
  6744. lex:function lex() {
  6745. var r = this.next();
  6746. if (typeof r !== 'undefined') {
  6747. return r;
  6748. } else {
  6749. return this.lex();
  6750. }
  6751. },
  6752. begin:function begin(condition) {
  6753. this.conditionStack.push(condition);
  6754. },
  6755. popState:function popState() {
  6756. return this.conditionStack.pop();
  6757. },
  6758. _currentRules:function _currentRules() {
  6759. return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
  6760. },
  6761. topState:function () {
  6762. return this.conditionStack[this.conditionStack.length-2];
  6763. },
  6764. pushState:function begin(condition) {
  6765. this.begin(condition);
  6766. }});
  6767. lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
  6768. var YYSTATE=YY_START;
  6769. switch($avoiding_name_collisions) {
  6770. case 0:/* skip whitespace */
  6771. break;
  6772. case 1:return 20
  6773. break;
  6774. case 2:return 19
  6775. break;
  6776. case 3:return 8
  6777. break;
  6778. case 4:return 9
  6779. break;
  6780. case 5:return 6
  6781. break;
  6782. case 6:return 7
  6783. break;
  6784. case 7:return 11
  6785. break;
  6786. case 8:return 13
  6787. break;
  6788. case 9:return 10
  6789. break;
  6790. case 10:return 12
  6791. break;
  6792. case 11:return 14
  6793. break;
  6794. case 12:return 15
  6795. break;
  6796. case 13:return 16
  6797. break;
  6798. case 14:return 17
  6799. break;
  6800. case 15:return 18
  6801. break;
  6802. case 16:return 5
  6803. break;
  6804. case 17:return 'INVALID'
  6805. break;
  6806. }
  6807. };
  6808. lexer.rules = [/^\s+/,/^[0-9]+(\.[0-9]+)?\b/,/^n\b/,/^\|\|/,/^&&/,/^\?/,/^:/,/^<=/,/^>=/,/^</,/^>/,/^!=/,/^==/,/^%/,/^\(/,/^\)/,/^$/,/^./];
  6809. lexer.conditions = {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],"inclusive":true}};return lexer;})()
  6810. parser.lexer = lexer;
  6811. return parser;
  6812. })();
  6813. // End parser
  6814. // Handle node, amd, and global systems
  6815. if (true) {
  6816. if (typeof module !== 'undefined' && module.exports) {
  6817. exports = module.exports = Jed;
  6818. }
  6819. exports.Jed = Jed;
  6820. }
  6821. else {}
  6822. })(this);
  6823. /***/ }),
  6824. /***/ "./node_modules/lodash/_Symbol.js":
  6825. /*!****************************************!*\
  6826. !*** ./node_modules/lodash/_Symbol.js ***!
  6827. \****************************************/
  6828. /*! no static exports found */
  6829. /***/ (function(module, exports, __webpack_require__) {
  6830. var root = __webpack_require__(/*! ./_root */ "./node_modules/lodash/_root.js");
  6831. /** Built-in value references. */
  6832. var Symbol = root.Symbol;
  6833. module.exports = Symbol;
  6834. /***/ }),
  6835. /***/ "./node_modules/lodash/_arrayMap.js":
  6836. /*!******************************************!*\
  6837. !*** ./node_modules/lodash/_arrayMap.js ***!
  6838. \******************************************/
  6839. /*! no static exports found */
  6840. /***/ (function(module, exports) {
  6841. /**
  6842. * A specialized version of `_.map` for arrays without support for iteratee
  6843. * shorthands.
  6844. *
  6845. * @private
  6846. * @param {Array} [array] The array to iterate over.
  6847. * @param {Function} iteratee The function invoked per iteration.
  6848. * @returns {Array} Returns the new mapped array.
  6849. */
  6850. function arrayMap(array, iteratee) {
  6851. var index = -1,
  6852. length = array == null ? 0 : array.length,
  6853. result = Array(length);
  6854. while (++index < length) {
  6855. result[index] = iteratee(array[index], index, array);
  6856. }
  6857. return result;
  6858. }
  6859. module.exports = arrayMap;
  6860. /***/ }),
  6861. /***/ "./node_modules/lodash/_baseGetTag.js":
  6862. /*!********************************************!*\
  6863. !*** ./node_modules/lodash/_baseGetTag.js ***!
  6864. \********************************************/
  6865. /*! no static exports found */
  6866. /***/ (function(module, exports, __webpack_require__) {
  6867. var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),
  6868. getRawTag = __webpack_require__(/*! ./_getRawTag */ "./node_modules/lodash/_getRawTag.js"),
  6869. objectToString = __webpack_require__(/*! ./_objectToString */ "./node_modules/lodash/_objectToString.js");
  6870. /** `Object#toString` result references. */
  6871. var nullTag = '[object Null]',
  6872. undefinedTag = '[object Undefined]';
  6873. /** Built-in value references. */
  6874. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  6875. /**
  6876. * The base implementation of `getTag` without fallbacks for buggy environments.
  6877. *
  6878. * @private
  6879. * @param {*} value The value to query.
  6880. * @returns {string} Returns the `toStringTag`.
  6881. */
  6882. function baseGetTag(value) {
  6883. if (value == null) {
  6884. return value === undefined ? undefinedTag : nullTag;
  6885. }
  6886. return (symToStringTag && symToStringTag in Object(value))
  6887. ? getRawTag(value)
  6888. : objectToString(value);
  6889. }
  6890. module.exports = baseGetTag;
  6891. /***/ }),
  6892. /***/ "./node_modules/lodash/_basePropertyOf.js":
  6893. /*!************************************************!*\
  6894. !*** ./node_modules/lodash/_basePropertyOf.js ***!
  6895. \************************************************/
  6896. /*! no static exports found */
  6897. /***/ (function(module, exports) {
  6898. /**
  6899. * The base implementation of `_.propertyOf` without support for deep paths.
  6900. *
  6901. * @private
  6902. * @param {Object} object The object to query.
  6903. * @returns {Function} Returns the new accessor function.
  6904. */
  6905. function basePropertyOf(object) {
  6906. return function(key) {
  6907. return object == null ? undefined : object[key];
  6908. };
  6909. }
  6910. module.exports = basePropertyOf;
  6911. /***/ }),
  6912. /***/ "./node_modules/lodash/_baseToString.js":
  6913. /*!**********************************************!*\
  6914. !*** ./node_modules/lodash/_baseToString.js ***!
  6915. \**********************************************/
  6916. /*! no static exports found */
  6917. /***/ (function(module, exports, __webpack_require__) {
  6918. var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js"),
  6919. arrayMap = __webpack_require__(/*! ./_arrayMap */ "./node_modules/lodash/_arrayMap.js"),
  6920. isArray = __webpack_require__(/*! ./isArray */ "./node_modules/lodash/isArray.js"),
  6921. isSymbol = __webpack_require__(/*! ./isSymbol */ "./node_modules/lodash/isSymbol.js");
  6922. /** Used as references for various `Number` constants. */
  6923. var INFINITY = 1 / 0;
  6924. /** Used to convert symbols to primitives and strings. */
  6925. var symbolProto = Symbol ? Symbol.prototype : undefined,
  6926. symbolToString = symbolProto ? symbolProto.toString : undefined;
  6927. /**
  6928. * The base implementation of `_.toString` which doesn't convert nullish
  6929. * values to empty strings.
  6930. *
  6931. * @private
  6932. * @param {*} value The value to process.
  6933. * @returns {string} Returns the string.
  6934. */
  6935. function baseToString(value) {
  6936. // Exit early for strings to avoid a performance hit in some environments.
  6937. if (typeof value == 'string') {
  6938. return value;
  6939. }
  6940. if (isArray(value)) {
  6941. // Recursively convert values (susceptible to call stack limits).
  6942. return arrayMap(value, baseToString) + '';
  6943. }
  6944. if (isSymbol(value)) {
  6945. return symbolToString ? symbolToString.call(value) : '';
  6946. }
  6947. var result = (value + '');
  6948. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  6949. }
  6950. module.exports = baseToString;
  6951. /***/ }),
  6952. /***/ "./node_modules/lodash/_escapeHtmlChar.js":
  6953. /*!************************************************!*\
  6954. !*** ./node_modules/lodash/_escapeHtmlChar.js ***!
  6955. \************************************************/
  6956. /*! no static exports found */
  6957. /***/ (function(module, exports, __webpack_require__) {
  6958. var basePropertyOf = __webpack_require__(/*! ./_basePropertyOf */ "./node_modules/lodash/_basePropertyOf.js");
  6959. /** Used to map characters to HTML entities. */
  6960. var htmlEscapes = {
  6961. '&': '&amp;',
  6962. '<': '&lt;',
  6963. '>': '&gt;',
  6964. '"': '&quot;',
  6965. "'": '&#39;'
  6966. };
  6967. /**
  6968. * Used by `_.escape` to convert characters to HTML entities.
  6969. *
  6970. * @private
  6971. * @param {string} chr The matched character to escape.
  6972. * @returns {string} Returns the escaped character.
  6973. */
  6974. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  6975. module.exports = escapeHtmlChar;
  6976. /***/ }),
  6977. /***/ "./node_modules/lodash/_freeGlobal.js":
  6978. /*!********************************************!*\
  6979. !*** ./node_modules/lodash/_freeGlobal.js ***!
  6980. \********************************************/
  6981. /*! no static exports found */
  6982. /***/ (function(module, exports, __webpack_require__) {
  6983. /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
  6984. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  6985. module.exports = freeGlobal;
  6986. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  6987. /***/ }),
  6988. /***/ "./node_modules/lodash/_getRawTag.js":
  6989. /*!*******************************************!*\
  6990. !*** ./node_modules/lodash/_getRawTag.js ***!
  6991. \*******************************************/
  6992. /*! no static exports found */
  6993. /***/ (function(module, exports, __webpack_require__) {
  6994. var Symbol = __webpack_require__(/*! ./_Symbol */ "./node_modules/lodash/_Symbol.js");
  6995. /** Used for built-in method references. */
  6996. var objectProto = Object.prototype;
  6997. /** Used to check objects for own properties. */
  6998. var hasOwnProperty = objectProto.hasOwnProperty;
  6999. /**
  7000. * Used to resolve the
  7001. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  7002. * of values.
  7003. */
  7004. var nativeObjectToString = objectProto.toString;
  7005. /** Built-in value references. */
  7006. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  7007. /**
  7008. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  7009. *
  7010. * @private
  7011. * @param {*} value The value to query.
  7012. * @returns {string} Returns the raw `toStringTag`.
  7013. */
  7014. function getRawTag(value) {
  7015. var isOwn = hasOwnProperty.call(value, symToStringTag),
  7016. tag = value[symToStringTag];
  7017. try {
  7018. value[symToStringTag] = undefined;
  7019. var unmasked = true;
  7020. } catch (e) {}
  7021. var result = nativeObjectToString.call(value);
  7022. if (unmasked) {
  7023. if (isOwn) {
  7024. value[symToStringTag] = tag;
  7025. } else {
  7026. delete value[symToStringTag];
  7027. }
  7028. }
  7029. return result;
  7030. }
  7031. module.exports = getRawTag;
  7032. /***/ }),
  7033. /***/ "./node_modules/lodash/_objectToString.js":
  7034. /*!************************************************!*\
  7035. !*** ./node_modules/lodash/_objectToString.js ***!
  7036. \************************************************/
  7037. /*! no static exports found */
  7038. /***/ (function(module, exports) {
  7039. /** Used for built-in method references. */
  7040. var objectProto = Object.prototype;
  7041. /**
  7042. * Used to resolve the
  7043. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  7044. * of values.
  7045. */
  7046. var nativeObjectToString = objectProto.toString;
  7047. /**
  7048. * Converts `value` to a string using `Object.prototype.toString`.
  7049. *
  7050. * @private
  7051. * @param {*} value The value to convert.
  7052. * @returns {string} Returns the converted string.
  7053. */
  7054. function objectToString(value) {
  7055. return nativeObjectToString.call(value);
  7056. }
  7057. module.exports = objectToString;
  7058. /***/ }),
  7059. /***/ "./node_modules/lodash/_root.js":
  7060. /*!**************************************!*\
  7061. !*** ./node_modules/lodash/_root.js ***!
  7062. \**************************************/
  7063. /*! no static exports found */
  7064. /***/ (function(module, exports, __webpack_require__) {
  7065. var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "./node_modules/lodash/_freeGlobal.js");
  7066. /** Detect free variable `self`. */
  7067. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  7068. /** Used as a reference to the global object. */
  7069. var root = freeGlobal || freeSelf || Function('return this')();
  7070. module.exports = root;
  7071. /***/ }),
  7072. /***/ "./node_modules/lodash/escape.js":
  7073. /*!***************************************!*\
  7074. !*** ./node_modules/lodash/escape.js ***!
  7075. \***************************************/
  7076. /*! no static exports found */
  7077. /***/ (function(module, exports, __webpack_require__) {
  7078. var escapeHtmlChar = __webpack_require__(/*! ./_escapeHtmlChar */ "./node_modules/lodash/_escapeHtmlChar.js"),
  7079. toString = __webpack_require__(/*! ./toString */ "./node_modules/lodash/toString.js");
  7080. /** Used to match HTML entities and HTML characters. */
  7081. var reUnescapedHtml = /[&<>"']/g,
  7082. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  7083. /**
  7084. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  7085. * corresponding HTML entities.
  7086. *
  7087. * **Note:** No other characters are escaped. To escape additional
  7088. * characters use a third-party library like [_he_](https://mths.be/he).
  7089. *
  7090. * Though the ">" character is escaped for symmetry, characters like
  7091. * ">" and "/" don't need escaping in HTML and have no special meaning
  7092. * unless they're part of a tag or unquoted attribute value. See
  7093. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  7094. * (under "semi-related fun fact") for more details.
  7095. *
  7096. * When working with HTML you should always
  7097. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  7098. * XSS vectors.
  7099. *
  7100. * @static
  7101. * @since 0.1.0
  7102. * @memberOf _
  7103. * @category String
  7104. * @param {string} [string=''] The string to escape.
  7105. * @returns {string} Returns the escaped string.
  7106. * @example
  7107. *
  7108. * _.escape('fred, barney, & pebbles');
  7109. * // => 'fred, barney, &amp; pebbles'
  7110. */
  7111. function escape(string) {
  7112. string = toString(string);
  7113. return (string && reHasUnescapedHtml.test(string))
  7114. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  7115. : string;
  7116. }
  7117. module.exports = escape;
  7118. /***/ }),
  7119. /***/ "./node_modules/lodash/isArray.js":
  7120. /*!****************************************!*\
  7121. !*** ./node_modules/lodash/isArray.js ***!
  7122. \****************************************/
  7123. /*! no static exports found */
  7124. /***/ (function(module, exports) {
  7125. /**
  7126. * Checks if `value` is classified as an `Array` object.
  7127. *
  7128. * @static
  7129. * @memberOf _
  7130. * @since 0.1.0
  7131. * @category Lang
  7132. * @param {*} value The value to check.
  7133. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  7134. * @example
  7135. *
  7136. * _.isArray([1, 2, 3]);
  7137. * // => true
  7138. *
  7139. * _.isArray(document.body.children);
  7140. * // => false
  7141. *
  7142. * _.isArray('abc');
  7143. * // => false
  7144. *
  7145. * _.isArray(_.noop);
  7146. * // => false
  7147. */
  7148. var isArray = Array.isArray;
  7149. module.exports = isArray;
  7150. /***/ }),
  7151. /***/ "./node_modules/lodash/isObjectLike.js":
  7152. /*!*********************************************!*\
  7153. !*** ./node_modules/lodash/isObjectLike.js ***!
  7154. \*********************************************/
  7155. /*! no static exports found */
  7156. /***/ (function(module, exports) {
  7157. /**
  7158. * Checks if `value` is object-like. A value is object-like if it's not `null`
  7159. * and has a `typeof` result of "object".
  7160. *
  7161. * @static
  7162. * @memberOf _
  7163. * @since 4.0.0
  7164. * @category Lang
  7165. * @param {*} value The value to check.
  7166. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  7167. * @example
  7168. *
  7169. * _.isObjectLike({});
  7170. * // => true
  7171. *
  7172. * _.isObjectLike([1, 2, 3]);
  7173. * // => true
  7174. *
  7175. * _.isObjectLike(_.noop);
  7176. * // => false
  7177. *
  7178. * _.isObjectLike(null);
  7179. * // => false
  7180. */
  7181. function isObjectLike(value) {
  7182. return value != null && typeof value == 'object';
  7183. }
  7184. module.exports = isObjectLike;
  7185. /***/ }),
  7186. /***/ "./node_modules/lodash/isSymbol.js":
  7187. /*!*****************************************!*\
  7188. !*** ./node_modules/lodash/isSymbol.js ***!
  7189. \*****************************************/
  7190. /*! no static exports found */
  7191. /***/ (function(module, exports, __webpack_require__) {
  7192. var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "./node_modules/lodash/_baseGetTag.js"),
  7193. isObjectLike = __webpack_require__(/*! ./isObjectLike */ "./node_modules/lodash/isObjectLike.js");
  7194. /** `Object#toString` result references. */
  7195. var symbolTag = '[object Symbol]';
  7196. /**
  7197. * Checks if `value` is classified as a `Symbol` primitive or object.
  7198. *
  7199. * @static
  7200. * @memberOf _
  7201. * @since 4.0.0
  7202. * @category Lang
  7203. * @param {*} value The value to check.
  7204. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  7205. * @example
  7206. *
  7207. * _.isSymbol(Symbol.iterator);
  7208. * // => true
  7209. *
  7210. * _.isSymbol('abc');
  7211. * // => false
  7212. */
  7213. function isSymbol(value) {
  7214. return typeof value == 'symbol' ||
  7215. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  7216. }
  7217. module.exports = isSymbol;
  7218. /***/ }),
  7219. /***/ "./node_modules/lodash/lodash.js":
  7220. /*!***************************************!*\
  7221. !*** ./node_modules/lodash/lodash.js ***!
  7222. \***************************************/
  7223. /*! no static exports found */
  7224. /***/ (function(module, exports, __webpack_require__) {
  7225. /* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
  7226. * @license
  7227. * Lodash <https://lodash.com/>
  7228. * Copyright JS Foundation and other contributors <https://js.foundation/>
  7229. * Released under MIT license <https://lodash.com/license>
  7230. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  7231. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  7232. */
  7233. ;(function() {
  7234. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  7235. var undefined;
  7236. /** Used as the semantic version number. */
  7237. var VERSION = '4.17.10';
  7238. /** Used as the size to enable large array optimizations. */
  7239. var LARGE_ARRAY_SIZE = 200;
  7240. /** Error message constants. */
  7241. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  7242. FUNC_ERROR_TEXT = 'Expected a function';
  7243. /** Used to stand-in for `undefined` hash values. */
  7244. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  7245. /** Used as the maximum memoize cache size. */
  7246. var MAX_MEMOIZE_SIZE = 500;
  7247. /** Used as the internal argument placeholder. */
  7248. var PLACEHOLDER = '__lodash_placeholder__';
  7249. /** Used to compose bitmasks for cloning. */
  7250. var CLONE_DEEP_FLAG = 1,
  7251. CLONE_FLAT_FLAG = 2,
  7252. CLONE_SYMBOLS_FLAG = 4;
  7253. /** Used to compose bitmasks for value comparisons. */
  7254. var COMPARE_PARTIAL_FLAG = 1,
  7255. COMPARE_UNORDERED_FLAG = 2;
  7256. /** Used to compose bitmasks for function metadata. */
  7257. var WRAP_BIND_FLAG = 1,
  7258. WRAP_BIND_KEY_FLAG = 2,
  7259. WRAP_CURRY_BOUND_FLAG = 4,
  7260. WRAP_CURRY_FLAG = 8,
  7261. WRAP_CURRY_RIGHT_FLAG = 16,
  7262. WRAP_PARTIAL_FLAG = 32,
  7263. WRAP_PARTIAL_RIGHT_FLAG = 64,
  7264. WRAP_ARY_FLAG = 128,
  7265. WRAP_REARG_FLAG = 256,
  7266. WRAP_FLIP_FLAG = 512;
  7267. /** Used as default options for `_.truncate`. */
  7268. var DEFAULT_TRUNC_LENGTH = 30,
  7269. DEFAULT_TRUNC_OMISSION = '...';
  7270. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  7271. var HOT_COUNT = 800,
  7272. HOT_SPAN = 16;
  7273. /** Used to indicate the type of lazy iteratees. */
  7274. var LAZY_FILTER_FLAG = 1,
  7275. LAZY_MAP_FLAG = 2,
  7276. LAZY_WHILE_FLAG = 3;
  7277. /** Used as references for various `Number` constants. */
  7278. var INFINITY = 1 / 0,
  7279. MAX_SAFE_INTEGER = 9007199254740991,
  7280. MAX_INTEGER = 1.7976931348623157e+308,
  7281. NAN = 0 / 0;
  7282. /** Used as references for the maximum length and index of an array. */
  7283. var MAX_ARRAY_LENGTH = 4294967295,
  7284. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  7285. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  7286. /** Used to associate wrap methods with their bit flags. */
  7287. var wrapFlags = [
  7288. ['ary', WRAP_ARY_FLAG],
  7289. ['bind', WRAP_BIND_FLAG],
  7290. ['bindKey', WRAP_BIND_KEY_FLAG],
  7291. ['curry', WRAP_CURRY_FLAG],
  7292. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  7293. ['flip', WRAP_FLIP_FLAG],
  7294. ['partial', WRAP_PARTIAL_FLAG],
  7295. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  7296. ['rearg', WRAP_REARG_FLAG]
  7297. ];
  7298. /** `Object#toString` result references. */
  7299. var argsTag = '[object Arguments]',
  7300. arrayTag = '[object Array]',
  7301. asyncTag = '[object AsyncFunction]',
  7302. boolTag = '[object Boolean]',
  7303. dateTag = '[object Date]',
  7304. domExcTag = '[object DOMException]',
  7305. errorTag = '[object Error]',
  7306. funcTag = '[object Function]',
  7307. genTag = '[object GeneratorFunction]',
  7308. mapTag = '[object Map]',
  7309. numberTag = '[object Number]',
  7310. nullTag = '[object Null]',
  7311. objectTag = '[object Object]',
  7312. promiseTag = '[object Promise]',
  7313. proxyTag = '[object Proxy]',
  7314. regexpTag = '[object RegExp]',
  7315. setTag = '[object Set]',
  7316. stringTag = '[object String]',
  7317. symbolTag = '[object Symbol]',
  7318. undefinedTag = '[object Undefined]',
  7319. weakMapTag = '[object WeakMap]',
  7320. weakSetTag = '[object WeakSet]';
  7321. var arrayBufferTag = '[object ArrayBuffer]',
  7322. dataViewTag = '[object DataView]',
  7323. float32Tag = '[object Float32Array]',
  7324. float64Tag = '[object Float64Array]',
  7325. int8Tag = '[object Int8Array]',
  7326. int16Tag = '[object Int16Array]',
  7327. int32Tag = '[object Int32Array]',
  7328. uint8Tag = '[object Uint8Array]',
  7329. uint8ClampedTag = '[object Uint8ClampedArray]',
  7330. uint16Tag = '[object Uint16Array]',
  7331. uint32Tag = '[object Uint32Array]';
  7332. /** Used to match empty string literals in compiled template source. */
  7333. var reEmptyStringLeading = /\b__p \+= '';/g,
  7334. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  7335. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  7336. /** Used to match HTML entities and HTML characters. */
  7337. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  7338. reUnescapedHtml = /[&<>"']/g,
  7339. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  7340. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  7341. /** Used to match template delimiters. */
  7342. var reEscape = /<%-([\s\S]+?)%>/g,
  7343. reEvaluate = /<%([\s\S]+?)%>/g,
  7344. reInterpolate = /<%=([\s\S]+?)%>/g;
  7345. /** Used to match property names within property paths. */
  7346. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  7347. reIsPlainProp = /^\w*$/,
  7348. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  7349. /**
  7350. * Used to match `RegExp`
  7351. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  7352. */
  7353. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  7354. reHasRegExpChar = RegExp(reRegExpChar.source);
  7355. /** Used to match leading and trailing whitespace. */
  7356. var reTrim = /^\s+|\s+$/g,
  7357. reTrimStart = /^\s+/,
  7358. reTrimEnd = /\s+$/;
  7359. /** Used to match wrap detail comments. */
  7360. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  7361. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  7362. reSplitDetails = /,? & /;
  7363. /** Used to match words composed of alphanumeric characters. */
  7364. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  7365. /** Used to match backslashes in property paths. */
  7366. var reEscapeChar = /\\(\\)?/g;
  7367. /**
  7368. * Used to match
  7369. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  7370. */
  7371. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  7372. /** Used to match `RegExp` flags from their coerced string values. */
  7373. var reFlags = /\w*$/;
  7374. /** Used to detect bad signed hexadecimal string values. */
  7375. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  7376. /** Used to detect binary string values. */
  7377. var reIsBinary = /^0b[01]+$/i;
  7378. /** Used to detect host constructors (Safari). */
  7379. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  7380. /** Used to detect octal string values. */
  7381. var reIsOctal = /^0o[0-7]+$/i;
  7382. /** Used to detect unsigned integer values. */
  7383. var reIsUint = /^(?:0|[1-9]\d*)$/;
  7384. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  7385. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  7386. /** Used to ensure capturing order of template delimiters. */
  7387. var reNoMatch = /($^)/;
  7388. /** Used to match unescaped characters in compiled string literals. */
  7389. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  7390. /** Used to compose unicode character classes. */
  7391. var rsAstralRange = '\\ud800-\\udfff',
  7392. rsComboMarksRange = '\\u0300-\\u036f',
  7393. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  7394. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  7395. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  7396. rsDingbatRange = '\\u2700-\\u27bf',
  7397. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  7398. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  7399. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  7400. rsPunctuationRange = '\\u2000-\\u206f',
  7401. 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',
  7402. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  7403. rsVarRange = '\\ufe0e\\ufe0f',
  7404. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  7405. /** Used to compose unicode capture groups. */
  7406. var rsApos = "['\u2019]",
  7407. rsAstral = '[' + rsAstralRange + ']',
  7408. rsBreak = '[' + rsBreakRange + ']',
  7409. rsCombo = '[' + rsComboRange + ']',
  7410. rsDigits = '\\d+',
  7411. rsDingbat = '[' + rsDingbatRange + ']',
  7412. rsLower = '[' + rsLowerRange + ']',
  7413. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  7414. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  7415. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  7416. rsNonAstral = '[^' + rsAstralRange + ']',
  7417. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  7418. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  7419. rsUpper = '[' + rsUpperRange + ']',
  7420. rsZWJ = '\\u200d';
  7421. /** Used to compose unicode regexes. */
  7422. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  7423. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  7424. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  7425. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  7426. reOptMod = rsModifier + '?',
  7427. rsOptVar = '[' + rsVarRange + ']?',
  7428. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  7429. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  7430. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  7431. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  7432. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  7433. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  7434. /** Used to match apostrophes. */
  7435. var reApos = RegExp(rsApos, 'g');
  7436. /**
  7437. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  7438. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  7439. */
  7440. var reComboMark = RegExp(rsCombo, 'g');
  7441. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  7442. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  7443. /** Used to match complex or compound words. */
  7444. var reUnicodeWord = RegExp([
  7445. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  7446. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  7447. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  7448. rsUpper + '+' + rsOptContrUpper,
  7449. rsOrdUpper,
  7450. rsOrdLower,
  7451. rsDigits,
  7452. rsEmoji
  7453. ].join('|'), 'g');
  7454. /** 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/). */
  7455. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  7456. /** Used to detect strings that need a more robust regexp to match words. */
  7457. 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 ]/;
  7458. /** Used to assign default `context` object properties. */
  7459. var contextProps = [
  7460. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  7461. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  7462. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  7463. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  7464. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  7465. ];
  7466. /** Used to make template sourceURLs easier to identify. */
  7467. var templateCounter = -1;
  7468. /** Used to identify `toStringTag` values of typed arrays. */
  7469. var typedArrayTags = {};
  7470. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  7471. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  7472. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  7473. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  7474. typedArrayTags[uint32Tag] = true;
  7475. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  7476. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  7477. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  7478. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  7479. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  7480. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  7481. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  7482. typedArrayTags[weakMapTag] = false;
  7483. /** Used to identify `toStringTag` values supported by `_.clone`. */
  7484. var cloneableTags = {};
  7485. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  7486. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  7487. cloneableTags[boolTag] = cloneableTags[dateTag] =
  7488. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  7489. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  7490. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  7491. cloneableTags[numberTag] = cloneableTags[objectTag] =
  7492. cloneableTags[regexpTag] = cloneableTags[setTag] =
  7493. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  7494. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  7495. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  7496. cloneableTags[errorTag] = cloneableTags[funcTag] =
  7497. cloneableTags[weakMapTag] = false;
  7498. /** Used to map Latin Unicode letters to basic Latin letters. */
  7499. var deburredLetters = {
  7500. // Latin-1 Supplement block.
  7501. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  7502. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  7503. '\xc7': 'C', '\xe7': 'c',
  7504. '\xd0': 'D', '\xf0': 'd',
  7505. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  7506. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  7507. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  7508. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  7509. '\xd1': 'N', '\xf1': 'n',
  7510. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  7511. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  7512. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  7513. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  7514. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  7515. '\xc6': 'Ae', '\xe6': 'ae',
  7516. '\xde': 'Th', '\xfe': 'th',
  7517. '\xdf': 'ss',
  7518. // Latin Extended-A block.
  7519. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  7520. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  7521. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  7522. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  7523. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  7524. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  7525. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  7526. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  7527. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  7528. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  7529. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  7530. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  7531. '\u0134': 'J', '\u0135': 'j',
  7532. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  7533. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  7534. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  7535. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  7536. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  7537. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  7538. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  7539. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  7540. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  7541. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  7542. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  7543. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  7544. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  7545. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  7546. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  7547. '\u0174': 'W', '\u0175': 'w',
  7548. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  7549. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  7550. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  7551. '\u0132': 'IJ', '\u0133': 'ij',
  7552. '\u0152': 'Oe', '\u0153': 'oe',
  7553. '\u0149': "'n", '\u017f': 's'
  7554. };
  7555. /** Used to map characters to HTML entities. */
  7556. var htmlEscapes = {
  7557. '&': '&amp;',
  7558. '<': '&lt;',
  7559. '>': '&gt;',
  7560. '"': '&quot;',
  7561. "'": '&#39;'
  7562. };
  7563. /** Used to map HTML entities to characters. */
  7564. var htmlUnescapes = {
  7565. '&amp;': '&',
  7566. '&lt;': '<',
  7567. '&gt;': '>',
  7568. '&quot;': '"',
  7569. '&#39;': "'"
  7570. };
  7571. /** Used to escape characters for inclusion in compiled string literals. */
  7572. var stringEscapes = {
  7573. '\\': '\\',
  7574. "'": "'",
  7575. '\n': 'n',
  7576. '\r': 'r',
  7577. '\u2028': 'u2028',
  7578. '\u2029': 'u2029'
  7579. };
  7580. /** Built-in method references without a dependency on `root`. */
  7581. var freeParseFloat = parseFloat,
  7582. freeParseInt = parseInt;
  7583. /** Detect free variable `global` from Node.js. */
  7584. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  7585. /** Detect free variable `self`. */
  7586. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  7587. /** Used as a reference to the global object. */
  7588. var root = freeGlobal || freeSelf || Function('return this')();
  7589. /** Detect free variable `exports`. */
  7590. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  7591. /** Detect free variable `module`. */
  7592. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  7593. /** Detect the popular CommonJS extension `module.exports`. */
  7594. var moduleExports = freeModule && freeModule.exports === freeExports;
  7595. /** Detect free variable `process` from Node.js. */
  7596. var freeProcess = moduleExports && freeGlobal.process;
  7597. /** Used to access faster Node.js helpers. */
  7598. var nodeUtil = (function() {
  7599. try {
  7600. // Use `util.types` for Node.js 10+.
  7601. var types = freeModule && freeModule.require && freeModule.require('util').types;
  7602. if (types) {
  7603. return types;
  7604. }
  7605. // Legacy `process.binding('util')` for Node.js < 10.
  7606. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  7607. } catch (e) {}
  7608. }());
  7609. /* Node.js helper references. */
  7610. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  7611. nodeIsDate = nodeUtil && nodeUtil.isDate,
  7612. nodeIsMap = nodeUtil && nodeUtil.isMap,
  7613. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  7614. nodeIsSet = nodeUtil && nodeUtil.isSet,
  7615. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  7616. /*--------------------------------------------------------------------------*/
  7617. /**
  7618. * A faster alternative to `Function#apply`, this function invokes `func`
  7619. * with the `this` binding of `thisArg` and the arguments of `args`.
  7620. *
  7621. * @private
  7622. * @param {Function} func The function to invoke.
  7623. * @param {*} thisArg The `this` binding of `func`.
  7624. * @param {Array} args The arguments to invoke `func` with.
  7625. * @returns {*} Returns the result of `func`.
  7626. */
  7627. function apply(func, thisArg, args) {
  7628. switch (args.length) {
  7629. case 0: return func.call(thisArg);
  7630. case 1: return func.call(thisArg, args[0]);
  7631. case 2: return func.call(thisArg, args[0], args[1]);
  7632. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  7633. }
  7634. return func.apply(thisArg, args);
  7635. }
  7636. /**
  7637. * A specialized version of `baseAggregator` for arrays.
  7638. *
  7639. * @private
  7640. * @param {Array} [array] The array to iterate over.
  7641. * @param {Function} setter The function to set `accumulator` values.
  7642. * @param {Function} iteratee The iteratee to transform keys.
  7643. * @param {Object} accumulator The initial aggregated object.
  7644. * @returns {Function} Returns `accumulator`.
  7645. */
  7646. function arrayAggregator(array, setter, iteratee, accumulator) {
  7647. var index = -1,
  7648. length = array == null ? 0 : array.length;
  7649. while (++index < length) {
  7650. var value = array[index];
  7651. setter(accumulator, value, iteratee(value), array);
  7652. }
  7653. return accumulator;
  7654. }
  7655. /**
  7656. * A specialized version of `_.forEach` for arrays without support for
  7657. * iteratee shorthands.
  7658. *
  7659. * @private
  7660. * @param {Array} [array] The array to iterate over.
  7661. * @param {Function} iteratee The function invoked per iteration.
  7662. * @returns {Array} Returns `array`.
  7663. */
  7664. function arrayEach(array, iteratee) {
  7665. var index = -1,
  7666. length = array == null ? 0 : array.length;
  7667. while (++index < length) {
  7668. if (iteratee(array[index], index, array) === false) {
  7669. break;
  7670. }
  7671. }
  7672. return array;
  7673. }
  7674. /**
  7675. * A specialized version of `_.forEachRight` for arrays without support for
  7676. * iteratee shorthands.
  7677. *
  7678. * @private
  7679. * @param {Array} [array] The array to iterate over.
  7680. * @param {Function} iteratee The function invoked per iteration.
  7681. * @returns {Array} Returns `array`.
  7682. */
  7683. function arrayEachRight(array, iteratee) {
  7684. var length = array == null ? 0 : array.length;
  7685. while (length--) {
  7686. if (iteratee(array[length], length, array) === false) {
  7687. break;
  7688. }
  7689. }
  7690. return array;
  7691. }
  7692. /**
  7693. * A specialized version of `_.every` for arrays without support for
  7694. * iteratee shorthands.
  7695. *
  7696. * @private
  7697. * @param {Array} [array] The array to iterate over.
  7698. * @param {Function} predicate The function invoked per iteration.
  7699. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  7700. * else `false`.
  7701. */
  7702. function arrayEvery(array, predicate) {
  7703. var index = -1,
  7704. length = array == null ? 0 : array.length;
  7705. while (++index < length) {
  7706. if (!predicate(array[index], index, array)) {
  7707. return false;
  7708. }
  7709. }
  7710. return true;
  7711. }
  7712. /**
  7713. * A specialized version of `_.filter` for arrays without support for
  7714. * iteratee shorthands.
  7715. *
  7716. * @private
  7717. * @param {Array} [array] The array to iterate over.
  7718. * @param {Function} predicate The function invoked per iteration.
  7719. * @returns {Array} Returns the new filtered array.
  7720. */
  7721. function arrayFilter(array, predicate) {
  7722. var index = -1,
  7723. length = array == null ? 0 : array.length,
  7724. resIndex = 0,
  7725. result = [];
  7726. while (++index < length) {
  7727. var value = array[index];
  7728. if (predicate(value, index, array)) {
  7729. result[resIndex++] = value;
  7730. }
  7731. }
  7732. return result;
  7733. }
  7734. /**
  7735. * A specialized version of `_.includes` for arrays without support for
  7736. * specifying an index to search from.
  7737. *
  7738. * @private
  7739. * @param {Array} [array] The array to inspect.
  7740. * @param {*} target The value to search for.
  7741. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  7742. */
  7743. function arrayIncludes(array, value) {
  7744. var length = array == null ? 0 : array.length;
  7745. return !!length && baseIndexOf(array, value, 0) > -1;
  7746. }
  7747. /**
  7748. * This function is like `arrayIncludes` except that it accepts a comparator.
  7749. *
  7750. * @private
  7751. * @param {Array} [array] The array to inspect.
  7752. * @param {*} target The value to search for.
  7753. * @param {Function} comparator The comparator invoked per element.
  7754. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  7755. */
  7756. function arrayIncludesWith(array, value, comparator) {
  7757. var index = -1,
  7758. length = array == null ? 0 : array.length;
  7759. while (++index < length) {
  7760. if (comparator(value, array[index])) {
  7761. return true;
  7762. }
  7763. }
  7764. return false;
  7765. }
  7766. /**
  7767. * A specialized version of `_.map` for arrays without support for iteratee
  7768. * shorthands.
  7769. *
  7770. * @private
  7771. * @param {Array} [array] The array to iterate over.
  7772. * @param {Function} iteratee The function invoked per iteration.
  7773. * @returns {Array} Returns the new mapped array.
  7774. */
  7775. function arrayMap(array, iteratee) {
  7776. var index = -1,
  7777. length = array == null ? 0 : array.length,
  7778. result = Array(length);
  7779. while (++index < length) {
  7780. result[index] = iteratee(array[index], index, array);
  7781. }
  7782. return result;
  7783. }
  7784. /**
  7785. * Appends the elements of `values` to `array`.
  7786. *
  7787. * @private
  7788. * @param {Array} array The array to modify.
  7789. * @param {Array} values The values to append.
  7790. * @returns {Array} Returns `array`.
  7791. */
  7792. function arrayPush(array, values) {
  7793. var index = -1,
  7794. length = values.length,
  7795. offset = array.length;
  7796. while (++index < length) {
  7797. array[offset + index] = values[index];
  7798. }
  7799. return array;
  7800. }
  7801. /**
  7802. * A specialized version of `_.reduce` for arrays without support for
  7803. * iteratee shorthands.
  7804. *
  7805. * @private
  7806. * @param {Array} [array] The array to iterate over.
  7807. * @param {Function} iteratee The function invoked per iteration.
  7808. * @param {*} [accumulator] The initial value.
  7809. * @param {boolean} [initAccum] Specify using the first element of `array` as
  7810. * the initial value.
  7811. * @returns {*} Returns the accumulated value.
  7812. */
  7813. function arrayReduce(array, iteratee, accumulator, initAccum) {
  7814. var index = -1,
  7815. length = array == null ? 0 : array.length;
  7816. if (initAccum && length) {
  7817. accumulator = array[++index];
  7818. }
  7819. while (++index < length) {
  7820. accumulator = iteratee(accumulator, array[index], index, array);
  7821. }
  7822. return accumulator;
  7823. }
  7824. /**
  7825. * A specialized version of `_.reduceRight` for arrays without support for
  7826. * iteratee shorthands.
  7827. *
  7828. * @private
  7829. * @param {Array} [array] The array to iterate over.
  7830. * @param {Function} iteratee The function invoked per iteration.
  7831. * @param {*} [accumulator] The initial value.
  7832. * @param {boolean} [initAccum] Specify using the last element of `array` as
  7833. * the initial value.
  7834. * @returns {*} Returns the accumulated value.
  7835. */
  7836. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  7837. var length = array == null ? 0 : array.length;
  7838. if (initAccum && length) {
  7839. accumulator = array[--length];
  7840. }
  7841. while (length--) {
  7842. accumulator = iteratee(accumulator, array[length], length, array);
  7843. }
  7844. return accumulator;
  7845. }
  7846. /**
  7847. * A specialized version of `_.some` for arrays without support for iteratee
  7848. * shorthands.
  7849. *
  7850. * @private
  7851. * @param {Array} [array] The array to iterate over.
  7852. * @param {Function} predicate The function invoked per iteration.
  7853. * @returns {boolean} Returns `true` if any element passes the predicate check,
  7854. * else `false`.
  7855. */
  7856. function arraySome(array, predicate) {
  7857. var index = -1,
  7858. length = array == null ? 0 : array.length;
  7859. while (++index < length) {
  7860. if (predicate(array[index], index, array)) {
  7861. return true;
  7862. }
  7863. }
  7864. return false;
  7865. }
  7866. /**
  7867. * Gets the size of an ASCII `string`.
  7868. *
  7869. * @private
  7870. * @param {string} string The string inspect.
  7871. * @returns {number} Returns the string size.
  7872. */
  7873. var asciiSize = baseProperty('length');
  7874. /**
  7875. * Converts an ASCII `string` to an array.
  7876. *
  7877. * @private
  7878. * @param {string} string The string to convert.
  7879. * @returns {Array} Returns the converted array.
  7880. */
  7881. function asciiToArray(string) {
  7882. return string.split('');
  7883. }
  7884. /**
  7885. * Splits an ASCII `string` into an array of its words.
  7886. *
  7887. * @private
  7888. * @param {string} The string to inspect.
  7889. * @returns {Array} Returns the words of `string`.
  7890. */
  7891. function asciiWords(string) {
  7892. return string.match(reAsciiWord) || [];
  7893. }
  7894. /**
  7895. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  7896. * without support for iteratee shorthands, which iterates over `collection`
  7897. * using `eachFunc`.
  7898. *
  7899. * @private
  7900. * @param {Array|Object} collection The collection to inspect.
  7901. * @param {Function} predicate The function invoked per iteration.
  7902. * @param {Function} eachFunc The function to iterate over `collection`.
  7903. * @returns {*} Returns the found element or its key, else `undefined`.
  7904. */
  7905. function baseFindKey(collection, predicate, eachFunc) {
  7906. var result;
  7907. eachFunc(collection, function(value, key, collection) {
  7908. if (predicate(value, key, collection)) {
  7909. result = key;
  7910. return false;
  7911. }
  7912. });
  7913. return result;
  7914. }
  7915. /**
  7916. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  7917. * support for iteratee shorthands.
  7918. *
  7919. * @private
  7920. * @param {Array} array The array to inspect.
  7921. * @param {Function} predicate The function invoked per iteration.
  7922. * @param {number} fromIndex The index to search from.
  7923. * @param {boolean} [fromRight] Specify iterating from right to left.
  7924. * @returns {number} Returns the index of the matched value, else `-1`.
  7925. */
  7926. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  7927. var length = array.length,
  7928. index = fromIndex + (fromRight ? 1 : -1);
  7929. while ((fromRight ? index-- : ++index < length)) {
  7930. if (predicate(array[index], index, array)) {
  7931. return index;
  7932. }
  7933. }
  7934. return -1;
  7935. }
  7936. /**
  7937. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  7938. *
  7939. * @private
  7940. * @param {Array} array The array to inspect.
  7941. * @param {*} value The value to search for.
  7942. * @param {number} fromIndex The index to search from.
  7943. * @returns {number} Returns the index of the matched value, else `-1`.
  7944. */
  7945. function baseIndexOf(array, value, fromIndex) {
  7946. return value === value
  7947. ? strictIndexOf(array, value, fromIndex)
  7948. : baseFindIndex(array, baseIsNaN, fromIndex);
  7949. }
  7950. /**
  7951. * This function is like `baseIndexOf` except that it accepts a comparator.
  7952. *
  7953. * @private
  7954. * @param {Array} array The array to inspect.
  7955. * @param {*} value The value to search for.
  7956. * @param {number} fromIndex The index to search from.
  7957. * @param {Function} comparator The comparator invoked per element.
  7958. * @returns {number} Returns the index of the matched value, else `-1`.
  7959. */
  7960. function baseIndexOfWith(array, value, fromIndex, comparator) {
  7961. var index = fromIndex - 1,
  7962. length = array.length;
  7963. while (++index < length) {
  7964. if (comparator(array[index], value)) {
  7965. return index;
  7966. }
  7967. }
  7968. return -1;
  7969. }
  7970. /**
  7971. * The base implementation of `_.isNaN` without support for number objects.
  7972. *
  7973. * @private
  7974. * @param {*} value The value to check.
  7975. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  7976. */
  7977. function baseIsNaN(value) {
  7978. return value !== value;
  7979. }
  7980. /**
  7981. * The base implementation of `_.mean` and `_.meanBy` without support for
  7982. * iteratee shorthands.
  7983. *
  7984. * @private
  7985. * @param {Array} array The array to iterate over.
  7986. * @param {Function} iteratee The function invoked per iteration.
  7987. * @returns {number} Returns the mean.
  7988. */
  7989. function baseMean(array, iteratee) {
  7990. var length = array == null ? 0 : array.length;
  7991. return length ? (baseSum(array, iteratee) / length) : NAN;
  7992. }
  7993. /**
  7994. * The base implementation of `_.property` without support for deep paths.
  7995. *
  7996. * @private
  7997. * @param {string} key The key of the property to get.
  7998. * @returns {Function} Returns the new accessor function.
  7999. */
  8000. function baseProperty(key) {
  8001. return function(object) {
  8002. return object == null ? undefined : object[key];
  8003. };
  8004. }
  8005. /**
  8006. * The base implementation of `_.propertyOf` without support for deep paths.
  8007. *
  8008. * @private
  8009. * @param {Object} object The object to query.
  8010. * @returns {Function} Returns the new accessor function.
  8011. */
  8012. function basePropertyOf(object) {
  8013. return function(key) {
  8014. return object == null ? undefined : object[key];
  8015. };
  8016. }
  8017. /**
  8018. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  8019. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  8020. *
  8021. * @private
  8022. * @param {Array|Object} collection The collection to iterate over.
  8023. * @param {Function} iteratee The function invoked per iteration.
  8024. * @param {*} accumulator The initial value.
  8025. * @param {boolean} initAccum Specify using the first or last element of
  8026. * `collection` as the initial value.
  8027. * @param {Function} eachFunc The function to iterate over `collection`.
  8028. * @returns {*} Returns the accumulated value.
  8029. */
  8030. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  8031. eachFunc(collection, function(value, index, collection) {
  8032. accumulator = initAccum
  8033. ? (initAccum = false, value)
  8034. : iteratee(accumulator, value, index, collection);
  8035. });
  8036. return accumulator;
  8037. }
  8038. /**
  8039. * The base implementation of `_.sortBy` which uses `comparer` to define the
  8040. * sort order of `array` and replaces criteria objects with their corresponding
  8041. * values.
  8042. *
  8043. * @private
  8044. * @param {Array} array The array to sort.
  8045. * @param {Function} comparer The function to define sort order.
  8046. * @returns {Array} Returns `array`.
  8047. */
  8048. function baseSortBy(array, comparer) {
  8049. var length = array.length;
  8050. array.sort(comparer);
  8051. while (length--) {
  8052. array[length] = array[length].value;
  8053. }
  8054. return array;
  8055. }
  8056. /**
  8057. * The base implementation of `_.sum` and `_.sumBy` without support for
  8058. * iteratee shorthands.
  8059. *
  8060. * @private
  8061. * @param {Array} array The array to iterate over.
  8062. * @param {Function} iteratee The function invoked per iteration.
  8063. * @returns {number} Returns the sum.
  8064. */
  8065. function baseSum(array, iteratee) {
  8066. var result,
  8067. index = -1,
  8068. length = array.length;
  8069. while (++index < length) {
  8070. var current = iteratee(array[index]);
  8071. if (current !== undefined) {
  8072. result = result === undefined ? current : (result + current);
  8073. }
  8074. }
  8075. return result;
  8076. }
  8077. /**
  8078. * The base implementation of `_.times` without support for iteratee shorthands
  8079. * or max array length checks.
  8080. *
  8081. * @private
  8082. * @param {number} n The number of times to invoke `iteratee`.
  8083. * @param {Function} iteratee The function invoked per iteration.
  8084. * @returns {Array} Returns the array of results.
  8085. */
  8086. function baseTimes(n, iteratee) {
  8087. var index = -1,
  8088. result = Array(n);
  8089. while (++index < n) {
  8090. result[index] = iteratee(index);
  8091. }
  8092. return result;
  8093. }
  8094. /**
  8095. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  8096. * of key-value pairs for `object` corresponding to the property names of `props`.
  8097. *
  8098. * @private
  8099. * @param {Object} object The object to query.
  8100. * @param {Array} props The property names to get values for.
  8101. * @returns {Object} Returns the key-value pairs.
  8102. */
  8103. function baseToPairs(object, props) {
  8104. return arrayMap(props, function(key) {
  8105. return [key, object[key]];
  8106. });
  8107. }
  8108. /**
  8109. * The base implementation of `_.unary` without support for storing metadata.
  8110. *
  8111. * @private
  8112. * @param {Function} func The function to cap arguments for.
  8113. * @returns {Function} Returns the new capped function.
  8114. */
  8115. function baseUnary(func) {
  8116. return function(value) {
  8117. return func(value);
  8118. };
  8119. }
  8120. /**
  8121. * The base implementation of `_.values` and `_.valuesIn` which creates an
  8122. * array of `object` property values corresponding to the property names
  8123. * of `props`.
  8124. *
  8125. * @private
  8126. * @param {Object} object The object to query.
  8127. * @param {Array} props The property names to get values for.
  8128. * @returns {Object} Returns the array of property values.
  8129. */
  8130. function baseValues(object, props) {
  8131. return arrayMap(props, function(key) {
  8132. return object[key];
  8133. });
  8134. }
  8135. /**
  8136. * Checks if a `cache` value for `key` exists.
  8137. *
  8138. * @private
  8139. * @param {Object} cache The cache to query.
  8140. * @param {string} key The key of the entry to check.
  8141. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  8142. */
  8143. function cacheHas(cache, key) {
  8144. return cache.has(key);
  8145. }
  8146. /**
  8147. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  8148. * that is not found in the character symbols.
  8149. *
  8150. * @private
  8151. * @param {Array} strSymbols The string symbols to inspect.
  8152. * @param {Array} chrSymbols The character symbols to find.
  8153. * @returns {number} Returns the index of the first unmatched string symbol.
  8154. */
  8155. function charsStartIndex(strSymbols, chrSymbols) {
  8156. var index = -1,
  8157. length = strSymbols.length;
  8158. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  8159. return index;
  8160. }
  8161. /**
  8162. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  8163. * that is not found in the character symbols.
  8164. *
  8165. * @private
  8166. * @param {Array} strSymbols The string symbols to inspect.
  8167. * @param {Array} chrSymbols The character symbols to find.
  8168. * @returns {number} Returns the index of the last unmatched string symbol.
  8169. */
  8170. function charsEndIndex(strSymbols, chrSymbols) {
  8171. var index = strSymbols.length;
  8172. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  8173. return index;
  8174. }
  8175. /**
  8176. * Gets the number of `placeholder` occurrences in `array`.
  8177. *
  8178. * @private
  8179. * @param {Array} array The array to inspect.
  8180. * @param {*} placeholder The placeholder to search for.
  8181. * @returns {number} Returns the placeholder count.
  8182. */
  8183. function countHolders(array, placeholder) {
  8184. var length = array.length,
  8185. result = 0;
  8186. while (length--) {
  8187. if (array[length] === placeholder) {
  8188. ++result;
  8189. }
  8190. }
  8191. return result;
  8192. }
  8193. /**
  8194. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  8195. * letters to basic Latin letters.
  8196. *
  8197. * @private
  8198. * @param {string} letter The matched letter to deburr.
  8199. * @returns {string} Returns the deburred letter.
  8200. */
  8201. var deburrLetter = basePropertyOf(deburredLetters);
  8202. /**
  8203. * Used by `_.escape` to convert characters to HTML entities.
  8204. *
  8205. * @private
  8206. * @param {string} chr The matched character to escape.
  8207. * @returns {string} Returns the escaped character.
  8208. */
  8209. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  8210. /**
  8211. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  8212. *
  8213. * @private
  8214. * @param {string} chr The matched character to escape.
  8215. * @returns {string} Returns the escaped character.
  8216. */
  8217. function escapeStringChar(chr) {
  8218. return '\\' + stringEscapes[chr];
  8219. }
  8220. /**
  8221. * Gets the value at `key` of `object`.
  8222. *
  8223. * @private
  8224. * @param {Object} [object] The object to query.
  8225. * @param {string} key The key of the property to get.
  8226. * @returns {*} Returns the property value.
  8227. */
  8228. function getValue(object, key) {
  8229. return object == null ? undefined : object[key];
  8230. }
  8231. /**
  8232. * Checks if `string` contains Unicode symbols.
  8233. *
  8234. * @private
  8235. * @param {string} string The string to inspect.
  8236. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  8237. */
  8238. function hasUnicode(string) {
  8239. return reHasUnicode.test(string);
  8240. }
  8241. /**
  8242. * Checks if `string` contains a word composed of Unicode symbols.
  8243. *
  8244. * @private
  8245. * @param {string} string The string to inspect.
  8246. * @returns {boolean} Returns `true` if a word is found, else `false`.
  8247. */
  8248. function hasUnicodeWord(string) {
  8249. return reHasUnicodeWord.test(string);
  8250. }
  8251. /**
  8252. * Converts `iterator` to an array.
  8253. *
  8254. * @private
  8255. * @param {Object} iterator The iterator to convert.
  8256. * @returns {Array} Returns the converted array.
  8257. */
  8258. function iteratorToArray(iterator) {
  8259. var data,
  8260. result = [];
  8261. while (!(data = iterator.next()).done) {
  8262. result.push(data.value);
  8263. }
  8264. return result;
  8265. }
  8266. /**
  8267. * Converts `map` to its key-value pairs.
  8268. *
  8269. * @private
  8270. * @param {Object} map The map to convert.
  8271. * @returns {Array} Returns the key-value pairs.
  8272. */
  8273. function mapToArray(map) {
  8274. var index = -1,
  8275. result = Array(map.size);
  8276. map.forEach(function(value, key) {
  8277. result[++index] = [key, value];
  8278. });
  8279. return result;
  8280. }
  8281. /**
  8282. * Creates a unary function that invokes `func` with its argument transformed.
  8283. *
  8284. * @private
  8285. * @param {Function} func The function to wrap.
  8286. * @param {Function} transform The argument transform.
  8287. * @returns {Function} Returns the new function.
  8288. */
  8289. function overArg(func, transform) {
  8290. return function(arg) {
  8291. return func(transform(arg));
  8292. };
  8293. }
  8294. /**
  8295. * Replaces all `placeholder` elements in `array` with an internal placeholder
  8296. * and returns an array of their indexes.
  8297. *
  8298. * @private
  8299. * @param {Array} array The array to modify.
  8300. * @param {*} placeholder The placeholder to replace.
  8301. * @returns {Array} Returns the new array of placeholder indexes.
  8302. */
  8303. function replaceHolders(array, placeholder) {
  8304. var index = -1,
  8305. length = array.length,
  8306. resIndex = 0,
  8307. result = [];
  8308. while (++index < length) {
  8309. var value = array[index];
  8310. if (value === placeholder || value === PLACEHOLDER) {
  8311. array[index] = PLACEHOLDER;
  8312. result[resIndex++] = index;
  8313. }
  8314. }
  8315. return result;
  8316. }
  8317. /**
  8318. * Gets the value at `key`, unless `key` is "__proto__".
  8319. *
  8320. * @private
  8321. * @param {Object} object The object to query.
  8322. * @param {string} key The key of the property to get.
  8323. * @returns {*} Returns the property value.
  8324. */
  8325. function safeGet(object, key) {
  8326. return key == '__proto__'
  8327. ? undefined
  8328. : object[key];
  8329. }
  8330. /**
  8331. * Converts `set` to an array of its values.
  8332. *
  8333. * @private
  8334. * @param {Object} set The set to convert.
  8335. * @returns {Array} Returns the values.
  8336. */
  8337. function setToArray(set) {
  8338. var index = -1,
  8339. result = Array(set.size);
  8340. set.forEach(function(value) {
  8341. result[++index] = value;
  8342. });
  8343. return result;
  8344. }
  8345. /**
  8346. * Converts `set` to its value-value pairs.
  8347. *
  8348. * @private
  8349. * @param {Object} set The set to convert.
  8350. * @returns {Array} Returns the value-value pairs.
  8351. */
  8352. function setToPairs(set) {
  8353. var index = -1,
  8354. result = Array(set.size);
  8355. set.forEach(function(value) {
  8356. result[++index] = [value, value];
  8357. });
  8358. return result;
  8359. }
  8360. /**
  8361. * A specialized version of `_.indexOf` which performs strict equality
  8362. * comparisons of values, i.e. `===`.
  8363. *
  8364. * @private
  8365. * @param {Array} array The array to inspect.
  8366. * @param {*} value The value to search for.
  8367. * @param {number} fromIndex The index to search from.
  8368. * @returns {number} Returns the index of the matched value, else `-1`.
  8369. */
  8370. function strictIndexOf(array, value, fromIndex) {
  8371. var index = fromIndex - 1,
  8372. length = array.length;
  8373. while (++index < length) {
  8374. if (array[index] === value) {
  8375. return index;
  8376. }
  8377. }
  8378. return -1;
  8379. }
  8380. /**
  8381. * A specialized version of `_.lastIndexOf` which performs strict equality
  8382. * comparisons of values, i.e. `===`.
  8383. *
  8384. * @private
  8385. * @param {Array} array The array to inspect.
  8386. * @param {*} value The value to search for.
  8387. * @param {number} fromIndex The index to search from.
  8388. * @returns {number} Returns the index of the matched value, else `-1`.
  8389. */
  8390. function strictLastIndexOf(array, value, fromIndex) {
  8391. var index = fromIndex + 1;
  8392. while (index--) {
  8393. if (array[index] === value) {
  8394. return index;
  8395. }
  8396. }
  8397. return index;
  8398. }
  8399. /**
  8400. * Gets the number of symbols in `string`.
  8401. *
  8402. * @private
  8403. * @param {string} string The string to inspect.
  8404. * @returns {number} Returns the string size.
  8405. */
  8406. function stringSize(string) {
  8407. return hasUnicode(string)
  8408. ? unicodeSize(string)
  8409. : asciiSize(string);
  8410. }
  8411. /**
  8412. * Converts `string` to an array.
  8413. *
  8414. * @private
  8415. * @param {string} string The string to convert.
  8416. * @returns {Array} Returns the converted array.
  8417. */
  8418. function stringToArray(string) {
  8419. return hasUnicode(string)
  8420. ? unicodeToArray(string)
  8421. : asciiToArray(string);
  8422. }
  8423. /**
  8424. * Used by `_.unescape` to convert HTML entities to characters.
  8425. *
  8426. * @private
  8427. * @param {string} chr The matched character to unescape.
  8428. * @returns {string} Returns the unescaped character.
  8429. */
  8430. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  8431. /**
  8432. * Gets the size of a Unicode `string`.
  8433. *
  8434. * @private
  8435. * @param {string} string The string inspect.
  8436. * @returns {number} Returns the string size.
  8437. */
  8438. function unicodeSize(string) {
  8439. var result = reUnicode.lastIndex = 0;
  8440. while (reUnicode.test(string)) {
  8441. ++result;
  8442. }
  8443. return result;
  8444. }
  8445. /**
  8446. * Converts a Unicode `string` to an array.
  8447. *
  8448. * @private
  8449. * @param {string} string The string to convert.
  8450. * @returns {Array} Returns the converted array.
  8451. */
  8452. function unicodeToArray(string) {
  8453. return string.match(reUnicode) || [];
  8454. }
  8455. /**
  8456. * Splits a Unicode `string` into an array of its words.
  8457. *
  8458. * @private
  8459. * @param {string} The string to inspect.
  8460. * @returns {Array} Returns the words of `string`.
  8461. */
  8462. function unicodeWords(string) {
  8463. return string.match(reUnicodeWord) || [];
  8464. }
  8465. /*--------------------------------------------------------------------------*/
  8466. /**
  8467. * Create a new pristine `lodash` function using the `context` object.
  8468. *
  8469. * @static
  8470. * @memberOf _
  8471. * @since 1.1.0
  8472. * @category Util
  8473. * @param {Object} [context=root] The context object.
  8474. * @returns {Function} Returns a new `lodash` function.
  8475. * @example
  8476. *
  8477. * _.mixin({ 'foo': _.constant('foo') });
  8478. *
  8479. * var lodash = _.runInContext();
  8480. * lodash.mixin({ 'bar': lodash.constant('bar') });
  8481. *
  8482. * _.isFunction(_.foo);
  8483. * // => true
  8484. * _.isFunction(_.bar);
  8485. * // => false
  8486. *
  8487. * lodash.isFunction(lodash.foo);
  8488. * // => false
  8489. * lodash.isFunction(lodash.bar);
  8490. * // => true
  8491. *
  8492. * // Create a suped-up `defer` in Node.js.
  8493. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  8494. */
  8495. var runInContext = (function runInContext(context) {
  8496. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  8497. /** Built-in constructor references. */
  8498. var Array = context.Array,
  8499. Date = context.Date,
  8500. Error = context.Error,
  8501. Function = context.Function,
  8502. Math = context.Math,
  8503. Object = context.Object,
  8504. RegExp = context.RegExp,
  8505. String = context.String,
  8506. TypeError = context.TypeError;
  8507. /** Used for built-in method references. */
  8508. var arrayProto = Array.prototype,
  8509. funcProto = Function.prototype,
  8510. objectProto = Object.prototype;
  8511. /** Used to detect overreaching core-js shims. */
  8512. var coreJsData = context['__core-js_shared__'];
  8513. /** Used to resolve the decompiled source of functions. */
  8514. var funcToString = funcProto.toString;
  8515. /** Used to check objects for own properties. */
  8516. var hasOwnProperty = objectProto.hasOwnProperty;
  8517. /** Used to generate unique IDs. */
  8518. var idCounter = 0;
  8519. /** Used to detect methods masquerading as native. */
  8520. var maskSrcKey = (function() {
  8521. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  8522. return uid ? ('Symbol(src)_1.' + uid) : '';
  8523. }());
  8524. /**
  8525. * Used to resolve the
  8526. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  8527. * of values.
  8528. */
  8529. var nativeObjectToString = objectProto.toString;
  8530. /** Used to infer the `Object` constructor. */
  8531. var objectCtorString = funcToString.call(Object);
  8532. /** Used to restore the original `_` reference in `_.noConflict`. */
  8533. var oldDash = root._;
  8534. /** Used to detect if a method is native. */
  8535. var reIsNative = RegExp('^' +
  8536. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  8537. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  8538. );
  8539. /** Built-in value references. */
  8540. var Buffer = moduleExports ? context.Buffer : undefined,
  8541. Symbol = context.Symbol,
  8542. Uint8Array = context.Uint8Array,
  8543. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  8544. getPrototype = overArg(Object.getPrototypeOf, Object),
  8545. objectCreate = Object.create,
  8546. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  8547. splice = arrayProto.splice,
  8548. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  8549. symIterator = Symbol ? Symbol.iterator : undefined,
  8550. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  8551. var defineProperty = (function() {
  8552. try {
  8553. var func = getNative(Object, 'defineProperty');
  8554. func({}, '', {});
  8555. return func;
  8556. } catch (e) {}
  8557. }());
  8558. /** Mocked built-ins. */
  8559. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  8560. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  8561. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  8562. /* Built-in method references for those with the same name as other `lodash` methods. */
  8563. var nativeCeil = Math.ceil,
  8564. nativeFloor = Math.floor,
  8565. nativeGetSymbols = Object.getOwnPropertySymbols,
  8566. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  8567. nativeIsFinite = context.isFinite,
  8568. nativeJoin = arrayProto.join,
  8569. nativeKeys = overArg(Object.keys, Object),
  8570. nativeMax = Math.max,
  8571. nativeMin = Math.min,
  8572. nativeNow = Date.now,
  8573. nativeParseInt = context.parseInt,
  8574. nativeRandom = Math.random,
  8575. nativeReverse = arrayProto.reverse;
  8576. /* Built-in method references that are verified to be native. */
  8577. var DataView = getNative(context, 'DataView'),
  8578. Map = getNative(context, 'Map'),
  8579. Promise = getNative(context, 'Promise'),
  8580. Set = getNative(context, 'Set'),
  8581. WeakMap = getNative(context, 'WeakMap'),
  8582. nativeCreate = getNative(Object, 'create');
  8583. /** Used to store function metadata. */
  8584. var metaMap = WeakMap && new WeakMap;
  8585. /** Used to lookup unminified function names. */
  8586. var realNames = {};
  8587. /** Used to detect maps, sets, and weakmaps. */
  8588. var dataViewCtorString = toSource(DataView),
  8589. mapCtorString = toSource(Map),
  8590. promiseCtorString = toSource(Promise),
  8591. setCtorString = toSource(Set),
  8592. weakMapCtorString = toSource(WeakMap);
  8593. /** Used to convert symbols to primitives and strings. */
  8594. var symbolProto = Symbol ? Symbol.prototype : undefined,
  8595. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  8596. symbolToString = symbolProto ? symbolProto.toString : undefined;
  8597. /*------------------------------------------------------------------------*/
  8598. /**
  8599. * Creates a `lodash` object which wraps `value` to enable implicit method
  8600. * chain sequences. Methods that operate on and return arrays, collections,
  8601. * and functions can be chained together. Methods that retrieve a single value
  8602. * or may return a primitive value will automatically end the chain sequence
  8603. * and return the unwrapped value. Otherwise, the value must be unwrapped
  8604. * with `_#value`.
  8605. *
  8606. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  8607. * enabled using `_.chain`.
  8608. *
  8609. * The execution of chained methods is lazy, that is, it's deferred until
  8610. * `_#value` is implicitly or explicitly called.
  8611. *
  8612. * Lazy evaluation allows several methods to support shortcut fusion.
  8613. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  8614. * the creation of intermediate arrays and can greatly reduce the number of
  8615. * iteratee executions. Sections of a chain sequence qualify for shortcut
  8616. * fusion if the section is applied to an array and iteratees accept only
  8617. * one argument. The heuristic for whether a section qualifies for shortcut
  8618. * fusion is subject to change.
  8619. *
  8620. * Chaining is supported in custom builds as long as the `_#value` method is
  8621. * directly or indirectly included in the build.
  8622. *
  8623. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  8624. *
  8625. * The wrapper `Array` methods are:
  8626. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  8627. *
  8628. * The wrapper `String` methods are:
  8629. * `replace` and `split`
  8630. *
  8631. * The wrapper methods that support shortcut fusion are:
  8632. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  8633. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  8634. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  8635. *
  8636. * The chainable wrapper methods are:
  8637. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  8638. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  8639. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  8640. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  8641. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  8642. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  8643. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  8644. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  8645. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  8646. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  8647. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  8648. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  8649. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  8650. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  8651. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  8652. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  8653. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  8654. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  8655. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  8656. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  8657. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  8658. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  8659. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  8660. * `zipObject`, `zipObjectDeep`, and `zipWith`
  8661. *
  8662. * The wrapper methods that are **not** chainable by default are:
  8663. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  8664. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  8665. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  8666. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  8667. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  8668. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  8669. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  8670. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  8671. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  8672. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  8673. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  8674. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  8675. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  8676. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  8677. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  8678. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  8679. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  8680. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  8681. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  8682. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  8683. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  8684. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  8685. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  8686. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  8687. * `upperFirst`, `value`, and `words`
  8688. *
  8689. * @name _
  8690. * @constructor
  8691. * @category Seq
  8692. * @param {*} value The value to wrap in a `lodash` instance.
  8693. * @returns {Object} Returns the new `lodash` wrapper instance.
  8694. * @example
  8695. *
  8696. * function square(n) {
  8697. * return n * n;
  8698. * }
  8699. *
  8700. * var wrapped = _([1, 2, 3]);
  8701. *
  8702. * // Returns an unwrapped value.
  8703. * wrapped.reduce(_.add);
  8704. * // => 6
  8705. *
  8706. * // Returns a wrapped value.
  8707. * var squares = wrapped.map(square);
  8708. *
  8709. * _.isArray(squares);
  8710. * // => false
  8711. *
  8712. * _.isArray(squares.value());
  8713. * // => true
  8714. */
  8715. function lodash(value) {
  8716. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  8717. if (value instanceof LodashWrapper) {
  8718. return value;
  8719. }
  8720. if (hasOwnProperty.call(value, '__wrapped__')) {
  8721. return wrapperClone(value);
  8722. }
  8723. }
  8724. return new LodashWrapper(value);
  8725. }
  8726. /**
  8727. * The base implementation of `_.create` without support for assigning
  8728. * properties to the created object.
  8729. *
  8730. * @private
  8731. * @param {Object} proto The object to inherit from.
  8732. * @returns {Object} Returns the new object.
  8733. */
  8734. var baseCreate = (function() {
  8735. function object() {}
  8736. return function(proto) {
  8737. if (!isObject(proto)) {
  8738. return {};
  8739. }
  8740. if (objectCreate) {
  8741. return objectCreate(proto);
  8742. }
  8743. object.prototype = proto;
  8744. var result = new object;
  8745. object.prototype = undefined;
  8746. return result;
  8747. };
  8748. }());
  8749. /**
  8750. * The function whose prototype chain sequence wrappers inherit from.
  8751. *
  8752. * @private
  8753. */
  8754. function baseLodash() {
  8755. // No operation performed.
  8756. }
  8757. /**
  8758. * The base constructor for creating `lodash` wrapper objects.
  8759. *
  8760. * @private
  8761. * @param {*} value The value to wrap.
  8762. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  8763. */
  8764. function LodashWrapper(value, chainAll) {
  8765. this.__wrapped__ = value;
  8766. this.__actions__ = [];
  8767. this.__chain__ = !!chainAll;
  8768. this.__index__ = 0;
  8769. this.__values__ = undefined;
  8770. }
  8771. /**
  8772. * By default, the template delimiters used by lodash are like those in
  8773. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  8774. * following template settings to use alternative delimiters.
  8775. *
  8776. * @static
  8777. * @memberOf _
  8778. * @type {Object}
  8779. */
  8780. lodash.templateSettings = {
  8781. /**
  8782. * Used to detect `data` property values to be HTML-escaped.
  8783. *
  8784. * @memberOf _.templateSettings
  8785. * @type {RegExp}
  8786. */
  8787. 'escape': reEscape,
  8788. /**
  8789. * Used to detect code to be evaluated.
  8790. *
  8791. * @memberOf _.templateSettings
  8792. * @type {RegExp}
  8793. */
  8794. 'evaluate': reEvaluate,
  8795. /**
  8796. * Used to detect `data` property values to inject.
  8797. *
  8798. * @memberOf _.templateSettings
  8799. * @type {RegExp}
  8800. */
  8801. 'interpolate': reInterpolate,
  8802. /**
  8803. * Used to reference the data object in the template text.
  8804. *
  8805. * @memberOf _.templateSettings
  8806. * @type {string}
  8807. */
  8808. 'variable': '',
  8809. /**
  8810. * Used to import variables into the compiled template.
  8811. *
  8812. * @memberOf _.templateSettings
  8813. * @type {Object}
  8814. */
  8815. 'imports': {
  8816. /**
  8817. * A reference to the `lodash` function.
  8818. *
  8819. * @memberOf _.templateSettings.imports
  8820. * @type {Function}
  8821. */
  8822. '_': lodash
  8823. }
  8824. };
  8825. // Ensure wrappers are instances of `baseLodash`.
  8826. lodash.prototype = baseLodash.prototype;
  8827. lodash.prototype.constructor = lodash;
  8828. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  8829. LodashWrapper.prototype.constructor = LodashWrapper;
  8830. /*------------------------------------------------------------------------*/
  8831. /**
  8832. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  8833. *
  8834. * @private
  8835. * @constructor
  8836. * @param {*} value The value to wrap.
  8837. */
  8838. function LazyWrapper(value) {
  8839. this.__wrapped__ = value;
  8840. this.__actions__ = [];
  8841. this.__dir__ = 1;
  8842. this.__filtered__ = false;
  8843. this.__iteratees__ = [];
  8844. this.__takeCount__ = MAX_ARRAY_LENGTH;
  8845. this.__views__ = [];
  8846. }
  8847. /**
  8848. * Creates a clone of the lazy wrapper object.
  8849. *
  8850. * @private
  8851. * @name clone
  8852. * @memberOf LazyWrapper
  8853. * @returns {Object} Returns the cloned `LazyWrapper` object.
  8854. */
  8855. function lazyClone() {
  8856. var result = new LazyWrapper(this.__wrapped__);
  8857. result.__actions__ = copyArray(this.__actions__);
  8858. result.__dir__ = this.__dir__;
  8859. result.__filtered__ = this.__filtered__;
  8860. result.__iteratees__ = copyArray(this.__iteratees__);
  8861. result.__takeCount__ = this.__takeCount__;
  8862. result.__views__ = copyArray(this.__views__);
  8863. return result;
  8864. }
  8865. /**
  8866. * Reverses the direction of lazy iteration.
  8867. *
  8868. * @private
  8869. * @name reverse
  8870. * @memberOf LazyWrapper
  8871. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  8872. */
  8873. function lazyReverse() {
  8874. if (this.__filtered__) {
  8875. var result = new LazyWrapper(this);
  8876. result.__dir__ = -1;
  8877. result.__filtered__ = true;
  8878. } else {
  8879. result = this.clone();
  8880. result.__dir__ *= -1;
  8881. }
  8882. return result;
  8883. }
  8884. /**
  8885. * Extracts the unwrapped value from its lazy wrapper.
  8886. *
  8887. * @private
  8888. * @name value
  8889. * @memberOf LazyWrapper
  8890. * @returns {*} Returns the unwrapped value.
  8891. */
  8892. function lazyValue() {
  8893. var array = this.__wrapped__.value(),
  8894. dir = this.__dir__,
  8895. isArr = isArray(array),
  8896. isRight = dir < 0,
  8897. arrLength = isArr ? array.length : 0,
  8898. view = getView(0, arrLength, this.__views__),
  8899. start = view.start,
  8900. end = view.end,
  8901. length = end - start,
  8902. index = isRight ? end : (start - 1),
  8903. iteratees = this.__iteratees__,
  8904. iterLength = iteratees.length,
  8905. resIndex = 0,
  8906. takeCount = nativeMin(length, this.__takeCount__);
  8907. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  8908. return baseWrapperValue(array, this.__actions__);
  8909. }
  8910. var result = [];
  8911. outer:
  8912. while (length-- && resIndex < takeCount) {
  8913. index += dir;
  8914. var iterIndex = -1,
  8915. value = array[index];
  8916. while (++iterIndex < iterLength) {
  8917. var data = iteratees[iterIndex],
  8918. iteratee = data.iteratee,
  8919. type = data.type,
  8920. computed = iteratee(value);
  8921. if (type == LAZY_MAP_FLAG) {
  8922. value = computed;
  8923. } else if (!computed) {
  8924. if (type == LAZY_FILTER_FLAG) {
  8925. continue outer;
  8926. } else {
  8927. break outer;
  8928. }
  8929. }
  8930. }
  8931. result[resIndex++] = value;
  8932. }
  8933. return result;
  8934. }
  8935. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  8936. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  8937. LazyWrapper.prototype.constructor = LazyWrapper;
  8938. /*------------------------------------------------------------------------*/
  8939. /**
  8940. * Creates a hash object.
  8941. *
  8942. * @private
  8943. * @constructor
  8944. * @param {Array} [entries] The key-value pairs to cache.
  8945. */
  8946. function Hash(entries) {
  8947. var index = -1,
  8948. length = entries == null ? 0 : entries.length;
  8949. this.clear();
  8950. while (++index < length) {
  8951. var entry = entries[index];
  8952. this.set(entry[0], entry[1]);
  8953. }
  8954. }
  8955. /**
  8956. * Removes all key-value entries from the hash.
  8957. *
  8958. * @private
  8959. * @name clear
  8960. * @memberOf Hash
  8961. */
  8962. function hashClear() {
  8963. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  8964. this.size = 0;
  8965. }
  8966. /**
  8967. * Removes `key` and its value from the hash.
  8968. *
  8969. * @private
  8970. * @name delete
  8971. * @memberOf Hash
  8972. * @param {Object} hash The hash to modify.
  8973. * @param {string} key The key of the value to remove.
  8974. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  8975. */
  8976. function hashDelete(key) {
  8977. var result = this.has(key) && delete this.__data__[key];
  8978. this.size -= result ? 1 : 0;
  8979. return result;
  8980. }
  8981. /**
  8982. * Gets the hash value for `key`.
  8983. *
  8984. * @private
  8985. * @name get
  8986. * @memberOf Hash
  8987. * @param {string} key The key of the value to get.
  8988. * @returns {*} Returns the entry value.
  8989. */
  8990. function hashGet(key) {
  8991. var data = this.__data__;
  8992. if (nativeCreate) {
  8993. var result = data[key];
  8994. return result === HASH_UNDEFINED ? undefined : result;
  8995. }
  8996. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  8997. }
  8998. /**
  8999. * Checks if a hash value for `key` exists.
  9000. *
  9001. * @private
  9002. * @name has
  9003. * @memberOf Hash
  9004. * @param {string} key The key of the entry to check.
  9005. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9006. */
  9007. function hashHas(key) {
  9008. var data = this.__data__;
  9009. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  9010. }
  9011. /**
  9012. * Sets the hash `key` to `value`.
  9013. *
  9014. * @private
  9015. * @name set
  9016. * @memberOf Hash
  9017. * @param {string} key The key of the value to set.
  9018. * @param {*} value The value to set.
  9019. * @returns {Object} Returns the hash instance.
  9020. */
  9021. function hashSet(key, value) {
  9022. var data = this.__data__;
  9023. this.size += this.has(key) ? 0 : 1;
  9024. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  9025. return this;
  9026. }
  9027. // Add methods to `Hash`.
  9028. Hash.prototype.clear = hashClear;
  9029. Hash.prototype['delete'] = hashDelete;
  9030. Hash.prototype.get = hashGet;
  9031. Hash.prototype.has = hashHas;
  9032. Hash.prototype.set = hashSet;
  9033. /*------------------------------------------------------------------------*/
  9034. /**
  9035. * Creates an list cache object.
  9036. *
  9037. * @private
  9038. * @constructor
  9039. * @param {Array} [entries] The key-value pairs to cache.
  9040. */
  9041. function ListCache(entries) {
  9042. var index = -1,
  9043. length = entries == null ? 0 : entries.length;
  9044. this.clear();
  9045. while (++index < length) {
  9046. var entry = entries[index];
  9047. this.set(entry[0], entry[1]);
  9048. }
  9049. }
  9050. /**
  9051. * Removes all key-value entries from the list cache.
  9052. *
  9053. * @private
  9054. * @name clear
  9055. * @memberOf ListCache
  9056. */
  9057. function listCacheClear() {
  9058. this.__data__ = [];
  9059. this.size = 0;
  9060. }
  9061. /**
  9062. * Removes `key` and its value from the list cache.
  9063. *
  9064. * @private
  9065. * @name delete
  9066. * @memberOf ListCache
  9067. * @param {string} key The key of the value to remove.
  9068. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9069. */
  9070. function listCacheDelete(key) {
  9071. var data = this.__data__,
  9072. index = assocIndexOf(data, key);
  9073. if (index < 0) {
  9074. return false;
  9075. }
  9076. var lastIndex = data.length - 1;
  9077. if (index == lastIndex) {
  9078. data.pop();
  9079. } else {
  9080. splice.call(data, index, 1);
  9081. }
  9082. --this.size;
  9083. return true;
  9084. }
  9085. /**
  9086. * Gets the list cache value for `key`.
  9087. *
  9088. * @private
  9089. * @name get
  9090. * @memberOf ListCache
  9091. * @param {string} key The key of the value to get.
  9092. * @returns {*} Returns the entry value.
  9093. */
  9094. function listCacheGet(key) {
  9095. var data = this.__data__,
  9096. index = assocIndexOf(data, key);
  9097. return index < 0 ? undefined : data[index][1];
  9098. }
  9099. /**
  9100. * Checks if a list cache value for `key` exists.
  9101. *
  9102. * @private
  9103. * @name has
  9104. * @memberOf ListCache
  9105. * @param {string} key The key of the entry to check.
  9106. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9107. */
  9108. function listCacheHas(key) {
  9109. return assocIndexOf(this.__data__, key) > -1;
  9110. }
  9111. /**
  9112. * Sets the list cache `key` to `value`.
  9113. *
  9114. * @private
  9115. * @name set
  9116. * @memberOf ListCache
  9117. * @param {string} key The key of the value to set.
  9118. * @param {*} value The value to set.
  9119. * @returns {Object} Returns the list cache instance.
  9120. */
  9121. function listCacheSet(key, value) {
  9122. var data = this.__data__,
  9123. index = assocIndexOf(data, key);
  9124. if (index < 0) {
  9125. ++this.size;
  9126. data.push([key, value]);
  9127. } else {
  9128. data[index][1] = value;
  9129. }
  9130. return this;
  9131. }
  9132. // Add methods to `ListCache`.
  9133. ListCache.prototype.clear = listCacheClear;
  9134. ListCache.prototype['delete'] = listCacheDelete;
  9135. ListCache.prototype.get = listCacheGet;
  9136. ListCache.prototype.has = listCacheHas;
  9137. ListCache.prototype.set = listCacheSet;
  9138. /*------------------------------------------------------------------------*/
  9139. /**
  9140. * Creates a map cache object to store key-value pairs.
  9141. *
  9142. * @private
  9143. * @constructor
  9144. * @param {Array} [entries] The key-value pairs to cache.
  9145. */
  9146. function MapCache(entries) {
  9147. var index = -1,
  9148. length = entries == null ? 0 : entries.length;
  9149. this.clear();
  9150. while (++index < length) {
  9151. var entry = entries[index];
  9152. this.set(entry[0], entry[1]);
  9153. }
  9154. }
  9155. /**
  9156. * Removes all key-value entries from the map.
  9157. *
  9158. * @private
  9159. * @name clear
  9160. * @memberOf MapCache
  9161. */
  9162. function mapCacheClear() {
  9163. this.size = 0;
  9164. this.__data__ = {
  9165. 'hash': new Hash,
  9166. 'map': new (Map || ListCache),
  9167. 'string': new Hash
  9168. };
  9169. }
  9170. /**
  9171. * Removes `key` and its value from the map.
  9172. *
  9173. * @private
  9174. * @name delete
  9175. * @memberOf MapCache
  9176. * @param {string} key The key of the value to remove.
  9177. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9178. */
  9179. function mapCacheDelete(key) {
  9180. var result = getMapData(this, key)['delete'](key);
  9181. this.size -= result ? 1 : 0;
  9182. return result;
  9183. }
  9184. /**
  9185. * Gets the map value for `key`.
  9186. *
  9187. * @private
  9188. * @name get
  9189. * @memberOf MapCache
  9190. * @param {string} key The key of the value to get.
  9191. * @returns {*} Returns the entry value.
  9192. */
  9193. function mapCacheGet(key) {
  9194. return getMapData(this, key).get(key);
  9195. }
  9196. /**
  9197. * Checks if a map value for `key` exists.
  9198. *
  9199. * @private
  9200. * @name has
  9201. * @memberOf MapCache
  9202. * @param {string} key The key of the entry to check.
  9203. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9204. */
  9205. function mapCacheHas(key) {
  9206. return getMapData(this, key).has(key);
  9207. }
  9208. /**
  9209. * Sets the map `key` to `value`.
  9210. *
  9211. * @private
  9212. * @name set
  9213. * @memberOf MapCache
  9214. * @param {string} key The key of the value to set.
  9215. * @param {*} value The value to set.
  9216. * @returns {Object} Returns the map cache instance.
  9217. */
  9218. function mapCacheSet(key, value) {
  9219. var data = getMapData(this, key),
  9220. size = data.size;
  9221. data.set(key, value);
  9222. this.size += data.size == size ? 0 : 1;
  9223. return this;
  9224. }
  9225. // Add methods to `MapCache`.
  9226. MapCache.prototype.clear = mapCacheClear;
  9227. MapCache.prototype['delete'] = mapCacheDelete;
  9228. MapCache.prototype.get = mapCacheGet;
  9229. MapCache.prototype.has = mapCacheHas;
  9230. MapCache.prototype.set = mapCacheSet;
  9231. /*------------------------------------------------------------------------*/
  9232. /**
  9233. *
  9234. * Creates an array cache object to store unique values.
  9235. *
  9236. * @private
  9237. * @constructor
  9238. * @param {Array} [values] The values to cache.
  9239. */
  9240. function SetCache(values) {
  9241. var index = -1,
  9242. length = values == null ? 0 : values.length;
  9243. this.__data__ = new MapCache;
  9244. while (++index < length) {
  9245. this.add(values[index]);
  9246. }
  9247. }
  9248. /**
  9249. * Adds `value` to the array cache.
  9250. *
  9251. * @private
  9252. * @name add
  9253. * @memberOf SetCache
  9254. * @alias push
  9255. * @param {*} value The value to cache.
  9256. * @returns {Object} Returns the cache instance.
  9257. */
  9258. function setCacheAdd(value) {
  9259. this.__data__.set(value, HASH_UNDEFINED);
  9260. return this;
  9261. }
  9262. /**
  9263. * Checks if `value` is in the array cache.
  9264. *
  9265. * @private
  9266. * @name has
  9267. * @memberOf SetCache
  9268. * @param {*} value The value to search for.
  9269. * @returns {number} Returns `true` if `value` is found, else `false`.
  9270. */
  9271. function setCacheHas(value) {
  9272. return this.__data__.has(value);
  9273. }
  9274. // Add methods to `SetCache`.
  9275. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  9276. SetCache.prototype.has = setCacheHas;
  9277. /*------------------------------------------------------------------------*/
  9278. /**
  9279. * Creates a stack cache object to store key-value pairs.
  9280. *
  9281. * @private
  9282. * @constructor
  9283. * @param {Array} [entries] The key-value pairs to cache.
  9284. */
  9285. function Stack(entries) {
  9286. var data = this.__data__ = new ListCache(entries);
  9287. this.size = data.size;
  9288. }
  9289. /**
  9290. * Removes all key-value entries from the stack.
  9291. *
  9292. * @private
  9293. * @name clear
  9294. * @memberOf Stack
  9295. */
  9296. function stackClear() {
  9297. this.__data__ = new ListCache;
  9298. this.size = 0;
  9299. }
  9300. /**
  9301. * Removes `key` and its value from the stack.
  9302. *
  9303. * @private
  9304. * @name delete
  9305. * @memberOf Stack
  9306. * @param {string} key The key of the value to remove.
  9307. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  9308. */
  9309. function stackDelete(key) {
  9310. var data = this.__data__,
  9311. result = data['delete'](key);
  9312. this.size = data.size;
  9313. return result;
  9314. }
  9315. /**
  9316. * Gets the stack value for `key`.
  9317. *
  9318. * @private
  9319. * @name get
  9320. * @memberOf Stack
  9321. * @param {string} key The key of the value to get.
  9322. * @returns {*} Returns the entry value.
  9323. */
  9324. function stackGet(key) {
  9325. return this.__data__.get(key);
  9326. }
  9327. /**
  9328. * Checks if a stack value for `key` exists.
  9329. *
  9330. * @private
  9331. * @name has
  9332. * @memberOf Stack
  9333. * @param {string} key The key of the entry to check.
  9334. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  9335. */
  9336. function stackHas(key) {
  9337. return this.__data__.has(key);
  9338. }
  9339. /**
  9340. * Sets the stack `key` to `value`.
  9341. *
  9342. * @private
  9343. * @name set
  9344. * @memberOf Stack
  9345. * @param {string} key The key of the value to set.
  9346. * @param {*} value The value to set.
  9347. * @returns {Object} Returns the stack cache instance.
  9348. */
  9349. function stackSet(key, value) {
  9350. var data = this.__data__;
  9351. if (data instanceof ListCache) {
  9352. var pairs = data.__data__;
  9353. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  9354. pairs.push([key, value]);
  9355. this.size = ++data.size;
  9356. return this;
  9357. }
  9358. data = this.__data__ = new MapCache(pairs);
  9359. }
  9360. data.set(key, value);
  9361. this.size = data.size;
  9362. return this;
  9363. }
  9364. // Add methods to `Stack`.
  9365. Stack.prototype.clear = stackClear;
  9366. Stack.prototype['delete'] = stackDelete;
  9367. Stack.prototype.get = stackGet;
  9368. Stack.prototype.has = stackHas;
  9369. Stack.prototype.set = stackSet;
  9370. /*------------------------------------------------------------------------*/
  9371. /**
  9372. * Creates an array of the enumerable property names of the array-like `value`.
  9373. *
  9374. * @private
  9375. * @param {*} value The value to query.
  9376. * @param {boolean} inherited Specify returning inherited property names.
  9377. * @returns {Array} Returns the array of property names.
  9378. */
  9379. function arrayLikeKeys(value, inherited) {
  9380. var isArr = isArray(value),
  9381. isArg = !isArr && isArguments(value),
  9382. isBuff = !isArr && !isArg && isBuffer(value),
  9383. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  9384. skipIndexes = isArr || isArg || isBuff || isType,
  9385. result = skipIndexes ? baseTimes(value.length, String) : [],
  9386. length = result.length;
  9387. for (var key in value) {
  9388. if ((inherited || hasOwnProperty.call(value, key)) &&
  9389. !(skipIndexes && (
  9390. // Safari 9 has enumerable `arguments.length` in strict mode.
  9391. key == 'length' ||
  9392. // Node.js 0.10 has enumerable non-index properties on buffers.
  9393. (isBuff && (key == 'offset' || key == 'parent')) ||
  9394. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  9395. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  9396. // Skip index properties.
  9397. isIndex(key, length)
  9398. ))) {
  9399. result.push(key);
  9400. }
  9401. }
  9402. return result;
  9403. }
  9404. /**
  9405. * A specialized version of `_.sample` for arrays.
  9406. *
  9407. * @private
  9408. * @param {Array} array The array to sample.
  9409. * @returns {*} Returns the random element.
  9410. */
  9411. function arraySample(array) {
  9412. var length = array.length;
  9413. return length ? array[baseRandom(0, length - 1)] : undefined;
  9414. }
  9415. /**
  9416. * A specialized version of `_.sampleSize` for arrays.
  9417. *
  9418. * @private
  9419. * @param {Array} array The array to sample.
  9420. * @param {number} n The number of elements to sample.
  9421. * @returns {Array} Returns the random elements.
  9422. */
  9423. function arraySampleSize(array, n) {
  9424. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  9425. }
  9426. /**
  9427. * A specialized version of `_.shuffle` for arrays.
  9428. *
  9429. * @private
  9430. * @param {Array} array The array to shuffle.
  9431. * @returns {Array} Returns the new shuffled array.
  9432. */
  9433. function arrayShuffle(array) {
  9434. return shuffleSelf(copyArray(array));
  9435. }
  9436. /**
  9437. * This function is like `assignValue` except that it doesn't assign
  9438. * `undefined` values.
  9439. *
  9440. * @private
  9441. * @param {Object} object The object to modify.
  9442. * @param {string} key The key of the property to assign.
  9443. * @param {*} value The value to assign.
  9444. */
  9445. function assignMergeValue(object, key, value) {
  9446. if ((value !== undefined && !eq(object[key], value)) ||
  9447. (value === undefined && !(key in object))) {
  9448. baseAssignValue(object, key, value);
  9449. }
  9450. }
  9451. /**
  9452. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  9453. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9454. * for equality comparisons.
  9455. *
  9456. * @private
  9457. * @param {Object} object The object to modify.
  9458. * @param {string} key The key of the property to assign.
  9459. * @param {*} value The value to assign.
  9460. */
  9461. function assignValue(object, key, value) {
  9462. var objValue = object[key];
  9463. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  9464. (value === undefined && !(key in object))) {
  9465. baseAssignValue(object, key, value);
  9466. }
  9467. }
  9468. /**
  9469. * Gets the index at which the `key` is found in `array` of key-value pairs.
  9470. *
  9471. * @private
  9472. * @param {Array} array The array to inspect.
  9473. * @param {*} key The key to search for.
  9474. * @returns {number} Returns the index of the matched value, else `-1`.
  9475. */
  9476. function assocIndexOf(array, key) {
  9477. var length = array.length;
  9478. while (length--) {
  9479. if (eq(array[length][0], key)) {
  9480. return length;
  9481. }
  9482. }
  9483. return -1;
  9484. }
  9485. /**
  9486. * Aggregates elements of `collection` on `accumulator` with keys transformed
  9487. * by `iteratee` and values set by `setter`.
  9488. *
  9489. * @private
  9490. * @param {Array|Object} collection The collection to iterate over.
  9491. * @param {Function} setter The function to set `accumulator` values.
  9492. * @param {Function} iteratee The iteratee to transform keys.
  9493. * @param {Object} accumulator The initial aggregated object.
  9494. * @returns {Function} Returns `accumulator`.
  9495. */
  9496. function baseAggregator(collection, setter, iteratee, accumulator) {
  9497. baseEach(collection, function(value, key, collection) {
  9498. setter(accumulator, value, iteratee(value), collection);
  9499. });
  9500. return accumulator;
  9501. }
  9502. /**
  9503. * The base implementation of `_.assign` without support for multiple sources
  9504. * or `customizer` functions.
  9505. *
  9506. * @private
  9507. * @param {Object} object The destination object.
  9508. * @param {Object} source The source object.
  9509. * @returns {Object} Returns `object`.
  9510. */
  9511. function baseAssign(object, source) {
  9512. return object && copyObject(source, keys(source), object);
  9513. }
  9514. /**
  9515. * The base implementation of `_.assignIn` without support for multiple sources
  9516. * or `customizer` functions.
  9517. *
  9518. * @private
  9519. * @param {Object} object The destination object.
  9520. * @param {Object} source The source object.
  9521. * @returns {Object} Returns `object`.
  9522. */
  9523. function baseAssignIn(object, source) {
  9524. return object && copyObject(source, keysIn(source), object);
  9525. }
  9526. /**
  9527. * The base implementation of `assignValue` and `assignMergeValue` without
  9528. * value checks.
  9529. *
  9530. * @private
  9531. * @param {Object} object The object to modify.
  9532. * @param {string} key The key of the property to assign.
  9533. * @param {*} value The value to assign.
  9534. */
  9535. function baseAssignValue(object, key, value) {
  9536. if (key == '__proto__' && defineProperty) {
  9537. defineProperty(object, key, {
  9538. 'configurable': true,
  9539. 'enumerable': true,
  9540. 'value': value,
  9541. 'writable': true
  9542. });
  9543. } else {
  9544. object[key] = value;
  9545. }
  9546. }
  9547. /**
  9548. * The base implementation of `_.at` without support for individual paths.
  9549. *
  9550. * @private
  9551. * @param {Object} object The object to iterate over.
  9552. * @param {string[]} paths The property paths to pick.
  9553. * @returns {Array} Returns the picked elements.
  9554. */
  9555. function baseAt(object, paths) {
  9556. var index = -1,
  9557. length = paths.length,
  9558. result = Array(length),
  9559. skip = object == null;
  9560. while (++index < length) {
  9561. result[index] = skip ? undefined : get(object, paths[index]);
  9562. }
  9563. return result;
  9564. }
  9565. /**
  9566. * The base implementation of `_.clamp` which doesn't coerce arguments.
  9567. *
  9568. * @private
  9569. * @param {number} number The number to clamp.
  9570. * @param {number} [lower] The lower bound.
  9571. * @param {number} upper The upper bound.
  9572. * @returns {number} Returns the clamped number.
  9573. */
  9574. function baseClamp(number, lower, upper) {
  9575. if (number === number) {
  9576. if (upper !== undefined) {
  9577. number = number <= upper ? number : upper;
  9578. }
  9579. if (lower !== undefined) {
  9580. number = number >= lower ? number : lower;
  9581. }
  9582. }
  9583. return number;
  9584. }
  9585. /**
  9586. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  9587. * traversed objects.
  9588. *
  9589. * @private
  9590. * @param {*} value The value to clone.
  9591. * @param {boolean} bitmask The bitmask flags.
  9592. * 1 - Deep clone
  9593. * 2 - Flatten inherited properties
  9594. * 4 - Clone symbols
  9595. * @param {Function} [customizer] The function to customize cloning.
  9596. * @param {string} [key] The key of `value`.
  9597. * @param {Object} [object] The parent object of `value`.
  9598. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  9599. * @returns {*} Returns the cloned value.
  9600. */
  9601. function baseClone(value, bitmask, customizer, key, object, stack) {
  9602. var result,
  9603. isDeep = bitmask & CLONE_DEEP_FLAG,
  9604. isFlat = bitmask & CLONE_FLAT_FLAG,
  9605. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  9606. if (customizer) {
  9607. result = object ? customizer(value, key, object, stack) : customizer(value);
  9608. }
  9609. if (result !== undefined) {
  9610. return result;
  9611. }
  9612. if (!isObject(value)) {
  9613. return value;
  9614. }
  9615. var isArr = isArray(value);
  9616. if (isArr) {
  9617. result = initCloneArray(value);
  9618. if (!isDeep) {
  9619. return copyArray(value, result);
  9620. }
  9621. } else {
  9622. var tag = getTag(value),
  9623. isFunc = tag == funcTag || tag == genTag;
  9624. if (isBuffer(value)) {
  9625. return cloneBuffer(value, isDeep);
  9626. }
  9627. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  9628. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  9629. if (!isDeep) {
  9630. return isFlat
  9631. ? copySymbolsIn(value, baseAssignIn(result, value))
  9632. : copySymbols(value, baseAssign(result, value));
  9633. }
  9634. } else {
  9635. if (!cloneableTags[tag]) {
  9636. return object ? value : {};
  9637. }
  9638. result = initCloneByTag(value, tag, isDeep);
  9639. }
  9640. }
  9641. // Check for circular references and return its corresponding clone.
  9642. stack || (stack = new Stack);
  9643. var stacked = stack.get(value);
  9644. if (stacked) {
  9645. return stacked;
  9646. }
  9647. stack.set(value, result);
  9648. if (isSet(value)) {
  9649. value.forEach(function(subValue) {
  9650. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  9651. });
  9652. return result;
  9653. }
  9654. if (isMap(value)) {
  9655. value.forEach(function(subValue, key) {
  9656. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  9657. });
  9658. return result;
  9659. }
  9660. var keysFunc = isFull
  9661. ? (isFlat ? getAllKeysIn : getAllKeys)
  9662. : (isFlat ? keysIn : keys);
  9663. var props = isArr ? undefined : keysFunc(value);
  9664. arrayEach(props || value, function(subValue, key) {
  9665. if (props) {
  9666. key = subValue;
  9667. subValue = value[key];
  9668. }
  9669. // Recursively populate clone (susceptible to call stack limits).
  9670. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  9671. });
  9672. return result;
  9673. }
  9674. /**
  9675. * The base implementation of `_.conforms` which doesn't clone `source`.
  9676. *
  9677. * @private
  9678. * @param {Object} source The object of property predicates to conform to.
  9679. * @returns {Function} Returns the new spec function.
  9680. */
  9681. function baseConforms(source) {
  9682. var props = keys(source);
  9683. return function(object) {
  9684. return baseConformsTo(object, source, props);
  9685. };
  9686. }
  9687. /**
  9688. * The base implementation of `_.conformsTo` which accepts `props` to check.
  9689. *
  9690. * @private
  9691. * @param {Object} object The object to inspect.
  9692. * @param {Object} source The object of property predicates to conform to.
  9693. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  9694. */
  9695. function baseConformsTo(object, source, props) {
  9696. var length = props.length;
  9697. if (object == null) {
  9698. return !length;
  9699. }
  9700. object = Object(object);
  9701. while (length--) {
  9702. var key = props[length],
  9703. predicate = source[key],
  9704. value = object[key];
  9705. if ((value === undefined && !(key in object)) || !predicate(value)) {
  9706. return false;
  9707. }
  9708. }
  9709. return true;
  9710. }
  9711. /**
  9712. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  9713. * to provide to `func`.
  9714. *
  9715. * @private
  9716. * @param {Function} func The function to delay.
  9717. * @param {number} wait The number of milliseconds to delay invocation.
  9718. * @param {Array} args The arguments to provide to `func`.
  9719. * @returns {number|Object} Returns the timer id or timeout object.
  9720. */
  9721. function baseDelay(func, wait, args) {
  9722. if (typeof func != 'function') {
  9723. throw new TypeError(FUNC_ERROR_TEXT);
  9724. }
  9725. return setTimeout(function() { func.apply(undefined, args); }, wait);
  9726. }
  9727. /**
  9728. * The base implementation of methods like `_.difference` without support
  9729. * for excluding multiple arrays or iteratee shorthands.
  9730. *
  9731. * @private
  9732. * @param {Array} array The array to inspect.
  9733. * @param {Array} values The values to exclude.
  9734. * @param {Function} [iteratee] The iteratee invoked per element.
  9735. * @param {Function} [comparator] The comparator invoked per element.
  9736. * @returns {Array} Returns the new array of filtered values.
  9737. */
  9738. function baseDifference(array, values, iteratee, comparator) {
  9739. var index = -1,
  9740. includes = arrayIncludes,
  9741. isCommon = true,
  9742. length = array.length,
  9743. result = [],
  9744. valuesLength = values.length;
  9745. if (!length) {
  9746. return result;
  9747. }
  9748. if (iteratee) {
  9749. values = arrayMap(values, baseUnary(iteratee));
  9750. }
  9751. if (comparator) {
  9752. includes = arrayIncludesWith;
  9753. isCommon = false;
  9754. }
  9755. else if (values.length >= LARGE_ARRAY_SIZE) {
  9756. includes = cacheHas;
  9757. isCommon = false;
  9758. values = new SetCache(values);
  9759. }
  9760. outer:
  9761. while (++index < length) {
  9762. var value = array[index],
  9763. computed = iteratee == null ? value : iteratee(value);
  9764. value = (comparator || value !== 0) ? value : 0;
  9765. if (isCommon && computed === computed) {
  9766. var valuesIndex = valuesLength;
  9767. while (valuesIndex--) {
  9768. if (values[valuesIndex] === computed) {
  9769. continue outer;
  9770. }
  9771. }
  9772. result.push(value);
  9773. }
  9774. else if (!includes(values, computed, comparator)) {
  9775. result.push(value);
  9776. }
  9777. }
  9778. return result;
  9779. }
  9780. /**
  9781. * The base implementation of `_.forEach` without support for iteratee shorthands.
  9782. *
  9783. * @private
  9784. * @param {Array|Object} collection The collection to iterate over.
  9785. * @param {Function} iteratee The function invoked per iteration.
  9786. * @returns {Array|Object} Returns `collection`.
  9787. */
  9788. var baseEach = createBaseEach(baseForOwn);
  9789. /**
  9790. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  9791. *
  9792. * @private
  9793. * @param {Array|Object} collection The collection to iterate over.
  9794. * @param {Function} iteratee The function invoked per iteration.
  9795. * @returns {Array|Object} Returns `collection`.
  9796. */
  9797. var baseEachRight = createBaseEach(baseForOwnRight, true);
  9798. /**
  9799. * The base implementation of `_.every` without support for iteratee shorthands.
  9800. *
  9801. * @private
  9802. * @param {Array|Object} collection The collection to iterate over.
  9803. * @param {Function} predicate The function invoked per iteration.
  9804. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9805. * else `false`
  9806. */
  9807. function baseEvery(collection, predicate) {
  9808. var result = true;
  9809. baseEach(collection, function(value, index, collection) {
  9810. result = !!predicate(value, index, collection);
  9811. return result;
  9812. });
  9813. return result;
  9814. }
  9815. /**
  9816. * The base implementation of methods like `_.max` and `_.min` which accepts a
  9817. * `comparator` to determine the extremum value.
  9818. *
  9819. * @private
  9820. * @param {Array} array The array to iterate over.
  9821. * @param {Function} iteratee The iteratee invoked per iteration.
  9822. * @param {Function} comparator The comparator used to compare values.
  9823. * @returns {*} Returns the extremum value.
  9824. */
  9825. function baseExtremum(array, iteratee, comparator) {
  9826. var index = -1,
  9827. length = array.length;
  9828. while (++index < length) {
  9829. var value = array[index],
  9830. current = iteratee(value);
  9831. if (current != null && (computed === undefined
  9832. ? (current === current && !isSymbol(current))
  9833. : comparator(current, computed)
  9834. )) {
  9835. var computed = current,
  9836. result = value;
  9837. }
  9838. }
  9839. return result;
  9840. }
  9841. /**
  9842. * The base implementation of `_.fill` without an iteratee call guard.
  9843. *
  9844. * @private
  9845. * @param {Array} array The array to fill.
  9846. * @param {*} value The value to fill `array` with.
  9847. * @param {number} [start=0] The start position.
  9848. * @param {number} [end=array.length] The end position.
  9849. * @returns {Array} Returns `array`.
  9850. */
  9851. function baseFill(array, value, start, end) {
  9852. var length = array.length;
  9853. start = toInteger(start);
  9854. if (start < 0) {
  9855. start = -start > length ? 0 : (length + start);
  9856. }
  9857. end = (end === undefined || end > length) ? length : toInteger(end);
  9858. if (end < 0) {
  9859. end += length;
  9860. }
  9861. end = start > end ? 0 : toLength(end);
  9862. while (start < end) {
  9863. array[start++] = value;
  9864. }
  9865. return array;
  9866. }
  9867. /**
  9868. * The base implementation of `_.filter` without support for iteratee shorthands.
  9869. *
  9870. * @private
  9871. * @param {Array|Object} collection The collection to iterate over.
  9872. * @param {Function} predicate The function invoked per iteration.
  9873. * @returns {Array} Returns the new filtered array.
  9874. */
  9875. function baseFilter(collection, predicate) {
  9876. var result = [];
  9877. baseEach(collection, function(value, index, collection) {
  9878. if (predicate(value, index, collection)) {
  9879. result.push(value);
  9880. }
  9881. });
  9882. return result;
  9883. }
  9884. /**
  9885. * The base implementation of `_.flatten` with support for restricting flattening.
  9886. *
  9887. * @private
  9888. * @param {Array} array The array to flatten.
  9889. * @param {number} depth The maximum recursion depth.
  9890. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  9891. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  9892. * @param {Array} [result=[]] The initial result value.
  9893. * @returns {Array} Returns the new flattened array.
  9894. */
  9895. function baseFlatten(array, depth, predicate, isStrict, result) {
  9896. var index = -1,
  9897. length = array.length;
  9898. predicate || (predicate = isFlattenable);
  9899. result || (result = []);
  9900. while (++index < length) {
  9901. var value = array[index];
  9902. if (depth > 0 && predicate(value)) {
  9903. if (depth > 1) {
  9904. // Recursively flatten arrays (susceptible to call stack limits).
  9905. baseFlatten(value, depth - 1, predicate, isStrict, result);
  9906. } else {
  9907. arrayPush(result, value);
  9908. }
  9909. } else if (!isStrict) {
  9910. result[result.length] = value;
  9911. }
  9912. }
  9913. return result;
  9914. }
  9915. /**
  9916. * The base implementation of `baseForOwn` which iterates over `object`
  9917. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  9918. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9919. *
  9920. * @private
  9921. * @param {Object} object The object to iterate over.
  9922. * @param {Function} iteratee The function invoked per iteration.
  9923. * @param {Function} keysFunc The function to get the keys of `object`.
  9924. * @returns {Object} Returns `object`.
  9925. */
  9926. var baseFor = createBaseFor();
  9927. /**
  9928. * This function is like `baseFor` except that it iterates over properties
  9929. * in the opposite order.
  9930. *
  9931. * @private
  9932. * @param {Object} object The object to iterate over.
  9933. * @param {Function} iteratee The function invoked per iteration.
  9934. * @param {Function} keysFunc The function to get the keys of `object`.
  9935. * @returns {Object} Returns `object`.
  9936. */
  9937. var baseForRight = createBaseFor(true);
  9938. /**
  9939. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  9940. *
  9941. * @private
  9942. * @param {Object} object The object to iterate over.
  9943. * @param {Function} iteratee The function invoked per iteration.
  9944. * @returns {Object} Returns `object`.
  9945. */
  9946. function baseForOwn(object, iteratee) {
  9947. return object && baseFor(object, iteratee, keys);
  9948. }
  9949. /**
  9950. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  9951. *
  9952. * @private
  9953. * @param {Object} object The object to iterate over.
  9954. * @param {Function} iteratee The function invoked per iteration.
  9955. * @returns {Object} Returns `object`.
  9956. */
  9957. function baseForOwnRight(object, iteratee) {
  9958. return object && baseForRight(object, iteratee, keys);
  9959. }
  9960. /**
  9961. * The base implementation of `_.functions` which creates an array of
  9962. * `object` function property names filtered from `props`.
  9963. *
  9964. * @private
  9965. * @param {Object} object The object to inspect.
  9966. * @param {Array} props The property names to filter.
  9967. * @returns {Array} Returns the function names.
  9968. */
  9969. function baseFunctions(object, props) {
  9970. return arrayFilter(props, function(key) {
  9971. return isFunction(object[key]);
  9972. });
  9973. }
  9974. /**
  9975. * The base implementation of `_.get` without support for default values.
  9976. *
  9977. * @private
  9978. * @param {Object} object The object to query.
  9979. * @param {Array|string} path The path of the property to get.
  9980. * @returns {*} Returns the resolved value.
  9981. */
  9982. function baseGet(object, path) {
  9983. path = castPath(path, object);
  9984. var index = 0,
  9985. length = path.length;
  9986. while (object != null && index < length) {
  9987. object = object[toKey(path[index++])];
  9988. }
  9989. return (index && index == length) ? object : undefined;
  9990. }
  9991. /**
  9992. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  9993. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  9994. * symbols of `object`.
  9995. *
  9996. * @private
  9997. * @param {Object} object The object to query.
  9998. * @param {Function} keysFunc The function to get the keys of `object`.
  9999. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  10000. * @returns {Array} Returns the array of property names and symbols.
  10001. */
  10002. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  10003. var result = keysFunc(object);
  10004. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  10005. }
  10006. /**
  10007. * The base implementation of `getTag` without fallbacks for buggy environments.
  10008. *
  10009. * @private
  10010. * @param {*} value The value to query.
  10011. * @returns {string} Returns the `toStringTag`.
  10012. */
  10013. function baseGetTag(value) {
  10014. if (value == null) {
  10015. return value === undefined ? undefinedTag : nullTag;
  10016. }
  10017. return (symToStringTag && symToStringTag in Object(value))
  10018. ? getRawTag(value)
  10019. : objectToString(value);
  10020. }
  10021. /**
  10022. * The base implementation of `_.gt` which doesn't coerce arguments.
  10023. *
  10024. * @private
  10025. * @param {*} value The value to compare.
  10026. * @param {*} other The other value to compare.
  10027. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  10028. * else `false`.
  10029. */
  10030. function baseGt(value, other) {
  10031. return value > other;
  10032. }
  10033. /**
  10034. * The base implementation of `_.has` without support for deep paths.
  10035. *
  10036. * @private
  10037. * @param {Object} [object] The object to query.
  10038. * @param {Array|string} key The key to check.
  10039. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  10040. */
  10041. function baseHas(object, key) {
  10042. return object != null && hasOwnProperty.call(object, key);
  10043. }
  10044. /**
  10045. * The base implementation of `_.hasIn` without support for deep paths.
  10046. *
  10047. * @private
  10048. * @param {Object} [object] The object to query.
  10049. * @param {Array|string} key The key to check.
  10050. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  10051. */
  10052. function baseHasIn(object, key) {
  10053. return object != null && key in Object(object);
  10054. }
  10055. /**
  10056. * The base implementation of `_.inRange` which doesn't coerce arguments.
  10057. *
  10058. * @private
  10059. * @param {number} number The number to check.
  10060. * @param {number} start The start of the range.
  10061. * @param {number} end The end of the range.
  10062. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  10063. */
  10064. function baseInRange(number, start, end) {
  10065. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  10066. }
  10067. /**
  10068. * The base implementation of methods like `_.intersection`, without support
  10069. * for iteratee shorthands, that accepts an array of arrays to inspect.
  10070. *
  10071. * @private
  10072. * @param {Array} arrays The arrays to inspect.
  10073. * @param {Function} [iteratee] The iteratee invoked per element.
  10074. * @param {Function} [comparator] The comparator invoked per element.
  10075. * @returns {Array} Returns the new array of shared values.
  10076. */
  10077. function baseIntersection(arrays, iteratee, comparator) {
  10078. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  10079. length = arrays[0].length,
  10080. othLength = arrays.length,
  10081. othIndex = othLength,
  10082. caches = Array(othLength),
  10083. maxLength = Infinity,
  10084. result = [];
  10085. while (othIndex--) {
  10086. var array = arrays[othIndex];
  10087. if (othIndex && iteratee) {
  10088. array = arrayMap(array, baseUnary(iteratee));
  10089. }
  10090. maxLength = nativeMin(array.length, maxLength);
  10091. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  10092. ? new SetCache(othIndex && array)
  10093. : undefined;
  10094. }
  10095. array = arrays[0];
  10096. var index = -1,
  10097. seen = caches[0];
  10098. outer:
  10099. while (++index < length && result.length < maxLength) {
  10100. var value = array[index],
  10101. computed = iteratee ? iteratee(value) : value;
  10102. value = (comparator || value !== 0) ? value : 0;
  10103. if (!(seen
  10104. ? cacheHas(seen, computed)
  10105. : includes(result, computed, comparator)
  10106. )) {
  10107. othIndex = othLength;
  10108. while (--othIndex) {
  10109. var cache = caches[othIndex];
  10110. if (!(cache
  10111. ? cacheHas(cache, computed)
  10112. : includes(arrays[othIndex], computed, comparator))
  10113. ) {
  10114. continue outer;
  10115. }
  10116. }
  10117. if (seen) {
  10118. seen.push(computed);
  10119. }
  10120. result.push(value);
  10121. }
  10122. }
  10123. return result;
  10124. }
  10125. /**
  10126. * The base implementation of `_.invert` and `_.invertBy` which inverts
  10127. * `object` with values transformed by `iteratee` and set by `setter`.
  10128. *
  10129. * @private
  10130. * @param {Object} object The object to iterate over.
  10131. * @param {Function} setter The function to set `accumulator` values.
  10132. * @param {Function} iteratee The iteratee to transform values.
  10133. * @param {Object} accumulator The initial inverted object.
  10134. * @returns {Function} Returns `accumulator`.
  10135. */
  10136. function baseInverter(object, setter, iteratee, accumulator) {
  10137. baseForOwn(object, function(value, key, object) {
  10138. setter(accumulator, iteratee(value), key, object);
  10139. });
  10140. return accumulator;
  10141. }
  10142. /**
  10143. * The base implementation of `_.invoke` without support for individual
  10144. * method arguments.
  10145. *
  10146. * @private
  10147. * @param {Object} object The object to query.
  10148. * @param {Array|string} path The path of the method to invoke.
  10149. * @param {Array} args The arguments to invoke the method with.
  10150. * @returns {*} Returns the result of the invoked method.
  10151. */
  10152. function baseInvoke(object, path, args) {
  10153. path = castPath(path, object);
  10154. object = parent(object, path);
  10155. var func = object == null ? object : object[toKey(last(path))];
  10156. return func == null ? undefined : apply(func, object, args);
  10157. }
  10158. /**
  10159. * The base implementation of `_.isArguments`.
  10160. *
  10161. * @private
  10162. * @param {*} value The value to check.
  10163. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  10164. */
  10165. function baseIsArguments(value) {
  10166. return isObjectLike(value) && baseGetTag(value) == argsTag;
  10167. }
  10168. /**
  10169. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  10170. *
  10171. * @private
  10172. * @param {*} value The value to check.
  10173. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  10174. */
  10175. function baseIsArrayBuffer(value) {
  10176. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  10177. }
  10178. /**
  10179. * The base implementation of `_.isDate` without Node.js optimizations.
  10180. *
  10181. * @private
  10182. * @param {*} value The value to check.
  10183. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  10184. */
  10185. function baseIsDate(value) {
  10186. return isObjectLike(value) && baseGetTag(value) == dateTag;
  10187. }
  10188. /**
  10189. * The base implementation of `_.isEqual` which supports partial comparisons
  10190. * and tracks traversed objects.
  10191. *
  10192. * @private
  10193. * @param {*} value The value to compare.
  10194. * @param {*} other The other value to compare.
  10195. * @param {boolean} bitmask The bitmask flags.
  10196. * 1 - Unordered comparison
  10197. * 2 - Partial comparison
  10198. * @param {Function} [customizer] The function to customize comparisons.
  10199. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  10200. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  10201. */
  10202. function baseIsEqual(value, other, bitmask, customizer, stack) {
  10203. if (value === other) {
  10204. return true;
  10205. }
  10206. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  10207. return value !== value && other !== other;
  10208. }
  10209. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  10210. }
  10211. /**
  10212. * A specialized version of `baseIsEqual` for arrays and objects which performs
  10213. * deep comparisons and tracks traversed objects enabling objects with circular
  10214. * references to be compared.
  10215. *
  10216. * @private
  10217. * @param {Object} object The object to compare.
  10218. * @param {Object} other The other object to compare.
  10219. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  10220. * @param {Function} customizer The function to customize comparisons.
  10221. * @param {Function} equalFunc The function to determine equivalents of values.
  10222. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  10223. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  10224. */
  10225. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  10226. var objIsArr = isArray(object),
  10227. othIsArr = isArray(other),
  10228. objTag = objIsArr ? arrayTag : getTag(object),
  10229. othTag = othIsArr ? arrayTag : getTag(other);
  10230. objTag = objTag == argsTag ? objectTag : objTag;
  10231. othTag = othTag == argsTag ? objectTag : othTag;
  10232. var objIsObj = objTag == objectTag,
  10233. othIsObj = othTag == objectTag,
  10234. isSameTag = objTag == othTag;
  10235. if (isSameTag && isBuffer(object)) {
  10236. if (!isBuffer(other)) {
  10237. return false;
  10238. }
  10239. objIsArr = true;
  10240. objIsObj = false;
  10241. }
  10242. if (isSameTag && !objIsObj) {
  10243. stack || (stack = new Stack);
  10244. return (objIsArr || isTypedArray(object))
  10245. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  10246. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  10247. }
  10248. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  10249. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  10250. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  10251. if (objIsWrapped || othIsWrapped) {
  10252. var objUnwrapped = objIsWrapped ? object.value() : object,
  10253. othUnwrapped = othIsWrapped ? other.value() : other;
  10254. stack || (stack = new Stack);
  10255. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  10256. }
  10257. }
  10258. if (!isSameTag) {
  10259. return false;
  10260. }
  10261. stack || (stack = new Stack);
  10262. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  10263. }
  10264. /**
  10265. * The base implementation of `_.isMap` without Node.js optimizations.
  10266. *
  10267. * @private
  10268. * @param {*} value The value to check.
  10269. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  10270. */
  10271. function baseIsMap(value) {
  10272. return isObjectLike(value) && getTag(value) == mapTag;
  10273. }
  10274. /**
  10275. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  10276. *
  10277. * @private
  10278. * @param {Object} object The object to inspect.
  10279. * @param {Object} source The object of property values to match.
  10280. * @param {Array} matchData The property names, values, and compare flags to match.
  10281. * @param {Function} [customizer] The function to customize comparisons.
  10282. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  10283. */
  10284. function baseIsMatch(object, source, matchData, customizer) {
  10285. var index = matchData.length,
  10286. length = index,
  10287. noCustomizer = !customizer;
  10288. if (object == null) {
  10289. return !length;
  10290. }
  10291. object = Object(object);
  10292. while (index--) {
  10293. var data = matchData[index];
  10294. if ((noCustomizer && data[2])
  10295. ? data[1] !== object[data[0]]
  10296. : !(data[0] in object)
  10297. ) {
  10298. return false;
  10299. }
  10300. }
  10301. while (++index < length) {
  10302. data = matchData[index];
  10303. var key = data[0],
  10304. objValue = object[key],
  10305. srcValue = data[1];
  10306. if (noCustomizer && data[2]) {
  10307. if (objValue === undefined && !(key in object)) {
  10308. return false;
  10309. }
  10310. } else {
  10311. var stack = new Stack;
  10312. if (customizer) {
  10313. var result = customizer(objValue, srcValue, key, object, source, stack);
  10314. }
  10315. if (!(result === undefined
  10316. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  10317. : result
  10318. )) {
  10319. return false;
  10320. }
  10321. }
  10322. }
  10323. return true;
  10324. }
  10325. /**
  10326. * The base implementation of `_.isNative` without bad shim checks.
  10327. *
  10328. * @private
  10329. * @param {*} value The value to check.
  10330. * @returns {boolean} Returns `true` if `value` is a native function,
  10331. * else `false`.
  10332. */
  10333. function baseIsNative(value) {
  10334. if (!isObject(value) || isMasked(value)) {
  10335. return false;
  10336. }
  10337. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  10338. return pattern.test(toSource(value));
  10339. }
  10340. /**
  10341. * The base implementation of `_.isRegExp` without Node.js optimizations.
  10342. *
  10343. * @private
  10344. * @param {*} value The value to check.
  10345. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  10346. */
  10347. function baseIsRegExp(value) {
  10348. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  10349. }
  10350. /**
  10351. * The base implementation of `_.isSet` without Node.js optimizations.
  10352. *
  10353. * @private
  10354. * @param {*} value The value to check.
  10355. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  10356. */
  10357. function baseIsSet(value) {
  10358. return isObjectLike(value) && getTag(value) == setTag;
  10359. }
  10360. /**
  10361. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  10362. *
  10363. * @private
  10364. * @param {*} value The value to check.
  10365. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  10366. */
  10367. function baseIsTypedArray(value) {
  10368. return isObjectLike(value) &&
  10369. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  10370. }
  10371. /**
  10372. * The base implementation of `_.iteratee`.
  10373. *
  10374. * @private
  10375. * @param {*} [value=_.identity] The value to convert to an iteratee.
  10376. * @returns {Function} Returns the iteratee.
  10377. */
  10378. function baseIteratee(value) {
  10379. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  10380. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  10381. if (typeof value == 'function') {
  10382. return value;
  10383. }
  10384. if (value == null) {
  10385. return identity;
  10386. }
  10387. if (typeof value == 'object') {
  10388. return isArray(value)
  10389. ? baseMatchesProperty(value[0], value[1])
  10390. : baseMatches(value);
  10391. }
  10392. return property(value);
  10393. }
  10394. /**
  10395. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  10396. *
  10397. * @private
  10398. * @param {Object} object The object to query.
  10399. * @returns {Array} Returns the array of property names.
  10400. */
  10401. function baseKeys(object) {
  10402. if (!isPrototype(object)) {
  10403. return nativeKeys(object);
  10404. }
  10405. var result = [];
  10406. for (var key in Object(object)) {
  10407. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  10408. result.push(key);
  10409. }
  10410. }
  10411. return result;
  10412. }
  10413. /**
  10414. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  10415. *
  10416. * @private
  10417. * @param {Object} object The object to query.
  10418. * @returns {Array} Returns the array of property names.
  10419. */
  10420. function baseKeysIn(object) {
  10421. if (!isObject(object)) {
  10422. return nativeKeysIn(object);
  10423. }
  10424. var isProto = isPrototype(object),
  10425. result = [];
  10426. for (var key in object) {
  10427. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  10428. result.push(key);
  10429. }
  10430. }
  10431. return result;
  10432. }
  10433. /**
  10434. * The base implementation of `_.lt` which doesn't coerce arguments.
  10435. *
  10436. * @private
  10437. * @param {*} value The value to compare.
  10438. * @param {*} other The other value to compare.
  10439. * @returns {boolean} Returns `true` if `value` is less than `other`,
  10440. * else `false`.
  10441. */
  10442. function baseLt(value, other) {
  10443. return value < other;
  10444. }
  10445. /**
  10446. * The base implementation of `_.map` without support for iteratee shorthands.
  10447. *
  10448. * @private
  10449. * @param {Array|Object} collection The collection to iterate over.
  10450. * @param {Function} iteratee The function invoked per iteration.
  10451. * @returns {Array} Returns the new mapped array.
  10452. */
  10453. function baseMap(collection, iteratee) {
  10454. var index = -1,
  10455. result = isArrayLike(collection) ? Array(collection.length) : [];
  10456. baseEach(collection, function(value, key, collection) {
  10457. result[++index] = iteratee(value, key, collection);
  10458. });
  10459. return result;
  10460. }
  10461. /**
  10462. * The base implementation of `_.matches` which doesn't clone `source`.
  10463. *
  10464. * @private
  10465. * @param {Object} source The object of property values to match.
  10466. * @returns {Function} Returns the new spec function.
  10467. */
  10468. function baseMatches(source) {
  10469. var matchData = getMatchData(source);
  10470. if (matchData.length == 1 && matchData[0][2]) {
  10471. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  10472. }
  10473. return function(object) {
  10474. return object === source || baseIsMatch(object, source, matchData);
  10475. };
  10476. }
  10477. /**
  10478. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  10479. *
  10480. * @private
  10481. * @param {string} path The path of the property to get.
  10482. * @param {*} srcValue The value to match.
  10483. * @returns {Function} Returns the new spec function.
  10484. */
  10485. function baseMatchesProperty(path, srcValue) {
  10486. if (isKey(path) && isStrictComparable(srcValue)) {
  10487. return matchesStrictComparable(toKey(path), srcValue);
  10488. }
  10489. return function(object) {
  10490. var objValue = get(object, path);
  10491. return (objValue === undefined && objValue === srcValue)
  10492. ? hasIn(object, path)
  10493. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  10494. };
  10495. }
  10496. /**
  10497. * The base implementation of `_.merge` without support for multiple sources.
  10498. *
  10499. * @private
  10500. * @param {Object} object The destination object.
  10501. * @param {Object} source The source object.
  10502. * @param {number} srcIndex The index of `source`.
  10503. * @param {Function} [customizer] The function to customize merged values.
  10504. * @param {Object} [stack] Tracks traversed source values and their merged
  10505. * counterparts.
  10506. */
  10507. function baseMerge(object, source, srcIndex, customizer, stack) {
  10508. if (object === source) {
  10509. return;
  10510. }
  10511. baseFor(source, function(srcValue, key) {
  10512. if (isObject(srcValue)) {
  10513. stack || (stack = new Stack);
  10514. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  10515. }
  10516. else {
  10517. var newValue = customizer
  10518. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  10519. : undefined;
  10520. if (newValue === undefined) {
  10521. newValue = srcValue;
  10522. }
  10523. assignMergeValue(object, key, newValue);
  10524. }
  10525. }, keysIn);
  10526. }
  10527. /**
  10528. * A specialized version of `baseMerge` for arrays and objects which performs
  10529. * deep merges and tracks traversed objects enabling objects with circular
  10530. * references to be merged.
  10531. *
  10532. * @private
  10533. * @param {Object} object The destination object.
  10534. * @param {Object} source The source object.
  10535. * @param {string} key The key of the value to merge.
  10536. * @param {number} srcIndex The index of `source`.
  10537. * @param {Function} mergeFunc The function to merge values.
  10538. * @param {Function} [customizer] The function to customize assigned values.
  10539. * @param {Object} [stack] Tracks traversed source values and their merged
  10540. * counterparts.
  10541. */
  10542. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  10543. var objValue = safeGet(object, key),
  10544. srcValue = safeGet(source, key),
  10545. stacked = stack.get(srcValue);
  10546. if (stacked) {
  10547. assignMergeValue(object, key, stacked);
  10548. return;
  10549. }
  10550. var newValue = customizer
  10551. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  10552. : undefined;
  10553. var isCommon = newValue === undefined;
  10554. if (isCommon) {
  10555. var isArr = isArray(srcValue),
  10556. isBuff = !isArr && isBuffer(srcValue),
  10557. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  10558. newValue = srcValue;
  10559. if (isArr || isBuff || isTyped) {
  10560. if (isArray(objValue)) {
  10561. newValue = objValue;
  10562. }
  10563. else if (isArrayLikeObject(objValue)) {
  10564. newValue = copyArray(objValue);
  10565. }
  10566. else if (isBuff) {
  10567. isCommon = false;
  10568. newValue = cloneBuffer(srcValue, true);
  10569. }
  10570. else if (isTyped) {
  10571. isCommon = false;
  10572. newValue = cloneTypedArray(srcValue, true);
  10573. }
  10574. else {
  10575. newValue = [];
  10576. }
  10577. }
  10578. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  10579. newValue = objValue;
  10580. if (isArguments(objValue)) {
  10581. newValue = toPlainObject(objValue);
  10582. }
  10583. else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
  10584. newValue = initCloneObject(srcValue);
  10585. }
  10586. }
  10587. else {
  10588. isCommon = false;
  10589. }
  10590. }
  10591. if (isCommon) {
  10592. // Recursively merge objects and arrays (susceptible to call stack limits).
  10593. stack.set(srcValue, newValue);
  10594. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  10595. stack['delete'](srcValue);
  10596. }
  10597. assignMergeValue(object, key, newValue);
  10598. }
  10599. /**
  10600. * The base implementation of `_.nth` which doesn't coerce arguments.
  10601. *
  10602. * @private
  10603. * @param {Array} array The array to query.
  10604. * @param {number} n The index of the element to return.
  10605. * @returns {*} Returns the nth element of `array`.
  10606. */
  10607. function baseNth(array, n) {
  10608. var length = array.length;
  10609. if (!length) {
  10610. return;
  10611. }
  10612. n += n < 0 ? length : 0;
  10613. return isIndex(n, length) ? array[n] : undefined;
  10614. }
  10615. /**
  10616. * The base implementation of `_.orderBy` without param guards.
  10617. *
  10618. * @private
  10619. * @param {Array|Object} collection The collection to iterate over.
  10620. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  10621. * @param {string[]} orders The sort orders of `iteratees`.
  10622. * @returns {Array} Returns the new sorted array.
  10623. */
  10624. function baseOrderBy(collection, iteratees, orders) {
  10625. var index = -1;
  10626. iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
  10627. var result = baseMap(collection, function(value, key, collection) {
  10628. var criteria = arrayMap(iteratees, function(iteratee) {
  10629. return iteratee(value);
  10630. });
  10631. return { 'criteria': criteria, 'index': ++index, 'value': value };
  10632. });
  10633. return baseSortBy(result, function(object, other) {
  10634. return compareMultiple(object, other, orders);
  10635. });
  10636. }
  10637. /**
  10638. * The base implementation of `_.pick` without support for individual
  10639. * property identifiers.
  10640. *
  10641. * @private
  10642. * @param {Object} object The source object.
  10643. * @param {string[]} paths The property paths to pick.
  10644. * @returns {Object} Returns the new object.
  10645. */
  10646. function basePick(object, paths) {
  10647. return basePickBy(object, paths, function(value, path) {
  10648. return hasIn(object, path);
  10649. });
  10650. }
  10651. /**
  10652. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  10653. *
  10654. * @private
  10655. * @param {Object} object The source object.
  10656. * @param {string[]} paths The property paths to pick.
  10657. * @param {Function} predicate The function invoked per property.
  10658. * @returns {Object} Returns the new object.
  10659. */
  10660. function basePickBy(object, paths, predicate) {
  10661. var index = -1,
  10662. length = paths.length,
  10663. result = {};
  10664. while (++index < length) {
  10665. var path = paths[index],
  10666. value = baseGet(object, path);
  10667. if (predicate(value, path)) {
  10668. baseSet(result, castPath(path, object), value);
  10669. }
  10670. }
  10671. return result;
  10672. }
  10673. /**
  10674. * A specialized version of `baseProperty` which supports deep paths.
  10675. *
  10676. * @private
  10677. * @param {Array|string} path The path of the property to get.
  10678. * @returns {Function} Returns the new accessor function.
  10679. */
  10680. function basePropertyDeep(path) {
  10681. return function(object) {
  10682. return baseGet(object, path);
  10683. };
  10684. }
  10685. /**
  10686. * The base implementation of `_.pullAllBy` without support for iteratee
  10687. * shorthands.
  10688. *
  10689. * @private
  10690. * @param {Array} array The array to modify.
  10691. * @param {Array} values The values to remove.
  10692. * @param {Function} [iteratee] The iteratee invoked per element.
  10693. * @param {Function} [comparator] The comparator invoked per element.
  10694. * @returns {Array} Returns `array`.
  10695. */
  10696. function basePullAll(array, values, iteratee, comparator) {
  10697. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  10698. index = -1,
  10699. length = values.length,
  10700. seen = array;
  10701. if (array === values) {
  10702. values = copyArray(values);
  10703. }
  10704. if (iteratee) {
  10705. seen = arrayMap(array, baseUnary(iteratee));
  10706. }
  10707. while (++index < length) {
  10708. var fromIndex = 0,
  10709. value = values[index],
  10710. computed = iteratee ? iteratee(value) : value;
  10711. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  10712. if (seen !== array) {
  10713. splice.call(seen, fromIndex, 1);
  10714. }
  10715. splice.call(array, fromIndex, 1);
  10716. }
  10717. }
  10718. return array;
  10719. }
  10720. /**
  10721. * The base implementation of `_.pullAt` without support for individual
  10722. * indexes or capturing the removed elements.
  10723. *
  10724. * @private
  10725. * @param {Array} array The array to modify.
  10726. * @param {number[]} indexes The indexes of elements to remove.
  10727. * @returns {Array} Returns `array`.
  10728. */
  10729. function basePullAt(array, indexes) {
  10730. var length = array ? indexes.length : 0,
  10731. lastIndex = length - 1;
  10732. while (length--) {
  10733. var index = indexes[length];
  10734. if (length == lastIndex || index !== previous) {
  10735. var previous = index;
  10736. if (isIndex(index)) {
  10737. splice.call(array, index, 1);
  10738. } else {
  10739. baseUnset(array, index);
  10740. }
  10741. }
  10742. }
  10743. return array;
  10744. }
  10745. /**
  10746. * The base implementation of `_.random` without support for returning
  10747. * floating-point numbers.
  10748. *
  10749. * @private
  10750. * @param {number} lower The lower bound.
  10751. * @param {number} upper The upper bound.
  10752. * @returns {number} Returns the random number.
  10753. */
  10754. function baseRandom(lower, upper) {
  10755. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  10756. }
  10757. /**
  10758. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  10759. * coerce arguments.
  10760. *
  10761. * @private
  10762. * @param {number} start The start of the range.
  10763. * @param {number} end The end of the range.
  10764. * @param {number} step The value to increment or decrement by.
  10765. * @param {boolean} [fromRight] Specify iterating from right to left.
  10766. * @returns {Array} Returns the range of numbers.
  10767. */
  10768. function baseRange(start, end, step, fromRight) {
  10769. var index = -1,
  10770. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  10771. result = Array(length);
  10772. while (length--) {
  10773. result[fromRight ? length : ++index] = start;
  10774. start += step;
  10775. }
  10776. return result;
  10777. }
  10778. /**
  10779. * The base implementation of `_.repeat` which doesn't coerce arguments.
  10780. *
  10781. * @private
  10782. * @param {string} string The string to repeat.
  10783. * @param {number} n The number of times to repeat the string.
  10784. * @returns {string} Returns the repeated string.
  10785. */
  10786. function baseRepeat(string, n) {
  10787. var result = '';
  10788. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  10789. return result;
  10790. }
  10791. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  10792. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  10793. do {
  10794. if (n % 2) {
  10795. result += string;
  10796. }
  10797. n = nativeFloor(n / 2);
  10798. if (n) {
  10799. string += string;
  10800. }
  10801. } while (n);
  10802. return result;
  10803. }
  10804. /**
  10805. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  10806. *
  10807. * @private
  10808. * @param {Function} func The function to apply a rest parameter to.
  10809. * @param {number} [start=func.length-1] The start position of the rest parameter.
  10810. * @returns {Function} Returns the new function.
  10811. */
  10812. function baseRest(func, start) {
  10813. return setToString(overRest(func, start, identity), func + '');
  10814. }
  10815. /**
  10816. * The base implementation of `_.sample`.
  10817. *
  10818. * @private
  10819. * @param {Array|Object} collection The collection to sample.
  10820. * @returns {*} Returns the random element.
  10821. */
  10822. function baseSample(collection) {
  10823. return arraySample(values(collection));
  10824. }
  10825. /**
  10826. * The base implementation of `_.sampleSize` without param guards.
  10827. *
  10828. * @private
  10829. * @param {Array|Object} collection The collection to sample.
  10830. * @param {number} n The number of elements to sample.
  10831. * @returns {Array} Returns the random elements.
  10832. */
  10833. function baseSampleSize(collection, n) {
  10834. var array = values(collection);
  10835. return shuffleSelf(array, baseClamp(n, 0, array.length));
  10836. }
  10837. /**
  10838. * The base implementation of `_.set`.
  10839. *
  10840. * @private
  10841. * @param {Object} object The object to modify.
  10842. * @param {Array|string} path The path of the property to set.
  10843. * @param {*} value The value to set.
  10844. * @param {Function} [customizer] The function to customize path creation.
  10845. * @returns {Object} Returns `object`.
  10846. */
  10847. function baseSet(object, path, value, customizer) {
  10848. if (!isObject(object)) {
  10849. return object;
  10850. }
  10851. path = castPath(path, object);
  10852. var index = -1,
  10853. length = path.length,
  10854. lastIndex = length - 1,
  10855. nested = object;
  10856. while (nested != null && ++index < length) {
  10857. var key = toKey(path[index]),
  10858. newValue = value;
  10859. if (index != lastIndex) {
  10860. var objValue = nested[key];
  10861. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  10862. if (newValue === undefined) {
  10863. newValue = isObject(objValue)
  10864. ? objValue
  10865. : (isIndex(path[index + 1]) ? [] : {});
  10866. }
  10867. }
  10868. assignValue(nested, key, newValue);
  10869. nested = nested[key];
  10870. }
  10871. return object;
  10872. }
  10873. /**
  10874. * The base implementation of `setData` without support for hot loop shorting.
  10875. *
  10876. * @private
  10877. * @param {Function} func The function to associate metadata with.
  10878. * @param {*} data The metadata.
  10879. * @returns {Function} Returns `func`.
  10880. */
  10881. var baseSetData = !metaMap ? identity : function(func, data) {
  10882. metaMap.set(func, data);
  10883. return func;
  10884. };
  10885. /**
  10886. * The base implementation of `setToString` without support for hot loop shorting.
  10887. *
  10888. * @private
  10889. * @param {Function} func The function to modify.
  10890. * @param {Function} string The `toString` result.
  10891. * @returns {Function} Returns `func`.
  10892. */
  10893. var baseSetToString = !defineProperty ? identity : function(func, string) {
  10894. return defineProperty(func, 'toString', {
  10895. 'configurable': true,
  10896. 'enumerable': false,
  10897. 'value': constant(string),
  10898. 'writable': true
  10899. });
  10900. };
  10901. /**
  10902. * The base implementation of `_.shuffle`.
  10903. *
  10904. * @private
  10905. * @param {Array|Object} collection The collection to shuffle.
  10906. * @returns {Array} Returns the new shuffled array.
  10907. */
  10908. function baseShuffle(collection) {
  10909. return shuffleSelf(values(collection));
  10910. }
  10911. /**
  10912. * The base implementation of `_.slice` without an iteratee call guard.
  10913. *
  10914. * @private
  10915. * @param {Array} array The array to slice.
  10916. * @param {number} [start=0] The start position.
  10917. * @param {number} [end=array.length] The end position.
  10918. * @returns {Array} Returns the slice of `array`.
  10919. */
  10920. function baseSlice(array, start, end) {
  10921. var index = -1,
  10922. length = array.length;
  10923. if (start < 0) {
  10924. start = -start > length ? 0 : (length + start);
  10925. }
  10926. end = end > length ? length : end;
  10927. if (end < 0) {
  10928. end += length;
  10929. }
  10930. length = start > end ? 0 : ((end - start) >>> 0);
  10931. start >>>= 0;
  10932. var result = Array(length);
  10933. while (++index < length) {
  10934. result[index] = array[index + start];
  10935. }
  10936. return result;
  10937. }
  10938. /**
  10939. * The base implementation of `_.some` without support for iteratee shorthands.
  10940. *
  10941. * @private
  10942. * @param {Array|Object} collection The collection to iterate over.
  10943. * @param {Function} predicate The function invoked per iteration.
  10944. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10945. * else `false`.
  10946. */
  10947. function baseSome(collection, predicate) {
  10948. var result;
  10949. baseEach(collection, function(value, index, collection) {
  10950. result = predicate(value, index, collection);
  10951. return !result;
  10952. });
  10953. return !!result;
  10954. }
  10955. /**
  10956. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  10957. * performs a binary search of `array` to determine the index at which `value`
  10958. * should be inserted into `array` in order to maintain its sort order.
  10959. *
  10960. * @private
  10961. * @param {Array} array The sorted array to inspect.
  10962. * @param {*} value The value to evaluate.
  10963. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  10964. * @returns {number} Returns the index at which `value` should be inserted
  10965. * into `array`.
  10966. */
  10967. function baseSortedIndex(array, value, retHighest) {
  10968. var low = 0,
  10969. high = array == null ? low : array.length;
  10970. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  10971. while (low < high) {
  10972. var mid = (low + high) >>> 1,
  10973. computed = array[mid];
  10974. if (computed !== null && !isSymbol(computed) &&
  10975. (retHighest ? (computed <= value) : (computed < value))) {
  10976. low = mid + 1;
  10977. } else {
  10978. high = mid;
  10979. }
  10980. }
  10981. return high;
  10982. }
  10983. return baseSortedIndexBy(array, value, identity, retHighest);
  10984. }
  10985. /**
  10986. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  10987. * which invokes `iteratee` for `value` and each element of `array` to compute
  10988. * their sort ranking. The iteratee is invoked with one argument; (value).
  10989. *
  10990. * @private
  10991. * @param {Array} array The sorted array to inspect.
  10992. * @param {*} value The value to evaluate.
  10993. * @param {Function} iteratee The iteratee invoked per element.
  10994. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  10995. * @returns {number} Returns the index at which `value` should be inserted
  10996. * into `array`.
  10997. */
  10998. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  10999. value = iteratee(value);
  11000. var low = 0,
  11001. high = array == null ? 0 : array.length,
  11002. valIsNaN = value !== value,
  11003. valIsNull = value === null,
  11004. valIsSymbol = isSymbol(value),
  11005. valIsUndefined = value === undefined;
  11006. while (low < high) {
  11007. var mid = nativeFloor((low + high) / 2),
  11008. computed = iteratee(array[mid]),
  11009. othIsDefined = computed !== undefined,
  11010. othIsNull = computed === null,
  11011. othIsReflexive = computed === computed,
  11012. othIsSymbol = isSymbol(computed);
  11013. if (valIsNaN) {
  11014. var setLow = retHighest || othIsReflexive;
  11015. } else if (valIsUndefined) {
  11016. setLow = othIsReflexive && (retHighest || othIsDefined);
  11017. } else if (valIsNull) {
  11018. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  11019. } else if (valIsSymbol) {
  11020. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  11021. } else if (othIsNull || othIsSymbol) {
  11022. setLow = false;
  11023. } else {
  11024. setLow = retHighest ? (computed <= value) : (computed < value);
  11025. }
  11026. if (setLow) {
  11027. low = mid + 1;
  11028. } else {
  11029. high = mid;
  11030. }
  11031. }
  11032. return nativeMin(high, MAX_ARRAY_INDEX);
  11033. }
  11034. /**
  11035. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  11036. * support for iteratee shorthands.
  11037. *
  11038. * @private
  11039. * @param {Array} array The array to inspect.
  11040. * @param {Function} [iteratee] The iteratee invoked per element.
  11041. * @returns {Array} Returns the new duplicate free array.
  11042. */
  11043. function baseSortedUniq(array, iteratee) {
  11044. var index = -1,
  11045. length = array.length,
  11046. resIndex = 0,
  11047. result = [];
  11048. while (++index < length) {
  11049. var value = array[index],
  11050. computed = iteratee ? iteratee(value) : value;
  11051. if (!index || !eq(computed, seen)) {
  11052. var seen = computed;
  11053. result[resIndex++] = value === 0 ? 0 : value;
  11054. }
  11055. }
  11056. return result;
  11057. }
  11058. /**
  11059. * The base implementation of `_.toNumber` which doesn't ensure correct
  11060. * conversions of binary, hexadecimal, or octal string values.
  11061. *
  11062. * @private
  11063. * @param {*} value The value to process.
  11064. * @returns {number} Returns the number.
  11065. */
  11066. function baseToNumber(value) {
  11067. if (typeof value == 'number') {
  11068. return value;
  11069. }
  11070. if (isSymbol(value)) {
  11071. return NAN;
  11072. }
  11073. return +value;
  11074. }
  11075. /**
  11076. * The base implementation of `_.toString` which doesn't convert nullish
  11077. * values to empty strings.
  11078. *
  11079. * @private
  11080. * @param {*} value The value to process.
  11081. * @returns {string} Returns the string.
  11082. */
  11083. function baseToString(value) {
  11084. // Exit early for strings to avoid a performance hit in some environments.
  11085. if (typeof value == 'string') {
  11086. return value;
  11087. }
  11088. if (isArray(value)) {
  11089. // Recursively convert values (susceptible to call stack limits).
  11090. return arrayMap(value, baseToString) + '';
  11091. }
  11092. if (isSymbol(value)) {
  11093. return symbolToString ? symbolToString.call(value) : '';
  11094. }
  11095. var result = (value + '');
  11096. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  11097. }
  11098. /**
  11099. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  11100. *
  11101. * @private
  11102. * @param {Array} array The array to inspect.
  11103. * @param {Function} [iteratee] The iteratee invoked per element.
  11104. * @param {Function} [comparator] The comparator invoked per element.
  11105. * @returns {Array} Returns the new duplicate free array.
  11106. */
  11107. function baseUniq(array, iteratee, comparator) {
  11108. var index = -1,
  11109. includes = arrayIncludes,
  11110. length = array.length,
  11111. isCommon = true,
  11112. result = [],
  11113. seen = result;
  11114. if (comparator) {
  11115. isCommon = false;
  11116. includes = arrayIncludesWith;
  11117. }
  11118. else if (length >= LARGE_ARRAY_SIZE) {
  11119. var set = iteratee ? null : createSet(array);
  11120. if (set) {
  11121. return setToArray(set);
  11122. }
  11123. isCommon = false;
  11124. includes = cacheHas;
  11125. seen = new SetCache;
  11126. }
  11127. else {
  11128. seen = iteratee ? [] : result;
  11129. }
  11130. outer:
  11131. while (++index < length) {
  11132. var value = array[index],
  11133. computed = iteratee ? iteratee(value) : value;
  11134. value = (comparator || value !== 0) ? value : 0;
  11135. if (isCommon && computed === computed) {
  11136. var seenIndex = seen.length;
  11137. while (seenIndex--) {
  11138. if (seen[seenIndex] === computed) {
  11139. continue outer;
  11140. }
  11141. }
  11142. if (iteratee) {
  11143. seen.push(computed);
  11144. }
  11145. result.push(value);
  11146. }
  11147. else if (!includes(seen, computed, comparator)) {
  11148. if (seen !== result) {
  11149. seen.push(computed);
  11150. }
  11151. result.push(value);
  11152. }
  11153. }
  11154. return result;
  11155. }
  11156. /**
  11157. * The base implementation of `_.unset`.
  11158. *
  11159. * @private
  11160. * @param {Object} object The object to modify.
  11161. * @param {Array|string} path The property path to unset.
  11162. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  11163. */
  11164. function baseUnset(object, path) {
  11165. path = castPath(path, object);
  11166. object = parent(object, path);
  11167. return object == null || delete object[toKey(last(path))];
  11168. }
  11169. /**
  11170. * The base implementation of `_.update`.
  11171. *
  11172. * @private
  11173. * @param {Object} object The object to modify.
  11174. * @param {Array|string} path The path of the property to update.
  11175. * @param {Function} updater The function to produce the updated value.
  11176. * @param {Function} [customizer] The function to customize path creation.
  11177. * @returns {Object} Returns `object`.
  11178. */
  11179. function baseUpdate(object, path, updater, customizer) {
  11180. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  11181. }
  11182. /**
  11183. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  11184. * without support for iteratee shorthands.
  11185. *
  11186. * @private
  11187. * @param {Array} array The array to query.
  11188. * @param {Function} predicate The function invoked per iteration.
  11189. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  11190. * @param {boolean} [fromRight] Specify iterating from right to left.
  11191. * @returns {Array} Returns the slice of `array`.
  11192. */
  11193. function baseWhile(array, predicate, isDrop, fromRight) {
  11194. var length = array.length,
  11195. index = fromRight ? length : -1;
  11196. while ((fromRight ? index-- : ++index < length) &&
  11197. predicate(array[index], index, array)) {}
  11198. return isDrop
  11199. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  11200. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  11201. }
  11202. /**
  11203. * The base implementation of `wrapperValue` which returns the result of
  11204. * performing a sequence of actions on the unwrapped `value`, where each
  11205. * successive action is supplied the return value of the previous.
  11206. *
  11207. * @private
  11208. * @param {*} value The unwrapped value.
  11209. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  11210. * @returns {*} Returns the resolved value.
  11211. */
  11212. function baseWrapperValue(value, actions) {
  11213. var result = value;
  11214. if (result instanceof LazyWrapper) {
  11215. result = result.value();
  11216. }
  11217. return arrayReduce(actions, function(result, action) {
  11218. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  11219. }, result);
  11220. }
  11221. /**
  11222. * The base implementation of methods like `_.xor`, without support for
  11223. * iteratee shorthands, that accepts an array of arrays to inspect.
  11224. *
  11225. * @private
  11226. * @param {Array} arrays The arrays to inspect.
  11227. * @param {Function} [iteratee] The iteratee invoked per element.
  11228. * @param {Function} [comparator] The comparator invoked per element.
  11229. * @returns {Array} Returns the new array of values.
  11230. */
  11231. function baseXor(arrays, iteratee, comparator) {
  11232. var length = arrays.length;
  11233. if (length < 2) {
  11234. return length ? baseUniq(arrays[0]) : [];
  11235. }
  11236. var index = -1,
  11237. result = Array(length);
  11238. while (++index < length) {
  11239. var array = arrays[index],
  11240. othIndex = -1;
  11241. while (++othIndex < length) {
  11242. if (othIndex != index) {
  11243. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  11244. }
  11245. }
  11246. }
  11247. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  11248. }
  11249. /**
  11250. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  11251. *
  11252. * @private
  11253. * @param {Array} props The property identifiers.
  11254. * @param {Array} values The property values.
  11255. * @param {Function} assignFunc The function to assign values.
  11256. * @returns {Object} Returns the new object.
  11257. */
  11258. function baseZipObject(props, values, assignFunc) {
  11259. var index = -1,
  11260. length = props.length,
  11261. valsLength = values.length,
  11262. result = {};
  11263. while (++index < length) {
  11264. var value = index < valsLength ? values[index] : undefined;
  11265. assignFunc(result, props[index], value);
  11266. }
  11267. return result;
  11268. }
  11269. /**
  11270. * Casts `value` to an empty array if it's not an array like object.
  11271. *
  11272. * @private
  11273. * @param {*} value The value to inspect.
  11274. * @returns {Array|Object} Returns the cast array-like object.
  11275. */
  11276. function castArrayLikeObject(value) {
  11277. return isArrayLikeObject(value) ? value : [];
  11278. }
  11279. /**
  11280. * Casts `value` to `identity` if it's not a function.
  11281. *
  11282. * @private
  11283. * @param {*} value The value to inspect.
  11284. * @returns {Function} Returns cast function.
  11285. */
  11286. function castFunction(value) {
  11287. return typeof value == 'function' ? value : identity;
  11288. }
  11289. /**
  11290. * Casts `value` to a path array if it's not one.
  11291. *
  11292. * @private
  11293. * @param {*} value The value to inspect.
  11294. * @param {Object} [object] The object to query keys on.
  11295. * @returns {Array} Returns the cast property path array.
  11296. */
  11297. function castPath(value, object) {
  11298. if (isArray(value)) {
  11299. return value;
  11300. }
  11301. return isKey(value, object) ? [value] : stringToPath(toString(value));
  11302. }
  11303. /**
  11304. * A `baseRest` alias which can be replaced with `identity` by module
  11305. * replacement plugins.
  11306. *
  11307. * @private
  11308. * @type {Function}
  11309. * @param {Function} func The function to apply a rest parameter to.
  11310. * @returns {Function} Returns the new function.
  11311. */
  11312. var castRest = baseRest;
  11313. /**
  11314. * Casts `array` to a slice if it's needed.
  11315. *
  11316. * @private
  11317. * @param {Array} array The array to inspect.
  11318. * @param {number} start The start position.
  11319. * @param {number} [end=array.length] The end position.
  11320. * @returns {Array} Returns the cast slice.
  11321. */
  11322. function castSlice(array, start, end) {
  11323. var length = array.length;
  11324. end = end === undefined ? length : end;
  11325. return (!start && end >= length) ? array : baseSlice(array, start, end);
  11326. }
  11327. /**
  11328. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  11329. *
  11330. * @private
  11331. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  11332. */
  11333. var clearTimeout = ctxClearTimeout || function(id) {
  11334. return root.clearTimeout(id);
  11335. };
  11336. /**
  11337. * Creates a clone of `buffer`.
  11338. *
  11339. * @private
  11340. * @param {Buffer} buffer The buffer to clone.
  11341. * @param {boolean} [isDeep] Specify a deep clone.
  11342. * @returns {Buffer} Returns the cloned buffer.
  11343. */
  11344. function cloneBuffer(buffer, isDeep) {
  11345. if (isDeep) {
  11346. return buffer.slice();
  11347. }
  11348. var length = buffer.length,
  11349. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  11350. buffer.copy(result);
  11351. return result;
  11352. }
  11353. /**
  11354. * Creates a clone of `arrayBuffer`.
  11355. *
  11356. * @private
  11357. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  11358. * @returns {ArrayBuffer} Returns the cloned array buffer.
  11359. */
  11360. function cloneArrayBuffer(arrayBuffer) {
  11361. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  11362. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  11363. return result;
  11364. }
  11365. /**
  11366. * Creates a clone of `dataView`.
  11367. *
  11368. * @private
  11369. * @param {Object} dataView The data view to clone.
  11370. * @param {boolean} [isDeep] Specify a deep clone.
  11371. * @returns {Object} Returns the cloned data view.
  11372. */
  11373. function cloneDataView(dataView, isDeep) {
  11374. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  11375. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  11376. }
  11377. /**
  11378. * Creates a clone of `regexp`.
  11379. *
  11380. * @private
  11381. * @param {Object} regexp The regexp to clone.
  11382. * @returns {Object} Returns the cloned regexp.
  11383. */
  11384. function cloneRegExp(regexp) {
  11385. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  11386. result.lastIndex = regexp.lastIndex;
  11387. return result;
  11388. }
  11389. /**
  11390. * Creates a clone of the `symbol` object.
  11391. *
  11392. * @private
  11393. * @param {Object} symbol The symbol object to clone.
  11394. * @returns {Object} Returns the cloned symbol object.
  11395. */
  11396. function cloneSymbol(symbol) {
  11397. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  11398. }
  11399. /**
  11400. * Creates a clone of `typedArray`.
  11401. *
  11402. * @private
  11403. * @param {Object} typedArray The typed array to clone.
  11404. * @param {boolean} [isDeep] Specify a deep clone.
  11405. * @returns {Object} Returns the cloned typed array.
  11406. */
  11407. function cloneTypedArray(typedArray, isDeep) {
  11408. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  11409. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  11410. }
  11411. /**
  11412. * Compares values to sort them in ascending order.
  11413. *
  11414. * @private
  11415. * @param {*} value The value to compare.
  11416. * @param {*} other The other value to compare.
  11417. * @returns {number} Returns the sort order indicator for `value`.
  11418. */
  11419. function compareAscending(value, other) {
  11420. if (value !== other) {
  11421. var valIsDefined = value !== undefined,
  11422. valIsNull = value === null,
  11423. valIsReflexive = value === value,
  11424. valIsSymbol = isSymbol(value);
  11425. var othIsDefined = other !== undefined,
  11426. othIsNull = other === null,
  11427. othIsReflexive = other === other,
  11428. othIsSymbol = isSymbol(other);
  11429. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  11430. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  11431. (valIsNull && othIsDefined && othIsReflexive) ||
  11432. (!valIsDefined && othIsReflexive) ||
  11433. !valIsReflexive) {
  11434. return 1;
  11435. }
  11436. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  11437. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  11438. (othIsNull && valIsDefined && valIsReflexive) ||
  11439. (!othIsDefined && valIsReflexive) ||
  11440. !othIsReflexive) {
  11441. return -1;
  11442. }
  11443. }
  11444. return 0;
  11445. }
  11446. /**
  11447. * Used by `_.orderBy` to compare multiple properties of a value to another
  11448. * and stable sort them.
  11449. *
  11450. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  11451. * specify an order of "desc" for descending or "asc" for ascending sort order
  11452. * of corresponding values.
  11453. *
  11454. * @private
  11455. * @param {Object} object The object to compare.
  11456. * @param {Object} other The other object to compare.
  11457. * @param {boolean[]|string[]} orders The order to sort by for each property.
  11458. * @returns {number} Returns the sort order indicator for `object`.
  11459. */
  11460. function compareMultiple(object, other, orders) {
  11461. var index = -1,
  11462. objCriteria = object.criteria,
  11463. othCriteria = other.criteria,
  11464. length = objCriteria.length,
  11465. ordersLength = orders.length;
  11466. while (++index < length) {
  11467. var result = compareAscending(objCriteria[index], othCriteria[index]);
  11468. if (result) {
  11469. if (index >= ordersLength) {
  11470. return result;
  11471. }
  11472. var order = orders[index];
  11473. return result * (order == 'desc' ? -1 : 1);
  11474. }
  11475. }
  11476. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  11477. // that causes it, under certain circumstances, to provide the same value for
  11478. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  11479. // for more details.
  11480. //
  11481. // This also ensures a stable sort in V8 and other engines.
  11482. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  11483. return object.index - other.index;
  11484. }
  11485. /**
  11486. * Creates an array that is the composition of partially applied arguments,
  11487. * placeholders, and provided arguments into a single array of arguments.
  11488. *
  11489. * @private
  11490. * @param {Array} args The provided arguments.
  11491. * @param {Array} partials The arguments to prepend to those provided.
  11492. * @param {Array} holders The `partials` placeholder indexes.
  11493. * @params {boolean} [isCurried] Specify composing for a curried function.
  11494. * @returns {Array} Returns the new array of composed arguments.
  11495. */
  11496. function composeArgs(args, partials, holders, isCurried) {
  11497. var argsIndex = -1,
  11498. argsLength = args.length,
  11499. holdersLength = holders.length,
  11500. leftIndex = -1,
  11501. leftLength = partials.length,
  11502. rangeLength = nativeMax(argsLength - holdersLength, 0),
  11503. result = Array(leftLength + rangeLength),
  11504. isUncurried = !isCurried;
  11505. while (++leftIndex < leftLength) {
  11506. result[leftIndex] = partials[leftIndex];
  11507. }
  11508. while (++argsIndex < holdersLength) {
  11509. if (isUncurried || argsIndex < argsLength) {
  11510. result[holders[argsIndex]] = args[argsIndex];
  11511. }
  11512. }
  11513. while (rangeLength--) {
  11514. result[leftIndex++] = args[argsIndex++];
  11515. }
  11516. return result;
  11517. }
  11518. /**
  11519. * This function is like `composeArgs` except that the arguments composition
  11520. * is tailored for `_.partialRight`.
  11521. *
  11522. * @private
  11523. * @param {Array} args The provided arguments.
  11524. * @param {Array} partials The arguments to append to those provided.
  11525. * @param {Array} holders The `partials` placeholder indexes.
  11526. * @params {boolean} [isCurried] Specify composing for a curried function.
  11527. * @returns {Array} Returns the new array of composed arguments.
  11528. */
  11529. function composeArgsRight(args, partials, holders, isCurried) {
  11530. var argsIndex = -1,
  11531. argsLength = args.length,
  11532. holdersIndex = -1,
  11533. holdersLength = holders.length,
  11534. rightIndex = -1,
  11535. rightLength = partials.length,
  11536. rangeLength = nativeMax(argsLength - holdersLength, 0),
  11537. result = Array(rangeLength + rightLength),
  11538. isUncurried = !isCurried;
  11539. while (++argsIndex < rangeLength) {
  11540. result[argsIndex] = args[argsIndex];
  11541. }
  11542. var offset = argsIndex;
  11543. while (++rightIndex < rightLength) {
  11544. result[offset + rightIndex] = partials[rightIndex];
  11545. }
  11546. while (++holdersIndex < holdersLength) {
  11547. if (isUncurried || argsIndex < argsLength) {
  11548. result[offset + holders[holdersIndex]] = args[argsIndex++];
  11549. }
  11550. }
  11551. return result;
  11552. }
  11553. /**
  11554. * Copies the values of `source` to `array`.
  11555. *
  11556. * @private
  11557. * @param {Array} source The array to copy values from.
  11558. * @param {Array} [array=[]] The array to copy values to.
  11559. * @returns {Array} Returns `array`.
  11560. */
  11561. function copyArray(source, array) {
  11562. var index = -1,
  11563. length = source.length;
  11564. array || (array = Array(length));
  11565. while (++index < length) {
  11566. array[index] = source[index];
  11567. }
  11568. return array;
  11569. }
  11570. /**
  11571. * Copies properties of `source` to `object`.
  11572. *
  11573. * @private
  11574. * @param {Object} source The object to copy properties from.
  11575. * @param {Array} props The property identifiers to copy.
  11576. * @param {Object} [object={}] The object to copy properties to.
  11577. * @param {Function} [customizer] The function to customize copied values.
  11578. * @returns {Object} Returns `object`.
  11579. */
  11580. function copyObject(source, props, object, customizer) {
  11581. var isNew = !object;
  11582. object || (object = {});
  11583. var index = -1,
  11584. length = props.length;
  11585. while (++index < length) {
  11586. var key = props[index];
  11587. var newValue = customizer
  11588. ? customizer(object[key], source[key], key, object, source)
  11589. : undefined;
  11590. if (newValue === undefined) {
  11591. newValue = source[key];
  11592. }
  11593. if (isNew) {
  11594. baseAssignValue(object, key, newValue);
  11595. } else {
  11596. assignValue(object, key, newValue);
  11597. }
  11598. }
  11599. return object;
  11600. }
  11601. /**
  11602. * Copies own symbols of `source` to `object`.
  11603. *
  11604. * @private
  11605. * @param {Object} source The object to copy symbols from.
  11606. * @param {Object} [object={}] The object to copy symbols to.
  11607. * @returns {Object} Returns `object`.
  11608. */
  11609. function copySymbols(source, object) {
  11610. return copyObject(source, getSymbols(source), object);
  11611. }
  11612. /**
  11613. * Copies own and inherited symbols of `source` to `object`.
  11614. *
  11615. * @private
  11616. * @param {Object} source The object to copy symbols from.
  11617. * @param {Object} [object={}] The object to copy symbols to.
  11618. * @returns {Object} Returns `object`.
  11619. */
  11620. function copySymbolsIn(source, object) {
  11621. return copyObject(source, getSymbolsIn(source), object);
  11622. }
  11623. /**
  11624. * Creates a function like `_.groupBy`.
  11625. *
  11626. * @private
  11627. * @param {Function} setter The function to set accumulator values.
  11628. * @param {Function} [initializer] The accumulator object initializer.
  11629. * @returns {Function} Returns the new aggregator function.
  11630. */
  11631. function createAggregator(setter, initializer) {
  11632. return function(collection, iteratee) {
  11633. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  11634. accumulator = initializer ? initializer() : {};
  11635. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  11636. };
  11637. }
  11638. /**
  11639. * Creates a function like `_.assign`.
  11640. *
  11641. * @private
  11642. * @param {Function} assigner The function to assign values.
  11643. * @returns {Function} Returns the new assigner function.
  11644. */
  11645. function createAssigner(assigner) {
  11646. return baseRest(function(object, sources) {
  11647. var index = -1,
  11648. length = sources.length,
  11649. customizer = length > 1 ? sources[length - 1] : undefined,
  11650. guard = length > 2 ? sources[2] : undefined;
  11651. customizer = (assigner.length > 3 && typeof customizer == 'function')
  11652. ? (length--, customizer)
  11653. : undefined;
  11654. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  11655. customizer = length < 3 ? undefined : customizer;
  11656. length = 1;
  11657. }
  11658. object = Object(object);
  11659. while (++index < length) {
  11660. var source = sources[index];
  11661. if (source) {
  11662. assigner(object, source, index, customizer);
  11663. }
  11664. }
  11665. return object;
  11666. });
  11667. }
  11668. /**
  11669. * Creates a `baseEach` or `baseEachRight` function.
  11670. *
  11671. * @private
  11672. * @param {Function} eachFunc The function to iterate over a collection.
  11673. * @param {boolean} [fromRight] Specify iterating from right to left.
  11674. * @returns {Function} Returns the new base function.
  11675. */
  11676. function createBaseEach(eachFunc, fromRight) {
  11677. return function(collection, iteratee) {
  11678. if (collection == null) {
  11679. return collection;
  11680. }
  11681. if (!isArrayLike(collection)) {
  11682. return eachFunc(collection, iteratee);
  11683. }
  11684. var length = collection.length,
  11685. index = fromRight ? length : -1,
  11686. iterable = Object(collection);
  11687. while ((fromRight ? index-- : ++index < length)) {
  11688. if (iteratee(iterable[index], index, iterable) === false) {
  11689. break;
  11690. }
  11691. }
  11692. return collection;
  11693. };
  11694. }
  11695. /**
  11696. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  11697. *
  11698. * @private
  11699. * @param {boolean} [fromRight] Specify iterating from right to left.
  11700. * @returns {Function} Returns the new base function.
  11701. */
  11702. function createBaseFor(fromRight) {
  11703. return function(object, iteratee, keysFunc) {
  11704. var index = -1,
  11705. iterable = Object(object),
  11706. props = keysFunc(object),
  11707. length = props.length;
  11708. while (length--) {
  11709. var key = props[fromRight ? length : ++index];
  11710. if (iteratee(iterable[key], key, iterable) === false) {
  11711. break;
  11712. }
  11713. }
  11714. return object;
  11715. };
  11716. }
  11717. /**
  11718. * Creates a function that wraps `func` to invoke it with the optional `this`
  11719. * binding of `thisArg`.
  11720. *
  11721. * @private
  11722. * @param {Function} func The function to wrap.
  11723. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  11724. * @param {*} [thisArg] The `this` binding of `func`.
  11725. * @returns {Function} Returns the new wrapped function.
  11726. */
  11727. function createBind(func, bitmask, thisArg) {
  11728. var isBind = bitmask & WRAP_BIND_FLAG,
  11729. Ctor = createCtor(func);
  11730. function wrapper() {
  11731. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  11732. return fn.apply(isBind ? thisArg : this, arguments);
  11733. }
  11734. return wrapper;
  11735. }
  11736. /**
  11737. * Creates a function like `_.lowerFirst`.
  11738. *
  11739. * @private
  11740. * @param {string} methodName The name of the `String` case method to use.
  11741. * @returns {Function} Returns the new case function.
  11742. */
  11743. function createCaseFirst(methodName) {
  11744. return function(string) {
  11745. string = toString(string);
  11746. var strSymbols = hasUnicode(string)
  11747. ? stringToArray(string)
  11748. : undefined;
  11749. var chr = strSymbols
  11750. ? strSymbols[0]
  11751. : string.charAt(0);
  11752. var trailing = strSymbols
  11753. ? castSlice(strSymbols, 1).join('')
  11754. : string.slice(1);
  11755. return chr[methodName]() + trailing;
  11756. };
  11757. }
  11758. /**
  11759. * Creates a function like `_.camelCase`.
  11760. *
  11761. * @private
  11762. * @param {Function} callback The function to combine each word.
  11763. * @returns {Function} Returns the new compounder function.
  11764. */
  11765. function createCompounder(callback) {
  11766. return function(string) {
  11767. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  11768. };
  11769. }
  11770. /**
  11771. * Creates a function that produces an instance of `Ctor` regardless of
  11772. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  11773. *
  11774. * @private
  11775. * @param {Function} Ctor The constructor to wrap.
  11776. * @returns {Function} Returns the new wrapped function.
  11777. */
  11778. function createCtor(Ctor) {
  11779. return function() {
  11780. // Use a `switch` statement to work with class constructors. See
  11781. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  11782. // for more details.
  11783. var args = arguments;
  11784. switch (args.length) {
  11785. case 0: return new Ctor;
  11786. case 1: return new Ctor(args[0]);
  11787. case 2: return new Ctor(args[0], args[1]);
  11788. case 3: return new Ctor(args[0], args[1], args[2]);
  11789. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  11790. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  11791. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  11792. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  11793. }
  11794. var thisBinding = baseCreate(Ctor.prototype),
  11795. result = Ctor.apply(thisBinding, args);
  11796. // Mimic the constructor's `return` behavior.
  11797. // See https://es5.github.io/#x13.2.2 for more details.
  11798. return isObject(result) ? result : thisBinding;
  11799. };
  11800. }
  11801. /**
  11802. * Creates a function that wraps `func` to enable currying.
  11803. *
  11804. * @private
  11805. * @param {Function} func The function to wrap.
  11806. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  11807. * @param {number} arity The arity of `func`.
  11808. * @returns {Function} Returns the new wrapped function.
  11809. */
  11810. function createCurry(func, bitmask, arity) {
  11811. var Ctor = createCtor(func);
  11812. function wrapper() {
  11813. var length = arguments.length,
  11814. args = Array(length),
  11815. index = length,
  11816. placeholder = getHolder(wrapper);
  11817. while (index--) {
  11818. args[index] = arguments[index];
  11819. }
  11820. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  11821. ? []
  11822. : replaceHolders(args, placeholder);
  11823. length -= holders.length;
  11824. if (length < arity) {
  11825. return createRecurry(
  11826. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  11827. args, holders, undefined, undefined, arity - length);
  11828. }
  11829. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  11830. return apply(fn, this, args);
  11831. }
  11832. return wrapper;
  11833. }
  11834. /**
  11835. * Creates a `_.find` or `_.findLast` function.
  11836. *
  11837. * @private
  11838. * @param {Function} findIndexFunc The function to find the collection index.
  11839. * @returns {Function} Returns the new find function.
  11840. */
  11841. function createFind(findIndexFunc) {
  11842. return function(collection, predicate, fromIndex) {
  11843. var iterable = Object(collection);
  11844. if (!isArrayLike(collection)) {
  11845. var iteratee = getIteratee(predicate, 3);
  11846. collection = keys(collection);
  11847. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  11848. }
  11849. var index = findIndexFunc(collection, predicate, fromIndex);
  11850. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  11851. };
  11852. }
  11853. /**
  11854. * Creates a `_.flow` or `_.flowRight` function.
  11855. *
  11856. * @private
  11857. * @param {boolean} [fromRight] Specify iterating from right to left.
  11858. * @returns {Function} Returns the new flow function.
  11859. */
  11860. function createFlow(fromRight) {
  11861. return flatRest(function(funcs) {
  11862. var length = funcs.length,
  11863. index = length,
  11864. prereq = LodashWrapper.prototype.thru;
  11865. if (fromRight) {
  11866. funcs.reverse();
  11867. }
  11868. while (index--) {
  11869. var func = funcs[index];
  11870. if (typeof func != 'function') {
  11871. throw new TypeError(FUNC_ERROR_TEXT);
  11872. }
  11873. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  11874. var wrapper = new LodashWrapper([], true);
  11875. }
  11876. }
  11877. index = wrapper ? index : length;
  11878. while (++index < length) {
  11879. func = funcs[index];
  11880. var funcName = getFuncName(func),
  11881. data = funcName == 'wrapper' ? getData(func) : undefined;
  11882. if (data && isLaziable(data[0]) &&
  11883. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  11884. !data[4].length && data[9] == 1
  11885. ) {
  11886. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  11887. } else {
  11888. wrapper = (func.length == 1 && isLaziable(func))
  11889. ? wrapper[funcName]()
  11890. : wrapper.thru(func);
  11891. }
  11892. }
  11893. return function() {
  11894. var args = arguments,
  11895. value = args[0];
  11896. if (wrapper && args.length == 1 && isArray(value)) {
  11897. return wrapper.plant(value).value();
  11898. }
  11899. var index = 0,
  11900. result = length ? funcs[index].apply(this, args) : value;
  11901. while (++index < length) {
  11902. result = funcs[index].call(this, result);
  11903. }
  11904. return result;
  11905. };
  11906. });
  11907. }
  11908. /**
  11909. * Creates a function that wraps `func` to invoke it with optional `this`
  11910. * binding of `thisArg`, partial application, and currying.
  11911. *
  11912. * @private
  11913. * @param {Function|string} func The function or method name to wrap.
  11914. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  11915. * @param {*} [thisArg] The `this` binding of `func`.
  11916. * @param {Array} [partials] The arguments to prepend to those provided to
  11917. * the new function.
  11918. * @param {Array} [holders] The `partials` placeholder indexes.
  11919. * @param {Array} [partialsRight] The arguments to append to those provided
  11920. * to the new function.
  11921. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  11922. * @param {Array} [argPos] The argument positions of the new function.
  11923. * @param {number} [ary] The arity cap of `func`.
  11924. * @param {number} [arity] The arity of `func`.
  11925. * @returns {Function} Returns the new wrapped function.
  11926. */
  11927. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  11928. var isAry = bitmask & WRAP_ARY_FLAG,
  11929. isBind = bitmask & WRAP_BIND_FLAG,
  11930. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  11931. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  11932. isFlip = bitmask & WRAP_FLIP_FLAG,
  11933. Ctor = isBindKey ? undefined : createCtor(func);
  11934. function wrapper() {
  11935. var length = arguments.length,
  11936. args = Array(length),
  11937. index = length;
  11938. while (index--) {
  11939. args[index] = arguments[index];
  11940. }
  11941. if (isCurried) {
  11942. var placeholder = getHolder(wrapper),
  11943. holdersCount = countHolders(args, placeholder);
  11944. }
  11945. if (partials) {
  11946. args = composeArgs(args, partials, holders, isCurried);
  11947. }
  11948. if (partialsRight) {
  11949. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  11950. }
  11951. length -= holdersCount;
  11952. if (isCurried && length < arity) {
  11953. var newHolders = replaceHolders(args, placeholder);
  11954. return createRecurry(
  11955. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  11956. args, newHolders, argPos, ary, arity - length
  11957. );
  11958. }
  11959. var thisBinding = isBind ? thisArg : this,
  11960. fn = isBindKey ? thisBinding[func] : func;
  11961. length = args.length;
  11962. if (argPos) {
  11963. args = reorder(args, argPos);
  11964. } else if (isFlip && length > 1) {
  11965. args.reverse();
  11966. }
  11967. if (isAry && ary < length) {
  11968. args.length = ary;
  11969. }
  11970. if (this && this !== root && this instanceof wrapper) {
  11971. fn = Ctor || createCtor(fn);
  11972. }
  11973. return fn.apply(thisBinding, args);
  11974. }
  11975. return wrapper;
  11976. }
  11977. /**
  11978. * Creates a function like `_.invertBy`.
  11979. *
  11980. * @private
  11981. * @param {Function} setter The function to set accumulator values.
  11982. * @param {Function} toIteratee The function to resolve iteratees.
  11983. * @returns {Function} Returns the new inverter function.
  11984. */
  11985. function createInverter(setter, toIteratee) {
  11986. return function(object, iteratee) {
  11987. return baseInverter(object, setter, toIteratee(iteratee), {});
  11988. };
  11989. }
  11990. /**
  11991. * Creates a function that performs a mathematical operation on two values.
  11992. *
  11993. * @private
  11994. * @param {Function} operator The function to perform the operation.
  11995. * @param {number} [defaultValue] The value used for `undefined` arguments.
  11996. * @returns {Function} Returns the new mathematical operation function.
  11997. */
  11998. function createMathOperation(operator, defaultValue) {
  11999. return function(value, other) {
  12000. var result;
  12001. if (value === undefined && other === undefined) {
  12002. return defaultValue;
  12003. }
  12004. if (value !== undefined) {
  12005. result = value;
  12006. }
  12007. if (other !== undefined) {
  12008. if (result === undefined) {
  12009. return other;
  12010. }
  12011. if (typeof value == 'string' || typeof other == 'string') {
  12012. value = baseToString(value);
  12013. other = baseToString(other);
  12014. } else {
  12015. value = baseToNumber(value);
  12016. other = baseToNumber(other);
  12017. }
  12018. result = operator(value, other);
  12019. }
  12020. return result;
  12021. };
  12022. }
  12023. /**
  12024. * Creates a function like `_.over`.
  12025. *
  12026. * @private
  12027. * @param {Function} arrayFunc The function to iterate over iteratees.
  12028. * @returns {Function} Returns the new over function.
  12029. */
  12030. function createOver(arrayFunc) {
  12031. return flatRest(function(iteratees) {
  12032. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  12033. return baseRest(function(args) {
  12034. var thisArg = this;
  12035. return arrayFunc(iteratees, function(iteratee) {
  12036. return apply(iteratee, thisArg, args);
  12037. });
  12038. });
  12039. });
  12040. }
  12041. /**
  12042. * Creates the padding for `string` based on `length`. The `chars` string
  12043. * is truncated if the number of characters exceeds `length`.
  12044. *
  12045. * @private
  12046. * @param {number} length The padding length.
  12047. * @param {string} [chars=' '] The string used as padding.
  12048. * @returns {string} Returns the padding for `string`.
  12049. */
  12050. function createPadding(length, chars) {
  12051. chars = chars === undefined ? ' ' : baseToString(chars);
  12052. var charsLength = chars.length;
  12053. if (charsLength < 2) {
  12054. return charsLength ? baseRepeat(chars, length) : chars;
  12055. }
  12056. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  12057. return hasUnicode(chars)
  12058. ? castSlice(stringToArray(result), 0, length).join('')
  12059. : result.slice(0, length);
  12060. }
  12061. /**
  12062. * Creates a function that wraps `func` to invoke it with the `this` binding
  12063. * of `thisArg` and `partials` prepended to the arguments it receives.
  12064. *
  12065. * @private
  12066. * @param {Function} func The function to wrap.
  12067. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  12068. * @param {*} thisArg The `this` binding of `func`.
  12069. * @param {Array} partials The arguments to prepend to those provided to
  12070. * the new function.
  12071. * @returns {Function} Returns the new wrapped function.
  12072. */
  12073. function createPartial(func, bitmask, thisArg, partials) {
  12074. var isBind = bitmask & WRAP_BIND_FLAG,
  12075. Ctor = createCtor(func);
  12076. function wrapper() {
  12077. var argsIndex = -1,
  12078. argsLength = arguments.length,
  12079. leftIndex = -1,
  12080. leftLength = partials.length,
  12081. args = Array(leftLength + argsLength),
  12082. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  12083. while (++leftIndex < leftLength) {
  12084. args[leftIndex] = partials[leftIndex];
  12085. }
  12086. while (argsLength--) {
  12087. args[leftIndex++] = arguments[++argsIndex];
  12088. }
  12089. return apply(fn, isBind ? thisArg : this, args);
  12090. }
  12091. return wrapper;
  12092. }
  12093. /**
  12094. * Creates a `_.range` or `_.rangeRight` function.
  12095. *
  12096. * @private
  12097. * @param {boolean} [fromRight] Specify iterating from right to left.
  12098. * @returns {Function} Returns the new range function.
  12099. */
  12100. function createRange(fromRight) {
  12101. return function(start, end, step) {
  12102. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  12103. end = step = undefined;
  12104. }
  12105. // Ensure the sign of `-0` is preserved.
  12106. start = toFinite(start);
  12107. if (end === undefined) {
  12108. end = start;
  12109. start = 0;
  12110. } else {
  12111. end = toFinite(end);
  12112. }
  12113. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  12114. return baseRange(start, end, step, fromRight);
  12115. };
  12116. }
  12117. /**
  12118. * Creates a function that performs a relational operation on two values.
  12119. *
  12120. * @private
  12121. * @param {Function} operator The function to perform the operation.
  12122. * @returns {Function} Returns the new relational operation function.
  12123. */
  12124. function createRelationalOperation(operator) {
  12125. return function(value, other) {
  12126. if (!(typeof value == 'string' && typeof other == 'string')) {
  12127. value = toNumber(value);
  12128. other = toNumber(other);
  12129. }
  12130. return operator(value, other);
  12131. };
  12132. }
  12133. /**
  12134. * Creates a function that wraps `func` to continue currying.
  12135. *
  12136. * @private
  12137. * @param {Function} func The function to wrap.
  12138. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  12139. * @param {Function} wrapFunc The function to create the `func` wrapper.
  12140. * @param {*} placeholder The placeholder value.
  12141. * @param {*} [thisArg] The `this` binding of `func`.
  12142. * @param {Array} [partials] The arguments to prepend to those provided to
  12143. * the new function.
  12144. * @param {Array} [holders] The `partials` placeholder indexes.
  12145. * @param {Array} [argPos] The argument positions of the new function.
  12146. * @param {number} [ary] The arity cap of `func`.
  12147. * @param {number} [arity] The arity of `func`.
  12148. * @returns {Function} Returns the new wrapped function.
  12149. */
  12150. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  12151. var isCurry = bitmask & WRAP_CURRY_FLAG,
  12152. newHolders = isCurry ? holders : undefined,
  12153. newHoldersRight = isCurry ? undefined : holders,
  12154. newPartials = isCurry ? partials : undefined,
  12155. newPartialsRight = isCurry ? undefined : partials;
  12156. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  12157. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  12158. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  12159. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  12160. }
  12161. var newData = [
  12162. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  12163. newHoldersRight, argPos, ary, arity
  12164. ];
  12165. var result = wrapFunc.apply(undefined, newData);
  12166. if (isLaziable(func)) {
  12167. setData(result, newData);
  12168. }
  12169. result.placeholder = placeholder;
  12170. return setWrapToString(result, func, bitmask);
  12171. }
  12172. /**
  12173. * Creates a function like `_.round`.
  12174. *
  12175. * @private
  12176. * @param {string} methodName The name of the `Math` method to use when rounding.
  12177. * @returns {Function} Returns the new round function.
  12178. */
  12179. function createRound(methodName) {
  12180. var func = Math[methodName];
  12181. return function(number, precision) {
  12182. number = toNumber(number);
  12183. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  12184. if (precision) {
  12185. // Shift with exponential notation to avoid floating-point issues.
  12186. // See [MDN](https://mdn.io/round#Examples) for more details.
  12187. var pair = (toString(number) + 'e').split('e'),
  12188. value = func(pair[0] + 'e' + (+pair[1] + precision));
  12189. pair = (toString(value) + 'e').split('e');
  12190. return +(pair[0] + 'e' + (+pair[1] - precision));
  12191. }
  12192. return func(number);
  12193. };
  12194. }
  12195. /**
  12196. * Creates a set object of `values`.
  12197. *
  12198. * @private
  12199. * @param {Array} values The values to add to the set.
  12200. * @returns {Object} Returns the new set.
  12201. */
  12202. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  12203. return new Set(values);
  12204. };
  12205. /**
  12206. * Creates a `_.toPairs` or `_.toPairsIn` function.
  12207. *
  12208. * @private
  12209. * @param {Function} keysFunc The function to get the keys of a given object.
  12210. * @returns {Function} Returns the new pairs function.
  12211. */
  12212. function createToPairs(keysFunc) {
  12213. return function(object) {
  12214. var tag = getTag(object);
  12215. if (tag == mapTag) {
  12216. return mapToArray(object);
  12217. }
  12218. if (tag == setTag) {
  12219. return setToPairs(object);
  12220. }
  12221. return baseToPairs(object, keysFunc(object));
  12222. };
  12223. }
  12224. /**
  12225. * Creates a function that either curries or invokes `func` with optional
  12226. * `this` binding and partially applied arguments.
  12227. *
  12228. * @private
  12229. * @param {Function|string} func The function or method name to wrap.
  12230. * @param {number} bitmask The bitmask flags.
  12231. * 1 - `_.bind`
  12232. * 2 - `_.bindKey`
  12233. * 4 - `_.curry` or `_.curryRight` of a bound function
  12234. * 8 - `_.curry`
  12235. * 16 - `_.curryRight`
  12236. * 32 - `_.partial`
  12237. * 64 - `_.partialRight`
  12238. * 128 - `_.rearg`
  12239. * 256 - `_.ary`
  12240. * 512 - `_.flip`
  12241. * @param {*} [thisArg] The `this` binding of `func`.
  12242. * @param {Array} [partials] The arguments to be partially applied.
  12243. * @param {Array} [holders] The `partials` placeholder indexes.
  12244. * @param {Array} [argPos] The argument positions of the new function.
  12245. * @param {number} [ary] The arity cap of `func`.
  12246. * @param {number} [arity] The arity of `func`.
  12247. * @returns {Function} Returns the new wrapped function.
  12248. */
  12249. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  12250. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  12251. if (!isBindKey && typeof func != 'function') {
  12252. throw new TypeError(FUNC_ERROR_TEXT);
  12253. }
  12254. var length = partials ? partials.length : 0;
  12255. if (!length) {
  12256. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  12257. partials = holders = undefined;
  12258. }
  12259. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  12260. arity = arity === undefined ? arity : toInteger(arity);
  12261. length -= holders ? holders.length : 0;
  12262. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  12263. var partialsRight = partials,
  12264. holdersRight = holders;
  12265. partials = holders = undefined;
  12266. }
  12267. var data = isBindKey ? undefined : getData(func);
  12268. var newData = [
  12269. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  12270. argPos, ary, arity
  12271. ];
  12272. if (data) {
  12273. mergeData(newData, data);
  12274. }
  12275. func = newData[0];
  12276. bitmask = newData[1];
  12277. thisArg = newData[2];
  12278. partials = newData[3];
  12279. holders = newData[4];
  12280. arity = newData[9] = newData[9] === undefined
  12281. ? (isBindKey ? 0 : func.length)
  12282. : nativeMax(newData[9] - length, 0);
  12283. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  12284. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  12285. }
  12286. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  12287. var result = createBind(func, bitmask, thisArg);
  12288. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  12289. result = createCurry(func, bitmask, arity);
  12290. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  12291. result = createPartial(func, bitmask, thisArg, partials);
  12292. } else {
  12293. result = createHybrid.apply(undefined, newData);
  12294. }
  12295. var setter = data ? baseSetData : setData;
  12296. return setWrapToString(setter(result, newData), func, bitmask);
  12297. }
  12298. /**
  12299. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  12300. * of source objects to the destination object for all destination properties
  12301. * that resolve to `undefined`.
  12302. *
  12303. * @private
  12304. * @param {*} objValue The destination value.
  12305. * @param {*} srcValue The source value.
  12306. * @param {string} key The key of the property to assign.
  12307. * @param {Object} object The parent object of `objValue`.
  12308. * @returns {*} Returns the value to assign.
  12309. */
  12310. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  12311. if (objValue === undefined ||
  12312. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  12313. return srcValue;
  12314. }
  12315. return objValue;
  12316. }
  12317. /**
  12318. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  12319. * objects into destination objects that are passed thru.
  12320. *
  12321. * @private
  12322. * @param {*} objValue The destination value.
  12323. * @param {*} srcValue The source value.
  12324. * @param {string} key The key of the property to merge.
  12325. * @param {Object} object The parent object of `objValue`.
  12326. * @param {Object} source The parent object of `srcValue`.
  12327. * @param {Object} [stack] Tracks traversed source values and their merged
  12328. * counterparts.
  12329. * @returns {*} Returns the value to assign.
  12330. */
  12331. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  12332. if (isObject(objValue) && isObject(srcValue)) {
  12333. // Recursively merge objects and arrays (susceptible to call stack limits).
  12334. stack.set(srcValue, objValue);
  12335. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  12336. stack['delete'](srcValue);
  12337. }
  12338. return objValue;
  12339. }
  12340. /**
  12341. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  12342. * objects.
  12343. *
  12344. * @private
  12345. * @param {*} value The value to inspect.
  12346. * @param {string} key The key of the property to inspect.
  12347. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  12348. */
  12349. function customOmitClone(value) {
  12350. return isPlainObject(value) ? undefined : value;
  12351. }
  12352. /**
  12353. * A specialized version of `baseIsEqualDeep` for arrays with support for
  12354. * partial deep comparisons.
  12355. *
  12356. * @private
  12357. * @param {Array} array The array to compare.
  12358. * @param {Array} other The other array to compare.
  12359. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  12360. * @param {Function} customizer The function to customize comparisons.
  12361. * @param {Function} equalFunc The function to determine equivalents of values.
  12362. * @param {Object} stack Tracks traversed `array` and `other` objects.
  12363. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  12364. */
  12365. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  12366. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  12367. arrLength = array.length,
  12368. othLength = other.length;
  12369. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  12370. return false;
  12371. }
  12372. // Assume cyclic values are equal.
  12373. var stacked = stack.get(array);
  12374. if (stacked && stack.get(other)) {
  12375. return stacked == other;
  12376. }
  12377. var index = -1,
  12378. result = true,
  12379. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  12380. stack.set(array, other);
  12381. stack.set(other, array);
  12382. // Ignore non-index properties.
  12383. while (++index < arrLength) {
  12384. var arrValue = array[index],
  12385. othValue = other[index];
  12386. if (customizer) {
  12387. var compared = isPartial
  12388. ? customizer(othValue, arrValue, index, other, array, stack)
  12389. : customizer(arrValue, othValue, index, array, other, stack);
  12390. }
  12391. if (compared !== undefined) {
  12392. if (compared) {
  12393. continue;
  12394. }
  12395. result = false;
  12396. break;
  12397. }
  12398. // Recursively compare arrays (susceptible to call stack limits).
  12399. if (seen) {
  12400. if (!arraySome(other, function(othValue, othIndex) {
  12401. if (!cacheHas(seen, othIndex) &&
  12402. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  12403. return seen.push(othIndex);
  12404. }
  12405. })) {
  12406. result = false;
  12407. break;
  12408. }
  12409. } else if (!(
  12410. arrValue === othValue ||
  12411. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  12412. )) {
  12413. result = false;
  12414. break;
  12415. }
  12416. }
  12417. stack['delete'](array);
  12418. stack['delete'](other);
  12419. return result;
  12420. }
  12421. /**
  12422. * A specialized version of `baseIsEqualDeep` for comparing objects of
  12423. * the same `toStringTag`.
  12424. *
  12425. * **Note:** This function only supports comparing values with tags of
  12426. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  12427. *
  12428. * @private
  12429. * @param {Object} object The object to compare.
  12430. * @param {Object} other The other object to compare.
  12431. * @param {string} tag The `toStringTag` of the objects to compare.
  12432. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  12433. * @param {Function} customizer The function to customize comparisons.
  12434. * @param {Function} equalFunc The function to determine equivalents of values.
  12435. * @param {Object} stack Tracks traversed `object` and `other` objects.
  12436. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  12437. */
  12438. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  12439. switch (tag) {
  12440. case dataViewTag:
  12441. if ((object.byteLength != other.byteLength) ||
  12442. (object.byteOffset != other.byteOffset)) {
  12443. return false;
  12444. }
  12445. object = object.buffer;
  12446. other = other.buffer;
  12447. case arrayBufferTag:
  12448. if ((object.byteLength != other.byteLength) ||
  12449. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  12450. return false;
  12451. }
  12452. return true;
  12453. case boolTag:
  12454. case dateTag:
  12455. case numberTag:
  12456. // Coerce booleans to `1` or `0` and dates to milliseconds.
  12457. // Invalid dates are coerced to `NaN`.
  12458. return eq(+object, +other);
  12459. case errorTag:
  12460. return object.name == other.name && object.message == other.message;
  12461. case regexpTag:
  12462. case stringTag:
  12463. // Coerce regexes to strings and treat strings, primitives and objects,
  12464. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  12465. // for more details.
  12466. return object == (other + '');
  12467. case mapTag:
  12468. var convert = mapToArray;
  12469. case setTag:
  12470. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  12471. convert || (convert = setToArray);
  12472. if (object.size != other.size && !isPartial) {
  12473. return false;
  12474. }
  12475. // Assume cyclic values are equal.
  12476. var stacked = stack.get(object);
  12477. if (stacked) {
  12478. return stacked == other;
  12479. }
  12480. bitmask |= COMPARE_UNORDERED_FLAG;
  12481. // Recursively compare objects (susceptible to call stack limits).
  12482. stack.set(object, other);
  12483. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  12484. stack['delete'](object);
  12485. return result;
  12486. case symbolTag:
  12487. if (symbolValueOf) {
  12488. return symbolValueOf.call(object) == symbolValueOf.call(other);
  12489. }
  12490. }
  12491. return false;
  12492. }
  12493. /**
  12494. * A specialized version of `baseIsEqualDeep` for objects with support for
  12495. * partial deep comparisons.
  12496. *
  12497. * @private
  12498. * @param {Object} object The object to compare.
  12499. * @param {Object} other The other object to compare.
  12500. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  12501. * @param {Function} customizer The function to customize comparisons.
  12502. * @param {Function} equalFunc The function to determine equivalents of values.
  12503. * @param {Object} stack Tracks traversed `object` and `other` objects.
  12504. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  12505. */
  12506. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  12507. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  12508. objProps = getAllKeys(object),
  12509. objLength = objProps.length,
  12510. othProps = getAllKeys(other),
  12511. othLength = othProps.length;
  12512. if (objLength != othLength && !isPartial) {
  12513. return false;
  12514. }
  12515. var index = objLength;
  12516. while (index--) {
  12517. var key = objProps[index];
  12518. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  12519. return false;
  12520. }
  12521. }
  12522. // Assume cyclic values are equal.
  12523. var stacked = stack.get(object);
  12524. if (stacked && stack.get(other)) {
  12525. return stacked == other;
  12526. }
  12527. var result = true;
  12528. stack.set(object, other);
  12529. stack.set(other, object);
  12530. var skipCtor = isPartial;
  12531. while (++index < objLength) {
  12532. key = objProps[index];
  12533. var objValue = object[key],
  12534. othValue = other[key];
  12535. if (customizer) {
  12536. var compared = isPartial
  12537. ? customizer(othValue, objValue, key, other, object, stack)
  12538. : customizer(objValue, othValue, key, object, other, stack);
  12539. }
  12540. // Recursively compare objects (susceptible to call stack limits).
  12541. if (!(compared === undefined
  12542. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  12543. : compared
  12544. )) {
  12545. result = false;
  12546. break;
  12547. }
  12548. skipCtor || (skipCtor = key == 'constructor');
  12549. }
  12550. if (result && !skipCtor) {
  12551. var objCtor = object.constructor,
  12552. othCtor = other.constructor;
  12553. // Non `Object` object instances with different constructors are not equal.
  12554. if (objCtor != othCtor &&
  12555. ('constructor' in object && 'constructor' in other) &&
  12556. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  12557. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  12558. result = false;
  12559. }
  12560. }
  12561. stack['delete'](object);
  12562. stack['delete'](other);
  12563. return result;
  12564. }
  12565. /**
  12566. * A specialized version of `baseRest` which flattens the rest array.
  12567. *
  12568. * @private
  12569. * @param {Function} func The function to apply a rest parameter to.
  12570. * @returns {Function} Returns the new function.
  12571. */
  12572. function flatRest(func) {
  12573. return setToString(overRest(func, undefined, flatten), func + '');
  12574. }
  12575. /**
  12576. * Creates an array of own enumerable property names and symbols of `object`.
  12577. *
  12578. * @private
  12579. * @param {Object} object The object to query.
  12580. * @returns {Array} Returns the array of property names and symbols.
  12581. */
  12582. function getAllKeys(object) {
  12583. return baseGetAllKeys(object, keys, getSymbols);
  12584. }
  12585. /**
  12586. * Creates an array of own and inherited enumerable property names and
  12587. * symbols of `object`.
  12588. *
  12589. * @private
  12590. * @param {Object} object The object to query.
  12591. * @returns {Array} Returns the array of property names and symbols.
  12592. */
  12593. function getAllKeysIn(object) {
  12594. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  12595. }
  12596. /**
  12597. * Gets metadata for `func`.
  12598. *
  12599. * @private
  12600. * @param {Function} func The function to query.
  12601. * @returns {*} Returns the metadata for `func`.
  12602. */
  12603. var getData = !metaMap ? noop : function(func) {
  12604. return metaMap.get(func);
  12605. };
  12606. /**
  12607. * Gets the name of `func`.
  12608. *
  12609. * @private
  12610. * @param {Function} func The function to query.
  12611. * @returns {string} Returns the function name.
  12612. */
  12613. function getFuncName(func) {
  12614. var result = (func.name + ''),
  12615. array = realNames[result],
  12616. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  12617. while (length--) {
  12618. var data = array[length],
  12619. otherFunc = data.func;
  12620. if (otherFunc == null || otherFunc == func) {
  12621. return data.name;
  12622. }
  12623. }
  12624. return result;
  12625. }
  12626. /**
  12627. * Gets the argument placeholder value for `func`.
  12628. *
  12629. * @private
  12630. * @param {Function} func The function to inspect.
  12631. * @returns {*} Returns the placeholder value.
  12632. */
  12633. function getHolder(func) {
  12634. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  12635. return object.placeholder;
  12636. }
  12637. /**
  12638. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  12639. * this function returns the custom method, otherwise it returns `baseIteratee`.
  12640. * If arguments are provided, the chosen function is invoked with them and
  12641. * its result is returned.
  12642. *
  12643. * @private
  12644. * @param {*} [value] The value to convert to an iteratee.
  12645. * @param {number} [arity] The arity of the created iteratee.
  12646. * @returns {Function} Returns the chosen function or its result.
  12647. */
  12648. function getIteratee() {
  12649. var result = lodash.iteratee || iteratee;
  12650. result = result === iteratee ? baseIteratee : result;
  12651. return arguments.length ? result(arguments[0], arguments[1]) : result;
  12652. }
  12653. /**
  12654. * Gets the data for `map`.
  12655. *
  12656. * @private
  12657. * @param {Object} map The map to query.
  12658. * @param {string} key The reference key.
  12659. * @returns {*} Returns the map data.
  12660. */
  12661. function getMapData(map, key) {
  12662. var data = map.__data__;
  12663. return isKeyable(key)
  12664. ? data[typeof key == 'string' ? 'string' : 'hash']
  12665. : data.map;
  12666. }
  12667. /**
  12668. * Gets the property names, values, and compare flags of `object`.
  12669. *
  12670. * @private
  12671. * @param {Object} object The object to query.
  12672. * @returns {Array} Returns the match data of `object`.
  12673. */
  12674. function getMatchData(object) {
  12675. var result = keys(object),
  12676. length = result.length;
  12677. while (length--) {
  12678. var key = result[length],
  12679. value = object[key];
  12680. result[length] = [key, value, isStrictComparable(value)];
  12681. }
  12682. return result;
  12683. }
  12684. /**
  12685. * Gets the native function at `key` of `object`.
  12686. *
  12687. * @private
  12688. * @param {Object} object The object to query.
  12689. * @param {string} key The key of the method to get.
  12690. * @returns {*} Returns the function if it's native, else `undefined`.
  12691. */
  12692. function getNative(object, key) {
  12693. var value = getValue(object, key);
  12694. return baseIsNative(value) ? value : undefined;
  12695. }
  12696. /**
  12697. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  12698. *
  12699. * @private
  12700. * @param {*} value The value to query.
  12701. * @returns {string} Returns the raw `toStringTag`.
  12702. */
  12703. function getRawTag(value) {
  12704. var isOwn = hasOwnProperty.call(value, symToStringTag),
  12705. tag = value[symToStringTag];
  12706. try {
  12707. value[symToStringTag] = undefined;
  12708. var unmasked = true;
  12709. } catch (e) {}
  12710. var result = nativeObjectToString.call(value);
  12711. if (unmasked) {
  12712. if (isOwn) {
  12713. value[symToStringTag] = tag;
  12714. } else {
  12715. delete value[symToStringTag];
  12716. }
  12717. }
  12718. return result;
  12719. }
  12720. /**
  12721. * Creates an array of the own enumerable symbols of `object`.
  12722. *
  12723. * @private
  12724. * @param {Object} object The object to query.
  12725. * @returns {Array} Returns the array of symbols.
  12726. */
  12727. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  12728. if (object == null) {
  12729. return [];
  12730. }
  12731. object = Object(object);
  12732. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  12733. return propertyIsEnumerable.call(object, symbol);
  12734. });
  12735. };
  12736. /**
  12737. * Creates an array of the own and inherited enumerable symbols of `object`.
  12738. *
  12739. * @private
  12740. * @param {Object} object The object to query.
  12741. * @returns {Array} Returns the array of symbols.
  12742. */
  12743. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  12744. var result = [];
  12745. while (object) {
  12746. arrayPush(result, getSymbols(object));
  12747. object = getPrototype(object);
  12748. }
  12749. return result;
  12750. };
  12751. /**
  12752. * Gets the `toStringTag` of `value`.
  12753. *
  12754. * @private
  12755. * @param {*} value The value to query.
  12756. * @returns {string} Returns the `toStringTag`.
  12757. */
  12758. var getTag = baseGetTag;
  12759. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  12760. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  12761. (Map && getTag(new Map) != mapTag) ||
  12762. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  12763. (Set && getTag(new Set) != setTag) ||
  12764. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  12765. getTag = function(value) {
  12766. var result = baseGetTag(value),
  12767. Ctor = result == objectTag ? value.constructor : undefined,
  12768. ctorString = Ctor ? toSource(Ctor) : '';
  12769. if (ctorString) {
  12770. switch (ctorString) {
  12771. case dataViewCtorString: return dataViewTag;
  12772. case mapCtorString: return mapTag;
  12773. case promiseCtorString: return promiseTag;
  12774. case setCtorString: return setTag;
  12775. case weakMapCtorString: return weakMapTag;
  12776. }
  12777. }
  12778. return result;
  12779. };
  12780. }
  12781. /**
  12782. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  12783. *
  12784. * @private
  12785. * @param {number} start The start of the view.
  12786. * @param {number} end The end of the view.
  12787. * @param {Array} transforms The transformations to apply to the view.
  12788. * @returns {Object} Returns an object containing the `start` and `end`
  12789. * positions of the view.
  12790. */
  12791. function getView(start, end, transforms) {
  12792. var index = -1,
  12793. length = transforms.length;
  12794. while (++index < length) {
  12795. var data = transforms[index],
  12796. size = data.size;
  12797. switch (data.type) {
  12798. case 'drop': start += size; break;
  12799. case 'dropRight': end -= size; break;
  12800. case 'take': end = nativeMin(end, start + size); break;
  12801. case 'takeRight': start = nativeMax(start, end - size); break;
  12802. }
  12803. }
  12804. return { 'start': start, 'end': end };
  12805. }
  12806. /**
  12807. * Extracts wrapper details from the `source` body comment.
  12808. *
  12809. * @private
  12810. * @param {string} source The source to inspect.
  12811. * @returns {Array} Returns the wrapper details.
  12812. */
  12813. function getWrapDetails(source) {
  12814. var match = source.match(reWrapDetails);
  12815. return match ? match[1].split(reSplitDetails) : [];
  12816. }
  12817. /**
  12818. * Checks if `path` exists on `object`.
  12819. *
  12820. * @private
  12821. * @param {Object} object The object to query.
  12822. * @param {Array|string} path The path to check.
  12823. * @param {Function} hasFunc The function to check properties.
  12824. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  12825. */
  12826. function hasPath(object, path, hasFunc) {
  12827. path = castPath(path, object);
  12828. var index = -1,
  12829. length = path.length,
  12830. result = false;
  12831. while (++index < length) {
  12832. var key = toKey(path[index]);
  12833. if (!(result = object != null && hasFunc(object, key))) {
  12834. break;
  12835. }
  12836. object = object[key];
  12837. }
  12838. if (result || ++index != length) {
  12839. return result;
  12840. }
  12841. length = object == null ? 0 : object.length;
  12842. return !!length && isLength(length) && isIndex(key, length) &&
  12843. (isArray(object) || isArguments(object));
  12844. }
  12845. /**
  12846. * Initializes an array clone.
  12847. *
  12848. * @private
  12849. * @param {Array} array The array to clone.
  12850. * @returns {Array} Returns the initialized clone.
  12851. */
  12852. function initCloneArray(array) {
  12853. var length = array.length,
  12854. result = new array.constructor(length);
  12855. // Add properties assigned by `RegExp#exec`.
  12856. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  12857. result.index = array.index;
  12858. result.input = array.input;
  12859. }
  12860. return result;
  12861. }
  12862. /**
  12863. * Initializes an object clone.
  12864. *
  12865. * @private
  12866. * @param {Object} object The object to clone.
  12867. * @returns {Object} Returns the initialized clone.
  12868. */
  12869. function initCloneObject(object) {
  12870. return (typeof object.constructor == 'function' && !isPrototype(object))
  12871. ? baseCreate(getPrototype(object))
  12872. : {};
  12873. }
  12874. /**
  12875. * Initializes an object clone based on its `toStringTag`.
  12876. *
  12877. * **Note:** This function only supports cloning values with tags of
  12878. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  12879. *
  12880. * @private
  12881. * @param {Object} object The object to clone.
  12882. * @param {string} tag The `toStringTag` of the object to clone.
  12883. * @param {boolean} [isDeep] Specify a deep clone.
  12884. * @returns {Object} Returns the initialized clone.
  12885. */
  12886. function initCloneByTag(object, tag, isDeep) {
  12887. var Ctor = object.constructor;
  12888. switch (tag) {
  12889. case arrayBufferTag:
  12890. return cloneArrayBuffer(object);
  12891. case boolTag:
  12892. case dateTag:
  12893. return new Ctor(+object);
  12894. case dataViewTag:
  12895. return cloneDataView(object, isDeep);
  12896. case float32Tag: case float64Tag:
  12897. case int8Tag: case int16Tag: case int32Tag:
  12898. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  12899. return cloneTypedArray(object, isDeep);
  12900. case mapTag:
  12901. return new Ctor;
  12902. case numberTag:
  12903. case stringTag:
  12904. return new Ctor(object);
  12905. case regexpTag:
  12906. return cloneRegExp(object);
  12907. case setTag:
  12908. return new Ctor;
  12909. case symbolTag:
  12910. return cloneSymbol(object);
  12911. }
  12912. }
  12913. /**
  12914. * Inserts wrapper `details` in a comment at the top of the `source` body.
  12915. *
  12916. * @private
  12917. * @param {string} source The source to modify.
  12918. * @returns {Array} details The details to insert.
  12919. * @returns {string} Returns the modified source.
  12920. */
  12921. function insertWrapDetails(source, details) {
  12922. var length = details.length;
  12923. if (!length) {
  12924. return source;
  12925. }
  12926. var lastIndex = length - 1;
  12927. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  12928. details = details.join(length > 2 ? ', ' : ' ');
  12929. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  12930. }
  12931. /**
  12932. * Checks if `value` is a flattenable `arguments` object or array.
  12933. *
  12934. * @private
  12935. * @param {*} value The value to check.
  12936. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  12937. */
  12938. function isFlattenable(value) {
  12939. return isArray(value) || isArguments(value) ||
  12940. !!(spreadableSymbol && value && value[spreadableSymbol]);
  12941. }
  12942. /**
  12943. * Checks if `value` is a valid array-like index.
  12944. *
  12945. * @private
  12946. * @param {*} value The value to check.
  12947. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  12948. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  12949. */
  12950. function isIndex(value, length) {
  12951. var type = typeof value;
  12952. length = length == null ? MAX_SAFE_INTEGER : length;
  12953. return !!length &&
  12954. (type == 'number' ||
  12955. (type != 'symbol' && reIsUint.test(value))) &&
  12956. (value > -1 && value % 1 == 0 && value < length);
  12957. }
  12958. /**
  12959. * Checks if the given arguments are from an iteratee call.
  12960. *
  12961. * @private
  12962. * @param {*} value The potential iteratee value argument.
  12963. * @param {*} index The potential iteratee index or key argument.
  12964. * @param {*} object The potential iteratee object argument.
  12965. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  12966. * else `false`.
  12967. */
  12968. function isIterateeCall(value, index, object) {
  12969. if (!isObject(object)) {
  12970. return false;
  12971. }
  12972. var type = typeof index;
  12973. if (type == 'number'
  12974. ? (isArrayLike(object) && isIndex(index, object.length))
  12975. : (type == 'string' && index in object)
  12976. ) {
  12977. return eq(object[index], value);
  12978. }
  12979. return false;
  12980. }
  12981. /**
  12982. * Checks if `value` is a property name and not a property path.
  12983. *
  12984. * @private
  12985. * @param {*} value The value to check.
  12986. * @param {Object} [object] The object to query keys on.
  12987. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12988. */
  12989. function isKey(value, object) {
  12990. if (isArray(value)) {
  12991. return false;
  12992. }
  12993. var type = typeof value;
  12994. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12995. value == null || isSymbol(value)) {
  12996. return true;
  12997. }
  12998. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12999. (object != null && value in Object(object));
  13000. }
  13001. /**
  13002. * Checks if `value` is suitable for use as unique object key.
  13003. *
  13004. * @private
  13005. * @param {*} value The value to check.
  13006. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  13007. */
  13008. function isKeyable(value) {
  13009. var type = typeof value;
  13010. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  13011. ? (value !== '__proto__')
  13012. : (value === null);
  13013. }
  13014. /**
  13015. * Checks if `func` has a lazy counterpart.
  13016. *
  13017. * @private
  13018. * @param {Function} func The function to check.
  13019. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  13020. * else `false`.
  13021. */
  13022. function isLaziable(func) {
  13023. var funcName = getFuncName(func),
  13024. other = lodash[funcName];
  13025. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  13026. return false;
  13027. }
  13028. if (func === other) {
  13029. return true;
  13030. }
  13031. var data = getData(other);
  13032. return !!data && func === data[0];
  13033. }
  13034. /**
  13035. * Checks if `func` has its source masked.
  13036. *
  13037. * @private
  13038. * @param {Function} func The function to check.
  13039. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  13040. */
  13041. function isMasked(func) {
  13042. return !!maskSrcKey && (maskSrcKey in func);
  13043. }
  13044. /**
  13045. * Checks if `func` is capable of being masked.
  13046. *
  13047. * @private
  13048. * @param {*} value The value to check.
  13049. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  13050. */
  13051. var isMaskable = coreJsData ? isFunction : stubFalse;
  13052. /**
  13053. * Checks if `value` is likely a prototype object.
  13054. *
  13055. * @private
  13056. * @param {*} value The value to check.
  13057. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  13058. */
  13059. function isPrototype(value) {
  13060. var Ctor = value && value.constructor,
  13061. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  13062. return value === proto;
  13063. }
  13064. /**
  13065. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  13066. *
  13067. * @private
  13068. * @param {*} value The value to check.
  13069. * @returns {boolean} Returns `true` if `value` if suitable for strict
  13070. * equality comparisons, else `false`.
  13071. */
  13072. function isStrictComparable(value) {
  13073. return value === value && !isObject(value);
  13074. }
  13075. /**
  13076. * A specialized version of `matchesProperty` for source values suitable
  13077. * for strict equality comparisons, i.e. `===`.
  13078. *
  13079. * @private
  13080. * @param {string} key The key of the property to get.
  13081. * @param {*} srcValue The value to match.
  13082. * @returns {Function} Returns the new spec function.
  13083. */
  13084. function matchesStrictComparable(key, srcValue) {
  13085. return function(object) {
  13086. if (object == null) {
  13087. return false;
  13088. }
  13089. return object[key] === srcValue &&
  13090. (srcValue !== undefined || (key in Object(object)));
  13091. };
  13092. }
  13093. /**
  13094. * A specialized version of `_.memoize` which clears the memoized function's
  13095. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  13096. *
  13097. * @private
  13098. * @param {Function} func The function to have its output memoized.
  13099. * @returns {Function} Returns the new memoized function.
  13100. */
  13101. function memoizeCapped(func) {
  13102. var result = memoize(func, function(key) {
  13103. if (cache.size === MAX_MEMOIZE_SIZE) {
  13104. cache.clear();
  13105. }
  13106. return key;
  13107. });
  13108. var cache = result.cache;
  13109. return result;
  13110. }
  13111. /**
  13112. * Merges the function metadata of `source` into `data`.
  13113. *
  13114. * Merging metadata reduces the number of wrappers used to invoke a function.
  13115. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  13116. * may be applied regardless of execution order. Methods like `_.ary` and
  13117. * `_.rearg` modify function arguments, making the order in which they are
  13118. * executed important, preventing the merging of metadata. However, we make
  13119. * an exception for a safe combined case where curried functions have `_.ary`
  13120. * and or `_.rearg` applied.
  13121. *
  13122. * @private
  13123. * @param {Array} data The destination metadata.
  13124. * @param {Array} source The source metadata.
  13125. * @returns {Array} Returns `data`.
  13126. */
  13127. function mergeData(data, source) {
  13128. var bitmask = data[1],
  13129. srcBitmask = source[1],
  13130. newBitmask = bitmask | srcBitmask,
  13131. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  13132. var isCombo =
  13133. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  13134. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  13135. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  13136. // Exit early if metadata can't be merged.
  13137. if (!(isCommon || isCombo)) {
  13138. return data;
  13139. }
  13140. // Use source `thisArg` if available.
  13141. if (srcBitmask & WRAP_BIND_FLAG) {
  13142. data[2] = source[2];
  13143. // Set when currying a bound function.
  13144. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  13145. }
  13146. // Compose partial arguments.
  13147. var value = source[3];
  13148. if (value) {
  13149. var partials = data[3];
  13150. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  13151. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  13152. }
  13153. // Compose partial right arguments.
  13154. value = source[5];
  13155. if (value) {
  13156. partials = data[5];
  13157. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  13158. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  13159. }
  13160. // Use source `argPos` if available.
  13161. value = source[7];
  13162. if (value) {
  13163. data[7] = value;
  13164. }
  13165. // Use source `ary` if it's smaller.
  13166. if (srcBitmask & WRAP_ARY_FLAG) {
  13167. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  13168. }
  13169. // Use source `arity` if one is not provided.
  13170. if (data[9] == null) {
  13171. data[9] = source[9];
  13172. }
  13173. // Use source `func` and merge bitmasks.
  13174. data[0] = source[0];
  13175. data[1] = newBitmask;
  13176. return data;
  13177. }
  13178. /**
  13179. * This function is like
  13180. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13181. * except that it includes inherited enumerable properties.
  13182. *
  13183. * @private
  13184. * @param {Object} object The object to query.
  13185. * @returns {Array} Returns the array of property names.
  13186. */
  13187. function nativeKeysIn(object) {
  13188. var result = [];
  13189. if (object != null) {
  13190. for (var key in Object(object)) {
  13191. result.push(key);
  13192. }
  13193. }
  13194. return result;
  13195. }
  13196. /**
  13197. * Converts `value` to a string using `Object.prototype.toString`.
  13198. *
  13199. * @private
  13200. * @param {*} value The value to convert.
  13201. * @returns {string} Returns the converted string.
  13202. */
  13203. function objectToString(value) {
  13204. return nativeObjectToString.call(value);
  13205. }
  13206. /**
  13207. * A specialized version of `baseRest` which transforms the rest array.
  13208. *
  13209. * @private
  13210. * @param {Function} func The function to apply a rest parameter to.
  13211. * @param {number} [start=func.length-1] The start position of the rest parameter.
  13212. * @param {Function} transform The rest array transform.
  13213. * @returns {Function} Returns the new function.
  13214. */
  13215. function overRest(func, start, transform) {
  13216. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  13217. return function() {
  13218. var args = arguments,
  13219. index = -1,
  13220. length = nativeMax(args.length - start, 0),
  13221. array = Array(length);
  13222. while (++index < length) {
  13223. array[index] = args[start + index];
  13224. }
  13225. index = -1;
  13226. var otherArgs = Array(start + 1);
  13227. while (++index < start) {
  13228. otherArgs[index] = args[index];
  13229. }
  13230. otherArgs[start] = transform(array);
  13231. return apply(func, this, otherArgs);
  13232. };
  13233. }
  13234. /**
  13235. * Gets the parent value at `path` of `object`.
  13236. *
  13237. * @private
  13238. * @param {Object} object The object to query.
  13239. * @param {Array} path The path to get the parent value of.
  13240. * @returns {*} Returns the parent value.
  13241. */
  13242. function parent(object, path) {
  13243. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  13244. }
  13245. /**
  13246. * Reorder `array` according to the specified indexes where the element at
  13247. * the first index is assigned as the first element, the element at
  13248. * the second index is assigned as the second element, and so on.
  13249. *
  13250. * @private
  13251. * @param {Array} array The array to reorder.
  13252. * @param {Array} indexes The arranged array indexes.
  13253. * @returns {Array} Returns `array`.
  13254. */
  13255. function reorder(array, indexes) {
  13256. var arrLength = array.length,
  13257. length = nativeMin(indexes.length, arrLength),
  13258. oldArray = copyArray(array);
  13259. while (length--) {
  13260. var index = indexes[length];
  13261. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  13262. }
  13263. return array;
  13264. }
  13265. /**
  13266. * Sets metadata for `func`.
  13267. *
  13268. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  13269. * period of time, it will trip its breaker and transition to an identity
  13270. * function to avoid garbage collection pauses in V8. See
  13271. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  13272. * for more details.
  13273. *
  13274. * @private
  13275. * @param {Function} func The function to associate metadata with.
  13276. * @param {*} data The metadata.
  13277. * @returns {Function} Returns `func`.
  13278. */
  13279. var setData = shortOut(baseSetData);
  13280. /**
  13281. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  13282. *
  13283. * @private
  13284. * @param {Function} func The function to delay.
  13285. * @param {number} wait The number of milliseconds to delay invocation.
  13286. * @returns {number|Object} Returns the timer id or timeout object.
  13287. */
  13288. var setTimeout = ctxSetTimeout || function(func, wait) {
  13289. return root.setTimeout(func, wait);
  13290. };
  13291. /**
  13292. * Sets the `toString` method of `func` to return `string`.
  13293. *
  13294. * @private
  13295. * @param {Function} func The function to modify.
  13296. * @param {Function} string The `toString` result.
  13297. * @returns {Function} Returns `func`.
  13298. */
  13299. var setToString = shortOut(baseSetToString);
  13300. /**
  13301. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  13302. * with wrapper details in a comment at the top of the source body.
  13303. *
  13304. * @private
  13305. * @param {Function} wrapper The function to modify.
  13306. * @param {Function} reference The reference function.
  13307. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  13308. * @returns {Function} Returns `wrapper`.
  13309. */
  13310. function setWrapToString(wrapper, reference, bitmask) {
  13311. var source = (reference + '');
  13312. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  13313. }
  13314. /**
  13315. * Creates a function that'll short out and invoke `identity` instead
  13316. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  13317. * milliseconds.
  13318. *
  13319. * @private
  13320. * @param {Function} func The function to restrict.
  13321. * @returns {Function} Returns the new shortable function.
  13322. */
  13323. function shortOut(func) {
  13324. var count = 0,
  13325. lastCalled = 0;
  13326. return function() {
  13327. var stamp = nativeNow(),
  13328. remaining = HOT_SPAN - (stamp - lastCalled);
  13329. lastCalled = stamp;
  13330. if (remaining > 0) {
  13331. if (++count >= HOT_COUNT) {
  13332. return arguments[0];
  13333. }
  13334. } else {
  13335. count = 0;
  13336. }
  13337. return func.apply(undefined, arguments);
  13338. };
  13339. }
  13340. /**
  13341. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  13342. *
  13343. * @private
  13344. * @param {Array} array The array to shuffle.
  13345. * @param {number} [size=array.length] The size of `array`.
  13346. * @returns {Array} Returns `array`.
  13347. */
  13348. function shuffleSelf(array, size) {
  13349. var index = -1,
  13350. length = array.length,
  13351. lastIndex = length - 1;
  13352. size = size === undefined ? length : size;
  13353. while (++index < size) {
  13354. var rand = baseRandom(index, lastIndex),
  13355. value = array[rand];
  13356. array[rand] = array[index];
  13357. array[index] = value;
  13358. }
  13359. array.length = size;
  13360. return array;
  13361. }
  13362. /**
  13363. * Converts `string` to a property path array.
  13364. *
  13365. * @private
  13366. * @param {string} string The string to convert.
  13367. * @returns {Array} Returns the property path array.
  13368. */
  13369. var stringToPath = memoizeCapped(function(string) {
  13370. var result = [];
  13371. if (string.charCodeAt(0) === 46 /* . */) {
  13372. result.push('');
  13373. }
  13374. string.replace(rePropName, function(match, number, quote, subString) {
  13375. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  13376. });
  13377. return result;
  13378. });
  13379. /**
  13380. * Converts `value` to a string key if it's not a string or symbol.
  13381. *
  13382. * @private
  13383. * @param {*} value The value to inspect.
  13384. * @returns {string|symbol} Returns the key.
  13385. */
  13386. function toKey(value) {
  13387. if (typeof value == 'string' || isSymbol(value)) {
  13388. return value;
  13389. }
  13390. var result = (value + '');
  13391. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  13392. }
  13393. /**
  13394. * Converts `func` to its source code.
  13395. *
  13396. * @private
  13397. * @param {Function} func The function to convert.
  13398. * @returns {string} Returns the source code.
  13399. */
  13400. function toSource(func) {
  13401. if (func != null) {
  13402. try {
  13403. return funcToString.call(func);
  13404. } catch (e) {}
  13405. try {
  13406. return (func + '');
  13407. } catch (e) {}
  13408. }
  13409. return '';
  13410. }
  13411. /**
  13412. * Updates wrapper `details` based on `bitmask` flags.
  13413. *
  13414. * @private
  13415. * @returns {Array} details The details to modify.
  13416. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  13417. * @returns {Array} Returns `details`.
  13418. */
  13419. function updateWrapDetails(details, bitmask) {
  13420. arrayEach(wrapFlags, function(pair) {
  13421. var value = '_.' + pair[0];
  13422. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  13423. details.push(value);
  13424. }
  13425. });
  13426. return details.sort();
  13427. }
  13428. /**
  13429. * Creates a clone of `wrapper`.
  13430. *
  13431. * @private
  13432. * @param {Object} wrapper The wrapper to clone.
  13433. * @returns {Object} Returns the cloned wrapper.
  13434. */
  13435. function wrapperClone(wrapper) {
  13436. if (wrapper instanceof LazyWrapper) {
  13437. return wrapper.clone();
  13438. }
  13439. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  13440. result.__actions__ = copyArray(wrapper.__actions__);
  13441. result.__index__ = wrapper.__index__;
  13442. result.__values__ = wrapper.__values__;
  13443. return result;
  13444. }
  13445. /*------------------------------------------------------------------------*/
  13446. /**
  13447. * Creates an array of elements split into groups the length of `size`.
  13448. * If `array` can't be split evenly, the final chunk will be the remaining
  13449. * elements.
  13450. *
  13451. * @static
  13452. * @memberOf _
  13453. * @since 3.0.0
  13454. * @category Array
  13455. * @param {Array} array The array to process.
  13456. * @param {number} [size=1] The length of each chunk
  13457. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  13458. * @returns {Array} Returns the new array of chunks.
  13459. * @example
  13460. *
  13461. * _.chunk(['a', 'b', 'c', 'd'], 2);
  13462. * // => [['a', 'b'], ['c', 'd']]
  13463. *
  13464. * _.chunk(['a', 'b', 'c', 'd'], 3);
  13465. * // => [['a', 'b', 'c'], ['d']]
  13466. */
  13467. function chunk(array, size, guard) {
  13468. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  13469. size = 1;
  13470. } else {
  13471. size = nativeMax(toInteger(size), 0);
  13472. }
  13473. var length = array == null ? 0 : array.length;
  13474. if (!length || size < 1) {
  13475. return [];
  13476. }
  13477. var index = 0,
  13478. resIndex = 0,
  13479. result = Array(nativeCeil(length / size));
  13480. while (index < length) {
  13481. result[resIndex++] = baseSlice(array, index, (index += size));
  13482. }
  13483. return result;
  13484. }
  13485. /**
  13486. * Creates an array with all falsey values removed. The values `false`, `null`,
  13487. * `0`, `""`, `undefined`, and `NaN` are falsey.
  13488. *
  13489. * @static
  13490. * @memberOf _
  13491. * @since 0.1.0
  13492. * @category Array
  13493. * @param {Array} array The array to compact.
  13494. * @returns {Array} Returns the new array of filtered values.
  13495. * @example
  13496. *
  13497. * _.compact([0, 1, false, 2, '', 3]);
  13498. * // => [1, 2, 3]
  13499. */
  13500. function compact(array) {
  13501. var index = -1,
  13502. length = array == null ? 0 : array.length,
  13503. resIndex = 0,
  13504. result = [];
  13505. while (++index < length) {
  13506. var value = array[index];
  13507. if (value) {
  13508. result[resIndex++] = value;
  13509. }
  13510. }
  13511. return result;
  13512. }
  13513. /**
  13514. * Creates a new array concatenating `array` with any additional arrays
  13515. * and/or values.
  13516. *
  13517. * @static
  13518. * @memberOf _
  13519. * @since 4.0.0
  13520. * @category Array
  13521. * @param {Array} array The array to concatenate.
  13522. * @param {...*} [values] The values to concatenate.
  13523. * @returns {Array} Returns the new concatenated array.
  13524. * @example
  13525. *
  13526. * var array = [1];
  13527. * var other = _.concat(array, 2, [3], [[4]]);
  13528. *
  13529. * console.log(other);
  13530. * // => [1, 2, 3, [4]]
  13531. *
  13532. * console.log(array);
  13533. * // => [1]
  13534. */
  13535. function concat() {
  13536. var length = arguments.length;
  13537. if (!length) {
  13538. return [];
  13539. }
  13540. var args = Array(length - 1),
  13541. array = arguments[0],
  13542. index = length;
  13543. while (index--) {
  13544. args[index - 1] = arguments[index];
  13545. }
  13546. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  13547. }
  13548. /**
  13549. * Creates an array of `array` values not included in the other given arrays
  13550. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13551. * for equality comparisons. The order and references of result values are
  13552. * determined by the first array.
  13553. *
  13554. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  13555. *
  13556. * @static
  13557. * @memberOf _
  13558. * @since 0.1.0
  13559. * @category Array
  13560. * @param {Array} array The array to inspect.
  13561. * @param {...Array} [values] The values to exclude.
  13562. * @returns {Array} Returns the new array of filtered values.
  13563. * @see _.without, _.xor
  13564. * @example
  13565. *
  13566. * _.difference([2, 1], [2, 3]);
  13567. * // => [1]
  13568. */
  13569. var difference = baseRest(function(array, values) {
  13570. return isArrayLikeObject(array)
  13571. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  13572. : [];
  13573. });
  13574. /**
  13575. * This method is like `_.difference` except that it accepts `iteratee` which
  13576. * is invoked for each element of `array` and `values` to generate the criterion
  13577. * by which they're compared. The order and references of result values are
  13578. * determined by the first array. The iteratee is invoked with one argument:
  13579. * (value).
  13580. *
  13581. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  13582. *
  13583. * @static
  13584. * @memberOf _
  13585. * @since 4.0.0
  13586. * @category Array
  13587. * @param {Array} array The array to inspect.
  13588. * @param {...Array} [values] The values to exclude.
  13589. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13590. * @returns {Array} Returns the new array of filtered values.
  13591. * @example
  13592. *
  13593. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  13594. * // => [1.2]
  13595. *
  13596. * // The `_.property` iteratee shorthand.
  13597. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  13598. * // => [{ 'x': 2 }]
  13599. */
  13600. var differenceBy = baseRest(function(array, values) {
  13601. var iteratee = last(values);
  13602. if (isArrayLikeObject(iteratee)) {
  13603. iteratee = undefined;
  13604. }
  13605. return isArrayLikeObject(array)
  13606. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  13607. : [];
  13608. });
  13609. /**
  13610. * This method is like `_.difference` except that it accepts `comparator`
  13611. * which is invoked to compare elements of `array` to `values`. The order and
  13612. * references of result values are determined by the first array. The comparator
  13613. * is invoked with two arguments: (arrVal, othVal).
  13614. *
  13615. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  13616. *
  13617. * @static
  13618. * @memberOf _
  13619. * @since 4.0.0
  13620. * @category Array
  13621. * @param {Array} array The array to inspect.
  13622. * @param {...Array} [values] The values to exclude.
  13623. * @param {Function} [comparator] The comparator invoked per element.
  13624. * @returns {Array} Returns the new array of filtered values.
  13625. * @example
  13626. *
  13627. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  13628. *
  13629. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  13630. * // => [{ 'x': 2, 'y': 1 }]
  13631. */
  13632. var differenceWith = baseRest(function(array, values) {
  13633. var comparator = last(values);
  13634. if (isArrayLikeObject(comparator)) {
  13635. comparator = undefined;
  13636. }
  13637. return isArrayLikeObject(array)
  13638. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  13639. : [];
  13640. });
  13641. /**
  13642. * Creates a slice of `array` with `n` elements dropped from the beginning.
  13643. *
  13644. * @static
  13645. * @memberOf _
  13646. * @since 0.5.0
  13647. * @category Array
  13648. * @param {Array} array The array to query.
  13649. * @param {number} [n=1] The number of elements to drop.
  13650. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  13651. * @returns {Array} Returns the slice of `array`.
  13652. * @example
  13653. *
  13654. * _.drop([1, 2, 3]);
  13655. * // => [2, 3]
  13656. *
  13657. * _.drop([1, 2, 3], 2);
  13658. * // => [3]
  13659. *
  13660. * _.drop([1, 2, 3], 5);
  13661. * // => []
  13662. *
  13663. * _.drop([1, 2, 3], 0);
  13664. * // => [1, 2, 3]
  13665. */
  13666. function drop(array, n, guard) {
  13667. var length = array == null ? 0 : array.length;
  13668. if (!length) {
  13669. return [];
  13670. }
  13671. n = (guard || n === undefined) ? 1 : toInteger(n);
  13672. return baseSlice(array, n < 0 ? 0 : n, length);
  13673. }
  13674. /**
  13675. * Creates a slice of `array` with `n` elements dropped from the end.
  13676. *
  13677. * @static
  13678. * @memberOf _
  13679. * @since 3.0.0
  13680. * @category Array
  13681. * @param {Array} array The array to query.
  13682. * @param {number} [n=1] The number of elements to drop.
  13683. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  13684. * @returns {Array} Returns the slice of `array`.
  13685. * @example
  13686. *
  13687. * _.dropRight([1, 2, 3]);
  13688. * // => [1, 2]
  13689. *
  13690. * _.dropRight([1, 2, 3], 2);
  13691. * // => [1]
  13692. *
  13693. * _.dropRight([1, 2, 3], 5);
  13694. * // => []
  13695. *
  13696. * _.dropRight([1, 2, 3], 0);
  13697. * // => [1, 2, 3]
  13698. */
  13699. function dropRight(array, n, guard) {
  13700. var length = array == null ? 0 : array.length;
  13701. if (!length) {
  13702. return [];
  13703. }
  13704. n = (guard || n === undefined) ? 1 : toInteger(n);
  13705. n = length - n;
  13706. return baseSlice(array, 0, n < 0 ? 0 : n);
  13707. }
  13708. /**
  13709. * Creates a slice of `array` excluding elements dropped from the end.
  13710. * Elements are dropped until `predicate` returns falsey. The predicate is
  13711. * invoked with three arguments: (value, index, array).
  13712. *
  13713. * @static
  13714. * @memberOf _
  13715. * @since 3.0.0
  13716. * @category Array
  13717. * @param {Array} array The array to query.
  13718. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13719. * @returns {Array} Returns the slice of `array`.
  13720. * @example
  13721. *
  13722. * var users = [
  13723. * { 'user': 'barney', 'active': true },
  13724. * { 'user': 'fred', 'active': false },
  13725. * { 'user': 'pebbles', 'active': false }
  13726. * ];
  13727. *
  13728. * _.dropRightWhile(users, function(o) { return !o.active; });
  13729. * // => objects for ['barney']
  13730. *
  13731. * // The `_.matches` iteratee shorthand.
  13732. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  13733. * // => objects for ['barney', 'fred']
  13734. *
  13735. * // The `_.matchesProperty` iteratee shorthand.
  13736. * _.dropRightWhile(users, ['active', false]);
  13737. * // => objects for ['barney']
  13738. *
  13739. * // The `_.property` iteratee shorthand.
  13740. * _.dropRightWhile(users, 'active');
  13741. * // => objects for ['barney', 'fred', 'pebbles']
  13742. */
  13743. function dropRightWhile(array, predicate) {
  13744. return (array && array.length)
  13745. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  13746. : [];
  13747. }
  13748. /**
  13749. * Creates a slice of `array` excluding elements dropped from the beginning.
  13750. * Elements are dropped until `predicate` returns falsey. The predicate is
  13751. * invoked with three arguments: (value, index, array).
  13752. *
  13753. * @static
  13754. * @memberOf _
  13755. * @since 3.0.0
  13756. * @category Array
  13757. * @param {Array} array The array to query.
  13758. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13759. * @returns {Array} Returns the slice of `array`.
  13760. * @example
  13761. *
  13762. * var users = [
  13763. * { 'user': 'barney', 'active': false },
  13764. * { 'user': 'fred', 'active': false },
  13765. * { 'user': 'pebbles', 'active': true }
  13766. * ];
  13767. *
  13768. * _.dropWhile(users, function(o) { return !o.active; });
  13769. * // => objects for ['pebbles']
  13770. *
  13771. * // The `_.matches` iteratee shorthand.
  13772. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  13773. * // => objects for ['fred', 'pebbles']
  13774. *
  13775. * // The `_.matchesProperty` iteratee shorthand.
  13776. * _.dropWhile(users, ['active', false]);
  13777. * // => objects for ['pebbles']
  13778. *
  13779. * // The `_.property` iteratee shorthand.
  13780. * _.dropWhile(users, 'active');
  13781. * // => objects for ['barney', 'fred', 'pebbles']
  13782. */
  13783. function dropWhile(array, predicate) {
  13784. return (array && array.length)
  13785. ? baseWhile(array, getIteratee(predicate, 3), true)
  13786. : [];
  13787. }
  13788. /**
  13789. * Fills elements of `array` with `value` from `start` up to, but not
  13790. * including, `end`.
  13791. *
  13792. * **Note:** This method mutates `array`.
  13793. *
  13794. * @static
  13795. * @memberOf _
  13796. * @since 3.2.0
  13797. * @category Array
  13798. * @param {Array} array The array to fill.
  13799. * @param {*} value The value to fill `array` with.
  13800. * @param {number} [start=0] The start position.
  13801. * @param {number} [end=array.length] The end position.
  13802. * @returns {Array} Returns `array`.
  13803. * @example
  13804. *
  13805. * var array = [1, 2, 3];
  13806. *
  13807. * _.fill(array, 'a');
  13808. * console.log(array);
  13809. * // => ['a', 'a', 'a']
  13810. *
  13811. * _.fill(Array(3), 2);
  13812. * // => [2, 2, 2]
  13813. *
  13814. * _.fill([4, 6, 8, 10], '*', 1, 3);
  13815. * // => [4, '*', '*', 10]
  13816. */
  13817. function fill(array, value, start, end) {
  13818. var length = array == null ? 0 : array.length;
  13819. if (!length) {
  13820. return [];
  13821. }
  13822. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  13823. start = 0;
  13824. end = length;
  13825. }
  13826. return baseFill(array, value, start, end);
  13827. }
  13828. /**
  13829. * This method is like `_.find` except that it returns the index of the first
  13830. * element `predicate` returns truthy for instead of the element itself.
  13831. *
  13832. * @static
  13833. * @memberOf _
  13834. * @since 1.1.0
  13835. * @category Array
  13836. * @param {Array} array The array to inspect.
  13837. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13838. * @param {number} [fromIndex=0] The index to search from.
  13839. * @returns {number} Returns the index of the found element, else `-1`.
  13840. * @example
  13841. *
  13842. * var users = [
  13843. * { 'user': 'barney', 'active': false },
  13844. * { 'user': 'fred', 'active': false },
  13845. * { 'user': 'pebbles', 'active': true }
  13846. * ];
  13847. *
  13848. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  13849. * // => 0
  13850. *
  13851. * // The `_.matches` iteratee shorthand.
  13852. * _.findIndex(users, { 'user': 'fred', 'active': false });
  13853. * // => 1
  13854. *
  13855. * // The `_.matchesProperty` iteratee shorthand.
  13856. * _.findIndex(users, ['active', false]);
  13857. * // => 0
  13858. *
  13859. * // The `_.property` iteratee shorthand.
  13860. * _.findIndex(users, 'active');
  13861. * // => 2
  13862. */
  13863. function findIndex(array, predicate, fromIndex) {
  13864. var length = array == null ? 0 : array.length;
  13865. if (!length) {
  13866. return -1;
  13867. }
  13868. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  13869. if (index < 0) {
  13870. index = nativeMax(length + index, 0);
  13871. }
  13872. return baseFindIndex(array, getIteratee(predicate, 3), index);
  13873. }
  13874. /**
  13875. * This method is like `_.findIndex` except that it iterates over elements
  13876. * of `collection` from right to left.
  13877. *
  13878. * @static
  13879. * @memberOf _
  13880. * @since 2.0.0
  13881. * @category Array
  13882. * @param {Array} array The array to inspect.
  13883. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13884. * @param {number} [fromIndex=array.length-1] The index to search from.
  13885. * @returns {number} Returns the index of the found element, else `-1`.
  13886. * @example
  13887. *
  13888. * var users = [
  13889. * { 'user': 'barney', 'active': true },
  13890. * { 'user': 'fred', 'active': false },
  13891. * { 'user': 'pebbles', 'active': false }
  13892. * ];
  13893. *
  13894. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  13895. * // => 2
  13896. *
  13897. * // The `_.matches` iteratee shorthand.
  13898. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  13899. * // => 0
  13900. *
  13901. * // The `_.matchesProperty` iteratee shorthand.
  13902. * _.findLastIndex(users, ['active', false]);
  13903. * // => 2
  13904. *
  13905. * // The `_.property` iteratee shorthand.
  13906. * _.findLastIndex(users, 'active');
  13907. * // => 0
  13908. */
  13909. function findLastIndex(array, predicate, fromIndex) {
  13910. var length = array == null ? 0 : array.length;
  13911. if (!length) {
  13912. return -1;
  13913. }
  13914. var index = length - 1;
  13915. if (fromIndex !== undefined) {
  13916. index = toInteger(fromIndex);
  13917. index = fromIndex < 0
  13918. ? nativeMax(length + index, 0)
  13919. : nativeMin(index, length - 1);
  13920. }
  13921. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  13922. }
  13923. /**
  13924. * Flattens `array` a single level deep.
  13925. *
  13926. * @static
  13927. * @memberOf _
  13928. * @since 0.1.0
  13929. * @category Array
  13930. * @param {Array} array The array to flatten.
  13931. * @returns {Array} Returns the new flattened array.
  13932. * @example
  13933. *
  13934. * _.flatten([1, [2, [3, [4]], 5]]);
  13935. * // => [1, 2, [3, [4]], 5]
  13936. */
  13937. function flatten(array) {
  13938. var length = array == null ? 0 : array.length;
  13939. return length ? baseFlatten(array, 1) : [];
  13940. }
  13941. /**
  13942. * Recursively flattens `array`.
  13943. *
  13944. * @static
  13945. * @memberOf _
  13946. * @since 3.0.0
  13947. * @category Array
  13948. * @param {Array} array The array to flatten.
  13949. * @returns {Array} Returns the new flattened array.
  13950. * @example
  13951. *
  13952. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  13953. * // => [1, 2, 3, 4, 5]
  13954. */
  13955. function flattenDeep(array) {
  13956. var length = array == null ? 0 : array.length;
  13957. return length ? baseFlatten(array, INFINITY) : [];
  13958. }
  13959. /**
  13960. * Recursively flatten `array` up to `depth` times.
  13961. *
  13962. * @static
  13963. * @memberOf _
  13964. * @since 4.4.0
  13965. * @category Array
  13966. * @param {Array} array The array to flatten.
  13967. * @param {number} [depth=1] The maximum recursion depth.
  13968. * @returns {Array} Returns the new flattened array.
  13969. * @example
  13970. *
  13971. * var array = [1, [2, [3, [4]], 5]];
  13972. *
  13973. * _.flattenDepth(array, 1);
  13974. * // => [1, 2, [3, [4]], 5]
  13975. *
  13976. * _.flattenDepth(array, 2);
  13977. * // => [1, 2, 3, [4], 5]
  13978. */
  13979. function flattenDepth(array, depth) {
  13980. var length = array == null ? 0 : array.length;
  13981. if (!length) {
  13982. return [];
  13983. }
  13984. depth = depth === undefined ? 1 : toInteger(depth);
  13985. return baseFlatten(array, depth);
  13986. }
  13987. /**
  13988. * The inverse of `_.toPairs`; this method returns an object composed
  13989. * from key-value `pairs`.
  13990. *
  13991. * @static
  13992. * @memberOf _
  13993. * @since 4.0.0
  13994. * @category Array
  13995. * @param {Array} pairs The key-value pairs.
  13996. * @returns {Object} Returns the new object.
  13997. * @example
  13998. *
  13999. * _.fromPairs([['a', 1], ['b', 2]]);
  14000. * // => { 'a': 1, 'b': 2 }
  14001. */
  14002. function fromPairs(pairs) {
  14003. var index = -1,
  14004. length = pairs == null ? 0 : pairs.length,
  14005. result = {};
  14006. while (++index < length) {
  14007. var pair = pairs[index];
  14008. result[pair[0]] = pair[1];
  14009. }
  14010. return result;
  14011. }
  14012. /**
  14013. * Gets the first element of `array`.
  14014. *
  14015. * @static
  14016. * @memberOf _
  14017. * @since 0.1.0
  14018. * @alias first
  14019. * @category Array
  14020. * @param {Array} array The array to query.
  14021. * @returns {*} Returns the first element of `array`.
  14022. * @example
  14023. *
  14024. * _.head([1, 2, 3]);
  14025. * // => 1
  14026. *
  14027. * _.head([]);
  14028. * // => undefined
  14029. */
  14030. function head(array) {
  14031. return (array && array.length) ? array[0] : undefined;
  14032. }
  14033. /**
  14034. * Gets the index at which the first occurrence of `value` is found in `array`
  14035. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14036. * for equality comparisons. If `fromIndex` is negative, it's used as the
  14037. * offset from the end of `array`.
  14038. *
  14039. * @static
  14040. * @memberOf _
  14041. * @since 0.1.0
  14042. * @category Array
  14043. * @param {Array} array The array to inspect.
  14044. * @param {*} value The value to search for.
  14045. * @param {number} [fromIndex=0] The index to search from.
  14046. * @returns {number} Returns the index of the matched value, else `-1`.
  14047. * @example
  14048. *
  14049. * _.indexOf([1, 2, 1, 2], 2);
  14050. * // => 1
  14051. *
  14052. * // Search from the `fromIndex`.
  14053. * _.indexOf([1, 2, 1, 2], 2, 2);
  14054. * // => 3
  14055. */
  14056. function indexOf(array, value, fromIndex) {
  14057. var length = array == null ? 0 : array.length;
  14058. if (!length) {
  14059. return -1;
  14060. }
  14061. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  14062. if (index < 0) {
  14063. index = nativeMax(length + index, 0);
  14064. }
  14065. return baseIndexOf(array, value, index);
  14066. }
  14067. /**
  14068. * Gets all but the last element of `array`.
  14069. *
  14070. * @static
  14071. * @memberOf _
  14072. * @since 0.1.0
  14073. * @category Array
  14074. * @param {Array} array The array to query.
  14075. * @returns {Array} Returns the slice of `array`.
  14076. * @example
  14077. *
  14078. * _.initial([1, 2, 3]);
  14079. * // => [1, 2]
  14080. */
  14081. function initial(array) {
  14082. var length = array == null ? 0 : array.length;
  14083. return length ? baseSlice(array, 0, -1) : [];
  14084. }
  14085. /**
  14086. * Creates an array of unique values that are included in all given arrays
  14087. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14088. * for equality comparisons. The order and references of result values are
  14089. * determined by the first array.
  14090. *
  14091. * @static
  14092. * @memberOf _
  14093. * @since 0.1.0
  14094. * @category Array
  14095. * @param {...Array} [arrays] The arrays to inspect.
  14096. * @returns {Array} Returns the new array of intersecting values.
  14097. * @example
  14098. *
  14099. * _.intersection([2, 1], [2, 3]);
  14100. * // => [2]
  14101. */
  14102. var intersection = baseRest(function(arrays) {
  14103. var mapped = arrayMap(arrays, castArrayLikeObject);
  14104. return (mapped.length && mapped[0] === arrays[0])
  14105. ? baseIntersection(mapped)
  14106. : [];
  14107. });
  14108. /**
  14109. * This method is like `_.intersection` except that it accepts `iteratee`
  14110. * which is invoked for each element of each `arrays` to generate the criterion
  14111. * by which they're compared. The order and references of result values are
  14112. * determined by the first array. The iteratee is invoked with one argument:
  14113. * (value).
  14114. *
  14115. * @static
  14116. * @memberOf _
  14117. * @since 4.0.0
  14118. * @category Array
  14119. * @param {...Array} [arrays] The arrays to inspect.
  14120. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14121. * @returns {Array} Returns the new array of intersecting values.
  14122. * @example
  14123. *
  14124. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  14125. * // => [2.1]
  14126. *
  14127. * // The `_.property` iteratee shorthand.
  14128. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  14129. * // => [{ 'x': 1 }]
  14130. */
  14131. var intersectionBy = baseRest(function(arrays) {
  14132. var iteratee = last(arrays),
  14133. mapped = arrayMap(arrays, castArrayLikeObject);
  14134. if (iteratee === last(mapped)) {
  14135. iteratee = undefined;
  14136. } else {
  14137. mapped.pop();
  14138. }
  14139. return (mapped.length && mapped[0] === arrays[0])
  14140. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  14141. : [];
  14142. });
  14143. /**
  14144. * This method is like `_.intersection` except that it accepts `comparator`
  14145. * which is invoked to compare elements of `arrays`. The order and references
  14146. * of result values are determined by the first array. The comparator is
  14147. * invoked with two arguments: (arrVal, othVal).
  14148. *
  14149. * @static
  14150. * @memberOf _
  14151. * @since 4.0.0
  14152. * @category Array
  14153. * @param {...Array} [arrays] The arrays to inspect.
  14154. * @param {Function} [comparator] The comparator invoked per element.
  14155. * @returns {Array} Returns the new array of intersecting values.
  14156. * @example
  14157. *
  14158. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  14159. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  14160. *
  14161. * _.intersectionWith(objects, others, _.isEqual);
  14162. * // => [{ 'x': 1, 'y': 2 }]
  14163. */
  14164. var intersectionWith = baseRest(function(arrays) {
  14165. var comparator = last(arrays),
  14166. mapped = arrayMap(arrays, castArrayLikeObject);
  14167. comparator = typeof comparator == 'function' ? comparator : undefined;
  14168. if (comparator) {
  14169. mapped.pop();
  14170. }
  14171. return (mapped.length && mapped[0] === arrays[0])
  14172. ? baseIntersection(mapped, undefined, comparator)
  14173. : [];
  14174. });
  14175. /**
  14176. * Converts all elements in `array` into a string separated by `separator`.
  14177. *
  14178. * @static
  14179. * @memberOf _
  14180. * @since 4.0.0
  14181. * @category Array
  14182. * @param {Array} array The array to convert.
  14183. * @param {string} [separator=','] The element separator.
  14184. * @returns {string} Returns the joined string.
  14185. * @example
  14186. *
  14187. * _.join(['a', 'b', 'c'], '~');
  14188. * // => 'a~b~c'
  14189. */
  14190. function join(array, separator) {
  14191. return array == null ? '' : nativeJoin.call(array, separator);
  14192. }
  14193. /**
  14194. * Gets the last element of `array`.
  14195. *
  14196. * @static
  14197. * @memberOf _
  14198. * @since 0.1.0
  14199. * @category Array
  14200. * @param {Array} array The array to query.
  14201. * @returns {*} Returns the last element of `array`.
  14202. * @example
  14203. *
  14204. * _.last([1, 2, 3]);
  14205. * // => 3
  14206. */
  14207. function last(array) {
  14208. var length = array == null ? 0 : array.length;
  14209. return length ? array[length - 1] : undefined;
  14210. }
  14211. /**
  14212. * This method is like `_.indexOf` except that it iterates over elements of
  14213. * `array` from right to left.
  14214. *
  14215. * @static
  14216. * @memberOf _
  14217. * @since 0.1.0
  14218. * @category Array
  14219. * @param {Array} array The array to inspect.
  14220. * @param {*} value The value to search for.
  14221. * @param {number} [fromIndex=array.length-1] The index to search from.
  14222. * @returns {number} Returns the index of the matched value, else `-1`.
  14223. * @example
  14224. *
  14225. * _.lastIndexOf([1, 2, 1, 2], 2);
  14226. * // => 3
  14227. *
  14228. * // Search from the `fromIndex`.
  14229. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  14230. * // => 1
  14231. */
  14232. function lastIndexOf(array, value, fromIndex) {
  14233. var length = array == null ? 0 : array.length;
  14234. if (!length) {
  14235. return -1;
  14236. }
  14237. var index = length;
  14238. if (fromIndex !== undefined) {
  14239. index = toInteger(fromIndex);
  14240. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  14241. }
  14242. return value === value
  14243. ? strictLastIndexOf(array, value, index)
  14244. : baseFindIndex(array, baseIsNaN, index, true);
  14245. }
  14246. /**
  14247. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  14248. * element from the end is returned.
  14249. *
  14250. * @static
  14251. * @memberOf _
  14252. * @since 4.11.0
  14253. * @category Array
  14254. * @param {Array} array The array to query.
  14255. * @param {number} [n=0] The index of the element to return.
  14256. * @returns {*} Returns the nth element of `array`.
  14257. * @example
  14258. *
  14259. * var array = ['a', 'b', 'c', 'd'];
  14260. *
  14261. * _.nth(array, 1);
  14262. * // => 'b'
  14263. *
  14264. * _.nth(array, -2);
  14265. * // => 'c';
  14266. */
  14267. function nth(array, n) {
  14268. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  14269. }
  14270. /**
  14271. * Removes all given values from `array` using
  14272. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14273. * for equality comparisons.
  14274. *
  14275. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  14276. * to remove elements from an array by predicate.
  14277. *
  14278. * @static
  14279. * @memberOf _
  14280. * @since 2.0.0
  14281. * @category Array
  14282. * @param {Array} array The array to modify.
  14283. * @param {...*} [values] The values to remove.
  14284. * @returns {Array} Returns `array`.
  14285. * @example
  14286. *
  14287. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  14288. *
  14289. * _.pull(array, 'a', 'c');
  14290. * console.log(array);
  14291. * // => ['b', 'b']
  14292. */
  14293. var pull = baseRest(pullAll);
  14294. /**
  14295. * This method is like `_.pull` except that it accepts an array of values to remove.
  14296. *
  14297. * **Note:** Unlike `_.difference`, this method mutates `array`.
  14298. *
  14299. * @static
  14300. * @memberOf _
  14301. * @since 4.0.0
  14302. * @category Array
  14303. * @param {Array} array The array to modify.
  14304. * @param {Array} values The values to remove.
  14305. * @returns {Array} Returns `array`.
  14306. * @example
  14307. *
  14308. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  14309. *
  14310. * _.pullAll(array, ['a', 'c']);
  14311. * console.log(array);
  14312. * // => ['b', 'b']
  14313. */
  14314. function pullAll(array, values) {
  14315. return (array && array.length && values && values.length)
  14316. ? basePullAll(array, values)
  14317. : array;
  14318. }
  14319. /**
  14320. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  14321. * invoked for each element of `array` and `values` to generate the criterion
  14322. * by which they're compared. The iteratee is invoked with one argument: (value).
  14323. *
  14324. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  14325. *
  14326. * @static
  14327. * @memberOf _
  14328. * @since 4.0.0
  14329. * @category Array
  14330. * @param {Array} array The array to modify.
  14331. * @param {Array} values The values to remove.
  14332. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14333. * @returns {Array} Returns `array`.
  14334. * @example
  14335. *
  14336. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  14337. *
  14338. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  14339. * console.log(array);
  14340. * // => [{ 'x': 2 }]
  14341. */
  14342. function pullAllBy(array, values, iteratee) {
  14343. return (array && array.length && values && values.length)
  14344. ? basePullAll(array, values, getIteratee(iteratee, 2))
  14345. : array;
  14346. }
  14347. /**
  14348. * This method is like `_.pullAll` except that it accepts `comparator` which
  14349. * is invoked to compare elements of `array` to `values`. The comparator is
  14350. * invoked with two arguments: (arrVal, othVal).
  14351. *
  14352. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  14353. *
  14354. * @static
  14355. * @memberOf _
  14356. * @since 4.6.0
  14357. * @category Array
  14358. * @param {Array} array The array to modify.
  14359. * @param {Array} values The values to remove.
  14360. * @param {Function} [comparator] The comparator invoked per element.
  14361. * @returns {Array} Returns `array`.
  14362. * @example
  14363. *
  14364. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  14365. *
  14366. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  14367. * console.log(array);
  14368. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  14369. */
  14370. function pullAllWith(array, values, comparator) {
  14371. return (array && array.length && values && values.length)
  14372. ? basePullAll(array, values, undefined, comparator)
  14373. : array;
  14374. }
  14375. /**
  14376. * Removes elements from `array` corresponding to `indexes` and returns an
  14377. * array of removed elements.
  14378. *
  14379. * **Note:** Unlike `_.at`, this method mutates `array`.
  14380. *
  14381. * @static
  14382. * @memberOf _
  14383. * @since 3.0.0
  14384. * @category Array
  14385. * @param {Array} array The array to modify.
  14386. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  14387. * @returns {Array} Returns the new array of removed elements.
  14388. * @example
  14389. *
  14390. * var array = ['a', 'b', 'c', 'd'];
  14391. * var pulled = _.pullAt(array, [1, 3]);
  14392. *
  14393. * console.log(array);
  14394. * // => ['a', 'c']
  14395. *
  14396. * console.log(pulled);
  14397. * // => ['b', 'd']
  14398. */
  14399. var pullAt = flatRest(function(array, indexes) {
  14400. var length = array == null ? 0 : array.length,
  14401. result = baseAt(array, indexes);
  14402. basePullAt(array, arrayMap(indexes, function(index) {
  14403. return isIndex(index, length) ? +index : index;
  14404. }).sort(compareAscending));
  14405. return result;
  14406. });
  14407. /**
  14408. * Removes all elements from `array` that `predicate` returns truthy for
  14409. * and returns an array of the removed elements. The predicate is invoked
  14410. * with three arguments: (value, index, array).
  14411. *
  14412. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  14413. * to pull elements from an array by value.
  14414. *
  14415. * @static
  14416. * @memberOf _
  14417. * @since 2.0.0
  14418. * @category Array
  14419. * @param {Array} array The array to modify.
  14420. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  14421. * @returns {Array} Returns the new array of removed elements.
  14422. * @example
  14423. *
  14424. * var array = [1, 2, 3, 4];
  14425. * var evens = _.remove(array, function(n) {
  14426. * return n % 2 == 0;
  14427. * });
  14428. *
  14429. * console.log(array);
  14430. * // => [1, 3]
  14431. *
  14432. * console.log(evens);
  14433. * // => [2, 4]
  14434. */
  14435. function remove(array, predicate) {
  14436. var result = [];
  14437. if (!(array && array.length)) {
  14438. return result;
  14439. }
  14440. var index = -1,
  14441. indexes = [],
  14442. length = array.length;
  14443. predicate = getIteratee(predicate, 3);
  14444. while (++index < length) {
  14445. var value = array[index];
  14446. if (predicate(value, index, array)) {
  14447. result.push(value);
  14448. indexes.push(index);
  14449. }
  14450. }
  14451. basePullAt(array, indexes);
  14452. return result;
  14453. }
  14454. /**
  14455. * Reverses `array` so that the first element becomes the last, the second
  14456. * element becomes the second to last, and so on.
  14457. *
  14458. * **Note:** This method mutates `array` and is based on
  14459. * [`Array#reverse`](https://mdn.io/Array/reverse).
  14460. *
  14461. * @static
  14462. * @memberOf _
  14463. * @since 4.0.0
  14464. * @category Array
  14465. * @param {Array} array The array to modify.
  14466. * @returns {Array} Returns `array`.
  14467. * @example
  14468. *
  14469. * var array = [1, 2, 3];
  14470. *
  14471. * _.reverse(array);
  14472. * // => [3, 2, 1]
  14473. *
  14474. * console.log(array);
  14475. * // => [3, 2, 1]
  14476. */
  14477. function reverse(array) {
  14478. return array == null ? array : nativeReverse.call(array);
  14479. }
  14480. /**
  14481. * Creates a slice of `array` from `start` up to, but not including, `end`.
  14482. *
  14483. * **Note:** This method is used instead of
  14484. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  14485. * returned.
  14486. *
  14487. * @static
  14488. * @memberOf _
  14489. * @since 3.0.0
  14490. * @category Array
  14491. * @param {Array} array The array to slice.
  14492. * @param {number} [start=0] The start position.
  14493. * @param {number} [end=array.length] The end position.
  14494. * @returns {Array} Returns the slice of `array`.
  14495. */
  14496. function slice(array, start, end) {
  14497. var length = array == null ? 0 : array.length;
  14498. if (!length) {
  14499. return [];
  14500. }
  14501. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  14502. start = 0;
  14503. end = length;
  14504. }
  14505. else {
  14506. start = start == null ? 0 : toInteger(start);
  14507. end = end === undefined ? length : toInteger(end);
  14508. }
  14509. return baseSlice(array, start, end);
  14510. }
  14511. /**
  14512. * Uses a binary search to determine the lowest index at which `value`
  14513. * should be inserted into `array` in order to maintain its sort order.
  14514. *
  14515. * @static
  14516. * @memberOf _
  14517. * @since 0.1.0
  14518. * @category Array
  14519. * @param {Array} array The sorted array to inspect.
  14520. * @param {*} value The value to evaluate.
  14521. * @returns {number} Returns the index at which `value` should be inserted
  14522. * into `array`.
  14523. * @example
  14524. *
  14525. * _.sortedIndex([30, 50], 40);
  14526. * // => 1
  14527. */
  14528. function sortedIndex(array, value) {
  14529. return baseSortedIndex(array, value);
  14530. }
  14531. /**
  14532. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  14533. * which is invoked for `value` and each element of `array` to compute their
  14534. * sort ranking. The iteratee is invoked with one argument: (value).
  14535. *
  14536. * @static
  14537. * @memberOf _
  14538. * @since 4.0.0
  14539. * @category Array
  14540. * @param {Array} array The sorted array to inspect.
  14541. * @param {*} value The value to evaluate.
  14542. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14543. * @returns {number} Returns the index at which `value` should be inserted
  14544. * into `array`.
  14545. * @example
  14546. *
  14547. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  14548. *
  14549. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  14550. * // => 0
  14551. *
  14552. * // The `_.property` iteratee shorthand.
  14553. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  14554. * // => 0
  14555. */
  14556. function sortedIndexBy(array, value, iteratee) {
  14557. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  14558. }
  14559. /**
  14560. * This method is like `_.indexOf` except that it performs a binary
  14561. * search on a sorted `array`.
  14562. *
  14563. * @static
  14564. * @memberOf _
  14565. * @since 4.0.0
  14566. * @category Array
  14567. * @param {Array} array The array to inspect.
  14568. * @param {*} value The value to search for.
  14569. * @returns {number} Returns the index of the matched value, else `-1`.
  14570. * @example
  14571. *
  14572. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  14573. * // => 1
  14574. */
  14575. function sortedIndexOf(array, value) {
  14576. var length = array == null ? 0 : array.length;
  14577. if (length) {
  14578. var index = baseSortedIndex(array, value);
  14579. if (index < length && eq(array[index], value)) {
  14580. return index;
  14581. }
  14582. }
  14583. return -1;
  14584. }
  14585. /**
  14586. * This method is like `_.sortedIndex` except that it returns the highest
  14587. * index at which `value` should be inserted into `array` in order to
  14588. * maintain its sort order.
  14589. *
  14590. * @static
  14591. * @memberOf _
  14592. * @since 3.0.0
  14593. * @category Array
  14594. * @param {Array} array The sorted array to inspect.
  14595. * @param {*} value The value to evaluate.
  14596. * @returns {number} Returns the index at which `value` should be inserted
  14597. * into `array`.
  14598. * @example
  14599. *
  14600. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  14601. * // => 4
  14602. */
  14603. function sortedLastIndex(array, value) {
  14604. return baseSortedIndex(array, value, true);
  14605. }
  14606. /**
  14607. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  14608. * which is invoked for `value` and each element of `array` to compute their
  14609. * sort ranking. The iteratee is invoked with one argument: (value).
  14610. *
  14611. * @static
  14612. * @memberOf _
  14613. * @since 4.0.0
  14614. * @category Array
  14615. * @param {Array} array The sorted array to inspect.
  14616. * @param {*} value The value to evaluate.
  14617. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14618. * @returns {number} Returns the index at which `value` should be inserted
  14619. * into `array`.
  14620. * @example
  14621. *
  14622. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  14623. *
  14624. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  14625. * // => 1
  14626. *
  14627. * // The `_.property` iteratee shorthand.
  14628. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  14629. * // => 1
  14630. */
  14631. function sortedLastIndexBy(array, value, iteratee) {
  14632. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  14633. }
  14634. /**
  14635. * This method is like `_.lastIndexOf` except that it performs a binary
  14636. * search on a sorted `array`.
  14637. *
  14638. * @static
  14639. * @memberOf _
  14640. * @since 4.0.0
  14641. * @category Array
  14642. * @param {Array} array The array to inspect.
  14643. * @param {*} value The value to search for.
  14644. * @returns {number} Returns the index of the matched value, else `-1`.
  14645. * @example
  14646. *
  14647. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  14648. * // => 3
  14649. */
  14650. function sortedLastIndexOf(array, value) {
  14651. var length = array == null ? 0 : array.length;
  14652. if (length) {
  14653. var index = baseSortedIndex(array, value, true) - 1;
  14654. if (eq(array[index], value)) {
  14655. return index;
  14656. }
  14657. }
  14658. return -1;
  14659. }
  14660. /**
  14661. * This method is like `_.uniq` except that it's designed and optimized
  14662. * for sorted arrays.
  14663. *
  14664. * @static
  14665. * @memberOf _
  14666. * @since 4.0.0
  14667. * @category Array
  14668. * @param {Array} array The array to inspect.
  14669. * @returns {Array} Returns the new duplicate free array.
  14670. * @example
  14671. *
  14672. * _.sortedUniq([1, 1, 2]);
  14673. * // => [1, 2]
  14674. */
  14675. function sortedUniq(array) {
  14676. return (array && array.length)
  14677. ? baseSortedUniq(array)
  14678. : [];
  14679. }
  14680. /**
  14681. * This method is like `_.uniqBy` except that it's designed and optimized
  14682. * for sorted arrays.
  14683. *
  14684. * @static
  14685. * @memberOf _
  14686. * @since 4.0.0
  14687. * @category Array
  14688. * @param {Array} array The array to inspect.
  14689. * @param {Function} [iteratee] The iteratee invoked per element.
  14690. * @returns {Array} Returns the new duplicate free array.
  14691. * @example
  14692. *
  14693. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  14694. * // => [1.1, 2.3]
  14695. */
  14696. function sortedUniqBy(array, iteratee) {
  14697. return (array && array.length)
  14698. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  14699. : [];
  14700. }
  14701. /**
  14702. * Gets all but the first element of `array`.
  14703. *
  14704. * @static
  14705. * @memberOf _
  14706. * @since 4.0.0
  14707. * @category Array
  14708. * @param {Array} array The array to query.
  14709. * @returns {Array} Returns the slice of `array`.
  14710. * @example
  14711. *
  14712. * _.tail([1, 2, 3]);
  14713. * // => [2, 3]
  14714. */
  14715. function tail(array) {
  14716. var length = array == null ? 0 : array.length;
  14717. return length ? baseSlice(array, 1, length) : [];
  14718. }
  14719. /**
  14720. * Creates a slice of `array` with `n` elements taken from the beginning.
  14721. *
  14722. * @static
  14723. * @memberOf _
  14724. * @since 0.1.0
  14725. * @category Array
  14726. * @param {Array} array The array to query.
  14727. * @param {number} [n=1] The number of elements to take.
  14728. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14729. * @returns {Array} Returns the slice of `array`.
  14730. * @example
  14731. *
  14732. * _.take([1, 2, 3]);
  14733. * // => [1]
  14734. *
  14735. * _.take([1, 2, 3], 2);
  14736. * // => [1, 2]
  14737. *
  14738. * _.take([1, 2, 3], 5);
  14739. * // => [1, 2, 3]
  14740. *
  14741. * _.take([1, 2, 3], 0);
  14742. * // => []
  14743. */
  14744. function take(array, n, guard) {
  14745. if (!(array && array.length)) {
  14746. return [];
  14747. }
  14748. n = (guard || n === undefined) ? 1 : toInteger(n);
  14749. return baseSlice(array, 0, n < 0 ? 0 : n);
  14750. }
  14751. /**
  14752. * Creates a slice of `array` with `n` elements taken from the end.
  14753. *
  14754. * @static
  14755. * @memberOf _
  14756. * @since 3.0.0
  14757. * @category Array
  14758. * @param {Array} array The array to query.
  14759. * @param {number} [n=1] The number of elements to take.
  14760. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14761. * @returns {Array} Returns the slice of `array`.
  14762. * @example
  14763. *
  14764. * _.takeRight([1, 2, 3]);
  14765. * // => [3]
  14766. *
  14767. * _.takeRight([1, 2, 3], 2);
  14768. * // => [2, 3]
  14769. *
  14770. * _.takeRight([1, 2, 3], 5);
  14771. * // => [1, 2, 3]
  14772. *
  14773. * _.takeRight([1, 2, 3], 0);
  14774. * // => []
  14775. */
  14776. function takeRight(array, n, guard) {
  14777. var length = array == null ? 0 : array.length;
  14778. if (!length) {
  14779. return [];
  14780. }
  14781. n = (guard || n === undefined) ? 1 : toInteger(n);
  14782. n = length - n;
  14783. return baseSlice(array, n < 0 ? 0 : n, length);
  14784. }
  14785. /**
  14786. * Creates a slice of `array` with elements taken from the end. Elements are
  14787. * taken until `predicate` returns falsey. The predicate is invoked with
  14788. * three arguments: (value, index, array).
  14789. *
  14790. * @static
  14791. * @memberOf _
  14792. * @since 3.0.0
  14793. * @category Array
  14794. * @param {Array} array The array to query.
  14795. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  14796. * @returns {Array} Returns the slice of `array`.
  14797. * @example
  14798. *
  14799. * var users = [
  14800. * { 'user': 'barney', 'active': true },
  14801. * { 'user': 'fred', 'active': false },
  14802. * { 'user': 'pebbles', 'active': false }
  14803. * ];
  14804. *
  14805. * _.takeRightWhile(users, function(o) { return !o.active; });
  14806. * // => objects for ['fred', 'pebbles']
  14807. *
  14808. * // The `_.matches` iteratee shorthand.
  14809. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  14810. * // => objects for ['pebbles']
  14811. *
  14812. * // The `_.matchesProperty` iteratee shorthand.
  14813. * _.takeRightWhile(users, ['active', false]);
  14814. * // => objects for ['fred', 'pebbles']
  14815. *
  14816. * // The `_.property` iteratee shorthand.
  14817. * _.takeRightWhile(users, 'active');
  14818. * // => []
  14819. */
  14820. function takeRightWhile(array, predicate) {
  14821. return (array && array.length)
  14822. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  14823. : [];
  14824. }
  14825. /**
  14826. * Creates a slice of `array` with elements taken from the beginning. Elements
  14827. * are taken until `predicate` returns falsey. The predicate is invoked with
  14828. * three arguments: (value, index, array).
  14829. *
  14830. * @static
  14831. * @memberOf _
  14832. * @since 3.0.0
  14833. * @category Array
  14834. * @param {Array} array The array to query.
  14835. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  14836. * @returns {Array} Returns the slice of `array`.
  14837. * @example
  14838. *
  14839. * var users = [
  14840. * { 'user': 'barney', 'active': false },
  14841. * { 'user': 'fred', 'active': false },
  14842. * { 'user': 'pebbles', 'active': true }
  14843. * ];
  14844. *
  14845. * _.takeWhile(users, function(o) { return !o.active; });
  14846. * // => objects for ['barney', 'fred']
  14847. *
  14848. * // The `_.matches` iteratee shorthand.
  14849. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  14850. * // => objects for ['barney']
  14851. *
  14852. * // The `_.matchesProperty` iteratee shorthand.
  14853. * _.takeWhile(users, ['active', false]);
  14854. * // => objects for ['barney', 'fred']
  14855. *
  14856. * // The `_.property` iteratee shorthand.
  14857. * _.takeWhile(users, 'active');
  14858. * // => []
  14859. */
  14860. function takeWhile(array, predicate) {
  14861. return (array && array.length)
  14862. ? baseWhile(array, getIteratee(predicate, 3))
  14863. : [];
  14864. }
  14865. /**
  14866. * Creates an array of unique values, in order, from all given arrays using
  14867. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14868. * for equality comparisons.
  14869. *
  14870. * @static
  14871. * @memberOf _
  14872. * @since 0.1.0
  14873. * @category Array
  14874. * @param {...Array} [arrays] The arrays to inspect.
  14875. * @returns {Array} Returns the new array of combined values.
  14876. * @example
  14877. *
  14878. * _.union([2], [1, 2]);
  14879. * // => [2, 1]
  14880. */
  14881. var union = baseRest(function(arrays) {
  14882. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  14883. });
  14884. /**
  14885. * This method is like `_.union` except that it accepts `iteratee` which is
  14886. * invoked for each element of each `arrays` to generate the criterion by
  14887. * which uniqueness is computed. Result values are chosen from the first
  14888. * array in which the value occurs. The iteratee is invoked with one argument:
  14889. * (value).
  14890. *
  14891. * @static
  14892. * @memberOf _
  14893. * @since 4.0.0
  14894. * @category Array
  14895. * @param {...Array} [arrays] The arrays to inspect.
  14896. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14897. * @returns {Array} Returns the new array of combined values.
  14898. * @example
  14899. *
  14900. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  14901. * // => [2.1, 1.2]
  14902. *
  14903. * // The `_.property` iteratee shorthand.
  14904. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  14905. * // => [{ 'x': 1 }, { 'x': 2 }]
  14906. */
  14907. var unionBy = baseRest(function(arrays) {
  14908. var iteratee = last(arrays);
  14909. if (isArrayLikeObject(iteratee)) {
  14910. iteratee = undefined;
  14911. }
  14912. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  14913. });
  14914. /**
  14915. * This method is like `_.union` except that it accepts `comparator` which
  14916. * is invoked to compare elements of `arrays`. Result values are chosen from
  14917. * the first array in which the value occurs. The comparator is invoked
  14918. * with two arguments: (arrVal, othVal).
  14919. *
  14920. * @static
  14921. * @memberOf _
  14922. * @since 4.0.0
  14923. * @category Array
  14924. * @param {...Array} [arrays] The arrays to inspect.
  14925. * @param {Function} [comparator] The comparator invoked per element.
  14926. * @returns {Array} Returns the new array of combined values.
  14927. * @example
  14928. *
  14929. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  14930. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  14931. *
  14932. * _.unionWith(objects, others, _.isEqual);
  14933. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  14934. */
  14935. var unionWith = baseRest(function(arrays) {
  14936. var comparator = last(arrays);
  14937. comparator = typeof comparator == 'function' ? comparator : undefined;
  14938. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  14939. });
  14940. /**
  14941. * Creates a duplicate-free version of an array, using
  14942. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14943. * for equality comparisons, in which only the first occurrence of each element
  14944. * is kept. The order of result values is determined by the order they occur
  14945. * in the array.
  14946. *
  14947. * @static
  14948. * @memberOf _
  14949. * @since 0.1.0
  14950. * @category Array
  14951. * @param {Array} array The array to inspect.
  14952. * @returns {Array} Returns the new duplicate free array.
  14953. * @example
  14954. *
  14955. * _.uniq([2, 1, 2]);
  14956. * // => [2, 1]
  14957. */
  14958. function uniq(array) {
  14959. return (array && array.length) ? baseUniq(array) : [];
  14960. }
  14961. /**
  14962. * This method is like `_.uniq` except that it accepts `iteratee` which is
  14963. * invoked for each element in `array` to generate the criterion by which
  14964. * uniqueness is computed. The order of result values is determined by the
  14965. * order they occur in the array. The iteratee is invoked with one argument:
  14966. * (value).
  14967. *
  14968. * @static
  14969. * @memberOf _
  14970. * @since 4.0.0
  14971. * @category Array
  14972. * @param {Array} array The array to inspect.
  14973. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14974. * @returns {Array} Returns the new duplicate free array.
  14975. * @example
  14976. *
  14977. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  14978. * // => [2.1, 1.2]
  14979. *
  14980. * // The `_.property` iteratee shorthand.
  14981. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  14982. * // => [{ 'x': 1 }, { 'x': 2 }]
  14983. */
  14984. function uniqBy(array, iteratee) {
  14985. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  14986. }
  14987. /**
  14988. * This method is like `_.uniq` except that it accepts `comparator` which
  14989. * is invoked to compare elements of `array`. The order of result values is
  14990. * determined by the order they occur in the array.The comparator is invoked
  14991. * with two arguments: (arrVal, othVal).
  14992. *
  14993. * @static
  14994. * @memberOf _
  14995. * @since 4.0.0
  14996. * @category Array
  14997. * @param {Array} array The array to inspect.
  14998. * @param {Function} [comparator] The comparator invoked per element.
  14999. * @returns {Array} Returns the new duplicate free array.
  15000. * @example
  15001. *
  15002. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  15003. *
  15004. * _.uniqWith(objects, _.isEqual);
  15005. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  15006. */
  15007. function uniqWith(array, comparator) {
  15008. comparator = typeof comparator == 'function' ? comparator : undefined;
  15009. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  15010. }
  15011. /**
  15012. * This method is like `_.zip` except that it accepts an array of grouped
  15013. * elements and creates an array regrouping the elements to their pre-zip
  15014. * configuration.
  15015. *
  15016. * @static
  15017. * @memberOf _
  15018. * @since 1.2.0
  15019. * @category Array
  15020. * @param {Array} array The array of grouped elements to process.
  15021. * @returns {Array} Returns the new array of regrouped elements.
  15022. * @example
  15023. *
  15024. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  15025. * // => [['a', 1, true], ['b', 2, false]]
  15026. *
  15027. * _.unzip(zipped);
  15028. * // => [['a', 'b'], [1, 2], [true, false]]
  15029. */
  15030. function unzip(array) {
  15031. if (!(array && array.length)) {
  15032. return [];
  15033. }
  15034. var length = 0;
  15035. array = arrayFilter(array, function(group) {
  15036. if (isArrayLikeObject(group)) {
  15037. length = nativeMax(group.length, length);
  15038. return true;
  15039. }
  15040. });
  15041. return baseTimes(length, function(index) {
  15042. return arrayMap(array, baseProperty(index));
  15043. });
  15044. }
  15045. /**
  15046. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  15047. * how regrouped values should be combined. The iteratee is invoked with the
  15048. * elements of each group: (...group).
  15049. *
  15050. * @static
  15051. * @memberOf _
  15052. * @since 3.8.0
  15053. * @category Array
  15054. * @param {Array} array The array of grouped elements to process.
  15055. * @param {Function} [iteratee=_.identity] The function to combine
  15056. * regrouped values.
  15057. * @returns {Array} Returns the new array of regrouped elements.
  15058. * @example
  15059. *
  15060. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  15061. * // => [[1, 10, 100], [2, 20, 200]]
  15062. *
  15063. * _.unzipWith(zipped, _.add);
  15064. * // => [3, 30, 300]
  15065. */
  15066. function unzipWith(array, iteratee) {
  15067. if (!(array && array.length)) {
  15068. return [];
  15069. }
  15070. var result = unzip(array);
  15071. if (iteratee == null) {
  15072. return result;
  15073. }
  15074. return arrayMap(result, function(group) {
  15075. return apply(iteratee, undefined, group);
  15076. });
  15077. }
  15078. /**
  15079. * Creates an array excluding all given values using
  15080. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  15081. * for equality comparisons.
  15082. *
  15083. * **Note:** Unlike `_.pull`, this method returns a new array.
  15084. *
  15085. * @static
  15086. * @memberOf _
  15087. * @since 0.1.0
  15088. * @category Array
  15089. * @param {Array} array The array to inspect.
  15090. * @param {...*} [values] The values to exclude.
  15091. * @returns {Array} Returns the new array of filtered values.
  15092. * @see _.difference, _.xor
  15093. * @example
  15094. *
  15095. * _.without([2, 1, 2, 3], 1, 2);
  15096. * // => [3]
  15097. */
  15098. var without = baseRest(function(array, values) {
  15099. return isArrayLikeObject(array)
  15100. ? baseDifference(array, values)
  15101. : [];
  15102. });
  15103. /**
  15104. * Creates an array of unique values that is the
  15105. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  15106. * of the given arrays. The order of result values is determined by the order
  15107. * they occur in the arrays.
  15108. *
  15109. * @static
  15110. * @memberOf _
  15111. * @since 2.4.0
  15112. * @category Array
  15113. * @param {...Array} [arrays] The arrays to inspect.
  15114. * @returns {Array} Returns the new array of filtered values.
  15115. * @see _.difference, _.without
  15116. * @example
  15117. *
  15118. * _.xor([2, 1], [2, 3]);
  15119. * // => [1, 3]
  15120. */
  15121. var xor = baseRest(function(arrays) {
  15122. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  15123. });
  15124. /**
  15125. * This method is like `_.xor` except that it accepts `iteratee` which is
  15126. * invoked for each element of each `arrays` to generate the criterion by
  15127. * which by which they're compared. The order of result values is determined
  15128. * by the order they occur in the arrays. The iteratee is invoked with one
  15129. * argument: (value).
  15130. *
  15131. * @static
  15132. * @memberOf _
  15133. * @since 4.0.0
  15134. * @category Array
  15135. * @param {...Array} [arrays] The arrays to inspect.
  15136. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  15137. * @returns {Array} Returns the new array of filtered values.
  15138. * @example
  15139. *
  15140. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  15141. * // => [1.2, 3.4]
  15142. *
  15143. * // The `_.property` iteratee shorthand.
  15144. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  15145. * // => [{ 'x': 2 }]
  15146. */
  15147. var xorBy = baseRest(function(arrays) {
  15148. var iteratee = last(arrays);
  15149. if (isArrayLikeObject(iteratee)) {
  15150. iteratee = undefined;
  15151. }
  15152. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  15153. });
  15154. /**
  15155. * This method is like `_.xor` except that it accepts `comparator` which is
  15156. * invoked to compare elements of `arrays`. The order of result values is
  15157. * determined by the order they occur in the arrays. The comparator is invoked
  15158. * with two arguments: (arrVal, othVal).
  15159. *
  15160. * @static
  15161. * @memberOf _
  15162. * @since 4.0.0
  15163. * @category Array
  15164. * @param {...Array} [arrays] The arrays to inspect.
  15165. * @param {Function} [comparator] The comparator invoked per element.
  15166. * @returns {Array} Returns the new array of filtered values.
  15167. * @example
  15168. *
  15169. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  15170. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  15171. *
  15172. * _.xorWith(objects, others, _.isEqual);
  15173. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  15174. */
  15175. var xorWith = baseRest(function(arrays) {
  15176. var comparator = last(arrays);
  15177. comparator = typeof comparator == 'function' ? comparator : undefined;
  15178. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  15179. });
  15180. /**
  15181. * Creates an array of grouped elements, the first of which contains the
  15182. * first elements of the given arrays, the second of which contains the
  15183. * second elements of the given arrays, and so on.
  15184. *
  15185. * @static
  15186. * @memberOf _
  15187. * @since 0.1.0
  15188. * @category Array
  15189. * @param {...Array} [arrays] The arrays to process.
  15190. * @returns {Array} Returns the new array of grouped elements.
  15191. * @example
  15192. *
  15193. * _.zip(['a', 'b'], [1, 2], [true, false]);
  15194. * // => [['a', 1, true], ['b', 2, false]]
  15195. */
  15196. var zip = baseRest(unzip);
  15197. /**
  15198. * This method is like `_.fromPairs` except that it accepts two arrays,
  15199. * one of property identifiers and one of corresponding values.
  15200. *
  15201. * @static
  15202. * @memberOf _
  15203. * @since 0.4.0
  15204. * @category Array
  15205. * @param {Array} [props=[]] The property identifiers.
  15206. * @param {Array} [values=[]] The property values.
  15207. * @returns {Object} Returns the new object.
  15208. * @example
  15209. *
  15210. * _.zipObject(['a', 'b'], [1, 2]);
  15211. * // => { 'a': 1, 'b': 2 }
  15212. */
  15213. function zipObject(props, values) {
  15214. return baseZipObject(props || [], values || [], assignValue);
  15215. }
  15216. /**
  15217. * This method is like `_.zipObject` except that it supports property paths.
  15218. *
  15219. * @static
  15220. * @memberOf _
  15221. * @since 4.1.0
  15222. * @category Array
  15223. * @param {Array} [props=[]] The property identifiers.
  15224. * @param {Array} [values=[]] The property values.
  15225. * @returns {Object} Returns the new object.
  15226. * @example
  15227. *
  15228. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  15229. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  15230. */
  15231. function zipObjectDeep(props, values) {
  15232. return baseZipObject(props || [], values || [], baseSet);
  15233. }
  15234. /**
  15235. * This method is like `_.zip` except that it accepts `iteratee` to specify
  15236. * how grouped values should be combined. The iteratee is invoked with the
  15237. * elements of each group: (...group).
  15238. *
  15239. * @static
  15240. * @memberOf _
  15241. * @since 3.8.0
  15242. * @category Array
  15243. * @param {...Array} [arrays] The arrays to process.
  15244. * @param {Function} [iteratee=_.identity] The function to combine
  15245. * grouped values.
  15246. * @returns {Array} Returns the new array of grouped elements.
  15247. * @example
  15248. *
  15249. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  15250. * return a + b + c;
  15251. * });
  15252. * // => [111, 222]
  15253. */
  15254. var zipWith = baseRest(function(arrays) {
  15255. var length = arrays.length,
  15256. iteratee = length > 1 ? arrays[length - 1] : undefined;
  15257. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  15258. return unzipWith(arrays, iteratee);
  15259. });
  15260. /*------------------------------------------------------------------------*/
  15261. /**
  15262. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  15263. * chain sequences enabled. The result of such sequences must be unwrapped
  15264. * with `_#value`.
  15265. *
  15266. * @static
  15267. * @memberOf _
  15268. * @since 1.3.0
  15269. * @category Seq
  15270. * @param {*} value The value to wrap.
  15271. * @returns {Object} Returns the new `lodash` wrapper instance.
  15272. * @example
  15273. *
  15274. * var users = [
  15275. * { 'user': 'barney', 'age': 36 },
  15276. * { 'user': 'fred', 'age': 40 },
  15277. * { 'user': 'pebbles', 'age': 1 }
  15278. * ];
  15279. *
  15280. * var youngest = _
  15281. * .chain(users)
  15282. * .sortBy('age')
  15283. * .map(function(o) {
  15284. * return o.user + ' is ' + o.age;
  15285. * })
  15286. * .head()
  15287. * .value();
  15288. * // => 'pebbles is 1'
  15289. */
  15290. function chain(value) {
  15291. var result = lodash(value);
  15292. result.__chain__ = true;
  15293. return result;
  15294. }
  15295. /**
  15296. * This method invokes `interceptor` and returns `value`. The interceptor
  15297. * is invoked with one argument; (value). The purpose of this method is to
  15298. * "tap into" a method chain sequence in order to modify intermediate results.
  15299. *
  15300. * @static
  15301. * @memberOf _
  15302. * @since 0.1.0
  15303. * @category Seq
  15304. * @param {*} value The value to provide to `interceptor`.
  15305. * @param {Function} interceptor The function to invoke.
  15306. * @returns {*} Returns `value`.
  15307. * @example
  15308. *
  15309. * _([1, 2, 3])
  15310. * .tap(function(array) {
  15311. * // Mutate input array.
  15312. * array.pop();
  15313. * })
  15314. * .reverse()
  15315. * .value();
  15316. * // => [2, 1]
  15317. */
  15318. function tap(value, interceptor) {
  15319. interceptor(value);
  15320. return value;
  15321. }
  15322. /**
  15323. * This method is like `_.tap` except that it returns the result of `interceptor`.
  15324. * The purpose of this method is to "pass thru" values replacing intermediate
  15325. * results in a method chain sequence.
  15326. *
  15327. * @static
  15328. * @memberOf _
  15329. * @since 3.0.0
  15330. * @category Seq
  15331. * @param {*} value The value to provide to `interceptor`.
  15332. * @param {Function} interceptor The function to invoke.
  15333. * @returns {*} Returns the result of `interceptor`.
  15334. * @example
  15335. *
  15336. * _(' abc ')
  15337. * .chain()
  15338. * .trim()
  15339. * .thru(function(value) {
  15340. * return [value];
  15341. * })
  15342. * .value();
  15343. * // => ['abc']
  15344. */
  15345. function thru(value, interceptor) {
  15346. return interceptor(value);
  15347. }
  15348. /**
  15349. * This method is the wrapper version of `_.at`.
  15350. *
  15351. * @name at
  15352. * @memberOf _
  15353. * @since 1.0.0
  15354. * @category Seq
  15355. * @param {...(string|string[])} [paths] The property paths to pick.
  15356. * @returns {Object} Returns the new `lodash` wrapper instance.
  15357. * @example
  15358. *
  15359. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  15360. *
  15361. * _(object).at(['a[0].b.c', 'a[1]']).value();
  15362. * // => [3, 4]
  15363. */
  15364. var wrapperAt = flatRest(function(paths) {
  15365. var length = paths.length,
  15366. start = length ? paths[0] : 0,
  15367. value = this.__wrapped__,
  15368. interceptor = function(object) { return baseAt(object, paths); };
  15369. if (length > 1 || this.__actions__.length ||
  15370. !(value instanceof LazyWrapper) || !isIndex(start)) {
  15371. return this.thru(interceptor);
  15372. }
  15373. value = value.slice(start, +start + (length ? 1 : 0));
  15374. value.__actions__.push({
  15375. 'func': thru,
  15376. 'args': [interceptor],
  15377. 'thisArg': undefined
  15378. });
  15379. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  15380. if (length && !array.length) {
  15381. array.push(undefined);
  15382. }
  15383. return array;
  15384. });
  15385. });
  15386. /**
  15387. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  15388. *
  15389. * @name chain
  15390. * @memberOf _
  15391. * @since 0.1.0
  15392. * @category Seq
  15393. * @returns {Object} Returns the new `lodash` wrapper instance.
  15394. * @example
  15395. *
  15396. * var users = [
  15397. * { 'user': 'barney', 'age': 36 },
  15398. * { 'user': 'fred', 'age': 40 }
  15399. * ];
  15400. *
  15401. * // A sequence without explicit chaining.
  15402. * _(users).head();
  15403. * // => { 'user': 'barney', 'age': 36 }
  15404. *
  15405. * // A sequence with explicit chaining.
  15406. * _(users)
  15407. * .chain()
  15408. * .head()
  15409. * .pick('user')
  15410. * .value();
  15411. * // => { 'user': 'barney' }
  15412. */
  15413. function wrapperChain() {
  15414. return chain(this);
  15415. }
  15416. /**
  15417. * Executes the chain sequence and returns the wrapped result.
  15418. *
  15419. * @name commit
  15420. * @memberOf _
  15421. * @since 3.2.0
  15422. * @category Seq
  15423. * @returns {Object} Returns the new `lodash` wrapper instance.
  15424. * @example
  15425. *
  15426. * var array = [1, 2];
  15427. * var wrapped = _(array).push(3);
  15428. *
  15429. * console.log(array);
  15430. * // => [1, 2]
  15431. *
  15432. * wrapped = wrapped.commit();
  15433. * console.log(array);
  15434. * // => [1, 2, 3]
  15435. *
  15436. * wrapped.last();
  15437. * // => 3
  15438. *
  15439. * console.log(array);
  15440. * // => [1, 2, 3]
  15441. */
  15442. function wrapperCommit() {
  15443. return new LodashWrapper(this.value(), this.__chain__);
  15444. }
  15445. /**
  15446. * Gets the next value on a wrapped object following the
  15447. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  15448. *
  15449. * @name next
  15450. * @memberOf _
  15451. * @since 4.0.0
  15452. * @category Seq
  15453. * @returns {Object} Returns the next iterator value.
  15454. * @example
  15455. *
  15456. * var wrapped = _([1, 2]);
  15457. *
  15458. * wrapped.next();
  15459. * // => { 'done': false, 'value': 1 }
  15460. *
  15461. * wrapped.next();
  15462. * // => { 'done': false, 'value': 2 }
  15463. *
  15464. * wrapped.next();
  15465. * // => { 'done': true, 'value': undefined }
  15466. */
  15467. function wrapperNext() {
  15468. if (this.__values__ === undefined) {
  15469. this.__values__ = toArray(this.value());
  15470. }
  15471. var done = this.__index__ >= this.__values__.length,
  15472. value = done ? undefined : this.__values__[this.__index__++];
  15473. return { 'done': done, 'value': value };
  15474. }
  15475. /**
  15476. * Enables the wrapper to be iterable.
  15477. *
  15478. * @name Symbol.iterator
  15479. * @memberOf _
  15480. * @since 4.0.0
  15481. * @category Seq
  15482. * @returns {Object} Returns the wrapper object.
  15483. * @example
  15484. *
  15485. * var wrapped = _([1, 2]);
  15486. *
  15487. * wrapped[Symbol.iterator]() === wrapped;
  15488. * // => true
  15489. *
  15490. * Array.from(wrapped);
  15491. * // => [1, 2]
  15492. */
  15493. function wrapperToIterator() {
  15494. return this;
  15495. }
  15496. /**
  15497. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  15498. *
  15499. * @name plant
  15500. * @memberOf _
  15501. * @since 3.2.0
  15502. * @category Seq
  15503. * @param {*} value The value to plant.
  15504. * @returns {Object} Returns the new `lodash` wrapper instance.
  15505. * @example
  15506. *
  15507. * function square(n) {
  15508. * return n * n;
  15509. * }
  15510. *
  15511. * var wrapped = _([1, 2]).map(square);
  15512. * var other = wrapped.plant([3, 4]);
  15513. *
  15514. * other.value();
  15515. * // => [9, 16]
  15516. *
  15517. * wrapped.value();
  15518. * // => [1, 4]
  15519. */
  15520. function wrapperPlant(value) {
  15521. var result,
  15522. parent = this;
  15523. while (parent instanceof baseLodash) {
  15524. var clone = wrapperClone(parent);
  15525. clone.__index__ = 0;
  15526. clone.__values__ = undefined;
  15527. if (result) {
  15528. previous.__wrapped__ = clone;
  15529. } else {
  15530. result = clone;
  15531. }
  15532. var previous = clone;
  15533. parent = parent.__wrapped__;
  15534. }
  15535. previous.__wrapped__ = value;
  15536. return result;
  15537. }
  15538. /**
  15539. * This method is the wrapper version of `_.reverse`.
  15540. *
  15541. * **Note:** This method mutates the wrapped array.
  15542. *
  15543. * @name reverse
  15544. * @memberOf _
  15545. * @since 0.1.0
  15546. * @category Seq
  15547. * @returns {Object} Returns the new `lodash` wrapper instance.
  15548. * @example
  15549. *
  15550. * var array = [1, 2, 3];
  15551. *
  15552. * _(array).reverse().value()
  15553. * // => [3, 2, 1]
  15554. *
  15555. * console.log(array);
  15556. * // => [3, 2, 1]
  15557. */
  15558. function wrapperReverse() {
  15559. var value = this.__wrapped__;
  15560. if (value instanceof LazyWrapper) {
  15561. var wrapped = value;
  15562. if (this.__actions__.length) {
  15563. wrapped = new LazyWrapper(this);
  15564. }
  15565. wrapped = wrapped.reverse();
  15566. wrapped.__actions__.push({
  15567. 'func': thru,
  15568. 'args': [reverse],
  15569. 'thisArg': undefined
  15570. });
  15571. return new LodashWrapper(wrapped, this.__chain__);
  15572. }
  15573. return this.thru(reverse);
  15574. }
  15575. /**
  15576. * Executes the chain sequence to resolve the unwrapped value.
  15577. *
  15578. * @name value
  15579. * @memberOf _
  15580. * @since 0.1.0
  15581. * @alias toJSON, valueOf
  15582. * @category Seq
  15583. * @returns {*} Returns the resolved unwrapped value.
  15584. * @example
  15585. *
  15586. * _([1, 2, 3]).value();
  15587. * // => [1, 2, 3]
  15588. */
  15589. function wrapperValue() {
  15590. return baseWrapperValue(this.__wrapped__, this.__actions__);
  15591. }
  15592. /*------------------------------------------------------------------------*/
  15593. /**
  15594. * Creates an object composed of keys generated from the results of running
  15595. * each element of `collection` thru `iteratee`. The corresponding value of
  15596. * each key is the number of times the key was returned by `iteratee`. The
  15597. * iteratee is invoked with one argument: (value).
  15598. *
  15599. * @static
  15600. * @memberOf _
  15601. * @since 0.5.0
  15602. * @category Collection
  15603. * @param {Array|Object} collection The collection to iterate over.
  15604. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  15605. * @returns {Object} Returns the composed aggregate object.
  15606. * @example
  15607. *
  15608. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  15609. * // => { '4': 1, '6': 2 }
  15610. *
  15611. * // The `_.property` iteratee shorthand.
  15612. * _.countBy(['one', 'two', 'three'], 'length');
  15613. * // => { '3': 2, '5': 1 }
  15614. */
  15615. var countBy = createAggregator(function(result, value, key) {
  15616. if (hasOwnProperty.call(result, key)) {
  15617. ++result[key];
  15618. } else {
  15619. baseAssignValue(result, key, 1);
  15620. }
  15621. });
  15622. /**
  15623. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  15624. * Iteration is stopped once `predicate` returns falsey. The predicate is
  15625. * invoked with three arguments: (value, index|key, collection).
  15626. *
  15627. * **Note:** This method returns `true` for
  15628. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  15629. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  15630. * elements of empty collections.
  15631. *
  15632. * @static
  15633. * @memberOf _
  15634. * @since 0.1.0
  15635. * @category Collection
  15636. * @param {Array|Object} collection The collection to iterate over.
  15637. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  15638. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15639. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  15640. * else `false`.
  15641. * @example
  15642. *
  15643. * _.every([true, 1, null, 'yes'], Boolean);
  15644. * // => false
  15645. *
  15646. * var users = [
  15647. * { 'user': 'barney', 'age': 36, 'active': false },
  15648. * { 'user': 'fred', 'age': 40, 'active': false }
  15649. * ];
  15650. *
  15651. * // The `_.matches` iteratee shorthand.
  15652. * _.every(users, { 'user': 'barney', 'active': false });
  15653. * // => false
  15654. *
  15655. * // The `_.matchesProperty` iteratee shorthand.
  15656. * _.every(users, ['active', false]);
  15657. * // => true
  15658. *
  15659. * // The `_.property` iteratee shorthand.
  15660. * _.every(users, 'active');
  15661. * // => false
  15662. */
  15663. function every(collection, predicate, guard) {
  15664. var func = isArray(collection) ? arrayEvery : baseEvery;
  15665. if (guard && isIterateeCall(collection, predicate, guard)) {
  15666. predicate = undefined;
  15667. }
  15668. return func(collection, getIteratee(predicate, 3));
  15669. }
  15670. /**
  15671. * Iterates over elements of `collection`, returning an array of all elements
  15672. * `predicate` returns truthy for. The predicate is invoked with three
  15673. * arguments: (value, index|key, collection).
  15674. *
  15675. * **Note:** Unlike `_.remove`, this method returns a new array.
  15676. *
  15677. * @static
  15678. * @memberOf _
  15679. * @since 0.1.0
  15680. * @category Collection
  15681. * @param {Array|Object} collection The collection to iterate over.
  15682. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  15683. * @returns {Array} Returns the new filtered array.
  15684. * @see _.reject
  15685. * @example
  15686. *
  15687. * var users = [
  15688. * { 'user': 'barney', 'age': 36, 'active': true },
  15689. * { 'user': 'fred', 'age': 40, 'active': false }
  15690. * ];
  15691. *
  15692. * _.filter(users, function(o) { return !o.active; });
  15693. * // => objects for ['fred']
  15694. *
  15695. * // The `_.matches` iteratee shorthand.
  15696. * _.filter(users, { 'age': 36, 'active': true });
  15697. * // => objects for ['barney']
  15698. *
  15699. * // The `_.matchesProperty` iteratee shorthand.
  15700. * _.filter(users, ['active', false]);
  15701. * // => objects for ['fred']
  15702. *
  15703. * // The `_.property` iteratee shorthand.
  15704. * _.filter(users, 'active');
  15705. * // => objects for ['barney']
  15706. */
  15707. function filter(collection, predicate) {
  15708. var func = isArray(collection) ? arrayFilter : baseFilter;
  15709. return func(collection, getIteratee(predicate, 3));
  15710. }
  15711. /**
  15712. * Iterates over elements of `collection`, returning the first element
  15713. * `predicate` returns truthy for. The predicate is invoked with three
  15714. * arguments: (value, index|key, collection).
  15715. *
  15716. * @static
  15717. * @memberOf _
  15718. * @since 0.1.0
  15719. * @category Collection
  15720. * @param {Array|Object} collection The collection to inspect.
  15721. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  15722. * @param {number} [fromIndex=0] The index to search from.
  15723. * @returns {*} Returns the matched element, else `undefined`.
  15724. * @example
  15725. *
  15726. * var users = [
  15727. * { 'user': 'barney', 'age': 36, 'active': true },
  15728. * { 'user': 'fred', 'age': 40, 'active': false },
  15729. * { 'user': 'pebbles', 'age': 1, 'active': true }
  15730. * ];
  15731. *
  15732. * _.find(users, function(o) { return o.age < 40; });
  15733. * // => object for 'barney'
  15734. *
  15735. * // The `_.matches` iteratee shorthand.
  15736. * _.find(users, { 'age': 1, 'active': true });
  15737. * // => object for 'pebbles'
  15738. *
  15739. * // The `_.matchesProperty` iteratee shorthand.
  15740. * _.find(users, ['active', false]);
  15741. * // => object for 'fred'
  15742. *
  15743. * // The `_.property` iteratee shorthand.
  15744. * _.find(users, 'active');
  15745. * // => object for 'barney'
  15746. */
  15747. var find = createFind(findIndex);
  15748. /**
  15749. * This method is like `_.find` except that it iterates over elements of
  15750. * `collection` from right to left.
  15751. *
  15752. * @static
  15753. * @memberOf _
  15754. * @since 2.0.0
  15755. * @category Collection
  15756. * @param {Array|Object} collection The collection to inspect.
  15757. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  15758. * @param {number} [fromIndex=collection.length-1] The index to search from.
  15759. * @returns {*} Returns the matched element, else `undefined`.
  15760. * @example
  15761. *
  15762. * _.findLast([1, 2, 3, 4], function(n) {
  15763. * return n % 2 == 1;
  15764. * });
  15765. * // => 3
  15766. */
  15767. var findLast = createFind(findLastIndex);
  15768. /**
  15769. * Creates a flattened array of values by running each element in `collection`
  15770. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  15771. * with three arguments: (value, index|key, collection).
  15772. *
  15773. * @static
  15774. * @memberOf _
  15775. * @since 4.0.0
  15776. * @category Collection
  15777. * @param {Array|Object} collection The collection to iterate over.
  15778. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  15779. * @returns {Array} Returns the new flattened array.
  15780. * @example
  15781. *
  15782. * function duplicate(n) {
  15783. * return [n, n];
  15784. * }
  15785. *
  15786. * _.flatMap([1, 2], duplicate);
  15787. * // => [1, 1, 2, 2]
  15788. */
  15789. function flatMap(collection, iteratee) {
  15790. return baseFlatten(map(collection, iteratee), 1);
  15791. }
  15792. /**
  15793. * This method is like `_.flatMap` except that it recursively flattens the
  15794. * mapped results.
  15795. *
  15796. * @static
  15797. * @memberOf _
  15798. * @since 4.7.0
  15799. * @category Collection
  15800. * @param {Array|Object} collection The collection to iterate over.
  15801. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  15802. * @returns {Array} Returns the new flattened array.
  15803. * @example
  15804. *
  15805. * function duplicate(n) {
  15806. * return [[[n, n]]];
  15807. * }
  15808. *
  15809. * _.flatMapDeep([1, 2], duplicate);
  15810. * // => [1, 1, 2, 2]
  15811. */
  15812. function flatMapDeep(collection, iteratee) {
  15813. return baseFlatten(map(collection, iteratee), INFINITY);
  15814. }
  15815. /**
  15816. * This method is like `_.flatMap` except that it recursively flattens the
  15817. * mapped results up to `depth` times.
  15818. *
  15819. * @static
  15820. * @memberOf _
  15821. * @since 4.7.0
  15822. * @category Collection
  15823. * @param {Array|Object} collection The collection to iterate over.
  15824. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  15825. * @param {number} [depth=1] The maximum recursion depth.
  15826. * @returns {Array} Returns the new flattened array.
  15827. * @example
  15828. *
  15829. * function duplicate(n) {
  15830. * return [[[n, n]]];
  15831. * }
  15832. *
  15833. * _.flatMapDepth([1, 2], duplicate, 2);
  15834. * // => [[1, 1], [2, 2]]
  15835. */
  15836. function flatMapDepth(collection, iteratee, depth) {
  15837. depth = depth === undefined ? 1 : toInteger(depth);
  15838. return baseFlatten(map(collection, iteratee), depth);
  15839. }
  15840. /**
  15841. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  15842. * The iteratee is invoked with three arguments: (value, index|key, collection).
  15843. * Iteratee functions may exit iteration early by explicitly returning `false`.
  15844. *
  15845. * **Note:** As with other "Collections" methods, objects with a "length"
  15846. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  15847. * or `_.forOwn` for object iteration.
  15848. *
  15849. * @static
  15850. * @memberOf _
  15851. * @since 0.1.0
  15852. * @alias each
  15853. * @category Collection
  15854. * @param {Array|Object} collection The collection to iterate over.
  15855. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  15856. * @returns {Array|Object} Returns `collection`.
  15857. * @see _.forEachRight
  15858. * @example
  15859. *
  15860. * _.forEach([1, 2], function(value) {
  15861. * console.log(value);
  15862. * });
  15863. * // => Logs `1` then `2`.
  15864. *
  15865. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  15866. * console.log(key);
  15867. * });
  15868. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  15869. */
  15870. function forEach(collection, iteratee) {
  15871. var func = isArray(collection) ? arrayEach : baseEach;
  15872. return func(collection, getIteratee(iteratee, 3));
  15873. }
  15874. /**
  15875. * This method is like `_.forEach` except that it iterates over elements of
  15876. * `collection` from right to left.
  15877. *
  15878. * @static
  15879. * @memberOf _
  15880. * @since 2.0.0
  15881. * @alias eachRight
  15882. * @category Collection
  15883. * @param {Array|Object} collection The collection to iterate over.
  15884. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  15885. * @returns {Array|Object} Returns `collection`.
  15886. * @see _.forEach
  15887. * @example
  15888. *
  15889. * _.forEachRight([1, 2], function(value) {
  15890. * console.log(value);
  15891. * });
  15892. * // => Logs `2` then `1`.
  15893. */
  15894. function forEachRight(collection, iteratee) {
  15895. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  15896. return func(collection, getIteratee(iteratee, 3));
  15897. }
  15898. /**
  15899. * Creates an object composed of keys generated from the results of running
  15900. * each element of `collection` thru `iteratee`. The order of grouped values
  15901. * is determined by the order they occur in `collection`. The corresponding
  15902. * value of each key is an array of elements responsible for generating the
  15903. * key. The iteratee is invoked with one argument: (value).
  15904. *
  15905. * @static
  15906. * @memberOf _
  15907. * @since 0.1.0
  15908. * @category Collection
  15909. * @param {Array|Object} collection The collection to iterate over.
  15910. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  15911. * @returns {Object} Returns the composed aggregate object.
  15912. * @example
  15913. *
  15914. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  15915. * // => { '4': [4.2], '6': [6.1, 6.3] }
  15916. *
  15917. * // The `_.property` iteratee shorthand.
  15918. * _.groupBy(['one', 'two', 'three'], 'length');
  15919. * // => { '3': ['one', 'two'], '5': ['three'] }
  15920. */
  15921. var groupBy = createAggregator(function(result, value, key) {
  15922. if (hasOwnProperty.call(result, key)) {
  15923. result[key].push(value);
  15924. } else {
  15925. baseAssignValue(result, key, [value]);
  15926. }
  15927. });
  15928. /**
  15929. * Checks if `value` is in `collection`. If `collection` is a string, it's
  15930. * checked for a substring of `value`, otherwise
  15931. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  15932. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  15933. * the offset from the end of `collection`.
  15934. *
  15935. * @static
  15936. * @memberOf _
  15937. * @since 0.1.0
  15938. * @category Collection
  15939. * @param {Array|Object|string} collection The collection to inspect.
  15940. * @param {*} value The value to search for.
  15941. * @param {number} [fromIndex=0] The index to search from.
  15942. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  15943. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  15944. * @example
  15945. *
  15946. * _.includes([1, 2, 3], 1);
  15947. * // => true
  15948. *
  15949. * _.includes([1, 2, 3], 1, 2);
  15950. * // => false
  15951. *
  15952. * _.includes({ 'a': 1, 'b': 2 }, 1);
  15953. * // => true
  15954. *
  15955. * _.includes('abcd', 'bc');
  15956. * // => true
  15957. */
  15958. function includes(collection, value, fromIndex, guard) {
  15959. collection = isArrayLike(collection) ? collection : values(collection);
  15960. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  15961. var length = collection.length;
  15962. if (fromIndex < 0) {
  15963. fromIndex = nativeMax(length + fromIndex, 0);
  15964. }
  15965. return isString(collection)
  15966. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  15967. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  15968. }
  15969. /**
  15970. * Invokes the method at `path` of each element in `collection`, returning
  15971. * an array of the results of each invoked method. Any additional arguments
  15972. * are provided to each invoked method. If `path` is a function, it's invoked
  15973. * for, and `this` bound to, each element in `collection`.
  15974. *
  15975. * @static
  15976. * @memberOf _
  15977. * @since 4.0.0
  15978. * @category Collection
  15979. * @param {Array|Object} collection The collection to iterate over.
  15980. * @param {Array|Function|string} path The path of the method to invoke or
  15981. * the function invoked per iteration.
  15982. * @param {...*} [args] The arguments to invoke each method with.
  15983. * @returns {Array} Returns the array of results.
  15984. * @example
  15985. *
  15986. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  15987. * // => [[1, 5, 7], [1, 2, 3]]
  15988. *
  15989. * _.invokeMap([123, 456], String.prototype.split, '');
  15990. * // => [['1', '2', '3'], ['4', '5', '6']]
  15991. */
  15992. var invokeMap = baseRest(function(collection, path, args) {
  15993. var index = -1,
  15994. isFunc = typeof path == 'function',
  15995. result = isArrayLike(collection) ? Array(collection.length) : [];
  15996. baseEach(collection, function(value) {
  15997. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  15998. });
  15999. return result;
  16000. });
  16001. /**
  16002. * Creates an object composed of keys generated from the results of running
  16003. * each element of `collection` thru `iteratee`. The corresponding value of
  16004. * each key is the last element responsible for generating the key. The
  16005. * iteratee is invoked with one argument: (value).
  16006. *
  16007. * @static
  16008. * @memberOf _
  16009. * @since 4.0.0
  16010. * @category Collection
  16011. * @param {Array|Object} collection The collection to iterate over.
  16012. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  16013. * @returns {Object} Returns the composed aggregate object.
  16014. * @example
  16015. *
  16016. * var array = [
  16017. * { 'dir': 'left', 'code': 97 },
  16018. * { 'dir': 'right', 'code': 100 }
  16019. * ];
  16020. *
  16021. * _.keyBy(array, function(o) {
  16022. * return String.fromCharCode(o.code);
  16023. * });
  16024. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  16025. *
  16026. * _.keyBy(array, 'dir');
  16027. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  16028. */
  16029. var keyBy = createAggregator(function(result, value, key) {
  16030. baseAssignValue(result, key, value);
  16031. });
  16032. /**
  16033. * Creates an array of values by running each element in `collection` thru
  16034. * `iteratee`. The iteratee is invoked with three arguments:
  16035. * (value, index|key, collection).
  16036. *
  16037. * Many lodash methods are guarded to work as iteratees for methods like
  16038. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  16039. *
  16040. * The guarded methods are:
  16041. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  16042. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  16043. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  16044. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  16045. *
  16046. * @static
  16047. * @memberOf _
  16048. * @since 0.1.0
  16049. * @category Collection
  16050. * @param {Array|Object} collection The collection to iterate over.
  16051. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16052. * @returns {Array} Returns the new mapped array.
  16053. * @example
  16054. *
  16055. * function square(n) {
  16056. * return n * n;
  16057. * }
  16058. *
  16059. * _.map([4, 8], square);
  16060. * // => [16, 64]
  16061. *
  16062. * _.map({ 'a': 4, 'b': 8 }, square);
  16063. * // => [16, 64] (iteration order is not guaranteed)
  16064. *
  16065. * var users = [
  16066. * { 'user': 'barney' },
  16067. * { 'user': 'fred' }
  16068. * ];
  16069. *
  16070. * // The `_.property` iteratee shorthand.
  16071. * _.map(users, 'user');
  16072. * // => ['barney', 'fred']
  16073. */
  16074. function map(collection, iteratee) {
  16075. var func = isArray(collection) ? arrayMap : baseMap;
  16076. return func(collection, getIteratee(iteratee, 3));
  16077. }
  16078. /**
  16079. * This method is like `_.sortBy` except that it allows specifying the sort
  16080. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  16081. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  16082. * descending or "asc" for ascending sort order of corresponding values.
  16083. *
  16084. * @static
  16085. * @memberOf _
  16086. * @since 4.0.0
  16087. * @category Collection
  16088. * @param {Array|Object} collection The collection to iterate over.
  16089. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  16090. * The iteratees to sort by.
  16091. * @param {string[]} [orders] The sort orders of `iteratees`.
  16092. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  16093. * @returns {Array} Returns the new sorted array.
  16094. * @example
  16095. *
  16096. * var users = [
  16097. * { 'user': 'fred', 'age': 48 },
  16098. * { 'user': 'barney', 'age': 34 },
  16099. * { 'user': 'fred', 'age': 40 },
  16100. * { 'user': 'barney', 'age': 36 }
  16101. * ];
  16102. *
  16103. * // Sort by `user` in ascending order and by `age` in descending order.
  16104. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  16105. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  16106. */
  16107. function orderBy(collection, iteratees, orders, guard) {
  16108. if (collection == null) {
  16109. return [];
  16110. }
  16111. if (!isArray(iteratees)) {
  16112. iteratees = iteratees == null ? [] : [iteratees];
  16113. }
  16114. orders = guard ? undefined : orders;
  16115. if (!isArray(orders)) {
  16116. orders = orders == null ? [] : [orders];
  16117. }
  16118. return baseOrderBy(collection, iteratees, orders);
  16119. }
  16120. /**
  16121. * Creates an array of elements split into two groups, the first of which
  16122. * contains elements `predicate` returns truthy for, the second of which
  16123. * contains elements `predicate` returns falsey for. The predicate is
  16124. * invoked with one argument: (value).
  16125. *
  16126. * @static
  16127. * @memberOf _
  16128. * @since 3.0.0
  16129. * @category Collection
  16130. * @param {Array|Object} collection The collection to iterate over.
  16131. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  16132. * @returns {Array} Returns the array of grouped elements.
  16133. * @example
  16134. *
  16135. * var users = [
  16136. * { 'user': 'barney', 'age': 36, 'active': false },
  16137. * { 'user': 'fred', 'age': 40, 'active': true },
  16138. * { 'user': 'pebbles', 'age': 1, 'active': false }
  16139. * ];
  16140. *
  16141. * _.partition(users, function(o) { return o.active; });
  16142. * // => objects for [['fred'], ['barney', 'pebbles']]
  16143. *
  16144. * // The `_.matches` iteratee shorthand.
  16145. * _.partition(users, { 'age': 1, 'active': false });
  16146. * // => objects for [['pebbles'], ['barney', 'fred']]
  16147. *
  16148. * // The `_.matchesProperty` iteratee shorthand.
  16149. * _.partition(users, ['active', false]);
  16150. * // => objects for [['barney', 'pebbles'], ['fred']]
  16151. *
  16152. * // The `_.property` iteratee shorthand.
  16153. * _.partition(users, 'active');
  16154. * // => objects for [['fred'], ['barney', 'pebbles']]
  16155. */
  16156. var partition = createAggregator(function(result, value, key) {
  16157. result[key ? 0 : 1].push(value);
  16158. }, function() { return [[], []]; });
  16159. /**
  16160. * Reduces `collection` to a value which is the accumulated result of running
  16161. * each element in `collection` thru `iteratee`, where each successive
  16162. * invocation is supplied the return value of the previous. If `accumulator`
  16163. * is not given, the first element of `collection` is used as the initial
  16164. * value. The iteratee is invoked with four arguments:
  16165. * (accumulator, value, index|key, collection).
  16166. *
  16167. * Many lodash methods are guarded to work as iteratees for methods like
  16168. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  16169. *
  16170. * The guarded methods are:
  16171. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  16172. * and `sortBy`
  16173. *
  16174. * @static
  16175. * @memberOf _
  16176. * @since 0.1.0
  16177. * @category Collection
  16178. * @param {Array|Object} collection The collection to iterate over.
  16179. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16180. * @param {*} [accumulator] The initial value.
  16181. * @returns {*} Returns the accumulated value.
  16182. * @see _.reduceRight
  16183. * @example
  16184. *
  16185. * _.reduce([1, 2], function(sum, n) {
  16186. * return sum + n;
  16187. * }, 0);
  16188. * // => 3
  16189. *
  16190. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  16191. * (result[value] || (result[value] = [])).push(key);
  16192. * return result;
  16193. * }, {});
  16194. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  16195. */
  16196. function reduce(collection, iteratee, accumulator) {
  16197. var func = isArray(collection) ? arrayReduce : baseReduce,
  16198. initAccum = arguments.length < 3;
  16199. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  16200. }
  16201. /**
  16202. * This method is like `_.reduce` except that it iterates over elements of
  16203. * `collection` from right to left.
  16204. *
  16205. * @static
  16206. * @memberOf _
  16207. * @since 0.1.0
  16208. * @category Collection
  16209. * @param {Array|Object} collection The collection to iterate over.
  16210. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16211. * @param {*} [accumulator] The initial value.
  16212. * @returns {*} Returns the accumulated value.
  16213. * @see _.reduce
  16214. * @example
  16215. *
  16216. * var array = [[0, 1], [2, 3], [4, 5]];
  16217. *
  16218. * _.reduceRight(array, function(flattened, other) {
  16219. * return flattened.concat(other);
  16220. * }, []);
  16221. * // => [4, 5, 2, 3, 0, 1]
  16222. */
  16223. function reduceRight(collection, iteratee, accumulator) {
  16224. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  16225. initAccum = arguments.length < 3;
  16226. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  16227. }
  16228. /**
  16229. * The opposite of `_.filter`; this method returns the elements of `collection`
  16230. * that `predicate` does **not** return truthy for.
  16231. *
  16232. * @static
  16233. * @memberOf _
  16234. * @since 0.1.0
  16235. * @category Collection
  16236. * @param {Array|Object} collection The collection to iterate over.
  16237. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  16238. * @returns {Array} Returns the new filtered array.
  16239. * @see _.filter
  16240. * @example
  16241. *
  16242. * var users = [
  16243. * { 'user': 'barney', 'age': 36, 'active': false },
  16244. * { 'user': 'fred', 'age': 40, 'active': true }
  16245. * ];
  16246. *
  16247. * _.reject(users, function(o) { return !o.active; });
  16248. * // => objects for ['fred']
  16249. *
  16250. * // The `_.matches` iteratee shorthand.
  16251. * _.reject(users, { 'age': 40, 'active': true });
  16252. * // => objects for ['barney']
  16253. *
  16254. * // The `_.matchesProperty` iteratee shorthand.
  16255. * _.reject(users, ['active', false]);
  16256. * // => objects for ['fred']
  16257. *
  16258. * // The `_.property` iteratee shorthand.
  16259. * _.reject(users, 'active');
  16260. * // => objects for ['barney']
  16261. */
  16262. function reject(collection, predicate) {
  16263. var func = isArray(collection) ? arrayFilter : baseFilter;
  16264. return func(collection, negate(getIteratee(predicate, 3)));
  16265. }
  16266. /**
  16267. * Gets a random element from `collection`.
  16268. *
  16269. * @static
  16270. * @memberOf _
  16271. * @since 2.0.0
  16272. * @category Collection
  16273. * @param {Array|Object} collection The collection to sample.
  16274. * @returns {*} Returns the random element.
  16275. * @example
  16276. *
  16277. * _.sample([1, 2, 3, 4]);
  16278. * // => 2
  16279. */
  16280. function sample(collection) {
  16281. var func = isArray(collection) ? arraySample : baseSample;
  16282. return func(collection);
  16283. }
  16284. /**
  16285. * Gets `n` random elements at unique keys from `collection` up to the
  16286. * size of `collection`.
  16287. *
  16288. * @static
  16289. * @memberOf _
  16290. * @since 4.0.0
  16291. * @category Collection
  16292. * @param {Array|Object} collection The collection to sample.
  16293. * @param {number} [n=1] The number of elements to sample.
  16294. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16295. * @returns {Array} Returns the random elements.
  16296. * @example
  16297. *
  16298. * _.sampleSize([1, 2, 3], 2);
  16299. * // => [3, 1]
  16300. *
  16301. * _.sampleSize([1, 2, 3], 4);
  16302. * // => [2, 3, 1]
  16303. */
  16304. function sampleSize(collection, n, guard) {
  16305. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  16306. n = 1;
  16307. } else {
  16308. n = toInteger(n);
  16309. }
  16310. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  16311. return func(collection, n);
  16312. }
  16313. /**
  16314. * Creates an array of shuffled values, using a version of the
  16315. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  16316. *
  16317. * @static
  16318. * @memberOf _
  16319. * @since 0.1.0
  16320. * @category Collection
  16321. * @param {Array|Object} collection The collection to shuffle.
  16322. * @returns {Array} Returns the new shuffled array.
  16323. * @example
  16324. *
  16325. * _.shuffle([1, 2, 3, 4]);
  16326. * // => [4, 1, 3, 2]
  16327. */
  16328. function shuffle(collection) {
  16329. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  16330. return func(collection);
  16331. }
  16332. /**
  16333. * Gets the size of `collection` by returning its length for array-like
  16334. * values or the number of own enumerable string keyed properties for objects.
  16335. *
  16336. * @static
  16337. * @memberOf _
  16338. * @since 0.1.0
  16339. * @category Collection
  16340. * @param {Array|Object|string} collection The collection to inspect.
  16341. * @returns {number} Returns the collection size.
  16342. * @example
  16343. *
  16344. * _.size([1, 2, 3]);
  16345. * // => 3
  16346. *
  16347. * _.size({ 'a': 1, 'b': 2 });
  16348. * // => 2
  16349. *
  16350. * _.size('pebbles');
  16351. * // => 7
  16352. */
  16353. function size(collection) {
  16354. if (collection == null) {
  16355. return 0;
  16356. }
  16357. if (isArrayLike(collection)) {
  16358. return isString(collection) ? stringSize(collection) : collection.length;
  16359. }
  16360. var tag = getTag(collection);
  16361. if (tag == mapTag || tag == setTag) {
  16362. return collection.size;
  16363. }
  16364. return baseKeys(collection).length;
  16365. }
  16366. /**
  16367. * Checks if `predicate` returns truthy for **any** element of `collection`.
  16368. * Iteration is stopped once `predicate` returns truthy. The predicate is
  16369. * invoked with three arguments: (value, index|key, collection).
  16370. *
  16371. * @static
  16372. * @memberOf _
  16373. * @since 0.1.0
  16374. * @category Collection
  16375. * @param {Array|Object} collection The collection to iterate over.
  16376. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  16377. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16378. * @returns {boolean} Returns `true` if any element passes the predicate check,
  16379. * else `false`.
  16380. * @example
  16381. *
  16382. * _.some([null, 0, 'yes', false], Boolean);
  16383. * // => true
  16384. *
  16385. * var users = [
  16386. * { 'user': 'barney', 'active': true },
  16387. * { 'user': 'fred', 'active': false }
  16388. * ];
  16389. *
  16390. * // The `_.matches` iteratee shorthand.
  16391. * _.some(users, { 'user': 'barney', 'active': false });
  16392. * // => false
  16393. *
  16394. * // The `_.matchesProperty` iteratee shorthand.
  16395. * _.some(users, ['active', false]);
  16396. * // => true
  16397. *
  16398. * // The `_.property` iteratee shorthand.
  16399. * _.some(users, 'active');
  16400. * // => true
  16401. */
  16402. function some(collection, predicate, guard) {
  16403. var func = isArray(collection) ? arraySome : baseSome;
  16404. if (guard && isIterateeCall(collection, predicate, guard)) {
  16405. predicate = undefined;
  16406. }
  16407. return func(collection, getIteratee(predicate, 3));
  16408. }
  16409. /**
  16410. * Creates an array of elements, sorted in ascending order by the results of
  16411. * running each element in a collection thru each iteratee. This method
  16412. * performs a stable sort, that is, it preserves the original sort order of
  16413. * equal elements. The iteratees are invoked with one argument: (value).
  16414. *
  16415. * @static
  16416. * @memberOf _
  16417. * @since 0.1.0
  16418. * @category Collection
  16419. * @param {Array|Object} collection The collection to iterate over.
  16420. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16421. * The iteratees to sort by.
  16422. * @returns {Array} Returns the new sorted array.
  16423. * @example
  16424. *
  16425. * var users = [
  16426. * { 'user': 'fred', 'age': 48 },
  16427. * { 'user': 'barney', 'age': 36 },
  16428. * { 'user': 'fred', 'age': 40 },
  16429. * { 'user': 'barney', 'age': 34 }
  16430. * ];
  16431. *
  16432. * _.sortBy(users, [function(o) { return o.user; }]);
  16433. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  16434. *
  16435. * _.sortBy(users, ['user', 'age']);
  16436. * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
  16437. */
  16438. var sortBy = baseRest(function(collection, iteratees) {
  16439. if (collection == null) {
  16440. return [];
  16441. }
  16442. var length = iteratees.length;
  16443. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  16444. iteratees = [];
  16445. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  16446. iteratees = [iteratees[0]];
  16447. }
  16448. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  16449. });
  16450. /*------------------------------------------------------------------------*/
  16451. /**
  16452. * Gets the timestamp of the number of milliseconds that have elapsed since
  16453. * the Unix epoch (1 January 1970 00:00:00 UTC).
  16454. *
  16455. * @static
  16456. * @memberOf _
  16457. * @since 2.4.0
  16458. * @category Date
  16459. * @returns {number} Returns the timestamp.
  16460. * @example
  16461. *
  16462. * _.defer(function(stamp) {
  16463. * console.log(_.now() - stamp);
  16464. * }, _.now());
  16465. * // => Logs the number of milliseconds it took for the deferred invocation.
  16466. */
  16467. var now = ctxNow || function() {
  16468. return root.Date.now();
  16469. };
  16470. /*------------------------------------------------------------------------*/
  16471. /**
  16472. * The opposite of `_.before`; this method creates a function that invokes
  16473. * `func` once it's called `n` or more times.
  16474. *
  16475. * @static
  16476. * @memberOf _
  16477. * @since 0.1.0
  16478. * @category Function
  16479. * @param {number} n The number of calls before `func` is invoked.
  16480. * @param {Function} func The function to restrict.
  16481. * @returns {Function} Returns the new restricted function.
  16482. * @example
  16483. *
  16484. * var saves = ['profile', 'settings'];
  16485. *
  16486. * var done = _.after(saves.length, function() {
  16487. * console.log('done saving!');
  16488. * });
  16489. *
  16490. * _.forEach(saves, function(type) {
  16491. * asyncSave({ 'type': type, 'complete': done });
  16492. * });
  16493. * // => Logs 'done saving!' after the two async saves have completed.
  16494. */
  16495. function after(n, func) {
  16496. if (typeof func != 'function') {
  16497. throw new TypeError(FUNC_ERROR_TEXT);
  16498. }
  16499. n = toInteger(n);
  16500. return function() {
  16501. if (--n < 1) {
  16502. return func.apply(this, arguments);
  16503. }
  16504. };
  16505. }
  16506. /**
  16507. * Creates a function that invokes `func`, with up to `n` arguments,
  16508. * ignoring any additional arguments.
  16509. *
  16510. * @static
  16511. * @memberOf _
  16512. * @since 3.0.0
  16513. * @category Function
  16514. * @param {Function} func The function to cap arguments for.
  16515. * @param {number} [n=func.length] The arity cap.
  16516. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16517. * @returns {Function} Returns the new capped function.
  16518. * @example
  16519. *
  16520. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  16521. * // => [6, 8, 10]
  16522. */
  16523. function ary(func, n, guard) {
  16524. n = guard ? undefined : n;
  16525. n = (func && n == null) ? func.length : n;
  16526. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  16527. }
  16528. /**
  16529. * Creates a function that invokes `func`, with the `this` binding and arguments
  16530. * of the created function, while it's called less than `n` times. Subsequent
  16531. * calls to the created function return the result of the last `func` invocation.
  16532. *
  16533. * @static
  16534. * @memberOf _
  16535. * @since 3.0.0
  16536. * @category Function
  16537. * @param {number} n The number of calls at which `func` is no longer invoked.
  16538. * @param {Function} func The function to restrict.
  16539. * @returns {Function} Returns the new restricted function.
  16540. * @example
  16541. *
  16542. * jQuery(element).on('click', _.before(5, addContactToList));
  16543. * // => Allows adding up to 4 contacts to the list.
  16544. */
  16545. function before(n, func) {
  16546. var result;
  16547. if (typeof func != 'function') {
  16548. throw new TypeError(FUNC_ERROR_TEXT);
  16549. }
  16550. n = toInteger(n);
  16551. return function() {
  16552. if (--n > 0) {
  16553. result = func.apply(this, arguments);
  16554. }
  16555. if (n <= 1) {
  16556. func = undefined;
  16557. }
  16558. return result;
  16559. };
  16560. }
  16561. /**
  16562. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  16563. * and `partials` prepended to the arguments it receives.
  16564. *
  16565. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  16566. * may be used as a placeholder for partially applied arguments.
  16567. *
  16568. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  16569. * property of bound functions.
  16570. *
  16571. * @static
  16572. * @memberOf _
  16573. * @since 0.1.0
  16574. * @category Function
  16575. * @param {Function} func The function to bind.
  16576. * @param {*} thisArg The `this` binding of `func`.
  16577. * @param {...*} [partials] The arguments to be partially applied.
  16578. * @returns {Function} Returns the new bound function.
  16579. * @example
  16580. *
  16581. * function greet(greeting, punctuation) {
  16582. * return greeting + ' ' + this.user + punctuation;
  16583. * }
  16584. *
  16585. * var object = { 'user': 'fred' };
  16586. *
  16587. * var bound = _.bind(greet, object, 'hi');
  16588. * bound('!');
  16589. * // => 'hi fred!'
  16590. *
  16591. * // Bound with placeholders.
  16592. * var bound = _.bind(greet, object, _, '!');
  16593. * bound('hi');
  16594. * // => 'hi fred!'
  16595. */
  16596. var bind = baseRest(function(func, thisArg, partials) {
  16597. var bitmask = WRAP_BIND_FLAG;
  16598. if (partials.length) {
  16599. var holders = replaceHolders(partials, getHolder(bind));
  16600. bitmask |= WRAP_PARTIAL_FLAG;
  16601. }
  16602. return createWrap(func, bitmask, thisArg, partials, holders);
  16603. });
  16604. /**
  16605. * Creates a function that invokes the method at `object[key]` with `partials`
  16606. * prepended to the arguments it receives.
  16607. *
  16608. * This method differs from `_.bind` by allowing bound functions to reference
  16609. * methods that may be redefined or don't yet exist. See
  16610. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  16611. * for more details.
  16612. *
  16613. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  16614. * builds, may be used as a placeholder for partially applied arguments.
  16615. *
  16616. * @static
  16617. * @memberOf _
  16618. * @since 0.10.0
  16619. * @category Function
  16620. * @param {Object} object The object to invoke the method on.
  16621. * @param {string} key The key of the method.
  16622. * @param {...*} [partials] The arguments to be partially applied.
  16623. * @returns {Function} Returns the new bound function.
  16624. * @example
  16625. *
  16626. * var object = {
  16627. * 'user': 'fred',
  16628. * 'greet': function(greeting, punctuation) {
  16629. * return greeting + ' ' + this.user + punctuation;
  16630. * }
  16631. * };
  16632. *
  16633. * var bound = _.bindKey(object, 'greet', 'hi');
  16634. * bound('!');
  16635. * // => 'hi fred!'
  16636. *
  16637. * object.greet = function(greeting, punctuation) {
  16638. * return greeting + 'ya ' + this.user + punctuation;
  16639. * };
  16640. *
  16641. * bound('!');
  16642. * // => 'hiya fred!'
  16643. *
  16644. * // Bound with placeholders.
  16645. * var bound = _.bindKey(object, 'greet', _, '!');
  16646. * bound('hi');
  16647. * // => 'hiya fred!'
  16648. */
  16649. var bindKey = baseRest(function(object, key, partials) {
  16650. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  16651. if (partials.length) {
  16652. var holders = replaceHolders(partials, getHolder(bindKey));
  16653. bitmask |= WRAP_PARTIAL_FLAG;
  16654. }
  16655. return createWrap(key, bitmask, object, partials, holders);
  16656. });
  16657. /**
  16658. * Creates a function that accepts arguments of `func` and either invokes
  16659. * `func` returning its result, if at least `arity` number of arguments have
  16660. * been provided, or returns a function that accepts the remaining `func`
  16661. * arguments, and so on. The arity of `func` may be specified if `func.length`
  16662. * is not sufficient.
  16663. *
  16664. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  16665. * may be used as a placeholder for provided arguments.
  16666. *
  16667. * **Note:** This method doesn't set the "length" property of curried functions.
  16668. *
  16669. * @static
  16670. * @memberOf _
  16671. * @since 2.0.0
  16672. * @category Function
  16673. * @param {Function} func The function to curry.
  16674. * @param {number} [arity=func.length] The arity of `func`.
  16675. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16676. * @returns {Function} Returns the new curried function.
  16677. * @example
  16678. *
  16679. * var abc = function(a, b, c) {
  16680. * return [a, b, c];
  16681. * };
  16682. *
  16683. * var curried = _.curry(abc);
  16684. *
  16685. * curried(1)(2)(3);
  16686. * // => [1, 2, 3]
  16687. *
  16688. * curried(1, 2)(3);
  16689. * // => [1, 2, 3]
  16690. *
  16691. * curried(1, 2, 3);
  16692. * // => [1, 2, 3]
  16693. *
  16694. * // Curried with placeholders.
  16695. * curried(1)(_, 3)(2);
  16696. * // => [1, 2, 3]
  16697. */
  16698. function curry(func, arity, guard) {
  16699. arity = guard ? undefined : arity;
  16700. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  16701. result.placeholder = curry.placeholder;
  16702. return result;
  16703. }
  16704. /**
  16705. * This method is like `_.curry` except that arguments are applied to `func`
  16706. * in the manner of `_.partialRight` instead of `_.partial`.
  16707. *
  16708. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  16709. * builds, may be used as a placeholder for provided arguments.
  16710. *
  16711. * **Note:** This method doesn't set the "length" property of curried functions.
  16712. *
  16713. * @static
  16714. * @memberOf _
  16715. * @since 3.0.0
  16716. * @category Function
  16717. * @param {Function} func The function to curry.
  16718. * @param {number} [arity=func.length] The arity of `func`.
  16719. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16720. * @returns {Function} Returns the new curried function.
  16721. * @example
  16722. *
  16723. * var abc = function(a, b, c) {
  16724. * return [a, b, c];
  16725. * };
  16726. *
  16727. * var curried = _.curryRight(abc);
  16728. *
  16729. * curried(3)(2)(1);
  16730. * // => [1, 2, 3]
  16731. *
  16732. * curried(2, 3)(1);
  16733. * // => [1, 2, 3]
  16734. *
  16735. * curried(1, 2, 3);
  16736. * // => [1, 2, 3]
  16737. *
  16738. * // Curried with placeholders.
  16739. * curried(3)(1, _)(2);
  16740. * // => [1, 2, 3]
  16741. */
  16742. function curryRight(func, arity, guard) {
  16743. arity = guard ? undefined : arity;
  16744. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  16745. result.placeholder = curryRight.placeholder;
  16746. return result;
  16747. }
  16748. /**
  16749. * Creates a debounced function that delays invoking `func` until after `wait`
  16750. * milliseconds have elapsed since the last time the debounced function was
  16751. * invoked. The debounced function comes with a `cancel` method to cancel
  16752. * delayed `func` invocations and a `flush` method to immediately invoke them.
  16753. * Provide `options` to indicate whether `func` should be invoked on the
  16754. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  16755. * with the last arguments provided to the debounced function. Subsequent
  16756. * calls to the debounced function return the result of the last `func`
  16757. * invocation.
  16758. *
  16759. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  16760. * invoked on the trailing edge of the timeout only if the debounced function
  16761. * is invoked more than once during the `wait` timeout.
  16762. *
  16763. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  16764. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  16765. *
  16766. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  16767. * for details over the differences between `_.debounce` and `_.throttle`.
  16768. *
  16769. * @static
  16770. * @memberOf _
  16771. * @since 0.1.0
  16772. * @category Function
  16773. * @param {Function} func The function to debounce.
  16774. * @param {number} [wait=0] The number of milliseconds to delay.
  16775. * @param {Object} [options={}] The options object.
  16776. * @param {boolean} [options.leading=false]
  16777. * Specify invoking on the leading edge of the timeout.
  16778. * @param {number} [options.maxWait]
  16779. * The maximum time `func` is allowed to be delayed before it's invoked.
  16780. * @param {boolean} [options.trailing=true]
  16781. * Specify invoking on the trailing edge of the timeout.
  16782. * @returns {Function} Returns the new debounced function.
  16783. * @example
  16784. *
  16785. * // Avoid costly calculations while the window size is in flux.
  16786. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  16787. *
  16788. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  16789. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  16790. * 'leading': true,
  16791. * 'trailing': false
  16792. * }));
  16793. *
  16794. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  16795. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  16796. * var source = new EventSource('/stream');
  16797. * jQuery(source).on('message', debounced);
  16798. *
  16799. * // Cancel the trailing debounced invocation.
  16800. * jQuery(window).on('popstate', debounced.cancel);
  16801. */
  16802. function debounce(func, wait, options) {
  16803. var lastArgs,
  16804. lastThis,
  16805. maxWait,
  16806. result,
  16807. timerId,
  16808. lastCallTime,
  16809. lastInvokeTime = 0,
  16810. leading = false,
  16811. maxing = false,
  16812. trailing = true;
  16813. if (typeof func != 'function') {
  16814. throw new TypeError(FUNC_ERROR_TEXT);
  16815. }
  16816. wait = toNumber(wait) || 0;
  16817. if (isObject(options)) {
  16818. leading = !!options.leading;
  16819. maxing = 'maxWait' in options;
  16820. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  16821. trailing = 'trailing' in options ? !!options.trailing : trailing;
  16822. }
  16823. function invokeFunc(time) {
  16824. var args = lastArgs,
  16825. thisArg = lastThis;
  16826. lastArgs = lastThis = undefined;
  16827. lastInvokeTime = time;
  16828. result = func.apply(thisArg, args);
  16829. return result;
  16830. }
  16831. function leadingEdge(time) {
  16832. // Reset any `maxWait` timer.
  16833. lastInvokeTime = time;
  16834. // Start the timer for the trailing edge.
  16835. timerId = setTimeout(timerExpired, wait);
  16836. // Invoke the leading edge.
  16837. return leading ? invokeFunc(time) : result;
  16838. }
  16839. function remainingWait(time) {
  16840. var timeSinceLastCall = time - lastCallTime,
  16841. timeSinceLastInvoke = time - lastInvokeTime,
  16842. timeWaiting = wait - timeSinceLastCall;
  16843. return maxing
  16844. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  16845. : timeWaiting;
  16846. }
  16847. function shouldInvoke(time) {
  16848. var timeSinceLastCall = time - lastCallTime,
  16849. timeSinceLastInvoke = time - lastInvokeTime;
  16850. // Either this is the first call, activity has stopped and we're at the
  16851. // trailing edge, the system time has gone backwards and we're treating
  16852. // it as the trailing edge, or we've hit the `maxWait` limit.
  16853. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  16854. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  16855. }
  16856. function timerExpired() {
  16857. var time = now();
  16858. if (shouldInvoke(time)) {
  16859. return trailingEdge(time);
  16860. }
  16861. // Restart the timer.
  16862. timerId = setTimeout(timerExpired, remainingWait(time));
  16863. }
  16864. function trailingEdge(time) {
  16865. timerId = undefined;
  16866. // Only invoke if we have `lastArgs` which means `func` has been
  16867. // debounced at least once.
  16868. if (trailing && lastArgs) {
  16869. return invokeFunc(time);
  16870. }
  16871. lastArgs = lastThis = undefined;
  16872. return result;
  16873. }
  16874. function cancel() {
  16875. if (timerId !== undefined) {
  16876. clearTimeout(timerId);
  16877. }
  16878. lastInvokeTime = 0;
  16879. lastArgs = lastCallTime = lastThis = timerId = undefined;
  16880. }
  16881. function flush() {
  16882. return timerId === undefined ? result : trailingEdge(now());
  16883. }
  16884. function debounced() {
  16885. var time = now(),
  16886. isInvoking = shouldInvoke(time);
  16887. lastArgs = arguments;
  16888. lastThis = this;
  16889. lastCallTime = time;
  16890. if (isInvoking) {
  16891. if (timerId === undefined) {
  16892. return leadingEdge(lastCallTime);
  16893. }
  16894. if (maxing) {
  16895. // Handle invocations in a tight loop.
  16896. timerId = setTimeout(timerExpired, wait);
  16897. return invokeFunc(lastCallTime);
  16898. }
  16899. }
  16900. if (timerId === undefined) {
  16901. timerId = setTimeout(timerExpired, wait);
  16902. }
  16903. return result;
  16904. }
  16905. debounced.cancel = cancel;
  16906. debounced.flush = flush;
  16907. return debounced;
  16908. }
  16909. /**
  16910. * Defers invoking the `func` until the current call stack has cleared. Any
  16911. * additional arguments are provided to `func` when it's invoked.
  16912. *
  16913. * @static
  16914. * @memberOf _
  16915. * @since 0.1.0
  16916. * @category Function
  16917. * @param {Function} func The function to defer.
  16918. * @param {...*} [args] The arguments to invoke `func` with.
  16919. * @returns {number} Returns the timer id.
  16920. * @example
  16921. *
  16922. * _.defer(function(text) {
  16923. * console.log(text);
  16924. * }, 'deferred');
  16925. * // => Logs 'deferred' after one millisecond.
  16926. */
  16927. var defer = baseRest(function(func, args) {
  16928. return baseDelay(func, 1, args);
  16929. });
  16930. /**
  16931. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  16932. * provided to `func` when it's invoked.
  16933. *
  16934. * @static
  16935. * @memberOf _
  16936. * @since 0.1.0
  16937. * @category Function
  16938. * @param {Function} func The function to delay.
  16939. * @param {number} wait The number of milliseconds to delay invocation.
  16940. * @param {...*} [args] The arguments to invoke `func` with.
  16941. * @returns {number} Returns the timer id.
  16942. * @example
  16943. *
  16944. * _.delay(function(text) {
  16945. * console.log(text);
  16946. * }, 1000, 'later');
  16947. * // => Logs 'later' after one second.
  16948. */
  16949. var delay = baseRest(function(func, wait, args) {
  16950. return baseDelay(func, toNumber(wait) || 0, args);
  16951. });
  16952. /**
  16953. * Creates a function that invokes `func` with arguments reversed.
  16954. *
  16955. * @static
  16956. * @memberOf _
  16957. * @since 4.0.0
  16958. * @category Function
  16959. * @param {Function} func The function to flip arguments for.
  16960. * @returns {Function} Returns the new flipped function.
  16961. * @example
  16962. *
  16963. * var flipped = _.flip(function() {
  16964. * return _.toArray(arguments);
  16965. * });
  16966. *
  16967. * flipped('a', 'b', 'c', 'd');
  16968. * // => ['d', 'c', 'b', 'a']
  16969. */
  16970. function flip(func) {
  16971. return createWrap(func, WRAP_FLIP_FLAG);
  16972. }
  16973. /**
  16974. * Creates a function that memoizes the result of `func`. If `resolver` is
  16975. * provided, it determines the cache key for storing the result based on the
  16976. * arguments provided to the memoized function. By default, the first argument
  16977. * provided to the memoized function is used as the map cache key. The `func`
  16978. * is invoked with the `this` binding of the memoized function.
  16979. *
  16980. * **Note:** The cache is exposed as the `cache` property on the memoized
  16981. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  16982. * constructor with one whose instances implement the
  16983. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  16984. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  16985. *
  16986. * @static
  16987. * @memberOf _
  16988. * @since 0.1.0
  16989. * @category Function
  16990. * @param {Function} func The function to have its output memoized.
  16991. * @param {Function} [resolver] The function to resolve the cache key.
  16992. * @returns {Function} Returns the new memoized function.
  16993. * @example
  16994. *
  16995. * var object = { 'a': 1, 'b': 2 };
  16996. * var other = { 'c': 3, 'd': 4 };
  16997. *
  16998. * var values = _.memoize(_.values);
  16999. * values(object);
  17000. * // => [1, 2]
  17001. *
  17002. * values(other);
  17003. * // => [3, 4]
  17004. *
  17005. * object.a = 2;
  17006. * values(object);
  17007. * // => [1, 2]
  17008. *
  17009. * // Modify the result cache.
  17010. * values.cache.set(object, ['a', 'b']);
  17011. * values(object);
  17012. * // => ['a', 'b']
  17013. *
  17014. * // Replace `_.memoize.Cache`.
  17015. * _.memoize.Cache = WeakMap;
  17016. */
  17017. function memoize(func, resolver) {
  17018. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  17019. throw new TypeError(FUNC_ERROR_TEXT);
  17020. }
  17021. var memoized = function() {
  17022. var args = arguments,
  17023. key = resolver ? resolver.apply(this, args) : args[0],
  17024. cache = memoized.cache;
  17025. if (cache.has(key)) {
  17026. return cache.get(key);
  17027. }
  17028. var result = func.apply(this, args);
  17029. memoized.cache = cache.set(key, result) || cache;
  17030. return result;
  17031. };
  17032. memoized.cache = new (memoize.Cache || MapCache);
  17033. return memoized;
  17034. }
  17035. // Expose `MapCache`.
  17036. memoize.Cache = MapCache;
  17037. /**
  17038. * Creates a function that negates the result of the predicate `func`. The
  17039. * `func` predicate is invoked with the `this` binding and arguments of the
  17040. * created function.
  17041. *
  17042. * @static
  17043. * @memberOf _
  17044. * @since 3.0.0
  17045. * @category Function
  17046. * @param {Function} predicate The predicate to negate.
  17047. * @returns {Function} Returns the new negated function.
  17048. * @example
  17049. *
  17050. * function isEven(n) {
  17051. * return n % 2 == 0;
  17052. * }
  17053. *
  17054. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  17055. * // => [1, 3, 5]
  17056. */
  17057. function negate(predicate) {
  17058. if (typeof predicate != 'function') {
  17059. throw new TypeError(FUNC_ERROR_TEXT);
  17060. }
  17061. return function() {
  17062. var args = arguments;
  17063. switch (args.length) {
  17064. case 0: return !predicate.call(this);
  17065. case 1: return !predicate.call(this, args[0]);
  17066. case 2: return !predicate.call(this, args[0], args[1]);
  17067. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  17068. }
  17069. return !predicate.apply(this, args);
  17070. };
  17071. }
  17072. /**
  17073. * Creates a function that is restricted to invoking `func` once. Repeat calls
  17074. * to the function return the value of the first invocation. The `func` is
  17075. * invoked with the `this` binding and arguments of the created function.
  17076. *
  17077. * @static
  17078. * @memberOf _
  17079. * @since 0.1.0
  17080. * @category Function
  17081. * @param {Function} func The function to restrict.
  17082. * @returns {Function} Returns the new restricted function.
  17083. * @example
  17084. *
  17085. * var initialize = _.once(createApplication);
  17086. * initialize();
  17087. * initialize();
  17088. * // => `createApplication` is invoked once
  17089. */
  17090. function once(func) {
  17091. return before(2, func);
  17092. }
  17093. /**
  17094. * Creates a function that invokes `func` with its arguments transformed.
  17095. *
  17096. * @static
  17097. * @since 4.0.0
  17098. * @memberOf _
  17099. * @category Function
  17100. * @param {Function} func The function to wrap.
  17101. * @param {...(Function|Function[])} [transforms=[_.identity]]
  17102. * The argument transforms.
  17103. * @returns {Function} Returns the new function.
  17104. * @example
  17105. *
  17106. * function doubled(n) {
  17107. * return n * 2;
  17108. * }
  17109. *
  17110. * function square(n) {
  17111. * return n * n;
  17112. * }
  17113. *
  17114. * var func = _.overArgs(function(x, y) {
  17115. * return [x, y];
  17116. * }, [square, doubled]);
  17117. *
  17118. * func(9, 3);
  17119. * // => [81, 6]
  17120. *
  17121. * func(10, 5);
  17122. * // => [100, 10]
  17123. */
  17124. var overArgs = castRest(function(func, transforms) {
  17125. transforms = (transforms.length == 1 && isArray(transforms[0]))
  17126. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  17127. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  17128. var funcsLength = transforms.length;
  17129. return baseRest(function(args) {
  17130. var index = -1,
  17131. length = nativeMin(args.length, funcsLength);
  17132. while (++index < length) {
  17133. args[index] = transforms[index].call(this, args[index]);
  17134. }
  17135. return apply(func, this, args);
  17136. });
  17137. });
  17138. /**
  17139. * Creates a function that invokes `func` with `partials` prepended to the
  17140. * arguments it receives. This method is like `_.bind` except it does **not**
  17141. * alter the `this` binding.
  17142. *
  17143. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  17144. * builds, may be used as a placeholder for partially applied arguments.
  17145. *
  17146. * **Note:** This method doesn't set the "length" property of partially
  17147. * applied functions.
  17148. *
  17149. * @static
  17150. * @memberOf _
  17151. * @since 0.2.0
  17152. * @category Function
  17153. * @param {Function} func The function to partially apply arguments to.
  17154. * @param {...*} [partials] The arguments to be partially applied.
  17155. * @returns {Function} Returns the new partially applied function.
  17156. * @example
  17157. *
  17158. * function greet(greeting, name) {
  17159. * return greeting + ' ' + name;
  17160. * }
  17161. *
  17162. * var sayHelloTo = _.partial(greet, 'hello');
  17163. * sayHelloTo('fred');
  17164. * // => 'hello fred'
  17165. *
  17166. * // Partially applied with placeholders.
  17167. * var greetFred = _.partial(greet, _, 'fred');
  17168. * greetFred('hi');
  17169. * // => 'hi fred'
  17170. */
  17171. var partial = baseRest(function(func, partials) {
  17172. var holders = replaceHolders(partials, getHolder(partial));
  17173. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  17174. });
  17175. /**
  17176. * This method is like `_.partial` except that partially applied arguments
  17177. * are appended to the arguments it receives.
  17178. *
  17179. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  17180. * builds, may be used as a placeholder for partially applied arguments.
  17181. *
  17182. * **Note:** This method doesn't set the "length" property of partially
  17183. * applied functions.
  17184. *
  17185. * @static
  17186. * @memberOf _
  17187. * @since 1.0.0
  17188. * @category Function
  17189. * @param {Function} func The function to partially apply arguments to.
  17190. * @param {...*} [partials] The arguments to be partially applied.
  17191. * @returns {Function} Returns the new partially applied function.
  17192. * @example
  17193. *
  17194. * function greet(greeting, name) {
  17195. * return greeting + ' ' + name;
  17196. * }
  17197. *
  17198. * var greetFred = _.partialRight(greet, 'fred');
  17199. * greetFred('hi');
  17200. * // => 'hi fred'
  17201. *
  17202. * // Partially applied with placeholders.
  17203. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  17204. * sayHelloTo('fred');
  17205. * // => 'hello fred'
  17206. */
  17207. var partialRight = baseRest(function(func, partials) {
  17208. var holders = replaceHolders(partials, getHolder(partialRight));
  17209. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  17210. });
  17211. /**
  17212. * Creates a function that invokes `func` with arguments arranged according
  17213. * to the specified `indexes` where the argument value at the first index is
  17214. * provided as the first argument, the argument value at the second index is
  17215. * provided as the second argument, and so on.
  17216. *
  17217. * @static
  17218. * @memberOf _
  17219. * @since 3.0.0
  17220. * @category Function
  17221. * @param {Function} func The function to rearrange arguments for.
  17222. * @param {...(number|number[])} indexes The arranged argument indexes.
  17223. * @returns {Function} Returns the new function.
  17224. * @example
  17225. *
  17226. * var rearged = _.rearg(function(a, b, c) {
  17227. * return [a, b, c];
  17228. * }, [2, 0, 1]);
  17229. *
  17230. * rearged('b', 'c', 'a')
  17231. * // => ['a', 'b', 'c']
  17232. */
  17233. var rearg = flatRest(function(func, indexes) {
  17234. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  17235. });
  17236. /**
  17237. * Creates a function that invokes `func` with the `this` binding of the
  17238. * created function and arguments from `start` and beyond provided as
  17239. * an array.
  17240. *
  17241. * **Note:** This method is based on the
  17242. * [rest parameter](https://mdn.io/rest_parameters).
  17243. *
  17244. * @static
  17245. * @memberOf _
  17246. * @since 4.0.0
  17247. * @category Function
  17248. * @param {Function} func The function to apply a rest parameter to.
  17249. * @param {number} [start=func.length-1] The start position of the rest parameter.
  17250. * @returns {Function} Returns the new function.
  17251. * @example
  17252. *
  17253. * var say = _.rest(function(what, names) {
  17254. * return what + ' ' + _.initial(names).join(', ') +
  17255. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  17256. * });
  17257. *
  17258. * say('hello', 'fred', 'barney', 'pebbles');
  17259. * // => 'hello fred, barney, & pebbles'
  17260. */
  17261. function rest(func, start) {
  17262. if (typeof func != 'function') {
  17263. throw new TypeError(FUNC_ERROR_TEXT);
  17264. }
  17265. start = start === undefined ? start : toInteger(start);
  17266. return baseRest(func, start);
  17267. }
  17268. /**
  17269. * Creates a function that invokes `func` with the `this` binding of the
  17270. * create function and an array of arguments much like
  17271. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  17272. *
  17273. * **Note:** This method is based on the
  17274. * [spread operator](https://mdn.io/spread_operator).
  17275. *
  17276. * @static
  17277. * @memberOf _
  17278. * @since 3.2.0
  17279. * @category Function
  17280. * @param {Function} func The function to spread arguments over.
  17281. * @param {number} [start=0] The start position of the spread.
  17282. * @returns {Function} Returns the new function.
  17283. * @example
  17284. *
  17285. * var say = _.spread(function(who, what) {
  17286. * return who + ' says ' + what;
  17287. * });
  17288. *
  17289. * say(['fred', 'hello']);
  17290. * // => 'fred says hello'
  17291. *
  17292. * var numbers = Promise.all([
  17293. * Promise.resolve(40),
  17294. * Promise.resolve(36)
  17295. * ]);
  17296. *
  17297. * numbers.then(_.spread(function(x, y) {
  17298. * return x + y;
  17299. * }));
  17300. * // => a Promise of 76
  17301. */
  17302. function spread(func, start) {
  17303. if (typeof func != 'function') {
  17304. throw new TypeError(FUNC_ERROR_TEXT);
  17305. }
  17306. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  17307. return baseRest(function(args) {
  17308. var array = args[start],
  17309. otherArgs = castSlice(args, 0, start);
  17310. if (array) {
  17311. arrayPush(otherArgs, array);
  17312. }
  17313. return apply(func, this, otherArgs);
  17314. });
  17315. }
  17316. /**
  17317. * Creates a throttled function that only invokes `func` at most once per
  17318. * every `wait` milliseconds. The throttled function comes with a `cancel`
  17319. * method to cancel delayed `func` invocations and a `flush` method to
  17320. * immediately invoke them. Provide `options` to indicate whether `func`
  17321. * should be invoked on the leading and/or trailing edge of the `wait`
  17322. * timeout. The `func` is invoked with the last arguments provided to the
  17323. * throttled function. Subsequent calls to the throttled function return the
  17324. * result of the last `func` invocation.
  17325. *
  17326. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  17327. * invoked on the trailing edge of the timeout only if the throttled function
  17328. * is invoked more than once during the `wait` timeout.
  17329. *
  17330. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  17331. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  17332. *
  17333. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  17334. * for details over the differences between `_.throttle` and `_.debounce`.
  17335. *
  17336. * @static
  17337. * @memberOf _
  17338. * @since 0.1.0
  17339. * @category Function
  17340. * @param {Function} func The function to throttle.
  17341. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  17342. * @param {Object} [options={}] The options object.
  17343. * @param {boolean} [options.leading=true]
  17344. * Specify invoking on the leading edge of the timeout.
  17345. * @param {boolean} [options.trailing=true]
  17346. * Specify invoking on the trailing edge of the timeout.
  17347. * @returns {Function} Returns the new throttled function.
  17348. * @example
  17349. *
  17350. * // Avoid excessively updating the position while scrolling.
  17351. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  17352. *
  17353. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  17354. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  17355. * jQuery(element).on('click', throttled);
  17356. *
  17357. * // Cancel the trailing throttled invocation.
  17358. * jQuery(window).on('popstate', throttled.cancel);
  17359. */
  17360. function throttle(func, wait, options) {
  17361. var leading = true,
  17362. trailing = true;
  17363. if (typeof func != 'function') {
  17364. throw new TypeError(FUNC_ERROR_TEXT);
  17365. }
  17366. if (isObject(options)) {
  17367. leading = 'leading' in options ? !!options.leading : leading;
  17368. trailing = 'trailing' in options ? !!options.trailing : trailing;
  17369. }
  17370. return debounce(func, wait, {
  17371. 'leading': leading,
  17372. 'maxWait': wait,
  17373. 'trailing': trailing
  17374. });
  17375. }
  17376. /**
  17377. * Creates a function that accepts up to one argument, ignoring any
  17378. * additional arguments.
  17379. *
  17380. * @static
  17381. * @memberOf _
  17382. * @since 4.0.0
  17383. * @category Function
  17384. * @param {Function} func The function to cap arguments for.
  17385. * @returns {Function} Returns the new capped function.
  17386. * @example
  17387. *
  17388. * _.map(['6', '8', '10'], _.unary(parseInt));
  17389. * // => [6, 8, 10]
  17390. */
  17391. function unary(func) {
  17392. return ary(func, 1);
  17393. }
  17394. /**
  17395. * Creates a function that provides `value` to `wrapper` as its first
  17396. * argument. Any additional arguments provided to the function are appended
  17397. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  17398. * binding of the created function.
  17399. *
  17400. * @static
  17401. * @memberOf _
  17402. * @since 0.1.0
  17403. * @category Function
  17404. * @param {*} value The value to wrap.
  17405. * @param {Function} [wrapper=identity] The wrapper function.
  17406. * @returns {Function} Returns the new function.
  17407. * @example
  17408. *
  17409. * var p = _.wrap(_.escape, function(func, text) {
  17410. * return '<p>' + func(text) + '</p>';
  17411. * });
  17412. *
  17413. * p('fred, barney, & pebbles');
  17414. * // => '<p>fred, barney, &amp; pebbles</p>'
  17415. */
  17416. function wrap(value, wrapper) {
  17417. return partial(castFunction(wrapper), value);
  17418. }
  17419. /*------------------------------------------------------------------------*/
  17420. /**
  17421. * Casts `value` as an array if it's not one.
  17422. *
  17423. * @static
  17424. * @memberOf _
  17425. * @since 4.4.0
  17426. * @category Lang
  17427. * @param {*} value The value to inspect.
  17428. * @returns {Array} Returns the cast array.
  17429. * @example
  17430. *
  17431. * _.castArray(1);
  17432. * // => [1]
  17433. *
  17434. * _.castArray({ 'a': 1 });
  17435. * // => [{ 'a': 1 }]
  17436. *
  17437. * _.castArray('abc');
  17438. * // => ['abc']
  17439. *
  17440. * _.castArray(null);
  17441. * // => [null]
  17442. *
  17443. * _.castArray(undefined);
  17444. * // => [undefined]
  17445. *
  17446. * _.castArray();
  17447. * // => []
  17448. *
  17449. * var array = [1, 2, 3];
  17450. * console.log(_.castArray(array) === array);
  17451. * // => true
  17452. */
  17453. function castArray() {
  17454. if (!arguments.length) {
  17455. return [];
  17456. }
  17457. var value = arguments[0];
  17458. return isArray(value) ? value : [value];
  17459. }
  17460. /**
  17461. * Creates a shallow clone of `value`.
  17462. *
  17463. * **Note:** This method is loosely based on the
  17464. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  17465. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  17466. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  17467. * arrays. The own enumerable properties of `arguments` objects are cloned
  17468. * as plain objects. An empty object is returned for uncloneable values such
  17469. * as error objects, functions, DOM nodes, and WeakMaps.
  17470. *
  17471. * @static
  17472. * @memberOf _
  17473. * @since 0.1.0
  17474. * @category Lang
  17475. * @param {*} value The value to clone.
  17476. * @returns {*} Returns the cloned value.
  17477. * @see _.cloneDeep
  17478. * @example
  17479. *
  17480. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  17481. *
  17482. * var shallow = _.clone(objects);
  17483. * console.log(shallow[0] === objects[0]);
  17484. * // => true
  17485. */
  17486. function clone(value) {
  17487. return baseClone(value, CLONE_SYMBOLS_FLAG);
  17488. }
  17489. /**
  17490. * This method is like `_.clone` except that it accepts `customizer` which
  17491. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  17492. * cloning is handled by the method instead. The `customizer` is invoked with
  17493. * up to four arguments; (value [, index|key, object, stack]).
  17494. *
  17495. * @static
  17496. * @memberOf _
  17497. * @since 4.0.0
  17498. * @category Lang
  17499. * @param {*} value The value to clone.
  17500. * @param {Function} [customizer] The function to customize cloning.
  17501. * @returns {*} Returns the cloned value.
  17502. * @see _.cloneDeepWith
  17503. * @example
  17504. *
  17505. * function customizer(value) {
  17506. * if (_.isElement(value)) {
  17507. * return value.cloneNode(false);
  17508. * }
  17509. * }
  17510. *
  17511. * var el = _.cloneWith(document.body, customizer);
  17512. *
  17513. * console.log(el === document.body);
  17514. * // => false
  17515. * console.log(el.nodeName);
  17516. * // => 'BODY'
  17517. * console.log(el.childNodes.length);
  17518. * // => 0
  17519. */
  17520. function cloneWith(value, customizer) {
  17521. customizer = typeof customizer == 'function' ? customizer : undefined;
  17522. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  17523. }
  17524. /**
  17525. * This method is like `_.clone` except that it recursively clones `value`.
  17526. *
  17527. * @static
  17528. * @memberOf _
  17529. * @since 1.0.0
  17530. * @category Lang
  17531. * @param {*} value The value to recursively clone.
  17532. * @returns {*} Returns the deep cloned value.
  17533. * @see _.clone
  17534. * @example
  17535. *
  17536. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  17537. *
  17538. * var deep = _.cloneDeep(objects);
  17539. * console.log(deep[0] === objects[0]);
  17540. * // => false
  17541. */
  17542. function cloneDeep(value) {
  17543. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  17544. }
  17545. /**
  17546. * This method is like `_.cloneWith` except that it recursively clones `value`.
  17547. *
  17548. * @static
  17549. * @memberOf _
  17550. * @since 4.0.0
  17551. * @category Lang
  17552. * @param {*} value The value to recursively clone.
  17553. * @param {Function} [customizer] The function to customize cloning.
  17554. * @returns {*} Returns the deep cloned value.
  17555. * @see _.cloneWith
  17556. * @example
  17557. *
  17558. * function customizer(value) {
  17559. * if (_.isElement(value)) {
  17560. * return value.cloneNode(true);
  17561. * }
  17562. * }
  17563. *
  17564. * var el = _.cloneDeepWith(document.body, customizer);
  17565. *
  17566. * console.log(el === document.body);
  17567. * // => false
  17568. * console.log(el.nodeName);
  17569. * // => 'BODY'
  17570. * console.log(el.childNodes.length);
  17571. * // => 20
  17572. */
  17573. function cloneDeepWith(value, customizer) {
  17574. customizer = typeof customizer == 'function' ? customizer : undefined;
  17575. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  17576. }
  17577. /**
  17578. * Checks if `object` conforms to `source` by invoking the predicate
  17579. * properties of `source` with the corresponding property values of `object`.
  17580. *
  17581. * **Note:** This method is equivalent to `_.conforms` when `source` is
  17582. * partially applied.
  17583. *
  17584. * @static
  17585. * @memberOf _
  17586. * @since 4.14.0
  17587. * @category Lang
  17588. * @param {Object} object The object to inspect.
  17589. * @param {Object} source The object of property predicates to conform to.
  17590. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  17591. * @example
  17592. *
  17593. * var object = { 'a': 1, 'b': 2 };
  17594. *
  17595. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  17596. * // => true
  17597. *
  17598. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  17599. * // => false
  17600. */
  17601. function conformsTo(object, source) {
  17602. return source == null || baseConformsTo(object, source, keys(source));
  17603. }
  17604. /**
  17605. * Performs a
  17606. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  17607. * comparison between two values to determine if they are equivalent.
  17608. *
  17609. * @static
  17610. * @memberOf _
  17611. * @since 4.0.0
  17612. * @category Lang
  17613. * @param {*} value The value to compare.
  17614. * @param {*} other The other value to compare.
  17615. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  17616. * @example
  17617. *
  17618. * var object = { 'a': 1 };
  17619. * var other = { 'a': 1 };
  17620. *
  17621. * _.eq(object, object);
  17622. * // => true
  17623. *
  17624. * _.eq(object, other);
  17625. * // => false
  17626. *
  17627. * _.eq('a', 'a');
  17628. * // => true
  17629. *
  17630. * _.eq('a', Object('a'));
  17631. * // => false
  17632. *
  17633. * _.eq(NaN, NaN);
  17634. * // => true
  17635. */
  17636. function eq(value, other) {
  17637. return value === other || (value !== value && other !== other);
  17638. }
  17639. /**
  17640. * Checks if `value` is greater than `other`.
  17641. *
  17642. * @static
  17643. * @memberOf _
  17644. * @since 3.9.0
  17645. * @category Lang
  17646. * @param {*} value The value to compare.
  17647. * @param {*} other The other value to compare.
  17648. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  17649. * else `false`.
  17650. * @see _.lt
  17651. * @example
  17652. *
  17653. * _.gt(3, 1);
  17654. * // => true
  17655. *
  17656. * _.gt(3, 3);
  17657. * // => false
  17658. *
  17659. * _.gt(1, 3);
  17660. * // => false
  17661. */
  17662. var gt = createRelationalOperation(baseGt);
  17663. /**
  17664. * Checks if `value` is greater than or equal to `other`.
  17665. *
  17666. * @static
  17667. * @memberOf _
  17668. * @since 3.9.0
  17669. * @category Lang
  17670. * @param {*} value The value to compare.
  17671. * @param {*} other The other value to compare.
  17672. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  17673. * `other`, else `false`.
  17674. * @see _.lte
  17675. * @example
  17676. *
  17677. * _.gte(3, 1);
  17678. * // => true
  17679. *
  17680. * _.gte(3, 3);
  17681. * // => true
  17682. *
  17683. * _.gte(1, 3);
  17684. * // => false
  17685. */
  17686. var gte = createRelationalOperation(function(value, other) {
  17687. return value >= other;
  17688. });
  17689. /**
  17690. * Checks if `value` is likely an `arguments` object.
  17691. *
  17692. * @static
  17693. * @memberOf _
  17694. * @since 0.1.0
  17695. * @category Lang
  17696. * @param {*} value The value to check.
  17697. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  17698. * else `false`.
  17699. * @example
  17700. *
  17701. * _.isArguments(function() { return arguments; }());
  17702. * // => true
  17703. *
  17704. * _.isArguments([1, 2, 3]);
  17705. * // => false
  17706. */
  17707. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  17708. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  17709. !propertyIsEnumerable.call(value, 'callee');
  17710. };
  17711. /**
  17712. * Checks if `value` is classified as an `Array` object.
  17713. *
  17714. * @static
  17715. * @memberOf _
  17716. * @since 0.1.0
  17717. * @category Lang
  17718. * @param {*} value The value to check.
  17719. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  17720. * @example
  17721. *
  17722. * _.isArray([1, 2, 3]);
  17723. * // => true
  17724. *
  17725. * _.isArray(document.body.children);
  17726. * // => false
  17727. *
  17728. * _.isArray('abc');
  17729. * // => false
  17730. *
  17731. * _.isArray(_.noop);
  17732. * // => false
  17733. */
  17734. var isArray = Array.isArray;
  17735. /**
  17736. * Checks if `value` is classified as an `ArrayBuffer` object.
  17737. *
  17738. * @static
  17739. * @memberOf _
  17740. * @since 4.3.0
  17741. * @category Lang
  17742. * @param {*} value The value to check.
  17743. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  17744. * @example
  17745. *
  17746. * _.isArrayBuffer(new ArrayBuffer(2));
  17747. * // => true
  17748. *
  17749. * _.isArrayBuffer(new Array(2));
  17750. * // => false
  17751. */
  17752. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  17753. /**
  17754. * Checks if `value` is array-like. A value is considered array-like if it's
  17755. * not a function and has a `value.length` that's an integer greater than or
  17756. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  17757. *
  17758. * @static
  17759. * @memberOf _
  17760. * @since 4.0.0
  17761. * @category Lang
  17762. * @param {*} value The value to check.
  17763. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  17764. * @example
  17765. *
  17766. * _.isArrayLike([1, 2, 3]);
  17767. * // => true
  17768. *
  17769. * _.isArrayLike(document.body.children);
  17770. * // => true
  17771. *
  17772. * _.isArrayLike('abc');
  17773. * // => true
  17774. *
  17775. * _.isArrayLike(_.noop);
  17776. * // => false
  17777. */
  17778. function isArrayLike(value) {
  17779. return value != null && isLength(value.length) && !isFunction(value);
  17780. }
  17781. /**
  17782. * This method is like `_.isArrayLike` except that it also checks if `value`
  17783. * is an object.
  17784. *
  17785. * @static
  17786. * @memberOf _
  17787. * @since 4.0.0
  17788. * @category Lang
  17789. * @param {*} value The value to check.
  17790. * @returns {boolean} Returns `true` if `value` is an array-like object,
  17791. * else `false`.
  17792. * @example
  17793. *
  17794. * _.isArrayLikeObject([1, 2, 3]);
  17795. * // => true
  17796. *
  17797. * _.isArrayLikeObject(document.body.children);
  17798. * // => true
  17799. *
  17800. * _.isArrayLikeObject('abc');
  17801. * // => false
  17802. *
  17803. * _.isArrayLikeObject(_.noop);
  17804. * // => false
  17805. */
  17806. function isArrayLikeObject(value) {
  17807. return isObjectLike(value) && isArrayLike(value);
  17808. }
  17809. /**
  17810. * Checks if `value` is classified as a boolean primitive or object.
  17811. *
  17812. * @static
  17813. * @memberOf _
  17814. * @since 0.1.0
  17815. * @category Lang
  17816. * @param {*} value The value to check.
  17817. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  17818. * @example
  17819. *
  17820. * _.isBoolean(false);
  17821. * // => true
  17822. *
  17823. * _.isBoolean(null);
  17824. * // => false
  17825. */
  17826. function isBoolean(value) {
  17827. return value === true || value === false ||
  17828. (isObjectLike(value) && baseGetTag(value) == boolTag);
  17829. }
  17830. /**
  17831. * Checks if `value` is a buffer.
  17832. *
  17833. * @static
  17834. * @memberOf _
  17835. * @since 4.3.0
  17836. * @category Lang
  17837. * @param {*} value The value to check.
  17838. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  17839. * @example
  17840. *
  17841. * _.isBuffer(new Buffer(2));
  17842. * // => true
  17843. *
  17844. * _.isBuffer(new Uint8Array(2));
  17845. * // => false
  17846. */
  17847. var isBuffer = nativeIsBuffer || stubFalse;
  17848. /**
  17849. * Checks if `value` is classified as a `Date` object.
  17850. *
  17851. * @static
  17852. * @memberOf _
  17853. * @since 0.1.0
  17854. * @category Lang
  17855. * @param {*} value The value to check.
  17856. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  17857. * @example
  17858. *
  17859. * _.isDate(new Date);
  17860. * // => true
  17861. *
  17862. * _.isDate('Mon April 23 2012');
  17863. * // => false
  17864. */
  17865. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  17866. /**
  17867. * Checks if `value` is likely a DOM element.
  17868. *
  17869. * @static
  17870. * @memberOf _
  17871. * @since 0.1.0
  17872. * @category Lang
  17873. * @param {*} value The value to check.
  17874. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  17875. * @example
  17876. *
  17877. * _.isElement(document.body);
  17878. * // => true
  17879. *
  17880. * _.isElement('<body>');
  17881. * // => false
  17882. */
  17883. function isElement(value) {
  17884. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  17885. }
  17886. /**
  17887. * Checks if `value` is an empty object, collection, map, or set.
  17888. *
  17889. * Objects are considered empty if they have no own enumerable string keyed
  17890. * properties.
  17891. *
  17892. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  17893. * jQuery-like collections are considered empty if they have a `length` of `0`.
  17894. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  17895. *
  17896. * @static
  17897. * @memberOf _
  17898. * @since 0.1.0
  17899. * @category Lang
  17900. * @param {*} value The value to check.
  17901. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  17902. * @example
  17903. *
  17904. * _.isEmpty(null);
  17905. * // => true
  17906. *
  17907. * _.isEmpty(true);
  17908. * // => true
  17909. *
  17910. * _.isEmpty(1);
  17911. * // => true
  17912. *
  17913. * _.isEmpty([1, 2, 3]);
  17914. * // => false
  17915. *
  17916. * _.isEmpty({ 'a': 1 });
  17917. * // => false
  17918. */
  17919. function isEmpty(value) {
  17920. if (value == null) {
  17921. return true;
  17922. }
  17923. if (isArrayLike(value) &&
  17924. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  17925. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  17926. return !value.length;
  17927. }
  17928. var tag = getTag(value);
  17929. if (tag == mapTag || tag == setTag) {
  17930. return !value.size;
  17931. }
  17932. if (isPrototype(value)) {
  17933. return !baseKeys(value).length;
  17934. }
  17935. for (var key in value) {
  17936. if (hasOwnProperty.call(value, key)) {
  17937. return false;
  17938. }
  17939. }
  17940. return true;
  17941. }
  17942. /**
  17943. * Performs a deep comparison between two values to determine if they are
  17944. * equivalent.
  17945. *
  17946. * **Note:** This method supports comparing arrays, array buffers, booleans,
  17947. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  17948. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  17949. * by their own, not inherited, enumerable properties. Functions and DOM
  17950. * nodes are compared by strict equality, i.e. `===`.
  17951. *
  17952. * @static
  17953. * @memberOf _
  17954. * @since 0.1.0
  17955. * @category Lang
  17956. * @param {*} value The value to compare.
  17957. * @param {*} other The other value to compare.
  17958. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  17959. * @example
  17960. *
  17961. * var object = { 'a': 1 };
  17962. * var other = { 'a': 1 };
  17963. *
  17964. * _.isEqual(object, other);
  17965. * // => true
  17966. *
  17967. * object === other;
  17968. * // => false
  17969. */
  17970. function isEqual(value, other) {
  17971. return baseIsEqual(value, other);
  17972. }
  17973. /**
  17974. * This method is like `_.isEqual` except that it accepts `customizer` which
  17975. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  17976. * are handled by the method instead. The `customizer` is invoked with up to
  17977. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  17978. *
  17979. * @static
  17980. * @memberOf _
  17981. * @since 4.0.0
  17982. * @category Lang
  17983. * @param {*} value The value to compare.
  17984. * @param {*} other The other value to compare.
  17985. * @param {Function} [customizer] The function to customize comparisons.
  17986. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  17987. * @example
  17988. *
  17989. * function isGreeting(value) {
  17990. * return /^h(?:i|ello)$/.test(value);
  17991. * }
  17992. *
  17993. * function customizer(objValue, othValue) {
  17994. * if (isGreeting(objValue) && isGreeting(othValue)) {
  17995. * return true;
  17996. * }
  17997. * }
  17998. *
  17999. * var array = ['hello', 'goodbye'];
  18000. * var other = ['hi', 'goodbye'];
  18001. *
  18002. * _.isEqualWith(array, other, customizer);
  18003. * // => true
  18004. */
  18005. function isEqualWith(value, other, customizer) {
  18006. customizer = typeof customizer == 'function' ? customizer : undefined;
  18007. var result = customizer ? customizer(value, other) : undefined;
  18008. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  18009. }
  18010. /**
  18011. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  18012. * `SyntaxError`, `TypeError`, or `URIError` object.
  18013. *
  18014. * @static
  18015. * @memberOf _
  18016. * @since 3.0.0
  18017. * @category Lang
  18018. * @param {*} value The value to check.
  18019. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  18020. * @example
  18021. *
  18022. * _.isError(new Error);
  18023. * // => true
  18024. *
  18025. * _.isError(Error);
  18026. * // => false
  18027. */
  18028. function isError(value) {
  18029. if (!isObjectLike(value)) {
  18030. return false;
  18031. }
  18032. var tag = baseGetTag(value);
  18033. return tag == errorTag || tag == domExcTag ||
  18034. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  18035. }
  18036. /**
  18037. * Checks if `value` is a finite primitive number.
  18038. *
  18039. * **Note:** This method is based on
  18040. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  18041. *
  18042. * @static
  18043. * @memberOf _
  18044. * @since 0.1.0
  18045. * @category Lang
  18046. * @param {*} value The value to check.
  18047. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  18048. * @example
  18049. *
  18050. * _.isFinite(3);
  18051. * // => true
  18052. *
  18053. * _.isFinite(Number.MIN_VALUE);
  18054. * // => true
  18055. *
  18056. * _.isFinite(Infinity);
  18057. * // => false
  18058. *
  18059. * _.isFinite('3');
  18060. * // => false
  18061. */
  18062. function isFinite(value) {
  18063. return typeof value == 'number' && nativeIsFinite(value);
  18064. }
  18065. /**
  18066. * Checks if `value` is classified as a `Function` object.
  18067. *
  18068. * @static
  18069. * @memberOf _
  18070. * @since 0.1.0
  18071. * @category Lang
  18072. * @param {*} value The value to check.
  18073. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  18074. * @example
  18075. *
  18076. * _.isFunction(_);
  18077. * // => true
  18078. *
  18079. * _.isFunction(/abc/);
  18080. * // => false
  18081. */
  18082. function isFunction(value) {
  18083. if (!isObject(value)) {
  18084. return false;
  18085. }
  18086. // The use of `Object#toString` avoids issues with the `typeof` operator
  18087. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  18088. var tag = baseGetTag(value);
  18089. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  18090. }
  18091. /**
  18092. * Checks if `value` is an integer.
  18093. *
  18094. * **Note:** This method is based on
  18095. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  18096. *
  18097. * @static
  18098. * @memberOf _
  18099. * @since 4.0.0
  18100. * @category Lang
  18101. * @param {*} value The value to check.
  18102. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  18103. * @example
  18104. *
  18105. * _.isInteger(3);
  18106. * // => true
  18107. *
  18108. * _.isInteger(Number.MIN_VALUE);
  18109. * // => false
  18110. *
  18111. * _.isInteger(Infinity);
  18112. * // => false
  18113. *
  18114. * _.isInteger('3');
  18115. * // => false
  18116. */
  18117. function isInteger(value) {
  18118. return typeof value == 'number' && value == toInteger(value);
  18119. }
  18120. /**
  18121. * Checks if `value` is a valid array-like length.
  18122. *
  18123. * **Note:** This method is loosely based on
  18124. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  18125. *
  18126. * @static
  18127. * @memberOf _
  18128. * @since 4.0.0
  18129. * @category Lang
  18130. * @param {*} value The value to check.
  18131. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  18132. * @example
  18133. *
  18134. * _.isLength(3);
  18135. * // => true
  18136. *
  18137. * _.isLength(Number.MIN_VALUE);
  18138. * // => false
  18139. *
  18140. * _.isLength(Infinity);
  18141. * // => false
  18142. *
  18143. * _.isLength('3');
  18144. * // => false
  18145. */
  18146. function isLength(value) {
  18147. return typeof value == 'number' &&
  18148. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  18149. }
  18150. /**
  18151. * Checks if `value` is the
  18152. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  18153. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  18154. *
  18155. * @static
  18156. * @memberOf _
  18157. * @since 0.1.0
  18158. * @category Lang
  18159. * @param {*} value The value to check.
  18160. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  18161. * @example
  18162. *
  18163. * _.isObject({});
  18164. * // => true
  18165. *
  18166. * _.isObject([1, 2, 3]);
  18167. * // => true
  18168. *
  18169. * _.isObject(_.noop);
  18170. * // => true
  18171. *
  18172. * _.isObject(null);
  18173. * // => false
  18174. */
  18175. function isObject(value) {
  18176. var type = typeof value;
  18177. return value != null && (type == 'object' || type == 'function');
  18178. }
  18179. /**
  18180. * Checks if `value` is object-like. A value is object-like if it's not `null`
  18181. * and has a `typeof` result of "object".
  18182. *
  18183. * @static
  18184. * @memberOf _
  18185. * @since 4.0.0
  18186. * @category Lang
  18187. * @param {*} value The value to check.
  18188. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  18189. * @example
  18190. *
  18191. * _.isObjectLike({});
  18192. * // => true
  18193. *
  18194. * _.isObjectLike([1, 2, 3]);
  18195. * // => true
  18196. *
  18197. * _.isObjectLike(_.noop);
  18198. * // => false
  18199. *
  18200. * _.isObjectLike(null);
  18201. * // => false
  18202. */
  18203. function isObjectLike(value) {
  18204. return value != null && typeof value == 'object';
  18205. }
  18206. /**
  18207. * Checks if `value` is classified as a `Map` object.
  18208. *
  18209. * @static
  18210. * @memberOf _
  18211. * @since 4.3.0
  18212. * @category Lang
  18213. * @param {*} value The value to check.
  18214. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  18215. * @example
  18216. *
  18217. * _.isMap(new Map);
  18218. * // => true
  18219. *
  18220. * _.isMap(new WeakMap);
  18221. * // => false
  18222. */
  18223. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  18224. /**
  18225. * Performs a partial deep comparison between `object` and `source` to
  18226. * determine if `object` contains equivalent property values.
  18227. *
  18228. * **Note:** This method is equivalent to `_.matches` when `source` is
  18229. * partially applied.
  18230. *
  18231. * Partial comparisons will match empty array and empty object `source`
  18232. * values against any array or object value, respectively. See `_.isEqual`
  18233. * for a list of supported value comparisons.
  18234. *
  18235. * @static
  18236. * @memberOf _
  18237. * @since 3.0.0
  18238. * @category Lang
  18239. * @param {Object} object The object to inspect.
  18240. * @param {Object} source The object of property values to match.
  18241. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  18242. * @example
  18243. *
  18244. * var object = { 'a': 1, 'b': 2 };
  18245. *
  18246. * _.isMatch(object, { 'b': 2 });
  18247. * // => true
  18248. *
  18249. * _.isMatch(object, { 'b': 1 });
  18250. * // => false
  18251. */
  18252. function isMatch(object, source) {
  18253. return object === source || baseIsMatch(object, source, getMatchData(source));
  18254. }
  18255. /**
  18256. * This method is like `_.isMatch` except that it accepts `customizer` which
  18257. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  18258. * are handled by the method instead. The `customizer` is invoked with five
  18259. * arguments: (objValue, srcValue, index|key, object, source).
  18260. *
  18261. * @static
  18262. * @memberOf _
  18263. * @since 4.0.0
  18264. * @category Lang
  18265. * @param {Object} object The object to inspect.
  18266. * @param {Object} source The object of property values to match.
  18267. * @param {Function} [customizer] The function to customize comparisons.
  18268. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  18269. * @example
  18270. *
  18271. * function isGreeting(value) {
  18272. * return /^h(?:i|ello)$/.test(value);
  18273. * }
  18274. *
  18275. * function customizer(objValue, srcValue) {
  18276. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  18277. * return true;
  18278. * }
  18279. * }
  18280. *
  18281. * var object = { 'greeting': 'hello' };
  18282. * var source = { 'greeting': 'hi' };
  18283. *
  18284. * _.isMatchWith(object, source, customizer);
  18285. * // => true
  18286. */
  18287. function isMatchWith(object, source, customizer) {
  18288. customizer = typeof customizer == 'function' ? customizer : undefined;
  18289. return baseIsMatch(object, source, getMatchData(source), customizer);
  18290. }
  18291. /**
  18292. * Checks if `value` is `NaN`.
  18293. *
  18294. * **Note:** This method is based on
  18295. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  18296. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  18297. * `undefined` and other non-number values.
  18298. *
  18299. * @static
  18300. * @memberOf _
  18301. * @since 0.1.0
  18302. * @category Lang
  18303. * @param {*} value The value to check.
  18304. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  18305. * @example
  18306. *
  18307. * _.isNaN(NaN);
  18308. * // => true
  18309. *
  18310. * _.isNaN(new Number(NaN));
  18311. * // => true
  18312. *
  18313. * isNaN(undefined);
  18314. * // => true
  18315. *
  18316. * _.isNaN(undefined);
  18317. * // => false
  18318. */
  18319. function isNaN(value) {
  18320. // An `NaN` primitive is the only value that is not equal to itself.
  18321. // Perform the `toStringTag` check first to avoid errors with some
  18322. // ActiveX objects in IE.
  18323. return isNumber(value) && value != +value;
  18324. }
  18325. /**
  18326. * Checks if `value` is a pristine native function.
  18327. *
  18328. * **Note:** This method can't reliably detect native functions in the presence
  18329. * of the core-js package because core-js circumvents this kind of detection.
  18330. * Despite multiple requests, the core-js maintainer has made it clear: any
  18331. * attempt to fix the detection will be obstructed. As a result, we're left
  18332. * with little choice but to throw an error. Unfortunately, this also affects
  18333. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  18334. * which rely on core-js.
  18335. *
  18336. * @static
  18337. * @memberOf _
  18338. * @since 3.0.0
  18339. * @category Lang
  18340. * @param {*} value The value to check.
  18341. * @returns {boolean} Returns `true` if `value` is a native function,
  18342. * else `false`.
  18343. * @example
  18344. *
  18345. * _.isNative(Array.prototype.push);
  18346. * // => true
  18347. *
  18348. * _.isNative(_);
  18349. * // => false
  18350. */
  18351. function isNative(value) {
  18352. if (isMaskable(value)) {
  18353. throw new Error(CORE_ERROR_TEXT);
  18354. }
  18355. return baseIsNative(value);
  18356. }
  18357. /**
  18358. * Checks if `value` is `null`.
  18359. *
  18360. * @static
  18361. * @memberOf _
  18362. * @since 0.1.0
  18363. * @category Lang
  18364. * @param {*} value The value to check.
  18365. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  18366. * @example
  18367. *
  18368. * _.isNull(null);
  18369. * // => true
  18370. *
  18371. * _.isNull(void 0);
  18372. * // => false
  18373. */
  18374. function isNull(value) {
  18375. return value === null;
  18376. }
  18377. /**
  18378. * Checks if `value` is `null` or `undefined`.
  18379. *
  18380. * @static
  18381. * @memberOf _
  18382. * @since 4.0.0
  18383. * @category Lang
  18384. * @param {*} value The value to check.
  18385. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  18386. * @example
  18387. *
  18388. * _.isNil(null);
  18389. * // => true
  18390. *
  18391. * _.isNil(void 0);
  18392. * // => true
  18393. *
  18394. * _.isNil(NaN);
  18395. * // => false
  18396. */
  18397. function isNil(value) {
  18398. return value == null;
  18399. }
  18400. /**
  18401. * Checks if `value` is classified as a `Number` primitive or object.
  18402. *
  18403. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  18404. * classified as numbers, use the `_.isFinite` method.
  18405. *
  18406. * @static
  18407. * @memberOf _
  18408. * @since 0.1.0
  18409. * @category Lang
  18410. * @param {*} value The value to check.
  18411. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  18412. * @example
  18413. *
  18414. * _.isNumber(3);
  18415. * // => true
  18416. *
  18417. * _.isNumber(Number.MIN_VALUE);
  18418. * // => true
  18419. *
  18420. * _.isNumber(Infinity);
  18421. * // => true
  18422. *
  18423. * _.isNumber('3');
  18424. * // => false
  18425. */
  18426. function isNumber(value) {
  18427. return typeof value == 'number' ||
  18428. (isObjectLike(value) && baseGetTag(value) == numberTag);
  18429. }
  18430. /**
  18431. * Checks if `value` is a plain object, that is, an object created by the
  18432. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  18433. *
  18434. * @static
  18435. * @memberOf _
  18436. * @since 0.8.0
  18437. * @category Lang
  18438. * @param {*} value The value to check.
  18439. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  18440. * @example
  18441. *
  18442. * function Foo() {
  18443. * this.a = 1;
  18444. * }
  18445. *
  18446. * _.isPlainObject(new Foo);
  18447. * // => false
  18448. *
  18449. * _.isPlainObject([1, 2, 3]);
  18450. * // => false
  18451. *
  18452. * _.isPlainObject({ 'x': 0, 'y': 0 });
  18453. * // => true
  18454. *
  18455. * _.isPlainObject(Object.create(null));
  18456. * // => true
  18457. */
  18458. function isPlainObject(value) {
  18459. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  18460. return false;
  18461. }
  18462. var proto = getPrototype(value);
  18463. if (proto === null) {
  18464. return true;
  18465. }
  18466. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  18467. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  18468. funcToString.call(Ctor) == objectCtorString;
  18469. }
  18470. /**
  18471. * Checks if `value` is classified as a `RegExp` object.
  18472. *
  18473. * @static
  18474. * @memberOf _
  18475. * @since 0.1.0
  18476. * @category Lang
  18477. * @param {*} value The value to check.
  18478. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  18479. * @example
  18480. *
  18481. * _.isRegExp(/abc/);
  18482. * // => true
  18483. *
  18484. * _.isRegExp('/abc/');
  18485. * // => false
  18486. */
  18487. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  18488. /**
  18489. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  18490. * double precision number which isn't the result of a rounded unsafe integer.
  18491. *
  18492. * **Note:** This method is based on
  18493. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  18494. *
  18495. * @static
  18496. * @memberOf _
  18497. * @since 4.0.0
  18498. * @category Lang
  18499. * @param {*} value The value to check.
  18500. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  18501. * @example
  18502. *
  18503. * _.isSafeInteger(3);
  18504. * // => true
  18505. *
  18506. * _.isSafeInteger(Number.MIN_VALUE);
  18507. * // => false
  18508. *
  18509. * _.isSafeInteger(Infinity);
  18510. * // => false
  18511. *
  18512. * _.isSafeInteger('3');
  18513. * // => false
  18514. */
  18515. function isSafeInteger(value) {
  18516. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  18517. }
  18518. /**
  18519. * Checks if `value` is classified as a `Set` object.
  18520. *
  18521. * @static
  18522. * @memberOf _
  18523. * @since 4.3.0
  18524. * @category Lang
  18525. * @param {*} value The value to check.
  18526. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  18527. * @example
  18528. *
  18529. * _.isSet(new Set);
  18530. * // => true
  18531. *
  18532. * _.isSet(new WeakSet);
  18533. * // => false
  18534. */
  18535. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  18536. /**
  18537. * Checks if `value` is classified as a `String` primitive or object.
  18538. *
  18539. * @static
  18540. * @since 0.1.0
  18541. * @memberOf _
  18542. * @category Lang
  18543. * @param {*} value The value to check.
  18544. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  18545. * @example
  18546. *
  18547. * _.isString('abc');
  18548. * // => true
  18549. *
  18550. * _.isString(1);
  18551. * // => false
  18552. */
  18553. function isString(value) {
  18554. return typeof value == 'string' ||
  18555. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  18556. }
  18557. /**
  18558. * Checks if `value` is classified as a `Symbol` primitive or object.
  18559. *
  18560. * @static
  18561. * @memberOf _
  18562. * @since 4.0.0
  18563. * @category Lang
  18564. * @param {*} value The value to check.
  18565. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  18566. * @example
  18567. *
  18568. * _.isSymbol(Symbol.iterator);
  18569. * // => true
  18570. *
  18571. * _.isSymbol('abc');
  18572. * // => false
  18573. */
  18574. function isSymbol(value) {
  18575. return typeof value == 'symbol' ||
  18576. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  18577. }
  18578. /**
  18579. * Checks if `value` is classified as a typed array.
  18580. *
  18581. * @static
  18582. * @memberOf _
  18583. * @since 3.0.0
  18584. * @category Lang
  18585. * @param {*} value The value to check.
  18586. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  18587. * @example
  18588. *
  18589. * _.isTypedArray(new Uint8Array);
  18590. * // => true
  18591. *
  18592. * _.isTypedArray([]);
  18593. * // => false
  18594. */
  18595. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  18596. /**
  18597. * Checks if `value` is `undefined`.
  18598. *
  18599. * @static
  18600. * @since 0.1.0
  18601. * @memberOf _
  18602. * @category Lang
  18603. * @param {*} value The value to check.
  18604. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  18605. * @example
  18606. *
  18607. * _.isUndefined(void 0);
  18608. * // => true
  18609. *
  18610. * _.isUndefined(null);
  18611. * // => false
  18612. */
  18613. function isUndefined(value) {
  18614. return value === undefined;
  18615. }
  18616. /**
  18617. * Checks if `value` is classified as a `WeakMap` object.
  18618. *
  18619. * @static
  18620. * @memberOf _
  18621. * @since 4.3.0
  18622. * @category Lang
  18623. * @param {*} value The value to check.
  18624. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  18625. * @example
  18626. *
  18627. * _.isWeakMap(new WeakMap);
  18628. * // => true
  18629. *
  18630. * _.isWeakMap(new Map);
  18631. * // => false
  18632. */
  18633. function isWeakMap(value) {
  18634. return isObjectLike(value) && getTag(value) == weakMapTag;
  18635. }
  18636. /**
  18637. * Checks if `value` is classified as a `WeakSet` object.
  18638. *
  18639. * @static
  18640. * @memberOf _
  18641. * @since 4.3.0
  18642. * @category Lang
  18643. * @param {*} value The value to check.
  18644. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  18645. * @example
  18646. *
  18647. * _.isWeakSet(new WeakSet);
  18648. * // => true
  18649. *
  18650. * _.isWeakSet(new Set);
  18651. * // => false
  18652. */
  18653. function isWeakSet(value) {
  18654. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  18655. }
  18656. /**
  18657. * Checks if `value` is less than `other`.
  18658. *
  18659. * @static
  18660. * @memberOf _
  18661. * @since 3.9.0
  18662. * @category Lang
  18663. * @param {*} value The value to compare.
  18664. * @param {*} other The other value to compare.
  18665. * @returns {boolean} Returns `true` if `value` is less than `other`,
  18666. * else `false`.
  18667. * @see _.gt
  18668. * @example
  18669. *
  18670. * _.lt(1, 3);
  18671. * // => true
  18672. *
  18673. * _.lt(3, 3);
  18674. * // => false
  18675. *
  18676. * _.lt(3, 1);
  18677. * // => false
  18678. */
  18679. var lt = createRelationalOperation(baseLt);
  18680. /**
  18681. * Checks if `value` is less than or equal to `other`.
  18682. *
  18683. * @static
  18684. * @memberOf _
  18685. * @since 3.9.0
  18686. * @category Lang
  18687. * @param {*} value The value to compare.
  18688. * @param {*} other The other value to compare.
  18689. * @returns {boolean} Returns `true` if `value` is less than or equal to
  18690. * `other`, else `false`.
  18691. * @see _.gte
  18692. * @example
  18693. *
  18694. * _.lte(1, 3);
  18695. * // => true
  18696. *
  18697. * _.lte(3, 3);
  18698. * // => true
  18699. *
  18700. * _.lte(3, 1);
  18701. * // => false
  18702. */
  18703. var lte = createRelationalOperation(function(value, other) {
  18704. return value <= other;
  18705. });
  18706. /**
  18707. * Converts `value` to an array.
  18708. *
  18709. * @static
  18710. * @since 0.1.0
  18711. * @memberOf _
  18712. * @category Lang
  18713. * @param {*} value The value to convert.
  18714. * @returns {Array} Returns the converted array.
  18715. * @example
  18716. *
  18717. * _.toArray({ 'a': 1, 'b': 2 });
  18718. * // => [1, 2]
  18719. *
  18720. * _.toArray('abc');
  18721. * // => ['a', 'b', 'c']
  18722. *
  18723. * _.toArray(1);
  18724. * // => []
  18725. *
  18726. * _.toArray(null);
  18727. * // => []
  18728. */
  18729. function toArray(value) {
  18730. if (!value) {
  18731. return [];
  18732. }
  18733. if (isArrayLike(value)) {
  18734. return isString(value) ? stringToArray(value) : copyArray(value);
  18735. }
  18736. if (symIterator && value[symIterator]) {
  18737. return iteratorToArray(value[symIterator]());
  18738. }
  18739. var tag = getTag(value),
  18740. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  18741. return func(value);
  18742. }
  18743. /**
  18744. * Converts `value` to a finite number.
  18745. *
  18746. * @static
  18747. * @memberOf _
  18748. * @since 4.12.0
  18749. * @category Lang
  18750. * @param {*} value The value to convert.
  18751. * @returns {number} Returns the converted number.
  18752. * @example
  18753. *
  18754. * _.toFinite(3.2);
  18755. * // => 3.2
  18756. *
  18757. * _.toFinite(Number.MIN_VALUE);
  18758. * // => 5e-324
  18759. *
  18760. * _.toFinite(Infinity);
  18761. * // => 1.7976931348623157e+308
  18762. *
  18763. * _.toFinite('3.2');
  18764. * // => 3.2
  18765. */
  18766. function toFinite(value) {
  18767. if (!value) {
  18768. return value === 0 ? value : 0;
  18769. }
  18770. value = toNumber(value);
  18771. if (value === INFINITY || value === -INFINITY) {
  18772. var sign = (value < 0 ? -1 : 1);
  18773. return sign * MAX_INTEGER;
  18774. }
  18775. return value === value ? value : 0;
  18776. }
  18777. /**
  18778. * Converts `value` to an integer.
  18779. *
  18780. * **Note:** This method is loosely based on
  18781. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  18782. *
  18783. * @static
  18784. * @memberOf _
  18785. * @since 4.0.0
  18786. * @category Lang
  18787. * @param {*} value The value to convert.
  18788. * @returns {number} Returns the converted integer.
  18789. * @example
  18790. *
  18791. * _.toInteger(3.2);
  18792. * // => 3
  18793. *
  18794. * _.toInteger(Number.MIN_VALUE);
  18795. * // => 0
  18796. *
  18797. * _.toInteger(Infinity);
  18798. * // => 1.7976931348623157e+308
  18799. *
  18800. * _.toInteger('3.2');
  18801. * // => 3
  18802. */
  18803. function toInteger(value) {
  18804. var result = toFinite(value),
  18805. remainder = result % 1;
  18806. return result === result ? (remainder ? result - remainder : result) : 0;
  18807. }
  18808. /**
  18809. * Converts `value` to an integer suitable for use as the length of an
  18810. * array-like object.
  18811. *
  18812. * **Note:** This method is based on
  18813. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  18814. *
  18815. * @static
  18816. * @memberOf _
  18817. * @since 4.0.0
  18818. * @category Lang
  18819. * @param {*} value The value to convert.
  18820. * @returns {number} Returns the converted integer.
  18821. * @example
  18822. *
  18823. * _.toLength(3.2);
  18824. * // => 3
  18825. *
  18826. * _.toLength(Number.MIN_VALUE);
  18827. * // => 0
  18828. *
  18829. * _.toLength(Infinity);
  18830. * // => 4294967295
  18831. *
  18832. * _.toLength('3.2');
  18833. * // => 3
  18834. */
  18835. function toLength(value) {
  18836. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  18837. }
  18838. /**
  18839. * Converts `value` to a number.
  18840. *
  18841. * @static
  18842. * @memberOf _
  18843. * @since 4.0.0
  18844. * @category Lang
  18845. * @param {*} value The value to process.
  18846. * @returns {number} Returns the number.
  18847. * @example
  18848. *
  18849. * _.toNumber(3.2);
  18850. * // => 3.2
  18851. *
  18852. * _.toNumber(Number.MIN_VALUE);
  18853. * // => 5e-324
  18854. *
  18855. * _.toNumber(Infinity);
  18856. * // => Infinity
  18857. *
  18858. * _.toNumber('3.2');
  18859. * // => 3.2
  18860. */
  18861. function toNumber(value) {
  18862. if (typeof value == 'number') {
  18863. return value;
  18864. }
  18865. if (isSymbol(value)) {
  18866. return NAN;
  18867. }
  18868. if (isObject(value)) {
  18869. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  18870. value = isObject(other) ? (other + '') : other;
  18871. }
  18872. if (typeof value != 'string') {
  18873. return value === 0 ? value : +value;
  18874. }
  18875. value = value.replace(reTrim, '');
  18876. var isBinary = reIsBinary.test(value);
  18877. return (isBinary || reIsOctal.test(value))
  18878. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  18879. : (reIsBadHex.test(value) ? NAN : +value);
  18880. }
  18881. /**
  18882. * Converts `value` to a plain object flattening inherited enumerable string
  18883. * keyed properties of `value` to own properties of the plain object.
  18884. *
  18885. * @static
  18886. * @memberOf _
  18887. * @since 3.0.0
  18888. * @category Lang
  18889. * @param {*} value The value to convert.
  18890. * @returns {Object} Returns the converted plain object.
  18891. * @example
  18892. *
  18893. * function Foo() {
  18894. * this.b = 2;
  18895. * }
  18896. *
  18897. * Foo.prototype.c = 3;
  18898. *
  18899. * _.assign({ 'a': 1 }, new Foo);
  18900. * // => { 'a': 1, 'b': 2 }
  18901. *
  18902. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  18903. * // => { 'a': 1, 'b': 2, 'c': 3 }
  18904. */
  18905. function toPlainObject(value) {
  18906. return copyObject(value, keysIn(value));
  18907. }
  18908. /**
  18909. * Converts `value` to a safe integer. A safe integer can be compared and
  18910. * represented correctly.
  18911. *
  18912. * @static
  18913. * @memberOf _
  18914. * @since 4.0.0
  18915. * @category Lang
  18916. * @param {*} value The value to convert.
  18917. * @returns {number} Returns the converted integer.
  18918. * @example
  18919. *
  18920. * _.toSafeInteger(3.2);
  18921. * // => 3
  18922. *
  18923. * _.toSafeInteger(Number.MIN_VALUE);
  18924. * // => 0
  18925. *
  18926. * _.toSafeInteger(Infinity);
  18927. * // => 9007199254740991
  18928. *
  18929. * _.toSafeInteger('3.2');
  18930. * // => 3
  18931. */
  18932. function toSafeInteger(value) {
  18933. return value
  18934. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  18935. : (value === 0 ? value : 0);
  18936. }
  18937. /**
  18938. * Converts `value` to a string. An empty string is returned for `null`
  18939. * and `undefined` values. The sign of `-0` is preserved.
  18940. *
  18941. * @static
  18942. * @memberOf _
  18943. * @since 4.0.0
  18944. * @category Lang
  18945. * @param {*} value The value to convert.
  18946. * @returns {string} Returns the converted string.
  18947. * @example
  18948. *
  18949. * _.toString(null);
  18950. * // => ''
  18951. *
  18952. * _.toString(-0);
  18953. * // => '-0'
  18954. *
  18955. * _.toString([1, 2, 3]);
  18956. * // => '1,2,3'
  18957. */
  18958. function toString(value) {
  18959. return value == null ? '' : baseToString(value);
  18960. }
  18961. /*------------------------------------------------------------------------*/
  18962. /**
  18963. * Assigns own enumerable string keyed properties of source objects to the
  18964. * destination object. Source objects are applied from left to right.
  18965. * Subsequent sources overwrite property assignments of previous sources.
  18966. *
  18967. * **Note:** This method mutates `object` and is loosely based on
  18968. * [`Object.assign`](https://mdn.io/Object/assign).
  18969. *
  18970. * @static
  18971. * @memberOf _
  18972. * @since 0.10.0
  18973. * @category Object
  18974. * @param {Object} object The destination object.
  18975. * @param {...Object} [sources] The source objects.
  18976. * @returns {Object} Returns `object`.
  18977. * @see _.assignIn
  18978. * @example
  18979. *
  18980. * function Foo() {
  18981. * this.a = 1;
  18982. * }
  18983. *
  18984. * function Bar() {
  18985. * this.c = 3;
  18986. * }
  18987. *
  18988. * Foo.prototype.b = 2;
  18989. * Bar.prototype.d = 4;
  18990. *
  18991. * _.assign({ 'a': 0 }, new Foo, new Bar);
  18992. * // => { 'a': 1, 'c': 3 }
  18993. */
  18994. var assign = createAssigner(function(object, source) {
  18995. if (isPrototype(source) || isArrayLike(source)) {
  18996. copyObject(source, keys(source), object);
  18997. return;
  18998. }
  18999. for (var key in source) {
  19000. if (hasOwnProperty.call(source, key)) {
  19001. assignValue(object, key, source[key]);
  19002. }
  19003. }
  19004. });
  19005. /**
  19006. * This method is like `_.assign` except that it iterates over own and
  19007. * inherited source properties.
  19008. *
  19009. * **Note:** This method mutates `object`.
  19010. *
  19011. * @static
  19012. * @memberOf _
  19013. * @since 4.0.0
  19014. * @alias extend
  19015. * @category Object
  19016. * @param {Object} object The destination object.
  19017. * @param {...Object} [sources] The source objects.
  19018. * @returns {Object} Returns `object`.
  19019. * @see _.assign
  19020. * @example
  19021. *
  19022. * function Foo() {
  19023. * this.a = 1;
  19024. * }
  19025. *
  19026. * function Bar() {
  19027. * this.c = 3;
  19028. * }
  19029. *
  19030. * Foo.prototype.b = 2;
  19031. * Bar.prototype.d = 4;
  19032. *
  19033. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  19034. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  19035. */
  19036. var assignIn = createAssigner(function(object, source) {
  19037. copyObject(source, keysIn(source), object);
  19038. });
  19039. /**
  19040. * This method is like `_.assignIn` except that it accepts `customizer`
  19041. * which is invoked to produce the assigned values. If `customizer` returns
  19042. * `undefined`, assignment is handled by the method instead. The `customizer`
  19043. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  19044. *
  19045. * **Note:** This method mutates `object`.
  19046. *
  19047. * @static
  19048. * @memberOf _
  19049. * @since 4.0.0
  19050. * @alias extendWith
  19051. * @category Object
  19052. * @param {Object} object The destination object.
  19053. * @param {...Object} sources The source objects.
  19054. * @param {Function} [customizer] The function to customize assigned values.
  19055. * @returns {Object} Returns `object`.
  19056. * @see _.assignWith
  19057. * @example
  19058. *
  19059. * function customizer(objValue, srcValue) {
  19060. * return _.isUndefined(objValue) ? srcValue : objValue;
  19061. * }
  19062. *
  19063. * var defaults = _.partialRight(_.assignInWith, customizer);
  19064. *
  19065. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  19066. * // => { 'a': 1, 'b': 2 }
  19067. */
  19068. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  19069. copyObject(source, keysIn(source), object, customizer);
  19070. });
  19071. /**
  19072. * This method is like `_.assign` except that it accepts `customizer`
  19073. * which is invoked to produce the assigned values. If `customizer` returns
  19074. * `undefined`, assignment is handled by the method instead. The `customizer`
  19075. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  19076. *
  19077. * **Note:** This method mutates `object`.
  19078. *
  19079. * @static
  19080. * @memberOf _
  19081. * @since 4.0.0
  19082. * @category Object
  19083. * @param {Object} object The destination object.
  19084. * @param {...Object} sources The source objects.
  19085. * @param {Function} [customizer] The function to customize assigned values.
  19086. * @returns {Object} Returns `object`.
  19087. * @see _.assignInWith
  19088. * @example
  19089. *
  19090. * function customizer(objValue, srcValue) {
  19091. * return _.isUndefined(objValue) ? srcValue : objValue;
  19092. * }
  19093. *
  19094. * var defaults = _.partialRight(_.assignWith, customizer);
  19095. *
  19096. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  19097. * // => { 'a': 1, 'b': 2 }
  19098. */
  19099. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  19100. copyObject(source, keys(source), object, customizer);
  19101. });
  19102. /**
  19103. * Creates an array of values corresponding to `paths` of `object`.
  19104. *
  19105. * @static
  19106. * @memberOf _
  19107. * @since 1.0.0
  19108. * @category Object
  19109. * @param {Object} object The object to iterate over.
  19110. * @param {...(string|string[])} [paths] The property paths to pick.
  19111. * @returns {Array} Returns the picked values.
  19112. * @example
  19113. *
  19114. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  19115. *
  19116. * _.at(object, ['a[0].b.c', 'a[1]']);
  19117. * // => [3, 4]
  19118. */
  19119. var at = flatRest(baseAt);
  19120. /**
  19121. * Creates an object that inherits from the `prototype` object. If a
  19122. * `properties` object is given, its own enumerable string keyed properties
  19123. * are assigned to the created object.
  19124. *
  19125. * @static
  19126. * @memberOf _
  19127. * @since 2.3.0
  19128. * @category Object
  19129. * @param {Object} prototype The object to inherit from.
  19130. * @param {Object} [properties] The properties to assign to the object.
  19131. * @returns {Object} Returns the new object.
  19132. * @example
  19133. *
  19134. * function Shape() {
  19135. * this.x = 0;
  19136. * this.y = 0;
  19137. * }
  19138. *
  19139. * function Circle() {
  19140. * Shape.call(this);
  19141. * }
  19142. *
  19143. * Circle.prototype = _.create(Shape.prototype, {
  19144. * 'constructor': Circle
  19145. * });
  19146. *
  19147. * var circle = new Circle;
  19148. * circle instanceof Circle;
  19149. * // => true
  19150. *
  19151. * circle instanceof Shape;
  19152. * // => true
  19153. */
  19154. function create(prototype, properties) {
  19155. var result = baseCreate(prototype);
  19156. return properties == null ? result : baseAssign(result, properties);
  19157. }
  19158. /**
  19159. * Assigns own and inherited enumerable string keyed properties of source
  19160. * objects to the destination object for all destination properties that
  19161. * resolve to `undefined`. Source objects are applied from left to right.
  19162. * Once a property is set, additional values of the same property are ignored.
  19163. *
  19164. * **Note:** This method mutates `object`.
  19165. *
  19166. * @static
  19167. * @since 0.1.0
  19168. * @memberOf _
  19169. * @category Object
  19170. * @param {Object} object The destination object.
  19171. * @param {...Object} [sources] The source objects.
  19172. * @returns {Object} Returns `object`.
  19173. * @see _.defaultsDeep
  19174. * @example
  19175. *
  19176. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  19177. * // => { 'a': 1, 'b': 2 }
  19178. */
  19179. var defaults = baseRest(function(object, sources) {
  19180. object = Object(object);
  19181. var index = -1;
  19182. var length = sources.length;
  19183. var guard = length > 2 ? sources[2] : undefined;
  19184. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  19185. length = 1;
  19186. }
  19187. while (++index < length) {
  19188. var source = sources[index];
  19189. var props = keysIn(source);
  19190. var propsIndex = -1;
  19191. var propsLength = props.length;
  19192. while (++propsIndex < propsLength) {
  19193. var key = props[propsIndex];
  19194. var value = object[key];
  19195. if (value === undefined ||
  19196. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  19197. object[key] = source[key];
  19198. }
  19199. }
  19200. }
  19201. return object;
  19202. });
  19203. /**
  19204. * This method is like `_.defaults` except that it recursively assigns
  19205. * default properties.
  19206. *
  19207. * **Note:** This method mutates `object`.
  19208. *
  19209. * @static
  19210. * @memberOf _
  19211. * @since 3.10.0
  19212. * @category Object
  19213. * @param {Object} object The destination object.
  19214. * @param {...Object} [sources] The source objects.
  19215. * @returns {Object} Returns `object`.
  19216. * @see _.defaults
  19217. * @example
  19218. *
  19219. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  19220. * // => { 'a': { 'b': 2, 'c': 3 } }
  19221. */
  19222. var defaultsDeep = baseRest(function(args) {
  19223. args.push(undefined, customDefaultsMerge);
  19224. return apply(mergeWith, undefined, args);
  19225. });
  19226. /**
  19227. * This method is like `_.find` except that it returns the key of the first
  19228. * element `predicate` returns truthy for instead of the element itself.
  19229. *
  19230. * @static
  19231. * @memberOf _
  19232. * @since 1.1.0
  19233. * @category Object
  19234. * @param {Object} object The object to inspect.
  19235. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  19236. * @returns {string|undefined} Returns the key of the matched element,
  19237. * else `undefined`.
  19238. * @example
  19239. *
  19240. * var users = {
  19241. * 'barney': { 'age': 36, 'active': true },
  19242. * 'fred': { 'age': 40, 'active': false },
  19243. * 'pebbles': { 'age': 1, 'active': true }
  19244. * };
  19245. *
  19246. * _.findKey(users, function(o) { return o.age < 40; });
  19247. * // => 'barney' (iteration order is not guaranteed)
  19248. *
  19249. * // The `_.matches` iteratee shorthand.
  19250. * _.findKey(users, { 'age': 1, 'active': true });
  19251. * // => 'pebbles'
  19252. *
  19253. * // The `_.matchesProperty` iteratee shorthand.
  19254. * _.findKey(users, ['active', false]);
  19255. * // => 'fred'
  19256. *
  19257. * // The `_.property` iteratee shorthand.
  19258. * _.findKey(users, 'active');
  19259. * // => 'barney'
  19260. */
  19261. function findKey(object, predicate) {
  19262. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  19263. }
  19264. /**
  19265. * This method is like `_.findKey` except that it iterates over elements of
  19266. * a collection in the opposite order.
  19267. *
  19268. * @static
  19269. * @memberOf _
  19270. * @since 2.0.0
  19271. * @category Object
  19272. * @param {Object} object The object to inspect.
  19273. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  19274. * @returns {string|undefined} Returns the key of the matched element,
  19275. * else `undefined`.
  19276. * @example
  19277. *
  19278. * var users = {
  19279. * 'barney': { 'age': 36, 'active': true },
  19280. * 'fred': { 'age': 40, 'active': false },
  19281. * 'pebbles': { 'age': 1, 'active': true }
  19282. * };
  19283. *
  19284. * _.findLastKey(users, function(o) { return o.age < 40; });
  19285. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  19286. *
  19287. * // The `_.matches` iteratee shorthand.
  19288. * _.findLastKey(users, { 'age': 36, 'active': true });
  19289. * // => 'barney'
  19290. *
  19291. * // The `_.matchesProperty` iteratee shorthand.
  19292. * _.findLastKey(users, ['active', false]);
  19293. * // => 'fred'
  19294. *
  19295. * // The `_.property` iteratee shorthand.
  19296. * _.findLastKey(users, 'active');
  19297. * // => 'pebbles'
  19298. */
  19299. function findLastKey(object, predicate) {
  19300. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  19301. }
  19302. /**
  19303. * Iterates over own and inherited enumerable string keyed properties of an
  19304. * object and invokes `iteratee` for each property. The iteratee is invoked
  19305. * with three arguments: (value, key, object). Iteratee functions may exit
  19306. * iteration early by explicitly returning `false`.
  19307. *
  19308. * @static
  19309. * @memberOf _
  19310. * @since 0.3.0
  19311. * @category Object
  19312. * @param {Object} object The object to iterate over.
  19313. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  19314. * @returns {Object} Returns `object`.
  19315. * @see _.forInRight
  19316. * @example
  19317. *
  19318. * function Foo() {
  19319. * this.a = 1;
  19320. * this.b = 2;
  19321. * }
  19322. *
  19323. * Foo.prototype.c = 3;
  19324. *
  19325. * _.forIn(new Foo, function(value, key) {
  19326. * console.log(key);
  19327. * });
  19328. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  19329. */
  19330. function forIn(object, iteratee) {
  19331. return object == null
  19332. ? object
  19333. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  19334. }
  19335. /**
  19336. * This method is like `_.forIn` except that it iterates over properties of
  19337. * `object` in the opposite order.
  19338. *
  19339. * @static
  19340. * @memberOf _
  19341. * @since 2.0.0
  19342. * @category Object
  19343. * @param {Object} object The object to iterate over.
  19344. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  19345. * @returns {Object} Returns `object`.
  19346. * @see _.forIn
  19347. * @example
  19348. *
  19349. * function Foo() {
  19350. * this.a = 1;
  19351. * this.b = 2;
  19352. * }
  19353. *
  19354. * Foo.prototype.c = 3;
  19355. *
  19356. * _.forInRight(new Foo, function(value, key) {
  19357. * console.log(key);
  19358. * });
  19359. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  19360. */
  19361. function forInRight(object, iteratee) {
  19362. return object == null
  19363. ? object
  19364. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  19365. }
  19366. /**
  19367. * Iterates over own enumerable string keyed properties of an object and
  19368. * invokes `iteratee` for each property. The iteratee is invoked with three
  19369. * arguments: (value, key, object). Iteratee functions may exit iteration
  19370. * early by explicitly returning `false`.
  19371. *
  19372. * @static
  19373. * @memberOf _
  19374. * @since 0.3.0
  19375. * @category Object
  19376. * @param {Object} object The object to iterate over.
  19377. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  19378. * @returns {Object} Returns `object`.
  19379. * @see _.forOwnRight
  19380. * @example
  19381. *
  19382. * function Foo() {
  19383. * this.a = 1;
  19384. * this.b = 2;
  19385. * }
  19386. *
  19387. * Foo.prototype.c = 3;
  19388. *
  19389. * _.forOwn(new Foo, function(value, key) {
  19390. * console.log(key);
  19391. * });
  19392. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  19393. */
  19394. function forOwn(object, iteratee) {
  19395. return object && baseForOwn(object, getIteratee(iteratee, 3));
  19396. }
  19397. /**
  19398. * This method is like `_.forOwn` except that it iterates over properties of
  19399. * `object` in the opposite order.
  19400. *
  19401. * @static
  19402. * @memberOf _
  19403. * @since 2.0.0
  19404. * @category Object
  19405. * @param {Object} object The object to iterate over.
  19406. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  19407. * @returns {Object} Returns `object`.
  19408. * @see _.forOwn
  19409. * @example
  19410. *
  19411. * function Foo() {
  19412. * this.a = 1;
  19413. * this.b = 2;
  19414. * }
  19415. *
  19416. * Foo.prototype.c = 3;
  19417. *
  19418. * _.forOwnRight(new Foo, function(value, key) {
  19419. * console.log(key);
  19420. * });
  19421. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  19422. */
  19423. function forOwnRight(object, iteratee) {
  19424. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  19425. }
  19426. /**
  19427. * Creates an array of function property names from own enumerable properties
  19428. * of `object`.
  19429. *
  19430. * @static
  19431. * @since 0.1.0
  19432. * @memberOf _
  19433. * @category Object
  19434. * @param {Object} object The object to inspect.
  19435. * @returns {Array} Returns the function names.
  19436. * @see _.functionsIn
  19437. * @example
  19438. *
  19439. * function Foo() {
  19440. * this.a = _.constant('a');
  19441. * this.b = _.constant('b');
  19442. * }
  19443. *
  19444. * Foo.prototype.c = _.constant('c');
  19445. *
  19446. * _.functions(new Foo);
  19447. * // => ['a', 'b']
  19448. */
  19449. function functions(object) {
  19450. return object == null ? [] : baseFunctions(object, keys(object));
  19451. }
  19452. /**
  19453. * Creates an array of function property names from own and inherited
  19454. * enumerable properties of `object`.
  19455. *
  19456. * @static
  19457. * @memberOf _
  19458. * @since 4.0.0
  19459. * @category Object
  19460. * @param {Object} object The object to inspect.
  19461. * @returns {Array} Returns the function names.
  19462. * @see _.functions
  19463. * @example
  19464. *
  19465. * function Foo() {
  19466. * this.a = _.constant('a');
  19467. * this.b = _.constant('b');
  19468. * }
  19469. *
  19470. * Foo.prototype.c = _.constant('c');
  19471. *
  19472. * _.functionsIn(new Foo);
  19473. * // => ['a', 'b', 'c']
  19474. */
  19475. function functionsIn(object) {
  19476. return object == null ? [] : baseFunctions(object, keysIn(object));
  19477. }
  19478. /**
  19479. * Gets the value at `path` of `object`. If the resolved value is
  19480. * `undefined`, the `defaultValue` is returned in its place.
  19481. *
  19482. * @static
  19483. * @memberOf _
  19484. * @since 3.7.0
  19485. * @category Object
  19486. * @param {Object} object The object to query.
  19487. * @param {Array|string} path The path of the property to get.
  19488. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  19489. * @returns {*} Returns the resolved value.
  19490. * @example
  19491. *
  19492. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  19493. *
  19494. * _.get(object, 'a[0].b.c');
  19495. * // => 3
  19496. *
  19497. * _.get(object, ['a', '0', 'b', 'c']);
  19498. * // => 3
  19499. *
  19500. * _.get(object, 'a.b.c', 'default');
  19501. * // => 'default'
  19502. */
  19503. function get(object, path, defaultValue) {
  19504. var result = object == null ? undefined : baseGet(object, path);
  19505. return result === undefined ? defaultValue : result;
  19506. }
  19507. /**
  19508. * Checks if `path` is a direct property of `object`.
  19509. *
  19510. * @static
  19511. * @since 0.1.0
  19512. * @memberOf _
  19513. * @category Object
  19514. * @param {Object} object The object to query.
  19515. * @param {Array|string} path The path to check.
  19516. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  19517. * @example
  19518. *
  19519. * var object = { 'a': { 'b': 2 } };
  19520. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  19521. *
  19522. * _.has(object, 'a');
  19523. * // => true
  19524. *
  19525. * _.has(object, 'a.b');
  19526. * // => true
  19527. *
  19528. * _.has(object, ['a', 'b']);
  19529. * // => true
  19530. *
  19531. * _.has(other, 'a');
  19532. * // => false
  19533. */
  19534. function has(object, path) {
  19535. return object != null && hasPath(object, path, baseHas);
  19536. }
  19537. /**
  19538. * Checks if `path` is a direct or inherited property of `object`.
  19539. *
  19540. * @static
  19541. * @memberOf _
  19542. * @since 4.0.0
  19543. * @category Object
  19544. * @param {Object} object The object to query.
  19545. * @param {Array|string} path The path to check.
  19546. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  19547. * @example
  19548. *
  19549. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  19550. *
  19551. * _.hasIn(object, 'a');
  19552. * // => true
  19553. *
  19554. * _.hasIn(object, 'a.b');
  19555. * // => true
  19556. *
  19557. * _.hasIn(object, ['a', 'b']);
  19558. * // => true
  19559. *
  19560. * _.hasIn(object, 'b');
  19561. * // => false
  19562. */
  19563. function hasIn(object, path) {
  19564. return object != null && hasPath(object, path, baseHasIn);
  19565. }
  19566. /**
  19567. * Creates an object composed of the inverted keys and values of `object`.
  19568. * If `object` contains duplicate values, subsequent values overwrite
  19569. * property assignments of previous values.
  19570. *
  19571. * @static
  19572. * @memberOf _
  19573. * @since 0.7.0
  19574. * @category Object
  19575. * @param {Object} object The object to invert.
  19576. * @returns {Object} Returns the new inverted object.
  19577. * @example
  19578. *
  19579. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  19580. *
  19581. * _.invert(object);
  19582. * // => { '1': 'c', '2': 'b' }
  19583. */
  19584. var invert = createInverter(function(result, value, key) {
  19585. if (value != null &&
  19586. typeof value.toString != 'function') {
  19587. value = nativeObjectToString.call(value);
  19588. }
  19589. result[value] = key;
  19590. }, constant(identity));
  19591. /**
  19592. * This method is like `_.invert` except that the inverted object is generated
  19593. * from the results of running each element of `object` thru `iteratee`. The
  19594. * corresponding inverted value of each inverted key is an array of keys
  19595. * responsible for generating the inverted value. The iteratee is invoked
  19596. * with one argument: (value).
  19597. *
  19598. * @static
  19599. * @memberOf _
  19600. * @since 4.1.0
  19601. * @category Object
  19602. * @param {Object} object The object to invert.
  19603. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  19604. * @returns {Object} Returns the new inverted object.
  19605. * @example
  19606. *
  19607. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  19608. *
  19609. * _.invertBy(object);
  19610. * // => { '1': ['a', 'c'], '2': ['b'] }
  19611. *
  19612. * _.invertBy(object, function(value) {
  19613. * return 'group' + value;
  19614. * });
  19615. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  19616. */
  19617. var invertBy = createInverter(function(result, value, key) {
  19618. if (value != null &&
  19619. typeof value.toString != 'function') {
  19620. value = nativeObjectToString.call(value);
  19621. }
  19622. if (hasOwnProperty.call(result, value)) {
  19623. result[value].push(key);
  19624. } else {
  19625. result[value] = [key];
  19626. }
  19627. }, getIteratee);
  19628. /**
  19629. * Invokes the method at `path` of `object`.
  19630. *
  19631. * @static
  19632. * @memberOf _
  19633. * @since 4.0.0
  19634. * @category Object
  19635. * @param {Object} object The object to query.
  19636. * @param {Array|string} path The path of the method to invoke.
  19637. * @param {...*} [args] The arguments to invoke the method with.
  19638. * @returns {*} Returns the result of the invoked method.
  19639. * @example
  19640. *
  19641. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  19642. *
  19643. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  19644. * // => [2, 3]
  19645. */
  19646. var invoke = baseRest(baseInvoke);
  19647. /**
  19648. * Creates an array of the own enumerable property names of `object`.
  19649. *
  19650. * **Note:** Non-object values are coerced to objects. See the
  19651. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  19652. * for more details.
  19653. *
  19654. * @static
  19655. * @since 0.1.0
  19656. * @memberOf _
  19657. * @category Object
  19658. * @param {Object} object The object to query.
  19659. * @returns {Array} Returns the array of property names.
  19660. * @example
  19661. *
  19662. * function Foo() {
  19663. * this.a = 1;
  19664. * this.b = 2;
  19665. * }
  19666. *
  19667. * Foo.prototype.c = 3;
  19668. *
  19669. * _.keys(new Foo);
  19670. * // => ['a', 'b'] (iteration order is not guaranteed)
  19671. *
  19672. * _.keys('hi');
  19673. * // => ['0', '1']
  19674. */
  19675. function keys(object) {
  19676. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  19677. }
  19678. /**
  19679. * Creates an array of the own and inherited enumerable property names of `object`.
  19680. *
  19681. * **Note:** Non-object values are coerced to objects.
  19682. *
  19683. * @static
  19684. * @memberOf _
  19685. * @since 3.0.0
  19686. * @category Object
  19687. * @param {Object} object The object to query.
  19688. * @returns {Array} Returns the array of property names.
  19689. * @example
  19690. *
  19691. * function Foo() {
  19692. * this.a = 1;
  19693. * this.b = 2;
  19694. * }
  19695. *
  19696. * Foo.prototype.c = 3;
  19697. *
  19698. * _.keysIn(new Foo);
  19699. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  19700. */
  19701. function keysIn(object) {
  19702. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  19703. }
  19704. /**
  19705. * The opposite of `_.mapValues`; this method creates an object with the
  19706. * same values as `object` and keys generated by running each own enumerable
  19707. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  19708. * with three arguments: (value, key, object).
  19709. *
  19710. * @static
  19711. * @memberOf _
  19712. * @since 3.8.0
  19713. * @category Object
  19714. * @param {Object} object The object to iterate over.
  19715. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  19716. * @returns {Object} Returns the new mapped object.
  19717. * @see _.mapValues
  19718. * @example
  19719. *
  19720. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  19721. * return key + value;
  19722. * });
  19723. * // => { 'a1': 1, 'b2': 2 }
  19724. */
  19725. function mapKeys(object, iteratee) {
  19726. var result = {};
  19727. iteratee = getIteratee(iteratee, 3);
  19728. baseForOwn(object, function(value, key, object) {
  19729. baseAssignValue(result, iteratee(value, key, object), value);
  19730. });
  19731. return result;
  19732. }
  19733. /**
  19734. * Creates an object with the same keys as `object` and values generated
  19735. * by running each own enumerable string keyed property of `object` thru
  19736. * `iteratee`. The iteratee is invoked with three arguments:
  19737. * (value, key, object).
  19738. *
  19739. * @static
  19740. * @memberOf _
  19741. * @since 2.4.0
  19742. * @category Object
  19743. * @param {Object} object The object to iterate over.
  19744. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  19745. * @returns {Object} Returns the new mapped object.
  19746. * @see _.mapKeys
  19747. * @example
  19748. *
  19749. * var users = {
  19750. * 'fred': { 'user': 'fred', 'age': 40 },
  19751. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  19752. * };
  19753. *
  19754. * _.mapValues(users, function(o) { return o.age; });
  19755. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  19756. *
  19757. * // The `_.property` iteratee shorthand.
  19758. * _.mapValues(users, 'age');
  19759. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  19760. */
  19761. function mapValues(object, iteratee) {
  19762. var result = {};
  19763. iteratee = getIteratee(iteratee, 3);
  19764. baseForOwn(object, function(value, key, object) {
  19765. baseAssignValue(result, key, iteratee(value, key, object));
  19766. });
  19767. return result;
  19768. }
  19769. /**
  19770. * This method is like `_.assign` except that it recursively merges own and
  19771. * inherited enumerable string keyed properties of source objects into the
  19772. * destination object. Source properties that resolve to `undefined` are
  19773. * skipped if a destination value exists. Array and plain object properties
  19774. * are merged recursively. Other objects and value types are overridden by
  19775. * assignment. Source objects are applied from left to right. Subsequent
  19776. * sources overwrite property assignments of previous sources.
  19777. *
  19778. * **Note:** This method mutates `object`.
  19779. *
  19780. * @static
  19781. * @memberOf _
  19782. * @since 0.5.0
  19783. * @category Object
  19784. * @param {Object} object The destination object.
  19785. * @param {...Object} [sources] The source objects.
  19786. * @returns {Object} Returns `object`.
  19787. * @example
  19788. *
  19789. * var object = {
  19790. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  19791. * };
  19792. *
  19793. * var other = {
  19794. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  19795. * };
  19796. *
  19797. * _.merge(object, other);
  19798. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  19799. */
  19800. var merge = createAssigner(function(object, source, srcIndex) {
  19801. baseMerge(object, source, srcIndex);
  19802. });
  19803. /**
  19804. * This method is like `_.merge` except that it accepts `customizer` which
  19805. * is invoked to produce the merged values of the destination and source
  19806. * properties. If `customizer` returns `undefined`, merging is handled by the
  19807. * method instead. The `customizer` is invoked with six arguments:
  19808. * (objValue, srcValue, key, object, source, stack).
  19809. *
  19810. * **Note:** This method mutates `object`.
  19811. *
  19812. * @static
  19813. * @memberOf _
  19814. * @since 4.0.0
  19815. * @category Object
  19816. * @param {Object} object The destination object.
  19817. * @param {...Object} sources The source objects.
  19818. * @param {Function} customizer The function to customize assigned values.
  19819. * @returns {Object} Returns `object`.
  19820. * @example
  19821. *
  19822. * function customizer(objValue, srcValue) {
  19823. * if (_.isArray(objValue)) {
  19824. * return objValue.concat(srcValue);
  19825. * }
  19826. * }
  19827. *
  19828. * var object = { 'a': [1], 'b': [2] };
  19829. * var other = { 'a': [3], 'b': [4] };
  19830. *
  19831. * _.mergeWith(object, other, customizer);
  19832. * // => { 'a': [1, 3], 'b': [2, 4] }
  19833. */
  19834. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  19835. baseMerge(object, source, srcIndex, customizer);
  19836. });
  19837. /**
  19838. * The opposite of `_.pick`; this method creates an object composed of the
  19839. * own and inherited enumerable property paths of `object` that are not omitted.
  19840. *
  19841. * **Note:** This method is considerably slower than `_.pick`.
  19842. *
  19843. * @static
  19844. * @since 0.1.0
  19845. * @memberOf _
  19846. * @category Object
  19847. * @param {Object} object The source object.
  19848. * @param {...(string|string[])} [paths] The property paths to omit.
  19849. * @returns {Object} Returns the new object.
  19850. * @example
  19851. *
  19852. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  19853. *
  19854. * _.omit(object, ['a', 'c']);
  19855. * // => { 'b': '2' }
  19856. */
  19857. var omit = flatRest(function(object, paths) {
  19858. var result = {};
  19859. if (object == null) {
  19860. return result;
  19861. }
  19862. var isDeep = false;
  19863. paths = arrayMap(paths, function(path) {
  19864. path = castPath(path, object);
  19865. isDeep || (isDeep = path.length > 1);
  19866. return path;
  19867. });
  19868. copyObject(object, getAllKeysIn(object), result);
  19869. if (isDeep) {
  19870. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  19871. }
  19872. var length = paths.length;
  19873. while (length--) {
  19874. baseUnset(result, paths[length]);
  19875. }
  19876. return result;
  19877. });
  19878. /**
  19879. * The opposite of `_.pickBy`; this method creates an object composed of
  19880. * the own and inherited enumerable string keyed properties of `object` that
  19881. * `predicate` doesn't return truthy for. The predicate is invoked with two
  19882. * arguments: (value, key).
  19883. *
  19884. * @static
  19885. * @memberOf _
  19886. * @since 4.0.0
  19887. * @category Object
  19888. * @param {Object} object The source object.
  19889. * @param {Function} [predicate=_.identity] The function invoked per property.
  19890. * @returns {Object} Returns the new object.
  19891. * @example
  19892. *
  19893. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  19894. *
  19895. * _.omitBy(object, _.isNumber);
  19896. * // => { 'b': '2' }
  19897. */
  19898. function omitBy(object, predicate) {
  19899. return pickBy(object, negate(getIteratee(predicate)));
  19900. }
  19901. /**
  19902. * Creates an object composed of the picked `object` properties.
  19903. *
  19904. * @static
  19905. * @since 0.1.0
  19906. * @memberOf _
  19907. * @category Object
  19908. * @param {Object} object The source object.
  19909. * @param {...(string|string[])} [paths] The property paths to pick.
  19910. * @returns {Object} Returns the new object.
  19911. * @example
  19912. *
  19913. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  19914. *
  19915. * _.pick(object, ['a', 'c']);
  19916. * // => { 'a': 1, 'c': 3 }
  19917. */
  19918. var pick = flatRest(function(object, paths) {
  19919. return object == null ? {} : basePick(object, paths);
  19920. });
  19921. /**
  19922. * Creates an object composed of the `object` properties `predicate` returns
  19923. * truthy for. The predicate is invoked with two arguments: (value, key).
  19924. *
  19925. * @static
  19926. * @memberOf _
  19927. * @since 4.0.0
  19928. * @category Object
  19929. * @param {Object} object The source object.
  19930. * @param {Function} [predicate=_.identity] The function invoked per property.
  19931. * @returns {Object} Returns the new object.
  19932. * @example
  19933. *
  19934. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  19935. *
  19936. * _.pickBy(object, _.isNumber);
  19937. * // => { 'a': 1, 'c': 3 }
  19938. */
  19939. function pickBy(object, predicate) {
  19940. if (object == null) {
  19941. return {};
  19942. }
  19943. var props = arrayMap(getAllKeysIn(object), function(prop) {
  19944. return [prop];
  19945. });
  19946. predicate = getIteratee(predicate);
  19947. return basePickBy(object, props, function(value, path) {
  19948. return predicate(value, path[0]);
  19949. });
  19950. }
  19951. /**
  19952. * This method is like `_.get` except that if the resolved value is a
  19953. * function it's invoked with the `this` binding of its parent object and
  19954. * its result is returned.
  19955. *
  19956. * @static
  19957. * @since 0.1.0
  19958. * @memberOf _
  19959. * @category Object
  19960. * @param {Object} object The object to query.
  19961. * @param {Array|string} path The path of the property to resolve.
  19962. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  19963. * @returns {*} Returns the resolved value.
  19964. * @example
  19965. *
  19966. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  19967. *
  19968. * _.result(object, 'a[0].b.c1');
  19969. * // => 3
  19970. *
  19971. * _.result(object, 'a[0].b.c2');
  19972. * // => 4
  19973. *
  19974. * _.result(object, 'a[0].b.c3', 'default');
  19975. * // => 'default'
  19976. *
  19977. * _.result(object, 'a[0].b.c3', _.constant('default'));
  19978. * // => 'default'
  19979. */
  19980. function result(object, path, defaultValue) {
  19981. path = castPath(path, object);
  19982. var index = -1,
  19983. length = path.length;
  19984. // Ensure the loop is entered when path is empty.
  19985. if (!length) {
  19986. length = 1;
  19987. object = undefined;
  19988. }
  19989. while (++index < length) {
  19990. var value = object == null ? undefined : object[toKey(path[index])];
  19991. if (value === undefined) {
  19992. index = length;
  19993. value = defaultValue;
  19994. }
  19995. object = isFunction(value) ? value.call(object) : value;
  19996. }
  19997. return object;
  19998. }
  19999. /**
  20000. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  20001. * it's created. Arrays are created for missing index properties while objects
  20002. * are created for all other missing properties. Use `_.setWith` to customize
  20003. * `path` creation.
  20004. *
  20005. * **Note:** This method mutates `object`.
  20006. *
  20007. * @static
  20008. * @memberOf _
  20009. * @since 3.7.0
  20010. * @category Object
  20011. * @param {Object} object The object to modify.
  20012. * @param {Array|string} path The path of the property to set.
  20013. * @param {*} value The value to set.
  20014. * @returns {Object} Returns `object`.
  20015. * @example
  20016. *
  20017. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  20018. *
  20019. * _.set(object, 'a[0].b.c', 4);
  20020. * console.log(object.a[0].b.c);
  20021. * // => 4
  20022. *
  20023. * _.set(object, ['x', '0', 'y', 'z'], 5);
  20024. * console.log(object.x[0].y.z);
  20025. * // => 5
  20026. */
  20027. function set(object, path, value) {
  20028. return object == null ? object : baseSet(object, path, value);
  20029. }
  20030. /**
  20031. * This method is like `_.set` except that it accepts `customizer` which is
  20032. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  20033. * path creation is handled by the method instead. The `customizer` is invoked
  20034. * with three arguments: (nsValue, key, nsObject).
  20035. *
  20036. * **Note:** This method mutates `object`.
  20037. *
  20038. * @static
  20039. * @memberOf _
  20040. * @since 4.0.0
  20041. * @category Object
  20042. * @param {Object} object The object to modify.
  20043. * @param {Array|string} path The path of the property to set.
  20044. * @param {*} value The value to set.
  20045. * @param {Function} [customizer] The function to customize assigned values.
  20046. * @returns {Object} Returns `object`.
  20047. * @example
  20048. *
  20049. * var object = {};
  20050. *
  20051. * _.setWith(object, '[0][1]', 'a', Object);
  20052. * // => { '0': { '1': 'a' } }
  20053. */
  20054. function setWith(object, path, value, customizer) {
  20055. customizer = typeof customizer == 'function' ? customizer : undefined;
  20056. return object == null ? object : baseSet(object, path, value, customizer);
  20057. }
  20058. /**
  20059. * Creates an array of own enumerable string keyed-value pairs for `object`
  20060. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  20061. * entries are returned.
  20062. *
  20063. * @static
  20064. * @memberOf _
  20065. * @since 4.0.0
  20066. * @alias entries
  20067. * @category Object
  20068. * @param {Object} object The object to query.
  20069. * @returns {Array} Returns the key-value pairs.
  20070. * @example
  20071. *
  20072. * function Foo() {
  20073. * this.a = 1;
  20074. * this.b = 2;
  20075. * }
  20076. *
  20077. * Foo.prototype.c = 3;
  20078. *
  20079. * _.toPairs(new Foo);
  20080. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  20081. */
  20082. var toPairs = createToPairs(keys);
  20083. /**
  20084. * Creates an array of own and inherited enumerable string keyed-value pairs
  20085. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  20086. * or set, its entries are returned.
  20087. *
  20088. * @static
  20089. * @memberOf _
  20090. * @since 4.0.0
  20091. * @alias entriesIn
  20092. * @category Object
  20093. * @param {Object} object The object to query.
  20094. * @returns {Array} Returns the key-value pairs.
  20095. * @example
  20096. *
  20097. * function Foo() {
  20098. * this.a = 1;
  20099. * this.b = 2;
  20100. * }
  20101. *
  20102. * Foo.prototype.c = 3;
  20103. *
  20104. * _.toPairsIn(new Foo);
  20105. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  20106. */
  20107. var toPairsIn = createToPairs(keysIn);
  20108. /**
  20109. * An alternative to `_.reduce`; this method transforms `object` to a new
  20110. * `accumulator` object which is the result of running each of its own
  20111. * enumerable string keyed properties thru `iteratee`, with each invocation
  20112. * potentially mutating the `accumulator` object. If `accumulator` is not
  20113. * provided, a new object with the same `[[Prototype]]` will be used. The
  20114. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  20115. * Iteratee functions may exit iteration early by explicitly returning `false`.
  20116. *
  20117. * @static
  20118. * @memberOf _
  20119. * @since 1.3.0
  20120. * @category Object
  20121. * @param {Object} object The object to iterate over.
  20122. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  20123. * @param {*} [accumulator] The custom accumulator value.
  20124. * @returns {*} Returns the accumulated value.
  20125. * @example
  20126. *
  20127. * _.transform([2, 3, 4], function(result, n) {
  20128. * result.push(n *= n);
  20129. * return n % 2 == 0;
  20130. * }, []);
  20131. * // => [4, 9]
  20132. *
  20133. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  20134. * (result[value] || (result[value] = [])).push(key);
  20135. * }, {});
  20136. * // => { '1': ['a', 'c'], '2': ['b'] }
  20137. */
  20138. function transform(object, iteratee, accumulator) {
  20139. var isArr = isArray(object),
  20140. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  20141. iteratee = getIteratee(iteratee, 4);
  20142. if (accumulator == null) {
  20143. var Ctor = object && object.constructor;
  20144. if (isArrLike) {
  20145. accumulator = isArr ? new Ctor : [];
  20146. }
  20147. else if (isObject(object)) {
  20148. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  20149. }
  20150. else {
  20151. accumulator = {};
  20152. }
  20153. }
  20154. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  20155. return iteratee(accumulator, value, index, object);
  20156. });
  20157. return accumulator;
  20158. }
  20159. /**
  20160. * Removes the property at `path` of `object`.
  20161. *
  20162. * **Note:** This method mutates `object`.
  20163. *
  20164. * @static
  20165. * @memberOf _
  20166. * @since 4.0.0
  20167. * @category Object
  20168. * @param {Object} object The object to modify.
  20169. * @param {Array|string} path The path of the property to unset.
  20170. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  20171. * @example
  20172. *
  20173. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  20174. * _.unset(object, 'a[0].b.c');
  20175. * // => true
  20176. *
  20177. * console.log(object);
  20178. * // => { 'a': [{ 'b': {} }] };
  20179. *
  20180. * _.unset(object, ['a', '0', 'b', 'c']);
  20181. * // => true
  20182. *
  20183. * console.log(object);
  20184. * // => { 'a': [{ 'b': {} }] };
  20185. */
  20186. function unset(object, path) {
  20187. return object == null ? true : baseUnset(object, path);
  20188. }
  20189. /**
  20190. * This method is like `_.set` except that accepts `updater` to produce the
  20191. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  20192. * is invoked with one argument: (value).
  20193. *
  20194. * **Note:** This method mutates `object`.
  20195. *
  20196. * @static
  20197. * @memberOf _
  20198. * @since 4.6.0
  20199. * @category Object
  20200. * @param {Object} object The object to modify.
  20201. * @param {Array|string} path The path of the property to set.
  20202. * @param {Function} updater The function to produce the updated value.
  20203. * @returns {Object} Returns `object`.
  20204. * @example
  20205. *
  20206. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  20207. *
  20208. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  20209. * console.log(object.a[0].b.c);
  20210. * // => 9
  20211. *
  20212. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  20213. * console.log(object.x[0].y.z);
  20214. * // => 0
  20215. */
  20216. function update(object, path, updater) {
  20217. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  20218. }
  20219. /**
  20220. * This method is like `_.update` except that it accepts `customizer` which is
  20221. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  20222. * path creation is handled by the method instead. The `customizer` is invoked
  20223. * with three arguments: (nsValue, key, nsObject).
  20224. *
  20225. * **Note:** This method mutates `object`.
  20226. *
  20227. * @static
  20228. * @memberOf _
  20229. * @since 4.6.0
  20230. * @category Object
  20231. * @param {Object} object The object to modify.
  20232. * @param {Array|string} path The path of the property to set.
  20233. * @param {Function} updater The function to produce the updated value.
  20234. * @param {Function} [customizer] The function to customize assigned values.
  20235. * @returns {Object} Returns `object`.
  20236. * @example
  20237. *
  20238. * var object = {};
  20239. *
  20240. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  20241. * // => { '0': { '1': 'a' } }
  20242. */
  20243. function updateWith(object, path, updater, customizer) {
  20244. customizer = typeof customizer == 'function' ? customizer : undefined;
  20245. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  20246. }
  20247. /**
  20248. * Creates an array of the own enumerable string keyed property values of `object`.
  20249. *
  20250. * **Note:** Non-object values are coerced to objects.
  20251. *
  20252. * @static
  20253. * @since 0.1.0
  20254. * @memberOf _
  20255. * @category Object
  20256. * @param {Object} object The object to query.
  20257. * @returns {Array} Returns the array of property values.
  20258. * @example
  20259. *
  20260. * function Foo() {
  20261. * this.a = 1;
  20262. * this.b = 2;
  20263. * }
  20264. *
  20265. * Foo.prototype.c = 3;
  20266. *
  20267. * _.values(new Foo);
  20268. * // => [1, 2] (iteration order is not guaranteed)
  20269. *
  20270. * _.values('hi');
  20271. * // => ['h', 'i']
  20272. */
  20273. function values(object) {
  20274. return object == null ? [] : baseValues(object, keys(object));
  20275. }
  20276. /**
  20277. * Creates an array of the own and inherited enumerable string keyed property
  20278. * values of `object`.
  20279. *
  20280. * **Note:** Non-object values are coerced to objects.
  20281. *
  20282. * @static
  20283. * @memberOf _
  20284. * @since 3.0.0
  20285. * @category Object
  20286. * @param {Object} object The object to query.
  20287. * @returns {Array} Returns the array of property values.
  20288. * @example
  20289. *
  20290. * function Foo() {
  20291. * this.a = 1;
  20292. * this.b = 2;
  20293. * }
  20294. *
  20295. * Foo.prototype.c = 3;
  20296. *
  20297. * _.valuesIn(new Foo);
  20298. * // => [1, 2, 3] (iteration order is not guaranteed)
  20299. */
  20300. function valuesIn(object) {
  20301. return object == null ? [] : baseValues(object, keysIn(object));
  20302. }
  20303. /*------------------------------------------------------------------------*/
  20304. /**
  20305. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  20306. *
  20307. * @static
  20308. * @memberOf _
  20309. * @since 4.0.0
  20310. * @category Number
  20311. * @param {number} number The number to clamp.
  20312. * @param {number} [lower] The lower bound.
  20313. * @param {number} upper The upper bound.
  20314. * @returns {number} Returns the clamped number.
  20315. * @example
  20316. *
  20317. * _.clamp(-10, -5, 5);
  20318. * // => -5
  20319. *
  20320. * _.clamp(10, -5, 5);
  20321. * // => 5
  20322. */
  20323. function clamp(number, lower, upper) {
  20324. if (upper === undefined) {
  20325. upper = lower;
  20326. lower = undefined;
  20327. }
  20328. if (upper !== undefined) {
  20329. upper = toNumber(upper);
  20330. upper = upper === upper ? upper : 0;
  20331. }
  20332. if (lower !== undefined) {
  20333. lower = toNumber(lower);
  20334. lower = lower === lower ? lower : 0;
  20335. }
  20336. return baseClamp(toNumber(number), lower, upper);
  20337. }
  20338. /**
  20339. * Checks if `n` is between `start` and up to, but not including, `end`. If
  20340. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  20341. * If `start` is greater than `end` the params are swapped to support
  20342. * negative ranges.
  20343. *
  20344. * @static
  20345. * @memberOf _
  20346. * @since 3.3.0
  20347. * @category Number
  20348. * @param {number} number The number to check.
  20349. * @param {number} [start=0] The start of the range.
  20350. * @param {number} end The end of the range.
  20351. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  20352. * @see _.range, _.rangeRight
  20353. * @example
  20354. *
  20355. * _.inRange(3, 2, 4);
  20356. * // => true
  20357. *
  20358. * _.inRange(4, 8);
  20359. * // => true
  20360. *
  20361. * _.inRange(4, 2);
  20362. * // => false
  20363. *
  20364. * _.inRange(2, 2);
  20365. * // => false
  20366. *
  20367. * _.inRange(1.2, 2);
  20368. * // => true
  20369. *
  20370. * _.inRange(5.2, 4);
  20371. * // => false
  20372. *
  20373. * _.inRange(-3, -2, -6);
  20374. * // => true
  20375. */
  20376. function inRange(number, start, end) {
  20377. start = toFinite(start);
  20378. if (end === undefined) {
  20379. end = start;
  20380. start = 0;
  20381. } else {
  20382. end = toFinite(end);
  20383. }
  20384. number = toNumber(number);
  20385. return baseInRange(number, start, end);
  20386. }
  20387. /**
  20388. * Produces a random number between the inclusive `lower` and `upper` bounds.
  20389. * If only one argument is provided a number between `0` and the given number
  20390. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  20391. * floats, a floating-point number is returned instead of an integer.
  20392. *
  20393. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  20394. * floating-point values which can produce unexpected results.
  20395. *
  20396. * @static
  20397. * @memberOf _
  20398. * @since 0.7.0
  20399. * @category Number
  20400. * @param {number} [lower=0] The lower bound.
  20401. * @param {number} [upper=1] The upper bound.
  20402. * @param {boolean} [floating] Specify returning a floating-point number.
  20403. * @returns {number} Returns the random number.
  20404. * @example
  20405. *
  20406. * _.random(0, 5);
  20407. * // => an integer between 0 and 5
  20408. *
  20409. * _.random(5);
  20410. * // => also an integer between 0 and 5
  20411. *
  20412. * _.random(5, true);
  20413. * // => a floating-point number between 0 and 5
  20414. *
  20415. * _.random(1.2, 5.2);
  20416. * // => a floating-point number between 1.2 and 5.2
  20417. */
  20418. function random(lower, upper, floating) {
  20419. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  20420. upper = floating = undefined;
  20421. }
  20422. if (floating === undefined) {
  20423. if (typeof upper == 'boolean') {
  20424. floating = upper;
  20425. upper = undefined;
  20426. }
  20427. else if (typeof lower == 'boolean') {
  20428. floating = lower;
  20429. lower = undefined;
  20430. }
  20431. }
  20432. if (lower === undefined && upper === undefined) {
  20433. lower = 0;
  20434. upper = 1;
  20435. }
  20436. else {
  20437. lower = toFinite(lower);
  20438. if (upper === undefined) {
  20439. upper = lower;
  20440. lower = 0;
  20441. } else {
  20442. upper = toFinite(upper);
  20443. }
  20444. }
  20445. if (lower > upper) {
  20446. var temp = lower;
  20447. lower = upper;
  20448. upper = temp;
  20449. }
  20450. if (floating || lower % 1 || upper % 1) {
  20451. var rand = nativeRandom();
  20452. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  20453. }
  20454. return baseRandom(lower, upper);
  20455. }
  20456. /*------------------------------------------------------------------------*/
  20457. /**
  20458. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  20459. *
  20460. * @static
  20461. * @memberOf _
  20462. * @since 3.0.0
  20463. * @category String
  20464. * @param {string} [string=''] The string to convert.
  20465. * @returns {string} Returns the camel cased string.
  20466. * @example
  20467. *
  20468. * _.camelCase('Foo Bar');
  20469. * // => 'fooBar'
  20470. *
  20471. * _.camelCase('--foo-bar--');
  20472. * // => 'fooBar'
  20473. *
  20474. * _.camelCase('__FOO_BAR__');
  20475. * // => 'fooBar'
  20476. */
  20477. var camelCase = createCompounder(function(result, word, index) {
  20478. word = word.toLowerCase();
  20479. return result + (index ? capitalize(word) : word);
  20480. });
  20481. /**
  20482. * Converts the first character of `string` to upper case and the remaining
  20483. * to lower case.
  20484. *
  20485. * @static
  20486. * @memberOf _
  20487. * @since 3.0.0
  20488. * @category String
  20489. * @param {string} [string=''] The string to capitalize.
  20490. * @returns {string} Returns the capitalized string.
  20491. * @example
  20492. *
  20493. * _.capitalize('FRED');
  20494. * // => 'Fred'
  20495. */
  20496. function capitalize(string) {
  20497. return upperFirst(toString(string).toLowerCase());
  20498. }
  20499. /**
  20500. * Deburrs `string` by converting
  20501. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  20502. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  20503. * letters to basic Latin letters and removing
  20504. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  20505. *
  20506. * @static
  20507. * @memberOf _
  20508. * @since 3.0.0
  20509. * @category String
  20510. * @param {string} [string=''] The string to deburr.
  20511. * @returns {string} Returns the deburred string.
  20512. * @example
  20513. *
  20514. * _.deburr('déjà vu');
  20515. * // => 'deja vu'
  20516. */
  20517. function deburr(string) {
  20518. string = toString(string);
  20519. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  20520. }
  20521. /**
  20522. * Checks if `string` ends with the given target string.
  20523. *
  20524. * @static
  20525. * @memberOf _
  20526. * @since 3.0.0
  20527. * @category String
  20528. * @param {string} [string=''] The string to inspect.
  20529. * @param {string} [target] The string to search for.
  20530. * @param {number} [position=string.length] The position to search up to.
  20531. * @returns {boolean} Returns `true` if `string` ends with `target`,
  20532. * else `false`.
  20533. * @example
  20534. *
  20535. * _.endsWith('abc', 'c');
  20536. * // => true
  20537. *
  20538. * _.endsWith('abc', 'b');
  20539. * // => false
  20540. *
  20541. * _.endsWith('abc', 'b', 2);
  20542. * // => true
  20543. */
  20544. function endsWith(string, target, position) {
  20545. string = toString(string);
  20546. target = baseToString(target);
  20547. var length = string.length;
  20548. position = position === undefined
  20549. ? length
  20550. : baseClamp(toInteger(position), 0, length);
  20551. var end = position;
  20552. position -= target.length;
  20553. return position >= 0 && string.slice(position, end) == target;
  20554. }
  20555. /**
  20556. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  20557. * corresponding HTML entities.
  20558. *
  20559. * **Note:** No other characters are escaped. To escape additional
  20560. * characters use a third-party library like [_he_](https://mths.be/he).
  20561. *
  20562. * Though the ">" character is escaped for symmetry, characters like
  20563. * ">" and "/" don't need escaping in HTML and have no special meaning
  20564. * unless they're part of a tag or unquoted attribute value. See
  20565. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  20566. * (under "semi-related fun fact") for more details.
  20567. *
  20568. * When working with HTML you should always
  20569. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  20570. * XSS vectors.
  20571. *
  20572. * @static
  20573. * @since 0.1.0
  20574. * @memberOf _
  20575. * @category String
  20576. * @param {string} [string=''] The string to escape.
  20577. * @returns {string} Returns the escaped string.
  20578. * @example
  20579. *
  20580. * _.escape('fred, barney, & pebbles');
  20581. * // => 'fred, barney, &amp; pebbles'
  20582. */
  20583. function escape(string) {
  20584. string = toString(string);
  20585. return (string && reHasUnescapedHtml.test(string))
  20586. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  20587. : string;
  20588. }
  20589. /**
  20590. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  20591. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  20592. *
  20593. * @static
  20594. * @memberOf _
  20595. * @since 3.0.0
  20596. * @category String
  20597. * @param {string} [string=''] The string to escape.
  20598. * @returns {string} Returns the escaped string.
  20599. * @example
  20600. *
  20601. * _.escapeRegExp('[lodash](https://lodash.com/)');
  20602. * // => '\[lodash\]\(https://lodash\.com/\)'
  20603. */
  20604. function escapeRegExp(string) {
  20605. string = toString(string);
  20606. return (string && reHasRegExpChar.test(string))
  20607. ? string.replace(reRegExpChar, '\\$&')
  20608. : string;
  20609. }
  20610. /**
  20611. * Converts `string` to
  20612. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  20613. *
  20614. * @static
  20615. * @memberOf _
  20616. * @since 3.0.0
  20617. * @category String
  20618. * @param {string} [string=''] The string to convert.
  20619. * @returns {string} Returns the kebab cased string.
  20620. * @example
  20621. *
  20622. * _.kebabCase('Foo Bar');
  20623. * // => 'foo-bar'
  20624. *
  20625. * _.kebabCase('fooBar');
  20626. * // => 'foo-bar'
  20627. *
  20628. * _.kebabCase('__FOO_BAR__');
  20629. * // => 'foo-bar'
  20630. */
  20631. var kebabCase = createCompounder(function(result, word, index) {
  20632. return result + (index ? '-' : '') + word.toLowerCase();
  20633. });
  20634. /**
  20635. * Converts `string`, as space separated words, to lower case.
  20636. *
  20637. * @static
  20638. * @memberOf _
  20639. * @since 4.0.0
  20640. * @category String
  20641. * @param {string} [string=''] The string to convert.
  20642. * @returns {string} Returns the lower cased string.
  20643. * @example
  20644. *
  20645. * _.lowerCase('--Foo-Bar--');
  20646. * // => 'foo bar'
  20647. *
  20648. * _.lowerCase('fooBar');
  20649. * // => 'foo bar'
  20650. *
  20651. * _.lowerCase('__FOO_BAR__');
  20652. * // => 'foo bar'
  20653. */
  20654. var lowerCase = createCompounder(function(result, word, index) {
  20655. return result + (index ? ' ' : '') + word.toLowerCase();
  20656. });
  20657. /**
  20658. * Converts the first character of `string` to lower case.
  20659. *
  20660. * @static
  20661. * @memberOf _
  20662. * @since 4.0.0
  20663. * @category String
  20664. * @param {string} [string=''] The string to convert.
  20665. * @returns {string} Returns the converted string.
  20666. * @example
  20667. *
  20668. * _.lowerFirst('Fred');
  20669. * // => 'fred'
  20670. *
  20671. * _.lowerFirst('FRED');
  20672. * // => 'fRED'
  20673. */
  20674. var lowerFirst = createCaseFirst('toLowerCase');
  20675. /**
  20676. * Pads `string` on the left and right sides if it's shorter than `length`.
  20677. * Padding characters are truncated if they can't be evenly divided by `length`.
  20678. *
  20679. * @static
  20680. * @memberOf _
  20681. * @since 3.0.0
  20682. * @category String
  20683. * @param {string} [string=''] The string to pad.
  20684. * @param {number} [length=0] The padding length.
  20685. * @param {string} [chars=' '] The string used as padding.
  20686. * @returns {string} Returns the padded string.
  20687. * @example
  20688. *
  20689. * _.pad('abc', 8);
  20690. * // => ' abc '
  20691. *
  20692. * _.pad('abc', 8, '_-');
  20693. * // => '_-abc_-_'
  20694. *
  20695. * _.pad('abc', 3);
  20696. * // => 'abc'
  20697. */
  20698. function pad(string, length, chars) {
  20699. string = toString(string);
  20700. length = toInteger(length);
  20701. var strLength = length ? stringSize(string) : 0;
  20702. if (!length || strLength >= length) {
  20703. return string;
  20704. }
  20705. var mid = (length - strLength) / 2;
  20706. return (
  20707. createPadding(nativeFloor(mid), chars) +
  20708. string +
  20709. createPadding(nativeCeil(mid), chars)
  20710. );
  20711. }
  20712. /**
  20713. * Pads `string` on the right side if it's shorter than `length`. Padding
  20714. * characters are truncated if they exceed `length`.
  20715. *
  20716. * @static
  20717. * @memberOf _
  20718. * @since 4.0.0
  20719. * @category String
  20720. * @param {string} [string=''] The string to pad.
  20721. * @param {number} [length=0] The padding length.
  20722. * @param {string} [chars=' '] The string used as padding.
  20723. * @returns {string} Returns the padded string.
  20724. * @example
  20725. *
  20726. * _.padEnd('abc', 6);
  20727. * // => 'abc '
  20728. *
  20729. * _.padEnd('abc', 6, '_-');
  20730. * // => 'abc_-_'
  20731. *
  20732. * _.padEnd('abc', 3);
  20733. * // => 'abc'
  20734. */
  20735. function padEnd(string, length, chars) {
  20736. string = toString(string);
  20737. length = toInteger(length);
  20738. var strLength = length ? stringSize(string) : 0;
  20739. return (length && strLength < length)
  20740. ? (string + createPadding(length - strLength, chars))
  20741. : string;
  20742. }
  20743. /**
  20744. * Pads `string` on the left side if it's shorter than `length`. Padding
  20745. * characters are truncated if they exceed `length`.
  20746. *
  20747. * @static
  20748. * @memberOf _
  20749. * @since 4.0.0
  20750. * @category String
  20751. * @param {string} [string=''] The string to pad.
  20752. * @param {number} [length=0] The padding length.
  20753. * @param {string} [chars=' '] The string used as padding.
  20754. * @returns {string} Returns the padded string.
  20755. * @example
  20756. *
  20757. * _.padStart('abc', 6);
  20758. * // => ' abc'
  20759. *
  20760. * _.padStart('abc', 6, '_-');
  20761. * // => '_-_abc'
  20762. *
  20763. * _.padStart('abc', 3);
  20764. * // => 'abc'
  20765. */
  20766. function padStart(string, length, chars) {
  20767. string = toString(string);
  20768. length = toInteger(length);
  20769. var strLength = length ? stringSize(string) : 0;
  20770. return (length && strLength < length)
  20771. ? (createPadding(length - strLength, chars) + string)
  20772. : string;
  20773. }
  20774. /**
  20775. * Converts `string` to an integer of the specified radix. If `radix` is
  20776. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  20777. * hexadecimal, in which case a `radix` of `16` is used.
  20778. *
  20779. * **Note:** This method aligns with the
  20780. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  20781. *
  20782. * @static
  20783. * @memberOf _
  20784. * @since 1.1.0
  20785. * @category String
  20786. * @param {string} string The string to convert.
  20787. * @param {number} [radix=10] The radix to interpret `value` by.
  20788. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  20789. * @returns {number} Returns the converted integer.
  20790. * @example
  20791. *
  20792. * _.parseInt('08');
  20793. * // => 8
  20794. *
  20795. * _.map(['6', '08', '10'], _.parseInt);
  20796. * // => [6, 8, 10]
  20797. */
  20798. function parseInt(string, radix, guard) {
  20799. if (guard || radix == null) {
  20800. radix = 0;
  20801. } else if (radix) {
  20802. radix = +radix;
  20803. }
  20804. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  20805. }
  20806. /**
  20807. * Repeats the given string `n` times.
  20808. *
  20809. * @static
  20810. * @memberOf _
  20811. * @since 3.0.0
  20812. * @category String
  20813. * @param {string} [string=''] The string to repeat.
  20814. * @param {number} [n=1] The number of times to repeat the string.
  20815. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  20816. * @returns {string} Returns the repeated string.
  20817. * @example
  20818. *
  20819. * _.repeat('*', 3);
  20820. * // => '***'
  20821. *
  20822. * _.repeat('abc', 2);
  20823. * // => 'abcabc'
  20824. *
  20825. * _.repeat('abc', 0);
  20826. * // => ''
  20827. */
  20828. function repeat(string, n, guard) {
  20829. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  20830. n = 1;
  20831. } else {
  20832. n = toInteger(n);
  20833. }
  20834. return baseRepeat(toString(string), n);
  20835. }
  20836. /**
  20837. * Replaces matches for `pattern` in `string` with `replacement`.
  20838. *
  20839. * **Note:** This method is based on
  20840. * [`String#replace`](https://mdn.io/String/replace).
  20841. *
  20842. * @static
  20843. * @memberOf _
  20844. * @since 4.0.0
  20845. * @category String
  20846. * @param {string} [string=''] The string to modify.
  20847. * @param {RegExp|string} pattern The pattern to replace.
  20848. * @param {Function|string} replacement The match replacement.
  20849. * @returns {string} Returns the modified string.
  20850. * @example
  20851. *
  20852. * _.replace('Hi Fred', 'Fred', 'Barney');
  20853. * // => 'Hi Barney'
  20854. */
  20855. function replace() {
  20856. var args = arguments,
  20857. string = toString(args[0]);
  20858. return args.length < 3 ? string : string.replace(args[1], args[2]);
  20859. }
  20860. /**
  20861. * Converts `string` to
  20862. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  20863. *
  20864. * @static
  20865. * @memberOf _
  20866. * @since 3.0.0
  20867. * @category String
  20868. * @param {string} [string=''] The string to convert.
  20869. * @returns {string} Returns the snake cased string.
  20870. * @example
  20871. *
  20872. * _.snakeCase('Foo Bar');
  20873. * // => 'foo_bar'
  20874. *
  20875. * _.snakeCase('fooBar');
  20876. * // => 'foo_bar'
  20877. *
  20878. * _.snakeCase('--FOO-BAR--');
  20879. * // => 'foo_bar'
  20880. */
  20881. var snakeCase = createCompounder(function(result, word, index) {
  20882. return result + (index ? '_' : '') + word.toLowerCase();
  20883. });
  20884. /**
  20885. * Splits `string` by `separator`.
  20886. *
  20887. * **Note:** This method is based on
  20888. * [`String#split`](https://mdn.io/String/split).
  20889. *
  20890. * @static
  20891. * @memberOf _
  20892. * @since 4.0.0
  20893. * @category String
  20894. * @param {string} [string=''] The string to split.
  20895. * @param {RegExp|string} separator The separator pattern to split by.
  20896. * @param {number} [limit] The length to truncate results to.
  20897. * @returns {Array} Returns the string segments.
  20898. * @example
  20899. *
  20900. * _.split('a-b-c', '-', 2);
  20901. * // => ['a', 'b']
  20902. */
  20903. function split(string, separator, limit) {
  20904. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  20905. separator = limit = undefined;
  20906. }
  20907. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  20908. if (!limit) {
  20909. return [];
  20910. }
  20911. string = toString(string);
  20912. if (string && (
  20913. typeof separator == 'string' ||
  20914. (separator != null && !isRegExp(separator))
  20915. )) {
  20916. separator = baseToString(separator);
  20917. if (!separator && hasUnicode(string)) {
  20918. return castSlice(stringToArray(string), 0, limit);
  20919. }
  20920. }
  20921. return string.split(separator, limit);
  20922. }
  20923. /**
  20924. * Converts `string` to
  20925. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  20926. *
  20927. * @static
  20928. * @memberOf _
  20929. * @since 3.1.0
  20930. * @category String
  20931. * @param {string} [string=''] The string to convert.
  20932. * @returns {string} Returns the start cased string.
  20933. * @example
  20934. *
  20935. * _.startCase('--foo-bar--');
  20936. * // => 'Foo Bar'
  20937. *
  20938. * _.startCase('fooBar');
  20939. * // => 'Foo Bar'
  20940. *
  20941. * _.startCase('__FOO_BAR__');
  20942. * // => 'FOO BAR'
  20943. */
  20944. var startCase = createCompounder(function(result, word, index) {
  20945. return result + (index ? ' ' : '') + upperFirst(word);
  20946. });
  20947. /**
  20948. * Checks if `string` starts with the given target string.
  20949. *
  20950. * @static
  20951. * @memberOf _
  20952. * @since 3.0.0
  20953. * @category String
  20954. * @param {string} [string=''] The string to inspect.
  20955. * @param {string} [target] The string to search for.
  20956. * @param {number} [position=0] The position to search from.
  20957. * @returns {boolean} Returns `true` if `string` starts with `target`,
  20958. * else `false`.
  20959. * @example
  20960. *
  20961. * _.startsWith('abc', 'a');
  20962. * // => true
  20963. *
  20964. * _.startsWith('abc', 'b');
  20965. * // => false
  20966. *
  20967. * _.startsWith('abc', 'b', 1);
  20968. * // => true
  20969. */
  20970. function startsWith(string, target, position) {
  20971. string = toString(string);
  20972. position = position == null
  20973. ? 0
  20974. : baseClamp(toInteger(position), 0, string.length);
  20975. target = baseToString(target);
  20976. return string.slice(position, position + target.length) == target;
  20977. }
  20978. /**
  20979. * Creates a compiled template function that can interpolate data properties
  20980. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  20981. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  20982. * properties may be accessed as free variables in the template. If a setting
  20983. * object is given, it takes precedence over `_.templateSettings` values.
  20984. *
  20985. * **Note:** In the development build `_.template` utilizes
  20986. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  20987. * for easier debugging.
  20988. *
  20989. * For more information on precompiling templates see
  20990. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  20991. *
  20992. * For more information on Chrome extension sandboxes see
  20993. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  20994. *
  20995. * @static
  20996. * @since 0.1.0
  20997. * @memberOf _
  20998. * @category String
  20999. * @param {string} [string=''] The template string.
  21000. * @param {Object} [options={}] The options object.
  21001. * @param {RegExp} [options.escape=_.templateSettings.escape]
  21002. * The HTML "escape" delimiter.
  21003. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  21004. * The "evaluate" delimiter.
  21005. * @param {Object} [options.imports=_.templateSettings.imports]
  21006. * An object to import into the template as free variables.
  21007. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  21008. * The "interpolate" delimiter.
  21009. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  21010. * The sourceURL of the compiled template.
  21011. * @param {string} [options.variable='obj']
  21012. * The data object variable name.
  21013. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  21014. * @returns {Function} Returns the compiled template function.
  21015. * @example
  21016. *
  21017. * // Use the "interpolate" delimiter to create a compiled template.
  21018. * var compiled = _.template('hello <%= user %>!');
  21019. * compiled({ 'user': 'fred' });
  21020. * // => 'hello fred!'
  21021. *
  21022. * // Use the HTML "escape" delimiter to escape data property values.
  21023. * var compiled = _.template('<b><%- value %></b>');
  21024. * compiled({ 'value': '<script>' });
  21025. * // => '<b>&lt;script&gt;</b>'
  21026. *
  21027. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  21028. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  21029. * compiled({ 'users': ['fred', 'barney'] });
  21030. * // => '<li>fred</li><li>barney</li>'
  21031. *
  21032. * // Use the internal `print` function in "evaluate" delimiters.
  21033. * var compiled = _.template('<% print("hello " + user); %>!');
  21034. * compiled({ 'user': 'barney' });
  21035. * // => 'hello barney!'
  21036. *
  21037. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  21038. * // Disable support by replacing the "interpolate" delimiter.
  21039. * var compiled = _.template('hello ${ user }!');
  21040. * compiled({ 'user': 'pebbles' });
  21041. * // => 'hello pebbles!'
  21042. *
  21043. * // Use backslashes to treat delimiters as plain text.
  21044. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  21045. * compiled({ 'value': 'ignored' });
  21046. * // => '<%- value %>'
  21047. *
  21048. * // Use the `imports` option to import `jQuery` as `jq`.
  21049. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  21050. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  21051. * compiled({ 'users': ['fred', 'barney'] });
  21052. * // => '<li>fred</li><li>barney</li>'
  21053. *
  21054. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  21055. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  21056. * compiled(data);
  21057. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  21058. *
  21059. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  21060. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  21061. * compiled.source;
  21062. * // => function(data) {
  21063. * // var __t, __p = '';
  21064. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  21065. * // return __p;
  21066. * // }
  21067. *
  21068. * // Use custom template delimiters.
  21069. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  21070. * var compiled = _.template('hello {{ user }}!');
  21071. * compiled({ 'user': 'mustache' });
  21072. * // => 'hello mustache!'
  21073. *
  21074. * // Use the `source` property to inline compiled templates for meaningful
  21075. * // line numbers in error messages and stack traces.
  21076. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  21077. * var JST = {\
  21078. * "main": ' + _.template(mainText).source + '\
  21079. * };\
  21080. * ');
  21081. */
  21082. function template(string, options, guard) {
  21083. // Based on John Resig's `tmpl` implementation
  21084. // (http://ejohn.org/blog/javascript-micro-templating/)
  21085. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  21086. var settings = lodash.templateSettings;
  21087. if (guard && isIterateeCall(string, options, guard)) {
  21088. options = undefined;
  21089. }
  21090. string = toString(string);
  21091. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  21092. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  21093. importsKeys = keys(imports),
  21094. importsValues = baseValues(imports, importsKeys);
  21095. var isEscaping,
  21096. isEvaluating,
  21097. index = 0,
  21098. interpolate = options.interpolate || reNoMatch,
  21099. source = "__p += '";
  21100. // Compile the regexp to match each delimiter.
  21101. var reDelimiters = RegExp(
  21102. (options.escape || reNoMatch).source + '|' +
  21103. interpolate.source + '|' +
  21104. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  21105. (options.evaluate || reNoMatch).source + '|$'
  21106. , 'g');
  21107. // Use a sourceURL for easier debugging.
  21108. var sourceURL = '//# sourceURL=' +
  21109. ('sourceURL' in options
  21110. ? options.sourceURL
  21111. : ('lodash.templateSources[' + (++templateCounter) + ']')
  21112. ) + '\n';
  21113. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  21114. interpolateValue || (interpolateValue = esTemplateValue);
  21115. // Escape characters that can't be included in string literals.
  21116. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  21117. // Replace delimiters with snippets.
  21118. if (escapeValue) {
  21119. isEscaping = true;
  21120. source += "' +\n__e(" + escapeValue + ") +\n'";
  21121. }
  21122. if (evaluateValue) {
  21123. isEvaluating = true;
  21124. source += "';\n" + evaluateValue + ";\n__p += '";
  21125. }
  21126. if (interpolateValue) {
  21127. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  21128. }
  21129. index = offset + match.length;
  21130. // The JS engine embedded in Adobe products needs `match` returned in
  21131. // order to produce the correct `offset` value.
  21132. return match;
  21133. });
  21134. source += "';\n";
  21135. // If `variable` is not specified wrap a with-statement around the generated
  21136. // code to add the data object to the top of the scope chain.
  21137. var variable = options.variable;
  21138. if (!variable) {
  21139. source = 'with (obj) {\n' + source + '\n}\n';
  21140. }
  21141. // Cleanup code by stripping empty strings.
  21142. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  21143. .replace(reEmptyStringMiddle, '$1')
  21144. .replace(reEmptyStringTrailing, '$1;');
  21145. // Frame code as the function body.
  21146. source = 'function(' + (variable || 'obj') + ') {\n' +
  21147. (variable
  21148. ? ''
  21149. : 'obj || (obj = {});\n'
  21150. ) +
  21151. "var __t, __p = ''" +
  21152. (isEscaping
  21153. ? ', __e = _.escape'
  21154. : ''
  21155. ) +
  21156. (isEvaluating
  21157. ? ', __j = Array.prototype.join;\n' +
  21158. "function print() { __p += __j.call(arguments, '') }\n"
  21159. : ';\n'
  21160. ) +
  21161. source +
  21162. 'return __p\n}';
  21163. var result = attempt(function() {
  21164. return Function(importsKeys, sourceURL + 'return ' + source)
  21165. .apply(undefined, importsValues);
  21166. });
  21167. // Provide the compiled function's source by its `toString` method or
  21168. // the `source` property as a convenience for inlining compiled templates.
  21169. result.source = source;
  21170. if (isError(result)) {
  21171. throw result;
  21172. }
  21173. return result;
  21174. }
  21175. /**
  21176. * Converts `string`, as a whole, to lower case just like
  21177. * [String#toLowerCase](https://mdn.io/toLowerCase).
  21178. *
  21179. * @static
  21180. * @memberOf _
  21181. * @since 4.0.0
  21182. * @category String
  21183. * @param {string} [string=''] The string to convert.
  21184. * @returns {string} Returns the lower cased string.
  21185. * @example
  21186. *
  21187. * _.toLower('--Foo-Bar--');
  21188. * // => '--foo-bar--'
  21189. *
  21190. * _.toLower('fooBar');
  21191. * // => 'foobar'
  21192. *
  21193. * _.toLower('__FOO_BAR__');
  21194. * // => '__foo_bar__'
  21195. */
  21196. function toLower(value) {
  21197. return toString(value).toLowerCase();
  21198. }
  21199. /**
  21200. * Converts `string`, as a whole, to upper case just like
  21201. * [String#toUpperCase](https://mdn.io/toUpperCase).
  21202. *
  21203. * @static
  21204. * @memberOf _
  21205. * @since 4.0.0
  21206. * @category String
  21207. * @param {string} [string=''] The string to convert.
  21208. * @returns {string} Returns the upper cased string.
  21209. * @example
  21210. *
  21211. * _.toUpper('--foo-bar--');
  21212. * // => '--FOO-BAR--'
  21213. *
  21214. * _.toUpper('fooBar');
  21215. * // => 'FOOBAR'
  21216. *
  21217. * _.toUpper('__foo_bar__');
  21218. * // => '__FOO_BAR__'
  21219. */
  21220. function toUpper(value) {
  21221. return toString(value).toUpperCase();
  21222. }
  21223. /**
  21224. * Removes leading and trailing whitespace or specified characters from `string`.
  21225. *
  21226. * @static
  21227. * @memberOf _
  21228. * @since 3.0.0
  21229. * @category String
  21230. * @param {string} [string=''] The string to trim.
  21231. * @param {string} [chars=whitespace] The characters to trim.
  21232. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  21233. * @returns {string} Returns the trimmed string.
  21234. * @example
  21235. *
  21236. * _.trim(' abc ');
  21237. * // => 'abc'
  21238. *
  21239. * _.trim('-_-abc-_-', '_-');
  21240. * // => 'abc'
  21241. *
  21242. * _.map([' foo ', ' bar '], _.trim);
  21243. * // => ['foo', 'bar']
  21244. */
  21245. function trim(string, chars, guard) {
  21246. string = toString(string);
  21247. if (string && (guard || chars === undefined)) {
  21248. return string.replace(reTrim, '');
  21249. }
  21250. if (!string || !(chars = baseToString(chars))) {
  21251. return string;
  21252. }
  21253. var strSymbols = stringToArray(string),
  21254. chrSymbols = stringToArray(chars),
  21255. start = charsStartIndex(strSymbols, chrSymbols),
  21256. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  21257. return castSlice(strSymbols, start, end).join('');
  21258. }
  21259. /**
  21260. * Removes trailing whitespace or specified characters from `string`.
  21261. *
  21262. * @static
  21263. * @memberOf _
  21264. * @since 4.0.0
  21265. * @category String
  21266. * @param {string} [string=''] The string to trim.
  21267. * @param {string} [chars=whitespace] The characters to trim.
  21268. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  21269. * @returns {string} Returns the trimmed string.
  21270. * @example
  21271. *
  21272. * _.trimEnd(' abc ');
  21273. * // => ' abc'
  21274. *
  21275. * _.trimEnd('-_-abc-_-', '_-');
  21276. * // => '-_-abc'
  21277. */
  21278. function trimEnd(string, chars, guard) {
  21279. string = toString(string);
  21280. if (string && (guard || chars === undefined)) {
  21281. return string.replace(reTrimEnd, '');
  21282. }
  21283. if (!string || !(chars = baseToString(chars))) {
  21284. return string;
  21285. }
  21286. var strSymbols = stringToArray(string),
  21287. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  21288. return castSlice(strSymbols, 0, end).join('');
  21289. }
  21290. /**
  21291. * Removes leading whitespace or specified characters from `string`.
  21292. *
  21293. * @static
  21294. * @memberOf _
  21295. * @since 4.0.0
  21296. * @category String
  21297. * @param {string} [string=''] The string to trim.
  21298. * @param {string} [chars=whitespace] The characters to trim.
  21299. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  21300. * @returns {string} Returns the trimmed string.
  21301. * @example
  21302. *
  21303. * _.trimStart(' abc ');
  21304. * // => 'abc '
  21305. *
  21306. * _.trimStart('-_-abc-_-', '_-');
  21307. * // => 'abc-_-'
  21308. */
  21309. function trimStart(string, chars, guard) {
  21310. string = toString(string);
  21311. if (string && (guard || chars === undefined)) {
  21312. return string.replace(reTrimStart, '');
  21313. }
  21314. if (!string || !(chars = baseToString(chars))) {
  21315. return string;
  21316. }
  21317. var strSymbols = stringToArray(string),
  21318. start = charsStartIndex(strSymbols, stringToArray(chars));
  21319. return castSlice(strSymbols, start).join('');
  21320. }
  21321. /**
  21322. * Truncates `string` if it's longer than the given maximum string length.
  21323. * The last characters of the truncated string are replaced with the omission
  21324. * string which defaults to "...".
  21325. *
  21326. * @static
  21327. * @memberOf _
  21328. * @since 4.0.0
  21329. * @category String
  21330. * @param {string} [string=''] The string to truncate.
  21331. * @param {Object} [options={}] The options object.
  21332. * @param {number} [options.length=30] The maximum string length.
  21333. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  21334. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  21335. * @returns {string} Returns the truncated string.
  21336. * @example
  21337. *
  21338. * _.truncate('hi-diddly-ho there, neighborino');
  21339. * // => 'hi-diddly-ho there, neighbo...'
  21340. *
  21341. * _.truncate('hi-diddly-ho there, neighborino', {
  21342. * 'length': 24,
  21343. * 'separator': ' '
  21344. * });
  21345. * // => 'hi-diddly-ho there,...'
  21346. *
  21347. * _.truncate('hi-diddly-ho there, neighborino', {
  21348. * 'length': 24,
  21349. * 'separator': /,? +/
  21350. * });
  21351. * // => 'hi-diddly-ho there...'
  21352. *
  21353. * _.truncate('hi-diddly-ho there, neighborino', {
  21354. * 'omission': ' [...]'
  21355. * });
  21356. * // => 'hi-diddly-ho there, neig [...]'
  21357. */
  21358. function truncate(string, options) {
  21359. var length = DEFAULT_TRUNC_LENGTH,
  21360. omission = DEFAULT_TRUNC_OMISSION;
  21361. if (isObject(options)) {
  21362. var separator = 'separator' in options ? options.separator : separator;
  21363. length = 'length' in options ? toInteger(options.length) : length;
  21364. omission = 'omission' in options ? baseToString(options.omission) : omission;
  21365. }
  21366. string = toString(string);
  21367. var strLength = string.length;
  21368. if (hasUnicode(string)) {
  21369. var strSymbols = stringToArray(string);
  21370. strLength = strSymbols.length;
  21371. }
  21372. if (length >= strLength) {
  21373. return string;
  21374. }
  21375. var end = length - stringSize(omission);
  21376. if (end < 1) {
  21377. return omission;
  21378. }
  21379. var result = strSymbols
  21380. ? castSlice(strSymbols, 0, end).join('')
  21381. : string.slice(0, end);
  21382. if (separator === undefined) {
  21383. return result + omission;
  21384. }
  21385. if (strSymbols) {
  21386. end += (result.length - end);
  21387. }
  21388. if (isRegExp(separator)) {
  21389. if (string.slice(end).search(separator)) {
  21390. var match,
  21391. substring = result;
  21392. if (!separator.global) {
  21393. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  21394. }
  21395. separator.lastIndex = 0;
  21396. while ((match = separator.exec(substring))) {
  21397. var newEnd = match.index;
  21398. }
  21399. result = result.slice(0, newEnd === undefined ? end : newEnd);
  21400. }
  21401. } else if (string.indexOf(baseToString(separator), end) != end) {
  21402. var index = result.lastIndexOf(separator);
  21403. if (index > -1) {
  21404. result = result.slice(0, index);
  21405. }
  21406. }
  21407. return result + omission;
  21408. }
  21409. /**
  21410. * The inverse of `_.escape`; this method converts the HTML entities
  21411. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  21412. * their corresponding characters.
  21413. *
  21414. * **Note:** No other HTML entities are unescaped. To unescape additional
  21415. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  21416. *
  21417. * @static
  21418. * @memberOf _
  21419. * @since 0.6.0
  21420. * @category String
  21421. * @param {string} [string=''] The string to unescape.
  21422. * @returns {string} Returns the unescaped string.
  21423. * @example
  21424. *
  21425. * _.unescape('fred, barney, &amp; pebbles');
  21426. * // => 'fred, barney, & pebbles'
  21427. */
  21428. function unescape(string) {
  21429. string = toString(string);
  21430. return (string && reHasEscapedHtml.test(string))
  21431. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  21432. : string;
  21433. }
  21434. /**
  21435. * Converts `string`, as space separated words, to upper case.
  21436. *
  21437. * @static
  21438. * @memberOf _
  21439. * @since 4.0.0
  21440. * @category String
  21441. * @param {string} [string=''] The string to convert.
  21442. * @returns {string} Returns the upper cased string.
  21443. * @example
  21444. *
  21445. * _.upperCase('--foo-bar');
  21446. * // => 'FOO BAR'
  21447. *
  21448. * _.upperCase('fooBar');
  21449. * // => 'FOO BAR'
  21450. *
  21451. * _.upperCase('__foo_bar__');
  21452. * // => 'FOO BAR'
  21453. */
  21454. var upperCase = createCompounder(function(result, word, index) {
  21455. return result + (index ? ' ' : '') + word.toUpperCase();
  21456. });
  21457. /**
  21458. * Converts the first character of `string` to upper case.
  21459. *
  21460. * @static
  21461. * @memberOf _
  21462. * @since 4.0.0
  21463. * @category String
  21464. * @param {string} [string=''] The string to convert.
  21465. * @returns {string} Returns the converted string.
  21466. * @example
  21467. *
  21468. * _.upperFirst('fred');
  21469. * // => 'Fred'
  21470. *
  21471. * _.upperFirst('FRED');
  21472. * // => 'FRED'
  21473. */
  21474. var upperFirst = createCaseFirst('toUpperCase');
  21475. /**
  21476. * Splits `string` into an array of its words.
  21477. *
  21478. * @static
  21479. * @memberOf _
  21480. * @since 3.0.0
  21481. * @category String
  21482. * @param {string} [string=''] The string to inspect.
  21483. * @param {RegExp|string} [pattern] The pattern to match words.
  21484. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  21485. * @returns {Array} Returns the words of `string`.
  21486. * @example
  21487. *
  21488. * _.words('fred, barney, & pebbles');
  21489. * // => ['fred', 'barney', 'pebbles']
  21490. *
  21491. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  21492. * // => ['fred', 'barney', '&', 'pebbles']
  21493. */
  21494. function words(string, pattern, guard) {
  21495. string = toString(string);
  21496. pattern = guard ? undefined : pattern;
  21497. if (pattern === undefined) {
  21498. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  21499. }
  21500. return string.match(pattern) || [];
  21501. }
  21502. /*------------------------------------------------------------------------*/
  21503. /**
  21504. * Attempts to invoke `func`, returning either the result or the caught error
  21505. * object. Any additional arguments are provided to `func` when it's invoked.
  21506. *
  21507. * @static
  21508. * @memberOf _
  21509. * @since 3.0.0
  21510. * @category Util
  21511. * @param {Function} func The function to attempt.
  21512. * @param {...*} [args] The arguments to invoke `func` with.
  21513. * @returns {*} Returns the `func` result or error object.
  21514. * @example
  21515. *
  21516. * // Avoid throwing errors for invalid selectors.
  21517. * var elements = _.attempt(function(selector) {
  21518. * return document.querySelectorAll(selector);
  21519. * }, '>_>');
  21520. *
  21521. * if (_.isError(elements)) {
  21522. * elements = [];
  21523. * }
  21524. */
  21525. var attempt = baseRest(function(func, args) {
  21526. try {
  21527. return apply(func, undefined, args);
  21528. } catch (e) {
  21529. return isError(e) ? e : new Error(e);
  21530. }
  21531. });
  21532. /**
  21533. * Binds methods of an object to the object itself, overwriting the existing
  21534. * method.
  21535. *
  21536. * **Note:** This method doesn't set the "length" property of bound functions.
  21537. *
  21538. * @static
  21539. * @since 0.1.0
  21540. * @memberOf _
  21541. * @category Util
  21542. * @param {Object} object The object to bind and assign the bound methods to.
  21543. * @param {...(string|string[])} methodNames The object method names to bind.
  21544. * @returns {Object} Returns `object`.
  21545. * @example
  21546. *
  21547. * var view = {
  21548. * 'label': 'docs',
  21549. * 'click': function() {
  21550. * console.log('clicked ' + this.label);
  21551. * }
  21552. * };
  21553. *
  21554. * _.bindAll(view, ['click']);
  21555. * jQuery(element).on('click', view.click);
  21556. * // => Logs 'clicked docs' when clicked.
  21557. */
  21558. var bindAll = flatRest(function(object, methodNames) {
  21559. arrayEach(methodNames, function(key) {
  21560. key = toKey(key);
  21561. baseAssignValue(object, key, bind(object[key], object));
  21562. });
  21563. return object;
  21564. });
  21565. /**
  21566. * Creates a function that iterates over `pairs` and invokes the corresponding
  21567. * function of the first predicate to return truthy. The predicate-function
  21568. * pairs are invoked with the `this` binding and arguments of the created
  21569. * function.
  21570. *
  21571. * @static
  21572. * @memberOf _
  21573. * @since 4.0.0
  21574. * @category Util
  21575. * @param {Array} pairs The predicate-function pairs.
  21576. * @returns {Function} Returns the new composite function.
  21577. * @example
  21578. *
  21579. * var func = _.cond([
  21580. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  21581. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  21582. * [_.stubTrue, _.constant('no match')]
  21583. * ]);
  21584. *
  21585. * func({ 'a': 1, 'b': 2 });
  21586. * // => 'matches A'
  21587. *
  21588. * func({ 'a': 0, 'b': 1 });
  21589. * // => 'matches B'
  21590. *
  21591. * func({ 'a': '1', 'b': '2' });
  21592. * // => 'no match'
  21593. */
  21594. function cond(pairs) {
  21595. var length = pairs == null ? 0 : pairs.length,
  21596. toIteratee = getIteratee();
  21597. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  21598. if (typeof pair[1] != 'function') {
  21599. throw new TypeError(FUNC_ERROR_TEXT);
  21600. }
  21601. return [toIteratee(pair[0]), pair[1]];
  21602. });
  21603. return baseRest(function(args) {
  21604. var index = -1;
  21605. while (++index < length) {
  21606. var pair = pairs[index];
  21607. if (apply(pair[0], this, args)) {
  21608. return apply(pair[1], this, args);
  21609. }
  21610. }
  21611. });
  21612. }
  21613. /**
  21614. * Creates a function that invokes the predicate properties of `source` with
  21615. * the corresponding property values of a given object, returning `true` if
  21616. * all predicates return truthy, else `false`.
  21617. *
  21618. * **Note:** The created function is equivalent to `_.conformsTo` with
  21619. * `source` partially applied.
  21620. *
  21621. * @static
  21622. * @memberOf _
  21623. * @since 4.0.0
  21624. * @category Util
  21625. * @param {Object} source The object of property predicates to conform to.
  21626. * @returns {Function} Returns the new spec function.
  21627. * @example
  21628. *
  21629. * var objects = [
  21630. * { 'a': 2, 'b': 1 },
  21631. * { 'a': 1, 'b': 2 }
  21632. * ];
  21633. *
  21634. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  21635. * // => [{ 'a': 1, 'b': 2 }]
  21636. */
  21637. function conforms(source) {
  21638. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  21639. }
  21640. /**
  21641. * Creates a function that returns `value`.
  21642. *
  21643. * @static
  21644. * @memberOf _
  21645. * @since 2.4.0
  21646. * @category Util
  21647. * @param {*} value The value to return from the new function.
  21648. * @returns {Function} Returns the new constant function.
  21649. * @example
  21650. *
  21651. * var objects = _.times(2, _.constant({ 'a': 1 }));
  21652. *
  21653. * console.log(objects);
  21654. * // => [{ 'a': 1 }, { 'a': 1 }]
  21655. *
  21656. * console.log(objects[0] === objects[1]);
  21657. * // => true
  21658. */
  21659. function constant(value) {
  21660. return function() {
  21661. return value;
  21662. };
  21663. }
  21664. /**
  21665. * Checks `value` to determine whether a default value should be returned in
  21666. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  21667. * or `undefined`.
  21668. *
  21669. * @static
  21670. * @memberOf _
  21671. * @since 4.14.0
  21672. * @category Util
  21673. * @param {*} value The value to check.
  21674. * @param {*} defaultValue The default value.
  21675. * @returns {*} Returns the resolved value.
  21676. * @example
  21677. *
  21678. * _.defaultTo(1, 10);
  21679. * // => 1
  21680. *
  21681. * _.defaultTo(undefined, 10);
  21682. * // => 10
  21683. */
  21684. function defaultTo(value, defaultValue) {
  21685. return (value == null || value !== value) ? defaultValue : value;
  21686. }
  21687. /**
  21688. * Creates a function that returns the result of invoking the given functions
  21689. * with the `this` binding of the created function, where each successive
  21690. * invocation is supplied the return value of the previous.
  21691. *
  21692. * @static
  21693. * @memberOf _
  21694. * @since 3.0.0
  21695. * @category Util
  21696. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  21697. * @returns {Function} Returns the new composite function.
  21698. * @see _.flowRight
  21699. * @example
  21700. *
  21701. * function square(n) {
  21702. * return n * n;
  21703. * }
  21704. *
  21705. * var addSquare = _.flow([_.add, square]);
  21706. * addSquare(1, 2);
  21707. * // => 9
  21708. */
  21709. var flow = createFlow();
  21710. /**
  21711. * This method is like `_.flow` except that it creates a function that
  21712. * invokes the given functions from right to left.
  21713. *
  21714. * @static
  21715. * @since 3.0.0
  21716. * @memberOf _
  21717. * @category Util
  21718. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  21719. * @returns {Function} Returns the new composite function.
  21720. * @see _.flow
  21721. * @example
  21722. *
  21723. * function square(n) {
  21724. * return n * n;
  21725. * }
  21726. *
  21727. * var addSquare = _.flowRight([square, _.add]);
  21728. * addSquare(1, 2);
  21729. * // => 9
  21730. */
  21731. var flowRight = createFlow(true);
  21732. /**
  21733. * This method returns the first argument it receives.
  21734. *
  21735. * @static
  21736. * @since 0.1.0
  21737. * @memberOf _
  21738. * @category Util
  21739. * @param {*} value Any value.
  21740. * @returns {*} Returns `value`.
  21741. * @example
  21742. *
  21743. * var object = { 'a': 1 };
  21744. *
  21745. * console.log(_.identity(object) === object);
  21746. * // => true
  21747. */
  21748. function identity(value) {
  21749. return value;
  21750. }
  21751. /**
  21752. * Creates a function that invokes `func` with the arguments of the created
  21753. * function. If `func` is a property name, the created function returns the
  21754. * property value for a given element. If `func` is an array or object, the
  21755. * created function returns `true` for elements that contain the equivalent
  21756. * source properties, otherwise it returns `false`.
  21757. *
  21758. * @static
  21759. * @since 4.0.0
  21760. * @memberOf _
  21761. * @category Util
  21762. * @param {*} [func=_.identity] The value to convert to a callback.
  21763. * @returns {Function} Returns the callback.
  21764. * @example
  21765. *
  21766. * var users = [
  21767. * { 'user': 'barney', 'age': 36, 'active': true },
  21768. * { 'user': 'fred', 'age': 40, 'active': false }
  21769. * ];
  21770. *
  21771. * // The `_.matches` iteratee shorthand.
  21772. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  21773. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  21774. *
  21775. * // The `_.matchesProperty` iteratee shorthand.
  21776. * _.filter(users, _.iteratee(['user', 'fred']));
  21777. * // => [{ 'user': 'fred', 'age': 40 }]
  21778. *
  21779. * // The `_.property` iteratee shorthand.
  21780. * _.map(users, _.iteratee('user'));
  21781. * // => ['barney', 'fred']
  21782. *
  21783. * // Create custom iteratee shorthands.
  21784. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  21785. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  21786. * return func.test(string);
  21787. * };
  21788. * });
  21789. *
  21790. * _.filter(['abc', 'def'], /ef/);
  21791. * // => ['def']
  21792. */
  21793. function iteratee(func) {
  21794. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  21795. }
  21796. /**
  21797. * Creates a function that performs a partial deep comparison between a given
  21798. * object and `source`, returning `true` if the given object has equivalent
  21799. * property values, else `false`.
  21800. *
  21801. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  21802. * partially applied.
  21803. *
  21804. * Partial comparisons will match empty array and empty object `source`
  21805. * values against any array or object value, respectively. See `_.isEqual`
  21806. * for a list of supported value comparisons.
  21807. *
  21808. * @static
  21809. * @memberOf _
  21810. * @since 3.0.0
  21811. * @category Util
  21812. * @param {Object} source The object of property values to match.
  21813. * @returns {Function} Returns the new spec function.
  21814. * @example
  21815. *
  21816. * var objects = [
  21817. * { 'a': 1, 'b': 2, 'c': 3 },
  21818. * { 'a': 4, 'b': 5, 'c': 6 }
  21819. * ];
  21820. *
  21821. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  21822. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  21823. */
  21824. function matches(source) {
  21825. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  21826. }
  21827. /**
  21828. * Creates a function that performs a partial deep comparison between the
  21829. * value at `path` of a given object to `srcValue`, returning `true` if the
  21830. * object value is equivalent, else `false`.
  21831. *
  21832. * **Note:** Partial comparisons will match empty array and empty object
  21833. * `srcValue` values against any array or object value, respectively. See
  21834. * `_.isEqual` for a list of supported value comparisons.
  21835. *
  21836. * @static
  21837. * @memberOf _
  21838. * @since 3.2.0
  21839. * @category Util
  21840. * @param {Array|string} path The path of the property to get.
  21841. * @param {*} srcValue The value to match.
  21842. * @returns {Function} Returns the new spec function.
  21843. * @example
  21844. *
  21845. * var objects = [
  21846. * { 'a': 1, 'b': 2, 'c': 3 },
  21847. * { 'a': 4, 'b': 5, 'c': 6 }
  21848. * ];
  21849. *
  21850. * _.find(objects, _.matchesProperty('a', 4));
  21851. * // => { 'a': 4, 'b': 5, 'c': 6 }
  21852. */
  21853. function matchesProperty(path, srcValue) {
  21854. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  21855. }
  21856. /**
  21857. * Creates a function that invokes the method at `path` of a given object.
  21858. * Any additional arguments are provided to the invoked method.
  21859. *
  21860. * @static
  21861. * @memberOf _
  21862. * @since 3.7.0
  21863. * @category Util
  21864. * @param {Array|string} path The path of the method to invoke.
  21865. * @param {...*} [args] The arguments to invoke the method with.
  21866. * @returns {Function} Returns the new invoker function.
  21867. * @example
  21868. *
  21869. * var objects = [
  21870. * { 'a': { 'b': _.constant(2) } },
  21871. * { 'a': { 'b': _.constant(1) } }
  21872. * ];
  21873. *
  21874. * _.map(objects, _.method('a.b'));
  21875. * // => [2, 1]
  21876. *
  21877. * _.map(objects, _.method(['a', 'b']));
  21878. * // => [2, 1]
  21879. */
  21880. var method = baseRest(function(path, args) {
  21881. return function(object) {
  21882. return baseInvoke(object, path, args);
  21883. };
  21884. });
  21885. /**
  21886. * The opposite of `_.method`; this method creates a function that invokes
  21887. * the method at a given path of `object`. Any additional arguments are
  21888. * provided to the invoked method.
  21889. *
  21890. * @static
  21891. * @memberOf _
  21892. * @since 3.7.0
  21893. * @category Util
  21894. * @param {Object} object The object to query.
  21895. * @param {...*} [args] The arguments to invoke the method with.
  21896. * @returns {Function} Returns the new invoker function.
  21897. * @example
  21898. *
  21899. * var array = _.times(3, _.constant),
  21900. * object = { 'a': array, 'b': array, 'c': array };
  21901. *
  21902. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  21903. * // => [2, 0]
  21904. *
  21905. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  21906. * // => [2, 0]
  21907. */
  21908. var methodOf = baseRest(function(object, args) {
  21909. return function(path) {
  21910. return baseInvoke(object, path, args);
  21911. };
  21912. });
  21913. /**
  21914. * Adds all own enumerable string keyed function properties of a source
  21915. * object to the destination object. If `object` is a function, then methods
  21916. * are added to its prototype as well.
  21917. *
  21918. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  21919. * avoid conflicts caused by modifying the original.
  21920. *
  21921. * @static
  21922. * @since 0.1.0
  21923. * @memberOf _
  21924. * @category Util
  21925. * @param {Function|Object} [object=lodash] The destination object.
  21926. * @param {Object} source The object of functions to add.
  21927. * @param {Object} [options={}] The options object.
  21928. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  21929. * @returns {Function|Object} Returns `object`.
  21930. * @example
  21931. *
  21932. * function vowels(string) {
  21933. * return _.filter(string, function(v) {
  21934. * return /[aeiou]/i.test(v);
  21935. * });
  21936. * }
  21937. *
  21938. * _.mixin({ 'vowels': vowels });
  21939. * _.vowels('fred');
  21940. * // => ['e']
  21941. *
  21942. * _('fred').vowels().value();
  21943. * // => ['e']
  21944. *
  21945. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  21946. * _('fred').vowels();
  21947. * // => ['e']
  21948. */
  21949. function mixin(object, source, options) {
  21950. var props = keys(source),
  21951. methodNames = baseFunctions(source, props);
  21952. if (options == null &&
  21953. !(isObject(source) && (methodNames.length || !props.length))) {
  21954. options = source;
  21955. source = object;
  21956. object = this;
  21957. methodNames = baseFunctions(source, keys(source));
  21958. }
  21959. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  21960. isFunc = isFunction(object);
  21961. arrayEach(methodNames, function(methodName) {
  21962. var func = source[methodName];
  21963. object[methodName] = func;
  21964. if (isFunc) {
  21965. object.prototype[methodName] = function() {
  21966. var chainAll = this.__chain__;
  21967. if (chain || chainAll) {
  21968. var result = object(this.__wrapped__),
  21969. actions = result.__actions__ = copyArray(this.__actions__);
  21970. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  21971. result.__chain__ = chainAll;
  21972. return result;
  21973. }
  21974. return func.apply(object, arrayPush([this.value()], arguments));
  21975. };
  21976. }
  21977. });
  21978. return object;
  21979. }
  21980. /**
  21981. * Reverts the `_` variable to its previous value and returns a reference to
  21982. * the `lodash` function.
  21983. *
  21984. * @static
  21985. * @since 0.1.0
  21986. * @memberOf _
  21987. * @category Util
  21988. * @returns {Function} Returns the `lodash` function.
  21989. * @example
  21990. *
  21991. * var lodash = _.noConflict();
  21992. */
  21993. function noConflict() {
  21994. if (root._ === this) {
  21995. root._ = oldDash;
  21996. }
  21997. return this;
  21998. }
  21999. /**
  22000. * This method returns `undefined`.
  22001. *
  22002. * @static
  22003. * @memberOf _
  22004. * @since 2.3.0
  22005. * @category Util
  22006. * @example
  22007. *
  22008. * _.times(2, _.noop);
  22009. * // => [undefined, undefined]
  22010. */
  22011. function noop() {
  22012. // No operation performed.
  22013. }
  22014. /**
  22015. * Creates a function that gets the argument at index `n`. If `n` is negative,
  22016. * the nth argument from the end is returned.
  22017. *
  22018. * @static
  22019. * @memberOf _
  22020. * @since 4.0.0
  22021. * @category Util
  22022. * @param {number} [n=0] The index of the argument to return.
  22023. * @returns {Function} Returns the new pass-thru function.
  22024. * @example
  22025. *
  22026. * var func = _.nthArg(1);
  22027. * func('a', 'b', 'c', 'd');
  22028. * // => 'b'
  22029. *
  22030. * var func = _.nthArg(-2);
  22031. * func('a', 'b', 'c', 'd');
  22032. * // => 'c'
  22033. */
  22034. function nthArg(n) {
  22035. n = toInteger(n);
  22036. return baseRest(function(args) {
  22037. return baseNth(args, n);
  22038. });
  22039. }
  22040. /**
  22041. * Creates a function that invokes `iteratees` with the arguments it receives
  22042. * and returns their results.
  22043. *
  22044. * @static
  22045. * @memberOf _
  22046. * @since 4.0.0
  22047. * @category Util
  22048. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  22049. * The iteratees to invoke.
  22050. * @returns {Function} Returns the new function.
  22051. * @example
  22052. *
  22053. * var func = _.over([Math.max, Math.min]);
  22054. *
  22055. * func(1, 2, 3, 4);
  22056. * // => [4, 1]
  22057. */
  22058. var over = createOver(arrayMap);
  22059. /**
  22060. * Creates a function that checks if **all** of the `predicates` return
  22061. * truthy when invoked with the arguments it receives.
  22062. *
  22063. * @static
  22064. * @memberOf _
  22065. * @since 4.0.0
  22066. * @category Util
  22067. * @param {...(Function|Function[])} [predicates=[_.identity]]
  22068. * The predicates to check.
  22069. * @returns {Function} Returns the new function.
  22070. * @example
  22071. *
  22072. * var func = _.overEvery([Boolean, isFinite]);
  22073. *
  22074. * func('1');
  22075. * // => true
  22076. *
  22077. * func(null);
  22078. * // => false
  22079. *
  22080. * func(NaN);
  22081. * // => false
  22082. */
  22083. var overEvery = createOver(arrayEvery);
  22084. /**
  22085. * Creates a function that checks if **any** of the `predicates` return
  22086. * truthy when invoked with the arguments it receives.
  22087. *
  22088. * @static
  22089. * @memberOf _
  22090. * @since 4.0.0
  22091. * @category Util
  22092. * @param {...(Function|Function[])} [predicates=[_.identity]]
  22093. * The predicates to check.
  22094. * @returns {Function} Returns the new function.
  22095. * @example
  22096. *
  22097. * var func = _.overSome([Boolean, isFinite]);
  22098. *
  22099. * func('1');
  22100. * // => true
  22101. *
  22102. * func(null);
  22103. * // => true
  22104. *
  22105. * func(NaN);
  22106. * // => false
  22107. */
  22108. var overSome = createOver(arraySome);
  22109. /**
  22110. * Creates a function that returns the value at `path` of a given object.
  22111. *
  22112. * @static
  22113. * @memberOf _
  22114. * @since 2.4.0
  22115. * @category Util
  22116. * @param {Array|string} path The path of the property to get.
  22117. * @returns {Function} Returns the new accessor function.
  22118. * @example
  22119. *
  22120. * var objects = [
  22121. * { 'a': { 'b': 2 } },
  22122. * { 'a': { 'b': 1 } }
  22123. * ];
  22124. *
  22125. * _.map(objects, _.property('a.b'));
  22126. * // => [2, 1]
  22127. *
  22128. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  22129. * // => [1, 2]
  22130. */
  22131. function property(path) {
  22132. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  22133. }
  22134. /**
  22135. * The opposite of `_.property`; this method creates a function that returns
  22136. * the value at a given path of `object`.
  22137. *
  22138. * @static
  22139. * @memberOf _
  22140. * @since 3.0.0
  22141. * @category Util
  22142. * @param {Object} object The object to query.
  22143. * @returns {Function} Returns the new accessor function.
  22144. * @example
  22145. *
  22146. * var array = [0, 1, 2],
  22147. * object = { 'a': array, 'b': array, 'c': array };
  22148. *
  22149. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  22150. * // => [2, 0]
  22151. *
  22152. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  22153. * // => [2, 0]
  22154. */
  22155. function propertyOf(object) {
  22156. return function(path) {
  22157. return object == null ? undefined : baseGet(object, path);
  22158. };
  22159. }
  22160. /**
  22161. * Creates an array of numbers (positive and/or negative) progressing from
  22162. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  22163. * `start` is specified without an `end` or `step`. If `end` is not specified,
  22164. * it's set to `start` with `start` then set to `0`.
  22165. *
  22166. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  22167. * floating-point values which can produce unexpected results.
  22168. *
  22169. * @static
  22170. * @since 0.1.0
  22171. * @memberOf _
  22172. * @category Util
  22173. * @param {number} [start=0] The start of the range.
  22174. * @param {number} end The end of the range.
  22175. * @param {number} [step=1] The value to increment or decrement by.
  22176. * @returns {Array} Returns the range of numbers.
  22177. * @see _.inRange, _.rangeRight
  22178. * @example
  22179. *
  22180. * _.range(4);
  22181. * // => [0, 1, 2, 3]
  22182. *
  22183. * _.range(-4);
  22184. * // => [0, -1, -2, -3]
  22185. *
  22186. * _.range(1, 5);
  22187. * // => [1, 2, 3, 4]
  22188. *
  22189. * _.range(0, 20, 5);
  22190. * // => [0, 5, 10, 15]
  22191. *
  22192. * _.range(0, -4, -1);
  22193. * // => [0, -1, -2, -3]
  22194. *
  22195. * _.range(1, 4, 0);
  22196. * // => [1, 1, 1]
  22197. *
  22198. * _.range(0);
  22199. * // => []
  22200. */
  22201. var range = createRange();
  22202. /**
  22203. * This method is like `_.range` except that it populates values in
  22204. * descending order.
  22205. *
  22206. * @static
  22207. * @memberOf _
  22208. * @since 4.0.0
  22209. * @category Util
  22210. * @param {number} [start=0] The start of the range.
  22211. * @param {number} end The end of the range.
  22212. * @param {number} [step=1] The value to increment or decrement by.
  22213. * @returns {Array} Returns the range of numbers.
  22214. * @see _.inRange, _.range
  22215. * @example
  22216. *
  22217. * _.rangeRight(4);
  22218. * // => [3, 2, 1, 0]
  22219. *
  22220. * _.rangeRight(-4);
  22221. * // => [-3, -2, -1, 0]
  22222. *
  22223. * _.rangeRight(1, 5);
  22224. * // => [4, 3, 2, 1]
  22225. *
  22226. * _.rangeRight(0, 20, 5);
  22227. * // => [15, 10, 5, 0]
  22228. *
  22229. * _.rangeRight(0, -4, -1);
  22230. * // => [-3, -2, -1, 0]
  22231. *
  22232. * _.rangeRight(1, 4, 0);
  22233. * // => [1, 1, 1]
  22234. *
  22235. * _.rangeRight(0);
  22236. * // => []
  22237. */
  22238. var rangeRight = createRange(true);
  22239. /**
  22240. * This method returns a new empty array.
  22241. *
  22242. * @static
  22243. * @memberOf _
  22244. * @since 4.13.0
  22245. * @category Util
  22246. * @returns {Array} Returns the new empty array.
  22247. * @example
  22248. *
  22249. * var arrays = _.times(2, _.stubArray);
  22250. *
  22251. * console.log(arrays);
  22252. * // => [[], []]
  22253. *
  22254. * console.log(arrays[0] === arrays[1]);
  22255. * // => false
  22256. */
  22257. function stubArray() {
  22258. return [];
  22259. }
  22260. /**
  22261. * This method returns `false`.
  22262. *
  22263. * @static
  22264. * @memberOf _
  22265. * @since 4.13.0
  22266. * @category Util
  22267. * @returns {boolean} Returns `false`.
  22268. * @example
  22269. *
  22270. * _.times(2, _.stubFalse);
  22271. * // => [false, false]
  22272. */
  22273. function stubFalse() {
  22274. return false;
  22275. }
  22276. /**
  22277. * This method returns a new empty object.
  22278. *
  22279. * @static
  22280. * @memberOf _
  22281. * @since 4.13.0
  22282. * @category Util
  22283. * @returns {Object} Returns the new empty object.
  22284. * @example
  22285. *
  22286. * var objects = _.times(2, _.stubObject);
  22287. *
  22288. * console.log(objects);
  22289. * // => [{}, {}]
  22290. *
  22291. * console.log(objects[0] === objects[1]);
  22292. * // => false
  22293. */
  22294. function stubObject() {
  22295. return {};
  22296. }
  22297. /**
  22298. * This method returns an empty string.
  22299. *
  22300. * @static
  22301. * @memberOf _
  22302. * @since 4.13.0
  22303. * @category Util
  22304. * @returns {string} Returns the empty string.
  22305. * @example
  22306. *
  22307. * _.times(2, _.stubString);
  22308. * // => ['', '']
  22309. */
  22310. function stubString() {
  22311. return '';
  22312. }
  22313. /**
  22314. * This method returns `true`.
  22315. *
  22316. * @static
  22317. * @memberOf _
  22318. * @since 4.13.0
  22319. * @category Util
  22320. * @returns {boolean} Returns `true`.
  22321. * @example
  22322. *
  22323. * _.times(2, _.stubTrue);
  22324. * // => [true, true]
  22325. */
  22326. function stubTrue() {
  22327. return true;
  22328. }
  22329. /**
  22330. * Invokes the iteratee `n` times, returning an array of the results of
  22331. * each invocation. The iteratee is invoked with one argument; (index).
  22332. *
  22333. * @static
  22334. * @since 0.1.0
  22335. * @memberOf _
  22336. * @category Util
  22337. * @param {number} n The number of times to invoke `iteratee`.
  22338. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  22339. * @returns {Array} Returns the array of results.
  22340. * @example
  22341. *
  22342. * _.times(3, String);
  22343. * // => ['0', '1', '2']
  22344. *
  22345. * _.times(4, _.constant(0));
  22346. * // => [0, 0, 0, 0]
  22347. */
  22348. function times(n, iteratee) {
  22349. n = toInteger(n);
  22350. if (n < 1 || n > MAX_SAFE_INTEGER) {
  22351. return [];
  22352. }
  22353. var index = MAX_ARRAY_LENGTH,
  22354. length = nativeMin(n, MAX_ARRAY_LENGTH);
  22355. iteratee = getIteratee(iteratee);
  22356. n -= MAX_ARRAY_LENGTH;
  22357. var result = baseTimes(length, iteratee);
  22358. while (++index < n) {
  22359. iteratee(index);
  22360. }
  22361. return result;
  22362. }
  22363. /**
  22364. * Converts `value` to a property path array.
  22365. *
  22366. * @static
  22367. * @memberOf _
  22368. * @since 4.0.0
  22369. * @category Util
  22370. * @param {*} value The value to convert.
  22371. * @returns {Array} Returns the new property path array.
  22372. * @example
  22373. *
  22374. * _.toPath('a.b.c');
  22375. * // => ['a', 'b', 'c']
  22376. *
  22377. * _.toPath('a[0].b.c');
  22378. * // => ['a', '0', 'b', 'c']
  22379. */
  22380. function toPath(value) {
  22381. if (isArray(value)) {
  22382. return arrayMap(value, toKey);
  22383. }
  22384. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  22385. }
  22386. /**
  22387. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  22388. *
  22389. * @static
  22390. * @since 0.1.0
  22391. * @memberOf _
  22392. * @category Util
  22393. * @param {string} [prefix=''] The value to prefix the ID with.
  22394. * @returns {string} Returns the unique ID.
  22395. * @example
  22396. *
  22397. * _.uniqueId('contact_');
  22398. * // => 'contact_104'
  22399. *
  22400. * _.uniqueId();
  22401. * // => '105'
  22402. */
  22403. function uniqueId(prefix) {
  22404. var id = ++idCounter;
  22405. return toString(prefix) + id;
  22406. }
  22407. /*------------------------------------------------------------------------*/
  22408. /**
  22409. * Adds two numbers.
  22410. *
  22411. * @static
  22412. * @memberOf _
  22413. * @since 3.4.0
  22414. * @category Math
  22415. * @param {number} augend The first number in an addition.
  22416. * @param {number} addend The second number in an addition.
  22417. * @returns {number} Returns the total.
  22418. * @example
  22419. *
  22420. * _.add(6, 4);
  22421. * // => 10
  22422. */
  22423. var add = createMathOperation(function(augend, addend) {
  22424. return augend + addend;
  22425. }, 0);
  22426. /**
  22427. * Computes `number` rounded up to `precision`.
  22428. *
  22429. * @static
  22430. * @memberOf _
  22431. * @since 3.10.0
  22432. * @category Math
  22433. * @param {number} number The number to round up.
  22434. * @param {number} [precision=0] The precision to round up to.
  22435. * @returns {number} Returns the rounded up number.
  22436. * @example
  22437. *
  22438. * _.ceil(4.006);
  22439. * // => 5
  22440. *
  22441. * _.ceil(6.004, 2);
  22442. * // => 6.01
  22443. *
  22444. * _.ceil(6040, -2);
  22445. * // => 6100
  22446. */
  22447. var ceil = createRound('ceil');
  22448. /**
  22449. * Divide two numbers.
  22450. *
  22451. * @static
  22452. * @memberOf _
  22453. * @since 4.7.0
  22454. * @category Math
  22455. * @param {number} dividend The first number in a division.
  22456. * @param {number} divisor The second number in a division.
  22457. * @returns {number} Returns the quotient.
  22458. * @example
  22459. *
  22460. * _.divide(6, 4);
  22461. * // => 1.5
  22462. */
  22463. var divide = createMathOperation(function(dividend, divisor) {
  22464. return dividend / divisor;
  22465. }, 1);
  22466. /**
  22467. * Computes `number` rounded down to `precision`.
  22468. *
  22469. * @static
  22470. * @memberOf _
  22471. * @since 3.10.0
  22472. * @category Math
  22473. * @param {number} number The number to round down.
  22474. * @param {number} [precision=0] The precision to round down to.
  22475. * @returns {number} Returns the rounded down number.
  22476. * @example
  22477. *
  22478. * _.floor(4.006);
  22479. * // => 4
  22480. *
  22481. * _.floor(0.046, 2);
  22482. * // => 0.04
  22483. *
  22484. * _.floor(4060, -2);
  22485. * // => 4000
  22486. */
  22487. var floor = createRound('floor');
  22488. /**
  22489. * Computes the maximum value of `array`. If `array` is empty or falsey,
  22490. * `undefined` is returned.
  22491. *
  22492. * @static
  22493. * @since 0.1.0
  22494. * @memberOf _
  22495. * @category Math
  22496. * @param {Array} array The array to iterate over.
  22497. * @returns {*} Returns the maximum value.
  22498. * @example
  22499. *
  22500. * _.max([4, 2, 8, 6]);
  22501. * // => 8
  22502. *
  22503. * _.max([]);
  22504. * // => undefined
  22505. */
  22506. function max(array) {
  22507. return (array && array.length)
  22508. ? baseExtremum(array, identity, baseGt)
  22509. : undefined;
  22510. }
  22511. /**
  22512. * This method is like `_.max` except that it accepts `iteratee` which is
  22513. * invoked for each element in `array` to generate the criterion by which
  22514. * the value is ranked. The iteratee is invoked with one argument: (value).
  22515. *
  22516. * @static
  22517. * @memberOf _
  22518. * @since 4.0.0
  22519. * @category Math
  22520. * @param {Array} array The array to iterate over.
  22521. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  22522. * @returns {*} Returns the maximum value.
  22523. * @example
  22524. *
  22525. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  22526. *
  22527. * _.maxBy(objects, function(o) { return o.n; });
  22528. * // => { 'n': 2 }
  22529. *
  22530. * // The `_.property` iteratee shorthand.
  22531. * _.maxBy(objects, 'n');
  22532. * // => { 'n': 2 }
  22533. */
  22534. function maxBy(array, iteratee) {
  22535. return (array && array.length)
  22536. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  22537. : undefined;
  22538. }
  22539. /**
  22540. * Computes the mean of the values in `array`.
  22541. *
  22542. * @static
  22543. * @memberOf _
  22544. * @since 4.0.0
  22545. * @category Math
  22546. * @param {Array} array The array to iterate over.
  22547. * @returns {number} Returns the mean.
  22548. * @example
  22549. *
  22550. * _.mean([4, 2, 8, 6]);
  22551. * // => 5
  22552. */
  22553. function mean(array) {
  22554. return baseMean(array, identity);
  22555. }
  22556. /**
  22557. * This method is like `_.mean` except that it accepts `iteratee` which is
  22558. * invoked for each element in `array` to generate the value to be averaged.
  22559. * The iteratee is invoked with one argument: (value).
  22560. *
  22561. * @static
  22562. * @memberOf _
  22563. * @since 4.7.0
  22564. * @category Math
  22565. * @param {Array} array The array to iterate over.
  22566. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  22567. * @returns {number} Returns the mean.
  22568. * @example
  22569. *
  22570. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  22571. *
  22572. * _.meanBy(objects, function(o) { return o.n; });
  22573. * // => 5
  22574. *
  22575. * // The `_.property` iteratee shorthand.
  22576. * _.meanBy(objects, 'n');
  22577. * // => 5
  22578. */
  22579. function meanBy(array, iteratee) {
  22580. return baseMean(array, getIteratee(iteratee, 2));
  22581. }
  22582. /**
  22583. * Computes the minimum value of `array`. If `array` is empty or falsey,
  22584. * `undefined` is returned.
  22585. *
  22586. * @static
  22587. * @since 0.1.0
  22588. * @memberOf _
  22589. * @category Math
  22590. * @param {Array} array The array to iterate over.
  22591. * @returns {*} Returns the minimum value.
  22592. * @example
  22593. *
  22594. * _.min([4, 2, 8, 6]);
  22595. * // => 2
  22596. *
  22597. * _.min([]);
  22598. * // => undefined
  22599. */
  22600. function min(array) {
  22601. return (array && array.length)
  22602. ? baseExtremum(array, identity, baseLt)
  22603. : undefined;
  22604. }
  22605. /**
  22606. * This method is like `_.min` except that it accepts `iteratee` which is
  22607. * invoked for each element in `array` to generate the criterion by which
  22608. * the value is ranked. The iteratee is invoked with one argument: (value).
  22609. *
  22610. * @static
  22611. * @memberOf _
  22612. * @since 4.0.0
  22613. * @category Math
  22614. * @param {Array} array The array to iterate over.
  22615. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  22616. * @returns {*} Returns the minimum value.
  22617. * @example
  22618. *
  22619. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  22620. *
  22621. * _.minBy(objects, function(o) { return o.n; });
  22622. * // => { 'n': 1 }
  22623. *
  22624. * // The `_.property` iteratee shorthand.
  22625. * _.minBy(objects, 'n');
  22626. * // => { 'n': 1 }
  22627. */
  22628. function minBy(array, iteratee) {
  22629. return (array && array.length)
  22630. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  22631. : undefined;
  22632. }
  22633. /**
  22634. * Multiply two numbers.
  22635. *
  22636. * @static
  22637. * @memberOf _
  22638. * @since 4.7.0
  22639. * @category Math
  22640. * @param {number} multiplier The first number in a multiplication.
  22641. * @param {number} multiplicand The second number in a multiplication.
  22642. * @returns {number} Returns the product.
  22643. * @example
  22644. *
  22645. * _.multiply(6, 4);
  22646. * // => 24
  22647. */
  22648. var multiply = createMathOperation(function(multiplier, multiplicand) {
  22649. return multiplier * multiplicand;
  22650. }, 1);
  22651. /**
  22652. * Computes `number` rounded to `precision`.
  22653. *
  22654. * @static
  22655. * @memberOf _
  22656. * @since 3.10.0
  22657. * @category Math
  22658. * @param {number} number The number to round.
  22659. * @param {number} [precision=0] The precision to round to.
  22660. * @returns {number} Returns the rounded number.
  22661. * @example
  22662. *
  22663. * _.round(4.006);
  22664. * // => 4
  22665. *
  22666. * _.round(4.006, 2);
  22667. * // => 4.01
  22668. *
  22669. * _.round(4060, -2);
  22670. * // => 4100
  22671. */
  22672. var round = createRound('round');
  22673. /**
  22674. * Subtract two numbers.
  22675. *
  22676. * @static
  22677. * @memberOf _
  22678. * @since 4.0.0
  22679. * @category Math
  22680. * @param {number} minuend The first number in a subtraction.
  22681. * @param {number} subtrahend The second number in a subtraction.
  22682. * @returns {number} Returns the difference.
  22683. * @example
  22684. *
  22685. * _.subtract(6, 4);
  22686. * // => 2
  22687. */
  22688. var subtract = createMathOperation(function(minuend, subtrahend) {
  22689. return minuend - subtrahend;
  22690. }, 0);
  22691. /**
  22692. * Computes the sum of the values in `array`.
  22693. *
  22694. * @static
  22695. * @memberOf _
  22696. * @since 3.4.0
  22697. * @category Math
  22698. * @param {Array} array The array to iterate over.
  22699. * @returns {number} Returns the sum.
  22700. * @example
  22701. *
  22702. * _.sum([4, 2, 8, 6]);
  22703. * // => 20
  22704. */
  22705. function sum(array) {
  22706. return (array && array.length)
  22707. ? baseSum(array, identity)
  22708. : 0;
  22709. }
  22710. /**
  22711. * This method is like `_.sum` except that it accepts `iteratee` which is
  22712. * invoked for each element in `array` to generate the value to be summed.
  22713. * The iteratee is invoked with one argument: (value).
  22714. *
  22715. * @static
  22716. * @memberOf _
  22717. * @since 4.0.0
  22718. * @category Math
  22719. * @param {Array} array The array to iterate over.
  22720. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  22721. * @returns {number} Returns the sum.
  22722. * @example
  22723. *
  22724. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  22725. *
  22726. * _.sumBy(objects, function(o) { return o.n; });
  22727. * // => 20
  22728. *
  22729. * // The `_.property` iteratee shorthand.
  22730. * _.sumBy(objects, 'n');
  22731. * // => 20
  22732. */
  22733. function sumBy(array, iteratee) {
  22734. return (array && array.length)
  22735. ? baseSum(array, getIteratee(iteratee, 2))
  22736. : 0;
  22737. }
  22738. /*------------------------------------------------------------------------*/
  22739. // Add methods that return wrapped values in chain sequences.
  22740. lodash.after = after;
  22741. lodash.ary = ary;
  22742. lodash.assign = assign;
  22743. lodash.assignIn = assignIn;
  22744. lodash.assignInWith = assignInWith;
  22745. lodash.assignWith = assignWith;
  22746. lodash.at = at;
  22747. lodash.before = before;
  22748. lodash.bind = bind;
  22749. lodash.bindAll = bindAll;
  22750. lodash.bindKey = bindKey;
  22751. lodash.castArray = castArray;
  22752. lodash.chain = chain;
  22753. lodash.chunk = chunk;
  22754. lodash.compact = compact;
  22755. lodash.concat = concat;
  22756. lodash.cond = cond;
  22757. lodash.conforms = conforms;
  22758. lodash.constant = constant;
  22759. lodash.countBy = countBy;
  22760. lodash.create = create;
  22761. lodash.curry = curry;
  22762. lodash.curryRight = curryRight;
  22763. lodash.debounce = debounce;
  22764. lodash.defaults = defaults;
  22765. lodash.defaultsDeep = defaultsDeep;
  22766. lodash.defer = defer;
  22767. lodash.delay = delay;
  22768. lodash.difference = difference;
  22769. lodash.differenceBy = differenceBy;
  22770. lodash.differenceWith = differenceWith;
  22771. lodash.drop = drop;
  22772. lodash.dropRight = dropRight;
  22773. lodash.dropRightWhile = dropRightWhile;
  22774. lodash.dropWhile = dropWhile;
  22775. lodash.fill = fill;
  22776. lodash.filter = filter;
  22777. lodash.flatMap = flatMap;
  22778. lodash.flatMapDeep = flatMapDeep;
  22779. lodash.flatMapDepth = flatMapDepth;
  22780. lodash.flatten = flatten;
  22781. lodash.flattenDeep = flattenDeep;
  22782. lodash.flattenDepth = flattenDepth;
  22783. lodash.flip = flip;
  22784. lodash.flow = flow;
  22785. lodash.flowRight = flowRight;
  22786. lodash.fromPairs = fromPairs;
  22787. lodash.functions = functions;
  22788. lodash.functionsIn = functionsIn;
  22789. lodash.groupBy = groupBy;
  22790. lodash.initial = initial;
  22791. lodash.intersection = intersection;
  22792. lodash.intersectionBy = intersectionBy;
  22793. lodash.intersectionWith = intersectionWith;
  22794. lodash.invert = invert;
  22795. lodash.invertBy = invertBy;
  22796. lodash.invokeMap = invokeMap;
  22797. lodash.iteratee = iteratee;
  22798. lodash.keyBy = keyBy;
  22799. lodash.keys = keys;
  22800. lodash.keysIn = keysIn;
  22801. lodash.map = map;
  22802. lodash.mapKeys = mapKeys;
  22803. lodash.mapValues = mapValues;
  22804. lodash.matches = matches;
  22805. lodash.matchesProperty = matchesProperty;
  22806. lodash.memoize = memoize;
  22807. lodash.merge = merge;
  22808. lodash.mergeWith = mergeWith;
  22809. lodash.method = method;
  22810. lodash.methodOf = methodOf;
  22811. lodash.mixin = mixin;
  22812. lodash.negate = negate;
  22813. lodash.nthArg = nthArg;
  22814. lodash.omit = omit;
  22815. lodash.omitBy = omitBy;
  22816. lodash.once = once;
  22817. lodash.orderBy = orderBy;
  22818. lodash.over = over;
  22819. lodash.overArgs = overArgs;
  22820. lodash.overEvery = overEvery;
  22821. lodash.overSome = overSome;
  22822. lodash.partial = partial;
  22823. lodash.partialRight = partialRight;
  22824. lodash.partition = partition;
  22825. lodash.pick = pick;
  22826. lodash.pickBy = pickBy;
  22827. lodash.property = property;
  22828. lodash.propertyOf = propertyOf;
  22829. lodash.pull = pull;
  22830. lodash.pullAll = pullAll;
  22831. lodash.pullAllBy = pullAllBy;
  22832. lodash.pullAllWith = pullAllWith;
  22833. lodash.pullAt = pullAt;
  22834. lodash.range = range;
  22835. lodash.rangeRight = rangeRight;
  22836. lodash.rearg = rearg;
  22837. lodash.reject = reject;
  22838. lodash.remove = remove;
  22839. lodash.rest = rest;
  22840. lodash.reverse = reverse;
  22841. lodash.sampleSize = sampleSize;
  22842. lodash.set = set;
  22843. lodash.setWith = setWith;
  22844. lodash.shuffle = shuffle;
  22845. lodash.slice = slice;
  22846. lodash.sortBy = sortBy;
  22847. lodash.sortedUniq = sortedUniq;
  22848. lodash.sortedUniqBy = sortedUniqBy;
  22849. lodash.split = split;
  22850. lodash.spread = spread;
  22851. lodash.tail = tail;
  22852. lodash.take = take;
  22853. lodash.takeRight = takeRight;
  22854. lodash.takeRightWhile = takeRightWhile;
  22855. lodash.takeWhile = takeWhile;
  22856. lodash.tap = tap;
  22857. lodash.throttle = throttle;
  22858. lodash.thru = thru;
  22859. lodash.toArray = toArray;
  22860. lodash.toPairs = toPairs;
  22861. lodash.toPairsIn = toPairsIn;
  22862. lodash.toPath = toPath;
  22863. lodash.toPlainObject = toPlainObject;
  22864. lodash.transform = transform;
  22865. lodash.unary = unary;
  22866. lodash.union = union;
  22867. lodash.unionBy = unionBy;
  22868. lodash.unionWith = unionWith;
  22869. lodash.uniq = uniq;
  22870. lodash.uniqBy = uniqBy;
  22871. lodash.uniqWith = uniqWith;
  22872. lodash.unset = unset;
  22873. lodash.unzip = unzip;
  22874. lodash.unzipWith = unzipWith;
  22875. lodash.update = update;
  22876. lodash.updateWith = updateWith;
  22877. lodash.values = values;
  22878. lodash.valuesIn = valuesIn;
  22879. lodash.without = without;
  22880. lodash.words = words;
  22881. lodash.wrap = wrap;
  22882. lodash.xor = xor;
  22883. lodash.xorBy = xorBy;
  22884. lodash.xorWith = xorWith;
  22885. lodash.zip = zip;
  22886. lodash.zipObject = zipObject;
  22887. lodash.zipObjectDeep = zipObjectDeep;
  22888. lodash.zipWith = zipWith;
  22889. // Add aliases.
  22890. lodash.entries = toPairs;
  22891. lodash.entriesIn = toPairsIn;
  22892. lodash.extend = assignIn;
  22893. lodash.extendWith = assignInWith;
  22894. // Add methods to `lodash.prototype`.
  22895. mixin(lodash, lodash);
  22896. /*------------------------------------------------------------------------*/
  22897. // Add methods that return unwrapped values in chain sequences.
  22898. lodash.add = add;
  22899. lodash.attempt = attempt;
  22900. lodash.camelCase = camelCase;
  22901. lodash.capitalize = capitalize;
  22902. lodash.ceil = ceil;
  22903. lodash.clamp = clamp;
  22904. lodash.clone = clone;
  22905. lodash.cloneDeep = cloneDeep;
  22906. lodash.cloneDeepWith = cloneDeepWith;
  22907. lodash.cloneWith = cloneWith;
  22908. lodash.conformsTo = conformsTo;
  22909. lodash.deburr = deburr;
  22910. lodash.defaultTo = defaultTo;
  22911. lodash.divide = divide;
  22912. lodash.endsWith = endsWith;
  22913. lodash.eq = eq;
  22914. lodash.escape = escape;
  22915. lodash.escapeRegExp = escapeRegExp;
  22916. lodash.every = every;
  22917. lodash.find = find;
  22918. lodash.findIndex = findIndex;
  22919. lodash.findKey = findKey;
  22920. lodash.findLast = findLast;
  22921. lodash.findLastIndex = findLastIndex;
  22922. lodash.findLastKey = findLastKey;
  22923. lodash.floor = floor;
  22924. lodash.forEach = forEach;
  22925. lodash.forEachRight = forEachRight;
  22926. lodash.forIn = forIn;
  22927. lodash.forInRight = forInRight;
  22928. lodash.forOwn = forOwn;
  22929. lodash.forOwnRight = forOwnRight;
  22930. lodash.get = get;
  22931. lodash.gt = gt;
  22932. lodash.gte = gte;
  22933. lodash.has = has;
  22934. lodash.hasIn = hasIn;
  22935. lodash.head = head;
  22936. lodash.identity = identity;
  22937. lodash.includes = includes;
  22938. lodash.indexOf = indexOf;
  22939. lodash.inRange = inRange;
  22940. lodash.invoke = invoke;
  22941. lodash.isArguments = isArguments;
  22942. lodash.isArray = isArray;
  22943. lodash.isArrayBuffer = isArrayBuffer;
  22944. lodash.isArrayLike = isArrayLike;
  22945. lodash.isArrayLikeObject = isArrayLikeObject;
  22946. lodash.isBoolean = isBoolean;
  22947. lodash.isBuffer = isBuffer;
  22948. lodash.isDate = isDate;
  22949. lodash.isElement = isElement;
  22950. lodash.isEmpty = isEmpty;
  22951. lodash.isEqual = isEqual;
  22952. lodash.isEqualWith = isEqualWith;
  22953. lodash.isError = isError;
  22954. lodash.isFinite = isFinite;
  22955. lodash.isFunction = isFunction;
  22956. lodash.isInteger = isInteger;
  22957. lodash.isLength = isLength;
  22958. lodash.isMap = isMap;
  22959. lodash.isMatch = isMatch;
  22960. lodash.isMatchWith = isMatchWith;
  22961. lodash.isNaN = isNaN;
  22962. lodash.isNative = isNative;
  22963. lodash.isNil = isNil;
  22964. lodash.isNull = isNull;
  22965. lodash.isNumber = isNumber;
  22966. lodash.isObject = isObject;
  22967. lodash.isObjectLike = isObjectLike;
  22968. lodash.isPlainObject = isPlainObject;
  22969. lodash.isRegExp = isRegExp;
  22970. lodash.isSafeInteger = isSafeInteger;
  22971. lodash.isSet = isSet;
  22972. lodash.isString = isString;
  22973. lodash.isSymbol = isSymbol;
  22974. lodash.isTypedArray = isTypedArray;
  22975. lodash.isUndefined = isUndefined;
  22976. lodash.isWeakMap = isWeakMap;
  22977. lodash.isWeakSet = isWeakSet;
  22978. lodash.join = join;
  22979. lodash.kebabCase = kebabCase;
  22980. lodash.last = last;
  22981. lodash.lastIndexOf = lastIndexOf;
  22982. lodash.lowerCase = lowerCase;
  22983. lodash.lowerFirst = lowerFirst;
  22984. lodash.lt = lt;
  22985. lodash.lte = lte;
  22986. lodash.max = max;
  22987. lodash.maxBy = maxBy;
  22988. lodash.mean = mean;
  22989. lodash.meanBy = meanBy;
  22990. lodash.min = min;
  22991. lodash.minBy = minBy;
  22992. lodash.stubArray = stubArray;
  22993. lodash.stubFalse = stubFalse;
  22994. lodash.stubObject = stubObject;
  22995. lodash.stubString = stubString;
  22996. lodash.stubTrue = stubTrue;
  22997. lodash.multiply = multiply;
  22998. lodash.nth = nth;
  22999. lodash.noConflict = noConflict;
  23000. lodash.noop = noop;
  23001. lodash.now = now;
  23002. lodash.pad = pad;
  23003. lodash.padEnd = padEnd;
  23004. lodash.padStart = padStart;
  23005. lodash.parseInt = parseInt;
  23006. lodash.random = random;
  23007. lodash.reduce = reduce;
  23008. lodash.reduceRight = reduceRight;
  23009. lodash.repeat = repeat;
  23010. lodash.replace = replace;
  23011. lodash.result = result;
  23012. lodash.round = round;
  23013. lodash.runInContext = runInContext;
  23014. lodash.sample = sample;
  23015. lodash.size = size;
  23016. lodash.snakeCase = snakeCase;
  23017. lodash.some = some;
  23018. lodash.sortedIndex = sortedIndex;
  23019. lodash.sortedIndexBy = sortedIndexBy;
  23020. lodash.sortedIndexOf = sortedIndexOf;
  23021. lodash.sortedLastIndex = sortedLastIndex;
  23022. lodash.sortedLastIndexBy = sortedLastIndexBy;
  23023. lodash.sortedLastIndexOf = sortedLastIndexOf;
  23024. lodash.startCase = startCase;
  23025. lodash.startsWith = startsWith;
  23026. lodash.subtract = subtract;
  23027. lodash.sum = sum;
  23028. lodash.sumBy = sumBy;
  23029. lodash.template = template;
  23030. lodash.times = times;
  23031. lodash.toFinite = toFinite;
  23032. lodash.toInteger = toInteger;
  23033. lodash.toLength = toLength;
  23034. lodash.toLower = toLower;
  23035. lodash.toNumber = toNumber;
  23036. lodash.toSafeInteger = toSafeInteger;
  23037. lodash.toString = toString;
  23038. lodash.toUpper = toUpper;
  23039. lodash.trim = trim;
  23040. lodash.trimEnd = trimEnd;
  23041. lodash.trimStart = trimStart;
  23042. lodash.truncate = truncate;
  23043. lodash.unescape = unescape;
  23044. lodash.uniqueId = uniqueId;
  23045. lodash.upperCase = upperCase;
  23046. lodash.upperFirst = upperFirst;
  23047. // Add aliases.
  23048. lodash.each = forEach;
  23049. lodash.eachRight = forEachRight;
  23050. lodash.first = head;
  23051. mixin(lodash, (function() {
  23052. var source = {};
  23053. baseForOwn(lodash, function(func, methodName) {
  23054. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  23055. source[methodName] = func;
  23056. }
  23057. });
  23058. return source;
  23059. }()), { 'chain': false });
  23060. /*------------------------------------------------------------------------*/
  23061. /**
  23062. * The semantic version number.
  23063. *
  23064. * @static
  23065. * @memberOf _
  23066. * @type {string}
  23067. */
  23068. lodash.VERSION = VERSION;
  23069. // Assign default placeholders.
  23070. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  23071. lodash[methodName].placeholder = lodash;
  23072. });
  23073. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  23074. arrayEach(['drop', 'take'], function(methodName, index) {
  23075. LazyWrapper.prototype[methodName] = function(n) {
  23076. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  23077. var result = (this.__filtered__ && !index)
  23078. ? new LazyWrapper(this)
  23079. : this.clone();
  23080. if (result.__filtered__) {
  23081. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  23082. } else {
  23083. result.__views__.push({
  23084. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  23085. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  23086. });
  23087. }
  23088. return result;
  23089. };
  23090. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  23091. return this.reverse()[methodName](n).reverse();
  23092. };
  23093. });
  23094. // Add `LazyWrapper` methods that accept an `iteratee` value.
  23095. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  23096. var type = index + 1,
  23097. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  23098. LazyWrapper.prototype[methodName] = function(iteratee) {
  23099. var result = this.clone();
  23100. result.__iteratees__.push({
  23101. 'iteratee': getIteratee(iteratee, 3),
  23102. 'type': type
  23103. });
  23104. result.__filtered__ = result.__filtered__ || isFilter;
  23105. return result;
  23106. };
  23107. });
  23108. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  23109. arrayEach(['head', 'last'], function(methodName, index) {
  23110. var takeName = 'take' + (index ? 'Right' : '');
  23111. LazyWrapper.prototype[methodName] = function() {
  23112. return this[takeName](1).value()[0];
  23113. };
  23114. });
  23115. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  23116. arrayEach(['initial', 'tail'], function(methodName, index) {
  23117. var dropName = 'drop' + (index ? '' : 'Right');
  23118. LazyWrapper.prototype[methodName] = function() {
  23119. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  23120. };
  23121. });
  23122. LazyWrapper.prototype.compact = function() {
  23123. return this.filter(identity);
  23124. };
  23125. LazyWrapper.prototype.find = function(predicate) {
  23126. return this.filter(predicate).head();
  23127. };
  23128. LazyWrapper.prototype.findLast = function(predicate) {
  23129. return this.reverse().find(predicate);
  23130. };
  23131. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  23132. if (typeof path == 'function') {
  23133. return new LazyWrapper(this);
  23134. }
  23135. return this.map(function(value) {
  23136. return baseInvoke(value, path, args);
  23137. });
  23138. });
  23139. LazyWrapper.prototype.reject = function(predicate) {
  23140. return this.filter(negate(getIteratee(predicate)));
  23141. };
  23142. LazyWrapper.prototype.slice = function(start, end) {
  23143. start = toInteger(start);
  23144. var result = this;
  23145. if (result.__filtered__ && (start > 0 || end < 0)) {
  23146. return new LazyWrapper(result);
  23147. }
  23148. if (start < 0) {
  23149. result = result.takeRight(-start);
  23150. } else if (start) {
  23151. result = result.drop(start);
  23152. }
  23153. if (end !== undefined) {
  23154. end = toInteger(end);
  23155. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  23156. }
  23157. return result;
  23158. };
  23159. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  23160. return this.reverse().takeWhile(predicate).reverse();
  23161. };
  23162. LazyWrapper.prototype.toArray = function() {
  23163. return this.take(MAX_ARRAY_LENGTH);
  23164. };
  23165. // Add `LazyWrapper` methods to `lodash.prototype`.
  23166. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  23167. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  23168. isTaker = /^(?:head|last)$/.test(methodName),
  23169. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  23170. retUnwrapped = isTaker || /^find/.test(methodName);
  23171. if (!lodashFunc) {
  23172. return;
  23173. }
  23174. lodash.prototype[methodName] = function() {
  23175. var value = this.__wrapped__,
  23176. args = isTaker ? [1] : arguments,
  23177. isLazy = value instanceof LazyWrapper,
  23178. iteratee = args[0],
  23179. useLazy = isLazy || isArray(value);
  23180. var interceptor = function(value) {
  23181. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  23182. return (isTaker && chainAll) ? result[0] : result;
  23183. };
  23184. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  23185. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  23186. isLazy = useLazy = false;
  23187. }
  23188. var chainAll = this.__chain__,
  23189. isHybrid = !!this.__actions__.length,
  23190. isUnwrapped = retUnwrapped && !chainAll,
  23191. onlyLazy = isLazy && !isHybrid;
  23192. if (!retUnwrapped && useLazy) {
  23193. value = onlyLazy ? value : new LazyWrapper(this);
  23194. var result = func.apply(value, args);
  23195. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  23196. return new LodashWrapper(result, chainAll);
  23197. }
  23198. if (isUnwrapped && onlyLazy) {
  23199. return func.apply(this, args);
  23200. }
  23201. result = this.thru(interceptor);
  23202. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  23203. };
  23204. });
  23205. // Add `Array` methods to `lodash.prototype`.
  23206. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  23207. var func = arrayProto[methodName],
  23208. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  23209. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  23210. lodash.prototype[methodName] = function() {
  23211. var args = arguments;
  23212. if (retUnwrapped && !this.__chain__) {
  23213. var value = this.value();
  23214. return func.apply(isArray(value) ? value : [], args);
  23215. }
  23216. return this[chainName](function(value) {
  23217. return func.apply(isArray(value) ? value : [], args);
  23218. });
  23219. };
  23220. });
  23221. // Map minified method names to their real names.
  23222. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  23223. var lodashFunc = lodash[methodName];
  23224. if (lodashFunc) {
  23225. var key = (lodashFunc.name + ''),
  23226. names = realNames[key] || (realNames[key] = []);
  23227. names.push({ 'name': methodName, 'func': lodashFunc });
  23228. }
  23229. });
  23230. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  23231. 'name': 'wrapper',
  23232. 'func': undefined
  23233. }];
  23234. // Add methods to `LazyWrapper`.
  23235. LazyWrapper.prototype.clone = lazyClone;
  23236. LazyWrapper.prototype.reverse = lazyReverse;
  23237. LazyWrapper.prototype.value = lazyValue;
  23238. // Add chain sequence methods to the `lodash` wrapper.
  23239. lodash.prototype.at = wrapperAt;
  23240. lodash.prototype.chain = wrapperChain;
  23241. lodash.prototype.commit = wrapperCommit;
  23242. lodash.prototype.next = wrapperNext;
  23243. lodash.prototype.plant = wrapperPlant;
  23244. lodash.prototype.reverse = wrapperReverse;
  23245. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  23246. // Add lazy aliases.
  23247. lodash.prototype.first = lodash.prototype.head;
  23248. if (symIterator) {
  23249. lodash.prototype[symIterator] = wrapperToIterator;
  23250. }
  23251. return lodash;
  23252. });
  23253. /*--------------------------------------------------------------------------*/
  23254. // Export lodash.
  23255. var _ = runInContext();
  23256. // Some AMD build optimizers, like r.js, check for condition patterns like:
  23257. if (true) {
  23258. // Expose Lodash on the global object to prevent errors when Lodash is
  23259. // loaded by a script tag in the presence of an AMD loader.
  23260. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  23261. // Use `_.noConflict` to remove Lodash from the global object.
  23262. root._ = _;
  23263. // Define as an anonymous module so, through path mapping, it can be
  23264. // referenced as the "underscore" module.
  23265. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  23266. return _;
  23267. }).call(exports, __webpack_require__, exports, module),
  23268. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  23269. }
  23270. // Check for `exports` after `define` in case a build optimizer adds it.
  23271. else {}
  23272. }.call(this));
  23273. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
  23274. /***/ }),
  23275. /***/ "./node_modules/lodash/toString.js":
  23276. /*!*****************************************!*\
  23277. !*** ./node_modules/lodash/toString.js ***!
  23278. \*****************************************/
  23279. /*! no static exports found */
  23280. /***/ (function(module, exports, __webpack_require__) {
  23281. var baseToString = __webpack_require__(/*! ./_baseToString */ "./node_modules/lodash/_baseToString.js");
  23282. /**
  23283. * Converts `value` to a string. An empty string is returned for `null`
  23284. * and `undefined` values. The sign of `-0` is preserved.
  23285. *
  23286. * @static
  23287. * @memberOf _
  23288. * @since 4.0.0
  23289. * @category Lang
  23290. * @param {*} value The value to convert.
  23291. * @returns {string} Returns the converted string.
  23292. * @example
  23293. *
  23294. * _.toString(null);
  23295. * // => ''
  23296. *
  23297. * _.toString(-0);
  23298. * // => '-0'
  23299. *
  23300. * _.toString([1, 2, 3]);
  23301. * // => '1,2,3'
  23302. */
  23303. function toString(value) {
  23304. return value == null ? '' : baseToString(value);
  23305. }
  23306. module.exports = toString;
  23307. /***/ }),
  23308. /***/ "./node_modules/moment/locale/af.js":
  23309. /*!******************************************!*\
  23310. !*** ./node_modules/moment/locale/af.js ***!
  23311. \******************************************/
  23312. /*! no static exports found */
  23313. /***/ (function(module, exports, __webpack_require__) {
  23314. //! moment.js locale configuration
  23315. //! locale : Afrikaans [af]
  23316. //! author : Werner Mollentze : https://github.com/wernerm
  23317. ;(function (global, factory) {
  23318. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23319. undefined
  23320. }(this, (function (moment) { 'use strict';
  23321. var af = moment.defineLocale('af', {
  23322. months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
  23323. monthsShort : 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
  23324. weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
  23325. weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
  23326. weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
  23327. meridiemParse: /vm|nm/i,
  23328. isPM : function (input) {
  23329. return /^nm$/i.test(input);
  23330. },
  23331. meridiem : function (hours, minutes, isLower) {
  23332. if (hours < 12) {
  23333. return isLower ? 'vm' : 'VM';
  23334. } else {
  23335. return isLower ? 'nm' : 'NM';
  23336. }
  23337. },
  23338. longDateFormat : {
  23339. LT : 'HH:mm',
  23340. LTS : 'HH:mm:ss',
  23341. L : 'DD/MM/YYYY',
  23342. LL : 'D MMMM YYYY',
  23343. LLL : 'D MMMM YYYY HH:mm',
  23344. LLLL : 'dddd, D MMMM YYYY HH:mm'
  23345. },
  23346. calendar : {
  23347. sameDay : '[Vandag om] LT',
  23348. nextDay : '[Môre om] LT',
  23349. nextWeek : 'dddd [om] LT',
  23350. lastDay : '[Gister om] LT',
  23351. lastWeek : '[Laas] dddd [om] LT',
  23352. sameElse : 'L'
  23353. },
  23354. relativeTime : {
  23355. future : 'oor %s',
  23356. past : '%s gelede',
  23357. s : '\'n paar sekondes',
  23358. m : '\'n minuut',
  23359. mm : '%d minute',
  23360. h : '\'n uur',
  23361. hh : '%d ure',
  23362. d : '\'n dag',
  23363. dd : '%d dae',
  23364. M : '\'n maand',
  23365. MM : '%d maande',
  23366. y : '\'n jaar',
  23367. yy : '%d jaar'
  23368. },
  23369. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  23370. ordinal : function (number) {
  23371. return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter
  23372. },
  23373. week : {
  23374. dow : 1, // Maandag is die eerste dag van die week.
  23375. doy : 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
  23376. }
  23377. });
  23378. return af;
  23379. })));
  23380. /***/ }),
  23381. /***/ "./node_modules/moment/locale/ar.js":
  23382. /*!******************************************!*\
  23383. !*** ./node_modules/moment/locale/ar.js ***!
  23384. \******************************************/
  23385. /*! no static exports found */
  23386. /***/ (function(module, exports, __webpack_require__) {
  23387. //! moment.js locale configuration
  23388. //! locale : Arabic [ar]
  23389. //! author : Abdel Said: https://github.com/abdelsaid
  23390. //! author : Ahmed Elkhatib
  23391. //! author : forabi https://github.com/forabi
  23392. ;(function (global, factory) {
  23393. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23394. undefined
  23395. }(this, (function (moment) { 'use strict';
  23396. var symbolMap = {
  23397. '1': '١',
  23398. '2': '٢',
  23399. '3': '٣',
  23400. '4': '٤',
  23401. '5': '٥',
  23402. '6': '٦',
  23403. '7': '٧',
  23404. '8': '٨',
  23405. '9': '٩',
  23406. '0': '٠'
  23407. };
  23408. var numberMap = {
  23409. '١': '1',
  23410. '٢': '2',
  23411. '٣': '3',
  23412. '٤': '4',
  23413. '٥': '5',
  23414. '٦': '6',
  23415. '٧': '7',
  23416. '٨': '8',
  23417. '٩': '9',
  23418. '٠': '0'
  23419. };
  23420. var pluralForm = function (n) {
  23421. return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
  23422. };
  23423. var plurals = {
  23424. s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
  23425. m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
  23426. h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
  23427. d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
  23428. M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
  23429. y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
  23430. };
  23431. var pluralize = function (u) {
  23432. return function (number, withoutSuffix, string, isFuture) {
  23433. var f = pluralForm(number),
  23434. str = plurals[u][pluralForm(number)];
  23435. if (f === 2) {
  23436. str = str[withoutSuffix ? 0 : 1];
  23437. }
  23438. return str.replace(/%d/i, number);
  23439. };
  23440. };
  23441. var months = [
  23442. 'كانون الثاني يناير',
  23443. 'شباط فبراير',
  23444. 'آذار مارس',
  23445. 'نيسان أبريل',
  23446. 'أيار مايو',
  23447. 'حزيران يونيو',
  23448. 'تموز يوليو',
  23449. 'آب أغسطس',
  23450. 'أيلول سبتمبر',
  23451. 'تشرين الأول أكتوبر',
  23452. 'تشرين الثاني نوفمبر',
  23453. 'كانون الأول ديسمبر'
  23454. ];
  23455. var ar = moment.defineLocale('ar', {
  23456. months : months,
  23457. monthsShort : months,
  23458. weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  23459. weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  23460. weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  23461. weekdaysParseExact : true,
  23462. longDateFormat : {
  23463. LT : 'HH:mm',
  23464. LTS : 'HH:mm:ss',
  23465. L : 'D/\u200FM/\u200FYYYY',
  23466. LL : 'D MMMM YYYY',
  23467. LLL : 'D MMMM YYYY HH:mm',
  23468. LLLL : 'dddd D MMMM YYYY HH:mm'
  23469. },
  23470. meridiemParse: /ص|م/,
  23471. isPM : function (input) {
  23472. return 'م' === input;
  23473. },
  23474. meridiem : function (hour, minute, isLower) {
  23475. if (hour < 12) {
  23476. return 'ص';
  23477. } else {
  23478. return 'م';
  23479. }
  23480. },
  23481. calendar : {
  23482. sameDay: '[اليوم عند الساعة] LT',
  23483. nextDay: '[غدًا عند الساعة] LT',
  23484. nextWeek: 'dddd [عند الساعة] LT',
  23485. lastDay: '[أمس عند الساعة] LT',
  23486. lastWeek: 'dddd [عند الساعة] LT',
  23487. sameElse: 'L'
  23488. },
  23489. relativeTime : {
  23490. future : 'بعد %s',
  23491. past : 'منذ %s',
  23492. s : pluralize('s'),
  23493. m : pluralize('m'),
  23494. mm : pluralize('m'),
  23495. h : pluralize('h'),
  23496. hh : pluralize('h'),
  23497. d : pluralize('d'),
  23498. dd : pluralize('d'),
  23499. M : pluralize('M'),
  23500. MM : pluralize('M'),
  23501. y : pluralize('y'),
  23502. yy : pluralize('y')
  23503. },
  23504. preparse: function (string) {
  23505. return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  23506. return numberMap[match];
  23507. }).replace(/،/g, ',');
  23508. },
  23509. postformat: function (string) {
  23510. return string.replace(/\d/g, function (match) {
  23511. return symbolMap[match];
  23512. }).replace(/,/g, '،');
  23513. },
  23514. week : {
  23515. dow : 6, // Saturday is the first day of the week.
  23516. doy : 12 // The week that contains Jan 1st is the first week of the year.
  23517. }
  23518. });
  23519. return ar;
  23520. })));
  23521. /***/ }),
  23522. /***/ "./node_modules/moment/locale/bg.js":
  23523. /*!******************************************!*\
  23524. !*** ./node_modules/moment/locale/bg.js ***!
  23525. \******************************************/
  23526. /*! no static exports found */
  23527. /***/ (function(module, exports, __webpack_require__) {
  23528. //! moment.js locale configuration
  23529. //! locale : Bulgarian [bg]
  23530. //! author : Krasen Borisov : https://github.com/kraz
  23531. ;(function (global, factory) {
  23532. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23533. undefined
  23534. }(this, (function (moment) { 'use strict';
  23535. var bg = moment.defineLocale('bg', {
  23536. months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
  23537. monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
  23538. weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),
  23539. weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
  23540. weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  23541. longDateFormat : {
  23542. LT : 'H:mm',
  23543. LTS : 'H:mm:ss',
  23544. L : 'D.MM.YYYY',
  23545. LL : 'D MMMM YYYY',
  23546. LLL : 'D MMMM YYYY H:mm',
  23547. LLLL : 'dddd, D MMMM YYYY H:mm'
  23548. },
  23549. calendar : {
  23550. sameDay : '[Днес в] LT',
  23551. nextDay : '[Утре в] LT',
  23552. nextWeek : 'dddd [в] LT',
  23553. lastDay : '[Вчера в] LT',
  23554. lastWeek : function () {
  23555. switch (this.day()) {
  23556. case 0:
  23557. case 3:
  23558. case 6:
  23559. return '[В изминалата] dddd [в] LT';
  23560. case 1:
  23561. case 2:
  23562. case 4:
  23563. case 5:
  23564. return '[В изминалия] dddd [в] LT';
  23565. }
  23566. },
  23567. sameElse : 'L'
  23568. },
  23569. relativeTime : {
  23570. future : 'след %s',
  23571. past : 'преди %s',
  23572. s : 'няколко секунди',
  23573. m : 'минута',
  23574. mm : '%d минути',
  23575. h : 'час',
  23576. hh : '%d часа',
  23577. d : 'ден',
  23578. dd : '%d дни',
  23579. M : 'месец',
  23580. MM : '%d месеца',
  23581. y : 'година',
  23582. yy : '%d години'
  23583. },
  23584. dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  23585. ordinal : function (number) {
  23586. var lastDigit = number % 10,
  23587. last2Digits = number % 100;
  23588. if (number === 0) {
  23589. return number + '-ев';
  23590. } else if (last2Digits === 0) {
  23591. return number + '-ен';
  23592. } else if (last2Digits > 10 && last2Digits < 20) {
  23593. return number + '-ти';
  23594. } else if (lastDigit === 1) {
  23595. return number + '-ви';
  23596. } else if (lastDigit === 2) {
  23597. return number + '-ри';
  23598. } else if (lastDigit === 7 || lastDigit === 8) {
  23599. return number + '-ми';
  23600. } else {
  23601. return number + '-ти';
  23602. }
  23603. },
  23604. week : {
  23605. dow : 1, // Monday is the first day of the week.
  23606. doy : 7 // The week that contains Jan 1st is the first week of the year.
  23607. }
  23608. });
  23609. return bg;
  23610. })));
  23611. /***/ }),
  23612. /***/ "./node_modules/moment/locale/ca.js":
  23613. /*!******************************************!*\
  23614. !*** ./node_modules/moment/locale/ca.js ***!
  23615. \******************************************/
  23616. /*! no static exports found */
  23617. /***/ (function(module, exports, __webpack_require__) {
  23618. //! moment.js locale configuration
  23619. //! locale : Catalan [ca]
  23620. //! author : Juan G. Hurtado : https://github.com/juanghurtado
  23621. ;(function (global, factory) {
  23622. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23623. undefined
  23624. }(this, (function (moment) { 'use strict';
  23625. var ca = moment.defineLocale('ca', {
  23626. months : {
  23627. standalone: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),
  23628. format: 'de gener_de febrer_de març_d\'abril_de maig_de juny_de juliol_d\'agost_de setembre_d\'octubre_de novembre_de desembre'.split('_'),
  23629. isFormat: /D[oD]?(\s)+MMMM/
  23630. },
  23631. monthsShort : 'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split('_'),
  23632. monthsParseExact : true,
  23633. weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),
  23634. weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
  23635. weekdaysMin : 'dg_dl_dt_dc_dj_dv_ds'.split('_'),
  23636. weekdaysParseExact : true,
  23637. longDateFormat : {
  23638. LT : 'H:mm',
  23639. LTS : 'H:mm:ss',
  23640. L : 'DD/MM/YYYY',
  23641. LL : 'D MMMM [de] YYYY',
  23642. ll : 'D MMM YYYY',
  23643. LLL : 'D MMMM [de] YYYY [a les] H:mm',
  23644. lll : 'D MMM YYYY, H:mm',
  23645. LLLL : 'dddd D MMMM [de] YYYY [a les] H:mm',
  23646. llll : 'ddd D MMM YYYY, H:mm'
  23647. },
  23648. calendar : {
  23649. sameDay : function () {
  23650. return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  23651. },
  23652. nextDay : function () {
  23653. return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  23654. },
  23655. nextWeek : function () {
  23656. return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  23657. },
  23658. lastDay : function () {
  23659. return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  23660. },
  23661. lastWeek : function () {
  23662. return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
  23663. },
  23664. sameElse : 'L'
  23665. },
  23666. relativeTime : {
  23667. future : 'd\'aquí %s',
  23668. past : 'fa %s',
  23669. s : 'uns segons',
  23670. m : 'un minut',
  23671. mm : '%d minuts',
  23672. h : 'una hora',
  23673. hh : '%d hores',
  23674. d : 'un dia',
  23675. dd : '%d dies',
  23676. M : 'un mes',
  23677. MM : '%d mesos',
  23678. y : 'un any',
  23679. yy : '%d anys'
  23680. },
  23681. dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
  23682. ordinal : function (number, period) {
  23683. var output = (number === 1) ? 'r' :
  23684. (number === 2) ? 'n' :
  23685. (number === 3) ? 'r' :
  23686. (number === 4) ? 't' : 'è';
  23687. if (period === 'w' || period === 'W') {
  23688. output = 'a';
  23689. }
  23690. return number + output;
  23691. },
  23692. week : {
  23693. dow : 1, // Monday is the first day of the week.
  23694. doy : 4 // The week that contains Jan 4th is the first week of the year.
  23695. }
  23696. });
  23697. return ca;
  23698. })));
  23699. /***/ }),
  23700. /***/ "./node_modules/moment/locale/cs.js":
  23701. /*!******************************************!*\
  23702. !*** ./node_modules/moment/locale/cs.js ***!
  23703. \******************************************/
  23704. /*! no static exports found */
  23705. /***/ (function(module, exports, __webpack_require__) {
  23706. //! moment.js locale configuration
  23707. //! locale : Czech [cs]
  23708. //! author : petrbela : https://github.com/petrbela
  23709. ;(function (global, factory) {
  23710. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23711. undefined
  23712. }(this, (function (moment) { 'use strict';
  23713. var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_');
  23714. var monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
  23715. function plural(n) {
  23716. return (n > 1) && (n < 5) && (~~(n / 10) !== 1);
  23717. }
  23718. function translate(number, withoutSuffix, key, isFuture) {
  23719. var result = number + ' ';
  23720. switch (key) {
  23721. case 's': // a few seconds / in a few seconds / a few seconds ago
  23722. return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';
  23723. case 'm': // a minute / in a minute / a minute ago
  23724. return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');
  23725. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  23726. if (withoutSuffix || isFuture) {
  23727. return result + (plural(number) ? 'minuty' : 'minut');
  23728. } else {
  23729. return result + 'minutami';
  23730. }
  23731. break;
  23732. case 'h': // an hour / in an hour / an hour ago
  23733. return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
  23734. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  23735. if (withoutSuffix || isFuture) {
  23736. return result + (plural(number) ? 'hodiny' : 'hodin');
  23737. } else {
  23738. return result + 'hodinami';
  23739. }
  23740. break;
  23741. case 'd': // a day / in a day / a day ago
  23742. return (withoutSuffix || isFuture) ? 'den' : 'dnem';
  23743. case 'dd': // 9 days / in 9 days / 9 days ago
  23744. if (withoutSuffix || isFuture) {
  23745. return result + (plural(number) ? 'dny' : 'dní');
  23746. } else {
  23747. return result + 'dny';
  23748. }
  23749. break;
  23750. case 'M': // a month / in a month / a month ago
  23751. return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';
  23752. case 'MM': // 9 months / in 9 months / 9 months ago
  23753. if (withoutSuffix || isFuture) {
  23754. return result + (plural(number) ? 'měsíce' : 'měsíců');
  23755. } else {
  23756. return result + 'měsíci';
  23757. }
  23758. break;
  23759. case 'y': // a year / in a year / a year ago
  23760. return (withoutSuffix || isFuture) ? 'rok' : 'rokem';
  23761. case 'yy': // 9 years / in 9 years / 9 years ago
  23762. if (withoutSuffix || isFuture) {
  23763. return result + (plural(number) ? 'roky' : 'let');
  23764. } else {
  23765. return result + 'lety';
  23766. }
  23767. break;
  23768. }
  23769. }
  23770. var cs = moment.defineLocale('cs', {
  23771. months : months,
  23772. monthsShort : monthsShort,
  23773. monthsParse : (function (months, monthsShort) {
  23774. var i, _monthsParse = [];
  23775. for (i = 0; i < 12; i++) {
  23776. // use custom parser to solve problem with July (červenec)
  23777. _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
  23778. }
  23779. return _monthsParse;
  23780. }(months, monthsShort)),
  23781. shortMonthsParse : (function (monthsShort) {
  23782. var i, _shortMonthsParse = [];
  23783. for (i = 0; i < 12; i++) {
  23784. _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i');
  23785. }
  23786. return _shortMonthsParse;
  23787. }(monthsShort)),
  23788. longMonthsParse : (function (months) {
  23789. var i, _longMonthsParse = [];
  23790. for (i = 0; i < 12; i++) {
  23791. _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i');
  23792. }
  23793. return _longMonthsParse;
  23794. }(months)),
  23795. weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
  23796. weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),
  23797. weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),
  23798. longDateFormat : {
  23799. LT: 'H:mm',
  23800. LTS : 'H:mm:ss',
  23801. L : 'DD.MM.YYYY',
  23802. LL : 'D. MMMM YYYY',
  23803. LLL : 'D. MMMM YYYY H:mm',
  23804. LLLL : 'dddd D. MMMM YYYY H:mm',
  23805. l : 'D. M. YYYY'
  23806. },
  23807. calendar : {
  23808. sameDay: '[dnes v] LT',
  23809. nextDay: '[zítra v] LT',
  23810. nextWeek: function () {
  23811. switch (this.day()) {
  23812. case 0:
  23813. return '[v neděli v] LT';
  23814. case 1:
  23815. case 2:
  23816. return '[v] dddd [v] LT';
  23817. case 3:
  23818. return '[ve středu v] LT';
  23819. case 4:
  23820. return '[ve čtvrtek v] LT';
  23821. case 5:
  23822. return '[v pátek v] LT';
  23823. case 6:
  23824. return '[v sobotu v] LT';
  23825. }
  23826. },
  23827. lastDay: '[včera v] LT',
  23828. lastWeek: function () {
  23829. switch (this.day()) {
  23830. case 0:
  23831. return '[minulou neděli v] LT';
  23832. case 1:
  23833. case 2:
  23834. return '[minulé] dddd [v] LT';
  23835. case 3:
  23836. return '[minulou středu v] LT';
  23837. case 4:
  23838. case 5:
  23839. return '[minulý] dddd [v] LT';
  23840. case 6:
  23841. return '[minulou sobotu v] LT';
  23842. }
  23843. },
  23844. sameElse: 'L'
  23845. },
  23846. relativeTime : {
  23847. future : 'za %s',
  23848. past : 'před %s',
  23849. s : translate,
  23850. m : translate,
  23851. mm : translate,
  23852. h : translate,
  23853. hh : translate,
  23854. d : translate,
  23855. dd : translate,
  23856. M : translate,
  23857. MM : translate,
  23858. y : translate,
  23859. yy : translate
  23860. },
  23861. dayOfMonthOrdinalParse : /\d{1,2}\./,
  23862. ordinal : '%d.',
  23863. week : {
  23864. dow : 1, // Monday is the first day of the week.
  23865. doy : 4 // The week that contains Jan 4th is the first week of the year.
  23866. }
  23867. });
  23868. return cs;
  23869. })));
  23870. /***/ }),
  23871. /***/ "./node_modules/moment/locale/de.js":
  23872. /*!******************************************!*\
  23873. !*** ./node_modules/moment/locale/de.js ***!
  23874. \******************************************/
  23875. /*! no static exports found */
  23876. /***/ (function(module, exports, __webpack_require__) {
  23877. //! moment.js locale configuration
  23878. //! locale : German [de]
  23879. //! author : lluchs : https://github.com/lluchs
  23880. //! author: Menelion Elensúle: https://github.com/Oire
  23881. //! author : Mikolaj Dadela : https://github.com/mik01aj
  23882. ;(function (global, factory) {
  23883. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23884. undefined
  23885. }(this, (function (moment) { 'use strict';
  23886. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  23887. var format = {
  23888. 'm': ['eine Minute', 'einer Minute'],
  23889. 'h': ['eine Stunde', 'einer Stunde'],
  23890. 'd': ['ein Tag', 'einem Tag'],
  23891. 'dd': [number + ' Tage', number + ' Tagen'],
  23892. 'M': ['ein Monat', 'einem Monat'],
  23893. 'MM': [number + ' Monate', number + ' Monaten'],
  23894. 'y': ['ein Jahr', 'einem Jahr'],
  23895. 'yy': [number + ' Jahre', number + ' Jahren']
  23896. };
  23897. return withoutSuffix ? format[key][0] : format[key][1];
  23898. }
  23899. var de = moment.defineLocale('de', {
  23900. months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
  23901. monthsShort : 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
  23902. monthsParseExact : true,
  23903. weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
  23904. weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  23905. weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  23906. weekdaysParseExact : true,
  23907. longDateFormat : {
  23908. LT: 'HH:mm',
  23909. LTS: 'HH:mm:ss',
  23910. L : 'DD.MM.YYYY',
  23911. LL : 'D. MMMM YYYY',
  23912. LLL : 'D. MMMM YYYY HH:mm',
  23913. LLLL : 'dddd, D. MMMM YYYY HH:mm'
  23914. },
  23915. calendar : {
  23916. sameDay: '[heute um] LT [Uhr]',
  23917. sameElse: 'L',
  23918. nextDay: '[morgen um] LT [Uhr]',
  23919. nextWeek: 'dddd [um] LT [Uhr]',
  23920. lastDay: '[gestern um] LT [Uhr]',
  23921. lastWeek: '[letzten] dddd [um] LT [Uhr]'
  23922. },
  23923. relativeTime : {
  23924. future : 'in %s',
  23925. past : 'vor %s',
  23926. s : 'ein paar Sekunden',
  23927. m : processRelativeTime,
  23928. mm : '%d Minuten',
  23929. h : processRelativeTime,
  23930. hh : '%d Stunden',
  23931. d : processRelativeTime,
  23932. dd : processRelativeTime,
  23933. M : processRelativeTime,
  23934. MM : processRelativeTime,
  23935. y : processRelativeTime,
  23936. yy : processRelativeTime
  23937. },
  23938. dayOfMonthOrdinalParse: /\d{1,2}\./,
  23939. ordinal : '%d.',
  23940. week : {
  23941. dow : 1, // Monday is the first day of the week.
  23942. doy : 4 // The week that contains Jan 4th is the first week of the year.
  23943. }
  23944. });
  23945. return de;
  23946. })));
  23947. /***/ }),
  23948. /***/ "./node_modules/moment/locale/es.js":
  23949. /*!******************************************!*\
  23950. !*** ./node_modules/moment/locale/es.js ***!
  23951. \******************************************/
  23952. /*! no static exports found */
  23953. /***/ (function(module, exports, __webpack_require__) {
  23954. //! moment.js locale configuration
  23955. //! locale : Spanish [es]
  23956. //! author : Julio Napurí : https://github.com/julionc
  23957. ;(function (global, factory) {
  23958. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23959. undefined
  23960. }(this, (function (moment) { 'use strict';
  23961. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');
  23962. var monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
  23963. var monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];
  23964. var monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
  23965. var es = moment.defineLocale('es', {
  23966. months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
  23967. monthsShort : function (m, format) {
  23968. if (!m) {
  23969. return monthsShortDot;
  23970. } else if (/-MMM-/.test(format)) {
  23971. return monthsShort[m.month()];
  23972. } else {
  23973. return monthsShortDot[m.month()];
  23974. }
  23975. },
  23976. monthsRegex : monthsRegex,
  23977. monthsShortRegex : monthsRegex,
  23978. monthsStrictRegex : /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  23979. monthsShortStrictRegex : /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  23980. monthsParse : monthsParse,
  23981. longMonthsParse : monthsParse,
  23982. shortMonthsParse : monthsParse,
  23983. weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  23984. weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  23985. weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  23986. weekdaysParseExact : true,
  23987. longDateFormat : {
  23988. LT : 'H:mm',
  23989. LTS : 'H:mm:ss',
  23990. L : 'DD/MM/YYYY',
  23991. LL : 'D [de] MMMM [de] YYYY',
  23992. LLL : 'D [de] MMMM [de] YYYY H:mm',
  23993. LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
  23994. },
  23995. calendar : {
  23996. sameDay : function () {
  23997. return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  23998. },
  23999. nextDay : function () {
  24000. return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  24001. },
  24002. nextWeek : function () {
  24003. return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  24004. },
  24005. lastDay : function () {
  24006. return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  24007. },
  24008. lastWeek : function () {
  24009. return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT';
  24010. },
  24011. sameElse : 'L'
  24012. },
  24013. relativeTime : {
  24014. future : 'en %s',
  24015. past : 'hace %s',
  24016. s : 'unos segundos',
  24017. m : 'un minuto',
  24018. mm : '%d minutos',
  24019. h : 'una hora',
  24020. hh : '%d horas',
  24021. d : 'un día',
  24022. dd : '%d días',
  24023. M : 'un mes',
  24024. MM : '%d meses',
  24025. y : 'un año',
  24026. yy : '%d años'
  24027. },
  24028. dayOfMonthOrdinalParse : /\d{1,2}º/,
  24029. ordinal : '%dº',
  24030. week : {
  24031. dow : 1, // Monday is the first day of the week.
  24032. doy : 4 // The week that contains Jan 4th is the first week of the year.
  24033. }
  24034. });
  24035. return es;
  24036. })));
  24037. /***/ }),
  24038. /***/ "./node_modules/moment/locale/eu.js":
  24039. /*!******************************************!*\
  24040. !*** ./node_modules/moment/locale/eu.js ***!
  24041. \******************************************/
  24042. /*! no static exports found */
  24043. /***/ (function(module, exports, __webpack_require__) {
  24044. //! moment.js locale configuration
  24045. //! locale : Basque [eu]
  24046. //! author : Eneko Illarramendi : https://github.com/eillarra
  24047. ;(function (global, factory) {
  24048. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24049. undefined
  24050. }(this, (function (moment) { 'use strict';
  24051. var eu = moment.defineLocale('eu', {
  24052. months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'),
  24053. monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'),
  24054. monthsParseExact : true,
  24055. weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'),
  24056. weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'),
  24057. weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'),
  24058. weekdaysParseExact : true,
  24059. longDateFormat : {
  24060. LT : 'HH:mm',
  24061. LTS : 'HH:mm:ss',
  24062. L : 'YYYY-MM-DD',
  24063. LL : 'YYYY[ko] MMMM[ren] D[a]',
  24064. LLL : 'YYYY[ko] MMMM[ren] D[a] HH:mm',
  24065. LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
  24066. l : 'YYYY-M-D',
  24067. ll : 'YYYY[ko] MMM D[a]',
  24068. lll : 'YYYY[ko] MMM D[a] HH:mm',
  24069. llll : 'ddd, YYYY[ko] MMM D[a] HH:mm'
  24070. },
  24071. calendar : {
  24072. sameDay : '[gaur] LT[etan]',
  24073. nextDay : '[bihar] LT[etan]',
  24074. nextWeek : 'dddd LT[etan]',
  24075. lastDay : '[atzo] LT[etan]',
  24076. lastWeek : '[aurreko] dddd LT[etan]',
  24077. sameElse : 'L'
  24078. },
  24079. relativeTime : {
  24080. future : '%s barru',
  24081. past : 'duela %s',
  24082. s : 'segundo batzuk',
  24083. m : 'minutu bat',
  24084. mm : '%d minutu',
  24085. h : 'ordu bat',
  24086. hh : '%d ordu',
  24087. d : 'egun bat',
  24088. dd : '%d egun',
  24089. M : 'hilabete bat',
  24090. MM : '%d hilabete',
  24091. y : 'urte bat',
  24092. yy : '%d urte'
  24093. },
  24094. dayOfMonthOrdinalParse: /\d{1,2}\./,
  24095. ordinal : '%d.',
  24096. week : {
  24097. dow : 1, // Monday is the first day of the week.
  24098. doy : 7 // The week that contains Jan 1st is the first week of the year.
  24099. }
  24100. });
  24101. return eu;
  24102. })));
  24103. /***/ }),
  24104. /***/ "./node_modules/moment/locale/fr.js":
  24105. /*!******************************************!*\
  24106. !*** ./node_modules/moment/locale/fr.js ***!
  24107. \******************************************/
  24108. /*! no static exports found */
  24109. /***/ (function(module, exports, __webpack_require__) {
  24110. //! moment.js locale configuration
  24111. //! locale : French [fr]
  24112. //! author : John Fischer : https://github.com/jfroffice
  24113. ;(function (global, factory) {
  24114. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24115. undefined
  24116. }(this, (function (moment) { 'use strict';
  24117. var fr = moment.defineLocale('fr', {
  24118. months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
  24119. monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
  24120. monthsParseExact : true,
  24121. weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  24122. weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  24123. weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
  24124. weekdaysParseExact : true,
  24125. longDateFormat : {
  24126. LT : 'HH:mm',
  24127. LTS : 'HH:mm:ss',
  24128. L : 'DD/MM/YYYY',
  24129. LL : 'D MMMM YYYY',
  24130. LLL : 'D MMMM YYYY HH:mm',
  24131. LLLL : 'dddd D MMMM YYYY HH:mm'
  24132. },
  24133. calendar : {
  24134. sameDay : '[Aujourd’hui à] LT',
  24135. nextDay : '[Demain à] LT',
  24136. nextWeek : 'dddd [à] LT',
  24137. lastDay : '[Hier à] LT',
  24138. lastWeek : 'dddd [dernier à] LT',
  24139. sameElse : 'L'
  24140. },
  24141. relativeTime : {
  24142. future : 'dans %s',
  24143. past : 'il y a %s',
  24144. s : 'quelques secondes',
  24145. m : 'une minute',
  24146. mm : '%d minutes',
  24147. h : 'une heure',
  24148. hh : '%d heures',
  24149. d : 'un jour',
  24150. dd : '%d jours',
  24151. M : 'un mois',
  24152. MM : '%d mois',
  24153. y : 'un an',
  24154. yy : '%d ans'
  24155. },
  24156. dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
  24157. ordinal : function (number, period) {
  24158. switch (period) {
  24159. // TODO: Return 'e' when day of month > 1. Move this case inside
  24160. // block for masculine words below.
  24161. // See https://github.com/moment/moment/issues/3375
  24162. case 'D':
  24163. return number + (number === 1 ? 'er' : '');
  24164. // Words with masculine grammatical gender: mois, trimestre, jour
  24165. default:
  24166. case 'M':
  24167. case 'Q':
  24168. case 'DDD':
  24169. case 'd':
  24170. return number + (number === 1 ? 'er' : 'e');
  24171. // Words with feminine grammatical gender: semaine
  24172. case 'w':
  24173. case 'W':
  24174. return number + (number === 1 ? 're' : 'e');
  24175. }
  24176. },
  24177. week : {
  24178. dow : 1, // Monday is the first day of the week.
  24179. doy : 4 // The week that contains Jan 4th is the first week of the year.
  24180. }
  24181. });
  24182. return fr;
  24183. })));
  24184. /***/ }),
  24185. /***/ "./node_modules/moment/locale/gl.js":
  24186. /*!******************************************!*\
  24187. !*** ./node_modules/moment/locale/gl.js ***!
  24188. \******************************************/
  24189. /*! no static exports found */
  24190. /***/ (function(module, exports, __webpack_require__) {
  24191. //! moment.js locale configuration
  24192. //! locale : Galician [gl]
  24193. //! author : Juan G. Hurtado : https://github.com/juanghurtado
  24194. ;(function (global, factory) {
  24195. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24196. undefined
  24197. }(this, (function (moment) { 'use strict';
  24198. var gl = moment.defineLocale('gl', {
  24199. months : 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split('_'),
  24200. monthsShort : 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split('_'),
  24201. monthsParseExact: true,
  24202. weekdays : 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
  24203. weekdaysShort : 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
  24204. weekdaysMin : 'do_lu_ma_mé_xo_ve_sá'.split('_'),
  24205. weekdaysParseExact : true,
  24206. longDateFormat : {
  24207. LT : 'H:mm',
  24208. LTS : 'H:mm:ss',
  24209. L : 'DD/MM/YYYY',
  24210. LL : 'D [de] MMMM [de] YYYY',
  24211. LLL : 'D [de] MMMM [de] YYYY H:mm',
  24212. LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm'
  24213. },
  24214. calendar : {
  24215. sameDay : function () {
  24216. return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
  24217. },
  24218. nextDay : function () {
  24219. return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT';
  24220. },
  24221. nextWeek : function () {
  24222. return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
  24223. },
  24224. lastDay : function () {
  24225. return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT';
  24226. },
  24227. lastWeek : function () {
  24228. return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT';
  24229. },
  24230. sameElse : 'L'
  24231. },
  24232. relativeTime : {
  24233. future : function (str) {
  24234. if (str.indexOf('un') === 0) {
  24235. return 'n' + str;
  24236. }
  24237. return 'en ' + str;
  24238. },
  24239. past : 'hai %s',
  24240. s : 'uns segundos',
  24241. m : 'un minuto',
  24242. mm : '%d minutos',
  24243. h : 'unha hora',
  24244. hh : '%d horas',
  24245. d : 'un día',
  24246. dd : '%d días',
  24247. M : 'un mes',
  24248. MM : '%d meses',
  24249. y : 'un ano',
  24250. yy : '%d anos'
  24251. },
  24252. dayOfMonthOrdinalParse : /\d{1,2}º/,
  24253. ordinal : '%dº',
  24254. week : {
  24255. dow : 1, // Monday is the first day of the week.
  24256. doy : 4 // The week that contains Jan 4th is the first week of the year.
  24257. }
  24258. });
  24259. return gl;
  24260. })));
  24261. /***/ }),
  24262. /***/ "./node_modules/moment/locale/he.js":
  24263. /*!******************************************!*\
  24264. !*** ./node_modules/moment/locale/he.js ***!
  24265. \******************************************/
  24266. /*! no static exports found */
  24267. /***/ (function(module, exports, __webpack_require__) {
  24268. //! moment.js locale configuration
  24269. //! locale : Hebrew [he]
  24270. //! author : Tomer Cohen : https://github.com/tomer
  24271. //! author : Moshe Simantov : https://github.com/DevelopmentIL
  24272. //! author : Tal Ater : https://github.com/TalAter
  24273. ;(function (global, factory) {
  24274. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24275. undefined
  24276. }(this, (function (moment) { 'use strict';
  24277. var he = moment.defineLocale('he', {
  24278. months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),
  24279. monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),
  24280. weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
  24281. weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
  24282. weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'),
  24283. longDateFormat : {
  24284. LT : 'HH:mm',
  24285. LTS : 'HH:mm:ss',
  24286. L : 'DD/MM/YYYY',
  24287. LL : 'D [ב]MMMM YYYY',
  24288. LLL : 'D [ב]MMMM YYYY HH:mm',
  24289. LLLL : 'dddd, D [ב]MMMM YYYY HH:mm',
  24290. l : 'D/M/YYYY',
  24291. ll : 'D MMM YYYY',
  24292. lll : 'D MMM YYYY HH:mm',
  24293. llll : 'ddd, D MMM YYYY HH:mm'
  24294. },
  24295. calendar : {
  24296. sameDay : '[היום ב־]LT',
  24297. nextDay : '[מחר ב־]LT',
  24298. nextWeek : 'dddd [בשעה] LT',
  24299. lastDay : '[אתמול ב־]LT',
  24300. lastWeek : '[ביום] dddd [האחרון בשעה] LT',
  24301. sameElse : 'L'
  24302. },
  24303. relativeTime : {
  24304. future : 'בעוד %s',
  24305. past : 'לפני %s',
  24306. s : 'מספר שניות',
  24307. m : 'דקה',
  24308. mm : '%d דקות',
  24309. h : 'שעה',
  24310. hh : function (number) {
  24311. if (number === 2) {
  24312. return 'שעתיים';
  24313. }
  24314. return number + ' שעות';
  24315. },
  24316. d : 'יום',
  24317. dd : function (number) {
  24318. if (number === 2) {
  24319. return 'יומיים';
  24320. }
  24321. return number + ' ימים';
  24322. },
  24323. M : 'חודש',
  24324. MM : function (number) {
  24325. if (number === 2) {
  24326. return 'חודשיים';
  24327. }
  24328. return number + ' חודשים';
  24329. },
  24330. y : 'שנה',
  24331. yy : function (number) {
  24332. if (number === 2) {
  24333. return 'שנתיים';
  24334. } else if (number % 10 === 0 && number !== 10) {
  24335. return number + ' שנה';
  24336. }
  24337. return number + ' שנים';
  24338. }
  24339. },
  24340. meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
  24341. isPM : function (input) {
  24342. return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
  24343. },
  24344. meridiem : function (hour, minute, isLower) {
  24345. if (hour < 5) {
  24346. return 'לפנות בוקר';
  24347. } else if (hour < 10) {
  24348. return 'בבוקר';
  24349. } else if (hour < 12) {
  24350. return isLower ? 'לפנה"צ' : 'לפני הצהריים';
  24351. } else if (hour < 18) {
  24352. return isLower ? 'אחה"צ' : 'אחרי הצהריים';
  24353. } else {
  24354. return 'בערב';
  24355. }
  24356. }
  24357. });
  24358. return he;
  24359. })));
  24360. /***/ }),
  24361. /***/ "./node_modules/moment/locale/hi.js":
  24362. /*!******************************************!*\
  24363. !*** ./node_modules/moment/locale/hi.js ***!
  24364. \******************************************/
  24365. /*! no static exports found */
  24366. /***/ (function(module, exports, __webpack_require__) {
  24367. //! moment.js locale configuration
  24368. //! locale : Hindi [hi]
  24369. //! author : Mayank Singhal : https://github.com/mayanksinghal
  24370. ;(function (global, factory) {
  24371. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24372. undefined
  24373. }(this, (function (moment) { 'use strict';
  24374. var symbolMap = {
  24375. '1': '१',
  24376. '2': '२',
  24377. '3': '३',
  24378. '4': '४',
  24379. '5': '५',
  24380. '6': '६',
  24381. '7': '७',
  24382. '8': '८',
  24383. '9': '९',
  24384. '0': '०'
  24385. };
  24386. var numberMap = {
  24387. '१': '1',
  24388. '२': '2',
  24389. '३': '3',
  24390. '४': '4',
  24391. '५': '5',
  24392. '६': '6',
  24393. '७': '7',
  24394. '८': '8',
  24395. '९': '9',
  24396. '०': '0'
  24397. };
  24398. var hi = moment.defineLocale('hi', {
  24399. months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),
  24400. monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
  24401. monthsParseExact: true,
  24402. weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  24403. weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
  24404. weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
  24405. longDateFormat : {
  24406. LT : 'A h:mm बजे',
  24407. LTS : 'A h:mm:ss बजे',
  24408. L : 'DD/MM/YYYY',
  24409. LL : 'D MMMM YYYY',
  24410. LLL : 'D MMMM YYYY, A h:mm बजे',
  24411. LLLL : 'dddd, D MMMM YYYY, A h:mm बजे'
  24412. },
  24413. calendar : {
  24414. sameDay : '[आज] LT',
  24415. nextDay : '[कल] LT',
  24416. nextWeek : 'dddd, LT',
  24417. lastDay : '[कल] LT',
  24418. lastWeek : '[पिछले] dddd, LT',
  24419. sameElse : 'L'
  24420. },
  24421. relativeTime : {
  24422. future : '%s में',
  24423. past : '%s पहले',
  24424. s : 'कुछ ही क्षण',
  24425. m : 'एक मिनट',
  24426. mm : '%d मिनट',
  24427. h : 'एक घंटा',
  24428. hh : '%d घंटे',
  24429. d : 'एक दिन',
  24430. dd : '%d दिन',
  24431. M : 'एक महीने',
  24432. MM : '%d महीने',
  24433. y : 'एक वर्ष',
  24434. yy : '%d वर्ष'
  24435. },
  24436. preparse: function (string) {
  24437. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  24438. return numberMap[match];
  24439. });
  24440. },
  24441. postformat: function (string) {
  24442. return string.replace(/\d/g, function (match) {
  24443. return symbolMap[match];
  24444. });
  24445. },
  24446. // Hindi notation for meridiems are quite fuzzy in practice. While there exists
  24447. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
  24448. meridiemParse: /रात|सुबह|दोपहर|शाम/,
  24449. meridiemHour : function (hour, meridiem) {
  24450. if (hour === 12) {
  24451. hour = 0;
  24452. }
  24453. if (meridiem === 'रात') {
  24454. return hour < 4 ? hour : hour + 12;
  24455. } else if (meridiem === 'सुबह') {
  24456. return hour;
  24457. } else if (meridiem === 'दोपहर') {
  24458. return hour >= 10 ? hour : hour + 12;
  24459. } else if (meridiem === 'शाम') {
  24460. return hour + 12;
  24461. }
  24462. },
  24463. meridiem : function (hour, minute, isLower) {
  24464. if (hour < 4) {
  24465. return 'रात';
  24466. } else if (hour < 10) {
  24467. return 'सुबह';
  24468. } else if (hour < 17) {
  24469. return 'दोपहर';
  24470. } else if (hour < 20) {
  24471. return 'शाम';
  24472. } else {
  24473. return 'रात';
  24474. }
  24475. },
  24476. week : {
  24477. dow : 0, // Sunday is the first day of the week.
  24478. doy : 6 // The week that contains Jan 1st is the first week of the year.
  24479. }
  24480. });
  24481. return hi;
  24482. })));
  24483. /***/ }),
  24484. /***/ "./node_modules/moment/locale/hu.js":
  24485. /*!******************************************!*\
  24486. !*** ./node_modules/moment/locale/hu.js ***!
  24487. \******************************************/
  24488. /*! no static exports found */
  24489. /***/ (function(module, exports, __webpack_require__) {
  24490. //! moment.js locale configuration
  24491. //! locale : Hungarian [hu]
  24492. //! author : Adam Brunner : https://github.com/adambrunner
  24493. ;(function (global, factory) {
  24494. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24495. undefined
  24496. }(this, (function (moment) { 'use strict';
  24497. var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');
  24498. function translate(number, withoutSuffix, key, isFuture) {
  24499. var num = number;
  24500. switch (key) {
  24501. case 's':
  24502. return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';
  24503. case 'm':
  24504. return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
  24505. case 'mm':
  24506. return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
  24507. case 'h':
  24508. return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
  24509. case 'hh':
  24510. return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
  24511. case 'd':
  24512. return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
  24513. case 'dd':
  24514. return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
  24515. case 'M':
  24516. return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  24517. case 'MM':
  24518. return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  24519. case 'y':
  24520. return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
  24521. case 'yy':
  24522. return num + (isFuture || withoutSuffix ? ' év' : ' éve');
  24523. }
  24524. return '';
  24525. }
  24526. function week(isFuture) {
  24527. return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]';
  24528. }
  24529. var hu = moment.defineLocale('hu', {
  24530. months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),
  24531. monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),
  24532. weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
  24533. weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
  24534. weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'),
  24535. longDateFormat : {
  24536. LT : 'H:mm',
  24537. LTS : 'H:mm:ss',
  24538. L : 'YYYY.MM.DD.',
  24539. LL : 'YYYY. MMMM D.',
  24540. LLL : 'YYYY. MMMM D. H:mm',
  24541. LLLL : 'YYYY. MMMM D., dddd H:mm'
  24542. },
  24543. meridiemParse: /de|du/i,
  24544. isPM: function (input) {
  24545. return input.charAt(1).toLowerCase() === 'u';
  24546. },
  24547. meridiem : function (hours, minutes, isLower) {
  24548. if (hours < 12) {
  24549. return isLower === true ? 'de' : 'DE';
  24550. } else {
  24551. return isLower === true ? 'du' : 'DU';
  24552. }
  24553. },
  24554. calendar : {
  24555. sameDay : '[ma] LT[-kor]',
  24556. nextDay : '[holnap] LT[-kor]',
  24557. nextWeek : function () {
  24558. return week.call(this, true);
  24559. },
  24560. lastDay : '[tegnap] LT[-kor]',
  24561. lastWeek : function () {
  24562. return week.call(this, false);
  24563. },
  24564. sameElse : 'L'
  24565. },
  24566. relativeTime : {
  24567. future : '%s múlva',
  24568. past : '%s',
  24569. s : translate,
  24570. m : translate,
  24571. mm : translate,
  24572. h : translate,
  24573. hh : translate,
  24574. d : translate,
  24575. dd : translate,
  24576. M : translate,
  24577. MM : translate,
  24578. y : translate,
  24579. yy : translate
  24580. },
  24581. dayOfMonthOrdinalParse: /\d{1,2}\./,
  24582. ordinal : '%d.',
  24583. week : {
  24584. dow : 1, // Monday is the first day of the week.
  24585. doy : 4 // The week that contains Jan 4th is the first week of the year.
  24586. }
  24587. });
  24588. return hu;
  24589. })));
  24590. /***/ }),
  24591. /***/ "./node_modules/moment/locale/id.js":
  24592. /*!******************************************!*\
  24593. !*** ./node_modules/moment/locale/id.js ***!
  24594. \******************************************/
  24595. /*! no static exports found */
  24596. /***/ (function(module, exports, __webpack_require__) {
  24597. //! moment.js locale configuration
  24598. //! locale : Indonesian [id]
  24599. //! author : Mohammad Satrio Utomo : https://github.com/tyok
  24600. //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan
  24601. ;(function (global, factory) {
  24602. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24603. undefined
  24604. }(this, (function (moment) { 'use strict';
  24605. var id = moment.defineLocale('id', {
  24606. months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
  24607. monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),
  24608. weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
  24609. weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
  24610. weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
  24611. longDateFormat : {
  24612. LT : 'HH.mm',
  24613. LTS : 'HH.mm.ss',
  24614. L : 'DD/MM/YYYY',
  24615. LL : 'D MMMM YYYY',
  24616. LLL : 'D MMMM YYYY [pukul] HH.mm',
  24617. LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
  24618. },
  24619. meridiemParse: /pagi|siang|sore|malam/,
  24620. meridiemHour : function (hour, meridiem) {
  24621. if (hour === 12) {
  24622. hour = 0;
  24623. }
  24624. if (meridiem === 'pagi') {
  24625. return hour;
  24626. } else if (meridiem === 'siang') {
  24627. return hour >= 11 ? hour : hour + 12;
  24628. } else if (meridiem === 'sore' || meridiem === 'malam') {
  24629. return hour + 12;
  24630. }
  24631. },
  24632. meridiem : function (hours, minutes, isLower) {
  24633. if (hours < 11) {
  24634. return 'pagi';
  24635. } else if (hours < 15) {
  24636. return 'siang';
  24637. } else if (hours < 19) {
  24638. return 'sore';
  24639. } else {
  24640. return 'malam';
  24641. }
  24642. },
  24643. calendar : {
  24644. sameDay : '[Hari ini pukul] LT',
  24645. nextDay : '[Besok pukul] LT',
  24646. nextWeek : 'dddd [pukul] LT',
  24647. lastDay : '[Kemarin pukul] LT',
  24648. lastWeek : 'dddd [lalu pukul] LT',
  24649. sameElse : 'L'
  24650. },
  24651. relativeTime : {
  24652. future : 'dalam %s',
  24653. past : '%s yang lalu',
  24654. s : 'beberapa detik',
  24655. m : 'semenit',
  24656. mm : '%d menit',
  24657. h : 'sejam',
  24658. hh : '%d jam',
  24659. d : 'sehari',
  24660. dd : '%d hari',
  24661. M : 'sebulan',
  24662. MM : '%d bulan',
  24663. y : 'setahun',
  24664. yy : '%d tahun'
  24665. },
  24666. week : {
  24667. dow : 1, // Monday is the first day of the week.
  24668. doy : 7 // The week that contains Jan 1st is the first week of the year.
  24669. }
  24670. });
  24671. return id;
  24672. })));
  24673. /***/ }),
  24674. /***/ "./node_modules/moment/locale/it.js":
  24675. /*!******************************************!*\
  24676. !*** ./node_modules/moment/locale/it.js ***!
  24677. \******************************************/
  24678. /*! no static exports found */
  24679. /***/ (function(module, exports, __webpack_require__) {
  24680. //! moment.js locale configuration
  24681. //! locale : Italian [it]
  24682. //! author : Lorenzo : https://github.com/aliem
  24683. //! author: Mattia Larentis: https://github.com/nostalgiaz
  24684. ;(function (global, factory) {
  24685. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24686. undefined
  24687. }(this, (function (moment) { 'use strict';
  24688. var it = moment.defineLocale('it', {
  24689. months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
  24690. monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
  24691. weekdays : 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),
  24692. weekdaysShort : 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
  24693. weekdaysMin : 'do_lu_ma_me_gi_ve_sa'.split('_'),
  24694. longDateFormat : {
  24695. LT : 'HH:mm',
  24696. LTS : 'HH:mm:ss',
  24697. L : 'DD/MM/YYYY',
  24698. LL : 'D MMMM YYYY',
  24699. LLL : 'D MMMM YYYY HH:mm',
  24700. LLLL : 'dddd, D MMMM YYYY HH:mm'
  24701. },
  24702. calendar : {
  24703. sameDay: '[Oggi alle] LT',
  24704. nextDay: '[Domani alle] LT',
  24705. nextWeek: 'dddd [alle] LT',
  24706. lastDay: '[Ieri alle] LT',
  24707. lastWeek: function () {
  24708. switch (this.day()) {
  24709. case 0:
  24710. return '[la scorsa] dddd [alle] LT';
  24711. default:
  24712. return '[lo scorso] dddd [alle] LT';
  24713. }
  24714. },
  24715. sameElse: 'L'
  24716. },
  24717. relativeTime : {
  24718. future : function (s) {
  24719. return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s;
  24720. },
  24721. past : '%s fa',
  24722. s : 'alcuni secondi',
  24723. m : 'un minuto',
  24724. mm : '%d minuti',
  24725. h : 'un\'ora',
  24726. hh : '%d ore',
  24727. d : 'un giorno',
  24728. dd : '%d giorni',
  24729. M : 'un mese',
  24730. MM : '%d mesi',
  24731. y : 'un anno',
  24732. yy : '%d anni'
  24733. },
  24734. dayOfMonthOrdinalParse : /\d{1,2}º/,
  24735. ordinal: '%dº',
  24736. week : {
  24737. dow : 1, // Monday is the first day of the week.
  24738. doy : 4 // The week that contains Jan 4th is the first week of the year.
  24739. }
  24740. });
  24741. return it;
  24742. })));
  24743. /***/ }),
  24744. /***/ "./node_modules/moment/locale/ja.js":
  24745. /*!******************************************!*\
  24746. !*** ./node_modules/moment/locale/ja.js ***!
  24747. \******************************************/
  24748. /*! no static exports found */
  24749. /***/ (function(module, exports, __webpack_require__) {
  24750. //! moment.js locale configuration
  24751. //! locale : Japanese [ja]
  24752. //! author : LI Long : https://github.com/baryon
  24753. ;(function (global, factory) {
  24754. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24755. undefined
  24756. }(this, (function (moment) { 'use strict';
  24757. var ja = moment.defineLocale('ja', {
  24758. months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  24759. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  24760. weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
  24761. weekdaysShort : '日_月_火_水_木_金_土'.split('_'),
  24762. weekdaysMin : '日_月_火_水_木_金_土'.split('_'),
  24763. longDateFormat : {
  24764. LT : 'HH:mm',
  24765. LTS : 'HH:mm:ss',
  24766. L : 'YYYY/MM/DD',
  24767. LL : 'YYYY年M月D日',
  24768. LLL : 'YYYY年M月D日 HH:mm',
  24769. LLLL : 'YYYY年M月D日 HH:mm dddd',
  24770. l : 'YYYY/MM/DD',
  24771. ll : 'YYYY年M月D日',
  24772. lll : 'YYYY年M月D日 HH:mm',
  24773. llll : 'YYYY年M月D日 HH:mm dddd'
  24774. },
  24775. meridiemParse: /午前|午後/i,
  24776. isPM : function (input) {
  24777. return input === '午後';
  24778. },
  24779. meridiem : function (hour, minute, isLower) {
  24780. if (hour < 12) {
  24781. return '午前';
  24782. } else {
  24783. return '午後';
  24784. }
  24785. },
  24786. calendar : {
  24787. sameDay : '[今日] LT',
  24788. nextDay : '[明日] LT',
  24789. nextWeek : '[来週]dddd LT',
  24790. lastDay : '[昨日] LT',
  24791. lastWeek : '[前週]dddd LT',
  24792. sameElse : 'L'
  24793. },
  24794. dayOfMonthOrdinalParse : /\d{1,2}日/,
  24795. ordinal : function (number, period) {
  24796. switch (period) {
  24797. case 'd':
  24798. case 'D':
  24799. case 'DDD':
  24800. return number + '日';
  24801. default:
  24802. return number;
  24803. }
  24804. },
  24805. relativeTime : {
  24806. future : '%s後',
  24807. past : '%s前',
  24808. s : '数秒',
  24809. m : '1分',
  24810. mm : '%d分',
  24811. h : '1時間',
  24812. hh : '%d時間',
  24813. d : '1日',
  24814. dd : '%d日',
  24815. M : '1ヶ月',
  24816. MM : '%dヶ月',
  24817. y : '1年',
  24818. yy : '%d年'
  24819. }
  24820. });
  24821. return ja;
  24822. })));
  24823. /***/ }),
  24824. /***/ "./node_modules/moment/locale/nb.js":
  24825. /*!******************************************!*\
  24826. !*** ./node_modules/moment/locale/nb.js ***!
  24827. \******************************************/
  24828. /*! no static exports found */
  24829. /***/ (function(module, exports, __webpack_require__) {
  24830. //! moment.js locale configuration
  24831. //! locale : Norwegian Bokmål [nb]
  24832. //! authors : Espen Hovlandsdal : https://github.com/rexxars
  24833. //! Sigurd Gartmann : https://github.com/sigurdga
  24834. ;(function (global, factory) {
  24835. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24836. undefined
  24837. }(this, (function (moment) { 'use strict';
  24838. var nb = moment.defineLocale('nb', {
  24839. months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
  24840. monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),
  24841. monthsParseExact : true,
  24842. weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  24843. weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'),
  24844. weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
  24845. weekdaysParseExact : true,
  24846. longDateFormat : {
  24847. LT : 'HH:mm',
  24848. LTS : 'HH:mm:ss',
  24849. L : 'DD.MM.YYYY',
  24850. LL : 'D. MMMM YYYY',
  24851. LLL : 'D. MMMM YYYY [kl.] HH:mm',
  24852. LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm'
  24853. },
  24854. calendar : {
  24855. sameDay: '[i dag kl.] LT',
  24856. nextDay: '[i morgen kl.] LT',
  24857. nextWeek: 'dddd [kl.] LT',
  24858. lastDay: '[i går kl.] LT',
  24859. lastWeek: '[forrige] dddd [kl.] LT',
  24860. sameElse: 'L'
  24861. },
  24862. relativeTime : {
  24863. future : 'om %s',
  24864. past : '%s siden',
  24865. s : 'noen sekunder',
  24866. m : 'ett minutt',
  24867. mm : '%d minutter',
  24868. h : 'en time',
  24869. hh : '%d timer',
  24870. d : 'en dag',
  24871. dd : '%d dager',
  24872. M : 'en måned',
  24873. MM : '%d måneder',
  24874. y : 'ett år',
  24875. yy : '%d år'
  24876. },
  24877. dayOfMonthOrdinalParse: /\d{1,2}\./,
  24878. ordinal : '%d.',
  24879. week : {
  24880. dow : 1, // Monday is the first day of the week.
  24881. doy : 4 // The week that contains Jan 4th is the first week of the year.
  24882. }
  24883. });
  24884. return nb;
  24885. })));
  24886. /***/ }),
  24887. /***/ "./node_modules/moment/locale/nl.js":
  24888. /*!******************************************!*\
  24889. !*** ./node_modules/moment/locale/nl.js ***!
  24890. \******************************************/
  24891. /*! no static exports found */
  24892. /***/ (function(module, exports, __webpack_require__) {
  24893. //! moment.js locale configuration
  24894. //! locale : Dutch [nl]
  24895. //! author : Joris Röling : https://github.com/jorisroling
  24896. //! author : Jacob Middag : https://github.com/middagj
  24897. ;(function (global, factory) {
  24898. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24899. undefined
  24900. }(this, (function (moment) { 'use strict';
  24901. var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_');
  24902. var monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
  24903. var monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
  24904. var monthsRegex = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
  24905. var nl = moment.defineLocale('nl', {
  24906. months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
  24907. monthsShort : function (m, format) {
  24908. if (!m) {
  24909. return monthsShortWithDots;
  24910. } else if (/-MMM-/.test(format)) {
  24911. return monthsShortWithoutDots[m.month()];
  24912. } else {
  24913. return monthsShortWithDots[m.month()];
  24914. }
  24915. },
  24916. monthsRegex: monthsRegex,
  24917. monthsShortRegex: monthsRegex,
  24918. monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
  24919. monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
  24920. monthsParse : monthsParse,
  24921. longMonthsParse : monthsParse,
  24922. shortMonthsParse : monthsParse,
  24923. weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
  24924. weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'),
  24925. weekdaysMin : 'zo_ma_di_wo_do_vr_za'.split('_'),
  24926. weekdaysParseExact : true,
  24927. longDateFormat : {
  24928. LT : 'HH:mm',
  24929. LTS : 'HH:mm:ss',
  24930. L : 'DD-MM-YYYY',
  24931. LL : 'D MMMM YYYY',
  24932. LLL : 'D MMMM YYYY HH:mm',
  24933. LLLL : 'dddd D MMMM YYYY HH:mm'
  24934. },
  24935. calendar : {
  24936. sameDay: '[vandaag om] LT',
  24937. nextDay: '[morgen om] LT',
  24938. nextWeek: 'dddd [om] LT',
  24939. lastDay: '[gisteren om] LT',
  24940. lastWeek: '[afgelopen] dddd [om] LT',
  24941. sameElse: 'L'
  24942. },
  24943. relativeTime : {
  24944. future : 'over %s',
  24945. past : '%s geleden',
  24946. s : 'een paar seconden',
  24947. m : 'één minuut',
  24948. mm : '%d minuten',
  24949. h : 'één uur',
  24950. hh : '%d uur',
  24951. d : 'één dag',
  24952. dd : '%d dagen',
  24953. M : 'één maand',
  24954. MM : '%d maanden',
  24955. y : 'één jaar',
  24956. yy : '%d jaar'
  24957. },
  24958. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  24959. ordinal : function (number) {
  24960. return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de');
  24961. },
  24962. week : {
  24963. dow : 1, // Monday is the first day of the week.
  24964. doy : 4 // The week that contains Jan 4th is the first week of the year.
  24965. }
  24966. });
  24967. return nl;
  24968. })));
  24969. /***/ }),
  24970. /***/ "./node_modules/moment/locale/pl.js":
  24971. /*!******************************************!*\
  24972. !*** ./node_modules/moment/locale/pl.js ***!
  24973. \******************************************/
  24974. /*! no static exports found */
  24975. /***/ (function(module, exports, __webpack_require__) {
  24976. //! moment.js locale configuration
  24977. //! locale : Polish [pl]
  24978. //! author : Rafal Hirsz : https://github.com/evoL
  24979. ;(function (global, factory) {
  24980. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24981. undefined
  24982. }(this, (function (moment) { 'use strict';
  24983. var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_');
  24984. var monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
  24985. function plural(n) {
  24986. return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1);
  24987. }
  24988. function translate(number, withoutSuffix, key) {
  24989. var result = number + ' ';
  24990. switch (key) {
  24991. case 'm':
  24992. return withoutSuffix ? 'minuta' : 'minutę';
  24993. case 'mm':
  24994. return result + (plural(number) ? 'minuty' : 'minut');
  24995. case 'h':
  24996. return withoutSuffix ? 'godzina' : 'godzinę';
  24997. case 'hh':
  24998. return result + (plural(number) ? 'godziny' : 'godzin');
  24999. case 'MM':
  25000. return result + (plural(number) ? 'miesiące' : 'miesięcy');
  25001. case 'yy':
  25002. return result + (plural(number) ? 'lata' : 'lat');
  25003. }
  25004. }
  25005. var pl = moment.defineLocale('pl', {
  25006. months : function (momentToFormat, format) {
  25007. if (!momentToFormat) {
  25008. return monthsNominative;
  25009. } else if (format === '') {
  25010. // Hack: if format empty we know this is used to generate
  25011. // RegExp by moment. Give then back both valid forms of months
  25012. // in RegExp ready format.
  25013. return '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')';
  25014. } else if (/D MMMM/.test(format)) {
  25015. return monthsSubjective[momentToFormat.month()];
  25016. } else {
  25017. return monthsNominative[momentToFormat.month()];
  25018. }
  25019. },
  25020. monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
  25021. weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
  25022. weekdaysShort : 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
  25023. weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
  25024. longDateFormat : {
  25025. LT : 'HH:mm',
  25026. LTS : 'HH:mm:ss',
  25027. L : 'DD.MM.YYYY',
  25028. LL : 'D MMMM YYYY',
  25029. LLL : 'D MMMM YYYY HH:mm',
  25030. LLLL : 'dddd, D MMMM YYYY HH:mm'
  25031. },
  25032. calendar : {
  25033. sameDay: '[Dziś o] LT',
  25034. nextDay: '[Jutro o] LT',
  25035. nextWeek: function () {
  25036. switch (this.day()) {
  25037. case 0:
  25038. return '[W niedzielę o] LT';
  25039. case 2:
  25040. return '[We wtorek o] LT';
  25041. case 3:
  25042. return '[W środę o] LT';
  25043. case 6:
  25044. return '[W sobotę o] LT';
  25045. default:
  25046. return '[W] dddd [o] LT';
  25047. }
  25048. },
  25049. lastDay: '[Wczoraj o] LT',
  25050. lastWeek: function () {
  25051. switch (this.day()) {
  25052. case 0:
  25053. return '[W zeszłą niedzielę o] LT';
  25054. case 3:
  25055. return '[W zeszłą środę o] LT';
  25056. case 6:
  25057. return '[W zeszłą sobotę o] LT';
  25058. default:
  25059. return '[W zeszły] dddd [o] LT';
  25060. }
  25061. },
  25062. sameElse: 'L'
  25063. },
  25064. relativeTime : {
  25065. future : 'za %s',
  25066. past : '%s temu',
  25067. s : 'kilka sekund',
  25068. m : translate,
  25069. mm : translate,
  25070. h : translate,
  25071. hh : translate,
  25072. d : '1 dzień',
  25073. dd : '%d dni',
  25074. M : 'miesiąc',
  25075. MM : translate,
  25076. y : 'rok',
  25077. yy : translate
  25078. },
  25079. dayOfMonthOrdinalParse: /\d{1,2}\./,
  25080. ordinal : '%d.',
  25081. week : {
  25082. dow : 1, // Monday is the first day of the week.
  25083. doy : 4 // The week that contains Jan 4th is the first week of the year.
  25084. }
  25085. });
  25086. return pl;
  25087. })));
  25088. /***/ }),
  25089. /***/ "./node_modules/moment/locale/pt-br.js":
  25090. /*!*********************************************!*\
  25091. !*** ./node_modules/moment/locale/pt-br.js ***!
  25092. \*********************************************/
  25093. /*! no static exports found */
  25094. /***/ (function(module, exports, __webpack_require__) {
  25095. //! moment.js locale configuration
  25096. //! locale : Portuguese (Brazil) [pt-br]
  25097. //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
  25098. ;(function (global, factory) {
  25099. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25100. undefined
  25101. }(this, (function (moment) { 'use strict';
  25102. var ptBr = moment.defineLocale('pt-br', {
  25103. months : 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'),
  25104. monthsShort : 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
  25105. weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
  25106. weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
  25107. weekdaysMin : 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
  25108. weekdaysParseExact : true,
  25109. longDateFormat : {
  25110. LT : 'HH:mm',
  25111. LTS : 'HH:mm:ss',
  25112. L : 'DD/MM/YYYY',
  25113. LL : 'D [de] MMMM [de] YYYY',
  25114. LLL : 'D [de] MMMM [de] YYYY [às] HH:mm',
  25115. LLLL : 'dddd, D [de] MMMM [de] YYYY [às] HH:mm'
  25116. },
  25117. calendar : {
  25118. sameDay: '[Hoje às] LT',
  25119. nextDay: '[Amanhã às] LT',
  25120. nextWeek: 'dddd [às] LT',
  25121. lastDay: '[Ontem às] LT',
  25122. lastWeek: function () {
  25123. return (this.day() === 0 || this.day() === 6) ?
  25124. '[Último] dddd [às] LT' : // Saturday + Sunday
  25125. '[Última] dddd [às] LT'; // Monday - Friday
  25126. },
  25127. sameElse: 'L'
  25128. },
  25129. relativeTime : {
  25130. future : 'em %s',
  25131. past : '%s atrás',
  25132. s : 'poucos segundos',
  25133. ss : '%d segundos',
  25134. m : 'um minuto',
  25135. mm : '%d minutos',
  25136. h : 'uma hora',
  25137. hh : '%d horas',
  25138. d : 'um dia',
  25139. dd : '%d dias',
  25140. M : 'um mês',
  25141. MM : '%d meses',
  25142. y : 'um ano',
  25143. yy : '%d anos'
  25144. },
  25145. dayOfMonthOrdinalParse: /\d{1,2}º/,
  25146. ordinal : '%dº'
  25147. });
  25148. return ptBr;
  25149. })));
  25150. /***/ }),
  25151. /***/ "./node_modules/moment/locale/ro.js":
  25152. /*!******************************************!*\
  25153. !*** ./node_modules/moment/locale/ro.js ***!
  25154. \******************************************/
  25155. /*! no static exports found */
  25156. /***/ (function(module, exports, __webpack_require__) {
  25157. //! moment.js locale configuration
  25158. //! locale : Romanian [ro]
  25159. //! author : Vlad Gurdiga : https://github.com/gurdiga
  25160. //! author : Valentin Agachi : https://github.com/avaly
  25161. ;(function (global, factory) {
  25162. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25163. undefined
  25164. }(this, (function (moment) { 'use strict';
  25165. function relativeTimeWithPlural(number, withoutSuffix, key) {
  25166. var format = {
  25167. 'mm': 'minute',
  25168. 'hh': 'ore',
  25169. 'dd': 'zile',
  25170. 'MM': 'luni',
  25171. 'yy': 'ani'
  25172. },
  25173. separator = ' ';
  25174. if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
  25175. separator = ' de ';
  25176. }
  25177. return number + separator + format[key];
  25178. }
  25179. var ro = moment.defineLocale('ro', {
  25180. months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),
  25181. monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),
  25182. monthsParseExact: true,
  25183. weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
  25184. weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
  25185. weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
  25186. longDateFormat : {
  25187. LT : 'H:mm',
  25188. LTS : 'H:mm:ss',
  25189. L : 'DD.MM.YYYY',
  25190. LL : 'D MMMM YYYY',
  25191. LLL : 'D MMMM YYYY H:mm',
  25192. LLLL : 'dddd, D MMMM YYYY H:mm'
  25193. },
  25194. calendar : {
  25195. sameDay: '[azi la] LT',
  25196. nextDay: '[mâine la] LT',
  25197. nextWeek: 'dddd [la] LT',
  25198. lastDay: '[ieri la] LT',
  25199. lastWeek: '[fosta] dddd [la] LT',
  25200. sameElse: 'L'
  25201. },
  25202. relativeTime : {
  25203. future : 'peste %s',
  25204. past : '%s în urmă',
  25205. s : 'câteva secunde',
  25206. m : 'un minut',
  25207. mm : relativeTimeWithPlural,
  25208. h : 'o oră',
  25209. hh : relativeTimeWithPlural,
  25210. d : 'o zi',
  25211. dd : relativeTimeWithPlural,
  25212. M : 'o lună',
  25213. MM : relativeTimeWithPlural,
  25214. y : 'un an',
  25215. yy : relativeTimeWithPlural
  25216. },
  25217. week : {
  25218. dow : 1, // Monday is the first day of the week.
  25219. doy : 7 // The week that contains Jan 1st is the first week of the year.
  25220. }
  25221. });
  25222. return ro;
  25223. })));
  25224. /***/ }),
  25225. /***/ "./node_modules/moment/locale/ru.js":
  25226. /*!******************************************!*\
  25227. !*** ./node_modules/moment/locale/ru.js ***!
  25228. \******************************************/
  25229. /*! no static exports found */
  25230. /***/ (function(module, exports, __webpack_require__) {
  25231. //! moment.js locale configuration
  25232. //! locale : Russian [ru]
  25233. //! author : Viktorminator : https://github.com/Viktorminator
  25234. //! Author : Menelion Elensúle : https://github.com/Oire
  25235. //! author : Коренберг Марк : https://github.com/socketpair
  25236. ;(function (global, factory) {
  25237. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25238. undefined
  25239. }(this, (function (moment) { 'use strict';
  25240. function plural(word, num) {
  25241. var forms = word.split('_');
  25242. return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
  25243. }
  25244. function relativeTimeWithPlural(number, withoutSuffix, key) {
  25245. var format = {
  25246. 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
  25247. 'hh': 'час_часа_часов',
  25248. 'dd': 'день_дня_дней',
  25249. 'MM': 'месяц_месяца_месяцев',
  25250. 'yy': 'год_года_лет'
  25251. };
  25252. if (key === 'm') {
  25253. return withoutSuffix ? 'минута' : 'минуту';
  25254. }
  25255. else {
  25256. return number + ' ' + plural(format[key], +number);
  25257. }
  25258. }
  25259. var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i];
  25260. // http://new.gramota.ru/spravka/rules/139-prop : § 103
  25261. // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
  25262. // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
  25263. var ru = moment.defineLocale('ru', {
  25264. months : {
  25265. format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'),
  25266. standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_')
  25267. },
  25268. monthsShort : {
  25269. // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ?
  25270. format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'),
  25271. standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_')
  25272. },
  25273. weekdays : {
  25274. standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
  25275. format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'),
  25276. isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/
  25277. },
  25278. weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  25279. weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  25280. monthsParse : monthsParse,
  25281. longMonthsParse : monthsParse,
  25282. shortMonthsParse : monthsParse,
  25283. // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
  25284. monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  25285. // копия предыдущего
  25286. monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  25287. // полные названия с падежами
  25288. monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,
  25289. // Выражение, которое соотвествует только сокращённым формам
  25290. monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
  25291. longDateFormat : {
  25292. LT : 'HH:mm',
  25293. LTS : 'HH:mm:ss',
  25294. L : 'DD.MM.YYYY',
  25295. LL : 'D MMMM YYYY г.',
  25296. LLL : 'D MMMM YYYY г., HH:mm',
  25297. LLLL : 'dddd, D MMMM YYYY г., HH:mm'
  25298. },
  25299. calendar : {
  25300. sameDay: '[Сегодня в] LT',
  25301. nextDay: '[Завтра в] LT',
  25302. lastDay: '[Вчера в] LT',
  25303. nextWeek: function (now) {
  25304. if (now.week() !== this.week()) {
  25305. switch (this.day()) {
  25306. case 0:
  25307. return '[В следующее] dddd [в] LT';
  25308. case 1:
  25309. case 2:
  25310. case 4:
  25311. return '[В следующий] dddd [в] LT';
  25312. case 3:
  25313. case 5:
  25314. case 6:
  25315. return '[В следующую] dddd [в] LT';
  25316. }
  25317. } else {
  25318. if (this.day() === 2) {
  25319. return '[Во] dddd [в] LT';
  25320. } else {
  25321. return '[В] dddd [в] LT';
  25322. }
  25323. }
  25324. },
  25325. lastWeek: function (now) {
  25326. if (now.week() !== this.week()) {
  25327. switch (this.day()) {
  25328. case 0:
  25329. return '[В прошлое] dddd [в] LT';
  25330. case 1:
  25331. case 2:
  25332. case 4:
  25333. return '[В прошлый] dddd [в] LT';
  25334. case 3:
  25335. case 5:
  25336. case 6:
  25337. return '[В прошлую] dddd [в] LT';
  25338. }
  25339. } else {
  25340. if (this.day() === 2) {
  25341. return '[Во] dddd [в] LT';
  25342. } else {
  25343. return '[В] dddd [в] LT';
  25344. }
  25345. }
  25346. },
  25347. sameElse: 'L'
  25348. },
  25349. relativeTime : {
  25350. future : 'через %s',
  25351. past : '%s назад',
  25352. s : 'несколько секунд',
  25353. m : relativeTimeWithPlural,
  25354. mm : relativeTimeWithPlural,
  25355. h : 'час',
  25356. hh : relativeTimeWithPlural,
  25357. d : 'день',
  25358. dd : relativeTimeWithPlural,
  25359. M : 'месяц',
  25360. MM : relativeTimeWithPlural,
  25361. y : 'год',
  25362. yy : relativeTimeWithPlural
  25363. },
  25364. meridiemParse: /ночи|утра|дня|вечера/i,
  25365. isPM : function (input) {
  25366. return /^(дня|вечера)$/.test(input);
  25367. },
  25368. meridiem : function (hour, minute, isLower) {
  25369. if (hour < 4) {
  25370. return 'ночи';
  25371. } else if (hour < 12) {
  25372. return 'утра';
  25373. } else if (hour < 17) {
  25374. return 'дня';
  25375. } else {
  25376. return 'вечера';
  25377. }
  25378. },
  25379. dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/,
  25380. ordinal: function (number, period) {
  25381. switch (period) {
  25382. case 'M':
  25383. case 'd':
  25384. case 'DDD':
  25385. return number + '-й';
  25386. case 'D':
  25387. return number + '-го';
  25388. case 'w':
  25389. case 'W':
  25390. return number + '-я';
  25391. default:
  25392. return number;
  25393. }
  25394. },
  25395. week : {
  25396. dow : 1, // Monday is the first day of the week.
  25397. doy : 4 // The week that contains Jan 4th is the first week of the year.
  25398. }
  25399. });
  25400. return ru;
  25401. })));
  25402. /***/ }),
  25403. /***/ "./node_modules/moment/locale/tr.js":
  25404. /*!******************************************!*\
  25405. !*** ./node_modules/moment/locale/tr.js ***!
  25406. \******************************************/
  25407. /*! no static exports found */
  25408. /***/ (function(module, exports, __webpack_require__) {
  25409. //! moment.js locale configuration
  25410. //! locale : Turkish [tr]
  25411. //! authors : Erhan Gundogan : https://github.com/erhangundogan,
  25412. //! Burak Yiğit Kaya: https://github.com/BYK
  25413. ;(function (global, factory) {
  25414. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25415. undefined
  25416. }(this, (function (moment) { 'use strict';
  25417. var suffixes = {
  25418. 1: '\'inci',
  25419. 5: '\'inci',
  25420. 8: '\'inci',
  25421. 70: '\'inci',
  25422. 80: '\'inci',
  25423. 2: '\'nci',
  25424. 7: '\'nci',
  25425. 20: '\'nci',
  25426. 50: '\'nci',
  25427. 3: '\'üncü',
  25428. 4: '\'üncü',
  25429. 100: '\'üncü',
  25430. 6: '\'ncı',
  25431. 9: '\'uncu',
  25432. 10: '\'uncu',
  25433. 30: '\'uncu',
  25434. 60: '\'ıncı',
  25435. 90: '\'ıncı'
  25436. };
  25437. var tr = moment.defineLocale('tr', {
  25438. months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),
  25439. monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
  25440. weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),
  25441. weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
  25442. weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
  25443. longDateFormat : {
  25444. LT : 'HH:mm',
  25445. LTS : 'HH:mm:ss',
  25446. L : 'DD.MM.YYYY',
  25447. LL : 'D MMMM YYYY',
  25448. LLL : 'D MMMM YYYY HH:mm',
  25449. LLLL : 'dddd, D MMMM YYYY HH:mm'
  25450. },
  25451. calendar : {
  25452. sameDay : '[bugün saat] LT',
  25453. nextDay : '[yarın saat] LT',
  25454. nextWeek : '[gelecek] dddd [saat] LT',
  25455. lastDay : '[dün] LT',
  25456. lastWeek : '[geçen] dddd [saat] LT',
  25457. sameElse : 'L'
  25458. },
  25459. relativeTime : {
  25460. future : '%s sonra',
  25461. past : '%s önce',
  25462. s : 'birkaç saniye',
  25463. m : 'bir dakika',
  25464. mm : '%d dakika',
  25465. h : 'bir saat',
  25466. hh : '%d saat',
  25467. d : 'bir gün',
  25468. dd : '%d gün',
  25469. M : 'bir ay',
  25470. MM : '%d ay',
  25471. y : 'bir yıl',
  25472. yy : '%d yıl'
  25473. },
  25474. dayOfMonthOrdinalParse: /\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,
  25475. ordinal : function (number) {
  25476. if (number === 0) { // special case for zero
  25477. return number + '\'ıncı';
  25478. }
  25479. var a = number % 10,
  25480. b = number % 100 - a,
  25481. c = number >= 100 ? 100 : null;
  25482. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  25483. },
  25484. week : {
  25485. dow : 1, // Monday is the first day of the week.
  25486. doy : 7 // The week that contains Jan 1st is the first week of the year.
  25487. }
  25488. });
  25489. return tr;
  25490. })));
  25491. /***/ }),
  25492. /***/ "./node_modules/moment/locale/uk.js":
  25493. /*!******************************************!*\
  25494. !*** ./node_modules/moment/locale/uk.js ***!
  25495. \******************************************/
  25496. /*! no static exports found */
  25497. /***/ (function(module, exports, __webpack_require__) {
  25498. //! moment.js locale configuration
  25499. //! locale : Ukrainian [uk]
  25500. //! author : zemlanin : https://github.com/zemlanin
  25501. //! Author : Menelion Elensúle : https://github.com/Oire
  25502. ;(function (global, factory) {
  25503. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25504. undefined
  25505. }(this, (function (moment) { 'use strict';
  25506. function plural(word, num) {
  25507. var forms = word.split('_');
  25508. return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
  25509. }
  25510. function relativeTimeWithPlural(number, withoutSuffix, key) {
  25511. var format = {
  25512. 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
  25513. 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
  25514. 'dd': 'день_дні_днів',
  25515. 'MM': 'місяць_місяці_місяців',
  25516. 'yy': 'рік_роки_років'
  25517. };
  25518. if (key === 'm') {
  25519. return withoutSuffix ? 'хвилина' : 'хвилину';
  25520. }
  25521. else if (key === 'h') {
  25522. return withoutSuffix ? 'година' : 'годину';
  25523. }
  25524. else {
  25525. return number + ' ' + plural(format[key], +number);
  25526. }
  25527. }
  25528. function weekdaysCaseReplace(m, format) {
  25529. var weekdays = {
  25530. 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
  25531. 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
  25532. 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
  25533. };
  25534. if (!m) {
  25535. return weekdays['nominative'];
  25536. }
  25537. var nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ?
  25538. 'accusative' :
  25539. ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ?
  25540. 'genitive' :
  25541. 'nominative');
  25542. return weekdays[nounCase][m.day()];
  25543. }
  25544. function processHoursFunction(str) {
  25545. return function () {
  25546. return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
  25547. };
  25548. }
  25549. var uk = moment.defineLocale('uk', {
  25550. months : {
  25551. 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'),
  25552. 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_')
  25553. },
  25554. monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),
  25555. weekdays : weekdaysCaseReplace,
  25556. weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  25557. weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  25558. longDateFormat : {
  25559. LT : 'HH:mm',
  25560. LTS : 'HH:mm:ss',
  25561. L : 'DD.MM.YYYY',
  25562. LL : 'D MMMM YYYY р.',
  25563. LLL : 'D MMMM YYYY р., HH:mm',
  25564. LLLL : 'dddd, D MMMM YYYY р., HH:mm'
  25565. },
  25566. calendar : {
  25567. sameDay: processHoursFunction('[Сьогодні '),
  25568. nextDay: processHoursFunction('[Завтра '),
  25569. lastDay: processHoursFunction('[Вчора '),
  25570. nextWeek: processHoursFunction('[У] dddd ['),
  25571. lastWeek: function () {
  25572. switch (this.day()) {
  25573. case 0:
  25574. case 3:
  25575. case 5:
  25576. case 6:
  25577. return processHoursFunction('[Минулої] dddd [').call(this);
  25578. case 1:
  25579. case 2:
  25580. case 4:
  25581. return processHoursFunction('[Минулого] dddd [').call(this);
  25582. }
  25583. },
  25584. sameElse: 'L'
  25585. },
  25586. relativeTime : {
  25587. future : 'за %s',
  25588. past : '%s тому',
  25589. s : 'декілька секунд',
  25590. m : relativeTimeWithPlural,
  25591. mm : relativeTimeWithPlural,
  25592. h : 'годину',
  25593. hh : relativeTimeWithPlural,
  25594. d : 'день',
  25595. dd : relativeTimeWithPlural,
  25596. M : 'місяць',
  25597. MM : relativeTimeWithPlural,
  25598. y : 'рік',
  25599. yy : relativeTimeWithPlural
  25600. },
  25601. // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
  25602. meridiemParse: /ночі|ранку|дня|вечора/,
  25603. isPM: function (input) {
  25604. return /^(дня|вечора)$/.test(input);
  25605. },
  25606. meridiem : function (hour, minute, isLower) {
  25607. if (hour < 4) {
  25608. return 'ночі';
  25609. } else if (hour < 12) {
  25610. return 'ранку';
  25611. } else if (hour < 17) {
  25612. return 'дня';
  25613. } else {
  25614. return 'вечора';
  25615. }
  25616. },
  25617. dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/,
  25618. ordinal: function (number, period) {
  25619. switch (period) {
  25620. case 'M':
  25621. case 'd':
  25622. case 'DDD':
  25623. case 'w':
  25624. case 'W':
  25625. return number + '-й';
  25626. case 'D':
  25627. return number + '-го';
  25628. default:
  25629. return number;
  25630. }
  25631. },
  25632. week : {
  25633. dow : 1, // Monday is the first day of the week.
  25634. doy : 7 // The week that contains Jan 1st is the first week of the year.
  25635. }
  25636. });
  25637. return uk;
  25638. })));
  25639. /***/ }),
  25640. /***/ "./node_modules/moment/locale/zh-cn.js":
  25641. /*!*********************************************!*\
  25642. !*** ./node_modules/moment/locale/zh-cn.js ***!
  25643. \*********************************************/
  25644. /*! no static exports found */
  25645. /***/ (function(module, exports, __webpack_require__) {
  25646. //! moment.js locale configuration
  25647. //! locale : Chinese (China) [zh-cn]
  25648. //! author : suupic : https://github.com/suupic
  25649. //! author : Zeno Zeng : https://github.com/zenozeng
  25650. ;(function (global, factory) {
  25651. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25652. undefined
  25653. }(this, (function (moment) { 'use strict';
  25654. var zhCn = moment.defineLocale('zh-cn', {
  25655. months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
  25656. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  25657. weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  25658. weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),
  25659. weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
  25660. longDateFormat : {
  25661. LT : 'HH:mm',
  25662. LTS : 'HH:mm:ss',
  25663. L : 'YYYY年MMMD日',
  25664. LL : 'YYYY年MMMD日',
  25665. LLL : 'YYYY年MMMD日Ah点mm分',
  25666. LLLL : 'YYYY年MMMD日ddddAh点mm分',
  25667. l : 'YYYY年MMMD日',
  25668. ll : 'YYYY年MMMD日',
  25669. lll : 'YYYY年MMMD日 HH:mm',
  25670. llll : 'YYYY年MMMD日dddd HH:mm'
  25671. },
  25672. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  25673. meridiemHour: function (hour, meridiem) {
  25674. if (hour === 12) {
  25675. hour = 0;
  25676. }
  25677. if (meridiem === '凌晨' || meridiem === '早上' ||
  25678. meridiem === '上午') {
  25679. return hour;
  25680. } else if (meridiem === '下午' || meridiem === '晚上') {
  25681. return hour + 12;
  25682. } else {
  25683. // '中午'
  25684. return hour >= 11 ? hour : hour + 12;
  25685. }
  25686. },
  25687. meridiem : function (hour, minute, isLower) {
  25688. var hm = hour * 100 + minute;
  25689. if (hm < 600) {
  25690. return '凌晨';
  25691. } else if (hm < 900) {
  25692. return '早上';
  25693. } else if (hm < 1130) {
  25694. return '上午';
  25695. } else if (hm < 1230) {
  25696. return '中午';
  25697. } else if (hm < 1800) {
  25698. return '下午';
  25699. } else {
  25700. return '晚上';
  25701. }
  25702. },
  25703. calendar : {
  25704. sameDay : '[今天]LT',
  25705. nextDay : '[明天]LT',
  25706. nextWeek : '[下]ddddLT',
  25707. lastDay : '[昨天]LT',
  25708. lastWeek : '[上]ddddLT',
  25709. sameElse : 'L'
  25710. },
  25711. dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
  25712. ordinal : function (number, period) {
  25713. switch (period) {
  25714. case 'd':
  25715. case 'D':
  25716. case 'DDD':
  25717. return number + '日';
  25718. case 'M':
  25719. return number + '月';
  25720. case 'w':
  25721. case 'W':
  25722. return number + '周';
  25723. default:
  25724. return number;
  25725. }
  25726. },
  25727. relativeTime : {
  25728. future : '%s内',
  25729. past : '%s前',
  25730. s : '几秒',
  25731. m : '1 分钟',
  25732. mm : '%d 分钟',
  25733. h : '1 小时',
  25734. hh : '%d 小时',
  25735. d : '1 天',
  25736. dd : '%d 天',
  25737. M : '1 个月',
  25738. MM : '%d 个月',
  25739. y : '1 年',
  25740. yy : '%d 年'
  25741. },
  25742. week : {
  25743. // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
  25744. dow : 1, // Monday is the first day of the week.
  25745. doy : 4 // The week that contains Jan 4th is the first week of the year.
  25746. }
  25747. });
  25748. return zhCn;
  25749. })));
  25750. /***/ }),
  25751. /***/ "./node_modules/moment/locale/zh-tw.js":
  25752. /*!*********************************************!*\
  25753. !*** ./node_modules/moment/locale/zh-tw.js ***!
  25754. \*********************************************/
  25755. /*! no static exports found */
  25756. /***/ (function(module, exports, __webpack_require__) {
  25757. //! moment.js locale configuration
  25758. //! locale : Chinese (Taiwan) [zh-tw]
  25759. //! author : Ben : https://github.com/ben-lin
  25760. //! author : Chris Lam : https://github.com/hehachris
  25761. ;(function (global, factory) {
  25762. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25763. undefined
  25764. }(this, (function (moment) { 'use strict';
  25765. var zhTw = moment.defineLocale('zh-tw', {
  25766. months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
  25767. monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  25768. weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  25769. weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  25770. weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
  25771. longDateFormat : {
  25772. LT : 'HH:mm',
  25773. LTS : 'HH:mm:ss',
  25774. L : 'YYYY年MMMD日',
  25775. LL : 'YYYY年MMMD日',
  25776. LLL : 'YYYY年MMMD日 HH:mm',
  25777. LLLL : 'YYYY年MMMD日dddd HH:mm',
  25778. l : 'YYYY年MMMD日',
  25779. ll : 'YYYY年MMMD日',
  25780. lll : 'YYYY年MMMD日 HH:mm',
  25781. llll : 'YYYY年MMMD日dddd HH:mm'
  25782. },
  25783. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  25784. meridiemHour : function (hour, meridiem) {
  25785. if (hour === 12) {
  25786. hour = 0;
  25787. }
  25788. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  25789. return hour;
  25790. } else if (meridiem === '中午') {
  25791. return hour >= 11 ? hour : hour + 12;
  25792. } else if (meridiem === '下午' || meridiem === '晚上') {
  25793. return hour + 12;
  25794. }
  25795. },
  25796. meridiem : function (hour, minute, isLower) {
  25797. var hm = hour * 100 + minute;
  25798. if (hm < 600) {
  25799. return '凌晨';
  25800. } else if (hm < 900) {
  25801. return '早上';
  25802. } else if (hm < 1130) {
  25803. return '上午';
  25804. } else if (hm < 1230) {
  25805. return '中午';
  25806. } else if (hm < 1800) {
  25807. return '下午';
  25808. } else {
  25809. return '晚上';
  25810. }
  25811. },
  25812. calendar : {
  25813. sameDay : '[今天]LT',
  25814. nextDay : '[明天]LT',
  25815. nextWeek : '[下]ddddLT',
  25816. lastDay : '[昨天]LT',
  25817. lastWeek : '[上]ddddLT',
  25818. sameElse : 'L'
  25819. },
  25820. dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
  25821. ordinal : function (number, period) {
  25822. switch (period) {
  25823. case 'd' :
  25824. case 'D' :
  25825. case 'DDD' :
  25826. return number + '日';
  25827. case 'M' :
  25828. return number + '月';
  25829. case 'w' :
  25830. case 'W' :
  25831. return number + '週';
  25832. default :
  25833. return number;
  25834. }
  25835. },
  25836. relativeTime : {
  25837. future : '%s內',
  25838. past : '%s前',
  25839. s : '幾秒',
  25840. m : '1 分鐘',
  25841. mm : '%d 分鐘',
  25842. h : '1 小時',
  25843. hh : '%d 小時',
  25844. d : '1 天',
  25845. dd : '%d 天',
  25846. M : '1 個月',
  25847. MM : '%d 個月',
  25848. y : '1 年',
  25849. yy : '%d 年'
  25850. }
  25851. });
  25852. return zhTw;
  25853. })));
  25854. /***/ }),
  25855. /***/ "./node_modules/moment/moment.js":
  25856. /*!***************************************!*\
  25857. !*** ./node_modules/moment/moment.js ***!
  25858. \***************************************/
  25859. /*! no static exports found */
  25860. /***/ (function(module, exports, __webpack_require__) {
  25861. /* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js
  25862. //! version : 2.19.4
  25863. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  25864. //! license : MIT
  25865. //! momentjs.com
  25866. ;(function (global, factory) {
  25867. true ? module.exports = factory() :
  25868. undefined
  25869. }(this, (function () { 'use strict';
  25870. var hookCallback;
  25871. function hooks () {
  25872. return hookCallback.apply(null, arguments);
  25873. }
  25874. // This is done to register the method called with moment()
  25875. // without creating circular dependencies.
  25876. function setHookCallback (callback) {
  25877. hookCallback = callback;
  25878. }
  25879. function isArray(input) {
  25880. return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
  25881. }
  25882. function isObject(input) {
  25883. // IE8 will treat undefined and null as object if it wasn't for
  25884. // input != null
  25885. return input != null && Object.prototype.toString.call(input) === '[object Object]';
  25886. }
  25887. function isObjectEmpty(obj) {
  25888. if (Object.getOwnPropertyNames) {
  25889. return (Object.getOwnPropertyNames(obj).length === 0);
  25890. } else {
  25891. var k;
  25892. for (k in obj) {
  25893. if (obj.hasOwnProperty(k)) {
  25894. return false;
  25895. }
  25896. }
  25897. return true;
  25898. }
  25899. }
  25900. function isUndefined(input) {
  25901. return input === void 0;
  25902. }
  25903. function isNumber(input) {
  25904. return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';
  25905. }
  25906. function isDate(input) {
  25907. return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
  25908. }
  25909. function map(arr, fn) {
  25910. var res = [], i;
  25911. for (i = 0; i < arr.length; ++i) {
  25912. res.push(fn(arr[i], i));
  25913. }
  25914. return res;
  25915. }
  25916. function hasOwnProp(a, b) {
  25917. return Object.prototype.hasOwnProperty.call(a, b);
  25918. }
  25919. function extend(a, b) {
  25920. for (var i in b) {
  25921. if (hasOwnProp(b, i)) {
  25922. a[i] = b[i];
  25923. }
  25924. }
  25925. if (hasOwnProp(b, 'toString')) {
  25926. a.toString = b.toString;
  25927. }
  25928. if (hasOwnProp(b, 'valueOf')) {
  25929. a.valueOf = b.valueOf;
  25930. }
  25931. return a;
  25932. }
  25933. function createUTC (input, format, locale, strict) {
  25934. return createLocalOrUTC(input, format, locale, strict, true).utc();
  25935. }
  25936. function defaultParsingFlags() {
  25937. // We need to deep clone this object.
  25938. return {
  25939. empty : false,
  25940. unusedTokens : [],
  25941. unusedInput : [],
  25942. overflow : -2,
  25943. charsLeftOver : 0,
  25944. nullInput : false,
  25945. invalidMonth : null,
  25946. invalidFormat : false,
  25947. userInvalidated : false,
  25948. iso : false,
  25949. parsedDateParts : [],
  25950. meridiem : null,
  25951. rfc2822 : false,
  25952. weekdayMismatch : false
  25953. };
  25954. }
  25955. function getParsingFlags(m) {
  25956. if (m._pf == null) {
  25957. m._pf = defaultParsingFlags();
  25958. }
  25959. return m._pf;
  25960. }
  25961. var some;
  25962. if (Array.prototype.some) {
  25963. some = Array.prototype.some;
  25964. } else {
  25965. some = function (fun) {
  25966. var t = Object(this);
  25967. var len = t.length >>> 0;
  25968. for (var i = 0; i < len; i++) {
  25969. if (i in t && fun.call(this, t[i], i, t)) {
  25970. return true;
  25971. }
  25972. }
  25973. return false;
  25974. };
  25975. }
  25976. function isValid(m) {
  25977. if (m._isValid == null) {
  25978. var flags = getParsingFlags(m);
  25979. var parsedParts = some.call(flags.parsedDateParts, function (i) {
  25980. return i != null;
  25981. });
  25982. var isNowValid = !isNaN(m._d.getTime()) &&
  25983. flags.overflow < 0 &&
  25984. !flags.empty &&
  25985. !flags.invalidMonth &&
  25986. !flags.invalidWeekday &&
  25987. !flags.weekdayMismatch &&
  25988. !flags.nullInput &&
  25989. !flags.invalidFormat &&
  25990. !flags.userInvalidated &&
  25991. (!flags.meridiem || (flags.meridiem && parsedParts));
  25992. if (m._strict) {
  25993. isNowValid = isNowValid &&
  25994. flags.charsLeftOver === 0 &&
  25995. flags.unusedTokens.length === 0 &&
  25996. flags.bigHour === undefined;
  25997. }
  25998. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  25999. m._isValid = isNowValid;
  26000. }
  26001. else {
  26002. return isNowValid;
  26003. }
  26004. }
  26005. return m._isValid;
  26006. }
  26007. function createInvalid (flags) {
  26008. var m = createUTC(NaN);
  26009. if (flags != null) {
  26010. extend(getParsingFlags(m), flags);
  26011. }
  26012. else {
  26013. getParsingFlags(m).userInvalidated = true;
  26014. }
  26015. return m;
  26016. }
  26017. // Plugins that add properties should also add the key here (null value),
  26018. // so we can properly clone ourselves.
  26019. var momentProperties = hooks.momentProperties = [];
  26020. function copyConfig(to, from) {
  26021. var i, prop, val;
  26022. if (!isUndefined(from._isAMomentObject)) {
  26023. to._isAMomentObject = from._isAMomentObject;
  26024. }
  26025. if (!isUndefined(from._i)) {
  26026. to._i = from._i;
  26027. }
  26028. if (!isUndefined(from._f)) {
  26029. to._f = from._f;
  26030. }
  26031. if (!isUndefined(from._l)) {
  26032. to._l = from._l;
  26033. }
  26034. if (!isUndefined(from._strict)) {
  26035. to._strict = from._strict;
  26036. }
  26037. if (!isUndefined(from._tzm)) {
  26038. to._tzm = from._tzm;
  26039. }
  26040. if (!isUndefined(from._isUTC)) {
  26041. to._isUTC = from._isUTC;
  26042. }
  26043. if (!isUndefined(from._offset)) {
  26044. to._offset = from._offset;
  26045. }
  26046. if (!isUndefined(from._pf)) {
  26047. to._pf = getParsingFlags(from);
  26048. }
  26049. if (!isUndefined(from._locale)) {
  26050. to._locale = from._locale;
  26051. }
  26052. if (momentProperties.length > 0) {
  26053. for (i = 0; i < momentProperties.length; i++) {
  26054. prop = momentProperties[i];
  26055. val = from[prop];
  26056. if (!isUndefined(val)) {
  26057. to[prop] = val;
  26058. }
  26059. }
  26060. }
  26061. return to;
  26062. }
  26063. var updateInProgress = false;
  26064. // Moment prototype object
  26065. function Moment(config) {
  26066. copyConfig(this, config);
  26067. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  26068. if (!this.isValid()) {
  26069. this._d = new Date(NaN);
  26070. }
  26071. // Prevent infinite loop in case updateOffset creates new moment
  26072. // objects.
  26073. if (updateInProgress === false) {
  26074. updateInProgress = true;
  26075. hooks.updateOffset(this);
  26076. updateInProgress = false;
  26077. }
  26078. }
  26079. function isMoment (obj) {
  26080. return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
  26081. }
  26082. function absFloor (number) {
  26083. if (number < 0) {
  26084. // -0 -> 0
  26085. return Math.ceil(number) || 0;
  26086. } else {
  26087. return Math.floor(number);
  26088. }
  26089. }
  26090. function toInt(argumentForCoercion) {
  26091. var coercedNumber = +argumentForCoercion,
  26092. value = 0;
  26093. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  26094. value = absFloor(coercedNumber);
  26095. }
  26096. return value;
  26097. }
  26098. // compare two arrays, return the number of differences
  26099. function compareArrays(array1, array2, dontConvert) {
  26100. var len = Math.min(array1.length, array2.length),
  26101. lengthDiff = Math.abs(array1.length - array2.length),
  26102. diffs = 0,
  26103. i;
  26104. for (i = 0; i < len; i++) {
  26105. if ((dontConvert && array1[i] !== array2[i]) ||
  26106. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
  26107. diffs++;
  26108. }
  26109. }
  26110. return diffs + lengthDiff;
  26111. }
  26112. function warn(msg) {
  26113. if (hooks.suppressDeprecationWarnings === false &&
  26114. (typeof console !== 'undefined') && console.warn) {
  26115. console.warn('Deprecation warning: ' + msg);
  26116. }
  26117. }
  26118. function deprecate(msg, fn) {
  26119. var firstTime = true;
  26120. return extend(function () {
  26121. if (hooks.deprecationHandler != null) {
  26122. hooks.deprecationHandler(null, msg);
  26123. }
  26124. if (firstTime) {
  26125. var args = [];
  26126. var arg;
  26127. for (var i = 0; i < arguments.length; i++) {
  26128. arg = '';
  26129. if (typeof arguments[i] === 'object') {
  26130. arg += '\n[' + i + '] ';
  26131. for (var key in arguments[0]) {
  26132. arg += key + ': ' + arguments[0][key] + ', ';
  26133. }
  26134. arg = arg.slice(0, -2); // Remove trailing comma and space
  26135. } else {
  26136. arg = arguments[i];
  26137. }
  26138. args.push(arg);
  26139. }
  26140. warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
  26141. firstTime = false;
  26142. }
  26143. return fn.apply(this, arguments);
  26144. }, fn);
  26145. }
  26146. var deprecations = {};
  26147. function deprecateSimple(name, msg) {
  26148. if (hooks.deprecationHandler != null) {
  26149. hooks.deprecationHandler(name, msg);
  26150. }
  26151. if (!deprecations[name]) {
  26152. warn(msg);
  26153. deprecations[name] = true;
  26154. }
  26155. }
  26156. hooks.suppressDeprecationWarnings = false;
  26157. hooks.deprecationHandler = null;
  26158. function isFunction(input) {
  26159. return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
  26160. }
  26161. function set (config) {
  26162. var prop, i;
  26163. for (i in config) {
  26164. prop = config[i];
  26165. if (isFunction(prop)) {
  26166. this[i] = prop;
  26167. } else {
  26168. this['_' + i] = prop;
  26169. }
  26170. }
  26171. this._config = config;
  26172. // Lenient ordinal parsing accepts just a number in addition to
  26173. // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
  26174. // TODO: Remove "ordinalParse" fallback in next major release.
  26175. this._dayOfMonthOrdinalParseLenient = new RegExp(
  26176. (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
  26177. '|' + (/\d{1,2}/).source);
  26178. }
  26179. function mergeConfigs(parentConfig, childConfig) {
  26180. var res = extend({}, parentConfig), prop;
  26181. for (prop in childConfig) {
  26182. if (hasOwnProp(childConfig, prop)) {
  26183. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  26184. res[prop] = {};
  26185. extend(res[prop], parentConfig[prop]);
  26186. extend(res[prop], childConfig[prop]);
  26187. } else if (childConfig[prop] != null) {
  26188. res[prop] = childConfig[prop];
  26189. } else {
  26190. delete res[prop];
  26191. }
  26192. }
  26193. }
  26194. for (prop in parentConfig) {
  26195. if (hasOwnProp(parentConfig, prop) &&
  26196. !hasOwnProp(childConfig, prop) &&
  26197. isObject(parentConfig[prop])) {
  26198. // make sure changes to properties don't modify parent config
  26199. res[prop] = extend({}, res[prop]);
  26200. }
  26201. }
  26202. return res;
  26203. }
  26204. function Locale(config) {
  26205. if (config != null) {
  26206. this.set(config);
  26207. }
  26208. }
  26209. var keys;
  26210. if (Object.keys) {
  26211. keys = Object.keys;
  26212. } else {
  26213. keys = function (obj) {
  26214. var i, res = [];
  26215. for (i in obj) {
  26216. if (hasOwnProp(obj, i)) {
  26217. res.push(i);
  26218. }
  26219. }
  26220. return res;
  26221. };
  26222. }
  26223. var defaultCalendar = {
  26224. sameDay : '[Today at] LT',
  26225. nextDay : '[Tomorrow at] LT',
  26226. nextWeek : 'dddd [at] LT',
  26227. lastDay : '[Yesterday at] LT',
  26228. lastWeek : '[Last] dddd [at] LT',
  26229. sameElse : 'L'
  26230. };
  26231. function calendar (key, mom, now) {
  26232. var output = this._calendar[key] || this._calendar['sameElse'];
  26233. return isFunction(output) ? output.call(mom, now) : output;
  26234. }
  26235. var defaultLongDateFormat = {
  26236. LTS : 'h:mm:ss A',
  26237. LT : 'h:mm A',
  26238. L : 'MM/DD/YYYY',
  26239. LL : 'MMMM D, YYYY',
  26240. LLL : 'MMMM D, YYYY h:mm A',
  26241. LLLL : 'dddd, MMMM D, YYYY h:mm A'
  26242. };
  26243. function longDateFormat (key) {
  26244. var format = this._longDateFormat[key],
  26245. formatUpper = this._longDateFormat[key.toUpperCase()];
  26246. if (format || !formatUpper) {
  26247. return format;
  26248. }
  26249. this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
  26250. return val.slice(1);
  26251. });
  26252. return this._longDateFormat[key];
  26253. }
  26254. var defaultInvalidDate = 'Invalid date';
  26255. function invalidDate () {
  26256. return this._invalidDate;
  26257. }
  26258. var defaultOrdinal = '%d';
  26259. var defaultDayOfMonthOrdinalParse = /\d{1,2}/;
  26260. function ordinal (number) {
  26261. return this._ordinal.replace('%d', number);
  26262. }
  26263. var defaultRelativeTime = {
  26264. future : 'in %s',
  26265. past : '%s ago',
  26266. s : 'a few seconds',
  26267. ss : '%d seconds',
  26268. m : 'a minute',
  26269. mm : '%d minutes',
  26270. h : 'an hour',
  26271. hh : '%d hours',
  26272. d : 'a day',
  26273. dd : '%d days',
  26274. M : 'a month',
  26275. MM : '%d months',
  26276. y : 'a year',
  26277. yy : '%d years'
  26278. };
  26279. function relativeTime (number, withoutSuffix, string, isFuture) {
  26280. var output = this._relativeTime[string];
  26281. return (isFunction(output)) ?
  26282. output(number, withoutSuffix, string, isFuture) :
  26283. output.replace(/%d/i, number);
  26284. }
  26285. function pastFuture (diff, output) {
  26286. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  26287. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  26288. }
  26289. var aliases = {};
  26290. function addUnitAlias (unit, shorthand) {
  26291. var lowerCase = unit.toLowerCase();
  26292. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  26293. }
  26294. function normalizeUnits(units) {
  26295. return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
  26296. }
  26297. function normalizeObjectUnits(inputObject) {
  26298. var normalizedInput = {},
  26299. normalizedProp,
  26300. prop;
  26301. for (prop in inputObject) {
  26302. if (hasOwnProp(inputObject, prop)) {
  26303. normalizedProp = normalizeUnits(prop);
  26304. if (normalizedProp) {
  26305. normalizedInput[normalizedProp] = inputObject[prop];
  26306. }
  26307. }
  26308. }
  26309. return normalizedInput;
  26310. }
  26311. var priorities = {};
  26312. function addUnitPriority(unit, priority) {
  26313. priorities[unit] = priority;
  26314. }
  26315. function getPrioritizedUnits(unitsObj) {
  26316. var units = [];
  26317. for (var u in unitsObj) {
  26318. units.push({unit: u, priority: priorities[u]});
  26319. }
  26320. units.sort(function (a, b) {
  26321. return a.priority - b.priority;
  26322. });
  26323. return units;
  26324. }
  26325. function zeroFill(number, targetLength, forceSign) {
  26326. var absNumber = '' + Math.abs(number),
  26327. zerosToFill = targetLength - absNumber.length,
  26328. sign = number >= 0;
  26329. return (sign ? (forceSign ? '+' : '') : '-') +
  26330. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  26331. }
  26332. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
  26333. var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
  26334. var formatFunctions = {};
  26335. var formatTokenFunctions = {};
  26336. // token: 'M'
  26337. // padded: ['MM', 2]
  26338. // ordinal: 'Mo'
  26339. // callback: function () { this.month() + 1 }
  26340. function addFormatToken (token, padded, ordinal, callback) {
  26341. var func = callback;
  26342. if (typeof callback === 'string') {
  26343. func = function () {
  26344. return this[callback]();
  26345. };
  26346. }
  26347. if (token) {
  26348. formatTokenFunctions[token] = func;
  26349. }
  26350. if (padded) {
  26351. formatTokenFunctions[padded[0]] = function () {
  26352. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  26353. };
  26354. }
  26355. if (ordinal) {
  26356. formatTokenFunctions[ordinal] = function () {
  26357. return this.localeData().ordinal(func.apply(this, arguments), token);
  26358. };
  26359. }
  26360. }
  26361. function removeFormattingTokens(input) {
  26362. if (input.match(/\[[\s\S]/)) {
  26363. return input.replace(/^\[|\]$/g, '');
  26364. }
  26365. return input.replace(/\\/g, '');
  26366. }
  26367. function makeFormatFunction(format) {
  26368. var array = format.match(formattingTokens), i, length;
  26369. for (i = 0, length = array.length; i < length; i++) {
  26370. if (formatTokenFunctions[array[i]]) {
  26371. array[i] = formatTokenFunctions[array[i]];
  26372. } else {
  26373. array[i] = removeFormattingTokens(array[i]);
  26374. }
  26375. }
  26376. return function (mom) {
  26377. var output = '', i;
  26378. for (i = 0; i < length; i++) {
  26379. output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];
  26380. }
  26381. return output;
  26382. };
  26383. }
  26384. // format date using native date object
  26385. function formatMoment(m, format) {
  26386. if (!m.isValid()) {
  26387. return m.localeData().invalidDate();
  26388. }
  26389. format = expandFormat(format, m.localeData());
  26390. formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
  26391. return formatFunctions[format](m);
  26392. }
  26393. function expandFormat(format, locale) {
  26394. var i = 5;
  26395. function replaceLongDateFormatTokens(input) {
  26396. return locale.longDateFormat(input) || input;
  26397. }
  26398. localFormattingTokens.lastIndex = 0;
  26399. while (i >= 0 && localFormattingTokens.test(format)) {
  26400. format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
  26401. localFormattingTokens.lastIndex = 0;
  26402. i -= 1;
  26403. }
  26404. return format;
  26405. }
  26406. var match1 = /\d/; // 0 - 9
  26407. var match2 = /\d\d/; // 00 - 99
  26408. var match3 = /\d{3}/; // 000 - 999
  26409. var match4 = /\d{4}/; // 0000 - 9999
  26410. var match6 = /[+-]?\d{6}/; // -999999 - 999999
  26411. var match1to2 = /\d\d?/; // 0 - 99
  26412. var match3to4 = /\d\d\d\d?/; // 999 - 9999
  26413. var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
  26414. var match1to3 = /\d{1,3}/; // 0 - 999
  26415. var match1to4 = /\d{1,4}/; // 0 - 9999
  26416. var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
  26417. var matchUnsigned = /\d+/; // 0 - inf
  26418. var matchSigned = /[+-]?\d+/; // -inf - inf
  26419. var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
  26420. var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  26421. var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
  26422. // any word (or two) characters or numbers including two/three word month in arabic.
  26423. // includes scottish gaelic two word and hyphenated months
  26424. var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
  26425. var regexes = {};
  26426. function addRegexToken (token, regex, strictRegex) {
  26427. regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
  26428. return (isStrict && strictRegex) ? strictRegex : regex;
  26429. };
  26430. }
  26431. function getParseRegexForToken (token, config) {
  26432. if (!hasOwnProp(regexes, token)) {
  26433. return new RegExp(unescapeFormat(token));
  26434. }
  26435. return regexes[token](config._strict, config._locale);
  26436. }
  26437. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  26438. function unescapeFormat(s) {
  26439. return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
  26440. return p1 || p2 || p3 || p4;
  26441. }));
  26442. }
  26443. function regexEscape(s) {
  26444. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  26445. }
  26446. var tokens = {};
  26447. function addParseToken (token, callback) {
  26448. var i, func = callback;
  26449. if (typeof token === 'string') {
  26450. token = [token];
  26451. }
  26452. if (isNumber(callback)) {
  26453. func = function (input, array) {
  26454. array[callback] = toInt(input);
  26455. };
  26456. }
  26457. for (i = 0; i < token.length; i++) {
  26458. tokens[token[i]] = func;
  26459. }
  26460. }
  26461. function addWeekParseToken (token, callback) {
  26462. addParseToken(token, function (input, array, config, token) {
  26463. config._w = config._w || {};
  26464. callback(input, config._w, config, token);
  26465. });
  26466. }
  26467. function addTimeToArrayFromToken(token, input, config) {
  26468. if (input != null && hasOwnProp(tokens, token)) {
  26469. tokens[token](input, config._a, config, token);
  26470. }
  26471. }
  26472. var YEAR = 0;
  26473. var MONTH = 1;
  26474. var DATE = 2;
  26475. var HOUR = 3;
  26476. var MINUTE = 4;
  26477. var SECOND = 5;
  26478. var MILLISECOND = 6;
  26479. var WEEK = 7;
  26480. var WEEKDAY = 8;
  26481. // FORMATTING
  26482. addFormatToken('Y', 0, 0, function () {
  26483. var y = this.year();
  26484. return y <= 9999 ? '' + y : '+' + y;
  26485. });
  26486. addFormatToken(0, ['YY', 2], 0, function () {
  26487. return this.year() % 100;
  26488. });
  26489. addFormatToken(0, ['YYYY', 4], 0, 'year');
  26490. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  26491. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  26492. // ALIASES
  26493. addUnitAlias('year', 'y');
  26494. // PRIORITIES
  26495. addUnitPriority('year', 1);
  26496. // PARSING
  26497. addRegexToken('Y', matchSigned);
  26498. addRegexToken('YY', match1to2, match2);
  26499. addRegexToken('YYYY', match1to4, match4);
  26500. addRegexToken('YYYYY', match1to6, match6);
  26501. addRegexToken('YYYYYY', match1to6, match6);
  26502. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  26503. addParseToken('YYYY', function (input, array) {
  26504. array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  26505. });
  26506. addParseToken('YY', function (input, array) {
  26507. array[YEAR] = hooks.parseTwoDigitYear(input);
  26508. });
  26509. addParseToken('Y', function (input, array) {
  26510. array[YEAR] = parseInt(input, 10);
  26511. });
  26512. // HELPERS
  26513. function daysInYear(year) {
  26514. return isLeapYear(year) ? 366 : 365;
  26515. }
  26516. function isLeapYear(year) {
  26517. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  26518. }
  26519. // HOOKS
  26520. hooks.parseTwoDigitYear = function (input) {
  26521. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  26522. };
  26523. // MOMENTS
  26524. var getSetYear = makeGetSet('FullYear', true);
  26525. function getIsLeapYear () {
  26526. return isLeapYear(this.year());
  26527. }
  26528. function makeGetSet (unit, keepTime) {
  26529. return function (value) {
  26530. if (value != null) {
  26531. set$1(this, unit, value);
  26532. hooks.updateOffset(this, keepTime);
  26533. return this;
  26534. } else {
  26535. return get(this, unit);
  26536. }
  26537. };
  26538. }
  26539. function get (mom, unit) {
  26540. return mom.isValid() ?
  26541. mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
  26542. }
  26543. function set$1 (mom, unit, value) {
  26544. if (mom.isValid() && !isNaN(value)) {
  26545. if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) {
  26546. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month()));
  26547. }
  26548. else {
  26549. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  26550. }
  26551. }
  26552. }
  26553. // MOMENTS
  26554. function stringGet (units) {
  26555. units = normalizeUnits(units);
  26556. if (isFunction(this[units])) {
  26557. return this[units]();
  26558. }
  26559. return this;
  26560. }
  26561. function stringSet (units, value) {
  26562. if (typeof units === 'object') {
  26563. units = normalizeObjectUnits(units);
  26564. var prioritized = getPrioritizedUnits(units);
  26565. for (var i = 0; i < prioritized.length; i++) {
  26566. this[prioritized[i].unit](units[prioritized[i].unit]);
  26567. }
  26568. } else {
  26569. units = normalizeUnits(units);
  26570. if (isFunction(this[units])) {
  26571. return this[units](value);
  26572. }
  26573. }
  26574. return this;
  26575. }
  26576. function mod(n, x) {
  26577. return ((n % x) + x) % x;
  26578. }
  26579. var indexOf;
  26580. if (Array.prototype.indexOf) {
  26581. indexOf = Array.prototype.indexOf;
  26582. } else {
  26583. indexOf = function (o) {
  26584. // I know
  26585. var i;
  26586. for (i = 0; i < this.length; ++i) {
  26587. if (this[i] === o) {
  26588. return i;
  26589. }
  26590. }
  26591. return -1;
  26592. };
  26593. }
  26594. function daysInMonth(year, month) {
  26595. if (isNaN(year) || isNaN(month)) {
  26596. return NaN;
  26597. }
  26598. var modMonth = mod(month, 12);
  26599. year += (month - modMonth) / 12;
  26600. return modMonth === 1 ? (isLeapYear(year) ? 29 : 28) : (31 - modMonth % 7 % 2);
  26601. }
  26602. // FORMATTING
  26603. addFormatToken('M', ['MM', 2], 'Mo', function () {
  26604. return this.month() + 1;
  26605. });
  26606. addFormatToken('MMM', 0, 0, function (format) {
  26607. return this.localeData().monthsShort(this, format);
  26608. });
  26609. addFormatToken('MMMM', 0, 0, function (format) {
  26610. return this.localeData().months(this, format);
  26611. });
  26612. // ALIASES
  26613. addUnitAlias('month', 'M');
  26614. // PRIORITY
  26615. addUnitPriority('month', 8);
  26616. // PARSING
  26617. addRegexToken('M', match1to2);
  26618. addRegexToken('MM', match1to2, match2);
  26619. addRegexToken('MMM', function (isStrict, locale) {
  26620. return locale.monthsShortRegex(isStrict);
  26621. });
  26622. addRegexToken('MMMM', function (isStrict, locale) {
  26623. return locale.monthsRegex(isStrict);
  26624. });
  26625. addParseToken(['M', 'MM'], function (input, array) {
  26626. array[MONTH] = toInt(input) - 1;
  26627. });
  26628. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  26629. var month = config._locale.monthsParse(input, token, config._strict);
  26630. // if we didn't find a month name, mark the date as invalid.
  26631. if (month != null) {
  26632. array[MONTH] = month;
  26633. } else {
  26634. getParsingFlags(config).invalidMonth = input;
  26635. }
  26636. });
  26637. // LOCALES
  26638. var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
  26639. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
  26640. function localeMonths (m, format) {
  26641. if (!m) {
  26642. return isArray(this._months) ? this._months :
  26643. this._months['standalone'];
  26644. }
  26645. return isArray(this._months) ? this._months[m.month()] :
  26646. this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
  26647. }
  26648. var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
  26649. function localeMonthsShort (m, format) {
  26650. if (!m) {
  26651. return isArray(this._monthsShort) ? this._monthsShort :
  26652. this._monthsShort['standalone'];
  26653. }
  26654. return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
  26655. this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
  26656. }
  26657. function handleStrictParse(monthName, format, strict) {
  26658. var i, ii, mom, llc = monthName.toLocaleLowerCase();
  26659. if (!this._monthsParse) {
  26660. // this is not used
  26661. this._monthsParse = [];
  26662. this._longMonthsParse = [];
  26663. this._shortMonthsParse = [];
  26664. for (i = 0; i < 12; ++i) {
  26665. mom = createUTC([2000, i]);
  26666. this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
  26667. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  26668. }
  26669. }
  26670. if (strict) {
  26671. if (format === 'MMM') {
  26672. ii = indexOf.call(this._shortMonthsParse, llc);
  26673. return ii !== -1 ? ii : null;
  26674. } else {
  26675. ii = indexOf.call(this._longMonthsParse, llc);
  26676. return ii !== -1 ? ii : null;
  26677. }
  26678. } else {
  26679. if (format === 'MMM') {
  26680. ii = indexOf.call(this._shortMonthsParse, llc);
  26681. if (ii !== -1) {
  26682. return ii;
  26683. }
  26684. ii = indexOf.call(this._longMonthsParse, llc);
  26685. return ii !== -1 ? ii : null;
  26686. } else {
  26687. ii = indexOf.call(this._longMonthsParse, llc);
  26688. if (ii !== -1) {
  26689. return ii;
  26690. }
  26691. ii = indexOf.call(this._shortMonthsParse, llc);
  26692. return ii !== -1 ? ii : null;
  26693. }
  26694. }
  26695. }
  26696. function localeMonthsParse (monthName, format, strict) {
  26697. var i, mom, regex;
  26698. if (this._monthsParseExact) {
  26699. return handleStrictParse.call(this, monthName, format, strict);
  26700. }
  26701. if (!this._monthsParse) {
  26702. this._monthsParse = [];
  26703. this._longMonthsParse = [];
  26704. this._shortMonthsParse = [];
  26705. }
  26706. // TODO: add sorting
  26707. // Sorting makes sure if one month (or abbr) is a prefix of another
  26708. // see sorting in computeMonthsParse
  26709. for (i = 0; i < 12; i++) {
  26710. // make the regex if we don't have it already
  26711. mom = createUTC([2000, i]);
  26712. if (strict && !this._longMonthsParse[i]) {
  26713. this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
  26714. this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
  26715. }
  26716. if (!strict && !this._monthsParse[i]) {
  26717. regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  26718. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  26719. }
  26720. // test the regex
  26721. if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
  26722. return i;
  26723. } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
  26724. return i;
  26725. } else if (!strict && this._monthsParse[i].test(monthName)) {
  26726. return i;
  26727. }
  26728. }
  26729. }
  26730. // MOMENTS
  26731. function setMonth (mom, value) {
  26732. var dayOfMonth;
  26733. if (!mom.isValid()) {
  26734. // No op
  26735. return mom;
  26736. }
  26737. if (typeof value === 'string') {
  26738. if (/^\d+$/.test(value)) {
  26739. value = toInt(value);
  26740. } else {
  26741. value = mom.localeData().monthsParse(value);
  26742. // TODO: Another silent failure?
  26743. if (!isNumber(value)) {
  26744. return mom;
  26745. }
  26746. }
  26747. }
  26748. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  26749. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  26750. return mom;
  26751. }
  26752. function getSetMonth (value) {
  26753. if (value != null) {
  26754. setMonth(this, value);
  26755. hooks.updateOffset(this, true);
  26756. return this;
  26757. } else {
  26758. return get(this, 'Month');
  26759. }
  26760. }
  26761. function getDaysInMonth () {
  26762. return daysInMonth(this.year(), this.month());
  26763. }
  26764. var defaultMonthsShortRegex = matchWord;
  26765. function monthsShortRegex (isStrict) {
  26766. if (this._monthsParseExact) {
  26767. if (!hasOwnProp(this, '_monthsRegex')) {
  26768. computeMonthsParse.call(this);
  26769. }
  26770. if (isStrict) {
  26771. return this._monthsShortStrictRegex;
  26772. } else {
  26773. return this._monthsShortRegex;
  26774. }
  26775. } else {
  26776. if (!hasOwnProp(this, '_monthsShortRegex')) {
  26777. this._monthsShortRegex = defaultMonthsShortRegex;
  26778. }
  26779. return this._monthsShortStrictRegex && isStrict ?
  26780. this._monthsShortStrictRegex : this._monthsShortRegex;
  26781. }
  26782. }
  26783. var defaultMonthsRegex = matchWord;
  26784. function monthsRegex (isStrict) {
  26785. if (this._monthsParseExact) {
  26786. if (!hasOwnProp(this, '_monthsRegex')) {
  26787. computeMonthsParse.call(this);
  26788. }
  26789. if (isStrict) {
  26790. return this._monthsStrictRegex;
  26791. } else {
  26792. return this._monthsRegex;
  26793. }
  26794. } else {
  26795. if (!hasOwnProp(this, '_monthsRegex')) {
  26796. this._monthsRegex = defaultMonthsRegex;
  26797. }
  26798. return this._monthsStrictRegex && isStrict ?
  26799. this._monthsStrictRegex : this._monthsRegex;
  26800. }
  26801. }
  26802. function computeMonthsParse () {
  26803. function cmpLenRev(a, b) {
  26804. return b.length - a.length;
  26805. }
  26806. var shortPieces = [], longPieces = [], mixedPieces = [],
  26807. i, mom;
  26808. for (i = 0; i < 12; i++) {
  26809. // make the regex if we don't have it already
  26810. mom = createUTC([2000, i]);
  26811. shortPieces.push(this.monthsShort(mom, ''));
  26812. longPieces.push(this.months(mom, ''));
  26813. mixedPieces.push(this.months(mom, ''));
  26814. mixedPieces.push(this.monthsShort(mom, ''));
  26815. }
  26816. // Sorting makes sure if one month (or abbr) is a prefix of another it
  26817. // will match the longer piece.
  26818. shortPieces.sort(cmpLenRev);
  26819. longPieces.sort(cmpLenRev);
  26820. mixedPieces.sort(cmpLenRev);
  26821. for (i = 0; i < 12; i++) {
  26822. shortPieces[i] = regexEscape(shortPieces[i]);
  26823. longPieces[i] = regexEscape(longPieces[i]);
  26824. }
  26825. for (i = 0; i < 24; i++) {
  26826. mixedPieces[i] = regexEscape(mixedPieces[i]);
  26827. }
  26828. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  26829. this._monthsShortRegex = this._monthsRegex;
  26830. this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  26831. this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  26832. }
  26833. function createDate (y, m, d, h, M, s, ms) {
  26834. // can't just apply() to create a date:
  26835. // https://stackoverflow.com/q/181348
  26836. var date = new Date(y, m, d, h, M, s, ms);
  26837. // the date constructor remaps years 0-99 to 1900-1999
  26838. if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
  26839. date.setFullYear(y);
  26840. }
  26841. return date;
  26842. }
  26843. function createUTCDate (y) {
  26844. var date = new Date(Date.UTC.apply(null, arguments));
  26845. // the Date.UTC function remaps years 0-99 to 1900-1999
  26846. if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
  26847. date.setUTCFullYear(y);
  26848. }
  26849. return date;
  26850. }
  26851. // start-of-first-week - start-of-year
  26852. function firstWeekOffset(year, dow, doy) {
  26853. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  26854. fwd = 7 + dow - doy,
  26855. // first-week day local weekday -- which local weekday is fwd
  26856. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  26857. return -fwdlw + fwd - 1;
  26858. }
  26859. // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  26860. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  26861. var localWeekday = (7 + weekday - dow) % 7,
  26862. weekOffset = firstWeekOffset(year, dow, doy),
  26863. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  26864. resYear, resDayOfYear;
  26865. if (dayOfYear <= 0) {
  26866. resYear = year - 1;
  26867. resDayOfYear = daysInYear(resYear) + dayOfYear;
  26868. } else if (dayOfYear > daysInYear(year)) {
  26869. resYear = year + 1;
  26870. resDayOfYear = dayOfYear - daysInYear(year);
  26871. } else {
  26872. resYear = year;
  26873. resDayOfYear = dayOfYear;
  26874. }
  26875. return {
  26876. year: resYear,
  26877. dayOfYear: resDayOfYear
  26878. };
  26879. }
  26880. function weekOfYear(mom, dow, doy) {
  26881. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  26882. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  26883. resWeek, resYear;
  26884. if (week < 1) {
  26885. resYear = mom.year() - 1;
  26886. resWeek = week + weeksInYear(resYear, dow, doy);
  26887. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  26888. resWeek = week - weeksInYear(mom.year(), dow, doy);
  26889. resYear = mom.year() + 1;
  26890. } else {
  26891. resYear = mom.year();
  26892. resWeek = week;
  26893. }
  26894. return {
  26895. week: resWeek,
  26896. year: resYear
  26897. };
  26898. }
  26899. function weeksInYear(year, dow, doy) {
  26900. var weekOffset = firstWeekOffset(year, dow, doy),
  26901. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  26902. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  26903. }
  26904. // FORMATTING
  26905. addFormatToken('w', ['ww', 2], 'wo', 'week');
  26906. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  26907. // ALIASES
  26908. addUnitAlias('week', 'w');
  26909. addUnitAlias('isoWeek', 'W');
  26910. // PRIORITIES
  26911. addUnitPriority('week', 5);
  26912. addUnitPriority('isoWeek', 5);
  26913. // PARSING
  26914. addRegexToken('w', match1to2);
  26915. addRegexToken('ww', match1to2, match2);
  26916. addRegexToken('W', match1to2);
  26917. addRegexToken('WW', match1to2, match2);
  26918. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
  26919. week[token.substr(0, 1)] = toInt(input);
  26920. });
  26921. // HELPERS
  26922. // LOCALES
  26923. function localeWeek (mom) {
  26924. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  26925. }
  26926. var defaultLocaleWeek = {
  26927. dow : 0, // Sunday is the first day of the week.
  26928. doy : 6 // The week that contains Jan 1st is the first week of the year.
  26929. };
  26930. function localeFirstDayOfWeek () {
  26931. return this._week.dow;
  26932. }
  26933. function localeFirstDayOfYear () {
  26934. return this._week.doy;
  26935. }
  26936. // MOMENTS
  26937. function getSetWeek (input) {
  26938. var week = this.localeData().week(this);
  26939. return input == null ? week : this.add((input - week) * 7, 'd');
  26940. }
  26941. function getSetISOWeek (input) {
  26942. var week = weekOfYear(this, 1, 4).week;
  26943. return input == null ? week : this.add((input - week) * 7, 'd');
  26944. }
  26945. // FORMATTING
  26946. addFormatToken('d', 0, 'do', 'day');
  26947. addFormatToken('dd', 0, 0, function (format) {
  26948. return this.localeData().weekdaysMin(this, format);
  26949. });
  26950. addFormatToken('ddd', 0, 0, function (format) {
  26951. return this.localeData().weekdaysShort(this, format);
  26952. });
  26953. addFormatToken('dddd', 0, 0, function (format) {
  26954. return this.localeData().weekdays(this, format);
  26955. });
  26956. addFormatToken('e', 0, 0, 'weekday');
  26957. addFormatToken('E', 0, 0, 'isoWeekday');
  26958. // ALIASES
  26959. addUnitAlias('day', 'd');
  26960. addUnitAlias('weekday', 'e');
  26961. addUnitAlias('isoWeekday', 'E');
  26962. // PRIORITY
  26963. addUnitPriority('day', 11);
  26964. addUnitPriority('weekday', 11);
  26965. addUnitPriority('isoWeekday', 11);
  26966. // PARSING
  26967. addRegexToken('d', match1to2);
  26968. addRegexToken('e', match1to2);
  26969. addRegexToken('E', match1to2);
  26970. addRegexToken('dd', function (isStrict, locale) {
  26971. return locale.weekdaysMinRegex(isStrict);
  26972. });
  26973. addRegexToken('ddd', function (isStrict, locale) {
  26974. return locale.weekdaysShortRegex(isStrict);
  26975. });
  26976. addRegexToken('dddd', function (isStrict, locale) {
  26977. return locale.weekdaysRegex(isStrict);
  26978. });
  26979. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  26980. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  26981. // if we didn't get a weekday name, mark the date as invalid
  26982. if (weekday != null) {
  26983. week.d = weekday;
  26984. } else {
  26985. getParsingFlags(config).invalidWeekday = input;
  26986. }
  26987. });
  26988. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  26989. week[token] = toInt(input);
  26990. });
  26991. // HELPERS
  26992. function parseWeekday(input, locale) {
  26993. if (typeof input !== 'string') {
  26994. return input;
  26995. }
  26996. if (!isNaN(input)) {
  26997. return parseInt(input, 10);
  26998. }
  26999. input = locale.weekdaysParse(input);
  27000. if (typeof input === 'number') {
  27001. return input;
  27002. }
  27003. return null;
  27004. }
  27005. function parseIsoWeekday(input, locale) {
  27006. if (typeof input === 'string') {
  27007. return locale.weekdaysParse(input) % 7 || 7;
  27008. }
  27009. return isNaN(input) ? null : input;
  27010. }
  27011. // LOCALES
  27012. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
  27013. function localeWeekdays (m, format) {
  27014. if (!m) {
  27015. return isArray(this._weekdays) ? this._weekdays :
  27016. this._weekdays['standalone'];
  27017. }
  27018. return isArray(this._weekdays) ? this._weekdays[m.day()] :
  27019. this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
  27020. }
  27021. var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
  27022. function localeWeekdaysShort (m) {
  27023. return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
  27024. }
  27025. var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
  27026. function localeWeekdaysMin (m) {
  27027. return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
  27028. }
  27029. function handleStrictParse$1(weekdayName, format, strict) {
  27030. var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
  27031. if (!this._weekdaysParse) {
  27032. this._weekdaysParse = [];
  27033. this._shortWeekdaysParse = [];
  27034. this._minWeekdaysParse = [];
  27035. for (i = 0; i < 7; ++i) {
  27036. mom = createUTC([2000, 1]).day(i);
  27037. this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
  27038. this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
  27039. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  27040. }
  27041. }
  27042. if (strict) {
  27043. if (format === 'dddd') {
  27044. ii = indexOf.call(this._weekdaysParse, llc);
  27045. return ii !== -1 ? ii : null;
  27046. } else if (format === 'ddd') {
  27047. ii = indexOf.call(this._shortWeekdaysParse, llc);
  27048. return ii !== -1 ? ii : null;
  27049. } else {
  27050. ii = indexOf.call(this._minWeekdaysParse, llc);
  27051. return ii !== -1 ? ii : null;
  27052. }
  27053. } else {
  27054. if (format === 'dddd') {
  27055. ii = indexOf.call(this._weekdaysParse, llc);
  27056. if (ii !== -1) {
  27057. return ii;
  27058. }
  27059. ii = indexOf.call(this._shortWeekdaysParse, llc);
  27060. if (ii !== -1) {
  27061. return ii;
  27062. }
  27063. ii = indexOf.call(this._minWeekdaysParse, llc);
  27064. return ii !== -1 ? ii : null;
  27065. } else if (format === 'ddd') {
  27066. ii = indexOf.call(this._shortWeekdaysParse, llc);
  27067. if (ii !== -1) {
  27068. return ii;
  27069. }
  27070. ii = indexOf.call(this._weekdaysParse, llc);
  27071. if (ii !== -1) {
  27072. return ii;
  27073. }
  27074. ii = indexOf.call(this._minWeekdaysParse, llc);
  27075. return ii !== -1 ? ii : null;
  27076. } else {
  27077. ii = indexOf.call(this._minWeekdaysParse, llc);
  27078. if (ii !== -1) {
  27079. return ii;
  27080. }
  27081. ii = indexOf.call(this._weekdaysParse, llc);
  27082. if (ii !== -1) {
  27083. return ii;
  27084. }
  27085. ii = indexOf.call(this._shortWeekdaysParse, llc);
  27086. return ii !== -1 ? ii : null;
  27087. }
  27088. }
  27089. }
  27090. function localeWeekdaysParse (weekdayName, format, strict) {
  27091. var i, mom, regex;
  27092. if (this._weekdaysParseExact) {
  27093. return handleStrictParse$1.call(this, weekdayName, format, strict);
  27094. }
  27095. if (!this._weekdaysParse) {
  27096. this._weekdaysParse = [];
  27097. this._minWeekdaysParse = [];
  27098. this._shortWeekdaysParse = [];
  27099. this._fullWeekdaysParse = [];
  27100. }
  27101. for (i = 0; i < 7; i++) {
  27102. // make the regex if we don't have it already
  27103. mom = createUTC([2000, 1]).day(i);
  27104. if (strict && !this._fullWeekdaysParse[i]) {
  27105. this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
  27106. this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
  27107. this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
  27108. }
  27109. if (!this._weekdaysParse[i]) {
  27110. regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
  27111. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  27112. }
  27113. // test the regex
  27114. if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
  27115. return i;
  27116. } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
  27117. return i;
  27118. } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
  27119. return i;
  27120. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  27121. return i;
  27122. }
  27123. }
  27124. }
  27125. // MOMENTS
  27126. function getSetDayOfWeek (input) {
  27127. if (!this.isValid()) {
  27128. return input != null ? this : NaN;
  27129. }
  27130. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  27131. if (input != null) {
  27132. input = parseWeekday(input, this.localeData());
  27133. return this.add(input - day, 'd');
  27134. } else {
  27135. return day;
  27136. }
  27137. }
  27138. function getSetLocaleDayOfWeek (input) {
  27139. if (!this.isValid()) {
  27140. return input != null ? this : NaN;
  27141. }
  27142. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  27143. return input == null ? weekday : this.add(input - weekday, 'd');
  27144. }
  27145. function getSetISODayOfWeek (input) {
  27146. if (!this.isValid()) {
  27147. return input != null ? this : NaN;
  27148. }
  27149. // behaves the same as moment#day except
  27150. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  27151. // as a setter, sunday should belong to the previous week.
  27152. if (input != null) {
  27153. var weekday = parseIsoWeekday(input, this.localeData());
  27154. return this.day(this.day() % 7 ? weekday : weekday - 7);
  27155. } else {
  27156. return this.day() || 7;
  27157. }
  27158. }
  27159. var defaultWeekdaysRegex = matchWord;
  27160. function weekdaysRegex (isStrict) {
  27161. if (this._weekdaysParseExact) {
  27162. if (!hasOwnProp(this, '_weekdaysRegex')) {
  27163. computeWeekdaysParse.call(this);
  27164. }
  27165. if (isStrict) {
  27166. return this._weekdaysStrictRegex;
  27167. } else {
  27168. return this._weekdaysRegex;
  27169. }
  27170. } else {
  27171. if (!hasOwnProp(this, '_weekdaysRegex')) {
  27172. this._weekdaysRegex = defaultWeekdaysRegex;
  27173. }
  27174. return this._weekdaysStrictRegex && isStrict ?
  27175. this._weekdaysStrictRegex : this._weekdaysRegex;
  27176. }
  27177. }
  27178. var defaultWeekdaysShortRegex = matchWord;
  27179. function weekdaysShortRegex (isStrict) {
  27180. if (this._weekdaysParseExact) {
  27181. if (!hasOwnProp(this, '_weekdaysRegex')) {
  27182. computeWeekdaysParse.call(this);
  27183. }
  27184. if (isStrict) {
  27185. return this._weekdaysShortStrictRegex;
  27186. } else {
  27187. return this._weekdaysShortRegex;
  27188. }
  27189. } else {
  27190. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  27191. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  27192. }
  27193. return this._weekdaysShortStrictRegex && isStrict ?
  27194. this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  27195. }
  27196. }
  27197. var defaultWeekdaysMinRegex = matchWord;
  27198. function weekdaysMinRegex (isStrict) {
  27199. if (this._weekdaysParseExact) {
  27200. if (!hasOwnProp(this, '_weekdaysRegex')) {
  27201. computeWeekdaysParse.call(this);
  27202. }
  27203. if (isStrict) {
  27204. return this._weekdaysMinStrictRegex;
  27205. } else {
  27206. return this._weekdaysMinRegex;
  27207. }
  27208. } else {
  27209. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  27210. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  27211. }
  27212. return this._weekdaysMinStrictRegex && isStrict ?
  27213. this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  27214. }
  27215. }
  27216. function computeWeekdaysParse () {
  27217. function cmpLenRev(a, b) {
  27218. return b.length - a.length;
  27219. }
  27220. var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
  27221. i, mom, minp, shortp, longp;
  27222. for (i = 0; i < 7; i++) {
  27223. // make the regex if we don't have it already
  27224. mom = createUTC([2000, 1]).day(i);
  27225. minp = this.weekdaysMin(mom, '');
  27226. shortp = this.weekdaysShort(mom, '');
  27227. longp = this.weekdays(mom, '');
  27228. minPieces.push(minp);
  27229. shortPieces.push(shortp);
  27230. longPieces.push(longp);
  27231. mixedPieces.push(minp);
  27232. mixedPieces.push(shortp);
  27233. mixedPieces.push(longp);
  27234. }
  27235. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  27236. // will match the longer piece.
  27237. minPieces.sort(cmpLenRev);
  27238. shortPieces.sort(cmpLenRev);
  27239. longPieces.sort(cmpLenRev);
  27240. mixedPieces.sort(cmpLenRev);
  27241. for (i = 0; i < 7; i++) {
  27242. shortPieces[i] = regexEscape(shortPieces[i]);
  27243. longPieces[i] = regexEscape(longPieces[i]);
  27244. mixedPieces[i] = regexEscape(mixedPieces[i]);
  27245. }
  27246. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  27247. this._weekdaysShortRegex = this._weekdaysRegex;
  27248. this._weekdaysMinRegex = this._weekdaysRegex;
  27249. this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  27250. this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  27251. this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
  27252. }
  27253. // FORMATTING
  27254. function hFormat() {
  27255. return this.hours() % 12 || 12;
  27256. }
  27257. function kFormat() {
  27258. return this.hours() || 24;
  27259. }
  27260. addFormatToken('H', ['HH', 2], 0, 'hour');
  27261. addFormatToken('h', ['hh', 2], 0, hFormat);
  27262. addFormatToken('k', ['kk', 2], 0, kFormat);
  27263. addFormatToken('hmm', 0, 0, function () {
  27264. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  27265. });
  27266. addFormatToken('hmmss', 0, 0, function () {
  27267. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
  27268. zeroFill(this.seconds(), 2);
  27269. });
  27270. addFormatToken('Hmm', 0, 0, function () {
  27271. return '' + this.hours() + zeroFill(this.minutes(), 2);
  27272. });
  27273. addFormatToken('Hmmss', 0, 0, function () {
  27274. return '' + this.hours() + zeroFill(this.minutes(), 2) +
  27275. zeroFill(this.seconds(), 2);
  27276. });
  27277. function meridiem (token, lowercase) {
  27278. addFormatToken(token, 0, 0, function () {
  27279. return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
  27280. });
  27281. }
  27282. meridiem('a', true);
  27283. meridiem('A', false);
  27284. // ALIASES
  27285. addUnitAlias('hour', 'h');
  27286. // PRIORITY
  27287. addUnitPriority('hour', 13);
  27288. // PARSING
  27289. function matchMeridiem (isStrict, locale) {
  27290. return locale._meridiemParse;
  27291. }
  27292. addRegexToken('a', matchMeridiem);
  27293. addRegexToken('A', matchMeridiem);
  27294. addRegexToken('H', match1to2);
  27295. addRegexToken('h', match1to2);
  27296. addRegexToken('k', match1to2);
  27297. addRegexToken('HH', match1to2, match2);
  27298. addRegexToken('hh', match1to2, match2);
  27299. addRegexToken('kk', match1to2, match2);
  27300. addRegexToken('hmm', match3to4);
  27301. addRegexToken('hmmss', match5to6);
  27302. addRegexToken('Hmm', match3to4);
  27303. addRegexToken('Hmmss', match5to6);
  27304. addParseToken(['H', 'HH'], HOUR);
  27305. addParseToken(['k', 'kk'], function (input, array, config) {
  27306. var kInput = toInt(input);
  27307. array[HOUR] = kInput === 24 ? 0 : kInput;
  27308. });
  27309. addParseToken(['a', 'A'], function (input, array, config) {
  27310. config._isPm = config._locale.isPM(input);
  27311. config._meridiem = input;
  27312. });
  27313. addParseToken(['h', 'hh'], function (input, array, config) {
  27314. array[HOUR] = toInt(input);
  27315. getParsingFlags(config).bigHour = true;
  27316. });
  27317. addParseToken('hmm', function (input, array, config) {
  27318. var pos = input.length - 2;
  27319. array[HOUR] = toInt(input.substr(0, pos));
  27320. array[MINUTE] = toInt(input.substr(pos));
  27321. getParsingFlags(config).bigHour = true;
  27322. });
  27323. addParseToken('hmmss', function (input, array, config) {
  27324. var pos1 = input.length - 4;
  27325. var pos2 = input.length - 2;
  27326. array[HOUR] = toInt(input.substr(0, pos1));
  27327. array[MINUTE] = toInt(input.substr(pos1, 2));
  27328. array[SECOND] = toInt(input.substr(pos2));
  27329. getParsingFlags(config).bigHour = true;
  27330. });
  27331. addParseToken('Hmm', function (input, array, config) {
  27332. var pos = input.length - 2;
  27333. array[HOUR] = toInt(input.substr(0, pos));
  27334. array[MINUTE] = toInt(input.substr(pos));
  27335. });
  27336. addParseToken('Hmmss', function (input, array, config) {
  27337. var pos1 = input.length - 4;
  27338. var pos2 = input.length - 2;
  27339. array[HOUR] = toInt(input.substr(0, pos1));
  27340. array[MINUTE] = toInt(input.substr(pos1, 2));
  27341. array[SECOND] = toInt(input.substr(pos2));
  27342. });
  27343. // LOCALES
  27344. function localeIsPM (input) {
  27345. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  27346. // Using charAt should be more compatible.
  27347. return ((input + '').toLowerCase().charAt(0) === 'p');
  27348. }
  27349. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
  27350. function localeMeridiem (hours, minutes, isLower) {
  27351. if (hours > 11) {
  27352. return isLower ? 'pm' : 'PM';
  27353. } else {
  27354. return isLower ? 'am' : 'AM';
  27355. }
  27356. }
  27357. // MOMENTS
  27358. // Setting the hour should keep the time, because the user explicitly
  27359. // specified which hour he wants. So trying to maintain the same hour (in
  27360. // a new timezone) makes sense. Adding/subtracting hours does not follow
  27361. // this rule.
  27362. var getSetHour = makeGetSet('Hours', true);
  27363. // months
  27364. // week
  27365. // weekdays
  27366. // meridiem
  27367. var baseConfig = {
  27368. calendar: defaultCalendar,
  27369. longDateFormat: defaultLongDateFormat,
  27370. invalidDate: defaultInvalidDate,
  27371. ordinal: defaultOrdinal,
  27372. dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
  27373. relativeTime: defaultRelativeTime,
  27374. months: defaultLocaleMonths,
  27375. monthsShort: defaultLocaleMonthsShort,
  27376. week: defaultLocaleWeek,
  27377. weekdays: defaultLocaleWeekdays,
  27378. weekdaysMin: defaultLocaleWeekdaysMin,
  27379. weekdaysShort: defaultLocaleWeekdaysShort,
  27380. meridiemParse: defaultLocaleMeridiemParse
  27381. };
  27382. // internal storage for locale config files
  27383. var locales = {};
  27384. var localeFamilies = {};
  27385. var globalLocale;
  27386. function normalizeLocale(key) {
  27387. return key ? key.toLowerCase().replace('_', '-') : key;
  27388. }
  27389. // pick the locale from the array
  27390. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  27391. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  27392. function chooseLocale(names) {
  27393. var i = 0, j, next, locale, split;
  27394. while (i < names.length) {
  27395. split = normalizeLocale(names[i]).split('-');
  27396. j = split.length;
  27397. next = normalizeLocale(names[i + 1]);
  27398. next = next ? next.split('-') : null;
  27399. while (j > 0) {
  27400. locale = loadLocale(split.slice(0, j).join('-'));
  27401. if (locale) {
  27402. return locale;
  27403. }
  27404. if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
  27405. //the next array item is better than a shallower substring of this one
  27406. break;
  27407. }
  27408. j--;
  27409. }
  27410. i++;
  27411. }
  27412. return null;
  27413. }
  27414. function loadLocale(name) {
  27415. var oldLocale = null;
  27416. // TODO: Find a better way to register and load all the locales in Node
  27417. if (!locales[name] && (typeof module !== 'undefined') &&
  27418. module && module.exports) {
  27419. try {
  27420. oldLocale = globalLocale._abbr;
  27421. var aliasedRequire = require;
  27422. !(function webpackMissingModule() { var e = new Error("Cannot find module 'undefined'"); e.code = 'MODULE_NOT_FOUND'; throw e; }());
  27423. getSetGlobalLocale(oldLocale);
  27424. } catch (e) {}
  27425. }
  27426. return locales[name];
  27427. }
  27428. // This function will load locale and then set the global locale. If
  27429. // no arguments are passed in, it will simply return the current global
  27430. // locale key.
  27431. function getSetGlobalLocale (key, values) {
  27432. var data;
  27433. if (key) {
  27434. if (isUndefined(values)) {
  27435. data = getLocale(key);
  27436. }
  27437. else {
  27438. data = defineLocale(key, values);
  27439. }
  27440. if (data) {
  27441. // moment.duration._locale = moment._locale = data;
  27442. globalLocale = data;
  27443. }
  27444. }
  27445. return globalLocale._abbr;
  27446. }
  27447. function defineLocale (name, config) {
  27448. if (config !== null) {
  27449. var parentConfig = baseConfig;
  27450. config.abbr = name;
  27451. if (locales[name] != null) {
  27452. deprecateSimple('defineLocaleOverride',
  27453. 'use moment.updateLocale(localeName, config) to change ' +
  27454. 'an existing locale. moment.defineLocale(localeName, ' +
  27455. 'config) should only be used for creating a new locale ' +
  27456. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
  27457. parentConfig = locales[name]._config;
  27458. } else if (config.parentLocale != null) {
  27459. if (locales[config.parentLocale] != null) {
  27460. parentConfig = locales[config.parentLocale]._config;
  27461. } else {
  27462. if (!localeFamilies[config.parentLocale]) {
  27463. localeFamilies[config.parentLocale] = [];
  27464. }
  27465. localeFamilies[config.parentLocale].push({
  27466. name: name,
  27467. config: config
  27468. });
  27469. return null;
  27470. }
  27471. }
  27472. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  27473. if (localeFamilies[name]) {
  27474. localeFamilies[name].forEach(function (x) {
  27475. defineLocale(x.name, x.config);
  27476. });
  27477. }
  27478. // backwards compat for now: also set the locale
  27479. // make sure we set the locale AFTER all child locales have been
  27480. // created, so we won't end up with the child locale set.
  27481. getSetGlobalLocale(name);
  27482. return locales[name];
  27483. } else {
  27484. // useful for testing
  27485. delete locales[name];
  27486. return null;
  27487. }
  27488. }
  27489. function updateLocale(name, config) {
  27490. if (config != null) {
  27491. var locale, tmpLocale, parentConfig = baseConfig;
  27492. // MERGE
  27493. tmpLocale = loadLocale(name);
  27494. if (tmpLocale != null) {
  27495. parentConfig = tmpLocale._config;
  27496. }
  27497. config = mergeConfigs(parentConfig, config);
  27498. locale = new Locale(config);
  27499. locale.parentLocale = locales[name];
  27500. locales[name] = locale;
  27501. // backwards compat for now: also set the locale
  27502. getSetGlobalLocale(name);
  27503. } else {
  27504. // pass null for config to unupdate, useful for tests
  27505. if (locales[name] != null) {
  27506. if (locales[name].parentLocale != null) {
  27507. locales[name] = locales[name].parentLocale;
  27508. } else if (locales[name] != null) {
  27509. delete locales[name];
  27510. }
  27511. }
  27512. }
  27513. return locales[name];
  27514. }
  27515. // returns locale data
  27516. function getLocale (key) {
  27517. var locale;
  27518. if (key && key._locale && key._locale._abbr) {
  27519. key = key._locale._abbr;
  27520. }
  27521. if (!key) {
  27522. return globalLocale;
  27523. }
  27524. if (!isArray(key)) {
  27525. //short-circuit everything else
  27526. locale = loadLocale(key);
  27527. if (locale) {
  27528. return locale;
  27529. }
  27530. key = [key];
  27531. }
  27532. return chooseLocale(key);
  27533. }
  27534. function listLocales() {
  27535. return keys(locales);
  27536. }
  27537. function checkOverflow (m) {
  27538. var overflow;
  27539. var a = m._a;
  27540. if (a && getParsingFlags(m).overflow === -2) {
  27541. overflow =
  27542. a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
  27543. a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
  27544. a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
  27545. a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
  27546. a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
  27547. a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
  27548. -1;
  27549. if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  27550. overflow = DATE;
  27551. }
  27552. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  27553. overflow = WEEK;
  27554. }
  27555. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  27556. overflow = WEEKDAY;
  27557. }
  27558. getParsingFlags(m).overflow = overflow;
  27559. }
  27560. return m;
  27561. }
  27562. // Pick the first defined of two or three arguments.
  27563. function defaults(a, b, c) {
  27564. if (a != null) {
  27565. return a;
  27566. }
  27567. if (b != null) {
  27568. return b;
  27569. }
  27570. return c;
  27571. }
  27572. function currentDateArray(config) {
  27573. // hooks is actually the exported moment object
  27574. var nowValue = new Date(hooks.now());
  27575. if (config._useUTC) {
  27576. return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
  27577. }
  27578. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  27579. }
  27580. // convert an array to a date.
  27581. // the array should mirror the parameters below
  27582. // note: all values past the year are optional and will default to the lowest possible value.
  27583. // [year, month, day , hour, minute, second, millisecond]
  27584. function configFromArray (config) {
  27585. var i, date, input = [], currentDate, expectedWeekday, yearToUse;
  27586. if (config._d) {
  27587. return;
  27588. }
  27589. currentDate = currentDateArray(config);
  27590. //compute day of the year from weeks and weekdays
  27591. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  27592. dayOfYearFromWeekInfo(config);
  27593. }
  27594. //if the day of the year is set, figure out what it is
  27595. if (config._dayOfYear != null) {
  27596. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  27597. if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
  27598. getParsingFlags(config)._overflowDayOfYear = true;
  27599. }
  27600. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  27601. config._a[MONTH] = date.getUTCMonth();
  27602. config._a[DATE] = date.getUTCDate();
  27603. }
  27604. // Default to current date.
  27605. // * if no year, month, day of month are given, default to today
  27606. // * if day of month is given, default month and year
  27607. // * if month is given, default only year
  27608. // * if year is given, don't default anything
  27609. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  27610. config._a[i] = input[i] = currentDate[i];
  27611. }
  27612. // Zero out whatever was not defaulted, including time
  27613. for (; i < 7; i++) {
  27614. config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
  27615. }
  27616. // Check for 24:00:00.000
  27617. if (config._a[HOUR] === 24 &&
  27618. config._a[MINUTE] === 0 &&
  27619. config._a[SECOND] === 0 &&
  27620. config._a[MILLISECOND] === 0) {
  27621. config._nextDay = true;
  27622. config._a[HOUR] = 0;
  27623. }
  27624. config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
  27625. expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
  27626. // Apply timezone offset from input. The actual utcOffset can be changed
  27627. // with parseZone.
  27628. if (config._tzm != null) {
  27629. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  27630. }
  27631. if (config._nextDay) {
  27632. config._a[HOUR] = 24;
  27633. }
  27634. // check for mismatching day of week
  27635. if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
  27636. getParsingFlags(config).weekdayMismatch = true;
  27637. }
  27638. }
  27639. function dayOfYearFromWeekInfo(config) {
  27640. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
  27641. w = config._w;
  27642. if (w.GG != null || w.W != null || w.E != null) {
  27643. dow = 1;
  27644. doy = 4;
  27645. // TODO: We need to take the current isoWeekYear, but that depends on
  27646. // how we interpret now (local, utc, fixed offset). So create
  27647. // a now version of current config (take local/utc/offset flags, and
  27648. // create now).
  27649. weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);
  27650. week = defaults(w.W, 1);
  27651. weekday = defaults(w.E, 1);
  27652. if (weekday < 1 || weekday > 7) {
  27653. weekdayOverflow = true;
  27654. }
  27655. } else {
  27656. dow = config._locale._week.dow;
  27657. doy = config._locale._week.doy;
  27658. var curWeek = weekOfYear(createLocal(), dow, doy);
  27659. weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
  27660. // Default to current week.
  27661. week = defaults(w.w, curWeek.week);
  27662. if (w.d != null) {
  27663. // weekday -- low day numbers are considered next week
  27664. weekday = w.d;
  27665. if (weekday < 0 || weekday > 6) {
  27666. weekdayOverflow = true;
  27667. }
  27668. } else if (w.e != null) {
  27669. // local weekday -- counting starts from begining of week
  27670. weekday = w.e + dow;
  27671. if (w.e < 0 || w.e > 6) {
  27672. weekdayOverflow = true;
  27673. }
  27674. } else {
  27675. // default to begining of week
  27676. weekday = dow;
  27677. }
  27678. }
  27679. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  27680. getParsingFlags(config)._overflowWeeks = true;
  27681. } else if (weekdayOverflow != null) {
  27682. getParsingFlags(config)._overflowWeekday = true;
  27683. } else {
  27684. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  27685. config._a[YEAR] = temp.year;
  27686. config._dayOfYear = temp.dayOfYear;
  27687. }
  27688. }
  27689. // iso 8601 regex
  27690. // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
  27691. var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
  27692. var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
  27693. var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
  27694. var isoDates = [
  27695. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  27696. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  27697. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  27698. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  27699. ['YYYY-DDD', /\d{4}-\d{3}/],
  27700. ['YYYY-MM', /\d{4}-\d\d/, false],
  27701. ['YYYYYYMMDD', /[+-]\d{10}/],
  27702. ['YYYYMMDD', /\d{8}/],
  27703. // YYYYMM is NOT allowed by the standard
  27704. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  27705. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  27706. ['YYYYDDD', /\d{7}/]
  27707. ];
  27708. // iso time formats and regexes
  27709. var isoTimes = [
  27710. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  27711. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  27712. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  27713. ['HH:mm', /\d\d:\d\d/],
  27714. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  27715. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  27716. ['HHmmss', /\d\d\d\d\d\d/],
  27717. ['HHmm', /\d\d\d\d/],
  27718. ['HH', /\d\d/]
  27719. ];
  27720. var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
  27721. // date from iso format
  27722. function configFromISO(config) {
  27723. var i, l,
  27724. string = config._i,
  27725. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  27726. allowTime, dateFormat, timeFormat, tzFormat;
  27727. if (match) {
  27728. getParsingFlags(config).iso = true;
  27729. for (i = 0, l = isoDates.length; i < l; i++) {
  27730. if (isoDates[i][1].exec(match[1])) {
  27731. dateFormat = isoDates[i][0];
  27732. allowTime = isoDates[i][2] !== false;
  27733. break;
  27734. }
  27735. }
  27736. if (dateFormat == null) {
  27737. config._isValid = false;
  27738. return;
  27739. }
  27740. if (match[3]) {
  27741. for (i = 0, l = isoTimes.length; i < l; i++) {
  27742. if (isoTimes[i][1].exec(match[3])) {
  27743. // match[2] should be 'T' or space
  27744. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  27745. break;
  27746. }
  27747. }
  27748. if (timeFormat == null) {
  27749. config._isValid = false;
  27750. return;
  27751. }
  27752. }
  27753. if (!allowTime && timeFormat != null) {
  27754. config._isValid = false;
  27755. return;
  27756. }
  27757. if (match[4]) {
  27758. if (tzRegex.exec(match[4])) {
  27759. tzFormat = 'Z';
  27760. } else {
  27761. config._isValid = false;
  27762. return;
  27763. }
  27764. }
  27765. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  27766. configFromStringAndFormat(config);
  27767. } else {
  27768. config._isValid = false;
  27769. }
  27770. }
  27771. // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
  27772. var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;
  27773. function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
  27774. var result = [
  27775. untruncateYear(yearStr),
  27776. defaultLocaleMonthsShort.indexOf(monthStr),
  27777. parseInt(dayStr, 10),
  27778. parseInt(hourStr, 10),
  27779. parseInt(minuteStr, 10)
  27780. ];
  27781. if (secondStr) {
  27782. result.push(parseInt(secondStr, 10));
  27783. }
  27784. return result;
  27785. }
  27786. function untruncateYear(yearStr) {
  27787. var year = parseInt(yearStr, 10);
  27788. if (year <= 49) {
  27789. return 2000 + year;
  27790. } else if (year <= 999) {
  27791. return 1900 + year;
  27792. }
  27793. return year;
  27794. }
  27795. function preprocessRFC2822(s) {
  27796. // Remove comments and folding whitespace and replace multiple-spaces with a single space
  27797. return s.replace(/\([^)]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').trim();
  27798. }
  27799. function checkWeekday(weekdayStr, parsedInput, config) {
  27800. if (weekdayStr) {
  27801. // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.
  27802. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
  27803. weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();
  27804. if (weekdayProvided !== weekdayActual) {
  27805. getParsingFlags(config).weekdayMismatch = true;
  27806. config._isValid = false;
  27807. return false;
  27808. }
  27809. }
  27810. return true;
  27811. }
  27812. var obsOffsets = {
  27813. UT: 0,
  27814. GMT: 0,
  27815. EDT: -4 * 60,
  27816. EST: -5 * 60,
  27817. CDT: -5 * 60,
  27818. CST: -6 * 60,
  27819. MDT: -6 * 60,
  27820. MST: -7 * 60,
  27821. PDT: -7 * 60,
  27822. PST: -8 * 60
  27823. };
  27824. function calculateOffset(obsOffset, militaryOffset, numOffset) {
  27825. if (obsOffset) {
  27826. return obsOffsets[obsOffset];
  27827. } else if (militaryOffset) {
  27828. // the only allowed military tz is Z
  27829. return 0;
  27830. } else {
  27831. var hm = parseInt(numOffset, 10);
  27832. var m = hm % 100, h = (hm - m) / 100;
  27833. return h * 60 + m;
  27834. }
  27835. }
  27836. // date and time from ref 2822 format
  27837. function configFromRFC2822(config) {
  27838. var match = rfc2822.exec(preprocessRFC2822(config._i));
  27839. if (match) {
  27840. var parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);
  27841. if (!checkWeekday(match[1], parsedArray, config)) {
  27842. return;
  27843. }
  27844. config._a = parsedArray;
  27845. config._tzm = calculateOffset(match[8], match[9], match[10]);
  27846. config._d = createUTCDate.apply(null, config._a);
  27847. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  27848. getParsingFlags(config).rfc2822 = true;
  27849. } else {
  27850. config._isValid = false;
  27851. }
  27852. }
  27853. // date from iso format or fallback
  27854. function configFromString(config) {
  27855. var matched = aspNetJsonRegex.exec(config._i);
  27856. if (matched !== null) {
  27857. config._d = new Date(+matched[1]);
  27858. return;
  27859. }
  27860. configFromISO(config);
  27861. if (config._isValid === false) {
  27862. delete config._isValid;
  27863. } else {
  27864. return;
  27865. }
  27866. configFromRFC2822(config);
  27867. if (config._isValid === false) {
  27868. delete config._isValid;
  27869. } else {
  27870. return;
  27871. }
  27872. // Final attempt, use Input Fallback
  27873. hooks.createFromInputFallback(config);
  27874. }
  27875. hooks.createFromInputFallback = deprecate(
  27876. 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
  27877. 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
  27878. 'discouraged and will be removed in an upcoming major release. Please refer to ' +
  27879. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  27880. function (config) {
  27881. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  27882. }
  27883. );
  27884. // constant that refers to the ISO standard
  27885. hooks.ISO_8601 = function () {};
  27886. // constant that refers to the RFC 2822 form
  27887. hooks.RFC_2822 = function () {};
  27888. // date from string and format string
  27889. function configFromStringAndFormat(config) {
  27890. // TODO: Move this to another part of the creation flow to prevent circular deps
  27891. if (config._f === hooks.ISO_8601) {
  27892. configFromISO(config);
  27893. return;
  27894. }
  27895. if (config._f === hooks.RFC_2822) {
  27896. configFromRFC2822(config);
  27897. return;
  27898. }
  27899. config._a = [];
  27900. getParsingFlags(config).empty = true;
  27901. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  27902. var string = '' + config._i,
  27903. i, parsedInput, tokens, token, skipped,
  27904. stringLength = string.length,
  27905. totalParsedInputLength = 0;
  27906. tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  27907. for (i = 0; i < tokens.length; i++) {
  27908. token = tokens[i];
  27909. parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
  27910. // console.log('token', token, 'parsedInput', parsedInput,
  27911. // 'regex', getParseRegexForToken(token, config));
  27912. if (parsedInput) {
  27913. skipped = string.substr(0, string.indexOf(parsedInput));
  27914. if (skipped.length > 0) {
  27915. getParsingFlags(config).unusedInput.push(skipped);
  27916. }
  27917. string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
  27918. totalParsedInputLength += parsedInput.length;
  27919. }
  27920. // don't parse if it's not a known token
  27921. if (formatTokenFunctions[token]) {
  27922. if (parsedInput) {
  27923. getParsingFlags(config).empty = false;
  27924. }
  27925. else {
  27926. getParsingFlags(config).unusedTokens.push(token);
  27927. }
  27928. addTimeToArrayFromToken(token, parsedInput, config);
  27929. }
  27930. else if (config._strict && !parsedInput) {
  27931. getParsingFlags(config).unusedTokens.push(token);
  27932. }
  27933. }
  27934. // add remaining unparsed input length to the string
  27935. getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
  27936. if (string.length > 0) {
  27937. getParsingFlags(config).unusedInput.push(string);
  27938. }
  27939. // clear _12h flag if hour is <= 12
  27940. if (config._a[HOUR] <= 12 &&
  27941. getParsingFlags(config).bigHour === true &&
  27942. config._a[HOUR] > 0) {
  27943. getParsingFlags(config).bigHour = undefined;
  27944. }
  27945. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  27946. getParsingFlags(config).meridiem = config._meridiem;
  27947. // handle meridiem
  27948. config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
  27949. configFromArray(config);
  27950. checkOverflow(config);
  27951. }
  27952. function meridiemFixWrap (locale, hour, meridiem) {
  27953. var isPm;
  27954. if (meridiem == null) {
  27955. // nothing to do
  27956. return hour;
  27957. }
  27958. if (locale.meridiemHour != null) {
  27959. return locale.meridiemHour(hour, meridiem);
  27960. } else if (locale.isPM != null) {
  27961. // Fallback
  27962. isPm = locale.isPM(meridiem);
  27963. if (isPm && hour < 12) {
  27964. hour += 12;
  27965. }
  27966. if (!isPm && hour === 12) {
  27967. hour = 0;
  27968. }
  27969. return hour;
  27970. } else {
  27971. // this is not supposed to happen
  27972. return hour;
  27973. }
  27974. }
  27975. // date from string and array of format strings
  27976. function configFromStringAndArray(config) {
  27977. var tempConfig,
  27978. bestMoment,
  27979. scoreToBeat,
  27980. i,
  27981. currentScore;
  27982. if (config._f.length === 0) {
  27983. getParsingFlags(config).invalidFormat = true;
  27984. config._d = new Date(NaN);
  27985. return;
  27986. }
  27987. for (i = 0; i < config._f.length; i++) {
  27988. currentScore = 0;
  27989. tempConfig = copyConfig({}, config);
  27990. if (config._useUTC != null) {
  27991. tempConfig._useUTC = config._useUTC;
  27992. }
  27993. tempConfig._f = config._f[i];
  27994. configFromStringAndFormat(tempConfig);
  27995. if (!isValid(tempConfig)) {
  27996. continue;
  27997. }
  27998. // if there is any input that was not parsed add a penalty for that format
  27999. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  28000. //or tokens
  28001. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  28002. getParsingFlags(tempConfig).score = currentScore;
  28003. if (scoreToBeat == null || currentScore < scoreToBeat) {
  28004. scoreToBeat = currentScore;
  28005. bestMoment = tempConfig;
  28006. }
  28007. }
  28008. extend(config, bestMoment || tempConfig);
  28009. }
  28010. function configFromObject(config) {
  28011. if (config._d) {
  28012. return;
  28013. }
  28014. var i = normalizeObjectUnits(config._i);
  28015. config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
  28016. return obj && parseInt(obj, 10);
  28017. });
  28018. configFromArray(config);
  28019. }
  28020. function createFromConfig (config) {
  28021. var res = new Moment(checkOverflow(prepareConfig(config)));
  28022. if (res._nextDay) {
  28023. // Adding is smart enough around DST
  28024. res.add(1, 'd');
  28025. res._nextDay = undefined;
  28026. }
  28027. return res;
  28028. }
  28029. function prepareConfig (config) {
  28030. var input = config._i,
  28031. format = config._f;
  28032. config._locale = config._locale || getLocale(config._l);
  28033. if (input === null || (format === undefined && input === '')) {
  28034. return createInvalid({nullInput: true});
  28035. }
  28036. if (typeof input === 'string') {
  28037. config._i = input = config._locale.preparse(input);
  28038. }
  28039. if (isMoment(input)) {
  28040. return new Moment(checkOverflow(input));
  28041. } else if (isDate(input)) {
  28042. config._d = input;
  28043. } else if (isArray(format)) {
  28044. configFromStringAndArray(config);
  28045. } else if (format) {
  28046. configFromStringAndFormat(config);
  28047. } else {
  28048. configFromInput(config);
  28049. }
  28050. if (!isValid(config)) {
  28051. config._d = null;
  28052. }
  28053. return config;
  28054. }
  28055. function configFromInput(config) {
  28056. var input = config._i;
  28057. if (isUndefined(input)) {
  28058. config._d = new Date(hooks.now());
  28059. } else if (isDate(input)) {
  28060. config._d = new Date(input.valueOf());
  28061. } else if (typeof input === 'string') {
  28062. configFromString(config);
  28063. } else if (isArray(input)) {
  28064. config._a = map(input.slice(0), function (obj) {
  28065. return parseInt(obj, 10);
  28066. });
  28067. configFromArray(config);
  28068. } else if (isObject(input)) {
  28069. configFromObject(config);
  28070. } else if (isNumber(input)) {
  28071. // from milliseconds
  28072. config._d = new Date(input);
  28073. } else {
  28074. hooks.createFromInputFallback(config);
  28075. }
  28076. }
  28077. function createLocalOrUTC (input, format, locale, strict, isUTC) {
  28078. var c = {};
  28079. if (locale === true || locale === false) {
  28080. strict = locale;
  28081. locale = undefined;
  28082. }
  28083. if ((isObject(input) && isObjectEmpty(input)) ||
  28084. (isArray(input) && input.length === 0)) {
  28085. input = undefined;
  28086. }
  28087. // object construction must be done this way.
  28088. // https://github.com/moment/moment/issues/1423
  28089. c._isAMomentObject = true;
  28090. c._useUTC = c._isUTC = isUTC;
  28091. c._l = locale;
  28092. c._i = input;
  28093. c._f = format;
  28094. c._strict = strict;
  28095. return createFromConfig(c);
  28096. }
  28097. function createLocal (input, format, locale, strict) {
  28098. return createLocalOrUTC(input, format, locale, strict, false);
  28099. }
  28100. var prototypeMin = deprecate(
  28101. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  28102. function () {
  28103. var other = createLocal.apply(null, arguments);
  28104. if (this.isValid() && other.isValid()) {
  28105. return other < this ? this : other;
  28106. } else {
  28107. return createInvalid();
  28108. }
  28109. }
  28110. );
  28111. var prototypeMax = deprecate(
  28112. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  28113. function () {
  28114. var other = createLocal.apply(null, arguments);
  28115. if (this.isValid() && other.isValid()) {
  28116. return other > this ? this : other;
  28117. } else {
  28118. return createInvalid();
  28119. }
  28120. }
  28121. );
  28122. // Pick a moment m from moments so that m[fn](other) is true for all
  28123. // other. This relies on the function fn to be transitive.
  28124. //
  28125. // moments should either be an array of moment objects or an array, whose
  28126. // first element is an array of moment objects.
  28127. function pickBy(fn, moments) {
  28128. var res, i;
  28129. if (moments.length === 1 && isArray(moments[0])) {
  28130. moments = moments[0];
  28131. }
  28132. if (!moments.length) {
  28133. return createLocal();
  28134. }
  28135. res = moments[0];
  28136. for (i = 1; i < moments.length; ++i) {
  28137. if (!moments[i].isValid() || moments[i][fn](res)) {
  28138. res = moments[i];
  28139. }
  28140. }
  28141. return res;
  28142. }
  28143. // TODO: Use [].sort instead?
  28144. function min () {
  28145. var args = [].slice.call(arguments, 0);
  28146. return pickBy('isBefore', args);
  28147. }
  28148. function max () {
  28149. var args = [].slice.call(arguments, 0);
  28150. return pickBy('isAfter', args);
  28151. }
  28152. var now = function () {
  28153. return Date.now ? Date.now() : +(new Date());
  28154. };
  28155. var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];
  28156. function isDurationValid(m) {
  28157. for (var key in m) {
  28158. if (!(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) {
  28159. return false;
  28160. }
  28161. }
  28162. var unitHasDecimal = false;
  28163. for (var i = 0; i < ordering.length; ++i) {
  28164. if (m[ordering[i]]) {
  28165. if (unitHasDecimal) {
  28166. return false; // only allow non-integers for smallest unit
  28167. }
  28168. if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
  28169. unitHasDecimal = true;
  28170. }
  28171. }
  28172. }
  28173. return true;
  28174. }
  28175. function isValid$1() {
  28176. return this._isValid;
  28177. }
  28178. function createInvalid$1() {
  28179. return createDuration(NaN);
  28180. }
  28181. function Duration (duration) {
  28182. var normalizedInput = normalizeObjectUnits(duration),
  28183. years = normalizedInput.year || 0,
  28184. quarters = normalizedInput.quarter || 0,
  28185. months = normalizedInput.month || 0,
  28186. weeks = normalizedInput.week || 0,
  28187. days = normalizedInput.day || 0,
  28188. hours = normalizedInput.hour || 0,
  28189. minutes = normalizedInput.minute || 0,
  28190. seconds = normalizedInput.second || 0,
  28191. milliseconds = normalizedInput.millisecond || 0;
  28192. this._isValid = isDurationValid(normalizedInput);
  28193. // representation for dateAddRemove
  28194. this._milliseconds = +milliseconds +
  28195. seconds * 1e3 + // 1000
  28196. minutes * 6e4 + // 1000 * 60
  28197. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  28198. // Because of dateAddRemove treats 24 hours as different from a
  28199. // day when working around DST, we need to store them separately
  28200. this._days = +days +
  28201. weeks * 7;
  28202. // It is impossible to translate months into days without knowing
  28203. // which months you are are talking about, so we have to store
  28204. // it separately.
  28205. this._months = +months +
  28206. quarters * 3 +
  28207. years * 12;
  28208. this._data = {};
  28209. this._locale = getLocale();
  28210. this._bubble();
  28211. }
  28212. function isDuration (obj) {
  28213. return obj instanceof Duration;
  28214. }
  28215. function absRound (number) {
  28216. if (number < 0) {
  28217. return Math.round(-1 * number) * -1;
  28218. } else {
  28219. return Math.round(number);
  28220. }
  28221. }
  28222. // FORMATTING
  28223. function offset (token, separator) {
  28224. addFormatToken(token, 0, 0, function () {
  28225. var offset = this.utcOffset();
  28226. var sign = '+';
  28227. if (offset < 0) {
  28228. offset = -offset;
  28229. sign = '-';
  28230. }
  28231. return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
  28232. });
  28233. }
  28234. offset('Z', ':');
  28235. offset('ZZ', '');
  28236. // PARSING
  28237. addRegexToken('Z', matchShortOffset);
  28238. addRegexToken('ZZ', matchShortOffset);
  28239. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  28240. config._useUTC = true;
  28241. config._tzm = offsetFromString(matchShortOffset, input);
  28242. });
  28243. // HELPERS
  28244. // timezone chunker
  28245. // '+10:00' > ['10', '00']
  28246. // '-1530' > ['-15', '30']
  28247. var chunkOffset = /([\+\-]|\d\d)/gi;
  28248. function offsetFromString(matcher, string) {
  28249. var matches = (string || '').match(matcher);
  28250. if (matches === null) {
  28251. return null;
  28252. }
  28253. var chunk = matches[matches.length - 1] || [];
  28254. var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  28255. var minutes = +(parts[1] * 60) + toInt(parts[2]);
  28256. return minutes === 0 ?
  28257. 0 :
  28258. parts[0] === '+' ? minutes : -minutes;
  28259. }
  28260. // Return a moment from input, that is local/utc/zone equivalent to model.
  28261. function cloneWithOffset(input, model) {
  28262. var res, diff;
  28263. if (model._isUTC) {
  28264. res = model.clone();
  28265. diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();
  28266. // Use low-level api, because this fn is low-level api.
  28267. res._d.setTime(res._d.valueOf() + diff);
  28268. hooks.updateOffset(res, false);
  28269. return res;
  28270. } else {
  28271. return createLocal(input).local();
  28272. }
  28273. }
  28274. function getDateOffset (m) {
  28275. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  28276. // https://github.com/moment/moment/pull/1871
  28277. return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
  28278. }
  28279. // HOOKS
  28280. // This function will be called whenever a moment is mutated.
  28281. // It is intended to keep the offset in sync with the timezone.
  28282. hooks.updateOffset = function () {};
  28283. // MOMENTS
  28284. // keepLocalTime = true means only change the timezone, without
  28285. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  28286. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  28287. // +0200, so we adjust the time as needed, to be valid.
  28288. //
  28289. // Keeping the time actually adds/subtracts (one hour)
  28290. // from the actual represented time. That is why we call updateOffset
  28291. // a second time. In case it wants us to change the offset again
  28292. // _changeInProgress == true case, then we have to adjust, because
  28293. // there is no such time in the given timezone.
  28294. function getSetOffset (input, keepLocalTime, keepMinutes) {
  28295. var offset = this._offset || 0,
  28296. localAdjust;
  28297. if (!this.isValid()) {
  28298. return input != null ? this : NaN;
  28299. }
  28300. if (input != null) {
  28301. if (typeof input === 'string') {
  28302. input = offsetFromString(matchShortOffset, input);
  28303. if (input === null) {
  28304. return this;
  28305. }
  28306. } else if (Math.abs(input) < 16 && !keepMinutes) {
  28307. input = input * 60;
  28308. }
  28309. if (!this._isUTC && keepLocalTime) {
  28310. localAdjust = getDateOffset(this);
  28311. }
  28312. this._offset = input;
  28313. this._isUTC = true;
  28314. if (localAdjust != null) {
  28315. this.add(localAdjust, 'm');
  28316. }
  28317. if (offset !== input) {
  28318. if (!keepLocalTime || this._changeInProgress) {
  28319. addSubtract(this, createDuration(input - offset, 'm'), 1, false);
  28320. } else if (!this._changeInProgress) {
  28321. this._changeInProgress = true;
  28322. hooks.updateOffset(this, true);
  28323. this._changeInProgress = null;
  28324. }
  28325. }
  28326. return this;
  28327. } else {
  28328. return this._isUTC ? offset : getDateOffset(this);
  28329. }
  28330. }
  28331. function getSetZone (input, keepLocalTime) {
  28332. if (input != null) {
  28333. if (typeof input !== 'string') {
  28334. input = -input;
  28335. }
  28336. this.utcOffset(input, keepLocalTime);
  28337. return this;
  28338. } else {
  28339. return -this.utcOffset();
  28340. }
  28341. }
  28342. function setOffsetToUTC (keepLocalTime) {
  28343. return this.utcOffset(0, keepLocalTime);
  28344. }
  28345. function setOffsetToLocal (keepLocalTime) {
  28346. if (this._isUTC) {
  28347. this.utcOffset(0, keepLocalTime);
  28348. this._isUTC = false;
  28349. if (keepLocalTime) {
  28350. this.subtract(getDateOffset(this), 'm');
  28351. }
  28352. }
  28353. return this;
  28354. }
  28355. function setOffsetToParsedOffset () {
  28356. if (this._tzm != null) {
  28357. this.utcOffset(this._tzm, false, true);
  28358. } else if (typeof this._i === 'string') {
  28359. var tZone = offsetFromString(matchOffset, this._i);
  28360. if (tZone != null) {
  28361. this.utcOffset(tZone);
  28362. }
  28363. else {
  28364. this.utcOffset(0, true);
  28365. }
  28366. }
  28367. return this;
  28368. }
  28369. function hasAlignedHourOffset (input) {
  28370. if (!this.isValid()) {
  28371. return false;
  28372. }
  28373. input = input ? createLocal(input).utcOffset() : 0;
  28374. return (this.utcOffset() - input) % 60 === 0;
  28375. }
  28376. function isDaylightSavingTime () {
  28377. return (
  28378. this.utcOffset() > this.clone().month(0).utcOffset() ||
  28379. this.utcOffset() > this.clone().month(5).utcOffset()
  28380. );
  28381. }
  28382. function isDaylightSavingTimeShifted () {
  28383. if (!isUndefined(this._isDSTShifted)) {
  28384. return this._isDSTShifted;
  28385. }
  28386. var c = {};
  28387. copyConfig(c, this);
  28388. c = prepareConfig(c);
  28389. if (c._a) {
  28390. var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
  28391. this._isDSTShifted = this.isValid() &&
  28392. compareArrays(c._a, other.toArray()) > 0;
  28393. } else {
  28394. this._isDSTShifted = false;
  28395. }
  28396. return this._isDSTShifted;
  28397. }
  28398. function isLocal () {
  28399. return this.isValid() ? !this._isUTC : false;
  28400. }
  28401. function isUtcOffset () {
  28402. return this.isValid() ? this._isUTC : false;
  28403. }
  28404. function isUtc () {
  28405. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  28406. }
  28407. // ASP.NET json date format regex
  28408. var aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
  28409. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  28410. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  28411. // and further modified to allow for strings containing both week and day
  28412. var isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  28413. function createDuration (input, key) {
  28414. var duration = input,
  28415. // matching against regexp is expensive, do it on demand
  28416. match = null,
  28417. sign,
  28418. ret,
  28419. diffRes;
  28420. if (isDuration(input)) {
  28421. duration = {
  28422. ms : input._milliseconds,
  28423. d : input._days,
  28424. M : input._months
  28425. };
  28426. } else if (isNumber(input)) {
  28427. duration = {};
  28428. if (key) {
  28429. duration[key] = input;
  28430. } else {
  28431. duration.milliseconds = input;
  28432. }
  28433. } else if (!!(match = aspNetRegex.exec(input))) {
  28434. sign = (match[1] === '-') ? -1 : 1;
  28435. duration = {
  28436. y : 0,
  28437. d : toInt(match[DATE]) * sign,
  28438. h : toInt(match[HOUR]) * sign,
  28439. m : toInt(match[MINUTE]) * sign,
  28440. s : toInt(match[SECOND]) * sign,
  28441. ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
  28442. };
  28443. } else if (!!(match = isoRegex.exec(input))) {
  28444. sign = (match[1] === '-') ? -1 : (match[1] === '+') ? 1 : 1;
  28445. duration = {
  28446. y : parseIso(match[2], sign),
  28447. M : parseIso(match[3], sign),
  28448. w : parseIso(match[4], sign),
  28449. d : parseIso(match[5], sign),
  28450. h : parseIso(match[6], sign),
  28451. m : parseIso(match[7], sign),
  28452. s : parseIso(match[8], sign)
  28453. };
  28454. } else if (duration == null) {// checks for null or undefined
  28455. duration = {};
  28456. } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
  28457. diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));
  28458. duration = {};
  28459. duration.ms = diffRes.milliseconds;
  28460. duration.M = diffRes.months;
  28461. }
  28462. ret = new Duration(duration);
  28463. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  28464. ret._locale = input._locale;
  28465. }
  28466. return ret;
  28467. }
  28468. createDuration.fn = Duration.prototype;
  28469. createDuration.invalid = createInvalid$1;
  28470. function parseIso (inp, sign) {
  28471. // We'd normally use ~~inp for this, but unfortunately it also
  28472. // converts floats to ints.
  28473. // inp may be undefined, so careful calling replace on it.
  28474. var res = inp && parseFloat(inp.replace(',', '.'));
  28475. // apply sign while we're at it
  28476. return (isNaN(res) ? 0 : res) * sign;
  28477. }
  28478. function positiveMomentsDifference(base, other) {
  28479. var res = {milliseconds: 0, months: 0};
  28480. res.months = other.month() - base.month() +
  28481. (other.year() - base.year()) * 12;
  28482. if (base.clone().add(res.months, 'M').isAfter(other)) {
  28483. --res.months;
  28484. }
  28485. res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
  28486. return res;
  28487. }
  28488. function momentsDifference(base, other) {
  28489. var res;
  28490. if (!(base.isValid() && other.isValid())) {
  28491. return {milliseconds: 0, months: 0};
  28492. }
  28493. other = cloneWithOffset(other, base);
  28494. if (base.isBefore(other)) {
  28495. res = positiveMomentsDifference(base, other);
  28496. } else {
  28497. res = positiveMomentsDifference(other, base);
  28498. res.milliseconds = -res.milliseconds;
  28499. res.months = -res.months;
  28500. }
  28501. return res;
  28502. }
  28503. // TODO: remove 'name' arg after deprecation is removed
  28504. function createAdder(direction, name) {
  28505. return function (val, period) {
  28506. var dur, tmp;
  28507. //invert the arguments, but complain about it
  28508. if (period !== null && !isNaN(+period)) {
  28509. deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
  28510. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
  28511. tmp = val; val = period; period = tmp;
  28512. }
  28513. val = typeof val === 'string' ? +val : val;
  28514. dur = createDuration(val, period);
  28515. addSubtract(this, dur, direction);
  28516. return this;
  28517. };
  28518. }
  28519. function addSubtract (mom, duration, isAdding, updateOffset) {
  28520. var milliseconds = duration._milliseconds,
  28521. days = absRound(duration._days),
  28522. months = absRound(duration._months);
  28523. if (!mom.isValid()) {
  28524. // No op
  28525. return;
  28526. }
  28527. updateOffset = updateOffset == null ? true : updateOffset;
  28528. if (months) {
  28529. setMonth(mom, get(mom, 'Month') + months * isAdding);
  28530. }
  28531. if (days) {
  28532. set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
  28533. }
  28534. if (milliseconds) {
  28535. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  28536. }
  28537. if (updateOffset) {
  28538. hooks.updateOffset(mom, days || months);
  28539. }
  28540. }
  28541. var add = createAdder(1, 'add');
  28542. var subtract = createAdder(-1, 'subtract');
  28543. function getCalendarFormat(myMoment, now) {
  28544. var diff = myMoment.diff(now, 'days', true);
  28545. return diff < -6 ? 'sameElse' :
  28546. diff < -1 ? 'lastWeek' :
  28547. diff < 0 ? 'lastDay' :
  28548. diff < 1 ? 'sameDay' :
  28549. diff < 2 ? 'nextDay' :
  28550. diff < 7 ? 'nextWeek' : 'sameElse';
  28551. }
  28552. function calendar$1 (time, formats) {
  28553. // We want to compare the start of today, vs this.
  28554. // Getting start-of-today depends on whether we're local/utc/offset or not.
  28555. var now = time || createLocal(),
  28556. sod = cloneWithOffset(now, this).startOf('day'),
  28557. format = hooks.calendarFormat(this, sod) || 'sameElse';
  28558. var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
  28559. return this.format(output || this.localeData().calendar(format, this, createLocal(now)));
  28560. }
  28561. function clone () {
  28562. return new Moment(this);
  28563. }
  28564. function isAfter (input, units) {
  28565. var localInput = isMoment(input) ? input : createLocal(input);
  28566. if (!(this.isValid() && localInput.isValid())) {
  28567. return false;
  28568. }
  28569. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  28570. if (units === 'millisecond') {
  28571. return this.valueOf() > localInput.valueOf();
  28572. } else {
  28573. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  28574. }
  28575. }
  28576. function isBefore (input, units) {
  28577. var localInput = isMoment(input) ? input : createLocal(input);
  28578. if (!(this.isValid() && localInput.isValid())) {
  28579. return false;
  28580. }
  28581. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  28582. if (units === 'millisecond') {
  28583. return this.valueOf() < localInput.valueOf();
  28584. } else {
  28585. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  28586. }
  28587. }
  28588. function isBetween (from, to, units, inclusivity) {
  28589. inclusivity = inclusivity || '()';
  28590. return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
  28591. (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
  28592. }
  28593. function isSame (input, units) {
  28594. var localInput = isMoment(input) ? input : createLocal(input),
  28595. inputMs;
  28596. if (!(this.isValid() && localInput.isValid())) {
  28597. return false;
  28598. }
  28599. units = normalizeUnits(units || 'millisecond');
  28600. if (units === 'millisecond') {
  28601. return this.valueOf() === localInput.valueOf();
  28602. } else {
  28603. inputMs = localInput.valueOf();
  28604. return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
  28605. }
  28606. }
  28607. function isSameOrAfter (input, units) {
  28608. return this.isSame(input, units) || this.isAfter(input,units);
  28609. }
  28610. function isSameOrBefore (input, units) {
  28611. return this.isSame(input, units) || this.isBefore(input,units);
  28612. }
  28613. function diff (input, units, asFloat) {
  28614. var that,
  28615. zoneDelta,
  28616. delta, output;
  28617. if (!this.isValid()) {
  28618. return NaN;
  28619. }
  28620. that = cloneWithOffset(input, this);
  28621. if (!that.isValid()) {
  28622. return NaN;
  28623. }
  28624. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  28625. units = normalizeUnits(units);
  28626. switch (units) {
  28627. case 'year': output = monthDiff(this, that) / 12; break;
  28628. case 'month': output = monthDiff(this, that); break;
  28629. case 'quarter': output = monthDiff(this, that) / 3; break;
  28630. case 'second': output = (this - that) / 1e3; break; // 1000
  28631. case 'minute': output = (this - that) / 6e4; break; // 1000 * 60
  28632. case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60
  28633. case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst
  28634. case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst
  28635. default: output = this - that;
  28636. }
  28637. return asFloat ? output : absFloor(output);
  28638. }
  28639. function monthDiff (a, b) {
  28640. // difference in months
  28641. var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
  28642. // b is in (anchor - 1 month, anchor + 1 month)
  28643. anchor = a.clone().add(wholeMonthDiff, 'months'),
  28644. anchor2, adjust;
  28645. if (b - anchor < 0) {
  28646. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  28647. // linear across the month
  28648. adjust = (b - anchor) / (anchor - anchor2);
  28649. } else {
  28650. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  28651. // linear across the month
  28652. adjust = (b - anchor) / (anchor2 - anchor);
  28653. }
  28654. //check for negative zero, return zero if negative zero
  28655. return -(wholeMonthDiff + adjust) || 0;
  28656. }
  28657. hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  28658. hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  28659. function toString () {
  28660. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  28661. }
  28662. function toISOString() {
  28663. if (!this.isValid()) {
  28664. return null;
  28665. }
  28666. var m = this.clone().utc();
  28667. if (m.year() < 0 || m.year() > 9999) {
  28668. return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  28669. }
  28670. if (isFunction(Date.prototype.toISOString)) {
  28671. // native implementation is ~50x faster, use it when we can
  28672. return this.toDate().toISOString();
  28673. }
  28674. return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  28675. }
  28676. /**
  28677. * Return a human readable representation of a moment that can
  28678. * also be evaluated to get a new moment which is the same
  28679. *
  28680. * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
  28681. */
  28682. function inspect () {
  28683. if (!this.isValid()) {
  28684. return 'moment.invalid(/* ' + this._i + ' */)';
  28685. }
  28686. var func = 'moment';
  28687. var zone = '';
  28688. if (!this.isLocal()) {
  28689. func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
  28690. zone = 'Z';
  28691. }
  28692. var prefix = '[' + func + '("]';
  28693. var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';
  28694. var datetime = '-MM-DD[T]HH:mm:ss.SSS';
  28695. var suffix = zone + '[")]';
  28696. return this.format(prefix + year + datetime + suffix);
  28697. }
  28698. function format (inputString) {
  28699. if (!inputString) {
  28700. inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;
  28701. }
  28702. var output = formatMoment(this, inputString);
  28703. return this.localeData().postformat(output);
  28704. }
  28705. function from (time, withoutSuffix) {
  28706. if (this.isValid() &&
  28707. ((isMoment(time) && time.isValid()) ||
  28708. createLocal(time).isValid())) {
  28709. return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
  28710. } else {
  28711. return this.localeData().invalidDate();
  28712. }
  28713. }
  28714. function fromNow (withoutSuffix) {
  28715. return this.from(createLocal(), withoutSuffix);
  28716. }
  28717. function to (time, withoutSuffix) {
  28718. if (this.isValid() &&
  28719. ((isMoment(time) && time.isValid()) ||
  28720. createLocal(time).isValid())) {
  28721. return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
  28722. } else {
  28723. return this.localeData().invalidDate();
  28724. }
  28725. }
  28726. function toNow (withoutSuffix) {
  28727. return this.to(createLocal(), withoutSuffix);
  28728. }
  28729. // If passed a locale key, it will set the locale for this
  28730. // instance. Otherwise, it will return the locale configuration
  28731. // variables for this instance.
  28732. function locale (key) {
  28733. var newLocaleData;
  28734. if (key === undefined) {
  28735. return this._locale._abbr;
  28736. } else {
  28737. newLocaleData = getLocale(key);
  28738. if (newLocaleData != null) {
  28739. this._locale = newLocaleData;
  28740. }
  28741. return this;
  28742. }
  28743. }
  28744. var lang = deprecate(
  28745. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  28746. function (key) {
  28747. if (key === undefined) {
  28748. return this.localeData();
  28749. } else {
  28750. return this.locale(key);
  28751. }
  28752. }
  28753. );
  28754. function localeData () {
  28755. return this._locale;
  28756. }
  28757. function startOf (units) {
  28758. units = normalizeUnits(units);
  28759. // the following switch intentionally omits break keywords
  28760. // to utilize falling through the cases.
  28761. switch (units) {
  28762. case 'year':
  28763. this.month(0);
  28764. /* falls through */
  28765. case 'quarter':
  28766. case 'month':
  28767. this.date(1);
  28768. /* falls through */
  28769. case 'week':
  28770. case 'isoWeek':
  28771. case 'day':
  28772. case 'date':
  28773. this.hours(0);
  28774. /* falls through */
  28775. case 'hour':
  28776. this.minutes(0);
  28777. /* falls through */
  28778. case 'minute':
  28779. this.seconds(0);
  28780. /* falls through */
  28781. case 'second':
  28782. this.milliseconds(0);
  28783. }
  28784. // weeks are a special case
  28785. if (units === 'week') {
  28786. this.weekday(0);
  28787. }
  28788. if (units === 'isoWeek') {
  28789. this.isoWeekday(1);
  28790. }
  28791. // quarters are also special
  28792. if (units === 'quarter') {
  28793. this.month(Math.floor(this.month() / 3) * 3);
  28794. }
  28795. return this;
  28796. }
  28797. function endOf (units) {
  28798. units = normalizeUnits(units);
  28799. if (units === undefined || units === 'millisecond') {
  28800. return this;
  28801. }
  28802. // 'date' is an alias for 'day', so it should be considered as such.
  28803. if (units === 'date') {
  28804. units = 'day';
  28805. }
  28806. return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
  28807. }
  28808. function valueOf () {
  28809. return this._d.valueOf() - ((this._offset || 0) * 60000);
  28810. }
  28811. function unix () {
  28812. return Math.floor(this.valueOf() / 1000);
  28813. }
  28814. function toDate () {
  28815. return new Date(this.valueOf());
  28816. }
  28817. function toArray () {
  28818. var m = this;
  28819. return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
  28820. }
  28821. function toObject () {
  28822. var m = this;
  28823. return {
  28824. years: m.year(),
  28825. months: m.month(),
  28826. date: m.date(),
  28827. hours: m.hours(),
  28828. minutes: m.minutes(),
  28829. seconds: m.seconds(),
  28830. milliseconds: m.milliseconds()
  28831. };
  28832. }
  28833. function toJSON () {
  28834. // new Date(NaN).toJSON() === null
  28835. return this.isValid() ? this.toISOString() : null;
  28836. }
  28837. function isValid$2 () {
  28838. return isValid(this);
  28839. }
  28840. function parsingFlags () {
  28841. return extend({}, getParsingFlags(this));
  28842. }
  28843. function invalidAt () {
  28844. return getParsingFlags(this).overflow;
  28845. }
  28846. function creationData() {
  28847. return {
  28848. input: this._i,
  28849. format: this._f,
  28850. locale: this._locale,
  28851. isUTC: this._isUTC,
  28852. strict: this._strict
  28853. };
  28854. }
  28855. // FORMATTING
  28856. addFormatToken(0, ['gg', 2], 0, function () {
  28857. return this.weekYear() % 100;
  28858. });
  28859. addFormatToken(0, ['GG', 2], 0, function () {
  28860. return this.isoWeekYear() % 100;
  28861. });
  28862. function addWeekYearFormatToken (token, getter) {
  28863. addFormatToken(0, [token, token.length], 0, getter);
  28864. }
  28865. addWeekYearFormatToken('gggg', 'weekYear');
  28866. addWeekYearFormatToken('ggggg', 'weekYear');
  28867. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  28868. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  28869. // ALIASES
  28870. addUnitAlias('weekYear', 'gg');
  28871. addUnitAlias('isoWeekYear', 'GG');
  28872. // PRIORITY
  28873. addUnitPriority('weekYear', 1);
  28874. addUnitPriority('isoWeekYear', 1);
  28875. // PARSING
  28876. addRegexToken('G', matchSigned);
  28877. addRegexToken('g', matchSigned);
  28878. addRegexToken('GG', match1to2, match2);
  28879. addRegexToken('gg', match1to2, match2);
  28880. addRegexToken('GGGG', match1to4, match4);
  28881. addRegexToken('gggg', match1to4, match4);
  28882. addRegexToken('GGGGG', match1to6, match6);
  28883. addRegexToken('ggggg', match1to6, match6);
  28884. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
  28885. week[token.substr(0, 2)] = toInt(input);
  28886. });
  28887. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  28888. week[token] = hooks.parseTwoDigitYear(input);
  28889. });
  28890. // MOMENTS
  28891. function getSetWeekYear (input) {
  28892. return getSetWeekYearHelper.call(this,
  28893. input,
  28894. this.week(),
  28895. this.weekday(),
  28896. this.localeData()._week.dow,
  28897. this.localeData()._week.doy);
  28898. }
  28899. function getSetISOWeekYear (input) {
  28900. return getSetWeekYearHelper.call(this,
  28901. input, this.isoWeek(), this.isoWeekday(), 1, 4);
  28902. }
  28903. function getISOWeeksInYear () {
  28904. return weeksInYear(this.year(), 1, 4);
  28905. }
  28906. function getWeeksInYear () {
  28907. var weekInfo = this.localeData()._week;
  28908. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  28909. }
  28910. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  28911. var weeksTarget;
  28912. if (input == null) {
  28913. return weekOfYear(this, dow, doy).year;
  28914. } else {
  28915. weeksTarget = weeksInYear(input, dow, doy);
  28916. if (week > weeksTarget) {
  28917. week = weeksTarget;
  28918. }
  28919. return setWeekAll.call(this, input, week, weekday, dow, doy);
  28920. }
  28921. }
  28922. function setWeekAll(weekYear, week, weekday, dow, doy) {
  28923. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  28924. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  28925. this.year(date.getUTCFullYear());
  28926. this.month(date.getUTCMonth());
  28927. this.date(date.getUTCDate());
  28928. return this;
  28929. }
  28930. // FORMATTING
  28931. addFormatToken('Q', 0, 'Qo', 'quarter');
  28932. // ALIASES
  28933. addUnitAlias('quarter', 'Q');
  28934. // PRIORITY
  28935. addUnitPriority('quarter', 7);
  28936. // PARSING
  28937. addRegexToken('Q', match1);
  28938. addParseToken('Q', function (input, array) {
  28939. array[MONTH] = (toInt(input) - 1) * 3;
  28940. });
  28941. // MOMENTS
  28942. function getSetQuarter (input) {
  28943. return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  28944. }
  28945. // FORMATTING
  28946. addFormatToken('D', ['DD', 2], 'Do', 'date');
  28947. // ALIASES
  28948. addUnitAlias('date', 'D');
  28949. // PRIOROITY
  28950. addUnitPriority('date', 9);
  28951. // PARSING
  28952. addRegexToken('D', match1to2);
  28953. addRegexToken('DD', match1to2, match2);
  28954. addRegexToken('Do', function (isStrict, locale) {
  28955. // TODO: Remove "ordinalParse" fallback in next major release.
  28956. return isStrict ?
  28957. (locale._dayOfMonthOrdinalParse || locale._ordinalParse) :
  28958. locale._dayOfMonthOrdinalParseLenient;
  28959. });
  28960. addParseToken(['D', 'DD'], DATE);
  28961. addParseToken('Do', function (input, array) {
  28962. array[DATE] = toInt(input.match(match1to2)[0]);
  28963. });
  28964. // MOMENTS
  28965. var getSetDayOfMonth = makeGetSet('Date', true);
  28966. // FORMATTING
  28967. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  28968. // ALIASES
  28969. addUnitAlias('dayOfYear', 'DDD');
  28970. // PRIORITY
  28971. addUnitPriority('dayOfYear', 4);
  28972. // PARSING
  28973. addRegexToken('DDD', match1to3);
  28974. addRegexToken('DDDD', match3);
  28975. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  28976. config._dayOfYear = toInt(input);
  28977. });
  28978. // HELPERS
  28979. // MOMENTS
  28980. function getSetDayOfYear (input) {
  28981. var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
  28982. return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
  28983. }
  28984. // FORMATTING
  28985. addFormatToken('m', ['mm', 2], 0, 'minute');
  28986. // ALIASES
  28987. addUnitAlias('minute', 'm');
  28988. // PRIORITY
  28989. addUnitPriority('minute', 14);
  28990. // PARSING
  28991. addRegexToken('m', match1to2);
  28992. addRegexToken('mm', match1to2, match2);
  28993. addParseToken(['m', 'mm'], MINUTE);
  28994. // MOMENTS
  28995. var getSetMinute = makeGetSet('Minutes', false);
  28996. // FORMATTING
  28997. addFormatToken('s', ['ss', 2], 0, 'second');
  28998. // ALIASES
  28999. addUnitAlias('second', 's');
  29000. // PRIORITY
  29001. addUnitPriority('second', 15);
  29002. // PARSING
  29003. addRegexToken('s', match1to2);
  29004. addRegexToken('ss', match1to2, match2);
  29005. addParseToken(['s', 'ss'], SECOND);
  29006. // MOMENTS
  29007. var getSetSecond = makeGetSet('Seconds', false);
  29008. // FORMATTING
  29009. addFormatToken('S', 0, 0, function () {
  29010. return ~~(this.millisecond() / 100);
  29011. });
  29012. addFormatToken(0, ['SS', 2], 0, function () {
  29013. return ~~(this.millisecond() / 10);
  29014. });
  29015. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  29016. addFormatToken(0, ['SSSS', 4], 0, function () {
  29017. return this.millisecond() * 10;
  29018. });
  29019. addFormatToken(0, ['SSSSS', 5], 0, function () {
  29020. return this.millisecond() * 100;
  29021. });
  29022. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  29023. return this.millisecond() * 1000;
  29024. });
  29025. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  29026. return this.millisecond() * 10000;
  29027. });
  29028. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  29029. return this.millisecond() * 100000;
  29030. });
  29031. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  29032. return this.millisecond() * 1000000;
  29033. });
  29034. // ALIASES
  29035. addUnitAlias('millisecond', 'ms');
  29036. // PRIORITY
  29037. addUnitPriority('millisecond', 16);
  29038. // PARSING
  29039. addRegexToken('S', match1to3, match1);
  29040. addRegexToken('SS', match1to3, match2);
  29041. addRegexToken('SSS', match1to3, match3);
  29042. var token;
  29043. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  29044. addRegexToken(token, matchUnsigned);
  29045. }
  29046. function parseMs(input, array) {
  29047. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  29048. }
  29049. for (token = 'S'; token.length <= 9; token += 'S') {
  29050. addParseToken(token, parseMs);
  29051. }
  29052. // MOMENTS
  29053. var getSetMillisecond = makeGetSet('Milliseconds', false);
  29054. // FORMATTING
  29055. addFormatToken('z', 0, 0, 'zoneAbbr');
  29056. addFormatToken('zz', 0, 0, 'zoneName');
  29057. // MOMENTS
  29058. function getZoneAbbr () {
  29059. return this._isUTC ? 'UTC' : '';
  29060. }
  29061. function getZoneName () {
  29062. return this._isUTC ? 'Coordinated Universal Time' : '';
  29063. }
  29064. var proto = Moment.prototype;
  29065. proto.add = add;
  29066. proto.calendar = calendar$1;
  29067. proto.clone = clone;
  29068. proto.diff = diff;
  29069. proto.endOf = endOf;
  29070. proto.format = format;
  29071. proto.from = from;
  29072. proto.fromNow = fromNow;
  29073. proto.to = to;
  29074. proto.toNow = toNow;
  29075. proto.get = stringGet;
  29076. proto.invalidAt = invalidAt;
  29077. proto.isAfter = isAfter;
  29078. proto.isBefore = isBefore;
  29079. proto.isBetween = isBetween;
  29080. proto.isSame = isSame;
  29081. proto.isSameOrAfter = isSameOrAfter;
  29082. proto.isSameOrBefore = isSameOrBefore;
  29083. proto.isValid = isValid$2;
  29084. proto.lang = lang;
  29085. proto.locale = locale;
  29086. proto.localeData = localeData;
  29087. proto.max = prototypeMax;
  29088. proto.min = prototypeMin;
  29089. proto.parsingFlags = parsingFlags;
  29090. proto.set = stringSet;
  29091. proto.startOf = startOf;
  29092. proto.subtract = subtract;
  29093. proto.toArray = toArray;
  29094. proto.toObject = toObject;
  29095. proto.toDate = toDate;
  29096. proto.toISOString = toISOString;
  29097. proto.inspect = inspect;
  29098. proto.toJSON = toJSON;
  29099. proto.toString = toString;
  29100. proto.unix = unix;
  29101. proto.valueOf = valueOf;
  29102. proto.creationData = creationData;
  29103. // Year
  29104. proto.year = getSetYear;
  29105. proto.isLeapYear = getIsLeapYear;
  29106. // Week Year
  29107. proto.weekYear = getSetWeekYear;
  29108. proto.isoWeekYear = getSetISOWeekYear;
  29109. // Quarter
  29110. proto.quarter = proto.quarters = getSetQuarter;
  29111. // Month
  29112. proto.month = getSetMonth;
  29113. proto.daysInMonth = getDaysInMonth;
  29114. // Week
  29115. proto.week = proto.weeks = getSetWeek;
  29116. proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  29117. proto.weeksInYear = getWeeksInYear;
  29118. proto.isoWeeksInYear = getISOWeeksInYear;
  29119. // Day
  29120. proto.date = getSetDayOfMonth;
  29121. proto.day = proto.days = getSetDayOfWeek;
  29122. proto.weekday = getSetLocaleDayOfWeek;
  29123. proto.isoWeekday = getSetISODayOfWeek;
  29124. proto.dayOfYear = getSetDayOfYear;
  29125. // Hour
  29126. proto.hour = proto.hours = getSetHour;
  29127. // Minute
  29128. proto.minute = proto.minutes = getSetMinute;
  29129. // Second
  29130. proto.second = proto.seconds = getSetSecond;
  29131. // Millisecond
  29132. proto.millisecond = proto.milliseconds = getSetMillisecond;
  29133. // Offset
  29134. proto.utcOffset = getSetOffset;
  29135. proto.utc = setOffsetToUTC;
  29136. proto.local = setOffsetToLocal;
  29137. proto.parseZone = setOffsetToParsedOffset;
  29138. proto.hasAlignedHourOffset = hasAlignedHourOffset;
  29139. proto.isDST = isDaylightSavingTime;
  29140. proto.isLocal = isLocal;
  29141. proto.isUtcOffset = isUtcOffset;
  29142. proto.isUtc = isUtc;
  29143. proto.isUTC = isUtc;
  29144. // Timezone
  29145. proto.zoneAbbr = getZoneAbbr;
  29146. proto.zoneName = getZoneName;
  29147. // Deprecations
  29148. proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
  29149. proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
  29150. proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
  29151. proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
  29152. proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
  29153. function createUnix (input) {
  29154. return createLocal(input * 1000);
  29155. }
  29156. function createInZone () {
  29157. return createLocal.apply(null, arguments).parseZone();
  29158. }
  29159. function preParsePostFormat (string) {
  29160. return string;
  29161. }
  29162. var proto$1 = Locale.prototype;
  29163. proto$1.calendar = calendar;
  29164. proto$1.longDateFormat = longDateFormat;
  29165. proto$1.invalidDate = invalidDate;
  29166. proto$1.ordinal = ordinal;
  29167. proto$1.preparse = preParsePostFormat;
  29168. proto$1.postformat = preParsePostFormat;
  29169. proto$1.relativeTime = relativeTime;
  29170. proto$1.pastFuture = pastFuture;
  29171. proto$1.set = set;
  29172. // Month
  29173. proto$1.months = localeMonths;
  29174. proto$1.monthsShort = localeMonthsShort;
  29175. proto$1.monthsParse = localeMonthsParse;
  29176. proto$1.monthsRegex = monthsRegex;
  29177. proto$1.monthsShortRegex = monthsShortRegex;
  29178. // Week
  29179. proto$1.week = localeWeek;
  29180. proto$1.firstDayOfYear = localeFirstDayOfYear;
  29181. proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  29182. // Day of Week
  29183. proto$1.weekdays = localeWeekdays;
  29184. proto$1.weekdaysMin = localeWeekdaysMin;
  29185. proto$1.weekdaysShort = localeWeekdaysShort;
  29186. proto$1.weekdaysParse = localeWeekdaysParse;
  29187. proto$1.weekdaysRegex = weekdaysRegex;
  29188. proto$1.weekdaysShortRegex = weekdaysShortRegex;
  29189. proto$1.weekdaysMinRegex = weekdaysMinRegex;
  29190. // Hours
  29191. proto$1.isPM = localeIsPM;
  29192. proto$1.meridiem = localeMeridiem;
  29193. function get$1 (format, index, field, setter) {
  29194. var locale = getLocale();
  29195. var utc = createUTC().set(setter, index);
  29196. return locale[field](utc, format);
  29197. }
  29198. function listMonthsImpl (format, index, field) {
  29199. if (isNumber(format)) {
  29200. index = format;
  29201. format = undefined;
  29202. }
  29203. format = format || '';
  29204. if (index != null) {
  29205. return get$1(format, index, field, 'month');
  29206. }
  29207. var i;
  29208. var out = [];
  29209. for (i = 0; i < 12; i++) {
  29210. out[i] = get$1(format, i, field, 'month');
  29211. }
  29212. return out;
  29213. }
  29214. // ()
  29215. // (5)
  29216. // (fmt, 5)
  29217. // (fmt)
  29218. // (true)
  29219. // (true, 5)
  29220. // (true, fmt, 5)
  29221. // (true, fmt)
  29222. function listWeekdaysImpl (localeSorted, format, index, field) {
  29223. if (typeof localeSorted === 'boolean') {
  29224. if (isNumber(format)) {
  29225. index = format;
  29226. format = undefined;
  29227. }
  29228. format = format || '';
  29229. } else {
  29230. format = localeSorted;
  29231. index = format;
  29232. localeSorted = false;
  29233. if (isNumber(format)) {
  29234. index = format;
  29235. format = undefined;
  29236. }
  29237. format = format || '';
  29238. }
  29239. var locale = getLocale(),
  29240. shift = localeSorted ? locale._week.dow : 0;
  29241. if (index != null) {
  29242. return get$1(format, (index + shift) % 7, field, 'day');
  29243. }
  29244. var i;
  29245. var out = [];
  29246. for (i = 0; i < 7; i++) {
  29247. out[i] = get$1(format, (i + shift) % 7, field, 'day');
  29248. }
  29249. return out;
  29250. }
  29251. function listMonths (format, index) {
  29252. return listMonthsImpl(format, index, 'months');
  29253. }
  29254. function listMonthsShort (format, index) {
  29255. return listMonthsImpl(format, index, 'monthsShort');
  29256. }
  29257. function listWeekdays (localeSorted, format, index) {
  29258. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  29259. }
  29260. function listWeekdaysShort (localeSorted, format, index) {
  29261. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  29262. }
  29263. function listWeekdaysMin (localeSorted, format, index) {
  29264. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  29265. }
  29266. getSetGlobalLocale('en', {
  29267. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  29268. ordinal : function (number) {
  29269. var b = number % 10,
  29270. output = (toInt(number % 100 / 10) === 1) ? 'th' :
  29271. (b === 1) ? 'st' :
  29272. (b === 2) ? 'nd' :
  29273. (b === 3) ? 'rd' : 'th';
  29274. return number + output;
  29275. }
  29276. });
  29277. // Side effect imports
  29278. hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);
  29279. hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);
  29280. var mathAbs = Math.abs;
  29281. function abs () {
  29282. var data = this._data;
  29283. this._milliseconds = mathAbs(this._milliseconds);
  29284. this._days = mathAbs(this._days);
  29285. this._months = mathAbs(this._months);
  29286. data.milliseconds = mathAbs(data.milliseconds);
  29287. data.seconds = mathAbs(data.seconds);
  29288. data.minutes = mathAbs(data.minutes);
  29289. data.hours = mathAbs(data.hours);
  29290. data.months = mathAbs(data.months);
  29291. data.years = mathAbs(data.years);
  29292. return this;
  29293. }
  29294. function addSubtract$1 (duration, input, value, direction) {
  29295. var other = createDuration(input, value);
  29296. duration._milliseconds += direction * other._milliseconds;
  29297. duration._days += direction * other._days;
  29298. duration._months += direction * other._months;
  29299. return duration._bubble();
  29300. }
  29301. // supports only 2.0-style add(1, 's') or add(duration)
  29302. function add$1 (input, value) {
  29303. return addSubtract$1(this, input, value, 1);
  29304. }
  29305. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  29306. function subtract$1 (input, value) {
  29307. return addSubtract$1(this, input, value, -1);
  29308. }
  29309. function absCeil (number) {
  29310. if (number < 0) {
  29311. return Math.floor(number);
  29312. } else {
  29313. return Math.ceil(number);
  29314. }
  29315. }
  29316. function bubble () {
  29317. var milliseconds = this._milliseconds;
  29318. var days = this._days;
  29319. var months = this._months;
  29320. var data = this._data;
  29321. var seconds, minutes, hours, years, monthsFromDays;
  29322. // if we have a mix of positive and negative values, bubble down first
  29323. // check: https://github.com/moment/moment/issues/2166
  29324. if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
  29325. (milliseconds <= 0 && days <= 0 && months <= 0))) {
  29326. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  29327. days = 0;
  29328. months = 0;
  29329. }
  29330. // The following code bubbles up values, see the tests for
  29331. // examples of what that means.
  29332. data.milliseconds = milliseconds % 1000;
  29333. seconds = absFloor(milliseconds / 1000);
  29334. data.seconds = seconds % 60;
  29335. minutes = absFloor(seconds / 60);
  29336. data.minutes = minutes % 60;
  29337. hours = absFloor(minutes / 60);
  29338. data.hours = hours % 24;
  29339. days += absFloor(hours / 24);
  29340. // convert days to months
  29341. monthsFromDays = absFloor(daysToMonths(days));
  29342. months += monthsFromDays;
  29343. days -= absCeil(monthsToDays(monthsFromDays));
  29344. // 12 months -> 1 year
  29345. years = absFloor(months / 12);
  29346. months %= 12;
  29347. data.days = days;
  29348. data.months = months;
  29349. data.years = years;
  29350. return this;
  29351. }
  29352. function daysToMonths (days) {
  29353. // 400 years have 146097 days (taking into account leap year rules)
  29354. // 400 years have 12 months === 4800
  29355. return days * 4800 / 146097;
  29356. }
  29357. function monthsToDays (months) {
  29358. // the reverse of daysToMonths
  29359. return months * 146097 / 4800;
  29360. }
  29361. function as (units) {
  29362. if (!this.isValid()) {
  29363. return NaN;
  29364. }
  29365. var days;
  29366. var months;
  29367. var milliseconds = this._milliseconds;
  29368. units = normalizeUnits(units);
  29369. if (units === 'month' || units === 'year') {
  29370. days = this._days + milliseconds / 864e5;
  29371. months = this._months + daysToMonths(days);
  29372. return units === 'month' ? months : months / 12;
  29373. } else {
  29374. // handle milliseconds separately because of floating point math errors (issue #1867)
  29375. days = this._days + Math.round(monthsToDays(this._months));
  29376. switch (units) {
  29377. case 'week' : return days / 7 + milliseconds / 6048e5;
  29378. case 'day' : return days + milliseconds / 864e5;
  29379. case 'hour' : return days * 24 + milliseconds / 36e5;
  29380. case 'minute' : return days * 1440 + milliseconds / 6e4;
  29381. case 'second' : return days * 86400 + milliseconds / 1000;
  29382. // Math.floor prevents floating point math errors here
  29383. case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
  29384. default: throw new Error('Unknown unit ' + units);
  29385. }
  29386. }
  29387. }
  29388. // TODO: Use this.as('ms')?
  29389. function valueOf$1 () {
  29390. if (!this.isValid()) {
  29391. return NaN;
  29392. }
  29393. return (
  29394. this._milliseconds +
  29395. this._days * 864e5 +
  29396. (this._months % 12) * 2592e6 +
  29397. toInt(this._months / 12) * 31536e6
  29398. );
  29399. }
  29400. function makeAs (alias) {
  29401. return function () {
  29402. return this.as(alias);
  29403. };
  29404. }
  29405. var asMilliseconds = makeAs('ms');
  29406. var asSeconds = makeAs('s');
  29407. var asMinutes = makeAs('m');
  29408. var asHours = makeAs('h');
  29409. var asDays = makeAs('d');
  29410. var asWeeks = makeAs('w');
  29411. var asMonths = makeAs('M');
  29412. var asYears = makeAs('y');
  29413. function clone$1 () {
  29414. return createDuration(this);
  29415. }
  29416. function get$2 (units) {
  29417. units = normalizeUnits(units);
  29418. return this.isValid() ? this[units + 's']() : NaN;
  29419. }
  29420. function makeGetter(name) {
  29421. return function () {
  29422. return this.isValid() ? this._data[name] : NaN;
  29423. };
  29424. }
  29425. var milliseconds = makeGetter('milliseconds');
  29426. var seconds = makeGetter('seconds');
  29427. var minutes = makeGetter('minutes');
  29428. var hours = makeGetter('hours');
  29429. var days = makeGetter('days');
  29430. var months = makeGetter('months');
  29431. var years = makeGetter('years');
  29432. function weeks () {
  29433. return absFloor(this.days() / 7);
  29434. }
  29435. var round = Math.round;
  29436. var thresholds = {
  29437. ss: 44, // a few seconds to seconds
  29438. s : 45, // seconds to minute
  29439. m : 45, // minutes to hour
  29440. h : 22, // hours to day
  29441. d : 26, // days to month
  29442. M : 11 // months to year
  29443. };
  29444. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  29445. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  29446. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  29447. }
  29448. function relativeTime$1 (posNegDuration, withoutSuffix, locale) {
  29449. var duration = createDuration(posNegDuration).abs();
  29450. var seconds = round(duration.as('s'));
  29451. var minutes = round(duration.as('m'));
  29452. var hours = round(duration.as('h'));
  29453. var days = round(duration.as('d'));
  29454. var months = round(duration.as('M'));
  29455. var years = round(duration.as('y'));
  29456. var a = seconds <= thresholds.ss && ['s', seconds] ||
  29457. seconds < thresholds.s && ['ss', seconds] ||
  29458. minutes <= 1 && ['m'] ||
  29459. minutes < thresholds.m && ['mm', minutes] ||
  29460. hours <= 1 && ['h'] ||
  29461. hours < thresholds.h && ['hh', hours] ||
  29462. days <= 1 && ['d'] ||
  29463. days < thresholds.d && ['dd', days] ||
  29464. months <= 1 && ['M'] ||
  29465. months < thresholds.M && ['MM', months] ||
  29466. years <= 1 && ['y'] || ['yy', years];
  29467. a[2] = withoutSuffix;
  29468. a[3] = +posNegDuration > 0;
  29469. a[4] = locale;
  29470. return substituteTimeAgo.apply(null, a);
  29471. }
  29472. // This function allows you to set the rounding function for relative time strings
  29473. function getSetRelativeTimeRounding (roundingFunction) {
  29474. if (roundingFunction === undefined) {
  29475. return round;
  29476. }
  29477. if (typeof(roundingFunction) === 'function') {
  29478. round = roundingFunction;
  29479. return true;
  29480. }
  29481. return false;
  29482. }
  29483. // This function allows you to set a threshold for relative time strings
  29484. function getSetRelativeTimeThreshold (threshold, limit) {
  29485. if (thresholds[threshold] === undefined) {
  29486. return false;
  29487. }
  29488. if (limit === undefined) {
  29489. return thresholds[threshold];
  29490. }
  29491. thresholds[threshold] = limit;
  29492. if (threshold === 's') {
  29493. thresholds.ss = limit - 1;
  29494. }
  29495. return true;
  29496. }
  29497. function humanize (withSuffix) {
  29498. if (!this.isValid()) {
  29499. return this.localeData().invalidDate();
  29500. }
  29501. var locale = this.localeData();
  29502. var output = relativeTime$1(this, !withSuffix, locale);
  29503. if (withSuffix) {
  29504. output = locale.pastFuture(+this, output);
  29505. }
  29506. return locale.postformat(output);
  29507. }
  29508. var abs$1 = Math.abs;
  29509. function sign(x) {
  29510. return ((x > 0) - (x < 0)) || +x;
  29511. }
  29512. function toISOString$1() {
  29513. // for ISO strings we do not use the normal bubbling rules:
  29514. // * milliseconds bubble up until they become hours
  29515. // * days do not bubble at all
  29516. // * months bubble up until they become years
  29517. // This is because there is no context-free conversion between hours and days
  29518. // (think of clock changes)
  29519. // and also not between days and months (28-31 days per month)
  29520. if (!this.isValid()) {
  29521. return this.localeData().invalidDate();
  29522. }
  29523. var seconds = abs$1(this._milliseconds) / 1000;
  29524. var days = abs$1(this._days);
  29525. var months = abs$1(this._months);
  29526. var minutes, hours, years;
  29527. // 3600 seconds -> 60 minutes -> 1 hour
  29528. minutes = absFloor(seconds / 60);
  29529. hours = absFloor(minutes / 60);
  29530. seconds %= 60;
  29531. minutes %= 60;
  29532. // 12 months -> 1 year
  29533. years = absFloor(months / 12);
  29534. months %= 12;
  29535. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  29536. var Y = years;
  29537. var M = months;
  29538. var D = days;
  29539. var h = hours;
  29540. var m = minutes;
  29541. var s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
  29542. var total = this.asSeconds();
  29543. if (!total) {
  29544. // this is the same as C#'s (Noda) and python (isodate)...
  29545. // but not other JS (goog.date)
  29546. return 'P0D';
  29547. }
  29548. var totalSign = total < 0 ? '-' : '';
  29549. var ymSign = sign(this._months) !== sign(total) ? '-' : '';
  29550. var daysSign = sign(this._days) !== sign(total) ? '-' : '';
  29551. var hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
  29552. return totalSign + 'P' +
  29553. (Y ? ymSign + Y + 'Y' : '') +
  29554. (M ? ymSign + M + 'M' : '') +
  29555. (D ? daysSign + D + 'D' : '') +
  29556. ((h || m || s) ? 'T' : '') +
  29557. (h ? hmsSign + h + 'H' : '') +
  29558. (m ? hmsSign + m + 'M' : '') +
  29559. (s ? hmsSign + s + 'S' : '');
  29560. }
  29561. var proto$2 = Duration.prototype;
  29562. proto$2.isValid = isValid$1;
  29563. proto$2.abs = abs;
  29564. proto$2.add = add$1;
  29565. proto$2.subtract = subtract$1;
  29566. proto$2.as = as;
  29567. proto$2.asMilliseconds = asMilliseconds;
  29568. proto$2.asSeconds = asSeconds;
  29569. proto$2.asMinutes = asMinutes;
  29570. proto$2.asHours = asHours;
  29571. proto$2.asDays = asDays;
  29572. proto$2.asWeeks = asWeeks;
  29573. proto$2.asMonths = asMonths;
  29574. proto$2.asYears = asYears;
  29575. proto$2.valueOf = valueOf$1;
  29576. proto$2._bubble = bubble;
  29577. proto$2.clone = clone$1;
  29578. proto$2.get = get$2;
  29579. proto$2.milliseconds = milliseconds;
  29580. proto$2.seconds = seconds;
  29581. proto$2.minutes = minutes;
  29582. proto$2.hours = hours;
  29583. proto$2.days = days;
  29584. proto$2.weeks = weeks;
  29585. proto$2.months = months;
  29586. proto$2.years = years;
  29587. proto$2.humanize = humanize;
  29588. proto$2.toISOString = toISOString$1;
  29589. proto$2.toString = toISOString$1;
  29590. proto$2.toJSON = toISOString$1;
  29591. proto$2.locale = locale;
  29592. proto$2.localeData = localeData;
  29593. // Deprecations
  29594. proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);
  29595. proto$2.lang = lang;
  29596. // Side effect imports
  29597. // FORMATTING
  29598. addFormatToken('X', 0, 0, 'unix');
  29599. addFormatToken('x', 0, 0, 'valueOf');
  29600. // PARSING
  29601. addRegexToken('x', matchSigned);
  29602. addRegexToken('X', matchTimestamp);
  29603. addParseToken('X', function (input, array, config) {
  29604. config._d = new Date(parseFloat(input, 10) * 1000);
  29605. });
  29606. addParseToken('x', function (input, array, config) {
  29607. config._d = new Date(toInt(input));
  29608. });
  29609. // Side effect imports
  29610. hooks.version = '2.19.4';
  29611. setHookCallback(createLocal);
  29612. hooks.fn = proto;
  29613. hooks.min = min;
  29614. hooks.max = max;
  29615. hooks.now = now;
  29616. hooks.utc = createUTC;
  29617. hooks.unix = createUnix;
  29618. hooks.months = listMonths;
  29619. hooks.isDate = isDate;
  29620. hooks.locale = getSetGlobalLocale;
  29621. hooks.invalid = createInvalid;
  29622. hooks.duration = createDuration;
  29623. hooks.isMoment = isMoment;
  29624. hooks.weekdays = listWeekdays;
  29625. hooks.parseZone = createInZone;
  29626. hooks.localeData = getLocale;
  29627. hooks.isDuration = isDuration;
  29628. hooks.monthsShort = listMonthsShort;
  29629. hooks.weekdaysMin = listWeekdaysMin;
  29630. hooks.defineLocale = defineLocale;
  29631. hooks.updateLocale = updateLocale;
  29632. hooks.locales = listLocales;
  29633. hooks.weekdaysShort = listWeekdaysShort;
  29634. hooks.normalizeUnits = normalizeUnits;
  29635. hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  29636. hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  29637. hooks.calendarFormat = getCalendarFormat;
  29638. hooks.prototype = proto;
  29639. return hooks;
  29640. })));
  29641. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
  29642. /***/ }),
  29643. /***/ "./node_modules/pluggable.js/dist/pluggable.js":
  29644. /*!*****************************************************!*\
  29645. !*** ./node_modules/pluggable.js/dist/pluggable.js ***!
  29646. \*****************************************************/
  29647. /*! no static exports found */
  29648. /***/ (function(module, exports, __webpack_require__) {
  29649. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  29650. if (true) {
  29651. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  29652. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  29653. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  29654. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  29655. } else { var mod; }
  29656. })(this, function (exports, _lodash) {
  29657. 'use strict';
  29658. Object.defineProperty(exports, "__esModule", {
  29659. value: true
  29660. });
  29661. exports.enable = undefined;
  29662. var _ = _interopRequireWildcard(_lodash);
  29663. function _interopRequireWildcard(obj) {
  29664. if (obj && obj.__esModule) {
  29665. return obj;
  29666. } else {
  29667. var newObj = {};
  29668. if (obj != null) {
  29669. for (var key in obj) {
  29670. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  29671. }
  29672. }
  29673. newObj.default = obj;
  29674. return newObj;
  29675. }
  29676. }
  29677. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
  29678. return typeof obj;
  29679. } : function (obj) {
  29680. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  29681. };
  29682. // The `PluginSocket` class contains the plugin architecture, and gets
  29683. // created whenever `pluggable.enable(obj);` is called on the object
  29684. // that you want to make pluggable.
  29685. // You can also see it as the thing into which the plugins are plugged.
  29686. // It takes two parameters, first, the object being made pluggable, and
  29687. // then the name by which the pluggable object may be referenced on the
  29688. // __super__ object (inside overrides).
  29689. function PluginSocket(plugged, name) {
  29690. this.name = name;
  29691. this.plugged = plugged;
  29692. if (typeof this.plugged.__super__ === 'undefined') {
  29693. this.plugged.__super__ = {};
  29694. } else if (typeof this.plugged.__super__ === 'string') {
  29695. this.plugged.__super__ = { '__string__': this.plugged.__super__ };
  29696. }
  29697. this.plugged.__super__[name] = this.plugged;
  29698. this.plugins = {};
  29699. this.initialized_plugins = [];
  29700. }
  29701. // Now we add methods to the PluginSocket by adding them to its
  29702. // prototype.
  29703. _.extend(PluginSocket.prototype, {
  29704. // `wrappedOverride` creates a partially applied wrapper function
  29705. // that makes sure to set the proper super method when the
  29706. // overriding method is called. This is done to enable
  29707. // chaining of plugin methods, all the way up to the
  29708. // original method.
  29709. wrappedOverride: function wrappedOverride(key, value, super_method, default_super) {
  29710. if (typeof super_method === "function") {
  29711. if (typeof this.__super__ === "undefined") {
  29712. /* We're not on the context of the plugged object.
  29713. * This can happen when the overridden method is called via
  29714. * an event handler or when it's a constructor.
  29715. *
  29716. * In this case, we simply tack on the __super__ obj.
  29717. */
  29718. this.__super__ = default_super;
  29719. }
  29720. this.__super__[key] = super_method.bind(this);
  29721. }
  29722. return value.apply(this, _.drop(arguments, 4));
  29723. },
  29724. // `_overrideAttribute` overrides an attribute on the original object
  29725. // (the thing being plugged into).
  29726. //
  29727. // If the attribute being overridden is a function, then the original
  29728. // function will still be available via the `__super__` attribute.
  29729. //
  29730. // If the same function is being overridden multiple times, then
  29731. // the original function will be available at the end of a chain of
  29732. // functions, starting from the most recent override, all the way
  29733. // back to the original function, each being referenced by the
  29734. // previous' __super__ attribute.
  29735. //
  29736. // For example:
  29737. //
  29738. // `plugin2.MyFunc.__super__.myFunc => plugin1.MyFunc.__super__.myFunc => original.myFunc`
  29739. _overrideAttribute: function _overrideAttribute(key, plugin) {
  29740. var value = plugin.overrides[key];
  29741. if (typeof value === "function") {
  29742. var default_super = {};
  29743. default_super[this.name] = this.plugged;
  29744. var wrapped_function = _.partial(this.wrappedOverride, key, value, this.plugged[key], default_super);
  29745. this.plugged[key] = wrapped_function;
  29746. } else {
  29747. this.plugged[key] = value;
  29748. }
  29749. },
  29750. _extendObject: function _extendObject(obj, attributes) {
  29751. if (!obj.prototype.__super__) {
  29752. obj.prototype.__super__ = {};
  29753. obj.prototype.__super__[this.name] = this.plugged;
  29754. }
  29755. var that = this;
  29756. _.each(attributes, function (value, key) {
  29757. if (key === 'events') {
  29758. obj.prototype[key] = _.extend(value, obj.prototype[key]);
  29759. } else if (typeof value === 'function') {
  29760. // We create a partially applied wrapper function, that
  29761. // makes sure to set the proper super method when the
  29762. // overriding method is called. This is done to enable
  29763. // chaining of plugin methods, all the way up to the
  29764. // original method.
  29765. var default_super = {};
  29766. default_super[that.name] = that.plugged;
  29767. var wrapped_function = _.partial(that.wrappedOverride, key, value, obj.prototype[key], default_super);
  29768. obj.prototype[key] = wrapped_function;
  29769. } else {
  29770. obj.prototype[key] = value;
  29771. }
  29772. });
  29773. },
  29774. // Plugins can specify dependencies (by means of the
  29775. // `dependencies` list attribute) which refers to dependencies
  29776. // which will be initialized first, before the plugin itself gets initialized.
  29777. //
  29778. // If `strict_plugin_dependencies` is set to `false` (on the object being
  29779. // made pluggable), then no error will be thrown if any of these plugins aren't
  29780. // available.
  29781. loadPluginDependencies: function loadPluginDependencies(plugin) {
  29782. var _this = this;
  29783. _.each(plugin.dependencies, function (name) {
  29784. var dep = _this.plugins[name];
  29785. if (dep) {
  29786. if (_.includes(dep.dependencies, plugin.__name__)) {
  29787. /* FIXME: circular dependency checking is only one level deep. */
  29788. throw "Found a circular dependency between the plugins \"" + plugin.__name__ + "\" and \"" + name + "\"";
  29789. }
  29790. _this.initializePlugin(dep);
  29791. } else {
  29792. _this.throwUndefinedDependencyError("Could not find dependency \"" + name + "\" " + "for the plugin \"" + plugin.__name__ + "\". " + "If it's needed, make sure it's loaded by require.js");
  29793. }
  29794. });
  29795. },
  29796. throwUndefinedDependencyError: function throwUndefinedDependencyError(msg) {
  29797. if (this.plugged.strict_plugin_dependencies) {
  29798. throw msg;
  29799. } else {
  29800. console.log(msg);
  29801. return;
  29802. }
  29803. },
  29804. // `applyOverrides` is called by initializePlugin. It applies any
  29805. // and all overrides of methods or Backbone views and models that
  29806. // are defined on any of the plugins.
  29807. applyOverrides: function applyOverrides(plugin) {
  29808. var _this2 = this;
  29809. _.each(Object.keys(plugin.overrides || {}), function (key) {
  29810. var override = plugin.overrides[key];
  29811. if ((typeof override === 'undefined' ? 'undefined' : _typeof(override)) === "object") {
  29812. if (typeof _this2.plugged[key] === 'undefined') {
  29813. _this2.throwUndefinedDependencyError("Error: Plugin \"" + plugin.__name__ + "\" tried to override " + key + " but it's not found.");
  29814. } else {
  29815. _this2._extendObject(_this2.plugged[key], override);
  29816. }
  29817. } else {
  29818. _this2._overrideAttribute(key, plugin);
  29819. }
  29820. });
  29821. },
  29822. // `initializePlugin` applies the overrides (if any) defined on all
  29823. // the registered plugins and then calls the initialize method of the plugin
  29824. initializePlugin: function initializePlugin(plugin) {
  29825. if (!_.includes(_.keys(this.allowed_plugins), plugin.__name__)) {
  29826. /* Don't initialize disallowed plugins. */
  29827. return;
  29828. }
  29829. if (_.includes(this.initialized_plugins, plugin.__name__)) {
  29830. /* Don't initialize plugins twice, otherwise we get
  29831. * infinite recursion in overridden methods.
  29832. */
  29833. return;
  29834. }
  29835. if (_.isBoolean(plugin.enabled) && plugin.enabled || _.isFunction(plugin.enabled) && plugin.enabled(this.plugged) || _.isNil(plugin.enabled)) {
  29836. _.extend(plugin, this.properties);
  29837. if (plugin.dependencies) {
  29838. this.loadPluginDependencies(plugin);
  29839. }
  29840. this.applyOverrides(plugin);
  29841. if (typeof plugin.initialize === "function") {
  29842. plugin.initialize.bind(plugin)(this);
  29843. }
  29844. this.initialized_plugins.push(plugin.__name__);
  29845. }
  29846. },
  29847. // `registerPlugin` registers (or inserts, if you'd like) a plugin,
  29848. // by adding it to the `plugins` map on the PluginSocket instance.
  29849. registerPlugin: function registerPlugin(name, plugin) {
  29850. if (name in this.plugins) {
  29851. throw new Error('Error: Plugin name ' + name + ' is already taken');
  29852. }
  29853. plugin.__name__ = name;
  29854. this.plugins[name] = plugin;
  29855. },
  29856. // `initializePlugins` should get called once all plugins have been
  29857. // registered. It will then iterate through all the plugins, calling
  29858. // `initializePlugin` for each.
  29859. // The passed in properties variable is an object with attributes and methods
  29860. // which will be attached to the plugins.
  29861. initializePlugins: function initializePlugins() {
  29862. var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  29863. var whitelist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  29864. var blacklist = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  29865. if (!_.size(this.plugins)) {
  29866. return;
  29867. }
  29868. this.properties = properties;
  29869. this.allowed_plugins = _.pickBy(this.plugins, function (plugin, key) {
  29870. return (!whitelist.length || whitelist.length && _.includes(whitelist, key)) && !_.includes(blacklist, key);
  29871. });
  29872. _.each(_.values(this.allowed_plugins), this.initializePlugin.bind(this));
  29873. }
  29874. });
  29875. function enable(object, name, attrname) {
  29876. // Call the `enable` method to make an object pluggable
  29877. //
  29878. // It takes three parameters:
  29879. // - `object`: The object that gets made pluggable.
  29880. // - `name`: The string name by which the now pluggable object
  29881. // may be referenced on the __super__ obj (in overrides).
  29882. // The default value is "plugged".
  29883. // - `attrname`: The string name of the attribute on the now
  29884. // pluggable object, which refers to the PluginSocket instance
  29885. // that gets created.
  29886. if (typeof attrname === "undefined") {
  29887. attrname = "pluginSocket";
  29888. }
  29889. if (typeof name === 'undefined') {
  29890. name = 'plugged';
  29891. }
  29892. var ref = {};
  29893. ref[attrname] = new PluginSocket(object, name);
  29894. return _.extend(object, ref);
  29895. }
  29896. exports.enable = enable;
  29897. exports.default = {
  29898. enable: enable
  29899. };
  29900. });
  29901. //# sourceMappingURL=pluggable.js.map
  29902. /***/ }),
  29903. /***/ "./node_modules/process/browser.js":
  29904. /*!*****************************************!*\
  29905. !*** ./node_modules/process/browser.js ***!
  29906. \*****************************************/
  29907. /*! no static exports found */
  29908. /***/ (function(module, exports) {
  29909. // shim for using process in browser
  29910. var process = module.exports = {};
  29911. // cached from whatever global is present so that test runners that stub it
  29912. // don't break things. But we need to wrap it in a try catch in case it is
  29913. // wrapped in strict mode code which doesn't define any globals. It's inside a
  29914. // function because try/catches deoptimize in certain engines.
  29915. var cachedSetTimeout;
  29916. var cachedClearTimeout;
  29917. function defaultSetTimout() {
  29918. throw new Error('setTimeout has not been defined');
  29919. }
  29920. function defaultClearTimeout () {
  29921. throw new Error('clearTimeout has not been defined');
  29922. }
  29923. (function () {
  29924. try {
  29925. if (typeof setTimeout === 'function') {
  29926. cachedSetTimeout = setTimeout;
  29927. } else {
  29928. cachedSetTimeout = defaultSetTimout;
  29929. }
  29930. } catch (e) {
  29931. cachedSetTimeout = defaultSetTimout;
  29932. }
  29933. try {
  29934. if (typeof clearTimeout === 'function') {
  29935. cachedClearTimeout = clearTimeout;
  29936. } else {
  29937. cachedClearTimeout = defaultClearTimeout;
  29938. }
  29939. } catch (e) {
  29940. cachedClearTimeout = defaultClearTimeout;
  29941. }
  29942. } ())
  29943. function runTimeout(fun) {
  29944. if (cachedSetTimeout === setTimeout) {
  29945. //normal enviroments in sane situations
  29946. return setTimeout(fun, 0);
  29947. }
  29948. // if setTimeout wasn't available but was latter defined
  29949. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  29950. cachedSetTimeout = setTimeout;
  29951. return setTimeout(fun, 0);
  29952. }
  29953. try {
  29954. // when when somebody has screwed with setTimeout but no I.E. maddness
  29955. return cachedSetTimeout(fun, 0);
  29956. } catch(e){
  29957. try {
  29958. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  29959. return cachedSetTimeout.call(null, fun, 0);
  29960. } catch(e){
  29961. // 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
  29962. return cachedSetTimeout.call(this, fun, 0);
  29963. }
  29964. }
  29965. }
  29966. function runClearTimeout(marker) {
  29967. if (cachedClearTimeout === clearTimeout) {
  29968. //normal enviroments in sane situations
  29969. return clearTimeout(marker);
  29970. }
  29971. // if clearTimeout wasn't available but was latter defined
  29972. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  29973. cachedClearTimeout = clearTimeout;
  29974. return clearTimeout(marker);
  29975. }
  29976. try {
  29977. // when when somebody has screwed with setTimeout but no I.E. maddness
  29978. return cachedClearTimeout(marker);
  29979. } catch (e){
  29980. try {
  29981. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  29982. return cachedClearTimeout.call(null, marker);
  29983. } catch (e){
  29984. // 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.
  29985. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  29986. return cachedClearTimeout.call(this, marker);
  29987. }
  29988. }
  29989. }
  29990. var queue = [];
  29991. var draining = false;
  29992. var currentQueue;
  29993. var queueIndex = -1;
  29994. function cleanUpNextTick() {
  29995. if (!draining || !currentQueue) {
  29996. return;
  29997. }
  29998. draining = false;
  29999. if (currentQueue.length) {
  30000. queue = currentQueue.concat(queue);
  30001. } else {
  30002. queueIndex = -1;
  30003. }
  30004. if (queue.length) {
  30005. drainQueue();
  30006. }
  30007. }
  30008. function drainQueue() {
  30009. if (draining) {
  30010. return;
  30011. }
  30012. var timeout = runTimeout(cleanUpNextTick);
  30013. draining = true;
  30014. var len = queue.length;
  30015. while(len) {
  30016. currentQueue = queue;
  30017. queue = [];
  30018. while (++queueIndex < len) {
  30019. if (currentQueue) {
  30020. currentQueue[queueIndex].run();
  30021. }
  30022. }
  30023. queueIndex = -1;
  30024. len = queue.length;
  30025. }
  30026. currentQueue = null;
  30027. draining = false;
  30028. runClearTimeout(timeout);
  30029. }
  30030. process.nextTick = function (fun) {
  30031. var args = new Array(arguments.length - 1);
  30032. if (arguments.length > 1) {
  30033. for (var i = 1; i < arguments.length; i++) {
  30034. args[i - 1] = arguments[i];
  30035. }
  30036. }
  30037. queue.push(new Item(fun, args));
  30038. if (queue.length === 1 && !draining) {
  30039. runTimeout(drainQueue);
  30040. }
  30041. };
  30042. // v8 likes predictible objects
  30043. function Item(fun, array) {
  30044. this.fun = fun;
  30045. this.array = array;
  30046. }
  30047. Item.prototype.run = function () {
  30048. this.fun.apply(null, this.array);
  30049. };
  30050. process.title = 'browser';
  30051. process.browser = true;
  30052. process.env = {};
  30053. process.argv = [];
  30054. process.version = ''; // empty string to avoid regexp issues
  30055. process.versions = {};
  30056. function noop() {}
  30057. process.on = noop;
  30058. process.addListener = noop;
  30059. process.once = noop;
  30060. process.off = noop;
  30061. process.removeListener = noop;
  30062. process.removeAllListeners = noop;
  30063. process.emit = noop;
  30064. process.prependListener = noop;
  30065. process.prependOnceListener = noop;
  30066. process.listeners = function (name) { return [] }
  30067. process.binding = function (name) {
  30068. throw new Error('process.binding is not supported');
  30069. };
  30070. process.cwd = function () { return '/' };
  30071. process.chdir = function (dir) {
  30072. throw new Error('process.chdir is not supported');
  30073. };
  30074. process.umask = function() { return 0; };
  30075. /***/ }),
  30076. /***/ "./node_modules/sizzle/dist/sizzle.js":
  30077. /*!********************************************!*\
  30078. !*** ./node_modules/sizzle/dist/sizzle.js ***!
  30079. \********************************************/
  30080. /*! no static exports found */
  30081. /***/ (function(module, exports, __webpack_require__) {
  30082. var __WEBPACK_AMD_DEFINE_RESULT__;/*!
  30083. * Sizzle CSS Selector Engine v2.3.3
  30084. * https://sizzlejs.com/
  30085. *
  30086. * Copyright jQuery Foundation and other contributors
  30087. * Released under the MIT license
  30088. * http://jquery.org/license
  30089. *
  30090. * Date: 2016-08-08
  30091. */
  30092. (function( window ) {
  30093. var i,
  30094. support,
  30095. Expr,
  30096. getText,
  30097. isXML,
  30098. tokenize,
  30099. compile,
  30100. select,
  30101. outermostContext,
  30102. sortInput,
  30103. hasDuplicate,
  30104. // Local document vars
  30105. setDocument,
  30106. document,
  30107. docElem,
  30108. documentIsHTML,
  30109. rbuggyQSA,
  30110. rbuggyMatches,
  30111. matches,
  30112. contains,
  30113. // Instance-specific data
  30114. expando = "sizzle" + 1 * new Date(),
  30115. preferredDoc = window.document,
  30116. dirruns = 0,
  30117. done = 0,
  30118. classCache = createCache(),
  30119. tokenCache = createCache(),
  30120. compilerCache = createCache(),
  30121. sortOrder = function( a, b ) {
  30122. if ( a === b ) {
  30123. hasDuplicate = true;
  30124. }
  30125. return 0;
  30126. },
  30127. // Instance methods
  30128. hasOwn = ({}).hasOwnProperty,
  30129. arr = [],
  30130. pop = arr.pop,
  30131. push_native = arr.push,
  30132. push = arr.push,
  30133. slice = arr.slice,
  30134. // Use a stripped-down indexOf as it's faster than native
  30135. // https://jsperf.com/thor-indexof-vs-for/5
  30136. indexOf = function( list, elem ) {
  30137. var i = 0,
  30138. len = list.length;
  30139. for ( ; i < len; i++ ) {
  30140. if ( list[i] === elem ) {
  30141. return i;
  30142. }
  30143. }
  30144. return -1;
  30145. },
  30146. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  30147. // Regular expressions
  30148. // http://www.w3.org/TR/css3-selectors/#whitespace
  30149. whitespace = "[\\x20\\t\\r\\n\\f]",
  30150. // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  30151. identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
  30152. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  30153. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  30154. // Operator (capture 2)
  30155. "*([*^$|!~]?=)" + whitespace +
  30156. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  30157. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  30158. "*\\]",
  30159. pseudos = ":(" + identifier + ")(?:\\((" +
  30160. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  30161. // 1. quoted (capture 3; capture 4 or capture 5)
  30162. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  30163. // 2. simple (capture 6)
  30164. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  30165. // 3. anything else (capture 2)
  30166. ".*" +
  30167. ")\\)|)",
  30168. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  30169. rwhitespace = new RegExp( whitespace + "+", "g" ),
  30170. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  30171. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  30172. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  30173. rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
  30174. rpseudo = new RegExp( pseudos ),
  30175. ridentifier = new RegExp( "^" + identifier + "$" ),
  30176. matchExpr = {
  30177. "ID": new RegExp( "^#(" + identifier + ")" ),
  30178. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  30179. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  30180. "ATTR": new RegExp( "^" + attributes ),
  30181. "PSEUDO": new RegExp( "^" + pseudos ),
  30182. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  30183. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  30184. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  30185. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  30186. // For use in libraries implementing .is()
  30187. // We use this for POS matching in `select`
  30188. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  30189. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  30190. },
  30191. rinputs = /^(?:input|select|textarea|button)$/i,
  30192. rheader = /^h\d$/i,
  30193. rnative = /^[^{]+\{\s*\[native \w/,
  30194. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  30195. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  30196. rsibling = /[+~]/,
  30197. // CSS escapes
  30198. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  30199. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  30200. funescape = function( _, escaped, escapedWhitespace ) {
  30201. var high = "0x" + escaped - 0x10000;
  30202. // NaN means non-codepoint
  30203. // Support: Firefox<24
  30204. // Workaround erroneous numeric interpretation of +"0x"
  30205. return high !== high || escapedWhitespace ?
  30206. escaped :
  30207. high < 0 ?
  30208. // BMP codepoint
  30209. String.fromCharCode( high + 0x10000 ) :
  30210. // Supplemental Plane codepoint (surrogate pair)
  30211. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  30212. },
  30213. // CSS string/identifier serialization
  30214. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  30215. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  30216. fcssescape = function( ch, asCodePoint ) {
  30217. if ( asCodePoint ) {
  30218. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  30219. if ( ch === "\0" ) {
  30220. return "\uFFFD";
  30221. }
  30222. // Control characters and (dependent upon position) numbers get escaped as code points
  30223. return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  30224. }
  30225. // Other potentially-special ASCII characters get backslash-escaped
  30226. return "\\" + ch;
  30227. },
  30228. // Used for iframes
  30229. // See setDocument()
  30230. // Removing the function wrapper causes a "Permission Denied"
  30231. // error in IE
  30232. unloadHandler = function() {
  30233. setDocument();
  30234. },
  30235. disabledAncestor = addCombinator(
  30236. function( elem ) {
  30237. return elem.disabled === true && ("form" in elem || "label" in elem);
  30238. },
  30239. { dir: "parentNode", next: "legend" }
  30240. );
  30241. // Optimize for push.apply( _, NodeList )
  30242. try {
  30243. push.apply(
  30244. (arr = slice.call( preferredDoc.childNodes )),
  30245. preferredDoc.childNodes
  30246. );
  30247. // Support: Android<4.0
  30248. // Detect silently failing push.apply
  30249. arr[ preferredDoc.childNodes.length ].nodeType;
  30250. } catch ( e ) {
  30251. push = { apply: arr.length ?
  30252. // Leverage slice if possible
  30253. function( target, els ) {
  30254. push_native.apply( target, slice.call(els) );
  30255. } :
  30256. // Support: IE<9
  30257. // Otherwise append directly
  30258. function( target, els ) {
  30259. var j = target.length,
  30260. i = 0;
  30261. // Can't trust NodeList.length
  30262. while ( (target[j++] = els[i++]) ) {}
  30263. target.length = j - 1;
  30264. }
  30265. };
  30266. }
  30267. function Sizzle( selector, context, results, seed ) {
  30268. var m, i, elem, nid, match, groups, newSelector,
  30269. newContext = context && context.ownerDocument,
  30270. // nodeType defaults to 9, since context defaults to document
  30271. nodeType = context ? context.nodeType : 9;
  30272. results = results || [];
  30273. // Return early from calls with invalid selector or context
  30274. if ( typeof selector !== "string" || !selector ||
  30275. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  30276. return results;
  30277. }
  30278. // Try to shortcut find operations (as opposed to filters) in HTML documents
  30279. if ( !seed ) {
  30280. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  30281. setDocument( context );
  30282. }
  30283. context = context || document;
  30284. if ( documentIsHTML ) {
  30285. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  30286. // (excepting DocumentFragment context, where the methods don't exist)
  30287. if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
  30288. // ID selector
  30289. if ( (m = match[1]) ) {
  30290. // Document context
  30291. if ( nodeType === 9 ) {
  30292. if ( (elem = context.getElementById( m )) ) {
  30293. // Support: IE, Opera, Webkit
  30294. // TODO: identify versions
  30295. // getElementById can match elements by name instead of ID
  30296. if ( elem.id === m ) {
  30297. results.push( elem );
  30298. return results;
  30299. }
  30300. } else {
  30301. return results;
  30302. }
  30303. // Element context
  30304. } else {
  30305. // Support: IE, Opera, Webkit
  30306. // TODO: identify versions
  30307. // getElementById can match elements by name instead of ID
  30308. if ( newContext && (elem = newContext.getElementById( m )) &&
  30309. contains( context, elem ) &&
  30310. elem.id === m ) {
  30311. results.push( elem );
  30312. return results;
  30313. }
  30314. }
  30315. // Type selector
  30316. } else if ( match[2] ) {
  30317. push.apply( results, context.getElementsByTagName( selector ) );
  30318. return results;
  30319. // Class selector
  30320. } else if ( (m = match[3]) && support.getElementsByClassName &&
  30321. context.getElementsByClassName ) {
  30322. push.apply( results, context.getElementsByClassName( m ) );
  30323. return results;
  30324. }
  30325. }
  30326. // Take advantage of querySelectorAll
  30327. if ( support.qsa &&
  30328. !compilerCache[ selector + " " ] &&
  30329. (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
  30330. if ( nodeType !== 1 ) {
  30331. newContext = context;
  30332. newSelector = selector;
  30333. // qSA looks outside Element context, which is not what we want
  30334. // Thanks to Andrew Dupont for this workaround technique
  30335. // Support: IE <=8
  30336. // Exclude object elements
  30337. } else if ( context.nodeName.toLowerCase() !== "object" ) {
  30338. // Capture the context ID, setting it first if necessary
  30339. if ( (nid = context.getAttribute( "id" )) ) {
  30340. nid = nid.replace( rcssescape, fcssescape );
  30341. } else {
  30342. context.setAttribute( "id", (nid = expando) );
  30343. }
  30344. // Prefix every selector in the list
  30345. groups = tokenize( selector );
  30346. i = groups.length;
  30347. while ( i-- ) {
  30348. groups[i] = "#" + nid + " " + toSelector( groups[i] );
  30349. }
  30350. newSelector = groups.join( "," );
  30351. // Expand context for sibling selectors
  30352. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  30353. context;
  30354. }
  30355. if ( newSelector ) {
  30356. try {
  30357. push.apply( results,
  30358. newContext.querySelectorAll( newSelector )
  30359. );
  30360. return results;
  30361. } catch ( qsaError ) {
  30362. } finally {
  30363. if ( nid === expando ) {
  30364. context.removeAttribute( "id" );
  30365. }
  30366. }
  30367. }
  30368. }
  30369. }
  30370. }
  30371. // All others
  30372. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  30373. }
  30374. /**
  30375. * Create key-value caches of limited size
  30376. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  30377. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  30378. * deleting the oldest entry
  30379. */
  30380. function createCache() {
  30381. var keys = [];
  30382. function cache( key, value ) {
  30383. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  30384. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  30385. // Only keep the most recent entries
  30386. delete cache[ keys.shift() ];
  30387. }
  30388. return (cache[ key + " " ] = value);
  30389. }
  30390. return cache;
  30391. }
  30392. /**
  30393. * Mark a function for special use by Sizzle
  30394. * @param {Function} fn The function to mark
  30395. */
  30396. function markFunction( fn ) {
  30397. fn[ expando ] = true;
  30398. return fn;
  30399. }
  30400. /**
  30401. * Support testing using an element
  30402. * @param {Function} fn Passed the created element and returns a boolean result
  30403. */
  30404. function assert( fn ) {
  30405. var el = document.createElement("fieldset");
  30406. try {
  30407. return !!fn( el );
  30408. } catch (e) {
  30409. return false;
  30410. } finally {
  30411. // Remove from its parent by default
  30412. if ( el.parentNode ) {
  30413. el.parentNode.removeChild( el );
  30414. }
  30415. // release memory in IE
  30416. el = null;
  30417. }
  30418. }
  30419. /**
  30420. * Adds the same handler for all of the specified attrs
  30421. * @param {String} attrs Pipe-separated list of attributes
  30422. * @param {Function} handler The method that will be applied
  30423. */
  30424. function addHandle( attrs, handler ) {
  30425. var arr = attrs.split("|"),
  30426. i = arr.length;
  30427. while ( i-- ) {
  30428. Expr.attrHandle[ arr[i] ] = handler;
  30429. }
  30430. }
  30431. /**
  30432. * Checks document order of two siblings
  30433. * @param {Element} a
  30434. * @param {Element} b
  30435. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  30436. */
  30437. function siblingCheck( a, b ) {
  30438. var cur = b && a,
  30439. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  30440. a.sourceIndex - b.sourceIndex;
  30441. // Use IE sourceIndex if available on both nodes
  30442. if ( diff ) {
  30443. return diff;
  30444. }
  30445. // Check if b follows a
  30446. if ( cur ) {
  30447. while ( (cur = cur.nextSibling) ) {
  30448. if ( cur === b ) {
  30449. return -1;
  30450. }
  30451. }
  30452. }
  30453. return a ? 1 : -1;
  30454. }
  30455. /**
  30456. * Returns a function to use in pseudos for input types
  30457. * @param {String} type
  30458. */
  30459. function createInputPseudo( type ) {
  30460. return function( elem ) {
  30461. var name = elem.nodeName.toLowerCase();
  30462. return name === "input" && elem.type === type;
  30463. };
  30464. }
  30465. /**
  30466. * Returns a function to use in pseudos for buttons
  30467. * @param {String} type
  30468. */
  30469. function createButtonPseudo( type ) {
  30470. return function( elem ) {
  30471. var name = elem.nodeName.toLowerCase();
  30472. return (name === "input" || name === "button") && elem.type === type;
  30473. };
  30474. }
  30475. /**
  30476. * Returns a function to use in pseudos for :enabled/:disabled
  30477. * @param {Boolean} disabled true for :disabled; false for :enabled
  30478. */
  30479. function createDisabledPseudo( disabled ) {
  30480. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  30481. return function( elem ) {
  30482. // Only certain elements can match :enabled or :disabled
  30483. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  30484. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  30485. if ( "form" in elem ) {
  30486. // Check for inherited disabledness on relevant non-disabled elements:
  30487. // * listed form-associated elements in a disabled fieldset
  30488. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  30489. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  30490. // * option elements in a disabled optgroup
  30491. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  30492. // All such elements have a "form" property.
  30493. if ( elem.parentNode && elem.disabled === false ) {
  30494. // Option elements defer to a parent optgroup if present
  30495. if ( "label" in elem ) {
  30496. if ( "label" in elem.parentNode ) {
  30497. return elem.parentNode.disabled === disabled;
  30498. } else {
  30499. return elem.disabled === disabled;
  30500. }
  30501. }
  30502. // Support: IE 6 - 11
  30503. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  30504. return elem.isDisabled === disabled ||
  30505. // Where there is no isDisabled, check manually
  30506. /* jshint -W018 */
  30507. elem.isDisabled !== !disabled &&
  30508. disabledAncestor( elem ) === disabled;
  30509. }
  30510. return elem.disabled === disabled;
  30511. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  30512. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  30513. // even exist on them, let alone have a boolean value.
  30514. } else if ( "label" in elem ) {
  30515. return elem.disabled === disabled;
  30516. }
  30517. // Remaining elements are neither :enabled nor :disabled
  30518. return false;
  30519. };
  30520. }
  30521. /**
  30522. * Returns a function to use in pseudos for positionals
  30523. * @param {Function} fn
  30524. */
  30525. function createPositionalPseudo( fn ) {
  30526. return markFunction(function( argument ) {
  30527. argument = +argument;
  30528. return markFunction(function( seed, matches ) {
  30529. var j,
  30530. matchIndexes = fn( [], seed.length, argument ),
  30531. i = matchIndexes.length;
  30532. // Match elements found at the specified indexes
  30533. while ( i-- ) {
  30534. if ( seed[ (j = matchIndexes[i]) ] ) {
  30535. seed[j] = !(matches[j] = seed[j]);
  30536. }
  30537. }
  30538. });
  30539. });
  30540. }
  30541. /**
  30542. * Checks a node for validity as a Sizzle context
  30543. * @param {Element|Object=} context
  30544. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  30545. */
  30546. function testContext( context ) {
  30547. return context && typeof context.getElementsByTagName !== "undefined" && context;
  30548. }
  30549. // Expose support vars for convenience
  30550. support = Sizzle.support = {};
  30551. /**
  30552. * Detects XML nodes
  30553. * @param {Element|Object} elem An element or a document
  30554. * @returns {Boolean} True iff elem is a non-HTML XML node
  30555. */
  30556. isXML = Sizzle.isXML = function( elem ) {
  30557. // documentElement is verified for cases where it doesn't yet exist
  30558. // (such as loading iframes in IE - #4833)
  30559. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  30560. return documentElement ? documentElement.nodeName !== "HTML" : false;
  30561. };
  30562. /**
  30563. * Sets document-related variables once based on the current document
  30564. * @param {Element|Object} [doc] An element or document object to use to set the document
  30565. * @returns {Object} Returns the current document
  30566. */
  30567. setDocument = Sizzle.setDocument = function( node ) {
  30568. var hasCompare, subWindow,
  30569. doc = node ? node.ownerDocument || node : preferredDoc;
  30570. // Return early if doc is invalid or already selected
  30571. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  30572. return document;
  30573. }
  30574. // Update global variables
  30575. document = doc;
  30576. docElem = document.documentElement;
  30577. documentIsHTML = !isXML( document );
  30578. // Support: IE 9-11, Edge
  30579. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  30580. if ( preferredDoc !== document &&
  30581. (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
  30582. // Support: IE 11, Edge
  30583. if ( subWindow.addEventListener ) {
  30584. subWindow.addEventListener( "unload", unloadHandler, false );
  30585. // Support: IE 9 - 10 only
  30586. } else if ( subWindow.attachEvent ) {
  30587. subWindow.attachEvent( "onunload", unloadHandler );
  30588. }
  30589. }
  30590. /* Attributes
  30591. ---------------------------------------------------------------------- */
  30592. // Support: IE<8
  30593. // Verify that getAttribute really returns attributes and not properties
  30594. // (excepting IE8 booleans)
  30595. support.attributes = assert(function( el ) {
  30596. el.className = "i";
  30597. return !el.getAttribute("className");
  30598. });
  30599. /* getElement(s)By*
  30600. ---------------------------------------------------------------------- */
  30601. // Check if getElementsByTagName("*") returns only elements
  30602. support.getElementsByTagName = assert(function( el ) {
  30603. el.appendChild( document.createComment("") );
  30604. return !el.getElementsByTagName("*").length;
  30605. });
  30606. // Support: IE<9
  30607. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  30608. // Support: IE<10
  30609. // Check if getElementById returns elements by name
  30610. // The broken getElementById methods don't pick up programmatically-set names,
  30611. // so use a roundabout getElementsByName test
  30612. support.getById = assert(function( el ) {
  30613. docElem.appendChild( el ).id = expando;
  30614. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  30615. });
  30616. // ID filter and find
  30617. if ( support.getById ) {
  30618. Expr.filter["ID"] = function( id ) {
  30619. var attrId = id.replace( runescape, funescape );
  30620. return function( elem ) {
  30621. return elem.getAttribute("id") === attrId;
  30622. };
  30623. };
  30624. Expr.find["ID"] = function( id, context ) {
  30625. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  30626. var elem = context.getElementById( id );
  30627. return elem ? [ elem ] : [];
  30628. }
  30629. };
  30630. } else {
  30631. Expr.filter["ID"] = function( id ) {
  30632. var attrId = id.replace( runescape, funescape );
  30633. return function( elem ) {
  30634. var node = typeof elem.getAttributeNode !== "undefined" &&
  30635. elem.getAttributeNode("id");
  30636. return node && node.value === attrId;
  30637. };
  30638. };
  30639. // Support: IE 6 - 7 only
  30640. // getElementById is not reliable as a find shortcut
  30641. Expr.find["ID"] = function( id, context ) {
  30642. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  30643. var node, i, elems,
  30644. elem = context.getElementById( id );
  30645. if ( elem ) {
  30646. // Verify the id attribute
  30647. node = elem.getAttributeNode("id");
  30648. if ( node && node.value === id ) {
  30649. return [ elem ];
  30650. }
  30651. // Fall back on getElementsByName
  30652. elems = context.getElementsByName( id );
  30653. i = 0;
  30654. while ( (elem = elems[i++]) ) {
  30655. node = elem.getAttributeNode("id");
  30656. if ( node && node.value === id ) {
  30657. return [ elem ];
  30658. }
  30659. }
  30660. }
  30661. return [];
  30662. }
  30663. };
  30664. }
  30665. // Tag
  30666. Expr.find["TAG"] = support.getElementsByTagName ?
  30667. function( tag, context ) {
  30668. if ( typeof context.getElementsByTagName !== "undefined" ) {
  30669. return context.getElementsByTagName( tag );
  30670. // DocumentFragment nodes don't have gEBTN
  30671. } else if ( support.qsa ) {
  30672. return context.querySelectorAll( tag );
  30673. }
  30674. } :
  30675. function( tag, context ) {
  30676. var elem,
  30677. tmp = [],
  30678. i = 0,
  30679. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  30680. results = context.getElementsByTagName( tag );
  30681. // Filter out possible comments
  30682. if ( tag === "*" ) {
  30683. while ( (elem = results[i++]) ) {
  30684. if ( elem.nodeType === 1 ) {
  30685. tmp.push( elem );
  30686. }
  30687. }
  30688. return tmp;
  30689. }
  30690. return results;
  30691. };
  30692. // Class
  30693. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  30694. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  30695. return context.getElementsByClassName( className );
  30696. }
  30697. };
  30698. /* QSA/matchesSelector
  30699. ---------------------------------------------------------------------- */
  30700. // QSA and matchesSelector support
  30701. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  30702. rbuggyMatches = [];
  30703. // qSa(:focus) reports false when true (Chrome 21)
  30704. // We allow this because of a bug in IE8/9 that throws an error
  30705. // whenever `document.activeElement` is accessed on an iframe
  30706. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  30707. // See https://bugs.jquery.com/ticket/13378
  30708. rbuggyQSA = [];
  30709. if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
  30710. // Build QSA regex
  30711. // Regex strategy adopted from Diego Perini
  30712. assert(function( el ) {
  30713. // Select is set to empty string on purpose
  30714. // This is to test IE's treatment of not explicitly
  30715. // setting a boolean content attribute,
  30716. // since its presence should be enough
  30717. // https://bugs.jquery.com/ticket/12359
  30718. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  30719. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  30720. "<option selected=''></option></select>";
  30721. // Support: IE8, Opera 11-12.16
  30722. // Nothing should be selected when empty strings follow ^= or $= or *=
  30723. // The test attribute must be unknown in Opera but "safe" for WinRT
  30724. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  30725. if ( el.querySelectorAll("[msallowcapture^='']").length ) {
  30726. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  30727. }
  30728. // Support: IE8
  30729. // Boolean attributes and "value" are not treated correctly
  30730. if ( !el.querySelectorAll("[selected]").length ) {
  30731. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  30732. }
  30733. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  30734. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  30735. rbuggyQSA.push("~=");
  30736. }
  30737. // Webkit/Opera - :checked should return selected option elements
  30738. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  30739. // IE8 throws error here and will not see later tests
  30740. if ( !el.querySelectorAll(":checked").length ) {
  30741. rbuggyQSA.push(":checked");
  30742. }
  30743. // Support: Safari 8+, iOS 8+
  30744. // https://bugs.webkit.org/show_bug.cgi?id=136851
  30745. // In-page `selector#id sibling-combinator selector` fails
  30746. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  30747. rbuggyQSA.push(".#.+[+~]");
  30748. }
  30749. });
  30750. assert(function( el ) {
  30751. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  30752. "<select disabled='disabled'><option/></select>";
  30753. // Support: Windows 8 Native Apps
  30754. // The type and name attributes are restricted during .innerHTML assignment
  30755. var input = document.createElement("input");
  30756. input.setAttribute( "type", "hidden" );
  30757. el.appendChild( input ).setAttribute( "name", "D" );
  30758. // Support: IE8
  30759. // Enforce case-sensitivity of name attribute
  30760. if ( el.querySelectorAll("[name=d]").length ) {
  30761. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  30762. }
  30763. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  30764. // IE8 throws error here and will not see later tests
  30765. if ( el.querySelectorAll(":enabled").length !== 2 ) {
  30766. rbuggyQSA.push( ":enabled", ":disabled" );
  30767. }
  30768. // Support: IE9-11+
  30769. // IE's :disabled selector does not pick up the children of disabled fieldsets
  30770. docElem.appendChild( el ).disabled = true;
  30771. if ( el.querySelectorAll(":disabled").length !== 2 ) {
  30772. rbuggyQSA.push( ":enabled", ":disabled" );
  30773. }
  30774. // Opera 10-11 does not throw on post-comma invalid pseudos
  30775. el.querySelectorAll("*,:x");
  30776. rbuggyQSA.push(",.*:");
  30777. });
  30778. }
  30779. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  30780. docElem.webkitMatchesSelector ||
  30781. docElem.mozMatchesSelector ||
  30782. docElem.oMatchesSelector ||
  30783. docElem.msMatchesSelector) )) ) {
  30784. assert(function( el ) {
  30785. // Check to see if it's possible to do matchesSelector
  30786. // on a disconnected node (IE 9)
  30787. support.disconnectedMatch = matches.call( el, "*" );
  30788. // This should fail with an exception
  30789. // Gecko does not error, returns false instead
  30790. matches.call( el, "[s!='']:x" );
  30791. rbuggyMatches.push( "!=", pseudos );
  30792. });
  30793. }
  30794. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  30795. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  30796. /* Contains
  30797. ---------------------------------------------------------------------- */
  30798. hasCompare = rnative.test( docElem.compareDocumentPosition );
  30799. // Element contains another
  30800. // Purposefully self-exclusive
  30801. // As in, an element does not contain itself
  30802. contains = hasCompare || rnative.test( docElem.contains ) ?
  30803. function( a, b ) {
  30804. var adown = a.nodeType === 9 ? a.documentElement : a,
  30805. bup = b && b.parentNode;
  30806. return a === bup || !!( bup && bup.nodeType === 1 && (
  30807. adown.contains ?
  30808. adown.contains( bup ) :
  30809. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  30810. ));
  30811. } :
  30812. function( a, b ) {
  30813. if ( b ) {
  30814. while ( (b = b.parentNode) ) {
  30815. if ( b === a ) {
  30816. return true;
  30817. }
  30818. }
  30819. }
  30820. return false;
  30821. };
  30822. /* Sorting
  30823. ---------------------------------------------------------------------- */
  30824. // Document order sorting
  30825. sortOrder = hasCompare ?
  30826. function( a, b ) {
  30827. // Flag for duplicate removal
  30828. if ( a === b ) {
  30829. hasDuplicate = true;
  30830. return 0;
  30831. }
  30832. // Sort on method existence if only one input has compareDocumentPosition
  30833. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  30834. if ( compare ) {
  30835. return compare;
  30836. }
  30837. // Calculate position if both inputs belong to the same document
  30838. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  30839. a.compareDocumentPosition( b ) :
  30840. // Otherwise we know they are disconnected
  30841. 1;
  30842. // Disconnected nodes
  30843. if ( compare & 1 ||
  30844. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  30845. // Choose the first element that is related to our preferred document
  30846. if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  30847. return -1;
  30848. }
  30849. if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  30850. return 1;
  30851. }
  30852. // Maintain original order
  30853. return sortInput ?
  30854. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  30855. 0;
  30856. }
  30857. return compare & 4 ? -1 : 1;
  30858. } :
  30859. function( a, b ) {
  30860. // Exit early if the nodes are identical
  30861. if ( a === b ) {
  30862. hasDuplicate = true;
  30863. return 0;
  30864. }
  30865. var cur,
  30866. i = 0,
  30867. aup = a.parentNode,
  30868. bup = b.parentNode,
  30869. ap = [ a ],
  30870. bp = [ b ];
  30871. // Parentless nodes are either documents or disconnected
  30872. if ( !aup || !bup ) {
  30873. return a === document ? -1 :
  30874. b === document ? 1 :
  30875. aup ? -1 :
  30876. bup ? 1 :
  30877. sortInput ?
  30878. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  30879. 0;
  30880. // If the nodes are siblings, we can do a quick check
  30881. } else if ( aup === bup ) {
  30882. return siblingCheck( a, b );
  30883. }
  30884. // Otherwise we need full lists of their ancestors for comparison
  30885. cur = a;
  30886. while ( (cur = cur.parentNode) ) {
  30887. ap.unshift( cur );
  30888. }
  30889. cur = b;
  30890. while ( (cur = cur.parentNode) ) {
  30891. bp.unshift( cur );
  30892. }
  30893. // Walk down the tree looking for a discrepancy
  30894. while ( ap[i] === bp[i] ) {
  30895. i++;
  30896. }
  30897. return i ?
  30898. // Do a sibling check if the nodes have a common ancestor
  30899. siblingCheck( ap[i], bp[i] ) :
  30900. // Otherwise nodes in our document sort first
  30901. ap[i] === preferredDoc ? -1 :
  30902. bp[i] === preferredDoc ? 1 :
  30903. 0;
  30904. };
  30905. return document;
  30906. };
  30907. Sizzle.matches = function( expr, elements ) {
  30908. return Sizzle( expr, null, null, elements );
  30909. };
  30910. Sizzle.matchesSelector = function( elem, expr ) {
  30911. // Set document vars if needed
  30912. if ( ( elem.ownerDocument || elem ) !== document ) {
  30913. setDocument( elem );
  30914. }
  30915. // Make sure that attribute selectors are quoted
  30916. expr = expr.replace( rattributeQuotes, "='$1']" );
  30917. if ( support.matchesSelector && documentIsHTML &&
  30918. !compilerCache[ expr + " " ] &&
  30919. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  30920. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  30921. try {
  30922. var ret = matches.call( elem, expr );
  30923. // IE 9's matchesSelector returns false on disconnected nodes
  30924. if ( ret || support.disconnectedMatch ||
  30925. // As well, disconnected nodes are said to be in a document
  30926. // fragment in IE 9
  30927. elem.document && elem.document.nodeType !== 11 ) {
  30928. return ret;
  30929. }
  30930. } catch (e) {}
  30931. }
  30932. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  30933. };
  30934. Sizzle.contains = function( context, elem ) {
  30935. // Set document vars if needed
  30936. if ( ( context.ownerDocument || context ) !== document ) {
  30937. setDocument( context );
  30938. }
  30939. return contains( context, elem );
  30940. };
  30941. Sizzle.attr = function( elem, name ) {
  30942. // Set document vars if needed
  30943. if ( ( elem.ownerDocument || elem ) !== document ) {
  30944. setDocument( elem );
  30945. }
  30946. var fn = Expr.attrHandle[ name.toLowerCase() ],
  30947. // Don't get fooled by Object.prototype properties (jQuery #13807)
  30948. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  30949. fn( elem, name, !documentIsHTML ) :
  30950. undefined;
  30951. return val !== undefined ?
  30952. val :
  30953. support.attributes || !documentIsHTML ?
  30954. elem.getAttribute( name ) :
  30955. (val = elem.getAttributeNode(name)) && val.specified ?
  30956. val.value :
  30957. null;
  30958. };
  30959. Sizzle.escape = function( sel ) {
  30960. return (sel + "").replace( rcssescape, fcssescape );
  30961. };
  30962. Sizzle.error = function( msg ) {
  30963. throw new Error( "Syntax error, unrecognized expression: " + msg );
  30964. };
  30965. /**
  30966. * Document sorting and removing duplicates
  30967. * @param {ArrayLike} results
  30968. */
  30969. Sizzle.uniqueSort = function( results ) {
  30970. var elem,
  30971. duplicates = [],
  30972. j = 0,
  30973. i = 0;
  30974. // Unless we *know* we can detect duplicates, assume their presence
  30975. hasDuplicate = !support.detectDuplicates;
  30976. sortInput = !support.sortStable && results.slice( 0 );
  30977. results.sort( sortOrder );
  30978. if ( hasDuplicate ) {
  30979. while ( (elem = results[i++]) ) {
  30980. if ( elem === results[ i ] ) {
  30981. j = duplicates.push( i );
  30982. }
  30983. }
  30984. while ( j-- ) {
  30985. results.splice( duplicates[ j ], 1 );
  30986. }
  30987. }
  30988. // Clear input after sorting to release objects
  30989. // See https://github.com/jquery/sizzle/pull/225
  30990. sortInput = null;
  30991. return results;
  30992. };
  30993. /**
  30994. * Utility function for retrieving the text value of an array of DOM nodes
  30995. * @param {Array|Element} elem
  30996. */
  30997. getText = Sizzle.getText = function( elem ) {
  30998. var node,
  30999. ret = "",
  31000. i = 0,
  31001. nodeType = elem.nodeType;
  31002. if ( !nodeType ) {
  31003. // If no nodeType, this is expected to be an array
  31004. while ( (node = elem[i++]) ) {
  31005. // Do not traverse comment nodes
  31006. ret += getText( node );
  31007. }
  31008. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  31009. // Use textContent for elements
  31010. // innerText usage removed for consistency of new lines (jQuery #11153)
  31011. if ( typeof elem.textContent === "string" ) {
  31012. return elem.textContent;
  31013. } else {
  31014. // Traverse its children
  31015. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  31016. ret += getText( elem );
  31017. }
  31018. }
  31019. } else if ( nodeType === 3 || nodeType === 4 ) {
  31020. return elem.nodeValue;
  31021. }
  31022. // Do not include comment or processing instruction nodes
  31023. return ret;
  31024. };
  31025. Expr = Sizzle.selectors = {
  31026. // Can be adjusted by the user
  31027. cacheLength: 50,
  31028. createPseudo: markFunction,
  31029. match: matchExpr,
  31030. attrHandle: {},
  31031. find: {},
  31032. relative: {
  31033. ">": { dir: "parentNode", first: true },
  31034. " ": { dir: "parentNode" },
  31035. "+": { dir: "previousSibling", first: true },
  31036. "~": { dir: "previousSibling" }
  31037. },
  31038. preFilter: {
  31039. "ATTR": function( match ) {
  31040. match[1] = match[1].replace( runescape, funescape );
  31041. // Move the given value to match[3] whether quoted or unquoted
  31042. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  31043. if ( match[2] === "~=" ) {
  31044. match[3] = " " + match[3] + " ";
  31045. }
  31046. return match.slice( 0, 4 );
  31047. },
  31048. "CHILD": function( match ) {
  31049. /* matches from matchExpr["CHILD"]
  31050. 1 type (only|nth|...)
  31051. 2 what (child|of-type)
  31052. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  31053. 4 xn-component of xn+y argument ([+-]?\d*n|)
  31054. 5 sign of xn-component
  31055. 6 x of xn-component
  31056. 7 sign of y-component
  31057. 8 y of y-component
  31058. */
  31059. match[1] = match[1].toLowerCase();
  31060. if ( match[1].slice( 0, 3 ) === "nth" ) {
  31061. // nth-* requires argument
  31062. if ( !match[3] ) {
  31063. Sizzle.error( match[0] );
  31064. }
  31065. // numeric x and y parameters for Expr.filter.CHILD
  31066. // remember that false/true cast respectively to 0/1
  31067. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  31068. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  31069. // other types prohibit arguments
  31070. } else if ( match[3] ) {
  31071. Sizzle.error( match[0] );
  31072. }
  31073. return match;
  31074. },
  31075. "PSEUDO": function( match ) {
  31076. var excess,
  31077. unquoted = !match[6] && match[2];
  31078. if ( matchExpr["CHILD"].test( match[0] ) ) {
  31079. return null;
  31080. }
  31081. // Accept quoted arguments as-is
  31082. if ( match[3] ) {
  31083. match[2] = match[4] || match[5] || "";
  31084. // Strip excess characters from unquoted arguments
  31085. } else if ( unquoted && rpseudo.test( unquoted ) &&
  31086. // Get excess from tokenize (recursively)
  31087. (excess = tokenize( unquoted, true )) &&
  31088. // advance to the next closing parenthesis
  31089. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  31090. // excess is a negative index
  31091. match[0] = match[0].slice( 0, excess );
  31092. match[2] = unquoted.slice( 0, excess );
  31093. }
  31094. // Return only captures needed by the pseudo filter method (type and argument)
  31095. return match.slice( 0, 3 );
  31096. }
  31097. },
  31098. filter: {
  31099. "TAG": function( nodeNameSelector ) {
  31100. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  31101. return nodeNameSelector === "*" ?
  31102. function() { return true; } :
  31103. function( elem ) {
  31104. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  31105. };
  31106. },
  31107. "CLASS": function( className ) {
  31108. var pattern = classCache[ className + " " ];
  31109. return pattern ||
  31110. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  31111. classCache( className, function( elem ) {
  31112. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
  31113. });
  31114. },
  31115. "ATTR": function( name, operator, check ) {
  31116. return function( elem ) {
  31117. var result = Sizzle.attr( elem, name );
  31118. if ( result == null ) {
  31119. return operator === "!=";
  31120. }
  31121. if ( !operator ) {
  31122. return true;
  31123. }
  31124. result += "";
  31125. return operator === "=" ? result === check :
  31126. operator === "!=" ? result !== check :
  31127. operator === "^=" ? check && result.indexOf( check ) === 0 :
  31128. operator === "*=" ? check && result.indexOf( check ) > -1 :
  31129. operator === "$=" ? check && result.slice( -check.length ) === check :
  31130. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  31131. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  31132. false;
  31133. };
  31134. },
  31135. "CHILD": function( type, what, argument, first, last ) {
  31136. var simple = type.slice( 0, 3 ) !== "nth",
  31137. forward = type.slice( -4 ) !== "last",
  31138. ofType = what === "of-type";
  31139. return first === 1 && last === 0 ?
  31140. // Shortcut for :nth-*(n)
  31141. function( elem ) {
  31142. return !!elem.parentNode;
  31143. } :
  31144. function( elem, context, xml ) {
  31145. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  31146. dir = simple !== forward ? "nextSibling" : "previousSibling",
  31147. parent = elem.parentNode,
  31148. name = ofType && elem.nodeName.toLowerCase(),
  31149. useCache = !xml && !ofType,
  31150. diff = false;
  31151. if ( parent ) {
  31152. // :(first|last|only)-(child|of-type)
  31153. if ( simple ) {
  31154. while ( dir ) {
  31155. node = elem;
  31156. while ( (node = node[ dir ]) ) {
  31157. if ( ofType ?
  31158. node.nodeName.toLowerCase() === name :
  31159. node.nodeType === 1 ) {
  31160. return false;
  31161. }
  31162. }
  31163. // Reverse direction for :only-* (if we haven't yet done so)
  31164. start = dir = type === "only" && !start && "nextSibling";
  31165. }
  31166. return true;
  31167. }
  31168. start = [ forward ? parent.firstChild : parent.lastChild ];
  31169. // non-xml :nth-child(...) stores cache data on `parent`
  31170. if ( forward && useCache ) {
  31171. // Seek `elem` from a previously-cached index
  31172. // ...in a gzip-friendly way
  31173. node = parent;
  31174. outerCache = node[ expando ] || (node[ expando ] = {});
  31175. // Support: IE <9 only
  31176. // Defend against cloned attroperties (jQuery gh-1709)
  31177. uniqueCache = outerCache[ node.uniqueID ] ||
  31178. (outerCache[ node.uniqueID ] = {});
  31179. cache = uniqueCache[ type ] || [];
  31180. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  31181. diff = nodeIndex && cache[ 2 ];
  31182. node = nodeIndex && parent.childNodes[ nodeIndex ];
  31183. while ( (node = ++nodeIndex && node && node[ dir ] ||
  31184. // Fallback to seeking `elem` from the start
  31185. (diff = nodeIndex = 0) || start.pop()) ) {
  31186. // When found, cache indexes on `parent` and break
  31187. if ( node.nodeType === 1 && ++diff && node === elem ) {
  31188. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  31189. break;
  31190. }
  31191. }
  31192. } else {
  31193. // Use previously-cached element index if available
  31194. if ( useCache ) {
  31195. // ...in a gzip-friendly way
  31196. node = elem;
  31197. outerCache = node[ expando ] || (node[ expando ] = {});
  31198. // Support: IE <9 only
  31199. // Defend against cloned attroperties (jQuery gh-1709)
  31200. uniqueCache = outerCache[ node.uniqueID ] ||
  31201. (outerCache[ node.uniqueID ] = {});
  31202. cache = uniqueCache[ type ] || [];
  31203. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  31204. diff = nodeIndex;
  31205. }
  31206. // xml :nth-child(...)
  31207. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  31208. if ( diff === false ) {
  31209. // Use the same loop as above to seek `elem` from the start
  31210. while ( (node = ++nodeIndex && node && node[ dir ] ||
  31211. (diff = nodeIndex = 0) || start.pop()) ) {
  31212. if ( ( ofType ?
  31213. node.nodeName.toLowerCase() === name :
  31214. node.nodeType === 1 ) &&
  31215. ++diff ) {
  31216. // Cache the index of each encountered element
  31217. if ( useCache ) {
  31218. outerCache = node[ expando ] || (node[ expando ] = {});
  31219. // Support: IE <9 only
  31220. // Defend against cloned attroperties (jQuery gh-1709)
  31221. uniqueCache = outerCache[ node.uniqueID ] ||
  31222. (outerCache[ node.uniqueID ] = {});
  31223. uniqueCache[ type ] = [ dirruns, diff ];
  31224. }
  31225. if ( node === elem ) {
  31226. break;
  31227. }
  31228. }
  31229. }
  31230. }
  31231. }
  31232. // Incorporate the offset, then check against cycle size
  31233. diff -= last;
  31234. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  31235. }
  31236. };
  31237. },
  31238. "PSEUDO": function( pseudo, argument ) {
  31239. // pseudo-class names are case-insensitive
  31240. // http://www.w3.org/TR/selectors/#pseudo-classes
  31241. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  31242. // Remember that setFilters inherits from pseudos
  31243. var args,
  31244. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  31245. Sizzle.error( "unsupported pseudo: " + pseudo );
  31246. // The user may use createPseudo to indicate that
  31247. // arguments are needed to create the filter function
  31248. // just as Sizzle does
  31249. if ( fn[ expando ] ) {
  31250. return fn( argument );
  31251. }
  31252. // But maintain support for old signatures
  31253. if ( fn.length > 1 ) {
  31254. args = [ pseudo, pseudo, "", argument ];
  31255. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  31256. markFunction(function( seed, matches ) {
  31257. var idx,
  31258. matched = fn( seed, argument ),
  31259. i = matched.length;
  31260. while ( i-- ) {
  31261. idx = indexOf( seed, matched[i] );
  31262. seed[ idx ] = !( matches[ idx ] = matched[i] );
  31263. }
  31264. }) :
  31265. function( elem ) {
  31266. return fn( elem, 0, args );
  31267. };
  31268. }
  31269. return fn;
  31270. }
  31271. },
  31272. pseudos: {
  31273. // Potentially complex pseudos
  31274. "not": markFunction(function( selector ) {
  31275. // Trim the selector passed to compile
  31276. // to avoid treating leading and trailing
  31277. // spaces as combinators
  31278. var input = [],
  31279. results = [],
  31280. matcher = compile( selector.replace( rtrim, "$1" ) );
  31281. return matcher[ expando ] ?
  31282. markFunction(function( seed, matches, context, xml ) {
  31283. var elem,
  31284. unmatched = matcher( seed, null, xml, [] ),
  31285. i = seed.length;
  31286. // Match elements unmatched by `matcher`
  31287. while ( i-- ) {
  31288. if ( (elem = unmatched[i]) ) {
  31289. seed[i] = !(matches[i] = elem);
  31290. }
  31291. }
  31292. }) :
  31293. function( elem, context, xml ) {
  31294. input[0] = elem;
  31295. matcher( input, null, xml, results );
  31296. // Don't keep the element (issue #299)
  31297. input[0] = null;
  31298. return !results.pop();
  31299. };
  31300. }),
  31301. "has": markFunction(function( selector ) {
  31302. return function( elem ) {
  31303. return Sizzle( selector, elem ).length > 0;
  31304. };
  31305. }),
  31306. "contains": markFunction(function( text ) {
  31307. text = text.replace( runescape, funescape );
  31308. return function( elem ) {
  31309. return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
  31310. };
  31311. }),
  31312. // "Whether an element is represented by a :lang() selector
  31313. // is based solely on the element's language value
  31314. // being equal to the identifier C,
  31315. // or beginning with the identifier C immediately followed by "-".
  31316. // The matching of C against the element's language value is performed case-insensitively.
  31317. // The identifier C does not have to be a valid language name."
  31318. // http://www.w3.org/TR/selectors/#lang-pseudo
  31319. "lang": markFunction( function( lang ) {
  31320. // lang value must be a valid identifier
  31321. if ( !ridentifier.test(lang || "") ) {
  31322. Sizzle.error( "unsupported lang: " + lang );
  31323. }
  31324. lang = lang.replace( runescape, funescape ).toLowerCase();
  31325. return function( elem ) {
  31326. var elemLang;
  31327. do {
  31328. if ( (elemLang = documentIsHTML ?
  31329. elem.lang :
  31330. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  31331. elemLang = elemLang.toLowerCase();
  31332. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  31333. }
  31334. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  31335. return false;
  31336. };
  31337. }),
  31338. // Miscellaneous
  31339. "target": function( elem ) {
  31340. var hash = window.location && window.location.hash;
  31341. return hash && hash.slice( 1 ) === elem.id;
  31342. },
  31343. "root": function( elem ) {
  31344. return elem === docElem;
  31345. },
  31346. "focus": function( elem ) {
  31347. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  31348. },
  31349. // Boolean properties
  31350. "enabled": createDisabledPseudo( false ),
  31351. "disabled": createDisabledPseudo( true ),
  31352. "checked": function( elem ) {
  31353. // In CSS3, :checked should return both checked and selected elements
  31354. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  31355. var nodeName = elem.nodeName.toLowerCase();
  31356. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  31357. },
  31358. "selected": function( elem ) {
  31359. // Accessing this property makes selected-by-default
  31360. // options in Safari work properly
  31361. if ( elem.parentNode ) {
  31362. elem.parentNode.selectedIndex;
  31363. }
  31364. return elem.selected === true;
  31365. },
  31366. // Contents
  31367. "empty": function( elem ) {
  31368. // http://www.w3.org/TR/selectors/#empty-pseudo
  31369. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  31370. // but not by others (comment: 8; processing instruction: 7; etc.)
  31371. // nodeType < 6 works because attributes (2) do not appear as children
  31372. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  31373. if ( elem.nodeType < 6 ) {
  31374. return false;
  31375. }
  31376. }
  31377. return true;
  31378. },
  31379. "parent": function( elem ) {
  31380. return !Expr.pseudos["empty"]( elem );
  31381. },
  31382. // Element/input types
  31383. "header": function( elem ) {
  31384. return rheader.test( elem.nodeName );
  31385. },
  31386. "input": function( elem ) {
  31387. return rinputs.test( elem.nodeName );
  31388. },
  31389. "button": function( elem ) {
  31390. var name = elem.nodeName.toLowerCase();
  31391. return name === "input" && elem.type === "button" || name === "button";
  31392. },
  31393. "text": function( elem ) {
  31394. var attr;
  31395. return elem.nodeName.toLowerCase() === "input" &&
  31396. elem.type === "text" &&
  31397. // Support: IE<8
  31398. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  31399. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  31400. },
  31401. // Position-in-collection
  31402. "first": createPositionalPseudo(function() {
  31403. return [ 0 ];
  31404. }),
  31405. "last": createPositionalPseudo(function( matchIndexes, length ) {
  31406. return [ length - 1 ];
  31407. }),
  31408. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  31409. return [ argument < 0 ? argument + length : argument ];
  31410. }),
  31411. "even": createPositionalPseudo(function( matchIndexes, length ) {
  31412. var i = 0;
  31413. for ( ; i < length; i += 2 ) {
  31414. matchIndexes.push( i );
  31415. }
  31416. return matchIndexes;
  31417. }),
  31418. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  31419. var i = 1;
  31420. for ( ; i < length; i += 2 ) {
  31421. matchIndexes.push( i );
  31422. }
  31423. return matchIndexes;
  31424. }),
  31425. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  31426. var i = argument < 0 ? argument + length : argument;
  31427. for ( ; --i >= 0; ) {
  31428. matchIndexes.push( i );
  31429. }
  31430. return matchIndexes;
  31431. }),
  31432. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  31433. var i = argument < 0 ? argument + length : argument;
  31434. for ( ; ++i < length; ) {
  31435. matchIndexes.push( i );
  31436. }
  31437. return matchIndexes;
  31438. })
  31439. }
  31440. };
  31441. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  31442. // Add button/input type pseudos
  31443. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  31444. Expr.pseudos[ i ] = createInputPseudo( i );
  31445. }
  31446. for ( i in { submit: true, reset: true } ) {
  31447. Expr.pseudos[ i ] = createButtonPseudo( i );
  31448. }
  31449. // Easy API for creating new setFilters
  31450. function setFilters() {}
  31451. setFilters.prototype = Expr.filters = Expr.pseudos;
  31452. Expr.setFilters = new setFilters();
  31453. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  31454. var matched, match, tokens, type,
  31455. soFar, groups, preFilters,
  31456. cached = tokenCache[ selector + " " ];
  31457. if ( cached ) {
  31458. return parseOnly ? 0 : cached.slice( 0 );
  31459. }
  31460. soFar = selector;
  31461. groups = [];
  31462. preFilters = Expr.preFilter;
  31463. while ( soFar ) {
  31464. // Comma and first run
  31465. if ( !matched || (match = rcomma.exec( soFar )) ) {
  31466. if ( match ) {
  31467. // Don't consume trailing commas as valid
  31468. soFar = soFar.slice( match[0].length ) || soFar;
  31469. }
  31470. groups.push( (tokens = []) );
  31471. }
  31472. matched = false;
  31473. // Combinators
  31474. if ( (match = rcombinators.exec( soFar )) ) {
  31475. matched = match.shift();
  31476. tokens.push({
  31477. value: matched,
  31478. // Cast descendant combinators to space
  31479. type: match[0].replace( rtrim, " " )
  31480. });
  31481. soFar = soFar.slice( matched.length );
  31482. }
  31483. // Filters
  31484. for ( type in Expr.filter ) {
  31485. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  31486. (match = preFilters[ type ]( match ))) ) {
  31487. matched = match.shift();
  31488. tokens.push({
  31489. value: matched,
  31490. type: type,
  31491. matches: match
  31492. });
  31493. soFar = soFar.slice( matched.length );
  31494. }
  31495. }
  31496. if ( !matched ) {
  31497. break;
  31498. }
  31499. }
  31500. // Return the length of the invalid excess
  31501. // if we're just parsing
  31502. // Otherwise, throw an error or return tokens
  31503. return parseOnly ?
  31504. soFar.length :
  31505. soFar ?
  31506. Sizzle.error( selector ) :
  31507. // Cache the tokens
  31508. tokenCache( selector, groups ).slice( 0 );
  31509. };
  31510. function toSelector( tokens ) {
  31511. var i = 0,
  31512. len = tokens.length,
  31513. selector = "";
  31514. for ( ; i < len; i++ ) {
  31515. selector += tokens[i].value;
  31516. }
  31517. return selector;
  31518. }
  31519. function addCombinator( matcher, combinator, base ) {
  31520. var dir = combinator.dir,
  31521. skip = combinator.next,
  31522. key = skip || dir,
  31523. checkNonElements = base && key === "parentNode",
  31524. doneName = done++;
  31525. return combinator.first ?
  31526. // Check against closest ancestor/preceding element
  31527. function( elem, context, xml ) {
  31528. while ( (elem = elem[ dir ]) ) {
  31529. if ( elem.nodeType === 1 || checkNonElements ) {
  31530. return matcher( elem, context, xml );
  31531. }
  31532. }
  31533. return false;
  31534. } :
  31535. // Check against all ancestor/preceding elements
  31536. function( elem, context, xml ) {
  31537. var oldCache, uniqueCache, outerCache,
  31538. newCache = [ dirruns, doneName ];
  31539. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  31540. if ( xml ) {
  31541. while ( (elem = elem[ dir ]) ) {
  31542. if ( elem.nodeType === 1 || checkNonElements ) {
  31543. if ( matcher( elem, context, xml ) ) {
  31544. return true;
  31545. }
  31546. }
  31547. }
  31548. } else {
  31549. while ( (elem = elem[ dir ]) ) {
  31550. if ( elem.nodeType === 1 || checkNonElements ) {
  31551. outerCache = elem[ expando ] || (elem[ expando ] = {});
  31552. // Support: IE <9 only
  31553. // Defend against cloned attroperties (jQuery gh-1709)
  31554. uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
  31555. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  31556. elem = elem[ dir ] || elem;
  31557. } else if ( (oldCache = uniqueCache[ key ]) &&
  31558. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  31559. // Assign to newCache so results back-propagate to previous elements
  31560. return (newCache[ 2 ] = oldCache[ 2 ]);
  31561. } else {
  31562. // Reuse newcache so results back-propagate to previous elements
  31563. uniqueCache[ key ] = newCache;
  31564. // A match means we're done; a fail means we have to keep checking
  31565. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  31566. return true;
  31567. }
  31568. }
  31569. }
  31570. }
  31571. }
  31572. return false;
  31573. };
  31574. }
  31575. function elementMatcher( matchers ) {
  31576. return matchers.length > 1 ?
  31577. function( elem, context, xml ) {
  31578. var i = matchers.length;
  31579. while ( i-- ) {
  31580. if ( !matchers[i]( elem, context, xml ) ) {
  31581. return false;
  31582. }
  31583. }
  31584. return true;
  31585. } :
  31586. matchers[0];
  31587. }
  31588. function multipleContexts( selector, contexts, results ) {
  31589. var i = 0,
  31590. len = contexts.length;
  31591. for ( ; i < len; i++ ) {
  31592. Sizzle( selector, contexts[i], results );
  31593. }
  31594. return results;
  31595. }
  31596. function condense( unmatched, map, filter, context, xml ) {
  31597. var elem,
  31598. newUnmatched = [],
  31599. i = 0,
  31600. len = unmatched.length,
  31601. mapped = map != null;
  31602. for ( ; i < len; i++ ) {
  31603. if ( (elem = unmatched[i]) ) {
  31604. if ( !filter || filter( elem, context, xml ) ) {
  31605. newUnmatched.push( elem );
  31606. if ( mapped ) {
  31607. map.push( i );
  31608. }
  31609. }
  31610. }
  31611. }
  31612. return newUnmatched;
  31613. }
  31614. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  31615. if ( postFilter && !postFilter[ expando ] ) {
  31616. postFilter = setMatcher( postFilter );
  31617. }
  31618. if ( postFinder && !postFinder[ expando ] ) {
  31619. postFinder = setMatcher( postFinder, postSelector );
  31620. }
  31621. return markFunction(function( seed, results, context, xml ) {
  31622. var temp, i, elem,
  31623. preMap = [],
  31624. postMap = [],
  31625. preexisting = results.length,
  31626. // Get initial elements from seed or context
  31627. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  31628. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  31629. matcherIn = preFilter && ( seed || !selector ) ?
  31630. condense( elems, preMap, preFilter, context, xml ) :
  31631. elems,
  31632. matcherOut = matcher ?
  31633. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  31634. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  31635. // ...intermediate processing is necessary
  31636. [] :
  31637. // ...otherwise use results directly
  31638. results :
  31639. matcherIn;
  31640. // Find primary matches
  31641. if ( matcher ) {
  31642. matcher( matcherIn, matcherOut, context, xml );
  31643. }
  31644. // Apply postFilter
  31645. if ( postFilter ) {
  31646. temp = condense( matcherOut, postMap );
  31647. postFilter( temp, [], context, xml );
  31648. // Un-match failing elements by moving them back to matcherIn
  31649. i = temp.length;
  31650. while ( i-- ) {
  31651. if ( (elem = temp[i]) ) {
  31652. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  31653. }
  31654. }
  31655. }
  31656. if ( seed ) {
  31657. if ( postFinder || preFilter ) {
  31658. if ( postFinder ) {
  31659. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  31660. temp = [];
  31661. i = matcherOut.length;
  31662. while ( i-- ) {
  31663. if ( (elem = matcherOut[i]) ) {
  31664. // Restore matcherIn since elem is not yet a final match
  31665. temp.push( (matcherIn[i] = elem) );
  31666. }
  31667. }
  31668. postFinder( null, (matcherOut = []), temp, xml );
  31669. }
  31670. // Move matched elements from seed to results to keep them synchronized
  31671. i = matcherOut.length;
  31672. while ( i-- ) {
  31673. if ( (elem = matcherOut[i]) &&
  31674. (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
  31675. seed[temp] = !(results[temp] = elem);
  31676. }
  31677. }
  31678. }
  31679. // Add elements to results, through postFinder if defined
  31680. } else {
  31681. matcherOut = condense(
  31682. matcherOut === results ?
  31683. matcherOut.splice( preexisting, matcherOut.length ) :
  31684. matcherOut
  31685. );
  31686. if ( postFinder ) {
  31687. postFinder( null, results, matcherOut, xml );
  31688. } else {
  31689. push.apply( results, matcherOut );
  31690. }
  31691. }
  31692. });
  31693. }
  31694. function matcherFromTokens( tokens ) {
  31695. var checkContext, matcher, j,
  31696. len = tokens.length,
  31697. leadingRelative = Expr.relative[ tokens[0].type ],
  31698. implicitRelative = leadingRelative || Expr.relative[" "],
  31699. i = leadingRelative ? 1 : 0,
  31700. // The foundational matcher ensures that elements are reachable from top-level context(s)
  31701. matchContext = addCombinator( function( elem ) {
  31702. return elem === checkContext;
  31703. }, implicitRelative, true ),
  31704. matchAnyContext = addCombinator( function( elem ) {
  31705. return indexOf( checkContext, elem ) > -1;
  31706. }, implicitRelative, true ),
  31707. matchers = [ function( elem, context, xml ) {
  31708. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  31709. (checkContext = context).nodeType ?
  31710. matchContext( elem, context, xml ) :
  31711. matchAnyContext( elem, context, xml ) );
  31712. // Avoid hanging onto element (issue #299)
  31713. checkContext = null;
  31714. return ret;
  31715. } ];
  31716. for ( ; i < len; i++ ) {
  31717. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  31718. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  31719. } else {
  31720. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  31721. // Return special upon seeing a positional matcher
  31722. if ( matcher[ expando ] ) {
  31723. // Find the next relative operator (if any) for proper handling
  31724. j = ++i;
  31725. for ( ; j < len; j++ ) {
  31726. if ( Expr.relative[ tokens[j].type ] ) {
  31727. break;
  31728. }
  31729. }
  31730. return setMatcher(
  31731. i > 1 && elementMatcher( matchers ),
  31732. i > 1 && toSelector(
  31733. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  31734. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  31735. ).replace( rtrim, "$1" ),
  31736. matcher,
  31737. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  31738. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  31739. j < len && toSelector( tokens )
  31740. );
  31741. }
  31742. matchers.push( matcher );
  31743. }
  31744. }
  31745. return elementMatcher( matchers );
  31746. }
  31747. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  31748. var bySet = setMatchers.length > 0,
  31749. byElement = elementMatchers.length > 0,
  31750. superMatcher = function( seed, context, xml, results, outermost ) {
  31751. var elem, j, matcher,
  31752. matchedCount = 0,
  31753. i = "0",
  31754. unmatched = seed && [],
  31755. setMatched = [],
  31756. contextBackup = outermostContext,
  31757. // We must always have either seed elements or outermost context
  31758. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  31759. // Use integer dirruns iff this is the outermost matcher
  31760. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  31761. len = elems.length;
  31762. if ( outermost ) {
  31763. outermostContext = context === document || context || outermost;
  31764. }
  31765. // Add elements passing elementMatchers directly to results
  31766. // Support: IE<9, Safari
  31767. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  31768. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  31769. if ( byElement && elem ) {
  31770. j = 0;
  31771. if ( !context && elem.ownerDocument !== document ) {
  31772. setDocument( elem );
  31773. xml = !documentIsHTML;
  31774. }
  31775. while ( (matcher = elementMatchers[j++]) ) {
  31776. if ( matcher( elem, context || document, xml) ) {
  31777. results.push( elem );
  31778. break;
  31779. }
  31780. }
  31781. if ( outermost ) {
  31782. dirruns = dirrunsUnique;
  31783. }
  31784. }
  31785. // Track unmatched elements for set filters
  31786. if ( bySet ) {
  31787. // They will have gone through all possible matchers
  31788. if ( (elem = !matcher && elem) ) {
  31789. matchedCount--;
  31790. }
  31791. // Lengthen the array for every element, matched or not
  31792. if ( seed ) {
  31793. unmatched.push( elem );
  31794. }
  31795. }
  31796. }
  31797. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  31798. // makes the latter nonnegative.
  31799. matchedCount += i;
  31800. // Apply set filters to unmatched elements
  31801. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  31802. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  31803. // no element matchers and no seed.
  31804. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  31805. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  31806. // numerically zero.
  31807. if ( bySet && i !== matchedCount ) {
  31808. j = 0;
  31809. while ( (matcher = setMatchers[j++]) ) {
  31810. matcher( unmatched, setMatched, context, xml );
  31811. }
  31812. if ( seed ) {
  31813. // Reintegrate element matches to eliminate the need for sorting
  31814. if ( matchedCount > 0 ) {
  31815. while ( i-- ) {
  31816. if ( !(unmatched[i] || setMatched[i]) ) {
  31817. setMatched[i] = pop.call( results );
  31818. }
  31819. }
  31820. }
  31821. // Discard index placeholder values to get only actual matches
  31822. setMatched = condense( setMatched );
  31823. }
  31824. // Add matches to results
  31825. push.apply( results, setMatched );
  31826. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  31827. if ( outermost && !seed && setMatched.length > 0 &&
  31828. ( matchedCount + setMatchers.length ) > 1 ) {
  31829. Sizzle.uniqueSort( results );
  31830. }
  31831. }
  31832. // Override manipulation of globals by nested matchers
  31833. if ( outermost ) {
  31834. dirruns = dirrunsUnique;
  31835. outermostContext = contextBackup;
  31836. }
  31837. return unmatched;
  31838. };
  31839. return bySet ?
  31840. markFunction( superMatcher ) :
  31841. superMatcher;
  31842. }
  31843. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  31844. var i,
  31845. setMatchers = [],
  31846. elementMatchers = [],
  31847. cached = compilerCache[ selector + " " ];
  31848. if ( !cached ) {
  31849. // Generate a function of recursive functions that can be used to check each element
  31850. if ( !match ) {
  31851. match = tokenize( selector );
  31852. }
  31853. i = match.length;
  31854. while ( i-- ) {
  31855. cached = matcherFromTokens( match[i] );
  31856. if ( cached[ expando ] ) {
  31857. setMatchers.push( cached );
  31858. } else {
  31859. elementMatchers.push( cached );
  31860. }
  31861. }
  31862. // Cache the compiled function
  31863. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  31864. // Save selector and tokenization
  31865. cached.selector = selector;
  31866. }
  31867. return cached;
  31868. };
  31869. /**
  31870. * A low-level selection function that works with Sizzle's compiled
  31871. * selector functions
  31872. * @param {String|Function} selector A selector or a pre-compiled
  31873. * selector function built with Sizzle.compile
  31874. * @param {Element} context
  31875. * @param {Array} [results]
  31876. * @param {Array} [seed] A set of elements to match against
  31877. */
  31878. select = Sizzle.select = function( selector, context, results, seed ) {
  31879. var i, tokens, token, type, find,
  31880. compiled = typeof selector === "function" && selector,
  31881. match = !seed && tokenize( (selector = compiled.selector || selector) );
  31882. results = results || [];
  31883. // Try to minimize operations if there is only one selector in the list and no seed
  31884. // (the latter of which guarantees us context)
  31885. if ( match.length === 1 ) {
  31886. // Reduce context if the leading compound selector is an ID
  31887. tokens = match[0] = match[0].slice( 0 );
  31888. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  31889. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
  31890. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  31891. if ( !context ) {
  31892. return results;
  31893. // Precompiled matchers will still verify ancestry, so step up a level
  31894. } else if ( compiled ) {
  31895. context = context.parentNode;
  31896. }
  31897. selector = selector.slice( tokens.shift().value.length );
  31898. }
  31899. // Fetch a seed set for right-to-left matching
  31900. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  31901. while ( i-- ) {
  31902. token = tokens[i];
  31903. // Abort if we hit a combinator
  31904. if ( Expr.relative[ (type = token.type) ] ) {
  31905. break;
  31906. }
  31907. if ( (find = Expr.find[ type ]) ) {
  31908. // Search, expanding context for leading sibling combinators
  31909. if ( (seed = find(
  31910. token.matches[0].replace( runescape, funescape ),
  31911. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  31912. )) ) {
  31913. // If seed is empty or no tokens remain, we can return early
  31914. tokens.splice( i, 1 );
  31915. selector = seed.length && toSelector( tokens );
  31916. if ( !selector ) {
  31917. push.apply( results, seed );
  31918. return results;
  31919. }
  31920. break;
  31921. }
  31922. }
  31923. }
  31924. }
  31925. // Compile and execute a filtering function if one is not provided
  31926. // Provide `match` to avoid retokenization if we modified the selector above
  31927. ( compiled || compile( selector, match ) )(
  31928. seed,
  31929. context,
  31930. !documentIsHTML,
  31931. results,
  31932. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  31933. );
  31934. return results;
  31935. };
  31936. // One-time assignments
  31937. // Sort stability
  31938. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  31939. // Support: Chrome 14-35+
  31940. // Always assume duplicates if they aren't passed to the comparison function
  31941. support.detectDuplicates = !!hasDuplicate;
  31942. // Initialize against the default document
  31943. setDocument();
  31944. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  31945. // Detached nodes confoundingly follow *each other*
  31946. support.sortDetached = assert(function( el ) {
  31947. // Should return 1, but returns 4 (following)
  31948. return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
  31949. });
  31950. // Support: IE<8
  31951. // Prevent attribute/property "interpolation"
  31952. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  31953. if ( !assert(function( el ) {
  31954. el.innerHTML = "<a href='#'></a>";
  31955. return el.firstChild.getAttribute("href") === "#" ;
  31956. }) ) {
  31957. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  31958. if ( !isXML ) {
  31959. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  31960. }
  31961. });
  31962. }
  31963. // Support: IE<9
  31964. // Use defaultValue in place of getAttribute("value")
  31965. if ( !support.attributes || !assert(function( el ) {
  31966. el.innerHTML = "<input/>";
  31967. el.firstChild.setAttribute( "value", "" );
  31968. return el.firstChild.getAttribute( "value" ) === "";
  31969. }) ) {
  31970. addHandle( "value", function( elem, name, isXML ) {
  31971. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  31972. return elem.defaultValue;
  31973. }
  31974. });
  31975. }
  31976. // Support: IE<9
  31977. // Use getAttributeNode to fetch booleans when getAttribute lies
  31978. if ( !assert(function( el ) {
  31979. return el.getAttribute("disabled") == null;
  31980. }) ) {
  31981. addHandle( booleans, function( elem, name, isXML ) {
  31982. var val;
  31983. if ( !isXML ) {
  31984. return elem[ name ] === true ? name.toLowerCase() :
  31985. (val = elem.getAttributeNode( name )) && val.specified ?
  31986. val.value :
  31987. null;
  31988. }
  31989. });
  31990. }
  31991. // EXPOSE
  31992. var _sizzle = window.Sizzle;
  31993. Sizzle.noConflict = function() {
  31994. if ( window.Sizzle === Sizzle ) {
  31995. window.Sizzle = _sizzle;
  31996. }
  31997. return Sizzle;
  31998. };
  31999. if ( true ) {
  32000. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return Sizzle; }).call(exports, __webpack_require__, exports, module),
  32001. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  32002. // Sizzle requires that there be a global window in Common-JS like environments
  32003. } else {}
  32004. // EXPOSE
  32005. })( window );
  32006. /***/ }),
  32007. /***/ "./node_modules/snabbdom/dist/snabbdom-attributes.js":
  32008. /*!***********************************************************!*\
  32009. !*** ./node_modules/snabbdom/dist/snabbdom-attributes.js ***!
  32010. \***********************************************************/
  32011. /*! no static exports found */
  32012. /***/ (function(module, exports, __webpack_require__) {
  32013. var require;var require;(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(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 require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  32014. "use strict";
  32015. Object.defineProperty(exports, "__esModule", { value: true });
  32016. var booleanAttrs = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "compact", "controls", "declare",
  32017. "default", "defaultchecked", "defaultmuted", "defaultselected", "defer", "disabled", "draggable",
  32018. "enabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "itemscope", "loop", "multiple",
  32019. "muted", "nohref", "noresize", "noshade", "novalidate", "nowrap", "open", "pauseonexit", "readonly",
  32020. "required", "reversed", "scoped", "seamless", "selected", "sortable", "spellcheck", "translate",
  32021. "truespeed", "typemustmatch", "visible"];
  32022. var xlinkNS = 'http://www.w3.org/1999/xlink';
  32023. var xmlNS = 'http://www.w3.org/XML/1998/namespace';
  32024. var colonChar = 58;
  32025. var xChar = 120;
  32026. var booleanAttrsDict = Object.create(null);
  32027. for (var i = 0, len = booleanAttrs.length; i < len; i++) {
  32028. booleanAttrsDict[booleanAttrs[i]] = true;
  32029. }
  32030. function updateAttrs(oldVnode, vnode) {
  32031. var key, elm = vnode.elm, oldAttrs = oldVnode.data.attrs, attrs = vnode.data.attrs;
  32032. if (!oldAttrs && !attrs)
  32033. return;
  32034. if (oldAttrs === attrs)
  32035. return;
  32036. oldAttrs = oldAttrs || {};
  32037. attrs = attrs || {};
  32038. // update modified attributes, add new attributes
  32039. for (key in attrs) {
  32040. var cur = attrs[key];
  32041. var old = oldAttrs[key];
  32042. if (old !== cur) {
  32043. if (booleanAttrsDict[key]) {
  32044. if (cur) {
  32045. elm.setAttribute(key, "");
  32046. }
  32047. else {
  32048. elm.removeAttribute(key);
  32049. }
  32050. }
  32051. else {
  32052. if (key.charCodeAt(0) !== xChar) {
  32053. elm.setAttribute(key, cur);
  32054. }
  32055. else if (key.charCodeAt(3) === colonChar) {
  32056. // Assume xml namespace
  32057. elm.setAttributeNS(xmlNS, key, cur);
  32058. }
  32059. else if (key.charCodeAt(5) === colonChar) {
  32060. // Assume xlink namespace
  32061. elm.setAttributeNS(xlinkNS, key, cur);
  32062. }
  32063. else {
  32064. elm.setAttribute(key, cur);
  32065. }
  32066. }
  32067. }
  32068. }
  32069. // remove removed attributes
  32070. // use `in` operator since the previous `for` iteration uses it (.i.e. add even attributes with undefined value)
  32071. // the other option is to remove all attributes with value == undefined
  32072. for (key in oldAttrs) {
  32073. if (!(key in attrs)) {
  32074. elm.removeAttribute(key);
  32075. }
  32076. }
  32077. }
  32078. exports.attributesModule = { create: updateAttrs, update: updateAttrs };
  32079. exports.default = exports.attributesModule;
  32080. },{}]},{},[1])(1)
  32081. });
  32082. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy8ucmVnaXN0cnkubnBtanMub3JnL2Jyb3dzZXItcGFjay82LjAuMi9ub2RlX21vZHVsZXMvYnJvd3Nlci1wYWNrL19wcmVsdWRlLmpzIiwibW9kdWxlcy9hdHRyaWJ1dGVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FDQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJmaWxlIjoiZ2VuZXJhdGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXNDb250ZW50IjpbIihmdW5jdGlvbiBlKHQsbixyKXtmdW5jdGlvbiBzKG8sdSl7aWYoIW5bb10pe2lmKCF0W29dKXt2YXIgYT10eXBlb2YgcmVxdWlyZT09XCJmdW5jdGlvblwiJiZyZXF1aXJlO2lmKCF1JiZhKXJldHVybiBhKG8sITApO2lmKGkpcmV0dXJuIGkobywhMCk7dmFyIGY9bmV3IEVycm9yKFwiQ2Fubm90IGZpbmQgbW9kdWxlICdcIitvK1wiJ1wiKTt0aHJvdyBmLmNvZGU9XCJNT0RVTEVfTk9UX0ZPVU5EXCIsZn12YXIgbD1uW29dPXtleHBvcnRzOnt9fTt0W29dWzBdLmNhbGwobC5leHBvcnRzLGZ1bmN0aW9uKGUpe3ZhciBuPXRbb11bMV1bZV07cmV0dXJuIHMobj9uOmUpfSxsLGwuZXhwb3J0cyxlLHQsbixyKX1yZXR1cm4gbltvXS5leHBvcnRzfXZhciBpPXR5cGVvZiByZXF1aXJlPT1cImZ1bmN0aW9uXCImJnJlcXVpcmU7Zm9yKHZhciBvPTA7bzxyLmxlbmd0aDtvKyspcyhyW29dKTtyZXR1cm4gc30pIiwiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6IHRydWUgfSk7XG52YXIgYm9vbGVhbkF0dHJzID0gW1wiYWxsb3dmdWxsc2NyZWVuXCIsIFwiYXN5bmNcIiwgXCJhdXRvZm9jdXNcIiwgXCJhdXRvcGxheVwiLCBcImNoZWNrZWRcIiwgXCJjb21wYWN0XCIsIFwiY29udHJvbHNcIiwgXCJkZWNsYXJlXCIsXG4gICAgXCJkZWZhdWx0XCIsIFwiZGVmYXVsdGNoZWNrZWRcIiwgXCJkZWZhdWx0bXV0ZWRcIiwgXCJkZWZhdWx0c2VsZWN0ZWRcIiwgXCJkZWZlclwiLCBcImRpc2FibGVkXCIsIFwiZHJhZ2dhYmxlXCIsXG4gICAgXCJlbmFibGVkXCIsIFwiZm9ybW5vdmFsaWRhdGVcIiwgXCJoaWRkZW5cIiwgXCJpbmRldGVybWluYXRlXCIsIFwiaW5lcnRcIiwgXCJpc21hcFwiLCBcIml0ZW1zY29wZVwiLCBcImxvb3BcIiwgXCJtdWx0aXBsZVwiLFxuICAgIFwibXV0ZWRcIiwgXCJub2hyZWZcIiwgXCJub3Jlc2l6ZVwiLCBcIm5vc2hhZGVcIiwgXCJub3ZhbGlkYXRlXCIsIFwibm93cmFwXCIsIFwib3BlblwiLCBcInBhdXNlb25leGl0XCIsIFwicmVhZG9ubHlcIixcbiAgICBcInJlcXVpcmVkXCIsIFwicmV2ZXJzZWRcIiwgXCJzY29wZWRcIiwgXCJzZWFtbGVzc1wiLCBcInNlbGVjdGVkXCIsIFwic29ydGFibGVcIiwgXCJzcGVsbGNoZWNrXCIsIFwidHJhbnNsYXRlXCIsXG4gICAgXCJ0cnVlc3BlZWRcIiwgXCJ0eXBlbXVzdG1hdGNoXCIsIFwidmlzaWJsZVwiXTtcbnZhciB4bGlua05TID0gJ2h0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsnO1xudmFyIHhtbE5TID0gJ2h0dHA6Ly93d3cudzMub3JnL1hNTC8xOTk4L25hbWVzcGFjZSc7XG52YXIgY29sb25DaGFyID0gNTg7XG52YXIgeENoYXIgPSAxMjA7XG52YXIgYm9vbGVhbkF0dHJzRGljdCA9IE9iamVjdC5jcmVhdGUobnVsbCk7XG5mb3IgKHZhciBpID0gMCwgbGVuID0gYm9vbGVhbkF0dHJzLmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7XG4gICAgYm9vbGVhbkF0dHJzRGljdFtib29sZWFuQXR0cnNbaV1dID0gdHJ1ZTtcbn1cbmZ1bmN0aW9uIHVwZGF0ZUF0dHJzKG9sZFZub2RlLCB2bm9kZSkge1xuICAgIHZhciBrZXksIGVsbSA9IHZub2RlLmVsbSwgb2xkQXR0cnMgPSBvbGRWbm9kZS5kYXRhLmF0dHJzLCBhdHRycyA9IHZub2RlLmRhdGEuYXR0cnM7XG4gICAgaWYgKCFvbGRBdHRycyAmJiAhYXR0cnMpXG4gICAgICAgIHJldHVybjtcbiAgICBpZiAob2xkQXR0cnMgPT09IGF0dHJzKVxuICAgICAgICByZXR1cm47XG4gICAgb2xkQXR0cnMgPSBvbGRBdHRycyB8fCB7fTtcbiAgICBhdHRycyA9IGF0dHJzIHx8IHt9O1xuICAgIC8vIHVwZGF0ZSBtb2RpZmllZCBhdHRyaWJ1dGVzLCBhZGQgbmV3IGF0dHJpYnV0ZXNcbiAgICBmb3IgKGtleSBpbiBhdHRycykge1xuICAgICAgICB2YXIgY3VyID0gYXR0cnNba2V5XTtcbiAgICAgICAgdmFyIG9sZCA9IG9sZEF0dHJzW2tleV07XG4gICAgICAgIGlmIChvbGQgIT09IGN1cikge1xuICAgICAgICAgICAgaWYgKGJvb2xlYW5BdHRyc0RpY3Rba2V5XSkge1xuICAgICAgICAgICAgICAgIGlmIChjdXIpIHtcbiAgICAgICAgICAgICAgICAgICAgZWxtLnNldEF0dHJpYnV0ZShrZXksIFwiXCIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZWxtLnJlbW92ZUF0dHJpYnV0ZShrZXkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChrZXkuY2hhckNvZGVBdCgwKSAhPT0geENoYXIpIHtcbiAgICAgICAgICAgICAgICAgICAgZWxtLnNldEF0dHJpYnV0ZShrZXksIGN1cik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGtleS5jaGFyQ29kZUF0KDMpID09PSBjb2xvbkNoYXIpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQXNzdW1lIHhtbCBuYW1lc3BhY2VcbiAgICAgICAgICAgICAgICAgICAgZWxtLnNldEF0dHJpYnV0ZU5TKHhtbE5TLCBrZXksIGN1cik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGtleS5jaGFyQ29kZUF0KDUpID09PSBjb2xvbkNoYXIpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQXNzdW1lIHhsaW5rIG5hbWVzcGFjZVxuICAgICAgICAgICAgICAgICAgICBlbG0uc2V0QXR0cmlidXRlTlMoeGxpbmtOUywga2V5LCBjdXIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZWxtLnNldEF0dHJpYnV0ZShrZXksIGN1cik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIC8vIHJlbW92ZSByZW1vdmVkIGF0dHJpYnV0ZXNcbiAgICAvLyB1c2UgYGluYCBvcGVyYXRvciBzaW5jZSB0aGUgcHJldmlvdXMgYGZvcmAgaXRlcmF0aW9uIHVzZXMgaXQgKC5pLmUuIGFkZCBldmVuIGF0dHJpYnV0ZXMgd2l0aCB1bmRlZmluZWQgdmFsdWUpXG4gICAgLy8gdGhlIG90aGVyIG9wdGlvbiBpcyB0byByZW1vdmUgYWxsIGF0dHJpYnV0ZXMgd2l0aCB2YWx1ZSA9PSB1bmRlZmluZWRcbiAgICBmb3IgKGtleSBpbiBvbGRBdHRycykge1xuICAgICAgICBpZiAoIShrZXkgaW4gYXR0cnMpKSB7XG4gICAgICAgICAgICBlbG0ucmVtb3ZlQXR0cmlidXRlKGtleSk7XG4gICAgICAgIH1cbiAgICB9XG59XG5leHBvcnRzLmF0dHJpYnV0ZXNNb2R1bGUgPSB7IGNyZWF0ZTogdXBkYXRlQXR0cnMsIHVwZGF0ZTogdXBkYXRlQXR0cnMgfTtcbmV4cG9ydHMuZGVmYXVsdCA9IGV4cG9ydHMuYXR0cmlidXRlc01vZHVsZTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWF0dHJpYnV0ZXMuanMubWFwIl19
  32083. /***/ }),
  32084. /***/ "./node_modules/snabbdom/dist/snabbdom-class.js":
  32085. /*!******************************************************!*\
  32086. !*** ./node_modules/snabbdom/dist/snabbdom-class.js ***!
  32087. \******************************************************/
  32088. /*! no static exports found */
  32089. /***/ (function(module, exports, __webpack_require__) {
  32090. var require;var require;(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(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 require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  32091. "use strict";
  32092. Object.defineProperty(exports, "__esModule", { value: true });
  32093. function updateClass(oldVnode, vnode) {
  32094. var cur, name, elm = vnode.elm, oldClass = oldVnode.data.class, klass = vnode.data.class;
  32095. if (!oldClass && !klass)
  32096. return;
  32097. if (oldClass === klass)
  32098. return;
  32099. oldClass = oldClass || {};
  32100. klass = klass || {};
  32101. for (name in oldClass) {
  32102. if (!klass[name]) {
  32103. elm.classList.remove(name);
  32104. }
  32105. }
  32106. for (name in klass) {
  32107. cur = klass[name];
  32108. if (cur !== oldClass[name]) {
  32109. elm.classList[cur ? 'add' : 'remove'](name);
  32110. }
  32111. }
  32112. }
  32113. exports.classModule = { create: updateClass, update: updateClass };
  32114. exports.default = exports.classModule;
  32115. },{}]},{},[1])(1)
  32116. });
  32117. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy8ucmVnaXN0cnkubnBtanMub3JnL2Jyb3dzZXItcGFjay82LjAuMi9ub2RlX21vZHVsZXMvYnJvd3Nlci1wYWNrL19wcmVsdWRlLmpzIiwibW9kdWxlcy9jbGFzcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQ0FBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6ImdlbmVyYXRlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyIoZnVuY3Rpb24gZSh0LG4scil7ZnVuY3Rpb24gcyhvLHUpe2lmKCFuW29dKXtpZighdFtvXSl7dmFyIGE9dHlwZW9mIHJlcXVpcmU9PVwiZnVuY3Rpb25cIiYmcmVxdWlyZTtpZighdSYmYSlyZXR1cm4gYShvLCEwKTtpZihpKXJldHVybiBpKG8sITApO3ZhciBmPW5ldyBFcnJvcihcIkNhbm5vdCBmaW5kIG1vZHVsZSAnXCIrbytcIidcIik7dGhyb3cgZi5jb2RlPVwiTU9EVUxFX05PVF9GT1VORFwiLGZ9dmFyIGw9bltvXT17ZXhwb3J0czp7fX07dFtvXVswXS5jYWxsKGwuZXhwb3J0cyxmdW5jdGlvbihlKXt2YXIgbj10W29dWzFdW2VdO3JldHVybiBzKG4/bjplKX0sbCxsLmV4cG9ydHMsZSx0LG4scil9cmV0dXJuIG5bb10uZXhwb3J0c312YXIgaT10eXBlb2YgcmVxdWlyZT09XCJmdW5jdGlvblwiJiZyZXF1aXJlO2Zvcih2YXIgbz0wO288ci5sZW5ndGg7bysrKXMocltvXSk7cmV0dXJuIHN9KSIsIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiB0cnVlIH0pO1xuZnVuY3Rpb24gdXBkYXRlQ2xhc3Mob2xkVm5vZGUsIHZub2RlKSB7XG4gICAgdmFyIGN1ciwgbmFtZSwgZWxtID0gdm5vZGUuZWxtLCBvbGRDbGFzcyA9IG9sZFZub2RlLmRhdGEuY2xhc3MsIGtsYXNzID0gdm5vZGUuZGF0YS5jbGFzcztcbiAgICBpZiAoIW9sZENsYXNzICYmICFrbGFzcylcbiAgICAgICAgcmV0dXJuO1xuICAgIGlmIChvbGRDbGFzcyA9PT0ga2xhc3MpXG4gICAgICAgIHJldHVybjtcbiAgICBvbGRDbGFzcyA9IG9sZENsYXNzIHx8IHt9O1xuICAgIGtsYXNzID0ga2xhc3MgfHwge307XG4gICAgZm9yIChuYW1lIGluIG9sZENsYXNzKSB7XG4gICAgICAgIGlmICgha2xhc3NbbmFtZV0pIHtcbiAgICAgICAgICAgIGVsbS5jbGFzc0xpc3QucmVtb3ZlKG5hbWUpO1xuICAgICAgICB9XG4gICAgfVxuICAgIGZvciAobmFtZSBpbiBrbGFzcykge1xuICAgICAgICBjdXIgPSBrbGFzc1tuYW1lXTtcbiAgICAgICAgaWYgKGN1ciAhPT0gb2xkQ2xhc3NbbmFtZV0pIHtcbiAgICAgICAgICAgIGVsbS5jbGFzc0xpc3RbY3VyID8gJ2FkZCcgOiAncmVtb3ZlJ10obmFtZSk7XG4gICAgICAgIH1cbiAgICB9XG59XG5leHBvcnRzLmNsYXNzTW9kdWxlID0geyBjcmVhdGU6IHVwZGF0ZUNsYXNzLCB1cGRhdGU6IHVwZGF0ZUNsYXNzIH07XG5leHBvcnRzLmRlZmF1bHQgPSBleHBvcnRzLmNsYXNzTW9kdWxlO1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9Y2xhc3MuanMubWFwIl19
  32118. /***/ }),
  32119. /***/ "./node_modules/snabbdom/dist/snabbdom-dataset.js":
  32120. /*!********************************************************!*\
  32121. !*** ./node_modules/snabbdom/dist/snabbdom-dataset.js ***!
  32122. \********************************************************/
  32123. /*! no static exports found */
  32124. /***/ (function(module, exports, __webpack_require__) {
  32125. var require;var require;(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(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 require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  32126. "use strict";
  32127. Object.defineProperty(exports, "__esModule", { value: true });
  32128. var CAPS_REGEX = /[A-Z]/g;
  32129. function updateDataset(oldVnode, vnode) {
  32130. var elm = vnode.elm, oldDataset = oldVnode.data.dataset, dataset = vnode.data.dataset, key;
  32131. if (!oldDataset && !dataset)
  32132. return;
  32133. if (oldDataset === dataset)
  32134. return;
  32135. oldDataset = oldDataset || {};
  32136. dataset = dataset || {};
  32137. var d = elm.dataset;
  32138. for (key in oldDataset) {
  32139. if (!dataset[key]) {
  32140. if (d) {
  32141. if (key in d) {
  32142. delete d[key];
  32143. }
  32144. }
  32145. else {
  32146. elm.removeAttribute('data-' + key.replace(CAPS_REGEX, '-$&').toLowerCase());
  32147. }
  32148. }
  32149. }
  32150. for (key in dataset) {
  32151. if (oldDataset[key] !== dataset[key]) {
  32152. if (d) {
  32153. d[key] = dataset[key];
  32154. }
  32155. else {
  32156. elm.setAttribute('data-' + key.replace(CAPS_REGEX, '-$&').toLowerCase(), dataset[key]);
  32157. }
  32158. }
  32159. }
  32160. }
  32161. exports.datasetModule = { create: updateDataset, update: updateDataset };
  32162. exports.default = exports.datasetModule;
  32163. },{}]},{},[1])(1)
  32164. });
  32165. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJtb2R1bGVzL2RhdGFzZXQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUNBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6ImdlbmVyYXRlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzQ29udGVudCI6WyIoZnVuY3Rpb24gZSh0LG4scil7ZnVuY3Rpb24gcyhvLHUpe2lmKCFuW29dKXtpZighdFtvXSl7dmFyIGE9dHlwZW9mIHJlcXVpcmU9PVwiZnVuY3Rpb25cIiYmcmVxdWlyZTtpZighdSYmYSlyZXR1cm4gYShvLCEwKTtpZihpKXJldHVybiBpKG8sITApO3ZhciBmPW5ldyBFcnJvcihcIkNhbm5vdCBmaW5kIG1vZHVsZSAnXCIrbytcIidcIik7dGhyb3cgZi5jb2RlPVwiTU9EVUxFX05PVF9GT1VORFwiLGZ9dmFyIGw9bltvXT17ZXhwb3J0czp7fX07dFtvXVswXS5jYWxsKGwuZXhwb3J0cyxmdW5jdGlvbihlKXt2YXIgbj10W29dWzFdW2VdO3JldHVybiBzKG4/bjplKX0sbCxsLmV4cG9ydHMsZSx0LG4scil9cmV0dXJuIG5bb10uZXhwb3J0c312YXIgaT10eXBlb2YgcmVxdWlyZT09XCJmdW5jdGlvblwiJiZyZXF1aXJlO2Zvcih2YXIgbz0wO288ci5sZW5ndGg7bysrKXMocltvXSk7cmV0dXJuIHN9KSIsIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiB0cnVlIH0pO1xudmFyIENBUFNfUkVHRVggPSAvW0EtWl0vZztcbmZ1bmN0aW9uIHVwZGF0ZURhdGFzZXQob2xkVm5vZGUsIHZub2RlKSB7XG4gICAgdmFyIGVsbSA9IHZub2RlLmVsbSwgb2xkRGF0YXNldCA9IG9sZFZub2RlLmRhdGEuZGF0YXNldCwgZGF0YXNldCA9IHZub2RlLmRhdGEuZGF0YXNldCwga2V5O1xuICAgIGlmICghb2xkRGF0YXNldCAmJiAhZGF0YXNldClcbiAgICAgICAgcmV0dXJuO1xuICAgIGlmIChvbGREYXRhc2V0ID09PSBkYXRhc2V0KVxuICAgICAgICByZXR1cm47XG4gICAgb2xkRGF0YXNldCA9IG9sZERhdGFzZXQgfHwge307XG4gICAgZGF0YXNldCA9IGRhdGFzZXQgfHwge307XG4gICAgdmFyIGQgPSBlbG0uZGF0YXNldDtcbiAgICBmb3IgKGtleSBpbiBvbGREYXRhc2V0KSB7XG4gICAgICAgIGlmICghZGF0YXNldFtrZXldKSB7XG4gICAgICAgICAgICBpZiAoZCkge1xuICAgICAgICAgICAgICAgIGlmIChrZXkgaW4gZCkge1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgZFtrZXldO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGVsbS5yZW1vdmVBdHRyaWJ1dGUoJ2RhdGEtJyArIGtleS5yZXBsYWNlKENBUFNfUkVHRVgsICctJCYnKS50b0xvd2VyQ2FzZSgpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBmb3IgKGtleSBpbiBkYXRhc2V0KSB7XG4gICAgICAgIGlmIChvbGREYXRhc2V0W2tleV0gIT09IGRhdGFzZXRba2V5XSkge1xuICAgICAgICAgICAgaWYgKGQpIHtcbiAgICAgICAgICAgICAgICBkW2tleV0gPSBkYXRhc2V0W2tleV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBlbG0uc2V0QXR0cmlidXRlKCdkYXRhLScgKyBrZXkucmVwbGFjZShDQVBTX1JFR0VYLCAnLSQmJykudG9Mb3dlckNhc2UoKSwgZGF0YXNldFtrZXldKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn1cbmV4cG9ydHMuZGF0YXNldE1vZHVsZSA9IHsgY3JlYXRlOiB1cGRhdGVEYXRhc2V0LCB1cGRhdGU6IHVwZGF0ZURhdGFzZXQgfTtcbmV4cG9ydHMuZGVmYXVsdCA9IGV4cG9ydHMuZGF0YXNldE1vZHVsZTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWRhdGFzZXQuanMubWFwIl19
  32166. /***/ }),
  32167. /***/ "./node_modules/snabbdom/dist/snabbdom-props.js":
  32168. /*!******************************************************!*\
  32169. !*** ./node_modules/snabbdom/dist/snabbdom-props.js ***!
  32170. \******************************************************/
  32171. /*! no static exports found */
  32172. /***/ (function(module, exports, __webpack_require__) {
  32173. var require;var require;(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(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 require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  32174. "use strict";
  32175. Object.defineProperty(exports, "__esModule", { value: true });
  32176. function updateProps(oldVnode, vnode) {
  32177. var key, cur, old, elm = vnode.elm, oldProps = oldVnode.data.props, props = vnode.data.props;
  32178. if (!oldProps && !props)
  32179. return;
  32180. if (oldProps === props)
  32181. return;
  32182. oldProps = oldProps || {};
  32183. props = props || {};
  32184. for (key in oldProps) {
  32185. if (!props[key]) {
  32186. delete elm[key];
  32187. }
  32188. }
  32189. for (key in props) {
  32190. cur = props[key];
  32191. old = oldProps[key];
  32192. if (old !== cur && (key !== 'value' || elm[key] !== cur)) {
  32193. elm[key] = cur;
  32194. }
  32195. }
  32196. }
  32197. exports.propsModule = { create: updateProps, update: updateProps };
  32198. exports.default = exports.propsModule;
  32199. },{}]},{},[1])(1)
  32200. });
  32201. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy8ucmVnaXN0cnkubnBtanMub3JnL2Jyb3dzZXItcGFjay82LjAuMi9ub2RlX21vZHVsZXMvYnJvd3Nlci1wYWNrL19wcmVsdWRlLmpzIiwibW9kdWxlcy9wcm9wcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQ0FBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJmaWxlIjoiZ2VuZXJhdGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXNDb250ZW50IjpbIihmdW5jdGlvbiBlKHQsbixyKXtmdW5jdGlvbiBzKG8sdSl7aWYoIW5bb10pe2lmKCF0W29dKXt2YXIgYT10eXBlb2YgcmVxdWlyZT09XCJmdW5jdGlvblwiJiZyZXF1aXJlO2lmKCF1JiZhKXJldHVybiBhKG8sITApO2lmKGkpcmV0dXJuIGkobywhMCk7dmFyIGY9bmV3IEVycm9yKFwiQ2Fubm90IGZpbmQgbW9kdWxlICdcIitvK1wiJ1wiKTt0aHJvdyBmLmNvZGU9XCJNT0RVTEVfTk9UX0ZPVU5EXCIsZn12YXIgbD1uW29dPXtleHBvcnRzOnt9fTt0W29dWzBdLmNhbGwobC5leHBvcnRzLGZ1bmN0aW9uKGUpe3ZhciBuPXRbb11bMV1bZV07cmV0dXJuIHMobj9uOmUpfSxsLGwuZXhwb3J0cyxlLHQsbixyKX1yZXR1cm4gbltvXS5leHBvcnRzfXZhciBpPXR5cGVvZiByZXF1aXJlPT1cImZ1bmN0aW9uXCImJnJlcXVpcmU7Zm9yKHZhciBvPTA7bzxyLmxlbmd0aDtvKyspcyhyW29dKTtyZXR1cm4gc30pIiwiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6IHRydWUgfSk7XG5mdW5jdGlvbiB1cGRhdGVQcm9wcyhvbGRWbm9kZSwgdm5vZGUpIHtcbiAgICB2YXIga2V5LCBjdXIsIG9sZCwgZWxtID0gdm5vZGUuZWxtLCBvbGRQcm9wcyA9IG9sZFZub2RlLmRhdGEucHJvcHMsIHByb3BzID0gdm5vZGUuZGF0YS5wcm9wcztcbiAgICBpZiAoIW9sZFByb3BzICYmICFwcm9wcylcbiAgICAgICAgcmV0dXJuO1xuICAgIGlmIChvbGRQcm9wcyA9PT0gcHJvcHMpXG4gICAgICAgIHJldHVybjtcbiAgICBvbGRQcm9wcyA9IG9sZFByb3BzIHx8IHt9O1xuICAgIHByb3BzID0gcHJvcHMgfHwge307XG4gICAgZm9yIChrZXkgaW4gb2xkUHJvcHMpIHtcbiAgICAgICAgaWYgKCFwcm9wc1trZXldKSB7XG4gICAgICAgICAgICBkZWxldGUgZWxtW2tleV07XG4gICAgICAgIH1cbiAgICB9XG4gICAgZm9yIChrZXkgaW4gcHJvcHMpIHtcbiAgICAgICAgY3VyID0gcHJvcHNba2V5XTtcbiAgICAgICAgb2xkID0gb2xkUHJvcHNba2V5XTtcbiAgICAgICAgaWYgKG9sZCAhPT0gY3VyICYmIChrZXkgIT09ICd2YWx1ZScgfHwgZWxtW2tleV0gIT09IGN1cikpIHtcbiAgICAgICAgICAgIGVsbVtrZXldID0gY3VyO1xuICAgICAgICB9XG4gICAgfVxufVxuZXhwb3J0cy5wcm9wc01vZHVsZSA9IHsgY3JlYXRlOiB1cGRhdGVQcm9wcywgdXBkYXRlOiB1cGRhdGVQcm9wcyB9O1xuZXhwb3J0cy5kZWZhdWx0ID0gZXhwb3J0cy5wcm9wc01vZHVsZTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXByb3BzLmpzLm1hcCJdfQ==
  32202. /***/ }),
  32203. /***/ "./node_modules/snabbdom/dist/snabbdom-style.js":
  32204. /*!******************************************************!*\
  32205. !*** ./node_modules/snabbdom/dist/snabbdom-style.js ***!
  32206. \******************************************************/
  32207. /*! no static exports found */
  32208. /***/ (function(module, exports, __webpack_require__) {
  32209. var require;var require;(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(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 require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  32210. "use strict";
  32211. Object.defineProperty(exports, "__esModule", { value: true });
  32212. var raf = (typeof window !== 'undefined' && window.requestAnimationFrame) || setTimeout;
  32213. var nextFrame = function (fn) { raf(function () { raf(fn); }); };
  32214. function setNextFrame(obj, prop, val) {
  32215. nextFrame(function () { obj[prop] = val; });
  32216. }
  32217. function updateStyle(oldVnode, vnode) {
  32218. var cur, name, elm = vnode.elm, oldStyle = oldVnode.data.style, style = vnode.data.style;
  32219. if (!oldStyle && !style)
  32220. return;
  32221. if (oldStyle === style)
  32222. return;
  32223. oldStyle = oldStyle || {};
  32224. style = style || {};
  32225. var oldHasDel = 'delayed' in oldStyle;
  32226. for (name in oldStyle) {
  32227. if (!style[name]) {
  32228. if (name[0] === '-' && name[1] === '-') {
  32229. elm.style.removeProperty(name);
  32230. }
  32231. else {
  32232. elm.style[name] = '';
  32233. }
  32234. }
  32235. }
  32236. for (name in style) {
  32237. cur = style[name];
  32238. if (name === 'delayed' && style.delayed) {
  32239. for (var name2 in style.delayed) {
  32240. cur = style.delayed[name2];
  32241. if (!oldHasDel || cur !== oldStyle.delayed[name2]) {
  32242. setNextFrame(elm.style, name2, cur);
  32243. }
  32244. }
  32245. }
  32246. else if (name !== 'remove' && cur !== oldStyle[name]) {
  32247. if (name[0] === '-' && name[1] === '-') {
  32248. elm.style.setProperty(name, cur);
  32249. }
  32250. else {
  32251. elm.style[name] = cur;
  32252. }
  32253. }
  32254. }
  32255. }
  32256. function applyDestroyStyle(vnode) {
  32257. var style, name, elm = vnode.elm, s = vnode.data.style;
  32258. if (!s || !(style = s.destroy))
  32259. return;
  32260. for (name in style) {
  32261. elm.style[name] = style[name];
  32262. }
  32263. }
  32264. function applyRemoveStyle(vnode, rm) {
  32265. var s = vnode.data.style;
  32266. if (!s || !s.remove) {
  32267. rm();
  32268. return;
  32269. }
  32270. var name, elm = vnode.elm, i = 0, compStyle, style = s.remove, amount = 0, applied = [];
  32271. for (name in style) {
  32272. applied.push(name);
  32273. elm.style[name] = style[name];
  32274. }
  32275. compStyle = getComputedStyle(elm);
  32276. var props = compStyle['transition-property'].split(', ');
  32277. for (; i < props.length; ++i) {
  32278. if (applied.indexOf(props[i]) !== -1)
  32279. amount++;
  32280. }
  32281. elm.addEventListener('transitionend', function (ev) {
  32282. if (ev.target === elm)
  32283. --amount;
  32284. if (amount === 0)
  32285. rm();
  32286. });
  32287. }
  32288. exports.styleModule = {
  32289. create: updateStyle,
  32290. update: updateStyle,
  32291. destroy: applyDestroyStyle,
  32292. remove: applyRemoveStyle
  32293. };
  32294. exports.default = exports.styleModule;
  32295. },{}]},{},[1])(1)
  32296. });
  32297. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy8ucmVnaXN0cnkubnBtanMub3JnL2Jyb3dzZXItcGFjay82LjAuMi9ub2RlX21vZHVsZXMvYnJvd3Nlci1wYWNrL19wcmVsdWRlLmpzIiwibW9kdWxlcy9zdHlsZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQ0FBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJmaWxlIjoiZ2VuZXJhdGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXNDb250ZW50IjpbIihmdW5jdGlvbiBlKHQsbixyKXtmdW5jdGlvbiBzKG8sdSl7aWYoIW5bb10pe2lmKCF0W29dKXt2YXIgYT10eXBlb2YgcmVxdWlyZT09XCJmdW5jdGlvblwiJiZyZXF1aXJlO2lmKCF1JiZhKXJldHVybiBhKG8sITApO2lmKGkpcmV0dXJuIGkobywhMCk7dmFyIGY9bmV3IEVycm9yKFwiQ2Fubm90IGZpbmQgbW9kdWxlICdcIitvK1wiJ1wiKTt0aHJvdyBmLmNvZGU9XCJNT0RVTEVfTk9UX0ZPVU5EXCIsZn12YXIgbD1uW29dPXtleHBvcnRzOnt9fTt0W29dWzBdLmNhbGwobC5leHBvcnRzLGZ1bmN0aW9uKGUpe3ZhciBuPXRbb11bMV1bZV07cmV0dXJuIHMobj9uOmUpfSxsLGwuZXhwb3J0cyxlLHQsbixyKX1yZXR1cm4gbltvXS5leHBvcnRzfXZhciBpPXR5cGVvZiByZXF1aXJlPT1cImZ1bmN0aW9uXCImJnJlcXVpcmU7Zm9yKHZhciBvPTA7bzxyLmxlbmd0aDtvKyspcyhyW29dKTtyZXR1cm4gc30pIiwiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6IHRydWUgfSk7XG52YXIgcmFmID0gKHR5cGVvZiB3aW5kb3cgIT09ICd1bmRlZmluZWQnICYmIHdpbmRvdy5yZXF1ZXN0QW5pbWF0aW9uRnJhbWUpIHx8IHNldFRpbWVvdXQ7XG52YXIgbmV4dEZyYW1lID0gZnVuY3Rpb24gKGZuKSB7IHJhZihmdW5jdGlvbiAoKSB7IHJhZihmbik7IH0pOyB9O1xuZnVuY3Rpb24gc2V0TmV4dEZyYW1lKG9iaiwgcHJvcCwgdmFsKSB7XG4gICAgbmV4dEZyYW1lKGZ1bmN0aW9uICgpIHsgb2JqW3Byb3BdID0gdmFsOyB9KTtcbn1cbmZ1bmN0aW9uIHVwZGF0ZVN0eWxlKG9sZFZub2RlLCB2bm9kZSkge1xuICAgIHZhciBjdXIsIG5hbWUsIGVsbSA9IHZub2RlLmVsbSwgb2xkU3R5bGUgPSBvbGRWbm9kZS5kYXRhLnN0eWxlLCBzdHlsZSA9IHZub2RlLmRhdGEuc3R5bGU7XG4gICAgaWYgKCFvbGRTdHlsZSAmJiAhc3R5bGUpXG4gICAgICAgIHJldHVybjtcbiAgICBpZiAob2xkU3R5bGUgPT09IHN0eWxlKVxuICAgICAgICByZXR1cm47XG4gICAgb2xkU3R5bGUgPSBvbGRTdHlsZSB8fCB7fTtcbiAgICBzdHlsZSA9IHN0eWxlIHx8IHt9O1xuICAgIHZhciBvbGRIYXNEZWwgPSAnZGVsYXllZCcgaW4gb2xkU3R5bGU7XG4gICAgZm9yIChuYW1lIGluIG9sZFN0eWxlKSB7XG4gICAgICAgIGlmICghc3R5bGVbbmFtZV0pIHtcbiAgICAgICAgICAgIGlmIChuYW1lWzBdID09PSAnLScgJiYgbmFtZVsxXSA9PT0gJy0nKSB7XG4gICAgICAgICAgICAgICAgZWxtLnN0eWxlLnJlbW92ZVByb3BlcnR5KG5hbWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgZWxtLnN0eWxlW25hbWVdID0gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgZm9yIChuYW1lIGluIHN0eWxlKSB7XG4gICAgICAgIGN1ciA9IHN0eWxlW25hbWVdO1xuICAgICAgICBpZiAobmFtZSA9PT0gJ2RlbGF5ZWQnICYmIHN0eWxlLmRlbGF5ZWQpIHtcbiAgICAgICAgICAgIGZvciAodmFyIG5hbWUyIGluIHN0eWxlLmRlbGF5ZWQpIHtcbiAgICAgICAgICAgICAgICBjdXIgPSBzdHlsZS5kZWxheWVkW25hbWUyXTtcbiAgICAgICAgICAgICAgICBpZiAoIW9sZEhhc0RlbCB8fCBjdXIgIT09IG9sZFN0eWxlLmRlbGF5ZWRbbmFtZTJdKSB7XG4gICAgICAgICAgICAgICAgICAgIHNldE5leHRGcmFtZShlbG0uc3R5bGUsIG5hbWUyLCBjdXIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChuYW1lICE9PSAncmVtb3ZlJyAmJiBjdXIgIT09IG9sZFN0eWxlW25hbWVdKSB7XG4gICAgICAgICAgICBpZiAobmFtZVswXSA9PT0gJy0nICYmIG5hbWVbMV0gPT09ICctJykge1xuICAgICAgICAgICAgICAgIGVsbS5zdHlsZS5zZXRQcm9wZXJ0eShuYW1lLCBjdXIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgZWxtLnN0eWxlW25hbWVdID0gY3VyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufVxuZnVuY3Rpb24gYXBwbHlEZXN0cm95U3R5bGUodm5vZGUpIHtcbiAgICB2YXIgc3R5bGUsIG5hbWUsIGVsbSA9IHZub2RlLmVsbSwgcyA9IHZub2RlLmRhdGEuc3R5bGU7XG4gICAgaWYgKCFzIHx8ICEoc3R5bGUgPSBzLmRlc3Ryb3kpKVxuICAgICAgICByZXR1cm47XG4gICAgZm9yIChuYW1lIGluIHN0eWxlKSB7XG4gICAgICAgIGVsbS5zdHlsZVtuYW1lXSA9IHN0eWxlW25hbWVdO1xuICAgIH1cbn1cbmZ1bmN0aW9uIGFwcGx5UmVtb3ZlU3R5bGUodm5vZGUsIHJtKSB7XG4gICAgdmFyIHMgPSB2bm9kZS5kYXRhLnN0eWxlO1xuICAgIGlmICghcyB8fCAhcy5yZW1vdmUpIHtcbiAgICAgICAgcm0oKTtcbiAgICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICB2YXIgbmFtZSwgZWxtID0gdm5vZGUuZWxtLCBpID0gMCwgY29tcFN0eWxlLCBzdHlsZSA9IHMucmVtb3ZlLCBhbW91bnQgPSAwLCBhcHBsaWVkID0gW107XG4gICAgZm9yIChuYW1lIGluIHN0eWxlKSB7XG4gICAgICAgIGFwcGxpZWQucHVzaChuYW1lKTtcbiAgICAgICAgZWxtLnN0eWxlW25hbWVdID0gc3R5bGVbbmFtZV07XG4gICAgfVxuICAgIGNvbXBTdHlsZSA9IGdldENvbXB1dGVkU3R5bGUoZWxtKTtcbiAgICB2YXIgcHJvcHMgPSBjb21wU3R5bGVbJ3RyYW5zaXRpb24tcHJvcGVydHknXS5zcGxpdCgnLCAnKTtcbiAgICBmb3IgKDsgaSA8IHByb3BzLmxlbmd0aDsgKytpKSB7XG4gICAgICAgIGlmIChhcHBsaWVkLmluZGV4T2YocHJvcHNbaV0pICE9PSAtMSlcbiAgICAgICAgICAgIGFtb3VudCsrO1xuICAgIH1cbiAgICBlbG0uYWRkRXZlbnRMaXN0ZW5lcigndHJhbnNpdGlvbmVuZCcsIGZ1bmN0aW9uIChldikge1xuICAgICAgICBpZiAoZXYudGFyZ2V0ID09PSBlbG0pXG4gICAgICAgICAgICAtLWFtb3VudDtcbiAgICAgICAgaWYgKGFtb3VudCA9PT0gMClcbiAgICAgICAgICAgIHJtKCk7XG4gICAgfSk7XG59XG5leHBvcnRzLnN0eWxlTW9kdWxlID0ge1xuICAgIGNyZWF0ZTogdXBkYXRlU3R5bGUsXG4gICAgdXBkYXRlOiB1cGRhdGVTdHlsZSxcbiAgICBkZXN0cm95OiBhcHBseURlc3Ryb3lTdHlsZSxcbiAgICByZW1vdmU6IGFwcGx5UmVtb3ZlU3R5bGVcbn07XG5leHBvcnRzLmRlZmF1bHQgPSBleHBvcnRzLnN0eWxlTW9kdWxlO1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9c3R5bGUuanMubWFwIl19
  32298. /***/ }),
  32299. /***/ "./node_modules/snabbdom/dist/snabbdom.js":
  32300. /*!************************************************!*\
  32301. !*** ./node_modules/snabbdom/dist/snabbdom.js ***!
  32302. \************************************************/
  32303. /*! no static exports found */
  32304. /***/ (function(module, exports, __webpack_require__) {
  32305. var require;var require;(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(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 require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  32306. "use strict";
  32307. Object.defineProperty(exports, "__esModule", { value: true });
  32308. var vnode_1 = require("./vnode");
  32309. var is = require("./is");
  32310. function addNS(data, children, sel) {
  32311. data.ns = 'http://www.w3.org/2000/svg';
  32312. if (sel !== 'foreignObject' && children !== undefined) {
  32313. for (var i = 0; i < children.length; ++i) {
  32314. var childData = children[i].data;
  32315. if (childData !== undefined) {
  32316. addNS(childData, children[i].children, children[i].sel);
  32317. }
  32318. }
  32319. }
  32320. }
  32321. function h(sel, b, c) {
  32322. var data = {}, children, text, i;
  32323. if (c !== undefined) {
  32324. data = b;
  32325. if (is.array(c)) {
  32326. children = c;
  32327. }
  32328. else if (is.primitive(c)) {
  32329. text = c;
  32330. }
  32331. else if (c && c.sel) {
  32332. children = [c];
  32333. }
  32334. }
  32335. else if (b !== undefined) {
  32336. if (is.array(b)) {
  32337. children = b;
  32338. }
  32339. else if (is.primitive(b)) {
  32340. text = b;
  32341. }
  32342. else if (b && b.sel) {
  32343. children = [b];
  32344. }
  32345. else {
  32346. data = b;
  32347. }
  32348. }
  32349. if (is.array(children)) {
  32350. for (i = 0; i < children.length; ++i) {
  32351. if (is.primitive(children[i]))
  32352. children[i] = vnode_1.vnode(undefined, undefined, undefined, children[i]);
  32353. }
  32354. }
  32355. if (sel[0] === 's' && sel[1] === 'v' && sel[2] === 'g' &&
  32356. (sel.length === 3 || sel[3] === '.' || sel[3] === '#')) {
  32357. addNS(data, children, sel);
  32358. }
  32359. return vnode_1.vnode(sel, data, children, text, undefined);
  32360. }
  32361. exports.h = h;
  32362. ;
  32363. exports.default = h;
  32364. },{"./is":3,"./vnode":6}],2:[function(require,module,exports){
  32365. "use strict";
  32366. Object.defineProperty(exports, "__esModule", { value: true });
  32367. function createElement(tagName) {
  32368. return document.createElement(tagName);
  32369. }
  32370. function createElementNS(namespaceURI, qualifiedName) {
  32371. return document.createElementNS(namespaceURI, qualifiedName);
  32372. }
  32373. function createTextNode(text) {
  32374. return document.createTextNode(text);
  32375. }
  32376. function createComment(text) {
  32377. return document.createComment(text);
  32378. }
  32379. function insertBefore(parentNode, newNode, referenceNode) {
  32380. parentNode.insertBefore(newNode, referenceNode);
  32381. }
  32382. function removeChild(node, child) {
  32383. node.removeChild(child);
  32384. }
  32385. function appendChild(node, child) {
  32386. node.appendChild(child);
  32387. }
  32388. function parentNode(node) {
  32389. return node.parentNode;
  32390. }
  32391. function nextSibling(node) {
  32392. return node.nextSibling;
  32393. }
  32394. function tagName(elm) {
  32395. return elm.tagName;
  32396. }
  32397. function setTextContent(node, text) {
  32398. node.textContent = text;
  32399. }
  32400. function getTextContent(node) {
  32401. return node.textContent;
  32402. }
  32403. function isElement(node) {
  32404. return node.nodeType === 1;
  32405. }
  32406. function isText(node) {
  32407. return node.nodeType === 3;
  32408. }
  32409. function isComment(node) {
  32410. return node.nodeType === 8;
  32411. }
  32412. exports.htmlDomApi = {
  32413. createElement: createElement,
  32414. createElementNS: createElementNS,
  32415. createTextNode: createTextNode,
  32416. createComment: createComment,
  32417. insertBefore: insertBefore,
  32418. removeChild: removeChild,
  32419. appendChild: appendChild,
  32420. parentNode: parentNode,
  32421. nextSibling: nextSibling,
  32422. tagName: tagName,
  32423. setTextContent: setTextContent,
  32424. getTextContent: getTextContent,
  32425. isElement: isElement,
  32426. isText: isText,
  32427. isComment: isComment,
  32428. };
  32429. exports.default = exports.htmlDomApi;
  32430. },{}],3:[function(require,module,exports){
  32431. "use strict";
  32432. Object.defineProperty(exports, "__esModule", { value: true });
  32433. exports.array = Array.isArray;
  32434. function primitive(s) {
  32435. return typeof s === 'string' || typeof s === 'number';
  32436. }
  32437. exports.primitive = primitive;
  32438. },{}],4:[function(require,module,exports){
  32439. "use strict";
  32440. Object.defineProperty(exports, "__esModule", { value: true });
  32441. var vnode_1 = require("./vnode");
  32442. var is = require("./is");
  32443. var htmldomapi_1 = require("./htmldomapi");
  32444. function isUndef(s) { return s === undefined; }
  32445. function isDef(s) { return s !== undefined; }
  32446. var emptyNode = vnode_1.default('', {}, [], undefined, undefined);
  32447. function sameVnode(vnode1, vnode2) {
  32448. return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
  32449. }
  32450. function isVnode(vnode) {
  32451. return vnode.sel !== undefined;
  32452. }
  32453. function createKeyToOldIdx(children, beginIdx, endIdx) {
  32454. var i, map = {}, key, ch;
  32455. for (i = beginIdx; i <= endIdx; ++i) {
  32456. ch = children[i];
  32457. if (ch != null) {
  32458. key = ch.key;
  32459. if (key !== undefined)
  32460. map[key] = i;
  32461. }
  32462. }
  32463. return map;
  32464. }
  32465. var hooks = ['create', 'update', 'remove', 'destroy', 'pre', 'post'];
  32466. var h_1 = require("./h");
  32467. exports.h = h_1.h;
  32468. var thunk_1 = require("./thunk");
  32469. exports.thunk = thunk_1.thunk;
  32470. function init(modules, domApi) {
  32471. var i, j, cbs = {};
  32472. var api = domApi !== undefined ? domApi : htmldomapi_1.default;
  32473. for (i = 0; i < hooks.length; ++i) {
  32474. cbs[hooks[i]] = [];
  32475. for (j = 0; j < modules.length; ++j) {
  32476. var hook = modules[j][hooks[i]];
  32477. if (hook !== undefined) {
  32478. cbs[hooks[i]].push(hook);
  32479. }
  32480. }
  32481. }
  32482. function emptyNodeAt(elm) {
  32483. var id = elm.id ? '#' + elm.id : '';
  32484. var c = elm.className ? '.' + elm.className.split(' ').join('.') : '';
  32485. return vnode_1.default(api.tagName(elm).toLowerCase() + id + c, {}, [], undefined, elm);
  32486. }
  32487. function createRmCb(childElm, listeners) {
  32488. return function rmCb() {
  32489. if (--listeners === 0) {
  32490. var parent_1 = api.parentNode(childElm);
  32491. api.removeChild(parent_1, childElm);
  32492. }
  32493. };
  32494. }
  32495. function createElm(vnode, insertedVnodeQueue) {
  32496. var i, data = vnode.data;
  32497. if (data !== undefined) {
  32498. if (isDef(i = data.hook) && isDef(i = i.init)) {
  32499. i(vnode);
  32500. data = vnode.data;
  32501. }
  32502. }
  32503. var children = vnode.children, sel = vnode.sel;
  32504. if (sel === '!') {
  32505. if (isUndef(vnode.text)) {
  32506. vnode.text = '';
  32507. }
  32508. vnode.elm = api.createComment(vnode.text);
  32509. }
  32510. else if (sel !== undefined) {
  32511. // Parse selector
  32512. var hashIdx = sel.indexOf('#');
  32513. var dotIdx = sel.indexOf('.', hashIdx);
  32514. var hash = hashIdx > 0 ? hashIdx : sel.length;
  32515. var dot = dotIdx > 0 ? dotIdx : sel.length;
  32516. var tag = hashIdx !== -1 || dotIdx !== -1 ? sel.slice(0, Math.min(hash, dot)) : sel;
  32517. var elm = vnode.elm = isDef(data) && isDef(i = data.ns) ? api.createElementNS(i, tag)
  32518. : api.createElement(tag);
  32519. if (hash < dot)
  32520. elm.setAttribute('id', sel.slice(hash + 1, dot));
  32521. if (dotIdx > 0)
  32522. elm.setAttribute('class', sel.slice(dot + 1).replace(/\./g, ' '));
  32523. for (i = 0; i < cbs.create.length; ++i)
  32524. cbs.create[i](emptyNode, vnode);
  32525. if (is.array(children)) {
  32526. for (i = 0; i < children.length; ++i) {
  32527. var ch = children[i];
  32528. if (ch != null) {
  32529. api.appendChild(elm, createElm(ch, insertedVnodeQueue));
  32530. }
  32531. }
  32532. }
  32533. else if (is.primitive(vnode.text)) {
  32534. api.appendChild(elm, api.createTextNode(vnode.text));
  32535. }
  32536. i = vnode.data.hook; // Reuse variable
  32537. if (isDef(i)) {
  32538. if (i.create)
  32539. i.create(emptyNode, vnode);
  32540. if (i.insert)
  32541. insertedVnodeQueue.push(vnode);
  32542. }
  32543. }
  32544. else {
  32545. vnode.elm = api.createTextNode(vnode.text);
  32546. }
  32547. return vnode.elm;
  32548. }
  32549. function addVnodes(parentElm, before, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  32550. for (; startIdx <= endIdx; ++startIdx) {
  32551. var ch = vnodes[startIdx];
  32552. if (ch != null) {
  32553. api.insertBefore(parentElm, createElm(ch, insertedVnodeQueue), before);
  32554. }
  32555. }
  32556. }
  32557. function invokeDestroyHook(vnode) {
  32558. var i, j, data = vnode.data;
  32559. if (data !== undefined) {
  32560. if (isDef(i = data.hook) && isDef(i = i.destroy))
  32561. i(vnode);
  32562. for (i = 0; i < cbs.destroy.length; ++i)
  32563. cbs.destroy[i](vnode);
  32564. if (vnode.children !== undefined) {
  32565. for (j = 0; j < vnode.children.length; ++j) {
  32566. i = vnode.children[j];
  32567. if (i != null && typeof i !== "string") {
  32568. invokeDestroyHook(i);
  32569. }
  32570. }
  32571. }
  32572. }
  32573. }
  32574. function removeVnodes(parentElm, vnodes, startIdx, endIdx) {
  32575. for (; startIdx <= endIdx; ++startIdx) {
  32576. var i_1 = void 0, listeners = void 0, rm = void 0, ch = vnodes[startIdx];
  32577. if (ch != null) {
  32578. if (isDef(ch.sel)) {
  32579. invokeDestroyHook(ch);
  32580. listeners = cbs.remove.length + 1;
  32581. rm = createRmCb(ch.elm, listeners);
  32582. for (i_1 = 0; i_1 < cbs.remove.length; ++i_1)
  32583. cbs.remove[i_1](ch, rm);
  32584. if (isDef(i_1 = ch.data) && isDef(i_1 = i_1.hook) && isDef(i_1 = i_1.remove)) {
  32585. i_1(ch, rm);
  32586. }
  32587. else {
  32588. rm();
  32589. }
  32590. }
  32591. else {
  32592. api.removeChild(parentElm, ch.elm);
  32593. }
  32594. }
  32595. }
  32596. }
  32597. function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue) {
  32598. var oldStartIdx = 0, newStartIdx = 0;
  32599. var oldEndIdx = oldCh.length - 1;
  32600. var oldStartVnode = oldCh[0];
  32601. var oldEndVnode = oldCh[oldEndIdx];
  32602. var newEndIdx = newCh.length - 1;
  32603. var newStartVnode = newCh[0];
  32604. var newEndVnode = newCh[newEndIdx];
  32605. var oldKeyToIdx;
  32606. var idxInOld;
  32607. var elmToMove;
  32608. var before;
  32609. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  32610. if (oldStartVnode == null) {
  32611. oldStartVnode = oldCh[++oldStartIdx]; // Vnode might have been moved left
  32612. }
  32613. else if (oldEndVnode == null) {
  32614. oldEndVnode = oldCh[--oldEndIdx];
  32615. }
  32616. else if (newStartVnode == null) {
  32617. newStartVnode = newCh[++newStartIdx];
  32618. }
  32619. else if (newEndVnode == null) {
  32620. newEndVnode = newCh[--newEndIdx];
  32621. }
  32622. else if (sameVnode(oldStartVnode, newStartVnode)) {
  32623. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
  32624. oldStartVnode = oldCh[++oldStartIdx];
  32625. newStartVnode = newCh[++newStartIdx];
  32626. }
  32627. else if (sameVnode(oldEndVnode, newEndVnode)) {
  32628. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
  32629. oldEndVnode = oldCh[--oldEndIdx];
  32630. newEndVnode = newCh[--newEndIdx];
  32631. }
  32632. else if (sameVnode(oldStartVnode, newEndVnode)) {
  32633. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
  32634. api.insertBefore(parentElm, oldStartVnode.elm, api.nextSibling(oldEndVnode.elm));
  32635. oldStartVnode = oldCh[++oldStartIdx];
  32636. newEndVnode = newCh[--newEndIdx];
  32637. }
  32638. else if (sameVnode(oldEndVnode, newStartVnode)) {
  32639. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
  32640. api.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  32641. oldEndVnode = oldCh[--oldEndIdx];
  32642. newStartVnode = newCh[++newStartIdx];
  32643. }
  32644. else {
  32645. if (oldKeyToIdx === undefined) {
  32646. oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
  32647. }
  32648. idxInOld = oldKeyToIdx[newStartVnode.key];
  32649. if (isUndef(idxInOld)) {
  32650. api.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);
  32651. newStartVnode = newCh[++newStartIdx];
  32652. }
  32653. else {
  32654. elmToMove = oldCh[idxInOld];
  32655. if (elmToMove.sel !== newStartVnode.sel) {
  32656. api.insertBefore(parentElm, createElm(newStartVnode, insertedVnodeQueue), oldStartVnode.elm);
  32657. }
  32658. else {
  32659. patchVnode(elmToMove, newStartVnode, insertedVnodeQueue);
  32660. oldCh[idxInOld] = undefined;
  32661. api.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm);
  32662. }
  32663. newStartVnode = newCh[++newStartIdx];
  32664. }
  32665. }
  32666. }
  32667. if (oldStartIdx > oldEndIdx) {
  32668. before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].elm;
  32669. addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  32670. }
  32671. else if (newStartIdx > newEndIdx) {
  32672. removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
  32673. }
  32674. }
  32675. function patchVnode(oldVnode, vnode, insertedVnodeQueue) {
  32676. var i, hook;
  32677. if (isDef(i = vnode.data) && isDef(hook = i.hook) && isDef(i = hook.prepatch)) {
  32678. i(oldVnode, vnode);
  32679. }
  32680. var elm = vnode.elm = oldVnode.elm;
  32681. var oldCh = oldVnode.children;
  32682. var ch = vnode.children;
  32683. if (oldVnode === vnode)
  32684. return;
  32685. if (vnode.data !== undefined) {
  32686. for (i = 0; i < cbs.update.length; ++i)
  32687. cbs.update[i](oldVnode, vnode);
  32688. i = vnode.data.hook;
  32689. if (isDef(i) && isDef(i = i.update))
  32690. i(oldVnode, vnode);
  32691. }
  32692. if (isUndef(vnode.text)) {
  32693. if (isDef(oldCh) && isDef(ch)) {
  32694. if (oldCh !== ch)
  32695. updateChildren(elm, oldCh, ch, insertedVnodeQueue);
  32696. }
  32697. else if (isDef(ch)) {
  32698. if (isDef(oldVnode.text))
  32699. api.setTextContent(elm, '');
  32700. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  32701. }
  32702. else if (isDef(oldCh)) {
  32703. removeVnodes(elm, oldCh, 0, oldCh.length - 1);
  32704. }
  32705. else if (isDef(oldVnode.text)) {
  32706. api.setTextContent(elm, '');
  32707. }
  32708. }
  32709. else if (oldVnode.text !== vnode.text) {
  32710. api.setTextContent(elm, vnode.text);
  32711. }
  32712. if (isDef(hook) && isDef(i = hook.postpatch)) {
  32713. i(oldVnode, vnode);
  32714. }
  32715. }
  32716. return function patch(oldVnode, vnode) {
  32717. var i, elm, parent;
  32718. var insertedVnodeQueue = [];
  32719. for (i = 0; i < cbs.pre.length; ++i)
  32720. cbs.pre[i]();
  32721. if (!isVnode(oldVnode)) {
  32722. oldVnode = emptyNodeAt(oldVnode);
  32723. }
  32724. if (sameVnode(oldVnode, vnode)) {
  32725. patchVnode(oldVnode, vnode, insertedVnodeQueue);
  32726. }
  32727. else {
  32728. elm = oldVnode.elm;
  32729. parent = api.parentNode(elm);
  32730. createElm(vnode, insertedVnodeQueue);
  32731. if (parent !== null) {
  32732. api.insertBefore(parent, vnode.elm, api.nextSibling(elm));
  32733. removeVnodes(parent, [oldVnode], 0, 0);
  32734. }
  32735. }
  32736. for (i = 0; i < insertedVnodeQueue.length; ++i) {
  32737. insertedVnodeQueue[i].data.hook.insert(insertedVnodeQueue[i]);
  32738. }
  32739. for (i = 0; i < cbs.post.length; ++i)
  32740. cbs.post[i]();
  32741. return vnode;
  32742. };
  32743. }
  32744. exports.init = init;
  32745. },{"./h":1,"./htmldomapi":2,"./is":3,"./thunk":5,"./vnode":6}],5:[function(require,module,exports){
  32746. "use strict";
  32747. Object.defineProperty(exports, "__esModule", { value: true });
  32748. var h_1 = require("./h");
  32749. function copyToThunk(vnode, thunk) {
  32750. thunk.elm = vnode.elm;
  32751. vnode.data.fn = thunk.data.fn;
  32752. vnode.data.args = thunk.data.args;
  32753. thunk.data = vnode.data;
  32754. thunk.children = vnode.children;
  32755. thunk.text = vnode.text;
  32756. thunk.elm = vnode.elm;
  32757. }
  32758. function init(thunk) {
  32759. var cur = thunk.data;
  32760. var vnode = cur.fn.apply(undefined, cur.args);
  32761. copyToThunk(vnode, thunk);
  32762. }
  32763. function prepatch(oldVnode, thunk) {
  32764. var i, old = oldVnode.data, cur = thunk.data;
  32765. var oldArgs = old.args, args = cur.args;
  32766. if (old.fn !== cur.fn || oldArgs.length !== args.length) {
  32767. copyToThunk(cur.fn.apply(undefined, args), thunk);
  32768. return;
  32769. }
  32770. for (i = 0; i < args.length; ++i) {
  32771. if (oldArgs[i] !== args[i]) {
  32772. copyToThunk(cur.fn.apply(undefined, args), thunk);
  32773. return;
  32774. }
  32775. }
  32776. copyToThunk(oldVnode, thunk);
  32777. }
  32778. exports.thunk = function thunk(sel, key, fn, args) {
  32779. if (args === undefined) {
  32780. args = fn;
  32781. fn = key;
  32782. key = undefined;
  32783. }
  32784. return h_1.h(sel, {
  32785. key: key,
  32786. hook: { init: init, prepatch: prepatch },
  32787. fn: fn,
  32788. args: args
  32789. });
  32790. };
  32791. exports.default = exports.thunk;
  32792. },{"./h":1}],6:[function(require,module,exports){
  32793. "use strict";
  32794. Object.defineProperty(exports, "__esModule", { value: true });
  32795. function vnode(sel, data, children, text, elm) {
  32796. var key = data === undefined ? undefined : data.key;
  32797. return { sel: sel, data: data, children: children,
  32798. text: text, elm: elm, key: key };
  32799. }
  32800. exports.vnode = vnode;
  32801. exports.default = vnode;
  32802. },{}]},{},[4])(4)
  32803. });
  32804. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy8ucmVnaXN0cnkubnBtanMub3JnL2Jyb3dzZXItcGFjay82LjAuMi9ub2RlX21vZHVsZXMvYnJvd3Nlci1wYWNrL19wcmVsdWRlLmpzIiwiaC5qcyIsImh0bWxkb21hcGkuanMiLCJpcy5qcyIsInNuYWJiZG9tLmpzIiwidGh1bmsuanMiLCJ2bm9kZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQ0FBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FDMURBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUNqRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUNQQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUNsVEE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUM5Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJmaWxlIjoiZ2VuZXJhdGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXNDb250ZW50IjpbIihmdW5jdGlvbiBlKHQsbixyKXtmdW5jdGlvbiBzKG8sdSl7aWYoIW5bb10pe2lmKCF0W29dKXt2YXIgYT10eXBlb2YgcmVxdWlyZT09XCJmdW5jdGlvblwiJiZyZXF1aXJlO2lmKCF1JiZhKXJldHVybiBhKG8sITApO2lmKGkpcmV0dXJuIGkobywhMCk7dmFyIGY9bmV3IEVycm9yKFwiQ2Fubm90IGZpbmQgbW9kdWxlICdcIitvK1wiJ1wiKTt0aHJvdyBmLmNvZGU9XCJNT0RVTEVfTk9UX0ZPVU5EXCIsZn12YXIgbD1uW29dPXtleHBvcnRzOnt9fTt0W29dWzBdLmNhbGwobC5leHBvcnRzLGZ1bmN0aW9uKGUpe3ZhciBuPXRbb11bMV1bZV07cmV0dXJuIHMobj9uOmUpfSxsLGwuZXhwb3J0cyxlLHQsbixyKX1yZXR1cm4gbltvXS5leHBvcnRzfXZhciBpPXR5cGVvZiByZXF1aXJlPT1cImZ1bmN0aW9uXCImJnJlcXVpcmU7Zm9yKHZhciBvPTA7bzxyLmxlbmd0aDtvKyspcyhyW29dKTtyZXR1cm4gc30pIiwiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6IHRydWUgfSk7XG52YXIgdm5vZGVfMSA9IHJlcXVpcmUoXCIuL3Zub2RlXCIpO1xudmFyIGlzID0gcmVxdWlyZShcIi4vaXNcIik7XG5mdW5jdGlvbiBhZGROUyhkYXRhLCBjaGlsZHJlbiwgc2VsKSB7XG4gICAgZGF0YS5ucyA9ICdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2Zyc7XG4gICAgaWYgKHNlbCAhPT0gJ2ZvcmVpZ25PYmplY3QnICYmIGNoaWxkcmVuICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGlsZHJlbi5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgdmFyIGNoaWxkRGF0YSA9IGNoaWxkcmVuW2ldLmRhdGE7XG4gICAgICAgICAgICBpZiAoY2hpbGREYXRhICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICBhZGROUyhjaGlsZERhdGEsIGNoaWxkcmVuW2ldLmNoaWxkcmVuLCBjaGlsZHJlbltpXS5zZWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufVxuZnVuY3Rpb24gaChzZWwsIGIsIGMpIHtcbiAgICB2YXIgZGF0YSA9IHt9LCBjaGlsZHJlbiwgdGV4dCwgaTtcbiAgICBpZiAoYyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGRhdGEgPSBiO1xuICAgICAgICBpZiAoaXMuYXJyYXkoYykpIHtcbiAgICAgICAgICAgIGNoaWxkcmVuID0gYztcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChpcy5wcmltaXRpdmUoYykpIHtcbiAgICAgICAgICAgIHRleHQgPSBjO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGMgJiYgYy5zZWwpIHtcbiAgICAgICAgICAgIGNoaWxkcmVuID0gW2NdO1xuICAgICAgICB9XG4gICAgfVxuICAgIGVsc2UgaWYgKGIgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAoaXMuYXJyYXkoYikpIHtcbiAgICAgICAgICAgIGNoaWxkcmVuID0gYjtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChpcy5wcmltaXRpdmUoYikpIHtcbiAgICAgICAgICAgIHRleHQgPSBiO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGIgJiYgYi5zZWwpIHtcbiAgICAgICAgICAgIGNoaWxkcmVuID0gW2JdO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgZGF0YSA9IGI7XG4gICAgICAgIH1cbiAgICB9XG4gICAgaWYgKGlzLmFycmF5KGNoaWxkcmVuKSkge1xuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY2hpbGRyZW4ubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgICAgIGlmIChpcy5wcmltaXRpdmUoY2hpbGRyZW5baV0pKVxuICAgICAgICAgICAgICAgIGNoaWxkcmVuW2ldID0gdm5vZGVfMS52bm9kZSh1bmRlZmluZWQsIHVuZGVmaW5lZCwgdW5kZWZpbmVkLCBjaGlsZHJlbltpXSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgaWYgKHNlbFswXSA9PT0gJ3MnICYmIHNlbFsxXSA9PT0gJ3YnICYmIHNlbFsyXSA9PT0gJ2cnICYmXG4gICAgICAgIChzZWwubGVuZ3RoID09PSAzIHx8IHNlbFszXSA9PT0gJy4nIHx8IHNlbFszXSA9PT0gJyMnKSkge1xuICAgICAgICBhZGROUyhkYXRhLCBjaGlsZHJlbiwgc2VsKTtcbiAgICB9XG4gICAgcmV0dXJuIHZub2RlXzEudm5vZGUoc2VsLCBkYXRhLCBjaGlsZHJlbiwgdGV4dCwgdW5kZWZpbmVkKTtcbn1cbmV4cG9ydHMuaCA9IGg7XG47XG5leHBvcnRzLmRlZmF1bHQgPSBoO1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9aC5qcy5tYXAiLCJcInVzZSBzdHJpY3RcIjtcbk9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBcIl9fZXNNb2R1bGVcIiwgeyB2YWx1ZTogdHJ1ZSB9KTtcbmZ1bmN0aW9uIGNyZWF0ZUVsZW1lbnQodGFnTmFtZSkge1xuICAgIHJldHVybiBkb2N1bWVudC5jcmVhdGVFbGVtZW50KHRhZ05hbWUpO1xufVxuZnVuY3Rpb24gY3JlYXRlRWxlbWVudE5TKG5hbWVzcGFjZVVSSSwgcXVhbGlmaWVkTmFtZSkge1xuICAgIHJldHVybiBkb2N1bWVudC5jcmVhdGVFbGVtZW50TlMobmFtZXNwYWNlVVJJLCBxdWFsaWZpZWROYW1lKTtcbn1cbmZ1bmN0aW9uIGNyZWF0ZVRleHROb2RlKHRleHQpIHtcbiAgICByZXR1cm4gZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUodGV4dCk7XG59XG5mdW5jdGlvbiBjcmVhdGVDb21tZW50KHRleHQpIHtcbiAgICByZXR1cm4gZG9jdW1lbnQuY3JlYXRlQ29tbWVudCh0ZXh0KTtcbn1cbmZ1bmN0aW9uIGluc2VydEJlZm9yZShwYXJlbnROb2RlLCBuZXdOb2RlLCByZWZlcmVuY2VOb2RlKSB7XG4gICAgcGFyZW50Tm9kZS5pbnNlcnRCZWZvcmUobmV3Tm9kZSwgcmVmZXJlbmNlTm9kZSk7XG59XG5mdW5jdGlvbiByZW1vdmVDaGlsZChub2RlLCBjaGlsZCkge1xuICAgIG5vZGUucmVtb3ZlQ2hpbGQoY2hpbGQpO1xufVxuZnVuY3Rpb24gYXBwZW5kQ2hpbGQobm9kZSwgY2hpbGQpIHtcbiAgICBub2RlLmFwcGVuZENoaWxkKGNoaWxkKTtcbn1cbmZ1bmN0aW9uIHBhcmVudE5vZGUobm9kZSkge1xuICAgIHJldHVybiBub2RlLnBhcmVudE5vZGU7XG59XG5mdW5jdGlvbiBuZXh0U2libGluZyhub2RlKSB7XG4gICAgcmV0dXJuIG5vZGUubmV4dFNpYmxpbmc7XG59XG5mdW5jdGlvbiB0YWdOYW1lKGVsbSkge1xuICAgIHJldHVybiBlbG0udGFnTmFtZTtcbn1cbmZ1bmN0aW9uIHNldFRleHRDb250ZW50KG5vZGUsIHRleHQpIHtcbiAgICBub2RlLnRleHRDb250ZW50ID0gdGV4dDtcbn1cbmZ1bmN0aW9uIGdldFRleHRDb250ZW50KG5vZGUpIHtcbiAgICByZXR1cm4gbm9kZS50ZXh0Q29udGVudDtcbn1cbmZ1bmN0aW9uIGlzRWxlbWVudChub2RlKSB7XG4gICAgcmV0dXJuIG5vZGUubm9kZVR5cGUgPT09IDE7XG59XG5mdW5jdGlvbiBpc1RleHQobm9kZSkge1xuICAgIHJldHVybiBub2RlLm5vZGVUeXBlID09PSAzO1xufVxuZnVuY3Rpb24gaXNDb21tZW50KG5vZGUpIHtcbiAgICByZXR1cm4gbm9kZS5ub2RlVHlwZSA9PT0gODtcbn1cbmV4cG9ydHMuaHRtbERvbUFwaSA9IHtcbiAgICBjcmVhdGVFbGVtZW50OiBjcmVhdGVFbGVtZW50LFxuICAgIGNyZWF0ZUVsZW1lbnROUzogY3JlYXRlRWxlbWVudE5TLFxuICAgIGNyZWF0ZVRleHROb2RlOiBjcmVhdGVUZXh0Tm9kZSxcbiAgICBjcmVhdGVDb21tZW50OiBjcmVhdGVDb21tZW50LFxuICAgIGluc2VydEJlZm9yZTogaW5zZXJ0QmVmb3JlLFxuICAgIHJlbW92ZUNoaWxkOiByZW1vdmVDaGlsZCxcbiAgICBhcHBlbmRDaGlsZDogYXBwZW5kQ2hpbGQsXG4gICAgcGFyZW50Tm9kZTogcGFyZW50Tm9kZSxcbiAgICBuZXh0U2libGluZzogbmV4dFNpYmxpbmcsXG4gICAgdGFnTmFtZTogdGFnTmFtZSxcbiAgICBzZXRUZXh0Q29udGVudDogc2V0VGV4dENvbnRlbnQsXG4gICAgZ2V0VGV4dENvbnRlbnQ6IGdldFRleHRDb250ZW50LFxuICAgIGlzRWxlbWVudDogaXNFbGVtZW50LFxuICAgIGlzVGV4dDogaXNUZXh0LFxuICAgIGlzQ29tbWVudDogaXNDb21tZW50LFxufTtcbmV4cG9ydHMuZGVmYXVsdCA9IGV4cG9ydHMuaHRtbERvbUFwaTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWh0bWxkb21hcGkuanMubWFwIiwiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6IHRydWUgfSk7XG5leHBvcnRzLmFycmF5ID0gQXJyYXkuaXNBcnJheTtcbmZ1bmN0aW9uIHByaW1pdGl2ZShzKSB7XG4gICAgcmV0dXJuIHR5cGVvZiBzID09PSAnc3RyaW5nJyB8fCB0eXBlb2YgcyA9PT0gJ251bWJlcic7XG59XG5leHBvcnRzLnByaW1pdGl2ZSA9IHByaW1pdGl2ZTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWlzLmpzLm1hcCIsIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiB0cnVlIH0pO1xudmFyIHZub2RlXzEgPSByZXF1aXJlKFwiLi92bm9kZVwiKTtcbnZhciBpcyA9IHJlcXVpcmUoXCIuL2lzXCIpO1xudmFyIGh0bWxkb21hcGlfMSA9IHJlcXVpcmUoXCIuL2h0bWxkb21hcGlcIik7XG5mdW5jdGlvbiBpc1VuZGVmKHMpIHsgcmV0dXJuIHMgPT09IHVuZGVmaW5lZDsgfVxuZnVuY3Rpb24gaXNEZWYocykgeyByZXR1cm4gcyAhPT0gdW5kZWZpbmVkOyB9XG52YXIgZW1wdHlOb2RlID0gdm5vZGVfMS5kZWZhdWx0KCcnLCB7fSwgW10sIHVuZGVmaW5lZCwgdW5kZWZpbmVkKTtcbmZ1bmN0aW9uIHNhbWVWbm9kZSh2bm9kZTEsIHZub2RlMikge1xuICAgIHJldHVybiB2bm9kZTEua2V5ID09PSB2bm9kZTIua2V5ICYmIHZub2RlMS5zZWwgPT09IHZub2RlMi5zZWw7XG59XG5mdW5jdGlvbiBpc1Zub2RlKHZub2RlKSB7XG4gICAgcmV0dXJuIHZub2RlLnNlbCAhPT0gdW5kZWZpbmVkO1xufVxuZnVuY3Rpb24gY3JlYXRlS2V5VG9PbGRJZHgoY2hpbGRyZW4sIGJlZ2luSWR4LCBlbmRJZHgpIHtcbiAgICB2YXIgaSwgbWFwID0ge30sIGtleSwgY2g7XG4gICAgZm9yIChpID0gYmVnaW5JZHg7IGkgPD0gZW5kSWR4OyArK2kpIHtcbiAgICAgICAgY2ggPSBjaGlsZHJlbltpXTtcbiAgICAgICAgaWYgKGNoICE9IG51bGwpIHtcbiAgICAgICAgICAgIGtleSA9IGNoLmtleTtcbiAgICAgICAgICAgIGlmIChrZXkgIT09IHVuZGVmaW5lZClcbiAgICAgICAgICAgICAgICBtYXBba2V5XSA9IGk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIG1hcDtcbn1cbnZhciBob29rcyA9IFsnY3JlYXRlJywgJ3VwZGF0ZScsICdyZW1vdmUnLCAnZGVzdHJveScsICdwcmUnLCAncG9zdCddO1xudmFyIGhfMSA9IHJlcXVpcmUoXCIuL2hcIik7XG5leHBvcnRzLmggPSBoXzEuaDtcbnZhciB0aHVua18xID0gcmVxdWlyZShcIi4vdGh1bmtcIik7XG5leHBvcnRzLnRodW5rID0gdGh1bmtfMS50aHVuaztcbmZ1bmN0aW9uIGluaXQobW9kdWxlcywgZG9tQXBpKSB7XG4gICAgdmFyIGksIGosIGNicyA9IHt9O1xuICAgIHZhciBhcGkgPSBkb21BcGkgIT09IHVuZGVmaW5lZCA/IGRvbUFwaSA6IGh0bWxkb21hcGlfMS5kZWZhdWx0O1xuICAgIGZvciAoaSA9IDA7IGkgPCBob29rcy5sZW5ndGg7ICsraSkge1xuICAgICAgICBjYnNbaG9va3NbaV1dID0gW107XG4gICAgICAgIGZvciAoaiA9IDA7IGogPCBtb2R1bGVzLmxlbmd0aDsgKytqKSB7XG4gICAgICAgICAgICB2YXIgaG9vayA9IG1vZHVsZXNbal1baG9va3NbaV1dO1xuICAgICAgICAgICAgaWYgKGhvb2sgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIGNic1tob29rc1tpXV0ucHVzaChob29rKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiBlbXB0eU5vZGVBdChlbG0pIHtcbiAgICAgICAgdmFyIGlkID0gZWxtLmlkID8gJyMnICsgZWxtLmlkIDogJyc7XG4gICAgICAgIHZhciBjID0gZWxtLmNsYXNzTmFtZSA/ICcuJyArIGVsbS5jbGFzc05hbWUuc3BsaXQoJyAnKS5qb2luKCcuJykgOiAnJztcbiAgICAgICAgcmV0dXJuIHZub2RlXzEuZGVmYXVsdChhcGkudGFnTmFtZShlbG0pLnRvTG93ZXJDYXNlKCkgKyBpZCArIGMsIHt9LCBbXSwgdW5kZWZpbmVkLCBlbG0pO1xuICAgIH1cbiAgICBmdW5jdGlvbiBjcmVhdGVSbUNiKGNoaWxkRWxtLCBsaXN0ZW5lcnMpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIHJtQ2IoKSB7XG4gICAgICAgICAgICBpZiAoLS1saXN0ZW5lcnMgPT09IDApIHtcbiAgICAgICAgICAgICAgICB2YXIgcGFyZW50XzEgPSBhcGkucGFyZW50Tm9kZShjaGlsZEVsbSk7XG4gICAgICAgICAgICAgICAgYXBpLnJlbW92ZUNoaWxkKHBhcmVudF8xLCBjaGlsZEVsbSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgfVxuICAgIGZ1bmN0aW9uIGNyZWF0ZUVsbSh2bm9kZSwgaW5zZXJ0ZWRWbm9kZVF1ZXVlKSB7XG4gICAgICAgIHZhciBpLCBkYXRhID0gdm5vZGUuZGF0YTtcbiAgICAgICAgaWYgKGRhdGEgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgaWYgKGlzRGVmKGkgPSBkYXRhLmhvb2spICYmIGlzRGVmKGkgPSBpLmluaXQpKSB7XG4gICAgICAgICAgICAgICAgaSh2bm9kZSk7XG4gICAgICAgICAgICAgICAgZGF0YSA9IHZub2RlLmRhdGE7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGNoaWxkcmVuID0gdm5vZGUuY2hpbGRyZW4sIHNlbCA9IHZub2RlLnNlbDtcbiAgICAgICAgaWYgKHNlbCA9PT0gJyEnKSB7XG4gICAgICAgICAgICBpZiAoaXNVbmRlZih2bm9kZS50ZXh0KSkge1xuICAgICAgICAgICAgICAgIHZub2RlLnRleHQgPSAnJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZub2RlLmVsbSA9IGFwaS5jcmVhdGVDb21tZW50KHZub2RlLnRleHQpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHNlbCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAvLyBQYXJzZSBzZWxlY3RvclxuICAgICAgICAgICAgdmFyIGhhc2hJZHggPSBzZWwuaW5kZXhPZignIycpO1xuICAgICAgICAgICAgdmFyIGRvdElkeCA9IHNlbC5pbmRleE9mKCcuJywgaGFzaElkeCk7XG4gICAgICAgICAgICB2YXIgaGFzaCA9IGhhc2hJZHggPiAwID8gaGFzaElkeCA6IHNlbC5sZW5ndGg7XG4gICAgICAgICAgICB2YXIgZG90ID0gZG90SWR4ID4gMCA/IGRvdElkeCA6IHNlbC5sZW5ndGg7XG4gICAgICAgICAgICB2YXIgdGFnID0gaGFzaElkeCAhPT0gLTEgfHwgZG90SWR4ICE9PSAtMSA/IHNlbC5zbGljZSgwLCBNYXRoLm1pbihoYXNoLCBkb3QpKSA6IHNlbDtcbiAgICAgICAgICAgIHZhciBlbG0gPSB2bm9kZS5lbG0gPSBpc0RlZihkYXRhKSAmJiBpc0RlZihpID0gZGF0YS5ucykgPyBhcGkuY3JlYXRlRWxlbWVudE5TKGksIHRhZylcbiAgICAgICAgICAgICAgICA6IGFwaS5jcmVhdGVFbGVtZW50KHRhZyk7XG4gICAgICAgICAgICBpZiAoaGFzaCA8IGRvdClcbiAgICAgICAgICAgICAgICBlbG0uc2V0QXR0cmlidXRlKCdpZCcsIHNlbC5zbGljZShoYXNoICsgMSwgZG90KSk7XG4gICAgICAgICAgICBpZiAoZG90SWR4ID4gMClcbiAgICAgICAgICAgICAgICBlbG0uc2V0QXR0cmlidXRlKCdjbGFzcycsIHNlbC5zbGljZShkb3QgKyAxKS5yZXBsYWNlKC9cXC4vZywgJyAnKSk7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY2JzLmNyZWF0ZS5sZW5ndGg7ICsraSlcbiAgICAgICAgICAgICAgICBjYnMuY3JlYXRlW2ldKGVtcHR5Tm9kZSwgdm5vZGUpO1xuICAgICAgICAgICAgaWYgKGlzLmFycmF5KGNoaWxkcmVuKSkge1xuICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjaGlsZHJlbi5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY2ggPSBjaGlsZHJlbltpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNoICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFwaS5hcHBlbmRDaGlsZChlbG0sIGNyZWF0ZUVsbShjaCwgaW5zZXJ0ZWRWbm9kZVF1ZXVlKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChpcy5wcmltaXRpdmUodm5vZGUudGV4dCkpIHtcbiAgICAgICAgICAgICAgICBhcGkuYXBwZW5kQ2hpbGQoZWxtLCBhcGkuY3JlYXRlVGV4dE5vZGUodm5vZGUudGV4dCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaSA9IHZub2RlLmRhdGEuaG9vazsgLy8gUmV1c2UgdmFyaWFibGVcbiAgICAgICAgICAgIGlmIChpc0RlZihpKSkge1xuICAgICAgICAgICAgICAgIGlmIChpLmNyZWF0ZSlcbiAgICAgICAgICAgICAgICAgICAgaS5jcmVhdGUoZW1wdHlOb2RlLCB2bm9kZSk7XG4gICAgICAgICAgICAgICAgaWYgKGkuaW5zZXJ0KVxuICAgICAgICAgICAgICAgICAgICBpbnNlcnRlZFZub2RlUXVldWUucHVzaCh2bm9kZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB2bm9kZS5lbG0gPSBhcGkuY3JlYXRlVGV4dE5vZGUodm5vZGUudGV4dCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHZub2RlLmVsbTtcbiAgICB9XG4gICAgZnVuY3Rpb24gYWRkVm5vZGVzKHBhcmVudEVsbSwgYmVmb3JlLCB2bm9kZXMsIHN0YXJ0SWR4LCBlbmRJZHgsIGluc2VydGVkVm5vZGVRdWV1ZSkge1xuICAgICAgICBmb3IgKDsgc3RhcnRJZHggPD0gZW5kSWR4OyArK3N0YXJ0SWR4KSB7XG4gICAgICAgICAgICB2YXIgY2ggPSB2bm9kZXNbc3RhcnRJZHhdO1xuICAgICAgICAgICAgaWYgKGNoICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBhcGkuaW5zZXJ0QmVmb3JlKHBhcmVudEVsbSwgY3JlYXRlRWxtKGNoLCBpbnNlcnRlZFZub2RlUXVldWUpLCBiZWZvcmUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIGludm9rZURlc3Ryb3lIb29rKHZub2RlKSB7XG4gICAgICAgIHZhciBpLCBqLCBkYXRhID0gdm5vZGUuZGF0YTtcbiAgICAgICAgaWYgKGRhdGEgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgaWYgKGlzRGVmKGkgPSBkYXRhLmhvb2spICYmIGlzRGVmKGkgPSBpLmRlc3Ryb3kpKVxuICAgICAgICAgICAgICAgIGkodm5vZGUpO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGNicy5kZXN0cm95Lmxlbmd0aDsgKytpKVxuICAgICAgICAgICAgICAgIGNicy5kZXN0cm95W2ldKHZub2RlKTtcbiAgICAgICAgICAgIGlmICh2bm9kZS5jaGlsZHJlbiAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IHZub2RlLmNoaWxkcmVuLmxlbmd0aDsgKytqKSB7XG4gICAgICAgICAgICAgICAgICAgIGkgPSB2bm9kZS5jaGlsZHJlbltqXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgIT0gbnVsbCAmJiB0eXBlb2YgaSAhPT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW52b2tlRGVzdHJveUhvb2soaSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gcmVtb3ZlVm5vZGVzKHBhcmVudEVsbSwgdm5vZGVzLCBzdGFydElkeCwgZW5kSWR4KSB7XG4gICAgICAgIGZvciAoOyBzdGFydElkeCA8PSBlbmRJZHg7ICsrc3RhcnRJZHgpIHtcbiAgICAgICAgICAgIHZhciBpXzEgPSB2b2lkIDAsIGxpc3RlbmVycyA9IHZvaWQgMCwgcm0gPSB2b2lkIDAsIGNoID0gdm5vZGVzW3N0YXJ0SWR4XTtcbiAgICAgICAgICAgIGlmIChjaCAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzRGVmKGNoLnNlbCkpIHtcbiAgICAgICAgICAgICAgICAgICAgaW52b2tlRGVzdHJveUhvb2soY2gpO1xuICAgICAgICAgICAgICAgICAgICBsaXN0ZW5lcnMgPSBjYnMucmVtb3ZlLmxlbmd0aCArIDE7XG4gICAgICAgICAgICAgICAgICAgIHJtID0gY3JlYXRlUm1DYihjaC5lbG0sIGxpc3RlbmVycyk7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoaV8xID0gMDsgaV8xIDwgY2JzLnJlbW92ZS5sZW5ndGg7ICsraV8xKVxuICAgICAgICAgICAgICAgICAgICAgICAgY2JzLnJlbW92ZVtpXzFdKGNoLCBybSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc0RlZihpXzEgPSBjaC5kYXRhKSAmJiBpc0RlZihpXzEgPSBpXzEuaG9vaykgJiYgaXNEZWYoaV8xID0gaV8xLnJlbW92ZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlfMShjaCwgcm0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcm0oKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYXBpLnJlbW92ZUNoaWxkKHBhcmVudEVsbSwgY2guZWxtKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gdXBkYXRlQ2hpbGRyZW4ocGFyZW50RWxtLCBvbGRDaCwgbmV3Q2gsIGluc2VydGVkVm5vZGVRdWV1ZSkge1xuICAgICAgICB2YXIgb2xkU3RhcnRJZHggPSAwLCBuZXdTdGFydElkeCA9IDA7XG4gICAgICAgIHZhciBvbGRFbmRJZHggPSBvbGRDaC5sZW5ndGggLSAxO1xuICAgICAgICB2YXIgb2xkU3RhcnRWbm9kZSA9IG9sZENoWzBdO1xuICAgICAgICB2YXIgb2xkRW5kVm5vZGUgPSBvbGRDaFtvbGRFbmRJZHhdO1xuICAgICAgICB2YXIgbmV3RW5kSWR4ID0gbmV3Q2gubGVuZ3RoIC0gMTtcbiAgICAgICAgdmFyIG5ld1N0YXJ0Vm5vZGUgPSBuZXdDaFswXTtcbiAgICAgICAgdmFyIG5ld0VuZFZub2RlID0gbmV3Q2hbbmV3RW5kSWR4XTtcbiAgICAgICAgdmFyIG9sZEtleVRvSWR4O1xuICAgICAgICB2YXIgaWR4SW5PbGQ7XG4gICAgICAgIHZhciBlbG1Ub01vdmU7XG4gICAgICAgIHZhciBiZWZvcmU7XG4gICAgICAgIHdoaWxlIChvbGRTdGFydElkeCA8PSBvbGRFbmRJZHggJiYgbmV3U3RhcnRJZHggPD0gbmV3RW5kSWR4KSB7XG4gICAgICAgICAgICBpZiAob2xkU3RhcnRWbm9kZSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgb2xkU3RhcnRWbm9kZSA9IG9sZENoWysrb2xkU3RhcnRJZHhdOyAvLyBWbm9kZSBtaWdodCBoYXZlIGJlZW4gbW92ZWQgbGVmdFxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAob2xkRW5kVm5vZGUgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIG9sZEVuZFZub2RlID0gb2xkQ2hbLS1vbGRFbmRJZHhdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAobmV3U3RhcnRWbm9kZSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgbmV3U3RhcnRWbm9kZSA9IG5ld0NoWysrbmV3U3RhcnRJZHhdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAobmV3RW5kVm5vZGUgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIG5ld0VuZFZub2RlID0gbmV3Q2hbLS1uZXdFbmRJZHhdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoc2FtZVZub2RlKG9sZFN0YXJ0Vm5vZGUsIG5ld1N0YXJ0Vm5vZGUpKSB7XG4gICAgICAgICAgICAgICAgcGF0Y2hWbm9kZShvbGRTdGFydFZub2RlLCBuZXdTdGFydFZub2RlLCBpbnNlcnRlZFZub2RlUXVldWUpO1xuICAgICAgICAgICAgICAgIG9sZFN0YXJ0Vm5vZGUgPSBvbGRDaFsrK29sZFN0YXJ0SWR4XTtcbiAgICAgICAgICAgICAgICBuZXdTdGFydFZub2RlID0gbmV3Q2hbKytuZXdTdGFydElkeF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChzYW1lVm5vZGUob2xkRW5kVm5vZGUsIG5ld0VuZFZub2RlKSkge1xuICAgICAgICAgICAgICAgIHBhdGNoVm5vZGUob2xkRW5kVm5vZGUsIG5ld0VuZFZub2RlLCBpbnNlcnRlZFZub2RlUXVldWUpO1xuICAgICAgICAgICAgICAgIG9sZEVuZFZub2RlID0gb2xkQ2hbLS1vbGRFbmRJZHhdO1xuICAgICAgICAgICAgICAgIG5ld0VuZFZub2RlID0gbmV3Q2hbLS1uZXdFbmRJZHhdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoc2FtZVZub2RlKG9sZFN0YXJ0Vm5vZGUsIG5ld0VuZFZub2RlKSkge1xuICAgICAgICAgICAgICAgIHBhdGNoVm5vZGUob2xkU3RhcnRWbm9kZSwgbmV3RW5kVm5vZGUsIGluc2VydGVkVm5vZGVRdWV1ZSk7XG4gICAgICAgICAgICAgICAgYXBpLmluc2VydEJlZm9yZShwYXJlbnRFbG0sIG9sZFN0YXJ0Vm5vZGUuZWxtLCBhcGkubmV4dFNpYmxpbmcob2xkRW5kVm5vZGUuZWxtKSk7XG4gICAgICAgICAgICAgICAgb2xkU3RhcnRWbm9kZSA9IG9sZENoWysrb2xkU3RhcnRJZHhdO1xuICAgICAgICAgICAgICAgIG5ld0VuZFZub2RlID0gbmV3Q2hbLS1uZXdFbmRJZHhdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoc2FtZVZub2RlKG9sZEVuZFZub2RlLCBuZXdTdGFydFZub2RlKSkge1xuICAgICAgICAgICAgICAgIHBhdGNoVm5vZGUob2xkRW5kVm5vZGUsIG5ld1N0YXJ0Vm5vZGUsIGluc2VydGVkVm5vZGVRdWV1ZSk7XG4gICAgICAgICAgICAgICAgYXBpLmluc2VydEJlZm9yZShwYXJlbnRFbG0sIG9sZEVuZFZub2RlLmVsbSwgb2xkU3RhcnRWbm9kZS5lbG0pO1xuICAgICAgICAgICAgICAgIG9sZEVuZFZub2RlID0gb2xkQ2hbLS1vbGRFbmRJZHhdO1xuICAgICAgICAgICAgICAgIG5ld1N0YXJ0Vm5vZGUgPSBuZXdDaFsrK25ld1N0YXJ0SWR4XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChvbGRLZXlUb0lkeCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIG9sZEtleVRvSWR4ID0gY3JlYXRlS2V5VG9PbGRJZHgob2xkQ2gsIG9sZFN0YXJ0SWR4LCBvbGRFbmRJZHgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZHhJbk9sZCA9IG9sZEtleVRvSWR4W25ld1N0YXJ0Vm5vZGUua2V5XTtcbiAgICAgICAgICAgICAgICBpZiAoaXNVbmRlZihpZHhJbk9sZCkpIHtcbiAgICAgICAgICAgICAgICAgICAgYXBpLmluc2VydEJlZm9yZShwYXJlbnRFbG0sIGNyZWF0ZUVsbShuZXdTdGFydFZub2RlLCBpbnNlcnRlZFZub2RlUXVldWUpLCBvbGRTdGFydFZub2RlLmVsbSk7XG4gICAgICAgICAgICAgICAgICAgIG5ld1N0YXJ0Vm5vZGUgPSBuZXdDaFsrK25ld1N0YXJ0SWR4XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGVsbVRvTW92ZSA9IG9sZENoW2lkeEluT2xkXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVsbVRvTW92ZS5zZWwgIT09IG5ld1N0YXJ0Vm5vZGUuc2VsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhcGkuaW5zZXJ0QmVmb3JlKHBhcmVudEVsbSwgY3JlYXRlRWxtKG5ld1N0YXJ0Vm5vZGUsIGluc2VydGVkVm5vZGVRdWV1ZSksIG9sZFN0YXJ0Vm5vZGUuZWxtKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGNoVm5vZGUoZWxtVG9Nb3ZlLCBuZXdTdGFydFZub2RlLCBpbnNlcnRlZFZub2RlUXVldWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgb2xkQ2hbaWR4SW5PbGRdID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICAgICAgYXBpLmluc2VydEJlZm9yZShwYXJlbnRFbG0sIGVsbVRvTW92ZS5lbG0sIG9sZFN0YXJ0Vm5vZGUuZWxtKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBuZXdTdGFydFZub2RlID0gbmV3Q2hbKytuZXdTdGFydElkeF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChvbGRTdGFydElkeCA+IG9sZEVuZElkeCkge1xuICAgICAgICAgICAgYmVmb3JlID0gbmV3Q2hbbmV3RW5kSWR4ICsgMV0gPT0gbnVsbCA/IG51bGwgOiBuZXdDaFtuZXdFbmRJZHggKyAxXS5lbG07XG4gICAgICAgICAgICBhZGRWbm9kZXMocGFyZW50RWxtLCBiZWZvcmUsIG5ld0NoLCBuZXdTdGFydElkeCwgbmV3RW5kSWR4LCBpbnNlcnRlZFZub2RlUXVldWUpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKG5ld1N0YXJ0SWR4ID4gbmV3RW5kSWR4KSB7XG4gICAgICAgICAgICByZW1vdmVWbm9kZXMocGFyZW50RWxtLCBvbGRDaCwgb2xkU3RhcnRJZHgsIG9sZEVuZElkeCk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gcGF0Y2hWbm9kZShvbGRWbm9kZSwgdm5vZGUsIGluc2VydGVkVm5vZGVRdWV1ZSkge1xuICAgICAgICB2YXIgaSwgaG9vaztcbiAgICAgICAgaWYgKGlzRGVmKGkgPSB2bm9kZS5kYXRhKSAmJiBpc0RlZihob29rID0gaS5ob29rKSAmJiBpc0RlZihpID0gaG9vay5wcmVwYXRjaCkpIHtcbiAgICAgICAgICAgIGkob2xkVm5vZGUsIHZub2RlKTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgZWxtID0gdm5vZGUuZWxtID0gb2xkVm5vZGUuZWxtO1xuICAgICAgICB2YXIgb2xkQ2ggPSBvbGRWbm9kZS5jaGlsZHJlbjtcbiAgICAgICAgdmFyIGNoID0gdm5vZGUuY2hpbGRyZW47XG4gICAgICAgIGlmIChvbGRWbm9kZSA9PT0gdm5vZGUpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIGlmICh2bm9kZS5kYXRhICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBjYnMudXBkYXRlLmxlbmd0aDsgKytpKVxuICAgICAgICAgICAgICAgIGNicy51cGRhdGVbaV0ob2xkVm5vZGUsIHZub2RlKTtcbiAgICAgICAgICAgIGkgPSB2bm9kZS5kYXRhLmhvb2s7XG4gICAgICAgICAgICBpZiAoaXNEZWYoaSkgJiYgaXNEZWYoaSA9IGkudXBkYXRlKSlcbiAgICAgICAgICAgICAgICBpKG9sZFZub2RlLCB2bm9kZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGlzVW5kZWYodm5vZGUudGV4dCkpIHtcbiAgICAgICAgICAgIGlmIChpc0RlZihvbGRDaCkgJiYgaXNEZWYoY2gpKSB7XG4gICAgICAgICAgICAgICAgaWYgKG9sZENoICE9PSBjaClcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlQ2hpbGRyZW4oZWxtLCBvbGRDaCwgY2gsIGluc2VydGVkVm5vZGVRdWV1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChpc0RlZihjaCkpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNEZWYob2xkVm5vZGUudGV4dCkpXG4gICAgICAgICAgICAgICAgICAgIGFwaS5zZXRUZXh0Q29udGVudChlbG0sICcnKTtcbiAgICAgICAgICAgICAgICBhZGRWbm9kZXMoZWxtLCBudWxsLCBjaCwgMCwgY2gubGVuZ3RoIC0gMSwgaW5zZXJ0ZWRWbm9kZVF1ZXVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGlzRGVmKG9sZENoKSkge1xuICAgICAgICAgICAgICAgIHJlbW92ZVZub2RlcyhlbG0sIG9sZENoLCAwLCBvbGRDaC5sZW5ndGggLSAxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGlzRGVmKG9sZFZub2RlLnRleHQpKSB7XG4gICAgICAgICAgICAgICAgYXBpLnNldFRleHRDb250ZW50KGVsbSwgJycpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKG9sZFZub2RlLnRleHQgIT09IHZub2RlLnRleHQpIHtcbiAgICAgICAgICAgIGFwaS5zZXRUZXh0Q29udGVudChlbG0sIHZub2RlLnRleHQpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc0RlZihob29rKSAmJiBpc0RlZihpID0gaG9vay5wb3N0cGF0Y2gpKSB7XG4gICAgICAgICAgICBpKG9sZFZub2RlLCB2bm9kZSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIGZ1bmN0aW9uIHBhdGNoKG9sZFZub2RlLCB2bm9kZSkge1xuICAgICAgICB2YXIgaSwgZWxtLCBwYXJlbnQ7XG4gICAgICAgIHZhciBpbnNlcnRlZFZub2RlUXVldWUgPSBbXTtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGNicy5wcmUubGVuZ3RoOyArK2kpXG4gICAgICAgICAgICBjYnMucHJlW2ldKCk7XG4gICAgICAgIGlmICghaXNWbm9kZShvbGRWbm9kZSkpIHtcbiAgICAgICAgICAgIG9sZFZub2RlID0gZW1wdHlOb2RlQXQob2xkVm5vZGUpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzYW1lVm5vZGUob2xkVm5vZGUsIHZub2RlKSkge1xuICAgICAgICAgICAgcGF0Y2hWbm9kZShvbGRWbm9kZSwgdm5vZGUsIGluc2VydGVkVm5vZGVRdWV1ZSk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBlbG0gPSBvbGRWbm9kZS5lbG07XG4gICAgICAgICAgICBwYXJlbnQgPSBhcGkucGFyZW50Tm9kZShlbG0pO1xuICAgICAgICAgICAgY3JlYXRlRWxtKHZub2RlLCBpbnNlcnRlZFZub2RlUXVldWUpO1xuICAgICAgICAgICAgaWYgKHBhcmVudCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGFwaS5pbnNlcnRCZWZvcmUocGFyZW50LCB2bm9kZS5lbG0sIGFwaS5uZXh0U2libGluZyhlbG0pKTtcbiAgICAgICAgICAgICAgICByZW1vdmVWbm9kZXMocGFyZW50LCBbb2xkVm5vZGVdLCAwLCAwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgaW5zZXJ0ZWRWbm9kZVF1ZXVlLmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICBpbnNlcnRlZFZub2RlUXVldWVbaV0uZGF0YS5ob29rLmluc2VydChpbnNlcnRlZFZub2RlUXVldWVbaV0pO1xuICAgICAgICB9XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBjYnMucG9zdC5sZW5ndGg7ICsraSlcbiAgICAgICAgICAgIGNicy5wb3N0W2ldKCk7XG4gICAgICAgIHJldHVybiB2bm9kZTtcbiAgICB9O1xufVxuZXhwb3J0cy5pbml0ID0gaW5pdDtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXNuYWJiZG9tLmpzLm1hcCIsIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiB0cnVlIH0pO1xudmFyIGhfMSA9IHJlcXVpcmUoXCIuL2hcIik7XG5mdW5jdGlvbiBjb3B5VG9UaHVuayh2bm9kZSwgdGh1bmspIHtcbiAgICB0aHVuay5lbG0gPSB2bm9kZS5lbG07XG4gICAgdm5vZGUuZGF0YS5mbiA9IHRodW5rLmRhdGEuZm47XG4gICAgdm5vZGUuZGF0YS5hcmdzID0gdGh1bmsuZGF0YS5hcmdzO1xuICAgIHRodW5rLmRhdGEgPSB2bm9kZS5kYXRhO1xuICAgIHRodW5rLmNoaWxkcmVuID0gdm5vZGUuY2hpbGRyZW47XG4gICAgdGh1bmsudGV4dCA9IHZub2RlLnRleHQ7XG4gICAgdGh1bmsuZWxtID0gdm5vZGUuZWxtO1xufVxuZnVuY3Rpb24gaW5pdCh0aHVuaykge1xuICAgIHZhciBjdXIgPSB0aHVuay5kYXRhO1xuICAgIHZhciB2bm9kZSA9IGN1ci5mbi5hcHBseSh1bmRlZmluZWQsIGN1ci5hcmdzKTtcbiAgICBjb3B5VG9UaHVuayh2bm9kZSwgdGh1bmspO1xufVxuZnVuY3Rpb24gcHJlcGF0Y2gob2xkVm5vZGUsIHRodW5rKSB7XG4gICAgdmFyIGksIG9sZCA9IG9sZFZub2RlLmRhdGEsIGN1ciA9IHRodW5rLmRhdGE7XG4gICAgdmFyIG9sZEFyZ3MgPSBvbGQuYXJncywgYXJncyA9IGN1ci5hcmdzO1xuICAgIGlmIChvbGQuZm4gIT09IGN1ci5mbiB8fCBvbGRBcmdzLmxlbmd0aCAhPT0gYXJncy5sZW5ndGgpIHtcbiAgICAgICAgY29weVRvVGh1bmsoY3VyLmZuLmFwcGx5KHVuZGVmaW5lZCwgYXJncyksIHRodW5rKTtcbiAgICAgICAgcmV0dXJuO1xuICAgIH1cbiAgICBmb3IgKGkgPSAwOyBpIDwgYXJncy5sZW5ndGg7ICsraSkge1xuICAgICAgICBpZiAob2xkQXJnc1tpXSAhPT0gYXJnc1tpXSkge1xuICAgICAgICAgICAgY29weVRvVGh1bmsoY3VyLmZuLmFwcGx5KHVuZGVmaW5lZCwgYXJncyksIHRodW5rKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgIH1cbiAgICBjb3B5VG9UaHVuayhvbGRWbm9kZSwgdGh1bmspO1xufVxuZXhwb3J0cy50aHVuayA9IGZ1bmN0aW9uIHRodW5rKHNlbCwga2V5LCBmbiwgYXJncykge1xuICAgIGlmIChhcmdzID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgYXJncyA9IGZuO1xuICAgICAgICBmbiA9IGtleTtcbiAgICAgICAga2V5ID0gdW5kZWZpbmVkO1xuICAgIH1cbiAgICByZXR1cm4gaF8xLmgoc2VsLCB7XG4gICAgICAgIGtleToga2V5LFxuICAgICAgICBob29rOiB7IGluaXQ6IGluaXQsIHByZXBhdGNoOiBwcmVwYXRjaCB9LFxuICAgICAgICBmbjogZm4sXG4gICAgICAgIGFyZ3M6IGFyZ3NcbiAgICB9KTtcbn07XG5leHBvcnRzLmRlZmF1bHQgPSBleHBvcnRzLnRodW5rO1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9dGh1bmsuanMubWFwIiwiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6IHRydWUgfSk7XG5mdW5jdGlvbiB2bm9kZShzZWwsIGRhdGEsIGNoaWxkcmVuLCB0ZXh0LCBlbG0pIHtcbiAgICB2YXIga2V5ID0gZGF0YSA9PT0gdW5kZWZpbmVkID8gdW5kZWZpbmVkIDogZGF0YS5rZXk7XG4gICAgcmV0dXJuIHsgc2VsOiBzZWwsIGRhdGE6IGRhdGEsIGNoaWxkcmVuOiBjaGlsZHJlbixcbiAgICAgICAgdGV4dDogdGV4dCwgZWxtOiBlbG0sIGtleToga2V5IH07XG59XG5leHBvcnRzLnZub2RlID0gdm5vZGU7XG5leHBvcnRzLmRlZmF1bHQgPSB2bm9kZTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXZub2RlLmpzLm1hcCJdfQ==
  32805. /***/ }),
  32806. /***/ "./node_modules/snabbdom/dist/tovnode.js":
  32807. /*!***********************************************!*\
  32808. !*** ./node_modules/snabbdom/dist/tovnode.js ***!
  32809. \***********************************************/
  32810. /*! no static exports found */
  32811. /***/ (function(module, exports, __webpack_require__) {
  32812. var require;var require;(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(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 require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  32813. "use strict";
  32814. Object.defineProperty(exports, "__esModule", { value: true });
  32815. function createElement(tagName) {
  32816. return document.createElement(tagName);
  32817. }
  32818. function createElementNS(namespaceURI, qualifiedName) {
  32819. return document.createElementNS(namespaceURI, qualifiedName);
  32820. }
  32821. function createTextNode(text) {
  32822. return document.createTextNode(text);
  32823. }
  32824. function createComment(text) {
  32825. return document.createComment(text);
  32826. }
  32827. function insertBefore(parentNode, newNode, referenceNode) {
  32828. parentNode.insertBefore(newNode, referenceNode);
  32829. }
  32830. function removeChild(node, child) {
  32831. node.removeChild(child);
  32832. }
  32833. function appendChild(node, child) {
  32834. node.appendChild(child);
  32835. }
  32836. function parentNode(node) {
  32837. return node.parentNode;
  32838. }
  32839. function nextSibling(node) {
  32840. return node.nextSibling;
  32841. }
  32842. function tagName(elm) {
  32843. return elm.tagName;
  32844. }
  32845. function setTextContent(node, text) {
  32846. node.textContent = text;
  32847. }
  32848. function getTextContent(node) {
  32849. return node.textContent;
  32850. }
  32851. function isElement(node) {
  32852. return node.nodeType === 1;
  32853. }
  32854. function isText(node) {
  32855. return node.nodeType === 3;
  32856. }
  32857. function isComment(node) {
  32858. return node.nodeType === 8;
  32859. }
  32860. exports.htmlDomApi = {
  32861. createElement: createElement,
  32862. createElementNS: createElementNS,
  32863. createTextNode: createTextNode,
  32864. createComment: createComment,
  32865. insertBefore: insertBefore,
  32866. removeChild: removeChild,
  32867. appendChild: appendChild,
  32868. parentNode: parentNode,
  32869. nextSibling: nextSibling,
  32870. tagName: tagName,
  32871. setTextContent: setTextContent,
  32872. getTextContent: getTextContent,
  32873. isElement: isElement,
  32874. isText: isText,
  32875. isComment: isComment,
  32876. };
  32877. exports.default = exports.htmlDomApi;
  32878. },{}],2:[function(require,module,exports){
  32879. "use strict";
  32880. Object.defineProperty(exports, "__esModule", { value: true });
  32881. var vnode_1 = require("./vnode");
  32882. var htmldomapi_1 = require("./htmldomapi");
  32883. function toVNode(node, domApi) {
  32884. var api = domApi !== undefined ? domApi : htmldomapi_1.default;
  32885. var text;
  32886. if (api.isElement(node)) {
  32887. var id = node.id ? '#' + node.id : '';
  32888. var cn = node.getAttribute('class');
  32889. var c = cn ? '.' + cn.split(' ').join('.') : '';
  32890. var sel = api.tagName(node).toLowerCase() + id + c;
  32891. var attrs = {};
  32892. var children = [];
  32893. var name_1;
  32894. var i = void 0, n = void 0;
  32895. var elmAttrs = node.attributes;
  32896. var elmChildren = node.childNodes;
  32897. for (i = 0, n = elmAttrs.length; i < n; i++) {
  32898. name_1 = elmAttrs[i].nodeName;
  32899. if (name_1 !== 'id' && name_1 !== 'class') {
  32900. attrs[name_1] = elmAttrs[i].nodeValue;
  32901. }
  32902. }
  32903. for (i = 0, n = elmChildren.length; i < n; i++) {
  32904. children.push(toVNode(elmChildren[i]));
  32905. }
  32906. return vnode_1.default(sel, { attrs: attrs }, children, undefined, node);
  32907. }
  32908. else if (api.isText(node)) {
  32909. text = api.getTextContent(node);
  32910. return vnode_1.default(undefined, undefined, undefined, text, node);
  32911. }
  32912. else if (api.isComment(node)) {
  32913. text = api.getTextContent(node);
  32914. return vnode_1.default('!', {}, [], text, node);
  32915. }
  32916. else {
  32917. return vnode_1.default('', {}, [], undefined, undefined);
  32918. }
  32919. }
  32920. exports.toVNode = toVNode;
  32921. exports.default = toVNode;
  32922. },{"./htmldomapi":1,"./vnode":3}],3:[function(require,module,exports){
  32923. "use strict";
  32924. Object.defineProperty(exports, "__esModule", { value: true });
  32925. function vnode(sel, data, children, text, elm) {
  32926. var key = data === undefined ? undefined : data.key;
  32927. return { sel: sel, data: data, children: children,
  32928. text: text, elm: elm, key: key };
  32929. }
  32930. exports.vnode = vnode;
  32931. exports.default = vnode;
  32932. },{}]},{},[2])(2)
  32933. });
  32934. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy8ucmVnaXN0cnkubnBtanMub3JnL2Jyb3dzZXItcGFjay82LjAuMi9ub2RlX21vZHVsZXMvYnJvd3Nlci1wYWNrL19wcmVsdWRlLmpzIiwiaHRtbGRvbWFwaS5qcyIsInRvdm5vZGUuanMiLCJ2bm9kZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQ0FBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUNqRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUMzQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJmaWxlIjoiZ2VuZXJhdGVkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXNDb250ZW50IjpbIihmdW5jdGlvbiBlKHQsbixyKXtmdW5jdGlvbiBzKG8sdSl7aWYoIW5bb10pe2lmKCF0W29dKXt2YXIgYT10eXBlb2YgcmVxdWlyZT09XCJmdW5jdGlvblwiJiZyZXF1aXJlO2lmKCF1JiZhKXJldHVybiBhKG8sITApO2lmKGkpcmV0dXJuIGkobywhMCk7dmFyIGY9bmV3IEVycm9yKFwiQ2Fubm90IGZpbmQgbW9kdWxlICdcIitvK1wiJ1wiKTt0aHJvdyBmLmNvZGU9XCJNT0RVTEVfTk9UX0ZPVU5EXCIsZn12YXIgbD1uW29dPXtleHBvcnRzOnt9fTt0W29dWzBdLmNhbGwobC5leHBvcnRzLGZ1bmN0aW9uKGUpe3ZhciBuPXRbb11bMV1bZV07cmV0dXJuIHMobj9uOmUpfSxsLGwuZXhwb3J0cyxlLHQsbixyKX1yZXR1cm4gbltvXS5leHBvcnRzfXZhciBpPXR5cGVvZiByZXF1aXJlPT1cImZ1bmN0aW9uXCImJnJlcXVpcmU7Zm9yKHZhciBvPTA7bzxyLmxlbmd0aDtvKyspcyhyW29dKTtyZXR1cm4gc30pIiwiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6IHRydWUgfSk7XG5mdW5jdGlvbiBjcmVhdGVFbGVtZW50KHRhZ05hbWUpIHtcbiAgICByZXR1cm4gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCh0YWdOYW1lKTtcbn1cbmZ1bmN0aW9uIGNyZWF0ZUVsZW1lbnROUyhuYW1lc3BhY2VVUkksIHF1YWxpZmllZE5hbWUpIHtcbiAgICByZXR1cm4gZG9jdW1lbnQuY3JlYXRlRWxlbWVudE5TKG5hbWVzcGFjZVVSSSwgcXVhbGlmaWVkTmFtZSk7XG59XG5mdW5jdGlvbiBjcmVhdGVUZXh0Tm9kZSh0ZXh0KSB7XG4gICAgcmV0dXJuIGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKHRleHQpO1xufVxuZnVuY3Rpb24gY3JlYXRlQ29tbWVudCh0ZXh0KSB7XG4gICAgcmV0dXJuIGRvY3VtZW50LmNyZWF0ZUNvbW1lbnQodGV4dCk7XG59XG5mdW5jdGlvbiBpbnNlcnRCZWZvcmUocGFyZW50Tm9kZSwgbmV3Tm9kZSwgcmVmZXJlbmNlTm9kZSkge1xuICAgIHBhcmVudE5vZGUuaW5zZXJ0QmVmb3JlKG5ld05vZGUsIHJlZmVyZW5jZU5vZGUpO1xufVxuZnVuY3Rpb24gcmVtb3ZlQ2hpbGQobm9kZSwgY2hpbGQpIHtcbiAgICBub2RlLnJlbW92ZUNoaWxkKGNoaWxkKTtcbn1cbmZ1bmN0aW9uIGFwcGVuZENoaWxkKG5vZGUsIGNoaWxkKSB7XG4gICAgbm9kZS5hcHBlbmRDaGlsZChjaGlsZCk7XG59XG5mdW5jdGlvbiBwYXJlbnROb2RlKG5vZGUpIHtcbiAgICByZXR1cm4gbm9kZS5wYXJlbnROb2RlO1xufVxuZnVuY3Rpb24gbmV4dFNpYmxpbmcobm9kZSkge1xuICAgIHJldHVybiBub2RlLm5leHRTaWJsaW5nO1xufVxuZnVuY3Rpb24gdGFnTmFtZShlbG0pIHtcbiAgICByZXR1cm4gZWxtLnRhZ05hbWU7XG59XG5mdW5jdGlvbiBzZXRUZXh0Q29udGVudChub2RlLCB0ZXh0KSB7XG4gICAgbm9kZS50ZXh0Q29udGVudCA9IHRleHQ7XG59XG5mdW5jdGlvbiBnZXRUZXh0Q29udGVudChub2RlKSB7XG4gICAgcmV0dXJuIG5vZGUudGV4dENvbnRlbnQ7XG59XG5mdW5jdGlvbiBpc0VsZW1lbnQobm9kZSkge1xuICAgIHJldHVybiBub2RlLm5vZGVUeXBlID09PSAxO1xufVxuZnVuY3Rpb24gaXNUZXh0KG5vZGUpIHtcbiAgICByZXR1cm4gbm9kZS5ub2RlVHlwZSA9PT0gMztcbn1cbmZ1bmN0aW9uIGlzQ29tbWVudChub2RlKSB7XG4gICAgcmV0dXJuIG5vZGUubm9kZVR5cGUgPT09IDg7XG59XG5leHBvcnRzLmh0bWxEb21BcGkgPSB7XG4gICAgY3JlYXRlRWxlbWVudDogY3JlYXRlRWxlbWVudCxcbiAgICBjcmVhdGVFbGVtZW50TlM6IGNyZWF0ZUVsZW1lbnROUyxcbiAgICBjcmVhdGVUZXh0Tm9kZTogY3JlYXRlVGV4dE5vZGUsXG4gICAgY3JlYXRlQ29tbWVudDogY3JlYXRlQ29tbWVudCxcbiAgICBpbnNlcnRCZWZvcmU6IGluc2VydEJlZm9yZSxcbiAgICByZW1vdmVDaGlsZDogcmVtb3ZlQ2hpbGQsXG4gICAgYXBwZW5kQ2hpbGQ6IGFwcGVuZENoaWxkLFxuICAgIHBhcmVudE5vZGU6IHBhcmVudE5vZGUsXG4gICAgbmV4dFNpYmxpbmc6IG5leHRTaWJsaW5nLFxuICAgIHRhZ05hbWU6IHRhZ05hbWUsXG4gICAgc2V0VGV4dENvbnRlbnQ6IHNldFRleHRDb250ZW50LFxuICAgIGdldFRleHRDb250ZW50OiBnZXRUZXh0Q29udGVudCxcbiAgICBpc0VsZW1lbnQ6IGlzRWxlbWVudCxcbiAgICBpc1RleHQ6IGlzVGV4dCxcbiAgICBpc0NvbW1lbnQ6IGlzQ29tbWVudCxcbn07XG5leHBvcnRzLmRlZmF1bHQgPSBleHBvcnRzLmh0bWxEb21BcGk7XG4vLyMgc291cmNlTWFwcGluZ1VSTD1odG1sZG9tYXBpLmpzLm1hcCIsIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiB0cnVlIH0pO1xudmFyIHZub2RlXzEgPSByZXF1aXJlKFwiLi92bm9kZVwiKTtcbnZhciBodG1sZG9tYXBpXzEgPSByZXF1aXJlKFwiLi9odG1sZG9tYXBpXCIpO1xuZnVuY3Rpb24gdG9WTm9kZShub2RlLCBkb21BcGkpIHtcbiAgICB2YXIgYXBpID0gZG9tQXBpICE9PSB1bmRlZmluZWQgPyBkb21BcGkgOiBodG1sZG9tYXBpXzEuZGVmYXVsdDtcbiAgICB2YXIgdGV4dDtcbiAgICBpZiAoYXBpLmlzRWxlbWVudChub2RlKSkge1xuICAgICAgICB2YXIgaWQgPSBub2RlLmlkID8gJyMnICsgbm9kZS5pZCA6ICcnO1xuICAgICAgICB2YXIgY24gPSBub2RlLmdldEF0dHJpYnV0ZSgnY2xhc3MnKTtcbiAgICAgICAgdmFyIGMgPSBjbiA/ICcuJyArIGNuLnNwbGl0KCcgJykuam9pbignLicpIDogJyc7XG4gICAgICAgIHZhciBzZWwgPSBhcGkudGFnTmFtZShub2RlKS50b0xvd2VyQ2FzZSgpICsgaWQgKyBjO1xuICAgICAgICB2YXIgYXR0cnMgPSB7fTtcbiAgICAgICAgdmFyIGNoaWxkcmVuID0gW107XG4gICAgICAgIHZhciBuYW1lXzE7XG4gICAgICAgIHZhciBpID0gdm9pZCAwLCBuID0gdm9pZCAwO1xuICAgICAgICB2YXIgZWxtQXR0cnMgPSBub2RlLmF0dHJpYnV0ZXM7XG4gICAgICAgIHZhciBlbG1DaGlsZHJlbiA9IG5vZGUuY2hpbGROb2RlcztcbiAgICAgICAgZm9yIChpID0gMCwgbiA9IGVsbUF0dHJzLmxlbmd0aDsgaSA8IG47IGkrKykge1xuICAgICAgICAgICAgbmFtZV8xID0gZWxtQXR0cnNbaV0ubm9kZU5hbWU7XG4gICAgICAgICAgICBpZiAobmFtZV8xICE9PSAnaWQnICYmIG5hbWVfMSAhPT0gJ2NsYXNzJykge1xuICAgICAgICAgICAgICAgIGF0dHJzW25hbWVfMV0gPSBlbG1BdHRyc1tpXS5ub2RlVmFsdWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChpID0gMCwgbiA9IGVsbUNoaWxkcmVuLmxlbmd0aDsgaSA8IG47IGkrKykge1xuICAgICAgICAgICAgY2hpbGRyZW4ucHVzaCh0b1ZOb2RlKGVsbUNoaWxkcmVuW2ldKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHZub2RlXzEuZGVmYXVsdChzZWwsIHsgYXR0cnM6IGF0dHJzIH0sIGNoaWxkcmVuLCB1bmRlZmluZWQsIG5vZGUpO1xuICAgIH1cbiAgICBlbHNlIGlmIChhcGkuaXNUZXh0KG5vZGUpKSB7XG4gICAgICAgIHRleHQgPSBhcGkuZ2V0VGV4dENvbnRlbnQobm9kZSk7XG4gICAgICAgIHJldHVybiB2bm9kZV8xLmRlZmF1bHQodW5kZWZpbmVkLCB1bmRlZmluZWQsIHVuZGVmaW5lZCwgdGV4dCwgbm9kZSk7XG4gICAgfVxuICAgIGVsc2UgaWYgKGFwaS5pc0NvbW1lbnQobm9kZSkpIHtcbiAgICAgICAgdGV4dCA9IGFwaS5nZXRUZXh0Q29udGVudChub2RlKTtcbiAgICAgICAgcmV0dXJuIHZub2RlXzEuZGVmYXVsdCgnIScsIHt9LCBbXSwgdGV4dCwgbm9kZSk7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICByZXR1cm4gdm5vZGVfMS5kZWZhdWx0KCcnLCB7fSwgW10sIHVuZGVmaW5lZCwgdW5kZWZpbmVkKTtcbiAgICB9XG59XG5leHBvcnRzLnRvVk5vZGUgPSB0b1ZOb2RlO1xuZXhwb3J0cy5kZWZhdWx0ID0gdG9WTm9kZTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXRvdm5vZGUuanMubWFwIiwiXCJ1c2Ugc3RyaWN0XCI7XG5PYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgXCJfX2VzTW9kdWxlXCIsIHsgdmFsdWU6IHRydWUgfSk7XG5mdW5jdGlvbiB2bm9kZShzZWwsIGRhdGEsIGNoaWxkcmVuLCB0ZXh0LCBlbG0pIHtcbiAgICB2YXIga2V5ID0gZGF0YSA9PT0gdW5kZWZpbmVkID8gdW5kZWZpbmVkIDogZGF0YS5rZXk7XG4gICAgcmV0dXJuIHsgc2VsOiBzZWwsIGRhdGE6IGRhdGEsIGNoaWxkcmVuOiBjaGlsZHJlbixcbiAgICAgICAgdGV4dDogdGV4dCwgZWxtOiBlbG0sIGtleToga2V5IH07XG59XG5leHBvcnRzLnZub2RlID0gdm5vZGU7XG5leHBvcnRzLmRlZmF1bHQgPSB2bm9kZTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXZub2RlLmpzLm1hcCJdfQ==
  32935. /***/ }),
  32936. /***/ "./node_modules/strophe.js/dist/strophe.js":
  32937. /*!*************************************************!*\
  32938. !*** ./node_modules/strophe.js/dist/strophe.js ***!
  32939. \*************************************************/
  32940. /*! no static exports found */
  32941. /***/ (function(module, exports, __webpack_require__) {
  32942. (function webpackUniversalModuleDefinition(root, factory) {
  32943. if(true)
  32944. module.exports = factory();
  32945. else {}
  32946. })(window, function() {
  32947. return /******/ (function(modules) { // webpackBootstrap
  32948. /******/ // The module cache
  32949. /******/ var installedModules = {};
  32950. /******/
  32951. /******/ // The require function
  32952. /******/ function __webpack_require__(moduleId) {
  32953. /******/
  32954. /******/ // Check if module is in cache
  32955. /******/ if(installedModules[moduleId]) {
  32956. /******/ return installedModules[moduleId].exports;
  32957. /******/ }
  32958. /******/ // Create a new module (and put it into the cache)
  32959. /******/ var module = installedModules[moduleId] = {
  32960. /******/ i: moduleId,
  32961. /******/ l: false,
  32962. /******/ exports: {}
  32963. /******/ };
  32964. /******/
  32965. /******/ // Execute the module function
  32966. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  32967. /******/
  32968. /******/ // Flag the module as loaded
  32969. /******/ module.l = true;
  32970. /******/
  32971. /******/ // Return the exports of the module
  32972. /******/ return module.exports;
  32973. /******/ }
  32974. /******/
  32975. /******/
  32976. /******/ // expose the modules object (__webpack_modules__)
  32977. /******/ __webpack_require__.m = modules;
  32978. /******/
  32979. /******/ // expose the module cache
  32980. /******/ __webpack_require__.c = installedModules;
  32981. /******/
  32982. /******/ // define getter function for harmony exports
  32983. /******/ __webpack_require__.d = function(exports, name, getter) {
  32984. /******/ if(!__webpack_require__.o(exports, name)) {
  32985. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  32986. /******/ }
  32987. /******/ };
  32988. /******/
  32989. /******/ // define __esModule on exports
  32990. /******/ __webpack_require__.r = function(exports) {
  32991. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  32992. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  32993. /******/ }
  32994. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  32995. /******/ };
  32996. /******/
  32997. /******/ // create a fake namespace object
  32998. /******/ // mode & 1: value is a module id, require it
  32999. /******/ // mode & 2: merge all properties of value into the ns
  33000. /******/ // mode & 4: return value when already ns object
  33001. /******/ // mode & 8|1: behave like require
  33002. /******/ __webpack_require__.t = function(value, mode) {
  33003. /******/ if(mode & 1) value = __webpack_require__(value);
  33004. /******/ if(mode & 8) return value;
  33005. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  33006. /******/ var ns = Object.create(null);
  33007. /******/ __webpack_require__.r(ns);
  33008. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  33009. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  33010. /******/ return ns;
  33011. /******/ };
  33012. /******/
  33013. /******/ // getDefaultExport function for compatibility with non-harmony modules
  33014. /******/ __webpack_require__.n = function(module) {
  33015. /******/ var getter = module && module.__esModule ?
  33016. /******/ function getDefault() { return module['default']; } :
  33017. /******/ function getModuleExports() { return module; };
  33018. /******/ __webpack_require__.d(getter, 'a', getter);
  33019. /******/ return getter;
  33020. /******/ };
  33021. /******/
  33022. /******/ // Object.prototype.hasOwnProperty.call
  33023. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  33024. /******/
  33025. /******/ // __webpack_public_path__
  33026. /******/ __webpack_require__.p = "";
  33027. /******/
  33028. /******/
  33029. /******/ // Load entry module and return exports
  33030. /******/ return __webpack_require__(__webpack_require__.s = "./src/strophe.js");
  33031. /******/ })
  33032. /************************************************************************/
  33033. /******/ ({
  33034. /***/ "./src/bosh.js":
  33035. /*!*********************!*\
  33036. !*** ./src/bosh.js ***!
  33037. \*********************/
  33038. /*! no exports provided */
  33039. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33040. "use strict";
  33041. __webpack_require__.r(__webpack_exports__);
  33042. /* harmony import */ var core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core */ "./src/core.js");
  33043. /*
  33044. This program is distributed under the terms of the MIT license.
  33045. Please see the LICENSE file for details.
  33046. Copyright 2006-2008, OGG, LLC
  33047. */
  33048. /* global window, setTimeout, clearTimeout, XMLHttpRequest, ActiveXObject */
  33049. var Strophe = core__WEBPACK_IMPORTED_MODULE_0__["default"].Strophe;
  33050. var $build = core__WEBPACK_IMPORTED_MODULE_0__["default"].$build;
  33051. /** PrivateClass: Strophe.Request
  33052. * _Private_ helper class that provides a cross implementation abstraction
  33053. * for a BOSH related XMLHttpRequest.
  33054. *
  33055. * The Strophe.Request class is used internally to encapsulate BOSH request
  33056. * information. It is not meant to be used from user's code.
  33057. */
  33058. /** PrivateConstructor: Strophe.Request
  33059. * Create and initialize a new Strophe.Request object.
  33060. *
  33061. * Parameters:
  33062. * (XMLElement) elem - The XML data to be sent in the request.
  33063. * (Function) func - The function that will be called when the
  33064. * XMLHttpRequest readyState changes.
  33065. * (Integer) rid - The BOSH rid attribute associated with this request.
  33066. * (Integer) sends - The number of times this same request has been sent.
  33067. */
  33068. Strophe.Request = function (elem, func, rid, sends) {
  33069. this.id = ++Strophe._requestId;
  33070. this.xmlData = elem;
  33071. this.data = Strophe.serialize(elem); // save original function in case we need to make a new request
  33072. // from this one.
  33073. this.origFunc = func;
  33074. this.func = func;
  33075. this.rid = rid;
  33076. this.date = NaN;
  33077. this.sends = sends || 0;
  33078. this.abort = false;
  33079. this.dead = null;
  33080. this.age = function () {
  33081. if (!this.date) {
  33082. return 0;
  33083. }
  33084. var now = new Date();
  33085. return (now - this.date) / 1000;
  33086. };
  33087. this.timeDead = function () {
  33088. if (!this.dead) {
  33089. return 0;
  33090. }
  33091. var now = new Date();
  33092. return (now - this.dead) / 1000;
  33093. };
  33094. this.xhr = this._newXHR();
  33095. };
  33096. Strophe.Request.prototype = {
  33097. /** PrivateFunction: getResponse
  33098. * Get a response from the underlying XMLHttpRequest.
  33099. *
  33100. * This function attempts to get a response from the request and checks
  33101. * for errors.
  33102. *
  33103. * Throws:
  33104. * "parsererror" - A parser error occured.
  33105. * "bad-format" - The entity has sent XML that cannot be processed.
  33106. *
  33107. * Returns:
  33108. * The DOM element tree of the response.
  33109. */
  33110. getResponse: function getResponse() {
  33111. var node = null;
  33112. if (this.xhr.responseXML && this.xhr.responseXML.documentElement) {
  33113. node = this.xhr.responseXML.documentElement;
  33114. if (node.tagName === "parsererror") {
  33115. Strophe.error("invalid response received");
  33116. Strophe.error("responseText: " + this.xhr.responseText);
  33117. Strophe.error("responseXML: " + Strophe.serialize(this.xhr.responseXML));
  33118. throw new Error("parsererror");
  33119. }
  33120. } else if (this.xhr.responseText) {
  33121. // In React Native, we may get responseText but no responseXML. We can try to parse it manually.
  33122. Strophe.debug("Got responseText but no responseXML; attempting to parse it with DOMParser...");
  33123. node = new DOMParser().parseFromString(this.xhr.responseText, 'application/xml').documentElement;
  33124. if (!node) {
  33125. throw new Error('Parsing produced null node');
  33126. } else if (node.querySelector('parsererror')) {
  33127. Strophe.error("invalid response received: " + node.querySelector('parsererror').textContent);
  33128. Strophe.error("responseText: " + this.xhr.responseText);
  33129. var error = new Error();
  33130. error.name = Strophe.ErrorCondition.BAD_FORMAT;
  33131. throw error;
  33132. }
  33133. }
  33134. return node;
  33135. },
  33136. /** PrivateFunction: _newXHR
  33137. * _Private_ helper function to create XMLHttpRequests.
  33138. *
  33139. * This function creates XMLHttpRequests across all implementations.
  33140. *
  33141. * Returns:
  33142. * A new XMLHttpRequest.
  33143. */
  33144. _newXHR: function _newXHR() {
  33145. var xhr = null;
  33146. if (window.XMLHttpRequest) {
  33147. xhr = new XMLHttpRequest();
  33148. if (xhr.overrideMimeType) {
  33149. xhr.overrideMimeType("text/xml; charset=utf-8");
  33150. }
  33151. } else if (window.ActiveXObject) {
  33152. xhr = new ActiveXObject("Microsoft.XMLHTTP");
  33153. } // use Function.bind() to prepend ourselves as an argument
  33154. xhr.onreadystatechange = this.func.bind(null, this);
  33155. return xhr;
  33156. }
  33157. };
  33158. /** Class: Strophe.Bosh
  33159. * _Private_ helper class that handles BOSH Connections
  33160. *
  33161. * The Strophe.Bosh class is used internally by Strophe.Connection
  33162. * to encapsulate BOSH sessions. It is not meant to be used from user's code.
  33163. */
  33164. /** File: bosh.js
  33165. * A JavaScript library to enable BOSH in Strophejs.
  33166. *
  33167. * this library uses Bidirectional-streams Over Synchronous HTTP (BOSH)
  33168. * to emulate a persistent, stateful, two-way connection to an XMPP server.
  33169. * More information on BOSH can be found in XEP 124.
  33170. */
  33171. /** PrivateConstructor: Strophe.Bosh
  33172. * Create and initialize a Strophe.Bosh object.
  33173. *
  33174. * Parameters:
  33175. * (Strophe.Connection) connection - The Strophe.Connection that will use BOSH.
  33176. *
  33177. * Returns:
  33178. * A new Strophe.Bosh object.
  33179. */
  33180. Strophe.Bosh = function (connection) {
  33181. this._conn = connection;
  33182. /* request id for body tags */
  33183. this.rid = Math.floor(Math.random() * 4294967295);
  33184. /* The current session ID. */
  33185. this.sid = null; // default BOSH values
  33186. this.hold = 1;
  33187. this.wait = 60;
  33188. this.window = 5;
  33189. this.errors = 0;
  33190. this.inactivity = null;
  33191. this.lastResponseHeaders = null;
  33192. this._requests = [];
  33193. };
  33194. Strophe.Bosh.prototype = {
  33195. /** Variable: strip
  33196. *
  33197. * BOSH-Connections will have all stanzas wrapped in a <body> tag when
  33198. * passed to <Strophe.Connection.xmlInput> or <Strophe.Connection.xmlOutput>.
  33199. * To strip this tag, User code can set <Strophe.Bosh.strip> to "body":
  33200. *
  33201. * > Strophe.Bosh.prototype.strip = "body";
  33202. *
  33203. * This will enable stripping of the body tag in both
  33204. * <Strophe.Connection.xmlInput> and <Strophe.Connection.xmlOutput>.
  33205. */
  33206. strip: null,
  33207. /** PrivateFunction: _buildBody
  33208. * _Private_ helper function to generate the <body/> wrapper for BOSH.
  33209. *
  33210. * Returns:
  33211. * A Strophe.Builder with a <body/> element.
  33212. */
  33213. _buildBody: function _buildBody() {
  33214. var bodyWrap = $build('body', {
  33215. 'rid': this.rid++,
  33216. 'xmlns': Strophe.NS.HTTPBIND
  33217. });
  33218. if (this.sid !== null) {
  33219. bodyWrap.attrs({
  33220. 'sid': this.sid
  33221. });
  33222. }
  33223. if (this._conn.options.keepalive && this._conn._sessionCachingSupported()) {
  33224. this._cacheSession();
  33225. }
  33226. return bodyWrap;
  33227. },
  33228. /** PrivateFunction: _reset
  33229. * Reset the connection.
  33230. *
  33231. * This function is called by the reset function of the Strophe Connection
  33232. */
  33233. _reset: function _reset() {
  33234. this.rid = Math.floor(Math.random() * 4294967295);
  33235. this.sid = null;
  33236. this.errors = 0;
  33237. if (this._conn._sessionCachingSupported()) {
  33238. window.sessionStorage.removeItem('strophe-bosh-session');
  33239. }
  33240. this._conn.nextValidRid(this.rid);
  33241. },
  33242. /** PrivateFunction: _connect
  33243. * _Private_ function that initializes the BOSH connection.
  33244. *
  33245. * Creates and sends the Request that initializes the BOSH connection.
  33246. */
  33247. _connect: function _connect(wait, hold, route) {
  33248. this.wait = wait || this.wait;
  33249. this.hold = hold || this.hold;
  33250. this.errors = 0;
  33251. var body = this._buildBody().attrs({
  33252. "to": this._conn.domain,
  33253. "xml:lang": "en",
  33254. "wait": this.wait,
  33255. "hold": this.hold,
  33256. "content": "text/xml; charset=utf-8",
  33257. "ver": "1.6",
  33258. "xmpp:version": "1.0",
  33259. "xmlns:xmpp": Strophe.NS.BOSH
  33260. });
  33261. if (route) {
  33262. body.attrs({
  33263. 'route': route
  33264. });
  33265. }
  33266. var _connect_cb = this._conn._connect_cb;
  33267. this._requests.push(new Strophe.Request(body.tree(), this._onRequestStateChange.bind(this, _connect_cb.bind(this._conn)), body.tree().getAttribute("rid")));
  33268. this._throttledRequestHandler();
  33269. },
  33270. /** PrivateFunction: _attach
  33271. * Attach to an already created and authenticated BOSH session.
  33272. *
  33273. * This function is provided to allow Strophe to attach to BOSH
  33274. * sessions which have been created externally, perhaps by a Web
  33275. * application. This is often used to support auto-login type features
  33276. * without putting user credentials into the page.
  33277. *
  33278. * Parameters:
  33279. * (String) jid - The full JID that is bound by the session.
  33280. * (String) sid - The SID of the BOSH session.
  33281. * (String) rid - The current RID of the BOSH session. This RID
  33282. * will be used by the next request.
  33283. * (Function) callback The connect callback function.
  33284. * (Integer) wait - The optional HTTPBIND wait value. This is the
  33285. * time the server will wait before returning an empty result for
  33286. * a request. The default setting of 60 seconds is recommended.
  33287. * Other settings will require tweaks to the Strophe.TIMEOUT value.
  33288. * (Integer) hold - The optional HTTPBIND hold value. This is the
  33289. * number of connections the server will hold at one time. This
  33290. * should almost always be set to 1 (the default).
  33291. * (Integer) wind - The optional HTTBIND window value. This is the
  33292. * allowed range of request ids that are valid. The default is 5.
  33293. */
  33294. _attach: function _attach(jid, sid, rid, callback, wait, hold, wind) {
  33295. this._conn.jid = jid;
  33296. this.sid = sid;
  33297. this.rid = rid;
  33298. this._conn.connect_callback = callback;
  33299. this._conn.domain = Strophe.getDomainFromJid(this._conn.jid);
  33300. this._conn.authenticated = true;
  33301. this._conn.connected = true;
  33302. this.wait = wait || this.wait;
  33303. this.hold = hold || this.hold;
  33304. this.window = wind || this.window;
  33305. this._conn._changeConnectStatus(Strophe.Status.ATTACHED, null);
  33306. },
  33307. /** PrivateFunction: _restore
  33308. * Attempt to restore a cached BOSH session
  33309. *
  33310. * Parameters:
  33311. * (String) jid - The full JID that is bound by the session.
  33312. * This parameter is optional but recommended, specifically in cases
  33313. * where prebinded BOSH sessions are used where it's important to know
  33314. * that the right session is being restored.
  33315. * (Function) callback The connect callback function.
  33316. * (Integer) wait - The optional HTTPBIND wait value. This is the
  33317. * time the server will wait before returning an empty result for
  33318. * a request. The default setting of 60 seconds is recommended.
  33319. * Other settings will require tweaks to the Strophe.TIMEOUT value.
  33320. * (Integer) hold - The optional HTTPBIND hold value. This is the
  33321. * number of connections the server will hold at one time. This
  33322. * should almost always be set to 1 (the default).
  33323. * (Integer) wind - The optional HTTBIND window value. This is the
  33324. * allowed range of request ids that are valid. The default is 5.
  33325. */
  33326. _restore: function _restore(jid, callback, wait, hold, wind) {
  33327. var session = JSON.parse(window.sessionStorage.getItem('strophe-bosh-session'));
  33328. if (typeof session !== "undefined" && session !== null && session.rid && session.sid && session.jid && (typeof jid === "undefined" || jid === null || Strophe.getBareJidFromJid(session.jid) === Strophe.getBareJidFromJid(jid) || // If authcid is null, then it's an anonymous login, so
  33329. // we compare only the domains:
  33330. Strophe.getNodeFromJid(jid) === null && Strophe.getDomainFromJid(session.jid) === jid)) {
  33331. this._conn.restored = true;
  33332. this._attach(session.jid, session.sid, session.rid, callback, wait, hold, wind);
  33333. } else {
  33334. var error = new Error("_restore: no restoreable session.");
  33335. error.name = "StropheSessionError";
  33336. throw error;
  33337. }
  33338. },
  33339. /** PrivateFunction: _cacheSession
  33340. * _Private_ handler for the beforeunload event.
  33341. *
  33342. * This handler is used to process the Bosh-part of the initial request.
  33343. * Parameters:
  33344. * (Strophe.Request) bodyWrap - The received stanza.
  33345. */
  33346. _cacheSession: function _cacheSession() {
  33347. if (this._conn.authenticated) {
  33348. if (this._conn.jid && this.rid && this.sid) {
  33349. window.sessionStorage.setItem('strophe-bosh-session', JSON.stringify({
  33350. 'jid': this._conn.jid,
  33351. 'rid': this.rid,
  33352. 'sid': this.sid
  33353. }));
  33354. }
  33355. } else {
  33356. window.sessionStorage.removeItem('strophe-bosh-session');
  33357. }
  33358. },
  33359. /** PrivateFunction: _connect_cb
  33360. * _Private_ handler for initial connection request.
  33361. *
  33362. * This handler is used to process the Bosh-part of the initial request.
  33363. * Parameters:
  33364. * (Strophe.Request) bodyWrap - The received stanza.
  33365. */
  33366. _connect_cb: function _connect_cb(bodyWrap) {
  33367. var typ = bodyWrap.getAttribute("type");
  33368. if (typ !== null && typ === "terminate") {
  33369. // an error occurred
  33370. var cond = bodyWrap.getAttribute("condition");
  33371. Strophe.error("BOSH-Connection failed: " + cond);
  33372. var conflict = bodyWrap.getElementsByTagName("conflict");
  33373. if (cond !== null) {
  33374. if (cond === "remote-stream-error" && conflict.length > 0) {
  33375. cond = "conflict";
  33376. }
  33377. this._conn._changeConnectStatus(Strophe.Status.CONNFAIL, cond);
  33378. } else {
  33379. this._conn._changeConnectStatus(Strophe.Status.CONNFAIL, "unknown");
  33380. }
  33381. this._conn._doDisconnect(cond);
  33382. return Strophe.Status.CONNFAIL;
  33383. } // check to make sure we don't overwrite these if _connect_cb is
  33384. // called multiple times in the case of missing stream:features
  33385. if (!this.sid) {
  33386. this.sid = bodyWrap.getAttribute("sid");
  33387. }
  33388. var wind = bodyWrap.getAttribute('requests');
  33389. if (wind) {
  33390. this.window = parseInt(wind, 10);
  33391. }
  33392. var hold = bodyWrap.getAttribute('hold');
  33393. if (hold) {
  33394. this.hold = parseInt(hold, 10);
  33395. }
  33396. var wait = bodyWrap.getAttribute('wait');
  33397. if (wait) {
  33398. this.wait = parseInt(wait, 10);
  33399. }
  33400. var inactivity = bodyWrap.getAttribute('inactivity');
  33401. if (inactivity) {
  33402. this.inactivity = parseInt(inactivity, 10);
  33403. }
  33404. },
  33405. /** PrivateFunction: _disconnect
  33406. * _Private_ part of Connection.disconnect for Bosh
  33407. *
  33408. * Parameters:
  33409. * (Request) pres - This stanza will be sent before disconnecting.
  33410. */
  33411. _disconnect: function _disconnect(pres) {
  33412. this._sendTerminate(pres);
  33413. },
  33414. /** PrivateFunction: _doDisconnect
  33415. * _Private_ function to disconnect.
  33416. *
  33417. * Resets the SID and RID.
  33418. */
  33419. _doDisconnect: function _doDisconnect() {
  33420. this.sid = null;
  33421. this.rid = Math.floor(Math.random() * 4294967295);
  33422. if (this._conn._sessionCachingSupported()) {
  33423. window.sessionStorage.removeItem('strophe-bosh-session');
  33424. }
  33425. this._conn.nextValidRid(this.rid);
  33426. },
  33427. /** PrivateFunction: _emptyQueue
  33428. * _Private_ function to check if the Request queue is empty.
  33429. *
  33430. * Returns:
  33431. * True, if there are no Requests queued, False otherwise.
  33432. */
  33433. _emptyQueue: function _emptyQueue() {
  33434. return this._requests.length === 0;
  33435. },
  33436. /** PrivateFunction: _callProtocolErrorHandlers
  33437. * _Private_ function to call error handlers registered for HTTP errors.
  33438. *
  33439. * Parameters:
  33440. * (Strophe.Request) req - The request that is changing readyState.
  33441. */
  33442. _callProtocolErrorHandlers: function _callProtocolErrorHandlers(req) {
  33443. var reqStatus = this._getRequestStatus(req);
  33444. var err_callback = this._conn.protocolErrorHandlers.HTTP[reqStatus];
  33445. if (err_callback) {
  33446. err_callback.call(this, reqStatus);
  33447. }
  33448. },
  33449. /** PrivateFunction: _hitError
  33450. * _Private_ function to handle the error count.
  33451. *
  33452. * Requests are resent automatically until their error count reaches
  33453. * 5. Each time an error is encountered, this function is called to
  33454. * increment the count and disconnect if the count is too high.
  33455. *
  33456. * Parameters:
  33457. * (Integer) reqStatus - The request status.
  33458. */
  33459. _hitError: function _hitError(reqStatus) {
  33460. this.errors++;
  33461. Strophe.warn("request errored, status: " + reqStatus + ", number of errors: " + this.errors);
  33462. if (this.errors > 4) {
  33463. this._conn._onDisconnectTimeout();
  33464. }
  33465. },
  33466. /** PrivateFunction: _no_auth_received
  33467. *
  33468. * Called on stream start/restart when no stream:features
  33469. * has been received and sends a blank poll request.
  33470. */
  33471. _no_auth_received: function _no_auth_received(callback) {
  33472. Strophe.warn("Server did not yet offer a supported authentication " + "mechanism. Sending a blank poll request.");
  33473. if (callback) {
  33474. callback = callback.bind(this._conn);
  33475. } else {
  33476. callback = this._conn._connect_cb.bind(this._conn);
  33477. }
  33478. var body = this._buildBody();
  33479. this._requests.push(new Strophe.Request(body.tree(), this._onRequestStateChange.bind(this, callback), body.tree().getAttribute("rid")));
  33480. this._throttledRequestHandler();
  33481. },
  33482. /** PrivateFunction: _onDisconnectTimeout
  33483. * _Private_ timeout handler for handling non-graceful disconnection.
  33484. *
  33485. * Cancels all remaining Requests and clears the queue.
  33486. */
  33487. _onDisconnectTimeout: function _onDisconnectTimeout() {
  33488. this._abortAllRequests();
  33489. },
  33490. /** PrivateFunction: _abortAllRequests
  33491. * _Private_ helper function that makes sure all pending requests are aborted.
  33492. */
  33493. _abortAllRequests: function _abortAllRequests() {
  33494. while (this._requests.length > 0) {
  33495. var req = this._requests.pop();
  33496. req.abort = true;
  33497. req.xhr.abort(); // jslint complains, but this is fine. setting to empty func
  33498. // is necessary for IE6
  33499. req.xhr.onreadystatechange = function () {}; // jshint ignore:line
  33500. }
  33501. },
  33502. /** PrivateFunction: _onIdle
  33503. * _Private_ handler called by Strophe.Connection._onIdle
  33504. *
  33505. * Sends all queued Requests or polls with empty Request if there are none.
  33506. */
  33507. _onIdle: function _onIdle() {
  33508. var data = this._conn._data; // if no requests are in progress, poll
  33509. if (this._conn.authenticated && this._requests.length === 0 && data.length === 0 && !this._conn.disconnecting) {
  33510. Strophe.info("no requests during idle cycle, sending " + "blank request");
  33511. data.push(null);
  33512. }
  33513. if (this._conn.paused) {
  33514. return;
  33515. }
  33516. if (this._requests.length < 2 && data.length > 0) {
  33517. var body = this._buildBody();
  33518. for (var i = 0; i < data.length; i++) {
  33519. if (data[i] !== null) {
  33520. if (data[i] === "restart") {
  33521. body.attrs({
  33522. "to": this._conn.domain,
  33523. "xml:lang": "en",
  33524. "xmpp:restart": "true",
  33525. "xmlns:xmpp": Strophe.NS.BOSH
  33526. });
  33527. } else {
  33528. body.cnode(data[i]).up();
  33529. }
  33530. }
  33531. }
  33532. delete this._conn._data;
  33533. this._conn._data = [];
  33534. this._requests.push(new Strophe.Request(body.tree(), this._onRequestStateChange.bind(this, this._conn._dataRecv.bind(this._conn)), body.tree().getAttribute("rid")));
  33535. this._throttledRequestHandler();
  33536. }
  33537. if (this._requests.length > 0) {
  33538. var time_elapsed = this._requests[0].age();
  33539. if (this._requests[0].dead !== null) {
  33540. if (this._requests[0].timeDead() > Math.floor(Strophe.SECONDARY_TIMEOUT * this.wait)) {
  33541. this._throttledRequestHandler();
  33542. }
  33543. }
  33544. if (time_elapsed > Math.floor(Strophe.TIMEOUT * this.wait)) {
  33545. Strophe.warn("Request " + this._requests[0].id + " timed out, over " + Math.floor(Strophe.TIMEOUT * this.wait) + " seconds since last activity");
  33546. this._throttledRequestHandler();
  33547. }
  33548. }
  33549. },
  33550. /** PrivateFunction: _getRequestStatus
  33551. *
  33552. * Returns the HTTP status code from a Strophe.Request
  33553. *
  33554. * Parameters:
  33555. * (Strophe.Request) req - The Strophe.Request instance.
  33556. * (Integer) def - The default value that should be returned if no
  33557. * status value was found.
  33558. */
  33559. _getRequestStatus: function _getRequestStatus(req, def) {
  33560. var reqStatus;
  33561. if (req.xhr.readyState === 4) {
  33562. try {
  33563. reqStatus = req.xhr.status;
  33564. } catch (e) {
  33565. // ignore errors from undefined status attribute. Works
  33566. // around a browser bug
  33567. Strophe.error("Caught an error while retrieving a request's status, " + "reqStatus: " + reqStatus);
  33568. }
  33569. }
  33570. if (typeof reqStatus === "undefined") {
  33571. reqStatus = typeof def === 'number' ? def : 0;
  33572. }
  33573. return reqStatus;
  33574. },
  33575. /** PrivateFunction: _onRequestStateChange
  33576. * _Private_ handler for Strophe.Request state changes.
  33577. *
  33578. * This function is called when the XMLHttpRequest readyState changes.
  33579. * It contains a lot of error handling logic for the many ways that
  33580. * requests can fail, and calls the request callback when requests
  33581. * succeed.
  33582. *
  33583. * Parameters:
  33584. * (Function) func - The handler for the request.
  33585. * (Strophe.Request) req - The request that is changing readyState.
  33586. */
  33587. _onRequestStateChange: function _onRequestStateChange(func, req) {
  33588. Strophe.debug("request id " + req.id + "." + req.sends + " state changed to " + req.xhr.readyState);
  33589. if (req.abort) {
  33590. req.abort = false;
  33591. return;
  33592. }
  33593. if (req.xhr.readyState !== 4) {
  33594. // The request is not yet complete
  33595. return;
  33596. }
  33597. var reqStatus = this._getRequestStatus(req);
  33598. this.lastResponseHeaders = req.xhr.getAllResponseHeaders();
  33599. if (this.disconnecting && reqStatus >= 400) {
  33600. this._hitError(reqStatus);
  33601. this._callProtocolErrorHandlers(req);
  33602. return;
  33603. }
  33604. var valid_request = reqStatus > 0 && reqStatus < 500;
  33605. var too_many_retries = req.sends > this._conn.maxRetries;
  33606. if (valid_request || too_many_retries) {
  33607. // remove from internal queue
  33608. this._removeRequest(req);
  33609. Strophe.debug("request id " + req.id + " should now be removed");
  33610. }
  33611. if (reqStatus === 200) {
  33612. // request succeeded
  33613. var reqIs0 = this._requests[0] === req;
  33614. var reqIs1 = this._requests[1] === req; // if request 1 finished, or request 0 finished and request
  33615. // 1 is over Strophe.SECONDARY_TIMEOUT seconds old, we need to
  33616. // restart the other - both will be in the first spot, as the
  33617. // completed request has been removed from the queue already
  33618. if (reqIs1 || reqIs0 && this._requests.length > 0 && this._requests[0].age() > Math.floor(Strophe.SECONDARY_TIMEOUT * this.wait)) {
  33619. this._restartRequest(0);
  33620. }
  33621. this._conn.nextValidRid(Number(req.rid) + 1);
  33622. Strophe.debug("request id " + req.id + "." + req.sends + " got 200");
  33623. func(req); // call handler
  33624. this.errors = 0;
  33625. } else if (reqStatus === 0 || reqStatus >= 400 && reqStatus < 600 || reqStatus >= 12000) {
  33626. // request failed
  33627. Strophe.error("request id " + req.id + "." + req.sends + " error " + reqStatus + " happened");
  33628. this._hitError(reqStatus);
  33629. this._callProtocolErrorHandlers(req);
  33630. if (reqStatus >= 400 && reqStatus < 500) {
  33631. this._conn._changeConnectStatus(Strophe.Status.DISCONNECTING, null);
  33632. this._conn._doDisconnect();
  33633. }
  33634. } else {
  33635. Strophe.error("request id " + req.id + "." + req.sends + " error " + reqStatus + " happened");
  33636. }
  33637. if (!valid_request && !too_many_retries) {
  33638. this._throttledRequestHandler();
  33639. } else if (too_many_retries && !this._conn.connected) {
  33640. this._conn._changeConnectStatus(Strophe.Status.CONNFAIL, "giving-up");
  33641. }
  33642. },
  33643. /** PrivateFunction: _processRequest
  33644. * _Private_ function to process a request in the queue.
  33645. *
  33646. * This function takes requests off the queue and sends them and
  33647. * restarts dead requests.
  33648. *
  33649. * Parameters:
  33650. * (Integer) i - The index of the request in the queue.
  33651. */
  33652. _processRequest: function _processRequest(i) {
  33653. var _this = this;
  33654. var req = this._requests[i];
  33655. var reqStatus = this._getRequestStatus(req, -1); // make sure we limit the number of retries
  33656. if (req.sends > this._conn.maxRetries) {
  33657. this._conn._onDisconnectTimeout();
  33658. return;
  33659. }
  33660. var time_elapsed = req.age();
  33661. var primary_timeout = !isNaN(time_elapsed) && time_elapsed > Math.floor(Strophe.TIMEOUT * this.wait);
  33662. var secondary_timeout = req.dead !== null && req.timeDead() > Math.floor(Strophe.SECONDARY_TIMEOUT * this.wait);
  33663. var server_error = req.xhr.readyState === 4 && (reqStatus < 1 || reqStatus >= 500);
  33664. if (primary_timeout || secondary_timeout || server_error) {
  33665. if (secondary_timeout) {
  33666. Strophe.error("Request ".concat(this._requests[i].id, " timed out (secondary), restarting"));
  33667. }
  33668. req.abort = true;
  33669. req.xhr.abort(); // setting to null fails on IE6, so set to empty function
  33670. req.xhr.onreadystatechange = function () {};
  33671. this._requests[i] = new Strophe.Request(req.xmlData, req.origFunc, req.rid, req.sends);
  33672. req = this._requests[i];
  33673. }
  33674. if (req.xhr.readyState === 0) {
  33675. Strophe.debug("request id " + req.id + "." + req.sends + " posting");
  33676. try {
  33677. var content_type = this._conn.options.contentType || "text/xml; charset=utf-8";
  33678. req.xhr.open("POST", this._conn.service, this._conn.options.sync ? false : true);
  33679. if (typeof req.xhr.setRequestHeader !== 'undefined') {
  33680. // IE9 doesn't have setRequestHeader
  33681. req.xhr.setRequestHeader("Content-Type", content_type);
  33682. }
  33683. if (this._conn.options.withCredentials) {
  33684. req.xhr.withCredentials = true;
  33685. }
  33686. } catch (e2) {
  33687. Strophe.error("XHR open failed: " + e2.toString());
  33688. if (!this._conn.connected) {
  33689. this._conn._changeConnectStatus(Strophe.Status.CONNFAIL, "bad-service");
  33690. }
  33691. this._conn.disconnect();
  33692. return;
  33693. } // Fires the XHR request -- may be invoked immediately
  33694. // or on a gradually expanding retry window for reconnects
  33695. var sendFunc = function sendFunc() {
  33696. req.date = new Date();
  33697. if (_this._conn.options.customHeaders) {
  33698. var headers = _this._conn.options.customHeaders;
  33699. for (var header in headers) {
  33700. if (Object.prototype.hasOwnProperty.call(headers, header)) {
  33701. req.xhr.setRequestHeader(header, headers[header]);
  33702. }
  33703. }
  33704. }
  33705. req.xhr.send(req.data);
  33706. }; // Implement progressive backoff for reconnects --
  33707. // First retry (send === 1) should also be instantaneous
  33708. if (req.sends > 1) {
  33709. // Using a cube of the retry number creates a nicely
  33710. // expanding retry window
  33711. var backoff = Math.min(Math.floor(Strophe.TIMEOUT * this.wait), Math.pow(req.sends, 3)) * 1000;
  33712. setTimeout(function () {
  33713. // XXX: setTimeout should be called only with function expressions (23974bc1)
  33714. sendFunc();
  33715. }, backoff);
  33716. } else {
  33717. sendFunc();
  33718. }
  33719. req.sends++;
  33720. if (this._conn.xmlOutput !== Strophe.Connection.prototype.xmlOutput) {
  33721. if (req.xmlData.nodeName === this.strip && req.xmlData.childNodes.length) {
  33722. this._conn.xmlOutput(req.xmlData.childNodes[0]);
  33723. } else {
  33724. this._conn.xmlOutput(req.xmlData);
  33725. }
  33726. }
  33727. if (this._conn.rawOutput !== Strophe.Connection.prototype.rawOutput) {
  33728. this._conn.rawOutput(req.data);
  33729. }
  33730. } else {
  33731. Strophe.debug("_processRequest: " + (i === 0 ? "first" : "second") + " request has readyState of " + req.xhr.readyState);
  33732. }
  33733. },
  33734. /** PrivateFunction: _removeRequest
  33735. * _Private_ function to remove a request from the queue.
  33736. *
  33737. * Parameters:
  33738. * (Strophe.Request) req - The request to remove.
  33739. */
  33740. _removeRequest: function _removeRequest(req) {
  33741. Strophe.debug("removing request");
  33742. for (var i = this._requests.length - 1; i >= 0; i--) {
  33743. if (req === this._requests[i]) {
  33744. this._requests.splice(i, 1);
  33745. }
  33746. } // IE6 fails on setting to null, so set to empty function
  33747. req.xhr.onreadystatechange = function () {};
  33748. this._throttledRequestHandler();
  33749. },
  33750. /** PrivateFunction: _restartRequest
  33751. * _Private_ function to restart a request that is presumed dead.
  33752. *
  33753. * Parameters:
  33754. * (Integer) i - The index of the request in the queue.
  33755. */
  33756. _restartRequest: function _restartRequest(i) {
  33757. var req = this._requests[i];
  33758. if (req.dead === null) {
  33759. req.dead = new Date();
  33760. }
  33761. this._processRequest(i);
  33762. },
  33763. /** PrivateFunction: _reqToData
  33764. * _Private_ function to get a stanza out of a request.
  33765. *
  33766. * Tries to extract a stanza out of a Request Object.
  33767. * When this fails the current connection will be disconnected.
  33768. *
  33769. * Parameters:
  33770. * (Object) req - The Request.
  33771. *
  33772. * Returns:
  33773. * The stanza that was passed.
  33774. */
  33775. _reqToData: function _reqToData(req) {
  33776. try {
  33777. return req.getResponse();
  33778. } catch (e) {
  33779. if (e.message !== "parsererror") {
  33780. throw e;
  33781. }
  33782. this._conn.disconnect("strophe-parsererror");
  33783. }
  33784. },
  33785. /** PrivateFunction: _sendTerminate
  33786. * _Private_ function to send initial disconnect sequence.
  33787. *
  33788. * This is the first step in a graceful disconnect. It sends
  33789. * the BOSH server a terminate body and includes an unavailable
  33790. * presence if authentication has completed.
  33791. */
  33792. _sendTerminate: function _sendTerminate(pres) {
  33793. Strophe.info("_sendTerminate was called");
  33794. var body = this._buildBody().attrs({
  33795. type: "terminate"
  33796. });
  33797. if (pres) {
  33798. body.cnode(pres.tree());
  33799. }
  33800. var req = new Strophe.Request(body.tree(), this._onRequestStateChange.bind(this, this._conn._dataRecv.bind(this._conn)), body.tree().getAttribute("rid"));
  33801. this._requests.push(req);
  33802. this._throttledRequestHandler();
  33803. },
  33804. /** PrivateFunction: _send
  33805. * _Private_ part of the Connection.send function for BOSH
  33806. *
  33807. * Just triggers the RequestHandler to send the messages that are in the queue
  33808. */
  33809. _send: function _send() {
  33810. var _this2 = this;
  33811. clearTimeout(this._conn._idleTimeout);
  33812. this._throttledRequestHandler();
  33813. this._conn._idleTimeout = setTimeout(function () {
  33814. return _this2._conn._onIdle();
  33815. }, 100);
  33816. },
  33817. /** PrivateFunction: _sendRestart
  33818. *
  33819. * Send an xmpp:restart stanza.
  33820. */
  33821. _sendRestart: function _sendRestart() {
  33822. this._throttledRequestHandler();
  33823. clearTimeout(this._conn._idleTimeout);
  33824. },
  33825. /** PrivateFunction: _throttledRequestHandler
  33826. * _Private_ function to throttle requests to the connection window.
  33827. *
  33828. * This function makes sure we don't send requests so fast that the
  33829. * request ids overflow the connection window in the case that one
  33830. * request died.
  33831. */
  33832. _throttledRequestHandler: function _throttledRequestHandler() {
  33833. if (!this._requests) {
  33834. Strophe.debug("_throttledRequestHandler called with " + "undefined requests");
  33835. } else {
  33836. Strophe.debug("_throttledRequestHandler called with " + this._requests.length + " requests");
  33837. }
  33838. if (!this._requests || this._requests.length === 0) {
  33839. return;
  33840. }
  33841. if (this._requests.length > 0) {
  33842. this._processRequest(0);
  33843. }
  33844. if (this._requests.length > 1 && Math.abs(this._requests[0].rid - this._requests[1].rid) < this.window) {
  33845. this._processRequest(1);
  33846. }
  33847. }
  33848. };
  33849. /***/ }),
  33850. /***/ "./src/core.js":
  33851. /*!*********************!*\
  33852. !*** ./src/core.js ***!
  33853. \*********************/
  33854. /*! exports provided: default */
  33855. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  33856. "use strict";
  33857. __webpack_require__.r(__webpack_exports__);
  33858. /* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! md5 */ "./src/md5.js");
  33859. /* harmony import */ var sha1__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! sha1 */ "./src/sha1.js");
  33860. /* harmony import */ var utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! utils */ "./src/utils.js");
  33861. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
  33862. function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
  33863. function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
  33864. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
  33865. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  33866. /*
  33867. This program is distributed under the terms of the MIT license.
  33868. Please see the LICENSE file for details.
  33869. Copyright 2006-2018, OGG, LLC
  33870. */
  33871. /*global define, document, sessionStorage, setTimeout, clearTimeout, ActiveXObject, DOMParser, btoa, atob, module */
  33872. /** Function: $build
  33873. * Create a Strophe.Builder.
  33874. * This is an alias for 'new Strophe.Builder(name, attrs)'.
  33875. *
  33876. * Parameters:
  33877. * (String) name - The root element name.
  33878. * (Object) attrs - The attributes for the root element in object notation.
  33879. *
  33880. * Returns:
  33881. * A new Strophe.Builder object.
  33882. */
  33883. function $build(name, attrs) {
  33884. return new Strophe.Builder(name, attrs);
  33885. }
  33886. /** Function: $msg
  33887. * Create a Strophe.Builder with a <message/> element as the root.
  33888. *
  33889. * Parameters:
  33890. * (Object) attrs - The <message/> element attributes in object notation.
  33891. *
  33892. * Returns:
  33893. * A new Strophe.Builder object.
  33894. */
  33895. function $msg(attrs) {
  33896. return new Strophe.Builder("message", attrs);
  33897. }
  33898. /** Function: $iq
  33899. * Create a Strophe.Builder with an <iq/> element as the root.
  33900. *
  33901. * Parameters:
  33902. * (Object) attrs - The <iq/> element attributes in object notation.
  33903. *
  33904. * Returns:
  33905. * A new Strophe.Builder object.
  33906. */
  33907. function $iq(attrs) {
  33908. return new Strophe.Builder("iq", attrs);
  33909. }
  33910. /** Function: $pres
  33911. * Create a Strophe.Builder with a <presence/> element as the root.
  33912. *
  33913. * Parameters:
  33914. * (Object) attrs - The <presence/> element attributes in object notation.
  33915. *
  33916. * Returns:
  33917. * A new Strophe.Builder object.
  33918. */
  33919. function $pres(attrs) {
  33920. return new Strophe.Builder("presence", attrs);
  33921. }
  33922. /** Class: Strophe
  33923. * An object container for all Strophe library functions.
  33924. *
  33925. * This class is just a container for all the objects and constants
  33926. * used in the library. It is not meant to be instantiated, but to
  33927. * provide a namespace for library objects, constants, and functions.
  33928. */
  33929. var Strophe = {
  33930. /** Constant: VERSION */
  33931. VERSION: "1.3.0",
  33932. /** Constants: XMPP Namespace Constants
  33933. * Common namespace constants from the XMPP RFCs and XEPs.
  33934. *
  33935. * NS.HTTPBIND - HTTP BIND namespace from XEP 124.
  33936. * NS.BOSH - BOSH namespace from XEP 206.
  33937. * NS.CLIENT - Main XMPP client namespace.
  33938. * NS.AUTH - Legacy authentication namespace.
  33939. * NS.ROSTER - Roster operations namespace.
  33940. * NS.PROFILE - Profile namespace.
  33941. * NS.DISCO_INFO - Service discovery info namespace from XEP 30.
  33942. * NS.DISCO_ITEMS - Service discovery items namespace from XEP 30.
  33943. * NS.MUC - Multi-User Chat namespace from XEP 45.
  33944. * NS.SASL - XMPP SASL namespace from RFC 3920.
  33945. * NS.STREAM - XMPP Streams namespace from RFC 3920.
  33946. * NS.BIND - XMPP Binding namespace from RFC 3920.
  33947. * NS.SESSION - XMPP Session namespace from RFC 3920.
  33948. * NS.XHTML_IM - XHTML-IM namespace from XEP 71.
  33949. * NS.XHTML - XHTML body namespace from XEP 71.
  33950. */
  33951. NS: {
  33952. HTTPBIND: "http://jabber.org/protocol/httpbind",
  33953. BOSH: "urn:xmpp:xbosh",
  33954. CLIENT: "jabber:client",
  33955. AUTH: "jabber:iq:auth",
  33956. ROSTER: "jabber:iq:roster",
  33957. PROFILE: "jabber:iq:profile",
  33958. DISCO_INFO: "http://jabber.org/protocol/disco#info",
  33959. DISCO_ITEMS: "http://jabber.org/protocol/disco#items",
  33960. MUC: "http://jabber.org/protocol/muc",
  33961. SASL: "urn:ietf:params:xml:ns:xmpp-sasl",
  33962. STREAM: "http://etherx.jabber.org/streams",
  33963. FRAMING: "urn:ietf:params:xml:ns:xmpp-framing",
  33964. BIND: "urn:ietf:params:xml:ns:xmpp-bind",
  33965. SESSION: "urn:ietf:params:xml:ns:xmpp-session",
  33966. VERSION: "jabber:iq:version",
  33967. STANZAS: "urn:ietf:params:xml:ns:xmpp-stanzas",
  33968. XHTML_IM: "http://jabber.org/protocol/xhtml-im",
  33969. XHTML: "http://www.w3.org/1999/xhtml"
  33970. },
  33971. /** Constants: XHTML_IM Namespace
  33972. * contains allowed tags, tag attributes, and css properties.
  33973. * Used in the createHtml function to filter incoming html into the allowed XHTML-IM subset.
  33974. * See http://xmpp.org/extensions/xep-0071.html#profile-summary for the list of recommended
  33975. * allowed tags and their attributes.
  33976. */
  33977. XHTML: {
  33978. tags: ['a', 'blockquote', 'br', 'cite', 'em', 'img', 'li', 'ol', 'p', 'span', 'strong', 'ul', 'body'],
  33979. attributes: {
  33980. 'a': ['href'],
  33981. 'blockquote': ['style'],
  33982. 'br': [],
  33983. 'cite': ['style'],
  33984. 'em': [],
  33985. 'img': ['src', 'alt', 'style', 'height', 'width'],
  33986. 'li': ['style'],
  33987. 'ol': ['style'],
  33988. 'p': ['style'],
  33989. 'span': ['style'],
  33990. 'strong': [],
  33991. 'ul': ['style'],
  33992. 'body': []
  33993. },
  33994. css: ['background-color', 'color', 'font-family', 'font-size', 'font-style', 'font-weight', 'margin-left', 'margin-right', 'text-align', 'text-decoration'],
  33995. /** Function: XHTML.validTag
  33996. *
  33997. * Utility method to determine whether a tag is allowed
  33998. * in the XHTML_IM namespace.
  33999. *
  34000. * XHTML tag names are case sensitive and must be lower case.
  34001. */
  34002. validTag: function validTag(tag) {
  34003. for (var i = 0; i < Strophe.XHTML.tags.length; i++) {
  34004. if (tag === Strophe.XHTML.tags[i]) {
  34005. return true;
  34006. }
  34007. }
  34008. return false;
  34009. },
  34010. /** Function: XHTML.validAttribute
  34011. *
  34012. * Utility method to determine whether an attribute is allowed
  34013. * as recommended per XEP-0071
  34014. *
  34015. * XHTML attribute names are case sensitive and must be lower case.
  34016. */
  34017. validAttribute: function validAttribute(tag, attribute) {
  34018. if (typeof Strophe.XHTML.attributes[tag] !== 'undefined' && Strophe.XHTML.attributes[tag].length > 0) {
  34019. for (var i = 0; i < Strophe.XHTML.attributes[tag].length; i++) {
  34020. if (attribute === Strophe.XHTML.attributes[tag][i]) {
  34021. return true;
  34022. }
  34023. }
  34024. }
  34025. return false;
  34026. },
  34027. validCSS: function validCSS(style) {
  34028. for (var i = 0; i < Strophe.XHTML.css.length; i++) {
  34029. if (style === Strophe.XHTML.css[i]) {
  34030. return true;
  34031. }
  34032. }
  34033. return false;
  34034. }
  34035. },
  34036. /** Constants: Connection Status Constants
  34037. * Connection status constants for use by the connection handler
  34038. * callback.
  34039. *
  34040. * Status.ERROR - An error has occurred
  34041. * Status.CONNECTING - The connection is currently being made
  34042. * Status.CONNFAIL - The connection attempt failed
  34043. * Status.AUTHENTICATING - The connection is authenticating
  34044. * Status.AUTHFAIL - The authentication attempt failed
  34045. * Status.CONNECTED - The connection has succeeded
  34046. * Status.DISCONNECTED - The connection has been terminated
  34047. * Status.DISCONNECTING - The connection is currently being terminated
  34048. * Status.ATTACHED - The connection has been attached
  34049. * Status.REDIRECT - The connection has been redirected
  34050. * Status.CONNTIMEOUT - The connection has timed out
  34051. */
  34052. Status: {
  34053. ERROR: 0,
  34054. CONNECTING: 1,
  34055. CONNFAIL: 2,
  34056. AUTHENTICATING: 3,
  34057. AUTHFAIL: 4,
  34058. CONNECTED: 5,
  34059. DISCONNECTED: 6,
  34060. DISCONNECTING: 7,
  34061. ATTACHED: 8,
  34062. REDIRECT: 9,
  34063. CONNTIMEOUT: 10
  34064. },
  34065. ErrorCondition: {
  34066. BAD_FORMAT: "bad-format",
  34067. CONFLICT: "conflict",
  34068. MISSING_JID_NODE: "x-strophe-bad-non-anon-jid",
  34069. NO_AUTH_MECH: "no-auth-mech",
  34070. UNKNOWN_REASON: "unknown"
  34071. },
  34072. /** Constants: Log Level Constants
  34073. * Logging level indicators.
  34074. *
  34075. * LogLevel.DEBUG - Debug output
  34076. * LogLevel.INFO - Informational output
  34077. * LogLevel.WARN - Warnings
  34078. * LogLevel.ERROR - Errors
  34079. * LogLevel.FATAL - Fatal errors
  34080. */
  34081. LogLevel: {
  34082. DEBUG: 0,
  34083. INFO: 1,
  34084. WARN: 2,
  34085. ERROR: 3,
  34086. FATAL: 4
  34087. },
  34088. /** PrivateConstants: DOM Element Type Constants
  34089. * DOM element types.
  34090. *
  34091. * ElementType.NORMAL - Normal element.
  34092. * ElementType.TEXT - Text data element.
  34093. * ElementType.FRAGMENT - XHTML fragment element.
  34094. */
  34095. ElementType: {
  34096. NORMAL: 1,
  34097. TEXT: 3,
  34098. CDATA: 4,
  34099. FRAGMENT: 11
  34100. },
  34101. /** PrivateConstants: Timeout Values
  34102. * Timeout values for error states. These values are in seconds.
  34103. * These should not be changed unless you know exactly what you are
  34104. * doing.
  34105. *
  34106. * TIMEOUT - Timeout multiplier. A waiting request will be considered
  34107. * failed after Math.floor(TIMEOUT * wait) seconds have elapsed.
  34108. * This defaults to 1.1, and with default wait, 66 seconds.
  34109. * SECONDARY_TIMEOUT - Secondary timeout multiplier. In cases where
  34110. * Strophe can detect early failure, it will consider the request
  34111. * failed if it doesn't return after
  34112. * Math.floor(SECONDARY_TIMEOUT * wait) seconds have elapsed.
  34113. * This defaults to 0.1, and with default wait, 6 seconds.
  34114. */
  34115. TIMEOUT: 1.1,
  34116. SECONDARY_TIMEOUT: 0.1,
  34117. /** Function: addNamespace
  34118. * This function is used to extend the current namespaces in
  34119. * Strophe.NS. It takes a key and a value with the key being the
  34120. * name of the new namespace, with its actual value.
  34121. * For example:
  34122. * Strophe.addNamespace('PUBSUB', "http://jabber.org/protocol/pubsub");
  34123. *
  34124. * Parameters:
  34125. * (String) name - The name under which the namespace will be
  34126. * referenced under Strophe.NS
  34127. * (String) value - The actual namespace.
  34128. */
  34129. addNamespace: function addNamespace(name, value) {
  34130. Strophe.NS[name] = value;
  34131. },
  34132. /** Function: forEachChild
  34133. * Map a function over some or all child elements of a given element.
  34134. *
  34135. * This is a small convenience function for mapping a function over
  34136. * some or all of the children of an element. If elemName is null, all
  34137. * children will be passed to the function, otherwise only children
  34138. * whose tag names match elemName will be passed.
  34139. *
  34140. * Parameters:
  34141. * (XMLElement) elem - The element to operate on.
  34142. * (String) elemName - The child element tag name filter.
  34143. * (Function) func - The function to apply to each child. This
  34144. * function should take a single argument, a DOM element.
  34145. */
  34146. forEachChild: function forEachChild(elem, elemName, func) {
  34147. for (var i = 0; i < elem.childNodes.length; i++) {
  34148. var childNode = elem.childNodes[i];
  34149. if (childNode.nodeType === Strophe.ElementType.NORMAL && (!elemName || this.isTagEqual(childNode, elemName))) {
  34150. func(childNode);
  34151. }
  34152. }
  34153. },
  34154. /** Function: isTagEqual
  34155. * Compare an element's tag name with a string.
  34156. *
  34157. * This function is case sensitive.
  34158. *
  34159. * Parameters:
  34160. * (XMLElement) el - A DOM element.
  34161. * (String) name - The element name.
  34162. *
  34163. * Returns:
  34164. * true if the element's tag name matches _el_, and false
  34165. * otherwise.
  34166. */
  34167. isTagEqual: function isTagEqual(el, name) {
  34168. return el.tagName === name;
  34169. },
  34170. /** PrivateVariable: _xmlGenerator
  34171. * _Private_ variable that caches a DOM document to
  34172. * generate elements.
  34173. */
  34174. _xmlGenerator: null,
  34175. /** PrivateFunction: _makeGenerator
  34176. * _Private_ function that creates a dummy XML DOM document to serve as
  34177. * an element and text node generator.
  34178. */
  34179. _makeGenerator: function _makeGenerator() {
  34180. var doc; // IE9 does implement createDocument(); however, using it will cause the browser to leak memory on page unload.
  34181. // Here, we test for presence of createDocument() plus IE's proprietary documentMode attribute, which would be
  34182. // less than 10 in the case of IE9 and below.
  34183. if (document.implementation.createDocument === undefined || document.implementation.createDocument && document.documentMode && document.documentMode < 10) {
  34184. doc = this._getIEXmlDom();
  34185. doc.appendChild(doc.createElement('strophe'));
  34186. } else {
  34187. doc = document.implementation.createDocument('jabber:client', 'strophe', null);
  34188. }
  34189. return doc;
  34190. },
  34191. /** Function: xmlGenerator
  34192. * Get the DOM document to generate elements.
  34193. *
  34194. * Returns:
  34195. * The currently used DOM document.
  34196. */
  34197. xmlGenerator: function xmlGenerator() {
  34198. if (!Strophe._xmlGenerator) {
  34199. Strophe._xmlGenerator = Strophe._makeGenerator();
  34200. }
  34201. return Strophe._xmlGenerator;
  34202. },
  34203. /** PrivateFunction: _getIEXmlDom
  34204. * Gets IE xml doc object
  34205. *
  34206. * Returns:
  34207. * A Microsoft XML DOM Object
  34208. * See Also:
  34209. * http://msdn.microsoft.com/en-us/library/ms757837%28VS.85%29.aspx
  34210. */
  34211. _getIEXmlDom: function _getIEXmlDom() {
  34212. var doc = null;
  34213. var docStrings = ["Msxml2.DOMDocument.6.0", "Msxml2.DOMDocument.5.0", "Msxml2.DOMDocument.4.0", "MSXML2.DOMDocument.3.0", "MSXML2.DOMDocument", "MSXML.DOMDocument", "Microsoft.XMLDOM"];
  34214. for (var d = 0; d < docStrings.length; d++) {
  34215. if (doc === null) {
  34216. try {
  34217. doc = new ActiveXObject(docStrings[d]);
  34218. } catch (e) {
  34219. doc = null;
  34220. }
  34221. } else {
  34222. break;
  34223. }
  34224. }
  34225. return doc;
  34226. },
  34227. /** Function: xmlElement
  34228. * Create an XML DOM element.
  34229. *
  34230. * This function creates an XML DOM element correctly across all
  34231. * implementations. Note that these are not HTML DOM elements, which
  34232. * aren't appropriate for XMPP stanzas.
  34233. *
  34234. * Parameters:
  34235. * (String) name - The name for the element.
  34236. * (Array|Object) attrs - An optional array or object containing
  34237. * key/value pairs to use as element attributes. The object should
  34238. * be in the format {'key': 'value'} or {key: 'value'}. The array
  34239. * should have the format [['key1', 'value1'], ['key2', 'value2']].
  34240. * (String) text - The text child data for the element.
  34241. *
  34242. * Returns:
  34243. * A new XML DOM element.
  34244. */
  34245. xmlElement: function xmlElement(name) {
  34246. if (!name) {
  34247. return null;
  34248. }
  34249. var node = Strophe.xmlGenerator().createElement(name); // FIXME: this should throw errors if args are the wrong type or
  34250. // there are more than two optional args
  34251. for (var a = 1; a < arguments.length; a++) {
  34252. var arg = arguments[a];
  34253. if (!arg) {
  34254. continue;
  34255. }
  34256. if (typeof arg === "string" || typeof arg === "number") {
  34257. node.appendChild(Strophe.xmlTextNode(arg));
  34258. } else if (_typeof(arg) === "object" && typeof arg.sort === "function") {
  34259. for (var i = 0; i < arg.length; i++) {
  34260. var attr = arg[i];
  34261. if (_typeof(attr) === "object" && typeof attr.sort === "function" && attr[1] !== undefined && attr[1] !== null) {
  34262. node.setAttribute(attr[0], attr[1]);
  34263. }
  34264. }
  34265. } else if (_typeof(arg) === "object") {
  34266. for (var k in arg) {
  34267. if (Object.prototype.hasOwnProperty.call(arg, k) && arg[k] !== undefined && arg[k] !== null) {
  34268. node.setAttribute(k, arg[k]);
  34269. }
  34270. }
  34271. }
  34272. }
  34273. return node;
  34274. },
  34275. /* Function: xmlescape
  34276. * Excapes invalid xml characters.
  34277. *
  34278. * Parameters:
  34279. * (String) text - text to escape.
  34280. *
  34281. * Returns:
  34282. * Escaped text.
  34283. */
  34284. xmlescape: function xmlescape(text) {
  34285. text = text.replace(/\&/g, "&amp;");
  34286. text = text.replace(/</g, "&lt;");
  34287. text = text.replace(/>/g, "&gt;");
  34288. text = text.replace(/'/g, "&apos;");
  34289. text = text.replace(/"/g, "&quot;");
  34290. return text;
  34291. },
  34292. /* Function: xmlunescape
  34293. * Unexcapes invalid xml characters.
  34294. *
  34295. * Parameters:
  34296. * (String) text - text to unescape.
  34297. *
  34298. * Returns:
  34299. * Unescaped text.
  34300. */
  34301. xmlunescape: function xmlunescape(text) {
  34302. text = text.replace(/\&amp;/g, "&");
  34303. text = text.replace(/&lt;/g, "<");
  34304. text = text.replace(/&gt;/g, ">");
  34305. text = text.replace(/&apos;/g, "'");
  34306. text = text.replace(/&quot;/g, "\"");
  34307. return text;
  34308. },
  34309. /** Function: xmlTextNode
  34310. * Creates an XML DOM text node.
  34311. *
  34312. * Provides a cross implementation version of document.createTextNode.
  34313. *
  34314. * Parameters:
  34315. * (String) text - The content of the text node.
  34316. *
  34317. * Returns:
  34318. * A new XML DOM text node.
  34319. */
  34320. xmlTextNode: function xmlTextNode(text) {
  34321. return Strophe.xmlGenerator().createTextNode(text);
  34322. },
  34323. /** Function: xmlHtmlNode
  34324. * Creates an XML DOM html node.
  34325. *
  34326. * Parameters:
  34327. * (String) html - The content of the html node.
  34328. *
  34329. * Returns:
  34330. * A new XML DOM text node.
  34331. */
  34332. xmlHtmlNode: function xmlHtmlNode(html) {
  34333. var node; //ensure text is escaped
  34334. if (DOMParser) {
  34335. var parser = new DOMParser();
  34336. node = parser.parseFromString(html, "text/xml");
  34337. } else {
  34338. node = new ActiveXObject("Microsoft.XMLDOM");
  34339. node.async = "false";
  34340. node.loadXML(html);
  34341. }
  34342. return node;
  34343. },
  34344. /** Function: getText
  34345. * Get the concatenation of all text children of an element.
  34346. *
  34347. * Parameters:
  34348. * (XMLElement) elem - A DOM element.
  34349. *
  34350. * Returns:
  34351. * A String with the concatenated text of all text element children.
  34352. */
  34353. getText: function getText(elem) {
  34354. if (!elem) {
  34355. return null;
  34356. }
  34357. var str = "";
  34358. if (elem.childNodes.length === 0 && elem.nodeType === Strophe.ElementType.TEXT) {
  34359. str += elem.nodeValue;
  34360. }
  34361. for (var i = 0; i < elem.childNodes.length; i++) {
  34362. if (elem.childNodes[i].nodeType === Strophe.ElementType.TEXT) {
  34363. str += elem.childNodes[i].nodeValue;
  34364. }
  34365. }
  34366. return Strophe.xmlescape(str);
  34367. },
  34368. /** Function: copyElement
  34369. * Copy an XML DOM element.
  34370. *
  34371. * This function copies a DOM element and all its descendants and returns
  34372. * the new copy.
  34373. *
  34374. * Parameters:
  34375. * (XMLElement) elem - A DOM element.
  34376. *
  34377. * Returns:
  34378. * A new, copied DOM element tree.
  34379. */
  34380. copyElement: function copyElement(elem) {
  34381. var el;
  34382. if (elem.nodeType === Strophe.ElementType.NORMAL) {
  34383. el = Strophe.xmlElement(elem.tagName);
  34384. for (var i = 0; i < elem.attributes.length; i++) {
  34385. el.setAttribute(elem.attributes[i].nodeName, elem.attributes[i].value);
  34386. }
  34387. for (var _i = 0; _i < elem.childNodes.length; _i++) {
  34388. el.appendChild(Strophe.copyElement(elem.childNodes[_i]));
  34389. }
  34390. } else if (elem.nodeType === Strophe.ElementType.TEXT) {
  34391. el = Strophe.xmlGenerator().createTextNode(elem.nodeValue);
  34392. }
  34393. return el;
  34394. },
  34395. /** Function: createHtml
  34396. * Copy an HTML DOM element into an XML DOM.
  34397. *
  34398. * This function copies a DOM element and all its descendants and returns
  34399. * the new copy.
  34400. *
  34401. * Parameters:
  34402. * (HTMLElement) elem - A DOM element.
  34403. *
  34404. * Returns:
  34405. * A new, copied DOM element tree.
  34406. */
  34407. createHtml: function createHtml(elem) {
  34408. var el;
  34409. if (elem.nodeType === Strophe.ElementType.NORMAL) {
  34410. var tag = elem.nodeName.toLowerCase(); // XHTML tags must be lower case.
  34411. if (Strophe.XHTML.validTag(tag)) {
  34412. try {
  34413. el = Strophe.xmlElement(tag);
  34414. for (var i = 0; i < Strophe.XHTML.attributes[tag].length; i++) {
  34415. var attribute = Strophe.XHTML.attributes[tag][i];
  34416. var value = elem.getAttribute(attribute);
  34417. if (typeof value === 'undefined' || value === null || value === '' || value === false || value === 0) {
  34418. continue;
  34419. }
  34420. if (attribute === 'style' && _typeof(value) === 'object' && typeof value.cssText !== 'undefined') {
  34421. value = value.cssText; // we're dealing with IE, need to get CSS out
  34422. } // filter out invalid css styles
  34423. if (attribute === 'style') {
  34424. var css = [];
  34425. var cssAttrs = value.split(';');
  34426. for (var j = 0; j < cssAttrs.length; j++) {
  34427. var attr = cssAttrs[j].split(':');
  34428. var cssName = attr[0].replace(/^\s*/, "").replace(/\s*$/, "").toLowerCase();
  34429. if (Strophe.XHTML.validCSS(cssName)) {
  34430. var cssValue = attr[1].replace(/^\s*/, "").replace(/\s*$/, "");
  34431. css.push(cssName + ': ' + cssValue);
  34432. }
  34433. }
  34434. if (css.length > 0) {
  34435. value = css.join('; ');
  34436. el.setAttribute(attribute, value);
  34437. }
  34438. } else {
  34439. el.setAttribute(attribute, value);
  34440. }
  34441. }
  34442. for (var _i2 = 0; _i2 < elem.childNodes.length; _i2++) {
  34443. el.appendChild(Strophe.createHtml(elem.childNodes[_i2]));
  34444. }
  34445. } catch (e) {
  34446. // invalid elements
  34447. el = Strophe.xmlTextNode('');
  34448. }
  34449. } else {
  34450. el = Strophe.xmlGenerator().createDocumentFragment();
  34451. for (var _i3 = 0; _i3 < elem.childNodes.length; _i3++) {
  34452. el.appendChild(Strophe.createHtml(elem.childNodes[_i3]));
  34453. }
  34454. }
  34455. } else if (elem.nodeType === Strophe.ElementType.FRAGMENT) {
  34456. el = Strophe.xmlGenerator().createDocumentFragment();
  34457. for (var _i4 = 0; _i4 < elem.childNodes.length; _i4++) {
  34458. el.appendChild(Strophe.createHtml(elem.childNodes[_i4]));
  34459. }
  34460. } else if (elem.nodeType === Strophe.ElementType.TEXT) {
  34461. el = Strophe.xmlTextNode(elem.nodeValue);
  34462. }
  34463. return el;
  34464. },
  34465. /** Function: escapeNode
  34466. * Escape the node part (also called local part) of a JID.
  34467. *
  34468. * Parameters:
  34469. * (String) node - A node (or local part).
  34470. *
  34471. * Returns:
  34472. * An escaped node (or local part).
  34473. */
  34474. escapeNode: function escapeNode(node) {
  34475. if (typeof node !== "string") {
  34476. return node;
  34477. }
  34478. return node.replace(/^\s+|\s+$/g, '').replace(/\\/g, "\\5c").replace(/ /g, "\\20").replace(/\"/g, "\\22").replace(/\&/g, "\\26").replace(/\'/g, "\\27").replace(/\//g, "\\2f").replace(/:/g, "\\3a").replace(/</g, "\\3c").replace(/>/g, "\\3e").replace(/@/g, "\\40");
  34479. },
  34480. /** Function: unescapeNode
  34481. * Unescape a node part (also called local part) of a JID.
  34482. *
  34483. * Parameters:
  34484. * (String) node - A node (or local part).
  34485. *
  34486. * Returns:
  34487. * An unescaped node (or local part).
  34488. */
  34489. unescapeNode: function unescapeNode(node) {
  34490. if (typeof node !== "string") {
  34491. return node;
  34492. }
  34493. return node.replace(/\\20/g, " ").replace(/\\22/g, '"').replace(/\\26/g, "&").replace(/\\27/g, "'").replace(/\\2f/g, "/").replace(/\\3a/g, ":").replace(/\\3c/g, "<").replace(/\\3e/g, ">").replace(/\\40/g, "@").replace(/\\5c/g, "\\");
  34494. },
  34495. /** Function: getNodeFromJid
  34496. * Get the node portion of a JID String.
  34497. *
  34498. * Parameters:
  34499. * (String) jid - A JID.
  34500. *
  34501. * Returns:
  34502. * A String containing the node.
  34503. */
  34504. getNodeFromJid: function getNodeFromJid(jid) {
  34505. if (jid.indexOf("@") < 0) {
  34506. return null;
  34507. }
  34508. return jid.split("@")[0];
  34509. },
  34510. /** Function: getDomainFromJid
  34511. * Get the domain portion of a JID String.
  34512. *
  34513. * Parameters:
  34514. * (String) jid - A JID.
  34515. *
  34516. * Returns:
  34517. * A String containing the domain.
  34518. */
  34519. getDomainFromJid: function getDomainFromJid(jid) {
  34520. var bare = Strophe.getBareJidFromJid(jid);
  34521. if (bare.indexOf("@") < 0) {
  34522. return bare;
  34523. } else {
  34524. var parts = bare.split("@");
  34525. parts.splice(0, 1);
  34526. return parts.join('@');
  34527. }
  34528. },
  34529. /** Function: getResourceFromJid
  34530. * Get the resource portion of a JID String.
  34531. *
  34532. * Parameters:
  34533. * (String) jid - A JID.
  34534. *
  34535. * Returns:
  34536. * A String containing the resource.
  34537. */
  34538. getResourceFromJid: function getResourceFromJid(jid) {
  34539. var s = jid.split("/");
  34540. if (s.length < 2) {
  34541. return null;
  34542. }
  34543. s.splice(0, 1);
  34544. return s.join('/');
  34545. },
  34546. /** Function: getBareJidFromJid
  34547. * Get the bare JID from a JID String.
  34548. *
  34549. * Parameters:
  34550. * (String) jid - A JID.
  34551. *
  34552. * Returns:
  34553. * A String containing the bare JID.
  34554. */
  34555. getBareJidFromJid: function getBareJidFromJid(jid) {
  34556. return jid ? jid.split("/")[0] : null;
  34557. },
  34558. /** PrivateFunction: _handleError
  34559. * _Private_ function that properly logs an error to the console
  34560. */
  34561. _handleError: function _handleError(e) {
  34562. if (typeof e.stack !== "undefined") {
  34563. Strophe.fatal(e.stack);
  34564. }
  34565. if (e.sourceURL) {
  34566. Strophe.fatal("error: " + this.handler + " " + e.sourceURL + ":" + e.line + " - " + e.name + ": " + e.message);
  34567. } else if (e.fileName) {
  34568. Strophe.fatal("error: " + this.handler + " " + e.fileName + ":" + e.lineNumber + " - " + e.name + ": " + e.message);
  34569. } else {
  34570. Strophe.fatal("error: " + e.message);
  34571. }
  34572. },
  34573. /** Function: log
  34574. * User overrideable logging function.
  34575. *
  34576. * This function is called whenever the Strophe library calls any
  34577. * of the logging functions. The default implementation of this
  34578. * function logs only fatal errors. If client code wishes to handle the logging
  34579. * messages, it should override this with
  34580. * > Strophe.log = function (level, msg) {
  34581. * > (user code here)
  34582. * > };
  34583. *
  34584. * Please note that data sent and received over the wire is logged
  34585. * via Strophe.Connection.rawInput() and Strophe.Connection.rawOutput().
  34586. *
  34587. * The different levels and their meanings are
  34588. *
  34589. * DEBUG - Messages useful for debugging purposes.
  34590. * INFO - Informational messages. This is mostly information like
  34591. * 'disconnect was called' or 'SASL auth succeeded'.
  34592. * WARN - Warnings about potential problems. This is mostly used
  34593. * to report transient connection errors like request timeouts.
  34594. * ERROR - Some error occurred.
  34595. * FATAL - A non-recoverable fatal error occurred.
  34596. *
  34597. * Parameters:
  34598. * (Integer) level - The log level of the log message. This will
  34599. * be one of the values in Strophe.LogLevel.
  34600. * (String) msg - The log message.
  34601. */
  34602. log: function log(level, msg) {
  34603. if (level === this.LogLevel.FATAL && _typeof(window.console) === 'object' && typeof window.console.error === 'function') {
  34604. window.console.error(msg);
  34605. }
  34606. },
  34607. /** Function: debug
  34608. * Log a message at the Strophe.LogLevel.DEBUG level.
  34609. *
  34610. * Parameters:
  34611. * (String) msg - The log message.
  34612. */
  34613. debug: function debug(msg) {
  34614. this.log(this.LogLevel.DEBUG, msg);
  34615. },
  34616. /** Function: info
  34617. * Log a message at the Strophe.LogLevel.INFO level.
  34618. *
  34619. * Parameters:
  34620. * (String) msg - The log message.
  34621. */
  34622. info: function info(msg) {
  34623. this.log(this.LogLevel.INFO, msg);
  34624. },
  34625. /** Function: warn
  34626. * Log a message at the Strophe.LogLevel.WARN level.
  34627. *
  34628. * Parameters:
  34629. * (String) msg - The log message.
  34630. */
  34631. warn: function warn(msg) {
  34632. this.log(this.LogLevel.WARN, msg);
  34633. },
  34634. /** Function: error
  34635. * Log a message at the Strophe.LogLevel.ERROR level.
  34636. *
  34637. * Parameters:
  34638. * (String) msg - The log message.
  34639. */
  34640. error: function error(msg) {
  34641. this.log(this.LogLevel.ERROR, msg);
  34642. },
  34643. /** Function: fatal
  34644. * Log a message at the Strophe.LogLevel.FATAL level.
  34645. *
  34646. * Parameters:
  34647. * (String) msg - The log message.
  34648. */
  34649. fatal: function fatal(msg) {
  34650. this.log(this.LogLevel.FATAL, msg);
  34651. },
  34652. /** Function: serialize
  34653. * Render a DOM element and all descendants to a String.
  34654. *
  34655. * Parameters:
  34656. * (XMLElement) elem - A DOM element.
  34657. *
  34658. * Returns:
  34659. * The serialized element tree as a String.
  34660. */
  34661. serialize: function serialize(elem) {
  34662. if (!elem) {
  34663. return null;
  34664. }
  34665. if (typeof elem.tree === "function") {
  34666. elem = elem.tree();
  34667. }
  34668. var names = _toConsumableArray(Array(elem.attributes.length).keys()).map(function (i) {
  34669. return elem.attributes[i].nodeName;
  34670. });
  34671. names.sort();
  34672. var result = names.reduce(function (a, n) {
  34673. return "".concat(a, " ").concat(n, "=\"").concat(Strophe.xmlescape(elem.attributes.getNamedItem(n).value), "\"");
  34674. }, "<".concat(elem.nodeName));
  34675. if (elem.childNodes.length > 0) {
  34676. result += ">";
  34677. for (var i = 0; i < elem.childNodes.length; i++) {
  34678. var child = elem.childNodes[i];
  34679. switch (child.nodeType) {
  34680. case Strophe.ElementType.NORMAL:
  34681. // normal element, so recurse
  34682. result += Strophe.serialize(child);
  34683. break;
  34684. case Strophe.ElementType.TEXT:
  34685. // text element to escape values
  34686. result += Strophe.xmlescape(child.nodeValue);
  34687. break;
  34688. case Strophe.ElementType.CDATA:
  34689. // cdata section so don't escape values
  34690. result += "<![CDATA[" + child.nodeValue + "]]>";
  34691. }
  34692. }
  34693. result += "</" + elem.nodeName + ">";
  34694. } else {
  34695. result += "/>";
  34696. }
  34697. return result;
  34698. },
  34699. /** PrivateVariable: _requestId
  34700. * _Private_ variable that keeps track of the request ids for
  34701. * connections.
  34702. */
  34703. _requestId: 0,
  34704. /** PrivateVariable: Strophe.connectionPlugins
  34705. * _Private_ variable Used to store plugin names that need
  34706. * initialization on Strophe.Connection construction.
  34707. */
  34708. _connectionPlugins: {},
  34709. /** Function: addConnectionPlugin
  34710. * Extends the Strophe.Connection object with the given plugin.
  34711. *
  34712. * Parameters:
  34713. * (String) name - The name of the extension.
  34714. * (Object) ptype - The plugin's prototype.
  34715. */
  34716. addConnectionPlugin: function addConnectionPlugin(name, ptype) {
  34717. Strophe._connectionPlugins[name] = ptype;
  34718. }
  34719. };
  34720. /** Class: Strophe.Builder
  34721. * XML DOM builder.
  34722. *
  34723. * This object provides an interface similar to JQuery but for building
  34724. * DOM elements easily and rapidly. All the functions except for toString()
  34725. * and tree() return the object, so calls can be chained. Here's an
  34726. * example using the $iq() builder helper.
  34727. * > $iq({to: 'you', from: 'me', type: 'get', id: '1'})
  34728. * > .c('query', {xmlns: 'strophe:example'})
  34729. * > .c('example')
  34730. * > .toString()
  34731. *
  34732. * The above generates this XML fragment
  34733. * > <iq to='you' from='me' type='get' id='1'>
  34734. * > <query xmlns='strophe:example'>
  34735. * > <example/>
  34736. * > </query>
  34737. * > </iq>
  34738. * The corresponding DOM manipulations to get a similar fragment would be
  34739. * a lot more tedious and probably involve several helper variables.
  34740. *
  34741. * Since adding children makes new operations operate on the child, up()
  34742. * is provided to traverse up the tree. To add two children, do
  34743. * > builder.c('child1', ...).up().c('child2', ...)
  34744. * The next operation on the Builder will be relative to the second child.
  34745. */
  34746. /** Constructor: Strophe.Builder
  34747. * Create a Strophe.Builder object.
  34748. *
  34749. * The attributes should be passed in object notation. For example
  34750. * > let b = new Builder('message', {to: 'you', from: 'me'});
  34751. * or
  34752. * > let b = new Builder('messsage', {'xml:lang': 'en'});
  34753. *
  34754. * Parameters:
  34755. * (String) name - The name of the root element.
  34756. * (Object) attrs - The attributes for the root element in object notation.
  34757. *
  34758. * Returns:
  34759. * A new Strophe.Builder.
  34760. */
  34761. Strophe.Builder = function (name, attrs) {
  34762. // Set correct namespace for jabber:client elements
  34763. if (name === "presence" || name === "message" || name === "iq") {
  34764. if (attrs && !attrs.xmlns) {
  34765. attrs.xmlns = Strophe.NS.CLIENT;
  34766. } else if (!attrs) {
  34767. attrs = {
  34768. xmlns: Strophe.NS.CLIENT
  34769. };
  34770. }
  34771. } // Holds the tree being built.
  34772. this.nodeTree = Strophe.xmlElement(name, attrs); // Points to the current operation node.
  34773. this.node = this.nodeTree;
  34774. };
  34775. Strophe.Builder.prototype = {
  34776. /** Function: tree
  34777. * Return the DOM tree.
  34778. *
  34779. * This function returns the current DOM tree as an element object. This
  34780. * is suitable for passing to functions like Strophe.Connection.send().
  34781. *
  34782. * Returns:
  34783. * The DOM tree as a element object.
  34784. */
  34785. tree: function tree() {
  34786. return this.nodeTree;
  34787. },
  34788. /** Function: toString
  34789. * Serialize the DOM tree to a String.
  34790. *
  34791. * This function returns a string serialization of the current DOM
  34792. * tree. It is often used internally to pass data to a
  34793. * Strophe.Request object.
  34794. *
  34795. * Returns:
  34796. * The serialized DOM tree in a String.
  34797. */
  34798. toString: function toString() {
  34799. return Strophe.serialize(this.nodeTree);
  34800. },
  34801. /** Function: up
  34802. * Make the current parent element the new current element.
  34803. *
  34804. * This function is often used after c() to traverse back up the tree.
  34805. * For example, to add two children to the same element
  34806. * > builder.c('child1', {}).up().c('child2', {});
  34807. *
  34808. * Returns:
  34809. * The Stophe.Builder object.
  34810. */
  34811. up: function up() {
  34812. this.node = this.node.parentNode;
  34813. return this;
  34814. },
  34815. /** Function: root
  34816. * Make the root element the new current element.
  34817. *
  34818. * When at a deeply nested element in the tree, this function can be used
  34819. * to jump back to the root of the tree, instead of having to repeatedly
  34820. * call up().
  34821. *
  34822. * Returns:
  34823. * The Stophe.Builder object.
  34824. */
  34825. root: function root() {
  34826. this.node = this.nodeTree;
  34827. return this;
  34828. },
  34829. /** Function: attrs
  34830. * Add or modify attributes of the current element.
  34831. *
  34832. * The attributes should be passed in object notation. This function
  34833. * does not move the current element pointer.
  34834. *
  34835. * Parameters:
  34836. * (Object) moreattrs - The attributes to add/modify in object notation.
  34837. *
  34838. * Returns:
  34839. * The Strophe.Builder object.
  34840. */
  34841. attrs: function attrs(moreattrs) {
  34842. for (var k in moreattrs) {
  34843. if (Object.prototype.hasOwnProperty.call(moreattrs, k)) {
  34844. if (moreattrs[k] === undefined) {
  34845. this.node.removeAttribute(k);
  34846. } else {
  34847. this.node.setAttribute(k, moreattrs[k]);
  34848. }
  34849. }
  34850. }
  34851. return this;
  34852. },
  34853. /** Function: c
  34854. * Add a child to the current element and make it the new current
  34855. * element.
  34856. *
  34857. * This function moves the current element pointer to the child,
  34858. * unless text is provided. If you need to add another child, it
  34859. * is necessary to use up() to go back to the parent in the tree.
  34860. *
  34861. * Parameters:
  34862. * (String) name - The name of the child.
  34863. * (Object) attrs - The attributes of the child in object notation.
  34864. * (String) text - The text to add to the child.
  34865. *
  34866. * Returns:
  34867. * The Strophe.Builder object.
  34868. */
  34869. c: function c(name, attrs, text) {
  34870. var child = Strophe.xmlElement(name, attrs, text);
  34871. this.node.appendChild(child);
  34872. if (typeof text !== "string" && typeof text !== "number") {
  34873. this.node = child;
  34874. }
  34875. return this;
  34876. },
  34877. /** Function: cnode
  34878. * Add a child to the current element and make it the new current
  34879. * element.
  34880. *
  34881. * This function is the same as c() except that instead of using a
  34882. * name and an attributes object to create the child it uses an
  34883. * existing DOM element object.
  34884. *
  34885. * Parameters:
  34886. * (XMLElement) elem - A DOM element.
  34887. *
  34888. * Returns:
  34889. * The Strophe.Builder object.
  34890. */
  34891. cnode: function cnode(elem) {
  34892. var impNode;
  34893. var xmlGen = Strophe.xmlGenerator();
  34894. try {
  34895. impNode = xmlGen.importNode !== undefined;
  34896. } catch (e) {
  34897. impNode = false;
  34898. }
  34899. var newElem = impNode ? xmlGen.importNode(elem, true) : Strophe.copyElement(elem);
  34900. this.node.appendChild(newElem);
  34901. this.node = newElem;
  34902. return this;
  34903. },
  34904. /** Function: t
  34905. * Add a child text element.
  34906. *
  34907. * This *does not* make the child the new current element since there
  34908. * are no children of text elements.
  34909. *
  34910. * Parameters:
  34911. * (String) text - The text data to append to the current element.
  34912. *
  34913. * Returns:
  34914. * The Strophe.Builder object.
  34915. */
  34916. t: function t(text) {
  34917. var child = Strophe.xmlTextNode(text);
  34918. this.node.appendChild(child);
  34919. return this;
  34920. },
  34921. /** Function: h
  34922. * Replace current element contents with the HTML passed in.
  34923. *
  34924. * This *does not* make the child the new current element
  34925. *
  34926. * Parameters:
  34927. * (String) html - The html to insert as contents of current element.
  34928. *
  34929. * Returns:
  34930. * The Strophe.Builder object.
  34931. */
  34932. h: function h(html) {
  34933. var fragment = document.createElement('body'); // force the browser to try and fix any invalid HTML tags
  34934. fragment.innerHTML = html; // copy cleaned html into an xml dom
  34935. var xhtml = Strophe.createHtml(fragment);
  34936. while (xhtml.childNodes.length > 0) {
  34937. this.node.appendChild(xhtml.childNodes[0]);
  34938. }
  34939. return this;
  34940. }
  34941. };
  34942. /** PrivateClass: Strophe.Handler
  34943. * _Private_ helper class for managing stanza handlers.
  34944. *
  34945. * A Strophe.Handler encapsulates a user provided callback function to be
  34946. * executed when matching stanzas are received by the connection.
  34947. * Handlers can be either one-off or persistant depending on their
  34948. * return value. Returning true will cause a Handler to remain active, and
  34949. * returning false will remove the Handler.
  34950. *
  34951. * Users will not use Strophe.Handler objects directly, but instead they
  34952. * will use Strophe.Connection.addHandler() and
  34953. * Strophe.Connection.deleteHandler().
  34954. */
  34955. /** PrivateConstructor: Strophe.Handler
  34956. * Create and initialize a new Strophe.Handler.
  34957. *
  34958. * Parameters:
  34959. * (Function) handler - A function to be executed when the handler is run.
  34960. * (String) ns - The namespace to match.
  34961. * (String) name - The element name to match.
  34962. * (String) type - The element type to match.
  34963. * (String) id - The element id attribute to match.
  34964. * (String) from - The element from attribute to match.
  34965. * (Object) options - Handler options
  34966. *
  34967. * Returns:
  34968. * A new Strophe.Handler object.
  34969. */
  34970. Strophe.Handler = function (handler, ns, name, type, id, from, options) {
  34971. this.handler = handler;
  34972. this.ns = ns;
  34973. this.name = name;
  34974. this.type = type;
  34975. this.id = id;
  34976. this.options = options || {
  34977. 'matchBareFromJid': false,
  34978. 'ignoreNamespaceFragment': false
  34979. }; // BBB: Maintain backward compatibility with old `matchBare` option
  34980. if (this.options.matchBare) {
  34981. Strophe.warn('The "matchBare" option is deprecated, use "matchBareFromJid" instead.');
  34982. this.options.matchBareFromJid = this.options.matchBare;
  34983. delete this.options.matchBare;
  34984. }
  34985. if (this.options.matchBareFromJid) {
  34986. this.from = from ? Strophe.getBareJidFromJid(from) : null;
  34987. } else {
  34988. this.from = from;
  34989. } // whether the handler is a user handler or a system handler
  34990. this.user = true;
  34991. };
  34992. Strophe.Handler.prototype = {
  34993. /** PrivateFunction: getNamespace
  34994. * Returns the XML namespace attribute on an element.
  34995. * If `ignoreNamespaceFragment` was passed in for this handler, then the
  34996. * URL fragment will be stripped.
  34997. *
  34998. * Parameters:
  34999. * (XMLElement) elem - The XML element with the namespace.
  35000. *
  35001. * Returns:
  35002. * The namespace, with optionally the fragment stripped.
  35003. */
  35004. getNamespace: function getNamespace(elem) {
  35005. var elNamespace = elem.getAttribute("xmlns");
  35006. if (elNamespace && this.options.ignoreNamespaceFragment) {
  35007. elNamespace = elNamespace.split('#')[0];
  35008. }
  35009. return elNamespace;
  35010. },
  35011. /** PrivateFunction: namespaceMatch
  35012. * Tests if a stanza matches the namespace set for this Strophe.Handler.
  35013. *
  35014. * Parameters:
  35015. * (XMLElement) elem - The XML element to test.
  35016. *
  35017. * Returns:
  35018. * true if the stanza matches and false otherwise.
  35019. */
  35020. namespaceMatch: function namespaceMatch(elem) {
  35021. var _this = this;
  35022. var nsMatch = false;
  35023. if (!this.ns) {
  35024. return true;
  35025. } else {
  35026. Strophe.forEachChild(elem, null, function (elem) {
  35027. if (_this.getNamespace(elem) === _this.ns) {
  35028. nsMatch = true;
  35029. }
  35030. });
  35031. return nsMatch || this.getNamespace(elem) === this.ns;
  35032. }
  35033. },
  35034. /** PrivateFunction: isMatch
  35035. * Tests if a stanza matches the Strophe.Handler.
  35036. *
  35037. * Parameters:
  35038. * (XMLElement) elem - The XML element to test.
  35039. *
  35040. * Returns:
  35041. * true if the stanza matches and false otherwise.
  35042. */
  35043. isMatch: function isMatch(elem) {
  35044. var from = elem.getAttribute('from');
  35045. if (this.options.matchBareFromJid) {
  35046. from = Strophe.getBareJidFromJid(from);
  35047. }
  35048. var elem_type = elem.getAttribute("type");
  35049. if (this.namespaceMatch(elem) && (!this.name || Strophe.isTagEqual(elem, this.name)) && (!this.type || (Array.isArray(this.type) ? this.type.indexOf(elem_type) !== -1 : elem_type === this.type)) && (!this.id || elem.getAttribute("id") === this.id) && (!this.from || from === this.from)) {
  35050. return true;
  35051. }
  35052. return false;
  35053. },
  35054. /** PrivateFunction: run
  35055. * Run the callback on a matching stanza.
  35056. *
  35057. * Parameters:
  35058. * (XMLElement) elem - The DOM element that triggered the
  35059. * Strophe.Handler.
  35060. *
  35061. * Returns:
  35062. * A boolean indicating if the handler should remain active.
  35063. */
  35064. run: function run(elem) {
  35065. var result = null;
  35066. try {
  35067. result = this.handler(elem);
  35068. } catch (e) {
  35069. Strophe._handleError(e);
  35070. throw e;
  35071. }
  35072. return result;
  35073. },
  35074. /** PrivateFunction: toString
  35075. * Get a String representation of the Strophe.Handler object.
  35076. *
  35077. * Returns:
  35078. * A String.
  35079. */
  35080. toString: function toString() {
  35081. return "{Handler: " + this.handler + "(" + this.name + "," + this.id + "," + this.ns + ")}";
  35082. }
  35083. };
  35084. /** PrivateClass: Strophe.TimedHandler
  35085. * _Private_ helper class for managing timed handlers.
  35086. *
  35087. * A Strophe.TimedHandler encapsulates a user provided callback that
  35088. * should be called after a certain period of time or at regular
  35089. * intervals. The return value of the callback determines whether the
  35090. * Strophe.TimedHandler will continue to fire.
  35091. *
  35092. * Users will not use Strophe.TimedHandler objects directly, but instead
  35093. * they will use Strophe.Connection.addTimedHandler() and
  35094. * Strophe.Connection.deleteTimedHandler().
  35095. */
  35096. /** PrivateConstructor: Strophe.TimedHandler
  35097. * Create and initialize a new Strophe.TimedHandler object.
  35098. *
  35099. * Parameters:
  35100. * (Integer) period - The number of milliseconds to wait before the
  35101. * handler is called.
  35102. * (Function) handler - The callback to run when the handler fires. This
  35103. * function should take no arguments.
  35104. *
  35105. * Returns:
  35106. * A new Strophe.TimedHandler object.
  35107. */
  35108. Strophe.TimedHandler = function (period, handler) {
  35109. this.period = period;
  35110. this.handler = handler;
  35111. this.lastCalled = new Date().getTime();
  35112. this.user = true;
  35113. };
  35114. Strophe.TimedHandler.prototype = {
  35115. /** PrivateFunction: run
  35116. * Run the callback for the Strophe.TimedHandler.
  35117. *
  35118. * Returns:
  35119. * true if the Strophe.TimedHandler should be called again, and false
  35120. * otherwise.
  35121. */
  35122. run: function run() {
  35123. this.lastCalled = new Date().getTime();
  35124. return this.handler();
  35125. },
  35126. /** PrivateFunction: reset
  35127. * Reset the last called time for the Strophe.TimedHandler.
  35128. */
  35129. reset: function reset() {
  35130. this.lastCalled = new Date().getTime();
  35131. },
  35132. /** PrivateFunction: toString
  35133. * Get a string representation of the Strophe.TimedHandler object.
  35134. *
  35135. * Returns:
  35136. * The string representation.
  35137. */
  35138. toString: function toString() {
  35139. return "{TimedHandler: " + this.handler + "(" + this.period + ")}";
  35140. }
  35141. };
  35142. /** Class: Strophe.Connection
  35143. * XMPP Connection manager.
  35144. *
  35145. * This class is the main part of Strophe. It manages a BOSH or websocket
  35146. * connection to an XMPP server and dispatches events to the user callbacks
  35147. * as data arrives. It supports SASL PLAIN, SASL DIGEST-MD5, SASL SCRAM-SHA1
  35148. * and legacy authentication.
  35149. *
  35150. * After creating a Strophe.Connection object, the user will typically
  35151. * call connect() with a user supplied callback to handle connection level
  35152. * events like authentication failure, disconnection, or connection
  35153. * complete.
  35154. *
  35155. * The user will also have several event handlers defined by using
  35156. * addHandler() and addTimedHandler(). These will allow the user code to
  35157. * respond to interesting stanzas or do something periodically with the
  35158. * connection. These handlers will be active once authentication is
  35159. * finished.
  35160. *
  35161. * To send data to the connection, use send().
  35162. */
  35163. /** Constructor: Strophe.Connection
  35164. * Create and initialize a Strophe.Connection object.
  35165. *
  35166. * The transport-protocol for this connection will be chosen automatically
  35167. * based on the given service parameter. URLs starting with "ws://" or
  35168. * "wss://" will use WebSockets, URLs starting with "http://", "https://"
  35169. * or without a protocol will use BOSH.
  35170. *
  35171. * To make Strophe connect to the current host you can leave out the protocol
  35172. * and host part and just pass the path, e.g.
  35173. *
  35174. * > let conn = new Strophe.Connection("/http-bind/");
  35175. *
  35176. * Options common to both Websocket and BOSH:
  35177. * ------------------------------------------
  35178. *
  35179. * cookies:
  35180. *
  35181. * The *cookies* option allows you to pass in cookies to be added to the
  35182. * document. These cookies will then be included in the BOSH XMLHttpRequest
  35183. * or in the websocket connection.
  35184. *
  35185. * The passed in value must be a map of cookie names and string values.
  35186. *
  35187. * > { "myCookie": {
  35188. * > "value": "1234",
  35189. * > "domain": ".example.org",
  35190. * > "path": "/",
  35191. * > "expires": expirationDate
  35192. * > }
  35193. * > }
  35194. *
  35195. * Note that cookies can't be set in this way for other domains (i.e. cross-domain).
  35196. * Those cookies need to be set under those domains, for example they can be
  35197. * set server-side by making a XHR call to that domain to ask it to set any
  35198. * necessary cookies.
  35199. *
  35200. * mechanisms:
  35201. *
  35202. * The *mechanisms* option allows you to specify the SASL mechanisms that this
  35203. * instance of Strophe.Connection (and therefore your XMPP client) will
  35204. * support.
  35205. *
  35206. * The value must be an array of objects with Strophe.SASLMechanism
  35207. * prototypes.
  35208. *
  35209. * If nothing is specified, then the following mechanisms (and their
  35210. * priorities) are registered:
  35211. *
  35212. * SCRAM-SHA1 - 70
  35213. * DIGEST-MD5 - 60
  35214. * PLAIN - 50
  35215. * OAUTH-BEARER - 40
  35216. * OAUTH-2 - 30
  35217. * ANONYMOUS - 20
  35218. * EXTERNAL - 10
  35219. *
  35220. * WebSocket options:
  35221. * ------------------
  35222. *
  35223. * If you want to connect to the current host with a WebSocket connection you
  35224. * can tell Strophe to use WebSockets through a "protocol" attribute in the
  35225. * optional options parameter. Valid values are "ws" for WebSocket and "wss"
  35226. * for Secure WebSocket.
  35227. * So to connect to "wss://CURRENT_HOSTNAME/xmpp-websocket" you would call
  35228. *
  35229. * > let conn = new Strophe.Connection("/xmpp-websocket/", {protocol: "wss"});
  35230. *
  35231. * Note that relative URLs _NOT_ starting with a "/" will also include the path
  35232. * of the current site.
  35233. *
  35234. * Also because downgrading security is not permitted by browsers, when using
  35235. * relative URLs both BOSH and WebSocket connections will use their secure
  35236. * variants if the current connection to the site is also secure (https).
  35237. *
  35238. * BOSH options:
  35239. * -------------
  35240. *
  35241. * By adding "sync" to the options, you can control if requests will
  35242. * be made synchronously or not. The default behaviour is asynchronous.
  35243. * If you want to make requests synchronous, make "sync" evaluate to true.
  35244. * > let conn = new Strophe.Connection("/http-bind/", {sync: true});
  35245. *
  35246. * You can also toggle this on an already established connection.
  35247. * > conn.options.sync = true;
  35248. *
  35249. * The *customHeaders* option can be used to provide custom HTTP headers to be
  35250. * included in the XMLHttpRequests made.
  35251. *
  35252. * The *keepalive* option can be used to instruct Strophe to maintain the
  35253. * current BOSH session across interruptions such as webpage reloads.
  35254. *
  35255. * It will do this by caching the sessions tokens in sessionStorage, and when
  35256. * "restore" is called it will check whether there are cached tokens with
  35257. * which it can resume an existing session.
  35258. *
  35259. * The *withCredentials* option should receive a Boolean value and is used to
  35260. * indicate wether cookies should be included in ajax requests (by default
  35261. * they're not).
  35262. * Set this value to true if you are connecting to a BOSH service
  35263. * and for some reason need to send cookies to it.
  35264. * In order for this to work cross-domain, the server must also enable
  35265. * credentials by setting the Access-Control-Allow-Credentials response header
  35266. * to "true". For most usecases however this setting should be false (which
  35267. * is the default).
  35268. * Additionally, when using Access-Control-Allow-Credentials, the
  35269. * Access-Control-Allow-Origin header can't be set to the wildcard "*", but
  35270. * instead must be restricted to actual domains.
  35271. *
  35272. * The *contentType* option can be set to change the default Content-Type
  35273. * of "text/xml; charset=utf-8", which can be useful to reduce the amount of
  35274. * CORS preflight requests that are sent to the server.
  35275. *
  35276. * Parameters:
  35277. * (String) service - The BOSH or WebSocket service URL.
  35278. * (Object) options - A hash of configuration options
  35279. *
  35280. * Returns:
  35281. * A new Strophe.Connection object.
  35282. */
  35283. Strophe.Connection = function (service, options) {
  35284. var _this2 = this;
  35285. // The service URL
  35286. this.service = service; // Configuration options
  35287. this.options = options || {};
  35288. var proto = this.options.protocol || ""; // Select protocal based on service or options
  35289. if (service.indexOf("ws:") === 0 || service.indexOf("wss:") === 0 || proto.indexOf("ws") === 0) {
  35290. this._proto = new Strophe.Websocket(this);
  35291. } else {
  35292. this._proto = new Strophe.Bosh(this);
  35293. }
  35294. /* The connected JID. */
  35295. this.jid = "";
  35296. /* the JIDs domain */
  35297. this.domain = null;
  35298. /* stream:features */
  35299. this.features = null; // SASL
  35300. this._sasl_data = {};
  35301. this.do_session = false;
  35302. this.do_bind = false; // handler lists
  35303. this.timedHandlers = [];
  35304. this.handlers = [];
  35305. this.removeTimeds = [];
  35306. this.removeHandlers = [];
  35307. this.addTimeds = [];
  35308. this.addHandlers = [];
  35309. this.protocolErrorHandlers = {
  35310. 'HTTP': {},
  35311. 'websocket': {}
  35312. };
  35313. this._idleTimeout = null;
  35314. this._disconnectTimeout = null;
  35315. this.authenticated = false;
  35316. this.connected = false;
  35317. this.disconnecting = false;
  35318. this.do_authentication = true;
  35319. this.paused = false;
  35320. this.restored = false;
  35321. this._data = [];
  35322. this._uniqueId = 0;
  35323. this._sasl_success_handler = null;
  35324. this._sasl_failure_handler = null;
  35325. this._sasl_challenge_handler = null; // Max retries before disconnecting
  35326. this.maxRetries = 5; // Call onIdle callback every 1/10th of a second
  35327. this._idleTimeout = setTimeout(function () {
  35328. return _this2._onIdle();
  35329. }, 100);
  35330. utils__WEBPACK_IMPORTED_MODULE_2__["default"].addCookies(this.options.cookies);
  35331. this.registerSASLMechanisms(this.options.mechanisms); // initialize plugins
  35332. for (var k in Strophe._connectionPlugins) {
  35333. if (Object.prototype.hasOwnProperty.call(Strophe._connectionPlugins, k)) {
  35334. var F = function F() {};
  35335. F.prototype = Strophe._connectionPlugins[k];
  35336. this[k] = new F();
  35337. this[k].init(this);
  35338. }
  35339. }
  35340. };
  35341. Strophe.Connection.prototype = {
  35342. /** Function: reset
  35343. * Reset the connection.
  35344. *
  35345. * This function should be called after a connection is disconnected
  35346. * before that connection is reused.
  35347. */
  35348. reset: function reset() {
  35349. this._proto._reset(); // SASL
  35350. this.do_session = false;
  35351. this.do_bind = false; // handler lists
  35352. this.timedHandlers = [];
  35353. this.handlers = [];
  35354. this.removeTimeds = [];
  35355. this.removeHandlers = [];
  35356. this.addTimeds = [];
  35357. this.addHandlers = [];
  35358. this.authenticated = false;
  35359. this.connected = false;
  35360. this.disconnecting = false;
  35361. this.restored = false;
  35362. this._data = [];
  35363. this._requests = [];
  35364. this._uniqueId = 0;
  35365. },
  35366. /** Function: pause
  35367. * Pause the request manager.
  35368. *
  35369. * This will prevent Strophe from sending any more requests to the
  35370. * server. This is very useful for temporarily pausing
  35371. * BOSH-Connections while a lot of send() calls are happening quickly.
  35372. * This causes Strophe to send the data in a single request, saving
  35373. * many request trips.
  35374. */
  35375. pause: function pause() {
  35376. this.paused = true;
  35377. },
  35378. /** Function: resume
  35379. * Resume the request manager.
  35380. *
  35381. * This resumes after pause() has been called.
  35382. */
  35383. resume: function resume() {
  35384. this.paused = false;
  35385. },
  35386. /** Function: getUniqueId
  35387. * Generate a unique ID for use in <iq/> elements.
  35388. *
  35389. * All <iq/> stanzas are required to have unique id attributes. This
  35390. * function makes creating these easy. Each connection instance has
  35391. * a counter which starts from zero, and the value of this counter
  35392. * plus a colon followed by the suffix becomes the unique id. If no
  35393. * suffix is supplied, the counter is used as the unique id.
  35394. *
  35395. * Suffixes are used to make debugging easier when reading the stream
  35396. * data, and their use is recommended. The counter resets to 0 for
  35397. * every new connection for the same reason. For connections to the
  35398. * same server that authenticate the same way, all the ids should be
  35399. * the same, which makes it easy to see changes. This is useful for
  35400. * automated testing as well.
  35401. *
  35402. * Parameters:
  35403. * (String) suffix - A optional suffix to append to the id.
  35404. *
  35405. * Returns:
  35406. * A unique string to be used for the id attribute.
  35407. */
  35408. getUniqueId: function getUniqueId(suffix) {
  35409. var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  35410. var r = Math.random() * 16 | 0,
  35411. v = c === 'x' ? r : r & 0x3 | 0x8;
  35412. return v.toString(16);
  35413. });
  35414. if (typeof suffix === "string" || typeof suffix === "number") {
  35415. return uuid + ":" + suffix;
  35416. } else {
  35417. return uuid + "";
  35418. }
  35419. },
  35420. /** Function: addProtocolErrorHandler
  35421. * Register a handler function for when a protocol (websocker or HTTP)
  35422. * error occurs.
  35423. *
  35424. * NOTE: Currently only HTTP errors for BOSH requests are handled.
  35425. * Patches that handle websocket errors would be very welcome.
  35426. *
  35427. * Parameters:
  35428. * (String) protocol - 'HTTP' or 'websocket'
  35429. * (Integer) status_code - Error status code (e.g 500, 400 or 404)
  35430. * (Function) callback - Function that will fire on Http error
  35431. *
  35432. * Example:
  35433. * function onError(err_code){
  35434. * //do stuff
  35435. * }
  35436. *
  35437. * let conn = Strophe.connect('http://example.com/http-bind');
  35438. * conn.addProtocolErrorHandler('HTTP', 500, onError);
  35439. * // Triggers HTTP 500 error and onError handler will be called
  35440. * conn.connect('user_jid@incorrect_jabber_host', 'secret', onConnect);
  35441. */
  35442. addProtocolErrorHandler: function addProtocolErrorHandler(protocol, status_code, callback) {
  35443. this.protocolErrorHandlers[protocol][status_code] = callback;
  35444. },
  35445. /** Function: connect
  35446. * Starts the connection process.
  35447. *
  35448. * As the connection process proceeds, the user supplied callback will
  35449. * be triggered multiple times with status updates. The callback
  35450. * should take two arguments - the status code and the error condition.
  35451. *
  35452. * The status code will be one of the values in the Strophe.Status
  35453. * constants. The error condition will be one of the conditions
  35454. * defined in RFC 3920 or the condition 'strophe-parsererror'.
  35455. *
  35456. * The Parameters _wait_, _hold_ and _route_ are optional and only relevant
  35457. * for BOSH connections. Please see XEP 124 for a more detailed explanation
  35458. * of the optional parameters.
  35459. *
  35460. * Parameters:
  35461. * (String) jid - The user's JID. This may be a bare JID,
  35462. * or a full JID. If a node is not supplied, SASL OAUTHBEARER or
  35463. * SASL ANONYMOUS authentication will be attempted (OAUTHBEARER will
  35464. * process the provided password value as an access token).
  35465. * (String) pass - The user's password.
  35466. * (Function) callback - The connect callback function.
  35467. * (Integer) wait - The optional HTTPBIND wait value. This is the
  35468. * time the server will wait before returning an empty result for
  35469. * a request. The default setting of 60 seconds is recommended.
  35470. * (Integer) hold - The optional HTTPBIND hold value. This is the
  35471. * number of connections the server will hold at one time. This
  35472. * should almost always be set to 1 (the default).
  35473. * (String) route - The optional route value.
  35474. * (String) authcid - The optional alternative authentication identity
  35475. * (username) if intending to impersonate another user.
  35476. * When using the SASL-EXTERNAL authentication mechanism, for example
  35477. * with client certificates, then the authcid value is used to
  35478. * determine whether an authorization JID (authzid) should be sent to
  35479. * the server. The authzid should not be sent to the server if the
  35480. * authzid and authcid are the same. So to prevent it from being sent
  35481. * (for example when the JID is already contained in the client
  35482. * certificate), set authcid to that same JID. See XEP-178 for more
  35483. * details.
  35484. */
  35485. connect: function connect(jid, pass, callback, wait, hold, route, authcid) {
  35486. this.jid = jid;
  35487. /** Variable: authzid
  35488. * Authorization identity.
  35489. */
  35490. this.authzid = Strophe.getBareJidFromJid(this.jid);
  35491. /** Variable: authcid
  35492. * Authentication identity (User name).
  35493. */
  35494. this.authcid = authcid || Strophe.getNodeFromJid(this.jid);
  35495. /** Variable: pass
  35496. * Authentication identity (User password).
  35497. */
  35498. this.pass = pass;
  35499. /** Variable: servtype
  35500. * Digest MD5 compatibility.
  35501. */
  35502. this.servtype = "xmpp";
  35503. this.connect_callback = callback;
  35504. this.disconnecting = false;
  35505. this.connected = false;
  35506. this.authenticated = false;
  35507. this.restored = false; // parse jid for domain
  35508. this.domain = Strophe.getDomainFromJid(this.jid);
  35509. this._changeConnectStatus(Strophe.Status.CONNECTING, null);
  35510. this._proto._connect(wait, hold, route);
  35511. },
  35512. /** Function: attach
  35513. * Attach to an already created and authenticated BOSH session.
  35514. *
  35515. * This function is provided to allow Strophe to attach to BOSH
  35516. * sessions which have been created externally, perhaps by a Web
  35517. * application. This is often used to support auto-login type features
  35518. * without putting user credentials into the page.
  35519. *
  35520. * Parameters:
  35521. * (String) jid - The full JID that is bound by the session.
  35522. * (String) sid - The SID of the BOSH session.
  35523. * (String) rid - The current RID of the BOSH session. This RID
  35524. * will be used by the next request.
  35525. * (Function) callback The connect callback function.
  35526. * (Integer) wait - The optional HTTPBIND wait value. This is the
  35527. * time the server will wait before returning an empty result for
  35528. * a request. The default setting of 60 seconds is recommended.
  35529. * Other settings will require tweaks to the Strophe.TIMEOUT value.
  35530. * (Integer) hold - The optional HTTPBIND hold value. This is the
  35531. * number of connections the server will hold at one time. This
  35532. * should almost always be set to 1 (the default).
  35533. * (Integer) wind - The optional HTTBIND window value. This is the
  35534. * allowed range of request ids that are valid. The default is 5.
  35535. */
  35536. attach: function attach(jid, sid, rid, callback, wait, hold, wind) {
  35537. if (this._proto instanceof Strophe.Bosh) {
  35538. this._proto._attach(jid, sid, rid, callback, wait, hold, wind);
  35539. } else {
  35540. var error = new Error('The "attach" method can only be used with a BOSH connection.');
  35541. error.name = 'StropheSessionError';
  35542. throw error;
  35543. }
  35544. },
  35545. /** Function: restore
  35546. * Attempt to restore a cached BOSH session.
  35547. *
  35548. * This function is only useful in conjunction with providing the
  35549. * "keepalive":true option when instantiating a new Strophe.Connection.
  35550. *
  35551. * When "keepalive" is set to true, Strophe will cache the BOSH tokens
  35552. * RID (Request ID) and SID (Session ID) and then when this function is
  35553. * called, it will attempt to restore the session from those cached
  35554. * tokens.
  35555. *
  35556. * This function must therefore be called instead of connect or attach.
  35557. *
  35558. * For an example on how to use it, please see examples/restore.js
  35559. *
  35560. * Parameters:
  35561. * (String) jid - The user's JID. This may be a bare JID or a full JID.
  35562. * (Function) callback - The connect callback function.
  35563. * (Integer) wait - The optional HTTPBIND wait value. This is the
  35564. * time the server will wait before returning an empty result for
  35565. * a request. The default setting of 60 seconds is recommended.
  35566. * (Integer) hold - The optional HTTPBIND hold value. This is the
  35567. * number of connections the server will hold at one time. This
  35568. * should almost always be set to 1 (the default).
  35569. * (Integer) wind - The optional HTTBIND window value. This is the
  35570. * allowed range of request ids that are valid. The default is 5.
  35571. */
  35572. restore: function restore(jid, callback, wait, hold, wind) {
  35573. if (this._sessionCachingSupported()) {
  35574. this._proto._restore(jid, callback, wait, hold, wind);
  35575. } else {
  35576. var error = new Error('The "restore" method can only be used with a BOSH connection.');
  35577. error.name = 'StropheSessionError';
  35578. throw error;
  35579. }
  35580. },
  35581. /** PrivateFunction: _sessionCachingSupported
  35582. * Checks whether sessionStorage and JSON are supported and whether we're
  35583. * using BOSH.
  35584. */
  35585. _sessionCachingSupported: function _sessionCachingSupported() {
  35586. if (this._proto instanceof Strophe.Bosh) {
  35587. if (!JSON) {
  35588. return false;
  35589. }
  35590. try {
  35591. sessionStorage.setItem('_strophe_', '_strophe_');
  35592. sessionStorage.removeItem('_strophe_');
  35593. } catch (e) {
  35594. return false;
  35595. }
  35596. return true;
  35597. }
  35598. return false;
  35599. },
  35600. /** Function: xmlInput
  35601. * User overrideable function that receives XML data coming into the
  35602. * connection.
  35603. *
  35604. * The default function does nothing. User code can override this with
  35605. * > Strophe.Connection.xmlInput = function (elem) {
  35606. * > (user code)
  35607. * > };
  35608. *
  35609. * Due to limitations of current Browsers' XML-Parsers the opening and closing
  35610. * <stream> tag for WebSocket-Connoctions will be passed as selfclosing here.
  35611. *
  35612. * BOSH-Connections will have all stanzas wrapped in a <body> tag. See
  35613. * <Strophe.Bosh.strip> if you want to strip this tag.
  35614. *
  35615. * Parameters:
  35616. * (XMLElement) elem - The XML data received by the connection.
  35617. */
  35618. /* jshint unused:false */
  35619. xmlInput: function xmlInput(elem) {
  35620. return;
  35621. },
  35622. /* jshint unused:true */
  35623. /** Function: xmlOutput
  35624. * User overrideable function that receives XML data sent to the
  35625. * connection.
  35626. *
  35627. * The default function does nothing. User code can override this with
  35628. * > Strophe.Connection.xmlOutput = function (elem) {
  35629. * > (user code)
  35630. * > };
  35631. *
  35632. * Due to limitations of current Browsers' XML-Parsers the opening and closing
  35633. * <stream> tag for WebSocket-Connoctions will be passed as selfclosing here.
  35634. *
  35635. * BOSH-Connections will have all stanzas wrapped in a <body> tag. See
  35636. * <Strophe.Bosh.strip> if you want to strip this tag.
  35637. *
  35638. * Parameters:
  35639. * (XMLElement) elem - The XMLdata sent by the connection.
  35640. */
  35641. /* jshint unused:false */
  35642. xmlOutput: function xmlOutput(elem) {
  35643. return;
  35644. },
  35645. /* jshint unused:true */
  35646. /** Function: rawInput
  35647. * User overrideable function that receives raw data coming into the
  35648. * connection.
  35649. *
  35650. * The default function does nothing. User code can override this with
  35651. * > Strophe.Connection.rawInput = function (data) {
  35652. * > (user code)
  35653. * > };
  35654. *
  35655. * Parameters:
  35656. * (String) data - The data received by the connection.
  35657. */
  35658. /* jshint unused:false */
  35659. rawInput: function rawInput(data) {
  35660. return;
  35661. },
  35662. /* jshint unused:true */
  35663. /** Function: rawOutput
  35664. * User overrideable function that receives raw data sent to the
  35665. * connection.
  35666. *
  35667. * The default function does nothing. User code can override this with
  35668. * > Strophe.Connection.rawOutput = function (data) {
  35669. * > (user code)
  35670. * > };
  35671. *
  35672. * Parameters:
  35673. * (String) data - The data sent by the connection.
  35674. */
  35675. /* jshint unused:false */
  35676. rawOutput: function rawOutput(data) {
  35677. return;
  35678. },
  35679. /* jshint unused:true */
  35680. /** Function: nextValidRid
  35681. * User overrideable function that receives the new valid rid.
  35682. *
  35683. * The default function does nothing. User code can override this with
  35684. * > Strophe.Connection.nextValidRid = function (rid) {
  35685. * > (user code)
  35686. * > };
  35687. *
  35688. * Parameters:
  35689. * (Number) rid - The next valid rid
  35690. */
  35691. /* jshint unused:false */
  35692. nextValidRid: function nextValidRid(rid) {
  35693. return;
  35694. },
  35695. /* jshint unused:true */
  35696. /** Function: send
  35697. * Send a stanza.
  35698. *
  35699. * This function is called to push data onto the send queue to
  35700. * go out over the wire. Whenever a request is sent to the BOSH
  35701. * server, all pending data is sent and the queue is flushed.
  35702. *
  35703. * Parameters:
  35704. * (XMLElement |
  35705. * [XMLElement] |
  35706. * Strophe.Builder) elem - The stanza to send.
  35707. */
  35708. send: function send(elem) {
  35709. if (elem === null) {
  35710. return;
  35711. }
  35712. if (typeof elem.sort === "function") {
  35713. for (var i = 0; i < elem.length; i++) {
  35714. this._queueData(elem[i]);
  35715. }
  35716. } else if (typeof elem.tree === "function") {
  35717. this._queueData(elem.tree());
  35718. } else {
  35719. this._queueData(elem);
  35720. }
  35721. this._proto._send();
  35722. },
  35723. /** Function: flush
  35724. * Immediately send any pending outgoing data.
  35725. *
  35726. * Normally send() queues outgoing data until the next idle period
  35727. * (100ms), which optimizes network use in the common cases when
  35728. * several send()s are called in succession. flush() can be used to
  35729. * immediately send all pending data.
  35730. */
  35731. flush: function flush() {
  35732. // cancel the pending idle period and run the idle function
  35733. // immediately
  35734. clearTimeout(this._idleTimeout);
  35735. this._onIdle();
  35736. },
  35737. /** Function: sendPresence
  35738. * Helper function to send presence stanzas. The main benefit is for
  35739. * sending presence stanzas for which you expect a responding presence
  35740. * stanza with the same id (for example when leaving a chat room).
  35741. *
  35742. * Parameters:
  35743. * (XMLElement) elem - The stanza to send.
  35744. * (Function) callback - The callback function for a successful request.
  35745. * (Function) errback - The callback function for a failed or timed
  35746. * out request. On timeout, the stanza will be null.
  35747. * (Integer) timeout - The time specified in milliseconds for a
  35748. * timeout to occur.
  35749. *
  35750. * Returns:
  35751. * The id used to send the presence.
  35752. */
  35753. sendPresence: function sendPresence(elem, callback, errback, timeout) {
  35754. var _this3 = this;
  35755. var timeoutHandler = null;
  35756. if (typeof elem.tree === "function") {
  35757. elem = elem.tree();
  35758. }
  35759. var id = elem.getAttribute('id');
  35760. if (!id) {
  35761. // inject id if not found
  35762. id = this.getUniqueId("sendPresence");
  35763. elem.setAttribute("id", id);
  35764. }
  35765. if (typeof callback === "function" || typeof errback === "function") {
  35766. var handler = this.addHandler(function (stanza) {
  35767. // remove timeout handler if there is one
  35768. if (timeoutHandler) {
  35769. _this3.deleteTimedHandler(timeoutHandler);
  35770. }
  35771. if (stanza.getAttribute('type') === 'error') {
  35772. if (errback) {
  35773. errback(stanza);
  35774. }
  35775. } else if (callback) {
  35776. callback(stanza);
  35777. }
  35778. }, null, 'presence', null, id); // if timeout specified, set up a timeout handler.
  35779. if (timeout) {
  35780. timeoutHandler = this.addTimedHandler(timeout, function () {
  35781. // get rid of normal handler
  35782. _this3.deleteHandler(handler); // call errback on timeout with null stanza
  35783. if (errback) {
  35784. errback(null);
  35785. }
  35786. return false;
  35787. });
  35788. }
  35789. }
  35790. this.send(elem);
  35791. return id;
  35792. },
  35793. /** Function: sendIQ
  35794. * Helper function to send IQ stanzas.
  35795. *
  35796. * Parameters:
  35797. * (XMLElement) elem - The stanza to send.
  35798. * (Function) callback - The callback function for a successful request.
  35799. * (Function) errback - The callback function for a failed or timed
  35800. * out request. On timeout, the stanza will be null.
  35801. * (Integer) timeout - The time specified in milliseconds for a
  35802. * timeout to occur.
  35803. *
  35804. * Returns:
  35805. * The id used to send the IQ.
  35806. */
  35807. sendIQ: function sendIQ(elem, callback, errback, timeout) {
  35808. var _this4 = this;
  35809. var timeoutHandler = null;
  35810. if (typeof elem.tree === "function") {
  35811. elem = elem.tree();
  35812. }
  35813. var id = elem.getAttribute('id');
  35814. if (!id) {
  35815. // inject id if not found
  35816. id = this.getUniqueId("sendIQ");
  35817. elem.setAttribute("id", id);
  35818. }
  35819. if (typeof callback === "function" || typeof errback === "function") {
  35820. var handler = this.addHandler(function (stanza) {
  35821. // remove timeout handler if there is one
  35822. if (timeoutHandler) {
  35823. _this4.deleteTimedHandler(timeoutHandler);
  35824. }
  35825. var iqtype = stanza.getAttribute('type');
  35826. if (iqtype === 'result') {
  35827. if (callback) {
  35828. callback(stanza);
  35829. }
  35830. } else if (iqtype === 'error') {
  35831. if (errback) {
  35832. errback(stanza);
  35833. }
  35834. } else {
  35835. var error = new Error("Got bad IQ type of ".concat(iqtype));
  35836. error.name = "StropheError";
  35837. throw error;
  35838. }
  35839. }, null, 'iq', ['error', 'result'], id); // if timeout specified, set up a timeout handler.
  35840. if (timeout) {
  35841. timeoutHandler = this.addTimedHandler(timeout, function () {
  35842. // get rid of normal handler
  35843. _this4.deleteHandler(handler); // call errback on timeout with null stanza
  35844. if (errback) {
  35845. errback(null);
  35846. }
  35847. return false;
  35848. });
  35849. }
  35850. }
  35851. this.send(elem);
  35852. return id;
  35853. },
  35854. /** PrivateFunction: _queueData
  35855. * Queue outgoing data for later sending. Also ensures that the data
  35856. * is a DOMElement.
  35857. */
  35858. _queueData: function _queueData(element) {
  35859. if (element === null || !element.tagName || !element.childNodes) {
  35860. var error = new Error("Cannot queue non-DOMElement.");
  35861. error.name = "StropheError";
  35862. throw error;
  35863. }
  35864. this._data.push(element);
  35865. },
  35866. /** PrivateFunction: _sendRestart
  35867. * Send an xmpp:restart stanza.
  35868. */
  35869. _sendRestart: function _sendRestart() {
  35870. var _this5 = this;
  35871. this._data.push("restart");
  35872. this._proto._sendRestart();
  35873. this._idleTimeout = setTimeout(function () {
  35874. return _this5._onIdle();
  35875. }, 100);
  35876. },
  35877. /** Function: addTimedHandler
  35878. * Add a timed handler to the connection.
  35879. *
  35880. * This function adds a timed handler. The provided handler will
  35881. * be called every period milliseconds until it returns false,
  35882. * the connection is terminated, or the handler is removed. Handlers
  35883. * that wish to continue being invoked should return true.
  35884. *
  35885. * Because of method binding it is necessary to save the result of
  35886. * this function if you wish to remove a handler with
  35887. * deleteTimedHandler().
  35888. *
  35889. * Note that user handlers are not active until authentication is
  35890. * successful.
  35891. *
  35892. * Parameters:
  35893. * (Integer) period - The period of the handler.
  35894. * (Function) handler - The callback function.
  35895. *
  35896. * Returns:
  35897. * A reference to the handler that can be used to remove it.
  35898. */
  35899. addTimedHandler: function addTimedHandler(period, handler) {
  35900. var thand = new Strophe.TimedHandler(period, handler);
  35901. this.addTimeds.push(thand);
  35902. return thand;
  35903. },
  35904. /** Function: deleteTimedHandler
  35905. * Delete a timed handler for a connection.
  35906. *
  35907. * This function removes a timed handler from the connection. The
  35908. * handRef parameter is *not* the function passed to addTimedHandler(),
  35909. * but is the reference returned from addTimedHandler().
  35910. *
  35911. * Parameters:
  35912. * (Strophe.TimedHandler) handRef - The handler reference.
  35913. */
  35914. deleteTimedHandler: function deleteTimedHandler(handRef) {
  35915. // this must be done in the Idle loop so that we don't change
  35916. // the handlers during iteration
  35917. this.removeTimeds.push(handRef);
  35918. },
  35919. /** Function: addHandler
  35920. * Add a stanza handler for the connection.
  35921. *
  35922. * This function adds a stanza handler to the connection. The
  35923. * handler callback will be called for any stanza that matches
  35924. * the parameters. Note that if multiple parameters are supplied,
  35925. * they must all match for the handler to be invoked.
  35926. *
  35927. * The handler will receive the stanza that triggered it as its argument.
  35928. * *The handler should return true if it is to be invoked again;
  35929. * returning false will remove the handler after it returns.*
  35930. *
  35931. * As a convenience, the ns parameters applies to the top level element
  35932. * and also any of its immediate children. This is primarily to make
  35933. * matching /iq/query elements easy.
  35934. *
  35935. * Options
  35936. * ~~~~~~~
  35937. * With the options argument, you can specify boolean flags that affect how
  35938. * matches are being done.
  35939. *
  35940. * Currently two flags exist:
  35941. *
  35942. * - matchBareFromJid:
  35943. * When set to true, the from parameter and the
  35944. * from attribute on the stanza will be matched as bare JIDs instead
  35945. * of full JIDs. To use this, pass {matchBareFromJid: true} as the
  35946. * value of options. The default value for matchBareFromJid is false.
  35947. *
  35948. * - ignoreNamespaceFragment:
  35949. * When set to true, a fragment specified on the stanza's namespace
  35950. * URL will be ignored when it's matched with the one configured for
  35951. * the handler.
  35952. *
  35953. * This means that if you register like this:
  35954. * > connection.addHandler(
  35955. * > handler,
  35956. * > 'http://jabber.org/protocol/muc',
  35957. * > null, null, null, null,
  35958. * > {'ignoreNamespaceFragment': true}
  35959. * > );
  35960. *
  35961. * Then a stanza with XML namespace of
  35962. * 'http://jabber.org/protocol/muc#user' will also be matched. If
  35963. * 'ignoreNamespaceFragment' is false, then only stanzas with
  35964. * 'http://jabber.org/protocol/muc' will be matched.
  35965. *
  35966. * Deleting the handler
  35967. * ~~~~~~~~~~~~~~~~~~~~
  35968. * The return value should be saved if you wish to remove the handler
  35969. * with deleteHandler().
  35970. *
  35971. * Parameters:
  35972. * (Function) handler - The user callback.
  35973. * (String) ns - The namespace to match.
  35974. * (String) name - The stanza name to match.
  35975. * (String|Array) type - The stanza type (or types if an array) to match.
  35976. * (String) id - The stanza id attribute to match.
  35977. * (String) from - The stanza from attribute to match.
  35978. * (String) options - The handler options
  35979. *
  35980. * Returns:
  35981. * A reference to the handler that can be used to remove it.
  35982. */
  35983. addHandler: function addHandler(handler, ns, name, type, id, from, options) {
  35984. var hand = new Strophe.Handler(handler, ns, name, type, id, from, options);
  35985. this.addHandlers.push(hand);
  35986. return hand;
  35987. },
  35988. /** Function: deleteHandler
  35989. * Delete a stanza handler for a connection.
  35990. *
  35991. * This function removes a stanza handler from the connection. The
  35992. * handRef parameter is *not* the function passed to addHandler(),
  35993. * but is the reference returned from addHandler().
  35994. *
  35995. * Parameters:
  35996. * (Strophe.Handler) handRef - The handler reference.
  35997. */
  35998. deleteHandler: function deleteHandler(handRef) {
  35999. // this must be done in the Idle loop so that we don't change
  36000. // the handlers during iteration
  36001. this.removeHandlers.push(handRef); // If a handler is being deleted while it is being added,
  36002. // prevent it from getting added
  36003. var i = this.addHandlers.indexOf(handRef);
  36004. if (i >= 0) {
  36005. this.addHandlers.splice(i, 1);
  36006. }
  36007. },
  36008. /** Function: registerSASLMechanisms
  36009. *
  36010. * Register the SASL mechanisms which will be supported by this instance of
  36011. * Strophe.Connection (i.e. which this XMPP client will support).
  36012. *
  36013. * Parameters:
  36014. * (Array) mechanisms - Array of objects with Strophe.SASLMechanism prototypes
  36015. *
  36016. */
  36017. registerSASLMechanisms: function registerSASLMechanisms(mechanisms) {
  36018. this.mechanisms = {};
  36019. mechanisms = mechanisms || [Strophe.SASLAnonymous, Strophe.SASLExternal, Strophe.SASLMD5, Strophe.SASLOAuthBearer, Strophe.SASLXOAuth2, Strophe.SASLPlain, Strophe.SASLSHA1];
  36020. mechanisms.forEach(this.registerSASLMechanism.bind(this));
  36021. },
  36022. /** Function: registerSASLMechanism
  36023. *
  36024. * Register a single SASL mechanism, to be supported by this client.
  36025. *
  36026. * Parameters:
  36027. * (Object) mechanism - Object with a Strophe.SASLMechanism prototype
  36028. *
  36029. */
  36030. registerSASLMechanism: function registerSASLMechanism(mechanism) {
  36031. this.mechanisms[mechanism.prototype.name] = mechanism;
  36032. },
  36033. /** Function: disconnect
  36034. * Start the graceful disconnection process.
  36035. *
  36036. * This function starts the disconnection process. This process starts
  36037. * by sending unavailable presence and sending BOSH body of type
  36038. * terminate. A timeout handler makes sure that disconnection happens
  36039. * even if the BOSH server does not respond.
  36040. * If the Connection object isn't connected, at least tries to abort all pending requests
  36041. * so the connection object won't generate successful requests (which were already opened).
  36042. *
  36043. * The user supplied connection callback will be notified of the
  36044. * progress as this process happens.
  36045. *
  36046. * Parameters:
  36047. * (String) reason - The reason the disconnect is occuring.
  36048. */
  36049. disconnect: function disconnect(reason) {
  36050. this._changeConnectStatus(Strophe.Status.DISCONNECTING, reason);
  36051. Strophe.info("Disconnect was called because: " + reason);
  36052. if (this.connected) {
  36053. var pres = false;
  36054. this.disconnecting = true;
  36055. if (this.authenticated) {
  36056. pres = $pres({
  36057. 'xmlns': Strophe.NS.CLIENT,
  36058. 'type': 'unavailable'
  36059. });
  36060. } // setup timeout handler
  36061. this._disconnectTimeout = this._addSysTimedHandler(3000, this._onDisconnectTimeout.bind(this));
  36062. this._proto._disconnect(pres);
  36063. } else {
  36064. Strophe.info("Disconnect was called before Strophe connected to the server");
  36065. this._proto._abortAllRequests();
  36066. this._doDisconnect();
  36067. }
  36068. },
  36069. /** PrivateFunction: _changeConnectStatus
  36070. * _Private_ helper function that makes sure plugins and the user's
  36071. * callback are notified of connection status changes.
  36072. *
  36073. * Parameters:
  36074. * (Integer) status - the new connection status, one of the values
  36075. * in Strophe.Status
  36076. * (String) condition - the error condition or null
  36077. * (XMLElement) elem - The triggering stanza.
  36078. */
  36079. _changeConnectStatus: function _changeConnectStatus(status, condition, elem) {
  36080. // notify all plugins listening for status changes
  36081. for (var k in Strophe._connectionPlugins) {
  36082. if (Object.prototype.hasOwnProperty.call(Strophe._connectionPlugins, k)) {
  36083. var plugin = this[k];
  36084. if (plugin.statusChanged) {
  36085. try {
  36086. plugin.statusChanged(status, condition);
  36087. } catch (err) {
  36088. Strophe.error("".concat(k, " plugin caused an exception changing status: ").concat(err));
  36089. }
  36090. }
  36091. }
  36092. } // notify the user's callback
  36093. if (this.connect_callback) {
  36094. try {
  36095. this.connect_callback(status, condition, elem);
  36096. } catch (e) {
  36097. Strophe._handleError(e);
  36098. Strophe.error("User connection callback caused an exception: ".concat(e));
  36099. }
  36100. }
  36101. },
  36102. /** PrivateFunction: _doDisconnect
  36103. * _Private_ function to disconnect.
  36104. *
  36105. * This is the last piece of the disconnection logic. This resets the
  36106. * connection and alerts the user's connection callback.
  36107. */
  36108. _doDisconnect: function _doDisconnect(condition) {
  36109. if (typeof this._idleTimeout === "number") {
  36110. clearTimeout(this._idleTimeout);
  36111. } // Cancel Disconnect Timeout
  36112. if (this._disconnectTimeout !== null) {
  36113. this.deleteTimedHandler(this._disconnectTimeout);
  36114. this._disconnectTimeout = null;
  36115. }
  36116. Strophe.info("_doDisconnect was called");
  36117. this._proto._doDisconnect();
  36118. this.authenticated = false;
  36119. this.disconnecting = false;
  36120. this.restored = false; // delete handlers
  36121. this.handlers = [];
  36122. this.timedHandlers = [];
  36123. this.removeTimeds = [];
  36124. this.removeHandlers = [];
  36125. this.addTimeds = [];
  36126. this.addHandlers = []; // tell the parent we disconnected
  36127. this._changeConnectStatus(Strophe.Status.DISCONNECTED, condition);
  36128. this.connected = false;
  36129. },
  36130. /** PrivateFunction: _dataRecv
  36131. * _Private_ handler to processes incoming data from the the connection.
  36132. *
  36133. * Except for _connect_cb handling the initial connection request,
  36134. * this function handles the incoming data for all requests. This
  36135. * function also fires stanza handlers that match each incoming
  36136. * stanza.
  36137. *
  36138. * Parameters:
  36139. * (Strophe.Request) req - The request that has data ready.
  36140. * (string) req - The stanza a raw string (optiona).
  36141. */
  36142. _dataRecv: function _dataRecv(req, raw) {
  36143. var _this6 = this;
  36144. Strophe.info("_dataRecv called");
  36145. var elem = this._proto._reqToData(req);
  36146. if (elem === null) {
  36147. return;
  36148. }
  36149. if (this.xmlInput !== Strophe.Connection.prototype.xmlInput) {
  36150. if (elem.nodeName === this._proto.strip && elem.childNodes.length) {
  36151. this.xmlInput(elem.childNodes[0]);
  36152. } else {
  36153. this.xmlInput(elem);
  36154. }
  36155. }
  36156. if (this.rawInput !== Strophe.Connection.prototype.rawInput) {
  36157. if (raw) {
  36158. this.rawInput(raw);
  36159. } else {
  36160. this.rawInput(Strophe.serialize(elem));
  36161. }
  36162. } // remove handlers scheduled for deletion
  36163. while (this.removeHandlers.length > 0) {
  36164. var hand = this.removeHandlers.pop();
  36165. var i = this.handlers.indexOf(hand);
  36166. if (i >= 0) {
  36167. this.handlers.splice(i, 1);
  36168. }
  36169. } // add handlers scheduled for addition
  36170. while (this.addHandlers.length > 0) {
  36171. this.handlers.push(this.addHandlers.pop());
  36172. } // handle graceful disconnect
  36173. if (this.disconnecting && this._proto._emptyQueue()) {
  36174. this._doDisconnect();
  36175. return;
  36176. }
  36177. var type = elem.getAttribute("type");
  36178. if (type !== null && type === "terminate") {
  36179. // Don't process stanzas that come in after disconnect
  36180. if (this.disconnecting) {
  36181. return;
  36182. } // an error occurred
  36183. var cond = elem.getAttribute("condition");
  36184. var conflict = elem.getElementsByTagName("conflict");
  36185. if (cond !== null) {
  36186. if (cond === "remote-stream-error" && conflict.length > 0) {
  36187. cond = "conflict";
  36188. }
  36189. this._changeConnectStatus(Strophe.Status.CONNFAIL, cond);
  36190. } else {
  36191. this._changeConnectStatus(Strophe.Status.CONNFAIL, Strophe.ErrorCondition.UNKOWN_REASON);
  36192. }
  36193. this._doDisconnect(cond);
  36194. return;
  36195. } // send each incoming stanza through the handler chain
  36196. Strophe.forEachChild(elem, null, function (child) {
  36197. // process handlers
  36198. var newList = _this6.handlers;
  36199. _this6.handlers = [];
  36200. for (var _i5 = 0; _i5 < newList.length; _i5++) {
  36201. var _hand = newList[_i5]; // encapsulate 'handler.run' not to lose the whole handler list if
  36202. // one of the handlers throws an exception
  36203. try {
  36204. if (_hand.isMatch(child) && (_this6.authenticated || !_hand.user)) {
  36205. if (_hand.run(child)) {
  36206. _this6.handlers.push(_hand);
  36207. }
  36208. } else {
  36209. _this6.handlers.push(_hand);
  36210. }
  36211. } catch (e) {
  36212. // if the handler throws an exception, we consider it as false
  36213. Strophe.warn('Removing Strophe handlers due to uncaught exception: ' + e.message);
  36214. }
  36215. }
  36216. });
  36217. },
  36218. /** Attribute: mechanisms
  36219. * SASL Mechanisms available for Connection.
  36220. */
  36221. mechanisms: {},
  36222. /** PrivateFunction: _connect_cb
  36223. * _Private_ handler for initial connection request.
  36224. *
  36225. * This handler is used to process the initial connection request
  36226. * response from the BOSH server. It is used to set up authentication
  36227. * handlers and start the authentication process.
  36228. *
  36229. * SASL authentication will be attempted if available, otherwise
  36230. * the code will fall back to legacy authentication.
  36231. *
  36232. * Parameters:
  36233. * (Strophe.Request) req - The current request.
  36234. * (Function) _callback - low level (xmpp) connect callback function.
  36235. * Useful for plugins with their own xmpp connect callback (when they
  36236. * want to do something special).
  36237. */
  36238. _connect_cb: function _connect_cb(req, _callback, raw) {
  36239. Strophe.info("_connect_cb was called");
  36240. this.connected = true;
  36241. var bodyWrap;
  36242. try {
  36243. bodyWrap = this._proto._reqToData(req);
  36244. } catch (e) {
  36245. if (e.name !== Strophe.ErrorCondition.BAD_FORMAT) {
  36246. throw e;
  36247. }
  36248. this._changeConnectStatus(Strophe.Status.CONNFAIL, Strophe.ErrorCondition.BAD_FORMAT);
  36249. this._doDisconnect(Strophe.ErrorCondition.BAD_FORMAT);
  36250. }
  36251. if (!bodyWrap) {
  36252. return;
  36253. }
  36254. if (this.xmlInput !== Strophe.Connection.prototype.xmlInput) {
  36255. if (bodyWrap.nodeName === this._proto.strip && bodyWrap.childNodes.length) {
  36256. this.xmlInput(bodyWrap.childNodes[0]);
  36257. } else {
  36258. this.xmlInput(bodyWrap);
  36259. }
  36260. }
  36261. if (this.rawInput !== Strophe.Connection.prototype.rawInput) {
  36262. if (raw) {
  36263. this.rawInput(raw);
  36264. } else {
  36265. this.rawInput(Strophe.serialize(bodyWrap));
  36266. }
  36267. }
  36268. var conncheck = this._proto._connect_cb(bodyWrap);
  36269. if (conncheck === Strophe.Status.CONNFAIL) {
  36270. return;
  36271. } // Check for the stream:features tag
  36272. var hasFeatures;
  36273. if (bodyWrap.getElementsByTagNameNS) {
  36274. hasFeatures = bodyWrap.getElementsByTagNameNS(Strophe.NS.STREAM, "features").length > 0;
  36275. } else {
  36276. hasFeatures = bodyWrap.getElementsByTagName("stream:features").length > 0 || bodyWrap.getElementsByTagName("features").length > 0;
  36277. }
  36278. if (!hasFeatures) {
  36279. this._proto._no_auth_received(_callback);
  36280. return;
  36281. }
  36282. var matched = [];
  36283. var mechanisms = bodyWrap.getElementsByTagName("mechanism");
  36284. if (mechanisms.length > 0) {
  36285. for (var i = 0; i < mechanisms.length; i++) {
  36286. var mech = Strophe.getText(mechanisms[i]);
  36287. if (this.mechanisms[mech]) matched.push(this.mechanisms[mech]);
  36288. }
  36289. }
  36290. if (matched.length === 0) {
  36291. if (bodyWrap.getElementsByTagName("auth").length === 0) {
  36292. // There are no matching SASL mechanisms and also no legacy
  36293. // auth available.
  36294. this._proto._no_auth_received(_callback);
  36295. return;
  36296. }
  36297. }
  36298. if (this.do_authentication !== false) {
  36299. this.authenticate(matched);
  36300. }
  36301. },
  36302. /** Function: sortMechanismsByPriority
  36303. *
  36304. * Sorts an array of objects with prototype SASLMechanism according to
  36305. * their priorities.
  36306. *
  36307. * Parameters:
  36308. * (Array) mechanisms - Array of SASL mechanisms.
  36309. *
  36310. */
  36311. sortMechanismsByPriority: function sortMechanismsByPriority(mechanisms) {
  36312. // Sorting mechanisms according to priority.
  36313. for (var i = 0; i < mechanisms.length - 1; ++i) {
  36314. var higher = i;
  36315. for (var j = i + 1; j < mechanisms.length; ++j) {
  36316. if (mechanisms[j].prototype.priority > mechanisms[higher].prototype.priority) {
  36317. higher = j;
  36318. }
  36319. }
  36320. if (higher !== i) {
  36321. var swap = mechanisms[i];
  36322. mechanisms[i] = mechanisms[higher];
  36323. mechanisms[higher] = swap;
  36324. }
  36325. }
  36326. return mechanisms;
  36327. },
  36328. /** PrivateFunction: _attemptSASLAuth
  36329. *
  36330. * Iterate through an array of SASL mechanisms and attempt authentication
  36331. * with the highest priority (enabled) mechanism.
  36332. *
  36333. * Parameters:
  36334. * (Array) mechanisms - Array of SASL mechanisms.
  36335. *
  36336. * Returns:
  36337. * (Boolean) mechanism_found - true or false, depending on whether a
  36338. * valid SASL mechanism was found with which authentication could be
  36339. * started.
  36340. */
  36341. _attemptSASLAuth: function _attemptSASLAuth(mechanisms) {
  36342. mechanisms = this.sortMechanismsByPriority(mechanisms || []);
  36343. var mechanism_found = false;
  36344. for (var i = 0; i < mechanisms.length; ++i) {
  36345. if (!mechanisms[i].prototype.test(this)) {
  36346. continue;
  36347. }
  36348. this._sasl_success_handler = this._addSysHandler(this._sasl_success_cb.bind(this), null, "success", null, null);
  36349. this._sasl_failure_handler = this._addSysHandler(this._sasl_failure_cb.bind(this), null, "failure", null, null);
  36350. this._sasl_challenge_handler = this._addSysHandler(this._sasl_challenge_cb.bind(this), null, "challenge", null, null);
  36351. this._sasl_mechanism = new mechanisms[i]();
  36352. this._sasl_mechanism.onStart(this);
  36353. var request_auth_exchange = $build("auth", {
  36354. 'xmlns': Strophe.NS.SASL,
  36355. 'mechanism': this._sasl_mechanism.name
  36356. });
  36357. if (this._sasl_mechanism.isClientFirst) {
  36358. var response = this._sasl_mechanism.onChallenge(this, null);
  36359. request_auth_exchange.t(btoa(response));
  36360. }
  36361. this.send(request_auth_exchange.tree());
  36362. mechanism_found = true;
  36363. break;
  36364. }
  36365. return mechanism_found;
  36366. },
  36367. /** PrivateFunction: _attemptLegacyAuth
  36368. *
  36369. * Attempt legacy (i.e. non-SASL) authentication.
  36370. *
  36371. */
  36372. _attemptLegacyAuth: function _attemptLegacyAuth() {
  36373. if (Strophe.getNodeFromJid(this.jid) === null) {
  36374. // we don't have a node, which is required for non-anonymous
  36375. // client connections
  36376. this._changeConnectStatus(Strophe.Status.CONNFAIL, Strophe.ErrorCondition.MISSING_JID_NODE);
  36377. this.disconnect(Strophe.ErrorCondition.MISSING_JID_NODE);
  36378. } else {
  36379. // Fall back to legacy authentication
  36380. this._changeConnectStatus(Strophe.Status.AUTHENTICATING, null);
  36381. this._addSysHandler(this._auth1_cb.bind(this), null, null, null, "_auth_1");
  36382. this.send($iq({
  36383. 'type': "get",
  36384. 'to': this.domain,
  36385. 'id': "_auth_1"
  36386. }).c("query", {
  36387. xmlns: Strophe.NS.AUTH
  36388. }).c("username", {}).t(Strophe.getNodeFromJid(this.jid)).tree());
  36389. }
  36390. },
  36391. /** Function: authenticate
  36392. * Set up authentication
  36393. *
  36394. * Continues the initial connection request by setting up authentication
  36395. * handlers and starting the authentication process.
  36396. *
  36397. * SASL authentication will be attempted if available, otherwise
  36398. * the code will fall back to legacy authentication.
  36399. *
  36400. * Parameters:
  36401. * (Array) matched - Array of SASL mechanisms supported.
  36402. *
  36403. */
  36404. authenticate: function authenticate(matched) {
  36405. if (!this._attemptSASLAuth(matched)) {
  36406. this._attemptLegacyAuth();
  36407. }
  36408. },
  36409. /** PrivateFunction: _sasl_challenge_cb
  36410. * _Private_ handler for the SASL challenge
  36411. *
  36412. */
  36413. _sasl_challenge_cb: function _sasl_challenge_cb(elem) {
  36414. var challenge = atob(Strophe.getText(elem));
  36415. var response = this._sasl_mechanism.onChallenge(this, challenge);
  36416. var stanza = $build('response', {
  36417. 'xmlns': Strophe.NS.SASL
  36418. });
  36419. if (response !== "") {
  36420. stanza.t(btoa(response));
  36421. }
  36422. this.send(stanza.tree());
  36423. return true;
  36424. },
  36425. /** PrivateFunction: _auth1_cb
  36426. * _Private_ handler for legacy authentication.
  36427. *
  36428. * This handler is called in response to the initial <iq type='get'/>
  36429. * for legacy authentication. It builds an authentication <iq/> and
  36430. * sends it, creating a handler (calling back to _auth2_cb()) to
  36431. * handle the result
  36432. *
  36433. * Parameters:
  36434. * (XMLElement) elem - The stanza that triggered the callback.
  36435. *
  36436. * Returns:
  36437. * false to remove the handler.
  36438. */
  36439. /* jshint unused:false */
  36440. _auth1_cb: function _auth1_cb(elem) {
  36441. // build plaintext auth iq
  36442. var iq = $iq({
  36443. type: "set",
  36444. id: "_auth_2"
  36445. }).c('query', {
  36446. xmlns: Strophe.NS.AUTH
  36447. }).c('username', {}).t(Strophe.getNodeFromJid(this.jid)).up().c('password').t(this.pass);
  36448. if (!Strophe.getResourceFromJid(this.jid)) {
  36449. // since the user has not supplied a resource, we pick
  36450. // a default one here. unlike other auth methods, the server
  36451. // cannot do this for us.
  36452. this.jid = Strophe.getBareJidFromJid(this.jid) + '/strophe';
  36453. }
  36454. iq.up().c('resource', {}).t(Strophe.getResourceFromJid(this.jid));
  36455. this._addSysHandler(this._auth2_cb.bind(this), null, null, null, "_auth_2");
  36456. this.send(iq.tree());
  36457. return false;
  36458. },
  36459. /* jshint unused:true */
  36460. /** PrivateFunction: _sasl_success_cb
  36461. * _Private_ handler for succesful SASL authentication.
  36462. *
  36463. * Parameters:
  36464. * (XMLElement) elem - The matching stanza.
  36465. *
  36466. * Returns:
  36467. * false to remove the handler.
  36468. */
  36469. _sasl_success_cb: function _sasl_success_cb(elem) {
  36470. var _this7 = this;
  36471. if (this._sasl_data["server-signature"]) {
  36472. var serverSignature;
  36473. var success = atob(Strophe.getText(elem));
  36474. var attribMatch = /([a-z]+)=([^,]+)(,|$)/;
  36475. var matches = success.match(attribMatch);
  36476. if (matches[1] === "v") {
  36477. serverSignature = matches[2];
  36478. }
  36479. if (serverSignature !== this._sasl_data["server-signature"]) {
  36480. // remove old handlers
  36481. this.deleteHandler(this._sasl_failure_handler);
  36482. this._sasl_failure_handler = null;
  36483. if (this._sasl_challenge_handler) {
  36484. this.deleteHandler(this._sasl_challenge_handler);
  36485. this._sasl_challenge_handler = null;
  36486. }
  36487. this._sasl_data = {};
  36488. return this._sasl_failure_cb(null);
  36489. }
  36490. }
  36491. Strophe.info("SASL authentication succeeded.");
  36492. if (this._sasl_mechanism) {
  36493. this._sasl_mechanism.onSuccess();
  36494. } // remove old handlers
  36495. this.deleteHandler(this._sasl_failure_handler);
  36496. this._sasl_failure_handler = null;
  36497. if (this._sasl_challenge_handler) {
  36498. this.deleteHandler(this._sasl_challenge_handler);
  36499. this._sasl_challenge_handler = null;
  36500. }
  36501. var streamfeature_handlers = [];
  36502. var wrapper = function wrapper(handlers, elem) {
  36503. while (handlers.length) {
  36504. _this7.deleteHandler(handlers.pop());
  36505. }
  36506. _this7._sasl_auth1_cb(elem);
  36507. return false;
  36508. };
  36509. streamfeature_handlers.push(this._addSysHandler(function (elem) {
  36510. return wrapper(streamfeature_handlers, elem);
  36511. }, null, "stream:features", null, null));
  36512. streamfeature_handlers.push(this._addSysHandler(function (elem) {
  36513. return wrapper(streamfeature_handlers, elem);
  36514. }, Strophe.NS.STREAM, "features", null, null)); // we must send an xmpp:restart now
  36515. this._sendRestart();
  36516. return false;
  36517. },
  36518. /** PrivateFunction: _sasl_auth1_cb
  36519. * _Private_ handler to start stream binding.
  36520. *
  36521. * Parameters:
  36522. * (XMLElement) elem - The matching stanza.
  36523. *
  36524. * Returns:
  36525. * false to remove the handler.
  36526. */
  36527. _sasl_auth1_cb: function _sasl_auth1_cb(elem) {
  36528. // save stream:features for future usage
  36529. this.features = elem;
  36530. for (var i = 0; i < elem.childNodes.length; i++) {
  36531. var child = elem.childNodes[i];
  36532. if (child.nodeName === 'bind') {
  36533. this.do_bind = true;
  36534. }
  36535. if (child.nodeName === 'session') {
  36536. this.do_session = true;
  36537. }
  36538. }
  36539. if (!this.do_bind) {
  36540. this._changeConnectStatus(Strophe.Status.AUTHFAIL, null);
  36541. return false;
  36542. } else {
  36543. this._addSysHandler(this._sasl_bind_cb.bind(this), null, null, null, "_bind_auth_2");
  36544. var resource = Strophe.getResourceFromJid(this.jid);
  36545. if (resource) {
  36546. this.send($iq({
  36547. type: "set",
  36548. id: "_bind_auth_2"
  36549. }).c('bind', {
  36550. xmlns: Strophe.NS.BIND
  36551. }).c('resource', {}).t(resource).tree());
  36552. } else {
  36553. this.send($iq({
  36554. type: "set",
  36555. id: "_bind_auth_2"
  36556. }).c('bind', {
  36557. xmlns: Strophe.NS.BIND
  36558. }).tree());
  36559. }
  36560. }
  36561. return false;
  36562. },
  36563. /** PrivateFunction: _sasl_bind_cb
  36564. * _Private_ handler for binding result and session start.
  36565. *
  36566. * Parameters:
  36567. * (XMLElement) elem - The matching stanza.
  36568. *
  36569. * Returns:
  36570. * false to remove the handler.
  36571. */
  36572. _sasl_bind_cb: function _sasl_bind_cb(elem) {
  36573. if (elem.getAttribute("type") === "error") {
  36574. Strophe.info("SASL binding failed.");
  36575. var conflict = elem.getElementsByTagName("conflict");
  36576. var condition;
  36577. if (conflict.length > 0) {
  36578. condition = Strophe.ErrorCondition.CONFLICT;
  36579. }
  36580. this._changeConnectStatus(Strophe.Status.AUTHFAIL, condition, elem);
  36581. return false;
  36582. } // TODO - need to grab errors
  36583. var bind = elem.getElementsByTagName("bind");
  36584. if (bind.length > 0) {
  36585. var jidNode = bind[0].getElementsByTagName("jid");
  36586. if (jidNode.length > 0) {
  36587. this.jid = Strophe.getText(jidNode[0]);
  36588. if (this.do_session) {
  36589. this._addSysHandler(this._sasl_session_cb.bind(this), null, null, null, "_session_auth_2");
  36590. this.send($iq({
  36591. type: "set",
  36592. id: "_session_auth_2"
  36593. }).c('session', {
  36594. xmlns: Strophe.NS.SESSION
  36595. }).tree());
  36596. } else {
  36597. this.authenticated = true;
  36598. this._changeConnectStatus(Strophe.Status.CONNECTED, null);
  36599. }
  36600. }
  36601. } else {
  36602. Strophe.info("SASL binding failed.");
  36603. this._changeConnectStatus(Strophe.Status.AUTHFAIL, null, elem);
  36604. return false;
  36605. }
  36606. },
  36607. /** PrivateFunction: _sasl_session_cb
  36608. * _Private_ handler to finish successful SASL connection.
  36609. *
  36610. * This sets Connection.authenticated to true on success, which
  36611. * starts the processing of user handlers.
  36612. *
  36613. * Parameters:
  36614. * (XMLElement) elem - The matching stanza.
  36615. *
  36616. * Returns:
  36617. * false to remove the handler.
  36618. */
  36619. _sasl_session_cb: function _sasl_session_cb(elem) {
  36620. if (elem.getAttribute("type") === "result") {
  36621. this.authenticated = true;
  36622. this._changeConnectStatus(Strophe.Status.CONNECTED, null);
  36623. } else if (elem.getAttribute("type") === "error") {
  36624. Strophe.info("Session creation failed.");
  36625. this._changeConnectStatus(Strophe.Status.AUTHFAIL, null, elem);
  36626. return false;
  36627. }
  36628. return false;
  36629. },
  36630. /** PrivateFunction: _sasl_failure_cb
  36631. * _Private_ handler for SASL authentication failure.
  36632. *
  36633. * Parameters:
  36634. * (XMLElement) elem - The matching stanza.
  36635. *
  36636. * Returns:
  36637. * false to remove the handler.
  36638. */
  36639. /* jshint unused:false */
  36640. _sasl_failure_cb: function _sasl_failure_cb(elem) {
  36641. // delete unneeded handlers
  36642. if (this._sasl_success_handler) {
  36643. this.deleteHandler(this._sasl_success_handler);
  36644. this._sasl_success_handler = null;
  36645. }
  36646. if (this._sasl_challenge_handler) {
  36647. this.deleteHandler(this._sasl_challenge_handler);
  36648. this._sasl_challenge_handler = null;
  36649. }
  36650. if (this._sasl_mechanism) this._sasl_mechanism.onFailure();
  36651. this._changeConnectStatus(Strophe.Status.AUTHFAIL, null, elem);
  36652. return false;
  36653. },
  36654. /* jshint unused:true */
  36655. /** PrivateFunction: _auth2_cb
  36656. * _Private_ handler to finish legacy authentication.
  36657. *
  36658. * This handler is called when the result from the jabber:iq:auth
  36659. * <iq/> stanza is returned.
  36660. *
  36661. * Parameters:
  36662. * (XMLElement) elem - The stanza that triggered the callback.
  36663. *
  36664. * Returns:
  36665. * false to remove the handler.
  36666. */
  36667. _auth2_cb: function _auth2_cb(elem) {
  36668. if (elem.getAttribute("type") === "result") {
  36669. this.authenticated = true;
  36670. this._changeConnectStatus(Strophe.Status.CONNECTED, null);
  36671. } else if (elem.getAttribute("type") === "error") {
  36672. this._changeConnectStatus(Strophe.Status.AUTHFAIL, null, elem);
  36673. this.disconnect('authentication failed');
  36674. }
  36675. return false;
  36676. },
  36677. /** PrivateFunction: _addSysTimedHandler
  36678. * _Private_ function to add a system level timed handler.
  36679. *
  36680. * This function is used to add a Strophe.TimedHandler for the
  36681. * library code. System timed handlers are allowed to run before
  36682. * authentication is complete.
  36683. *
  36684. * Parameters:
  36685. * (Integer) period - The period of the handler.
  36686. * (Function) handler - The callback function.
  36687. */
  36688. _addSysTimedHandler: function _addSysTimedHandler(period, handler) {
  36689. var thand = new Strophe.TimedHandler(period, handler);
  36690. thand.user = false;
  36691. this.addTimeds.push(thand);
  36692. return thand;
  36693. },
  36694. /** PrivateFunction: _addSysHandler
  36695. * _Private_ function to add a system level stanza handler.
  36696. *
  36697. * This function is used to add a Strophe.Handler for the
  36698. * library code. System stanza handlers are allowed to run before
  36699. * authentication is complete.
  36700. *
  36701. * Parameters:
  36702. * (Function) handler - The callback function.
  36703. * (String) ns - The namespace to match.
  36704. * (String) name - The stanza name to match.
  36705. * (String) type - The stanza type attribute to match.
  36706. * (String) id - The stanza id attribute to match.
  36707. */
  36708. _addSysHandler: function _addSysHandler(handler, ns, name, type, id) {
  36709. var hand = new Strophe.Handler(handler, ns, name, type, id);
  36710. hand.user = false;
  36711. this.addHandlers.push(hand);
  36712. return hand;
  36713. },
  36714. /** PrivateFunction: _onDisconnectTimeout
  36715. * _Private_ timeout handler for handling non-graceful disconnection.
  36716. *
  36717. * If the graceful disconnect process does not complete within the
  36718. * time allotted, this handler finishes the disconnect anyway.
  36719. *
  36720. * Returns:
  36721. * false to remove the handler.
  36722. */
  36723. _onDisconnectTimeout: function _onDisconnectTimeout() {
  36724. Strophe.info("_onDisconnectTimeout was called");
  36725. this._changeConnectStatus(Strophe.Status.CONNTIMEOUT, null);
  36726. this._proto._onDisconnectTimeout(); // actually disconnect
  36727. this._doDisconnect();
  36728. return false;
  36729. },
  36730. /** PrivateFunction: _onIdle
  36731. * _Private_ handler to process events during idle cycle.
  36732. *
  36733. * This handler is called every 100ms to fire timed handlers that
  36734. * are ready and keep poll requests going.
  36735. */
  36736. _onIdle: function _onIdle() {
  36737. var _this8 = this;
  36738. // add timed handlers scheduled for addition
  36739. // NOTE: we add before remove in the case a timed handler is
  36740. // added and then deleted before the next _onIdle() call.
  36741. while (this.addTimeds.length > 0) {
  36742. this.timedHandlers.push(this.addTimeds.pop());
  36743. } // remove timed handlers that have been scheduled for deletion
  36744. while (this.removeTimeds.length > 0) {
  36745. var thand = this.removeTimeds.pop();
  36746. var i = this.timedHandlers.indexOf(thand);
  36747. if (i >= 0) {
  36748. this.timedHandlers.splice(i, 1);
  36749. }
  36750. } // call ready timed handlers
  36751. var now = new Date().getTime();
  36752. var newList = [];
  36753. for (var _i6 = 0; _i6 < this.timedHandlers.length; _i6++) {
  36754. var _thand = this.timedHandlers[_i6];
  36755. if (this.authenticated || !_thand.user) {
  36756. var since = _thand.lastCalled + _thand.period;
  36757. if (since - now <= 0) {
  36758. if (_thand.run()) {
  36759. newList.push(_thand);
  36760. }
  36761. } else {
  36762. newList.push(_thand);
  36763. }
  36764. }
  36765. }
  36766. this.timedHandlers = newList;
  36767. clearTimeout(this._idleTimeout);
  36768. this._proto._onIdle(); // reactivate the timer only if connected
  36769. if (this.connected) {
  36770. this._idleTimeout = setTimeout(function () {
  36771. return _this8._onIdle();
  36772. }, 100);
  36773. }
  36774. }
  36775. };
  36776. /** Class: Strophe.SASLMechanism
  36777. *
  36778. * encapsulates SASL authentication mechanisms.
  36779. *
  36780. * User code may override the priority for each mechanism or disable it completely.
  36781. * See <priority> for information about changing priority and <test> for informatian on
  36782. * how to disable a mechanism.
  36783. *
  36784. * By default, all mechanisms are enabled and the priorities are
  36785. *
  36786. * OAUTHBEARER - 60
  36787. * SCRAM-SHA1 - 50
  36788. * DIGEST-MD5 - 40
  36789. * PLAIN - 30
  36790. * ANONYMOUS - 20
  36791. * EXTERNAL - 10
  36792. *
  36793. * See: Strophe.Connection.addSupportedSASLMechanisms
  36794. */
  36795. /**
  36796. * PrivateConstructor: Strophe.SASLMechanism
  36797. * SASL auth mechanism abstraction.
  36798. *
  36799. * Parameters:
  36800. * (String) name - SASL Mechanism name.
  36801. * (Boolean) isClientFirst - If client should send response first without challenge.
  36802. * (Number) priority - Priority.
  36803. *
  36804. * Returns:
  36805. * A new Strophe.SASLMechanism object.
  36806. */
  36807. Strophe.SASLMechanism = function (name, isClientFirst, priority) {
  36808. /** PrivateVariable: name
  36809. * Mechanism name.
  36810. */
  36811. this.name = name;
  36812. /** PrivateVariable: isClientFirst
  36813. * If client sends response without initial server challenge.
  36814. */
  36815. this.isClientFirst = isClientFirst;
  36816. /** Variable: priority
  36817. * Determines which <SASLMechanism> is chosen for authentication (Higher is better).
  36818. * Users may override this to prioritize mechanisms differently.
  36819. *
  36820. * In the default configuration the priorities are
  36821. *
  36822. * SCRAM-SHA1 - 40
  36823. * DIGEST-MD5 - 30
  36824. * Plain - 20
  36825. *
  36826. * Example: (This will cause Strophe to choose the mechanism that the server sent first)
  36827. *
  36828. * > Strophe.SASLMD5.priority = Strophe.SASLSHA1.priority;
  36829. *
  36830. * See <SASL mechanisms> for a list of available mechanisms.
  36831. *
  36832. */
  36833. this.priority = priority;
  36834. };
  36835. Strophe.SASLMechanism.prototype = {
  36836. /**
  36837. * Function: test
  36838. * Checks if mechanism able to run.
  36839. * To disable a mechanism, make this return false;
  36840. *
  36841. * To disable plain authentication run
  36842. * > Strophe.SASLPlain.test = function() {
  36843. * > return false;
  36844. * > }
  36845. *
  36846. * See <SASL mechanisms> for a list of available mechanisms.
  36847. *
  36848. * Parameters:
  36849. * (Strophe.Connection) connection - Target Connection.
  36850. *
  36851. * Returns:
  36852. * (Boolean) If mechanism was able to run.
  36853. */
  36854. /* jshint unused:false */
  36855. test: function test(connection) {
  36856. return true;
  36857. },
  36858. /* jshint unused:true */
  36859. /** PrivateFunction: onStart
  36860. * Called before starting mechanism on some connection.
  36861. *
  36862. * Parameters:
  36863. * (Strophe.Connection) connection - Target Connection.
  36864. */
  36865. onStart: function onStart(connection) {
  36866. this._connection = connection;
  36867. },
  36868. /** PrivateFunction: onChallenge
  36869. * Called by protocol implementation on incoming challenge. If client is
  36870. * first (isClientFirst === true) challenge will be null on the first call.
  36871. *
  36872. * Parameters:
  36873. * (Strophe.Connection) connection - Target Connection.
  36874. * (String) challenge - current challenge to handle.
  36875. *
  36876. * Returns:
  36877. * (String) Mechanism response.
  36878. */
  36879. /* jshint unused:false */
  36880. onChallenge: function onChallenge(connection, challenge) {
  36881. throw new Error("You should implement challenge handling!");
  36882. },
  36883. /* jshint unused:true */
  36884. /** PrivateFunction: onFailure
  36885. * Protocol informs mechanism implementation about SASL failure.
  36886. */
  36887. onFailure: function onFailure() {
  36888. this._connection = null;
  36889. },
  36890. /** PrivateFunction: onSuccess
  36891. * Protocol informs mechanism implementation about SASL success.
  36892. */
  36893. onSuccess: function onSuccess() {
  36894. this._connection = null;
  36895. }
  36896. };
  36897. /** Constants: SASL mechanisms
  36898. * Available authentication mechanisms
  36899. *
  36900. * Strophe.SASLAnonymous - SASL ANONYMOUS authentication.
  36901. * Strophe.SASLPlain - SASL PLAIN authentication.
  36902. * Strophe.SASLMD5 - SASL DIGEST-MD5 authentication
  36903. * Strophe.SASLSHA1 - SASL SCRAM-SHA1 authentication
  36904. * Strophe.SASLOAuthBearer - SASL OAuth Bearer authentication
  36905. * Strophe.SASLExternal - SASL EXTERNAL authentication
  36906. * Strophe.SASLXOAuth2 - SASL X-OAuth2 authentication
  36907. */
  36908. // Building SASL callbacks
  36909. /** PrivateConstructor: SASLAnonymous
  36910. * SASL ANONYMOUS authentication.
  36911. */
  36912. Strophe.SASLAnonymous = function () {};
  36913. Strophe.SASLAnonymous.prototype = new Strophe.SASLMechanism("ANONYMOUS", false, 20);
  36914. Strophe.SASLAnonymous.prototype.test = function (connection) {
  36915. return connection.authcid === null;
  36916. };
  36917. /** PrivateConstructor: SASLPlain
  36918. * SASL PLAIN authentication.
  36919. */
  36920. Strophe.SASLPlain = function () {};
  36921. Strophe.SASLPlain.prototype = new Strophe.SASLMechanism("PLAIN", true, 50);
  36922. Strophe.SASLPlain.prototype.test = function (connection) {
  36923. return connection.authcid !== null;
  36924. };
  36925. Strophe.SASLPlain.prototype.onChallenge = function (connection) {
  36926. var auth_str = connection.authzid;
  36927. auth_str = auth_str + "\0";
  36928. auth_str = auth_str + connection.authcid;
  36929. auth_str = auth_str + "\0";
  36930. auth_str = auth_str + connection.pass;
  36931. return utils__WEBPACK_IMPORTED_MODULE_2__["default"].utf16to8(auth_str);
  36932. };
  36933. /** PrivateConstructor: SASLSHA1
  36934. * SASL SCRAM SHA 1 authentication.
  36935. */
  36936. Strophe.SASLSHA1 = function () {};
  36937. Strophe.SASLSHA1.prototype = new Strophe.SASLMechanism("SCRAM-SHA-1", true, 70);
  36938. Strophe.SASLSHA1.prototype.test = function (connection) {
  36939. return connection.authcid !== null;
  36940. };
  36941. Strophe.SASLSHA1.prototype.onChallenge = function (connection, challenge, test_cnonce) {
  36942. var cnonce = test_cnonce || md5__WEBPACK_IMPORTED_MODULE_0__["default"].hexdigest(Math.random() * 1234567890);
  36943. var auth_str = "n=" + utils__WEBPACK_IMPORTED_MODULE_2__["default"].utf16to8(connection.authcid);
  36944. auth_str += ",r=";
  36945. auth_str += cnonce;
  36946. connection._sasl_data.cnonce = cnonce;
  36947. connection._sasl_data["client-first-message-bare"] = auth_str;
  36948. auth_str = "n,," + auth_str;
  36949. this.onChallenge = function (connection, challenge) {
  36950. var nonce, salt, iter, Hi, U, U_old, i, k;
  36951. var responseText = "c=biws,";
  36952. var authMessage = "".concat(connection._sasl_data["client-first-message-bare"], ",").concat(challenge, ",");
  36953. var cnonce = connection._sasl_data.cnonce;
  36954. var attribMatch = /([a-z]+)=([^,]+)(,|$)/;
  36955. while (challenge.match(attribMatch)) {
  36956. var matches = challenge.match(attribMatch);
  36957. challenge = challenge.replace(matches[0], "");
  36958. switch (matches[1]) {
  36959. case "r":
  36960. nonce = matches[2];
  36961. break;
  36962. case "s":
  36963. salt = matches[2];
  36964. break;
  36965. case "i":
  36966. iter = matches[2];
  36967. break;
  36968. }
  36969. }
  36970. if (nonce.substr(0, cnonce.length) !== cnonce) {
  36971. connection._sasl_data = {};
  36972. return connection._sasl_failure_cb();
  36973. }
  36974. responseText += "r=" + nonce;
  36975. authMessage += responseText;
  36976. salt = atob(salt);
  36977. salt += "\x00\x00\x00\x01";
  36978. var pass = utils__WEBPACK_IMPORTED_MODULE_2__["default"].utf16to8(connection.pass);
  36979. Hi = U_old = sha1__WEBPACK_IMPORTED_MODULE_1__["default"].core_hmac_sha1(pass, salt);
  36980. for (i = 1; i < iter; i++) {
  36981. U = sha1__WEBPACK_IMPORTED_MODULE_1__["default"].core_hmac_sha1(pass, sha1__WEBPACK_IMPORTED_MODULE_1__["default"].binb2str(U_old));
  36982. for (k = 0; k < 5; k++) {
  36983. Hi[k] ^= U[k];
  36984. }
  36985. U_old = U;
  36986. }
  36987. Hi = sha1__WEBPACK_IMPORTED_MODULE_1__["default"].binb2str(Hi);
  36988. var clientKey = sha1__WEBPACK_IMPORTED_MODULE_1__["default"].core_hmac_sha1(Hi, "Client Key");
  36989. var serverKey = sha1__WEBPACK_IMPORTED_MODULE_1__["default"].str_hmac_sha1(Hi, "Server Key");
  36990. var clientSignature = sha1__WEBPACK_IMPORTED_MODULE_1__["default"].core_hmac_sha1(sha1__WEBPACK_IMPORTED_MODULE_1__["default"].str_sha1(sha1__WEBPACK_IMPORTED_MODULE_1__["default"].binb2str(clientKey)), authMessage);
  36991. connection._sasl_data["server-signature"] = sha1__WEBPACK_IMPORTED_MODULE_1__["default"].b64_hmac_sha1(serverKey, authMessage);
  36992. for (k = 0; k < 5; k++) {
  36993. clientKey[k] ^= clientSignature[k];
  36994. }
  36995. responseText += ",p=" + btoa(sha1__WEBPACK_IMPORTED_MODULE_1__["default"].binb2str(clientKey));
  36996. return responseText;
  36997. };
  36998. return auth_str;
  36999. };
  37000. /** PrivateConstructor: SASLMD5
  37001. * SASL DIGEST MD5 authentication.
  37002. */
  37003. Strophe.SASLMD5 = function () {};
  37004. Strophe.SASLMD5.prototype = new Strophe.SASLMechanism("DIGEST-MD5", false, 60);
  37005. Strophe.SASLMD5.prototype.test = function (connection) {
  37006. return connection.authcid !== null;
  37007. };
  37008. /** PrivateFunction: _quote
  37009. * _Private_ utility function to backslash escape and quote strings.
  37010. *
  37011. * Parameters:
  37012. * (String) str - The string to be quoted.
  37013. *
  37014. * Returns:
  37015. * quoted string
  37016. */
  37017. Strophe.SASLMD5.prototype._quote = function (str) {
  37018. return '"' + str.replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '"'; //" end string workaround for emacs
  37019. };
  37020. Strophe.SASLMD5.prototype.onChallenge = function (connection, challenge, test_cnonce) {
  37021. var attribMatch = /([a-z]+)=("[^"]+"|[^,"]+)(?:,|$)/;
  37022. var cnonce = test_cnonce || md5__WEBPACK_IMPORTED_MODULE_0__["default"].hexdigest("" + Math.random() * 1234567890);
  37023. var realm = "";
  37024. var host = null;
  37025. var nonce = "";
  37026. var qop = "";
  37027. while (challenge.match(attribMatch)) {
  37028. var matches = challenge.match(attribMatch);
  37029. challenge = challenge.replace(matches[0], "");
  37030. matches[2] = matches[2].replace(/^"(.+)"$/, "$1");
  37031. switch (matches[1]) {
  37032. case "realm":
  37033. realm = matches[2];
  37034. break;
  37035. case "nonce":
  37036. nonce = matches[2];
  37037. break;
  37038. case "qop":
  37039. qop = matches[2];
  37040. break;
  37041. case "host":
  37042. host = matches[2];
  37043. break;
  37044. }
  37045. }
  37046. var digest_uri = connection.servtype + "/" + connection.domain;
  37047. if (host !== null) {
  37048. digest_uri = digest_uri + "/" + host;
  37049. }
  37050. var cred = utils__WEBPACK_IMPORTED_MODULE_2__["default"].utf16to8(connection.authcid + ":" + realm + ":" + this._connection.pass);
  37051. var A1 = md5__WEBPACK_IMPORTED_MODULE_0__["default"].hash(cred) + ":" + nonce + ":" + cnonce;
  37052. var A2 = 'AUTHENTICATE:' + digest_uri;
  37053. var responseText = "";
  37054. responseText += 'charset=utf-8,';
  37055. responseText += 'username=' + this._quote(utils__WEBPACK_IMPORTED_MODULE_2__["default"].utf16to8(connection.authcid)) + ',';
  37056. responseText += 'realm=' + this._quote(realm) + ',';
  37057. responseText += 'nonce=' + this._quote(nonce) + ',';
  37058. responseText += 'nc=00000001,';
  37059. responseText += 'cnonce=' + this._quote(cnonce) + ',';
  37060. responseText += 'digest-uri=' + this._quote(digest_uri) + ',';
  37061. responseText += 'response=' + md5__WEBPACK_IMPORTED_MODULE_0__["default"].hexdigest(md5__WEBPACK_IMPORTED_MODULE_0__["default"].hexdigest(A1) + ":" + nonce + ":00000001:" + cnonce + ":auth:" + md5__WEBPACK_IMPORTED_MODULE_0__["default"].hexdigest(A2)) + ",";
  37062. responseText += 'qop=auth';
  37063. this.onChallenge = function () {
  37064. return "";
  37065. };
  37066. return responseText;
  37067. };
  37068. /** PrivateConstructor: SASLOAuthBearer
  37069. * SASL OAuth Bearer authentication.
  37070. */
  37071. Strophe.SASLOAuthBearer = function () {};
  37072. Strophe.SASLOAuthBearer.prototype = new Strophe.SASLMechanism("OAUTHBEARER", true, 40);
  37073. Strophe.SASLOAuthBearer.prototype.test = function (connection) {
  37074. return connection.pass !== null;
  37075. };
  37076. Strophe.SASLOAuthBearer.prototype.onChallenge = function (connection) {
  37077. var auth_str = 'n,';
  37078. if (connection.authcid !== null) {
  37079. auth_str = auth_str + 'a=' + connection.authzid;
  37080. }
  37081. auth_str = auth_str + ',';
  37082. auth_str = auth_str + "\x01";
  37083. auth_str = auth_str + 'auth=Bearer ';
  37084. auth_str = auth_str + connection.pass;
  37085. auth_str = auth_str + "\x01";
  37086. auth_str = auth_str + "\x01";
  37087. return utils__WEBPACK_IMPORTED_MODULE_2__["default"].utf16to8(auth_str);
  37088. };
  37089. /** PrivateConstructor: SASLExternal
  37090. * SASL EXTERNAL authentication.
  37091. *
  37092. * The EXTERNAL mechanism allows a client to request the server to use
  37093. * credentials established by means external to the mechanism to
  37094. * authenticate the client. The external means may be, for instance,
  37095. * TLS services.
  37096. */
  37097. Strophe.SASLExternal = function () {};
  37098. Strophe.SASLExternal.prototype = new Strophe.SASLMechanism("EXTERNAL", true, 10);
  37099. Strophe.SASLExternal.prototype.onChallenge = function (connection) {
  37100. /** According to XEP-178, an authzid SHOULD NOT be presented when the
  37101. * authcid contained or implied in the client certificate is the JID (i.e.
  37102. * authzid) with which the user wants to log in as.
  37103. *
  37104. * To NOT send the authzid, the user should therefore set the authcid equal
  37105. * to the JID when instantiating a new Strophe.Connection object.
  37106. */
  37107. return connection.authcid === connection.authzid ? '' : connection.authzid;
  37108. };
  37109. /** PrivateConstructor: SASLXOAuth2
  37110. * SASL X-OAuth2 authentication.
  37111. */
  37112. Strophe.SASLXOAuth2 = function () {};
  37113. Strophe.SASLXOAuth2.prototype = new Strophe.SASLMechanism("X-OAUTH2", true, 30);
  37114. Strophe.SASLXOAuth2.prototype.test = function (connection) {
  37115. return connection.pass !== null;
  37116. };
  37117. Strophe.SASLXOAuth2.prototype.onChallenge = function (connection) {
  37118. var auth_str = "\0";
  37119. if (connection.authcid !== null) {
  37120. auth_str = auth_str + connection.authzid;
  37121. }
  37122. auth_str = auth_str + "\0";
  37123. auth_str = auth_str + connection.pass;
  37124. return utils__WEBPACK_IMPORTED_MODULE_2__["default"].utf16to8(auth_str);
  37125. };
  37126. /* harmony default export */ __webpack_exports__["default"] = ({
  37127. 'Strophe': Strophe,
  37128. '$build': $build,
  37129. '$iq': $iq,
  37130. '$msg': $msg,
  37131. '$pres': $pres,
  37132. 'SHA1': sha1__WEBPACK_IMPORTED_MODULE_1__["default"],
  37133. 'MD5': md5__WEBPACK_IMPORTED_MODULE_0__["default"],
  37134. 'b64_hmac_sha1': sha1__WEBPACK_IMPORTED_MODULE_1__["default"].b64_hmac_sha1,
  37135. 'b64_sha1': sha1__WEBPACK_IMPORTED_MODULE_1__["default"].b64_sha1,
  37136. 'str_hmac_sha1': sha1__WEBPACK_IMPORTED_MODULE_1__["default"].str_hmac_sha1,
  37137. 'str_sha1': sha1__WEBPACK_IMPORTED_MODULE_1__["default"].str_sha1
  37138. });
  37139. /***/ }),
  37140. /***/ "./src/md5.js":
  37141. /*!********************!*\
  37142. !*** ./src/md5.js ***!
  37143. \********************/
  37144. /*! exports provided: default */
  37145. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37146. "use strict";
  37147. __webpack_require__.r(__webpack_exports__);
  37148. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return MD5; });
  37149. /*
  37150. * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
  37151. * Digest Algorithm, as defined in RFC 1321.
  37152. * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
  37153. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  37154. * Distributed under the BSD License
  37155. * See http://pajhome.org.uk/crypt/md5 for more info.
  37156. */
  37157. /*
  37158. * Everything that isn't used by Strophe has been stripped here!
  37159. */
  37160. /*
  37161. * Add integers, wrapping at 2^32. This uses 16-bit operations internally
  37162. * to work around bugs in some JS interpreters.
  37163. */
  37164. var safe_add = function safe_add(x, y) {
  37165. var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  37166. var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  37167. return msw << 16 | lsw & 0xFFFF;
  37168. };
  37169. /*
  37170. * Bitwise rotate a 32-bit number to the left.
  37171. */
  37172. var bit_rol = function bit_rol(num, cnt) {
  37173. return num << cnt | num >>> 32 - cnt;
  37174. };
  37175. /*
  37176. * Convert a string to an array of little-endian words
  37177. */
  37178. var str2binl = function str2binl(str) {
  37179. var bin = [];
  37180. for (var i = 0; i < str.length * 8; i += 8) {
  37181. bin[i >> 5] |= (str.charCodeAt(i / 8) & 255) << i % 32;
  37182. }
  37183. return bin;
  37184. };
  37185. /*
  37186. * Convert an array of little-endian words to a string
  37187. */
  37188. var binl2str = function binl2str(bin) {
  37189. var str = "";
  37190. for (var i = 0; i < bin.length * 32; i += 8) {
  37191. str += String.fromCharCode(bin[i >> 5] >>> i % 32 & 255);
  37192. }
  37193. return str;
  37194. };
  37195. /*
  37196. * Convert an array of little-endian words to a hex string.
  37197. */
  37198. var binl2hex = function binl2hex(binarray) {
  37199. var hex_tab = "0123456789abcdef";
  37200. var str = "";
  37201. for (var i = 0; i < binarray.length * 4; i++) {
  37202. str += hex_tab.charAt(binarray[i >> 2] >> i % 4 * 8 + 4 & 0xF) + hex_tab.charAt(binarray[i >> 2] >> i % 4 * 8 & 0xF);
  37203. }
  37204. return str;
  37205. };
  37206. /*
  37207. * These functions implement the four basic operations the algorithm uses.
  37208. */
  37209. var md5_cmn = function md5_cmn(q, a, b, x, s, t) {
  37210. return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
  37211. };
  37212. var md5_ff = function md5_ff(a, b, c, d, x, s, t) {
  37213. return md5_cmn(b & c | ~b & d, a, b, x, s, t);
  37214. };
  37215. var md5_gg = function md5_gg(a, b, c, d, x, s, t) {
  37216. return md5_cmn(b & d | c & ~d, a, b, x, s, t);
  37217. };
  37218. var md5_hh = function md5_hh(a, b, c, d, x, s, t) {
  37219. return md5_cmn(b ^ c ^ d, a, b, x, s, t);
  37220. };
  37221. var md5_ii = function md5_ii(a, b, c, d, x, s, t) {
  37222. return md5_cmn(c ^ (b | ~d), a, b, x, s, t);
  37223. };
  37224. /*
  37225. * Calculate the MD5 of an array of little-endian words, and a bit length
  37226. */
  37227. var core_md5 = function core_md5(x, len) {
  37228. /* append padding */
  37229. x[len >> 5] |= 0x80 << len % 32;
  37230. x[(len + 64 >>> 9 << 4) + 14] = len;
  37231. var a = 1732584193;
  37232. var b = -271733879;
  37233. var c = -1732584194;
  37234. var d = 271733878;
  37235. var olda, oldb, oldc, oldd;
  37236. for (var i = 0; i < x.length; i += 16) {
  37237. olda = a;
  37238. oldb = b;
  37239. oldc = c;
  37240. oldd = d;
  37241. a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936);
  37242. d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);
  37243. c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);
  37244. b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);
  37245. a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);
  37246. d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);
  37247. c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);
  37248. b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);
  37249. a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);
  37250. d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);
  37251. c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);
  37252. b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);
  37253. a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);
  37254. d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);
  37255. c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);
  37256. b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);
  37257. a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);
  37258. d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);
  37259. c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);
  37260. b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302);
  37261. a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);
  37262. d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);
  37263. c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);
  37264. b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);
  37265. a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);
  37266. d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);
  37267. c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);
  37268. b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);
  37269. a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);
  37270. d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);
  37271. c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);
  37272. b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);
  37273. a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);
  37274. d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);
  37275. c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);
  37276. b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);
  37277. a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);
  37278. d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);
  37279. c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);
  37280. b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);
  37281. a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);
  37282. d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222);
  37283. c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);
  37284. b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);
  37285. a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);
  37286. d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);
  37287. c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);
  37288. b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);
  37289. a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844);
  37290. d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);
  37291. c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);
  37292. b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);
  37293. a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);
  37294. d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);
  37295. c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);
  37296. b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);
  37297. a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);
  37298. d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);
  37299. c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);
  37300. b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);
  37301. a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);
  37302. d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
  37303. c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
  37304. b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
  37305. a = safe_add(a, olda);
  37306. b = safe_add(b, oldb);
  37307. c = safe_add(c, oldc);
  37308. d = safe_add(d, oldd);
  37309. }
  37310. return [a, b, c, d];
  37311. };
  37312. /*
  37313. * These are the functions you'll usually want to call.
  37314. * They take string arguments and return either hex or base-64 encoded
  37315. * strings.
  37316. */
  37317. var MD5 = {
  37318. hexdigest: function hexdigest(s) {
  37319. return binl2hex(core_md5(str2binl(s), s.length * 8));
  37320. },
  37321. hash: function hash(s) {
  37322. return binl2str(core_md5(str2binl(s), s.length * 8));
  37323. }
  37324. };
  37325. /***/ }),
  37326. /***/ "./src/sha1.js":
  37327. /*!*********************!*\
  37328. !*** ./src/sha1.js ***!
  37329. \*********************/
  37330. /*! exports provided: default */
  37331. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37332. "use strict";
  37333. __webpack_require__.r(__webpack_exports__);
  37334. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SHA1; });
  37335. /*
  37336. * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
  37337. * in FIPS PUB 180-1
  37338. * Version 2.1a Copyright Paul Johnston 2000 - 2002.
  37339. * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  37340. * Distributed under the BSD License
  37341. * See http://pajhome.org.uk/crypt/md5 for details.
  37342. */
  37343. /* jshint undef: true, unused: true:, noarg: true, latedef: false */
  37344. /* global define */
  37345. /* Some functions and variables have been stripped for use with Strophe */
  37346. /*
  37347. * Calculate the SHA-1 of an array of big-endian words, and a bit length
  37348. */
  37349. function core_sha1(x, len) {
  37350. /* append padding */
  37351. x[len >> 5] |= 0x80 << 24 - len % 32;
  37352. x[(len + 64 >> 9 << 4) + 15] = len;
  37353. var w = new Array(80);
  37354. var a = 1732584193;
  37355. var b = -271733879;
  37356. var c = -1732584194;
  37357. var d = 271733878;
  37358. var e = -1009589776;
  37359. var i, j, t, olda, oldb, oldc, oldd, olde;
  37360. for (i = 0; i < x.length; i += 16) {
  37361. olda = a;
  37362. oldb = b;
  37363. oldc = c;
  37364. oldd = d;
  37365. olde = e;
  37366. for (j = 0; j < 80; j++) {
  37367. if (j < 16) {
  37368. w[j] = x[i + j];
  37369. } else {
  37370. w[j] = rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1);
  37371. }
  37372. t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), safe_add(safe_add(e, w[j]), sha1_kt(j)));
  37373. e = d;
  37374. d = c;
  37375. c = rol(b, 30);
  37376. b = a;
  37377. a = t;
  37378. }
  37379. a = safe_add(a, olda);
  37380. b = safe_add(b, oldb);
  37381. c = safe_add(c, oldc);
  37382. d = safe_add(d, oldd);
  37383. e = safe_add(e, olde);
  37384. }
  37385. return [a, b, c, d, e];
  37386. }
  37387. /*
  37388. * Perform the appropriate triplet combination function for the current
  37389. * iteration
  37390. */
  37391. function sha1_ft(t, b, c, d) {
  37392. if (t < 20) {
  37393. return b & c | ~b & d;
  37394. }
  37395. if (t < 40) {
  37396. return b ^ c ^ d;
  37397. }
  37398. if (t < 60) {
  37399. return b & c | b & d | c & d;
  37400. }
  37401. return b ^ c ^ d;
  37402. }
  37403. /*
  37404. * Determine the appropriate additive constant for the current iteration
  37405. */
  37406. function sha1_kt(t) {
  37407. return t < 20 ? 1518500249 : t < 40 ? 1859775393 : t < 60 ? -1894007588 : -899497514;
  37408. }
  37409. /*
  37410. * Calculate the HMAC-SHA1 of a key and some data
  37411. */
  37412. function core_hmac_sha1(key, data) {
  37413. var bkey = str2binb(key);
  37414. if (bkey.length > 16) {
  37415. bkey = core_sha1(bkey, key.length * 8);
  37416. }
  37417. var ipad = new Array(16),
  37418. opad = new Array(16);
  37419. for (var i = 0; i < 16; i++) {
  37420. ipad[i] = bkey[i] ^ 0x36363636;
  37421. opad[i] = bkey[i] ^ 0x5C5C5C5C;
  37422. }
  37423. var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * 8);
  37424. return core_sha1(opad.concat(hash), 512 + 160);
  37425. }
  37426. /*
  37427. * Add integers, wrapping at 2^32. This uses 16-bit operations internally
  37428. * to work around bugs in some JS interpreters.
  37429. */
  37430. function safe_add(x, y) {
  37431. var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  37432. var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  37433. return msw << 16 | lsw & 0xFFFF;
  37434. }
  37435. /*
  37436. * Bitwise rotate a 32-bit number to the left.
  37437. */
  37438. function rol(num, cnt) {
  37439. return num << cnt | num >>> 32 - cnt;
  37440. }
  37441. /*
  37442. * Convert an 8-bit or 16-bit string to an array of big-endian words
  37443. * In 8-bit function, characters >255 have their hi-byte silently ignored.
  37444. */
  37445. function str2binb(str) {
  37446. var bin = [];
  37447. var mask = 255;
  37448. for (var i = 0; i < str.length * 8; i += 8) {
  37449. bin[i >> 5] |= (str.charCodeAt(i / 8) & mask) << 24 - i % 32;
  37450. }
  37451. return bin;
  37452. }
  37453. /*
  37454. * Convert an array of big-endian words to a base-64 string
  37455. */
  37456. function binb2b64(binarray) {
  37457. var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  37458. var str = "";
  37459. var triplet, j;
  37460. for (var i = 0; i < binarray.length * 4; i += 3) {
  37461. triplet = (binarray[i >> 2] >> 8 * (3 - i % 4) & 0xFF) << 16 | (binarray[i + 1 >> 2] >> 8 * (3 - (i + 1) % 4) & 0xFF) << 8 | binarray[i + 2 >> 2] >> 8 * (3 - (i + 2) % 4) & 0xFF;
  37462. for (j = 0; j < 4; j++) {
  37463. if (i * 8 + j * 6 > binarray.length * 32) {
  37464. str += "=";
  37465. } else {
  37466. str += tab.charAt(triplet >> 6 * (3 - j) & 0x3F);
  37467. }
  37468. }
  37469. }
  37470. return str;
  37471. }
  37472. /*
  37473. * Convert an array of big-endian words to a string
  37474. */
  37475. function binb2str(bin) {
  37476. var str = "";
  37477. var mask = 255;
  37478. for (var i = 0; i < bin.length * 32; i += 8) {
  37479. str += String.fromCharCode(bin[i >> 5] >>> 24 - i % 32 & mask);
  37480. }
  37481. return str;
  37482. }
  37483. /*
  37484. * These are the functions you'll usually want to call
  37485. * They take string arguments and return either hex or base-64 encoded strings
  37486. */
  37487. var SHA1 = {
  37488. b64_hmac_sha1: function b64_hmac_sha1(key, data) {
  37489. return binb2b64(core_hmac_sha1(key, data));
  37490. },
  37491. b64_sha1: function b64_sha1(s) {
  37492. return binb2b64(core_sha1(str2binb(s), s.length * 8));
  37493. },
  37494. binb2str: binb2str,
  37495. core_hmac_sha1: core_hmac_sha1,
  37496. str_hmac_sha1: function str_hmac_sha1(key, data) {
  37497. return binb2str(core_hmac_sha1(key, data));
  37498. },
  37499. str_sha1: function str_sha1(s) {
  37500. return binb2str(core_sha1(str2binb(s), s.length * 8));
  37501. }
  37502. };
  37503. /***/ }),
  37504. /***/ "./src/strophe.js":
  37505. /*!************************!*\
  37506. !*** ./src/strophe.js ***!
  37507. \************************/
  37508. /*! exports provided: default */
  37509. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37510. "use strict";
  37511. __webpack_require__.r(__webpack_exports__);
  37512. /* harmony import */ var bosh__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! bosh */ "./src/bosh.js");
  37513. /* harmony import */ var websocket__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! websocket */ "./src/websocket.js");
  37514. /* harmony import */ var core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core */ "./src/core.js");
  37515. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "default", function() { return core__WEBPACK_IMPORTED_MODULE_2__["default"]; });
  37516. /***/ }),
  37517. /***/ "./src/utils.js":
  37518. /*!**********************!*\
  37519. !*** ./src/utils.js ***!
  37520. \**********************/
  37521. /*! exports provided: default */
  37522. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37523. "use strict";
  37524. __webpack_require__.r(__webpack_exports__);
  37525. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return utils; });
  37526. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  37527. var utils = {
  37528. utf16to8: function utf16to8(str) {
  37529. var i, c;
  37530. var out = "";
  37531. var len = str.length;
  37532. for (i = 0; i < len; i++) {
  37533. c = str.charCodeAt(i);
  37534. if (c >= 0x0000 && c <= 0x007F) {
  37535. out += str.charAt(i);
  37536. } else if (c > 0x07FF) {
  37537. out += String.fromCharCode(0xE0 | c >> 12 & 0x0F);
  37538. out += String.fromCharCode(0x80 | c >> 6 & 0x3F);
  37539. out += String.fromCharCode(0x80 | c >> 0 & 0x3F);
  37540. } else {
  37541. out += String.fromCharCode(0xC0 | c >> 6 & 0x1F);
  37542. out += String.fromCharCode(0x80 | c >> 0 & 0x3F);
  37543. }
  37544. }
  37545. return out;
  37546. },
  37547. addCookies: function addCookies(cookies) {
  37548. /* Parameters:
  37549. * (Object) cookies - either a map of cookie names
  37550. * to string values or to maps of cookie values.
  37551. *
  37552. * For example:
  37553. * { "myCookie": "1234" }
  37554. *
  37555. * or:
  37556. * { "myCookie": {
  37557. * "value": "1234",
  37558. * "domain": ".example.org",
  37559. * "path": "/",
  37560. * "expires": expirationDate
  37561. * }
  37562. * }
  37563. *
  37564. * These values get passed to Strophe.Connection via
  37565. * options.cookies
  37566. */
  37567. cookies = cookies || {};
  37568. for (var cookieName in cookies) {
  37569. if (Object.prototype.hasOwnProperty.call(cookies, cookieName)) {
  37570. var expires = '';
  37571. var domain = '';
  37572. var path = '';
  37573. var cookieObj = cookies[cookieName];
  37574. var isObj = _typeof(cookieObj) === "object";
  37575. var cookieValue = escape(unescape(isObj ? cookieObj.value : cookieObj));
  37576. if (isObj) {
  37577. expires = cookieObj.expires ? ";expires=" + cookieObj.expires : '';
  37578. domain = cookieObj.domain ? ";domain=" + cookieObj.domain : '';
  37579. path = cookieObj.path ? ";path=" + cookieObj.path : '';
  37580. }
  37581. document.cookie = cookieName + '=' + cookieValue + expires + domain + path;
  37582. }
  37583. }
  37584. }
  37585. };
  37586. /***/ }),
  37587. /***/ "./src/websocket.js":
  37588. /*!**************************!*\
  37589. !*** ./src/websocket.js ***!
  37590. \**************************/
  37591. /*! no exports provided */
  37592. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  37593. "use strict";
  37594. __webpack_require__.r(__webpack_exports__);
  37595. /* harmony import */ var core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core */ "./src/core.js");
  37596. /*
  37597. This program is distributed under the terms of the MIT license.
  37598. Please see the LICENSE file for details.
  37599. Copyright 2006-2008, OGG, LLC
  37600. */
  37601. /* global window, clearTimeout, WebSocket, DOMParser */
  37602. var Strophe = core__WEBPACK_IMPORTED_MODULE_0__["default"].Strophe;
  37603. var $build = core__WEBPACK_IMPORTED_MODULE_0__["default"].$build;
  37604. /** Class: Strophe.WebSocket
  37605. * _Private_ helper class that handles WebSocket Connections
  37606. *
  37607. * The Strophe.WebSocket class is used internally by Strophe.Connection
  37608. * to encapsulate WebSocket sessions. It is not meant to be used from user's code.
  37609. */
  37610. /** File: websocket.js
  37611. * A JavaScript library to enable XMPP over Websocket in Strophejs.
  37612. *
  37613. * This file implements XMPP over WebSockets for Strophejs.
  37614. * If a Connection is established with a Websocket url (ws://...)
  37615. * Strophe will use WebSockets.
  37616. * For more information on XMPP-over-WebSocket see RFC 7395:
  37617. * http://tools.ietf.org/html/rfc7395
  37618. *
  37619. * WebSocket support implemented by Andreas Guth (andreas.guth@rwth-aachen.de)
  37620. */
  37621. /** PrivateConstructor: Strophe.Websocket
  37622. * Create and initialize a Strophe.WebSocket object.
  37623. * Currently only sets the connection Object.
  37624. *
  37625. * Parameters:
  37626. * (Strophe.Connection) connection - The Strophe.Connection that will use WebSockets.
  37627. *
  37628. * Returns:
  37629. * A new Strophe.WebSocket object.
  37630. */
  37631. Strophe.Websocket = function (connection) {
  37632. this._conn = connection;
  37633. this.strip = "wrapper";
  37634. var service = connection.service;
  37635. if (service.indexOf("ws:") !== 0 && service.indexOf("wss:") !== 0) {
  37636. // If the service is not an absolute URL, assume it is a path and put the absolute
  37637. // URL together from options, current URL and the path.
  37638. var new_service = "";
  37639. if (connection.options.protocol === "ws" && window.location.protocol !== "https:") {
  37640. new_service += "ws";
  37641. } else {
  37642. new_service += "wss";
  37643. }
  37644. new_service += "://" + window.location.host;
  37645. if (service.indexOf("/") !== 0) {
  37646. new_service += window.location.pathname + service;
  37647. } else {
  37648. new_service += service;
  37649. }
  37650. connection.service = new_service;
  37651. }
  37652. };
  37653. Strophe.Websocket.prototype = {
  37654. /** PrivateFunction: _buildStream
  37655. * _Private_ helper function to generate the <stream> start tag for WebSockets
  37656. *
  37657. * Returns:
  37658. * A Strophe.Builder with a <stream> element.
  37659. */
  37660. _buildStream: function _buildStream() {
  37661. return $build("open", {
  37662. "xmlns": Strophe.NS.FRAMING,
  37663. "to": this._conn.domain,
  37664. "version": '1.0'
  37665. });
  37666. },
  37667. /** PrivateFunction: _check_streamerror
  37668. * _Private_ checks a message for stream:error
  37669. *
  37670. * Parameters:
  37671. * (Strophe.Request) bodyWrap - The received stanza.
  37672. * connectstatus - The ConnectStatus that will be set on error.
  37673. * Returns:
  37674. * true if there was a streamerror, false otherwise.
  37675. */
  37676. _check_streamerror: function _check_streamerror(bodyWrap, connectstatus) {
  37677. var errors;
  37678. if (bodyWrap.getElementsByTagNameNS) {
  37679. errors = bodyWrap.getElementsByTagNameNS(Strophe.NS.STREAM, "error");
  37680. } else {
  37681. errors = bodyWrap.getElementsByTagName("stream:error");
  37682. }
  37683. if (errors.length === 0) {
  37684. return false;
  37685. }
  37686. var error = errors[0];
  37687. var condition = "";
  37688. var text = "";
  37689. var ns = "urn:ietf:params:xml:ns:xmpp-streams";
  37690. for (var i = 0; i < error.childNodes.length; i++) {
  37691. var e = error.childNodes[i];
  37692. if (e.getAttribute("xmlns") !== ns) {
  37693. break;
  37694. }
  37695. if (e.nodeName === "text") {
  37696. text = e.textContent;
  37697. } else {
  37698. condition = e.nodeName;
  37699. }
  37700. }
  37701. var errorString = "WebSocket stream error: ";
  37702. if (condition) {
  37703. errorString += condition;
  37704. } else {
  37705. errorString += "unknown";
  37706. }
  37707. if (text) {
  37708. errorString += " - " + text;
  37709. }
  37710. Strophe.error(errorString); // close the connection on stream_error
  37711. this._conn._changeConnectStatus(connectstatus, condition);
  37712. this._conn._doDisconnect();
  37713. return true;
  37714. },
  37715. /** PrivateFunction: _reset
  37716. * Reset the connection.
  37717. *
  37718. * This function is called by the reset function of the Strophe Connection.
  37719. * Is not needed by WebSockets.
  37720. */
  37721. _reset: function _reset() {
  37722. return;
  37723. },
  37724. /** PrivateFunction: _connect
  37725. * _Private_ function called by Strophe.Connection.connect
  37726. *
  37727. * Creates a WebSocket for a connection and assigns Callbacks to it.
  37728. * Does nothing if there already is a WebSocket.
  37729. */
  37730. _connect: function _connect() {
  37731. // Ensure that there is no open WebSocket from a previous Connection.
  37732. this._closeSocket(); // Create the new WobSocket
  37733. this.socket = new WebSocket(this._conn.service, "xmpp");
  37734. this.socket.onopen = this._onOpen.bind(this);
  37735. this.socket.onerror = this._onError.bind(this);
  37736. this.socket.onclose = this._onClose.bind(this);
  37737. this.socket.onmessage = this._connect_cb_wrapper.bind(this);
  37738. },
  37739. /** PrivateFunction: _connect_cb
  37740. * _Private_ function called by Strophe.Connection._connect_cb
  37741. *
  37742. * checks for stream:error
  37743. *
  37744. * Parameters:
  37745. * (Strophe.Request) bodyWrap - The received stanza.
  37746. */
  37747. _connect_cb: function _connect_cb(bodyWrap) {
  37748. var error = this._check_streamerror(bodyWrap, Strophe.Status.CONNFAIL);
  37749. if (error) {
  37750. return Strophe.Status.CONNFAIL;
  37751. }
  37752. },
  37753. /** PrivateFunction: _handleStreamStart
  37754. * _Private_ function that checks the opening <open /> tag for errors.
  37755. *
  37756. * Disconnects if there is an error and returns false, true otherwise.
  37757. *
  37758. * Parameters:
  37759. * (Node) message - Stanza containing the <open /> tag.
  37760. */
  37761. _handleStreamStart: function _handleStreamStart(message) {
  37762. var error = false; // Check for errors in the <open /> tag
  37763. var ns = message.getAttribute("xmlns");
  37764. if (typeof ns !== "string") {
  37765. error = "Missing xmlns in <open />";
  37766. } else if (ns !== Strophe.NS.FRAMING) {
  37767. error = "Wrong xmlns in <open />: " + ns;
  37768. }
  37769. var ver = message.getAttribute("version");
  37770. if (typeof ver !== "string") {
  37771. error = "Missing version in <open />";
  37772. } else if (ver !== "1.0") {
  37773. error = "Wrong version in <open />: " + ver;
  37774. }
  37775. if (error) {
  37776. this._conn._changeConnectStatus(Strophe.Status.CONNFAIL, error);
  37777. this._conn._doDisconnect();
  37778. return false;
  37779. }
  37780. return true;
  37781. },
  37782. /** PrivateFunction: _connect_cb_wrapper
  37783. * _Private_ function that handles the first connection messages.
  37784. *
  37785. * On receiving an opening stream tag this callback replaces itself with the real
  37786. * message handler. On receiving a stream error the connection is terminated.
  37787. */
  37788. _connect_cb_wrapper: function _connect_cb_wrapper(message) {
  37789. if (message.data.indexOf("<open ") === 0 || message.data.indexOf("<?xml") === 0) {
  37790. // Strip the XML Declaration, if there is one
  37791. var data = message.data.replace(/^(<\?.*?\?>\s*)*/, "");
  37792. if (data === '') return;
  37793. var streamStart = new DOMParser().parseFromString(data, "text/xml").documentElement;
  37794. this._conn.xmlInput(streamStart);
  37795. this._conn.rawInput(message.data); //_handleStreamSteart will check for XML errors and disconnect on error
  37796. if (this._handleStreamStart(streamStart)) {
  37797. //_connect_cb will check for stream:error and disconnect on error
  37798. this._connect_cb(streamStart);
  37799. }
  37800. } else if (message.data.indexOf("<close ") === 0) {
  37801. // <close xmlns="urn:ietf:params:xml:ns:xmpp-framing />
  37802. // Parse the raw string to an XML element
  37803. var parsedMessage = new DOMParser().parseFromString(message.data, "text/xml").documentElement; // Report this input to the raw and xml handlers
  37804. this._conn.xmlInput(parsedMessage);
  37805. this._conn.rawInput(message.data);
  37806. var see_uri = parsedMessage.getAttribute("see-other-uri");
  37807. if (see_uri) {
  37808. var service = this._conn.service; // Valid scenarios: WSS->WSS, WS->ANY
  37809. var isSecureRedirect = service.indexOf("wss:") >= 0 && see_uri.indexOf("wss:") >= 0 || service.indexOf("ws:") >= 0;
  37810. if (isSecureRedirect) {
  37811. this._conn._changeConnectStatus(Strophe.Status.REDIRECT, "Received see-other-uri, resetting connection");
  37812. this._conn.reset();
  37813. this._conn.service = see_uri;
  37814. this._connect();
  37815. }
  37816. } else {
  37817. this._conn._changeConnectStatus(Strophe.Status.CONNFAIL, "Received closing stream");
  37818. this._conn._doDisconnect();
  37819. }
  37820. } else {
  37821. var string = this._streamWrap(message.data);
  37822. var elem = new DOMParser().parseFromString(string, "text/xml").documentElement;
  37823. this.socket.onmessage = this._onMessage.bind(this);
  37824. this._conn._connect_cb(elem, null, message.data);
  37825. }
  37826. },
  37827. /** PrivateFunction: _disconnect
  37828. * _Private_ function called by Strophe.Connection.disconnect
  37829. *
  37830. * Disconnects and sends a last stanza if one is given
  37831. *
  37832. * Parameters:
  37833. * (Request) pres - This stanza will be sent before disconnecting.
  37834. */
  37835. _disconnect: function _disconnect(pres) {
  37836. if (this.socket && this.socket.readyState !== WebSocket.CLOSED) {
  37837. if (pres) {
  37838. this._conn.send(pres);
  37839. }
  37840. var close = $build("close", {
  37841. "xmlns": Strophe.NS.FRAMING
  37842. });
  37843. this._conn.xmlOutput(close.tree());
  37844. var closeString = Strophe.serialize(close);
  37845. this._conn.rawOutput(closeString);
  37846. try {
  37847. this.socket.send(closeString);
  37848. } catch (e) {
  37849. Strophe.info("Couldn't send <close /> tag.");
  37850. }
  37851. }
  37852. this._conn._doDisconnect();
  37853. },
  37854. /** PrivateFunction: _doDisconnect
  37855. * _Private_ function to disconnect.
  37856. *
  37857. * Just closes the Socket for WebSockets
  37858. */
  37859. _doDisconnect: function _doDisconnect() {
  37860. Strophe.info("WebSockets _doDisconnect was called");
  37861. this._closeSocket();
  37862. },
  37863. /** PrivateFunction _streamWrap
  37864. * _Private_ helper function to wrap a stanza in a <stream> tag.
  37865. * This is used so Strophe can process stanzas from WebSockets like BOSH
  37866. */
  37867. _streamWrap: function _streamWrap(stanza) {
  37868. return "<wrapper>" + stanza + '</wrapper>';
  37869. },
  37870. /** PrivateFunction: _closeSocket
  37871. * _Private_ function to close the WebSocket.
  37872. *
  37873. * Closes the socket if it is still open and deletes it
  37874. */
  37875. _closeSocket: function _closeSocket() {
  37876. if (this.socket) {
  37877. try {
  37878. this.socket.onerror = null;
  37879. this.socket.close();
  37880. } catch (e) {
  37881. Strophe.debug(e.message);
  37882. }
  37883. }
  37884. this.socket = null;
  37885. },
  37886. /** PrivateFunction: _emptyQueue
  37887. * _Private_ function to check if the message queue is empty.
  37888. *
  37889. * Returns:
  37890. * True, because WebSocket messages are send immediately after queueing.
  37891. */
  37892. _emptyQueue: function _emptyQueue() {
  37893. return true;
  37894. },
  37895. /** PrivateFunction: _onClose
  37896. * _Private_ function to handle websockets closing.
  37897. *
  37898. * Nothing to do here for WebSockets
  37899. */
  37900. _onClose: function _onClose(e) {
  37901. if (this._conn.connected && !this._conn.disconnecting) {
  37902. Strophe.error("Websocket closed unexpectedly");
  37903. this._conn._doDisconnect();
  37904. } else if (e && e.code === 1006 && !this._conn.connected && this.socket) {
  37905. // in case the onError callback was not called (Safari 10 does not
  37906. // call onerror when the initial connection fails) we need to
  37907. // dispatch a CONNFAIL status update to be consistent with the
  37908. // behavior on other browsers.
  37909. Strophe.error("Websocket closed unexcectedly");
  37910. this._conn._changeConnectStatus(Strophe.Status.CONNFAIL, "The WebSocket connection could not be established or was disconnected.");
  37911. this._conn._doDisconnect();
  37912. } else {
  37913. Strophe.info("Websocket closed");
  37914. }
  37915. },
  37916. /** PrivateFunction: _no_auth_received
  37917. *
  37918. * Called on stream start/restart when no stream:features
  37919. * has been received.
  37920. */
  37921. _no_auth_received: function _no_auth_received(callback) {
  37922. Strophe.error("Server did not offer a supported authentication mechanism");
  37923. this._changeConnectStatus(Strophe.Status.CONNFAIL, Strophe.ErrorCondition.NO_AUTH_MECH);
  37924. if (callback) {
  37925. callback.call(this._conn);
  37926. }
  37927. this._conn._doDisconnect();
  37928. },
  37929. /** PrivateFunction: _onDisconnectTimeout
  37930. * _Private_ timeout handler for handling non-graceful disconnection.
  37931. *
  37932. * This does nothing for WebSockets
  37933. */
  37934. _onDisconnectTimeout: function _onDisconnectTimeout() {},
  37935. /** PrivateFunction: _abortAllRequests
  37936. * _Private_ helper function that makes sure all pending requests are aborted.
  37937. */
  37938. _abortAllRequests: function _abortAllRequests() {},
  37939. /** PrivateFunction: _onError
  37940. * _Private_ function to handle websockets errors.
  37941. *
  37942. * Parameters:
  37943. * (Object) error - The websocket error.
  37944. */
  37945. _onError: function _onError(error) {
  37946. Strophe.error("Websocket error " + error);
  37947. this._conn._changeConnectStatus(Strophe.Status.CONNFAIL, "The WebSocket connection could not be established or was disconnected.");
  37948. this._disconnect();
  37949. },
  37950. /** PrivateFunction: _onIdle
  37951. * _Private_ function called by Strophe.Connection._onIdle
  37952. *
  37953. * sends all queued stanzas
  37954. */
  37955. _onIdle: function _onIdle() {
  37956. var data = this._conn._data;
  37957. if (data.length > 0 && !this._conn.paused) {
  37958. for (var i = 0; i < data.length; i++) {
  37959. if (data[i] !== null) {
  37960. var stanza = void 0;
  37961. if (data[i] === "restart") {
  37962. stanza = this._buildStream().tree();
  37963. } else {
  37964. stanza = data[i];
  37965. }
  37966. var rawStanza = Strophe.serialize(stanza);
  37967. this._conn.xmlOutput(stanza);
  37968. this._conn.rawOutput(rawStanza);
  37969. this.socket.send(rawStanza);
  37970. }
  37971. }
  37972. this._conn._data = [];
  37973. }
  37974. },
  37975. /** PrivateFunction: _onMessage
  37976. * _Private_ function to handle websockets messages.
  37977. *
  37978. * This function parses each of the messages as if they are full documents.
  37979. * [TODO : We may actually want to use a SAX Push parser].
  37980. *
  37981. * Since all XMPP traffic starts with
  37982. * <stream:stream version='1.0'
  37983. * xml:lang='en'
  37984. * xmlns='jabber:client'
  37985. * xmlns:stream='http://etherx.jabber.org/streams'
  37986. * id='3697395463'
  37987. * from='SERVER'>
  37988. *
  37989. * The first stanza will always fail to be parsed.
  37990. *
  37991. * Additionally, the seconds stanza will always be <stream:features> with
  37992. * the stream NS defined in the previous stanza, so we need to 'force'
  37993. * the inclusion of the NS in this stanza.
  37994. *
  37995. * Parameters:
  37996. * (string) message - The websocket message.
  37997. */
  37998. _onMessage: function _onMessage(message) {
  37999. var elem; // check for closing stream
  38000. var close = '<close xmlns="urn:ietf:params:xml:ns:xmpp-framing" />';
  38001. if (message.data === close) {
  38002. this._conn.rawInput(close);
  38003. this._conn.xmlInput(message);
  38004. if (!this._conn.disconnecting) {
  38005. this._conn._doDisconnect();
  38006. }
  38007. return;
  38008. } else if (message.data.search("<open ") === 0) {
  38009. // This handles stream restarts
  38010. elem = new DOMParser().parseFromString(message.data, "text/xml").documentElement;
  38011. if (!this._handleStreamStart(elem)) {
  38012. return;
  38013. }
  38014. } else {
  38015. var data = this._streamWrap(message.data);
  38016. elem = new DOMParser().parseFromString(data, "text/xml").documentElement;
  38017. }
  38018. if (this._check_streamerror(elem, Strophe.Status.ERROR)) {
  38019. return;
  38020. } //handle unavailable presence stanza before disconnecting
  38021. if (this._conn.disconnecting && elem.firstChild.nodeName === "presence" && elem.firstChild.getAttribute("type") === "unavailable") {
  38022. this._conn.xmlInput(elem);
  38023. this._conn.rawInput(Strophe.serialize(elem)); // if we are already disconnecting we will ignore the unavailable stanza and
  38024. // wait for the </stream:stream> tag before we close the connection
  38025. return;
  38026. }
  38027. this._conn._dataRecv(elem, message.data);
  38028. },
  38029. /** PrivateFunction: _onOpen
  38030. * _Private_ function to handle websockets connection setup.
  38031. *
  38032. * The opening stream tag is sent here.
  38033. */
  38034. _onOpen: function _onOpen() {
  38035. Strophe.info("Websocket open");
  38036. var start = this._buildStream();
  38037. this._conn.xmlOutput(start.tree());
  38038. var startString = Strophe.serialize(start);
  38039. this._conn.rawOutput(startString);
  38040. this.socket.send(startString);
  38041. },
  38042. /** PrivateFunction: _reqToData
  38043. * _Private_ function to get a stanza out of a request.
  38044. *
  38045. * WebSockets don't use requests, so the passed argument is just returned.
  38046. *
  38047. * Parameters:
  38048. * (Object) stanza - The stanza.
  38049. *
  38050. * Returns:
  38051. * The stanza that was passed.
  38052. */
  38053. _reqToData: function _reqToData(stanza) {
  38054. return stanza;
  38055. },
  38056. /** PrivateFunction: _send
  38057. * _Private_ part of the Connection.send function for WebSocket
  38058. *
  38059. * Just flushes the messages that are in the queue
  38060. */
  38061. _send: function _send() {
  38062. this._conn.flush();
  38063. },
  38064. /** PrivateFunction: _sendRestart
  38065. *
  38066. * Send an xmpp:restart stanza.
  38067. */
  38068. _sendRestart: function _sendRestart() {
  38069. clearTimeout(this._conn._idleTimeout);
  38070. this._conn._onIdle.bind(this._conn)();
  38071. }
  38072. };
  38073. /***/ })
  38074. /******/ })["default"];
  38075. });
  38076. //# sourceMappingURL=strophe.js.map
  38077. /***/ }),
  38078. /***/ "./node_modules/strophejs-plugin-ping/strophe.ping.js":
  38079. /*!************************************************************!*\
  38080. !*** ./node_modules/strophejs-plugin-ping/strophe.ping.js ***!
  38081. \************************************************************/
  38082. /*! no static exports found */
  38083. /***/ (function(module, exports, __webpack_require__) {
  38084. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
  38085. * Based on Ping Strophejs plugins (https://github.com/metajack/strophejs-plugins/tree/master/ping)
  38086. * This plugin is distributed under the terms of the MIT licence.
  38087. * Please see the LICENCE file for details.
  38088. *
  38089. * Copyright (c) Markus Kohlhase, 2010
  38090. * Refactored by Pavel Lang, 2011
  38091. * AMD Support added by Thierry
  38092. */
  38093. /**
  38094. * File: strophe.ping.js
  38095. * A Strophe plugin for XMPP Ping ( http://xmpp.org/extensions/xep-0199.html )
  38096. */
  38097. (function (root, factory) {
  38098. if (true) {
  38099. // AMD. Register as an anonymous module.
  38100. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [
  38101. __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.js")
  38102. ], __WEBPACK_AMD_DEFINE_RESULT__ = (function (Strophe) {
  38103. factory(
  38104. Strophe.Strophe,
  38105. Strophe.$build,
  38106. Strophe.$iq ,
  38107. Strophe.$msg,
  38108. Strophe.$pres
  38109. );
  38110. return Strophe;
  38111. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  38112. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  38113. } else {}
  38114. }(this, function (Strophe, $build, $iq, $msg, $pres) {
  38115. Strophe.addConnectionPlugin('ping', {
  38116. _c: null,
  38117. // called by the Strophe.Connection constructor
  38118. init: function(conn) {
  38119. this._c = conn;
  38120. Strophe.addNamespace('PING', "urn:xmpp:ping");
  38121. },
  38122. /**
  38123. * Function: ping
  38124. *
  38125. * Parameters:
  38126. * (String) to - The JID you want to ping
  38127. * (Function) success - Callback function on success
  38128. * (Function) error - Callback function on error
  38129. * (Integer) timeout - Timeout in milliseconds
  38130. */
  38131. ping: function(jid, success, error, timeout) {
  38132. var id = this._c.getUniqueId('ping');
  38133. var iq = $iq({type: 'get', to: jid, id: id}).c(
  38134. 'ping', {xmlns: Strophe.NS.PING});
  38135. this._c.sendIQ(iq, success, error, timeout);
  38136. },
  38137. /**
  38138. * Function: pong
  38139. *
  38140. * Parameters:
  38141. * (Object) ping - The ping stanza from the server.
  38142. */
  38143. pong: function(ping) {
  38144. var from = ping.getAttribute('from');
  38145. var id = ping.getAttribute('id');
  38146. var iq = $iq({type: 'result', to: from,id: id});
  38147. this._c.sendIQ(iq);
  38148. },
  38149. /**
  38150. * Function: addPingHandler
  38151. *
  38152. * Parameters:
  38153. * (Function) handler - Ping handler
  38154. *
  38155. * Returns:
  38156. * A reference to the handler that can be used to remove it.
  38157. */
  38158. addPingHandler: function(handler) {
  38159. return this._c.addHandler(handler, Strophe.NS.PING, "iq", "get");
  38160. }
  38161. });
  38162. }));
  38163. /***/ }),
  38164. /***/ "./node_modules/strophejs-plugin-rsm/lib/strophe.rsm.js":
  38165. /*!**************************************************************!*\
  38166. !*** ./node_modules/strophejs-plugin-rsm/lib/strophe.rsm.js ***!
  38167. \**************************************************************/
  38168. /*! no static exports found */
  38169. /***/ (function(module, exports, __webpack_require__) {
  38170. (function (global, factory) {
  38171. true ? factory(__webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.js")) :
  38172. undefined;
  38173. }(this, (function (strophe_js) { 'use strict';
  38174. strophe_js.Strophe.addNamespace('RSM', 'http://jabber.org/protocol/rsm');
  38175. strophe_js.Strophe.RSM = function(options) {
  38176. this.attribs = ['max', 'first', 'last', 'after', 'before', 'index', 'count'];
  38177. if (typeof options.xml != 'undefined') {
  38178. this.fromXMLElement(options.xml);
  38179. } else {
  38180. for (var ii = 0; ii < this.attribs.length; ii++) {
  38181. var attrib = this.attribs[ii];
  38182. this[attrib] = options[attrib];
  38183. }
  38184. }
  38185. };
  38186. strophe_js.Strophe.RSM.prototype = {
  38187. toXML: function() {
  38188. var xml = strophe_js.$build('set', {xmlns: strophe_js.Strophe.NS.RSM});
  38189. for (var ii = 0; ii < this.attribs.length; ii++) {
  38190. var attrib = this.attribs[ii];
  38191. if (typeof this[attrib] != 'undefined') {
  38192. xml = xml.c(attrib).t(this[attrib].toString()).up();
  38193. }
  38194. }
  38195. return xml.tree();
  38196. },
  38197. next: function(max) {
  38198. var newSet = new strophe_js.Strophe.RSM({max: max, after: this.last});
  38199. return newSet;
  38200. },
  38201. previous: function(max) {
  38202. var newSet = new strophe_js.Strophe.RSM({max: max, before: this.first});
  38203. return newSet;
  38204. },
  38205. fromXMLElement: function(xmlElement) {
  38206. for (var ii = 0; ii < this.attribs.length; ii++) {
  38207. var attrib = this.attribs[ii];
  38208. var elem = xmlElement.getElementsByTagName(attrib)[0];
  38209. if (typeof elem != 'undefined' && elem !== null) {
  38210. this[attrib] = strophe_js.Strophe.getText(elem);
  38211. if (attrib == 'first') {
  38212. this.index = elem.getAttribute('index');
  38213. }
  38214. }
  38215. }
  38216. }
  38217. };
  38218. })));
  38219. //# sourceMappingURL=strophe.rsm.js.map
  38220. /***/ }),
  38221. /***/ "./node_modules/twemoji/2/esm.js":
  38222. /*!***************************************!*\
  38223. !*** ./node_modules/twemoji/2/esm.js ***!
  38224. \***************************************/
  38225. /*! exports provided: default */
  38226. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38227. "use strict";
  38228. __webpack_require__.r(__webpack_exports__);
  38229. /*! Copyright Twitter Inc. and other contributors. Licensed under MIT */
  38230. var twemoji=function(){"use strict";var twemoji={base:"https://twemoji.maxcdn.com/2/",ext:".png",size:"72x72",className:"emoji",convert:{fromCodePoint:fromCodePoint,toCodePoint:toCodePoint},onerror:function onerror(){if(this.parentNode){this.parentNode.replaceChild(createText(this.alt,false),this)}},parse:parse,replace:replace,test:test},escaper={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"},re=/(?:\ud83d[\udc68\udc69])(?:\ud83c[\udffb-\udfff])?\u200d(?:\u2695\ufe0f|\u2696\ufe0f|\u2708\ufe0f|\ud83c[\udf3e\udf73\udf93\udfa4\udfa8\udfeb\udfed]|\ud83d[\udcbb\udcbc\udd27\udd2c\ude80\ude92]|\ud83e[\uddb0-\uddb3])|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f)|(?:\ud83c[\udfc3\udfc4\udfca]|\ud83d[\udc6e\udc71\udc73\udc77\udc81\udc82\udc86\udc87\ude45-\ude47\ude4b\ude4d\ude4e\udea3\udeb4-\udeb6]|\ud83e[\udd26\udd35\udd37-\udd39\udd3d\udd3e\uddb8\uddb9\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc68\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc68\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83e\uddde\u200d\u2640\ufe0f|\ud83e\uddde\u200d\u2642\ufe0f|\ud83e\udddf\u200d\u2640\ufe0f|\ud83e\udddf\u200d\u2642\ufe0f)|[\u0023\u002a\u0030-\u0039]\ufe0f?\u20e3|(?:[\u00a9\u00ae\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\udd70\udd71\udd7e\udd7f\ude02\ude1a\ude2f\ude37\udf21\udf24-\udf2c\udf36\udf7d\udf96\udf97\udf99-\udf9b\udf9e\udf9f\udfcd\udfce\udfd4-\udfdf\udff3\udff5\udff7]|\ud83d[\udc3f\udc41\udcfd\udd49\udd4a\udd6f\udd70\udd73\udd76-\udd79\udd87\udd8a-\udd8d\udda5\udda8\uddb1\uddb2\uddbc\uddc2-\uddc4\uddd1-\uddd3\udddc-\uddde\udde1\udde3\udde8\uddef\uddf3\uddfa\udecb\udecd-\udecf\udee0-\udee5\udee9\udef0\udef3]|[\u203c\u2049\u2139\u2194-\u2199\u21a9\u21aa\u231a\u231b\u2328\u23cf\u23ed-\u23ef\u23f1\u23f2\u23f8-\u23fa\u24c2\u25aa\u25ab\u25b6\u25c0\u25fb-\u25fe\u2600-\u2604\u260e\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262a\u262e\u262f\u2638-\u263a\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267b\u267f\u2692-\u2697\u2699\u269b\u269c\u26a0\u26a1\u26aa\u26ab\u26b0\u26b1\u26bd\u26be\u26c4\u26c5\u26c8\u26cf\u26d1\u26d3\u26d4\u26e9\u26ea\u26f0-\u26f5\u26f8\u26fa\u26fd\u2702\u2708\u2709\u270f\u2712\u2714\u2716\u271d\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u2764\u27a1\u2934\u2935\u2b05-\u2b07\u2b1b\u2b1c\u2b50\u2b55\u3030\u303d\u3297\u3299])(?:\ufe0f|(?!\ufe0e))|(?:(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75\udd90]|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c[\udf85\udfc2-\udfc4\udfc7\udfca]|\ud83d[\udc42\udc43\udc46-\udc50\udc66-\udc69\udc6e\udc70-\udc78\udc7c\udc81-\udc83\udc85-\udc87\udcaa\udd7a\udd95\udd96\ude45-\ude47\ude4b-\ude4f\udea3\udeb4-\udeb6\udec0\udecc]|\ud83e[\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\uddb5\uddb6\uddb8\uddb9\uddd1-\udddd]|[\u270a\u270b]))(?:\ud83c[\udffb-\udfff])?|(?:\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc73\udb40\udc63\udb40\udc74\udb40\udc7f|\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc77\udb40\udc6c\udb40\udc73\udb40\udc7f|\ud83c\udde6\ud83c[\udde8-\uddec\uddee\uddf1\uddf2\uddf4\uddf6-\uddfa\uddfc\uddfd\uddff]|\ud83c\udde7\ud83c[\udde6\udde7\udde9-\uddef\uddf1-\uddf4\uddf6-\uddf9\uddfb\uddfc\uddfe\uddff]|\ud83c\udde8\ud83c[\udde6\udde8\udde9\uddeb-\uddee\uddf0-\uddf5\uddf7\uddfa-\uddff]|\ud83c\udde9\ud83c[\uddea\uddec\uddef\uddf0\uddf2\uddf4\uddff]|\ud83c\uddea\ud83c[\udde6\udde8\uddea\uddec\udded\uddf7-\uddfa]|\ud83c\uddeb\ud83c[\uddee-\uddf0\uddf2\uddf4\uddf7]|\ud83c\uddec\ud83c[\udde6\udde7\udde9-\uddee\uddf1-\uddf3\uddf5-\uddfa\uddfc\uddfe]|\ud83c\udded\ud83c[\uddf0\uddf2\uddf3\uddf7\uddf9\uddfa]|\ud83c\uddee\ud83c[\udde8-\uddea\uddf1-\uddf4\uddf6-\uddf9]|\ud83c\uddef\ud83c[\uddea\uddf2\uddf4\uddf5]|\ud83c\uddf0\ud83c[\uddea\uddec-\uddee\uddf2\uddf3\uddf5\uddf7\uddfc\uddfe\uddff]|\ud83c\uddf1\ud83c[\udde6-\udde8\uddee\uddf0\uddf7-\uddfb\uddfe]|\ud83c\uddf2\ud83c[\udde6\udde8-\udded\uddf0-\uddff]|\ud83c\uddf3\ud83c[\udde6\udde8\uddea-\uddec\uddee\uddf1\uddf4\uddf5\uddf7\uddfa\uddff]|\ud83c\uddf4\ud83c\uddf2|\ud83c\uddf5\ud83c[\udde6\uddea-\udded\uddf0-\uddf3\uddf7-\uddf9\uddfc\uddfe]|\ud83c\uddf6\ud83c\udde6|\ud83c\uddf7\ud83c[\uddea\uddf4\uddf8\uddfa\uddfc]|\ud83c\uddf8\ud83c[\udde6-\uddea\uddec-\uddf4\uddf7-\uddf9\uddfb\uddfd-\uddff]|\ud83c\uddf9\ud83c[\udde6\udde8\udde9\uddeb-\udded\uddef-\uddf4\uddf7\uddf9\uddfb\uddfc\uddff]|\ud83c\uddfa\ud83c[\udde6\uddec\uddf2\uddf3\uddf8\uddfe\uddff]|\ud83c\uddfb\ud83c[\udde6\udde8\uddea\uddec\uddee\uddf3\uddfa]|\ud83c\uddfc\ud83c[\uddeb\uddf8]|\ud83c\uddfd\ud83c\uddf0|\ud83c\uddfe\ud83c[\uddea\uddf9]|\ud83c\uddff\ud83c[\udde6\uddf2\uddfc]|\ud83c[\udccf\udd8e\udd91-\udd9a\udde6-\uddff\ude01\ude32-\ude36\ude38-\ude3a\ude50\ude51\udf00-\udf20\udf2d-\udf35\udf37-\udf7c\udf7e-\udf84\udf86-\udf93\udfa0-\udfc1\udfc5\udfc6\udfc8\udfc9\udfcf-\udfd3\udfe0-\udff0\udff4\udff8-\udfff]|\ud83d[\udc00-\udc3e\udc40\udc44\udc45\udc51-\udc65\udc6a-\udc6d\udc6f\udc79-\udc7b\udc7d-\udc80\udc84\udc88-\udca9\udcab-\udcfc\udcff-\udd3d\udd4b-\udd4e\udd50-\udd67\udda4\uddfb-\ude44\ude48-\ude4a\ude80-\udea2\udea4-\udeb3\udeb7-\udebf\udec1-\udec5\uded0-\uded2\udeeb\udeec\udef4-\udef9]|\ud83e[\udd10-\udd17\udd1d\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd40-\udd45\udd47-\udd70\udd73-\udd76\udd7a\udd7c-\udda2\uddb4\uddb7\uddc0-\uddc2\uddd0\uddde-\uddff]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,UFE0Fg=/\uFE0F/g,U200D=String.fromCharCode(8205),rescaper=/[&<>'"]/g,shouldntBeParsed=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,fromCharCode=String.fromCharCode;return twemoji;function createText(text,clean){return document.createTextNode(clean?text.replace(UFE0Fg,""):text)}function escapeHTML(s){return s.replace(rescaper,replacer)}function defaultImageSrcGenerator(icon,options){return"".concat(options.base,options.size,"/",icon,options.ext)}function grabAllTextNodes(node,allText){var childNodes=node.childNodes,length=childNodes.length,subnode,nodeType;while(length--){subnode=childNodes[length];nodeType=subnode.nodeType;if(nodeType===3){allText.push(subnode)}else if(nodeType===1&&!("ownerSVGElement"in subnode)&&!shouldntBeParsed.test(subnode.nodeName.toLowerCase())){grabAllTextNodes(subnode,allText)}}return allText}function grabTheRightIcon(rawText){return toCodePoint(rawText.indexOf(U200D)<0?rawText.replace(UFE0Fg,""):rawText)}function parseNode(node,options){var allText=grabAllTextNodes(node,[]),length=allText.length,attrib,attrname,modified,fragment,subnode,text,match,i,index,img,rawText,iconId,src;while(length--){modified=false;fragment=document.createDocumentFragment();subnode=allText[length];text=subnode.nodeValue;i=0;while(match=re.exec(text)){index=match.index;if(index!==i){fragment.appendChild(createText(text.slice(i,index),true))}rawText=match[0];iconId=grabTheRightIcon(rawText);i=index+rawText.length;src=options.callback(iconId,options);if(iconId&&src){img=new Image;img.onerror=options.onerror;img.setAttribute("draggable","false");attrib=options.attributes(rawText,iconId);for(attrname in attrib){if(attrib.hasOwnProperty(attrname)&&attrname.indexOf("on")!==0&&!img.hasAttribute(attrname)){img.setAttribute(attrname,attrib[attrname])}}img.className=options.className;img.alt=rawText;img.src=src;modified=true;fragment.appendChild(img)}if(!img)fragment.appendChild(createText(rawText,false));img=null}if(modified){if(i<text.length){fragment.appendChild(createText(text.slice(i),true))}subnode.parentNode.replaceChild(fragment,subnode)}}return node}function parseString(str,options){return replace(str,function(rawText){var ret=rawText,iconId=grabTheRightIcon(rawText),src=options.callback(iconId,options),attrib,attrname;if(iconId&&src){ret="<img ".concat('class="',options.className,'" ','draggable="false" ','alt="',rawText,'"',' src="',src,'"');attrib=options.attributes(rawText,iconId);for(attrname in attrib){if(attrib.hasOwnProperty(attrname)&&attrname.indexOf("on")!==0&&ret.indexOf(" "+attrname+"=")===-1){ret=ret.concat(" ",attrname,'="',escapeHTML(attrib[attrname]),'"')}}ret=ret.concat("/>")}return ret})}function replacer(m){return escaper[m]}function returnNull(){return null}function toSizeSquaredAsset(value){return typeof value==="number"?value+"x"+value:value}function fromCodePoint(codepoint){var code=typeof codepoint==="string"?parseInt(codepoint,16):codepoint;if(code<65536){return fromCharCode(code)}code-=65536;return fromCharCode(55296+(code>>10),56320+(code&1023))}function parse(what,how){if(!how||typeof how==="function"){how={callback:how}}return(typeof what==="string"?parseString:parseNode)(what,{callback:how.callback||defaultImageSrcGenerator,attributes:typeof how.attributes==="function"?how.attributes:returnNull,base:typeof how.base==="string"?how.base:twemoji.base,ext:how.ext||twemoji.ext,size:how.folder||toSizeSquaredAsset(how.size||twemoji.size),className:how.className||twemoji.className,onerror:how.onerror||twemoji.onerror})}function replace(text,callback){return String(text).replace(re,callback)}function test(text){re.lastIndex=0;var result=re.test(text);re.lastIndex=0;return result}function toCodePoint(unicodeSurrogates,sep){var r=[],c=0,p=0,i=0;while(i<unicodeSurrogates.length){c=unicodeSurrogates.charCodeAt(i++);if(p){r.push((65536+(p-55296<<10)+(c-56320)).toString(16));p=0}else if(55296<=c&&c<=56319){p=c}else{r.push(c.toString(16))}}return r.join(sep||"-")}}();
  38231. /* harmony default export */ __webpack_exports__["default"] = (twemoji);
  38232. /***/ }),
  38233. /***/ "./node_modules/urijs/src/IPv6.js":
  38234. /*!****************************************!*\
  38235. !*** ./node_modules/urijs/src/IPv6.js ***!
  38236. \****************************************/
  38237. /*! no static exports found */
  38238. /***/ (function(module, exports, __webpack_require__) {
  38239. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  38240. * URI.js - Mutating URLs
  38241. * IPv6 Support
  38242. *
  38243. * Version: 1.19.1
  38244. *
  38245. * Author: Rodney Rehm
  38246. * Web: http://medialize.github.io/URI.js/
  38247. *
  38248. * Licensed under
  38249. * MIT License http://www.opensource.org/licenses/mit-license
  38250. *
  38251. */
  38252. (function (root, factory) {
  38253. 'use strict';
  38254. // https://github.com/umdjs/umd/blob/master/returnExports.js
  38255. if (typeof module === 'object' && module.exports) {
  38256. // Node
  38257. module.exports = factory();
  38258. } else if (true) {
  38259. // AMD. Register as an anonymous module.
  38260. !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  38261. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  38262. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  38263. __WEBPACK_AMD_DEFINE_FACTORY__),
  38264. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  38265. } else {}
  38266. }(this, function (root) {
  38267. 'use strict';
  38268. /*
  38269. var _in = "fe80:0000:0000:0000:0204:61ff:fe9d:f156";
  38270. var _out = IPv6.best(_in);
  38271. var _expected = "fe80::204:61ff:fe9d:f156";
  38272. console.log(_in, _out, _expected, _out === _expected);
  38273. */
  38274. // save current IPv6 variable, if any
  38275. var _IPv6 = root && root.IPv6;
  38276. function bestPresentation(address) {
  38277. // based on:
  38278. // Javascript to test an IPv6 address for proper format, and to
  38279. // present the "best text representation" according to IETF Draft RFC at
  38280. // http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04
  38281. // 8 Feb 2010 Rich Brown, Dartware, LLC
  38282. // Please feel free to use this code as long as you provide a link to
  38283. // http://www.intermapper.com
  38284. // http://intermapper.com/support/tools/IPV6-Validator.aspx
  38285. // http://download.dartware.com/thirdparty/ipv6validator.js
  38286. var _address = address.toLowerCase();
  38287. var segments = _address.split(':');
  38288. var length = segments.length;
  38289. var total = 8;
  38290. // trim colons (:: or ::a:b:c… or …a:b:c::)
  38291. if (segments[0] === '' && segments[1] === '' && segments[2] === '') {
  38292. // must have been ::
  38293. // remove first two items
  38294. segments.shift();
  38295. segments.shift();
  38296. } else if (segments[0] === '' && segments[1] === '') {
  38297. // must have been ::xxxx
  38298. // remove the first item
  38299. segments.shift();
  38300. } else if (segments[length - 1] === '' && segments[length - 2] === '') {
  38301. // must have been xxxx::
  38302. segments.pop();
  38303. }
  38304. length = segments.length;
  38305. // adjust total segments for IPv4 trailer
  38306. if (segments[length - 1].indexOf('.') !== -1) {
  38307. // found a "." which means IPv4
  38308. total = 7;
  38309. }
  38310. // fill empty segments them with "0000"
  38311. var pos;
  38312. for (pos = 0; pos < length; pos++) {
  38313. if (segments[pos] === '') {
  38314. break;
  38315. }
  38316. }
  38317. if (pos < total) {
  38318. segments.splice(pos, 1, '0000');
  38319. while (segments.length < total) {
  38320. segments.splice(pos, 0, '0000');
  38321. }
  38322. }
  38323. // strip leading zeros
  38324. var _segments;
  38325. for (var i = 0; i < total; i++) {
  38326. _segments = segments[i].split('');
  38327. for (var j = 0; j < 3 ; j++) {
  38328. if (_segments[0] === '0' && _segments.length > 1) {
  38329. _segments.splice(0,1);
  38330. } else {
  38331. break;
  38332. }
  38333. }
  38334. segments[i] = _segments.join('');
  38335. }
  38336. // find longest sequence of zeroes and coalesce them into one segment
  38337. var best = -1;
  38338. var _best = 0;
  38339. var _current = 0;
  38340. var current = -1;
  38341. var inzeroes = false;
  38342. // i; already declared
  38343. for (i = 0; i < total; i++) {
  38344. if (inzeroes) {
  38345. if (segments[i] === '0') {
  38346. _current += 1;
  38347. } else {
  38348. inzeroes = false;
  38349. if (_current > _best) {
  38350. best = current;
  38351. _best = _current;
  38352. }
  38353. }
  38354. } else {
  38355. if (segments[i] === '0') {
  38356. inzeroes = true;
  38357. current = i;
  38358. _current = 1;
  38359. }
  38360. }
  38361. }
  38362. if (_current > _best) {
  38363. best = current;
  38364. _best = _current;
  38365. }
  38366. if (_best > 1) {
  38367. segments.splice(best, _best, '');
  38368. }
  38369. length = segments.length;
  38370. // assemble remaining segments
  38371. var result = '';
  38372. if (segments[0] === '') {
  38373. result = ':';
  38374. }
  38375. for (i = 0; i < length; i++) {
  38376. result += segments[i];
  38377. if (i === length - 1) {
  38378. break;
  38379. }
  38380. result += ':';
  38381. }
  38382. if (segments[length - 1] === '') {
  38383. result += ':';
  38384. }
  38385. return result;
  38386. }
  38387. function noConflict() {
  38388. /*jshint validthis: true */
  38389. if (root.IPv6 === this) {
  38390. root.IPv6 = _IPv6;
  38391. }
  38392. return this;
  38393. }
  38394. return {
  38395. best: bestPresentation,
  38396. noConflict: noConflict
  38397. };
  38398. }));
  38399. /***/ }),
  38400. /***/ "./node_modules/urijs/src/SecondLevelDomains.js":
  38401. /*!******************************************************!*\
  38402. !*** ./node_modules/urijs/src/SecondLevelDomains.js ***!
  38403. \******************************************************/
  38404. /*! no static exports found */
  38405. /***/ (function(module, exports, __webpack_require__) {
  38406. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  38407. * URI.js - Mutating URLs
  38408. * Second Level Domain (SLD) Support
  38409. *
  38410. * Version: 1.19.1
  38411. *
  38412. * Author: Rodney Rehm
  38413. * Web: http://medialize.github.io/URI.js/
  38414. *
  38415. * Licensed under
  38416. * MIT License http://www.opensource.org/licenses/mit-license
  38417. *
  38418. */
  38419. (function (root, factory) {
  38420. 'use strict';
  38421. // https://github.com/umdjs/umd/blob/master/returnExports.js
  38422. if (typeof module === 'object' && module.exports) {
  38423. // Node
  38424. module.exports = factory();
  38425. } else if (true) {
  38426. // AMD. Register as an anonymous module.
  38427. !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  38428. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  38429. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  38430. __WEBPACK_AMD_DEFINE_FACTORY__),
  38431. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  38432. } else {}
  38433. }(this, function (root) {
  38434. 'use strict';
  38435. // save current SecondLevelDomains variable, if any
  38436. var _SecondLevelDomains = root && root.SecondLevelDomains;
  38437. var SLD = {
  38438. // list of known Second Level Domains
  38439. // converted list of SLDs from https://github.com/gavingmiller/second-level-domains
  38440. // ----
  38441. // publicsuffix.org is more current and actually used by a couple of browsers internally.
  38442. // downside is it also contains domains like "dyndns.org" - which is fine for the security
  38443. // issues browser have to deal with (SOP for cookies, etc) - but is way overboard for URI.js
  38444. // ----
  38445. list: {
  38446. 'ac':' com gov mil net org ',
  38447. 'ae':' ac co gov mil name net org pro sch ',
  38448. 'af':' com edu gov net org ',
  38449. 'al':' com edu gov mil net org ',
  38450. 'ao':' co ed gv it og pb ',
  38451. 'ar':' com edu gob gov int mil net org tur ',
  38452. 'at':' ac co gv or ',
  38453. 'au':' asn com csiro edu gov id net org ',
  38454. 'ba':' co com edu gov mil net org rs unbi unmo unsa untz unze ',
  38455. 'bb':' biz co com edu gov info net org store tv ',
  38456. 'bh':' biz cc com edu gov info net org ',
  38457. 'bn':' com edu gov net org ',
  38458. 'bo':' com edu gob gov int mil net org tv ',
  38459. 'br':' adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ',
  38460. 'bs':' com edu gov net org ',
  38461. 'bz':' du et om ov rg ',
  38462. 'ca':' ab bc mb nb nf nl ns nt nu on pe qc sk yk ',
  38463. 'ck':' biz co edu gen gov info net org ',
  38464. 'cn':' ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ',
  38465. 'co':' com edu gov mil net nom org ',
  38466. 'cr':' ac c co ed fi go or sa ',
  38467. 'cy':' ac biz com ekloges gov ltd name net org parliament press pro tm ',
  38468. 'do':' art com edu gob gov mil net org sld web ',
  38469. 'dz':' art asso com edu gov net org pol ',
  38470. 'ec':' com edu fin gov info med mil net org pro ',
  38471. 'eg':' com edu eun gov mil name net org sci ',
  38472. 'er':' com edu gov ind mil net org rochest w ',
  38473. 'es':' com edu gob nom org ',
  38474. 'et':' biz com edu gov info name net org ',
  38475. 'fj':' ac biz com info mil name net org pro ',
  38476. 'fk':' ac co gov net nom org ',
  38477. 'fr':' asso com f gouv nom prd presse tm ',
  38478. 'gg':' co net org ',
  38479. 'gh':' com edu gov mil org ',
  38480. 'gn':' ac com gov net org ',
  38481. 'gr':' com edu gov mil net org ',
  38482. 'gt':' com edu gob ind mil net org ',
  38483. 'gu':' com edu gov net org ',
  38484. 'hk':' com edu gov idv net org ',
  38485. 'hu':' 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ',
  38486. 'id':' ac co go mil net or sch web ',
  38487. 'il':' ac co gov idf k12 muni net org ',
  38488. 'in':' ac co edu ernet firm gen gov i ind mil net nic org res ',
  38489. 'iq':' com edu gov i mil net org ',
  38490. 'ir':' ac co dnssec gov i id net org sch ',
  38491. 'it':' edu gov ',
  38492. 'je':' co net org ',
  38493. 'jo':' com edu gov mil name net org sch ',
  38494. 'jp':' ac ad co ed go gr lg ne or ',
  38495. 'ke':' ac co go info me mobi ne or sc ',
  38496. 'kh':' com edu gov mil net org per ',
  38497. 'ki':' biz com de edu gov info mob net org tel ',
  38498. 'km':' asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ',
  38499. 'kn':' edu gov net org ',
  38500. 'kr':' ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ',
  38501. 'kw':' com edu gov net org ',
  38502. 'ky':' com edu gov net org ',
  38503. 'kz':' com edu gov mil net org ',
  38504. 'lb':' com edu gov net org ',
  38505. 'lk':' assn com edu gov grp hotel int ltd net ngo org sch soc web ',
  38506. 'lr':' com edu gov net org ',
  38507. 'lv':' asn com conf edu gov id mil net org ',
  38508. 'ly':' com edu gov id med net org plc sch ',
  38509. 'ma':' ac co gov m net org press ',
  38510. 'mc':' asso tm ',
  38511. 'me':' ac co edu gov its net org priv ',
  38512. 'mg':' com edu gov mil nom org prd tm ',
  38513. 'mk':' com edu gov inf name net org pro ',
  38514. 'ml':' com edu gov net org presse ',
  38515. 'mn':' edu gov org ',
  38516. 'mo':' com edu gov net org ',
  38517. 'mt':' com edu gov net org ',
  38518. 'mv':' aero biz com coop edu gov info int mil museum name net org pro ',
  38519. 'mw':' ac co com coop edu gov int museum net org ',
  38520. 'mx':' com edu gob net org ',
  38521. 'my':' com edu gov mil name net org sch ',
  38522. 'nf':' arts com firm info net other per rec store web ',
  38523. 'ng':' biz com edu gov mil mobi name net org sch ',
  38524. 'ni':' ac co com edu gob mil net nom org ',
  38525. 'np':' com edu gov mil net org ',
  38526. 'nr':' biz com edu gov info net org ',
  38527. 'om':' ac biz co com edu gov med mil museum net org pro sch ',
  38528. 'pe':' com edu gob mil net nom org sld ',
  38529. 'ph':' com edu gov i mil net ngo org ',
  38530. 'pk':' biz com edu fam gob gok gon gop gos gov net org web ',
  38531. 'pl':' art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ',
  38532. 'pr':' ac biz com edu est gov info isla name net org pro prof ',
  38533. 'ps':' com edu gov net org plo sec ',
  38534. 'pw':' belau co ed go ne or ',
  38535. 'ro':' arts com firm info nom nt org rec store tm www ',
  38536. 'rs':' ac co edu gov in org ',
  38537. 'sb':' com edu gov net org ',
  38538. 'sc':' com edu gov net org ',
  38539. 'sh':' co com edu gov net nom org ',
  38540. 'sl':' com edu gov net org ',
  38541. 'st':' co com consulado edu embaixada gov mil net org principe saotome store ',
  38542. 'sv':' com edu gob org red ',
  38543. 'sz':' ac co org ',
  38544. 'tr':' av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ',
  38545. 'tt':' aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ',
  38546. 'tw':' club com ebiz edu game gov idv mil net org ',
  38547. 'mu':' ac co com gov net or org ',
  38548. 'mz':' ac co edu gov org ',
  38549. 'na':' co com ',
  38550. 'nz':' ac co cri geek gen govt health iwi maori mil net org parliament school ',
  38551. 'pa':' abo ac com edu gob ing med net nom org sld ',
  38552. 'pt':' com edu gov int net nome org publ ',
  38553. 'py':' com edu gov mil net org ',
  38554. 'qa':' com edu gov mil net org ',
  38555. 're':' asso com nom ',
  38556. 'ru':' ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ',
  38557. 'rw':' ac co com edu gouv gov int mil net ',
  38558. 'sa':' com edu gov med net org pub sch ',
  38559. 'sd':' com edu gov info med net org tv ',
  38560. 'se':' a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ',
  38561. 'sg':' com edu gov idn net org per ',
  38562. 'sn':' art com edu gouv org perso univ ',
  38563. 'sy':' com edu gov mil net news org ',
  38564. 'th':' ac co go in mi net or ',
  38565. 'tj':' ac biz co com edu go gov info int mil name net nic org test web ',
  38566. 'tn':' agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ',
  38567. 'tz':' ac co go ne or ',
  38568. 'ua':' biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ',
  38569. 'ug':' ac co go ne or org sc ',
  38570. 'uk':' ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ',
  38571. 'us':' dni fed isa kids nsn ',
  38572. 'uy':' com edu gub mil net org ',
  38573. 've':' co com edu gob info mil net org web ',
  38574. 'vi':' co com k12 net org ',
  38575. 'vn':' ac biz com edu gov health info int name net org pro ',
  38576. 'ye':' co com gov ltd me net org plc ',
  38577. 'yu':' ac co edu gov org ',
  38578. 'za':' ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ',
  38579. 'zm':' ac co com edu gov net org sch ',
  38580. // https://en.wikipedia.org/wiki/CentralNic#Second-level_domains
  38581. 'com': 'ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ',
  38582. 'net': 'gb jp se uk ',
  38583. 'org': 'ae',
  38584. 'de': 'com '
  38585. },
  38586. // gorhill 2013-10-25: Using indexOf() instead Regexp(). Significant boost
  38587. // in both performance and memory footprint. No initialization required.
  38588. // http://jsperf.com/uri-js-sld-regex-vs-binary-search/4
  38589. // Following methods use lastIndexOf() rather than array.split() in order
  38590. // to avoid any memory allocations.
  38591. has: function(domain) {
  38592. var tldOffset = domain.lastIndexOf('.');
  38593. if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {
  38594. return false;
  38595. }
  38596. var sldOffset = domain.lastIndexOf('.', tldOffset-1);
  38597. if (sldOffset <= 0 || sldOffset >= (tldOffset-1)) {
  38598. return false;
  38599. }
  38600. var sldList = SLD.list[domain.slice(tldOffset+1)];
  38601. if (!sldList) {
  38602. return false;
  38603. }
  38604. return sldList.indexOf(' ' + domain.slice(sldOffset+1, tldOffset) + ' ') >= 0;
  38605. },
  38606. is: function(domain) {
  38607. var tldOffset = domain.lastIndexOf('.');
  38608. if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {
  38609. return false;
  38610. }
  38611. var sldOffset = domain.lastIndexOf('.', tldOffset-1);
  38612. if (sldOffset >= 0) {
  38613. return false;
  38614. }
  38615. var sldList = SLD.list[domain.slice(tldOffset+1)];
  38616. if (!sldList) {
  38617. return false;
  38618. }
  38619. return sldList.indexOf(' ' + domain.slice(0, tldOffset) + ' ') >= 0;
  38620. },
  38621. get: function(domain) {
  38622. var tldOffset = domain.lastIndexOf('.');
  38623. if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {
  38624. return null;
  38625. }
  38626. var sldOffset = domain.lastIndexOf('.', tldOffset-1);
  38627. if (sldOffset <= 0 || sldOffset >= (tldOffset-1)) {
  38628. return null;
  38629. }
  38630. var sldList = SLD.list[domain.slice(tldOffset+1)];
  38631. if (!sldList) {
  38632. return null;
  38633. }
  38634. if (sldList.indexOf(' ' + domain.slice(sldOffset+1, tldOffset) + ' ') < 0) {
  38635. return null;
  38636. }
  38637. return domain.slice(sldOffset+1);
  38638. },
  38639. noConflict: function(){
  38640. if (root.SecondLevelDomains === this) {
  38641. root.SecondLevelDomains = _SecondLevelDomains;
  38642. }
  38643. return this;
  38644. }
  38645. };
  38646. return SLD;
  38647. }));
  38648. /***/ }),
  38649. /***/ "./node_modules/urijs/src/URI.js":
  38650. /*!***************************************!*\
  38651. !*** ./node_modules/urijs/src/URI.js ***!
  38652. \***************************************/
  38653. /*! no static exports found */
  38654. /***/ (function(module, exports, __webpack_require__) {
  38655. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  38656. * URI.js - Mutating URLs
  38657. *
  38658. * Version: 1.19.1
  38659. *
  38660. * Author: Rodney Rehm
  38661. * Web: http://medialize.github.io/URI.js/
  38662. *
  38663. * Licensed under
  38664. * MIT License http://www.opensource.org/licenses/mit-license
  38665. *
  38666. */
  38667. (function (root, factory) {
  38668. 'use strict';
  38669. // https://github.com/umdjs/umd/blob/master/returnExports.js
  38670. if (typeof module === 'object' && module.exports) {
  38671. // Node
  38672. module.exports = factory(__webpack_require__(/*! ./punycode */ "./node_modules/urijs/src/punycode.js"), __webpack_require__(/*! ./IPv6 */ "./node_modules/urijs/src/IPv6.js"), __webpack_require__(/*! ./SecondLevelDomains */ "./node_modules/urijs/src/SecondLevelDomains.js"));
  38673. } else if (true) {
  38674. // AMD. Register as an anonymous module.
  38675. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! ./punycode */ "./node_modules/urijs/src/punycode.js"), __webpack_require__(/*! ./IPv6 */ "./node_modules/urijs/src/IPv6.js"), __webpack_require__(/*! ./SecondLevelDomains */ "./node_modules/urijs/src/SecondLevelDomains.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  38676. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  38677. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  38678. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  38679. } else {}
  38680. }(this, function (punycode, IPv6, SLD, root) {
  38681. 'use strict';
  38682. /*global location, escape, unescape */
  38683. // FIXME: v2.0.0 renamce non-camelCase properties to uppercase
  38684. /*jshint camelcase: false */
  38685. // save current URI variable, if any
  38686. var _URI = root && root.URI;
  38687. function URI(url, base) {
  38688. var _urlSupplied = arguments.length >= 1;
  38689. var _baseSupplied = arguments.length >= 2;
  38690. // Allow instantiation without the 'new' keyword
  38691. if (!(this instanceof URI)) {
  38692. if (_urlSupplied) {
  38693. if (_baseSupplied) {
  38694. return new URI(url, base);
  38695. }
  38696. return new URI(url);
  38697. }
  38698. return new URI();
  38699. }
  38700. if (url === undefined) {
  38701. if (_urlSupplied) {
  38702. throw new TypeError('undefined is not a valid argument for URI');
  38703. }
  38704. if (typeof location !== 'undefined') {
  38705. url = location.href + '';
  38706. } else {
  38707. url = '';
  38708. }
  38709. }
  38710. if (url === null) {
  38711. if (_urlSupplied) {
  38712. throw new TypeError('null is not a valid argument for URI');
  38713. }
  38714. }
  38715. this.href(url);
  38716. // resolve to base according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#constructor
  38717. if (base !== undefined) {
  38718. return this.absoluteTo(base);
  38719. }
  38720. return this;
  38721. }
  38722. function isInteger(value) {
  38723. return /^[0-9]+$/.test(value);
  38724. }
  38725. URI.version = '1.19.1';
  38726. var p = URI.prototype;
  38727. var hasOwn = Object.prototype.hasOwnProperty;
  38728. function escapeRegEx(string) {
  38729. // https://github.com/medialize/URI.js/commit/85ac21783c11f8ccab06106dba9735a31a86924d#commitcomment-821963
  38730. return string.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
  38731. }
  38732. function getType(value) {
  38733. // IE8 doesn't return [Object Undefined] but [Object Object] for undefined value
  38734. if (value === undefined) {
  38735. return 'Undefined';
  38736. }
  38737. return String(Object.prototype.toString.call(value)).slice(8, -1);
  38738. }
  38739. function isArray(obj) {
  38740. return getType(obj) === 'Array';
  38741. }
  38742. function filterArrayValues(data, value) {
  38743. var lookup = {};
  38744. var i, length;
  38745. if (getType(value) === 'RegExp') {
  38746. lookup = null;
  38747. } else if (isArray(value)) {
  38748. for (i = 0, length = value.length; i < length; i++) {
  38749. lookup[value[i]] = true;
  38750. }
  38751. } else {
  38752. lookup[value] = true;
  38753. }
  38754. for (i = 0, length = data.length; i < length; i++) {
  38755. /*jshint laxbreak: true */
  38756. var _match = lookup && lookup[data[i]] !== undefined
  38757. || !lookup && value.test(data[i]);
  38758. /*jshint laxbreak: false */
  38759. if (_match) {
  38760. data.splice(i, 1);
  38761. length--;
  38762. i--;
  38763. }
  38764. }
  38765. return data;
  38766. }
  38767. function arrayContains(list, value) {
  38768. var i, length;
  38769. // value may be string, number, array, regexp
  38770. if (isArray(value)) {
  38771. // Note: this can be optimized to O(n) (instead of current O(m * n))
  38772. for (i = 0, length = value.length; i < length; i++) {
  38773. if (!arrayContains(list, value[i])) {
  38774. return false;
  38775. }
  38776. }
  38777. return true;
  38778. }
  38779. var _type = getType(value);
  38780. for (i = 0, length = list.length; i < length; i++) {
  38781. if (_type === 'RegExp') {
  38782. if (typeof list[i] === 'string' && list[i].match(value)) {
  38783. return true;
  38784. }
  38785. } else if (list[i] === value) {
  38786. return true;
  38787. }
  38788. }
  38789. return false;
  38790. }
  38791. function arraysEqual(one, two) {
  38792. if (!isArray(one) || !isArray(two)) {
  38793. return false;
  38794. }
  38795. // arrays can't be equal if they have different amount of content
  38796. if (one.length !== two.length) {
  38797. return false;
  38798. }
  38799. one.sort();
  38800. two.sort();
  38801. for (var i = 0, l = one.length; i < l; i++) {
  38802. if (one[i] !== two[i]) {
  38803. return false;
  38804. }
  38805. }
  38806. return true;
  38807. }
  38808. function trimSlashes(text) {
  38809. var trim_expression = /^\/+|\/+$/g;
  38810. return text.replace(trim_expression, '');
  38811. }
  38812. URI._parts = function() {
  38813. return {
  38814. protocol: null,
  38815. username: null,
  38816. password: null,
  38817. hostname: null,
  38818. urn: null,
  38819. port: null,
  38820. path: null,
  38821. query: null,
  38822. fragment: null,
  38823. // state
  38824. preventInvalidHostname: URI.preventInvalidHostname,
  38825. duplicateQueryParameters: URI.duplicateQueryParameters,
  38826. escapeQuerySpace: URI.escapeQuerySpace
  38827. };
  38828. };
  38829. // state: throw on invalid hostname
  38830. // see https://github.com/medialize/URI.js/pull/345
  38831. // and https://github.com/medialize/URI.js/issues/354
  38832. URI.preventInvalidHostname = false;
  38833. // state: allow duplicate query parameters (a=1&a=1)
  38834. URI.duplicateQueryParameters = false;
  38835. // state: replaces + with %20 (space in query strings)
  38836. URI.escapeQuerySpace = true;
  38837. // static properties
  38838. URI.protocol_expression = /^[a-z][a-z0-9.+-]*$/i;
  38839. URI.idn_expression = /[^a-z0-9\._-]/i;
  38840. URI.punycode_expression = /(xn--)/i;
  38841. // well, 333.444.555.666 matches, but it sure ain't no IPv4 - do we care?
  38842. URI.ip4_expression = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
  38843. // credits to Rich Brown
  38844. // source: http://forums.intermapper.com/viewtopic.php?p=1096#1096
  38845. // specification: http://www.ietf.org/rfc/rfc4291.txt
  38846. URI.ip6_expression = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
  38847. // expression used is "gruber revised" (@gruber v2) determined to be the
  38848. // best solution in a regex-golf we did a couple of ages ago at
  38849. // * http://mathiasbynens.be/demo/url-regex
  38850. // * http://rodneyrehm.de/t/url-regex.html
  38851. URI.find_uri_expression = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig;
  38852. URI.findUri = {
  38853. // valid "scheme://" or "www."
  38854. start: /\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,
  38855. // everything up to the next whitespace
  38856. end: /[\s\r\n]|$/,
  38857. // trim trailing punctuation captured by end RegExp
  38858. trim: /[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,
  38859. // balanced parens inclusion (), [], {}, <>
  38860. parens: /(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g,
  38861. };
  38862. // http://www.iana.org/assignments/uri-schemes.html
  38863. // http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Well-known_ports
  38864. URI.defaultPorts = {
  38865. http: '80',
  38866. https: '443',
  38867. ftp: '21',
  38868. gopher: '70',
  38869. ws: '80',
  38870. wss: '443'
  38871. };
  38872. // list of protocols which always require a hostname
  38873. URI.hostProtocols = [
  38874. 'http',
  38875. 'https'
  38876. ];
  38877. // allowed hostname characters according to RFC 3986
  38878. // ALPHA DIGIT "-" "." "_" "~" "!" "$" "&" "'" "(" ")" "*" "+" "," ";" "=" %encoded
  38879. // I've never seen a (non-IDN) hostname other than: ALPHA DIGIT . - _
  38880. URI.invalid_hostname_characters = /[^a-zA-Z0-9\.\-:_]/;
  38881. // map DOM Elements to their URI attribute
  38882. URI.domAttributes = {
  38883. 'a': 'href',
  38884. 'blockquote': 'cite',
  38885. 'link': 'href',
  38886. 'base': 'href',
  38887. 'script': 'src',
  38888. 'form': 'action',
  38889. 'img': 'src',
  38890. 'area': 'href',
  38891. 'iframe': 'src',
  38892. 'embed': 'src',
  38893. 'source': 'src',
  38894. 'track': 'src',
  38895. 'input': 'src', // but only if type="image"
  38896. 'audio': 'src',
  38897. 'video': 'src'
  38898. };
  38899. URI.getDomAttribute = function(node) {
  38900. if (!node || !node.nodeName) {
  38901. return undefined;
  38902. }
  38903. var nodeName = node.nodeName.toLowerCase();
  38904. // <input> should only expose src for type="image"
  38905. if (nodeName === 'input' && node.type !== 'image') {
  38906. return undefined;
  38907. }
  38908. return URI.domAttributes[nodeName];
  38909. };
  38910. function escapeForDumbFirefox36(value) {
  38911. // https://github.com/medialize/URI.js/issues/91
  38912. return escape(value);
  38913. }
  38914. // encoding / decoding according to RFC3986
  38915. function strictEncodeURIComponent(string) {
  38916. // see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent
  38917. return encodeURIComponent(string)
  38918. .replace(/[!'()*]/g, escapeForDumbFirefox36)
  38919. .replace(/\*/g, '%2A');
  38920. }
  38921. URI.encode = strictEncodeURIComponent;
  38922. URI.decode = decodeURIComponent;
  38923. URI.iso8859 = function() {
  38924. URI.encode = escape;
  38925. URI.decode = unescape;
  38926. };
  38927. URI.unicode = function() {
  38928. URI.encode = strictEncodeURIComponent;
  38929. URI.decode = decodeURIComponent;
  38930. };
  38931. URI.characters = {
  38932. pathname: {
  38933. encode: {
  38934. // RFC3986 2.1: For consistency, URI producers and normalizers should
  38935. // use uppercase hexadecimal digits for all percent-encodings.
  38936. expression: /%(24|26|2B|2C|3B|3D|3A|40)/ig,
  38937. map: {
  38938. // -._~!'()*
  38939. '%24': '$',
  38940. '%26': '&',
  38941. '%2B': '+',
  38942. '%2C': ',',
  38943. '%3B': ';',
  38944. '%3D': '=',
  38945. '%3A': ':',
  38946. '%40': '@'
  38947. }
  38948. },
  38949. decode: {
  38950. expression: /[\/\?#]/g,
  38951. map: {
  38952. '/': '%2F',
  38953. '?': '%3F',
  38954. '#': '%23'
  38955. }
  38956. }
  38957. },
  38958. reserved: {
  38959. encode: {
  38960. // RFC3986 2.1: For consistency, URI producers and normalizers should
  38961. // use uppercase hexadecimal digits for all percent-encodings.
  38962. expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,
  38963. map: {
  38964. // gen-delims
  38965. '%3A': ':',
  38966. '%2F': '/',
  38967. '%3F': '?',
  38968. '%23': '#',
  38969. '%5B': '[',
  38970. '%5D': ']',
  38971. '%40': '@',
  38972. // sub-delims
  38973. '%21': '!',
  38974. '%24': '$',
  38975. '%26': '&',
  38976. '%27': '\'',
  38977. '%28': '(',
  38978. '%29': ')',
  38979. '%2A': '*',
  38980. '%2B': '+',
  38981. '%2C': ',',
  38982. '%3B': ';',
  38983. '%3D': '='
  38984. }
  38985. }
  38986. },
  38987. urnpath: {
  38988. // The characters under `encode` are the characters called out by RFC 2141 as being acceptable
  38989. // for usage in a URN. RFC2141 also calls out "-", ".", and "_" as acceptable characters, but
  38990. // these aren't encoded by encodeURIComponent, so we don't have to call them out here. Also
  38991. // note that the colon character is not featured in the encoding map; this is because URI.js
  38992. // gives the colons in URNs semantic meaning as the delimiters of path segements, and so it
  38993. // should not appear unencoded in a segment itself.
  38994. // See also the note above about RFC3986 and capitalalized hex digits.
  38995. encode: {
  38996. expression: /%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,
  38997. map: {
  38998. '%21': '!',
  38999. '%24': '$',
  39000. '%27': '\'',
  39001. '%28': '(',
  39002. '%29': ')',
  39003. '%2A': '*',
  39004. '%2B': '+',
  39005. '%2C': ',',
  39006. '%3B': ';',
  39007. '%3D': '=',
  39008. '%40': '@'
  39009. }
  39010. },
  39011. // These characters are the characters called out by RFC2141 as "reserved" characters that
  39012. // should never appear in a URN, plus the colon character (see note above).
  39013. decode: {
  39014. expression: /[\/\?#:]/g,
  39015. map: {
  39016. '/': '%2F',
  39017. '?': '%3F',
  39018. '#': '%23',
  39019. ':': '%3A'
  39020. }
  39021. }
  39022. }
  39023. };
  39024. URI.encodeQuery = function(string, escapeQuerySpace) {
  39025. var escaped = URI.encode(string + '');
  39026. if (escapeQuerySpace === undefined) {
  39027. escapeQuerySpace = URI.escapeQuerySpace;
  39028. }
  39029. return escapeQuerySpace ? escaped.replace(/%20/g, '+') : escaped;
  39030. };
  39031. URI.decodeQuery = function(string, escapeQuerySpace) {
  39032. string += '';
  39033. if (escapeQuerySpace === undefined) {
  39034. escapeQuerySpace = URI.escapeQuerySpace;
  39035. }
  39036. try {
  39037. return URI.decode(escapeQuerySpace ? string.replace(/\+/g, '%20') : string);
  39038. } catch(e) {
  39039. // we're not going to mess with weird encodings,
  39040. // give up and return the undecoded original string
  39041. // see https://github.com/medialize/URI.js/issues/87
  39042. // see https://github.com/medialize/URI.js/issues/92
  39043. return string;
  39044. }
  39045. };
  39046. // generate encode/decode path functions
  39047. var _parts = {'encode':'encode', 'decode':'decode'};
  39048. var _part;
  39049. var generateAccessor = function(_group, _part) {
  39050. return function(string) {
  39051. try {
  39052. return URI[_part](string + '').replace(URI.characters[_group][_part].expression, function(c) {
  39053. return URI.characters[_group][_part].map[c];
  39054. });
  39055. } catch (e) {
  39056. // we're not going to mess with weird encodings,
  39057. // give up and return the undecoded original string
  39058. // see https://github.com/medialize/URI.js/issues/87
  39059. // see https://github.com/medialize/URI.js/issues/92
  39060. return string;
  39061. }
  39062. };
  39063. };
  39064. for (_part in _parts) {
  39065. URI[_part + 'PathSegment'] = generateAccessor('pathname', _parts[_part]);
  39066. URI[_part + 'UrnPathSegment'] = generateAccessor('urnpath', _parts[_part]);
  39067. }
  39068. var generateSegmentedPathFunction = function(_sep, _codingFuncName, _innerCodingFuncName) {
  39069. return function(string) {
  39070. // Why pass in names of functions, rather than the function objects themselves? The
  39071. // definitions of some functions (but in particular, URI.decode) will occasionally change due
  39072. // to URI.js having ISO8859 and Unicode modes. Passing in the name and getting it will ensure
  39073. // that the functions we use here are "fresh".
  39074. var actualCodingFunc;
  39075. if (!_innerCodingFuncName) {
  39076. actualCodingFunc = URI[_codingFuncName];
  39077. } else {
  39078. actualCodingFunc = function(string) {
  39079. return URI[_codingFuncName](URI[_innerCodingFuncName](string));
  39080. };
  39081. }
  39082. var segments = (string + '').split(_sep);
  39083. for (var i = 0, length = segments.length; i < length; i++) {
  39084. segments[i] = actualCodingFunc(segments[i]);
  39085. }
  39086. return segments.join(_sep);
  39087. };
  39088. };
  39089. // This takes place outside the above loop because we don't want, e.g., encodeUrnPath functions.
  39090. URI.decodePath = generateSegmentedPathFunction('/', 'decodePathSegment');
  39091. URI.decodeUrnPath = generateSegmentedPathFunction(':', 'decodeUrnPathSegment');
  39092. URI.recodePath = generateSegmentedPathFunction('/', 'encodePathSegment', 'decode');
  39093. URI.recodeUrnPath = generateSegmentedPathFunction(':', 'encodeUrnPathSegment', 'decode');
  39094. URI.encodeReserved = generateAccessor('reserved', 'encode');
  39095. URI.parse = function(string, parts) {
  39096. var pos;
  39097. if (!parts) {
  39098. parts = {
  39099. preventInvalidHostname: URI.preventInvalidHostname
  39100. };
  39101. }
  39102. // [protocol"://"[username[":"password]"@"]hostname[":"port]"/"?][path]["?"querystring]["#"fragment]
  39103. // extract fragment
  39104. pos = string.indexOf('#');
  39105. if (pos > -1) {
  39106. // escaping?
  39107. parts.fragment = string.substring(pos + 1) || null;
  39108. string = string.substring(0, pos);
  39109. }
  39110. // extract query
  39111. pos = string.indexOf('?');
  39112. if (pos > -1) {
  39113. // escaping?
  39114. parts.query = string.substring(pos + 1) || null;
  39115. string = string.substring(0, pos);
  39116. }
  39117. // extract protocol
  39118. if (string.substring(0, 2) === '//') {
  39119. // relative-scheme
  39120. parts.protocol = null;
  39121. string = string.substring(2);
  39122. // extract "user:pass@host:port"
  39123. string = URI.parseAuthority(string, parts);
  39124. } else {
  39125. pos = string.indexOf(':');
  39126. if (pos > -1) {
  39127. parts.protocol = string.substring(0, pos) || null;
  39128. if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) {
  39129. // : may be within the path
  39130. parts.protocol = undefined;
  39131. } else if (string.substring(pos + 1, pos + 3) === '//') {
  39132. string = string.substring(pos + 3);
  39133. // extract "user:pass@host:port"
  39134. string = URI.parseAuthority(string, parts);
  39135. } else {
  39136. string = string.substring(pos + 1);
  39137. parts.urn = true;
  39138. }
  39139. }
  39140. }
  39141. // what's left must be the path
  39142. parts.path = string;
  39143. // and we're done
  39144. return parts;
  39145. };
  39146. URI.parseHost = function(string, parts) {
  39147. if (!string) {
  39148. string = '';
  39149. }
  39150. // Copy chrome, IE, opera backslash-handling behavior.
  39151. // Back slashes before the query string get converted to forward slashes
  39152. // See: https://github.com/joyent/node/blob/386fd24f49b0e9d1a8a076592a404168faeecc34/lib/url.js#L115-L124
  39153. // See: https://code.google.com/p/chromium/issues/detail?id=25916
  39154. // https://github.com/medialize/URI.js/pull/233
  39155. string = string.replace(/\\/g, '/');
  39156. // extract host:port
  39157. var pos = string.indexOf('/');
  39158. var bracketPos;
  39159. var t;
  39160. if (pos === -1) {
  39161. pos = string.length;
  39162. }
  39163. if (string.charAt(0) === '[') {
  39164. // IPv6 host - http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04#section-6
  39165. // I claim most client software breaks on IPv6 anyways. To simplify things, URI only accepts
  39166. // IPv6+port in the format [2001:db8::1]:80 (for the time being)
  39167. bracketPos = string.indexOf(']');
  39168. parts.hostname = string.substring(1, bracketPos) || null;
  39169. parts.port = string.substring(bracketPos + 2, pos) || null;
  39170. if (parts.port === '/') {
  39171. parts.port = null;
  39172. }
  39173. } else {
  39174. var firstColon = string.indexOf(':');
  39175. var firstSlash = string.indexOf('/');
  39176. var nextColon = string.indexOf(':', firstColon + 1);
  39177. if (nextColon !== -1 && (firstSlash === -1 || nextColon < firstSlash)) {
  39178. // IPv6 host contains multiple colons - but no port
  39179. // this notation is actually not allowed by RFC 3986, but we're a liberal parser
  39180. parts.hostname = string.substring(0, pos) || null;
  39181. parts.port = null;
  39182. } else {
  39183. t = string.substring(0, pos).split(':');
  39184. parts.hostname = t[0] || null;
  39185. parts.port = t[1] || null;
  39186. }
  39187. }
  39188. if (parts.hostname && string.substring(pos).charAt(0) !== '/') {
  39189. pos++;
  39190. string = '/' + string;
  39191. }
  39192. if (parts.preventInvalidHostname) {
  39193. URI.ensureValidHostname(parts.hostname, parts.protocol);
  39194. }
  39195. if (parts.port) {
  39196. URI.ensureValidPort(parts.port);
  39197. }
  39198. return string.substring(pos) || '/';
  39199. };
  39200. URI.parseAuthority = function(string, parts) {
  39201. string = URI.parseUserinfo(string, parts);
  39202. return URI.parseHost(string, parts);
  39203. };
  39204. URI.parseUserinfo = function(string, parts) {
  39205. // extract username:password
  39206. var firstSlash = string.indexOf('/');
  39207. var pos = string.lastIndexOf('@', firstSlash > -1 ? firstSlash : string.length - 1);
  39208. var t;
  39209. // authority@ must come before /path
  39210. if (pos > -1 && (firstSlash === -1 || pos < firstSlash)) {
  39211. t = string.substring(0, pos).split(':');
  39212. parts.username = t[0] ? URI.decode(t[0]) : null;
  39213. t.shift();
  39214. parts.password = t[0] ? URI.decode(t.join(':')) : null;
  39215. string = string.substring(pos + 1);
  39216. } else {
  39217. parts.username = null;
  39218. parts.password = null;
  39219. }
  39220. return string;
  39221. };
  39222. URI.parseQuery = function(string, escapeQuerySpace) {
  39223. if (!string) {
  39224. return {};
  39225. }
  39226. // throw out the funky business - "?"[name"="value"&"]+
  39227. string = string.replace(/&+/g, '&').replace(/^\?*&*|&+$/g, '');
  39228. if (!string) {
  39229. return {};
  39230. }
  39231. var items = {};
  39232. var splits = string.split('&');
  39233. var length = splits.length;
  39234. var v, name, value;
  39235. for (var i = 0; i < length; i++) {
  39236. v = splits[i].split('=');
  39237. name = URI.decodeQuery(v.shift(), escapeQuerySpace);
  39238. // no "=" is null according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#collect-url-parameters
  39239. value = v.length ? URI.decodeQuery(v.join('='), escapeQuerySpace) : null;
  39240. if (hasOwn.call(items, name)) {
  39241. if (typeof items[name] === 'string' || items[name] === null) {
  39242. items[name] = [items[name]];
  39243. }
  39244. items[name].push(value);
  39245. } else {
  39246. items[name] = value;
  39247. }
  39248. }
  39249. return items;
  39250. };
  39251. URI.build = function(parts) {
  39252. var t = '';
  39253. if (parts.protocol) {
  39254. t += parts.protocol + ':';
  39255. }
  39256. if (!parts.urn && (t || parts.hostname)) {
  39257. t += '//';
  39258. }
  39259. t += (URI.buildAuthority(parts) || '');
  39260. if (typeof parts.path === 'string') {
  39261. if (parts.path.charAt(0) !== '/' && typeof parts.hostname === 'string') {
  39262. t += '/';
  39263. }
  39264. t += parts.path;
  39265. }
  39266. if (typeof parts.query === 'string' && parts.query) {
  39267. t += '?' + parts.query;
  39268. }
  39269. if (typeof parts.fragment === 'string' && parts.fragment) {
  39270. t += '#' + parts.fragment;
  39271. }
  39272. return t;
  39273. };
  39274. URI.buildHost = function(parts) {
  39275. var t = '';
  39276. if (!parts.hostname) {
  39277. return '';
  39278. } else if (URI.ip6_expression.test(parts.hostname)) {
  39279. t += '[' + parts.hostname + ']';
  39280. } else {
  39281. t += parts.hostname;
  39282. }
  39283. if (parts.port) {
  39284. t += ':' + parts.port;
  39285. }
  39286. return t;
  39287. };
  39288. URI.buildAuthority = function(parts) {
  39289. return URI.buildUserinfo(parts) + URI.buildHost(parts);
  39290. };
  39291. URI.buildUserinfo = function(parts) {
  39292. var t = '';
  39293. if (parts.username) {
  39294. t += URI.encode(parts.username);
  39295. }
  39296. if (parts.password) {
  39297. t += ':' + URI.encode(parts.password);
  39298. }
  39299. if (t) {
  39300. t += '@';
  39301. }
  39302. return t;
  39303. };
  39304. URI.buildQuery = function(data, duplicateQueryParameters, escapeQuerySpace) {
  39305. // according to http://tools.ietf.org/html/rfc3986 or http://labs.apache.org/webarch/uri/rfc/rfc3986.html
  39306. // being »-._~!$&'()*+,;=:@/?« %HEX and alnum are allowed
  39307. // the RFC explicitly states ?/foo being a valid use case, no mention of parameter syntax!
  39308. // URI.js treats the query string as being application/x-www-form-urlencoded
  39309. // see http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type
  39310. var t = '';
  39311. var unique, key, i, length;
  39312. for (key in data) {
  39313. if (hasOwn.call(data, key) && key) {
  39314. if (isArray(data[key])) {
  39315. unique = {};
  39316. for (i = 0, length = data[key].length; i < length; i++) {
  39317. if (data[key][i] !== undefined && unique[data[key][i] + ''] === undefined) {
  39318. t += '&' + URI.buildQueryParameter(key, data[key][i], escapeQuerySpace);
  39319. if (duplicateQueryParameters !== true) {
  39320. unique[data[key][i] + ''] = true;
  39321. }
  39322. }
  39323. }
  39324. } else if (data[key] !== undefined) {
  39325. t += '&' + URI.buildQueryParameter(key, data[key], escapeQuerySpace);
  39326. }
  39327. }
  39328. }
  39329. return t.substring(1);
  39330. };
  39331. URI.buildQueryParameter = function(name, value, escapeQuerySpace) {
  39332. // http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type -- application/x-www-form-urlencoded
  39333. // don't append "=" for null values, according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#url-parameter-serialization
  39334. return URI.encodeQuery(name, escapeQuerySpace) + (value !== null ? '=' + URI.encodeQuery(value, escapeQuerySpace) : '');
  39335. };
  39336. URI.addQuery = function(data, name, value) {
  39337. if (typeof name === 'object') {
  39338. for (var key in name) {
  39339. if (hasOwn.call(name, key)) {
  39340. URI.addQuery(data, key, name[key]);
  39341. }
  39342. }
  39343. } else if (typeof name === 'string') {
  39344. if (data[name] === undefined) {
  39345. data[name] = value;
  39346. return;
  39347. } else if (typeof data[name] === 'string') {
  39348. data[name] = [data[name]];
  39349. }
  39350. if (!isArray(value)) {
  39351. value = [value];
  39352. }
  39353. data[name] = (data[name] || []).concat(value);
  39354. } else {
  39355. throw new TypeError('URI.addQuery() accepts an object, string as the name parameter');
  39356. }
  39357. };
  39358. URI.setQuery = function(data, name, value) {
  39359. if (typeof name === 'object') {
  39360. for (var key in name) {
  39361. if (hasOwn.call(name, key)) {
  39362. URI.setQuery(data, key, name[key]);
  39363. }
  39364. }
  39365. } else if (typeof name === 'string') {
  39366. data[name] = value === undefined ? null : value;
  39367. } else {
  39368. throw new TypeError('URI.setQuery() accepts an object, string as the name parameter');
  39369. }
  39370. };
  39371. URI.removeQuery = function(data, name, value) {
  39372. var i, length, key;
  39373. if (isArray(name)) {
  39374. for (i = 0, length = name.length; i < length; i++) {
  39375. data[name[i]] = undefined;
  39376. }
  39377. } else if (getType(name) === 'RegExp') {
  39378. for (key in data) {
  39379. if (name.test(key)) {
  39380. data[key] = undefined;
  39381. }
  39382. }
  39383. } else if (typeof name === 'object') {
  39384. for (key in name) {
  39385. if (hasOwn.call(name, key)) {
  39386. URI.removeQuery(data, key, name[key]);
  39387. }
  39388. }
  39389. } else if (typeof name === 'string') {
  39390. if (value !== undefined) {
  39391. if (getType(value) === 'RegExp') {
  39392. if (!isArray(data[name]) && value.test(data[name])) {
  39393. data[name] = undefined;
  39394. } else {
  39395. data[name] = filterArrayValues(data[name], value);
  39396. }
  39397. } else if (data[name] === String(value) && (!isArray(value) || value.length === 1)) {
  39398. data[name] = undefined;
  39399. } else if (isArray(data[name])) {
  39400. data[name] = filterArrayValues(data[name], value);
  39401. }
  39402. } else {
  39403. data[name] = undefined;
  39404. }
  39405. } else {
  39406. throw new TypeError('URI.removeQuery() accepts an object, string, RegExp as the first parameter');
  39407. }
  39408. };
  39409. URI.hasQuery = function(data, name, value, withinArray) {
  39410. switch (getType(name)) {
  39411. case 'String':
  39412. // Nothing to do here
  39413. break;
  39414. case 'RegExp':
  39415. for (var key in data) {
  39416. if (hasOwn.call(data, key)) {
  39417. if (name.test(key) && (value === undefined || URI.hasQuery(data, key, value))) {
  39418. return true;
  39419. }
  39420. }
  39421. }
  39422. return false;
  39423. case 'Object':
  39424. for (var _key in name) {
  39425. if (hasOwn.call(name, _key)) {
  39426. if (!URI.hasQuery(data, _key, name[_key])) {
  39427. return false;
  39428. }
  39429. }
  39430. }
  39431. return true;
  39432. default:
  39433. throw new TypeError('URI.hasQuery() accepts a string, regular expression or object as the name parameter');
  39434. }
  39435. switch (getType(value)) {
  39436. case 'Undefined':
  39437. // true if exists (but may be empty)
  39438. return name in data; // data[name] !== undefined;
  39439. case 'Boolean':
  39440. // true if exists and non-empty
  39441. var _booly = Boolean(isArray(data[name]) ? data[name].length : data[name]);
  39442. return value === _booly;
  39443. case 'Function':
  39444. // allow complex comparison
  39445. return !!value(data[name], name, data);
  39446. case 'Array':
  39447. if (!isArray(data[name])) {
  39448. return false;
  39449. }
  39450. var op = withinArray ? arrayContains : arraysEqual;
  39451. return op(data[name], value);
  39452. case 'RegExp':
  39453. if (!isArray(data[name])) {
  39454. return Boolean(data[name] && data[name].match(value));
  39455. }
  39456. if (!withinArray) {
  39457. return false;
  39458. }
  39459. return arrayContains(data[name], value);
  39460. case 'Number':
  39461. value = String(value);
  39462. /* falls through */
  39463. case 'String':
  39464. if (!isArray(data[name])) {
  39465. return data[name] === value;
  39466. }
  39467. if (!withinArray) {
  39468. return false;
  39469. }
  39470. return arrayContains(data[name], value);
  39471. default:
  39472. throw new TypeError('URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter');
  39473. }
  39474. };
  39475. URI.joinPaths = function() {
  39476. var input = [];
  39477. var segments = [];
  39478. var nonEmptySegments = 0;
  39479. for (var i = 0; i < arguments.length; i++) {
  39480. var url = new URI(arguments[i]);
  39481. input.push(url);
  39482. var _segments = url.segment();
  39483. for (var s = 0; s < _segments.length; s++) {
  39484. if (typeof _segments[s] === 'string') {
  39485. segments.push(_segments[s]);
  39486. }
  39487. if (_segments[s]) {
  39488. nonEmptySegments++;
  39489. }
  39490. }
  39491. }
  39492. if (!segments.length || !nonEmptySegments) {
  39493. return new URI('');
  39494. }
  39495. var uri = new URI('').segment(segments);
  39496. if (input[0].path() === '' || input[0].path().slice(0, 1) === '/') {
  39497. uri.path('/' + uri.path());
  39498. }
  39499. return uri.normalize();
  39500. };
  39501. URI.commonPath = function(one, two) {
  39502. var length = Math.min(one.length, two.length);
  39503. var pos;
  39504. // find first non-matching character
  39505. for (pos = 0; pos < length; pos++) {
  39506. if (one.charAt(pos) !== two.charAt(pos)) {
  39507. pos--;
  39508. break;
  39509. }
  39510. }
  39511. if (pos < 1) {
  39512. return one.charAt(0) === two.charAt(0) && one.charAt(0) === '/' ? '/' : '';
  39513. }
  39514. // revert to last /
  39515. if (one.charAt(pos) !== '/' || two.charAt(pos) !== '/') {
  39516. pos = one.substring(0, pos).lastIndexOf('/');
  39517. }
  39518. return one.substring(0, pos + 1);
  39519. };
  39520. URI.withinString = function(string, callback, options) {
  39521. options || (options = {});
  39522. var _start = options.start || URI.findUri.start;
  39523. var _end = options.end || URI.findUri.end;
  39524. var _trim = options.trim || URI.findUri.trim;
  39525. var _parens = options.parens || URI.findUri.parens;
  39526. var _attributeOpen = /[a-z0-9-]=["']?$/i;
  39527. _start.lastIndex = 0;
  39528. while (true) {
  39529. var match = _start.exec(string);
  39530. if (!match) {
  39531. break;
  39532. }
  39533. var start = match.index;
  39534. if (options.ignoreHtml) {
  39535. // attribut(e=["']?$)
  39536. var attributeOpen = string.slice(Math.max(start - 3, 0), start);
  39537. if (attributeOpen && _attributeOpen.test(attributeOpen)) {
  39538. continue;
  39539. }
  39540. }
  39541. var end = start + string.slice(start).search(_end);
  39542. var slice = string.slice(start, end);
  39543. // make sure we include well balanced parens
  39544. var parensEnd = -1;
  39545. while (true) {
  39546. var parensMatch = _parens.exec(slice);
  39547. if (!parensMatch) {
  39548. break;
  39549. }
  39550. var parensMatchEnd = parensMatch.index + parensMatch[0].length;
  39551. parensEnd = Math.max(parensEnd, parensMatchEnd);
  39552. }
  39553. if (parensEnd > -1) {
  39554. slice = slice.slice(0, parensEnd) + slice.slice(parensEnd).replace(_trim, '');
  39555. } else {
  39556. slice = slice.replace(_trim, '');
  39557. }
  39558. if (slice.length <= match[0].length) {
  39559. // the extract only contains the starting marker of a URI,
  39560. // e.g. "www" or "http://"
  39561. continue;
  39562. }
  39563. if (options.ignore && options.ignore.test(slice)) {
  39564. continue;
  39565. }
  39566. end = start + slice.length;
  39567. var result = callback(slice, start, end, string);
  39568. if (result === undefined) {
  39569. _start.lastIndex = end;
  39570. continue;
  39571. }
  39572. result = String(result);
  39573. string = string.slice(0, start) + result + string.slice(end);
  39574. _start.lastIndex = start + result.length;
  39575. }
  39576. _start.lastIndex = 0;
  39577. return string;
  39578. };
  39579. URI.ensureValidHostname = function(v, protocol) {
  39580. // Theoretically URIs allow percent-encoding in Hostnames (according to RFC 3986)
  39581. // they are not part of DNS and therefore ignored by URI.js
  39582. var hasHostname = !!v; // not null and not an empty string
  39583. var hasProtocol = !!protocol;
  39584. var rejectEmptyHostname = false;
  39585. if (hasProtocol) {
  39586. rejectEmptyHostname = arrayContains(URI.hostProtocols, protocol);
  39587. }
  39588. if (rejectEmptyHostname && !hasHostname) {
  39589. throw new TypeError('Hostname cannot be empty, if protocol is ' + protocol);
  39590. } else if (v && v.match(URI.invalid_hostname_characters)) {
  39591. // test punycode
  39592. if (!punycode) {
  39593. throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');
  39594. }
  39595. if (punycode.toASCII(v).match(URI.invalid_hostname_characters)) {
  39596. throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-:_]');
  39597. }
  39598. }
  39599. };
  39600. URI.ensureValidPort = function (v) {
  39601. if (!v) {
  39602. return;
  39603. }
  39604. var port = Number(v);
  39605. if (isInteger(port) && (port > 0) && (port < 65536)) {
  39606. return;
  39607. }
  39608. throw new TypeError('Port "' + v + '" is not a valid port');
  39609. };
  39610. // noConflict
  39611. URI.noConflict = function(removeAll) {
  39612. if (removeAll) {
  39613. var unconflicted = {
  39614. URI: this.noConflict()
  39615. };
  39616. if (root.URITemplate && typeof root.URITemplate.noConflict === 'function') {
  39617. unconflicted.URITemplate = root.URITemplate.noConflict();
  39618. }
  39619. if (root.IPv6 && typeof root.IPv6.noConflict === 'function') {
  39620. unconflicted.IPv6 = root.IPv6.noConflict();
  39621. }
  39622. if (root.SecondLevelDomains && typeof root.SecondLevelDomains.noConflict === 'function') {
  39623. unconflicted.SecondLevelDomains = root.SecondLevelDomains.noConflict();
  39624. }
  39625. return unconflicted;
  39626. } else if (root.URI === this) {
  39627. root.URI = _URI;
  39628. }
  39629. return this;
  39630. };
  39631. p.build = function(deferBuild) {
  39632. if (deferBuild === true) {
  39633. this._deferred_build = true;
  39634. } else if (deferBuild === undefined || this._deferred_build) {
  39635. this._string = URI.build(this._parts);
  39636. this._deferred_build = false;
  39637. }
  39638. return this;
  39639. };
  39640. p.clone = function() {
  39641. return new URI(this);
  39642. };
  39643. p.valueOf = p.toString = function() {
  39644. return this.build(false)._string;
  39645. };
  39646. function generateSimpleAccessor(_part){
  39647. return function(v, build) {
  39648. if (v === undefined) {
  39649. return this._parts[_part] || '';
  39650. } else {
  39651. this._parts[_part] = v || null;
  39652. this.build(!build);
  39653. return this;
  39654. }
  39655. };
  39656. }
  39657. function generatePrefixAccessor(_part, _key){
  39658. return function(v, build) {
  39659. if (v === undefined) {
  39660. return this._parts[_part] || '';
  39661. } else {
  39662. if (v !== null) {
  39663. v = v + '';
  39664. if (v.charAt(0) === _key) {
  39665. v = v.substring(1);
  39666. }
  39667. }
  39668. this._parts[_part] = v;
  39669. this.build(!build);
  39670. return this;
  39671. }
  39672. };
  39673. }
  39674. p.protocol = generateSimpleAccessor('protocol');
  39675. p.username = generateSimpleAccessor('username');
  39676. p.password = generateSimpleAccessor('password');
  39677. p.hostname = generateSimpleAccessor('hostname');
  39678. p.port = generateSimpleAccessor('port');
  39679. p.query = generatePrefixAccessor('query', '?');
  39680. p.fragment = generatePrefixAccessor('fragment', '#');
  39681. p.search = function(v, build) {
  39682. var t = this.query(v, build);
  39683. return typeof t === 'string' && t.length ? ('?' + t) : t;
  39684. };
  39685. p.hash = function(v, build) {
  39686. var t = this.fragment(v, build);
  39687. return typeof t === 'string' && t.length ? ('#' + t) : t;
  39688. };
  39689. p.pathname = function(v, build) {
  39690. if (v === undefined || v === true) {
  39691. var res = this._parts.path || (this._parts.hostname ? '/' : '');
  39692. return v ? (this._parts.urn ? URI.decodeUrnPath : URI.decodePath)(res) : res;
  39693. } else {
  39694. if (this._parts.urn) {
  39695. this._parts.path = v ? URI.recodeUrnPath(v) : '';
  39696. } else {
  39697. this._parts.path = v ? URI.recodePath(v) : '/';
  39698. }
  39699. this.build(!build);
  39700. return this;
  39701. }
  39702. };
  39703. p.path = p.pathname;
  39704. p.href = function(href, build) {
  39705. var key;
  39706. if (href === undefined) {
  39707. return this.toString();
  39708. }
  39709. this._string = '';
  39710. this._parts = URI._parts();
  39711. var _URI = href instanceof URI;
  39712. var _object = typeof href === 'object' && (href.hostname || href.path || href.pathname);
  39713. if (href.nodeName) {
  39714. var attribute = URI.getDomAttribute(href);
  39715. href = href[attribute] || '';
  39716. _object = false;
  39717. }
  39718. // window.location is reported to be an object, but it's not the sort
  39719. // of object we're looking for:
  39720. // * location.protocol ends with a colon
  39721. // * location.query != object.search
  39722. // * location.hash != object.fragment
  39723. // simply serializing the unknown object should do the trick
  39724. // (for location, not for everything...)
  39725. if (!_URI && _object && href.pathname !== undefined) {
  39726. href = href.toString();
  39727. }
  39728. if (typeof href === 'string' || href instanceof String) {
  39729. this._parts = URI.parse(String(href), this._parts);
  39730. } else if (_URI || _object) {
  39731. var src = _URI ? href._parts : href;
  39732. for (key in src) {
  39733. if (key === 'query') { continue; }
  39734. if (hasOwn.call(this._parts, key)) {
  39735. this._parts[key] = src[key];
  39736. }
  39737. }
  39738. if (src.query) {
  39739. this.query(src.query, false);
  39740. }
  39741. } else {
  39742. throw new TypeError('invalid input');
  39743. }
  39744. this.build(!build);
  39745. return this;
  39746. };
  39747. // identification accessors
  39748. p.is = function(what) {
  39749. var ip = false;
  39750. var ip4 = false;
  39751. var ip6 = false;
  39752. var name = false;
  39753. var sld = false;
  39754. var idn = false;
  39755. var punycode = false;
  39756. var relative = !this._parts.urn;
  39757. if (this._parts.hostname) {
  39758. relative = false;
  39759. ip4 = URI.ip4_expression.test(this._parts.hostname);
  39760. ip6 = URI.ip6_expression.test(this._parts.hostname);
  39761. ip = ip4 || ip6;
  39762. name = !ip;
  39763. sld = name && SLD && SLD.has(this._parts.hostname);
  39764. idn = name && URI.idn_expression.test(this._parts.hostname);
  39765. punycode = name && URI.punycode_expression.test(this._parts.hostname);
  39766. }
  39767. switch (what.toLowerCase()) {
  39768. case 'relative':
  39769. return relative;
  39770. case 'absolute':
  39771. return !relative;
  39772. // hostname identification
  39773. case 'domain':
  39774. case 'name':
  39775. return name;
  39776. case 'sld':
  39777. return sld;
  39778. case 'ip':
  39779. return ip;
  39780. case 'ip4':
  39781. case 'ipv4':
  39782. case 'inet4':
  39783. return ip4;
  39784. case 'ip6':
  39785. case 'ipv6':
  39786. case 'inet6':
  39787. return ip6;
  39788. case 'idn':
  39789. return idn;
  39790. case 'url':
  39791. return !this._parts.urn;
  39792. case 'urn':
  39793. return !!this._parts.urn;
  39794. case 'punycode':
  39795. return punycode;
  39796. }
  39797. return null;
  39798. };
  39799. // component specific input validation
  39800. var _protocol = p.protocol;
  39801. var _port = p.port;
  39802. var _hostname = p.hostname;
  39803. p.protocol = function(v, build) {
  39804. if (v) {
  39805. // accept trailing ://
  39806. v = v.replace(/:(\/\/)?$/, '');
  39807. if (!v.match(URI.protocol_expression)) {
  39808. throw new TypeError('Protocol "' + v + '" contains characters other than [A-Z0-9.+-] or doesn\'t start with [A-Z]');
  39809. }
  39810. }
  39811. return _protocol.call(this, v, build);
  39812. };
  39813. p.scheme = p.protocol;
  39814. p.port = function(v, build) {
  39815. if (this._parts.urn) {
  39816. return v === undefined ? '' : this;
  39817. }
  39818. if (v !== undefined) {
  39819. if (v === 0) {
  39820. v = null;
  39821. }
  39822. if (v) {
  39823. v += '';
  39824. if (v.charAt(0) === ':') {
  39825. v = v.substring(1);
  39826. }
  39827. URI.ensureValidPort(v);
  39828. }
  39829. }
  39830. return _port.call(this, v, build);
  39831. };
  39832. p.hostname = function(v, build) {
  39833. if (this._parts.urn) {
  39834. return v === undefined ? '' : this;
  39835. }
  39836. if (v !== undefined) {
  39837. var x = { preventInvalidHostname: this._parts.preventInvalidHostname };
  39838. var res = URI.parseHost(v, x);
  39839. if (res !== '/') {
  39840. throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]');
  39841. }
  39842. v = x.hostname;
  39843. if (this._parts.preventInvalidHostname) {
  39844. URI.ensureValidHostname(v, this._parts.protocol);
  39845. }
  39846. }
  39847. return _hostname.call(this, v, build);
  39848. };
  39849. // compound accessors
  39850. p.origin = function(v, build) {
  39851. if (this._parts.urn) {
  39852. return v === undefined ? '' : this;
  39853. }
  39854. if (v === undefined) {
  39855. var protocol = this.protocol();
  39856. var authority = this.authority();
  39857. if (!authority) {
  39858. return '';
  39859. }
  39860. return (protocol ? protocol + '://' : '') + this.authority();
  39861. } else {
  39862. var origin = URI(v);
  39863. this
  39864. .protocol(origin.protocol())
  39865. .authority(origin.authority())
  39866. .build(!build);
  39867. return this;
  39868. }
  39869. };
  39870. p.host = function(v, build) {
  39871. if (this._parts.urn) {
  39872. return v === undefined ? '' : this;
  39873. }
  39874. if (v === undefined) {
  39875. return this._parts.hostname ? URI.buildHost(this._parts) : '';
  39876. } else {
  39877. var res = URI.parseHost(v, this._parts);
  39878. if (res !== '/') {
  39879. throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]');
  39880. }
  39881. this.build(!build);
  39882. return this;
  39883. }
  39884. };
  39885. p.authority = function(v, build) {
  39886. if (this._parts.urn) {
  39887. return v === undefined ? '' : this;
  39888. }
  39889. if (v === undefined) {
  39890. return this._parts.hostname ? URI.buildAuthority(this._parts) : '';
  39891. } else {
  39892. var res = URI.parseAuthority(v, this._parts);
  39893. if (res !== '/') {
  39894. throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]');
  39895. }
  39896. this.build(!build);
  39897. return this;
  39898. }
  39899. };
  39900. p.userinfo = function(v, build) {
  39901. if (this._parts.urn) {
  39902. return v === undefined ? '' : this;
  39903. }
  39904. if (v === undefined) {
  39905. var t = URI.buildUserinfo(this._parts);
  39906. return t ? t.substring(0, t.length -1) : t;
  39907. } else {
  39908. if (v[v.length-1] !== '@') {
  39909. v += '@';
  39910. }
  39911. URI.parseUserinfo(v, this._parts);
  39912. this.build(!build);
  39913. return this;
  39914. }
  39915. };
  39916. p.resource = function(v, build) {
  39917. var parts;
  39918. if (v === undefined) {
  39919. return this.path() + this.search() + this.hash();
  39920. }
  39921. parts = URI.parse(v);
  39922. this._parts.path = parts.path;
  39923. this._parts.query = parts.query;
  39924. this._parts.fragment = parts.fragment;
  39925. this.build(!build);
  39926. return this;
  39927. };
  39928. // fraction accessors
  39929. p.subdomain = function(v, build) {
  39930. if (this._parts.urn) {
  39931. return v === undefined ? '' : this;
  39932. }
  39933. // convenience, return "www" from "www.example.org"
  39934. if (v === undefined) {
  39935. if (!this._parts.hostname || this.is('IP')) {
  39936. return '';
  39937. }
  39938. // grab domain and add another segment
  39939. var end = this._parts.hostname.length - this.domain().length - 1;
  39940. return this._parts.hostname.substring(0, end) || '';
  39941. } else {
  39942. var e = this._parts.hostname.length - this.domain().length;
  39943. var sub = this._parts.hostname.substring(0, e);
  39944. var replace = new RegExp('^' + escapeRegEx(sub));
  39945. if (v && v.charAt(v.length - 1) !== '.') {
  39946. v += '.';
  39947. }
  39948. if (v.indexOf(':') !== -1) {
  39949. throw new TypeError('Domains cannot contain colons');
  39950. }
  39951. if (v) {
  39952. URI.ensureValidHostname(v, this._parts.protocol);
  39953. }
  39954. this._parts.hostname = this._parts.hostname.replace(replace, v);
  39955. this.build(!build);
  39956. return this;
  39957. }
  39958. };
  39959. p.domain = function(v, build) {
  39960. if (this._parts.urn) {
  39961. return v === undefined ? '' : this;
  39962. }
  39963. if (typeof v === 'boolean') {
  39964. build = v;
  39965. v = undefined;
  39966. }
  39967. // convenience, return "example.org" from "www.example.org"
  39968. if (v === undefined) {
  39969. if (!this._parts.hostname || this.is('IP')) {
  39970. return '';
  39971. }
  39972. // if hostname consists of 1 or 2 segments, it must be the domain
  39973. var t = this._parts.hostname.match(/\./g);
  39974. if (t && t.length < 2) {
  39975. return this._parts.hostname;
  39976. }
  39977. // grab tld and add another segment
  39978. var end = this._parts.hostname.length - this.tld(build).length - 1;
  39979. end = this._parts.hostname.lastIndexOf('.', end -1) + 1;
  39980. return this._parts.hostname.substring(end) || '';
  39981. } else {
  39982. if (!v) {
  39983. throw new TypeError('cannot set domain empty');
  39984. }
  39985. if (v.indexOf(':') !== -1) {
  39986. throw new TypeError('Domains cannot contain colons');
  39987. }
  39988. URI.ensureValidHostname(v, this._parts.protocol);
  39989. if (!this._parts.hostname || this.is('IP')) {
  39990. this._parts.hostname = v;
  39991. } else {
  39992. var replace = new RegExp(escapeRegEx(this.domain()) + '$');
  39993. this._parts.hostname = this._parts.hostname.replace(replace, v);
  39994. }
  39995. this.build(!build);
  39996. return this;
  39997. }
  39998. };
  39999. p.tld = function(v, build) {
  40000. if (this._parts.urn) {
  40001. return v === undefined ? '' : this;
  40002. }
  40003. if (typeof v === 'boolean') {
  40004. build = v;
  40005. v = undefined;
  40006. }
  40007. // return "org" from "www.example.org"
  40008. if (v === undefined) {
  40009. if (!this._parts.hostname || this.is('IP')) {
  40010. return '';
  40011. }
  40012. var pos = this._parts.hostname.lastIndexOf('.');
  40013. var tld = this._parts.hostname.substring(pos + 1);
  40014. if (build !== true && SLD && SLD.list[tld.toLowerCase()]) {
  40015. return SLD.get(this._parts.hostname) || tld;
  40016. }
  40017. return tld;
  40018. } else {
  40019. var replace;
  40020. if (!v) {
  40021. throw new TypeError('cannot set TLD empty');
  40022. } else if (v.match(/[^a-zA-Z0-9-]/)) {
  40023. if (SLD && SLD.is(v)) {
  40024. replace = new RegExp(escapeRegEx(this.tld()) + '$');
  40025. this._parts.hostname = this._parts.hostname.replace(replace, v);
  40026. } else {
  40027. throw new TypeError('TLD "' + v + '" contains characters other than [A-Z0-9]');
  40028. }
  40029. } else if (!this._parts.hostname || this.is('IP')) {
  40030. throw new ReferenceError('cannot set TLD on non-domain host');
  40031. } else {
  40032. replace = new RegExp(escapeRegEx(this.tld()) + '$');
  40033. this._parts.hostname = this._parts.hostname.replace(replace, v);
  40034. }
  40035. this.build(!build);
  40036. return this;
  40037. }
  40038. };
  40039. p.directory = function(v, build) {
  40040. if (this._parts.urn) {
  40041. return v === undefined ? '' : this;
  40042. }
  40043. if (v === undefined || v === true) {
  40044. if (!this._parts.path && !this._parts.hostname) {
  40045. return '';
  40046. }
  40047. if (this._parts.path === '/') {
  40048. return '/';
  40049. }
  40050. var end = this._parts.path.length - this.filename().length - 1;
  40051. var res = this._parts.path.substring(0, end) || (this._parts.hostname ? '/' : '');
  40052. return v ? URI.decodePath(res) : res;
  40053. } else {
  40054. var e = this._parts.path.length - this.filename().length;
  40055. var directory = this._parts.path.substring(0, e);
  40056. var replace = new RegExp('^' + escapeRegEx(directory));
  40057. // fully qualifier directories begin with a slash
  40058. if (!this.is('relative')) {
  40059. if (!v) {
  40060. v = '/';
  40061. }
  40062. if (v.charAt(0) !== '/') {
  40063. v = '/' + v;
  40064. }
  40065. }
  40066. // directories always end with a slash
  40067. if (v && v.charAt(v.length - 1) !== '/') {
  40068. v += '/';
  40069. }
  40070. v = URI.recodePath(v);
  40071. this._parts.path = this._parts.path.replace(replace, v);
  40072. this.build(!build);
  40073. return this;
  40074. }
  40075. };
  40076. p.filename = function(v, build) {
  40077. if (this._parts.urn) {
  40078. return v === undefined ? '' : this;
  40079. }
  40080. if (typeof v !== 'string') {
  40081. if (!this._parts.path || this._parts.path === '/') {
  40082. return '';
  40083. }
  40084. var pos = this._parts.path.lastIndexOf('/');
  40085. var res = this._parts.path.substring(pos+1);
  40086. return v ? URI.decodePathSegment(res) : res;
  40087. } else {
  40088. var mutatedDirectory = false;
  40089. if (v.charAt(0) === '/') {
  40090. v = v.substring(1);
  40091. }
  40092. if (v.match(/\.?\//)) {
  40093. mutatedDirectory = true;
  40094. }
  40095. var replace = new RegExp(escapeRegEx(this.filename()) + '$');
  40096. v = URI.recodePath(v);
  40097. this._parts.path = this._parts.path.replace(replace, v);
  40098. if (mutatedDirectory) {
  40099. this.normalizePath(build);
  40100. } else {
  40101. this.build(!build);
  40102. }
  40103. return this;
  40104. }
  40105. };
  40106. p.suffix = function(v, build) {
  40107. if (this._parts.urn) {
  40108. return v === undefined ? '' : this;
  40109. }
  40110. if (v === undefined || v === true) {
  40111. if (!this._parts.path || this._parts.path === '/') {
  40112. return '';
  40113. }
  40114. var filename = this.filename();
  40115. var pos = filename.lastIndexOf('.');
  40116. var s, res;
  40117. if (pos === -1) {
  40118. return '';
  40119. }
  40120. // suffix may only contain alnum characters (yup, I made this up.)
  40121. s = filename.substring(pos+1);
  40122. res = (/^[a-z0-9%]+$/i).test(s) ? s : '';
  40123. return v ? URI.decodePathSegment(res) : res;
  40124. } else {
  40125. if (v.charAt(0) === '.') {
  40126. v = v.substring(1);
  40127. }
  40128. var suffix = this.suffix();
  40129. var replace;
  40130. if (!suffix) {
  40131. if (!v) {
  40132. return this;
  40133. }
  40134. this._parts.path += '.' + URI.recodePath(v);
  40135. } else if (!v) {
  40136. replace = new RegExp(escapeRegEx('.' + suffix) + '$');
  40137. } else {
  40138. replace = new RegExp(escapeRegEx(suffix) + '$');
  40139. }
  40140. if (replace) {
  40141. v = URI.recodePath(v);
  40142. this._parts.path = this._parts.path.replace(replace, v);
  40143. }
  40144. this.build(!build);
  40145. return this;
  40146. }
  40147. };
  40148. p.segment = function(segment, v, build) {
  40149. var separator = this._parts.urn ? ':' : '/';
  40150. var path = this.path();
  40151. var absolute = path.substring(0, 1) === '/';
  40152. var segments = path.split(separator);
  40153. if (segment !== undefined && typeof segment !== 'number') {
  40154. build = v;
  40155. v = segment;
  40156. segment = undefined;
  40157. }
  40158. if (segment !== undefined && typeof segment !== 'number') {
  40159. throw new Error('Bad segment "' + segment + '", must be 0-based integer');
  40160. }
  40161. if (absolute) {
  40162. segments.shift();
  40163. }
  40164. if (segment < 0) {
  40165. // allow negative indexes to address from the end
  40166. segment = Math.max(segments.length + segment, 0);
  40167. }
  40168. if (v === undefined) {
  40169. /*jshint laxbreak: true */
  40170. return segment === undefined
  40171. ? segments
  40172. : segments[segment];
  40173. /*jshint laxbreak: false */
  40174. } else if (segment === null || segments[segment] === undefined) {
  40175. if (isArray(v)) {
  40176. segments = [];
  40177. // collapse empty elements within array
  40178. for (var i=0, l=v.length; i < l; i++) {
  40179. if (!v[i].length && (!segments.length || !segments[segments.length -1].length)) {
  40180. continue;
  40181. }
  40182. if (segments.length && !segments[segments.length -1].length) {
  40183. segments.pop();
  40184. }
  40185. segments.push(trimSlashes(v[i]));
  40186. }
  40187. } else if (v || typeof v === 'string') {
  40188. v = trimSlashes(v);
  40189. if (segments[segments.length -1] === '') {
  40190. // empty trailing elements have to be overwritten
  40191. // to prevent results such as /foo//bar
  40192. segments[segments.length -1] = v;
  40193. } else {
  40194. segments.push(v);
  40195. }
  40196. }
  40197. } else {
  40198. if (v) {
  40199. segments[segment] = trimSlashes(v);
  40200. } else {
  40201. segments.splice(segment, 1);
  40202. }
  40203. }
  40204. if (absolute) {
  40205. segments.unshift('');
  40206. }
  40207. return this.path(segments.join(separator), build);
  40208. };
  40209. p.segmentCoded = function(segment, v, build) {
  40210. var segments, i, l;
  40211. if (typeof segment !== 'number') {
  40212. build = v;
  40213. v = segment;
  40214. segment = undefined;
  40215. }
  40216. if (v === undefined) {
  40217. segments = this.segment(segment, v, build);
  40218. if (!isArray(segments)) {
  40219. segments = segments !== undefined ? URI.decode(segments) : undefined;
  40220. } else {
  40221. for (i = 0, l = segments.length; i < l; i++) {
  40222. segments[i] = URI.decode(segments[i]);
  40223. }
  40224. }
  40225. return segments;
  40226. }
  40227. if (!isArray(v)) {
  40228. v = (typeof v === 'string' || v instanceof String) ? URI.encode(v) : v;
  40229. } else {
  40230. for (i = 0, l = v.length; i < l; i++) {
  40231. v[i] = URI.encode(v[i]);
  40232. }
  40233. }
  40234. return this.segment(segment, v, build);
  40235. };
  40236. // mutating query string
  40237. var q = p.query;
  40238. p.query = function(v, build) {
  40239. if (v === true) {
  40240. return URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
  40241. } else if (typeof v === 'function') {
  40242. var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
  40243. var result = v.call(this, data);
  40244. this._parts.query = URI.buildQuery(result || data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
  40245. this.build(!build);
  40246. return this;
  40247. } else if (v !== undefined && typeof v !== 'string') {
  40248. this._parts.query = URI.buildQuery(v, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
  40249. this.build(!build);
  40250. return this;
  40251. } else {
  40252. return q.call(this, v, build);
  40253. }
  40254. };
  40255. p.setQuery = function(name, value, build) {
  40256. var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
  40257. if (typeof name === 'string' || name instanceof String) {
  40258. data[name] = value !== undefined ? value : null;
  40259. } else if (typeof name === 'object') {
  40260. for (var key in name) {
  40261. if (hasOwn.call(name, key)) {
  40262. data[key] = name[key];
  40263. }
  40264. }
  40265. } else {
  40266. throw new TypeError('URI.addQuery() accepts an object, string as the name parameter');
  40267. }
  40268. this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
  40269. if (typeof name !== 'string') {
  40270. build = value;
  40271. }
  40272. this.build(!build);
  40273. return this;
  40274. };
  40275. p.addQuery = function(name, value, build) {
  40276. var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
  40277. URI.addQuery(data, name, value === undefined ? null : value);
  40278. this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
  40279. if (typeof name !== 'string') {
  40280. build = value;
  40281. }
  40282. this.build(!build);
  40283. return this;
  40284. };
  40285. p.removeQuery = function(name, value, build) {
  40286. var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
  40287. URI.removeQuery(data, name, value);
  40288. this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
  40289. if (typeof name !== 'string') {
  40290. build = value;
  40291. }
  40292. this.build(!build);
  40293. return this;
  40294. };
  40295. p.hasQuery = function(name, value, withinArray) {
  40296. var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
  40297. return URI.hasQuery(data, name, value, withinArray);
  40298. };
  40299. p.setSearch = p.setQuery;
  40300. p.addSearch = p.addQuery;
  40301. p.removeSearch = p.removeQuery;
  40302. p.hasSearch = p.hasQuery;
  40303. // sanitizing URLs
  40304. p.normalize = function() {
  40305. if (this._parts.urn) {
  40306. return this
  40307. .normalizeProtocol(false)
  40308. .normalizePath(false)
  40309. .normalizeQuery(false)
  40310. .normalizeFragment(false)
  40311. .build();
  40312. }
  40313. return this
  40314. .normalizeProtocol(false)
  40315. .normalizeHostname(false)
  40316. .normalizePort(false)
  40317. .normalizePath(false)
  40318. .normalizeQuery(false)
  40319. .normalizeFragment(false)
  40320. .build();
  40321. };
  40322. p.normalizeProtocol = function(build) {
  40323. if (typeof this._parts.protocol === 'string') {
  40324. this._parts.protocol = this._parts.protocol.toLowerCase();
  40325. this.build(!build);
  40326. }
  40327. return this;
  40328. };
  40329. p.normalizeHostname = function(build) {
  40330. if (this._parts.hostname) {
  40331. if (this.is('IDN') && punycode) {
  40332. this._parts.hostname = punycode.toASCII(this._parts.hostname);
  40333. } else if (this.is('IPv6') && IPv6) {
  40334. this._parts.hostname = IPv6.best(this._parts.hostname);
  40335. }
  40336. this._parts.hostname = this._parts.hostname.toLowerCase();
  40337. this.build(!build);
  40338. }
  40339. return this;
  40340. };
  40341. p.normalizePort = function(build) {
  40342. // remove port of it's the protocol's default
  40343. if (typeof this._parts.protocol === 'string' && this._parts.port === URI.defaultPorts[this._parts.protocol]) {
  40344. this._parts.port = null;
  40345. this.build(!build);
  40346. }
  40347. return this;
  40348. };
  40349. p.normalizePath = function(build) {
  40350. var _path = this._parts.path;
  40351. if (!_path) {
  40352. return this;
  40353. }
  40354. if (this._parts.urn) {
  40355. this._parts.path = URI.recodeUrnPath(this._parts.path);
  40356. this.build(!build);
  40357. return this;
  40358. }
  40359. if (this._parts.path === '/') {
  40360. return this;
  40361. }
  40362. _path = URI.recodePath(_path);
  40363. var _was_relative;
  40364. var _leadingParents = '';
  40365. var _parent, _pos;
  40366. // handle relative paths
  40367. if (_path.charAt(0) !== '/') {
  40368. _was_relative = true;
  40369. _path = '/' + _path;
  40370. }
  40371. // handle relative files (as opposed to directories)
  40372. if (_path.slice(-3) === '/..' || _path.slice(-2) === '/.') {
  40373. _path += '/';
  40374. }
  40375. // resolve simples
  40376. _path = _path
  40377. .replace(/(\/(\.\/)+)|(\/\.$)/g, '/')
  40378. .replace(/\/{2,}/g, '/');
  40379. // remember leading parents
  40380. if (_was_relative) {
  40381. _leadingParents = _path.substring(1).match(/^(\.\.\/)+/) || '';
  40382. if (_leadingParents) {
  40383. _leadingParents = _leadingParents[0];
  40384. }
  40385. }
  40386. // resolve parents
  40387. while (true) {
  40388. _parent = _path.search(/\/\.\.(\/|$)/);
  40389. if (_parent === -1) {
  40390. // no more ../ to resolve
  40391. break;
  40392. } else if (_parent === 0) {
  40393. // top level cannot be relative, skip it
  40394. _path = _path.substring(3);
  40395. continue;
  40396. }
  40397. _pos = _path.substring(0, _parent).lastIndexOf('/');
  40398. if (_pos === -1) {
  40399. _pos = _parent;
  40400. }
  40401. _path = _path.substring(0, _pos) + _path.substring(_parent + 3);
  40402. }
  40403. // revert to relative
  40404. if (_was_relative && this.is('relative')) {
  40405. _path = _leadingParents + _path.substring(1);
  40406. }
  40407. this._parts.path = _path;
  40408. this.build(!build);
  40409. return this;
  40410. };
  40411. p.normalizePathname = p.normalizePath;
  40412. p.normalizeQuery = function(build) {
  40413. if (typeof this._parts.query === 'string') {
  40414. if (!this._parts.query.length) {
  40415. this._parts.query = null;
  40416. } else {
  40417. this.query(URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace));
  40418. }
  40419. this.build(!build);
  40420. }
  40421. return this;
  40422. };
  40423. p.normalizeFragment = function(build) {
  40424. if (!this._parts.fragment) {
  40425. this._parts.fragment = null;
  40426. this.build(!build);
  40427. }
  40428. return this;
  40429. };
  40430. p.normalizeSearch = p.normalizeQuery;
  40431. p.normalizeHash = p.normalizeFragment;
  40432. p.iso8859 = function() {
  40433. // expect unicode input, iso8859 output
  40434. var e = URI.encode;
  40435. var d = URI.decode;
  40436. URI.encode = escape;
  40437. URI.decode = decodeURIComponent;
  40438. try {
  40439. this.normalize();
  40440. } finally {
  40441. URI.encode = e;
  40442. URI.decode = d;
  40443. }
  40444. return this;
  40445. };
  40446. p.unicode = function() {
  40447. // expect iso8859 input, unicode output
  40448. var e = URI.encode;
  40449. var d = URI.decode;
  40450. URI.encode = strictEncodeURIComponent;
  40451. URI.decode = unescape;
  40452. try {
  40453. this.normalize();
  40454. } finally {
  40455. URI.encode = e;
  40456. URI.decode = d;
  40457. }
  40458. return this;
  40459. };
  40460. p.readable = function() {
  40461. var uri = this.clone();
  40462. // removing username, password, because they shouldn't be displayed according to RFC 3986
  40463. uri.username('').password('').normalize();
  40464. var t = '';
  40465. if (uri._parts.protocol) {
  40466. t += uri._parts.protocol + '://';
  40467. }
  40468. if (uri._parts.hostname) {
  40469. if (uri.is('punycode') && punycode) {
  40470. t += punycode.toUnicode(uri._parts.hostname);
  40471. if (uri._parts.port) {
  40472. t += ':' + uri._parts.port;
  40473. }
  40474. } else {
  40475. t += uri.host();
  40476. }
  40477. }
  40478. if (uri._parts.hostname && uri._parts.path && uri._parts.path.charAt(0) !== '/') {
  40479. t += '/';
  40480. }
  40481. t += uri.path(true);
  40482. if (uri._parts.query) {
  40483. var q = '';
  40484. for (var i = 0, qp = uri._parts.query.split('&'), l = qp.length; i < l; i++) {
  40485. var kv = (qp[i] || '').split('=');
  40486. q += '&' + URI.decodeQuery(kv[0], this._parts.escapeQuerySpace)
  40487. .replace(/&/g, '%26');
  40488. if (kv[1] !== undefined) {
  40489. q += '=' + URI.decodeQuery(kv[1], this._parts.escapeQuerySpace)
  40490. .replace(/&/g, '%26');
  40491. }
  40492. }
  40493. t += '?' + q.substring(1);
  40494. }
  40495. t += URI.decodeQuery(uri.hash(), true);
  40496. return t;
  40497. };
  40498. // resolving relative and absolute URLs
  40499. p.absoluteTo = function(base) {
  40500. var resolved = this.clone();
  40501. var properties = ['protocol', 'username', 'password', 'hostname', 'port'];
  40502. var basedir, i, p;
  40503. if (this._parts.urn) {
  40504. throw new Error('URNs do not have any generally defined hierarchical components');
  40505. }
  40506. if (!(base instanceof URI)) {
  40507. base = new URI(base);
  40508. }
  40509. if (resolved._parts.protocol) {
  40510. // Directly returns even if this._parts.hostname is empty.
  40511. return resolved;
  40512. } else {
  40513. resolved._parts.protocol = base._parts.protocol;
  40514. }
  40515. if (this._parts.hostname) {
  40516. return resolved;
  40517. }
  40518. for (i = 0; (p = properties[i]); i++) {
  40519. resolved._parts[p] = base._parts[p];
  40520. }
  40521. if (!resolved._parts.path) {
  40522. resolved._parts.path = base._parts.path;
  40523. if (!resolved._parts.query) {
  40524. resolved._parts.query = base._parts.query;
  40525. }
  40526. } else {
  40527. if (resolved._parts.path.substring(-2) === '..') {
  40528. resolved._parts.path += '/';
  40529. }
  40530. if (resolved.path().charAt(0) !== '/') {
  40531. basedir = base.directory();
  40532. basedir = basedir ? basedir : base.path().indexOf('/') === 0 ? '/' : '';
  40533. resolved._parts.path = (basedir ? (basedir + '/') : '') + resolved._parts.path;
  40534. resolved.normalizePath();
  40535. }
  40536. }
  40537. resolved.build();
  40538. return resolved;
  40539. };
  40540. p.relativeTo = function(base) {
  40541. var relative = this.clone().normalize();
  40542. var relativeParts, baseParts, common, relativePath, basePath;
  40543. if (relative._parts.urn) {
  40544. throw new Error('URNs do not have any generally defined hierarchical components');
  40545. }
  40546. base = new URI(base).normalize();
  40547. relativeParts = relative._parts;
  40548. baseParts = base._parts;
  40549. relativePath = relative.path();
  40550. basePath = base.path();
  40551. if (relativePath.charAt(0) !== '/') {
  40552. throw new Error('URI is already relative');
  40553. }
  40554. if (basePath.charAt(0) !== '/') {
  40555. throw new Error('Cannot calculate a URI relative to another relative URI');
  40556. }
  40557. if (relativeParts.protocol === baseParts.protocol) {
  40558. relativeParts.protocol = null;
  40559. }
  40560. if (relativeParts.username !== baseParts.username || relativeParts.password !== baseParts.password) {
  40561. return relative.build();
  40562. }
  40563. if (relativeParts.protocol !== null || relativeParts.username !== null || relativeParts.password !== null) {
  40564. return relative.build();
  40565. }
  40566. if (relativeParts.hostname === baseParts.hostname && relativeParts.port === baseParts.port) {
  40567. relativeParts.hostname = null;
  40568. relativeParts.port = null;
  40569. } else {
  40570. return relative.build();
  40571. }
  40572. if (relativePath === basePath) {
  40573. relativeParts.path = '';
  40574. return relative.build();
  40575. }
  40576. // determine common sub path
  40577. common = URI.commonPath(relativePath, basePath);
  40578. // If the paths have nothing in common, return a relative URL with the absolute path.
  40579. if (!common) {
  40580. return relative.build();
  40581. }
  40582. var parents = baseParts.path
  40583. .substring(common.length)
  40584. .replace(/[^\/]*$/, '')
  40585. .replace(/.*?\//g, '../');
  40586. relativeParts.path = (parents + relativeParts.path.substring(common.length)) || './';
  40587. return relative.build();
  40588. };
  40589. // comparing URIs
  40590. p.equals = function(uri) {
  40591. var one = this.clone();
  40592. var two = new URI(uri);
  40593. var one_map = {};
  40594. var two_map = {};
  40595. var checked = {};
  40596. var one_query, two_query, key;
  40597. one.normalize();
  40598. two.normalize();
  40599. // exact match
  40600. if (one.toString() === two.toString()) {
  40601. return true;
  40602. }
  40603. // extract query string
  40604. one_query = one.query();
  40605. two_query = two.query();
  40606. one.query('');
  40607. two.query('');
  40608. // definitely not equal if not even non-query parts match
  40609. if (one.toString() !== two.toString()) {
  40610. return false;
  40611. }
  40612. // query parameters have the same length, even if they're permuted
  40613. if (one_query.length !== two_query.length) {
  40614. return false;
  40615. }
  40616. one_map = URI.parseQuery(one_query, this._parts.escapeQuerySpace);
  40617. two_map = URI.parseQuery(two_query, this._parts.escapeQuerySpace);
  40618. for (key in one_map) {
  40619. if (hasOwn.call(one_map, key)) {
  40620. if (!isArray(one_map[key])) {
  40621. if (one_map[key] !== two_map[key]) {
  40622. return false;
  40623. }
  40624. } else if (!arraysEqual(one_map[key], two_map[key])) {
  40625. return false;
  40626. }
  40627. checked[key] = true;
  40628. }
  40629. }
  40630. for (key in two_map) {
  40631. if (hasOwn.call(two_map, key)) {
  40632. if (!checked[key]) {
  40633. // two contains a parameter not present in one
  40634. return false;
  40635. }
  40636. }
  40637. }
  40638. return true;
  40639. };
  40640. // state
  40641. p.preventInvalidHostname = function(v) {
  40642. this._parts.preventInvalidHostname = !!v;
  40643. return this;
  40644. };
  40645. p.duplicateQueryParameters = function(v) {
  40646. this._parts.duplicateQueryParameters = !!v;
  40647. return this;
  40648. };
  40649. p.escapeQuerySpace = function(v) {
  40650. this._parts.escapeQuerySpace = !!v;
  40651. return this;
  40652. };
  40653. return URI;
  40654. }));
  40655. /***/ }),
  40656. /***/ "./node_modules/urijs/src/punycode.js":
  40657. /*!********************************************!*\
  40658. !*** ./node_modules/urijs/src/punycode.js ***!
  40659. \********************************************/
  40660. /*! no static exports found */
  40661. /***/ (function(module, exports, __webpack_require__) {
  40662. /* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.0 by @mathias */
  40663. ;(function(root) {
  40664. /** Detect free variables */
  40665. var freeExports = typeof exports == 'object' && exports &&
  40666. !exports.nodeType && exports;
  40667. var freeModule = typeof module == 'object' && module &&
  40668. !module.nodeType && module;
  40669. var freeGlobal = typeof global == 'object' && global;
  40670. if (
  40671. freeGlobal.global === freeGlobal ||
  40672. freeGlobal.window === freeGlobal ||
  40673. freeGlobal.self === freeGlobal
  40674. ) {
  40675. root = freeGlobal;
  40676. }
  40677. /**
  40678. * The `punycode` object.
  40679. * @name punycode
  40680. * @type Object
  40681. */
  40682. var punycode,
  40683. /** Highest positive signed 32-bit float value */
  40684. maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
  40685. /** Bootstring parameters */
  40686. base = 36,
  40687. tMin = 1,
  40688. tMax = 26,
  40689. skew = 38,
  40690. damp = 700,
  40691. initialBias = 72,
  40692. initialN = 128, // 0x80
  40693. delimiter = '-', // '\x2D'
  40694. /** Regular expressions */
  40695. regexPunycode = /^xn--/,
  40696. regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
  40697. regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
  40698. /** Error messages */
  40699. errors = {
  40700. 'overflow': 'Overflow: input needs wider integers to process',
  40701. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  40702. 'invalid-input': 'Invalid input'
  40703. },
  40704. /** Convenience shortcuts */
  40705. baseMinusTMin = base - tMin,
  40706. floor = Math.floor,
  40707. stringFromCharCode = String.fromCharCode,
  40708. /** Temporary variable */
  40709. key;
  40710. /*--------------------------------------------------------------------------*/
  40711. /**
  40712. * A generic error utility function.
  40713. * @private
  40714. * @param {String} type The error type.
  40715. * @returns {Error} Throws a `RangeError` with the applicable error message.
  40716. */
  40717. function error(type) {
  40718. throw new RangeError(errors[type]);
  40719. }
  40720. /**
  40721. * A generic `Array#map` utility function.
  40722. * @private
  40723. * @param {Array} array The array to iterate over.
  40724. * @param {Function} callback The function that gets called for every array
  40725. * item.
  40726. * @returns {Array} A new array of values returned by the callback function.
  40727. */
  40728. function map(array, fn) {
  40729. var length = array.length;
  40730. var result = [];
  40731. while (length--) {
  40732. result[length] = fn(array[length]);
  40733. }
  40734. return result;
  40735. }
  40736. /**
  40737. * A simple `Array#map`-like wrapper to work with domain name strings or email
  40738. * addresses.
  40739. * @private
  40740. * @param {String} domain The domain name or email address.
  40741. * @param {Function} callback The function that gets called for every
  40742. * character.
  40743. * @returns {Array} A new string of characters returned by the callback
  40744. * function.
  40745. */
  40746. function mapDomain(string, fn) {
  40747. var parts = string.split('@');
  40748. var result = '';
  40749. if (parts.length > 1) {
  40750. // In email addresses, only the domain name should be punycoded. Leave
  40751. // the local part (i.e. everything up to `@`) intact.
  40752. result = parts[0] + '@';
  40753. string = parts[1];
  40754. }
  40755. // Avoid `split(regex)` for IE8 compatibility. See #17.
  40756. string = string.replace(regexSeparators, '\x2E');
  40757. var labels = string.split('.');
  40758. var encoded = map(labels, fn).join('.');
  40759. return result + encoded;
  40760. }
  40761. /**
  40762. * Creates an array containing the numeric code points of each Unicode
  40763. * character in the string. While JavaScript uses UCS-2 internally,
  40764. * this function will convert a pair of surrogate halves (each of which
  40765. * UCS-2 exposes as separate characters) into a single code point,
  40766. * matching UTF-16.
  40767. * @see `punycode.ucs2.encode`
  40768. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  40769. * @memberOf punycode.ucs2
  40770. * @name decode
  40771. * @param {String} string The Unicode input string (UCS-2).
  40772. * @returns {Array} The new array of code points.
  40773. */
  40774. function ucs2decode(string) {
  40775. var output = [],
  40776. counter = 0,
  40777. length = string.length,
  40778. value,
  40779. extra;
  40780. while (counter < length) {
  40781. value = string.charCodeAt(counter++);
  40782. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  40783. // high surrogate, and there is a next character
  40784. extra = string.charCodeAt(counter++);
  40785. if ((extra & 0xFC00) == 0xDC00) { // low surrogate
  40786. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  40787. } else {
  40788. // unmatched surrogate; only append this code unit, in case the next
  40789. // code unit is the high surrogate of a surrogate pair
  40790. output.push(value);
  40791. counter--;
  40792. }
  40793. } else {
  40794. output.push(value);
  40795. }
  40796. }
  40797. return output;
  40798. }
  40799. /**
  40800. * Creates a string based on an array of numeric code points.
  40801. * @see `punycode.ucs2.decode`
  40802. * @memberOf punycode.ucs2
  40803. * @name encode
  40804. * @param {Array} codePoints The array of numeric code points.
  40805. * @returns {String} The new Unicode string (UCS-2).
  40806. */
  40807. function ucs2encode(array) {
  40808. return map(array, function(value) {
  40809. var output = '';
  40810. if (value > 0xFFFF) {
  40811. value -= 0x10000;
  40812. output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
  40813. value = 0xDC00 | value & 0x3FF;
  40814. }
  40815. output += stringFromCharCode(value);
  40816. return output;
  40817. }).join('');
  40818. }
  40819. /**
  40820. * Converts a basic code point into a digit/integer.
  40821. * @see `digitToBasic()`
  40822. * @private
  40823. * @param {Number} codePoint The basic numeric code point value.
  40824. * @returns {Number} The numeric value of a basic code point (for use in
  40825. * representing integers) in the range `0` to `base - 1`, or `base` if
  40826. * the code point does not represent a value.
  40827. */
  40828. function basicToDigit(codePoint) {
  40829. if (codePoint - 48 < 10) {
  40830. return codePoint - 22;
  40831. }
  40832. if (codePoint - 65 < 26) {
  40833. return codePoint - 65;
  40834. }
  40835. if (codePoint - 97 < 26) {
  40836. return codePoint - 97;
  40837. }
  40838. return base;
  40839. }
  40840. /**
  40841. * Converts a digit/integer into a basic code point.
  40842. * @see `basicToDigit()`
  40843. * @private
  40844. * @param {Number} digit The numeric value of a basic code point.
  40845. * @returns {Number} The basic code point whose value (when used for
  40846. * representing integers) is `digit`, which needs to be in the range
  40847. * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
  40848. * used; else, the lowercase form is used. The behavior is undefined
  40849. * if `flag` is non-zero and `digit` has no uppercase form.
  40850. */
  40851. function digitToBasic(digit, flag) {
  40852. // 0..25 map to ASCII a..z or A..Z
  40853. // 26..35 map to ASCII 0..9
  40854. return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
  40855. }
  40856. /**
  40857. * Bias adaptation function as per section 3.4 of RFC 3492.
  40858. * https://tools.ietf.org/html/rfc3492#section-3.4
  40859. * @private
  40860. */
  40861. function adapt(delta, numPoints, firstTime) {
  40862. var k = 0;
  40863. delta = firstTime ? floor(delta / damp) : delta >> 1;
  40864. delta += floor(delta / numPoints);
  40865. for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
  40866. delta = floor(delta / baseMinusTMin);
  40867. }
  40868. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  40869. }
  40870. /**
  40871. * Converts a Punycode string of ASCII-only symbols to a string of Unicode
  40872. * symbols.
  40873. * @memberOf punycode
  40874. * @param {String} input The Punycode string of ASCII-only symbols.
  40875. * @returns {String} The resulting string of Unicode symbols.
  40876. */
  40877. function decode(input) {
  40878. // Don't use UCS-2
  40879. var output = [],
  40880. inputLength = input.length,
  40881. out,
  40882. i = 0,
  40883. n = initialN,
  40884. bias = initialBias,
  40885. basic,
  40886. j,
  40887. index,
  40888. oldi,
  40889. w,
  40890. k,
  40891. digit,
  40892. t,
  40893. /** Cached calculation results */
  40894. baseMinusT;
  40895. // Handle the basic code points: let `basic` be the number of input code
  40896. // points before the last delimiter, or `0` if there is none, then copy
  40897. // the first basic code points to the output.
  40898. basic = input.lastIndexOf(delimiter);
  40899. if (basic < 0) {
  40900. basic = 0;
  40901. }
  40902. for (j = 0; j < basic; ++j) {
  40903. // if it's not a basic code point
  40904. if (input.charCodeAt(j) >= 0x80) {
  40905. error('not-basic');
  40906. }
  40907. output.push(input.charCodeAt(j));
  40908. }
  40909. // Main decoding loop: start just after the last delimiter if any basic code
  40910. // points were copied; start at the beginning otherwise.
  40911. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
  40912. // `index` is the index of the next character to be consumed.
  40913. // Decode a generalized variable-length integer into `delta`,
  40914. // which gets added to `i`. The overflow checking is easier
  40915. // if we increase `i` as we go, then subtract off its starting
  40916. // value at the end to obtain `delta`.
  40917. for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
  40918. if (index >= inputLength) {
  40919. error('invalid-input');
  40920. }
  40921. digit = basicToDigit(input.charCodeAt(index++));
  40922. if (digit >= base || digit > floor((maxInt - i) / w)) {
  40923. error('overflow');
  40924. }
  40925. i += digit * w;
  40926. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  40927. if (digit < t) {
  40928. break;
  40929. }
  40930. baseMinusT = base - t;
  40931. if (w > floor(maxInt / baseMinusT)) {
  40932. error('overflow');
  40933. }
  40934. w *= baseMinusT;
  40935. }
  40936. out = output.length + 1;
  40937. bias = adapt(i - oldi, out, oldi == 0);
  40938. // `i` was supposed to wrap around from `out` to `0`,
  40939. // incrementing `n` each time, so we'll fix that now:
  40940. if (floor(i / out) > maxInt - n) {
  40941. error('overflow');
  40942. }
  40943. n += floor(i / out);
  40944. i %= out;
  40945. // Insert `n` at position `i` of the output
  40946. output.splice(i++, 0, n);
  40947. }
  40948. return ucs2encode(output);
  40949. }
  40950. /**
  40951. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  40952. * Punycode string of ASCII-only symbols.
  40953. * @memberOf punycode
  40954. * @param {String} input The string of Unicode symbols.
  40955. * @returns {String} The resulting Punycode string of ASCII-only symbols.
  40956. */
  40957. function encode(input) {
  40958. var n,
  40959. delta,
  40960. handledCPCount,
  40961. basicLength,
  40962. bias,
  40963. j,
  40964. m,
  40965. q,
  40966. k,
  40967. t,
  40968. currentValue,
  40969. output = [],
  40970. /** `inputLength` will hold the number of code points in `input`. */
  40971. inputLength,
  40972. /** Cached calculation results */
  40973. handledCPCountPlusOne,
  40974. baseMinusT,
  40975. qMinusT;
  40976. // Convert the input in UCS-2 to Unicode
  40977. input = ucs2decode(input);
  40978. // Cache the length
  40979. inputLength = input.length;
  40980. // Initialize the state
  40981. n = initialN;
  40982. delta = 0;
  40983. bias = initialBias;
  40984. // Handle the basic code points
  40985. for (j = 0; j < inputLength; ++j) {
  40986. currentValue = input[j];
  40987. if (currentValue < 0x80) {
  40988. output.push(stringFromCharCode(currentValue));
  40989. }
  40990. }
  40991. handledCPCount = basicLength = output.length;
  40992. // `handledCPCount` is the number of code points that have been handled;
  40993. // `basicLength` is the number of basic code points.
  40994. // Finish the basic string - if it is not empty - with a delimiter
  40995. if (basicLength) {
  40996. output.push(delimiter);
  40997. }
  40998. // Main encoding loop:
  40999. while (handledCPCount < inputLength) {
  41000. // All non-basic code points < n have been handled already. Find the next
  41001. // larger one:
  41002. for (m = maxInt, j = 0; j < inputLength; ++j) {
  41003. currentValue = input[j];
  41004. if (currentValue >= n && currentValue < m) {
  41005. m = currentValue;
  41006. }
  41007. }
  41008. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
  41009. // but guard against overflow
  41010. handledCPCountPlusOne = handledCPCount + 1;
  41011. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  41012. error('overflow');
  41013. }
  41014. delta += (m - n) * handledCPCountPlusOne;
  41015. n = m;
  41016. for (j = 0; j < inputLength; ++j) {
  41017. currentValue = input[j];
  41018. if (currentValue < n && ++delta > maxInt) {
  41019. error('overflow');
  41020. }
  41021. if (currentValue == n) {
  41022. // Represent delta as a generalized variable-length integer
  41023. for (q = delta, k = base; /* no condition */; k += base) {
  41024. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  41025. if (q < t) {
  41026. break;
  41027. }
  41028. qMinusT = q - t;
  41029. baseMinusT = base - t;
  41030. output.push(
  41031. stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
  41032. );
  41033. q = floor(qMinusT / baseMinusT);
  41034. }
  41035. output.push(stringFromCharCode(digitToBasic(q, 0)));
  41036. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  41037. delta = 0;
  41038. ++handledCPCount;
  41039. }
  41040. }
  41041. ++delta;
  41042. ++n;
  41043. }
  41044. return output.join('');
  41045. }
  41046. /**
  41047. * Converts a Punycode string representing a domain name or an email address
  41048. * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
  41049. * it doesn't matter if you call it on a string that has already been
  41050. * converted to Unicode.
  41051. * @memberOf punycode
  41052. * @param {String} input The Punycoded domain name or email address to
  41053. * convert to Unicode.
  41054. * @returns {String} The Unicode representation of the given Punycode
  41055. * string.
  41056. */
  41057. function toUnicode(input) {
  41058. return mapDomain(input, function(string) {
  41059. return regexPunycode.test(string)
  41060. ? decode(string.slice(4).toLowerCase())
  41061. : string;
  41062. });
  41063. }
  41064. /**
  41065. * Converts a Unicode string representing a domain name or an email address to
  41066. * Punycode. Only the non-ASCII parts of the domain name will be converted,
  41067. * i.e. it doesn't matter if you call it with a domain that's already in
  41068. * ASCII.
  41069. * @memberOf punycode
  41070. * @param {String} input The domain name or email address to convert, as a
  41071. * Unicode string.
  41072. * @returns {String} The Punycode representation of the given domain name or
  41073. * email address.
  41074. */
  41075. function toASCII(input) {
  41076. return mapDomain(input, function(string) {
  41077. return regexNonASCII.test(string)
  41078. ? 'xn--' + encode(string)
  41079. : string;
  41080. });
  41081. }
  41082. /*--------------------------------------------------------------------------*/
  41083. /** Define the public API */
  41084. punycode = {
  41085. /**
  41086. * A string representing the current Punycode.js version number.
  41087. * @memberOf punycode
  41088. * @type String
  41089. */
  41090. 'version': '1.3.2',
  41091. /**
  41092. * An object of methods to convert from JavaScript's internal character
  41093. * representation (UCS-2) to Unicode code points, and back.
  41094. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  41095. * @memberOf punycode
  41096. * @type Object
  41097. */
  41098. 'ucs2': {
  41099. 'decode': ucs2decode,
  41100. 'encode': ucs2encode
  41101. },
  41102. 'decode': decode,
  41103. 'encode': encode,
  41104. 'toASCII': toASCII,
  41105. 'toUnicode': toUnicode
  41106. };
  41107. /** Expose `punycode` */
  41108. // Some AMD build optimizers, like r.js, check for specific condition patterns
  41109. // like the following:
  41110. if (
  41111. true
  41112. ) {
  41113. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  41114. return punycode;
  41115. }).call(exports, __webpack_require__, exports, module),
  41116. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  41117. } else {}
  41118. }(this));
  41119. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module), __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  41120. /***/ }),
  41121. /***/ "./node_modules/webpack/buildin/global.js":
  41122. /*!***********************************!*\
  41123. !*** (webpack)/buildin/global.js ***!
  41124. \***********************************/
  41125. /*! no static exports found */
  41126. /***/ (function(module, exports) {
  41127. var g;
  41128. // This works in non-strict mode
  41129. g = (function() {
  41130. return this;
  41131. })();
  41132. try {
  41133. // This works if eval is allowed (see CSP)
  41134. g = g || Function("return this")() || (1, eval)("this");
  41135. } catch (e) {
  41136. // This works if the window reference is available
  41137. if (typeof window === "object") g = window;
  41138. }
  41139. // g can still be undefined, but nothing to do about it...
  41140. // We return undefined, instead of nothing here, so it's
  41141. // easier to handle this case. if(!global) { ...}
  41142. module.exports = g;
  41143. /***/ }),
  41144. /***/ "./node_modules/webpack/buildin/module.js":
  41145. /*!***********************************!*\
  41146. !*** (webpack)/buildin/module.js ***!
  41147. \***********************************/
  41148. /*! no static exports found */
  41149. /***/ (function(module, exports) {
  41150. module.exports = function(module) {
  41151. if (!module.webpackPolyfill) {
  41152. module.deprecate = function() {};
  41153. module.paths = [];
  41154. // module.parent = undefined by default
  41155. if (!module.children) module.children = [];
  41156. Object.defineProperty(module, "loaded", {
  41157. enumerable: true,
  41158. get: function() {
  41159. return module.l;
  41160. }
  41161. });
  41162. Object.defineProperty(module, "id", {
  41163. enumerable: true,
  41164. get: function() {
  41165. return module.i;
  41166. }
  41167. });
  41168. module.webpackPolyfill = 1;
  41169. }
  41170. return module;
  41171. };
  41172. /***/ }),
  41173. /***/ "./node_modules/xss/dist/xss.js":
  41174. /*!**************************************!*\
  41175. !*** ./node_modules/xss/dist/xss.js ***!
  41176. \**************************************/
  41177. /*! no static exports found */
  41178. /***/ (function(module, exports, __webpack_require__) {
  41179. var require;var require;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(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 require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  41180. /**
  41181. * default settings
  41182. *
  41183. * @author Zongmin Lei<leizongmin@gmail.com>
  41184. */
  41185. var FilterCSS = require("cssfilter").FilterCSS;
  41186. var getDefaultCSSWhiteList = require("cssfilter").getDefaultWhiteList;
  41187. var _ = require("./util");
  41188. function getDefaultWhiteList() {
  41189. return {
  41190. a: ["target", "href", "title"],
  41191. abbr: ["title"],
  41192. address: [],
  41193. area: ["shape", "coords", "href", "alt"],
  41194. article: [],
  41195. aside: [],
  41196. audio: ["autoplay", "controls", "loop", "preload", "src"],
  41197. b: [],
  41198. bdi: ["dir"],
  41199. bdo: ["dir"],
  41200. big: [],
  41201. blockquote: ["cite"],
  41202. br: [],
  41203. caption: [],
  41204. center: [],
  41205. cite: [],
  41206. code: [],
  41207. col: ["align", "valign", "span", "width"],
  41208. colgroup: ["align", "valign", "span", "width"],
  41209. dd: [],
  41210. del: ["datetime"],
  41211. details: ["open"],
  41212. div: [],
  41213. dl: [],
  41214. dt: [],
  41215. em: [],
  41216. font: ["color", "size", "face"],
  41217. footer: [],
  41218. h1: [],
  41219. h2: [],
  41220. h3: [],
  41221. h4: [],
  41222. h5: [],
  41223. h6: [],
  41224. header: [],
  41225. hr: [],
  41226. i: [],
  41227. img: ["src", "alt", "title", "width", "height"],
  41228. ins: ["datetime"],
  41229. li: [],
  41230. mark: [],
  41231. nav: [],
  41232. ol: [],
  41233. p: [],
  41234. pre: [],
  41235. s: [],
  41236. section: [],
  41237. small: [],
  41238. span: [],
  41239. sub: [],
  41240. sup: [],
  41241. strong: [],
  41242. table: ["width", "border", "align", "valign"],
  41243. tbody: ["align", "valign"],
  41244. td: ["width", "rowspan", "colspan", "align", "valign"],
  41245. tfoot: ["align", "valign"],
  41246. th: ["width", "rowspan", "colspan", "align", "valign"],
  41247. thead: ["align", "valign"],
  41248. tr: ["rowspan", "align", "valign"],
  41249. tt: [],
  41250. u: [],
  41251. ul: [],
  41252. video: ["autoplay", "controls", "loop", "preload", "src", "height", "width"]
  41253. };
  41254. }
  41255. var defaultCSSFilter = new FilterCSS();
  41256. /**
  41257. * default onTag function
  41258. *
  41259. * @param {String} tag
  41260. * @param {String} html
  41261. * @param {Object} options
  41262. * @return {String}
  41263. */
  41264. function onTag(tag, html, options) {
  41265. // do nothing
  41266. }
  41267. /**
  41268. * default onIgnoreTag function
  41269. *
  41270. * @param {String} tag
  41271. * @param {String} html
  41272. * @param {Object} options
  41273. * @return {String}
  41274. */
  41275. function onIgnoreTag(tag, html, options) {
  41276. // do nothing
  41277. }
  41278. /**
  41279. * default onTagAttr function
  41280. *
  41281. * @param {String} tag
  41282. * @param {String} name
  41283. * @param {String} value
  41284. * @return {String}
  41285. */
  41286. function onTagAttr(tag, name, value) {
  41287. // do nothing
  41288. }
  41289. /**
  41290. * default onIgnoreTagAttr function
  41291. *
  41292. * @param {String} tag
  41293. * @param {String} name
  41294. * @param {String} value
  41295. * @return {String}
  41296. */
  41297. function onIgnoreTagAttr(tag, name, value) {
  41298. // do nothing
  41299. }
  41300. /**
  41301. * default escapeHtml function
  41302. *
  41303. * @param {String} html
  41304. */
  41305. function escapeHtml(html) {
  41306. return html.replace(REGEXP_LT, "&lt;").replace(REGEXP_GT, "&gt;");
  41307. }
  41308. /**
  41309. * default safeAttrValue function
  41310. *
  41311. * @param {String} tag
  41312. * @param {String} name
  41313. * @param {String} value
  41314. * @param {Object} cssFilter
  41315. * @return {String}
  41316. */
  41317. function safeAttrValue(tag, name, value, cssFilter) {
  41318. // unescape attribute value firstly
  41319. value = friendlyAttrValue(value);
  41320. if (name === "href" || name === "src") {
  41321. // filter `href` and `src` attribute
  41322. // only allow the value that starts with `http://` | `https://` | `mailto:` | `/` | `#`
  41323. value = _.trim(value);
  41324. if (value === "#") return "#";
  41325. if (
  41326. !(
  41327. value.substr(0, 7) === "http://" ||
  41328. value.substr(0, 8) === "https://" ||
  41329. value.substr(0, 7) === "mailto:" ||
  41330. value.substr(0, 4) === "tel:" ||
  41331. value[0] === "#" ||
  41332. value[0] === "/"
  41333. )
  41334. ) {
  41335. return "";
  41336. }
  41337. } else if (name === "background") {
  41338. // filter `background` attribute (maybe no use)
  41339. // `javascript:`
  41340. REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
  41341. if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {
  41342. return "";
  41343. }
  41344. } else if (name === "style") {
  41345. // `expression()`
  41346. REGEXP_DEFAULT_ON_TAG_ATTR_7.lastIndex = 0;
  41347. if (REGEXP_DEFAULT_ON_TAG_ATTR_7.test(value)) {
  41348. return "";
  41349. }
  41350. // `url()`
  41351. REGEXP_DEFAULT_ON_TAG_ATTR_8.lastIndex = 0;
  41352. if (REGEXP_DEFAULT_ON_TAG_ATTR_8.test(value)) {
  41353. REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
  41354. if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {
  41355. return "";
  41356. }
  41357. }
  41358. if (cssFilter !== false) {
  41359. cssFilter = cssFilter || defaultCSSFilter;
  41360. value = cssFilter.process(value);
  41361. }
  41362. }
  41363. // escape `<>"` before returns
  41364. value = escapeAttrValue(value);
  41365. return value;
  41366. }
  41367. // RegExp list
  41368. var REGEXP_LT = /</g;
  41369. var REGEXP_GT = />/g;
  41370. var REGEXP_QUOTE = /"/g;
  41371. var REGEXP_QUOTE_2 = /&quot;/g;
  41372. var REGEXP_ATTR_VALUE_1 = /&#([a-zA-Z0-9]*);?/gim;
  41373. var REGEXP_ATTR_VALUE_COLON = /&colon;?/gim;
  41374. var REGEXP_ATTR_VALUE_NEWLINE = /&newline;?/gim;
  41375. var REGEXP_DEFAULT_ON_TAG_ATTR_3 = /\/\*|\*\//gm;
  41376. var REGEXP_DEFAULT_ON_TAG_ATTR_4 = /((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi;
  41377. var REGEXP_DEFAULT_ON_TAG_ATTR_5 = /^[\s"'`]*(d\s*a\s*t\s*a\s*)\:/gi;
  41378. var REGEXP_DEFAULT_ON_TAG_ATTR_6 = /^[\s"'`]*(d\s*a\s*t\s*a\s*)\:\s*image\//gi;
  41379. var REGEXP_DEFAULT_ON_TAG_ATTR_7 = /e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi;
  41380. var REGEXP_DEFAULT_ON_TAG_ATTR_8 = /u\s*r\s*l\s*\(.*/gi;
  41381. /**
  41382. * escape doube quote
  41383. *
  41384. * @param {String} str
  41385. * @return {String} str
  41386. */
  41387. function escapeQuote(str) {
  41388. return str.replace(REGEXP_QUOTE, "&quot;");
  41389. }
  41390. /**
  41391. * unescape double quote
  41392. *
  41393. * @param {String} str
  41394. * @return {String} str
  41395. */
  41396. function unescapeQuote(str) {
  41397. return str.replace(REGEXP_QUOTE_2, '"');
  41398. }
  41399. /**
  41400. * escape html entities
  41401. *
  41402. * @param {String} str
  41403. * @return {String}
  41404. */
  41405. function escapeHtmlEntities(str) {
  41406. return str.replace(REGEXP_ATTR_VALUE_1, function replaceUnicode(str, code) {
  41407. return code[0] === "x" || code[0] === "X"
  41408. ? String.fromCharCode(parseInt(code.substr(1), 16))
  41409. : String.fromCharCode(parseInt(code, 10));
  41410. });
  41411. }
  41412. /**
  41413. * escape html5 new danger entities
  41414. *
  41415. * @param {String} str
  41416. * @return {String}
  41417. */
  41418. function escapeDangerHtml5Entities(str) {
  41419. return str
  41420. .replace(REGEXP_ATTR_VALUE_COLON, ":")
  41421. .replace(REGEXP_ATTR_VALUE_NEWLINE, " ");
  41422. }
  41423. /**
  41424. * clear nonprintable characters
  41425. *
  41426. * @param {String} str
  41427. * @return {String}
  41428. */
  41429. function clearNonPrintableCharacter(str) {
  41430. var str2 = "";
  41431. for (var i = 0, len = str.length; i < len; i++) {
  41432. str2 += str.charCodeAt(i) < 32 ? " " : str.charAt(i);
  41433. }
  41434. return _.trim(str2);
  41435. }
  41436. /**
  41437. * get friendly attribute value
  41438. *
  41439. * @param {String} str
  41440. * @return {String}
  41441. */
  41442. function friendlyAttrValue(str) {
  41443. str = unescapeQuote(str);
  41444. str = escapeHtmlEntities(str);
  41445. str = escapeDangerHtml5Entities(str);
  41446. str = clearNonPrintableCharacter(str);
  41447. return str;
  41448. }
  41449. /**
  41450. * unescape attribute value
  41451. *
  41452. * @param {String} str
  41453. * @return {String}
  41454. */
  41455. function escapeAttrValue(str) {
  41456. str = escapeQuote(str);
  41457. str = escapeHtml(str);
  41458. return str;
  41459. }
  41460. /**
  41461. * `onIgnoreTag` function for removing all the tags that are not in whitelist
  41462. */
  41463. function onIgnoreTagStripAll() {
  41464. return "";
  41465. }
  41466. /**
  41467. * remove tag body
  41468. * specify a `tags` list, if the tag is not in the `tags` list then process by the specify function (optional)
  41469. *
  41470. * @param {array} tags
  41471. * @param {function} next
  41472. */
  41473. function StripTagBody(tags, next) {
  41474. if (typeof next !== "function") {
  41475. next = function() {};
  41476. }
  41477. var isRemoveAllTag = !Array.isArray(tags);
  41478. function isRemoveTag(tag) {
  41479. if (isRemoveAllTag) return true;
  41480. return _.indexOf(tags, tag) !== -1;
  41481. }
  41482. var removeList = [];
  41483. var posStart = false;
  41484. return {
  41485. onIgnoreTag: function(tag, html, options) {
  41486. if (isRemoveTag(tag)) {
  41487. if (options.isClosing) {
  41488. var ret = "[/removed]";
  41489. var end = options.position + ret.length;
  41490. removeList.push([
  41491. posStart !== false ? posStart : options.position,
  41492. end
  41493. ]);
  41494. posStart = false;
  41495. return ret;
  41496. } else {
  41497. if (!posStart) {
  41498. posStart = options.position;
  41499. }
  41500. return "[removed]";
  41501. }
  41502. } else {
  41503. return next(tag, html, options);
  41504. }
  41505. },
  41506. remove: function(html) {
  41507. var rethtml = "";
  41508. var lastPos = 0;
  41509. _.forEach(removeList, function(pos) {
  41510. rethtml += html.slice(lastPos, pos[0]);
  41511. lastPos = pos[1];
  41512. });
  41513. rethtml += html.slice(lastPos);
  41514. return rethtml;
  41515. }
  41516. };
  41517. }
  41518. /**
  41519. * remove html comments
  41520. *
  41521. * @param {String} html
  41522. * @return {String}
  41523. */
  41524. function stripCommentTag(html) {
  41525. return html.replace(STRIP_COMMENT_TAG_REGEXP, "");
  41526. }
  41527. var STRIP_COMMENT_TAG_REGEXP = /<!--[\s\S]*?-->/g;
  41528. /**
  41529. * remove invisible characters
  41530. *
  41531. * @param {String} html
  41532. * @return {String}
  41533. */
  41534. function stripBlankChar(html) {
  41535. var chars = html.split("");
  41536. chars = chars.filter(function(char) {
  41537. var c = char.charCodeAt(0);
  41538. if (c === 127) return false;
  41539. if (c <= 31) {
  41540. if (c === 10 || c === 13) return true;
  41541. return false;
  41542. }
  41543. return true;
  41544. });
  41545. return chars.join("");
  41546. }
  41547. exports.whiteList = getDefaultWhiteList();
  41548. exports.getDefaultWhiteList = getDefaultWhiteList;
  41549. exports.onTag = onTag;
  41550. exports.onIgnoreTag = onIgnoreTag;
  41551. exports.onTagAttr = onTagAttr;
  41552. exports.onIgnoreTagAttr = onIgnoreTagAttr;
  41553. exports.safeAttrValue = safeAttrValue;
  41554. exports.escapeHtml = escapeHtml;
  41555. exports.escapeQuote = escapeQuote;
  41556. exports.unescapeQuote = unescapeQuote;
  41557. exports.escapeHtmlEntities = escapeHtmlEntities;
  41558. exports.escapeDangerHtml5Entities = escapeDangerHtml5Entities;
  41559. exports.clearNonPrintableCharacter = clearNonPrintableCharacter;
  41560. exports.friendlyAttrValue = friendlyAttrValue;
  41561. exports.escapeAttrValue = escapeAttrValue;
  41562. exports.onIgnoreTagStripAll = onIgnoreTagStripAll;
  41563. exports.StripTagBody = StripTagBody;
  41564. exports.stripCommentTag = stripCommentTag;
  41565. exports.stripBlankChar = stripBlankChar;
  41566. exports.cssFilter = defaultCSSFilter;
  41567. exports.getDefaultCSSWhiteList = getDefaultCSSWhiteList;
  41568. },{"./util":4,"cssfilter":8}],2:[function(require,module,exports){
  41569. /**
  41570. * xss
  41571. *
  41572. * @author Zongmin Lei<leizongmin@gmail.com>
  41573. */
  41574. var DEFAULT = require("./default");
  41575. var parser = require("./parser");
  41576. var FilterXSS = require("./xss");
  41577. /**
  41578. * filter xss function
  41579. *
  41580. * @param {String} html
  41581. * @param {Object} options { whiteList, onTag, onTagAttr, onIgnoreTag, onIgnoreTagAttr, safeAttrValue, escapeHtml }
  41582. * @return {String}
  41583. */
  41584. function filterXSS(html, options) {
  41585. var xss = new FilterXSS(options);
  41586. return xss.process(html);
  41587. }
  41588. exports = module.exports = filterXSS;
  41589. exports.FilterXSS = FilterXSS;
  41590. for (var i in DEFAULT) exports[i] = DEFAULT[i];
  41591. for (var i in parser) exports[i] = parser[i];
  41592. // using `xss` on the browser, output `filterXSS` to the globals
  41593. if (typeof window !== "undefined") {
  41594. window.filterXSS = module.exports;
  41595. }
  41596. },{"./default":1,"./parser":3,"./xss":5}],3:[function(require,module,exports){
  41597. /**
  41598. * Simple HTML Parser
  41599. *
  41600. * @author Zongmin Lei<leizongmin@gmail.com>
  41601. */
  41602. var _ = require("./util");
  41603. /**
  41604. * get tag name
  41605. *
  41606. * @param {String} html e.g. '<a hef="#">'
  41607. * @return {String}
  41608. */
  41609. function getTagName(html) {
  41610. var i = _.spaceIndex(html);
  41611. if (i === -1) {
  41612. var tagName = html.slice(1, -1);
  41613. } else {
  41614. var tagName = html.slice(1, i + 1);
  41615. }
  41616. tagName = _.trim(tagName).toLowerCase();
  41617. if (tagName.slice(0, 1) === "/") tagName = tagName.slice(1);
  41618. if (tagName.slice(-1) === "/") tagName = tagName.slice(0, -1);
  41619. return tagName;
  41620. }
  41621. /**
  41622. * is close tag?
  41623. *
  41624. * @param {String} html 如:'<a hef="#">'
  41625. * @return {Boolean}
  41626. */
  41627. function isClosing(html) {
  41628. return html.slice(0, 2) === "</";
  41629. }
  41630. /**
  41631. * parse input html and returns processed html
  41632. *
  41633. * @param {String} html
  41634. * @param {Function} onTag e.g. function (sourcePosition, position, tag, html, isClosing)
  41635. * @param {Function} escapeHtml
  41636. * @return {String}
  41637. */
  41638. function parseTag(html, onTag, escapeHtml) {
  41639. "user strict";
  41640. var rethtml = "";
  41641. var lastPos = 0;
  41642. var tagStart = false;
  41643. var quoteStart = false;
  41644. var currentPos = 0;
  41645. var len = html.length;
  41646. var currentTagName = "";
  41647. var currentHtml = "";
  41648. for (currentPos = 0; currentPos < len; currentPos++) {
  41649. var c = html.charAt(currentPos);
  41650. if (tagStart === false) {
  41651. if (c === "<") {
  41652. tagStart = currentPos;
  41653. continue;
  41654. }
  41655. } else {
  41656. if (quoteStart === false) {
  41657. if (c === "<") {
  41658. rethtml += escapeHtml(html.slice(lastPos, currentPos));
  41659. tagStart = currentPos;
  41660. lastPos = currentPos;
  41661. continue;
  41662. }
  41663. if (c === ">") {
  41664. rethtml += escapeHtml(html.slice(lastPos, tagStart));
  41665. currentHtml = html.slice(tagStart, currentPos + 1);
  41666. currentTagName = getTagName(currentHtml);
  41667. rethtml += onTag(
  41668. tagStart,
  41669. rethtml.length,
  41670. currentTagName,
  41671. currentHtml,
  41672. isClosing(currentHtml)
  41673. );
  41674. lastPos = currentPos + 1;
  41675. tagStart = false;
  41676. continue;
  41677. }
  41678. if ((c === '"' || c === "'") && html.charAt(currentPos - 1) === "=") {
  41679. quoteStart = c;
  41680. continue;
  41681. }
  41682. } else {
  41683. if (c === quoteStart) {
  41684. quoteStart = false;
  41685. continue;
  41686. }
  41687. }
  41688. }
  41689. }
  41690. if (lastPos < html.length) {
  41691. rethtml += escapeHtml(html.substr(lastPos));
  41692. }
  41693. return rethtml;
  41694. }
  41695. var REGEXP_ILLEGAL_ATTR_NAME = /[^a-zA-Z0-9_:\.\-]/gim;
  41696. /**
  41697. * parse input attributes and returns processed attributes
  41698. *
  41699. * @param {String} html e.g. `href="#" target="_blank"`
  41700. * @param {Function} onAttr e.g. `function (name, value)`
  41701. * @return {String}
  41702. */
  41703. function parseAttr(html, onAttr) {
  41704. "user strict";
  41705. var lastPos = 0;
  41706. var retAttrs = [];
  41707. var tmpName = false;
  41708. var len = html.length;
  41709. function addAttr(name, value) {
  41710. name = _.trim(name);
  41711. name = name.replace(REGEXP_ILLEGAL_ATTR_NAME, "").toLowerCase();
  41712. if (name.length < 1) return;
  41713. var ret = onAttr(name, value || "");
  41714. if (ret) retAttrs.push(ret);
  41715. }
  41716. // 逐个分析字符
  41717. for (var i = 0; i < len; i++) {
  41718. var c = html.charAt(i);
  41719. var v, j;
  41720. if (tmpName === false && c === "=") {
  41721. tmpName = html.slice(lastPos, i);
  41722. lastPos = i + 1;
  41723. continue;
  41724. }
  41725. if (tmpName !== false) {
  41726. if (
  41727. i === lastPos &&
  41728. (c === '"' || c === "'") &&
  41729. html.charAt(i - 1) === "="
  41730. ) {
  41731. j = html.indexOf(c, i + 1);
  41732. if (j === -1) {
  41733. break;
  41734. } else {
  41735. v = _.trim(html.slice(lastPos + 1, j));
  41736. addAttr(tmpName, v);
  41737. tmpName = false;
  41738. i = j;
  41739. lastPos = i + 1;
  41740. continue;
  41741. }
  41742. }
  41743. }
  41744. if (/\s|\n|\t/.test(c)) {
  41745. html = html.replace(/\s|\n|\t/g, " ");
  41746. if (tmpName === false) {
  41747. j = findNextEqual(html, i);
  41748. if (j === -1) {
  41749. v = _.trim(html.slice(lastPos, i));
  41750. addAttr(v);
  41751. tmpName = false;
  41752. lastPos = i + 1;
  41753. continue;
  41754. } else {
  41755. i = j - 1;
  41756. continue;
  41757. }
  41758. } else {
  41759. j = findBeforeEqual(html, i - 1);
  41760. if (j === -1) {
  41761. v = _.trim(html.slice(lastPos, i));
  41762. v = stripQuoteWrap(v);
  41763. addAttr(tmpName, v);
  41764. tmpName = false;
  41765. lastPos = i + 1;
  41766. continue;
  41767. } else {
  41768. continue;
  41769. }
  41770. }
  41771. }
  41772. }
  41773. if (lastPos < html.length) {
  41774. if (tmpName === false) {
  41775. addAttr(html.slice(lastPos));
  41776. } else {
  41777. addAttr(tmpName, stripQuoteWrap(_.trim(html.slice(lastPos))));
  41778. }
  41779. }
  41780. return _.trim(retAttrs.join(" "));
  41781. }
  41782. function findNextEqual(str, i) {
  41783. for (; i < str.length; i++) {
  41784. var c = str[i];
  41785. if (c === " ") continue;
  41786. if (c === "=") return i;
  41787. return -1;
  41788. }
  41789. }
  41790. function findBeforeEqual(str, i) {
  41791. for (; i > 0; i--) {
  41792. var c = str[i];
  41793. if (c === " ") continue;
  41794. if (c === "=") return i;
  41795. return -1;
  41796. }
  41797. }
  41798. function isQuoteWrapString(text) {
  41799. if (
  41800. (text[0] === '"' && text[text.length - 1] === '"') ||
  41801. (text[0] === "'" && text[text.length - 1] === "'")
  41802. ) {
  41803. return true;
  41804. } else {
  41805. return false;
  41806. }
  41807. }
  41808. function stripQuoteWrap(text) {
  41809. if (isQuoteWrapString(text)) {
  41810. return text.substr(1, text.length - 2);
  41811. } else {
  41812. return text;
  41813. }
  41814. }
  41815. exports.parseTag = parseTag;
  41816. exports.parseAttr = parseAttr;
  41817. },{"./util":4}],4:[function(require,module,exports){
  41818. module.exports = {
  41819. indexOf: function(arr, item) {
  41820. var i, j;
  41821. if (Array.prototype.indexOf) {
  41822. return arr.indexOf(item);
  41823. }
  41824. for (i = 0, j = arr.length; i < j; i++) {
  41825. if (arr[i] === item) {
  41826. return i;
  41827. }
  41828. }
  41829. return -1;
  41830. },
  41831. forEach: function(arr, fn, scope) {
  41832. var i, j;
  41833. if (Array.prototype.forEach) {
  41834. return arr.forEach(fn, scope);
  41835. }
  41836. for (i = 0, j = arr.length; i < j; i++) {
  41837. fn.call(scope, arr[i], i, arr);
  41838. }
  41839. },
  41840. trim: function(str) {
  41841. if (String.prototype.trim) {
  41842. return str.trim();
  41843. }
  41844. return str.replace(/(^\s*)|(\s*$)/g, "");
  41845. },
  41846. spaceIndex: function(str) {
  41847. var reg = /\s|\n|\t/;
  41848. var match = reg.exec(str);
  41849. return match ? match.index : -1;
  41850. }
  41851. };
  41852. },{}],5:[function(require,module,exports){
  41853. /**
  41854. * filter xss
  41855. *
  41856. * @author Zongmin Lei<leizongmin@gmail.com>
  41857. */
  41858. var FilterCSS = require("cssfilter").FilterCSS;
  41859. var DEFAULT = require("./default");
  41860. var parser = require("./parser");
  41861. var parseTag = parser.parseTag;
  41862. var parseAttr = parser.parseAttr;
  41863. var _ = require("./util");
  41864. /**
  41865. * returns `true` if the input value is `undefined` or `null`
  41866. *
  41867. * @param {Object} obj
  41868. * @return {Boolean}
  41869. */
  41870. function isNull(obj) {
  41871. return obj === undefined || obj === null;
  41872. }
  41873. /**
  41874. * get attributes for a tag
  41875. *
  41876. * @param {String} html
  41877. * @return {Object}
  41878. * - {String} html
  41879. * - {Boolean} closing
  41880. */
  41881. function getAttrs(html) {
  41882. var i = _.spaceIndex(html);
  41883. if (i === -1) {
  41884. return {
  41885. html: "",
  41886. closing: html[html.length - 2] === "/"
  41887. };
  41888. }
  41889. html = _.trim(html.slice(i + 1, -1));
  41890. var isClosing = html[html.length - 1] === "/";
  41891. if (isClosing) html = _.trim(html.slice(0, -1));
  41892. return {
  41893. html: html,
  41894. closing: isClosing
  41895. };
  41896. }
  41897. /**
  41898. * shallow copy
  41899. *
  41900. * @param {Object} obj
  41901. * @return {Object}
  41902. */
  41903. function shallowCopyObject(obj) {
  41904. var ret = {};
  41905. for (var i in obj) {
  41906. ret[i] = obj[i];
  41907. }
  41908. return ret;
  41909. }
  41910. /**
  41911. * FilterXSS class
  41912. *
  41913. * @param {Object} options
  41914. * whiteList, onTag, onTagAttr, onIgnoreTag,
  41915. * onIgnoreTagAttr, safeAttrValue, escapeHtml
  41916. * stripIgnoreTagBody, allowCommentTag, stripBlankChar
  41917. * css{whiteList, onAttr, onIgnoreAttr} `css=false` means don't use `cssfilter`
  41918. */
  41919. function FilterXSS(options) {
  41920. options = shallowCopyObject(options || {});
  41921. if (options.stripIgnoreTag) {
  41922. if (options.onIgnoreTag) {
  41923. console.error(
  41924. 'Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'
  41925. );
  41926. }
  41927. options.onIgnoreTag = DEFAULT.onIgnoreTagStripAll;
  41928. }
  41929. options.whiteList = options.whiteList || DEFAULT.whiteList;
  41930. options.onTag = options.onTag || DEFAULT.onTag;
  41931. options.onTagAttr = options.onTagAttr || DEFAULT.onTagAttr;
  41932. options.onIgnoreTag = options.onIgnoreTag || DEFAULT.onIgnoreTag;
  41933. options.onIgnoreTagAttr = options.onIgnoreTagAttr || DEFAULT.onIgnoreTagAttr;
  41934. options.safeAttrValue = options.safeAttrValue || DEFAULT.safeAttrValue;
  41935. options.escapeHtml = options.escapeHtml || DEFAULT.escapeHtml;
  41936. this.options = options;
  41937. if (options.css === false) {
  41938. this.cssFilter = false;
  41939. } else {
  41940. options.css = options.css || {};
  41941. this.cssFilter = new FilterCSS(options.css);
  41942. }
  41943. }
  41944. /**
  41945. * start process and returns result
  41946. *
  41947. * @param {String} html
  41948. * @return {String}
  41949. */
  41950. FilterXSS.prototype.process = function(html) {
  41951. // compatible with the input
  41952. html = html || "";
  41953. html = html.toString();
  41954. if (!html) return "";
  41955. var me = this;
  41956. var options = me.options;
  41957. var whiteList = options.whiteList;
  41958. var onTag = options.onTag;
  41959. var onIgnoreTag = options.onIgnoreTag;
  41960. var onTagAttr = options.onTagAttr;
  41961. var onIgnoreTagAttr = options.onIgnoreTagAttr;
  41962. var safeAttrValue = options.safeAttrValue;
  41963. var escapeHtml = options.escapeHtml;
  41964. var cssFilter = me.cssFilter;
  41965. // remove invisible characters
  41966. if (options.stripBlankChar) {
  41967. html = DEFAULT.stripBlankChar(html);
  41968. }
  41969. // remove html comments
  41970. if (!options.allowCommentTag) {
  41971. html = DEFAULT.stripCommentTag(html);
  41972. }
  41973. // if enable stripIgnoreTagBody
  41974. var stripIgnoreTagBody = false;
  41975. if (options.stripIgnoreTagBody) {
  41976. var stripIgnoreTagBody = DEFAULT.StripTagBody(
  41977. options.stripIgnoreTagBody,
  41978. onIgnoreTag
  41979. );
  41980. onIgnoreTag = stripIgnoreTagBody.onIgnoreTag;
  41981. }
  41982. var retHtml = parseTag(
  41983. html,
  41984. function(sourcePosition, position, tag, html, isClosing) {
  41985. var info = {
  41986. sourcePosition: sourcePosition,
  41987. position: position,
  41988. isClosing: isClosing,
  41989. isWhite: whiteList.hasOwnProperty(tag)
  41990. };
  41991. // call `onTag()`
  41992. var ret = onTag(tag, html, info);
  41993. if (!isNull(ret)) return ret;
  41994. if (info.isWhite) {
  41995. if (info.isClosing) {
  41996. return "</" + tag + ">";
  41997. }
  41998. var attrs = getAttrs(html);
  41999. var whiteAttrList = whiteList[tag];
  42000. var attrsHtml = parseAttr(attrs.html, function(name, value) {
  42001. // call `onTagAttr()`
  42002. var isWhiteAttr = _.indexOf(whiteAttrList, name) !== -1;
  42003. var ret = onTagAttr(tag, name, value, isWhiteAttr);
  42004. if (!isNull(ret)) return ret;
  42005. if (isWhiteAttr) {
  42006. // call `safeAttrValue()`
  42007. value = safeAttrValue(tag, name, value, cssFilter);
  42008. if (value) {
  42009. return name + '="' + value + '"';
  42010. } else {
  42011. return name;
  42012. }
  42013. } else {
  42014. // call `onIgnoreTagAttr()`
  42015. var ret = onIgnoreTagAttr(tag, name, value, isWhiteAttr);
  42016. if (!isNull(ret)) return ret;
  42017. return;
  42018. }
  42019. });
  42020. // build new tag html
  42021. var html = "<" + tag;
  42022. if (attrsHtml) html += " " + attrsHtml;
  42023. if (attrs.closing) html += " /";
  42024. html += ">";
  42025. return html;
  42026. } else {
  42027. // call `onIgnoreTag()`
  42028. var ret = onIgnoreTag(tag, html, info);
  42029. if (!isNull(ret)) return ret;
  42030. return escapeHtml(html);
  42031. }
  42032. },
  42033. escapeHtml
  42034. );
  42035. // if enable stripIgnoreTagBody
  42036. if (stripIgnoreTagBody) {
  42037. retHtml = stripIgnoreTagBody.remove(retHtml);
  42038. }
  42039. return retHtml;
  42040. };
  42041. module.exports = FilterXSS;
  42042. },{"./default":1,"./parser":3,"./util":4,"cssfilter":8}],6:[function(require,module,exports){
  42043. /**
  42044. * cssfilter
  42045. *
  42046. * @author 老雷<leizongmin@gmail.com>
  42047. */
  42048. var DEFAULT = require('./default');
  42049. var parseStyle = require('./parser');
  42050. var _ = require('./util');
  42051. /**
  42052. * 返回值是否为空
  42053. *
  42054. * @param {Object} obj
  42055. * @return {Boolean}
  42056. */
  42057. function isNull (obj) {
  42058. return (obj === undefined || obj === null);
  42059. }
  42060. /**
  42061. * 浅拷贝对象
  42062. *
  42063. * @param {Object} obj
  42064. * @return {Object}
  42065. */
  42066. function shallowCopyObject (obj) {
  42067. var ret = {};
  42068. for (var i in obj) {
  42069. ret[i] = obj[i];
  42070. }
  42071. return ret;
  42072. }
  42073. /**
  42074. * 创建CSS过滤器
  42075. *
  42076. * @param {Object} options
  42077. * - {Object} whiteList
  42078. * - {Function} onAttr
  42079. * - {Function} onIgnoreAttr
  42080. * - {Function} safeAttrValue
  42081. */
  42082. function FilterCSS (options) {
  42083. options = shallowCopyObject(options || {});
  42084. options.whiteList = options.whiteList || DEFAULT.whiteList;
  42085. options.onAttr = options.onAttr || DEFAULT.onAttr;
  42086. options.onIgnoreAttr = options.onIgnoreAttr || DEFAULT.onIgnoreAttr;
  42087. options.safeAttrValue = options.safeAttrValue || DEFAULT.safeAttrValue;
  42088. this.options = options;
  42089. }
  42090. FilterCSS.prototype.process = function (css) {
  42091. // 兼容各种奇葩输入
  42092. css = css || '';
  42093. css = css.toString();
  42094. if (!css) return '';
  42095. var me = this;
  42096. var options = me.options;
  42097. var whiteList = options.whiteList;
  42098. var onAttr = options.onAttr;
  42099. var onIgnoreAttr = options.onIgnoreAttr;
  42100. var safeAttrValue = options.safeAttrValue;
  42101. var retCSS = parseStyle(css, function (sourcePosition, position, name, value, source) {
  42102. var check = whiteList[name];
  42103. var isWhite = false;
  42104. if (check === true) isWhite = check;
  42105. else if (typeof check === 'function') isWhite = check(value);
  42106. else if (check instanceof RegExp) isWhite = check.test(value);
  42107. if (isWhite !== true) isWhite = false;
  42108. // 如果过滤后 value 为空则直接忽略
  42109. value = safeAttrValue(name, value);
  42110. if (!value) return;
  42111. var opts = {
  42112. position: position,
  42113. sourcePosition: sourcePosition,
  42114. source: source,
  42115. isWhite: isWhite
  42116. };
  42117. if (isWhite) {
  42118. var ret = onAttr(name, value, opts);
  42119. if (isNull(ret)) {
  42120. return name + ':' + value;
  42121. } else {
  42122. return ret;
  42123. }
  42124. } else {
  42125. var ret = onIgnoreAttr(name, value, opts);
  42126. if (!isNull(ret)) {
  42127. return ret;
  42128. }
  42129. }
  42130. });
  42131. return retCSS;
  42132. };
  42133. module.exports = FilterCSS;
  42134. },{"./default":7,"./parser":9,"./util":10}],7:[function(require,module,exports){
  42135. /**
  42136. * cssfilter
  42137. *
  42138. * @author 老雷<leizongmin@gmail.com>
  42139. */
  42140. function getDefaultWhiteList () {
  42141. // 白名单值说明:
  42142. // true: 允许该属性
  42143. // Function: function (val) { } 返回true表示允许该属性,其他值均表示不允许
  42144. // RegExp: regexp.test(val) 返回true表示允许该属性,其他值均表示不允许
  42145. // 除上面列出的值外均表示不允许
  42146. var whiteList = {};
  42147. whiteList['align-content'] = false; // default: auto
  42148. whiteList['align-items'] = false; // default: auto
  42149. whiteList['align-self'] = false; // default: auto
  42150. whiteList['alignment-adjust'] = false; // default: auto
  42151. whiteList['alignment-baseline'] = false; // default: baseline
  42152. whiteList['all'] = false; // default: depending on individual properties
  42153. whiteList['anchor-point'] = false; // default: none
  42154. whiteList['animation'] = false; // default: depending on individual properties
  42155. whiteList['animation-delay'] = false; // default: 0
  42156. whiteList['animation-direction'] = false; // default: normal
  42157. whiteList['animation-duration'] = false; // default: 0
  42158. whiteList['animation-fill-mode'] = false; // default: none
  42159. whiteList['animation-iteration-count'] = false; // default: 1
  42160. whiteList['animation-name'] = false; // default: none
  42161. whiteList['animation-play-state'] = false; // default: running
  42162. whiteList['animation-timing-function'] = false; // default: ease
  42163. whiteList['azimuth'] = false; // default: center
  42164. whiteList['backface-visibility'] = false; // default: visible
  42165. whiteList['background'] = true; // default: depending on individual properties
  42166. whiteList['background-attachment'] = true; // default: scroll
  42167. whiteList['background-clip'] = true; // default: border-box
  42168. whiteList['background-color'] = true; // default: transparent
  42169. whiteList['background-image'] = true; // default: none
  42170. whiteList['background-origin'] = true; // default: padding-box
  42171. whiteList['background-position'] = true; // default: 0% 0%
  42172. whiteList['background-repeat'] = true; // default: repeat
  42173. whiteList['background-size'] = true; // default: auto
  42174. whiteList['baseline-shift'] = false; // default: baseline
  42175. whiteList['binding'] = false; // default: none
  42176. whiteList['bleed'] = false; // default: 6pt
  42177. whiteList['bookmark-label'] = false; // default: content()
  42178. whiteList['bookmark-level'] = false; // default: none
  42179. whiteList['bookmark-state'] = false; // default: open
  42180. whiteList['border'] = true; // default: depending on individual properties
  42181. whiteList['border-bottom'] = true; // default: depending on individual properties
  42182. whiteList['border-bottom-color'] = true; // default: current color
  42183. whiteList['border-bottom-left-radius'] = true; // default: 0
  42184. whiteList['border-bottom-right-radius'] = true; // default: 0
  42185. whiteList['border-bottom-style'] = true; // default: none
  42186. whiteList['border-bottom-width'] = true; // default: medium
  42187. whiteList['border-collapse'] = true; // default: separate
  42188. whiteList['border-color'] = true; // default: depending on individual properties
  42189. whiteList['border-image'] = true; // default: none
  42190. whiteList['border-image-outset'] = true; // default: 0
  42191. whiteList['border-image-repeat'] = true; // default: stretch
  42192. whiteList['border-image-slice'] = true; // default: 100%
  42193. whiteList['border-image-source'] = true; // default: none
  42194. whiteList['border-image-width'] = true; // default: 1
  42195. whiteList['border-left'] = true; // default: depending on individual properties
  42196. whiteList['border-left-color'] = true; // default: current color
  42197. whiteList['border-left-style'] = true; // default: none
  42198. whiteList['border-left-width'] = true; // default: medium
  42199. whiteList['border-radius'] = true; // default: 0
  42200. whiteList['border-right'] = true; // default: depending on individual properties
  42201. whiteList['border-right-color'] = true; // default: current color
  42202. whiteList['border-right-style'] = true; // default: none
  42203. whiteList['border-right-width'] = true; // default: medium
  42204. whiteList['border-spacing'] = true; // default: 0
  42205. whiteList['border-style'] = true; // default: depending on individual properties
  42206. whiteList['border-top'] = true; // default: depending on individual properties
  42207. whiteList['border-top-color'] = true; // default: current color
  42208. whiteList['border-top-left-radius'] = true; // default: 0
  42209. whiteList['border-top-right-radius'] = true; // default: 0
  42210. whiteList['border-top-style'] = true; // default: none
  42211. whiteList['border-top-width'] = true; // default: medium
  42212. whiteList['border-width'] = true; // default: depending on individual properties
  42213. whiteList['bottom'] = false; // default: auto
  42214. whiteList['box-decoration-break'] = true; // default: slice
  42215. whiteList['box-shadow'] = true; // default: none
  42216. whiteList['box-sizing'] = true; // default: content-box
  42217. whiteList['box-snap'] = true; // default: none
  42218. whiteList['box-suppress'] = true; // default: show
  42219. whiteList['break-after'] = true; // default: auto
  42220. whiteList['break-before'] = true; // default: auto
  42221. whiteList['break-inside'] = true; // default: auto
  42222. whiteList['caption-side'] = false; // default: top
  42223. whiteList['chains'] = false; // default: none
  42224. whiteList['clear'] = true; // default: none
  42225. whiteList['clip'] = false; // default: auto
  42226. whiteList['clip-path'] = false; // default: none
  42227. whiteList['clip-rule'] = false; // default: nonzero
  42228. whiteList['color'] = true; // default: implementation dependent
  42229. whiteList['color-interpolation-filters'] = true; // default: auto
  42230. whiteList['column-count'] = false; // default: auto
  42231. whiteList['column-fill'] = false; // default: balance
  42232. whiteList['column-gap'] = false; // default: normal
  42233. whiteList['column-rule'] = false; // default: depending on individual properties
  42234. whiteList['column-rule-color'] = false; // default: current color
  42235. whiteList['column-rule-style'] = false; // default: medium
  42236. whiteList['column-rule-width'] = false; // default: medium
  42237. whiteList['column-span'] = false; // default: none
  42238. whiteList['column-width'] = false; // default: auto
  42239. whiteList['columns'] = false; // default: depending on individual properties
  42240. whiteList['contain'] = false; // default: none
  42241. whiteList['content'] = false; // default: normal
  42242. whiteList['counter-increment'] = false; // default: none
  42243. whiteList['counter-reset'] = false; // default: none
  42244. whiteList['counter-set'] = false; // default: none
  42245. whiteList['crop'] = false; // default: auto
  42246. whiteList['cue'] = false; // default: depending on individual properties
  42247. whiteList['cue-after'] = false; // default: none
  42248. whiteList['cue-before'] = false; // default: none
  42249. whiteList['cursor'] = false; // default: auto
  42250. whiteList['direction'] = false; // default: ltr
  42251. whiteList['display'] = true; // default: depending on individual properties
  42252. whiteList['display-inside'] = true; // default: auto
  42253. whiteList['display-list'] = true; // default: none
  42254. whiteList['display-outside'] = true; // default: inline-level
  42255. whiteList['dominant-baseline'] = false; // default: auto
  42256. whiteList['elevation'] = false; // default: level
  42257. whiteList['empty-cells'] = false; // default: show
  42258. whiteList['filter'] = false; // default: none
  42259. whiteList['flex'] = false; // default: depending on individual properties
  42260. whiteList['flex-basis'] = false; // default: auto
  42261. whiteList['flex-direction'] = false; // default: row
  42262. whiteList['flex-flow'] = false; // default: depending on individual properties
  42263. whiteList['flex-grow'] = false; // default: 0
  42264. whiteList['flex-shrink'] = false; // default: 1
  42265. whiteList['flex-wrap'] = false; // default: nowrap
  42266. whiteList['float'] = false; // default: none
  42267. whiteList['float-offset'] = false; // default: 0 0
  42268. whiteList['flood-color'] = false; // default: black
  42269. whiteList['flood-opacity'] = false; // default: 1
  42270. whiteList['flow-from'] = false; // default: none
  42271. whiteList['flow-into'] = false; // default: none
  42272. whiteList['font'] = true; // default: depending on individual properties
  42273. whiteList['font-family'] = true; // default: implementation dependent
  42274. whiteList['font-feature-settings'] = true; // default: normal
  42275. whiteList['font-kerning'] = true; // default: auto
  42276. whiteList['font-language-override'] = true; // default: normal
  42277. whiteList['font-size'] = true; // default: medium
  42278. whiteList['font-size-adjust'] = true; // default: none
  42279. whiteList['font-stretch'] = true; // default: normal
  42280. whiteList['font-style'] = true; // default: normal
  42281. whiteList['font-synthesis'] = true; // default: weight style
  42282. whiteList['font-variant'] = true; // default: normal
  42283. whiteList['font-variant-alternates'] = true; // default: normal
  42284. whiteList['font-variant-caps'] = true; // default: normal
  42285. whiteList['font-variant-east-asian'] = true; // default: normal
  42286. whiteList['font-variant-ligatures'] = true; // default: normal
  42287. whiteList['font-variant-numeric'] = true; // default: normal
  42288. whiteList['font-variant-position'] = true; // default: normal
  42289. whiteList['font-weight'] = true; // default: normal
  42290. whiteList['grid'] = false; // default: depending on individual properties
  42291. whiteList['grid-area'] = false; // default: depending on individual properties
  42292. whiteList['grid-auto-columns'] = false; // default: auto
  42293. whiteList['grid-auto-flow'] = false; // default: none
  42294. whiteList['grid-auto-rows'] = false; // default: auto
  42295. whiteList['grid-column'] = false; // default: depending on individual properties
  42296. whiteList['grid-column-end'] = false; // default: auto
  42297. whiteList['grid-column-start'] = false; // default: auto
  42298. whiteList['grid-row'] = false; // default: depending on individual properties
  42299. whiteList['grid-row-end'] = false; // default: auto
  42300. whiteList['grid-row-start'] = false; // default: auto
  42301. whiteList['grid-template'] = false; // default: depending on individual properties
  42302. whiteList['grid-template-areas'] = false; // default: none
  42303. whiteList['grid-template-columns'] = false; // default: none
  42304. whiteList['grid-template-rows'] = false; // default: none
  42305. whiteList['hanging-punctuation'] = false; // default: none
  42306. whiteList['height'] = true; // default: auto
  42307. whiteList['hyphens'] = false; // default: manual
  42308. whiteList['icon'] = false; // default: auto
  42309. whiteList['image-orientation'] = false; // default: auto
  42310. whiteList['image-resolution'] = false; // default: normal
  42311. whiteList['ime-mode'] = false; // default: auto
  42312. whiteList['initial-letters'] = false; // default: normal
  42313. whiteList['inline-box-align'] = false; // default: last
  42314. whiteList['justify-content'] = false; // default: auto
  42315. whiteList['justify-items'] = false; // default: auto
  42316. whiteList['justify-self'] = false; // default: auto
  42317. whiteList['left'] = false; // default: auto
  42318. whiteList['letter-spacing'] = true; // default: normal
  42319. whiteList['lighting-color'] = true; // default: white
  42320. whiteList['line-box-contain'] = false; // default: block inline replaced
  42321. whiteList['line-break'] = false; // default: auto
  42322. whiteList['line-grid'] = false; // default: match-parent
  42323. whiteList['line-height'] = false; // default: normal
  42324. whiteList['line-snap'] = false; // default: none
  42325. whiteList['line-stacking'] = false; // default: depending on individual properties
  42326. whiteList['line-stacking-ruby'] = false; // default: exclude-ruby
  42327. whiteList['line-stacking-shift'] = false; // default: consider-shifts
  42328. whiteList['line-stacking-strategy'] = false; // default: inline-line-height
  42329. whiteList['list-style'] = true; // default: depending on individual properties
  42330. whiteList['list-style-image'] = true; // default: none
  42331. whiteList['list-style-position'] = true; // default: outside
  42332. whiteList['list-style-type'] = true; // default: disc
  42333. whiteList['margin'] = true; // default: depending on individual properties
  42334. whiteList['margin-bottom'] = true; // default: 0
  42335. whiteList['margin-left'] = true; // default: 0
  42336. whiteList['margin-right'] = true; // default: 0
  42337. whiteList['margin-top'] = true; // default: 0
  42338. whiteList['marker-offset'] = false; // default: auto
  42339. whiteList['marker-side'] = false; // default: list-item
  42340. whiteList['marks'] = false; // default: none
  42341. whiteList['mask'] = false; // default: border-box
  42342. whiteList['mask-box'] = false; // default: see individual properties
  42343. whiteList['mask-box-outset'] = false; // default: 0
  42344. whiteList['mask-box-repeat'] = false; // default: stretch
  42345. whiteList['mask-box-slice'] = false; // default: 0 fill
  42346. whiteList['mask-box-source'] = false; // default: none
  42347. whiteList['mask-box-width'] = false; // default: auto
  42348. whiteList['mask-clip'] = false; // default: border-box
  42349. whiteList['mask-image'] = false; // default: none
  42350. whiteList['mask-origin'] = false; // default: border-box
  42351. whiteList['mask-position'] = false; // default: center
  42352. whiteList['mask-repeat'] = false; // default: no-repeat
  42353. whiteList['mask-size'] = false; // default: border-box
  42354. whiteList['mask-source-type'] = false; // default: auto
  42355. whiteList['mask-type'] = false; // default: luminance
  42356. whiteList['max-height'] = true; // default: none
  42357. whiteList['max-lines'] = false; // default: none
  42358. whiteList['max-width'] = true; // default: none
  42359. whiteList['min-height'] = true; // default: 0
  42360. whiteList['min-width'] = true; // default: 0
  42361. whiteList['move-to'] = false; // default: normal
  42362. whiteList['nav-down'] = false; // default: auto
  42363. whiteList['nav-index'] = false; // default: auto
  42364. whiteList['nav-left'] = false; // default: auto
  42365. whiteList['nav-right'] = false; // default: auto
  42366. whiteList['nav-up'] = false; // default: auto
  42367. whiteList['object-fit'] = false; // default: fill
  42368. whiteList['object-position'] = false; // default: 50% 50%
  42369. whiteList['opacity'] = false; // default: 1
  42370. whiteList['order'] = false; // default: 0
  42371. whiteList['orphans'] = false; // default: 2
  42372. whiteList['outline'] = false; // default: depending on individual properties
  42373. whiteList['outline-color'] = false; // default: invert
  42374. whiteList['outline-offset'] = false; // default: 0
  42375. whiteList['outline-style'] = false; // default: none
  42376. whiteList['outline-width'] = false; // default: medium
  42377. whiteList['overflow'] = false; // default: depending on individual properties
  42378. whiteList['overflow-wrap'] = false; // default: normal
  42379. whiteList['overflow-x'] = false; // default: visible
  42380. whiteList['overflow-y'] = false; // default: visible
  42381. whiteList['padding'] = true; // default: depending on individual properties
  42382. whiteList['padding-bottom'] = true; // default: 0
  42383. whiteList['padding-left'] = true; // default: 0
  42384. whiteList['padding-right'] = true; // default: 0
  42385. whiteList['padding-top'] = true; // default: 0
  42386. whiteList['page'] = false; // default: auto
  42387. whiteList['page-break-after'] = false; // default: auto
  42388. whiteList['page-break-before'] = false; // default: auto
  42389. whiteList['page-break-inside'] = false; // default: auto
  42390. whiteList['page-policy'] = false; // default: start
  42391. whiteList['pause'] = false; // default: implementation dependent
  42392. whiteList['pause-after'] = false; // default: implementation dependent
  42393. whiteList['pause-before'] = false; // default: implementation dependent
  42394. whiteList['perspective'] = false; // default: none
  42395. whiteList['perspective-origin'] = false; // default: 50% 50%
  42396. whiteList['pitch'] = false; // default: medium
  42397. whiteList['pitch-range'] = false; // default: 50
  42398. whiteList['play-during'] = false; // default: auto
  42399. whiteList['position'] = false; // default: static
  42400. whiteList['presentation-level'] = false; // default: 0
  42401. whiteList['quotes'] = false; // default: text
  42402. whiteList['region-fragment'] = false; // default: auto
  42403. whiteList['resize'] = false; // default: none
  42404. whiteList['rest'] = false; // default: depending on individual properties
  42405. whiteList['rest-after'] = false; // default: none
  42406. whiteList['rest-before'] = false; // default: none
  42407. whiteList['richness'] = false; // default: 50
  42408. whiteList['right'] = false; // default: auto
  42409. whiteList['rotation'] = false; // default: 0
  42410. whiteList['rotation-point'] = false; // default: 50% 50%
  42411. whiteList['ruby-align'] = false; // default: auto
  42412. whiteList['ruby-merge'] = false; // default: separate
  42413. whiteList['ruby-position'] = false; // default: before
  42414. whiteList['shape-image-threshold'] = false; // default: 0.0
  42415. whiteList['shape-outside'] = false; // default: none
  42416. whiteList['shape-margin'] = false; // default: 0
  42417. whiteList['size'] = false; // default: auto
  42418. whiteList['speak'] = false; // default: auto
  42419. whiteList['speak-as'] = false; // default: normal
  42420. whiteList['speak-header'] = false; // default: once
  42421. whiteList['speak-numeral'] = false; // default: continuous
  42422. whiteList['speak-punctuation'] = false; // default: none
  42423. whiteList['speech-rate'] = false; // default: medium
  42424. whiteList['stress'] = false; // default: 50
  42425. whiteList['string-set'] = false; // default: none
  42426. whiteList['tab-size'] = false; // default: 8
  42427. whiteList['table-layout'] = false; // default: auto
  42428. whiteList['text-align'] = true; // default: start
  42429. whiteList['text-align-last'] = true; // default: auto
  42430. whiteList['text-combine-upright'] = true; // default: none
  42431. whiteList['text-decoration'] = true; // default: none
  42432. whiteList['text-decoration-color'] = true; // default: currentColor
  42433. whiteList['text-decoration-line'] = true; // default: none
  42434. whiteList['text-decoration-skip'] = true; // default: objects
  42435. whiteList['text-decoration-style'] = true; // default: solid
  42436. whiteList['text-emphasis'] = true; // default: depending on individual properties
  42437. whiteList['text-emphasis-color'] = true; // default: currentColor
  42438. whiteList['text-emphasis-position'] = true; // default: over right
  42439. whiteList['text-emphasis-style'] = true; // default: none
  42440. whiteList['text-height'] = true; // default: auto
  42441. whiteList['text-indent'] = true; // default: 0
  42442. whiteList['text-justify'] = true; // default: auto
  42443. whiteList['text-orientation'] = true; // default: mixed
  42444. whiteList['text-overflow'] = true; // default: clip
  42445. whiteList['text-shadow'] = true; // default: none
  42446. whiteList['text-space-collapse'] = true; // default: collapse
  42447. whiteList['text-transform'] = true; // default: none
  42448. whiteList['text-underline-position'] = true; // default: auto
  42449. whiteList['text-wrap'] = true; // default: normal
  42450. whiteList['top'] = false; // default: auto
  42451. whiteList['transform'] = false; // default: none
  42452. whiteList['transform-origin'] = false; // default: 50% 50% 0
  42453. whiteList['transform-style'] = false; // default: flat
  42454. whiteList['transition'] = false; // default: depending on individual properties
  42455. whiteList['transition-delay'] = false; // default: 0s
  42456. whiteList['transition-duration'] = false; // default: 0s
  42457. whiteList['transition-property'] = false; // default: all
  42458. whiteList['transition-timing-function'] = false; // default: ease
  42459. whiteList['unicode-bidi'] = false; // default: normal
  42460. whiteList['vertical-align'] = false; // default: baseline
  42461. whiteList['visibility'] = false; // default: visible
  42462. whiteList['voice-balance'] = false; // default: center
  42463. whiteList['voice-duration'] = false; // default: auto
  42464. whiteList['voice-family'] = false; // default: implementation dependent
  42465. whiteList['voice-pitch'] = false; // default: medium
  42466. whiteList['voice-range'] = false; // default: medium
  42467. whiteList['voice-rate'] = false; // default: normal
  42468. whiteList['voice-stress'] = false; // default: normal
  42469. whiteList['voice-volume'] = false; // default: medium
  42470. whiteList['volume'] = false; // default: medium
  42471. whiteList['white-space'] = false; // default: normal
  42472. whiteList['widows'] = false; // default: 2
  42473. whiteList['width'] = true; // default: auto
  42474. whiteList['will-change'] = false; // default: auto
  42475. whiteList['word-break'] = true; // default: normal
  42476. whiteList['word-spacing'] = true; // default: normal
  42477. whiteList['word-wrap'] = true; // default: normal
  42478. whiteList['wrap-flow'] = false; // default: auto
  42479. whiteList['wrap-through'] = false; // default: wrap
  42480. whiteList['writing-mode'] = false; // default: horizontal-tb
  42481. whiteList['z-index'] = false; // default: auto
  42482. return whiteList;
  42483. }
  42484. /**
  42485. * 匹配到白名单上的一个属性时
  42486. *
  42487. * @param {String} name
  42488. * @param {String} value
  42489. * @param {Object} options
  42490. * @return {String}
  42491. */
  42492. function onAttr (name, value, options) {
  42493. // do nothing
  42494. }
  42495. /**
  42496. * 匹配到不在白名单上的一个属性时
  42497. *
  42498. * @param {String} name
  42499. * @param {String} value
  42500. * @param {Object} options
  42501. * @return {String}
  42502. */
  42503. function onIgnoreAttr (name, value, options) {
  42504. // do nothing
  42505. }
  42506. var REGEXP_URL_JAVASCRIPT = /javascript\s*\:/img;
  42507. /**
  42508. * 过滤属性值
  42509. *
  42510. * @param {String} name
  42511. * @param {String} value
  42512. * @return {String}
  42513. */
  42514. function safeAttrValue(name, value) {
  42515. if (REGEXP_URL_JAVASCRIPT.test(value)) return '';
  42516. return value;
  42517. }
  42518. exports.whiteList = getDefaultWhiteList();
  42519. exports.getDefaultWhiteList = getDefaultWhiteList;
  42520. exports.onAttr = onAttr;
  42521. exports.onIgnoreAttr = onIgnoreAttr;
  42522. exports.safeAttrValue = safeAttrValue;
  42523. },{}],8:[function(require,module,exports){
  42524. /**
  42525. * cssfilter
  42526. *
  42527. * @author 老雷<leizongmin@gmail.com>
  42528. */
  42529. var DEFAULT = require('./default');
  42530. var FilterCSS = require('./css');
  42531. /**
  42532. * XSS过滤
  42533. *
  42534. * @param {String} css 要过滤的CSS代码
  42535. * @param {Object} options 选项:whiteList, onAttr, onIgnoreAttr
  42536. * @return {String}
  42537. */
  42538. function filterCSS (html, options) {
  42539. var xss = new FilterCSS(options);
  42540. return xss.process(html);
  42541. }
  42542. // 输出
  42543. exports = module.exports = filterCSS;
  42544. exports.FilterCSS = FilterCSS;
  42545. for (var i in DEFAULT) exports[i] = DEFAULT[i];
  42546. // 在浏览器端使用
  42547. if (typeof window !== 'undefined') {
  42548. window.filterCSS = module.exports;
  42549. }
  42550. },{"./css":6,"./default":7}],9:[function(require,module,exports){
  42551. /**
  42552. * cssfilter
  42553. *
  42554. * @author 老雷<leizongmin@gmail.com>
  42555. */
  42556. var _ = require('./util');
  42557. /**
  42558. * 解析style
  42559. *
  42560. * @param {String} css
  42561. * @param {Function} onAttr 处理属性的函数
  42562. * 参数格式: function (sourcePosition, position, name, value, source)
  42563. * @return {String}
  42564. */
  42565. function parseStyle (css, onAttr) {
  42566. css = _.trimRight(css);
  42567. if (css[css.length - 1] !== ';') css += ';';
  42568. var cssLength = css.length;
  42569. var isParenthesisOpen = false;
  42570. var lastPos = 0;
  42571. var i = 0;
  42572. var retCSS = '';
  42573. function addNewAttr () {
  42574. // 如果没有正常的闭合圆括号,则直接忽略当前属性
  42575. if (!isParenthesisOpen) {
  42576. var source = _.trim(css.slice(lastPos, i));
  42577. var j = source.indexOf(':');
  42578. if (j !== -1) {
  42579. var name = _.trim(source.slice(0, j));
  42580. var value = _.trim(source.slice(j + 1));
  42581. // 必须有属性名称
  42582. if (name) {
  42583. var ret = onAttr(lastPos, retCSS.length, name, value, source);
  42584. if (ret) retCSS += ret + '; ';
  42585. }
  42586. }
  42587. }
  42588. lastPos = i + 1;
  42589. }
  42590. for (; i < cssLength; i++) {
  42591. var c = css[i];
  42592. if (c === '/' && css[i + 1] === '*') {
  42593. // 备注开始
  42594. var j = css.indexOf('*/', i + 2);
  42595. // 如果没有正常的备注结束,则后面的部分全部跳过
  42596. if (j === -1) break;
  42597. // 直接将当前位置调到备注结尾,并且初始化状态
  42598. i = j + 1;
  42599. lastPos = i + 1;
  42600. isParenthesisOpen = false;
  42601. } else if (c === '(') {
  42602. isParenthesisOpen = true;
  42603. } else if (c === ')') {
  42604. isParenthesisOpen = false;
  42605. } else if (c === ';') {
  42606. if (isParenthesisOpen) {
  42607. // 在圆括号里面,忽略
  42608. } else {
  42609. addNewAttr();
  42610. }
  42611. } else if (c === '\n') {
  42612. addNewAttr();
  42613. }
  42614. }
  42615. return _.trim(retCSS);
  42616. }
  42617. module.exports = parseStyle;
  42618. },{"./util":10}],10:[function(require,module,exports){
  42619. module.exports = {
  42620. indexOf: function (arr, item) {
  42621. var i, j;
  42622. if (Array.prototype.indexOf) {
  42623. return arr.indexOf(item);
  42624. }
  42625. for (i = 0, j = arr.length; i < j; i++) {
  42626. if (arr[i] === item) {
  42627. return i;
  42628. }
  42629. }
  42630. return -1;
  42631. },
  42632. forEach: function (arr, fn, scope) {
  42633. var i, j;
  42634. if (Array.prototype.forEach) {
  42635. return arr.forEach(fn, scope);
  42636. }
  42637. for (i = 0, j = arr.length; i < j; i++) {
  42638. fn.call(scope, arr[i], i, arr);
  42639. }
  42640. },
  42641. trim: function (str) {
  42642. if (String.prototype.trim) {
  42643. return str.trim();
  42644. }
  42645. return str.replace(/(^\s*)|(\s*$)/g, '');
  42646. },
  42647. trimRight: function (str) {
  42648. if (String.prototype.trimRight) {
  42649. return str.trimRight();
  42650. }
  42651. return str.replace(/(\s*$)/g, '');
  42652. }
  42653. };
  42654. },{}]},{},[2]);
  42655. /*** EXPORTS FROM exports-loader ***/
  42656. exports["filterXSS"] = (filterXSS);
  42657. exports["filterCSS"] = (filterCSS);
  42658. /***/ }),
  42659. /***/ "./src/converse-autocomplete.js":
  42660. /*!**************************************!*\
  42661. !*** ./src/converse-autocomplete.js ***!
  42662. \**************************************/
  42663. /*! no exports provided */
  42664. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  42665. "use strict";
  42666. __webpack_require__.r(__webpack_exports__);
  42667. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  42668. // Converse.js
  42669. // http://conversejs.org
  42670. //
  42671. // Copyright (c) 2013-2018, the Converse.js developers
  42672. // Licensed under the Mozilla Public License (MPLv2)
  42673. // This plugin started as a fork of Lea Verou's Awesomplete
  42674. // https://leaverou.github.io/awesomplete/
  42675. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env,
  42676. _ = _converse$env._,
  42677. Backbone = _converse$env.Backbone,
  42678. u = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env.utils;
  42679. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins.add("converse-autocomplete", {
  42680. initialize() {
  42681. const _converse = this._converse;
  42682. _converse.FILTER_CONTAINS = function (text, input) {
  42683. return RegExp(helpers.regExpEscape(input.trim()), "i").test(text);
  42684. };
  42685. _converse.FILTER_STARTSWITH = function (text, input) {
  42686. return RegExp("^" + helpers.regExpEscape(input.trim()), "i").test(text);
  42687. };
  42688. const SORT_BYLENGTH = function SORT_BYLENGTH(a, b) {
  42689. if (a.length !== b.length) {
  42690. return a.length - b.length;
  42691. }
  42692. return a < b ? -1 : 1;
  42693. };
  42694. const ITEM = (text, input) => {
  42695. input = input.trim();
  42696. const element = document.createElement("li");
  42697. element.setAttribute("aria-selected", "false");
  42698. const regex = new RegExp("(" + input + ")", "ig");
  42699. const parts = input ? text.split(regex) : [text];
  42700. parts.forEach(txt => {
  42701. if (input && txt.match(regex)) {
  42702. const match = document.createElement("mark");
  42703. match.textContent = txt;
  42704. element.appendChild(match);
  42705. } else {
  42706. element.appendChild(document.createTextNode(txt));
  42707. }
  42708. });
  42709. return element;
  42710. };
  42711. class AutoComplete {
  42712. constructor(el, config = {}) {
  42713. this.is_opened = false;
  42714. if (u.hasClass('.suggestion-box', el)) {
  42715. this.container = el;
  42716. } else {
  42717. this.container = el.querySelector('.suggestion-box');
  42718. }
  42719. this.input = this.container.querySelector('.suggestion-box__input');
  42720. this.input.setAttribute("autocomplete", "off");
  42721. this.input.setAttribute("aria-autocomplete", "list");
  42722. this.ul = this.container.querySelector('.suggestion-box__results');
  42723. this.status = this.container.querySelector('.suggestion-box__additions');
  42724. _.assignIn(this, {
  42725. 'match_current_word': false,
  42726. // Match only the current word, otherwise all input is matched
  42727. 'match_on_tab': false,
  42728. // Whether matching should only start when tab's pressed
  42729. 'trigger_on_at': false,
  42730. // Whether @ should trigger autocomplete
  42731. 'min_chars': 2,
  42732. 'max_items': 10,
  42733. 'auto_evaluate': true,
  42734. 'auto_first': false,
  42735. 'data': _.identity,
  42736. 'filter': _converse.FILTER_CONTAINS,
  42737. 'sort': config.sort === false ? false : SORT_BYLENGTH,
  42738. 'item': ITEM
  42739. }, config);
  42740. this.index = -1;
  42741. this.bindEvents();
  42742. if (this.input.hasAttribute("list")) {
  42743. this.list = "#" + this.input.getAttribute("list");
  42744. this.input.removeAttribute("list");
  42745. } else {
  42746. this.list = this.input.getAttribute("data-list") || config.list || [];
  42747. }
  42748. }
  42749. bindEvents() {
  42750. // Bind events
  42751. const input = {
  42752. "blur": () => this.close({
  42753. 'reason': 'blur'
  42754. })
  42755. };
  42756. if (this.auto_evaluate) {
  42757. input["input"] = () => this.evaluate();
  42758. }
  42759. this._events = {
  42760. 'input': input,
  42761. 'form': {
  42762. "submit": () => this.close({
  42763. 'reason': 'submit'
  42764. })
  42765. },
  42766. 'ul': {
  42767. "mousedown": ev => this.onMouseDown(ev),
  42768. "mouseover": ev => this.onMouseOver(ev)
  42769. }
  42770. };
  42771. helpers.bind(this.input, this._events.input);
  42772. helpers.bind(this.input.form, this._events.form);
  42773. helpers.bind(this.ul, this._events.ul);
  42774. }
  42775. set list(list) {
  42776. if (Array.isArray(list) || typeof list === "function") {
  42777. this._list = list;
  42778. } else if (typeof list === "string" && _.includes(list, ",")) {
  42779. this._list = list.split(/\s*,\s*/);
  42780. } else {
  42781. // Element or CSS selector
  42782. list = helpers.getElement(list);
  42783. if (list && list.children) {
  42784. const items = [];
  42785. slice.apply(list.children).forEach(function (el) {
  42786. if (!el.disabled) {
  42787. const text = el.textContent.trim(),
  42788. value = el.value || text,
  42789. label = el.label || text;
  42790. if (value !== "") {
  42791. items.push({
  42792. label: label,
  42793. value: value
  42794. });
  42795. }
  42796. }
  42797. });
  42798. this._list = items;
  42799. }
  42800. }
  42801. if (document.activeElement === this.input) {
  42802. this.evaluate();
  42803. }
  42804. }
  42805. get selected() {
  42806. return this.index > -1;
  42807. }
  42808. get opened() {
  42809. return this.is_opened;
  42810. }
  42811. close(o) {
  42812. if (!this.opened) {
  42813. return;
  42814. }
  42815. this.ul.setAttribute("hidden", "");
  42816. this.is_opened = false;
  42817. this.index = -1;
  42818. this.trigger("suggestion-box-close", o || {});
  42819. }
  42820. insertValue(suggestion) {
  42821. let value;
  42822. if (this.match_current_word) {
  42823. u.replaceCurrentWord(this.input, suggestion.value);
  42824. } else {
  42825. this.input.value = suggestion.value;
  42826. }
  42827. }
  42828. open() {
  42829. this.ul.removeAttribute("hidden");
  42830. this.is_opened = true;
  42831. if (this.auto_first && this.index === -1) {
  42832. this.goto(0);
  42833. }
  42834. this.trigger("suggestion-box-open");
  42835. }
  42836. destroy() {
  42837. //remove events from the input and its form
  42838. helpers.unbind(this.input, this._events.input);
  42839. helpers.unbind(this.input.form, this._events.form); //move the input out of the suggestion-box container and remove the container and its children
  42840. const parentNode = this.container.parentNode;
  42841. parentNode.insertBefore(this.input, this.container);
  42842. parentNode.removeChild(this.container); //remove autocomplete and aria-autocomplete attributes
  42843. this.input.removeAttribute("autocomplete");
  42844. this.input.removeAttribute("aria-autocomplete");
  42845. }
  42846. next() {
  42847. const count = this.ul.children.length;
  42848. this.goto(this.index < count - 1 ? this.index + 1 : count ? 0 : -1);
  42849. }
  42850. previous() {
  42851. const count = this.ul.children.length,
  42852. pos = this.index - 1;
  42853. this.goto(this.selected && pos !== -1 ? pos : count - 1);
  42854. }
  42855. goto(i) {
  42856. // Should not be used directly, highlights specific item without any checks!
  42857. const list = this.ul.children;
  42858. if (this.selected) {
  42859. list[this.index].setAttribute("aria-selected", "false");
  42860. }
  42861. this.index = i;
  42862. if (i > -1 && list.length > 0) {
  42863. list[i].setAttribute("aria-selected", "true");
  42864. list[i].focus();
  42865. this.status.textContent = list[i].textContent; // scroll to highlighted element in case parent's height is fixed
  42866. this.ul.scrollTop = list[i].offsetTop - this.ul.clientHeight + list[i].clientHeight;
  42867. this.trigger("suggestion-box-highlight", {
  42868. 'text': this.suggestions[this.index]
  42869. });
  42870. }
  42871. }
  42872. select(selected, origin) {
  42873. if (selected) {
  42874. this.index = u.siblingIndex(selected);
  42875. } else {
  42876. selected = this.ul.children[this.index];
  42877. }
  42878. if (selected) {
  42879. const suggestion = this.suggestions[this.index];
  42880. this.insertValue(suggestion);
  42881. this.close({
  42882. 'reason': 'select'
  42883. });
  42884. this.auto_completing = false;
  42885. this.trigger("suggestion-box-selectcomplete", {
  42886. 'text': suggestion
  42887. });
  42888. }
  42889. }
  42890. onMouseOver(ev) {
  42891. const li = u.ancestor(ev.target, 'li');
  42892. if (li) {
  42893. this.goto(Array.prototype.slice.call(this.ul.children).indexOf(li));
  42894. }
  42895. }
  42896. onMouseDown(ev) {
  42897. if (ev.button !== 0) {
  42898. return; // Only select on left click
  42899. }
  42900. const li = u.ancestor(ev.target, 'li');
  42901. if (li) {
  42902. ev.preventDefault();
  42903. this.select(li, ev.target);
  42904. }
  42905. }
  42906. keyPressed(ev) {
  42907. if (this.opened) {
  42908. if (_.includes([_converse.keycodes.ENTER, _converse.keycodes.TAB], ev.keyCode) && this.selected) {
  42909. ev.preventDefault();
  42910. ev.stopPropagation();
  42911. this.select();
  42912. return true;
  42913. } else if (ev.keyCode === _converse.keycodes.ESCAPE) {
  42914. this.close({
  42915. 'reason': 'esc'
  42916. });
  42917. return true;
  42918. } else if (_.includes([_converse.keycodes.UP_ARROW, _converse.keycodes.DOWN_ARROW], ev.keyCode)) {
  42919. ev.preventDefault();
  42920. ev.stopPropagation();
  42921. this[ev.keyCode === _converse.keycodes.UP_ARROW ? "previous" : "next"]();
  42922. return true;
  42923. }
  42924. }
  42925. if (_.includes([_converse.keycodes.SHIFT, _converse.keycodes.META, _converse.keycodes.META_RIGHT, _converse.keycodes.ESCAPE, _converse.keycodes.ALT], ev.keyCode)) {
  42926. return;
  42927. }
  42928. if (this.match_on_tab && ev.keyCode === _converse.keycodes.TAB) {
  42929. ev.preventDefault();
  42930. this.auto_completing = true;
  42931. } else if (this.trigger_on_at && ev.keyCode === _converse.keycodes.AT) {
  42932. this.auto_completing = true;
  42933. }
  42934. }
  42935. evaluate(ev) {
  42936. const arrow_pressed = ev.keyCode === _converse.keycodes.UP_ARROW || ev.keyCode === _converse.keycodes.DOWN_ARROW;
  42937. if (!this.auto_completing || this.selected && arrow_pressed) {
  42938. return;
  42939. }
  42940. const list = typeof this._list === "function" ? this._list() : this._list;
  42941. if (list.length === 0) {
  42942. return;
  42943. }
  42944. let value = this.match_current_word ? u.getCurrentWord(this.input) : this.input.value;
  42945. let ignore_min_chars = false;
  42946. if (this.trigger_on_at && value.startsWith('@')) {
  42947. ignore_min_chars = true;
  42948. value = value.slice('1');
  42949. }
  42950. if (value.length >= this.min_chars || ignore_min_chars) {
  42951. this.index = -1; // Populate list with options that match
  42952. this.ul.innerHTML = "";
  42953. this.suggestions = list.map(item => new Suggestion(this.data(item, value))).filter(item => this.filter(item, value));
  42954. if (this.sort !== false) {
  42955. this.suggestions = this.suggestions.sort(this.sort);
  42956. }
  42957. this.suggestions = this.suggestions.slice(0, this.max_items);
  42958. this.suggestions.forEach(text => this.ul.appendChild(this.item(text, value)));
  42959. if (this.ul.children.length === 0) {
  42960. this.close({
  42961. 'reason': 'nomatches'
  42962. });
  42963. } else {
  42964. this.open();
  42965. }
  42966. } else {
  42967. this.close({
  42968. 'reason': 'nomatches'
  42969. });
  42970. this.auto_completing = false;
  42971. }
  42972. }
  42973. } // Make it an event emitter
  42974. _.extend(AutoComplete.prototype, Backbone.Events); // Private functions
  42975. function Suggestion(data) {
  42976. const o = Array.isArray(data) ? {
  42977. label: data[0],
  42978. value: data[1]
  42979. } : typeof data === "object" && "label" in data && "value" in data ? data : {
  42980. label: data,
  42981. value: data
  42982. };
  42983. this.label = o.label || o.value;
  42984. this.value = o.value;
  42985. }
  42986. Object.defineProperty(Suggestion.prototype = Object.create(String.prototype), "length", {
  42987. get: function get() {
  42988. return this.label.length;
  42989. }
  42990. });
  42991. Suggestion.prototype.toString = Suggestion.prototype.valueOf = function () {
  42992. return "" + this.label;
  42993. }; // Helpers
  42994. var slice = Array.prototype.slice;
  42995. const helpers = {
  42996. getElement(expr, el) {
  42997. return typeof expr === "string" ? (el || document).querySelector(expr) : expr || null;
  42998. },
  42999. bind(element, o) {
  43000. if (element) {
  43001. for (var event in o) {
  43002. if (!Object.prototype.hasOwnProperty.call(o, event)) {
  43003. continue;
  43004. }
  43005. const callback = o[event];
  43006. event.split(/\s+/).forEach(event => element.addEventListener(event, callback));
  43007. }
  43008. }
  43009. },
  43010. unbind(element, o) {
  43011. if (element) {
  43012. for (var event in o) {
  43013. if (!Object.prototype.hasOwnProperty.call(o, event)) {
  43014. continue;
  43015. }
  43016. const callback = o[event];
  43017. event.split(/\s+/).forEach(event => element.removeEventListener(event, callback));
  43018. }
  43019. }
  43020. },
  43021. regExpEscape(s) {
  43022. return s.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&");
  43023. }
  43024. };
  43025. _converse.AutoComplete = AutoComplete;
  43026. }
  43027. });
  43028. /***/ }),
  43029. /***/ "./src/converse-bookmarks.js":
  43030. /*!***********************************!*\
  43031. !*** ./src/converse-bookmarks.js ***!
  43032. \***********************************/
  43033. /*! no exports provided */
  43034. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43035. "use strict";
  43036. __webpack_require__.r(__webpack_exports__);
  43037. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  43038. /* harmony import */ var _converse_headless_converse_muc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless/converse-muc */ "./src/headless/converse-muc.js");
  43039. /* harmony import */ var templates_bookmark_html__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! templates/bookmark.html */ "./src/templates/bookmark.html");
  43040. /* harmony import */ var templates_bookmark_html__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(templates_bookmark_html__WEBPACK_IMPORTED_MODULE_2__);
  43041. /* harmony import */ var templates_bookmarks_list_html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! templates/bookmarks_list.html */ "./src/templates/bookmarks_list.html");
  43042. /* harmony import */ var templates_bookmarks_list_html__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(templates_bookmarks_list_html__WEBPACK_IMPORTED_MODULE_3__);
  43043. /* harmony import */ var templates_chatroom_bookmark_form_html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! templates/chatroom_bookmark_form.html */ "./src/templates/chatroom_bookmark_form.html");
  43044. /* harmony import */ var templates_chatroom_bookmark_form_html__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(templates_chatroom_bookmark_form_html__WEBPACK_IMPORTED_MODULE_4__);
  43045. /* harmony import */ var templates_chatroom_bookmark_toggle_html__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! templates/chatroom_bookmark_toggle.html */ "./src/templates/chatroom_bookmark_toggle.html");
  43046. /* harmony import */ var templates_chatroom_bookmark_toggle_html__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(templates_chatroom_bookmark_toggle_html__WEBPACK_IMPORTED_MODULE_5__);
  43047. // Converse.js (A browser based XMPP chat client)
  43048. // http://conversejs.org
  43049. //
  43050. // Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
  43051. // Licensed under the Mozilla Public License (MPLv2)
  43052. //
  43053. /*global define */
  43054. /* This is a Converse.js plugin which add support for bookmarks specified
  43055. * in XEP-0048.
  43056. */
  43057. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env,
  43058. Backbone = _converse$env.Backbone,
  43059. Promise = _converse$env.Promise,
  43060. Strophe = _converse$env.Strophe,
  43061. $iq = _converse$env.$iq,
  43062. b64_sha1 = _converse$env.b64_sha1,
  43063. sizzle = _converse$env.sizzle,
  43064. _ = _converse$env._;
  43065. const u = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env.utils;
  43066. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins.add('converse-bookmarks', {
  43067. /* Plugin dependencies are other plugins which might be
  43068. * overridden or relied upon, and therefore need to be loaded before
  43069. * this plugin.
  43070. *
  43071. * If the setting "strict_plugin_dependencies" is set to true,
  43072. * an error will be raised if the plugin is not found. By default it's
  43073. * false, which means these plugins are only loaded opportunistically.
  43074. *
  43075. * NB: These plugins need to have already been loaded via require.js.
  43076. */
  43077. dependencies: ["converse-chatboxes", "converse-muc", "converse-muc-views"],
  43078. overrides: {
  43079. // Overrides mentioned here will be picked up by converse.js's
  43080. // plugin architecture they will replace existing methods on the
  43081. // relevant objects or classes.
  43082. //
  43083. // New functions which don't exist yet can also be added.
  43084. ChatRoomView: {
  43085. events: {
  43086. 'click .toggle-bookmark': 'toggleBookmark'
  43087. },
  43088. initialize() {
  43089. this.__super__.initialize.apply(this, arguments);
  43090. this.model.on('change:bookmarked', this.onBookmarked, this);
  43091. this.setBookmarkState();
  43092. },
  43093. renderBookmarkToggle() {
  43094. if (this.el.querySelector('.chat-head .toggle-bookmark')) {
  43095. return;
  43096. }
  43097. const _converse = this.__super__._converse,
  43098. __ = _converse.__;
  43099. const bookmark_button = templates_chatroom_bookmark_toggle_html__WEBPACK_IMPORTED_MODULE_5___default()(_.assignIn(this.model.toJSON(), {
  43100. info_toggle_bookmark: __('Bookmark this groupchat'),
  43101. bookmarked: this.model.get('bookmarked')
  43102. }));
  43103. const close_button = this.el.querySelector('.close-chatbox-button');
  43104. close_button.insertAdjacentHTML('afterend', bookmark_button);
  43105. },
  43106. async renderHeading() {
  43107. this.__super__.renderHeading.apply(this, arguments);
  43108. const _converse = this.__super__._converse;
  43109. if (_converse.allow_bookmarks) {
  43110. const supported = await _converse.checkBookmarksSupport();
  43111. if (supported) {
  43112. this.renderBookmarkToggle();
  43113. }
  43114. }
  43115. },
  43116. checkForReservedNick() {
  43117. /* Check if the user has a bookmark with a saved nickanme
  43118. * for this groupchat, and if so use it.
  43119. * Otherwise delegate to the super method.
  43120. */
  43121. const _converse = this.__super__._converse;
  43122. if (_.isUndefined(_converse.bookmarks) || !_converse.allow_bookmarks) {
  43123. return this.__super__.checkForReservedNick.apply(this, arguments);
  43124. }
  43125. const model = _converse.bookmarks.findWhere({
  43126. 'jid': this.model.get('jid')
  43127. });
  43128. if (!_.isUndefined(model) && model.get('nick')) {
  43129. this.join(model.get('nick'));
  43130. } else {
  43131. return this.__super__.checkForReservedNick.apply(this, arguments);
  43132. }
  43133. },
  43134. onBookmarked() {
  43135. const _converse = this.__super__._converse,
  43136. __ = _converse.__;
  43137. const icon = this.el.querySelector('.toggle-bookmark');
  43138. if (_.isNull(icon)) {
  43139. return;
  43140. }
  43141. if (this.model.get('bookmarked')) {
  43142. icon.classList.add('button-on');
  43143. icon.title = __('Unbookmark this groupchat');
  43144. } else {
  43145. icon.classList.remove('button-on');
  43146. icon.title = __('Bookmark this groupchat');
  43147. }
  43148. },
  43149. setBookmarkState() {
  43150. /* Set whether the groupchat is bookmarked or not.
  43151. */
  43152. const _converse = this.__super__._converse;
  43153. if (!_.isUndefined(_converse.bookmarks)) {
  43154. const models = _converse.bookmarks.where({
  43155. 'jid': this.model.get('jid')
  43156. });
  43157. if (!models.length) {
  43158. this.model.save('bookmarked', false);
  43159. } else {
  43160. this.model.save('bookmarked', true);
  43161. }
  43162. }
  43163. },
  43164. renderBookmarkForm() {
  43165. const _converse = this.__super__._converse,
  43166. __ = _converse.__,
  43167. body = this.el.querySelector('.chatroom-body');
  43168. _.each(body.children, child => child.classList.add('hidden'));
  43169. _.each(body.querySelectorAll('.chatroom-form-container'), u.removeElement);
  43170. body.insertAdjacentHTML('beforeend', templates_chatroom_bookmark_form_html__WEBPACK_IMPORTED_MODULE_4___default()({
  43171. 'default_nick': this.model.get('nick'),
  43172. 'heading': __('Bookmark this groupchat'),
  43173. 'label_autojoin': __('Would you like this groupchat to be automatically joined upon startup?'),
  43174. 'label_cancel': __('Cancel'),
  43175. 'label_name': __('The name for this bookmark:'),
  43176. 'label_nick': __('What should your nickname for this groupchat be?'),
  43177. 'label_submit': __('Save'),
  43178. 'name': this.model.get('name')
  43179. }));
  43180. const form = body.querySelector('form.chatroom-form');
  43181. form.addEventListener('submit', ev => this.onBookmarkFormSubmitted(ev));
  43182. form.querySelector('.button-cancel').addEventListener('click', () => this.closeForm());
  43183. },
  43184. onBookmarkFormSubmitted(ev) {
  43185. ev.preventDefault();
  43186. const _converse = this.__super__._converse;
  43187. _converse.bookmarks.createBookmark({
  43188. 'jid': this.model.get('jid'),
  43189. 'autojoin': _.get(ev.target.querySelector('input[name="autojoin"]'), 'checked') || false,
  43190. 'name': _.get(ev.target.querySelector('input[name=name]'), 'value'),
  43191. 'nick': _.get(ev.target.querySelector('input[name=nick]'), 'value')
  43192. });
  43193. u.removeElement(this.el.querySelector('div.chatroom-form-container'));
  43194. this.renderAfterTransition();
  43195. },
  43196. toggleBookmark(ev) {
  43197. if (ev) {
  43198. ev.preventDefault();
  43199. ev.stopPropagation();
  43200. }
  43201. const _converse = this.__super__._converse;
  43202. const models = _converse.bookmarks.where({
  43203. 'jid': this.model.get('jid')
  43204. });
  43205. if (!models.length) {
  43206. this.renderBookmarkForm();
  43207. } else {
  43208. _.forEach(models, function (model) {
  43209. model.destroy();
  43210. });
  43211. this.el.querySelector('.toggle-bookmark').classList.remove('button-on');
  43212. }
  43213. }
  43214. }
  43215. },
  43216. initialize() {
  43217. /* The initialize function gets called as soon as the plugin is
  43218. * loaded by converse.js's plugin machinery.
  43219. */
  43220. const _converse = this._converse,
  43221. __ = _converse.__; // Configuration values for this plugin
  43222. // ====================================
  43223. // Refer to docs/source/configuration.rst for explanations of these
  43224. // configuration settings.
  43225. _converse.api.settings.update({
  43226. allow_bookmarks: true,
  43227. allow_public_bookmarks: false,
  43228. hide_open_bookmarks: true
  43229. }); // Promises exposed by this plugin
  43230. _converse.api.promises.add('bookmarksInitialized'); // Pure functions on the _converse object
  43231. _.extend(_converse, {
  43232. removeBookmarkViaEvent(ev) {
  43233. /* Remove a bookmark as determined by the passed in
  43234. * event.
  43235. */
  43236. ev.preventDefault();
  43237. const name = ev.target.getAttribute('data-bookmark-name');
  43238. const jid = ev.target.getAttribute('data-room-jid');
  43239. if (confirm(__("Are you sure you want to remove the bookmark \"%1$s\"?", name))) {
  43240. _.invokeMap(_converse.bookmarks.where({
  43241. 'jid': jid
  43242. }), Backbone.Model.prototype.destroy);
  43243. }
  43244. },
  43245. addBookmarkViaEvent(ev) {
  43246. /* Add a bookmark as determined by the passed in
  43247. * event.
  43248. */
  43249. ev.preventDefault();
  43250. const jid = ev.target.getAttribute('data-room-jid');
  43251. const chatroom = _converse.api.rooms.open(jid, {
  43252. 'bring_to_foreground': true
  43253. });
  43254. _converse.chatboxviews.get(jid).renderBookmarkForm();
  43255. }
  43256. });
  43257. _converse.Bookmark = Backbone.Model;
  43258. _converse.Bookmarks = Backbone.Collection.extend({
  43259. model: _converse.Bookmark,
  43260. comparator: item => item.get('name').toLowerCase(),
  43261. initialize() {
  43262. this.on('add', _.flow(this.openBookmarkedRoom, this.markRoomAsBookmarked));
  43263. this.on('remove', this.markRoomAsUnbookmarked, this);
  43264. this.on('remove', this.sendBookmarkStanza, this);
  43265. const storage = _converse.config.get('storage'),
  43266. cache_key = `converse.room-bookmarks${_converse.bare_jid}`;
  43267. this.fetched_flag = b64_sha1(cache_key + 'fetched');
  43268. this.browserStorage = new Backbone.BrowserStorage[storage](b64_sha1(cache_key));
  43269. },
  43270. openBookmarkedRoom(bookmark) {
  43271. if (bookmark.get('autojoin')) {
  43272. const groupchat = _converse.api.rooms.create(bookmark.get('jid'), bookmark.get('nick'));
  43273. if (!groupchat.get('hidden')) {
  43274. groupchat.trigger('show');
  43275. }
  43276. }
  43277. return bookmark;
  43278. },
  43279. fetchBookmarks() {
  43280. const deferred = u.getResolveablePromise();
  43281. if (this.browserStorage.records.length > 0) {
  43282. this.fetch({
  43283. 'success': _.bind(this.onCachedBookmarksFetched, this, deferred),
  43284. 'error': _.bind(this.onCachedBookmarksFetched, this, deferred)
  43285. });
  43286. } else if (!window.sessionStorage.getItem(this.fetched_flag)) {
  43287. // There aren't any cached bookmarks and the
  43288. // `fetched_flag` is off, so we query the XMPP server.
  43289. // If nothing is returned from the XMPP server, we set
  43290. // the `fetched_flag` to avoid calling the server again.
  43291. this.fetchBookmarksFromServer(deferred);
  43292. } else {
  43293. deferred.resolve();
  43294. }
  43295. return deferred;
  43296. },
  43297. onCachedBookmarksFetched(deferred) {
  43298. return deferred.resolve();
  43299. },
  43300. createBookmark(options) {
  43301. this.create(options);
  43302. this.sendBookmarkStanza().catch(iq => this.onBookmarkError(iq, options));
  43303. },
  43304. sendBookmarkStanza() {
  43305. const stanza = $iq({
  43306. 'type': 'set',
  43307. 'from': _converse.connection.jid
  43308. }).c('pubsub', {
  43309. 'xmlns': Strophe.NS.PUBSUB
  43310. }).c('publish', {
  43311. 'node': 'storage:bookmarks'
  43312. }).c('item', {
  43313. 'id': 'current'
  43314. }).c('storage', {
  43315. 'xmlns': 'storage:bookmarks'
  43316. });
  43317. this.each(model => {
  43318. stanza.c('conference', {
  43319. 'name': model.get('name'),
  43320. 'autojoin': model.get('autojoin'),
  43321. 'jid': model.get('jid')
  43322. }).c('nick').t(model.get('nick')).up().up();
  43323. });
  43324. stanza.up().up().up();
  43325. stanza.c('publish-options').c('x', {
  43326. 'xmlns': Strophe.NS.XFORM,
  43327. 'type': 'submit'
  43328. }).c('field', {
  43329. 'var': 'FORM_TYPE',
  43330. 'type': 'hidden'
  43331. }).c('value').t('http://jabber.org/protocol/pubsub#publish-options').up().up().c('field', {
  43332. 'var': 'pubsub#persist_items'
  43333. }).c('value').t('true').up().up().c('field', {
  43334. 'var': 'pubsub#access_model'
  43335. }).c('value').t('whitelist');
  43336. return _converse.api.sendIQ(stanza);
  43337. },
  43338. onBookmarkError(iq, options) {
  43339. _converse.log("Error while trying to add bookmark", Strophe.LogLevel.ERROR);
  43340. _converse.log(iq);
  43341. _converse.api.alert.show(Strophe.LogLevel.ERROR, __('Error'), [__("Sorry, something went wrong while trying to save your bookmark.")]);
  43342. this.findWhere({
  43343. 'jid': options.jid
  43344. }).destroy();
  43345. },
  43346. fetchBookmarksFromServer(deferred) {
  43347. const stanza = $iq({
  43348. 'from': _converse.connection.jid,
  43349. 'type': 'get'
  43350. }).c('pubsub', {
  43351. 'xmlns': Strophe.NS.PUBSUB
  43352. }).c('items', {
  43353. 'node': 'storage:bookmarks'
  43354. });
  43355. _converse.api.sendIQ(stanza).then(iq => this.onBookmarksReceived(deferred, iq)).catch(iq => this.onBookmarksReceivedError(deferred, iq));
  43356. },
  43357. markRoomAsBookmarked(bookmark) {
  43358. const groupchat = _converse.chatboxes.get(bookmark.get('jid'));
  43359. if (!_.isUndefined(groupchat)) {
  43360. groupchat.save('bookmarked', true);
  43361. }
  43362. },
  43363. markRoomAsUnbookmarked(bookmark) {
  43364. const groupchat = _converse.chatboxes.get(bookmark.get('jid'));
  43365. if (!_.isUndefined(groupchat)) {
  43366. groupchat.save('bookmarked', false);
  43367. }
  43368. },
  43369. createBookmarksFromStanza(stanza) {
  43370. const bookmarks = sizzle('items[node="storage:bookmarks"] ' + 'item#current ' + 'storage[xmlns="storage:bookmarks"] ' + 'conference', stanza);
  43371. _.forEach(bookmarks, bookmark => {
  43372. const jid = bookmark.getAttribute('jid');
  43373. this.create({
  43374. 'jid': jid,
  43375. 'name': bookmark.getAttribute('name') || jid,
  43376. 'autojoin': bookmark.getAttribute('autojoin') === 'true',
  43377. 'nick': _.get(bookmark.querySelector('nick'), 'textContent')
  43378. });
  43379. });
  43380. },
  43381. onBookmarksReceived(deferred, iq) {
  43382. this.createBookmarksFromStanza(iq);
  43383. if (!_.isUndefined(deferred)) {
  43384. return deferred.resolve();
  43385. }
  43386. },
  43387. onBookmarksReceivedError(deferred, iq) {
  43388. window.sessionStorage.setItem(this.fetched_flag, true);
  43389. _converse.log('Error while fetching bookmarks', Strophe.LogLevel.WARN);
  43390. _converse.log(iq.outerHTML, Strophe.LogLevel.DEBUG);
  43391. if (!_.isNil(deferred)) {
  43392. if (iq.querySelector('error[type="cancel"] item-not-found')) {
  43393. // Not an exception, the user simply doesn't have
  43394. // any bookmarks.
  43395. return deferred.resolve();
  43396. } else {
  43397. return deferred.reject(new Error("Could not fetch bookmarks"));
  43398. }
  43399. }
  43400. }
  43401. });
  43402. _converse.BookmarksList = Backbone.Model.extend({
  43403. defaults: {
  43404. "toggle-state": _converse.OPENED
  43405. }
  43406. });
  43407. _converse.BookmarkView = Backbone.VDOMView.extend({
  43408. toHTML() {
  43409. return templates_bookmark_html__WEBPACK_IMPORTED_MODULE_2___default()({
  43410. 'hidden': _converse.hide_open_bookmarks && _converse.chatboxes.where({
  43411. 'jid': this.model.get('jid')
  43412. }).length,
  43413. 'bookmarked': true,
  43414. 'info_leave_room': __('Leave this groupchat'),
  43415. 'info_remove': __('Remove this bookmark'),
  43416. 'info_remove_bookmark': __('Unbookmark this groupchat'),
  43417. 'info_title': __('Show more information on this groupchat'),
  43418. 'jid': this.model.get('jid'),
  43419. 'name': Strophe.xmlunescape(this.model.get('name')),
  43420. 'open_title': __('Click to open this groupchat')
  43421. });
  43422. }
  43423. });
  43424. _converse.BookmarksView = Backbone.OrderedListView.extend({
  43425. tagName: 'div',
  43426. className: 'bookmarks-list list-container rooms-list-container',
  43427. events: {
  43428. 'click .add-bookmark': 'addBookmark',
  43429. 'click .bookmarks-toggle': 'toggleBookmarksList',
  43430. 'click .remove-bookmark': 'removeBookmark',
  43431. 'click .open-room': 'openRoom'
  43432. },
  43433. listSelector: '.rooms-list',
  43434. ItemView: _converse.BookmarkView,
  43435. subviewIndex: 'jid',
  43436. initialize() {
  43437. Backbone.OrderedListView.prototype.initialize.apply(this, arguments);
  43438. this.model.on('add', this.showOrHide, this);
  43439. this.model.on('remove', this.showOrHide, this);
  43440. _converse.chatboxes.on('add', this.renderBookmarkListElement, this);
  43441. _converse.chatboxes.on('remove', this.renderBookmarkListElement, this);
  43442. const storage = _converse.config.get('storage'),
  43443. id = b64_sha1(`converse.room-bookmarks${_converse.bare_jid}-list-model`);
  43444. this.list_model = new _converse.BookmarksList({
  43445. 'id': id
  43446. });
  43447. this.list_model.browserStorage = new Backbone.BrowserStorage[storage](id);
  43448. this.list_model.fetch();
  43449. this.render();
  43450. this.sortAndPositionAllItems();
  43451. },
  43452. render() {
  43453. this.el.innerHTML = templates_bookmarks_list_html__WEBPACK_IMPORTED_MODULE_3___default()({
  43454. 'toggle_state': this.list_model.get('toggle-state'),
  43455. 'desc_bookmarks': __('Click to toggle the bookmarks list'),
  43456. 'label_bookmarks': __('Bookmarks'),
  43457. '_converse': _converse
  43458. });
  43459. this.showOrHide();
  43460. this.insertIntoControlBox();
  43461. return this;
  43462. },
  43463. insertIntoControlBox() {
  43464. const controlboxview = _converse.chatboxviews.get('controlbox');
  43465. if (!_.isUndefined(controlboxview) && !u.rootContains(_converse.root, this.el)) {
  43466. const el = controlboxview.el.querySelector('.bookmarks-list');
  43467. if (!_.isNull(el)) {
  43468. el.parentNode.replaceChild(this.el, el);
  43469. }
  43470. }
  43471. },
  43472. openRoom(ev) {
  43473. ev.preventDefault();
  43474. const name = ev.target.textContent;
  43475. const jid = ev.target.getAttribute('data-room-jid');
  43476. const data = {
  43477. 'name': name || Strophe.unescapeNode(Strophe.getNodeFromJid(jid)) || jid
  43478. };
  43479. _converse.api.rooms.open(jid, data);
  43480. },
  43481. removeBookmark: _converse.removeBookmarkViaEvent,
  43482. addBookmark: _converse.addBookmarkViaEvent,
  43483. renderBookmarkListElement(chatbox) {
  43484. const bookmarkview = this.get(chatbox.get('jid'));
  43485. if (_.isNil(bookmarkview)) {
  43486. // A chat box has been closed, but we don't have a
  43487. // bookmark for it, so nothing further to do here.
  43488. return;
  43489. }
  43490. bookmarkview.render();
  43491. this.showOrHide();
  43492. },
  43493. showOrHide(item) {
  43494. if (_converse.hide_open_bookmarks) {
  43495. const bookmarks = this.model.filter(bookmark => !_converse.chatboxes.get(bookmark.get('jid')));
  43496. if (!bookmarks.length) {
  43497. u.hideElement(this.el);
  43498. return;
  43499. }
  43500. }
  43501. if (this.model.models.length) {
  43502. u.showElement(this.el);
  43503. }
  43504. },
  43505. toggleBookmarksList(ev) {
  43506. if (ev && ev.preventDefault) {
  43507. ev.preventDefault();
  43508. }
  43509. const icon_el = ev.target.querySelector('.fa');
  43510. if (u.hasClass('fa-caret-down', icon_el)) {
  43511. u.slideIn(this.el.querySelector('.bookmarks'));
  43512. this.list_model.save({
  43513. 'toggle-state': _converse.CLOSED
  43514. });
  43515. icon_el.classList.remove("fa-caret-down");
  43516. icon_el.classList.add("fa-caret-right");
  43517. } else {
  43518. icon_el.classList.remove("fa-caret-right");
  43519. icon_el.classList.add("fa-caret-down");
  43520. u.slideOut(this.el.querySelector('.bookmarks'));
  43521. this.list_model.save({
  43522. 'toggle-state': _converse.OPENED
  43523. });
  43524. }
  43525. }
  43526. });
  43527. _converse.checkBookmarksSupport = async function () {
  43528. const args = await Promise.all([_converse.api.disco.getIdentity('pubsub', 'pep', _converse.bare_jid), _converse.api.disco.supports(Strophe.NS.PUBSUB + '#publish-options', _converse.bare_jid)]);
  43529. return args[0] && (args[1].length || _converse.allow_public_bookmarks);
  43530. };
  43531. const initBookmarks = async function initBookmarks() {
  43532. if (!_converse.allow_bookmarks) {
  43533. return;
  43534. }
  43535. const supported = await _converse.checkBookmarksSupport();
  43536. if (supported) {
  43537. _converse.bookmarks = new _converse.Bookmarks();
  43538. _converse.bookmarksview = new _converse.BookmarksView({
  43539. 'model': _converse.bookmarks
  43540. });
  43541. await _converse.bookmarks.fetchBookmarks();
  43542. }
  43543. _converse.emit('bookmarksInitialized');
  43544. };
  43545. u.onMultipleEvents([{
  43546. 'object': _converse,
  43547. 'event': 'chatBoxesFetched'
  43548. }, {
  43549. 'object': _converse,
  43550. 'event': 'roomsPanelRendered'
  43551. }], initBookmarks);
  43552. _converse.on('clearSession', () => {
  43553. if (!_.isUndefined(_converse.bookmarks)) {
  43554. _converse.bookmarks.browserStorage._clear();
  43555. window.sessionStorage.removeItem(_converse.bookmarks.fetched_flag);
  43556. }
  43557. });
  43558. _converse.on('reconnected', initBookmarks);
  43559. _converse.on('connected', () => {
  43560. // Add a handler for bookmarks pushed from other connected clients
  43561. // (from the same user obviously)
  43562. _converse.connection.addHandler(message => {
  43563. if (sizzle('event[xmlns="' + Strophe.NS.PUBSUB + '#event"] items[node="storage:bookmarks"]', message).length) {
  43564. _converse.api.waitUntil('bookmarksInitialized').then(() => _converse.bookmarks.createBookmarksFromStanza(message)).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
  43565. }
  43566. }, null, 'message', 'headline', null, _converse.bare_jid);
  43567. });
  43568. }
  43569. });
  43570. /***/ }),
  43571. /***/ "./src/converse-caps.js":
  43572. /*!******************************!*\
  43573. !*** ./src/converse-caps.js ***!
  43574. \******************************/
  43575. /*! no exports provided */
  43576. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43577. "use strict";
  43578. __webpack_require__.r(__webpack_exports__);
  43579. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  43580. // Converse.js
  43581. // http://conversejs.org
  43582. //
  43583. // Copyright (c) 2013-2018, the Converse.js developers
  43584. // Licensed under the Mozilla Public License (MPLv2)
  43585. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env,
  43586. Strophe = _converse$env.Strophe,
  43587. $build = _converse$env.$build,
  43588. _ = _converse$env._,
  43589. b64_sha1 = _converse$env.b64_sha1;
  43590. Strophe.addNamespace('CAPS', "http://jabber.org/protocol/caps");
  43591. function propertySort(array, property) {
  43592. return array.sort((a, b) => {
  43593. return a[property] > b[property] ? -1 : 1;
  43594. });
  43595. }
  43596. function generateVerificationString(_converse) {
  43597. const identities = _converse.api.disco.own.identities.get(),
  43598. features = _converse.api.disco.own.features.get();
  43599. if (identities.length > 1) {
  43600. propertySort(identities, "category");
  43601. propertySort(identities, "type");
  43602. propertySort(identities, "lang");
  43603. }
  43604. let S = _.reduce(identities, (result, id) => `${result}${id.category}/${id.type}/${_.get(id, 'lang', '')}/${id.name}<`, "");
  43605. features.sort();
  43606. S = _.reduce(features, (result, feature) => `${result}${feature}<`, S);
  43607. return b64_sha1(S);
  43608. }
  43609. function createCapsNode(_converse) {
  43610. return $build("c", {
  43611. 'xmlns': Strophe.NS.CAPS,
  43612. 'hash': "sha-1",
  43613. 'node': "https://conversejs.org",
  43614. 'ver': generateVerificationString(_converse)
  43615. }).nodeTree;
  43616. }
  43617. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins.add('converse-caps', {
  43618. overrides: {
  43619. // Overrides mentioned here will be picked up by converse.js's
  43620. // plugin architecture they will replace existing methods on the
  43621. // relevant objects or classes.
  43622. XMPPStatus: {
  43623. constructPresence() {
  43624. const presence = this.__super__.constructPresence.apply(this, arguments);
  43625. presence.root().cnode(createCapsNode(this.__super__._converse));
  43626. return presence;
  43627. }
  43628. }
  43629. }
  43630. });
  43631. /***/ }),
  43632. /***/ "./src/converse-chatboxviews.js":
  43633. /*!**************************************!*\
  43634. !*** ./src/converse-chatboxviews.js ***!
  43635. \**************************************/
  43636. /*! no exports provided */
  43637. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43638. "use strict";
  43639. __webpack_require__.r(__webpack_exports__);
  43640. /* harmony import */ var _converse_headless_converse_chatboxes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-chatboxes */ "./src/headless/converse-chatboxes.js");
  43641. /* harmony import */ var backbone_nativeview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! backbone.nativeview */ "./node_modules/backbone.nativeview/backbone.nativeview.js");
  43642. /* harmony import */ var backbone_nativeview__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(backbone_nativeview__WEBPACK_IMPORTED_MODULE_1__);
  43643. /* harmony import */ var backbone_overview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! backbone.overview */ "./node_modules/backbone.overview/backbone.overview.js");
  43644. /* harmony import */ var backbone_overview__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(backbone_overview__WEBPACK_IMPORTED_MODULE_2__);
  43645. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  43646. /* harmony import */ var templates_avatar_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! templates/avatar.svg */ "./src/templates/avatar.svg");
  43647. /* harmony import */ var templates_avatar_svg__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(templates_avatar_svg__WEBPACK_IMPORTED_MODULE_4__);
  43648. /* harmony import */ var templates_chatboxes_html__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! templates/chatboxes.html */ "./src/templates/chatboxes.html");
  43649. /* harmony import */ var templates_chatboxes_html__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(templates_chatboxes_html__WEBPACK_IMPORTED_MODULE_5__);
  43650. // Converse.js
  43651. // http://conversejs.org
  43652. //
  43653. // Copyright (c) 2012-2018, the Converse.js developers
  43654. // Licensed under the Mozilla Public License (MPLv2)
  43655. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].env,
  43656. Backbone = _converse$env.Backbone,
  43657. _ = _converse$env._,
  43658. utils = _converse$env.utils;
  43659. const u = utils;
  43660. const AvatarMixin = {
  43661. renderAvatar(el) {
  43662. el = el || this.el;
  43663. const canvas_el = el.querySelector('canvas');
  43664. if (_.isNull(canvas_el)) {
  43665. return;
  43666. }
  43667. const image_type = this.model.vcard.get('image_type'),
  43668. image = this.model.vcard.get('image');
  43669. canvas_el.outerHTML = templates_avatar_svg__WEBPACK_IMPORTED_MODULE_4___default()({
  43670. 'classes': canvas_el.getAttribute('class'),
  43671. 'width': canvas_el.width,
  43672. 'height': canvas_el.height,
  43673. 'image': "data:" + image_type + ";base64," + image
  43674. });
  43675. }
  43676. };
  43677. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add('converse-chatboxviews', {
  43678. dependencies: ["converse-chatboxes"],
  43679. overrides: {
  43680. // Overrides mentioned here will be picked up by converse.js's
  43681. // plugin architecture they will replace existing methods on the
  43682. // relevant objects or classes.
  43683. initStatus: function initStatus(reconnecting) {
  43684. const _converse = this.__super__._converse;
  43685. if (!reconnecting) {
  43686. _converse.chatboxviews.closeAllChatBoxes();
  43687. }
  43688. return this.__super__.initStatus.apply(this, arguments);
  43689. }
  43690. },
  43691. initialize() {
  43692. /* The initialize function gets called as soon as the plugin is
  43693. * loaded by converse.js's plugin machinery.
  43694. */
  43695. const _converse = this._converse,
  43696. __ = _converse.__;
  43697. _converse.api.promises.add(['chatBoxViewsInitialized']); // Configuration values for this plugin
  43698. // ====================================
  43699. // Refer to docs/source/configuration.rst for explanations of these
  43700. // configuration settings.
  43701. _converse.api.settings.update({
  43702. 'theme': 'default'
  43703. });
  43704. _converse.ViewWithAvatar = Backbone.NativeView.extend(AvatarMixin);
  43705. _converse.VDOMViewWithAvatar = Backbone.VDOMView.extend(AvatarMixin);
  43706. _converse.ChatBoxViews = Backbone.Overview.extend({
  43707. _ensureElement() {
  43708. /* Override method from backbone.js
  43709. * If the #conversejs element doesn't exist, create it.
  43710. */
  43711. if (!this.el) {
  43712. let el = _converse.root.querySelector('#conversejs');
  43713. if (_.isNull(el)) {
  43714. el = document.createElement('div');
  43715. el.setAttribute('id', 'conversejs');
  43716. u.addClass(`theme-${_converse.theme}`, el);
  43717. const body = _converse.root.querySelector('body');
  43718. if (body) {
  43719. body.appendChild(el);
  43720. } else {
  43721. // Perhaps inside a web component?
  43722. _converse.root.appendChild(el);
  43723. }
  43724. }
  43725. el.innerHTML = '';
  43726. this.setElement(el, false);
  43727. } else {
  43728. this.setElement(_.result(this, 'el'), false);
  43729. }
  43730. },
  43731. initialize() {
  43732. this.model.on("destroy", this.removeChat, this);
  43733. this.el.classList.add(`converse-${_converse.view_mode}`);
  43734. this.render();
  43735. },
  43736. render() {
  43737. try {
  43738. this.el.innerHTML = templates_chatboxes_html__WEBPACK_IMPORTED_MODULE_5___default()();
  43739. } catch (e) {
  43740. this._ensureElement();
  43741. this.el.innerHTML = templates_chatboxes_html__WEBPACK_IMPORTED_MODULE_5___default()();
  43742. }
  43743. this.row_el = this.el.querySelector('.row');
  43744. },
  43745. insertRowColumn(el) {
  43746. /* Add a new DOM element (likely a chat box) into the
  43747. * the row managed by this overview.
  43748. */
  43749. this.row_el.insertAdjacentElement('afterBegin', el);
  43750. },
  43751. removeChat(item) {
  43752. this.remove(item.get('id'));
  43753. },
  43754. closeAllChatBoxes() {
  43755. /* This method gets overridden in src/converse-controlbox.js if
  43756. * the controlbox plugin is active.
  43757. */
  43758. this.each(function (view) {
  43759. view.close();
  43760. });
  43761. return this;
  43762. },
  43763. chatBoxMayBeShown(chatbox) {
  43764. return this.model.chatBoxMayBeShown(chatbox);
  43765. }
  43766. });
  43767. /************************ BEGIN Event Handlers ************************/
  43768. _converse.api.listen.on('chatBoxesInitialized', () => {
  43769. _converse.chatboxviews = new _converse.ChatBoxViews({
  43770. 'model': _converse.chatboxes
  43771. });
  43772. _converse.emit('chatBoxViewsInitialized');
  43773. });
  43774. _converse.api.listen.on('clearSession', () => _converse.chatboxviews.closeAllChatBoxes());
  43775. /************************ END Event Handlers ************************/
  43776. }
  43777. });
  43778. /***/ }),
  43779. /***/ "./src/converse-chatview.js":
  43780. /*!**********************************!*\
  43781. !*** ./src/converse-chatview.js ***!
  43782. \**********************************/
  43783. /*! no exports provided */
  43784. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  43785. "use strict";
  43786. __webpack_require__.r(__webpack_exports__);
  43787. /* harmony import */ var converse_chatboxviews__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! converse-chatboxviews */ "./src/converse-chatboxviews.js");
  43788. /* harmony import */ var converse_message_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! converse-message-view */ "./src/converse-message-view.js");
  43789. /* harmony import */ var converse_modal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! converse-modal */ "./src/converse-modal.js");
  43790. /* harmony import */ var twemoji__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! twemoji */ "./node_modules/twemoji/2/esm.js");
  43791. /* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap.native/dist/bootstrap-native-v4.js");
  43792. /* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(bootstrap__WEBPACK_IMPORTED_MODULE_4__);
  43793. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  43794. /* harmony import */ var templates_alert_html__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! templates/alert.html */ "./src/templates/alert.html");
  43795. /* harmony import */ var templates_alert_html__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(templates_alert_html__WEBPACK_IMPORTED_MODULE_6__);
  43796. /* harmony import */ var templates_chatbox_html__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! templates/chatbox.html */ "./src/templates/chatbox.html");
  43797. /* harmony import */ var templates_chatbox_html__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(templates_chatbox_html__WEBPACK_IMPORTED_MODULE_7__);
  43798. /* harmony import */ var templates_chatbox_head_html__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! templates/chatbox_head.html */ "./src/templates/chatbox_head.html");
  43799. /* harmony import */ var templates_chatbox_head_html__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(templates_chatbox_head_html__WEBPACK_IMPORTED_MODULE_8__);
  43800. /* harmony import */ var templates_chatbox_message_form_html__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! templates/chatbox_message_form.html */ "./src/templates/chatbox_message_form.html");
  43801. /* harmony import */ var templates_chatbox_message_form_html__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(templates_chatbox_message_form_html__WEBPACK_IMPORTED_MODULE_9__);
  43802. /* harmony import */ var templates_emojis_html__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! templates/emojis.html */ "./src/templates/emojis.html");
  43803. /* harmony import */ var templates_emojis_html__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(templates_emojis_html__WEBPACK_IMPORTED_MODULE_10__);
  43804. /* harmony import */ var templates_error_message_html__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! templates/error_message.html */ "./src/templates/error_message.html");
  43805. /* harmony import */ var templates_error_message_html__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(templates_error_message_html__WEBPACK_IMPORTED_MODULE_11__);
  43806. /* harmony import */ var templates_help_message_html__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! templates/help_message.html */ "./src/templates/help_message.html");
  43807. /* harmony import */ var templates_help_message_html__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(templates_help_message_html__WEBPACK_IMPORTED_MODULE_12__);
  43808. /* harmony import */ var templates_info_html__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! templates/info.html */ "./src/templates/info.html");
  43809. /* harmony import */ var templates_info_html__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(templates_info_html__WEBPACK_IMPORTED_MODULE_13__);
  43810. /* harmony import */ var templates_new_day_html__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! templates/new_day.html */ "./src/templates/new_day.html");
  43811. /* harmony import */ var templates_new_day_html__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(templates_new_day_html__WEBPACK_IMPORTED_MODULE_14__);
  43812. /* harmony import */ var templates_spinner_html__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! templates/spinner.html */ "./src/templates/spinner.html");
  43813. /* harmony import */ var templates_spinner_html__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(templates_spinner_html__WEBPACK_IMPORTED_MODULE_15__);
  43814. /* harmony import */ var templates_spoiler_button_html__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! templates/spoiler_button.html */ "./src/templates/spoiler_button.html");
  43815. /* harmony import */ var templates_spoiler_button_html__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(templates_spoiler_button_html__WEBPACK_IMPORTED_MODULE_16__);
  43816. /* harmony import */ var templates_status_message_html__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! templates/status_message.html */ "./src/templates/status_message.html");
  43817. /* harmony import */ var templates_status_message_html__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(templates_status_message_html__WEBPACK_IMPORTED_MODULE_17__);
  43818. /* harmony import */ var templates_toolbar_html__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! templates/toolbar.html */ "./src/templates/toolbar.html");
  43819. /* harmony import */ var templates_toolbar_html__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(templates_toolbar_html__WEBPACK_IMPORTED_MODULE_18__);
  43820. /* harmony import */ var templates_toolbar_fileupload_html__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! templates/toolbar_fileupload.html */ "./src/templates/toolbar_fileupload.html");
  43821. /* harmony import */ var templates_toolbar_fileupload_html__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(templates_toolbar_fileupload_html__WEBPACK_IMPORTED_MODULE_19__);
  43822. /* harmony import */ var templates_user_details_modal_html__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! templates/user_details_modal.html */ "./src/templates/user_details_modal.html");
  43823. /* harmony import */ var templates_user_details_modal_html__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(templates_user_details_modal_html__WEBPACK_IMPORTED_MODULE_20__);
  43824. /* harmony import */ var _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @converse/headless/utils/emoji */ "./src/headless/utils/emoji.js");
  43825. /* harmony import */ var xss__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! xss */ "./node_modules/xss/dist/xss.js");
  43826. /* harmony import */ var xss__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(xss__WEBPACK_IMPORTED_MODULE_22__);
  43827. // Converse.js
  43828. // http://conversejs.org
  43829. //
  43830. // Copyright (c) 2013-2018, the Converse.js developers
  43831. // Licensed under the Mozilla Public License (MPLv2)
  43832. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__["default"].env,
  43833. $msg = _converse$env.$msg,
  43834. Backbone = _converse$env.Backbone,
  43835. Promise = _converse$env.Promise,
  43836. Strophe = _converse$env.Strophe,
  43837. _ = _converse$env._,
  43838. b64_sha1 = _converse$env.b64_sha1,
  43839. f = _converse$env.f,
  43840. sizzle = _converse$env.sizzle,
  43841. moment = _converse$env.moment;
  43842. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__["default"].plugins.add('converse-chatview', {
  43843. /* Plugin dependencies are other plugins which might be
  43844. * overridden or relied upon, and therefore need to be loaded before
  43845. * this plugin.
  43846. *
  43847. * If the setting "strict_plugin_dependencies" is set to true,
  43848. * an error will be raised if the plugin is not found. By default it's
  43849. * false, which means these plugins are only loaded opportunistically.
  43850. *
  43851. * NB: These plugins need to have already been loaded via require.js.
  43852. */
  43853. dependencies: ["converse-chatboxviews", "converse-disco", "converse-message-view", "converse-modal"],
  43854. initialize() {
  43855. /* The initialize function gets called as soon as the plugin is
  43856. * loaded by converse.js's plugin machinery.
  43857. */
  43858. const _converse = this._converse,
  43859. __ = _converse.__;
  43860. _converse.api.settings.update({
  43861. 'emoji_image_path': twemoji__WEBPACK_IMPORTED_MODULE_3__["default"].base,
  43862. 'show_send_button': false,
  43863. 'show_toolbar': true,
  43864. 'time_format': 'HH:mm',
  43865. 'use_system_emojis': true,
  43866. 'visible_toolbar_buttons': {
  43867. 'call': false,
  43868. 'clear': true,
  43869. 'emoji': true,
  43870. 'spoiler': true
  43871. }
  43872. });
  43873. twemoji__WEBPACK_IMPORTED_MODULE_3__["default"].base = _converse.emoji_image_path;
  43874. function onWindowStateChanged(data) {
  43875. if (_converse.chatboxviews) {
  43876. _converse.chatboxviews.each(view => {
  43877. if (view.model.get('id') !== 'controlbox') {
  43878. view.onWindowStateChanged(data.state);
  43879. }
  43880. });
  43881. }
  43882. }
  43883. _converse.api.listen.on('windowStateChanged', onWindowStateChanged);
  43884. _converse.EmojiPicker = Backbone.Model.extend({
  43885. defaults: {
  43886. 'current_category': 'people',
  43887. 'current_skintone': '',
  43888. 'scroll_position': 0
  43889. }
  43890. });
  43891. _converse.EmojiPickerView = Backbone.VDOMView.extend({
  43892. className: 'emoji-picker-container',
  43893. events: {
  43894. 'click .emoji-category-picker li.emoji-category': 'chooseCategory',
  43895. 'click .emoji-skintone-picker li.emoji-skintone': 'chooseSkinTone'
  43896. },
  43897. initialize() {
  43898. this.model.on('change:current_skintone', this.render, this);
  43899. this.model.on('change:current_category', this.render, this);
  43900. },
  43901. toHTML() {
  43902. return templates_emojis_html__WEBPACK_IMPORTED_MODULE_10___default()(_.extend(this.model.toJSON(), {
  43903. '_': _,
  43904. 'transform': _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].getEmojiRenderer(_converse),
  43905. 'emojis_by_category': _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].getEmojisByCategory(_converse),
  43906. 'toned_emojis': _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].getTonedEmojis(_converse),
  43907. 'skintones': ['tone1', 'tone2', 'tone3', 'tone4', 'tone5'],
  43908. 'shouldBeHidden': this.shouldBeHidden
  43909. }));
  43910. },
  43911. shouldBeHidden(shortname, current_skintone, toned_emojis) {
  43912. /* Helper method for the template which decides whether an
  43913. * emoji should be hidden, based on which skin tone is
  43914. * currently being applied.
  43915. */
  43916. if (_.includes(shortname, '_tone')) {
  43917. if (!current_skintone || !_.includes(shortname, current_skintone)) {
  43918. return true;
  43919. }
  43920. } else {
  43921. if (current_skintone && _.includes(toned_emojis, shortname)) {
  43922. return true;
  43923. }
  43924. }
  43925. return false;
  43926. },
  43927. chooseSkinTone(ev) {
  43928. ev.preventDefault();
  43929. ev.stopPropagation();
  43930. const target = ev.target.nodeName === 'IMG' ? ev.target.parentElement : ev.target;
  43931. const skintone = target.getAttribute("data-skintone").trim();
  43932. if (this.model.get('current_skintone') === skintone) {
  43933. this.model.save({
  43934. 'current_skintone': ''
  43935. });
  43936. } else {
  43937. this.model.save({
  43938. 'current_skintone': skintone
  43939. });
  43940. }
  43941. },
  43942. chooseCategory(ev) {
  43943. ev.preventDefault();
  43944. ev.stopPropagation();
  43945. const target = ev.target.nodeName === 'IMG' ? ev.target.parentElement : ev.target;
  43946. const category = target.getAttribute("data-category").trim();
  43947. this.model.save({
  43948. 'current_category': category,
  43949. 'scroll_position': 0
  43950. });
  43951. }
  43952. });
  43953. _converse.ChatBoxHeading = _converse.ViewWithAvatar.extend({
  43954. initialize() {
  43955. this.model.on('change:status', this.onStatusMessageChanged, this);
  43956. this.model.vcard.on('change', this.render, this);
  43957. },
  43958. render() {
  43959. this.el.innerHTML = templates_chatbox_head_html__WEBPACK_IMPORTED_MODULE_8___default()(_.extend(this.model.vcard.toJSON(), this.model.toJSON(), {
  43960. '_converse': _converse,
  43961. 'info_close': __('Close this chat box')
  43962. }));
  43963. this.renderAvatar();
  43964. return this;
  43965. },
  43966. onStatusMessageChanged(item) {
  43967. this.render();
  43968. _converse.emit('contactStatusMessageChanged', {
  43969. 'contact': item.attributes,
  43970. 'message': item.get('status')
  43971. });
  43972. }
  43973. });
  43974. _converse.UserDetailsModal = _converse.BootstrapModal.extend({
  43975. events: {
  43976. 'click button.remove-contact': 'removeContact',
  43977. 'click button.refresh-contact': 'refreshContact',
  43978. 'click .fingerprint-trust .btn input': 'toggleDeviceTrust'
  43979. },
  43980. initialize() {
  43981. _converse.BootstrapModal.prototype.initialize.apply(this, arguments);
  43982. this.model.on('contactAdded', this.registerContactEventHandlers, this);
  43983. this.model.on('change', this.render, this);
  43984. this.registerContactEventHandlers();
  43985. _converse.emit('userDetailsModalInitialized', this.model);
  43986. },
  43987. toHTML() {
  43988. return templates_user_details_modal_html__WEBPACK_IMPORTED_MODULE_20___default()(_.extend(this.model.toJSON(), this.model.vcard.toJSON(), {
  43989. '_': _,
  43990. '__': __,
  43991. 'view': this,
  43992. '_converse': _converse,
  43993. 'allow_contact_removal': _converse.allow_contact_removal,
  43994. 'display_name': this.model.getDisplayName(),
  43995. 'is_roster_contact': !_.isUndefined(this.model.contact),
  43996. 'utils': _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"]
  43997. }));
  43998. },
  43999. registerContactEventHandlers() {
  44000. if (!_.isUndefined(this.model.contact)) {
  44001. this.model.contact.on('change', this.render, this);
  44002. this.model.contact.vcard.on('change', this.render, this);
  44003. this.model.contact.on('destroy', () => {
  44004. delete this.model.contact;
  44005. this.render();
  44006. });
  44007. }
  44008. },
  44009. async refreshContact(ev) {
  44010. if (ev && ev.preventDefault) {
  44011. ev.preventDefault();
  44012. }
  44013. const refresh_icon = this.el.querySelector('.fa-refresh');
  44014. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].addClass('fa-spin', refresh_icon);
  44015. try {
  44016. await _converse.api.vcard.update(this.model.contact.vcard, true);
  44017. } catch (e) {
  44018. _converse.log(e, Strophe.LogLevel.FATAL);
  44019. this.el.querySelector('.modal-body').insertAdjacentHTML('afterBegin', templates_alert_html__WEBPACK_IMPORTED_MODULE_6___default()({
  44020. 'type': 'alert-danger',
  44021. 'message': __('Sorry, something went wrong while trying to refresh')
  44022. }));
  44023. }
  44024. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].removeClass('fa-spin', refresh_icon);
  44025. },
  44026. removeContact(ev) {
  44027. if (ev && ev.preventDefault) {
  44028. ev.preventDefault();
  44029. }
  44030. if (!_converse.allow_contact_removal) {
  44031. return;
  44032. }
  44033. const result = confirm(__("Are you sure you want to remove this contact?"));
  44034. if (result === true) {
  44035. this.modal.hide();
  44036. this.model.contact.removeFromRoster(iq => {
  44037. this.model.contact.destroy();
  44038. }, err => {
  44039. _converse.log(err, Strophe.LogLevel.ERROR);
  44040. _converse.api.alert.show(Strophe.LogLevel.ERROR, __('Error'), [__('Sorry, there was an error while trying to remove %1$s as a contact.', this.model.contact.getDisplayName())]);
  44041. });
  44042. }
  44043. }
  44044. });
  44045. _converse.ChatBoxView = Backbone.NativeView.extend({
  44046. length: 200,
  44047. className: 'chatbox hidden',
  44048. is_chatroom: false,
  44049. // Leaky abstraction from MUC
  44050. events: {
  44051. 'change input.fileupload': 'onFileSelection',
  44052. 'click .chat-msg__action-edit': 'onMessageEditButtonClicked',
  44053. 'click .chatbox-navback': 'showControlBox',
  44054. 'click .close-chatbox-button': 'close',
  44055. 'click .new-msgs-indicator': 'viewUnreadMessages',
  44056. 'click .send-button': 'onFormSubmitted',
  44057. 'click .show-user-details-modal': 'showUserDetailsModal',
  44058. 'click .spoiler-toggle': 'toggleSpoilerMessage',
  44059. 'click .toggle-call': 'toggleCall',
  44060. 'click .toggle-clear': 'clearMessages',
  44061. 'click .toggle-compose-spoiler': 'toggleComposeSpoilerMessage',
  44062. 'click .toggle-smiley ul.emoji-picker li': 'insertEmoji',
  44063. 'click .toggle-smiley': 'toggleEmojiMenu',
  44064. 'click .upload-file': 'toggleFileUpload',
  44065. 'input .chat-textarea': 'inputChanged',
  44066. 'keydown .chat-textarea': 'keyPressed',
  44067. 'dragover .chat-textarea': 'onDragOver',
  44068. 'drop .chat-textarea': 'onDrop'
  44069. },
  44070. initialize() {
  44071. this.initDebounced();
  44072. this.model.messages.on('add', this.onMessageAdded, this);
  44073. this.model.messages.on('rendered', this.scrollDown, this);
  44074. this.model.on('show', this.show, this);
  44075. this.model.on('destroy', this.remove, this);
  44076. this.model.presence.on('change:show', this.onPresenceChanged, this);
  44077. this.model.on('showHelpMessages', this.showHelpMessages, this);
  44078. this.render();
  44079. this.fetchMessages();
  44080. _converse.emit('chatBoxOpened', this);
  44081. _converse.emit('chatBoxInitialized', this);
  44082. },
  44083. initDebounced() {
  44084. this.scrollDown = _.debounce(this._scrollDown, 250);
  44085. this.markScrolled = _.debounce(this._markScrolled, 100);
  44086. this.show = _.debounce(this._show, 250, {
  44087. 'leading': true
  44088. });
  44089. },
  44090. render() {
  44091. // XXX: Is this still needed?
  44092. this.el.setAttribute('id', this.model.get('box_id'));
  44093. this.el.innerHTML = templates_chatbox_html__WEBPACK_IMPORTED_MODULE_7___default()(_.extend(this.model.toJSON(), {
  44094. 'unread_msgs': __('You have unread messages')
  44095. }));
  44096. this.content = this.el.querySelector('.chat-content');
  44097. this.renderMessageForm();
  44098. this.insertHeading();
  44099. return this;
  44100. },
  44101. renderToolbar(toolbar, options) {
  44102. if (!_converse.show_toolbar) {
  44103. return this;
  44104. }
  44105. toolbar = toolbar || templates_toolbar_html__WEBPACK_IMPORTED_MODULE_18___default.a;
  44106. options = _.assign(this.model.toJSON(), this.getToolbarOptions(options || {}));
  44107. this.el.querySelector('.chat-toolbar').innerHTML = toolbar(options);
  44108. this.addSpoilerButton(options);
  44109. this.addFileUploadButton();
  44110. _converse.emit('renderToolbar', this);
  44111. return this;
  44112. },
  44113. renderMessageForm() {
  44114. let placeholder;
  44115. if (this.model.get('composing_spoiler')) {
  44116. placeholder = __('Hidden message');
  44117. } else {
  44118. placeholder = __('Message');
  44119. }
  44120. const form_container = this.el.querySelector('.message-form-container');
  44121. form_container.innerHTML = templates_chatbox_message_form_html__WEBPACK_IMPORTED_MODULE_9___default()(_.extend(this.model.toJSON(), {
  44122. 'hint_value': _.get(this.el.querySelector('.spoiler-hint'), 'value'),
  44123. 'label_message': placeholder,
  44124. 'label_send': __('Send'),
  44125. 'label_spoiler_hint': __('Optional hint'),
  44126. 'message_value': _.get(this.el.querySelector('.chat-textarea'), 'value'),
  44127. 'show_send_button': _converse.show_send_button,
  44128. 'show_toolbar': _converse.show_toolbar,
  44129. 'unread_msgs': __('You have unread messages')
  44130. }));
  44131. this.renderToolbar();
  44132. },
  44133. showControlBox() {
  44134. // Used in mobile view, to navigate back to the controlbox
  44135. const view = _converse.chatboxviews.get('controlbox');
  44136. view.show();
  44137. this.hide();
  44138. },
  44139. showUserDetailsModal(ev) {
  44140. ev.preventDefault();
  44141. if (_.isUndefined(this.user_details_modal)) {
  44142. this.user_details_modal = new _converse.UserDetailsModal({
  44143. model: this.model
  44144. });
  44145. }
  44146. this.user_details_modal.show(ev);
  44147. },
  44148. toggleFileUpload(ev) {
  44149. this.el.querySelector('input.fileupload').click();
  44150. },
  44151. onFileSelection(evt) {
  44152. this.model.sendFiles(evt.target.files);
  44153. },
  44154. onDragOver(evt) {
  44155. evt.preventDefault();
  44156. },
  44157. onDrop(evt) {
  44158. if (evt.dataTransfer.files.length == 0) // There are no files to be dropped, so this isn’t a file
  44159. // transfer operation.
  44160. return;
  44161. evt.preventDefault();
  44162. this.model.sendFiles(evt.dataTransfer.files);
  44163. },
  44164. async addFileUploadButton(options) {
  44165. const result = await _converse.api.disco.supports(Strophe.NS.HTTPUPLOAD, _converse.domain);
  44166. if (result.length) {
  44167. this.el.querySelector('.chat-toolbar').insertAdjacentHTML('beforeend', templates_toolbar_fileupload_html__WEBPACK_IMPORTED_MODULE_19___default()({
  44168. 'tooltip_upload_file': __('Choose a file to send')
  44169. }));
  44170. }
  44171. },
  44172. async addSpoilerButton(options) {
  44173. /* Asynchronously adds a button for writing spoiler
  44174. * messages, based on whether the contact's client supports
  44175. * it.
  44176. */
  44177. if (!options.show_spoiler_button || this.model.get('type') === _converse.CHATROOMS_TYPE) {
  44178. return;
  44179. }
  44180. const contact_jid = this.model.get('jid');
  44181. const resources = this.model.presence.get('resources');
  44182. if (_.isEmpty(resources)) {
  44183. return;
  44184. }
  44185. const results = await Promise.all(_.map(_.keys(resources), resource => _converse.api.disco.supports(Strophe.NS.SPOILER, `${contact_jid}/${resource}`)));
  44186. if (_.filter(results, 'length').length) {
  44187. const html = templates_spoiler_button_html__WEBPACK_IMPORTED_MODULE_16___default()(this.model.toJSON());
  44188. if (_converse.visible_toolbar_buttons.emoji) {
  44189. this.el.querySelector('.toggle-smiley').insertAdjacentHTML('afterEnd', html);
  44190. } else {
  44191. this.el.querySelector('.chat-toolbar').insertAdjacentHTML('afterBegin', html);
  44192. }
  44193. }
  44194. },
  44195. insertHeading() {
  44196. this.heading = new _converse.ChatBoxHeading({
  44197. 'model': this.model
  44198. });
  44199. this.heading.render();
  44200. this.heading.chatview = this;
  44201. if (!_.isUndefined(this.model.contact)) {
  44202. this.model.contact.on('destroy', this.heading.render, this);
  44203. }
  44204. const flyout = this.el.querySelector('.flyout');
  44205. flyout.insertBefore(this.heading.el, flyout.querySelector('.chat-body'));
  44206. return this;
  44207. },
  44208. getToolbarOptions(options) {
  44209. let label_toggle_spoiler;
  44210. if (this.model.get('composing_spoiler')) {
  44211. label_toggle_spoiler = __('Click to write as a normal (non-spoiler) message');
  44212. } else {
  44213. label_toggle_spoiler = __('Click to write your message as a spoiler');
  44214. }
  44215. return _.extend(options || {}, {
  44216. 'label_clear': __('Clear all messages'),
  44217. 'tooltip_insert_smiley': __('Insert emojis'),
  44218. 'tooltip_start_call': __('Start a call'),
  44219. 'label_toggle_spoiler': label_toggle_spoiler,
  44220. 'show_call_button': _converse.visible_toolbar_buttons.call,
  44221. 'show_spoiler_button': _converse.visible_toolbar_buttons.spoiler,
  44222. 'use_emoji': _converse.visible_toolbar_buttons.emoji
  44223. });
  44224. },
  44225. afterMessagesFetched() {
  44226. this.insertIntoDOM();
  44227. this.scrollDown();
  44228. this.content.addEventListener('scroll', this.markScrolled.bind(this));
  44229. _converse.emit('afterMessagesFetched', this);
  44230. },
  44231. fetchMessages() {
  44232. this.model.messages.fetch({
  44233. 'add': true,
  44234. 'success': this.afterMessagesFetched.bind(this),
  44235. 'error': this.afterMessagesFetched.bind(this)
  44236. });
  44237. return this;
  44238. },
  44239. insertIntoDOM() {
  44240. /* This method gets overridden in src/converse-controlbox.js
  44241. * as well as src/converse-muc.js (if those plugins are
  44242. * enabled).
  44243. */
  44244. _converse.chatboxviews.insertRowColumn(this.el);
  44245. return this;
  44246. },
  44247. showChatEvent(message) {
  44248. const isodate = moment().format();
  44249. this.content.insertAdjacentHTML('beforeend', templates_info_html__WEBPACK_IMPORTED_MODULE_13___default()({
  44250. 'extra_classes': 'chat-event',
  44251. 'message': message,
  44252. 'isodate': isodate
  44253. }));
  44254. this.insertDayIndicator(this.content.lastElementChild);
  44255. this.scrollDown();
  44256. return isodate;
  44257. },
  44258. showErrorMessage(message) {
  44259. this.content.insertAdjacentHTML('beforeend', templates_error_message_html__WEBPACK_IMPORTED_MODULE_11___default()({
  44260. 'message': message,
  44261. 'isodate': moment().format()
  44262. }));
  44263. this.scrollDown();
  44264. },
  44265. addSpinner(append = false) {
  44266. if (_.isNull(this.el.querySelector('.spinner'))) {
  44267. if (append) {
  44268. this.content.insertAdjacentHTML('beforeend', templates_spinner_html__WEBPACK_IMPORTED_MODULE_15___default()());
  44269. this.scrollDown();
  44270. } else {
  44271. this.content.insertAdjacentHTML('afterbegin', templates_spinner_html__WEBPACK_IMPORTED_MODULE_15___default()());
  44272. }
  44273. }
  44274. },
  44275. clearSpinner() {
  44276. _.each(this.content.querySelectorAll('span.spinner'), el => el.parentNode.removeChild(el));
  44277. },
  44278. insertDayIndicator(next_msg_el) {
  44279. /* Inserts an indicator into the chat area, showing the
  44280. * day as given by the passed in date.
  44281. *
  44282. * The indicator is only inserted if necessary.
  44283. *
  44284. * Parameters:
  44285. * (HTMLElement) next_msg_el - The message element before
  44286. * which the day indicator element must be inserted.
  44287. * This element must have a "data-isodate" attribute
  44288. * which specifies its creation date.
  44289. */
  44290. const prev_msg_el = _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].getPreviousElement(next_msg_el, ".message:not(.chat-state-notification)"),
  44291. prev_msg_date = _.isNull(prev_msg_el) ? null : prev_msg_el.getAttribute('data-isodate'),
  44292. next_msg_date = next_msg_el.getAttribute('data-isodate');
  44293. if (_.isNull(prev_msg_date) && _.isNull(next_msg_date)) {
  44294. return;
  44295. }
  44296. if (_.isNull(prev_msg_date) || moment(next_msg_date).isAfter(prev_msg_date, 'day')) {
  44297. const day_date = moment(next_msg_date).startOf('day');
  44298. next_msg_el.insertAdjacentHTML('beforeBegin', templates_new_day_html__WEBPACK_IMPORTED_MODULE_14___default()({
  44299. 'isodate': day_date.format(),
  44300. 'datestring': day_date.format("dddd MMM Do YYYY")
  44301. }));
  44302. }
  44303. },
  44304. getLastMessageDate(cutoff) {
  44305. /* Return the ISO8601 format date of the latest message.
  44306. *
  44307. * Parameters:
  44308. * (Object) cutoff: Moment Date cutoff date. The last
  44309. * message received cutoff this date will be returned.
  44310. */
  44311. const first_msg = _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].getFirstChildElement(this.content, '.message:not(.chat-state-notification)'),
  44312. oldest_date = first_msg ? first_msg.getAttribute('data-isodate') : null;
  44313. if (!_.isNull(oldest_date) && moment(oldest_date).isAfter(cutoff)) {
  44314. return null;
  44315. }
  44316. const last_msg = _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].getLastChildElement(this.content, '.message:not(.chat-state-notification)'),
  44317. most_recent_date = last_msg ? last_msg.getAttribute('data-isodate') : null;
  44318. if (_.isNull(most_recent_date) || moment(most_recent_date).isBefore(cutoff)) {
  44319. return most_recent_date;
  44320. }
  44321. /* XXX: We avoid .chat-state-notification messages, since they are
  44322. * temporary and get removed once a new element is
  44323. * inserted into the chat area, so we don't query for
  44324. * them here, otherwise we get a null reference later
  44325. * upon element insertion.
  44326. */
  44327. const msg_dates = _.invokeMap(sizzle('.message:not(.chat-state-notification)', this.content), Element.prototype.getAttribute, 'data-isodate');
  44328. if (_.isObject(cutoff)) {
  44329. cutoff = cutoff.format();
  44330. }
  44331. msg_dates.push(cutoff);
  44332. msg_dates.sort();
  44333. const idx = msg_dates.lastIndexOf(cutoff);
  44334. if (idx === 0) {
  44335. return null;
  44336. } else {
  44337. return msg_dates[idx - 1];
  44338. }
  44339. },
  44340. setScrollPosition(message_el) {
  44341. /* Given a newly inserted message, determine whether we
  44342. * should keep the scrollbar in place (so as to not scroll
  44343. * up when using infinite scroll).
  44344. */
  44345. if (this.model.get('scrolled')) {
  44346. const next_msg_el = _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].getNextElement(message_el, ".chat-msg");
  44347. if (next_msg_el) {
  44348. // The currently received message is not new, there
  44349. // are newer messages after it. So let's see if we
  44350. // should maintain our current scroll position.
  44351. if (this.content.scrollTop === 0 || this.model.get('top_visible_message')) {
  44352. const top_visible_message = this.model.get('top_visible_message') || next_msg_el;
  44353. this.model.set('top_visible_message', top_visible_message);
  44354. this.content.scrollTop = top_visible_message.offsetTop - 30;
  44355. }
  44356. }
  44357. } else {
  44358. this.scrollDown();
  44359. }
  44360. },
  44361. showHelpMessages(msgs, type, spinner) {
  44362. _.each(msgs, msg => {
  44363. this.content.insertAdjacentHTML('beforeend', templates_help_message_html__WEBPACK_IMPORTED_MODULE_12___default()({
  44364. 'isodate': moment().format(),
  44365. 'type': type,
  44366. 'message': xss__WEBPACK_IMPORTED_MODULE_22___default.a.filterXSS(msg, {
  44367. 'whiteList': {
  44368. 'strong': []
  44369. }
  44370. })
  44371. }));
  44372. });
  44373. if (spinner === true) {
  44374. this.addSpinner();
  44375. } else if (spinner === false) {
  44376. this.clearSpinner();
  44377. }
  44378. return this.scrollDown();
  44379. },
  44380. clearChatStateNotification(message, isodate) {
  44381. if (isodate) {
  44382. _.each(sizzle(`.chat-state-notification[data-csn="${message.get('from')}"][data-isodate="${isodate}"]`, this.content), _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].removeElement);
  44383. } else {
  44384. _.each(sizzle(`.chat-state-notification[data-csn="${message.get('from')}"]`, this.content), _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].removeElement);
  44385. }
  44386. },
  44387. shouldShowOnTextMessage() {
  44388. return !_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].isVisible(this.el);
  44389. },
  44390. insertMessage(view) {
  44391. /* Given a view representing a message, insert it into the
  44392. * content area of the chat box.
  44393. *
  44394. * Parameters:
  44395. * (Backbone.View) message: The message Backbone.View
  44396. */
  44397. if (view.model.get('type') === 'error') {
  44398. const previous_msg_el = this.content.querySelector(`[data-msgid="${view.model.get('msgid')}"]`);
  44399. if (previous_msg_el) {
  44400. previous_msg_el.insertAdjacentElement('afterend', view.el);
  44401. return this.trigger('messageInserted', view.el);
  44402. }
  44403. }
  44404. const current_msg_date = moment(view.model.get('time')) || moment,
  44405. previous_msg_date = this.getLastMessageDate(current_msg_date);
  44406. if (_.isNull(previous_msg_date)) {
  44407. this.content.insertAdjacentElement('afterbegin', view.el);
  44408. } else {
  44409. const previous_msg_el = sizzle(`[data-isodate="${previous_msg_date}"]:last`, this.content).pop();
  44410. if (view.model.get('type') === 'error' && _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].hasClass('chat-error', previous_msg_el) && previous_msg_el.textContent === view.model.get('message')) {
  44411. // We don't show a duplicate error message
  44412. return;
  44413. }
  44414. previous_msg_el.insertAdjacentElement('afterend', view.el);
  44415. this.markFollowups(view.el);
  44416. }
  44417. return this.trigger('messageInserted', view.el);
  44418. },
  44419. markFollowups(el) {
  44420. /* Given a message element, determine wether it should be
  44421. * marked as a followup message to the previous element.
  44422. *
  44423. * Also determine whether the element following it is a
  44424. * followup message or not.
  44425. *
  44426. * Followup messages are subsequent ones written by the same
  44427. * author with no other conversation elements inbetween and
  44428. * posted within 10 minutes of one another.
  44429. *
  44430. * Parameters:
  44431. * (HTMLElement) el - The message element.
  44432. */
  44433. const from = el.getAttribute('data-from'),
  44434. previous_el = el.previousElementSibling,
  44435. date = moment(el.getAttribute('data-isodate')),
  44436. next_el = el.nextElementSibling;
  44437. if (!_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].hasClass('chat-msg--action', el) && !_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].hasClass('chat-msg--action', previous_el) && previous_el.getAttribute('data-from') === from && date.isBefore(moment(previous_el.getAttribute('data-isodate')).add(10, 'minutes')) && el.getAttribute('data-encrypted') === previous_el.getAttribute('data-encrypted')) {
  44438. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].addClass('chat-msg--followup', el);
  44439. }
  44440. if (!next_el) {
  44441. return;
  44442. }
  44443. if (!_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].hasClass('chat-msg--action', 'el') && next_el.getAttribute('data-from') === from && moment(next_el.getAttribute('data-isodate')).isBefore(date.add(10, 'minutes')) && el.getAttribute('data-encrypted') === next_el.getAttribute('data-encrypted')) {
  44444. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].addClass('chat-msg--followup', next_el);
  44445. } else {
  44446. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].removeClass('chat-msg--followup', next_el);
  44447. }
  44448. },
  44449. async showMessage(message) {
  44450. /* Inserts a chat message into the content area of the chat box.
  44451. *
  44452. * Will also insert a new day indicator if the message is on a
  44453. * different day.
  44454. *
  44455. * Parameters:
  44456. * (Backbone.Model) message: The message object
  44457. */
  44458. const view = new _converse.MessageView({
  44459. 'model': message
  44460. });
  44461. await view.render();
  44462. this.clearChatStateNotification(message);
  44463. if (!view.el.innerHTML) {
  44464. // An "inactive" CSN message (for example) will have an
  44465. // empty body. No need to then continue.
  44466. return _converse.log("Not inserting a message with empty element", Strophe.LogLevel.INFO);
  44467. }
  44468. this.insertMessage(view);
  44469. this.insertDayIndicator(view.el);
  44470. this.setScrollPosition(view.el);
  44471. if (_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].isNewMessage(message)) {
  44472. if (message.get('sender') === 'me') {
  44473. // We remove the "scrolled" flag so that the chat area
  44474. // gets scrolled down. We always want to scroll down
  44475. // when the user writes a message as opposed to when a
  44476. // message is received.
  44477. this.model.set('scrolled', false);
  44478. } else if (this.model.get('scrolled', true) && !_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].isOnlyChatStateNotification(message)) {
  44479. this.showNewMessagesIndicator();
  44480. }
  44481. }
  44482. if (this.shouldShowOnTextMessage()) {
  44483. this.show();
  44484. } else {
  44485. this.scrollDown();
  44486. }
  44487. },
  44488. onMessageAdded(message) {
  44489. /* Handler that gets called when a new message object is created.
  44490. *
  44491. * Parameters:
  44492. * (Object) message - The message Backbone object that was added.
  44493. */
  44494. this.showMessage(message);
  44495. if (message.get('correcting')) {
  44496. this.insertIntoTextArea(message.get('message'), true, true);
  44497. }
  44498. _converse.emit('messageAdded', {
  44499. 'message': message,
  44500. 'chatbox': this.model
  44501. });
  44502. },
  44503. parseMessageForCommands(text) {
  44504. const match = text.replace(/^\s*/, "").match(/^\/(.*)\s*$/);
  44505. if (match) {
  44506. if (match[1] === "clear") {
  44507. this.clearMessages();
  44508. return true;
  44509. } else if (match[1] === "help") {
  44510. const msgs = [`<strong>/clear</strong>: ${__('Remove messages')}`, `<strong>/me</strong>: ${__('Write in the third person')}`, `<strong>/help</strong>: ${__('Show this menu')}`];
  44511. this.showHelpMessages(msgs);
  44512. return true;
  44513. }
  44514. }
  44515. },
  44516. onMessageSubmitted(text, spoiler_hint) {
  44517. /* This method gets called once the user has typed a message
  44518. * and then pressed enter in a chat box.
  44519. *
  44520. * Parameters:
  44521. * (String) text - The chat message text.
  44522. * (String) spoiler_hint - A hint in case the message
  44523. * text is a hidden/spoiler message. See XEP-0382
  44524. */
  44525. if (!_converse.connection.authenticated) {
  44526. return this.showHelpMessages(['Sorry, the connection has been lost, ' + 'and your message could not be sent'], 'error');
  44527. }
  44528. if (this.parseMessageForCommands(text)) {
  44529. return;
  44530. }
  44531. const attrs = this.model.getOutgoingMessageAttributes(text, spoiler_hint);
  44532. this.model.sendMessage(attrs);
  44533. },
  44534. setChatState(state, options) {
  44535. /* Mutator for setting the chat state of this chat session.
  44536. * Handles clearing of any chat state notification timeouts and
  44537. * setting new ones if necessary.
  44538. * Timeouts are set when the state being set is COMPOSING or PAUSED.
  44539. * After the timeout, COMPOSING will become PAUSED and PAUSED will become INACTIVE.
  44540. * See XEP-0085 Chat State Notifications.
  44541. *
  44542. * Parameters:
  44543. * (string) state - The chat state (consts ACTIVE, COMPOSING, PAUSED, INACTIVE, GONE)
  44544. */
  44545. if (!_.isUndefined(this.chat_state_timeout)) {
  44546. window.clearTimeout(this.chat_state_timeout);
  44547. delete this.chat_state_timeout;
  44548. }
  44549. if (state === _converse.COMPOSING) {
  44550. this.chat_state_timeout = window.setTimeout(this.setChatState.bind(this), _converse.TIMEOUTS.PAUSED, _converse.PAUSED);
  44551. } else if (state === _converse.PAUSED) {
  44552. this.chat_state_timeout = window.setTimeout(this.setChatState.bind(this), _converse.TIMEOUTS.INACTIVE, _converse.INACTIVE);
  44553. }
  44554. this.model.set('chat_state', state, options);
  44555. return this;
  44556. },
  44557. onFormSubmitted(ev) {
  44558. ev.preventDefault();
  44559. const textarea = this.el.querySelector('.chat-textarea'),
  44560. message = textarea.value;
  44561. if (!message.replace(/\s/g, '').length) {
  44562. return;
  44563. }
  44564. let spoiler_hint;
  44565. if (this.model.get('composing_spoiler')) {
  44566. const hint_el = this.el.querySelector('form.sendXMPPMessage input.spoiler-hint');
  44567. spoiler_hint = hint_el.value;
  44568. hint_el.value = '';
  44569. }
  44570. textarea.value = '';
  44571. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].removeClass('correcting', textarea);
  44572. textarea.focus(); // Trigger input event, so that the textarea resizes
  44573. const event = document.createEvent('Event');
  44574. event.initEvent('input', true, true);
  44575. textarea.dispatchEvent(event);
  44576. this.onMessageSubmitted(message, spoiler_hint);
  44577. _converse.emit('messageSend', message); // Suppress events, otherwise superfluous CSN gets set
  44578. // immediately after the message, causing rate-limiting issues.
  44579. this.setChatState(_converse.ACTIVE, {
  44580. 'silent': true
  44581. });
  44582. },
  44583. keyPressed(ev) {
  44584. /* Event handler for when a key is pressed in a chat box textarea.
  44585. */
  44586. if (ev.ctrlKey) {
  44587. // When ctrl is pressed, no chars are entered into the textarea.
  44588. return;
  44589. }
  44590. if (!ev.shiftKey && !ev.altKey) {
  44591. if (ev.keyCode === _converse.keycodes.FORWARD_SLASH) {
  44592. // Forward slash is used to run commands. Nothing to do here.
  44593. return;
  44594. } else if (ev.keyCode === _converse.keycodes.ESCAPE) {
  44595. return this.onEscapePressed(ev);
  44596. } else if (ev.keyCode === _converse.keycodes.ENTER) {
  44597. if (this.emoji_dropdown && _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].isVisible(this.emoji_dropdown.el.querySelector('.emoji-picker'))) {
  44598. this.emoji_dropdown.toggle();
  44599. }
  44600. return this.onFormSubmitted(ev);
  44601. } else if (ev.keyCode === _converse.keycodes.UP_ARROW && !ev.target.selectionEnd) {
  44602. return this.editEarlierMessage();
  44603. } else if (ev.keyCode === _converse.keycodes.DOWN_ARROW && ev.target.selectionEnd === ev.target.value.length) {
  44604. return this.editLaterMessage();
  44605. }
  44606. }
  44607. if (_.includes([_converse.keycodes.SHIFT, _converse.keycodes.META, _converse.keycodes.META_RIGHT, _converse.keycodes.ESCAPE, _converse.keycodes.ALT], ev.keyCode)) {
  44608. return;
  44609. }
  44610. if (this.model.get('chat_state') !== _converse.COMPOSING) {
  44611. // Set chat state to composing if keyCode is not a forward-slash
  44612. // (which would imply an internal command and not a message).
  44613. this.setChatState(_converse.COMPOSING);
  44614. }
  44615. },
  44616. getOwnMessages() {
  44617. return f(this.model.messages.filter({
  44618. 'sender': 'me'
  44619. }));
  44620. },
  44621. onEscapePressed(ev) {
  44622. ev.preventDefault();
  44623. const idx = this.model.messages.findLastIndex('correcting'),
  44624. message = idx >= 0 ? this.model.messages.at(idx) : null;
  44625. if (message) {
  44626. message.save('correcting', false);
  44627. }
  44628. this.insertIntoTextArea('', true, false);
  44629. },
  44630. onMessageEditButtonClicked(ev) {
  44631. ev.preventDefault();
  44632. const idx = this.model.messages.findLastIndex('correcting'),
  44633. currently_correcting = idx >= 0 ? this.model.messages.at(idx) : null,
  44634. message_el = _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].ancestor(ev.target, '.chat-msg'),
  44635. message = this.model.messages.findWhere({
  44636. 'msgid': message_el.getAttribute('data-msgid')
  44637. });
  44638. if (currently_correcting !== message) {
  44639. if (!_.isNil(currently_correcting)) {
  44640. currently_correcting.save('correcting', false);
  44641. }
  44642. message.save('correcting', true);
  44643. this.insertIntoTextArea(_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].prefixMentions(message), true, true);
  44644. } else {
  44645. message.save('correcting', false);
  44646. this.insertIntoTextArea('', true, false);
  44647. }
  44648. },
  44649. editLaterMessage() {
  44650. let message;
  44651. let idx = this.model.messages.findLastIndex('correcting');
  44652. if (idx >= 0) {
  44653. this.model.messages.at(idx).save('correcting', false);
  44654. while (idx < this.model.messages.length - 1) {
  44655. idx += 1;
  44656. const candidate = this.model.messages.at(idx);
  44657. if (candidate.get('sender') === 'me' && candidate.get('message')) {
  44658. message = candidate;
  44659. break;
  44660. }
  44661. }
  44662. }
  44663. if (message) {
  44664. this.insertIntoTextArea(message.get('message'), true, true);
  44665. message.save('correcting', true);
  44666. } else {
  44667. this.insertIntoTextArea('', true, false);
  44668. }
  44669. },
  44670. editEarlierMessage() {
  44671. let message;
  44672. let idx = this.model.messages.findLastIndex('correcting');
  44673. if (idx >= 0) {
  44674. this.model.messages.at(idx).save('correcting', false);
  44675. while (idx > 0) {
  44676. idx -= 1;
  44677. const candidate = this.model.messages.at(idx);
  44678. if (candidate.get('sender') === 'me' && candidate.get('message')) {
  44679. message = candidate;
  44680. break;
  44681. }
  44682. }
  44683. }
  44684. message = message || this.getOwnMessages().findLast(msg => msg.get('message'));
  44685. if (message) {
  44686. this.insertIntoTextArea(message.get('message'), true, true);
  44687. message.save('correcting', true);
  44688. }
  44689. },
  44690. inputChanged(ev) {
  44691. ev.target.style.height = 'auto'; // Fixes weirdness
  44692. ev.target.style.height = ev.target.scrollHeight + 'px';
  44693. },
  44694. clearMessages(ev) {
  44695. if (ev && ev.preventDefault) {
  44696. ev.preventDefault();
  44697. }
  44698. const result = confirm(__("Are you sure you want to clear the messages from this conversation?"));
  44699. if (result === true) {
  44700. this.content.innerHTML = '';
  44701. this.model.messages.reset();
  44702. this.model.messages.browserStorage._clear();
  44703. }
  44704. return this;
  44705. },
  44706. insertIntoTextArea(value, replace = false, correcting = false) {
  44707. const textarea = this.el.querySelector('.chat-textarea');
  44708. if (correcting) {
  44709. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].addClass('correcting', textarea);
  44710. } else {
  44711. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].removeClass('correcting', textarea);
  44712. }
  44713. if (replace) {
  44714. textarea.value = '';
  44715. textarea.value = value;
  44716. } else {
  44717. let existing = textarea.value;
  44718. if (existing && existing[existing.length - 1] !== ' ') {
  44719. existing = existing + ' ';
  44720. }
  44721. textarea.value = '';
  44722. textarea.value = existing + value + ' ';
  44723. }
  44724. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].putCurserAtEnd(textarea);
  44725. },
  44726. createEmojiPicker() {
  44727. if (_.isUndefined(_converse.emojipicker)) {
  44728. const storage = _converse.config.get('storage'),
  44729. id = `converse.emoji-${_converse.bare_jid}`;
  44730. _converse.emojipicker = new _converse.EmojiPicker({
  44731. 'id': id
  44732. });
  44733. _converse.emojipicker.browserStorage = new Backbone.BrowserStorage[storage](id);
  44734. _converse.emojipicker.fetch();
  44735. }
  44736. this.emoji_picker_view = new _converse.EmojiPickerView({
  44737. 'model': _converse.emojipicker
  44738. });
  44739. },
  44740. insertEmoji(ev) {
  44741. ev.preventDefault();
  44742. ev.stopPropagation();
  44743. const target = ev.target.nodeName === 'IMG' ? ev.target.parentElement : ev.target;
  44744. this.insertIntoTextArea(target.getAttribute('data-emoji'));
  44745. },
  44746. toggleEmojiMenu(ev) {
  44747. if (_.isUndefined(this.emoji_dropdown)) {
  44748. ev.stopPropagation();
  44749. this.createEmojiPicker();
  44750. this.insertEmojiPicker();
  44751. this.renderEmojiPicker();
  44752. const dropdown_el = this.el.querySelector('.toggle-smiley.dropup');
  44753. this.emoji_dropdown = new bootstrap__WEBPACK_IMPORTED_MODULE_4___default.a.Dropdown(dropdown_el, true);
  44754. this.emoji_dropdown.el = dropdown_el;
  44755. this.emoji_dropdown.toggle();
  44756. }
  44757. },
  44758. toggleCall(ev) {
  44759. ev.stopPropagation();
  44760. _converse.emit('callButtonClicked', {
  44761. connection: _converse.connection,
  44762. model: this.model
  44763. });
  44764. },
  44765. toggleComposeSpoilerMessage() {
  44766. this.model.set('composing_spoiler', !this.model.get('composing_spoiler'));
  44767. this.renderMessageForm();
  44768. this.focus();
  44769. },
  44770. toggleSpoilerMessage(ev) {
  44771. if (ev && ev.preventDefault) {
  44772. ev.preventDefault();
  44773. }
  44774. const toggle_el = ev.target,
  44775. icon_el = toggle_el.firstElementChild;
  44776. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].slideToggleElement(toggle_el.parentElement.parentElement.querySelector('.spoiler'));
  44777. if (toggle_el.getAttribute("data-toggle-state") == "closed") {
  44778. toggle_el.textContent = 'Show less';
  44779. icon_el.classList.remove("fa-eye");
  44780. icon_el.classList.add("fa-eye-slash");
  44781. toggle_el.insertAdjacentElement('afterBegin', icon_el);
  44782. toggle_el.setAttribute("data-toggle-state", "open");
  44783. } else {
  44784. toggle_el.textContent = 'Show more';
  44785. icon_el.classList.remove("fa-eye-slash");
  44786. icon_el.classList.add("fa-eye");
  44787. toggle_el.insertAdjacentElement('afterBegin', icon_el);
  44788. toggle_el.setAttribute("data-toggle-state", "closed");
  44789. }
  44790. },
  44791. onPresenceChanged(item) {
  44792. const show = item.get('show'),
  44793. fullname = this.model.getDisplayName();
  44794. let text;
  44795. if (_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].isVisible(this.el)) {
  44796. if (show === 'offline') {
  44797. text = __('%1$s has gone offline', fullname);
  44798. } else if (show === 'away') {
  44799. text = __('%1$s has gone away', fullname);
  44800. } else if (show === 'dnd') {
  44801. text = __('%1$s is busy', fullname);
  44802. } else if (show === 'online') {
  44803. text = __('%1$s is online', fullname);
  44804. }
  44805. if (text) {
  44806. this.content.insertAdjacentHTML('beforeend', templates_status_message_html__WEBPACK_IMPORTED_MODULE_17___default()({
  44807. 'message': text,
  44808. 'isodate': moment().format()
  44809. }));
  44810. this.scrollDown();
  44811. }
  44812. }
  44813. },
  44814. close(ev) {
  44815. if (ev && ev.preventDefault) {
  44816. ev.preventDefault();
  44817. }
  44818. if (Backbone.history.getFragment() === "converse/chat?jid=" + this.model.get('jid')) {
  44819. _converse.router.navigate('');
  44820. }
  44821. if (_converse.connection.connected) {
  44822. // Immediately sending the chat state, because the
  44823. // model is going to be destroyed afterwards.
  44824. this.setChatState(_converse.INACTIVE);
  44825. this.model.sendChatState();
  44826. }
  44827. try {
  44828. this.model.destroy();
  44829. } catch (e) {
  44830. _converse.log(e, Strophe.LogLevel.ERROR);
  44831. }
  44832. this.remove();
  44833. _converse.emit('chatBoxClosed', this);
  44834. return this;
  44835. },
  44836. renderEmojiPicker() {
  44837. this.emoji_picker_view.render();
  44838. },
  44839. insertEmojiPicker() {
  44840. var picker_el = this.el.querySelector('.emoji-picker');
  44841. if (!_.isNull(picker_el)) {
  44842. picker_el.innerHTML = '';
  44843. picker_el.appendChild(this.emoji_picker_view.el);
  44844. }
  44845. },
  44846. focus() {
  44847. const textarea_el = this.el.querySelector('.chat-textarea');
  44848. if (!_.isNull(textarea_el)) {
  44849. textarea_el.focus();
  44850. _converse.emit('chatBoxFocused', this);
  44851. }
  44852. return this;
  44853. },
  44854. hide() {
  44855. this.el.classList.add('hidden');
  44856. return this;
  44857. },
  44858. afterShown() {
  44859. this.model.clearUnreadMsgCounter();
  44860. this.setChatState(_converse.ACTIVE);
  44861. this.scrollDown();
  44862. this.focus();
  44863. },
  44864. _show(f) {
  44865. /* Inner show method that gets debounced */
  44866. if (_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].isVisible(this.el)) {
  44867. this.focus();
  44868. return;
  44869. }
  44870. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].fadeIn(this.el, _.bind(this.afterShown, this));
  44871. },
  44872. showNewMessagesIndicator() {
  44873. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].showElement(this.el.querySelector('.new-msgs-indicator'));
  44874. },
  44875. hideNewMessagesIndicator() {
  44876. const new_msgs_indicator = this.el.querySelector('.new-msgs-indicator');
  44877. if (!_.isNull(new_msgs_indicator)) {
  44878. new_msgs_indicator.classList.add('hidden');
  44879. }
  44880. },
  44881. _markScrolled: function _markScrolled(ev) {
  44882. /* Called when the chat content is scrolled up or down.
  44883. * We want to record when the user has scrolled away from
  44884. * the bottom, so that we don't automatically scroll away
  44885. * from what the user is reading when new messages are
  44886. * received.
  44887. */
  44888. if (ev && ev.preventDefault) {
  44889. ev.preventDefault();
  44890. }
  44891. let scrolled = true;
  44892. const is_at_bottom = this.content.scrollTop + this.content.clientHeight >= this.content.scrollHeight - 62; // sigh...
  44893. if (is_at_bottom) {
  44894. scrolled = false;
  44895. this.onScrolledDown();
  44896. }
  44897. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].safeSave(this.model, {
  44898. 'scrolled': scrolled,
  44899. 'top_visible_message': null
  44900. });
  44901. },
  44902. viewUnreadMessages() {
  44903. this.model.save({
  44904. 'scrolled': false,
  44905. 'top_visible_message': null
  44906. });
  44907. this.scrollDown();
  44908. },
  44909. _scrollDown() {
  44910. /* Inner method that gets debounced */
  44911. if (_.isUndefined(this.content)) {
  44912. return;
  44913. }
  44914. if (_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_21__["default"].isVisible(this.content) && !this.model.get('scrolled')) {
  44915. this.content.scrollTop = this.content.scrollHeight;
  44916. }
  44917. },
  44918. onScrolledDown() {
  44919. this.hideNewMessagesIndicator();
  44920. if (_converse.windowState !== 'hidden') {
  44921. this.model.clearUnreadMsgCounter();
  44922. }
  44923. _converse.emit('chatBoxScrolledDown', {
  44924. 'chatbox': this.model
  44925. });
  44926. },
  44927. onWindowStateChanged(state) {
  44928. if (state === 'visible') {
  44929. if (!this.model.isHidden()) {
  44930. this.setChatState(_converse.ACTIVE);
  44931. if (this.model.get('num_unread', 0)) {
  44932. this.model.clearUnreadMsgCounter();
  44933. }
  44934. }
  44935. } else if (state === 'hidden') {
  44936. this.setChatState(_converse.INACTIVE, {
  44937. 'silent': true
  44938. });
  44939. this.model.sendChatState();
  44940. }
  44941. }
  44942. });
  44943. _converse.on('chatBoxViewsInitialized', () => {
  44944. const that = _converse.chatboxviews;
  44945. _converse.chatboxes.on('add', item => {
  44946. if (!that.get(item.get('id')) && item.get('type') === _converse.PRIVATE_CHAT_TYPE) {
  44947. that.add(item.get('id'), new _converse.ChatBoxView({
  44948. model: item
  44949. }));
  44950. }
  44951. });
  44952. });
  44953. _converse.on('connected', () => {
  44954. // Advertise that we support XEP-0382 Message Spoilers
  44955. _converse.api.disco.own.features.add(Strophe.NS.SPOILER);
  44956. });
  44957. /************************ BEGIN API ************************/
  44958. _.extend(_converse.api, {
  44959. /**
  44960. * The "chatview" namespace groups methods pertaining to views
  44961. * for one-on-one chats.
  44962. *
  44963. * @namespace _converse.api.chatviews
  44964. * @memberOf _converse.api
  44965. */
  44966. 'chatviews': {
  44967. /**
  44968. * Get the view of an already open chat.
  44969. *
  44970. * @method _converse.api.chatviews.get
  44971. * @returns {ChatBoxView} A [Backbone.View](http://backbonejs.org/#View) instance.
  44972. * The chat should already be open, otherwise `undefined` will be returned.
  44973. *
  44974. * @example
  44975. * // To return a single view, provide the JID of the contact:
  44976. * _converse.api.chatviews.get('buddy@example.com')
  44977. *
  44978. * @example
  44979. * // To return an array of views, provide an array of JIDs:
  44980. * _converse.api.chatviews.get(['buddy1@example.com', 'buddy2@example.com'])
  44981. */
  44982. 'get'(jids) {
  44983. if (_.isUndefined(jids)) {
  44984. _converse.log("chats.create: You need to provide at least one JID", Strophe.LogLevel.ERROR);
  44985. return null;
  44986. }
  44987. if (_.isString(jids)) {
  44988. return _converse.chatboxviews.get(jids);
  44989. }
  44990. return _.map(jids, jid => _converse.chatboxviews.get(jids));
  44991. }
  44992. }
  44993. });
  44994. /************************ END API ************************/
  44995. }
  44996. });
  44997. /***/ }),
  44998. /***/ "./src/converse-controlbox.js":
  44999. /*!************************************!*\
  45000. !*** ./src/converse-controlbox.js ***!
  45001. \************************************/
  45002. /*! no exports provided */
  45003. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45004. "use strict";
  45005. __webpack_require__.r(__webpack_exports__);
  45006. /* harmony import */ var converse_chatview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! converse-chatview */ "./src/converse-chatview.js");
  45007. /* harmony import */ var converse_profile__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! converse-profile */ "./src/converse-profile.js");
  45008. /* harmony import */ var converse_rosterview__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! converse-rosterview */ "./src/converse-rosterview.js");
  45009. /* harmony import */ var formdata_polyfill__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! formdata-polyfill */ "./node_modules/formdata-polyfill/FormData.js");
  45010. /* harmony import */ var formdata_polyfill__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(formdata_polyfill__WEBPACK_IMPORTED_MODULE_3__);
  45011. /* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap.native/dist/bootstrap-native-v4.js");
  45012. /* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(bootstrap__WEBPACK_IMPORTED_MODULE_4__);
  45013. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  45014. /* harmony import */ var _converse_headless_lodash_fp__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @converse/headless/lodash.fp */ "./src/headless/lodash.fp.js");
  45015. /* harmony import */ var _converse_headless_lodash_fp__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_converse_headless_lodash_fp__WEBPACK_IMPORTED_MODULE_6__);
  45016. /* harmony import */ var templates_converse_brand_heading_html__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! templates/converse_brand_heading.html */ "./src/templates/converse_brand_heading.html");
  45017. /* harmony import */ var templates_converse_brand_heading_html__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(templates_converse_brand_heading_html__WEBPACK_IMPORTED_MODULE_7__);
  45018. /* harmony import */ var templates_controlbox_html__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! templates/controlbox.html */ "./src/templates/controlbox.html");
  45019. /* harmony import */ var templates_controlbox_html__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(templates_controlbox_html__WEBPACK_IMPORTED_MODULE_8__);
  45020. /* harmony import */ var templates_controlbox_toggle_html__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! templates/controlbox_toggle.html */ "./src/templates/controlbox_toggle.html");
  45021. /* harmony import */ var templates_controlbox_toggle_html__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(templates_controlbox_toggle_html__WEBPACK_IMPORTED_MODULE_9__);
  45022. /* harmony import */ var templates_login_panel_html__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! templates/login_panel.html */ "./src/templates/login_panel.html");
  45023. /* harmony import */ var templates_login_panel_html__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(templates_login_panel_html__WEBPACK_IMPORTED_MODULE_10__);
  45024. // Converse.js (A browser based XMPP chat client)
  45025. // http://conversejs.org
  45026. //
  45027. // Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
  45028. // Licensed under the Mozilla Public License (MPLv2)
  45029. //
  45030. /*global define */
  45031. const CHATBOX_TYPE = 'chatbox';
  45032. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__["default"].env,
  45033. Strophe = _converse$env.Strophe,
  45034. Backbone = _converse$env.Backbone,
  45035. Promise = _converse$env.Promise,
  45036. _ = _converse$env._,
  45037. moment = _converse$env.moment;
  45038. const u = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__["default"].env.utils;
  45039. const CONNECTION_STATUS_CSS_CLASS = {
  45040. 'Error': 'error',
  45041. 'Connecting': 'info',
  45042. 'Connection failure': 'error',
  45043. 'Authenticating': 'info',
  45044. 'Authentication failure': 'error',
  45045. 'Connected': 'info',
  45046. 'Disconnected': 'error',
  45047. 'Disconnecting': 'warn',
  45048. 'Attached': 'info',
  45049. 'Redirect': 'info',
  45050. 'Reconnecting': 'warn'
  45051. };
  45052. const PRETTY_CONNECTION_STATUS = {
  45053. 0: 'Error',
  45054. 1: 'Connecting',
  45055. 2: 'Connection failure',
  45056. 3: 'Authenticating',
  45057. 4: 'Authentication failure',
  45058. 5: 'Connected',
  45059. 6: 'Disconnected',
  45060. 7: 'Disconnecting',
  45061. 8: 'Attached',
  45062. 9: 'Redirect',
  45063. 10: 'Reconnecting'
  45064. };
  45065. const REPORTABLE_STATUSES = [0, // ERROR'
  45066. 1, // CONNECTING
  45067. 2, // CONNFAIL
  45068. 3, // AUTHENTICATING
  45069. 4, // AUTHFAIL
  45070. 7, // DISCONNECTING
  45071. 10 // RECONNECTING
  45072. ];
  45073. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__["default"].plugins.add('converse-controlbox', {
  45074. /* Plugin dependencies are other plugins which might be
  45075. * overridden or relied upon, and therefore need to be loaded before
  45076. * this plugin.
  45077. *
  45078. * If the setting "strict_plugin_dependencies" is set to true,
  45079. * an error will be raised if the plugin is not found. By default it's
  45080. * false, which means these plugins are only loaded opportunistically.
  45081. *
  45082. * NB: These plugins need to have already been loaded via require.js.
  45083. */
  45084. dependencies: ["converse-modal", "converse-chatboxes", "converse-rosterview", "converse-chatview"],
  45085. enabled(_converse) {
  45086. return _converse.view_mode !== 'embedded';
  45087. },
  45088. overrides: {
  45089. // Overrides mentioned here will be picked up by converse.js's
  45090. // plugin architecture they will replace existing methods on the
  45091. // relevant objects or classes.
  45092. //
  45093. // New functions which don't exist yet can also be added.
  45094. tearDown() {
  45095. this.__super__.tearDown.apply(this, arguments);
  45096. if (this.rosterview) {
  45097. // Removes roster groups
  45098. this.rosterview.model.off().reset();
  45099. this.rosterview.each(function (groupview) {
  45100. groupview.removeAll();
  45101. groupview.remove();
  45102. });
  45103. this.rosterview.removeAll().remove();
  45104. }
  45105. },
  45106. ChatBoxes: {
  45107. model(attrs, options) {
  45108. const _converse = this.__super__._converse;
  45109. if (attrs.id == 'controlbox') {
  45110. return new _converse.ControlBox(attrs, options);
  45111. } else {
  45112. return this.__super__.model.apply(this, arguments);
  45113. }
  45114. },
  45115. chatBoxMayBeShown(chatbox) {
  45116. return this.__super__.chatBoxMayBeShown.apply(this, arguments) && chatbox.get('id') !== 'controlbox';
  45117. }
  45118. },
  45119. ChatBoxViews: {
  45120. closeAllChatBoxes() {
  45121. const _converse = this.__super__._converse;
  45122. this.each(function (view) {
  45123. if (view.model.get('id') === 'controlbox' && (_converse.disconnection_cause !== _converse.LOGOUT || _converse.show_controlbox_by_default)) {
  45124. return;
  45125. }
  45126. view.close();
  45127. });
  45128. return this;
  45129. },
  45130. getChatBoxWidth(view) {
  45131. const _converse = this.__super__._converse;
  45132. const controlbox = this.get('controlbox');
  45133. if (view.model.get('id') === 'controlbox') {
  45134. /* We return the width of the controlbox or its toggle,
  45135. * depending on which is visible.
  45136. */
  45137. if (!controlbox || !u.isVisible(controlbox.el)) {
  45138. return u.getOuterWidth(_converse.controlboxtoggle.el, true);
  45139. } else {
  45140. return u.getOuterWidth(controlbox.el, true);
  45141. }
  45142. } else {
  45143. return this.__super__.getChatBoxWidth.apply(this, arguments);
  45144. }
  45145. }
  45146. },
  45147. ChatBox: {
  45148. validate(attrs, options) {
  45149. const _converse = this.__super__._converse;
  45150. if (attrs.type === _converse.CONTROLBOX_TYPE) {
  45151. if (_converse.view_mode === 'embedded') {
  45152. return 'Controlbox not relevant in embedded view mode';
  45153. }
  45154. return;
  45155. }
  45156. return this.__super__.validate.apply(this, arguments);
  45157. },
  45158. initialize() {
  45159. if (this.get('id') === 'controlbox') {
  45160. this.set({
  45161. 'time_opened': moment(0).valueOf()
  45162. });
  45163. } else {
  45164. this.__super__.initialize.apply(this, arguments);
  45165. }
  45166. }
  45167. },
  45168. ChatBoxView: {
  45169. insertIntoDOM() {
  45170. const view = this.__super__._converse.chatboxviews.get("controlbox");
  45171. if (view) {
  45172. view.el.insertAdjacentElement('afterend', this.el);
  45173. } else {
  45174. this.__super__.insertIntoDOM.apply(this, arguments);
  45175. }
  45176. return this;
  45177. }
  45178. }
  45179. },
  45180. initialize() {
  45181. /* The initialize function gets called as soon as the plugin is
  45182. * loaded by converse.js's plugin machinery.
  45183. */
  45184. const _converse = this._converse,
  45185. __ = _converse.__;
  45186. _converse.api.settings.update({
  45187. allow_logout: true,
  45188. default_domain: undefined,
  45189. locked_domain: undefined,
  45190. show_controlbox_by_default: false,
  45191. sticky_controlbox: false
  45192. });
  45193. _converse.api.promises.add('controlboxInitialized');
  45194. const addControlBox = () => _converse.chatboxes.add({
  45195. 'id': 'controlbox'
  45196. });
  45197. _converse.ControlBox = _converse.ChatBox.extend({
  45198. defaults: {
  45199. 'bookmarked': false,
  45200. 'box_id': 'controlbox',
  45201. 'chat_state': undefined,
  45202. 'closed': !_converse.show_controlbox_by_default,
  45203. 'num_unread': 0,
  45204. 'type': _converse.CONTROLBOX_TYPE,
  45205. 'url': ''
  45206. },
  45207. initialize() {
  45208. u.safeSave(this, {
  45209. 'time_opened': this.get('time_opened') || moment().valueOf()
  45210. });
  45211. }
  45212. });
  45213. _converse.ControlBoxView = _converse.ChatBoxView.extend({
  45214. tagName: 'div',
  45215. className: 'chatbox',
  45216. id: 'controlbox',
  45217. events: {
  45218. 'click a.close-chatbox-button': 'close'
  45219. },
  45220. initialize() {
  45221. if (_.isUndefined(_converse.controlboxtoggle)) {
  45222. _converse.controlboxtoggle = new _converse.ControlBoxToggle();
  45223. }
  45224. _converse.controlboxtoggle.el.insertAdjacentElement('afterend', this.el);
  45225. this.model.on('change:connected', this.onConnected, this);
  45226. this.model.on('destroy', this.hide, this);
  45227. this.model.on('hide', this.hide, this);
  45228. this.model.on('show', this.show, this);
  45229. this.model.on('change:closed', this.ensureClosedState, this);
  45230. this.render();
  45231. if (this.model.get('connected')) {
  45232. this.insertRoster();
  45233. }
  45234. _converse.emit('controlboxInitialized', this);
  45235. },
  45236. render() {
  45237. if (this.model.get('connected')) {
  45238. if (_.isUndefined(this.model.get('closed'))) {
  45239. this.model.set('closed', !_converse.show_controlbox_by_default);
  45240. }
  45241. }
  45242. this.el.innerHTML = templates_controlbox_html__WEBPACK_IMPORTED_MODULE_8___default()(_.extend(this.model.toJSON()));
  45243. if (!this.model.get('closed')) {
  45244. this.show();
  45245. } else {
  45246. this.hide();
  45247. }
  45248. if (!_converse.connection.connected || !_converse.connection.authenticated || _converse.connection.disconnecting) {
  45249. this.renderLoginPanel();
  45250. } else if (this.model.get('connected') && (!this.controlbox_pane || !u.isVisible(this.controlbox_pane.el))) {
  45251. this.renderControlBoxPane();
  45252. }
  45253. return this;
  45254. },
  45255. onConnected() {
  45256. if (this.model.get('connected')) {
  45257. this.render();
  45258. this.insertRoster();
  45259. }
  45260. },
  45261. insertRoster() {
  45262. if (_converse.authentication === _converse.ANONYMOUS) {
  45263. return;
  45264. }
  45265. /* Place the rosterview inside the "Contacts" panel. */
  45266. _converse.api.waitUntil('rosterViewInitialized').then(() => this.controlbox_pane.el.insertAdjacentElement('beforeEnd', _converse.rosterview.el)).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
  45267. },
  45268. createBrandHeadingHTML() {
  45269. return templates_converse_brand_heading_html__WEBPACK_IMPORTED_MODULE_7___default()({
  45270. 'sticky_controlbox': _converse.sticky_controlbox
  45271. });
  45272. },
  45273. insertBrandHeading() {
  45274. const heading_el = this.el.querySelector('.brand-heading-container');
  45275. if (_.isNull(heading_el)) {
  45276. const el = this.el.querySelector('.controlbox-head');
  45277. el.insertAdjacentHTML('beforeend', this.createBrandHeadingHTML());
  45278. } else {
  45279. heading_el.outerHTML = this.createBrandHeadingHTML();
  45280. }
  45281. },
  45282. renderLoginPanel() {
  45283. this.el.classList.add("logged-out");
  45284. if (_.isNil(this.loginpanel)) {
  45285. this.loginpanel = new _converse.LoginPanel({
  45286. 'model': new _converse.LoginPanelModel()
  45287. });
  45288. const panes = this.el.querySelector('.controlbox-panes');
  45289. panes.innerHTML = '';
  45290. panes.appendChild(this.loginpanel.render().el);
  45291. this.insertBrandHeading();
  45292. } else {
  45293. this.loginpanel.render();
  45294. }
  45295. this.loginpanel.initPopovers();
  45296. return this;
  45297. },
  45298. renderControlBoxPane() {
  45299. /* Renders the "Contacts" panel of the controlbox.
  45300. *
  45301. * This will only be called after the user has already been
  45302. * logged in.
  45303. */
  45304. if (this.loginpanel) {
  45305. this.loginpanel.remove();
  45306. delete this.loginpanel;
  45307. }
  45308. this.el.classList.remove("logged-out");
  45309. this.controlbox_pane = new _converse.ControlBoxPane();
  45310. this.el.querySelector('.controlbox-panes').insertAdjacentElement('afterBegin', this.controlbox_pane.el);
  45311. },
  45312. close(ev) {
  45313. if (ev && ev.preventDefault) {
  45314. ev.preventDefault();
  45315. }
  45316. if (_converse.sticky_controlbox) {
  45317. return;
  45318. }
  45319. if (_converse.connection.connected && !_converse.connection.disconnecting) {
  45320. this.model.save({
  45321. 'closed': true
  45322. });
  45323. } else {
  45324. this.model.trigger('hide');
  45325. }
  45326. _converse.emit('controlBoxClosed', this);
  45327. return this;
  45328. },
  45329. ensureClosedState() {
  45330. if (this.model.get('closed')) {
  45331. this.hide();
  45332. } else {
  45333. this.show();
  45334. }
  45335. },
  45336. hide(callback) {
  45337. if (_converse.sticky_controlbox) {
  45338. return;
  45339. }
  45340. u.addClass('hidden', this.el);
  45341. _converse.emit('chatBoxClosed', this);
  45342. if (!_converse.connection.connected) {
  45343. _converse.controlboxtoggle.render();
  45344. }
  45345. _converse.controlboxtoggle.show(callback);
  45346. return this;
  45347. },
  45348. onControlBoxToggleHidden() {
  45349. this.model.set('closed', false);
  45350. this.el.classList.remove('hidden');
  45351. _converse.emit('controlBoxOpened', this);
  45352. },
  45353. show() {
  45354. _converse.controlboxtoggle.hide(this.onControlBoxToggleHidden.bind(this));
  45355. return this;
  45356. },
  45357. showHelpMessages() {
  45358. /* Override showHelpMessages in ChatBoxView, for now do nothing.
  45359. *
  45360. * Parameters:
  45361. * (Array) msgs: Array of messages
  45362. */
  45363. return;
  45364. }
  45365. });
  45366. _converse.LoginPanelModel = Backbone.Model.extend({
  45367. defaults: {
  45368. // Passed-by-reference. Fine in this case because there's
  45369. // only one such model.
  45370. 'errors': []
  45371. }
  45372. });
  45373. _converse.LoginPanel = Backbone.VDOMView.extend({
  45374. tagName: 'div',
  45375. id: "converse-login-panel",
  45376. className: 'controlbox-pane fade-in',
  45377. events: {
  45378. 'submit form#converse-login': 'authenticate',
  45379. 'change input': 'validate'
  45380. },
  45381. initialize(cfg) {
  45382. this.model.on('change', this.render, this);
  45383. this.listenTo(_converse.connfeedback, 'change', this.render);
  45384. this.render();
  45385. },
  45386. toHTML() {
  45387. const connection_status = _converse.connfeedback.get('connection_status');
  45388. let feedback_class, pretty_status;
  45389. if (_.includes(REPORTABLE_STATUSES, connection_status)) {
  45390. pretty_status = PRETTY_CONNECTION_STATUS[connection_status];
  45391. feedback_class = CONNECTION_STATUS_CSS_CLASS[pretty_status];
  45392. }
  45393. return templates_login_panel_html__WEBPACK_IMPORTED_MODULE_10___default()(_.extend(this.model.toJSON(), {
  45394. '__': __,
  45395. '_converse': _converse,
  45396. 'ANONYMOUS': _converse.ANONYMOUS,
  45397. 'EXTERNAL': _converse.EXTERNAL,
  45398. 'LOGIN': _converse.LOGIN,
  45399. 'PREBIND': _converse.PREBIND,
  45400. 'auto_login': _converse.auto_login,
  45401. 'authentication': _converse.authentication,
  45402. 'connection_status': connection_status,
  45403. 'conn_feedback_class': feedback_class,
  45404. 'conn_feedback_subject': pretty_status,
  45405. 'conn_feedback_message': _converse.connfeedback.get('message'),
  45406. 'placeholder_username': (_converse.locked_domain || _converse.default_domain) && __('Username') || __('user@domain'),
  45407. 'show_trust_checkbox': _converse.trusted !== 'on' && _converse.trusted !== 'off'
  45408. }));
  45409. },
  45410. initPopovers() {
  45411. _.forEach(this.el.querySelectorAll('[data-title]'), el => {
  45412. const popover = new bootstrap__WEBPACK_IMPORTED_MODULE_4___default.a.Popover(el, {
  45413. 'trigger': _converse.view_mode === 'mobile' && 'click' || 'hover',
  45414. 'dismissible': _converse.view_mode === 'mobile' && true || false,
  45415. 'container': this.el.parentElement.parentElement.parentElement
  45416. });
  45417. });
  45418. },
  45419. validate() {
  45420. const form = this.el.querySelector('form');
  45421. const jid_element = form.querySelector('input[name=jid]');
  45422. if (jid_element.value && !_converse.locked_domain && !_converse.default_domain && !u.isValidJID(jid_element.value)) {
  45423. jid_element.setCustomValidity(__('Please enter a valid XMPP address'));
  45424. return false;
  45425. }
  45426. jid_element.setCustomValidity('');
  45427. return true;
  45428. },
  45429. authenticate(ev) {
  45430. /* Authenticate the user based on a form submission event.
  45431. */
  45432. if (ev && ev.preventDefault) {
  45433. ev.preventDefault();
  45434. }
  45435. if (_converse.authentication === _converse.ANONYMOUS) {
  45436. this.connect(_converse.jid, null);
  45437. return;
  45438. }
  45439. if (!this.validate()) {
  45440. return;
  45441. }
  45442. const form_data = new FormData(ev.target);
  45443. if (_converse.trusted === 'on' || _converse.trusted === 'off') {
  45444. _converse.config.save({
  45445. 'trusted': _converse.trusted === 'on',
  45446. 'storage': _converse.trusted === 'on' ? 'local' : 'session'
  45447. });
  45448. } else {
  45449. _converse.config.save({
  45450. 'trusted': form_data.get('trusted') && true || false,
  45451. 'storage': form_data.get('trusted') ? 'local' : 'session'
  45452. });
  45453. }
  45454. let jid = form_data.get('jid');
  45455. if (_converse.locked_domain) {
  45456. const last_part = '@' + _converse.locked_domain;
  45457. if (jid.endsWith(last_part)) {
  45458. jid = jid.substr(0, jid.length - last_part.length);
  45459. }
  45460. jid = Strophe.escapeNode(jid) + last_part;
  45461. } else if (_converse.default_domain && !_.includes(jid, '@')) {
  45462. jid = jid + '@' + _converse.default_domain;
  45463. }
  45464. this.connect(jid, form_data.get('password'));
  45465. },
  45466. connect(jid, password) {
  45467. if (jid) {
  45468. const resource = Strophe.getResourceFromJid(jid);
  45469. if (!resource) {
  45470. jid = jid.toLowerCase() + _converse.generateResource();
  45471. } else {
  45472. jid = Strophe.getBareJidFromJid(jid).toLowerCase() + '/' + resource;
  45473. }
  45474. }
  45475. if (_.includes(["converse/login", "converse/register"], Backbone.history.getFragment())) {
  45476. _converse.router.navigate('', {
  45477. 'replace': true
  45478. });
  45479. }
  45480. _converse.connection.reset();
  45481. _converse.connection.connect(jid, password, _converse.onConnectStatusChanged);
  45482. }
  45483. });
  45484. _converse.ControlBoxPane = Backbone.NativeView.extend({
  45485. tagName: 'div',
  45486. className: 'controlbox-pane',
  45487. initialize() {
  45488. _converse.xmppstatusview = new _converse.XMPPStatusView({
  45489. 'model': _converse.xmppstatus
  45490. });
  45491. this.el.insertAdjacentElement('afterBegin', _converse.xmppstatusview.render().el);
  45492. }
  45493. });
  45494. _converse.ControlBoxToggle = Backbone.NativeView.extend({
  45495. tagName: 'a',
  45496. className: 'toggle-controlbox hidden',
  45497. id: 'toggle-controlbox',
  45498. events: {
  45499. 'click': 'onClick'
  45500. },
  45501. attributes: {
  45502. 'href': "#"
  45503. },
  45504. initialize() {
  45505. _converse.chatboxviews.insertRowColumn(this.render().el);
  45506. _converse.api.waitUntil('initialized').then(this.render.bind(this)).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
  45507. },
  45508. render() {
  45509. // We let the render method of ControlBoxView decide whether
  45510. // the ControlBox or the Toggle must be shown. This prevents
  45511. // artifacts (i.e. on page load the toggle is shown only to then
  45512. // seconds later be hidden in favor of the controlbox).
  45513. this.el.innerHTML = templates_controlbox_toggle_html__WEBPACK_IMPORTED_MODULE_9___default()({
  45514. 'label_toggle': _converse.connection.connected ? __('Chat Contacts') : __('Toggle chat')
  45515. });
  45516. return this;
  45517. },
  45518. hide(callback) {
  45519. u.hideElement(this.el);
  45520. callback();
  45521. },
  45522. show(callback) {
  45523. u.fadeIn(this.el, callback);
  45524. },
  45525. showControlBox() {
  45526. let controlbox = _converse.chatboxes.get('controlbox');
  45527. if (!controlbox) {
  45528. controlbox = addControlBox();
  45529. }
  45530. if (_converse.connection.connected) {
  45531. controlbox.save({
  45532. closed: false
  45533. });
  45534. } else {
  45535. controlbox.trigger('show');
  45536. }
  45537. },
  45538. onClick(e) {
  45539. e.preventDefault();
  45540. if (u.isVisible(_converse.root.querySelector("#controlbox"))) {
  45541. const controlbox = _converse.chatboxes.get('controlbox');
  45542. if (_converse.connection.connected) {
  45543. controlbox.save({
  45544. closed: true
  45545. });
  45546. } else {
  45547. controlbox.trigger('hide');
  45548. }
  45549. } else {
  45550. this.showControlBox();
  45551. }
  45552. }
  45553. });
  45554. _converse.on('chatBoxViewsInitialized', () => {
  45555. const that = _converse.chatboxviews;
  45556. _converse.chatboxes.on('add', item => {
  45557. if (item.get('type') === _converse.CONTROLBOX_TYPE) {
  45558. const view = that.get(item.get('id'));
  45559. if (view) {
  45560. view.model = item;
  45561. view.initialize();
  45562. } else {
  45563. that.add(item.get('id'), new _converse.ControlBoxView({
  45564. model: item
  45565. }));
  45566. }
  45567. }
  45568. });
  45569. });
  45570. _converse.on('clearSession', () => {
  45571. if (_converse.config.get('trusted')) {
  45572. const chatboxes = _.get(_converse, 'chatboxes', null);
  45573. if (!_.isNil(chatboxes)) {
  45574. const controlbox = chatboxes.get('controlbox');
  45575. if (controlbox && controlbox.collection && controlbox.collection.browserStorage) {
  45576. controlbox.save({
  45577. 'connected': false
  45578. });
  45579. }
  45580. }
  45581. }
  45582. });
  45583. Promise.all([_converse.api.waitUntil('connectionInitialized'), _converse.api.waitUntil('chatBoxViewsInitialized')]).then(addControlBox).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
  45584. _converse.on('chatBoxesFetched', () => {
  45585. const controlbox = _converse.chatboxes.get('controlbox') || addControlBox();
  45586. controlbox.save({
  45587. connected: true
  45588. });
  45589. });
  45590. const disconnect = function disconnect() {
  45591. /* Upon disconnection, set connected to `false`, so that if
  45592. * we reconnect, "onConnected" will be called,
  45593. * to fetch the roster again and to send out a presence stanza.
  45594. */
  45595. const view = _converse.chatboxviews.get('controlbox');
  45596. view.model.set({
  45597. 'connected': false
  45598. });
  45599. return view;
  45600. };
  45601. _converse.on('disconnected', () => disconnect().renderLoginPanel());
  45602. _converse.on('will-reconnect', disconnect);
  45603. /************************ BEGIN API ************************/
  45604. _.extend(_converse.api, {
  45605. /**
  45606. * The "controlbox" namespace groups methods pertaining to the
  45607. * controlbox view
  45608. *
  45609. * @namespace _converse.api.controlbox
  45610. * @memberOf _converse.api
  45611. */
  45612. 'controlbox': {
  45613. /**
  45614. * Retrieves the controlbox view.
  45615. *
  45616. * @example
  45617. * const view = _converse.api.controlbox.get();
  45618. *
  45619. * @returns {Backbone.View} View representing the controlbox
  45620. */
  45621. get() {
  45622. return _converse.chatboxviews.get('controlbox');
  45623. }
  45624. }
  45625. });
  45626. }
  45627. });
  45628. /***/ }),
  45629. /***/ "./src/converse-dragresize.js":
  45630. /*!************************************!*\
  45631. !*** ./src/converse-dragresize.js ***!
  45632. \************************************/
  45633. /*! no exports provided */
  45634. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45635. "use strict";
  45636. __webpack_require__.r(__webpack_exports__);
  45637. /* harmony import */ var converse_chatview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! converse-chatview */ "./src/converse-chatview.js");
  45638. /* harmony import */ var converse_controlbox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! converse-controlbox */ "./src/converse-controlbox.js");
  45639. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  45640. /* harmony import */ var templates_dragresize_html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! templates/dragresize.html */ "./src/templates/dragresize.html");
  45641. /* harmony import */ var templates_dragresize_html__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(templates_dragresize_html__WEBPACK_IMPORTED_MODULE_3__);
  45642. // Converse.js (A browser based XMPP chat client)
  45643. // http://conversejs.org
  45644. //
  45645. // Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
  45646. // Licensed under the Mozilla Public License (MPLv2)
  45647. //
  45648. /*global define, window, document */
  45649. const _ = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].env._;
  45650. function renderDragResizeHandles(_converse, view) {
  45651. const flyout = view.el.querySelector('.box-flyout');
  45652. const div = document.createElement('div');
  45653. div.innerHTML = templates_dragresize_html__WEBPACK_IMPORTED_MODULE_3___default()();
  45654. flyout.insertBefore(div, flyout.firstChild);
  45655. }
  45656. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].plugins.add('converse-dragresize', {
  45657. /* Plugin dependencies are other plugins which might be
  45658. * overridden or relied upon, and therefore need to be loaded before
  45659. * this plugin.
  45660. *
  45661. * If the setting "strict_plugin_dependencies" is set to true,
  45662. * an error will be raised if the plugin is not found. By default it's
  45663. * false, which means these plugins are only loaded opportunistically.
  45664. *
  45665. * NB: These plugins need to have already been loaded via require.js.
  45666. */
  45667. dependencies: ["converse-chatview", "converse-headline", "converse-muc-views"],
  45668. enabled(_converse) {
  45669. return _converse.view_mode == 'overlayed';
  45670. },
  45671. overrides: {
  45672. // Overrides mentioned here will be picked up by converse.js's
  45673. // plugin architecture they will replace existing methods on the
  45674. // relevant objects or classes.
  45675. //
  45676. // New functions which don't exist yet can also be added.
  45677. registerGlobalEventHandlers() {
  45678. const that = this;
  45679. document.addEventListener('mousemove', function (ev) {
  45680. if (!that.resizing || !that.allow_dragresize) {
  45681. return true;
  45682. }
  45683. ev.preventDefault();
  45684. that.resizing.chatbox.resizeChatBox(ev);
  45685. });
  45686. document.addEventListener('mouseup', function (ev) {
  45687. if (!that.resizing || !that.allow_dragresize) {
  45688. return true;
  45689. }
  45690. ev.preventDefault();
  45691. const height = that.applyDragResistance(that.resizing.chatbox.height, that.resizing.chatbox.model.get('default_height'));
  45692. const width = that.applyDragResistance(that.resizing.chatbox.width, that.resizing.chatbox.model.get('default_width'));
  45693. if (that.connection.connected) {
  45694. that.resizing.chatbox.model.save({
  45695. 'height': height
  45696. });
  45697. that.resizing.chatbox.model.save({
  45698. 'width': width
  45699. });
  45700. } else {
  45701. that.resizing.chatbox.model.set({
  45702. 'height': height
  45703. });
  45704. that.resizing.chatbox.model.set({
  45705. 'width': width
  45706. });
  45707. }
  45708. that.resizing = null;
  45709. });
  45710. return this.__super__.registerGlobalEventHandlers.apply(this, arguments);
  45711. },
  45712. ChatBox: {
  45713. initialize() {
  45714. const _converse = this.__super__._converse;
  45715. const result = this.__super__.initialize.apply(this, arguments),
  45716. height = this.get('height'),
  45717. width = this.get('width'),
  45718. save = this.get('id') === 'controlbox' ? this.set.bind(this) : this.save.bind(this);
  45719. save({
  45720. 'height': _converse.applyDragResistance(height, this.get('default_height')),
  45721. 'width': _converse.applyDragResistance(width, this.get('default_width'))
  45722. });
  45723. return result;
  45724. }
  45725. },
  45726. ChatBoxView: {
  45727. events: {
  45728. 'mousedown .dragresize-top': 'onStartVerticalResize',
  45729. 'mousedown .dragresize-left': 'onStartHorizontalResize',
  45730. 'mousedown .dragresize-topleft': 'onStartDiagonalResize'
  45731. },
  45732. initialize() {
  45733. window.addEventListener('resize', _.debounce(this.setDimensions.bind(this), 100));
  45734. this.__super__.initialize.apply(this, arguments);
  45735. },
  45736. render() {
  45737. const result = this.__super__.render.apply(this, arguments);
  45738. renderDragResizeHandles(this.__super__._converse, this);
  45739. this.setWidth();
  45740. return result;
  45741. },
  45742. setWidth() {
  45743. // If a custom width is applied (due to drag-resizing),
  45744. // then we need to set the width of the .chatbox element as well.
  45745. if (this.model.get('width')) {
  45746. this.el.style.width = this.model.get('width');
  45747. }
  45748. },
  45749. _show() {
  45750. this.initDragResize().setDimensions();
  45751. this.__super__._show.apply(this, arguments);
  45752. },
  45753. initDragResize() {
  45754. /* Determine and store the default box size.
  45755. * We need this information for the drag-resizing feature.
  45756. */
  45757. const _converse = this.__super__._converse,
  45758. flyout = this.el.querySelector('.box-flyout'),
  45759. style = window.getComputedStyle(flyout);
  45760. if (_.isUndefined(this.model.get('height'))) {
  45761. const height = parseInt(style.height.replace(/px$/, ''), 10),
  45762. width = parseInt(style.width.replace(/px$/, ''), 10);
  45763. this.model.set('height', height);
  45764. this.model.set('default_height', height);
  45765. this.model.set('width', width);
  45766. this.model.set('default_width', width);
  45767. }
  45768. const min_width = style['min-width'];
  45769. const min_height = style['min-height'];
  45770. this.model.set('min_width', min_width.endsWith('px') ? Number(min_width.replace(/px$/, '')) : 0);
  45771. this.model.set('min_height', min_height.endsWith('px') ? Number(min_height.replace(/px$/, '')) : 0); // Initialize last known mouse position
  45772. this.prev_pageY = 0;
  45773. this.prev_pageX = 0;
  45774. if (_converse.connection.connected) {
  45775. this.height = this.model.get('height');
  45776. this.width = this.model.get('width');
  45777. }
  45778. return this;
  45779. },
  45780. setDimensions() {
  45781. // Make sure the chat box has the right height and width.
  45782. this.adjustToViewport();
  45783. this.setChatBoxHeight(this.model.get('height'));
  45784. this.setChatBoxWidth(this.model.get('width'));
  45785. },
  45786. setChatBoxHeight(height) {
  45787. const _converse = this.__super__._converse;
  45788. if (height) {
  45789. height = _converse.applyDragResistance(height, this.model.get('default_height')) + 'px';
  45790. } else {
  45791. height = "";
  45792. }
  45793. const flyout_el = this.el.querySelector('.box-flyout');
  45794. if (!_.isNull(flyout_el)) {
  45795. flyout_el.style.height = height;
  45796. }
  45797. },
  45798. setChatBoxWidth(width) {
  45799. const _converse = this.__super__._converse;
  45800. if (width) {
  45801. width = _converse.applyDragResistance(width, this.model.get('default_width')) + 'px';
  45802. } else {
  45803. width = "";
  45804. }
  45805. this.el.style.width = width;
  45806. const flyout_el = this.el.querySelector('.box-flyout');
  45807. if (!_.isNull(flyout_el)) {
  45808. flyout_el.style.width = width;
  45809. }
  45810. },
  45811. adjustToViewport() {
  45812. /* Event handler called when viewport gets resized. We remove
  45813. * custom width/height from chat boxes.
  45814. */
  45815. const viewport_width = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  45816. const viewport_height = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  45817. if (viewport_width <= 480) {
  45818. this.model.set('height', undefined);
  45819. this.model.set('width', undefined);
  45820. } else if (viewport_width <= this.model.get('width')) {
  45821. this.model.set('width', undefined);
  45822. } else if (viewport_height <= this.model.get('height')) {
  45823. this.model.set('height', undefined);
  45824. }
  45825. },
  45826. onStartVerticalResize(ev) {
  45827. const _converse = this.__super__._converse;
  45828. if (!_converse.allow_dragresize) {
  45829. return true;
  45830. } // Record element attributes for mouseMove().
  45831. const flyout = this.el.querySelector('.box-flyout'),
  45832. style = window.getComputedStyle(flyout);
  45833. this.height = parseInt(style.height.replace(/px$/, ''), 10);
  45834. _converse.resizing = {
  45835. 'chatbox': this,
  45836. 'direction': 'top'
  45837. };
  45838. this.prev_pageY = ev.pageY;
  45839. },
  45840. onStartHorizontalResize(ev) {
  45841. const _converse = this.__super__._converse;
  45842. if (!_converse.allow_dragresize) {
  45843. return true;
  45844. }
  45845. const flyout = this.el.querySelector('.box-flyout'),
  45846. style = window.getComputedStyle(flyout);
  45847. this.width = parseInt(style.width.replace(/px$/, ''), 10);
  45848. _converse.resizing = {
  45849. 'chatbox': this,
  45850. 'direction': 'left'
  45851. };
  45852. this.prev_pageX = ev.pageX;
  45853. },
  45854. onStartDiagonalResize(ev) {
  45855. const _converse = this.__super__._converse;
  45856. this.onStartHorizontalResize(ev);
  45857. this.onStartVerticalResize(ev);
  45858. _converse.resizing.direction = 'topleft';
  45859. },
  45860. resizeChatBox(ev) {
  45861. let diff;
  45862. const _converse = this.__super__._converse;
  45863. if (_converse.resizing.direction.indexOf('top') === 0) {
  45864. diff = ev.pageY - this.prev_pageY;
  45865. if (diff) {
  45866. this.height = this.height - diff > (this.model.get('min_height') || 0) ? this.height - diff : this.model.get('min_height');
  45867. this.prev_pageY = ev.pageY;
  45868. this.setChatBoxHeight(this.height);
  45869. }
  45870. }
  45871. if (_.includes(_converse.resizing.direction, 'left')) {
  45872. diff = this.prev_pageX - ev.pageX;
  45873. if (diff) {
  45874. this.width = this.width + diff > (this.model.get('min_width') || 0) ? this.width + diff : this.model.get('min_width');
  45875. this.prev_pageX = ev.pageX;
  45876. this.setChatBoxWidth(this.width);
  45877. }
  45878. }
  45879. }
  45880. },
  45881. HeadlinesBoxView: {
  45882. events: {
  45883. 'mousedown .dragresize-top': 'onStartVerticalResize',
  45884. 'mousedown .dragresize-left': 'onStartHorizontalResize',
  45885. 'mousedown .dragresize-topleft': 'onStartDiagonalResize'
  45886. },
  45887. initialize() {
  45888. window.addEventListener('resize', _.debounce(this.setDimensions.bind(this), 100));
  45889. return this.__super__.initialize.apply(this, arguments);
  45890. },
  45891. render() {
  45892. const result = this.__super__.render.apply(this, arguments);
  45893. renderDragResizeHandles(this.__super__._converse, this);
  45894. this.setWidth();
  45895. return result;
  45896. }
  45897. },
  45898. ControlBoxView: {
  45899. events: {
  45900. 'mousedown .dragresize-top': 'onStartVerticalResize',
  45901. 'mousedown .dragresize-left': 'onStartHorizontalResize',
  45902. 'mousedown .dragresize-topleft': 'onStartDiagonalResize'
  45903. },
  45904. initialize() {
  45905. window.addEventListener('resize', _.debounce(this.setDimensions.bind(this), 100));
  45906. this.__super__.initialize.apply(this, arguments);
  45907. },
  45908. render() {
  45909. const result = this.__super__.render.apply(this, arguments);
  45910. renderDragResizeHandles(this.__super__._converse, this);
  45911. this.setWidth();
  45912. return result;
  45913. },
  45914. renderLoginPanel() {
  45915. const result = this.__super__.renderLoginPanel.apply(this, arguments);
  45916. this.initDragResize().setDimensions();
  45917. return result;
  45918. },
  45919. renderControlBoxPane() {
  45920. const result = this.__super__.renderControlBoxPane.apply(this, arguments);
  45921. this.initDragResize().setDimensions();
  45922. return result;
  45923. }
  45924. },
  45925. ChatRoomView: {
  45926. events: {
  45927. 'mousedown .dragresize-top': 'onStartVerticalResize',
  45928. 'mousedown .dragresize-left': 'onStartHorizontalResize',
  45929. 'mousedown .dragresize-topleft': 'onStartDiagonalResize'
  45930. },
  45931. initialize() {
  45932. window.addEventListener('resize', _.debounce(this.setDimensions.bind(this), 100));
  45933. this.__super__.initialize.apply(this, arguments);
  45934. },
  45935. render() {
  45936. const result = this.__super__.render.apply(this, arguments);
  45937. renderDragResizeHandles(this.__super__._converse, this);
  45938. this.setWidth();
  45939. return result;
  45940. }
  45941. }
  45942. },
  45943. initialize() {
  45944. /* The initialize function gets called as soon as the plugin is
  45945. * loaded by converse.js's plugin machinery.
  45946. */
  45947. const _converse = this._converse;
  45948. _converse.api.settings.update({
  45949. allow_dragresize: true
  45950. });
  45951. _converse.applyDragResistance = function (value, default_value) {
  45952. /* This method applies some resistance around the
  45953. * default_value. If value is close enough to
  45954. * default_value, then default_value is returned instead.
  45955. */
  45956. if (_.isUndefined(value)) {
  45957. return undefined;
  45958. } else if (_.isUndefined(default_value)) {
  45959. return value;
  45960. }
  45961. const resistance = 10;
  45962. if (value !== default_value && Math.abs(value - default_value) < resistance) {
  45963. return default_value;
  45964. }
  45965. return value;
  45966. };
  45967. }
  45968. });
  45969. /***/ }),
  45970. /***/ "./src/converse-embedded.js":
  45971. /*!**********************************!*\
  45972. !*** ./src/converse-embedded.js ***!
  45973. \**********************************/
  45974. /*! no exports provided */
  45975. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45976. "use strict";
  45977. __webpack_require__.r(__webpack_exports__);
  45978. /* harmony import */ var _converse_headless_converse_muc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-muc */ "./src/headless/converse-muc.js");
  45979. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  45980. // Converse.js
  45981. // http://conversejs.org
  45982. //
  45983. // Copyright (c) 2013-2018, the Converse.js developers
  45984. // Licensed under the Mozilla Public License (MPLv2)
  45985. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].env,
  45986. Backbone = _converse$env.Backbone,
  45987. _ = _converse$env._;
  45988. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].plugins.add('converse-embedded', {
  45989. enabled(_converse) {
  45990. return _converse.view_mode === 'embedded';
  45991. },
  45992. initialize() {
  45993. /* The initialize function gets called as soon as the plugin is
  45994. * loaded by converse.js's plugin machinery.
  45995. */
  45996. this._converse.api.settings.update({
  45997. 'allow_logout': false,
  45998. // No point in logging out when we have auto_login as true.
  45999. 'allow_muc_invitations': false,
  46000. // Doesn't make sense to allow because only
  46001. // roster contacts can be invited
  46002. 'hide_muc_server': true
  46003. });
  46004. const _converse = this._converse;
  46005. if (!_.isArray(_converse.auto_join_rooms) && !_.isArray(_converse.auto_join_private_chats)) {
  46006. throw new Error("converse-embedded: auto_join_rooms must be an Array");
  46007. }
  46008. if (_converse.auto_join_rooms.length > 1 && _converse.auto_join_private_chats.length > 1) {
  46009. throw new Error("converse-embedded: It doesn't make " + "sense to have the auto_join_rooms setting more then one, " + "since only one chat room can be open at any time.");
  46010. }
  46011. }
  46012. });
  46013. /***/ }),
  46014. /***/ "./src/converse-fullscreen.js":
  46015. /*!************************************!*\
  46016. !*** ./src/converse-fullscreen.js ***!
  46017. \************************************/
  46018. /*! no exports provided */
  46019. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46020. "use strict";
  46021. __webpack_require__.r(__webpack_exports__);
  46022. /* harmony import */ var _converse_headless_converse_muc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-muc */ "./src/headless/converse-muc.js");
  46023. /* harmony import */ var converse_chatview__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! converse-chatview */ "./src/converse-chatview.js");
  46024. /* harmony import */ var converse_controlbox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! converse-controlbox */ "./src/converse-controlbox.js");
  46025. /* harmony import */ var converse_singleton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! converse-singleton */ "./src/converse-singleton.js");
  46026. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  46027. /* harmony import */ var templates_inverse_brand_heading_html__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! templates/inverse_brand_heading.html */ "./src/templates/inverse_brand_heading.html");
  46028. /* harmony import */ var templates_inverse_brand_heading_html__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(templates_inverse_brand_heading_html__WEBPACK_IMPORTED_MODULE_5__);
  46029. // Converse.js (A browser based XMPP chat client)
  46030. // http://conversejs.org
  46031. //
  46032. // Copyright (c) JC Brand <jc@opkode.com>
  46033. // Licensed under the Mozilla Public License (MPLv2)
  46034. //
  46035. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_4__["default"].env,
  46036. Strophe = _converse$env.Strophe,
  46037. _ = _converse$env._;
  46038. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_4__["default"].plugins.add('converse-fullscreen', {
  46039. enabled(_converse) {
  46040. return _.includes(['fullscreen', 'embedded'], _converse.view_mode);
  46041. },
  46042. overrides: {
  46043. // overrides mentioned here will be picked up by converse.js's
  46044. // plugin architecture they will replace existing methods on the
  46045. // relevant objects or classes.
  46046. //
  46047. // new functions which don't exist yet can also be added.
  46048. ControlBoxView: {
  46049. createBrandHeadingHTML() {
  46050. const _converse = this.__super__._converse;
  46051. return templates_inverse_brand_heading_html__WEBPACK_IMPORTED_MODULE_5___default()({
  46052. 'version_name': _converse.VERSION_NAME
  46053. });
  46054. },
  46055. insertBrandHeading() {
  46056. const _converse = this.__super__._converse;
  46057. const el = _converse.root.getElementById('converse-login-panel');
  46058. el.parentNode.insertAdjacentHTML('afterbegin', this.createBrandHeadingHTML());
  46059. }
  46060. }
  46061. },
  46062. initialize() {
  46063. this._converse.api.settings.update({
  46064. chatview_avatar_height: 50,
  46065. chatview_avatar_width: 50,
  46066. hide_open_bookmarks: true,
  46067. show_controlbox_by_default: true,
  46068. sticky_controlbox: true
  46069. });
  46070. }
  46071. });
  46072. /***/ }),
  46073. /***/ "./src/converse-headline.js":
  46074. /*!**********************************!*\
  46075. !*** ./src/converse-headline.js ***!
  46076. \**********************************/
  46077. /*! no exports provided */
  46078. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46079. "use strict";
  46080. __webpack_require__.r(__webpack_exports__);
  46081. /* harmony import */ var converse_chatview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! converse-chatview */ "./src/converse-chatview.js");
  46082. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  46083. /* harmony import */ var templates_chatbox_html__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! templates/chatbox.html */ "./src/templates/chatbox.html");
  46084. /* harmony import */ var templates_chatbox_html__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(templates_chatbox_html__WEBPACK_IMPORTED_MODULE_2__);
  46085. // Converse.js (A browser based XMPP chat client)
  46086. // http://conversejs.org
  46087. //
  46088. // Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
  46089. // Licensed under the Mozilla Public License (MPLv2)
  46090. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].env,
  46091. _ = _converse$env._,
  46092. utils = _converse$env.utils;
  46093. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].plugins.add('converse-headline', {
  46094. /* Plugin dependencies are other plugins which might be
  46095. * overridden or relied upon, and therefore need to be loaded before
  46096. * this plugin.
  46097. *
  46098. * If the setting "strict_plugin_dependencies" is set to true,
  46099. * an error will be raised if the plugin is not found. By default it's
  46100. * false, which means these plugins are only loaded opportunistically.
  46101. *
  46102. * NB: These plugins need to have already been loaded via require.js.
  46103. */
  46104. dependencies: ["converse-chatview"],
  46105. overrides: {
  46106. // Overrides mentioned here will be picked up by converse.js's
  46107. // plugin architecture they will replace existing methods on the
  46108. // relevant objects or classes.
  46109. //
  46110. // New functions which don't exist yet can also be added.
  46111. ChatBoxes: {
  46112. model(attrs, options) {
  46113. const _converse = this.__super__._converse;
  46114. if (attrs.type == _converse.HEADLINES_TYPE) {
  46115. return new _converse.HeadlinesBox(attrs, options);
  46116. } else {
  46117. return this.__super__.model.apply(this, arguments);
  46118. }
  46119. }
  46120. }
  46121. },
  46122. initialize() {
  46123. /* The initialize function gets called as soon as the plugin is
  46124. * loaded by converse.js's plugin machinery.
  46125. */
  46126. const _converse = this._converse,
  46127. __ = _converse.__;
  46128. _converse.HeadlinesBox = _converse.ChatBox.extend({
  46129. defaults: {
  46130. 'type': _converse.HEADLINES_TYPE,
  46131. 'bookmarked': false,
  46132. 'chat_state': undefined,
  46133. 'num_unread': 0,
  46134. 'url': ''
  46135. }
  46136. });
  46137. _converse.HeadlinesBoxView = _converse.ChatBoxView.extend({
  46138. className: 'chatbox headlines',
  46139. events: {
  46140. 'click .close-chatbox-button': 'close',
  46141. 'click .toggle-chatbox-button': 'minimize',
  46142. 'keypress textarea.chat-textarea': 'keyPressed'
  46143. },
  46144. initialize() {
  46145. this.initDebounced();
  46146. this.disable_mam = true; // Don't do MAM queries for this box
  46147. this.model.messages.on('add', this.onMessageAdded, this);
  46148. this.model.on('show', this.show, this);
  46149. this.model.on('destroy', this.hide, this);
  46150. this.model.on('change:minimized', this.onMinimizedChanged, this);
  46151. this.render().insertHeading().fetchMessages().insertIntoDOM().hide();
  46152. _converse.emit('chatBoxOpened', this);
  46153. _converse.emit('chatBoxInitialized', this);
  46154. },
  46155. render() {
  46156. this.el.setAttribute('id', this.model.get('box_id'));
  46157. this.el.innerHTML = templates_chatbox_html__WEBPACK_IMPORTED_MODULE_2___default()(_.extend(this.model.toJSON(), {
  46158. info_close: '',
  46159. label_personal_message: '',
  46160. show_send_button: false,
  46161. show_toolbar: false,
  46162. unread_msgs: ''
  46163. }));
  46164. this.content = this.el.querySelector('.chat-content');
  46165. return this;
  46166. },
  46167. // Override to avoid the methods in converse-chatview.js
  46168. 'renderMessageForm': _.noop,
  46169. 'afterShown': _.noop
  46170. });
  46171. function onHeadlineMessage(message) {
  46172. /* Handler method for all incoming messages of type "headline". */
  46173. const from_jid = message.getAttribute('from');
  46174. if (utils.isHeadlineMessage(_converse, message)) {
  46175. if (_.includes(from_jid, '@') && !_converse.api.contacts.get(from_jid) && !_converse.allow_non_roster_messaging) {
  46176. return;
  46177. }
  46178. if (_.isNull(message.querySelector('body'))) {
  46179. // Avoid creating a chat box if we have nothing to show
  46180. // inside it.
  46181. return;
  46182. }
  46183. const chatbox = _converse.chatboxes.create({
  46184. 'id': from_jid,
  46185. 'jid': from_jid,
  46186. 'type': _converse.HEADLINES_TYPE,
  46187. 'from': from_jid
  46188. });
  46189. chatbox.createMessage(message, message);
  46190. _converse.emit('message', {
  46191. 'chatbox': chatbox,
  46192. 'stanza': message
  46193. });
  46194. }
  46195. return true;
  46196. }
  46197. function registerHeadlineHandler() {
  46198. _converse.connection.addHandler(onHeadlineMessage, null, 'message');
  46199. }
  46200. _converse.on('connected', registerHeadlineHandler);
  46201. _converse.on('reconnected', registerHeadlineHandler);
  46202. _converse.on('chatBoxViewsInitialized', () => {
  46203. const that = _converse.chatboxviews;
  46204. _converse.chatboxes.on('add', item => {
  46205. if (!that.get(item.get('id')) && item.get('type') === _converse.HEADLINES_TYPE) {
  46206. that.add(item.get('id'), new _converse.HeadlinesBoxView({
  46207. model: item
  46208. }));
  46209. }
  46210. });
  46211. });
  46212. }
  46213. });
  46214. /***/ }),
  46215. /***/ "./src/converse-message-view.js":
  46216. /*!**************************************!*\
  46217. !*** ./src/converse-message-view.js ***!
  46218. \**************************************/
  46219. /*! no exports provided */
  46220. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46221. "use strict";
  46222. __webpack_require__.r(__webpack_exports__);
  46223. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  46224. /* harmony import */ var filesize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! filesize */ "./node_modules/filesize/lib/filesize.js");
  46225. /* harmony import */ var filesize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(filesize__WEBPACK_IMPORTED_MODULE_1__);
  46226. /* harmony import */ var _utils_html__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/html */ "./src/utils/html.js");
  46227. /* harmony import */ var templates_csn_html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! templates/csn.html */ "./src/templates/csn.html");
  46228. /* harmony import */ var templates_csn_html__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(templates_csn_html__WEBPACK_IMPORTED_MODULE_3__);
  46229. /* harmony import */ var templates_file_progress_html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! templates/file_progress.html */ "./src/templates/file_progress.html");
  46230. /* harmony import */ var templates_file_progress_html__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(templates_file_progress_html__WEBPACK_IMPORTED_MODULE_4__);
  46231. /* harmony import */ var templates_info_html__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! templates/info.html */ "./src/templates/info.html");
  46232. /* harmony import */ var templates_info_html__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(templates_info_html__WEBPACK_IMPORTED_MODULE_5__);
  46233. /* harmony import */ var templates_message_html__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! templates/message.html */ "./src/templates/message.html");
  46234. /* harmony import */ var templates_message_html__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(templates_message_html__WEBPACK_IMPORTED_MODULE_6__);
  46235. /* harmony import */ var templates_message_versions_modal_html__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! templates/message_versions_modal.html */ "./src/templates/message_versions_modal.html");
  46236. /* harmony import */ var templates_message_versions_modal_html__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(templates_message_versions_modal_html__WEBPACK_IMPORTED_MODULE_7__);
  46237. /* harmony import */ var _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @converse/headless/utils/emoji */ "./src/headless/utils/emoji.js");
  46238. /* harmony import */ var xss__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! xss */ "./node_modules/xss/dist/xss.js");
  46239. /* harmony import */ var xss__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(xss__WEBPACK_IMPORTED_MODULE_9__);
  46240. // Converse.js
  46241. // https://conversejs.org
  46242. //
  46243. // Copyright (c) 2013-2018, the Converse.js developers
  46244. // Licensed under the Mozilla Public License (MPLv2)
  46245. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env,
  46246. Backbone = _converse$env.Backbone,
  46247. _ = _converse$env._,
  46248. moment = _converse$env.moment;
  46249. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins.add('converse-message-view', {
  46250. dependencies: ["converse-modal"],
  46251. initialize() {
  46252. /* The initialize function gets called as soon as the plugin is
  46253. * loaded by converse.js's plugin machinery.
  46254. */
  46255. const _converse = this._converse,
  46256. __ = _converse.__;
  46257. _converse.api.settings.update({
  46258. 'show_images_inline': true
  46259. });
  46260. _converse.MessageVersionsModal = _converse.BootstrapModal.extend({
  46261. toHTML() {
  46262. return templates_message_versions_modal_html__WEBPACK_IMPORTED_MODULE_7___default()(_.extend(this.model.toJSON(), {
  46263. '__': __
  46264. }));
  46265. }
  46266. });
  46267. _converse.MessageView = _converse.ViewWithAvatar.extend({
  46268. events: {
  46269. 'click .chat-msg__edit-modal': 'showMessageVersionsModal'
  46270. },
  46271. initialize() {
  46272. if (this.model.vcard) {
  46273. this.model.vcard.on('change', this.render, this);
  46274. }
  46275. this.model.on('change', this.onChanged, this);
  46276. this.model.on('destroy', this.remove, this);
  46277. },
  46278. async render() {
  46279. const is_followup = _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].hasClass('chat-msg--followup', this.el);
  46280. if (this.model.isOnlyChatStateNotification()) {
  46281. this.renderChatStateNotification();
  46282. } else if (this.model.get('file') && !this.model.get('oob_url')) {
  46283. if (!this.model.file) {
  46284. _converse.log("Attempted to render a file upload message with no file data");
  46285. return this.el;
  46286. }
  46287. this.renderFileUploadProgresBar();
  46288. } else if (this.model.get('type') === 'error') {
  46289. this.renderErrorMessage();
  46290. } else {
  46291. await this.renderChatMessage();
  46292. }
  46293. if (is_followup) {
  46294. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].addClass('chat-msg--followup', this.el);
  46295. }
  46296. return this.el;
  46297. },
  46298. async onChanged(item) {
  46299. // Jot down whether it was edited because the `changed`
  46300. // attr gets removed when this.render() gets called further
  46301. // down.
  46302. const edited = item.changed.edited;
  46303. if (this.model.changed.progress) {
  46304. return this.renderFileUploadProgresBar();
  46305. }
  46306. if (_.filter(['correcting', 'message', 'type', 'upload', 'received'], prop => Object.prototype.hasOwnProperty.call(this.model.changed, prop)).length) {
  46307. await this.render();
  46308. }
  46309. if (edited) {
  46310. this.onMessageEdited();
  46311. }
  46312. },
  46313. onMessageEdited() {
  46314. if (this.model.get('is_archived')) {
  46315. return;
  46316. }
  46317. this.el.addEventListener('animationend', () => _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].removeClass('onload', this.el));
  46318. _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].addClass('onload', this.el);
  46319. },
  46320. replaceElement(msg) {
  46321. if (!_.isNil(this.el.parentElement)) {
  46322. this.el.parentElement.replaceChild(msg, this.el);
  46323. }
  46324. this.setElement(msg);
  46325. return this.el;
  46326. },
  46327. async renderChatMessage() {
  46328. const is_me_message = this.isMeCommand(),
  46329. moment_time = moment(this.model.get('time')),
  46330. role = this.model.vcard ? this.model.vcard.get('role') : null,
  46331. roles = role ? role.split(',') : [];
  46332. const msg = _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].stringToElement(templates_message_html__WEBPACK_IMPORTED_MODULE_6___default()(_.extend(this.model.toJSON(), {
  46333. '__': __,
  46334. 'is_me_message': is_me_message,
  46335. 'roles': roles,
  46336. 'pretty_time': moment_time.format(_converse.time_format),
  46337. 'time': moment_time.format(),
  46338. 'extra_classes': this.getExtraMessageClasses(),
  46339. 'label_show': __('Show more'),
  46340. 'username': this.model.getDisplayName()
  46341. })));
  46342. const url = this.model.get('oob_url');
  46343. if (url) {
  46344. msg.querySelector('.chat-msg__media').innerHTML = _.flow(_.partial(_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].renderFileURL, _converse), _.partial(_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].renderMovieURL, _converse), _.partial(_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].renderAudioURL, _converse), _.partial(_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].renderImageURL, _converse))(url);
  46345. }
  46346. let text = this.getMessageText();
  46347. const msg_content = msg.querySelector('.chat-msg__text');
  46348. if (text && text !== url) {
  46349. if (is_me_message) {
  46350. text = text.substring(4);
  46351. }
  46352. text = xss__WEBPACK_IMPORTED_MODULE_9___default.a.filterXSS(text, {
  46353. 'whiteList': {}
  46354. });
  46355. msg_content.innerHTML = _.flow(_.partial(_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].geoUriToHttp, _, _converse.geouri_replacement), _.partial(_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].addMentionsMarkup, _, this.model.get('references'), this.model.collection.chatbox), _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].addHyperlinks, _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].renderNewLines, _.partial(_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].addEmoji, _converse, _))(text);
  46356. }
  46357. const promise = _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].renderImageURLs(_converse, msg_content);
  46358. if (this.model.get('type') !== 'headline') {
  46359. this.renderAvatar(msg);
  46360. }
  46361. await promise;
  46362. this.replaceElement(msg);
  46363. this.model.collection.trigger('rendered', this);
  46364. },
  46365. renderErrorMessage() {
  46366. const moment_time = moment(this.model.get('time')),
  46367. msg = _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].stringToElement(templates_info_html__WEBPACK_IMPORTED_MODULE_5___default()(_.extend(this.model.toJSON(), {
  46368. 'extra_classes': 'chat-error',
  46369. 'isodate': moment_time.format()
  46370. })));
  46371. return this.replaceElement(msg);
  46372. },
  46373. renderChatStateNotification() {
  46374. let text;
  46375. const from = this.model.get('from'),
  46376. name = this.model.getDisplayName();
  46377. if (this.model.get('chat_state') === _converse.COMPOSING) {
  46378. if (this.model.get('sender') === 'me') {
  46379. text = __('Typing from another device');
  46380. } else {
  46381. text = __('%1$s is typing', name);
  46382. }
  46383. } else if (this.model.get('chat_state') === _converse.PAUSED) {
  46384. if (this.model.get('sender') === 'me') {
  46385. text = __('Stopped typing on the other device');
  46386. } else {
  46387. text = __('%1$s has stopped typing', name);
  46388. }
  46389. } else if (this.model.get('chat_state') === _converse.GONE) {
  46390. text = __('%1$s has gone away', name);
  46391. } else {
  46392. return;
  46393. }
  46394. const isodate = moment().format();
  46395. this.replaceElement(_converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].stringToElement(templates_csn_html__WEBPACK_IMPORTED_MODULE_3___default()({
  46396. 'message': text,
  46397. 'from': from,
  46398. 'isodate': isodate
  46399. })));
  46400. },
  46401. renderFileUploadProgresBar() {
  46402. const msg = _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].stringToElement(templates_file_progress_html__WEBPACK_IMPORTED_MODULE_4___default()(_.extend(this.model.toJSON(), {
  46403. '__': __,
  46404. 'filename': this.model.file.name,
  46405. 'filesize': filesize__WEBPACK_IMPORTED_MODULE_1___default()(this.model.file.size)
  46406. })));
  46407. this.replaceElement(msg);
  46408. this.renderAvatar();
  46409. },
  46410. showMessageVersionsModal(ev) {
  46411. ev.preventDefault();
  46412. if (_.isUndefined(this.model.message_versions_modal)) {
  46413. this.model.message_versions_modal = new _converse.MessageVersionsModal({
  46414. 'model': this.model
  46415. });
  46416. }
  46417. this.model.message_versions_modal.show(ev);
  46418. },
  46419. getMessageText() {
  46420. if (this.model.get('is_encrypted')) {
  46421. return this.model.get('plaintext') || (_converse.debug ? __('Unencryptable OMEMO message') : null);
  46422. }
  46423. return this.model.get('message');
  46424. },
  46425. isMeCommand() {
  46426. const text = this.getMessageText();
  46427. if (!text) {
  46428. return false;
  46429. }
  46430. return text.startsWith('/me ');
  46431. },
  46432. processMessageText() {
  46433. var text = this.get('message');
  46434. text = _converse_headless_utils_emoji__WEBPACK_IMPORTED_MODULE_8__["default"].geoUriToHttp(text, _converse.geouri_replacement);
  46435. },
  46436. getExtraMessageClasses() {
  46437. let extra_classes = this.model.get('is_delayed') && 'delayed' || '';
  46438. if (this.model.get('type') === 'groupchat' && this.model.get('sender') === 'them') {
  46439. if (this.model.collection.chatbox.isUserMentioned(this.model)) {
  46440. // Add special class to mark groupchat messages
  46441. // in which we are mentioned.
  46442. extra_classes += ' mentioned';
  46443. }
  46444. }
  46445. if (this.model.get('correcting')) {
  46446. extra_classes += ' correcting';
  46447. }
  46448. return extra_classes;
  46449. }
  46450. });
  46451. }
  46452. });
  46453. /***/ }),
  46454. /***/ "./src/converse-minimize.js":
  46455. /*!**********************************!*\
  46456. !*** ./src/converse-minimize.js ***!
  46457. \**********************************/
  46458. /*! no exports provided */
  46459. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46460. "use strict";
  46461. __webpack_require__.r(__webpack_exports__);
  46462. /* harmony import */ var converse_chatview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! converse-chatview */ "./src/converse-chatview.js");
  46463. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  46464. /* harmony import */ var templates_chatbox_minimize_html__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! templates/chatbox_minimize.html */ "./src/templates/chatbox_minimize.html");
  46465. /* harmony import */ var templates_chatbox_minimize_html__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(templates_chatbox_minimize_html__WEBPACK_IMPORTED_MODULE_2__);
  46466. /* harmony import */ var templates_chats_panel_html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! templates/chats_panel.html */ "./src/templates/chats_panel.html");
  46467. /* harmony import */ var templates_chats_panel_html__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(templates_chats_panel_html__WEBPACK_IMPORTED_MODULE_3__);
  46468. /* harmony import */ var templates_toggle_chats_html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! templates/toggle_chats.html */ "./src/templates/toggle_chats.html");
  46469. /* harmony import */ var templates_toggle_chats_html__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(templates_toggle_chats_html__WEBPACK_IMPORTED_MODULE_4__);
  46470. /* harmony import */ var templates_trimmed_chat_html__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! templates/trimmed_chat.html */ "./src/templates/trimmed_chat.html");
  46471. /* harmony import */ var templates_trimmed_chat_html__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(templates_trimmed_chat_html__WEBPACK_IMPORTED_MODULE_5__);
  46472. // Converse.js (A browser based XMPP chat client)
  46473. // http://conversejs.org
  46474. //
  46475. // Copyright (c) 2013-2018, Jan-Carel Brand <jc@opkode.com>
  46476. // Licensed under the Mozilla Public License (MPLv2)
  46477. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].env,
  46478. _ = _converse$env._,
  46479. Backbone = _converse$env.Backbone,
  46480. Promise = _converse$env.Promise,
  46481. Strophe = _converse$env.Strophe,
  46482. b64_sha1 = _converse$env.b64_sha1,
  46483. moment = _converse$env.moment;
  46484. const u = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].env.utils;
  46485. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].plugins.add('converse-minimize', {
  46486. /* Optional dependencies are other plugins which might be
  46487. * overridden or relied upon, and therefore need to be loaded before
  46488. * this plugin. They are called "optional" because they might not be
  46489. * available, in which case any overrides applicable to them will be
  46490. * ignored.
  46491. *
  46492. * It's possible however to make optional dependencies non-optional.
  46493. * If the setting "strict_plugin_dependencies" is set to true,
  46494. * an error will be raised if the plugin is not found.
  46495. *
  46496. * NB: These plugins need to have already been loaded via require.js.
  46497. */
  46498. dependencies: ["converse-chatview", "converse-controlbox", "converse-muc", "converse-muc-views", "converse-headline"],
  46499. enabled(_converse) {
  46500. return _converse.view_mode === 'overlayed';
  46501. },
  46502. overrides: {
  46503. // Overrides mentioned here will be picked up by converse.js's
  46504. // plugin architecture they will replace existing methods on the
  46505. // relevant objects or classes.
  46506. //
  46507. // New functions which don't exist yet can also be added.
  46508. ChatBox: {
  46509. initialize() {
  46510. this.__super__.initialize.apply(this, arguments);
  46511. this.on('show', this.maximize, this);
  46512. if (this.get('id') === 'controlbox') {
  46513. return;
  46514. }
  46515. this.save({
  46516. 'minimized': this.get('minimized') || false,
  46517. 'time_minimized': this.get('time_minimized') || moment()
  46518. });
  46519. },
  46520. maximize() {
  46521. u.safeSave(this, {
  46522. 'minimized': false,
  46523. 'time_opened': moment().valueOf()
  46524. });
  46525. },
  46526. minimize() {
  46527. u.safeSave(this, {
  46528. 'minimized': true,
  46529. 'time_minimized': moment().format()
  46530. });
  46531. }
  46532. },
  46533. ChatBoxView: {
  46534. events: {
  46535. 'click .toggle-chatbox-button': 'minimize'
  46536. },
  46537. initialize() {
  46538. this.model.on('change:minimized', this.onMinimizedChanged, this);
  46539. return this.__super__.initialize.apply(this, arguments);
  46540. },
  46541. _show() {
  46542. const _converse = this.__super__._converse;
  46543. if (_converse.view_mode !== 'overlayed') {
  46544. return this.__super__._show.apply(this, arguments);
  46545. } else if (!this.model.get('minimized')) {
  46546. this.__super__._show.apply(this, arguments);
  46547. _converse.chatboxviews.trimChats(this);
  46548. } else {
  46549. this.minimize();
  46550. }
  46551. },
  46552. isNewMessageHidden() {
  46553. return this.model.get('minimized') || this.__super__.isNewMessageHidden.apply(this, arguments);
  46554. },
  46555. shouldShowOnTextMessage() {
  46556. return !this.model.get('minimized') && this.__super__.shouldShowOnTextMessage.apply(this, arguments);
  46557. },
  46558. setChatBoxHeight(height) {
  46559. if (!this.model.get('minimized')) {
  46560. return this.__super__.setChatBoxHeight.apply(this, arguments);
  46561. }
  46562. },
  46563. setChatBoxWidth(width) {
  46564. if (!this.model.get('minimized')) {
  46565. return this.__super__.setChatBoxWidth.apply(this, arguments);
  46566. }
  46567. },
  46568. onMinimizedChanged(item) {
  46569. if (item.get('minimized')) {
  46570. this.minimize();
  46571. } else {
  46572. this.maximize();
  46573. }
  46574. },
  46575. maximize() {
  46576. // Restores a minimized chat box
  46577. const _converse = this.__super__._converse;
  46578. this.insertIntoDOM();
  46579. if (!this.model.isScrolledUp()) {
  46580. this.model.clearUnreadMsgCounter();
  46581. }
  46582. this.show();
  46583. this.__super__._converse.emit('chatBoxMaximized', this);
  46584. return this;
  46585. },
  46586. minimize(ev) {
  46587. const _converse = this.__super__._converse;
  46588. if (ev && ev.preventDefault) {
  46589. ev.preventDefault();
  46590. } // save the scroll position to restore it on maximize
  46591. if (this.model.collection && this.model.collection.browserStorage) {
  46592. this.model.save({
  46593. 'scroll': this.content.scrollTop
  46594. });
  46595. } else {
  46596. this.model.set({
  46597. 'scroll': this.content.scrollTop
  46598. });
  46599. }
  46600. this.setChatState(_converse.INACTIVE).model.minimize();
  46601. this.hide();
  46602. _converse.emit('chatBoxMinimized', this);
  46603. }
  46604. },
  46605. ChatBoxHeading: {
  46606. render() {
  46607. const _converse = this.__super__._converse,
  46608. __ = _converse.__;
  46609. const result = this.__super__.render.apply(this, arguments);
  46610. const new_html = templates_chatbox_minimize_html__WEBPACK_IMPORTED_MODULE_2___default()({
  46611. info_minimize: __('Minimize this chat box')
  46612. });
  46613. const el = this.el.querySelector('.toggle-chatbox-button');
  46614. if (el) {
  46615. el.outerHTML = new_html;
  46616. } else {
  46617. const button = this.el.querySelector('.close-chatbox-button');
  46618. button.insertAdjacentHTML('afterEnd', new_html);
  46619. }
  46620. }
  46621. },
  46622. ChatRoomView: {
  46623. events: {
  46624. 'click .toggle-chatbox-button': 'minimize'
  46625. },
  46626. initialize() {
  46627. this.model.on('change:minimized', function (item) {
  46628. if (item.get('minimized')) {
  46629. this.hide();
  46630. } else {
  46631. this.maximize();
  46632. }
  46633. }, this);
  46634. const result = this.__super__.initialize.apply(this, arguments);
  46635. if (this.model.get('minimized')) {
  46636. this.hide();
  46637. }
  46638. return result;
  46639. },
  46640. generateHeadingHTML() {
  46641. const _converse = this.__super__._converse,
  46642. __ = _converse.__;
  46643. const html = this.__super__.generateHeadingHTML.apply(this, arguments);
  46644. const div = document.createElement('div');
  46645. div.innerHTML = html;
  46646. const button = div.querySelector('.close-chatbox-button');
  46647. button.insertAdjacentHTML('afterend', templates_chatbox_minimize_html__WEBPACK_IMPORTED_MODULE_2___default()({
  46648. 'info_minimize': __('Minimize this chat box')
  46649. }));
  46650. return div.innerHTML;
  46651. }
  46652. },
  46653. ChatBoxes: {
  46654. chatBoxMayBeShown(chatbox) {
  46655. return this.__super__.chatBoxMayBeShown.apply(this, arguments) && !chatbox.get('minimized');
  46656. }
  46657. },
  46658. ChatBoxViews: {
  46659. getChatBoxWidth(view) {
  46660. if (!view.model.get('minimized') && u.isVisible(view.el)) {
  46661. return u.getOuterWidth(view.el, true);
  46662. }
  46663. return 0;
  46664. },
  46665. getShownChats() {
  46666. return this.filter(view => // The controlbox can take a while to close,
  46667. // so we need to check its state. That's why we checked
  46668. // the 'closed' state.
  46669. !view.model.get('minimized') && !view.model.get('closed') && u.isVisible(view.el));
  46670. },
  46671. async trimChats(newchat) {
  46672. /* This method is called when a newly created chat box will
  46673. * be shown.
  46674. *
  46675. * It checks whether there is enough space on the page to show
  46676. * another chat box. Otherwise it minimizes the oldest chat box
  46677. * to create space.
  46678. */
  46679. const _converse = this.__super__._converse,
  46680. shown_chats = this.getShownChats(),
  46681. body_width = u.getOuterWidth(document.querySelector('body'), true);
  46682. if (_converse.no_trimming || shown_chats.length <= 1) {
  46683. return;
  46684. }
  46685. if (this.getChatBoxWidth(shown_chats[0]) === body_width) {
  46686. // If the chats shown are the same width as the body,
  46687. // then we're in responsive mode and the chats are
  46688. // fullscreen. In this case we don't trim.
  46689. return;
  46690. }
  46691. await _converse.api.waitUntil('minimizedChatsInitialized');
  46692. const minimized_el = _.get(_converse.minimized_chats, 'el'),
  46693. new_id = newchat ? newchat.model.get('id') : null;
  46694. if (minimized_el) {
  46695. const minimized_width = _.includes(this.model.pluck('minimized'), true) ? u.getOuterWidth(minimized_el, true) : 0;
  46696. const boxes_width = _.reduce(this.xget(new_id), (memo, view) => memo + this.getChatBoxWidth(view), newchat ? u.getOuterWidth(newchat.el, true) : 0);
  46697. if (minimized_width + boxes_width > body_width) {
  46698. const oldest_chat = this.getOldestMaximizedChat([new_id]);
  46699. if (oldest_chat) {
  46700. // We hide the chat immediately, because waiting
  46701. // for the event to fire (and letting the
  46702. // ChatBoxView hide it then) causes race
  46703. // conditions.
  46704. const view = this.get(oldest_chat.get('id'));
  46705. if (view) {
  46706. view.hide();
  46707. }
  46708. oldest_chat.minimize();
  46709. }
  46710. }
  46711. }
  46712. },
  46713. getOldestMaximizedChat(exclude_ids) {
  46714. // Get oldest view (if its id is not excluded)
  46715. exclude_ids.push('controlbox');
  46716. let i = 0;
  46717. let model = this.model.sort().at(i);
  46718. while (_.includes(exclude_ids, model.get('id')) || model.get('minimized') === true) {
  46719. i++;
  46720. model = this.model.at(i);
  46721. if (!model) {
  46722. return null;
  46723. }
  46724. }
  46725. return model;
  46726. }
  46727. }
  46728. },
  46729. initialize() {
  46730. /* The initialize function gets called as soon as the plugin is
  46731. * loaded by Converse.js's plugin machinery.
  46732. */
  46733. const _converse = this._converse,
  46734. __ = _converse.__; // Add new HTML templates.
  46735. _converse.templates.chatbox_minimize = templates_chatbox_minimize_html__WEBPACK_IMPORTED_MODULE_2___default.a;
  46736. _converse.templates.toggle_chats = templates_toggle_chats_html__WEBPACK_IMPORTED_MODULE_4___default.a;
  46737. _converse.templates.trimmed_chat = templates_trimmed_chat_html__WEBPACK_IMPORTED_MODULE_5___default.a;
  46738. _converse.templates.chats_panel = templates_chats_panel_html__WEBPACK_IMPORTED_MODULE_3___default.a;
  46739. _converse.api.settings.update({
  46740. no_trimming: false // Set to true for phantomjs tests (where browser apparently has no width)
  46741. });
  46742. _converse.api.promises.add('minimizedChatsInitialized');
  46743. _converse.MinimizedChatBoxView = Backbone.NativeView.extend({
  46744. tagName: 'div',
  46745. className: 'chat-head row no-gutters',
  46746. events: {
  46747. 'click .close-chatbox-button': 'close',
  46748. 'click .restore-chat': 'restore'
  46749. },
  46750. initialize() {
  46751. this.model.on('change:num_unread', this.render, this);
  46752. },
  46753. render() {
  46754. const data = _.extend(this.model.toJSON(), {
  46755. 'tooltip': __('Click to restore this chat')
  46756. });
  46757. if (this.model.get('type') === 'chatroom') {
  46758. data.title = this.model.get('name');
  46759. u.addClass('chat-head-chatroom', this.el);
  46760. } else {
  46761. data.title = this.model.get('fullname');
  46762. u.addClass('chat-head-chatbox', this.el);
  46763. }
  46764. this.el.innerHTML = templates_trimmed_chat_html__WEBPACK_IMPORTED_MODULE_5___default()(data);
  46765. return this.el;
  46766. },
  46767. close(ev) {
  46768. if (ev && ev.preventDefault) {
  46769. ev.preventDefault();
  46770. }
  46771. this.remove();
  46772. const view = _converse.chatboxviews.get(this.model.get('id'));
  46773. if (view) {
  46774. // This will call model.destroy(), removing it from the
  46775. // collection and will also emit 'chatBoxClosed'
  46776. view.close();
  46777. } else {
  46778. this.model.destroy();
  46779. _converse.emit('chatBoxClosed', this);
  46780. }
  46781. return this;
  46782. },
  46783. restore: _.debounce(function (ev) {
  46784. if (ev && ev.preventDefault) {
  46785. ev.preventDefault();
  46786. }
  46787. this.model.off('change:num_unread', null, this);
  46788. this.remove();
  46789. this.model.maximize();
  46790. }, 200, {
  46791. 'leading': true
  46792. })
  46793. });
  46794. _converse.MinimizedChats = Backbone.Overview.extend({
  46795. tagName: 'div',
  46796. id: "minimized-chats",
  46797. className: 'hidden',
  46798. events: {
  46799. "click #toggle-minimized-chats": "toggle"
  46800. },
  46801. initialize() {
  46802. this.render();
  46803. this.initToggle();
  46804. this.addMultipleChats(this.model.where({
  46805. 'minimized': true
  46806. }));
  46807. this.model.on("add", this.onChanged, this);
  46808. this.model.on("destroy", this.removeChat, this);
  46809. this.model.on("change:minimized", this.onChanged, this);
  46810. this.model.on('change:num_unread', this.updateUnreadMessagesCounter, this);
  46811. },
  46812. render() {
  46813. if (!this.el.parentElement) {
  46814. this.el.innerHTML = templates_chats_panel_html__WEBPACK_IMPORTED_MODULE_3___default()();
  46815. _converse.chatboxviews.insertRowColumn(this.el);
  46816. }
  46817. if (this.keys().length === 0) {
  46818. this.el.classList.add('hidden');
  46819. } else if (this.keys().length > 0 && !u.isVisible(this.el)) {
  46820. this.el.classList.remove('hidden');
  46821. _converse.chatboxviews.trimChats();
  46822. }
  46823. return this.el;
  46824. },
  46825. tearDown() {
  46826. this.model.off("add", this.onChanged);
  46827. this.model.off("destroy", this.removeChat);
  46828. this.model.off("change:minimized", this.onChanged);
  46829. this.model.off('change:num_unread', this.updateUnreadMessagesCounter);
  46830. return this;
  46831. },
  46832. initToggle() {
  46833. const storage = _converse.config.get('storage'),
  46834. id = b64_sha1(`converse.minchatstoggle${_converse.bare_jid}`);
  46835. this.toggleview = new _converse.MinimizedChatsToggleView({
  46836. 'model': new _converse.MinimizedChatsToggle({
  46837. 'id': id
  46838. })
  46839. });
  46840. this.toggleview.model.browserStorage = new Backbone.BrowserStorage[storage](id);
  46841. this.toggleview.model.fetch();
  46842. },
  46843. toggle(ev) {
  46844. if (ev && ev.preventDefault) {
  46845. ev.preventDefault();
  46846. }
  46847. this.toggleview.model.save({
  46848. 'collapsed': !this.toggleview.model.get('collapsed')
  46849. });
  46850. u.slideToggleElement(this.el.querySelector('.minimized-chats-flyout'), 200);
  46851. },
  46852. onChanged(item) {
  46853. if (item.get('id') === 'controlbox') {
  46854. // The ControlBox has it's own minimize toggle
  46855. return;
  46856. }
  46857. if (item.get('minimized')) {
  46858. this.addChat(item);
  46859. } else if (this.get(item.get('id'))) {
  46860. this.removeChat(item);
  46861. }
  46862. },
  46863. addChatView(item) {
  46864. const existing = this.get(item.get('id'));
  46865. if (existing && existing.el.parentNode) {
  46866. return;
  46867. }
  46868. const view = new _converse.MinimizedChatBoxView({
  46869. model: item
  46870. });
  46871. this.el.querySelector('.minimized-chats-flyout').insertAdjacentElement('beforeEnd', view.render());
  46872. this.add(item.get('id'), view);
  46873. },
  46874. addMultipleChats(items) {
  46875. _.each(items, this.addChatView.bind(this));
  46876. this.toggleview.model.set({
  46877. 'num_minimized': this.keys().length
  46878. });
  46879. this.render();
  46880. },
  46881. addChat(item) {
  46882. this.addChatView(item);
  46883. this.toggleview.model.set({
  46884. 'num_minimized': this.keys().length
  46885. });
  46886. this.render();
  46887. },
  46888. removeChat(item) {
  46889. this.remove(item.get('id'));
  46890. this.toggleview.model.set({
  46891. 'num_minimized': this.keys().length
  46892. });
  46893. this.render();
  46894. },
  46895. updateUnreadMessagesCounter() {
  46896. this.toggleview.model.save({
  46897. 'num_unread': _.sum(this.model.pluck('num_unread'))
  46898. });
  46899. this.render();
  46900. }
  46901. });
  46902. _converse.MinimizedChatsToggle = Backbone.Model.extend({
  46903. defaults: {
  46904. 'collapsed': false,
  46905. 'num_minimized': 0,
  46906. 'num_unread': 0
  46907. }
  46908. });
  46909. _converse.MinimizedChatsToggleView = Backbone.NativeView.extend({
  46910. el: '#toggle-minimized-chats',
  46911. initialize() {
  46912. this.model.on('change:num_minimized', this.render, this);
  46913. this.model.on('change:num_unread', this.render, this);
  46914. this.flyout = this.el.parentElement.querySelector('.minimized-chats-flyout');
  46915. },
  46916. render() {
  46917. this.el.innerHTML = templates_toggle_chats_html__WEBPACK_IMPORTED_MODULE_4___default()(_.extend(this.model.toJSON(), {
  46918. 'Minimized': __('Minimized')
  46919. }));
  46920. if (this.model.get('collapsed')) {
  46921. u.hideElement(this.flyout);
  46922. } else {
  46923. u.showElement(this.flyout);
  46924. }
  46925. return this.el;
  46926. }
  46927. });
  46928. Promise.all([_converse.api.waitUntil('connectionInitialized'), _converse.api.waitUntil('chatBoxViewsInitialized')]).then(() => {
  46929. _converse.minimized_chats = new _converse.MinimizedChats({
  46930. model: _converse.chatboxes
  46931. });
  46932. _converse.emit('minimizedChatsInitialized');
  46933. }).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
  46934. const debouncedTrim = _.debounce(ev => {
  46935. if (_converse.view_mode !== 'overlayed' || !_converse.chatboxviews.trimChats) {
  46936. return;
  46937. }
  46938. if (_converse.connection.connected) {
  46939. _converse.chatboxviews.trimChats();
  46940. }
  46941. }, 200);
  46942. _converse.api.listen.on('registeredGlobalEventHandlers', () => window.addEventListener("resize", debouncedTrim));
  46943. _converse.api.listen.on('unregisteredGlobalEventHandlers', () => window.removeEventListener("resize", debouncedTrim));
  46944. _converse.api.listen.on('controlBoxOpened', function (chatbox) {
  46945. // Wrapped in anon method because at scan time, chatboxviews
  46946. // attr not set yet.
  46947. if (_converse.connection.connected) {
  46948. _converse.chatboxviews.trimChats(chatbox);
  46949. }
  46950. });
  46951. }
  46952. });
  46953. /***/ }),
  46954. /***/ "./src/converse-modal.js":
  46955. /*!*******************************!*\
  46956. !*** ./src/converse-modal.js ***!
  46957. \*******************************/
  46958. /*! no exports provided */
  46959. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46960. "use strict";
  46961. __webpack_require__.r(__webpack_exports__);
  46962. /* harmony import */ var backbone_vdomview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! backbone.vdomview */ "./node_modules/backbone.vdomview/backbone.vdomview.js");
  46963. /* harmony import */ var backbone_vdomview__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(backbone_vdomview__WEBPACK_IMPORTED_MODULE_0__);
  46964. /* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap.native/dist/bootstrap-native-v4.js");
  46965. /* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(bootstrap__WEBPACK_IMPORTED_MODULE_1__);
  46966. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  46967. /* harmony import */ var templates_alert_modal_html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! templates/alert_modal.html */ "./src/templates/alert_modal.html");
  46968. /* harmony import */ var templates_alert_modal_html__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(templates_alert_modal_html__WEBPACK_IMPORTED_MODULE_3__);
  46969. // Converse.js
  46970. // http://conversejs.org
  46971. //
  46972. // Copyright (c) 2013-2018, the Converse.js developers
  46973. // Licensed under the Mozilla Public License (MPLv2)
  46974. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].env,
  46975. Strophe = _converse$env.Strophe,
  46976. Backbone = _converse$env.Backbone,
  46977. _ = _converse$env._;
  46978. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].plugins.add('converse-modal', {
  46979. initialize() {
  46980. const _converse = this._converse;
  46981. _converse.BootstrapModal = Backbone.VDOMView.extend({
  46982. initialize() {
  46983. this.render().insertIntoDOM();
  46984. this.modal = new bootstrap__WEBPACK_IMPORTED_MODULE_1___default.a.Modal(this.el, {
  46985. backdrop: 'static',
  46986. keyboard: true
  46987. });
  46988. this.el.addEventListener('hide.bs.modal', event => {
  46989. if (!_.isNil(this.trigger_el)) {
  46990. this.trigger_el.classList.remove('selected');
  46991. }
  46992. }, false);
  46993. },
  46994. insertIntoDOM() {
  46995. const container_el = _converse.chatboxviews.el.querySelector("#converse-modals");
  46996. container_el.insertAdjacentElement('beforeEnd', this.el);
  46997. },
  46998. show(ev) {
  46999. if (ev) {
  47000. ev.preventDefault();
  47001. this.trigger_el = ev.target;
  47002. this.trigger_el.classList.add('selected');
  47003. }
  47004. this.modal.show();
  47005. }
  47006. });
  47007. _converse.Alert = _converse.BootstrapModal.extend({
  47008. initialize() {
  47009. _converse.BootstrapModal.prototype.initialize.apply(this, arguments);
  47010. this.model.on('change', this.render, this);
  47011. },
  47012. toHTML() {
  47013. return templates_alert_modal_html__WEBPACK_IMPORTED_MODULE_3___default()(this.model.toJSON());
  47014. }
  47015. });
  47016. _converse.api.listen.on('afterTearDown', () => {
  47017. if (!_converse.chatboxviews) {
  47018. return;
  47019. }
  47020. const container = _converse.chatboxviews.el.querySelector("#converse-modals");
  47021. if (container) {
  47022. container.innerHTML = '';
  47023. }
  47024. });
  47025. /************************ BEGIN API ************************/
  47026. // We extend the default converse.js API to add methods specific to MUC chat rooms.
  47027. let alert;
  47028. _.extend(_converse.api, {
  47029. 'alert': {
  47030. 'show'(type, title, messages) {
  47031. if (_.isString(messages)) {
  47032. messages = [messages];
  47033. }
  47034. if (type === Strophe.LogLevel.ERROR) {
  47035. type = 'alert-danger';
  47036. } else if (type === Strophe.LogLevel.INFO) {
  47037. type = 'alert-info';
  47038. } else if (type === Strophe.LogLevel.WARN) {
  47039. type = 'alert-warning';
  47040. }
  47041. if (_.isUndefined(alert)) {
  47042. const model = new Backbone.Model({
  47043. 'title': title,
  47044. 'messages': messages,
  47045. 'type': type
  47046. });
  47047. alert = new _converse.Alert({
  47048. 'model': model
  47049. });
  47050. } else {
  47051. alert.model.set({
  47052. 'title': title,
  47053. 'messages': messages,
  47054. 'type': type
  47055. });
  47056. }
  47057. alert.show();
  47058. }
  47059. }
  47060. });
  47061. }
  47062. });
  47063. /***/ }),
  47064. /***/ "./src/converse-muc-views.js":
  47065. /*!***********************************!*\
  47066. !*** ./src/converse-muc-views.js ***!
  47067. \***********************************/
  47068. /*! no exports provided */
  47069. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  47070. "use strict";
  47071. __webpack_require__.r(__webpack_exports__);
  47072. /* harmony import */ var converse_modal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! converse-modal */ "./src/converse-modal.js");
  47073. /* harmony import */ var awesomplete__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! awesomplete */ "./node_modules/awesomplete-avoid-xss/awesomplete.js");
  47074. /* harmony import */ var awesomplete__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(awesomplete__WEBPACK_IMPORTED_MODULE_1__);
  47075. /* harmony import */ var formdata_polyfill__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! formdata-polyfill */ "./node_modules/formdata-polyfill/FormData.js");
  47076. /* harmony import */ var formdata_polyfill__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(formdata_polyfill__WEBPACK_IMPORTED_MODULE_2__);
  47077. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  47078. /* harmony import */ var _converse_headless_utils_muc__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/headless/utils/muc */ "./src/headless/utils/muc.js");
  47079. /* harmony import */ var templates_add_chatroom_modal_html__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! templates/add_chatroom_modal.html */ "./src/templates/add_chatroom_modal.html");
  47080. /* harmony import */ var templates_add_chatroom_modal_html__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(templates_add_chatroom_modal_html__WEBPACK_IMPORTED_MODULE_5__);
  47081. /* harmony import */ var templates_chatarea_html__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! templates/chatarea.html */ "./src/templates/chatarea.html");
  47082. /* harmony import */ var templates_chatarea_html__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(templates_chatarea_html__WEBPACK_IMPORTED_MODULE_6__);
  47083. /* harmony import */ var templates_chatroom_html__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! templates/chatroom.html */ "./src/templates/chatroom.html");
  47084. /* harmony import */ var templates_chatroom_html__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(templates_chatroom_html__WEBPACK_IMPORTED_MODULE_7__);
  47085. /* harmony import */ var templates_chatroom_destroyed_html__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! templates/chatroom_destroyed.html */ "./src/templates/chatroom_destroyed.html");
  47086. /* harmony import */ var templates_chatroom_destroyed_html__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(templates_chatroom_destroyed_html__WEBPACK_IMPORTED_MODULE_8__);
  47087. /* harmony import */ var templates_chatroom_details_modal_html__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! templates/chatroom_details_modal.html */ "./src/templates/chatroom_details_modal.html");
  47088. /* harmony import */ var templates_chatroom_details_modal_html__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(templates_chatroom_details_modal_html__WEBPACK_IMPORTED_MODULE_9__);
  47089. /* harmony import */ var templates_chatroom_disconnect_html__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! templates/chatroom_disconnect.html */ "./src/templates/chatroom_disconnect.html");
  47090. /* harmony import */ var templates_chatroom_disconnect_html__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(templates_chatroom_disconnect_html__WEBPACK_IMPORTED_MODULE_10__);
  47091. /* harmony import */ var templates_chatroom_features_html__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! templates/chatroom_features.html */ "./src/templates/chatroom_features.html");
  47092. /* harmony import */ var templates_chatroom_features_html__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(templates_chatroom_features_html__WEBPACK_IMPORTED_MODULE_11__);
  47093. /* harmony import */ var templates_chatroom_form_html__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! templates/chatroom_form.html */ "./src/templates/chatroom_form.html");
  47094. /* harmony import */ var templates_chatroom_form_html__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(templates_chatroom_form_html__WEBPACK_IMPORTED_MODULE_12__);
  47095. /* harmony import */ var templates_chatroom_head_html__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! templates/chatroom_head.html */ "./src/templates/chatroom_head.html");
  47096. /* harmony import */ var templates_chatroom_head_html__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(templates_chatroom_head_html__WEBPACK_IMPORTED_MODULE_13__);
  47097. /* harmony import */ var templates_chatroom_invite_html__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! templates/chatroom_invite.html */ "./src/templates/chatroom_invite.html");
  47098. /* harmony import */ var templates_chatroom_invite_html__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(templates_chatroom_invite_html__WEBPACK_IMPORTED_MODULE_14__);
  47099. /* harmony import */ var templates_chatroom_nickname_form_html__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! templates/chatroom_nickname_form.html */ "./src/templates/chatroom_nickname_form.html");
  47100. /* harmony import */ var templates_chatroom_nickname_form_html__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(templates_chatroom_nickname_form_html__WEBPACK_IMPORTED_MODULE_15__);
  47101. /* harmony import */ var templates_chatroom_password_form_html__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! templates/chatroom_password_form.html */ "./src/templates/chatroom_password_form.html");
  47102. /* harmony import */ var templates_chatroom_password_form_html__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(templates_chatroom_password_form_html__WEBPACK_IMPORTED_MODULE_16__);
  47103. /* harmony import */ var templates_chatroom_sidebar_html__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! templates/chatroom_sidebar.html */ "./src/templates/chatroom_sidebar.html");
  47104. /* harmony import */ var templates_chatroom_sidebar_html__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(templates_chatroom_sidebar_html__WEBPACK_IMPORTED_MODULE_17__);
  47105. /* harmony import */ var templates_info_html__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! templates/info.html */ "./src/templates/info.html");
  47106. /* harmony import */ var templates_info_html__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(templates_info_html__WEBPACK_IMPORTED_MODULE_18__);
  47107. /* harmony import */ var templates_list_chatrooms_modal_html__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! templates/list_chatrooms_modal.html */ "./src/templates/list_chatrooms_modal.html");
  47108. /* harmony import */ var templates_list_chatrooms_modal_html__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(templates_list_chatrooms_modal_html__WEBPACK_IMPORTED_MODULE_19__);
  47109. /* harmony import */ var templates_occupant_html__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! templates/occupant.html */ "./src/templates/occupant.html");
  47110. /* harmony import */ var templates_occupant_html__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(templates_occupant_html__WEBPACK_IMPORTED_MODULE_20__);
  47111. /* harmony import */ var templates_room_description_html__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! templates/room_description.html */ "./src/templates/room_description.html");
  47112. /* harmony import */ var templates_room_description_html__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(templates_room_description_html__WEBPACK_IMPORTED_MODULE_21__);
  47113. /* harmony import */ var templates_room_item_html__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! templates/room_item.html */ "./src/templates/room_item.html");
  47114. /* harmony import */ var templates_room_item_html__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(templates_room_item_html__WEBPACK_IMPORTED_MODULE_22__);
  47115. /* harmony import */ var templates_room_panel_html__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! templates/room_panel.html */ "./src/templates/room_panel.html");
  47116. /* harmony import */ var templates_room_panel_html__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(templates_room_panel_html__WEBPACK_IMPORTED_MODULE_23__);
  47117. /* harmony import */ var templates_rooms_results_html__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! templates/rooms_results.html */ "./src/templates/rooms_results.html");
  47118. /* harmony import */ var templates_rooms_results_html__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(templates_rooms_results_html__WEBPACK_IMPORTED_MODULE_24__);
  47119. /* harmony import */ var templates_spinner_html__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! templates/spinner.html */ "./src/templates/spinner.html");
  47120. /* harmony import */ var templates_spinner_html__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(templates_spinner_html__WEBPACK_IMPORTED_MODULE_25__);
  47121. /* harmony import */ var xss__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! xss */ "./node_modules/xss/dist/xss.js");
  47122. /* harmony import */ var xss__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(xss__WEBPACK_IMPORTED_MODULE_26__);
  47123. // Converse.js
  47124. // http://conversejs.org
  47125. //
  47126. // Copyright (c) 2013-2018, the Converse.js developers
  47127. // Licensed under the Mozilla Public License (MPLv2)
  47128. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].env,
  47129. Backbone = _converse$env.Backbone,
  47130. Promise = _converse$env.Promise,
  47131. Strophe = _converse$env.Strophe,
  47132. b64_sha1 = _converse$env.b64_sha1,
  47133. moment = _converse$env.moment,
  47134. f = _converse$env.f,
  47135. sizzle = _converse$env.sizzle,
  47136. _ = _converse$env._,
  47137. $build = _converse$env.$build,
  47138. $iq = _converse$env.$iq,
  47139. $msg = _converse$env.$msg,
  47140. $pres = _converse$env.$pres;
  47141. const u = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].env.utils;
  47142. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add('converse-muc-views', {
  47143. /* Dependencies are other plugins which might be
  47144. * overridden or relied upon, and therefore need to be loaded before
  47145. * this plugin. They are "optional" because they might not be
  47146. * available, in which case any overrides applicable to them will be
  47147. * ignored.
  47148. *
  47149. * NB: These plugins need to have already been loaded via require.js.
  47150. *
  47151. * It's possible to make these dependencies "non-optional".
  47152. * If the setting "strict_plugin_dependencies" is set to true,
  47153. * an error will be raised if the plugin is not found.
  47154. */
  47155. dependencies: ["converse-autocomplete", "converse-modal", "converse-controlbox", "converse-chatview"],
  47156. overrides: {
  47157. ControlBoxView: {
  47158. renderRoomsPanel() {
  47159. const _converse = this.__super__._converse;
  47160. this.roomspanel = new _converse.RoomsPanel({
  47161. 'model': new (_converse.RoomsPanelModel.extend({
  47162. 'id': b64_sha1(`converse.roomspanel${_converse.bare_jid}`),
  47163. // Required by sessionStorage
  47164. 'browserStorage': new Backbone.BrowserStorage[_converse.config.get('storage')](b64_sha1(`converse.roomspanel${_converse.bare_jid}`))
  47165. }))()
  47166. });
  47167. this.roomspanel.model.fetch();
  47168. this.el.querySelector('.controlbox-pane').insertAdjacentElement('beforeEnd', this.roomspanel.render().el);
  47169. if (!this.roomspanel.model.get('nick')) {
  47170. this.roomspanel.model.save({
  47171. nick: _converse.xmppstatus.vcard.get('nickname') || Strophe.getNodeFromJid(_converse.bare_jid)
  47172. });
  47173. }
  47174. _converse.emit('roomsPanelRendered');
  47175. },
  47176. renderControlBoxPane() {
  47177. const _converse = this.__super__._converse;
  47178. this.__super__.renderControlBoxPane.apply(this, arguments);
  47179. if (_converse.allow_muc) {
  47180. this.renderRoomsPanel();
  47181. }
  47182. }
  47183. }
  47184. },
  47185. initialize() {
  47186. const _converse = this._converse,
  47187. __ = _converse.__;
  47188. _converse.api.promises.add(['roomsPanelRendered']); // Configuration values for this plugin
  47189. // ====================================
  47190. // Refer to docs/source/configuration.rst for explanations of these
  47191. // configuration settings.
  47192. _converse.api.settings.update({
  47193. 'auto_list_rooms': false,
  47194. 'hide_muc_server': false,
  47195. // TODO: no longer implemented...
  47196. 'muc_disable_moderator_commands': false,
  47197. 'visible_toolbar_buttons': {
  47198. 'toggle_occupants': true
  47199. }
  47200. });
  47201. function ___(str) {
  47202. /* This is part of a hack to get gettext to scan strings to be
  47203. * translated. Strings we cannot send to the function above because
  47204. * they require variable interpolation and we don't yet have the
  47205. * variables at scan time.
  47206. *
  47207. * See actionInfoMessages further below.
  47208. */
  47209. return str;
  47210. }
  47211. /* http://xmpp.org/extensions/xep-0045.html
  47212. * ----------------------------------------
  47213. * 100 message Entering a groupchat Inform user that any occupant is allowed to see the user's full JID
  47214. * 101 message (out of band) Affiliation change Inform user that his or her affiliation changed while not in the groupchat
  47215. * 102 message Configuration change Inform occupants that groupchat now shows unavailable members
  47216. * 103 message Configuration change Inform occupants that groupchat now does not show unavailable members
  47217. * 104 message Configuration change Inform occupants that a non-privacy-related groupchat configuration change has occurred
  47218. * 110 presence Any groupchat presence Inform user that presence refers to one of its own groupchat occupants
  47219. * 170 message or initial presence Configuration change Inform occupants that groupchat logging is now enabled
  47220. * 171 message Configuration change Inform occupants that groupchat logging is now disabled
  47221. * 172 message Configuration change Inform occupants that the groupchat is now non-anonymous
  47222. * 173 message Configuration change Inform occupants that the groupchat is now semi-anonymous
  47223. * 174 message Configuration change Inform occupants that the groupchat is now fully-anonymous
  47224. * 201 presence Entering a groupchat Inform user that a new groupchat has been created
  47225. * 210 presence Entering a groupchat Inform user that the service has assigned or modified the occupant's roomnick
  47226. * 301 presence Removal from groupchat Inform user that he or she has been banned from the groupchat
  47227. * 303 presence Exiting a groupchat Inform all occupants of new groupchat nickname
  47228. * 307 presence Removal from groupchat Inform user that he or she has been kicked from the groupchat
  47229. * 321 presence Removal from groupchat Inform user that he or she is being removed from the groupchat because of an affiliation change
  47230. * 322 presence Removal from groupchat Inform user that he or she is being removed from the groupchat because the groupchat has been changed to members-only and the user is not a member
  47231. * 332 presence Removal from groupchat Inform user that he or she is being removed from the groupchat because of a system shutdown
  47232. */
  47233. _converse.muc = {
  47234. info_messages: {
  47235. 100: __('This groupchat is not anonymous'),
  47236. 102: __('This groupchat now shows unavailable members'),
  47237. 103: __('This groupchat does not show unavailable members'),
  47238. 104: __('The groupchat configuration has changed'),
  47239. 170: __('groupchat logging is now enabled'),
  47240. 171: __('groupchat logging is now disabled'),
  47241. 172: __('This groupchat is now no longer anonymous'),
  47242. 173: __('This groupchat is now semi-anonymous'),
  47243. 174: __('This groupchat is now fully-anonymous'),
  47244. 201: __('A new groupchat has been created')
  47245. },
  47246. disconnect_messages: {
  47247. 301: __('You have been banned from this groupchat'),
  47248. 307: __('You have been kicked from this groupchat'),
  47249. 321: __("You have been removed from this groupchat because of an affiliation change"),
  47250. 322: __("You have been removed from this groupchat because the groupchat has changed to members-only and you're not a member"),
  47251. 332: __("You have been removed from this groupchat because the service hosting it is being shut down")
  47252. },
  47253. action_info_messages: {
  47254. /* XXX: Note the triple underscore function and not double
  47255. * underscore.
  47256. *
  47257. * This is a hack. We can't pass the strings to __ because we
  47258. * don't yet know what the variable to interpolate is.
  47259. *
  47260. * Triple underscore will just return the string again, but we
  47261. * can then at least tell gettext to scan for it so that these
  47262. * strings are picked up by the translation machinery.
  47263. */
  47264. 301: ___("%1$s has been banned"),
  47265. 303: ___("%1$s's nickname has changed"),
  47266. 307: ___("%1$s has been kicked out"),
  47267. 321: ___("%1$s has been removed because of an affiliation change"),
  47268. 322: ___("%1$s has been removed for not being a member")
  47269. },
  47270. new_nickname_messages: {
  47271. 210: ___('Your nickname has been automatically set to %1$s'),
  47272. 303: ___('Your nickname has been changed to %1$s')
  47273. }
  47274. };
  47275. function insertRoomInfo(el, stanza) {
  47276. /* Insert groupchat info (based on returned #disco IQ stanza)
  47277. *
  47278. * Parameters:
  47279. * (HTMLElement) el: The HTML DOM element that should
  47280. * contain the info.
  47281. * (XMLElement) stanza: The IQ stanza containing the groupchat
  47282. * info.
  47283. */
  47284. // All MUC features found here: http://xmpp.org/registrar/disco-features.html
  47285. el.querySelector('span.spinner').remove();
  47286. el.querySelector('a.room-info').classList.add('selected');
  47287. el.insertAdjacentHTML('beforeEnd', templates_room_description_html__WEBPACK_IMPORTED_MODULE_21___default()({
  47288. 'jid': stanza.getAttribute('from'),
  47289. 'desc': _.get(_.head(sizzle('field[var="muc#roominfo_description"] value', stanza)), 'textContent'),
  47290. 'occ': _.get(_.head(sizzle('field[var="muc#roominfo_occupants"] value', stanza)), 'textContent'),
  47291. 'hidden': sizzle('feature[var="muc_hidden"]', stanza).length,
  47292. 'membersonly': sizzle('feature[var="muc_membersonly"]', stanza).length,
  47293. 'moderated': sizzle('feature[var="muc_moderated"]', stanza).length,
  47294. 'nonanonymous': sizzle('feature[var="muc_nonanonymous"]', stanza).length,
  47295. 'open': sizzle('feature[var="muc_open"]', stanza).length,
  47296. 'passwordprotected': sizzle('feature[var="muc_passwordprotected"]', stanza).length,
  47297. 'persistent': sizzle('feature[var="muc_persistent"]', stanza).length,
  47298. 'publicroom': sizzle('feature[var="muc_publicroom"]', stanza).length,
  47299. 'semianonymous': sizzle('feature[var="muc_semianonymous"]', stanza).length,
  47300. 'temporary': sizzle('feature[var="muc_temporary"]', stanza).length,
  47301. 'unmoderated': sizzle('feature[var="muc_unmoderated"]', stanza).length,
  47302. 'label_desc': __('Description:'),
  47303. 'label_jid': __('Groupchat Address (JID):'),
  47304. 'label_occ': __('Participants:'),
  47305. 'label_features': __('Features:'),
  47306. 'label_requires_auth': __('Requires authentication'),
  47307. 'label_hidden': __('Hidden'),
  47308. 'label_requires_invite': __('Requires an invitation'),
  47309. 'label_moderated': __('Moderated'),
  47310. 'label_non_anon': __('Non-anonymous'),
  47311. 'label_open_room': __('Open'),
  47312. 'label_permanent_room': __('Permanent'),
  47313. 'label_public': __('Public'),
  47314. 'label_semi_anon': __('Semi-anonymous'),
  47315. 'label_temp_room': __('Temporary'),
  47316. 'label_unmoderated': __('Unmoderated')
  47317. }));
  47318. }
  47319. function toggleRoomInfo(ev) {
  47320. /* Show/hide extra information about a groupchat in a listing. */
  47321. const parent_el = u.ancestor(ev.target, '.room-item'),
  47322. div_el = parent_el.querySelector('div.room-info');
  47323. if (div_el) {
  47324. u.slideIn(div_el).then(u.removeElement);
  47325. parent_el.querySelector('a.room-info').classList.remove('selected');
  47326. } else {
  47327. parent_el.insertAdjacentHTML('beforeend', templates_spinner_html__WEBPACK_IMPORTED_MODULE_25___default()());
  47328. _converse.api.disco.info(ev.target.getAttribute('data-room-jid'), null).then(stanza => insertRoomInfo(parent_el, stanza)).catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
  47329. }
  47330. }
  47331. _converse.ListChatRoomsModal = _converse.BootstrapModal.extend({
  47332. events: {
  47333. 'submit form': 'showRooms',
  47334. 'click a.room-info': 'toggleRoomInfo',
  47335. 'change input[name=nick]': 'setNick',
  47336. 'change input[name=server]': 'setDomain',
  47337. 'click .open-room': 'openRoom'
  47338. },
  47339. initialize() {
  47340. _converse.BootstrapModal.prototype.initialize.apply(this, arguments);
  47341. this.model.on('change:muc_domain', this.onDomainChange, this);
  47342. },
  47343. toHTML() {
  47344. return templates_list_chatrooms_modal_html__WEBPACK_IMPORTED_MODULE_19___default()(_.extend(this.model.toJSON(), {
  47345. 'heading_list_chatrooms': __('Query for Groupchats'),
  47346. 'label_server_address': __('Server address'),
  47347. 'label_query': __('Show groupchats'),
  47348. 'server_placeholder': __('conference.example.org')
  47349. }));
  47350. },
  47351. afterRender() {
  47352. this.el.addEventListener('shown.bs.modal', () => {
  47353. this.el.querySelector('input[name="server"]').focus();
  47354. }, false);
  47355. },
  47356. openRoom(ev) {
  47357. ev.preventDefault();
  47358. const jid = ev.target.getAttribute('data-room-jid');
  47359. const name = ev.target.getAttribute('data-room-name');
  47360. this.modal.hide();
  47361. _converse.api.rooms.open(jid, {
  47362. 'name': name
  47363. });
  47364. },
  47365. toggleRoomInfo(ev) {
  47366. ev.preventDefault();
  47367. toggleRoomInfo(ev);
  47368. },
  47369. onDomainChange(model) {
  47370. if (_converse.auto_list_rooms) {
  47371. this.updateRoomsList();
  47372. }
  47373. },
  47374. roomStanzaItemToHTMLElement(groupchat) {
  47375. const name = Strophe.unescapeNode(groupchat.getAttribute('name') || groupchat.getAttribute('jid'));
  47376. const div = document.createElement('div');
  47377. div.innerHTML = templates_room_item_html__WEBPACK_IMPORTED_MODULE_22___default()({
  47378. 'name': Strophe.xmlunescape(name),
  47379. 'jid': groupchat.getAttribute('jid'),
  47380. 'open_title': __('Click to open this groupchat'),
  47381. 'info_title': __('Show more information on this groupchat')
  47382. });
  47383. return div.firstElementChild;
  47384. },
  47385. removeSpinner() {
  47386. _.each(this.el.querySelectorAll('span.spinner'), el => el.parentNode.removeChild(el));
  47387. },
  47388. informNoRoomsFound() {
  47389. const chatrooms_el = this.el.querySelector('.available-chatrooms');
  47390. chatrooms_el.innerHTML = templates_rooms_results_html__WEBPACK_IMPORTED_MODULE_24___default()({
  47391. 'feedback_text': __('No groupchats found')
  47392. });
  47393. const input_el = this.el.querySelector('input[name="server"]');
  47394. input_el.classList.remove('hidden');
  47395. this.removeSpinner();
  47396. },
  47397. onRoomsFound(iq) {
  47398. /* Handle the IQ stanza returned from the server, containing
  47399. * all its public groupchats.
  47400. */
  47401. const available_chatrooms = this.el.querySelector('.available-chatrooms');
  47402. this.rooms = iq.querySelectorAll('query item');
  47403. if (this.rooms.length) {
  47404. // For translators: %1$s is a variable and will be
  47405. // replaced with the XMPP server name
  47406. available_chatrooms.innerHTML = templates_rooms_results_html__WEBPACK_IMPORTED_MODULE_24___default()({
  47407. 'feedback_text': __('Groupchats found:')
  47408. });
  47409. const fragment = document.createDocumentFragment();
  47410. const children = _.reject(_.map(this.rooms, this.roomStanzaItemToHTMLElement), _.isNil);
  47411. _.each(children, child => fragment.appendChild(child));
  47412. available_chatrooms.appendChild(fragment);
  47413. this.removeSpinner();
  47414. } else {
  47415. this.informNoRoomsFound();
  47416. }
  47417. return true;
  47418. },
  47419. updateRoomsList() {
  47420. /* Send an IQ stanza to the server asking for all groupchats
  47421. */
  47422. const iq = $iq({
  47423. 'to': this.model.get('muc_domain'),
  47424. 'from': _converse.connection.jid,
  47425. 'type': "get"
  47426. }).c("query", {
  47427. xmlns: Strophe.NS.DISCO_ITEMS
  47428. });
  47429. _converse.api.sendIQ(iq).then(iq => this.onRoomsFound(iq)).catch(iq => this.informNoRoomsFound());
  47430. },
  47431. showRooms(ev) {
  47432. ev.preventDefault();
  47433. const data = new FormData(ev.target);
  47434. this.model.save('muc_domain', Strophe.getDomainFromJid(data.get('server')));
  47435. this.updateRoomsList();
  47436. },
  47437. setDomain(ev) {
  47438. this.model.save('muc_domain', Strophe.getDomainFromJid(ev.target.value));
  47439. },
  47440. setNick(ev) {
  47441. this.model.save({
  47442. nick: ev.target.value
  47443. });
  47444. }
  47445. });
  47446. _converse.AddChatRoomModal = _converse.BootstrapModal.extend({
  47447. events: {
  47448. 'submit form.add-chatroom': 'openChatRoom'
  47449. },
  47450. toHTML() {
  47451. return templates_add_chatroom_modal_html__WEBPACK_IMPORTED_MODULE_5___default()(_.extend(this.model.toJSON(), {
  47452. 'heading_new_chatroom': __('Enter a new Groupchat'),
  47453. 'label_room_address': __('Groupchat address'),
  47454. 'label_nickname': __('Optional nickname'),
  47455. 'chatroom_placeholder': __('name@conference.example.org'),
  47456. 'label_join': __('Join')
  47457. }));
  47458. },
  47459. afterRender() {
  47460. this.el.addEventListener('shown.bs.modal', () => {
  47461. this.el.querySelector('input[name="chatroom"]').focus();
  47462. }, false);
  47463. },
  47464. parseRoomDataFromEvent(form) {
  47465. const data = new FormData(form);
  47466. const jid = data.get('chatroom');
  47467. this.model.save('muc_domain', Strophe.getDomainFromJid(jid));
  47468. return {
  47469. 'jid': jid,
  47470. 'nick': data.get('nickname')
  47471. };
  47472. },
  47473. openChatRoom(ev) {
  47474. ev.preventDefault();
  47475. const data = this.parseRoomDataFromEvent(ev.target);
  47476. if (data.nick === "") {
  47477. // Make sure defaults apply if no nick is provided.
  47478. data.nick = undefined;
  47479. }
  47480. _converse.api.rooms.open(data.jid, data);
  47481. this.modal.hide();
  47482. ev.target.reset();
  47483. }
  47484. });
  47485. _converse.RoomDetailsModal = _converse.BootstrapModal.extend({
  47486. initialize() {
  47487. _converse.BootstrapModal.prototype.initialize.apply(this, arguments);
  47488. this.model.on('change', this.render, this);
  47489. this.model.occupants.on('add', this.render, this);
  47490. this.model.occupants.on('change', this.render, this);
  47491. },
  47492. toHTML() {
  47493. return templates_chatroom_details_modal_html__WEBPACK_IMPORTED_MODULE_9___default()(_.extend(this.model.toJSON(), {
  47494. '_': _,
  47495. '__': __,
  47496. 'topic': u.addHyperlinks(xss__WEBPACK_IMPORTED_MODULE_26___default.a.filterXSS(_.get(this.model.get('subject'), 'text'), {
  47497. 'whiteList': {}
  47498. })),
  47499. 'display_name': __('Groupchat info for %1$s', this.model.getDisplayName()),
  47500. 'num_occupants': this.model.occupants.length
  47501. }));
  47502. }
  47503. });
  47504. _converse.ChatRoomView = _converse.ChatBoxView.extend({
  47505. /* Backbone.NativeView which renders a groupchat, based upon the view
  47506. * for normal one-on-one chat boxes.
  47507. */
  47508. length: 300,
  47509. tagName: 'div',
  47510. className: 'chatbox chatroom hidden',
  47511. is_chatroom: true,
  47512. events: {
  47513. 'change input.fileupload': 'onFileSelection',
  47514. 'click .chat-msg__action-edit': 'onMessageEditButtonClicked',
  47515. 'click .chatbox-navback': 'showControlBox',
  47516. 'click .close-chatbox-button': 'close',
  47517. 'click .configure-chatroom-button': 'getAndRenderConfigurationForm',
  47518. 'click .hide-occupants': 'hideOccupants',
  47519. 'click .new-msgs-indicator': 'viewUnreadMessages',
  47520. 'click .occupant-nick': 'onOccupantClicked',
  47521. 'click .send-button': 'onFormSubmitted',
  47522. 'click .show-room-details-modal': 'showRoomDetailsModal',
  47523. 'click .toggle-call': 'toggleCall',
  47524. 'click .toggle-occupants': 'toggleOccupants',
  47525. 'click .toggle-smiley ul.emoji-picker li': 'insertEmoji',
  47526. 'click .toggle-smiley': 'toggleEmojiMenu',
  47527. 'click .upload-file': 'toggleFileUpload',
  47528. 'keydown .chat-textarea': 'keyPressed',
  47529. 'keyup .chat-textarea': 'keyUp',
  47530. 'input .chat-textarea': 'inputChanged'
  47531. },
  47532. initialize() {
  47533. this.initDebounced();
  47534. this.model.messages.on('add', this.onMessageAdded, this);
  47535. this.model.messages.on('rendered', this.scrollDown, this);
  47536. this.model.on('change:affiliation', this.renderHeading, this);
  47537. this.model.on('change:connection_status', this.afterConnected, this);
  47538. this.model.on('change:jid', this.renderHeading, this);
  47539. this.model.on('change:name', this.renderHeading, this);
  47540. this.model.on('change:subject', this.renderHeading, this);
  47541. this.model.on('change:subject', this.setChatRoomSubject, this);
  47542. this.model.on('configurationNeeded', this.getAndRenderConfigurationForm, this);
  47543. this.model.on('destroy', this.hide, this);
  47544. this.model.on('show', this.show, this);
  47545. this.model.occupants.on('add', this.onOccupantAdded, this);
  47546. this.model.occupants.on('remove', this.onOccupantRemoved, this);
  47547. this.model.occupants.on('change:show', this.showJoinOrLeaveNotification, this);
  47548. this.model.occupants.on('change:role', this.informOfOccupantsRoleChange, this);
  47549. this.model.occupants.on('change:affiliation', this.informOfOccupantsAffiliationChange, this);
  47550. this.createEmojiPicker();
  47551. this.createOccupantsView();
  47552. this.render().insertIntoDOM();
  47553. this.registerHandlers();
  47554. this.enterRoom();
  47555. },
  47556. enterRoom(ev) {
  47557. if (ev) {
  47558. ev.preventDefault();
  47559. }
  47560. if (this.model.get('connection_status') !== _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.ENTERED) {
  47561. const handler = () => {
  47562. if (!u.isPersistableModel(this.model)) {
  47563. // Happens during tests, nothing to do if this
  47564. // is a hanging chatbox (i.e. not in the collection anymore).
  47565. return;
  47566. }
  47567. this.populateAndJoin();
  47568. _converse.emit('chatRoomOpened', this);
  47569. };
  47570. this.model.getRoomFeatures().then(handler, handler);
  47571. } else {
  47572. this.fetchMessages();
  47573. _converse.emit('chatRoomOpened', this);
  47574. }
  47575. },
  47576. render() {
  47577. this.el.setAttribute('id', this.model.get('box_id'));
  47578. this.el.innerHTML = templates_chatroom_html__WEBPACK_IMPORTED_MODULE_7___default()();
  47579. this.renderHeading();
  47580. this.renderChatArea();
  47581. this.renderMessageForm();
  47582. this.initAutoComplete();
  47583. if (this.model.get('connection_status') !== _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.ENTERED) {
  47584. this.showSpinner();
  47585. }
  47586. return this;
  47587. },
  47588. renderHeading() {
  47589. /* Render the heading UI of the groupchat. */
  47590. this.el.querySelector('.chat-head-chatroom').innerHTML = this.generateHeadingHTML();
  47591. },
  47592. renderChatArea() {
  47593. /* Render the UI container in which groupchat messages will appear.
  47594. */
  47595. if (_.isNull(this.el.querySelector('.chat-area'))) {
  47596. const container_el = this.el.querySelector('.chatroom-body');
  47597. container_el.insertAdjacentHTML('beforeend', templates_chatarea_html__WEBPACK_IMPORTED_MODULE_6___default()({
  47598. 'show_send_button': _converse.show_send_button
  47599. }));
  47600. container_el.insertAdjacentElement('beforeend', this.occupantsview.el);
  47601. this.content = this.el.querySelector('.chat-content');
  47602. this.toggleOccupants(null, true);
  47603. }
  47604. return this;
  47605. },
  47606. initAutoComplete() {
  47607. this.auto_complete = new _converse.AutoComplete(this.el, {
  47608. 'auto_first': true,
  47609. 'auto_evaluate': false,
  47610. 'min_chars': 1,
  47611. 'match_current_word': true,
  47612. 'match_on_tab': true,
  47613. 'list': () => this.model.occupants.map(o => ({
  47614. 'label': o.getDisplayName(),
  47615. 'value': `@${o.getDisplayName()}`
  47616. })),
  47617. 'filter': _converse.FILTER_STARTSWITH,
  47618. 'trigger_on_at': true
  47619. });
  47620. this.auto_complete.on('suggestion-box-selectcomplete', () => this.auto_completing = false);
  47621. },
  47622. keyPressed(ev) {
  47623. if (this.auto_complete.keyPressed(ev)) {
  47624. return;
  47625. }
  47626. return _converse.ChatBoxView.prototype.keyPressed.apply(this, arguments);
  47627. },
  47628. keyUp(ev) {
  47629. this.auto_complete.evaluate(ev);
  47630. },
  47631. showRoomDetailsModal(ev) {
  47632. ev.preventDefault();
  47633. if (_.isUndefined(this.model.room_details_modal)) {
  47634. this.model.room_details_modal = new _converse.RoomDetailsModal({
  47635. 'model': this.model
  47636. });
  47637. }
  47638. this.model.room_details_modal.show(ev);
  47639. },
  47640. showChatStateNotification(message) {
  47641. if (message.get('sender') === 'me') {
  47642. return;
  47643. }
  47644. return _converse.ChatBoxView.prototype.showChatStateNotification.apply(this, arguments);
  47645. },
  47646. createOccupantsView() {
  47647. /* Create the ChatRoomOccupantsView Backbone.NativeView
  47648. */
  47649. this.model.occupants.chatroomview = this;
  47650. this.occupantsview = new _converse.ChatRoomOccupantsView({
  47651. 'model': this.model.occupants
  47652. });
  47653. return this;
  47654. },
  47655. informOfOccupantsAffiliationChange(occupant, changed) {
  47656. const previous_affiliation = occupant._previousAttributes.affiliation,
  47657. current_affiliation = occupant.get('affiliation');
  47658. if (previous_affiliation === 'admin') {
  47659. this.showChatEvent(__("%1$s is no longer an admin of this groupchat", occupant.get('nick')));
  47660. } else if (previous_affiliation === 'owner') {
  47661. this.showChatEvent(__("%1$s is no longer an owner of this groupchat", occupant.get('nick')));
  47662. } else if (previous_affiliation === 'outcast') {
  47663. this.showChatEvent(__("%1$s is no longer banned from this groupchat", occupant.get('nick')));
  47664. }
  47665. if (current_affiliation === 'none' && previous_affiliation === 'member') {
  47666. this.showChatEvent(__("%1$s is no longer a permanent member of this groupchat", occupant.get('nick')));
  47667. }
  47668. if (current_affiliation === 'member') {
  47669. this.showChatEvent(__("%1$s is now a permanent member of this groupchat", occupant.get('nick')));
  47670. } else if (current_affiliation === 'outcast') {
  47671. this.showChatEvent(__("%1$s has been banned from this groupchat", occupant.get('nick')));
  47672. } else if (current_affiliation === 'admin' || current_affiliation == 'owner') {
  47673. // For example: AppleJack is now an (admin|owner) of this groupchat
  47674. this.showChatEvent(__('%1$s is now an %2$s of this groupchat', occupant.get('nick'), current_affiliation));
  47675. }
  47676. },
  47677. informOfOccupantsRoleChange(occupant, changed) {
  47678. if (changed === "none") {
  47679. return;
  47680. }
  47681. const previous_role = occupant._previousAttributes.role;
  47682. if (previous_role === 'moderator') {
  47683. this.showChatEvent(__("%1$s is no longer a moderator", occupant.get('nick')));
  47684. }
  47685. if (previous_role === 'visitor') {
  47686. this.showChatEvent(__("%1$s has been given a voice again", occupant.get('nick')));
  47687. }
  47688. if (occupant.get('role') === 'visitor') {
  47689. this.showChatEvent(__("%1$s has been muted", occupant.get('nick')));
  47690. }
  47691. if (occupant.get('role') === 'moderator') {
  47692. this.showChatEvent(__("%1$s is now a moderator", occupant.get('nick')));
  47693. }
  47694. },
  47695. generateHeadingHTML() {
  47696. /* Returns the heading HTML to be rendered.
  47697. */
  47698. return templates_chatroom_head_html__WEBPACK_IMPORTED_MODULE_13___default()(_.extend(this.model.toJSON(), {
  47699. 'Strophe': Strophe,
  47700. 'info_close': __('Close and leave this groupchat'),
  47701. 'info_configure': __('Configure this groupchat'),
  47702. 'info_details': __('Show more details about this groupchat'),
  47703. 'description': u.addHyperlinks(xss__WEBPACK_IMPORTED_MODULE_26___default.a.filterXSS(_.get(this.model.get('subject'), 'text'), {
  47704. 'whiteList': {}
  47705. }))
  47706. }));
  47707. },
  47708. afterShown() {
  47709. /* Override from converse-chatview, specifically to avoid
  47710. * the 'active' chat state from being sent out prematurely.
  47711. *
  47712. * This is instead done in `afterConnected` below.
  47713. */
  47714. if (u.isPersistableModel(this.model)) {
  47715. this.model.clearUnreadMsgCounter();
  47716. this.model.save();
  47717. }
  47718. this.occupantsview.setOccupantsHeight();
  47719. this.scrollDown();
  47720. this.renderEmojiPicker();
  47721. },
  47722. show() {
  47723. if (u.isVisible(this.el)) {
  47724. this.focus();
  47725. return;
  47726. } // Override from converse-chatview in order to not use
  47727. // "fadeIn", which causes flashing.
  47728. u.showElement(this.el);
  47729. this.afterShown();
  47730. },
  47731. afterConnected() {
  47732. if (this.model.get('connection_status') === _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.ENTERED) {
  47733. this.hideSpinner();
  47734. this.setChatState(_converse.ACTIVE);
  47735. this.scrollDown();
  47736. this.focus();
  47737. }
  47738. },
  47739. getToolbarOptions() {
  47740. return _.extend(_converse.ChatBoxView.prototype.getToolbarOptions.apply(this, arguments), {
  47741. 'label_hide_occupants': __('Hide the list of participants'),
  47742. 'show_occupants_toggle': this.is_chatroom && _converse.visible_toolbar_buttons.toggle_occupants
  47743. });
  47744. },
  47745. close(ev) {
  47746. /* Close this chat box, which implies leaving the groupchat as
  47747. * well.
  47748. */
  47749. this.hide();
  47750. if (Backbone.history.getFragment() === "converse/room?jid=" + this.model.get('jid')) {
  47751. _converse.router.navigate('');
  47752. }
  47753. this.model.leave();
  47754. _converse.ChatBoxView.prototype.close.apply(this, arguments);
  47755. },
  47756. setOccupantsVisibility() {
  47757. const icon_el = this.el.querySelector('.toggle-occupants');
  47758. if (this.model.get('hidden_occupants')) {
  47759. u.removeClass('fa-angle-double-right', icon_el);
  47760. u.addClass('fa-angle-double-left', icon_el);
  47761. const chat_area = this.el.querySelector('.chat-area');
  47762. u.removeClass('col-md-9', chat_area);
  47763. u.removeClass('col-8', chat_area);
  47764. u.addClass('full', chat_area);
  47765. u.addClass('col-12', chat_area);
  47766. u.hideElement(this.el.querySelector('.occupants'));
  47767. } else {
  47768. const chat_area = this.el.querySelector('.chat-area');
  47769. u.addClass('fa-angle-double-right', icon_el);
  47770. u.removeClass('fa-angle-double-left', icon_el);
  47771. u.removeClass('hidden', this.el.querySelector('.occupants'));
  47772. u.removeClass('full', chat_area);
  47773. u.removeClass('col-12', chat_area);
  47774. u.addClass('col-md-9', chat_area);
  47775. u.addClass('col-8', chat_area);
  47776. }
  47777. this.occupantsview.setOccupantsHeight();
  47778. },
  47779. hideOccupants(ev, preserve_state) {
  47780. /* Show or hide the right sidebar containing the chat
  47781. * occupants (and the invite widget).
  47782. */
  47783. if (ev) {
  47784. ev.preventDefault();
  47785. ev.stopPropagation();
  47786. }
  47787. this.model.save({
  47788. 'hidden_occupants': true
  47789. });
  47790. this.setOccupantsVisibility();
  47791. this.scrollDown();
  47792. },
  47793. toggleOccupants(ev, preserve_state) {
  47794. /* Show or hide the right sidebar containing the chat
  47795. * occupants (and the invite widget).
  47796. */
  47797. if (ev) {
  47798. ev.preventDefault();
  47799. ev.stopPropagation();
  47800. }
  47801. if (!preserve_state) {
  47802. this.model.set({
  47803. 'hidden_occupants': !this.model.get('hidden_occupants')
  47804. });
  47805. }
  47806. this.setOccupantsVisibility();
  47807. this.scrollDown();
  47808. },
  47809. onOccupantClicked(ev) {
  47810. /* When an occupant is clicked, insert their nickname into
  47811. * the chat textarea input.
  47812. */
  47813. this.insertIntoTextArea(ev.target.textContent);
  47814. },
  47815. handleChatStateNotification(message) {
  47816. /* Override the method on the ChatBoxView base class to
  47817. * ignore <gone/> notifications in groupchats.
  47818. *
  47819. * As laid out in the business rules in XEP-0085
  47820. * http://xmpp.org/extensions/xep-0085.html#bizrules-groupchat
  47821. */
  47822. if (message.get('fullname') === this.model.get('nick')) {
  47823. // Don't know about other servers, but OpenFire sends
  47824. // back to you your own chat state notifications.
  47825. // We ignore them here...
  47826. return;
  47827. }
  47828. if (message.get('chat_state') !== _converse.GONE) {
  47829. _converse.ChatBoxView.prototype.handleChatStateNotification.apply(this, arguments);
  47830. }
  47831. },
  47832. modifyRole(groupchat, nick, role, reason, onSuccess, onError) {
  47833. const item = $build("item", {
  47834. nick,
  47835. role
  47836. });
  47837. const iq = $iq({
  47838. to: groupchat,
  47839. type: "set"
  47840. }).c("query", {
  47841. xmlns: Strophe.NS.MUC_ADMIN
  47842. }).cnode(item.node);
  47843. if (reason !== null) {
  47844. iq.c("reason", reason);
  47845. }
  47846. return _converse.api.sendIQ(iq).then(onSuccess).catch(onError);
  47847. },
  47848. verifyRoles(roles) {
  47849. const me = this.model.occupants.findWhere({
  47850. 'jid': _converse.bare_jid
  47851. });
  47852. if (!_.includes(roles, me.get('role'))) {
  47853. this.showErrorMessage(__('Forbidden: you do not have the necessary role in order to do that.'));
  47854. return false;
  47855. }
  47856. return true;
  47857. },
  47858. verifyAffiliations(affiliations) {
  47859. const me = this.model.occupants.findWhere({
  47860. 'jid': _converse.bare_jid
  47861. });
  47862. if (!_.includes(affiliations, me.get('affiliation'))) {
  47863. this.showErrorMessage(__('Forbidden: you do not have the necessary affiliation in order to do that.'));
  47864. return false;
  47865. }
  47866. return true;
  47867. },
  47868. validateRoleChangeCommand(command, args) {
  47869. /* Check that a command to change a groupchat user's role or
  47870. * affiliation has anough arguments.
  47871. */
  47872. if (args.length < 1 || args.length > 2) {
  47873. this.showErrorMessage(__('Error: the "%1$s" command takes two arguments, the user\'s nickname and optionally a reason.', command));
  47874. return false;
  47875. }
  47876. if (!this.model.occupants.findWhere({
  47877. 'nick': args[0]
  47878. }) && !this.model.occupants.findWhere({
  47879. 'jid': args[0]
  47880. })) {
  47881. this.showErrorMessage(__('Error: couldn\'t find a groupchat participant "%1$s"', args[0]));
  47882. return false;
  47883. }
  47884. return true;
  47885. },
  47886. onCommandError(err) {
  47887. _converse.log(err, Strophe.LogLevel.FATAL);
  47888. this.showErrorMessage(__("Sorry, an error happened while running the command. Check your browser's developer console for details."));
  47889. },
  47890. parseMessageForCommands(text) {
  47891. if (_converse.muc_disable_moderator_commands) {
  47892. return _converse.ChatBoxView.prototype.parseMessageForCommands.apply(this, arguments);
  47893. }
  47894. const match = text.replace(/^\s*/, "").match(/^\/(.*?)(?: (.*))?$/) || [false, '', ''],
  47895. args = match[2] && match[2].splitOnce(' ').filter(s => s) || [],
  47896. command = match[1].toLowerCase();
  47897. switch (command) {
  47898. case 'admin':
  47899. if (!this.verifyAffiliations(['owner']) || !this.validateRoleChangeCommand(command, args)) {
  47900. break;
  47901. }
  47902. this.model.setAffiliation('admin', [{
  47903. 'jid': args[0],
  47904. 'reason': args[1]
  47905. }]).then(() => this.model.occupants.fetchMembers(), err => this.onCommandError(err));
  47906. break;
  47907. case 'ban':
  47908. if (!this.verifyAffiliations(['owner', 'admin']) || !this.validateRoleChangeCommand(command, args)) {
  47909. break;
  47910. }
  47911. this.model.setAffiliation('outcast', [{
  47912. 'jid': args[0],
  47913. 'reason': args[1]
  47914. }]).then(() => this.model.occupants.fetchMembers(), err => this.onCommandError(err));
  47915. break;
  47916. case 'deop':
  47917. if (!this.verifyAffiliations(['admin', 'owner']) || !this.validateRoleChangeCommand(command, args)) {
  47918. break;
  47919. }
  47920. this.modifyRole(this.model.get('jid'), args[0], 'participant', args[1], undefined, this.onCommandError.bind(this));
  47921. break;
  47922. case 'help':
  47923. this.showHelpMessages([`<strong>/admin</strong>: ${__("Change user's affiliation to admin")}`, `<strong>/ban</strong>: ${__('Ban user from groupchat')}`, `<strong>/clear</strong>: ${__('Remove messages')}`, `<strong>/deop</strong>: ${__('Change user role to participant')}`, `<strong>/help</strong>: ${__('Show this menu')}`, `<strong>/kick</strong>: ${__('Kick user from groupchat')}`, `<strong>/me</strong>: ${__('Write in 3rd person')}`, `<strong>/member</strong>: ${__('Grant membership to a user')}`, `<strong>/mute</strong>: ${__("Remove user's ability to post messages")}`, `<strong>/nick</strong>: ${__('Change your nickname')}`, `<strong>/op</strong>: ${__('Grant moderator role to user')}`, `<strong>/owner</strong>: ${__('Grant ownership of this groupchat')}`, `<strong>/register</strong>: ${__("Register a nickname for this groupchat")}`, `<strong>/revoke</strong>: ${__("Revoke user's membership")}`, `<strong>/subject</strong>: ${__('Set groupchat subject')}`, `<strong>/topic</strong>: ${__('Set groupchat subject (alias for /subject)')}`, `<strong>/voice</strong>: ${__('Allow muted user to post messages')}`]);
  47924. break;
  47925. case 'kick':
  47926. if (!this.verifyRoles(['moderator']) || !this.validateRoleChangeCommand(command, args)) {
  47927. break;
  47928. }
  47929. this.modifyRole(this.model.get('jid'), args[0], 'none', args[1], undefined, this.onCommandError.bind(this));
  47930. break;
  47931. case 'mute':
  47932. if (!this.verifyRoles(['moderator']) || !this.validateRoleChangeCommand(command, args)) {
  47933. break;
  47934. }
  47935. this.modifyRole(this.model.get('jid'), args[0], 'visitor', args[1], undefined, this.onCommandError.bind(this));
  47936. break;
  47937. case 'member':
  47938. {
  47939. if (!this.verifyAffiliations(['admin', 'owner']) || !this.validateRoleChangeCommand(command, args)) {
  47940. break;
  47941. }
  47942. const occupant = this.model.occupants.findWhere({
  47943. 'nick': args[0]
  47944. }) || this.model.occupants.findWhere({
  47945. 'jid': args[0]
  47946. }),
  47947. attrs = {
  47948. 'jid': occupant.get('jid'),
  47949. 'reason': args[1]
  47950. };
  47951. if (_converse.auto_register_muc_nickname) {
  47952. attrs['nick'] = occupant.get('nick');
  47953. }
  47954. this.model.setAffiliation('member', [attrs]).then(() => this.model.occupants.fetchMembers()).catch(err => this.onCommandError(err));
  47955. break;
  47956. }
  47957. case 'nick':
  47958. if (!this.verifyRoles(['visitor', 'participant', 'moderator'])) {
  47959. break;
  47960. }
  47961. _converse.api.send($pres({
  47962. from: _converse.connection.jid,
  47963. to: this.model.getRoomJIDAndNick(match[2]),
  47964. id: _converse.connection.getUniqueId()
  47965. }).tree());
  47966. break;
  47967. case 'owner':
  47968. if (!this.verifyAffiliations(['owner']) || !this.validateRoleChangeCommand(command, args)) {
  47969. break;
  47970. }
  47971. this.model.setAffiliation('owner', [{
  47972. 'jid': args[0],
  47973. 'reason': args[1]
  47974. }]).then(() => this.model.occupants.fetchMembers(), err => this.onCommandError(err));
  47975. break;
  47976. case 'op':
  47977. if (!this.verifyAffiliations(['admin', 'owner']) || !this.validateRoleChangeCommand(command, args)) {
  47978. break;
  47979. }
  47980. this.modifyRole(this.model.get('jid'), args[0], 'moderator', args[1], undefined, this.onCommandError.bind(this));
  47981. break;
  47982. case 'register':
  47983. if (args.length > 1) {
  47984. this.showErrorMessage(__('Error: invalid number of arguments'));
  47985. } else {
  47986. this.model.registerNickname().then(err_msg => {
  47987. if (err_msg) this.showErrorMessage(err_msg);
  47988. });
  47989. }
  47990. break;
  47991. case 'revoke':
  47992. if (!this.verifyAffiliations(['admin', 'owner']) || !this.validateRoleChangeCommand(command, args)) {
  47993. break;
  47994. }
  47995. this.model.setAffiliation('none', [{
  47996. 'jid': args[0],
  47997. 'reason': args[1]
  47998. }]).then(() => this.model.occupants.fetchMembers(), err => this.onCommandError(err));
  47999. break;
  48000. case 'topic':
  48001. case 'subject':
  48002. // TODO: should be done via API call to _converse.api.rooms
  48003. _converse.api.send($msg({
  48004. to: this.model.get('jid'),
  48005. from: _converse.connection.jid,
  48006. type: "groupchat"
  48007. }).c("subject", {
  48008. xmlns: "jabber:client"
  48009. }).t(match[2] || "").tree());
  48010. break;
  48011. case 'voice':
  48012. if (!this.verifyRoles(['moderator']) || !this.validateRoleChangeCommand(command, args)) {
  48013. break;
  48014. }
  48015. this.modifyRole(this.model.get('jid'), args[0], 'participant', args[1], undefined, this.onCommandError.bind(this));
  48016. break;
  48017. default:
  48018. return _converse.ChatBoxView.prototype.parseMessageForCommands.apply(this, arguments);
  48019. }
  48020. return true;
  48021. },
  48022. registerHandlers() {
  48023. /* Register presence and message handlers for this chat
  48024. * groupchat
  48025. */
  48026. // XXX: Ideally this can be refactored out so that we don't
  48027. // need to do stanza processing inside the views in this
  48028. // module. See the comment in "onPresence" for more info.
  48029. this.model.addHandler('presence', 'ChatRoomView.onPresence', this.onPresence.bind(this)); // XXX instead of having a method showStatusMessages, we could instead
  48030. // create message models in converse-muc.js and then give them views in this module.
  48031. this.model.addHandler('message', 'ChatRoomView.showStatusMessages', this.showStatusMessages.bind(this));
  48032. },
  48033. onPresence(pres) {
  48034. /* Handles all MUC presence stanzas.
  48035. *
  48036. * Parameters:
  48037. * (XMLElement) pres: The stanza
  48038. */
  48039. // XXX: Current thinking is that excessive stanza
  48040. // processing inside a view is a "code smell".
  48041. // Instead stanza processing should happen inside the
  48042. // models/collections.
  48043. if (pres.getAttribute('type') === 'error') {
  48044. this.showErrorMessageFromPresence(pres);
  48045. } else {
  48046. // Instead of doing it this way, we could perhaps rather
  48047. // create StatusMessage objects inside the messages
  48048. // Collection and then simply render those. Then stanza
  48049. // processing is done on the model and rendering in the
  48050. // view(s).
  48051. this.showStatusMessages(pres);
  48052. }
  48053. },
  48054. populateAndJoin() {
  48055. this.model.occupants.fetchMembers();
  48056. this.join();
  48057. this.fetchMessages();
  48058. },
  48059. join(nick, password) {
  48060. /* Join the groupchat.
  48061. *
  48062. * Parameters:
  48063. * (String) nick: The user's nickname
  48064. * (String) password: Optional password, if required by
  48065. * the groupchat.
  48066. */
  48067. if (!nick && !this.model.get('nick')) {
  48068. this.checkForReservedNick();
  48069. return this;
  48070. }
  48071. this.model.join(nick, password);
  48072. return this;
  48073. },
  48074. renderConfigurationForm(stanza) {
  48075. /* Renders a form given an IQ stanza containing the current
  48076. * groupchat configuration.
  48077. *
  48078. * Returns a promise which resolves once the user has
  48079. * either submitted the form, or canceled it.
  48080. *
  48081. * Parameters:
  48082. * (XMLElement) stanza: The IQ stanza containing the groupchat
  48083. * config.
  48084. */
  48085. const container_el = this.el.querySelector('.chatroom-body');
  48086. _.each(container_el.querySelectorAll('.chatroom-form-container'), u.removeElement);
  48087. _.each(container_el.children, u.hideElement);
  48088. container_el.insertAdjacentHTML('beforeend', templates_chatroom_form_html__WEBPACK_IMPORTED_MODULE_12___default()());
  48089. const form_el = container_el.querySelector('form.chatroom-form'),
  48090. fieldset_el = form_el.querySelector('fieldset'),
  48091. fields = stanza.querySelectorAll('field'),
  48092. title = _.get(stanza.querySelector('title'), 'textContent'),
  48093. instructions = _.get(stanza.querySelector('instructions'), 'textContent');
  48094. u.removeElement(fieldset_el.querySelector('span.spinner'));
  48095. fieldset_el.insertAdjacentHTML('beforeend', `<legend>${title}</legend>`);
  48096. if (instructions && instructions !== title) {
  48097. fieldset_el.insertAdjacentHTML('beforeend', `<p class="form-help">${instructions}</p>`);
  48098. }
  48099. _.each(fields, field => fieldset_el.insertAdjacentHTML('beforeend', u.xForm2webForm(field, stanza))); // Render save/cancel buttons
  48100. const last_fieldset_el = document.createElement('fieldset');
  48101. last_fieldset_el.insertAdjacentHTML('beforeend', `<input type="submit" class="btn btn-primary" value="${__('Save')}"/>`);
  48102. last_fieldset_el.insertAdjacentHTML('beforeend', `<input type="button" class="btn btn-secondary" value="${__('Cancel')}"/>`);
  48103. form_el.insertAdjacentElement('beforeend', last_fieldset_el);
  48104. last_fieldset_el.querySelector('input[type=button]').addEventListener('click', ev => {
  48105. ev.preventDefault();
  48106. this.closeForm();
  48107. });
  48108. form_el.addEventListener('submit', ev => {
  48109. ev.preventDefault();
  48110. this.model.saveConfiguration(ev.target).then(() => this.model.refreshRoomFeatures());
  48111. this.closeForm();
  48112. }, false);
  48113. },
  48114. closeForm() {
  48115. /* Remove the configuration form without submitting and
  48116. * return to the chat view.
  48117. */
  48118. u.removeElement(this.el.querySelector('.chatroom-form-container'));
  48119. this.renderAfterTransition();
  48120. },
  48121. getAndRenderConfigurationForm(ev) {
  48122. /* Start the process of configuring a groupchat, either by
  48123. * rendering a configuration form, or by auto-configuring
  48124. * based on the "roomconfig" data stored on the
  48125. * Backbone.Model.
  48126. *
  48127. * Stores the new configuration on the Backbone.Model once
  48128. * completed.
  48129. *
  48130. * Paremeters:
  48131. * (Event) ev: DOM event that might be passed in if this
  48132. * method is called due to a user action. In this
  48133. * case, auto-configure won't happen, regardless of
  48134. * the settings.
  48135. */
  48136. this.showSpinner();
  48137. this.model.fetchRoomConfiguration().then(iq => this.renderConfigurationForm(iq)).catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
  48138. },
  48139. submitNickname(ev) {
  48140. /* Get the nickname value from the form and then join the
  48141. * groupchat with it.
  48142. */
  48143. ev.preventDefault();
  48144. const nick_el = ev.target.nick;
  48145. const nick = nick_el.value;
  48146. if (!nick) {
  48147. nick_el.classList.add('error');
  48148. return;
  48149. } else {
  48150. nick_el.classList.remove('error');
  48151. }
  48152. this.el.querySelector('.chatroom-form-container').outerHTML = templates_spinner_html__WEBPACK_IMPORTED_MODULE_25___default()();
  48153. this.join(nick);
  48154. },
  48155. checkForReservedNick() {
  48156. /* User service-discovery to ask the XMPP server whether
  48157. * this user has a reserved nickname for this groupchat.
  48158. * If so, we'll use that, otherwise we render the nickname form.
  48159. */
  48160. this.showSpinner();
  48161. this.model.checkForReservedNick().then(this.onReservedNickFound.bind(this)).catch(this.onReservedNickNotFound.bind(this));
  48162. },
  48163. onReservedNickFound(iq) {
  48164. if (this.model.get('nick')) {
  48165. this.join();
  48166. } else {
  48167. this.onReservedNickNotFound();
  48168. }
  48169. },
  48170. onReservedNickNotFound(message) {
  48171. const nick = this.model.getDefaultNick();
  48172. if (nick) {
  48173. this.join(nick);
  48174. } else {
  48175. this.renderNicknameForm(message);
  48176. }
  48177. },
  48178. onNicknameClash(presence) {
  48179. /* When the nickname is already taken, we either render a
  48180. * form for the user to choose a new nickname, or we
  48181. * try to make the nickname unique by adding an integer to
  48182. * it. So john will become john-2, and then john-3 and so on.
  48183. *
  48184. * Which option is take depends on the value of
  48185. * muc_nickname_from_jid.
  48186. */
  48187. if (_converse.muc_nickname_from_jid) {
  48188. const nick = presence.getAttribute('from').split('/')[1];
  48189. if (nick === this.model.getDefaultNick()) {
  48190. this.join(nick + '-2');
  48191. } else {
  48192. const del = nick.lastIndexOf("-");
  48193. const num = nick.substring(del + 1, nick.length);
  48194. this.join(nick.substring(0, del + 1) + String(Number(num) + 1));
  48195. }
  48196. } else {
  48197. this.renderNicknameForm(__("The nickname you chose is reserved or " + "currently in use, please choose a different one."));
  48198. }
  48199. },
  48200. hideChatRoomContents() {
  48201. const container_el = this.el.querySelector('.chatroom-body');
  48202. if (!_.isNull(container_el)) {
  48203. _.each(container_el.children, child => {
  48204. child.classList.add('hidden');
  48205. });
  48206. }
  48207. },
  48208. renderNicknameForm(message) {
  48209. /* Render a form which allows the user to choose their
  48210. * nickname.
  48211. */
  48212. this.hideChatRoomContents();
  48213. _.each(this.el.querySelectorAll('span.centered.spinner'), u.removeElement);
  48214. if (!_.isString(message)) {
  48215. message = '';
  48216. }
  48217. const container_el = this.el.querySelector('.chatroom-body');
  48218. container_el.insertAdjacentHTML('beforeend', templates_chatroom_nickname_form_html__WEBPACK_IMPORTED_MODULE_15___default()({
  48219. heading: __('Please choose your nickname'),
  48220. label_nickname: __('Nickname'),
  48221. label_join: __('Enter groupchat'),
  48222. validation_message: message
  48223. }));
  48224. this.model.save('connection_status', _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.NICKNAME_REQUIRED);
  48225. const form_el = this.el.querySelector('.chatroom-form');
  48226. form_el.addEventListener('submit', this.submitNickname.bind(this), false);
  48227. },
  48228. submitPassword(ev) {
  48229. ev.preventDefault();
  48230. const password = this.el.querySelector('.chatroom-form input[type=password]').value;
  48231. this.showSpinner();
  48232. this.join(this.model.get('nick'), password);
  48233. },
  48234. renderPasswordForm() {
  48235. const container_el = this.el.querySelector('.chatroom-body');
  48236. _.each(container_el.children, u.hideElement);
  48237. _.each(this.el.querySelectorAll('.spinner'), u.removeElement);
  48238. _.each(this.el.querySelectorAll('.chatroom-form-container'), u.removeElement);
  48239. container_el.insertAdjacentHTML('beforeend', templates_chatroom_password_form_html__WEBPACK_IMPORTED_MODULE_16___default()({
  48240. 'heading': __('This groupchat requires a password'),
  48241. 'label_password': __('Password: '),
  48242. 'label_submit': __('Submit')
  48243. }));
  48244. this.model.save('connection_status', _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.PASSWORD_REQUIRED);
  48245. this.el.querySelector('.chatroom-form').addEventListener('submit', ev => this.submitPassword(ev), false);
  48246. },
  48247. showDestroyedMessage(error) {
  48248. u.hideElement(this.el.querySelector('.chat-area'));
  48249. u.hideElement(this.el.querySelector('.occupants'));
  48250. _.each(this.el.querySelectorAll('.spinner'), u.removeElement);
  48251. const container = this.el.querySelector('.disconnect-container');
  48252. const moved_jid = _.get(sizzle('gone[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]', error).pop(), 'textContent').replace(/^xmpp:/, '').replace(/\?join$/, '');
  48253. const reason = _.get(sizzle('text[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]', error).pop(), 'textContent');
  48254. container.innerHTML = templates_chatroom_destroyed_html__WEBPACK_IMPORTED_MODULE_8___default()({
  48255. '_': _,
  48256. '__': __,
  48257. 'jid': moved_jid,
  48258. 'reason': reason ? `"${reason}"` : null
  48259. });
  48260. const switch_el = container.querySelector('a.switch-chat');
  48261. if (switch_el) {
  48262. switch_el.addEventListener('click', ev => {
  48263. ev.preventDefault();
  48264. this.model.save('jid', moved_jid);
  48265. container.innerHTML = '';
  48266. this.showSpinner();
  48267. this.enterRoom();
  48268. });
  48269. }
  48270. u.showElement(container);
  48271. },
  48272. showDisconnectMessages(msgs) {
  48273. if (_.isString(msgs)) {
  48274. msgs = [msgs];
  48275. }
  48276. u.hideElement(this.el.querySelector('.chat-area'));
  48277. u.hideElement(this.el.querySelector('.occupants'));
  48278. _.each(this.el.querySelectorAll('.spinner'), u.removeElement);
  48279. const container = this.el.querySelector('.disconnect-container');
  48280. container.innerHTML = templates_chatroom_disconnect_html__WEBPACK_IMPORTED_MODULE_10___default()({
  48281. '_': _,
  48282. 'disconnect_messages': msgs
  48283. });
  48284. u.showElement(container);
  48285. },
  48286. getMessageFromStatus(stat, stanza, is_self) {
  48287. /* Parameters:
  48288. * (XMLElement) stat: A <status> element.
  48289. * (Boolean) is_self: Whether the element refers to the
  48290. * current user.
  48291. * (XMLElement) stanza: The original stanza received.
  48292. */
  48293. const code = stat.getAttribute('code');
  48294. if (code === '110' || code === '100' && !is_self) {
  48295. return;
  48296. }
  48297. if (code in _converse.muc.info_messages) {
  48298. return _converse.muc.info_messages[code];
  48299. }
  48300. let nick;
  48301. if (!is_self) {
  48302. if (code in _converse.muc.action_info_messages) {
  48303. nick = Strophe.getResourceFromJid(stanza.getAttribute('from'));
  48304. return __(_converse.muc.action_info_messages[code], nick);
  48305. }
  48306. } else if (code in _converse.muc.new_nickname_messages) {
  48307. if (is_self && code === "210") {
  48308. nick = Strophe.getResourceFromJid(stanza.getAttribute('from'));
  48309. } else if (is_self && code === "303") {
  48310. nick = stanza.querySelector('x item').getAttribute('nick');
  48311. }
  48312. return __(_converse.muc.new_nickname_messages[code], nick);
  48313. }
  48314. return;
  48315. },
  48316. getNotificationWithMessage(message) {
  48317. let el = this.content.lastElementChild;
  48318. while (!_.isNil(el)) {
  48319. const data = _.get(el, 'dataset', {});
  48320. if (!_.includes(_.get(el, 'classList', []), 'chat-info')) {
  48321. return;
  48322. }
  48323. if (el.textContent === message) {
  48324. return el;
  48325. }
  48326. el = el.previousElementSibling;
  48327. }
  48328. },
  48329. parseXUserElement(x, stanza, is_self) {
  48330. /* Parse the passed-in <x xmlns='http://jabber.org/protocol/muc#user'>
  48331. * element and construct a map containing relevant
  48332. * information.
  48333. */
  48334. // 1. Get notification messages based on the <status> elements.
  48335. const statuses = x.querySelectorAll('status');
  48336. const mapper = _.partial(this.getMessageFromStatus, _, stanza, is_self);
  48337. const notification = {};
  48338. const messages = _.reject(_.reject(_.map(statuses, mapper), _.isUndefined), message => this.getNotificationWithMessage(message));
  48339. if (messages.length) {
  48340. notification.messages = messages;
  48341. } // 2. Get disconnection messages based on the <status> elements
  48342. const codes = _.invokeMap(statuses, Element.prototype.getAttribute, 'code');
  48343. const disconnection_codes = _.intersection(codes, _.keys(_converse.muc.disconnect_messages));
  48344. const disconnected = is_self && disconnection_codes.length > 0;
  48345. if (disconnected) {
  48346. notification.disconnected = true;
  48347. notification.disconnection_message = _converse.muc.disconnect_messages[disconnection_codes[0]];
  48348. } // 3. Find the reason and actor from the <item> element
  48349. const item = x.querySelector('item'); // By using querySelector above, we assume here there is
  48350. // one <item> per <x xmlns='http://jabber.org/protocol/muc#user'>
  48351. // element. This appears to be a safe assumption, since
  48352. // each <x/> element pertains to a single user.
  48353. if (!_.isNull(item)) {
  48354. const reason = item.querySelector('reason');
  48355. if (reason) {
  48356. notification.reason = reason ? reason.textContent : undefined;
  48357. }
  48358. const actor = item.querySelector('actor');
  48359. if (actor) {
  48360. notification.actor = actor ? actor.getAttribute('nick') : undefined;
  48361. }
  48362. }
  48363. return notification;
  48364. },
  48365. showNotificationsforUser(notification) {
  48366. /* Given the notification object generated by
  48367. * parseXUserElement, display any relevant messages and
  48368. * information to the user.
  48369. */
  48370. if (notification.disconnected) {
  48371. const messages = [];
  48372. messages.push(notification.disconnection_message);
  48373. if (notification.actor) {
  48374. messages.push(__('This action was done by %1$s.', notification.actor));
  48375. }
  48376. if (notification.reason) {
  48377. messages.push(__('The reason given is: "%1$s".', notification.reason));
  48378. }
  48379. this.showDisconnectMessages(messages);
  48380. this.model.save('connection_status', _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.DISCONNECTED);
  48381. return;
  48382. }
  48383. _.each(notification.messages, message => {
  48384. this.content.insertAdjacentHTML('beforeend', templates_info_html__WEBPACK_IMPORTED_MODULE_18___default()({
  48385. 'isodate': moment().format(),
  48386. 'extra_classes': 'chat-event',
  48387. 'message': message
  48388. }));
  48389. });
  48390. if (notification.reason) {
  48391. this.showChatEvent(__('The reason given is: "%1$s".', notification.reason));
  48392. }
  48393. if (_.get(notification.messages, 'length')) {
  48394. this.scrollDown();
  48395. }
  48396. },
  48397. onOccupantAdded(occupant) {
  48398. if (occupant.get('show') === 'online') {
  48399. this.showJoinNotification(occupant);
  48400. }
  48401. },
  48402. onOccupantRemoved(occupant) {
  48403. if (occupant.get('show') === 'online') {
  48404. this.showLeaveNotification(occupant);
  48405. }
  48406. },
  48407. showJoinOrLeaveNotification(occupant) {
  48408. if (_.includes(occupant.get('states'), '303')) {
  48409. return;
  48410. }
  48411. if (occupant.get('show') === 'offline') {
  48412. this.showLeaveNotification(occupant);
  48413. } else if (occupant.get('show') === 'online') {
  48414. this.showJoinNotification(occupant);
  48415. }
  48416. },
  48417. getPreviousJoinOrLeaveNotification(el, nick) {
  48418. /* Working backwards, get the first join/leave notification
  48419. * from the same user, on the same day and BEFORE any chat
  48420. * messages were received.
  48421. */
  48422. while (!_.isNil(el)) {
  48423. const data = _.get(el, 'dataset', {});
  48424. if (!_.includes(_.get(el, 'classList', []), 'chat-info')) {
  48425. return;
  48426. }
  48427. if (!moment(el.getAttribute('data-isodate')).isSame(new Date(), "day")) {
  48428. el = el.previousElementSibling;
  48429. continue;
  48430. }
  48431. if (data.join === nick || data.leave === nick || data.leavejoin === nick || data.joinleave === nick) {
  48432. return el;
  48433. }
  48434. el = el.previousElementSibling;
  48435. }
  48436. },
  48437. showJoinNotification(occupant) {
  48438. if (this.model.get('connection_status') !== _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.ENTERED) {
  48439. return;
  48440. }
  48441. const nick = occupant.get('nick'),
  48442. stat = occupant.get('status'),
  48443. prev_info_el = this.getPreviousJoinOrLeaveNotification(this.content.lastElementChild, nick),
  48444. data = _.get(prev_info_el, 'dataset', {});
  48445. if (data.leave === nick) {
  48446. let message;
  48447. if (_.isNil(stat)) {
  48448. message = __('%1$s has left and re-entered the groupchat', nick);
  48449. } else {
  48450. message = __('%1$s has left and re-entered the groupchat. "%2$s"', nick, stat);
  48451. }
  48452. const data = {
  48453. 'data_name': 'leavejoin',
  48454. 'data_value': nick,
  48455. 'isodate': moment().format(),
  48456. 'extra_classes': 'chat-event',
  48457. 'message': message
  48458. };
  48459. this.content.removeChild(prev_info_el);
  48460. this.content.insertAdjacentHTML('beforeend', templates_info_html__WEBPACK_IMPORTED_MODULE_18___default()(data));
  48461. const el = this.content.lastElementChild;
  48462. setTimeout(() => u.addClass('fade-out', el), 5000);
  48463. setTimeout(() => el.parentElement && el.parentElement.removeChild(el), 5500);
  48464. } else {
  48465. let message;
  48466. if (_.isNil(stat)) {
  48467. message = __('%1$s has entered the groupchat', nick);
  48468. } else {
  48469. message = __('%1$s has entered the groupchat. "%2$s"', nick, stat);
  48470. }
  48471. const data = {
  48472. 'data_name': 'join',
  48473. 'data_value': nick,
  48474. 'isodate': moment().format(),
  48475. 'extra_classes': 'chat-event',
  48476. 'message': message
  48477. };
  48478. if (prev_info_el) {
  48479. this.content.removeChild(prev_info_el);
  48480. this.content.insertAdjacentHTML('beforeend', templates_info_html__WEBPACK_IMPORTED_MODULE_18___default()(data));
  48481. } else {
  48482. this.content.insertAdjacentHTML('beforeend', templates_info_html__WEBPACK_IMPORTED_MODULE_18___default()(data));
  48483. this.insertDayIndicator(this.content.lastElementChild);
  48484. }
  48485. }
  48486. this.scrollDown();
  48487. },
  48488. showLeaveNotification(occupant) {
  48489. if (_.includes(occupant.get('states'), '303') || _.includes(occupant.get('states'), '307')) {
  48490. return;
  48491. }
  48492. const nick = occupant.get('nick'),
  48493. stat = occupant.get('status'),
  48494. prev_info_el = this.getPreviousJoinOrLeaveNotification(this.content.lastElementChild, nick),
  48495. dataset = _.get(prev_info_el, 'dataset', {});
  48496. if (dataset.join === nick) {
  48497. let message;
  48498. if (_.isNil(stat)) {
  48499. message = __('%1$s has entered and left the groupchat', nick);
  48500. } else {
  48501. message = __('%1$s has entered and left the groupchat. "%2$s"', nick, stat);
  48502. }
  48503. const data = {
  48504. 'data_name': 'joinleave',
  48505. 'data_value': nick,
  48506. 'isodate': moment().format(),
  48507. 'extra_classes': 'chat-event',
  48508. 'message': message
  48509. };
  48510. this.content.removeChild(prev_info_el);
  48511. this.content.insertAdjacentHTML('beforeend', templates_info_html__WEBPACK_IMPORTED_MODULE_18___default()(data));
  48512. const el = this.content.lastElementChild;
  48513. setTimeout(() => u.addClass('fade-out', el), 5000);
  48514. setTimeout(() => el.parentElement && el.parentElement.removeChild(el), 5500);
  48515. } else {
  48516. let message;
  48517. if (_.isNil(stat)) {
  48518. message = __('%1$s has left the groupchat', nick);
  48519. } else {
  48520. message = __('%1$s has left the groupchat. "%2$s"', nick, stat);
  48521. }
  48522. const data = {
  48523. 'message': message,
  48524. 'isodate': moment().format(),
  48525. 'extra_classes': 'chat-event',
  48526. 'data_name': 'leave',
  48527. 'data_value': nick
  48528. };
  48529. if (prev_info_el) {
  48530. this.content.removeChild(prev_info_el);
  48531. this.content.insertAdjacentHTML('beforeend', templates_info_html__WEBPACK_IMPORTED_MODULE_18___default()(data));
  48532. } else {
  48533. this.content.insertAdjacentHTML('beforeend', templates_info_html__WEBPACK_IMPORTED_MODULE_18___default()(data));
  48534. this.insertDayIndicator(this.content.lastElementChild);
  48535. }
  48536. }
  48537. this.scrollDown();
  48538. },
  48539. showStatusMessages(stanza) {
  48540. /* Check for status codes and communicate their purpose to the user.
  48541. * See: http://xmpp.org/registrar/mucstatus.html
  48542. *
  48543. * Parameters:
  48544. * (XMLElement) stanza: The message or presence stanza
  48545. * containing the status codes.
  48546. */
  48547. const elements = sizzle(`x[xmlns="${Strophe.NS.MUC_USER}"]`, stanza);
  48548. const is_self = stanza.querySelectorAll("status[code='110']").length;
  48549. const iteratee = _.partial(this.parseXUserElement.bind(this), _, stanza, is_self);
  48550. const notifications = _.reject(_.map(elements, iteratee), _.isEmpty);
  48551. _.each(notifications, this.showNotificationsforUser.bind(this));
  48552. },
  48553. showErrorMessageFromPresence(presence) {
  48554. // We didn't enter the groupchat, so we must remove it from the MUC add-on
  48555. const error = presence.querySelector('error');
  48556. if (error.getAttribute('type') === 'auth') {
  48557. if (!_.isNull(error.querySelector('not-authorized'))) {
  48558. this.renderPasswordForm();
  48559. } else if (!_.isNull(error.querySelector('registration-required'))) {
  48560. this.showDisconnectMessages(__('You are not on the member list of this groupchat.'));
  48561. } else if (!_.isNull(error.querySelector('forbidden'))) {
  48562. this.showDisconnectMessages(__('You have been banned from this groupchat.'));
  48563. }
  48564. } else if (error.getAttribute('type') === 'modify') {
  48565. if (!_.isNull(error.querySelector('jid-malformed'))) {
  48566. this.showDisconnectMessages(__('No nickname was specified.'));
  48567. }
  48568. } else if (error.getAttribute('type') === 'cancel') {
  48569. if (!_.isNull(error.querySelector('not-allowed'))) {
  48570. this.showDisconnectMessages(__('You are not allowed to create new groupchats.'));
  48571. } else if (!_.isNull(error.querySelector('not-acceptable'))) {
  48572. this.showDisconnectMessages(__("Your nickname doesn't conform to this groupchat's policies."));
  48573. } else if (sizzle('gone[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]', error).length) {
  48574. this.showDestroyedMessage(error);
  48575. } else if (!_.isNull(error.querySelector('conflict'))) {
  48576. this.onNicknameClash(presence);
  48577. } else if (!_.isNull(error.querySelector('item-not-found'))) {
  48578. this.showDisconnectMessages(__("This groupchat does not (yet) exist."));
  48579. } else if (!_.isNull(error.querySelector('service-unavailable'))) {
  48580. this.showDisconnectMessages(__("This groupchat has reached its maximum number of participants."));
  48581. } else if (!_.isNull(error.querySelector('remote-server-not-found'))) {
  48582. const messages = [__("Remote server not found")];
  48583. const reason = _.get(error.querySelector('text'), 'textContent');
  48584. if (reason) {
  48585. messages.push(__('The explanation given is: "%1$s".', reason));
  48586. }
  48587. this.showDisconnectMessages(messages);
  48588. }
  48589. }
  48590. },
  48591. renderAfterTransition() {
  48592. /* Rerender the groupchat after some kind of transition. For
  48593. * example after the spinner has been removed or after a
  48594. * form has been submitted and removed.
  48595. */
  48596. if (this.model.get('connection_status') == _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.NICKNAME_REQUIRED) {
  48597. this.renderNicknameForm();
  48598. } else if (this.model.get('connection_status') == _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.PASSWORD_REQUIRED) {
  48599. this.renderPasswordForm();
  48600. } else {
  48601. this.el.querySelector('.chat-area').classList.remove('hidden');
  48602. this.setOccupantsVisibility();
  48603. this.scrollDown();
  48604. }
  48605. },
  48606. showSpinner() {
  48607. u.removeElement(this.el.querySelector('.spinner'));
  48608. const container_el = this.el.querySelector('.chatroom-body');
  48609. const children = Array.prototype.slice.call(container_el.children, 0);
  48610. container_el.insertAdjacentHTML('afterbegin', templates_spinner_html__WEBPACK_IMPORTED_MODULE_25___default()());
  48611. _.each(children, u.hideElement);
  48612. },
  48613. hideSpinner() {
  48614. /* Check if the spinner is being shown and if so, hide it.
  48615. * Also make sure then that the chat area and occupants
  48616. * list are both visible.
  48617. */
  48618. const spinner = this.el.querySelector('.spinner');
  48619. if (!_.isNull(spinner)) {
  48620. u.removeElement(spinner);
  48621. this.renderAfterTransition();
  48622. }
  48623. return this;
  48624. },
  48625. setChatRoomSubject() {
  48626. // For translators: the %1$s and %2$s parts will get
  48627. // replaced by the user and topic text respectively
  48628. // Example: Topic set by JC Brand to: Hello World!
  48629. const subject = this.model.get('subject'),
  48630. message = subject.text ? __('Topic set by %1$s', subject.author) : __('Topic cleared by %1$s', subject.author),
  48631. date = moment().format();
  48632. this.content.insertAdjacentHTML('beforeend', templates_info_html__WEBPACK_IMPORTED_MODULE_18___default()({
  48633. 'isodate': date,
  48634. 'extra_classes': 'chat-event',
  48635. 'message': message
  48636. }));
  48637. if (subject.text) {
  48638. this.content.insertAdjacentHTML('beforeend', templates_info_html__WEBPACK_IMPORTED_MODULE_18___default()({
  48639. 'isodate': date,
  48640. 'extra_classes': 'chat-topic',
  48641. 'message': u.addHyperlinks(xss__WEBPACK_IMPORTED_MODULE_26___default.a.filterXSS(_.get(this.model.get('subject'), 'text'), {
  48642. 'whiteList': {}
  48643. })),
  48644. 'render_message': true
  48645. }));
  48646. }
  48647. this.scrollDown();
  48648. }
  48649. });
  48650. _converse.RoomsPanel = Backbone.NativeView.extend({
  48651. /* Backbone.NativeView which renders MUC section of the control box.
  48652. */
  48653. tagName: 'div',
  48654. className: 'controlbox-section',
  48655. id: 'chatrooms',
  48656. events: {
  48657. 'click a.controlbox-heading__btn.show-add-muc-modal': 'showAddRoomModal',
  48658. 'click a.controlbox-heading__btn.show-list-muc-modal': 'showListRoomsModal'
  48659. },
  48660. render() {
  48661. this.el.innerHTML = templates_room_panel_html__WEBPACK_IMPORTED_MODULE_23___default()({
  48662. 'heading_chatrooms': __('Groupchats'),
  48663. 'title_new_room': __('Add a new groupchat'),
  48664. 'title_list_rooms': __('Query for groupchats')
  48665. });
  48666. return this;
  48667. },
  48668. showAddRoomModal(ev) {
  48669. if (_.isUndefined(this.add_room_modal)) {
  48670. this.add_room_modal = new _converse.AddChatRoomModal({
  48671. 'model': this.model
  48672. });
  48673. }
  48674. this.add_room_modal.show(ev);
  48675. },
  48676. showListRoomsModal(ev) {
  48677. if (_.isUndefined(this.list_rooms_modal)) {
  48678. this.list_rooms_modal = new _converse.ListChatRoomsModal({
  48679. 'model': this.model
  48680. });
  48681. }
  48682. this.list_rooms_modal.show(ev);
  48683. }
  48684. });
  48685. _converse.ChatRoomOccupantView = Backbone.VDOMView.extend({
  48686. tagName: 'li',
  48687. initialize() {
  48688. this.model.on('change', this.render, this);
  48689. },
  48690. toHTML() {
  48691. const show = this.model.get('show');
  48692. return templates_occupant_html__WEBPACK_IMPORTED_MODULE_20___default()(_.extend({
  48693. '_': _,
  48694. // XXX Normally this should already be included,
  48695. // but with the current webpack build,
  48696. // we only get a subset of the _ methods.
  48697. 'jid': '',
  48698. 'show': show,
  48699. 'hint_show': _converse.PRETTY_CHAT_STATUS[show],
  48700. 'hint_occupant': __('Click to mention %1$s in your message.', this.model.get('nick')),
  48701. 'desc_moderator': __('This user is a moderator.'),
  48702. 'desc_participant': __('This user can send messages in this groupchat.'),
  48703. 'desc_visitor': __('This user can NOT send messages in this groupchat.'),
  48704. 'label_moderator': __('Moderator'),
  48705. 'label_visitor': __('Visitor'),
  48706. 'label_owner': __('Owner'),
  48707. 'label_member': __('Member'),
  48708. 'label_admin': __('Admin')
  48709. }, this.model.toJSON()));
  48710. },
  48711. destroy() {
  48712. this.el.parentElement.removeChild(this.el);
  48713. }
  48714. });
  48715. _converse.ChatRoomOccupantsView = Backbone.OrderedListView.extend({
  48716. tagName: 'div',
  48717. className: 'occupants col-md-3 col-4',
  48718. listItems: 'model',
  48719. sortEvent: 'change:role',
  48720. listSelector: '.occupant-list',
  48721. ItemView: _converse.ChatRoomOccupantView,
  48722. initialize() {
  48723. Backbone.OrderedListView.prototype.initialize.apply(this, arguments);
  48724. this.chatroomview = this.model.chatroomview;
  48725. this.chatroomview.model.on('change:open', this.renderInviteWidget, this);
  48726. this.chatroomview.model.on('change:affiliation', this.renderInviteWidget, this);
  48727. this.chatroomview.model.on('change', () => {
  48728. if (_.intersection(_converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOM_FEATURES, Object.keys(this.chatroomview.model.changed)).length === 0) {
  48729. return;
  48730. }
  48731. this.renderRoomFeatures();
  48732. }, this);
  48733. this.render();
  48734. this.model.fetch({
  48735. 'add': true,
  48736. 'silent': true,
  48737. 'success': this.sortAndPositionAllItems.bind(this)
  48738. });
  48739. },
  48740. render() {
  48741. this.el.innerHTML = templates_chatroom_sidebar_html__WEBPACK_IMPORTED_MODULE_17___default()(_.extend(this.chatroomview.model.toJSON(), {
  48742. 'allow_muc_invitations': _converse.allow_muc_invitations,
  48743. 'label_occupants': __('Participants')
  48744. }));
  48745. if (_converse.allow_muc_invitations) {
  48746. _converse.api.waitUntil('rosterContactsFetched').then(this.renderInviteWidget.bind(this));
  48747. }
  48748. return this.renderRoomFeatures();
  48749. },
  48750. renderInviteWidget() {
  48751. const form = this.el.querySelector('form.room-invite');
  48752. if (this.shouldInviteWidgetBeShown()) {
  48753. if (_.isNull(form)) {
  48754. const heading = this.el.querySelector('.occupants-heading');
  48755. heading.insertAdjacentHTML('afterend', templates_chatroom_invite_html__WEBPACK_IMPORTED_MODULE_14___default()({
  48756. 'error_message': null,
  48757. 'label_invitation': __('Invite')
  48758. }));
  48759. this.initInviteWidget();
  48760. }
  48761. } else if (!_.isNull(form)) {
  48762. form.remove();
  48763. }
  48764. return this;
  48765. },
  48766. renderRoomFeatures() {
  48767. const picks = _.pick(this.chatroomview.model.attributes, _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOM_FEATURES),
  48768. iteratee = (a, v) => a || v,
  48769. el = this.el.querySelector('.chatroom-features');
  48770. el.innerHTML = templates_chatroom_features_html__WEBPACK_IMPORTED_MODULE_11___default()(_.extend(this.chatroomview.model.toJSON(), {
  48771. '__': __,
  48772. 'has_features': _.reduce(_.values(picks), iteratee)
  48773. }));
  48774. this.setOccupantsHeight();
  48775. return this;
  48776. },
  48777. setOccupantsHeight() {
  48778. const el = this.el.querySelector('.chatroom-features');
  48779. this.el.querySelector('.occupant-list').style.cssText = `height: calc(100% - ${el.offsetHeight}px - 5em);`;
  48780. },
  48781. promptForInvite(suggestion) {
  48782. const reason = prompt(__('You are about to invite %1$s to the groupchat "%2$s". ' + 'You may optionally include a message, explaining the reason for the invitation.', suggestion.text.label, this.model.get('id')));
  48783. if (reason !== null) {
  48784. this.chatroomview.model.directInvite(suggestion.text.value, reason);
  48785. }
  48786. const form = suggestion.target.form,
  48787. error = form.querySelector('.pure-form-message.error');
  48788. if (!_.isNull(error)) {
  48789. error.parentNode.removeChild(error);
  48790. }
  48791. suggestion.target.value = '';
  48792. },
  48793. inviteFormSubmitted(evt) {
  48794. evt.preventDefault();
  48795. const el = evt.target.querySelector('input.invited-contact'),
  48796. jid = el.value;
  48797. if (!jid || _.compact(jid.split('@')).length < 2) {
  48798. evt.target.outerHTML = templates_chatroom_invite_html__WEBPACK_IMPORTED_MODULE_14___default()({
  48799. 'error_message': __('Please enter a valid XMPP username'),
  48800. 'label_invitation': __('Invite')
  48801. });
  48802. this.initInviteWidget();
  48803. return;
  48804. }
  48805. this.promptForInvite({
  48806. 'target': el,
  48807. 'text': {
  48808. 'label': jid,
  48809. 'value': jid
  48810. }
  48811. });
  48812. },
  48813. shouldInviteWidgetBeShown() {
  48814. return _converse.allow_muc_invitations && (this.chatroomview.model.get('open') || this.chatroomview.model.get('affiliation') === "owner");
  48815. },
  48816. initInviteWidget() {
  48817. const form = this.el.querySelector('form.room-invite');
  48818. if (_.isNull(form)) {
  48819. return;
  48820. }
  48821. form.addEventListener('submit', this.inviteFormSubmitted.bind(this), false);
  48822. const el = this.el.querySelector('input.invited-contact');
  48823. const list = _converse.roster.map(function (item) {
  48824. const label = item.get('fullname') || item.get('jid');
  48825. return {
  48826. 'label': label,
  48827. 'value': item.get('jid')
  48828. };
  48829. });
  48830. const awesomplete = new awesomplete__WEBPACK_IMPORTED_MODULE_1___default.a(el, {
  48831. 'minChars': 1,
  48832. 'list': list
  48833. });
  48834. el.addEventListener('awesomplete-selectcomplete', this.promptForInvite.bind(this));
  48835. }
  48836. });
  48837. function setMUCDomain(domain, controlboxview) {
  48838. _converse.muc_domain = domain;
  48839. controlboxview.roomspanel.model.save('muc_domain', Strophe.getDomainFromJid(domain));
  48840. }
  48841. function setMUCDomainFromDisco(controlboxview) {
  48842. /* Check whether service discovery for the user's domain
  48843. * returned MUC information and use that to automatically
  48844. * set the MUC domain in the "Add groupchat" modal.
  48845. */
  48846. function featureAdded(feature) {
  48847. if (!feature) {
  48848. return;
  48849. }
  48850. if (feature.get('var') === Strophe.NS.MUC) {
  48851. feature.entity.getIdentity('conference', 'text').then(identity => {
  48852. if (identity) {
  48853. setMUCDomain(feature.get('from'), controlboxview);
  48854. }
  48855. });
  48856. }
  48857. }
  48858. _converse.api.waitUntil('discoInitialized').then(() => {
  48859. _converse.api.listen.on('serviceDiscovered', featureAdded); // Features could have been added before the controlbox was
  48860. // initialized. We're only interested in MUC
  48861. _converse.disco_entities.each(entity => featureAdded(entity.features.findWhere({
  48862. 'var': Strophe.NS.MUC
  48863. })));
  48864. }).catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
  48865. }
  48866. function fetchAndSetMUCDomain(controlboxview) {
  48867. if (controlboxview.model.get('connected')) {
  48868. if (!controlboxview.roomspanel.model.get('muc_domain')) {
  48869. if (_.isUndefined(_converse.muc_domain)) {
  48870. setMUCDomainFromDisco(controlboxview);
  48871. } else {
  48872. setMUCDomain(_converse.muc_domain, controlboxview);
  48873. }
  48874. }
  48875. }
  48876. }
  48877. /************************ BEGIN Event Handlers ************************/
  48878. _converse.on('chatBoxViewsInitialized', () => {
  48879. function openChatRoomFromURIClicked(ev) {
  48880. ev.preventDefault();
  48881. _converse.api.rooms.open(ev.target.href);
  48882. }
  48883. _converse.chatboxviews.delegate('click', 'a.open-chatroom', openChatRoomFromURIClicked);
  48884. const that = _converse.chatboxviews;
  48885. _converse.chatboxes.on('add', item => {
  48886. if (!that.get(item.get('id')) && item.get('type') === _converse.CHATROOMS_TYPE) {
  48887. return that.add(item.get('id'), new _converse.ChatRoomView({
  48888. 'model': item
  48889. }));
  48890. }
  48891. });
  48892. });
  48893. _converse.on('controlboxInitialized', view => {
  48894. if (!_converse.allow_muc) {
  48895. return;
  48896. }
  48897. fetchAndSetMUCDomain(view);
  48898. view.model.on('change:connected', _.partial(fetchAndSetMUCDomain, view));
  48899. });
  48900. function reconnectToChatRooms() {
  48901. /* Upon a reconnection event from converse, join again
  48902. * all the open groupchats.
  48903. */
  48904. _converse.chatboxviews.each(function (view) {
  48905. if (view.model.get('type') === _converse.CHATROOMS_TYPE) {
  48906. view.model.save('connection_status', _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.DISCONNECTED);
  48907. view.model.registerHandlers();
  48908. view.populateAndJoin();
  48909. }
  48910. });
  48911. }
  48912. _converse.on('reconnected', reconnectToChatRooms);
  48913. /************************ END Event Handlers ************************/
  48914. /************************ BEGIN API ************************/
  48915. _.extend(_converse.api, {
  48916. /**
  48917. * The "roomviews" namespace groups methods relevant to chatroom
  48918. * (aka groupchats) views.
  48919. *
  48920. * @namespace _converse.api.roomviews
  48921. * @memberOf _converse.api
  48922. */
  48923. 'roomviews': {
  48924. /**
  48925. * Lets you close open chatrooms.
  48926. *
  48927. * You can call this method without any arguments to close
  48928. * all open chatrooms, or you can specify a single JID or
  48929. * an array of JIDs.
  48930. *
  48931. * @method _converse.api.roomviews.close
  48932. * @param {(String[]|String)} jids The JID or array of JIDs of the chatroom(s)
  48933. */
  48934. 'close'(jids) {
  48935. if (_.isUndefined(jids)) {
  48936. _converse.chatboxviews.each(function (view) {
  48937. if (view.is_chatroom && view.model) {
  48938. view.close();
  48939. }
  48940. });
  48941. } else if (_.isString(jids)) {
  48942. const view = _converse.chatboxviews.get(jids);
  48943. if (view) {
  48944. view.close();
  48945. }
  48946. } else {
  48947. _.each(jids, function (jid) {
  48948. const view = _converse.chatboxviews.get(jid);
  48949. if (view) {
  48950. view.close();
  48951. }
  48952. });
  48953. }
  48954. }
  48955. }
  48956. });
  48957. }
  48958. });
  48959. /***/ }),
  48960. /***/ "./src/converse-notification.js":
  48961. /*!**************************************!*\
  48962. !*** ./src/converse-notification.js ***!
  48963. \**************************************/
  48964. /*! no exports provided */
  48965. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48966. "use strict";
  48967. __webpack_require__.r(__webpack_exports__);
  48968. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  48969. // Converse.js (A browser based XMPP chat client)
  48970. // http://conversejs.org
  48971. //
  48972. // Copyright (c) 2013-2018, JC Brand <jc@opkode.com>
  48973. // Licensed under the Mozilla Public License (MPLv2)
  48974. //
  48975. /*global define */
  48976. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env,
  48977. Strophe = _converse$env.Strophe,
  48978. _ = _converse$env._,
  48979. sizzle = _converse$env.sizzle,
  48980. u = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env.utils;
  48981. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins.add('converse-notification', {
  48982. dependencies: ["converse-chatboxes"],
  48983. initialize() {
  48984. /* The initialize function gets called as soon as the plugin is
  48985. * loaded by converse.js's plugin machinery.
  48986. */
  48987. const _converse = this._converse;
  48988. const __ = _converse.__;
  48989. _converse.supports_html5_notification = "Notification" in window;
  48990. _converse.api.settings.update({
  48991. notify_all_room_messages: false,
  48992. show_desktop_notifications: true,
  48993. show_chatstate_notifications: false,
  48994. chatstate_notification_blacklist: [],
  48995. // ^ a list of JIDs to ignore concerning chat state notifications
  48996. play_sounds: true,
  48997. sounds_path: 'sounds/',
  48998. notification_icon: 'logo/conversejs-filled.svg',
  48999. notification_delay: 5000
  49000. });
  49001. _converse.isOnlyChatStateNotification = msg => // See XEP-0085 Chat State Notification
  49002. _.isNull(msg.querySelector('body')) && (_.isNull(msg.querySelector(_converse.ACTIVE)) || _.isNull(msg.querySelector(_converse.COMPOSING)) || _.isNull(msg.querySelector(_converse.INACTIVE)) || _.isNull(msg.querySelector(_converse.PAUSED)) || _.isNull(msg.querySelector(_converse.GONE)));
  49003. _converse.shouldNotifyOfGroupMessage = function (message) {
  49004. /* Is this a group message worthy of notification?
  49005. */
  49006. let notify_all = _converse.notify_all_room_messages;
  49007. const jid = message.getAttribute('from'),
  49008. resource = Strophe.getResourceFromJid(jid),
  49009. room_jid = Strophe.getBareJidFromJid(jid),
  49010. sender = resource && Strophe.unescapeNode(resource) || '';
  49011. if (sender === '' || message.querySelectorAll('delay').length > 0) {
  49012. return false;
  49013. }
  49014. const room = _converse.chatboxes.get(room_jid);
  49015. const body = message.querySelector('body');
  49016. if (_.isNull(body)) {
  49017. return false;
  49018. }
  49019. const mentioned = new RegExp(`\\b${room.get('nick')}\\b`).test(body.textContent);
  49020. notify_all = notify_all === true || _.isArray(notify_all) && _.includes(notify_all, room_jid);
  49021. if (sender === room.get('nick') || !notify_all && !mentioned) {
  49022. return false;
  49023. }
  49024. return true;
  49025. };
  49026. _converse.isMessageToHiddenChat = function (message) {
  49027. if (_converse.isUniView()) {
  49028. const jid = Strophe.getBareJidFromJid(message.getAttribute('from')),
  49029. view = _converse.chatboxviews.get(jid);
  49030. if (!_.isNil(view)) {
  49031. return view.model.get('hidden') || _converse.windowState === 'hidden' || !u.isVisible(view.el);
  49032. }
  49033. return true;
  49034. }
  49035. return _converse.windowState === 'hidden';
  49036. };
  49037. _converse.shouldNotifyOfMessage = function (message) {
  49038. const forwarded = message.querySelector('forwarded');
  49039. if (!_.isNull(forwarded)) {
  49040. return false;
  49041. } else if (message.getAttribute('type') === 'groupchat') {
  49042. return _converse.shouldNotifyOfGroupMessage(message);
  49043. } else if (u.isHeadlineMessage(_converse, message)) {
  49044. // We want to show notifications for headline messages.
  49045. return _converse.isMessageToHiddenChat(message);
  49046. }
  49047. const is_me = Strophe.getBareJidFromJid(message.getAttribute('from')) === _converse.bare_jid;
  49048. return !_converse.isOnlyChatStateNotification(message) && !is_me && (_converse.show_desktop_notifications === 'all' || _converse.isMessageToHiddenChat(message));
  49049. };
  49050. _converse.playSoundNotification = function () {
  49051. /* Plays a sound to notify that a new message was recieved.
  49052. */
  49053. // XXX Eventually this can be refactored to use Notification's sound
  49054. // feature, but no browser currently supports it.
  49055. // https://developer.mozilla.org/en-US/docs/Web/API/notification/sound
  49056. if (_converse.play_sounds && !_.isUndefined(window.Audio)) {
  49057. const audioOgg = new Audio(_converse.sounds_path + "msg_received.ogg");
  49058. const canPlayOgg = audioOgg.canPlayType('audio/ogg');
  49059. if (canPlayOgg === 'probably') {
  49060. return audioOgg.play();
  49061. }
  49062. const audioMp3 = new Audio(_converse.sounds_path + "msg_received.mp3");
  49063. const canPlayMp3 = audioMp3.canPlayType('audio/mp3');
  49064. if (canPlayMp3 === 'probably') {
  49065. audioMp3.play();
  49066. } else if (canPlayOgg === 'maybe') {
  49067. audioOgg.play();
  49068. } else if (canPlayMp3 === 'maybe') {
  49069. audioMp3.play();
  49070. }
  49071. }
  49072. };
  49073. _converse.areDesktopNotificationsEnabled = function () {
  49074. return _converse.supports_html5_notification && _converse.show_desktop_notifications && Notification.permission === "granted";
  49075. };
  49076. _converse.showMessageNotification = function (message) {
  49077. /* Shows an HTML5 Notification to indicate that a new chat
  49078. * message was received.
  49079. */
  49080. if (!_converse.areDesktopNotificationsEnabled()) {
  49081. return;
  49082. }
  49083. let title, roster_item;
  49084. const full_from_jid = message.getAttribute('from'),
  49085. from_jid = Strophe.getBareJidFromJid(full_from_jid);
  49086. if (message.getAttribute('type') === 'headline') {
  49087. if (!_.includes(from_jid, '@') || _converse.allow_non_roster_messaging) {
  49088. title = __("Notification from %1$s", from_jid);
  49089. } else {
  49090. return;
  49091. }
  49092. } else if (!_.includes(from_jid, '@')) {
  49093. // workaround for Prosody which doesn't give type "headline"
  49094. title = __("Notification from %1$s", from_jid);
  49095. } else if (message.getAttribute('type') === 'groupchat') {
  49096. title = __("%1$s says", Strophe.getResourceFromJid(full_from_jid));
  49097. } else {
  49098. if (_.isUndefined(_converse.roster)) {
  49099. _converse.log("Could not send notification, because roster is undefined", Strophe.LogLevel.ERROR);
  49100. return;
  49101. }
  49102. roster_item = _converse.roster.get(from_jid);
  49103. if (!_.isUndefined(roster_item)) {
  49104. title = __("%1$s says", roster_item.getDisplayName());
  49105. } else {
  49106. if (_converse.allow_non_roster_messaging) {
  49107. title = __("%1$s says", from_jid);
  49108. } else {
  49109. return;
  49110. }
  49111. }
  49112. } // TODO: we should suppress notifications if we cannot decrypt
  49113. // the message...
  49114. const body = sizzle(`encrypted[xmlns="${Strophe.NS.OMEMO}"]`, message).length ? __('OMEMO Message received') : _.get(message.querySelector('body'), 'textContent');
  49115. if (!body) {
  49116. return;
  49117. }
  49118. const n = new Notification(title, {
  49119. 'body': body,
  49120. 'lang': _converse.locale,
  49121. 'icon': _converse.notification_icon,
  49122. 'requireInteraction': !_converse.notification_delay
  49123. });
  49124. if (_converse.notification_delay) {
  49125. setTimeout(n.close.bind(n), _converse.notification_delay);
  49126. }
  49127. };
  49128. _converse.showChatStateNotification = function (contact) {
  49129. /* Creates an HTML5 Notification to inform of a change in a
  49130. * contact's chat state.
  49131. */
  49132. if (_.includes(_converse.chatstate_notification_blacklist, contact.jid)) {
  49133. // Don't notify if the user is being ignored.
  49134. return;
  49135. }
  49136. const chat_state = contact.chat_status;
  49137. let message = null;
  49138. if (chat_state === 'offline') {
  49139. message = __('has gone offline');
  49140. } else if (chat_state === 'away') {
  49141. message = __('has gone away');
  49142. } else if (chat_state === 'dnd') {
  49143. message = __('is busy');
  49144. } else if (chat_state === 'online') {
  49145. message = __('has come online');
  49146. }
  49147. if (message === null) {
  49148. return;
  49149. }
  49150. const n = new Notification(contact.getDisplayName(), {
  49151. body: message,
  49152. lang: _converse.locale,
  49153. icon: _converse.notification_icon
  49154. });
  49155. setTimeout(n.close.bind(n), 5000);
  49156. };
  49157. _converse.showContactRequestNotification = function (contact) {
  49158. const n = new Notification(contact.getDisplayName(), {
  49159. body: __('wants to be your contact'),
  49160. lang: _converse.locale,
  49161. icon: _converse.notification_icon
  49162. });
  49163. setTimeout(n.close.bind(n), 5000);
  49164. };
  49165. _converse.showFeedbackNotification = function (data) {
  49166. if (data.klass === 'error' || data.klass === 'warn') {
  49167. const n = new Notification(data.subject, {
  49168. body: data.message,
  49169. lang: _converse.locale,
  49170. icon: _converse.notification_icon
  49171. });
  49172. setTimeout(n.close.bind(n), 5000);
  49173. }
  49174. };
  49175. _converse.handleChatStateNotification = function (contact) {
  49176. /* Event handler for on('contactPresenceChanged').
  49177. * Will show an HTML5 notification to indicate that the chat
  49178. * status has changed.
  49179. */
  49180. if (_converse.areDesktopNotificationsEnabled() && _converse.show_chatstate_notifications) {
  49181. _converse.showChatStateNotification(contact);
  49182. }
  49183. };
  49184. _converse.handleMessageNotification = function (data) {
  49185. /* Event handler for the on('message') event. Will call methods
  49186. * to play sounds and show HTML5 notifications.
  49187. */
  49188. const message = data.stanza;
  49189. if (!_converse.shouldNotifyOfMessage(message)) {
  49190. return false;
  49191. }
  49192. _converse.api.emit('messageNotification', message);
  49193. _converse.playSoundNotification();
  49194. _converse.showMessageNotification(message);
  49195. };
  49196. _converse.handleContactRequestNotification = function (contact) {
  49197. if (_converse.areDesktopNotificationsEnabled(true)) {
  49198. _converse.showContactRequestNotification(contact);
  49199. }
  49200. };
  49201. _converse.handleFeedback = function (data) {
  49202. if (_converse.areDesktopNotificationsEnabled(true)) {
  49203. _converse.showFeedbackNotification(data);
  49204. }
  49205. };
  49206. _converse.requestPermission = function () {
  49207. if (_converse.supports_html5_notification && !_.includes(['denied', 'granted'], Notification.permission)) {
  49208. // Ask user to enable HTML5 notifications
  49209. Notification.requestPermission();
  49210. }
  49211. };
  49212. _converse.on('pluginsInitialized', function () {
  49213. // We only register event handlers after all plugins are
  49214. // registered, because other plugins might override some of our
  49215. // handlers.
  49216. _converse.on('contactRequest', _converse.handleContactRequestNotification);
  49217. _converse.on('contactPresenceChanged', _converse.handleChatStateNotification);
  49218. _converse.on('message', _converse.handleMessageNotification);
  49219. _converse.on('feedback', _converse.handleFeedback);
  49220. _converse.on('connected', _converse.requestPermission);
  49221. });
  49222. }
  49223. });
  49224. /***/ }),
  49225. /***/ "./src/converse-omemo.js":
  49226. /*!*******************************!*\
  49227. !*** ./src/converse-omemo.js ***!
  49228. \*******************************/
  49229. /*! no exports provided */
  49230. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  49231. "use strict";
  49232. __webpack_require__.r(__webpack_exports__);
  49233. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  49234. /* harmony import */ var templates_toolbar_omemo_html__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! templates/toolbar_omemo.html */ "./src/templates/toolbar_omemo.html");
  49235. /* harmony import */ var templates_toolbar_omemo_html__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(templates_toolbar_omemo_html__WEBPACK_IMPORTED_MODULE_1__);
  49236. // Converse.js
  49237. // http://conversejs.org
  49238. //
  49239. // Copyright (c) 2013-2018, the Converse.js developers
  49240. // Licensed under the Mozilla Public License (MPLv2)
  49241. /* global libsignal, ArrayBuffer, parseInt, crypto */
  49242. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env,
  49243. Backbone = _converse$env.Backbone,
  49244. Promise = _converse$env.Promise,
  49245. Strophe = _converse$env.Strophe,
  49246. moment = _converse$env.moment,
  49247. sizzle = _converse$env.sizzle,
  49248. $iq = _converse$env.$iq,
  49249. $msg = _converse$env.$msg,
  49250. _ = _converse$env._,
  49251. f = _converse$env.f,
  49252. b64_sha1 = _converse$env.b64_sha1;
  49253. const u = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env.utils;
  49254. Strophe.addNamespace('OMEMO_DEVICELIST', Strophe.NS.OMEMO + ".devicelist");
  49255. Strophe.addNamespace('OMEMO_VERIFICATION', Strophe.NS.OMEMO + ".verification");
  49256. Strophe.addNamespace('OMEMO_WHITELISTED', Strophe.NS.OMEMO + ".whitelisted");
  49257. Strophe.addNamespace('OMEMO_BUNDLES', Strophe.NS.OMEMO + ".bundles");
  49258. const UNDECIDED = 0;
  49259. const TRUSTED = 1;
  49260. const UNTRUSTED = -1;
  49261. const TAG_LENGTH = 128;
  49262. const KEY_ALGO = {
  49263. 'name': "AES-GCM",
  49264. 'length': 128
  49265. };
  49266. function parseBundle(bundle_el) {
  49267. /* Given an XML element representing a user's OMEMO bundle, parse it
  49268. * and return a map.
  49269. */
  49270. const signed_prekey_public_el = bundle_el.querySelector('signedPreKeyPublic'),
  49271. signed_prekey_signature_el = bundle_el.querySelector('signedPreKeySignature'),
  49272. identity_key_el = bundle_el.querySelector('identityKey');
  49273. const prekeys = _.map(sizzle(`prekeys > preKeyPublic`, bundle_el), el => {
  49274. return {
  49275. 'id': parseInt(el.getAttribute('preKeyId'), 10),
  49276. 'key': el.textContent
  49277. };
  49278. });
  49279. return {
  49280. 'identity_key': bundle_el.querySelector('identityKey').textContent.trim(),
  49281. 'signed_prekey': {
  49282. 'id': parseInt(signed_prekey_public_el.getAttribute('signedPreKeyId'), 10),
  49283. 'public_key': signed_prekey_public_el.textContent,
  49284. 'signature': signed_prekey_signature_el.textContent
  49285. },
  49286. 'prekeys': prekeys
  49287. };
  49288. }
  49289. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins.add('converse-omemo', {
  49290. enabled(_converse) {
  49291. return !_.isNil(window.libsignal) && !f.includes('converse-omemo', _converse.blacklisted_plugins);
  49292. },
  49293. dependencies: ["converse-chatview"],
  49294. overrides: {
  49295. ProfileModal: {
  49296. events: {
  49297. 'change input.select-all': 'selectAll',
  49298. 'click .generate-bundle': 'generateOMEMODeviceBundle',
  49299. 'submit .fingerprint-removal': 'removeSelectedFingerprints'
  49300. },
  49301. initialize() {
  49302. const _converse = this.__super__._converse;
  49303. this.debouncedRender = _.debounce(this.render, 50);
  49304. this.devicelist = _converse.devicelists.get(_converse.bare_jid);
  49305. this.devicelist.devices.on('change:bundle', this.debouncedRender, this);
  49306. this.devicelist.devices.on('reset', this.debouncedRender, this);
  49307. this.devicelist.devices.on('reset', this.debouncedRender, this);
  49308. this.devicelist.devices.on('remove', this.debouncedRender, this);
  49309. this.devicelist.devices.on('add', this.debouncedRender, this);
  49310. return this.__super__.initialize.apply(this, arguments);
  49311. },
  49312. beforeRender() {
  49313. const _converse = this.__super__._converse,
  49314. device_id = _converse.omemo_store.get('device_id');
  49315. if (device_id) {
  49316. this.current_device = this.devicelist.devices.get(device_id);
  49317. }
  49318. this.other_devices = this.devicelist.devices.filter(d => d.get('id') !== device_id);
  49319. if (this.__super__.beforeRender) {
  49320. return this.__super__.beforeRender.apply(this, arguments);
  49321. }
  49322. },
  49323. selectAll(ev) {
  49324. let sibling = u.ancestor(ev.target, 'li');
  49325. while (sibling) {
  49326. sibling.querySelector('input[type="checkbox"]').checked = ev.target.checked;
  49327. sibling = sibling.nextElementSibling;
  49328. }
  49329. },
  49330. removeSelectedFingerprints(ev) {
  49331. ev.preventDefault();
  49332. ev.stopPropagation();
  49333. ev.target.querySelector('.select-all').checked = false;
  49334. const checkboxes = ev.target.querySelectorAll('.fingerprint-removal-item input[type="checkbox"]:checked'),
  49335. device_ids = _.map(checkboxes, 'value');
  49336. this.devicelist.removeOwnDevices(device_ids).then(this.modal.hide).catch(err => {
  49337. const _converse = this.__super__._converse,
  49338. __ = _converse.__;
  49339. _converse.log(err, Strophe.LogLevel.ERROR);
  49340. _converse.api.alert.show(Strophe.LogLevel.ERROR, __('Error'), [__('Sorry, an error occurred while trying to remove the devices.')]);
  49341. });
  49342. },
  49343. generateOMEMODeviceBundle(ev) {
  49344. const _converse = this.__super__._converse,
  49345. __ = _converse.__,
  49346. api = _converse.api;
  49347. ev.preventDefault();
  49348. if (confirm(__("Are you sure you want to generate new OMEMO keys? " + "This will remove your old keys and all previously encrypted messages will no longer be decryptable on this device."))) {
  49349. api.omemo.bundle.generate();
  49350. }
  49351. }
  49352. },
  49353. UserDetailsModal: {
  49354. events: {
  49355. 'click .fingerprint-trust .btn input': 'toggleDeviceTrust'
  49356. },
  49357. initialize() {
  49358. const _converse = this.__super__._converse;
  49359. const jid = this.model.get('jid');
  49360. this.devicelist = _converse.devicelists.get(jid) || _converse.devicelists.create({
  49361. 'jid': jid
  49362. });
  49363. this.devicelist.devices.on('change:bundle', this.render, this);
  49364. this.devicelist.devices.on('change:trusted', this.render, this);
  49365. this.devicelist.devices.on('remove', this.render, this);
  49366. this.devicelist.devices.on('add', this.render, this);
  49367. this.devicelist.devices.on('reset', this.render, this);
  49368. return this.__super__.initialize.apply(this, arguments);
  49369. },
  49370. toggleDeviceTrust(ev) {
  49371. const radio = ev.target;
  49372. const device = this.devicelist.devices.get(radio.getAttribute('name'));
  49373. device.save('trusted', parseInt(radio.value, 10));
  49374. }
  49375. },
  49376. ChatBox: {
  49377. getBundlesAndBuildSessions() {
  49378. const _converse = this.__super__._converse;
  49379. let devices;
  49380. return _converse.getDevicesForContact(this.get('jid')).then(their_devices => {
  49381. const device_id = _converse.omemo_store.get('device_id'),
  49382. devicelist = _converse.devicelists.get(_converse.bare_jid),
  49383. own_devices = devicelist.devices.filter(device => device.get('id') !== device_id);
  49384. devices = _.concat(own_devices, their_devices.models);
  49385. return Promise.all(devices.map(device => device.getBundle()));
  49386. }).then(() => this.buildSessions(devices));
  49387. },
  49388. async buildSession(device) {
  49389. const _converse = this.__super__._converse,
  49390. address = new libsignal.SignalProtocolAddress(device.get('jid'), device.get('id')),
  49391. sessionBuilder = new libsignal.SessionBuilder(_converse.omemo_store, address),
  49392. prekey = device.getRandomPreKey(),
  49393. bundle = await device.getBundle();
  49394. return sessionBuilder.processPreKey({
  49395. 'registrationId': parseInt(device.get('id'), 10),
  49396. 'identityKey': u.base64ToArrayBuffer(bundle.identity_key),
  49397. 'signedPreKey': {
  49398. 'keyId': bundle.signed_prekey.id,
  49399. // <Number>
  49400. 'publicKey': u.base64ToArrayBuffer(bundle.signed_prekey.public_key),
  49401. 'signature': u.base64ToArrayBuffer(bundle.signed_prekey.signature)
  49402. },
  49403. 'preKey': {
  49404. 'keyId': prekey.id,
  49405. // <Number>
  49406. 'publicKey': u.base64ToArrayBuffer(prekey.key)
  49407. }
  49408. });
  49409. },
  49410. getSession(device) {
  49411. const _converse = this.__super__._converse,
  49412. address = new libsignal.SignalProtocolAddress(device.get('jid'), device.get('id'));
  49413. return _converse.omemo_store.loadSession(address.toString()).then(session => {
  49414. if (session) {
  49415. return Promise.resolve();
  49416. } else {
  49417. return this.buildSession(device);
  49418. }
  49419. });
  49420. },
  49421. async encryptMessage(plaintext) {
  49422. // The client MUST use fresh, randomly generated key/IV pairs
  49423. // with AES-128 in Galois/Counter Mode (GCM).
  49424. // For GCM a 12 byte IV is strongly suggested as other IV lengths
  49425. // will require additional calculations. In principle any IV size
  49426. // can be used as long as the IV doesn't ever repeat. NIST however
  49427. // suggests that only an IV size of 12 bytes needs to be supported
  49428. // by implementations.
  49429. //
  49430. // https://crypto.stackexchange.com/questions/26783/ciphertext-and-tag-size-and-iv-transmission-with-aes-in-gcm-mode
  49431. const iv = crypto.getRandomValues(new window.Uint8Array(12)),
  49432. key = await crypto.subtle.generateKey(KEY_ALGO, true, ["encrypt", "decrypt"]),
  49433. algo = {
  49434. 'name': 'AES-GCM',
  49435. 'iv': iv,
  49436. 'tagLength': TAG_LENGTH
  49437. },
  49438. encrypted = await crypto.subtle.encrypt(algo, key, u.stringToArrayBuffer(plaintext)),
  49439. length = encrypted.byteLength - (128 + 7 >> 3),
  49440. ciphertext = encrypted.slice(0, length),
  49441. tag = encrypted.slice(length),
  49442. exported_key = await crypto.subtle.exportKey("raw", key);
  49443. return Promise.resolve({
  49444. 'key': exported_key,
  49445. 'tag': tag,
  49446. 'key_and_tag': u.appendArrayBuffer(exported_key, tag),
  49447. 'payload': u.arrayBufferToBase64(ciphertext),
  49448. 'iv': u.arrayBufferToBase64(iv)
  49449. });
  49450. },
  49451. async decryptMessage(obj) {
  49452. const key_obj = await crypto.subtle.importKey('raw', obj.key, KEY_ALGO, true, ['encrypt', 'decrypt']),
  49453. cipher = u.appendArrayBuffer(u.base64ToArrayBuffer(obj.payload), obj.tag),
  49454. algo = {
  49455. 'name': "AES-GCM",
  49456. 'iv': u.base64ToArrayBuffer(obj.iv),
  49457. 'tagLength': TAG_LENGTH
  49458. };
  49459. return u.arrayBufferToString((await crypto.subtle.decrypt(algo, key_obj, cipher)));
  49460. },
  49461. reportDecryptionError(e) {
  49462. const _converse = this.__super__._converse;
  49463. if (_converse.debug) {
  49464. const __ = _converse.__;
  49465. this.messages.create({
  49466. 'message': __("Sorry, could not decrypt a received OMEMO message due to an error.") + ` ${e.name} ${e.message}`,
  49467. 'type': 'error'
  49468. });
  49469. }
  49470. _converse.log(`${e.name} ${e.message}`, Strophe.LogLevel.ERROR);
  49471. },
  49472. decrypt(attrs) {
  49473. const _converse = this.__super__._converse,
  49474. session_cipher = this.getSessionCipher(attrs.from, parseInt(attrs.encrypted.device_id, 10)); // https://xmpp.org/extensions/xep-0384.html#usecases-receiving
  49475. if (attrs.encrypted.prekey === 'true') {
  49476. let plaintext;
  49477. return session_cipher.decryptPreKeyWhisperMessage(u.base64ToArrayBuffer(attrs.encrypted.key), 'binary').then(key_and_tag => {
  49478. if (attrs.encrypted.payload) {
  49479. const key = key_and_tag.slice(0, 16),
  49480. tag = key_and_tag.slice(16);
  49481. return this.decryptMessage(_.extend(attrs.encrypted, {
  49482. 'key': key,
  49483. 'tag': tag
  49484. }));
  49485. }
  49486. return Promise.resolve();
  49487. }).then(pt => {
  49488. plaintext = pt;
  49489. return _converse.omemo_store.generateMissingPreKeys();
  49490. }).then(() => _converse.omemo_store.publishBundle()).then(() => {
  49491. if (plaintext) {
  49492. return _.extend(attrs, {
  49493. 'plaintext': plaintext
  49494. });
  49495. } else {
  49496. return _.extend(attrs, {
  49497. 'is_only_key': true
  49498. });
  49499. }
  49500. }).catch(e => {
  49501. this.reportDecryptionError(e);
  49502. return attrs;
  49503. });
  49504. } else {
  49505. return session_cipher.decryptWhisperMessage(u.base64ToArrayBuffer(attrs.encrypted.key), 'binary').then(key_and_tag => {
  49506. const key = key_and_tag.slice(0, 16),
  49507. tag = key_and_tag.slice(16);
  49508. return this.decryptMessage(_.extend(attrs.encrypted, {
  49509. 'key': key,
  49510. 'tag': tag
  49511. }));
  49512. }).then(plaintext => _.extend(attrs, {
  49513. 'plaintext': plaintext
  49514. })).catch(e => {
  49515. this.reportDecryptionError(e);
  49516. return attrs;
  49517. });
  49518. }
  49519. },
  49520. getEncryptionAttributesfromStanza(stanza, original_stanza, attrs) {
  49521. const _converse = this.__super__._converse,
  49522. encrypted = sizzle(`encrypted[xmlns="${Strophe.NS.OMEMO}"]`, original_stanza).pop(),
  49523. header = encrypted.querySelector('header'),
  49524. key = sizzle(`key[rid="${_converse.omemo_store.get('device_id')}"]`, encrypted).pop();
  49525. if (key) {
  49526. attrs['is_encrypted'] = true;
  49527. attrs['encrypted'] = {
  49528. 'device_id': header.getAttribute('sid'),
  49529. 'iv': header.querySelector('iv').textContent,
  49530. 'key': key.textContent,
  49531. 'payload': _.get(encrypted.querySelector('payload'), 'textContent', null),
  49532. 'prekey': key.getAttribute('prekey')
  49533. };
  49534. return this.decrypt(attrs);
  49535. } else {
  49536. return Promise.resolve(attrs);
  49537. }
  49538. },
  49539. async getMessageAttributesFromStanza(stanza, original_stanza) {
  49540. const _converse = this.__super__._converse,
  49541. encrypted = sizzle(`encrypted[xmlns="${Strophe.NS.OMEMO}"]`, original_stanza).pop(),
  49542. attrs = await this.__super__.getMessageAttributesFromStanza.apply(this, arguments);
  49543. if (!encrypted || !_converse.config.get('trusted')) {
  49544. return attrs;
  49545. } else {
  49546. return this.getEncryptionAttributesfromStanza(stanza, original_stanza, attrs);
  49547. }
  49548. },
  49549. buildSessions(devices) {
  49550. return Promise.all(devices.map(device => this.getSession(device))).then(() => devices);
  49551. },
  49552. getSessionCipher(jid, id) {
  49553. const _converse = this.__super__._converse,
  49554. address = new libsignal.SignalProtocolAddress(jid, id);
  49555. this.session_cipher = new window.libsignal.SessionCipher(_converse.omemo_store, address);
  49556. return this.session_cipher;
  49557. },
  49558. encryptKey(plaintext, device) {
  49559. return this.getSessionCipher(device.get('jid'), device.get('id')).encrypt(plaintext).then(payload => ({
  49560. 'payload': payload,
  49561. 'device': device
  49562. }));
  49563. },
  49564. addKeysToMessageStanza(stanza, dicts, iv) {
  49565. for (var i in dicts) {
  49566. if (Object.prototype.hasOwnProperty.call(dicts, i)) {
  49567. const payload = dicts[i].payload,
  49568. device = dicts[i].device,
  49569. prekey = 3 == parseInt(payload.type, 10);
  49570. stanza.c('key', {
  49571. 'rid': device.get('id')
  49572. }).t(btoa(payload.body));
  49573. if (prekey) {
  49574. stanza.attrs({
  49575. 'prekey': prekey
  49576. });
  49577. }
  49578. stanza.up();
  49579. if (i == dicts.length - 1) {
  49580. stanza.c('iv').t(iv).up().up();
  49581. }
  49582. }
  49583. }
  49584. return Promise.resolve(stanza);
  49585. },
  49586. createOMEMOMessageStanza(message, devices) {
  49587. const _converse = this.__super__._converse,
  49588. __ = _converse.__;
  49589. const body = __("This is an OMEMO encrypted message which your client doesn’t seem to support. " + "Find more information on https://conversations.im/omemo");
  49590. if (!message.get('message')) {
  49591. throw new Error("No message body to encrypt!");
  49592. }
  49593. const stanza = $msg({
  49594. 'from': _converse.connection.jid,
  49595. 'to': this.get('jid'),
  49596. 'type': this.get('message_type'),
  49597. 'id': message.get('msgid')
  49598. }).c('body').t(body).up().c('request', {
  49599. 'xmlns': Strophe.NS.RECEIPTS
  49600. }).up() // An encrypted header is added to the message for
  49601. // each device that is supposed to receive it.
  49602. // These headers simply contain the key that the
  49603. // payload message is encrypted with,
  49604. // and they are separately encrypted using the
  49605. // session corresponding to the counterpart device.
  49606. .c('encrypted', {
  49607. 'xmlns': Strophe.NS.OMEMO
  49608. }).c('header', {
  49609. 'sid': _converse.omemo_store.get('device_id')
  49610. });
  49611. return this.encryptMessage(message.get('message')).then(obj => {
  49612. // The 16 bytes key and the GCM authentication tag (The tag
  49613. // SHOULD have at least 128 bit) are concatenated and for each
  49614. // intended recipient device, i.e. both own devices as well as
  49615. // devices associated with the contact, the result of this
  49616. // concatenation is encrypted using the corresponding
  49617. // long-standing SignalProtocol session.
  49618. const promises = devices.filter(device => device.get('trusted') != UNTRUSTED).map(device => this.encryptKey(obj.key_and_tag, device));
  49619. return Promise.all(promises).then(dicts => this.addKeysToMessageStanza(stanza, dicts, obj.iv)).then(stanza => {
  49620. stanza.c('payload').t(obj.payload).up().up();
  49621. stanza.c('store', {
  49622. 'xmlns': Strophe.NS.HINTS
  49623. });
  49624. return stanza;
  49625. });
  49626. });
  49627. },
  49628. sendMessage(attrs) {
  49629. const _converse = this.__super__._converse,
  49630. __ = _converse.__;
  49631. if (this.get('omemo_active') && attrs.message) {
  49632. attrs['is_encrypted'] = true;
  49633. attrs['plaintext'] = attrs.message;
  49634. const message = this.messages.create(attrs);
  49635. this.getBundlesAndBuildSessions().then(devices => this.createOMEMOMessageStanza(message, devices)).then(stanza => this.sendMessageStanza(stanza)).catch(e => {
  49636. this.messages.create({
  49637. 'message': __("Sorry, could not send the message due to an error.") + ` ${e.message}`,
  49638. 'type': 'error'
  49639. });
  49640. _converse.log(e, Strophe.LogLevel.ERROR);
  49641. });
  49642. } else {
  49643. return this.__super__.sendMessage.apply(this, arguments);
  49644. }
  49645. }
  49646. },
  49647. ChatBoxView: {
  49648. events: {
  49649. 'click .toggle-omemo': 'toggleOMEMO'
  49650. },
  49651. initialize() {
  49652. this.__super__.initialize.apply(this, arguments);
  49653. this.model.on('change:omemo_active', this.renderOMEMOToolbarButton, this);
  49654. this.model.on('change:omemo_supported', this.onOMEMOSupportedDetermined, this);
  49655. },
  49656. showMessage(message) {
  49657. // We don't show a message if it's only keying material
  49658. if (!message.get('is_only_key')) {
  49659. return this.__super__.showMessage.apply(this, arguments);
  49660. }
  49661. },
  49662. onOMEMOSupportedDetermined() {
  49663. if (!this.model.get('omemo_supported') && this.model.get('omemo_active')) {
  49664. this.model.set('omemo_active', false); // Will cause render
  49665. } else {
  49666. this.renderOMEMOToolbarButton();
  49667. }
  49668. },
  49669. renderOMEMOToolbarButton() {
  49670. const _converse = this.__super__._converse,
  49671. __ = _converse.__,
  49672. icon = this.el.querySelector('.toggle-omemo'),
  49673. html = templates_toolbar_omemo_html__WEBPACK_IMPORTED_MODULE_1___default()(_.extend(this.model.toJSON(), {
  49674. '__': __
  49675. }));
  49676. if (icon) {
  49677. icon.outerHTML = html;
  49678. } else {
  49679. this.el.querySelector('.chat-toolbar').insertAdjacentHTML('beforeend', html);
  49680. }
  49681. },
  49682. toggleOMEMO(ev) {
  49683. const _converse = this.__super__._converse,
  49684. __ = _converse.__;
  49685. if (!this.model.get('omemo_supported')) {
  49686. return _converse.api.alert.show(Strophe.LogLevel.ERROR, __('Error'), [__("Cannot use end-to-end encryption because %1$s uses a client that doesn't support OMEMO.", this.model.contact.getDisplayName())]);
  49687. }
  49688. ev.preventDefault();
  49689. this.model.save({
  49690. 'omemo_active': !this.model.get('omemo_active')
  49691. });
  49692. }
  49693. },
  49694. ChatRoomView: {
  49695. events: {
  49696. 'click .toggle-omemo': 'toggleOMEMO'
  49697. },
  49698. initialize() {
  49699. this.__super__.initialize.apply(this, arguments);
  49700. this.model.on('change:omemo_active', this.renderOMEMOToolbarButton, this);
  49701. this.model.on('change:omemo_supported', this.onOMEMOSupportedDetermined, this);
  49702. },
  49703. toggleOMEMO(ev) {
  49704. const _converse = this.__super__._converse,
  49705. __ = _converse.__;
  49706. if (!this.model.get('omemo_supported')) {
  49707. return _converse.api.alert.show(Strophe.LogLevel.ERROR, __('Error'), [__('Cannot use end-to-end encryption in this groupchat, ' + 'either the groupchat has some anonymity or not all participants support OMEMO.')]);
  49708. }
  49709. ev.preventDefault();
  49710. this.model.save({
  49711. 'omemo_active': !this.model.get('omemo_active')
  49712. });
  49713. }
  49714. }
  49715. },
  49716. initialize() {
  49717. /* The initialize function gets called as soon as the plugin is
  49718. * loaded by Converse.js's plugin machinery.
  49719. */
  49720. const _converse = this._converse,
  49721. __ = _converse.__;
  49722. _converse.api.promises.add(['OMEMOInitialized']);
  49723. _converse.NUM_PREKEYS = 100; // Set here so that tests can override
  49724. async function generateFingerprint(device) {
  49725. if (_.get(device.get('bundle'), 'fingerprint')) {
  49726. return;
  49727. }
  49728. const bundle = await device.getBundle();
  49729. bundle['fingerprint'] = u.arrayBufferToHex(u.base64ToArrayBuffer(bundle['identity_key']));
  49730. device.save('bundle', bundle);
  49731. device.trigger('change:bundle'); // Doesn't get triggered automatically due to pass-by-reference
  49732. }
  49733. _converse.generateFingerprints = async function (jid) {
  49734. const devices = await _converse.getDevicesForContact(jid);
  49735. return Promise.all(devices.map(d => generateFingerprint(d)));
  49736. };
  49737. _converse.getDeviceForContact = function (jid, device_id) {
  49738. return _converse.getDevicesForContact(jid).then(devices => devices.get(device_id));
  49739. };
  49740. _converse.getDevicesForContact = async function (jid) {
  49741. await _converse.api.waitUntil('OMEMOInitialized');
  49742. const devicelist = _converse.devicelists.get(jid) || _converse.devicelists.create({
  49743. 'jid': jid
  49744. });
  49745. await devicelist.fetchDevices();
  49746. return devicelist.devices;
  49747. };
  49748. _converse.contactHasOMEMOSupport = async function (jid) {
  49749. /* Checks whether the contact advertises any OMEMO-compatible devices. */
  49750. const devices = await _converse.getDevicesForContact(jid);
  49751. return devices.length > 0;
  49752. };
  49753. function generateDeviceID() {
  49754. /* Generates a device ID, making sure that it's unique */
  49755. const existing_ids = _converse.devicelists.get(_converse.bare_jid).devices.pluck('id');
  49756. let device_id = libsignal.KeyHelper.generateRegistrationId();
  49757. let i = 0;
  49758. while (_.includes(existing_ids, device_id)) {
  49759. device_id = libsignal.KeyHelper.generateRegistrationId();
  49760. i++;
  49761. if (i == 10) {
  49762. throw new Error("Unable to generate a unique device ID");
  49763. }
  49764. }
  49765. return device_id.toString();
  49766. }
  49767. _converse.OMEMOStore = Backbone.Model.extend({
  49768. Direction: {
  49769. SENDING: 1,
  49770. RECEIVING: 2
  49771. },
  49772. getIdentityKeyPair() {
  49773. const keypair = this.get('identity_keypair');
  49774. return Promise.resolve({
  49775. 'privKey': u.base64ToArrayBuffer(keypair.privKey),
  49776. 'pubKey': u.base64ToArrayBuffer(keypair.pubKey)
  49777. });
  49778. },
  49779. getLocalRegistrationId() {
  49780. return Promise.resolve(parseInt(this.get('device_id'), 10));
  49781. },
  49782. isTrustedIdentity(identifier, identity_key, direction) {
  49783. if (_.isNil(identifier)) {
  49784. throw new Error("Can't check identity key for invalid key");
  49785. }
  49786. if (!(identity_key instanceof ArrayBuffer)) {
  49787. throw new Error("Expected identity_key to be an ArrayBuffer");
  49788. }
  49789. const trusted = this.get('identity_key' + identifier);
  49790. if (trusted === undefined) {
  49791. return Promise.resolve(true);
  49792. }
  49793. return Promise.resolve(u.arrayBufferToBase64(identity_key) === trusted);
  49794. },
  49795. loadIdentityKey(identifier) {
  49796. if (_.isNil(identifier)) {
  49797. throw new Error("Can't load identity_key for invalid identifier");
  49798. }
  49799. return Promise.resolve(u.base64ToArrayBuffer(this.get('identity_key' + identifier)));
  49800. },
  49801. saveIdentity(identifier, identity_key) {
  49802. if (_.isNil(identifier)) {
  49803. throw new Error("Can't save identity_key for invalid identifier");
  49804. }
  49805. const address = new libsignal.SignalProtocolAddress.fromString(identifier),
  49806. existing = this.get('identity_key' + address.getName());
  49807. const b64_idkey = u.arrayBufferToBase64(identity_key);
  49808. this.save('identity_key' + address.getName(), b64_idkey);
  49809. if (existing && b64_idkey !== existing) {
  49810. return Promise.resolve(true);
  49811. } else {
  49812. return Promise.resolve(false);
  49813. }
  49814. },
  49815. getPreKeys() {
  49816. return this.get('prekeys') || {};
  49817. },
  49818. loadPreKey(key_id) {
  49819. const res = this.getPreKeys()[key_id];
  49820. if (res) {
  49821. return Promise.resolve({
  49822. 'privKey': u.base64ToArrayBuffer(res.privKey),
  49823. 'pubKey': u.base64ToArrayBuffer(res.pubKey)
  49824. });
  49825. }
  49826. return Promise.resolve();
  49827. },
  49828. storePreKey(key_id, key_pair) {
  49829. const prekey = {};
  49830. prekey[key_id] = {
  49831. 'pubKey': u.arrayBufferToBase64(key_pair.pubKey),
  49832. 'privKey': u.arrayBufferToBase64(key_pair.privKey)
  49833. };
  49834. this.save('prekeys', _.extend(this.getPreKeys(), prekey));
  49835. return Promise.resolve();
  49836. },
  49837. removePreKey(key_id) {
  49838. this.save('prekeys', _.omit(this.getPreKeys(), key_id));
  49839. return Promise.resolve();
  49840. },
  49841. loadSignedPreKey(keyId) {
  49842. const res = this.get('signed_prekey');
  49843. if (res) {
  49844. return Promise.resolve({
  49845. 'privKey': u.base64ToArrayBuffer(res.privKey),
  49846. 'pubKey': u.base64ToArrayBuffer(res.pubKey)
  49847. });
  49848. }
  49849. return Promise.resolve();
  49850. },
  49851. storeSignedPreKey(spk) {
  49852. if (typeof spk !== "object") {
  49853. // XXX: We've changed the signature of this method from the
  49854. // example given in InMemorySignalProtocolStore.
  49855. // Should be fine because the libsignal code doesn't
  49856. // actually call this method.
  49857. throw new Error("storeSignedPreKey: expected an object");
  49858. }
  49859. this.save('signed_prekey', {
  49860. 'id': spk.keyId,
  49861. 'privKey': u.arrayBufferToBase64(spk.keyPair.privKey),
  49862. 'pubKey': u.arrayBufferToBase64(spk.keyPair.pubKey),
  49863. // XXX: The InMemorySignalProtocolStore does not pass
  49864. // in or store the signature, but we need it when we
  49865. // publish out bundle and this method isn't called from
  49866. // within libsignal code, so we modify it to also store
  49867. // the signature.
  49868. 'signature': u.arrayBufferToBase64(spk.signature)
  49869. });
  49870. return Promise.resolve();
  49871. },
  49872. removeSignedPreKey(key_id) {
  49873. if (this.get('signed_prekey')['id'] === key_id) {
  49874. this.unset('signed_prekey');
  49875. this.save();
  49876. }
  49877. return Promise.resolve();
  49878. },
  49879. loadSession(identifier) {
  49880. return Promise.resolve(this.get('session' + identifier));
  49881. },
  49882. storeSession(identifier, record) {
  49883. return Promise.resolve(this.save('session' + identifier, record));
  49884. },
  49885. removeSession(identifier) {
  49886. return Promise.resolve(this.unset('session' + identifier));
  49887. },
  49888. removeAllSessions(identifier) {
  49889. const keys = _.filter(_.keys(this.attributes), key => {
  49890. if (key.startsWith('session' + identifier)) {
  49891. return key;
  49892. }
  49893. });
  49894. const attrs = {};
  49895. _.forEach(keys, key => {
  49896. attrs[key] = undefined;
  49897. });
  49898. this.save(attrs);
  49899. return Promise.resolve();
  49900. },
  49901. publishBundle() {
  49902. const signed_prekey = this.get('signed_prekey');
  49903. const stanza = $iq({
  49904. 'from': _converse.bare_jid,
  49905. 'type': 'set'
  49906. }).c('pubsub', {
  49907. 'xmlns': Strophe.NS.PUBSUB
  49908. }).c('publish', {
  49909. 'node': `${Strophe.NS.OMEMO_BUNDLES}:${this.get('device_id')}`
  49910. }).c('item').c('bundle', {
  49911. 'xmlns': Strophe.NS.OMEMO
  49912. }).c('signedPreKeyPublic', {
  49913. 'signedPreKeyId': signed_prekey.id
  49914. }).t(signed_prekey.pubKey).up().c('signedPreKeySignature').t(signed_prekey.signature).up().c('identityKey').t(this.get('identity_keypair').pubKey).up().c('prekeys');
  49915. _.forEach(this.get('prekeys'), (prekey, id) => stanza.c('preKeyPublic', {
  49916. 'preKeyId': id
  49917. }).t(prekey.pubKey).up());
  49918. return _converse.api.sendIQ(stanza);
  49919. },
  49920. generateMissingPreKeys() {
  49921. const current_keys = this.getPreKeys(),
  49922. missing_keys = _.difference(_.invokeMap(_.range(0, _converse.NUM_PREKEYS), Number.prototype.toString), _.keys(current_keys));
  49923. if (missing_keys.length < 1) {
  49924. _converse.log("No missing prekeys to generate for our own device", Strophe.LogLevel.WARN);
  49925. return Promise.resolve();
  49926. }
  49927. return Promise.all(_.map(missing_keys, id => libsignal.KeyHelper.generatePreKey(parseInt(id, 10)))).then(keys => {
  49928. _.forEach(keys, k => this.storePreKey(k.keyId, k.keyPair));
  49929. const marshalled_keys = _.map(this.getPreKeys(), k => ({
  49930. 'id': k.keyId,
  49931. 'key': u.arrayBufferToBase64(k.pubKey)
  49932. })),
  49933. devicelist = _converse.devicelists.get(_converse.bare_jid),
  49934. device = devicelist.devices.get(this.get('device_id'));
  49935. return device.getBundle().then(bundle => device.save('bundle', _.extend(bundle, {
  49936. 'prekeys': marshalled_keys
  49937. })));
  49938. });
  49939. },
  49940. async generateBundle() {
  49941. /* The first thing that needs to happen if a client wants to
  49942. * start using OMEMO is they need to generate an IdentityKey
  49943. * and a Device ID. The IdentityKey is a Curve25519 [6]
  49944. * public/private Key pair. The Device ID is a randomly
  49945. * generated integer between 1 and 2^31 - 1.
  49946. */
  49947. const identity_keypair = await libsignal.KeyHelper.generateIdentityKeyPair();
  49948. const bundle = {},
  49949. identity_key = u.arrayBufferToBase64(identity_keypair.pubKey),
  49950. device_id = generateDeviceID();
  49951. bundle['identity_key'] = identity_key;
  49952. bundle['device_id'] = device_id;
  49953. this.save({
  49954. 'device_id': device_id,
  49955. 'identity_keypair': {
  49956. 'privKey': u.arrayBufferToBase64(identity_keypair.privKey),
  49957. 'pubKey': identity_key
  49958. },
  49959. 'identity_key': identity_key
  49960. });
  49961. const signed_prekey = await libsignal.KeyHelper.generateSignedPreKey(identity_keypair, 0);
  49962. _converse.omemo_store.storeSignedPreKey(signed_prekey);
  49963. bundle['signed_prekey'] = {
  49964. 'id': signed_prekey.keyId,
  49965. 'public_key': u.arrayBufferToBase64(signed_prekey.keyPair.privKey),
  49966. 'signature': u.arrayBufferToBase64(signed_prekey.signature)
  49967. };
  49968. const keys = await Promise.all(_.map(_.range(0, _converse.NUM_PREKEYS), id => libsignal.KeyHelper.generatePreKey(id)));
  49969. _.forEach(keys, k => _converse.omemo_store.storePreKey(k.keyId, k.keyPair));
  49970. const devicelist = _converse.devicelists.get(_converse.bare_jid),
  49971. device = devicelist.devices.create({
  49972. 'id': bundle.device_id,
  49973. 'jid': _converse.bare_jid
  49974. }),
  49975. marshalled_keys = _.map(keys, k => ({
  49976. 'id': k.keyId,
  49977. 'key': u.arrayBufferToBase64(k.keyPair.pubKey)
  49978. }));
  49979. bundle['prekeys'] = marshalled_keys;
  49980. device.save('bundle', bundle);
  49981. },
  49982. fetchSession() {
  49983. if (_.isUndefined(this._setup_promise)) {
  49984. this._setup_promise = new Promise((resolve, reject) => {
  49985. this.fetch({
  49986. 'success': () => {
  49987. if (!_converse.omemo_store.get('device_id')) {
  49988. this.generateBundle().then(resolve).catch(resolve);
  49989. } else {
  49990. resolve();
  49991. }
  49992. },
  49993. 'error': () => {
  49994. this.generateBundle().then(resolve).catch(resolve);
  49995. }
  49996. });
  49997. });
  49998. }
  49999. return this._setup_promise;
  50000. }
  50001. });
  50002. _converse.Device = Backbone.Model.extend({
  50003. defaults: {
  50004. 'trusted': UNDECIDED
  50005. },
  50006. getRandomPreKey() {
  50007. // XXX: assumes that the bundle has already been fetched
  50008. const bundle = this.get('bundle');
  50009. return bundle.prekeys[u.getRandomInt(bundle.prekeys.length)];
  50010. },
  50011. fetchBundleFromServer() {
  50012. const stanza = $iq({
  50013. 'type': 'get',
  50014. 'from': _converse.bare_jid,
  50015. 'to': this.get('jid')
  50016. }).c('pubsub', {
  50017. 'xmlns': Strophe.NS.PUBSUB
  50018. }).c('items', {
  50019. 'node': `${Strophe.NS.OMEMO_BUNDLES}:${this.get('id')}`
  50020. });
  50021. return _converse.api.sendIQ(stanza).then(iq => {
  50022. const publish_el = sizzle(`items[node="${Strophe.NS.OMEMO_BUNDLES}:${this.get('id')}"]`, iq).pop(),
  50023. bundle_el = sizzle(`bundle[xmlns="${Strophe.NS.OMEMO}"]`, publish_el).pop(),
  50024. bundle = parseBundle(bundle_el);
  50025. this.save('bundle', bundle);
  50026. return bundle;
  50027. }).catch(iq => {
  50028. _converse.log(iq.outerHTML, Strophe.LogLevel.ERROR);
  50029. });
  50030. },
  50031. getBundle() {
  50032. /* Fetch and save the bundle information associated with
  50033. * this device, if the information is not at hand already.
  50034. */
  50035. if (this.get('bundle')) {
  50036. return Promise.resolve(this.get('bundle'), this);
  50037. } else {
  50038. return this.fetchBundleFromServer();
  50039. }
  50040. }
  50041. });
  50042. _converse.Devices = Backbone.Collection.extend({
  50043. model: _converse.Device
  50044. });
  50045. _converse.DeviceList = Backbone.Model.extend({
  50046. idAttribute: 'jid',
  50047. initialize() {
  50048. this.devices = new _converse.Devices();
  50049. const id = `converse.devicelist-${_converse.bare_jid}-${this.get('jid')}`;
  50050. this.devices.browserStorage = new Backbone.BrowserStorage.session(id);
  50051. this.fetchDevices();
  50052. },
  50053. fetchDevices() {
  50054. if (_.isUndefined(this._devices_promise)) {
  50055. this._devices_promise = new Promise(resolve => {
  50056. this.devices.fetch({
  50057. 'success': async collection => {
  50058. if (collection.length === 0) {
  50059. const ids = await this.fetchDevicesFromServer();
  50060. await this.publishCurrentDevice(ids);
  50061. }
  50062. resolve();
  50063. },
  50064. 'error': e => {
  50065. _converse.log(e, Strophe.LogLevel.ERROR);
  50066. resolve();
  50067. }
  50068. });
  50069. });
  50070. }
  50071. return this._devices_promise;
  50072. },
  50073. async publishCurrentDevice(device_ids) {
  50074. if (this.get('jid') !== _converse.bare_jid) {
  50075. // We only publish for ourselves.
  50076. return;
  50077. }
  50078. await restoreOMEMOSession();
  50079. let device_id = _converse.omemo_store.get('device_id');
  50080. if (!this.devices.findWhere({
  50081. 'id': device_id
  50082. })) {
  50083. // Generate a new bundle if we cannot find our device
  50084. await _converse.omemo_store.generateBundle();
  50085. device_id = _converse.omemo_store.get('device_id');
  50086. }
  50087. if (!_.includes(device_ids, device_id)) {
  50088. return this.publishDevices();
  50089. }
  50090. },
  50091. async fetchDevicesFromServer() {
  50092. const stanza = $iq({
  50093. 'type': 'get',
  50094. 'from': _converse.bare_jid,
  50095. 'to': this.get('jid')
  50096. }).c('pubsub', {
  50097. 'xmlns': Strophe.NS.PUBSUB
  50098. }).c('items', {
  50099. 'node': Strophe.NS.OMEMO_DEVICELIST
  50100. });
  50101. let iq;
  50102. try {
  50103. iq = await _converse.api.sendIQ(stanza);
  50104. } catch (e) {
  50105. _converse.log(e, Strophe.LogLevel.ERROR);
  50106. return [];
  50107. }
  50108. const device_ids = _.map(sizzle(`list[xmlns="${Strophe.NS.OMEMO}"] device`, iq), dev => dev.getAttribute('id'));
  50109. _.forEach(device_ids, id => this.devices.create({
  50110. 'id': id,
  50111. 'jid': this.get('jid')
  50112. }));
  50113. return device_ids;
  50114. },
  50115. publishDevices() {
  50116. const stanza = $iq({
  50117. 'from': _converse.bare_jid,
  50118. 'type': 'set'
  50119. }).c('pubsub', {
  50120. 'xmlns': Strophe.NS.PUBSUB
  50121. }).c('publish', {
  50122. 'node': Strophe.NS.OMEMO_DEVICELIST
  50123. }).c('item').c('list', {
  50124. 'xmlns': Strophe.NS.OMEMO
  50125. });
  50126. this.devices.each(device => stanza.c('device', {
  50127. 'id': device.get('id')
  50128. }).up());
  50129. return _converse.api.sendIQ(stanza);
  50130. },
  50131. removeOwnDevices(device_ids) {
  50132. if (this.get('jid') !== _converse.bare_jid) {
  50133. throw new Error("Cannot remove devices from someone else's device list");
  50134. }
  50135. _.forEach(device_ids, device_id => this.devices.get(device_id).destroy());
  50136. return this.publishDevices();
  50137. }
  50138. });
  50139. _converse.DeviceLists = Backbone.Collection.extend({
  50140. model: _converse.DeviceList
  50141. });
  50142. function fetchDeviceLists() {
  50143. return new Promise((resolve, reject) => _converse.devicelists.fetch({
  50144. 'success': resolve
  50145. }));
  50146. }
  50147. function fetchOwnDevices() {
  50148. return fetchDeviceLists().then(() => {
  50149. let own_devicelist = _converse.devicelists.get(_converse.bare_jid);
  50150. if (_.isNil(own_devicelist)) {
  50151. own_devicelist = _converse.devicelists.create({
  50152. 'jid': _converse.bare_jid
  50153. });
  50154. }
  50155. return own_devicelist.fetchDevices();
  50156. });
  50157. }
  50158. function updateBundleFromStanza(stanza) {
  50159. const items_el = sizzle(`items`, stanza).pop();
  50160. if (!items_el || !items_el.getAttribute('node').startsWith(Strophe.NS.OMEMO_BUNDLES)) {
  50161. return;
  50162. }
  50163. const device_id = items_el.getAttribute('node').split(':')[1],
  50164. jid = stanza.getAttribute('from'),
  50165. bundle_el = sizzle(`item > bundle`, items_el).pop(),
  50166. devicelist = _converse.devicelists.get(jid) || _converse.devicelists.create({
  50167. 'jid': jid
  50168. }),
  50169. device = devicelist.devices.get(device_id) || devicelist.devices.create({
  50170. 'id': device_id,
  50171. 'jid': jid
  50172. });
  50173. device.save({
  50174. 'bundle': parseBundle(bundle_el)
  50175. });
  50176. }
  50177. function updateDevicesFromStanza(stanza) {
  50178. const items_el = sizzle(`items[node="${Strophe.NS.OMEMO_DEVICELIST}"]`, stanza).pop();
  50179. if (!items_el) {
  50180. return;
  50181. }
  50182. const device_ids = _.map(sizzle(`item list[xmlns="${Strophe.NS.OMEMO}"] device`, items_el), device => device.getAttribute('id'));
  50183. const jid = stanza.getAttribute('from'),
  50184. devicelist = _converse.devicelists.get(jid) || _converse.devicelists.create({
  50185. 'jid': jid
  50186. }),
  50187. devices = devicelist.devices,
  50188. removed_ids = _.difference(devices.pluck('id'), device_ids);
  50189. _.forEach(removed_ids, id => {
  50190. if (jid === _converse.bare_jid && id === _converse.omemo_store.get('device_id')) {
  50191. // We don't remove the current device
  50192. return;
  50193. }
  50194. devices.get(id).destroy();
  50195. });
  50196. _.forEach(device_ids, device_id => {
  50197. if (!devices.get(device_id)) {
  50198. devices.create({
  50199. 'id': device_id,
  50200. 'jid': jid
  50201. });
  50202. }
  50203. });
  50204. if (Strophe.getBareJidFromJid(jid) === _converse.bare_jid) {
  50205. // Make sure our own device is on the list (i.e. if it was
  50206. // removed, add it again.
  50207. _converse.devicelists.get(_converse.bare_jid).publishCurrentDevice(device_ids);
  50208. }
  50209. }
  50210. function registerPEPPushHandler() {
  50211. // Add a handler for devices pushed from other connected clients
  50212. _converse.connection.addHandler(message => {
  50213. try {
  50214. if (sizzle(`event[xmlns="${Strophe.NS.PUBSUB}#event"]`, message).length) {
  50215. updateDevicesFromStanza(message);
  50216. updateBundleFromStanza(message);
  50217. }
  50218. } catch (e) {
  50219. _converse.log(e.message, Strophe.LogLevel.ERROR);
  50220. }
  50221. return true;
  50222. }, null, 'message', 'headline');
  50223. }
  50224. function restoreOMEMOSession() {
  50225. if (_.isUndefined(_converse.omemo_store)) {
  50226. const storage = _converse.config.get('storage'),
  50227. id = `converse.omemosession-${_converse.bare_jid}`;
  50228. _converse.omemo_store = new _converse.OMEMOStore({
  50229. 'id': id
  50230. });
  50231. _converse.omemo_store.browserStorage = new Backbone.BrowserStorage[storage](id);
  50232. }
  50233. return _converse.omemo_store.fetchSession();
  50234. }
  50235. function initOMEMO() {
  50236. if (!_converse.config.get('trusted')) {
  50237. return;
  50238. }
  50239. _converse.devicelists = new _converse.DeviceLists();
  50240. const storage = _converse.config.get('storage'),
  50241. id = `converse.devicelists-${_converse.bare_jid}`;
  50242. _converse.devicelists.browserStorage = new Backbone.BrowserStorage[storage](id);
  50243. fetchOwnDevices().then(() => restoreOMEMOSession()).then(() => _converse.omemo_store.publishBundle()).then(() => _converse.emit('OMEMOInitialized')).catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
  50244. }
  50245. async function onOccupantAdded(chatroom, occupant) {
  50246. if (occupant.isSelf() || !chatroom.get('nonanonymous')) {
  50247. return;
  50248. }
  50249. if (chatroom.get('omemo_active')) {
  50250. const supported = await _converse.contactHasOMEMOSupport(occupant.get('jid'));
  50251. if (!supported) {
  50252. chatroom.messages.create({
  50253. 'message': __("%1$s doesn't appear to have a client that supports OMEMO. " + "Encrypted chat will no longer be possible in this grouchat.", occupant.get('nick')),
  50254. 'type': 'error'
  50255. });
  50256. chatroom.save({
  50257. 'omemo_active': false,
  50258. 'omemo_supported': false
  50259. });
  50260. }
  50261. }
  50262. }
  50263. async function checkOMEMOSupported(chatbox) {
  50264. let supported;
  50265. if (chatbox.get('type') === _converse.CHATROOMS_TYPE) {
  50266. supported = chatbox.get('nonanonymous') && chatbox.get('membersonly');
  50267. } else if (chatbox.get('type') === _converse.PRIVATE_CHAT_TYPE) {
  50268. supported = await _converse.contactHasOMEMOSupport(chatbox.get('jid'));
  50269. }
  50270. chatbox.set('omemo_supported', supported);
  50271. }
  50272. _converse.api.waitUntil('chatBoxesInitialized').then(() => _converse.chatboxes.on('add', chatbox => {
  50273. checkOMEMOSupported(chatbox);
  50274. if (chatbox.get('type') === _converse.CHATROOMS_TYPE) {
  50275. chatbox.occupants.on('add', o => onOccupantAdded(chatbox, o));
  50276. chatbox.on('change:nonanonymous', checkOMEMOSupported);
  50277. chatbox.on('change:membersonly', checkOMEMOSupported);
  50278. }
  50279. }));
  50280. _converse.api.listen.on('afterTearDown', () => {
  50281. if (_converse.devicelists) {
  50282. _converse.devicelists.reset();
  50283. }
  50284. delete _converse.omemo_store;
  50285. });
  50286. _converse.api.listen.on('connected', registerPEPPushHandler);
  50287. _converse.api.listen.on('renderToolbar', view => view.renderOMEMOToolbarButton());
  50288. _converse.api.listen.on('statusInitialized', initOMEMO);
  50289. _converse.api.listen.on('addClientFeatures', () => _converse.api.disco.own.features.add(`${Strophe.NS.OMEMO_DEVICELIST}+notify`));
  50290. _converse.api.listen.on('userDetailsModalInitialized', contact => {
  50291. const jid = contact.get('jid');
  50292. _converse.generateFingerprints(jid).catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
  50293. });
  50294. _converse.api.listen.on('profileModalInitialized', contact => {
  50295. _converse.generateFingerprints(_converse.bare_jid).catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
  50296. });
  50297. /************************ BEGIN API ************************/
  50298. _.extend(_converse.api, {
  50299. /**
  50300. * The "omemo" namespace groups methods relevant to OMEMO
  50301. * encryption.
  50302. *
  50303. * @namespace _converse.api.omemo
  50304. * @memberOf _converse.api
  50305. */
  50306. 'omemo': {
  50307. /**
  50308. * The "bundle" namespace groups methods relevant to the user's
  50309. * OMEMO bundle.
  50310. *
  50311. * @namespace _converse.api.omemo.bundle
  50312. * @memberOf _converse.api.omemo
  50313. */
  50314. 'bundle': {
  50315. /**
  50316. * Lets you generate a new OMEMO device bundle
  50317. *
  50318. * @method _converse.api.omemo.bundle.generate
  50319. * @returns {promise} Promise which resolves once we have a result from the server.
  50320. */
  50321. 'generate': async () => {
  50322. // Remove current device
  50323. const devicelist = _converse.devicelists.get(_converse.bare_jid),
  50324. device_id = _converse.omemo_store.get('device_id');
  50325. if (device_id) {
  50326. const device = devicelist.devices.get(device_id);
  50327. _converse.omemo_store.unset(device_id);
  50328. if (device) {
  50329. await new Promise(done => device.destroy({
  50330. 'success': done,
  50331. 'error': done
  50332. }));
  50333. }
  50334. devicelist.devices.trigger('remove');
  50335. } // Generate new bundle and publish
  50336. await _converse.omemo_store.generateBundle();
  50337. await devicelist.publishDevices();
  50338. const device = devicelist.devices.get(_converse.omemo_store.get('device_id'));
  50339. return generateFingerprint(device);
  50340. }
  50341. }
  50342. }
  50343. });
  50344. }
  50345. });
  50346. /***/ }),
  50347. /***/ "./src/converse-profile.js":
  50348. /*!*********************************!*\
  50349. !*** ./src/converse-profile.js ***!
  50350. \*********************************/
  50351. /*! no exports provided */
  50352. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50353. "use strict";
  50354. __webpack_require__.r(__webpack_exports__);
  50355. /* harmony import */ var _converse_headless_converse_vcard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-vcard */ "./src/headless/converse-vcard.js");
  50356. /* harmony import */ var converse_modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! converse-modal */ "./src/converse-modal.js");
  50357. /* harmony import */ var formdata_polyfill__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! formdata-polyfill */ "./node_modules/formdata-polyfill/FormData.js");
  50358. /* harmony import */ var formdata_polyfill__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(formdata_polyfill__WEBPACK_IMPORTED_MODULE_2__);
  50359. /* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap.native/dist/bootstrap-native-v4.js");
  50360. /* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(bootstrap__WEBPACK_IMPORTED_MODULE_3__);
  50361. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  50362. /* harmony import */ var templates_chat_status_modal_html__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! templates/chat_status_modal.html */ "./src/templates/chat_status_modal.html");
  50363. /* harmony import */ var templates_chat_status_modal_html__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(templates_chat_status_modal_html__WEBPACK_IMPORTED_MODULE_5__);
  50364. /* harmony import */ var templates_client_info_modal_html__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! templates/client_info_modal.html */ "./src/templates/client_info_modal.html");
  50365. /* harmony import */ var templates_client_info_modal_html__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(templates_client_info_modal_html__WEBPACK_IMPORTED_MODULE_6__);
  50366. /* harmony import */ var templates_profile_modal_html__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! templates/profile_modal.html */ "./src/templates/profile_modal.html");
  50367. /* harmony import */ var templates_profile_modal_html__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(templates_profile_modal_html__WEBPACK_IMPORTED_MODULE_7__);
  50368. /* harmony import */ var templates_profile_view_html__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! templates/profile_view.html */ "./src/templates/profile_view.html");
  50369. /* harmony import */ var templates_profile_view_html__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(templates_profile_view_html__WEBPACK_IMPORTED_MODULE_8__);
  50370. /* harmony import */ var templates_status_option_html__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! templates/status_option.html */ "./src/templates/status_option.html");
  50371. /* harmony import */ var templates_status_option_html__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(templates_status_option_html__WEBPACK_IMPORTED_MODULE_9__);
  50372. // Converse.js (A browser based XMPP chat client)
  50373. // http://conversejs.org
  50374. //
  50375. // Copyright (c) 2013-2017, Jan-Carel Brand <jc@opkode.com>
  50376. // Licensed under the Mozilla Public License (MPLv2)
  50377. //
  50378. /*global define */
  50379. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_4__["default"].env,
  50380. Strophe = _converse$env.Strophe,
  50381. Backbone = _converse$env.Backbone,
  50382. Promise = _converse$env.Promise,
  50383. utils = _converse$env.utils,
  50384. _ = _converse$env._,
  50385. moment = _converse$env.moment;
  50386. const u = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_4__["default"].env.utils;
  50387. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_4__["default"].plugins.add('converse-profile', {
  50388. dependencies: ["converse-modal", "converse-vcard", "converse-chatboxviews"],
  50389. initialize() {
  50390. /* The initialize function gets called as soon as the plugin is
  50391. * loaded by converse.js's plugin machinery.
  50392. */
  50393. const _converse = this._converse,
  50394. __ = _converse.__;
  50395. _converse.ProfileModal = _converse.BootstrapModal.extend({
  50396. events: {
  50397. 'change input[type="file"': "updateFilePreview",
  50398. 'click .change-avatar': "openFileSelection",
  50399. 'submit .profile-form': 'onFormSubmitted'
  50400. },
  50401. initialize() {
  50402. this.model.on('change', this.render, this);
  50403. _converse.BootstrapModal.prototype.initialize.apply(this, arguments);
  50404. _converse.emit('profileModalInitialized', this.model);
  50405. },
  50406. toHTML() {
  50407. return templates_profile_modal_html__WEBPACK_IMPORTED_MODULE_7___default()(_.extend(this.model.toJSON(), this.model.vcard.toJSON(), {
  50408. '_': _,
  50409. '__': __,
  50410. '_converse': _converse,
  50411. 'alt_avatar': __('Your avatar image'),
  50412. 'heading_profile': __('Your Profile'),
  50413. 'label_close': __('Close'),
  50414. 'label_email': __('Email'),
  50415. 'label_fullname': __('Full Name'),
  50416. 'label_jid': __('XMPP Address (JID)'),
  50417. 'label_nickname': __('Nickname'),
  50418. 'label_role': __('Role'),
  50419. 'label_role_help': __('Use commas to separate multiple roles. Your roles are shown next to your name on your chat messages.'),
  50420. 'label_url': __('URL'),
  50421. 'utils': u,
  50422. 'view': this
  50423. }));
  50424. },
  50425. afterRender() {
  50426. this.tabs = _.map(this.el.querySelectorAll('.nav-item'), tab => new bootstrap__WEBPACK_IMPORTED_MODULE_3___default.a.Tab(tab));
  50427. },
  50428. openFileSelection(ev) {
  50429. ev.preventDefault();
  50430. this.el.querySelector('input[type="file"]').click();
  50431. },
  50432. updateFilePreview(ev) {
  50433. const file = ev.target.files[0],
  50434. reader = new FileReader();
  50435. reader.onloadend = () => {
  50436. this.el.querySelector('.avatar').setAttribute('src', reader.result);
  50437. };
  50438. reader.readAsDataURL(file);
  50439. },
  50440. setVCard(data) {
  50441. _converse.api.vcard.set(_converse.bare_jid, data).then(() => _converse.api.vcard.update(this.model.vcard, true)).catch(err => {
  50442. _converse.log(err, Strophe.LogLevel.FATAL);
  50443. _converse.api.alert.show(Strophe.LogLevel.ERROR, __('Error'), [__("Sorry, an error happened while trying to save your profile data."), __("You can check your browser's developer console for any error output.")]);
  50444. });
  50445. this.modal.hide();
  50446. },
  50447. onFormSubmitted(ev) {
  50448. ev.preventDefault();
  50449. const reader = new FileReader(),
  50450. form_data = new FormData(ev.target),
  50451. image_file = form_data.get('image');
  50452. const data = {
  50453. 'fn': form_data.get('fn'),
  50454. 'nickname': form_data.get('nickname'),
  50455. 'role': form_data.get('role'),
  50456. 'email': form_data.get('email'),
  50457. 'url': form_data.get('url')
  50458. };
  50459. if (!image_file.size) {
  50460. _.extend(data, {
  50461. 'image': this.model.vcard.get('image'),
  50462. 'image_type': this.model.vcard.get('image_type')
  50463. });
  50464. this.setVCard(data);
  50465. } else {
  50466. reader.onloadend = () => {
  50467. _.extend(data, {
  50468. 'image': btoa(reader.result),
  50469. 'image_type': image_file.type
  50470. });
  50471. this.setVCard(data);
  50472. };
  50473. reader.readAsBinaryString(image_file);
  50474. }
  50475. }
  50476. });
  50477. _converse.ChatStatusModal = _converse.BootstrapModal.extend({
  50478. events: {
  50479. "submit form#set-xmpp-status": "onFormSubmitted",
  50480. "click .clear-input": "clearStatusMessage"
  50481. },
  50482. toHTML() {
  50483. return templates_chat_status_modal_html__WEBPACK_IMPORTED_MODULE_5___default()(_.extend(this.model.toJSON(), this.model.vcard.toJSON(), {
  50484. 'label_away': __('Away'),
  50485. 'label_close': __('Close'),
  50486. 'label_busy': __('Busy'),
  50487. 'label_cancel': __('Cancel'),
  50488. 'label_custom_status': __('Custom status'),
  50489. 'label_offline': __('Offline'),
  50490. 'label_online': __('Online'),
  50491. 'label_save': __('Save'),
  50492. 'label_xa': __('Away for long'),
  50493. 'modal_title': __('Change chat status'),
  50494. 'placeholder_status_message': __('Personal status message')
  50495. }));
  50496. },
  50497. afterRender() {
  50498. this.el.addEventListener('shown.bs.modal', () => {
  50499. this.el.querySelector('input[name="status_message"]').focus();
  50500. }, false);
  50501. },
  50502. clearStatusMessage(ev) {
  50503. if (ev && ev.preventDefault) {
  50504. ev.preventDefault();
  50505. u.hideElement(this.el.querySelector('.clear-input'));
  50506. }
  50507. const roster_filter = this.el.querySelector('input[name="status_message"]');
  50508. roster_filter.value = '';
  50509. },
  50510. onFormSubmitted(ev) {
  50511. ev.preventDefault();
  50512. const data = new FormData(ev.target);
  50513. this.model.save({
  50514. 'status_message': data.get('status_message'),
  50515. 'status': data.get('chat_status')
  50516. });
  50517. this.modal.hide();
  50518. }
  50519. });
  50520. _converse.ClientInfoModal = _converse.BootstrapModal.extend({
  50521. toHTML() {
  50522. return templates_client_info_modal_html__WEBPACK_IMPORTED_MODULE_6___default()(_.extend(this.model.toJSON(), this.model.vcard.toJSON(), {
  50523. '__': __,
  50524. 'modal_title': __('About'),
  50525. 'version_name': _converse.VERSION_NAME,
  50526. 'first_subtitle': __('%1$s Open Source %2$s XMPP chat client brought to you by %3$s Opkode %2$s', '<a target="_blank" rel="nofollow" href="https://conversejs.org">', '</a>', '<a target="_blank" rel="nofollow" href="https://opkode.com">'),
  50527. 'second_subtitle': __('%1$s Translate %2$s it into your own language', '<a target="_blank" rel="nofollow" href="https://hosted.weblate.org/projects/conversejs/#languages">', '</a>')
  50528. }));
  50529. }
  50530. });
  50531. _converse.XMPPStatusView = _converse.VDOMViewWithAvatar.extend({
  50532. tagName: "div",
  50533. events: {
  50534. "click a.show-profile": "showProfileModal",
  50535. "click a.change-status": "showStatusChangeModal",
  50536. "click .show-client-info": "showClientInfoModal",
  50537. "click .logout": "logOut"
  50538. },
  50539. initialize() {
  50540. this.model.on("change", this.render, this);
  50541. this.model.vcard.on("change", this.render, this);
  50542. },
  50543. toHTML() {
  50544. const chat_status = this.model.get('status') || 'offline';
  50545. return templates_profile_view_html__WEBPACK_IMPORTED_MODULE_8___default()(_.extend(this.model.toJSON(), this.model.vcard.toJSON(), {
  50546. '__': __,
  50547. 'fullname': this.model.vcard.get('fullname') || _converse.bare_jid,
  50548. 'status_message': this.model.get('status_message') || __("I am %1$s", this.getPrettyStatus(chat_status)),
  50549. 'chat_status': chat_status,
  50550. '_converse': _converse,
  50551. 'title_change_settings': __('Change settings'),
  50552. 'title_change_status': __('Click to change your chat status'),
  50553. 'title_log_out': __('Log out'),
  50554. 'info_details': __('Show details about this chat client'),
  50555. 'title_your_profile': __('Your profile')
  50556. }));
  50557. },
  50558. afterRender() {
  50559. this.renderAvatar();
  50560. },
  50561. showProfileModal(ev) {
  50562. if (_.isUndefined(this.profile_modal)) {
  50563. this.profile_modal = new _converse.ProfileModal({
  50564. model: this.model
  50565. });
  50566. }
  50567. this.profile_modal.show(ev);
  50568. },
  50569. showStatusChangeModal(ev) {
  50570. if (_.isUndefined(this.status_modal)) {
  50571. this.status_modal = new _converse.ChatStatusModal({
  50572. model: this.model
  50573. });
  50574. }
  50575. this.status_modal.show(ev);
  50576. },
  50577. showClientInfoModal(ev) {
  50578. if (_.isUndefined(this.client_info_modal)) {
  50579. this.client_info_modal = new _converse.ClientInfoModal({
  50580. model: this.model
  50581. });
  50582. }
  50583. this.client_info_modal.show(ev);
  50584. },
  50585. logOut(ev) {
  50586. ev.preventDefault();
  50587. const result = confirm(__("Are you sure you want to log out?"));
  50588. if (result === true) {
  50589. _converse.logOut();
  50590. }
  50591. },
  50592. getPrettyStatus(stat) {
  50593. if (stat === 'chat') {
  50594. return __('online');
  50595. } else if (stat === 'dnd') {
  50596. return __('busy');
  50597. } else if (stat === 'xa') {
  50598. return __('away for long');
  50599. } else if (stat === 'away') {
  50600. return __('away');
  50601. } else if (stat === 'offline') {
  50602. return __('offline');
  50603. } else {
  50604. return __(stat) || __('online');
  50605. }
  50606. }
  50607. });
  50608. }
  50609. });
  50610. /***/ }),
  50611. /***/ "./src/converse-push.js":
  50612. /*!******************************!*\
  50613. !*** ./src/converse-push.js ***!
  50614. \******************************/
  50615. /*! no exports provided */
  50616. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50617. "use strict";
  50618. __webpack_require__.r(__webpack_exports__);
  50619. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  50620. // Converse.js
  50621. // https://conversejs.org
  50622. //
  50623. // Copyright (c) 2013-2018, the Converse.js developers
  50624. // Licensed under the Mozilla Public License (MPLv2)
  50625. /* This is a Converse.js plugin which add support for registering
  50626. * an "App Server" as defined in XEP-0357
  50627. */
  50628. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env,
  50629. Strophe = _converse$env.Strophe,
  50630. $iq = _converse$env.$iq,
  50631. _ = _converse$env._;
  50632. Strophe.addNamespace('PUSH', 'urn:xmpp:push:0');
  50633. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins.add('converse-push', {
  50634. initialize() {
  50635. /* The initialize function gets called as soon as the plugin is
  50636. * loaded by converse.js's plugin machinery.
  50637. */
  50638. const _converse = this._converse,
  50639. __ = _converse.__;
  50640. _converse.api.settings.update({
  50641. 'push_app_servers': [],
  50642. 'enable_muc_push': false
  50643. });
  50644. async function disablePushAppServer(domain, push_app_server) {
  50645. if (!push_app_server.jid) {
  50646. return;
  50647. }
  50648. const result = await _converse.api.disco.supports(Strophe.NS.PUSH, domain || _converse.bare_jid);
  50649. if (!result.length) {
  50650. return _converse.log(`Not disabling push app server "${push_app_server.jid}", no disco support from your server.`, Strophe.LogLevel.WARN);
  50651. }
  50652. const stanza = $iq({
  50653. 'type': 'set'
  50654. });
  50655. if (domain !== _converse.bare_jid) {
  50656. stanza.attrs({
  50657. 'to': domain
  50658. });
  50659. }
  50660. stanza.c('disable', {
  50661. 'xmlns': Strophe.NS.PUSH,
  50662. 'jid': push_app_server.jid
  50663. });
  50664. if (push_app_server.node) {
  50665. stanza.attrs({
  50666. 'node': push_app_server.node
  50667. });
  50668. }
  50669. _converse.api.sendIQ(stanza).catch(e => {
  50670. _converse.log(`Could not disable push app server for ${push_app_server.jid}`, Strophe.LogLevel.ERROR);
  50671. _converse.log(e, Strophe.LogLevel.ERROR);
  50672. });
  50673. }
  50674. async function enablePushAppServer(domain, push_app_server) {
  50675. if (!push_app_server.jid || !push_app_server.node) {
  50676. return;
  50677. }
  50678. const identity = await _converse.api.disco.getIdentity('pubsub', 'push', push_app_server.jid);
  50679. if (!identity) {
  50680. return _converse.log(`Not enabling push the service "${push_app_server.jid}", it doesn't have the right disco identtiy.`, Strophe.LogLevel.WARN);
  50681. }
  50682. const result = await Promise.all([_converse.api.disco.supports(Strophe.NS.PUSH, push_app_server.jid), _converse.api.disco.supports(Strophe.NS.PUSH, domain)]);
  50683. if (!result[0].length && !result[1].length) {
  50684. return _converse.log(`Not enabling push app server "${push_app_server.jid}", no disco support from your server.`, Strophe.LogLevel.WARN);
  50685. }
  50686. const stanza = $iq({
  50687. 'type': 'set'
  50688. });
  50689. if (domain !== _converse.bare_jid) {
  50690. stanza.attrs({
  50691. 'to': domain
  50692. });
  50693. }
  50694. stanza.c('enable', {
  50695. 'xmlns': Strophe.NS.PUSH,
  50696. 'jid': push_app_server.jid,
  50697. 'node': push_app_server.node
  50698. });
  50699. if (push_app_server.secret) {
  50700. stanza.c('x', {
  50701. 'xmlns': Strophe.NS.XFORM,
  50702. 'type': 'submit'
  50703. }).c('field', {
  50704. 'var': 'FORM_TYPE'
  50705. }).c('value').t(`${Strophe.NS.PUBSUB}#publish-options`).up().up().c('field', {
  50706. 'var': 'secret'
  50707. }).c('value').t(push_app_server.secret);
  50708. }
  50709. return _converse.api.sendIQ(stanza);
  50710. }
  50711. async function enablePush(domain) {
  50712. domain = domain || _converse.bare_jid;
  50713. const push_enabled = _converse.session.get('push_enabled') || [];
  50714. if (_.includes(push_enabled, domain)) {
  50715. return;
  50716. }
  50717. const enabled_services = _.reject(_converse.push_app_servers, 'disable');
  50718. const disabled_services = _.filter(_converse.push_app_servers, 'disable');
  50719. try {
  50720. const enabled = _.map(enabled_services, _.partial(enablePushAppServer, domain));
  50721. const disabled = _.map(disabled_services, _.partial(disablePushAppServer, domain));
  50722. await Promise.all(enabled.concat(disabled));
  50723. } catch (e) {
  50724. _converse.log('Could not enable or disable push App Server', Strophe.LogLevel.ERROR);
  50725. if (e) _converse.log(e, Strophe.LogLevel.ERROR);
  50726. } finally {
  50727. push_enabled.push(domain);
  50728. }
  50729. _converse.session.save('push_enabled', push_enabled);
  50730. }
  50731. _converse.api.listen.on('statusInitialized', () => enablePush());
  50732. function onChatBoxAdded(model) {
  50733. if (model.get('type') == _converse.CHATROOMS_TYPE) {
  50734. enablePush(Strophe.getDomainFromJid(model.get('jid')));
  50735. }
  50736. }
  50737. if (_converse.enable_muc_push) {
  50738. _converse.api.listen.on('chatBoxesInitialized', () => _converse.chatboxes.on('add', onChatBoxAdded));
  50739. }
  50740. }
  50741. });
  50742. /***/ }),
  50743. /***/ "./src/converse-register.js":
  50744. /*!**********************************!*\
  50745. !*** ./src/converse-register.js ***!
  50746. \**********************************/
  50747. /*! no exports provided */
  50748. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50749. "use strict";
  50750. __webpack_require__.r(__webpack_exports__);
  50751. /* harmony import */ var converse_controlbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! converse-controlbox */ "./src/converse-controlbox.js");
  50752. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  50753. /* harmony import */ var templates_form_input_html__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! templates/form_input.html */ "./src/templates/form_input.html");
  50754. /* harmony import */ var templates_form_input_html__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(templates_form_input_html__WEBPACK_IMPORTED_MODULE_2__);
  50755. /* harmony import */ var templates_form_username_html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! templates/form_username.html */ "./src/templates/form_username.html");
  50756. /* harmony import */ var templates_form_username_html__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(templates_form_username_html__WEBPACK_IMPORTED_MODULE_3__);
  50757. /* harmony import */ var templates_register_link_html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! templates/register_link.html */ "./src/templates/register_link.html");
  50758. /* harmony import */ var templates_register_link_html__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(templates_register_link_html__WEBPACK_IMPORTED_MODULE_4__);
  50759. /* harmony import */ var templates_register_panel_html__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! templates/register_panel.html */ "./src/templates/register_panel.html");
  50760. /* harmony import */ var templates_register_panel_html__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(templates_register_panel_html__WEBPACK_IMPORTED_MODULE_5__);
  50761. /* harmony import */ var templates_registration_form_html__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! templates/registration_form.html */ "./src/templates/registration_form.html");
  50762. /* harmony import */ var templates_registration_form_html__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(templates_registration_form_html__WEBPACK_IMPORTED_MODULE_6__);
  50763. /* harmony import */ var templates_registration_request_html__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! templates/registration_request.html */ "./src/templates/registration_request.html");
  50764. /* harmony import */ var templates_registration_request_html__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(templates_registration_request_html__WEBPACK_IMPORTED_MODULE_7__);
  50765. /* harmony import */ var templates_spinner_html__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! templates/spinner.html */ "./src/templates/spinner.html");
  50766. /* harmony import */ var templates_spinner_html__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(templates_spinner_html__WEBPACK_IMPORTED_MODULE_8__);
  50767. /* harmony import */ var _converse_headless_utils_form__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @converse/headless/utils/form */ "./src/headless/utils/form.js");
  50768. // Converse.js (A browser based XMPP chat client)
  50769. // http://conversejs.org
  50770. //
  50771. // Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
  50772. // Licensed under the Mozilla Public License (MPLv2)
  50773. //
  50774. /*global define */
  50775. /* This is a Converse.js plugin which add support for in-band registration
  50776. * as specified in XEP-0077.
  50777. */
  50778. // Strophe methods for building stanzas
  50779. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].env,
  50780. Strophe = _converse$env.Strophe,
  50781. Backbone = _converse$env.Backbone,
  50782. sizzle = _converse$env.sizzle,
  50783. $iq = _converse$env.$iq,
  50784. _ = _converse$env._; // Add Strophe Namespaces
  50785. Strophe.addNamespace('REGISTER', 'jabber:iq:register'); // Add Strophe Statuses
  50786. let i = 0;
  50787. _.each(_.keys(Strophe.Status), function (key) {
  50788. i = Math.max(i, Strophe.Status[key]);
  50789. });
  50790. Strophe.Status.REGIFAIL = i + 1;
  50791. Strophe.Status.REGISTERED = i + 2;
  50792. Strophe.Status.CONFLICT = i + 3;
  50793. Strophe.Status.NOTACCEPTABLE = i + 5;
  50794. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].plugins.add('converse-register', {
  50795. 'overrides': {
  50796. // Overrides mentioned here will be picked up by converse.js's
  50797. // plugin architecture they will replace existing methods on the
  50798. // relevant objects or classes.
  50799. //
  50800. // New functions which don't exist yet can also be added.
  50801. LoginPanel: {
  50802. insertRegisterLink() {
  50803. const _converse = this.__super__._converse;
  50804. if (_.isUndefined(this.registerlinkview)) {
  50805. this.registerlinkview = new _converse.RegisterLinkView({
  50806. 'model': this.model
  50807. });
  50808. this.registerlinkview.render();
  50809. this.el.querySelector('.buttons').insertAdjacentElement('afterend', this.registerlinkview.el);
  50810. }
  50811. this.registerlinkview.render();
  50812. },
  50813. render(cfg) {
  50814. const _converse = this.__super__._converse;
  50815. this.__super__.render.apply(this, arguments);
  50816. if (_converse.allow_registration && !_converse.auto_login) {
  50817. this.insertRegisterLink();
  50818. }
  50819. return this;
  50820. }
  50821. },
  50822. ControlBoxView: {
  50823. initialize() {
  50824. this.__super__.initialize.apply(this, arguments);
  50825. this.model.on('change:active-form', this.showLoginOrRegisterForm.bind(this));
  50826. },
  50827. showLoginOrRegisterForm() {
  50828. const _converse = this.__super__._converse;
  50829. if (_.isNil(this.registerpanel)) {
  50830. return;
  50831. }
  50832. if (this.model.get('active-form') == "register") {
  50833. this.loginpanel.el.classList.add('hidden');
  50834. this.registerpanel.el.classList.remove('hidden');
  50835. } else {
  50836. this.loginpanel.el.classList.remove('hidden');
  50837. this.registerpanel.el.classList.add('hidden');
  50838. }
  50839. },
  50840. renderRegistrationPanel() {
  50841. const _converse = this.__super__._converse;
  50842. if (_converse.allow_registration) {
  50843. this.registerpanel = new _converse.RegisterPanel({
  50844. 'model': this.model
  50845. });
  50846. this.registerpanel.render();
  50847. this.registerpanel.el.classList.add('hidden');
  50848. this.el.querySelector('#converse-login-panel').insertAdjacentElement('afterend', this.registerpanel.el);
  50849. this.showLoginOrRegisterForm();
  50850. }
  50851. return this;
  50852. },
  50853. renderLoginPanel() {
  50854. /* Also render a registration panel, when rendering the
  50855. * login panel.
  50856. */
  50857. this.__super__.renderLoginPanel.apply(this, arguments);
  50858. this.renderRegistrationPanel();
  50859. return this;
  50860. }
  50861. }
  50862. },
  50863. initialize() {
  50864. /* The initialize function gets called as soon as the plugin is
  50865. * loaded by converse.js's plugin machinery.
  50866. */
  50867. const _converse = this._converse,
  50868. __ = _converse.__;
  50869. _converse.CONNECTION_STATUS[Strophe.Status.REGIFAIL] = 'REGIFAIL';
  50870. _converse.CONNECTION_STATUS[Strophe.Status.REGISTERED] = 'REGISTERED';
  50871. _converse.CONNECTION_STATUS[Strophe.Status.CONFLICT] = 'CONFLICT';
  50872. _converse.CONNECTION_STATUS[Strophe.Status.NOTACCEPTABLE] = 'NOTACCEPTABLE';
  50873. _converse.api.settings.update({
  50874. 'allow_registration': true,
  50875. 'domain_placeholder': __(" e.g. conversejs.org"),
  50876. // Placeholder text shown in the domain input on the registration form
  50877. 'providers_link': 'https://compliance.conversations.im/',
  50878. // Link to XMPP providers shown on registration page
  50879. 'registration_domain': ''
  50880. });
  50881. function setActiveForm(value) {
  50882. _converse.api.waitUntil('controlboxInitialized').then(() => {
  50883. const controlbox = _converse.chatboxes.get('controlbox');
  50884. controlbox.set({
  50885. 'active-form': value
  50886. });
  50887. }).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
  50888. }
  50889. _converse.router.route('converse/login', _.partial(setActiveForm, 'login'));
  50890. _converse.router.route('converse/register', _.partial(setActiveForm, 'register'));
  50891. _converse.RegisterLinkView = Backbone.VDOMView.extend({
  50892. toHTML() {
  50893. return templates_register_link_html__WEBPACK_IMPORTED_MODULE_4___default()(_.extend(this.model.toJSON(), {
  50894. '__': _converse.__,
  50895. '_converse': _converse,
  50896. 'connection_status': _converse.connfeedback.get('connection_status')
  50897. }));
  50898. }
  50899. });
  50900. _converse.RegisterPanel = Backbone.NativeView.extend({
  50901. tagName: 'div',
  50902. id: "converse-register-panel",
  50903. className: 'controlbox-pane fade-in',
  50904. events: {
  50905. 'submit form#converse-register': 'onFormSubmission',
  50906. 'click .button-cancel': 'renderProviderChoiceForm'
  50907. },
  50908. initialize(cfg) {
  50909. this.reset();
  50910. this.registerHooks();
  50911. },
  50912. render() {
  50913. this.model.set('registration_form_rendered', false);
  50914. this.el.innerHTML = templates_register_panel_html__WEBPACK_IMPORTED_MODULE_5___default()({
  50915. '__': __,
  50916. 'default_domain': _converse.registration_domain,
  50917. 'label_register': __('Fetch registration form'),
  50918. 'help_providers': __('Tip: A list of public XMPP providers is available'),
  50919. 'help_providers_link': __('here'),
  50920. 'href_providers': _converse.providers_link,
  50921. 'domain_placeholder': _converse.domain_placeholder
  50922. });
  50923. if (_converse.registration_domain) {
  50924. this.fetchRegistrationForm(_converse.registration_domain);
  50925. }
  50926. return this;
  50927. },
  50928. registerHooks() {
  50929. /* Hook into Strophe's _connect_cb, so that we can send an IQ
  50930. * requesting the registration fields.
  50931. */
  50932. const conn = _converse.connection;
  50933. const connect_cb = conn._connect_cb.bind(conn);
  50934. conn._connect_cb = (req, callback, raw) => {
  50935. if (!this._registering) {
  50936. connect_cb(req, callback, raw);
  50937. } else {
  50938. if (this.getRegistrationFields(req, callback, raw)) {
  50939. this._registering = false;
  50940. }
  50941. }
  50942. };
  50943. },
  50944. getRegistrationFields(req, _callback, raw) {
  50945. /* Send an IQ stanza to the XMPP server asking for the
  50946. * registration fields.
  50947. * Parameters:
  50948. * (Strophe.Request) req - The current request
  50949. * (Function) callback
  50950. */
  50951. const conn = _converse.connection;
  50952. conn.connected = true;
  50953. const body = conn._proto._reqToData(req);
  50954. if (!body) {
  50955. return;
  50956. }
  50957. if (conn._proto._connect_cb(body) === Strophe.Status.CONNFAIL) {
  50958. this.showValidationError(__("Sorry, we're unable to connect to your chosen provider."));
  50959. return false;
  50960. }
  50961. const register = body.getElementsByTagName("register");
  50962. const mechanisms = body.getElementsByTagName("mechanism");
  50963. if (register.length === 0 && mechanisms.length === 0) {
  50964. conn._proto._no_auth_received(_callback);
  50965. return false;
  50966. }
  50967. if (register.length === 0) {
  50968. conn._changeConnectStatus(Strophe.Status.REGIFAIL);
  50969. this.showValidationError(__("Sorry, the given provider does not support in " + "band account registration. Please try with a " + "different provider."));
  50970. return true;
  50971. } // Send an IQ stanza to get all required data fields
  50972. conn._addSysHandler(this.onRegistrationFields.bind(this), null, "iq", null, null);
  50973. const stanza = $iq({
  50974. type: "get"
  50975. }).c("query", {
  50976. xmlns: Strophe.NS.REGISTER
  50977. }).tree();
  50978. stanza.setAttribute("id", conn.getUniqueId("sendIQ"));
  50979. conn.send(stanza);
  50980. conn.connected = false;
  50981. return true;
  50982. },
  50983. onRegistrationFields(stanza) {
  50984. /* Handler for Registration Fields Request.
  50985. *
  50986. * Parameters:
  50987. * (XMLElement) elem - The query stanza.
  50988. */
  50989. if (stanza.getAttribute("type") === "error") {
  50990. _converse.connection._changeConnectStatus(Strophe.Status.REGIFAIL, __('Something went wrong while establishing a connection with "%1$s". ' + 'Are you sure it exists?', this.domain));
  50991. return false;
  50992. }
  50993. if (stanza.getElementsByTagName("query").length !== 1) {
  50994. _converse.connection._changeConnectStatus(Strophe.Status.REGIFAIL, "unknown");
  50995. return false;
  50996. }
  50997. this.setFields(stanza);
  50998. if (!this.model.get('registration_form_rendered')) {
  50999. this.renderRegistrationForm(stanza);
  51000. }
  51001. return false;
  51002. },
  51003. reset(settings) {
  51004. const defaults = {
  51005. fields: {},
  51006. urls: [],
  51007. title: "",
  51008. instructions: "",
  51009. registered: false,
  51010. _registering: false,
  51011. domain: null,
  51012. form_type: null
  51013. };
  51014. _.extend(this, defaults);
  51015. if (settings) {
  51016. _.extend(this, _.pick(settings, _.keys(defaults)));
  51017. }
  51018. },
  51019. onFormSubmission(ev) {
  51020. /* Event handler when the #converse-register form is
  51021. * submitted.
  51022. *
  51023. * Depending on the available input fields, we delegate to
  51024. * other methods.
  51025. */
  51026. if (ev && ev.preventDefault) {
  51027. ev.preventDefault();
  51028. }
  51029. if (_.isNull(ev.target.querySelector('input[name=domain]'))) {
  51030. this.submitRegistrationForm(ev.target);
  51031. } else {
  51032. this.onProviderChosen(ev.target);
  51033. }
  51034. },
  51035. onProviderChosen(form) {
  51036. /* Callback method that gets called when the user has chosen an
  51037. * XMPP provider.
  51038. *
  51039. * Parameters:
  51040. * (HTMLElement) form - The form that was submitted
  51041. */
  51042. const domain_input = form.querySelector('input[name=domain]'),
  51043. domain = _.get(domain_input, 'value');
  51044. if (!domain) {
  51045. // TODO: add validation message
  51046. domain_input.classList.add('error');
  51047. return;
  51048. }
  51049. form.querySelector('input[type=submit]').classList.add('hidden');
  51050. this.fetchRegistrationForm(domain.trim());
  51051. },
  51052. fetchRegistrationForm(domain_name) {
  51053. /* This is called with a domain name based on which, it fetches a
  51054. * registration form from the requested domain.
  51055. *
  51056. * Parameters:
  51057. * (String) domain_name - XMPP server domain
  51058. */
  51059. if (!this.model.get('registration_form_rendered')) {
  51060. this.renderRegistrationRequest();
  51061. }
  51062. this.reset({
  51063. 'domain': Strophe.getDomainFromJid(domain_name),
  51064. '_registering': true
  51065. });
  51066. _converse.connection.connect(this.domain, "", this.onConnectStatusChanged.bind(this));
  51067. return false;
  51068. },
  51069. renderRegistrationRequest() {
  51070. /* Clear the form and inform the user that the registration
  51071. * form is being fetched.
  51072. */
  51073. this.clearRegistrationForm().insertAdjacentHTML('beforeend', templates_registration_request_html__WEBPACK_IMPORTED_MODULE_7___default()({
  51074. '__': _converse.__,
  51075. 'cancel': _converse.registration_domain
  51076. }));
  51077. },
  51078. giveFeedback(message, klass) {
  51079. let feedback = this.el.querySelector('.reg-feedback');
  51080. if (!_.isNull(feedback)) {
  51081. feedback.parentNode.removeChild(feedback);
  51082. }
  51083. const form = this.el.querySelector('form');
  51084. form.insertAdjacentHTML('afterbegin', '<span class="reg-feedback"></span>');
  51085. feedback = form.querySelector('.reg-feedback');
  51086. feedback.textContent = message;
  51087. if (klass) {
  51088. feedback.classList.add(klass);
  51089. }
  51090. },
  51091. clearRegistrationForm() {
  51092. const form = this.el.querySelector('form');
  51093. form.innerHTML = '';
  51094. this.model.set('registration_form_rendered', false);
  51095. return form;
  51096. },
  51097. showSpinner() {
  51098. const form = this.el.querySelector('form');
  51099. form.innerHTML = templates_spinner_html__WEBPACK_IMPORTED_MODULE_8___default()();
  51100. this.model.set('registration_form_rendered', false);
  51101. return this;
  51102. },
  51103. onConnectStatusChanged(status_code) {
  51104. /* Callback function called by Strophe whenever the
  51105. * connection status changes.
  51106. *
  51107. * Passed to Strophe specifically during a registration
  51108. * attempt.
  51109. *
  51110. * Parameters:
  51111. * (Integer) status_code - The Stroph.Status status code
  51112. */
  51113. _converse.log('converse-register: onConnectStatusChanged');
  51114. if (_.includes([Strophe.Status.DISCONNECTED, Strophe.Status.CONNFAIL, Strophe.Status.REGIFAIL, Strophe.Status.NOTACCEPTABLE, Strophe.Status.CONFLICT], status_code)) {
  51115. _converse.log(`Problem during registration: Strophe.Status is ${_converse.CONNECTION_STATUS[status_code]}`, Strophe.LogLevel.ERROR);
  51116. this.abortRegistration();
  51117. } else if (status_code === Strophe.Status.REGISTERED) {
  51118. _converse.log("Registered successfully.");
  51119. _converse.connection.reset();
  51120. this.showSpinner();
  51121. if (_.includes(["converse/login", "converse/register"], Backbone.history.getFragment())) {
  51122. _converse.router.navigate('', {
  51123. 'replace': true
  51124. });
  51125. }
  51126. if (this.fields.password && this.fields.username) {
  51127. // automatically log the user in
  51128. _converse.connection.connect(this.fields.username.toLowerCase() + '@' + this.domain.toLowerCase(), this.fields.password, _converse.onConnectStatusChanged);
  51129. this.giveFeedback(__('Now logging you in'), 'info');
  51130. } else {
  51131. _converse.chatboxviews.get('controlbox').renderLoginPanel();
  51132. _converse.giveFeedback(__('Registered successfully'));
  51133. }
  51134. this.reset();
  51135. }
  51136. },
  51137. renderLegacyRegistrationForm(form) {
  51138. _.each(_.keys(this.fields), key => {
  51139. if (key === "username") {
  51140. form.insertAdjacentHTML('beforeend', templates_form_username_html__WEBPACK_IMPORTED_MODULE_3___default()({
  51141. 'domain': ` @${this.domain}`,
  51142. 'name': key,
  51143. 'type': "text",
  51144. 'label': key,
  51145. 'value': '',
  51146. 'required': true
  51147. }));
  51148. } else {
  51149. form.insertAdjacentHTML('beforeend', templates_form_input_html__WEBPACK_IMPORTED_MODULE_2___default()({
  51150. 'label': key,
  51151. 'name': key,
  51152. 'placeholder': key,
  51153. 'required': true,
  51154. 'type': key === 'password' || key === 'email' ? key : "text",
  51155. 'value': ''
  51156. }));
  51157. }
  51158. }); // Show urls
  51159. _.each(this.urls, url => {
  51160. form.insertAdjacentHTML('afterend', '<a target="blank" rel="noopener" href="' + url + '">' + url + '</a>');
  51161. });
  51162. },
  51163. renderRegistrationForm(stanza) {
  51164. /* Renders the registration form based on the XForm fields
  51165. * received from the XMPP server.
  51166. *
  51167. * Parameters:
  51168. * (XMLElement) stanza - The IQ stanza received from the XMPP server.
  51169. */
  51170. const form = this.el.querySelector('form');
  51171. form.innerHTML = templates_registration_form_html__WEBPACK_IMPORTED_MODULE_6___default()({
  51172. '__': _converse.__,
  51173. 'domain': this.domain,
  51174. 'title': this.title,
  51175. 'instructions': this.instructions,
  51176. 'registration_domain': _converse.registration_domain
  51177. });
  51178. const buttons = form.querySelector('fieldset.buttons');
  51179. if (this.form_type === 'xform') {
  51180. _.each(stanza.querySelectorAll('field'), field => {
  51181. buttons.insertAdjacentHTML('beforebegin', _converse_headless_utils_form__WEBPACK_IMPORTED_MODULE_9__["default"].xForm2webForm(field, stanza, this.domain));
  51182. });
  51183. } else {
  51184. this.renderLegacyRegistrationForm(form);
  51185. }
  51186. if (!this.fields) {
  51187. form.querySelector('.button-primary').classList.add('hidden');
  51188. }
  51189. form.classList.remove('hidden');
  51190. this.model.set('registration_form_rendered', true);
  51191. },
  51192. showValidationError(message) {
  51193. const form = this.el.querySelector('form');
  51194. let flash = form.querySelector('.form-errors');
  51195. if (_.isNull(flash)) {
  51196. flash = '<div class="form-errors hidden"></div>';
  51197. const instructions = form.querySelector('p.instructions');
  51198. if (_.isNull(instructions)) {
  51199. form.insertAdjacentHTML('afterbegin', flash);
  51200. } else {
  51201. instructions.insertAdjacentHTML('afterend', flash);
  51202. }
  51203. flash = form.querySelector('.form-errors');
  51204. } else {
  51205. flash.innerHTML = '';
  51206. }
  51207. flash.insertAdjacentHTML('beforeend', '<p class="form-help error">' + message + '</p>');
  51208. flash.classList.remove('hidden');
  51209. },
  51210. reportErrors(stanza) {
  51211. /* Report back to the user any error messages received from the
  51212. * XMPP server after attempted registration.
  51213. *
  51214. * Parameters:
  51215. * (XMLElement) stanza - The IQ stanza received from the
  51216. * XMPP server.
  51217. */
  51218. const errors = stanza.querySelectorAll('error');
  51219. _.each(errors, error => {
  51220. this.showValidationError(error.textContent);
  51221. });
  51222. if (!errors.length) {
  51223. const message = __('The provider rejected your registration attempt. ' + 'Please check the values you entered for correctness.');
  51224. this.showValidationError(message);
  51225. }
  51226. },
  51227. renderProviderChoiceForm(ev) {
  51228. if (ev && ev.preventDefault) {
  51229. ev.preventDefault();
  51230. }
  51231. _converse.connection._proto._abortAllRequests();
  51232. _converse.connection.reset();
  51233. this.render();
  51234. },
  51235. abortRegistration() {
  51236. _converse.connection._proto._abortAllRequests();
  51237. _converse.connection.reset();
  51238. if (this.model.get('registration_form_rendered')) {
  51239. if (_converse.registration_domain && this.model.get('registration_form_rendered')) {
  51240. this.fetchRegistrationForm(_converse.registration_domain);
  51241. }
  51242. } else {
  51243. this.render();
  51244. }
  51245. },
  51246. submitRegistrationForm(form) {
  51247. /* Handler, when the user submits the registration form.
  51248. * Provides form error feedback or starts the registration
  51249. * process.
  51250. *
  51251. * Parameters:
  51252. * (HTMLElement) form - The HTML form that was submitted
  51253. */
  51254. const has_empty_inputs = _.reduce(this.el.querySelectorAll('input.required'), function (result, input) {
  51255. if (input.value === '') {
  51256. input.classList.add('error');
  51257. return result + 1;
  51258. }
  51259. return result;
  51260. }, 0);
  51261. if (has_empty_inputs) {
  51262. return;
  51263. }
  51264. const inputs = sizzle(':input:not([type=button]):not([type=submit])', form),
  51265. iq = $iq({
  51266. 'type': 'set',
  51267. 'id': _converse.connection.getUniqueId()
  51268. }).c("query", {
  51269. xmlns: Strophe.NS.REGISTER
  51270. });
  51271. if (this.form_type === 'xform') {
  51272. iq.c("x", {
  51273. xmlns: Strophe.NS.XFORM,
  51274. type: 'submit'
  51275. });
  51276. _.each(inputs, input => {
  51277. iq.cnode(_converse_headless_utils_form__WEBPACK_IMPORTED_MODULE_9__["default"].webForm2xForm(input)).up();
  51278. });
  51279. } else {
  51280. _.each(inputs, input => {
  51281. iq.c(input.getAttribute('name'), {}, input.value);
  51282. });
  51283. }
  51284. _converse.connection._addSysHandler(this._onRegisterIQ.bind(this), null, "iq", null, null);
  51285. _converse.connection.send(iq);
  51286. this.setFields(iq.tree());
  51287. },
  51288. setFields(stanza) {
  51289. /* Stores the values that will be sent to the XMPP server
  51290. * during attempted registration.
  51291. *
  51292. * Parameters:
  51293. * (XMLElement) stanza - the IQ stanza that will be sent to the XMPP server.
  51294. */
  51295. const query = stanza.querySelector('query');
  51296. const xform = sizzle(`x[xmlns="${Strophe.NS.XFORM}"]`, query);
  51297. if (xform.length > 0) {
  51298. this._setFieldsFromXForm(xform.pop());
  51299. } else {
  51300. this._setFieldsFromLegacy(query);
  51301. }
  51302. },
  51303. _setFieldsFromLegacy(query) {
  51304. _.each(query.children, field => {
  51305. if (field.tagName.toLowerCase() === 'instructions') {
  51306. this.instructions = Strophe.getText(field);
  51307. return;
  51308. } else if (field.tagName.toLowerCase() === 'x') {
  51309. if (field.getAttribute('xmlns') === 'jabber:x:oob') {
  51310. this.urls.concat(_.map(field.querySelectorAll('url'), 'textContent'));
  51311. }
  51312. return;
  51313. }
  51314. this.fields[field.tagName.toLowerCase()] = Strophe.getText(field);
  51315. });
  51316. this.form_type = 'legacy';
  51317. },
  51318. _setFieldsFromXForm(xform) {
  51319. this.title = _.get(xform.querySelector('title'), 'textContent');
  51320. this.instructions = _.get(xform.querySelector('instructions'), 'textContent');
  51321. _.each(xform.querySelectorAll('field'), field => {
  51322. const _var = field.getAttribute('var');
  51323. if (_var) {
  51324. this.fields[_var.toLowerCase()] = _.get(field.querySelector('value'), 'textContent', '');
  51325. } else {
  51326. // TODO: other option seems to be type="fixed"
  51327. _converse.log("Found field we couldn't parse", Strophe.LogLevel.WARN);
  51328. }
  51329. });
  51330. this.form_type = 'xform';
  51331. },
  51332. _onRegisterIQ(stanza) {
  51333. /* Callback method that gets called when a return IQ stanza
  51334. * is received from the XMPP server, after attempting to
  51335. * register a new user.
  51336. *
  51337. * Parameters:
  51338. * (XMLElement) stanza - The IQ stanza.
  51339. */
  51340. if (stanza.getAttribute("type") === "error") {
  51341. _converse.log("Registration failed.", Strophe.LogLevel.ERROR);
  51342. this.reportErrors(stanza);
  51343. let error = stanza.getElementsByTagName("error");
  51344. if (error.length !== 1) {
  51345. _converse.connection._changeConnectStatus(Strophe.Status.REGIFAIL, "unknown");
  51346. return false;
  51347. }
  51348. error = error[0].firstChild.tagName.toLowerCase();
  51349. if (error === 'conflict') {
  51350. _converse.connection._changeConnectStatus(Strophe.Status.CONFLICT, error);
  51351. } else if (error === 'not-acceptable') {
  51352. _converse.connection._changeConnectStatus(Strophe.Status.NOTACCEPTABLE, error);
  51353. } else {
  51354. _converse.connection._changeConnectStatus(Strophe.Status.REGIFAIL, error);
  51355. }
  51356. } else {
  51357. _converse.connection._changeConnectStatus(Strophe.Status.REGISTERED, null);
  51358. }
  51359. return false;
  51360. }
  51361. });
  51362. }
  51363. });
  51364. /***/ }),
  51365. /***/ "./src/converse-roomslist.js":
  51366. /*!***********************************!*\
  51367. !*** ./src/converse-roomslist.js ***!
  51368. \***********************************/
  51369. /*! no exports provided */
  51370. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51371. "use strict";
  51372. __webpack_require__.r(__webpack_exports__);
  51373. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  51374. /* harmony import */ var _converse_headless_converse_muc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless/converse-muc */ "./src/headless/converse-muc.js");
  51375. /* harmony import */ var templates_rooms_list_html__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! templates/rooms_list.html */ "./src/templates/rooms_list.html");
  51376. /* harmony import */ var templates_rooms_list_html__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(templates_rooms_list_html__WEBPACK_IMPORTED_MODULE_2__);
  51377. /* harmony import */ var templates_rooms_list_item_html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! templates/rooms_list_item.html */ "./src/templates/rooms_list_item.html");
  51378. /* harmony import */ var templates_rooms_list_item_html__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(templates_rooms_list_item_html__WEBPACK_IMPORTED_MODULE_3__);
  51379. // Converse.js (A browser based XMPP chat client)
  51380. // http://conversejs.org
  51381. //
  51382. // Copyright (c) 2013-2018, Jan-Carel Brand <jc@opkode.com>
  51383. // Licensed under the Mozilla Public License (MPLv2)
  51384. /* This is a non-core Converse.js plugin which shows a list of currently open
  51385. * rooms in the "Rooms Panel" of the ControlBox.
  51386. */
  51387. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env,
  51388. Backbone = _converse$env.Backbone,
  51389. Promise = _converse$env.Promise,
  51390. Strophe = _converse$env.Strophe,
  51391. b64_sha1 = _converse$env.b64_sha1,
  51392. sizzle = _converse$env.sizzle,
  51393. _ = _converse$env._;
  51394. const u = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env.utils;
  51395. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins.add('converse-roomslist', {
  51396. /* Optional dependencies are other plugins which might be
  51397. * overridden or relied upon, and therefore need to be loaded before
  51398. * this plugin. They are called "optional" because they might not be
  51399. * available, in which case any overrides applicable to them will be
  51400. * ignored.
  51401. *
  51402. * It's possible however to make optional dependencies non-optional.
  51403. * If the setting "strict_plugin_dependencies" is set to true,
  51404. * an error will be raised if the plugin is not found.
  51405. *
  51406. * NB: These plugins need to have already been loaded via require.js.
  51407. */
  51408. dependencies: ["converse-singleton", "converse-controlbox", "converse-muc", "converse-bookmarks"],
  51409. initialize() {
  51410. /* The initialize function gets called as soon as the plugin is
  51411. * loaded by converse.js's plugin machinery.
  51412. */
  51413. const _converse = this._converse,
  51414. __ = _converse.__; // Promises exposed by this plugin
  51415. _converse.api.promises.add('roomsListInitialized');
  51416. _converse.OpenRooms = Backbone.Collection.extend({
  51417. comparator(room) {
  51418. if (room.get('bookmarked')) {
  51419. const bookmark = _.head(_converse.bookmarksview.model.where({
  51420. 'jid': room.get('jid')
  51421. }));
  51422. return bookmark.get('name');
  51423. } else {
  51424. return room.get('name');
  51425. }
  51426. },
  51427. initialize() {
  51428. _converse.chatboxes.on('add', this.onChatBoxAdded, this);
  51429. _converse.chatboxes.on('change:hidden', this.onChatBoxChanged, this);
  51430. _converse.chatboxes.on('change:bookmarked', this.onChatBoxChanged, this);
  51431. _converse.chatboxes.on('change:name', this.onChatBoxChanged, this);
  51432. _converse.chatboxes.on('change:num_unread', this.onChatBoxChanged, this);
  51433. _converse.chatboxes.on('change:num_unread_general', this.onChatBoxChanged, this);
  51434. _converse.chatboxes.on('remove', this.onChatBoxRemoved, this);
  51435. this.reset(_.map(_converse.chatboxes.where({
  51436. 'type': 'chatroom'
  51437. }), 'attributes'));
  51438. },
  51439. onChatBoxAdded(item) {
  51440. if (item.get('type') === 'chatroom') {
  51441. this.create(item.attributes);
  51442. }
  51443. },
  51444. onChatBoxChanged(item) {
  51445. if (item.get('type') === 'chatroom') {
  51446. const room = this.get(item.get('jid'));
  51447. if (!_.isNil(room)) {
  51448. room.set(item.attributes);
  51449. }
  51450. }
  51451. },
  51452. onChatBoxRemoved(item) {
  51453. if (item.get('type') === 'chatroom') {
  51454. const room = this.get(item.get('jid'));
  51455. this.remove(room);
  51456. }
  51457. }
  51458. });
  51459. _converse.RoomsList = Backbone.Model.extend({
  51460. defaults: {
  51461. "toggle-state": _converse.OPENED
  51462. }
  51463. });
  51464. _converse.RoomsListElementView = Backbone.VDOMView.extend({
  51465. events: {
  51466. 'click .room-info': 'showRoomDetailsModal'
  51467. },
  51468. initialize() {
  51469. this.model.on('destroy', this.remove, this);
  51470. this.model.on('remove', this.remove, this);
  51471. this.model.on('change:bookmarked', this.render, this);
  51472. this.model.on('change:hidden', this.render, this);
  51473. this.model.on('change:name', this.render, this);
  51474. this.model.on('change:num_unread', this.render, this);
  51475. this.model.on('change:num_unread_general', this.render, this);
  51476. },
  51477. toHTML() {
  51478. return templates_rooms_list_item_html__WEBPACK_IMPORTED_MODULE_3___default()(_.extend(this.model.toJSON(), {
  51479. // XXX: By the time this renders, the _converse.bookmarks
  51480. // collection should already exist if bookmarks are
  51481. // supported by the XMPP server. So we can use it
  51482. // as a check for support (other ways of checking are async).
  51483. 'allow_bookmarks': _converse.allow_bookmarks && _converse.bookmarks,
  51484. 'currently_open': _converse.isUniView() && !this.model.get('hidden'),
  51485. 'info_leave_room': __('Leave this groupchat'),
  51486. 'info_remove_bookmark': __('Unbookmark this groupchat'),
  51487. 'info_add_bookmark': __('Bookmark this groupchat'),
  51488. 'info_title': __('Show more information on this groupchat'),
  51489. 'name': this.getRoomsListElementName(),
  51490. 'open_title': __('Click to open this groupchat')
  51491. }));
  51492. },
  51493. showRoomDetailsModal(ev) {
  51494. const room = _converse.chatboxes.get(this.model.get('jid'));
  51495. ev.preventDefault();
  51496. if (_.isUndefined(room.room_details_modal)) {
  51497. room.room_details_modal = new _converse.RoomDetailsModal({
  51498. 'model': room
  51499. });
  51500. }
  51501. room.room_details_modal.show(ev);
  51502. },
  51503. getRoomsListElementName() {
  51504. if (this.model.get('bookmarked') && _converse.bookmarksview) {
  51505. const bookmark = _.head(_converse.bookmarksview.model.where({
  51506. 'jid': this.model.get('jid')
  51507. }));
  51508. return bookmark.get('name');
  51509. } else {
  51510. return this.model.get('name');
  51511. }
  51512. }
  51513. });
  51514. _converse.RoomsListView = Backbone.OrderedListView.extend({
  51515. tagName: 'div',
  51516. className: 'open-rooms-list list-container rooms-list-container',
  51517. events: {
  51518. 'click .add-bookmark': 'addBookmark',
  51519. 'click .close-room': 'closeRoom',
  51520. 'click .list-toggle': 'toggleRoomsList',
  51521. 'click .remove-bookmark': 'removeBookmark',
  51522. 'click .open-room': 'openRoom'
  51523. },
  51524. listSelector: '.rooms-list',
  51525. ItemView: _converse.RoomsListElementView,
  51526. subviewIndex: 'jid',
  51527. initialize() {
  51528. Backbone.OrderedListView.prototype.initialize.apply(this, arguments);
  51529. this.model.on('add', this.showOrHide, this);
  51530. this.model.on('remove', this.showOrHide, this);
  51531. const storage = _converse.config.get('storage'),
  51532. id = b64_sha1(`converse.roomslist${_converse.bare_jid}`);
  51533. this.list_model = new _converse.RoomsList({
  51534. 'id': id
  51535. });
  51536. this.list_model.browserStorage = new Backbone.BrowserStorage[storage](id);
  51537. this.list_model.fetch();
  51538. this.render();
  51539. this.sortAndPositionAllItems();
  51540. },
  51541. render() {
  51542. this.el.innerHTML = templates_rooms_list_html__WEBPACK_IMPORTED_MODULE_2___default()({
  51543. 'toggle_state': this.list_model.get('toggle-state'),
  51544. 'desc_rooms': __('Click to toggle the list of open groupchats'),
  51545. 'label_rooms': __('Open Groupchats'),
  51546. '_converse': _converse
  51547. });
  51548. if (this.list_model.get('toggle-state') !== _converse.OPENED) {
  51549. this.el.querySelector('.open-rooms-list').classList.add('collapsed');
  51550. }
  51551. this.showOrHide();
  51552. this.insertIntoControlBox();
  51553. return this;
  51554. },
  51555. insertIntoControlBox() {
  51556. const controlboxview = _converse.chatboxviews.get('controlbox');
  51557. if (!_.isUndefined(controlboxview) && !u.rootContains(_converse.root, this.el)) {
  51558. const el = controlboxview.el.querySelector('.open-rooms-list');
  51559. if (!_.isNull(el)) {
  51560. el.parentNode.replaceChild(this.el, el);
  51561. }
  51562. }
  51563. },
  51564. hide() {
  51565. u.hideElement(this.el);
  51566. },
  51567. show() {
  51568. u.showElement(this.el);
  51569. },
  51570. openRoom(ev) {
  51571. ev.preventDefault();
  51572. const name = ev.target.textContent;
  51573. const jid = ev.target.getAttribute('data-room-jid');
  51574. const data = {
  51575. 'name': name || Strophe.unescapeNode(Strophe.getNodeFromJid(jid)) || jid
  51576. };
  51577. _converse.api.rooms.open(jid, data);
  51578. },
  51579. closeRoom(ev) {
  51580. ev.preventDefault();
  51581. const name = ev.target.getAttribute('data-room-name');
  51582. const jid = ev.target.getAttribute('data-room-jid');
  51583. if (confirm(__("Are you sure you want to leave the groupchat %1$s?", name))) {
  51584. // TODO: replace with API call
  51585. _converse.chatboxviews.get(jid).close();
  51586. }
  51587. },
  51588. showOrHide(item) {
  51589. if (!this.model.models.length) {
  51590. u.hideElement(this.el);
  51591. } else {
  51592. u.showElement(this.el);
  51593. }
  51594. },
  51595. removeBookmark: _converse.removeBookmarkViaEvent,
  51596. addBookmark: _converse.addBookmarkViaEvent,
  51597. toggleRoomsList(ev) {
  51598. if (ev && ev.preventDefault) {
  51599. ev.preventDefault();
  51600. }
  51601. const icon_el = ev.target.querySelector('.fa');
  51602. if (icon_el.classList.contains("fa-caret-down")) {
  51603. u.slideIn(this.el.querySelector('.open-rooms-list')).then(() => {
  51604. this.list_model.save({
  51605. 'toggle-state': _converse.CLOSED
  51606. });
  51607. icon_el.classList.remove("fa-caret-down");
  51608. icon_el.classList.add("fa-caret-right");
  51609. });
  51610. } else {
  51611. u.slideOut(this.el.querySelector('.open-rooms-list')).then(() => {
  51612. this.list_model.save({
  51613. 'toggle-state': _converse.OPENED
  51614. });
  51615. icon_el.classList.remove("fa-caret-right");
  51616. icon_el.classList.add("fa-caret-down");
  51617. });
  51618. }
  51619. }
  51620. });
  51621. const initRoomsListView = function initRoomsListView() {
  51622. const storage = _converse.config.get('storage'),
  51623. id = b64_sha1(`converse.open-rooms-{_converse.bare_jid}`),
  51624. model = new _converse.OpenRooms();
  51625. model.browserStorage = new Backbone.BrowserStorage[storage](id);
  51626. _converse.rooms_list_view = new _converse.RoomsListView({
  51627. 'model': model
  51628. });
  51629. _converse.api.emit('roomsListInitialized');
  51630. };
  51631. if (_converse.allow_bookmarks) {
  51632. _converse.api.waitUntil('bookmarksInitialized').then(initRoomsListView);
  51633. } else {
  51634. u.onMultipleEvents([{
  51635. 'object': _converse,
  51636. 'event': 'chatBoxesInitialized'
  51637. }, {
  51638. 'object': _converse,
  51639. 'event': 'roomsPanelRendered'
  51640. }], initRoomsListView);
  51641. }
  51642. _converse.api.listen.on('reconnected', initRoomsListView);
  51643. }
  51644. });
  51645. /***/ }),
  51646. /***/ "./src/converse-rosterview.js":
  51647. /*!************************************!*\
  51648. !*** ./src/converse-rosterview.js ***!
  51649. \************************************/
  51650. /*! no exports provided */
  51651. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51652. "use strict";
  51653. __webpack_require__.r(__webpack_exports__);
  51654. /* harmony import */ var _converse_headless_converse_roster__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-roster */ "./src/headless/converse-roster.js");
  51655. /* harmony import */ var _converse_headless_converse_chatboxes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless/converse-chatboxes */ "./src/headless/converse-chatboxes.js");
  51656. /* harmony import */ var converse_modal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! converse-modal */ "./src/converse-modal.js");
  51657. /* harmony import */ var awesomplete__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! awesomplete */ "./node_modules/awesomplete-avoid-xss/awesomplete.js");
  51658. /* harmony import */ var awesomplete__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(awesomplete__WEBPACK_IMPORTED_MODULE_3__);
  51659. /* harmony import */ var formdata_polyfill__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! formdata-polyfill */ "./node_modules/formdata-polyfill/FormData.js");
  51660. /* harmony import */ var formdata_polyfill__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(formdata_polyfill__WEBPACK_IMPORTED_MODULE_4__);
  51661. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  51662. /* harmony import */ var templates_add_contact_modal_html__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! templates/add_contact_modal.html */ "./src/templates/add_contact_modal.html");
  51663. /* harmony import */ var templates_add_contact_modal_html__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(templates_add_contact_modal_html__WEBPACK_IMPORTED_MODULE_6__);
  51664. /* harmony import */ var templates_group_header_html__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! templates/group_header.html */ "./src/templates/group_header.html");
  51665. /* harmony import */ var templates_group_header_html__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(templates_group_header_html__WEBPACK_IMPORTED_MODULE_7__);
  51666. /* harmony import */ var templates_pending_contact_html__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! templates/pending_contact.html */ "./src/templates/pending_contact.html");
  51667. /* harmony import */ var templates_pending_contact_html__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(templates_pending_contact_html__WEBPACK_IMPORTED_MODULE_8__);
  51668. /* harmony import */ var templates_requesting_contact_html__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! templates/requesting_contact.html */ "./src/templates/requesting_contact.html");
  51669. /* harmony import */ var templates_requesting_contact_html__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(templates_requesting_contact_html__WEBPACK_IMPORTED_MODULE_9__);
  51670. /* harmony import */ var templates_roster_html__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! templates/roster.html */ "./src/templates/roster.html");
  51671. /* harmony import */ var templates_roster_html__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(templates_roster_html__WEBPACK_IMPORTED_MODULE_10__);
  51672. /* harmony import */ var templates_roster_filter_html__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! templates/roster_filter.html */ "./src/templates/roster_filter.html");
  51673. /* harmony import */ var templates_roster_filter_html__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(templates_roster_filter_html__WEBPACK_IMPORTED_MODULE_11__);
  51674. /* harmony import */ var templates_roster_item_html__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! templates/roster_item.html */ "./src/templates/roster_item.html");
  51675. /* harmony import */ var templates_roster_item_html__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(templates_roster_item_html__WEBPACK_IMPORTED_MODULE_12__);
  51676. /* harmony import */ var templates_search_contact_html__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! templates/search_contact.html */ "./src/templates/search_contact.html");
  51677. /* harmony import */ var templates_search_contact_html__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(templates_search_contact_html__WEBPACK_IMPORTED_MODULE_13__);
  51678. // Converse.js
  51679. // http://conversejs.org
  51680. //
  51681. // Copyright (c) 2013-2018, the Converse.js developers
  51682. // Licensed under the Mozilla Public License (MPLv2)
  51683. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__["default"].env,
  51684. Backbone = _converse$env.Backbone,
  51685. Strophe = _converse$env.Strophe,
  51686. $iq = _converse$env.$iq,
  51687. b64_sha1 = _converse$env.b64_sha1,
  51688. sizzle = _converse$env.sizzle,
  51689. _ = _converse$env._;
  51690. const u = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__["default"].env.utils;
  51691. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_5__["default"].plugins.add('converse-rosterview', {
  51692. dependencies: ["converse-roster", "converse-modal"],
  51693. overrides: {
  51694. // Overrides mentioned here will be picked up by converse.js's
  51695. // plugin architecture they will replace existing methods on the
  51696. // relevant objects or classes.
  51697. //
  51698. // New functions which don't exist yet can also be added.
  51699. afterReconnected() {
  51700. this.__super__.afterReconnected.apply(this, arguments);
  51701. },
  51702. tearDown() {
  51703. /* Remove the rosterview when tearing down. It gets created
  51704. * anew when reconnecting or logging in.
  51705. */
  51706. this.__super__.tearDown.apply(this, arguments);
  51707. if (!_.isUndefined(this.rosterview)) {
  51708. this.rosterview.remove();
  51709. }
  51710. },
  51711. RosterGroups: {
  51712. comparator() {
  51713. // RosterGroupsComparator only gets set later (once i18n is
  51714. // set up), so we need to wrap it in this nameless function.
  51715. const _converse = this.__super__._converse;
  51716. return _converse.RosterGroupsComparator.apply(this, arguments);
  51717. }
  51718. }
  51719. },
  51720. initialize() {
  51721. /* The initialize function gets called as soon as the plugin is
  51722. * loaded by converse.js's plugin machinery.
  51723. */
  51724. const _converse = this._converse,
  51725. __ = _converse.__;
  51726. _converse.api.settings.update({
  51727. 'allow_chat_pending_contacts': true,
  51728. 'allow_contact_removal': true,
  51729. 'hide_offline_users': false,
  51730. 'roster_groups': true,
  51731. 'show_only_online_users': false,
  51732. 'show_toolbar': true,
  51733. 'xhr_user_search_url': null
  51734. });
  51735. _converse.api.promises.add('rosterViewInitialized');
  51736. const STATUSES = {
  51737. 'dnd': __('This contact is busy'),
  51738. 'online': __('This contact is online'),
  51739. 'offline': __('This contact is offline'),
  51740. 'unavailable': __('This contact is unavailable'),
  51741. 'xa': __('This contact is away for an extended period'),
  51742. 'away': __('This contact is away')
  51743. };
  51744. const LABEL_GROUPS = __('Groups');
  51745. const HEADER_CURRENT_CONTACTS = __('My contacts');
  51746. const HEADER_PENDING_CONTACTS = __('Pending contacts');
  51747. const HEADER_REQUESTING_CONTACTS = __('Contact requests');
  51748. const HEADER_UNGROUPED = __('Ungrouped');
  51749. const HEADER_WEIGHTS = {};
  51750. HEADER_WEIGHTS[HEADER_REQUESTING_CONTACTS] = 0;
  51751. HEADER_WEIGHTS[HEADER_CURRENT_CONTACTS] = 1;
  51752. HEADER_WEIGHTS[HEADER_UNGROUPED] = 2;
  51753. HEADER_WEIGHTS[HEADER_PENDING_CONTACTS] = 3;
  51754. _converse.RosterGroupsComparator = function (a, b) {
  51755. /* Groups are sorted alphabetically, ignoring case.
  51756. * However, Ungrouped, Requesting Contacts and Pending Contacts
  51757. * appear last and in that order.
  51758. */
  51759. a = a.get('name');
  51760. b = b.get('name');
  51761. const special_groups = _.keys(HEADER_WEIGHTS);
  51762. const a_is_special = _.includes(special_groups, a);
  51763. const b_is_special = _.includes(special_groups, b);
  51764. if (!a_is_special && !b_is_special) {
  51765. return a.toLowerCase() < b.toLowerCase() ? -1 : a.toLowerCase() > b.toLowerCase() ? 1 : 0;
  51766. } else if (a_is_special && b_is_special) {
  51767. return HEADER_WEIGHTS[a] < HEADER_WEIGHTS[b] ? -1 : HEADER_WEIGHTS[a] > HEADER_WEIGHTS[b] ? 1 : 0;
  51768. } else if (!a_is_special && b_is_special) {
  51769. return b === HEADER_REQUESTING_CONTACTS ? 1 : -1;
  51770. } else if (a_is_special && !b_is_special) {
  51771. return a === HEADER_REQUESTING_CONTACTS ? -1 : 1;
  51772. }
  51773. };
  51774. _converse.AddContactModal = _converse.BootstrapModal.extend({
  51775. events: {
  51776. 'submit form': 'addContactFromForm'
  51777. },
  51778. initialize() {
  51779. _converse.BootstrapModal.prototype.initialize.apply(this, arguments);
  51780. this.model.on('change', this.render, this);
  51781. },
  51782. toHTML() {
  51783. const label_nickname = _converse.xhr_user_search_url ? __('Contact name') : __('Optional nickname');
  51784. return templates_add_contact_modal_html__WEBPACK_IMPORTED_MODULE_6___default()(_.extend(this.model.toJSON(), {
  51785. '_converse': _converse,
  51786. 'heading_new_contact': __('Add a Contact'),
  51787. 'label_xmpp_address': __('XMPP Address'),
  51788. 'label_nickname': label_nickname,
  51789. 'contact_placeholder': __('name@example.org'),
  51790. 'label_add': __('Add'),
  51791. 'error_message': __('Please enter a valid XMPP address')
  51792. }));
  51793. },
  51794. afterRender() {
  51795. if (_converse.xhr_user_search_url && _.isString(_converse.xhr_user_search_url)) {
  51796. this.initXHRAutoComplete(this.el);
  51797. } else {
  51798. this.initJIDAutoComplete(this.el);
  51799. }
  51800. const jid_input = this.el.querySelector('input[name="jid"]');
  51801. this.el.addEventListener('shown.bs.modal', () => {
  51802. jid_input.focus();
  51803. }, false);
  51804. },
  51805. initJIDAutoComplete(root) {
  51806. const jid_input = root.querySelector('input[name="jid"]');
  51807. const list = _.uniq(_converse.roster.map(item => Strophe.getDomainFromJid(item.get('jid'))));
  51808. new awesomplete__WEBPACK_IMPORTED_MODULE_3___default.a(jid_input, {
  51809. 'list': list,
  51810. 'data': function data(text, input) {
  51811. return input.slice(0, input.indexOf("@")) + "@" + text;
  51812. },
  51813. 'filter': awesomplete__WEBPACK_IMPORTED_MODULE_3___default.a.FILTER_STARTSWITH
  51814. });
  51815. },
  51816. initXHRAutoComplete(root) {
  51817. const name_input = this.el.querySelector('input[name="name"]');
  51818. const jid_input = this.el.querySelector('input[name="jid"]');
  51819. const awesomplete = new awesomplete__WEBPACK_IMPORTED_MODULE_3___default.a(name_input, {
  51820. 'minChars': 1,
  51821. 'list': []
  51822. });
  51823. const xhr = new window.XMLHttpRequest(); // `open` must be called after `onload` for mock/testing purposes.
  51824. xhr.onload = function () {
  51825. if (xhr.responseText) {
  51826. awesomplete.list = JSON.parse(xhr.responseText).map(i => {
  51827. //eslint-disable-line arrow-body-style
  51828. return {
  51829. 'label': i.fullname || i.jid,
  51830. 'value': i.jid
  51831. };
  51832. });
  51833. awesomplete.evaluate();
  51834. }
  51835. };
  51836. name_input.addEventListener('input', _.debounce(() => {
  51837. xhr.open("GET", `${_converse.xhr_user_search_url}q=${name_input.value}`, true);
  51838. xhr.send();
  51839. }, 300));
  51840. this.el.addEventListener('awesomplete-selectcomplete', ev => {
  51841. jid_input.value = ev.text.value;
  51842. name_input.value = ev.text.label;
  51843. });
  51844. },
  51845. addContactFromForm(ev) {
  51846. ev.preventDefault();
  51847. const data = new FormData(ev.target),
  51848. jid = data.get('jid'),
  51849. name = data.get('name');
  51850. if (!jid || _.compact(jid.split('@')).length < 2) {
  51851. // XXX: we have to do this manually, instead of via
  51852. // toHTML because Awesomplete messes things up and
  51853. // confuses Snabbdom
  51854. u.addClass('is-invalid', this.el.querySelector('input[name="jid"]'));
  51855. u.addClass('d-block', this.el.querySelector('.invalid-feedback'));
  51856. } else {
  51857. ev.target.reset();
  51858. _converse.roster.addAndSubscribe(jid, name);
  51859. this.model.clear();
  51860. this.modal.hide();
  51861. }
  51862. }
  51863. });
  51864. _converse.RosterFilter = Backbone.Model.extend({
  51865. initialize() {
  51866. this.set({
  51867. 'filter_text': '',
  51868. 'filter_type': 'contacts',
  51869. 'chat_state': ''
  51870. });
  51871. }
  51872. });
  51873. _converse.RosterFilterView = Backbone.VDOMView.extend({
  51874. tagName: 'form',
  51875. className: 'roster-filter-form',
  51876. events: {
  51877. "keydown .roster-filter": "liveFilter",
  51878. "submit form.roster-filter-form": "submitFilter",
  51879. "click .clear-input": "clearFilter",
  51880. "click .filter-by span": "changeTypeFilter",
  51881. "change .state-type": "changeChatStateFilter"
  51882. },
  51883. initialize() {
  51884. this.model.on('change:filter_type', this.render, this);
  51885. this.model.on('change:filter_text', this.render, this);
  51886. },
  51887. toHTML() {
  51888. return templates_roster_filter_html__WEBPACK_IMPORTED_MODULE_11___default()(_.extend(this.model.toJSON(), {
  51889. visible: this.shouldBeVisible(),
  51890. placeholder: __('Filter'),
  51891. title_contact_filter: __('Filter by contact name'),
  51892. title_group_filter: __('Filter by group name'),
  51893. title_status_filter: __('Filter by status'),
  51894. label_any: __('Any'),
  51895. label_unread_messages: __('Unread'),
  51896. label_online: __('Online'),
  51897. label_chatty: __('Chatty'),
  51898. label_busy: __('Busy'),
  51899. label_away: __('Away'),
  51900. label_xa: __('Extended Away'),
  51901. label_offline: __('Offline')
  51902. }));
  51903. },
  51904. changeChatStateFilter(ev) {
  51905. if (ev && ev.preventDefault) {
  51906. ev.preventDefault();
  51907. }
  51908. this.model.save({
  51909. 'chat_state': this.el.querySelector('.state-type').value
  51910. });
  51911. },
  51912. changeTypeFilter(ev) {
  51913. if (ev && ev.preventDefault) {
  51914. ev.preventDefault();
  51915. }
  51916. const type = ev.target.dataset.type;
  51917. if (type === 'state') {
  51918. this.model.save({
  51919. 'filter_type': type,
  51920. 'chat_state': this.el.querySelector('.state-type').value
  51921. });
  51922. } else {
  51923. this.model.save({
  51924. 'filter_type': type,
  51925. 'filter_text': this.el.querySelector('.roster-filter').value
  51926. });
  51927. }
  51928. },
  51929. liveFilter: _.debounce(function (ev) {
  51930. this.model.save({
  51931. 'filter_text': this.el.querySelector('.roster-filter').value
  51932. });
  51933. }, 250),
  51934. submitFilter(ev) {
  51935. if (ev && ev.preventDefault) {
  51936. ev.preventDefault();
  51937. }
  51938. this.liveFilter();
  51939. this.render();
  51940. },
  51941. isActive() {
  51942. /* Returns true if the filter is enabled (i.e. if the user
  51943. * has added values to the filter).
  51944. */
  51945. if (this.model.get('filter_type') === 'state' || this.model.get('filter_text')) {
  51946. return true;
  51947. }
  51948. return false;
  51949. },
  51950. shouldBeVisible() {
  51951. return _converse.roster.length >= 5 || this.isActive();
  51952. },
  51953. showOrHide() {
  51954. if (this.shouldBeVisible()) {
  51955. this.show();
  51956. } else {
  51957. this.hide();
  51958. }
  51959. },
  51960. show() {
  51961. if (u.isVisible(this.el)) {
  51962. return this;
  51963. }
  51964. this.el.classList.add('fade-in');
  51965. this.el.classList.remove('hidden');
  51966. return this;
  51967. },
  51968. hide() {
  51969. if (!u.isVisible(this.el)) {
  51970. return this;
  51971. }
  51972. this.model.save({
  51973. 'filter_text': '',
  51974. 'chat_state': ''
  51975. });
  51976. this.el.classList.add('hidden');
  51977. return this;
  51978. },
  51979. clearFilter(ev) {
  51980. if (ev && ev.preventDefault) {
  51981. ev.preventDefault();
  51982. u.hideElement(this.el.querySelector('.clear-input'));
  51983. }
  51984. const roster_filter = this.el.querySelector('.roster-filter');
  51985. roster_filter.value = '';
  51986. this.model.save({
  51987. 'filter_text': ''
  51988. });
  51989. }
  51990. });
  51991. _converse.RosterContactView = Backbone.NativeView.extend({
  51992. tagName: 'li',
  51993. className: 'list-item d-flex hidden controlbox-padded',
  51994. events: {
  51995. "click .accept-xmpp-request": "acceptRequest",
  51996. "click .decline-xmpp-request": "declineRequest",
  51997. "click .open-chat": "openChat",
  51998. "click .remove-xmpp-contact": "removeContact"
  51999. },
  52000. initialize() {
  52001. this.model.on("change", this.render, this);
  52002. this.model.on("highlight", this.highlight, this);
  52003. this.model.on("destroy", this.remove, this);
  52004. this.model.on("open", this.openChat, this);
  52005. this.model.on("remove", this.remove, this);
  52006. this.model.presence.on("change:show", this.render, this);
  52007. this.model.vcard.on('change:fullname', this.render, this);
  52008. },
  52009. render() {
  52010. const that = this;
  52011. if (!this.mayBeShown()) {
  52012. u.hideElement(this.el);
  52013. return this;
  52014. }
  52015. const ask = this.model.get('ask'),
  52016. show = this.model.presence.get('show'),
  52017. requesting = this.model.get('requesting'),
  52018. subscription = this.model.get('subscription');
  52019. const classes_to_remove = ['current-xmpp-contact', 'pending-xmpp-contact', 'requesting-xmpp-contact'].concat(_.keys(STATUSES));
  52020. _.each(classes_to_remove, function (cls) {
  52021. if (_.includes(that.el.className, cls)) {
  52022. that.el.classList.remove(cls);
  52023. }
  52024. });
  52025. this.el.classList.add(show);
  52026. this.el.setAttribute('data-status', show);
  52027. this.highlight();
  52028. if (_converse.isUniView()) {
  52029. const chatbox = _converse.chatboxes.get(this.model.get('jid'));
  52030. if (chatbox) {
  52031. if (chatbox.get('hidden')) {
  52032. this.el.classList.remove('open');
  52033. } else {
  52034. this.el.classList.add('open');
  52035. }
  52036. }
  52037. }
  52038. if (ask === 'subscribe' || subscription === 'from') {
  52039. /* ask === 'subscribe'
  52040. * Means we have asked to subscribe to them.
  52041. *
  52042. * subscription === 'from'
  52043. * They are subscribed to use, but not vice versa.
  52044. * We assume that there is a pending subscription
  52045. * from us to them (otherwise we're in a state not
  52046. * supported by converse.js).
  52047. *
  52048. * So in both cases the user is a "pending" contact.
  52049. */
  52050. const display_name = this.model.getDisplayName();
  52051. this.el.classList.add('pending-xmpp-contact');
  52052. this.el.innerHTML = templates_pending_contact_html__WEBPACK_IMPORTED_MODULE_8___default()(_.extend(this.model.toJSON(), {
  52053. 'display_name': display_name,
  52054. 'desc_remove': __('Click to remove %1$s as a contact', display_name),
  52055. 'allow_chat_pending_contacts': _converse.allow_chat_pending_contacts
  52056. }));
  52057. } else if (requesting === true) {
  52058. const display_name = this.model.getDisplayName();
  52059. this.el.classList.add('requesting-xmpp-contact');
  52060. this.el.innerHTML = templates_requesting_contact_html__WEBPACK_IMPORTED_MODULE_9___default()(_.extend(this.model.toJSON(), {
  52061. 'display_name': display_name,
  52062. 'desc_accept': __("Click to accept the contact request from %1$s", display_name),
  52063. 'desc_decline': __("Click to decline the contact request from %1$s", display_name),
  52064. 'allow_chat_pending_contacts': _converse.allow_chat_pending_contacts
  52065. }));
  52066. } else if (subscription === 'both' || subscription === 'to') {
  52067. this.el.classList.add('current-xmpp-contact');
  52068. this.el.classList.remove(_.without(['both', 'to'], subscription)[0]);
  52069. this.el.classList.add(subscription);
  52070. this.renderRosterItem(this.model);
  52071. }
  52072. return this;
  52073. },
  52074. highlight() {
  52075. /* If appropriate, highlight the contact (by adding the 'open' class).
  52076. */
  52077. if (_converse.isUniView()) {
  52078. const chatbox = _converse.chatboxes.get(this.model.get('jid'));
  52079. if (chatbox) {
  52080. if (chatbox.get('hidden')) {
  52081. this.el.classList.remove('open');
  52082. } else {
  52083. this.el.classList.add('open');
  52084. }
  52085. }
  52086. }
  52087. },
  52088. renderRosterItem(item) {
  52089. let status_icon = 'fa fa-times-circle';
  52090. const show = item.presence.get('show') || 'offline';
  52091. if (show === 'online') {
  52092. status_icon = 'fa fa-circle chat-status chat-status--online';
  52093. } else if (show === 'away') {
  52094. status_icon = 'fa fa-circle chat-status chat-status--away';
  52095. } else if (show === 'xa') {
  52096. status_icon = 'far fa-circle chat-status';
  52097. } else if (show === 'dnd') {
  52098. status_icon = 'fa fa-minus-circle chat-status chat-status--busy';
  52099. }
  52100. const display_name = item.getDisplayName();
  52101. this.el.innerHTML = templates_roster_item_html__WEBPACK_IMPORTED_MODULE_12___default()(_.extend(item.toJSON(), {
  52102. 'display_name': display_name,
  52103. 'desc_status': STATUSES[show],
  52104. 'status_icon': status_icon,
  52105. 'desc_chat': __('Click to chat with %1$s (JID: %2$s)', display_name, item.get('jid')),
  52106. 'desc_remove': __('Click to remove %1$s as a contact', display_name),
  52107. 'allow_contact_removal': _converse.allow_contact_removal,
  52108. 'num_unread': item.get('num_unread') || 0
  52109. }));
  52110. return this;
  52111. },
  52112. mayBeShown() {
  52113. /* Return a boolean indicating whether this contact should
  52114. * generally be visible in the roster.
  52115. *
  52116. * It doesn't check for the more specific case of whether
  52117. * the group it's in is collapsed.
  52118. */
  52119. const chatStatus = this.model.presence.get('show');
  52120. if (_converse.show_only_online_users && chatStatus !== 'online' || _converse.hide_offline_users && chatStatus === 'offline') {
  52121. // If pending or requesting, show
  52122. if (this.model.get('ask') === 'subscribe' || this.model.get('subscription') === 'from' || this.model.get('requesting') === true) {
  52123. return true;
  52124. }
  52125. return false;
  52126. }
  52127. return true;
  52128. },
  52129. openChat(ev) {
  52130. if (ev && ev.preventDefault) {
  52131. ev.preventDefault();
  52132. }
  52133. const attrs = this.model.attributes;
  52134. _converse.api.chats.open(attrs.jid, attrs);
  52135. },
  52136. async removeContact(ev) {
  52137. if (ev && ev.preventDefault) {
  52138. ev.preventDefault();
  52139. }
  52140. if (!_converse.allow_contact_removal) {
  52141. return;
  52142. }
  52143. if (!confirm(__("Are you sure you want to remove this contact?"))) {
  52144. return;
  52145. }
  52146. let iq;
  52147. try {
  52148. iq = await this.model.removeFromRoster();
  52149. this.remove();
  52150. if (this.model.collection) {
  52151. // The model might have already been removed as
  52152. // result of a roster push.
  52153. this.model.destroy();
  52154. }
  52155. } catch (e) {
  52156. _converse.log(e, Strophe.LogLevel.ERROR);
  52157. _converse.api.alert.show(Strophe.LogLevel.ERROR, __('Sorry, there was an error while trying to remove %1$s as a contact.', name));
  52158. }
  52159. },
  52160. async acceptRequest(ev) {
  52161. if (ev && ev.preventDefault) {
  52162. ev.preventDefault();
  52163. }
  52164. await _converse.roster.sendContactAddIQ(this.model.get('jid'), this.model.getFullname(), []);
  52165. this.model.authorize().subscribe();
  52166. },
  52167. declineRequest(ev) {
  52168. if (ev && ev.preventDefault) {
  52169. ev.preventDefault();
  52170. }
  52171. const result = confirm(__("Are you sure you want to decline this contact request?"));
  52172. if (result === true) {
  52173. this.model.unauthorize().destroy();
  52174. }
  52175. return this;
  52176. }
  52177. });
  52178. _converse.RosterGroupView = Backbone.OrderedListView.extend({
  52179. tagName: 'div',
  52180. className: 'roster-group hidden',
  52181. events: {
  52182. "click a.group-toggle": "toggle"
  52183. },
  52184. ItemView: _converse.RosterContactView,
  52185. listItems: 'model.contacts',
  52186. listSelector: '.roster-group-contacts',
  52187. sortEvent: 'presenceChanged',
  52188. initialize() {
  52189. Backbone.OrderedListView.prototype.initialize.apply(this, arguments);
  52190. this.model.contacts.on("change:subscription", this.onContactSubscriptionChange, this);
  52191. this.model.contacts.on("change:requesting", this.onContactRequestChange, this);
  52192. this.model.contacts.on("remove", this.onRemove, this);
  52193. _converse.roster.on('change:groups', this.onContactGroupChange, this); // This event gets triggered once *all* contacts (i.e. not
  52194. // just this group's) have been fetched from browser
  52195. // storage or the XMPP server and once they've been
  52196. // assigned to their various groups.
  52197. _converse.rosterview.on('rosterContactsFetchedAndProcessed', this.sortAndPositionAllItems.bind(this));
  52198. },
  52199. render() {
  52200. this.el.setAttribute('data-group', this.model.get('name'));
  52201. this.el.innerHTML = templates_group_header_html__WEBPACK_IMPORTED_MODULE_7___default()({
  52202. 'label_group': this.model.get('name'),
  52203. 'desc_group_toggle': this.model.get('description'),
  52204. 'toggle_state': this.model.get('state'),
  52205. '_converse': _converse
  52206. });
  52207. this.contacts_el = this.el.querySelector('.roster-group-contacts');
  52208. return this;
  52209. },
  52210. show() {
  52211. u.showElement(this.el);
  52212. _.each(this.getAll(), contact_view => {
  52213. if (contact_view.mayBeShown() && this.model.get('state') === _converse.OPENED) {
  52214. u.showElement(contact_view.el);
  52215. }
  52216. });
  52217. return this;
  52218. },
  52219. collapse() {
  52220. return u.slideIn(this.contacts_el);
  52221. },
  52222. filterOutContacts(contacts = []) {
  52223. /* Given a list of contacts, make sure they're filtered out
  52224. * (aka hidden) and that all other contacts are visible.
  52225. *
  52226. * If all contacts are hidden, then also hide the group
  52227. * title.
  52228. */
  52229. let shown = 0;
  52230. const all_contact_views = this.getAll();
  52231. _.each(this.model.contacts.models, contact => {
  52232. const contact_view = this.get(contact.get('id'));
  52233. if (_.includes(contacts, contact)) {
  52234. u.hideElement(contact_view.el);
  52235. } else if (contact_view.mayBeShown()) {
  52236. u.showElement(contact_view.el);
  52237. shown += 1;
  52238. }
  52239. });
  52240. if (shown) {
  52241. u.showElement(this.el);
  52242. } else {
  52243. u.hideElement(this.el);
  52244. }
  52245. },
  52246. getFilterMatches(q, type) {
  52247. /* Given the filter query "q" and the filter type "type",
  52248. * return a list of contacts that need to be filtered out.
  52249. */
  52250. if (q.length === 0) {
  52251. return [];
  52252. }
  52253. let matches;
  52254. q = q.toLowerCase();
  52255. if (type === 'state') {
  52256. if (this.model.get('name') === HEADER_REQUESTING_CONTACTS) {
  52257. // When filtering by chat state, we still want to
  52258. // show requesting contacts, even though they don't
  52259. // have the state in question.
  52260. matches = this.model.contacts.filter(contact => !_.includes(contact.presence.get('show'), q) && !contact.get('requesting'));
  52261. } else if (q === 'unread_messages') {
  52262. matches = this.model.contacts.filter({
  52263. 'num_unread': 0
  52264. });
  52265. } else {
  52266. matches = this.model.contacts.filter(contact => !_.includes(contact.presence.get('show'), q));
  52267. }
  52268. } else {
  52269. matches = this.model.contacts.filter(contact => {
  52270. return !_.includes(contact.getDisplayName().toLowerCase(), q.toLowerCase());
  52271. });
  52272. }
  52273. return matches;
  52274. },
  52275. filter(q, type) {
  52276. /* Filter the group's contacts based on the query "q".
  52277. *
  52278. * If all contacts are filtered out (i.e. hidden), then the
  52279. * group must be filtered out as well.
  52280. */
  52281. if (_.isNil(q)) {
  52282. type = type || _converse.rosterview.filter_view.model.get('filter_type');
  52283. if (type === 'state') {
  52284. q = _converse.rosterview.filter_view.model.get('chat_state');
  52285. } else {
  52286. q = _converse.rosterview.filter_view.model.get('filter_text');
  52287. }
  52288. }
  52289. this.filterOutContacts(this.getFilterMatches(q, type));
  52290. },
  52291. async toggle(ev) {
  52292. if (ev && ev.preventDefault) {
  52293. ev.preventDefault();
  52294. }
  52295. const icon_el = ev.target.querySelector('.fa');
  52296. if (_.includes(icon_el.classList, "fa-caret-down")) {
  52297. this.model.save({
  52298. state: _converse.CLOSED
  52299. });
  52300. await this.collapse();
  52301. icon_el.classList.remove("fa-caret-down");
  52302. icon_el.classList.add("fa-caret-right");
  52303. } else {
  52304. icon_el.classList.remove("fa-caret-right");
  52305. icon_el.classList.add("fa-caret-down");
  52306. this.model.save({
  52307. state: _converse.OPENED
  52308. });
  52309. this.filter();
  52310. u.showElement(this.el);
  52311. u.slideOut(this.contacts_el);
  52312. }
  52313. },
  52314. onContactGroupChange(contact) {
  52315. const in_this_group = _.includes(contact.get('groups'), this.model.get('name'));
  52316. const cid = contact.get('id');
  52317. const in_this_overview = !this.get(cid);
  52318. if (in_this_group && !in_this_overview) {
  52319. this.items.trigger('add', contact);
  52320. } else if (!in_this_group) {
  52321. this.removeContact(contact);
  52322. }
  52323. },
  52324. onContactSubscriptionChange(contact) {
  52325. if (this.model.get('name') === HEADER_PENDING_CONTACTS && contact.get('subscription') !== 'from') {
  52326. this.removeContact(contact);
  52327. }
  52328. },
  52329. onContactRequestChange(contact) {
  52330. if (this.model.get('name') === HEADER_REQUESTING_CONTACTS && !contact.get('requesting')) {
  52331. this.removeContact(contact);
  52332. }
  52333. },
  52334. removeContact(contact) {
  52335. // We suppress events, otherwise the remove event will
  52336. // also cause the contact's view to be removed from the
  52337. // "Pending Contacts" group.
  52338. this.model.contacts.remove(contact, {
  52339. 'silent': true
  52340. });
  52341. this.onRemove(contact);
  52342. },
  52343. onRemove(contact) {
  52344. this.remove(contact.get('jid'));
  52345. if (this.model.contacts.length === 0) {
  52346. this.remove();
  52347. }
  52348. }
  52349. });
  52350. _converse.RosterView = Backbone.OrderedListView.extend({
  52351. tagName: 'div',
  52352. id: 'converse-roster',
  52353. className: 'controlbox-section',
  52354. ItemView: _converse.RosterGroupView,
  52355. listItems: 'model',
  52356. listSelector: '.roster-contacts',
  52357. sortEvent: null,
  52358. // Groups are immutable, so they don't get re-sorted
  52359. subviewIndex: 'name',
  52360. events: {
  52361. 'click a.controlbox-heading__btn.add-contact': 'showAddContactModal',
  52362. 'click a.controlbox-heading__btn.sync-contacts': 'syncContacts'
  52363. },
  52364. initialize() {
  52365. Backbone.OrderedListView.prototype.initialize.apply(this, arguments);
  52366. _converse.roster.on("add", this.onContactAdded, this);
  52367. _converse.roster.on('change:groups', this.onContactAdded, this);
  52368. _converse.roster.on('change', this.onContactChange, this);
  52369. _converse.roster.on("destroy", this.update, this);
  52370. _converse.roster.on("remove", this.update, this);
  52371. _converse.presences.on('change:show', () => {
  52372. this.update();
  52373. this.updateFilter();
  52374. });
  52375. this.model.on("reset", this.reset, this); // This event gets triggered once *all* contacts (i.e. not
  52376. // just this group's) have been fetched from browser
  52377. // storage or the XMPP server and once they've been
  52378. // assigned to their various groups.
  52379. _converse.on('rosterGroupsFetched', this.sortAndPositionAllItems.bind(this));
  52380. _converse.on('rosterContactsFetched', () => {
  52381. _converse.roster.each(contact => this.addRosterContact(contact, {
  52382. 'silent': true
  52383. }));
  52384. this.update();
  52385. this.updateFilter();
  52386. this.trigger('rosterContactsFetchedAndProcessed');
  52387. });
  52388. this.createRosterFilter();
  52389. },
  52390. render() {
  52391. this.el.innerHTML = templates_roster_html__WEBPACK_IMPORTED_MODULE_10___default()({
  52392. 'allow_contact_requests': _converse.allow_contact_requests,
  52393. 'heading_contacts': __('Contacts'),
  52394. 'title_add_contact': __('Add a contact'),
  52395. 'title_sync_contacts': __('Re-sync your contacts')
  52396. });
  52397. const form = this.el.querySelector('.roster-filter-form');
  52398. this.el.replaceChild(this.filter_view.render().el, form);
  52399. this.roster_el = this.el.querySelector('.roster-contacts');
  52400. return this;
  52401. },
  52402. showAddContactModal(ev) {
  52403. if (_.isUndefined(this.add_contact_modal)) {
  52404. this.add_contact_modal = new _converse.AddContactModal({
  52405. 'model': new Backbone.Model()
  52406. });
  52407. }
  52408. this.add_contact_modal.show(ev);
  52409. },
  52410. createRosterFilter() {
  52411. // Create a model on which we can store filter properties
  52412. const model = new _converse.RosterFilter();
  52413. model.id = b64_sha1(`_converse.rosterfilter${_converse.bare_jid}`);
  52414. model.browserStorage = new Backbone.BrowserStorage.local(this.filter.id);
  52415. this.filter_view = new _converse.RosterFilterView({
  52416. 'model': model
  52417. });
  52418. this.filter_view.model.on('change', this.updateFilter, this);
  52419. this.filter_view.model.fetch();
  52420. },
  52421. updateFilter: _.debounce(function () {
  52422. /* Filter the roster again.
  52423. * Called whenever the filter settings have been changed or
  52424. * when contacts have been added, removed or changed.
  52425. *
  52426. * Debounced so that it doesn't get called for every
  52427. * contact fetched from browser storage.
  52428. */
  52429. const type = this.filter_view.model.get('filter_type');
  52430. if (type === 'state') {
  52431. this.filter(this.filter_view.model.get('chat_state'), type);
  52432. } else {
  52433. this.filter(this.filter_view.model.get('filter_text'), type);
  52434. }
  52435. }, 100),
  52436. update: _.debounce(function () {
  52437. if (!u.isVisible(this.roster_el)) {
  52438. u.showElement(this.roster_el);
  52439. }
  52440. this.filter_view.showOrHide();
  52441. return this;
  52442. }, _converse.animate ? 100 : 0),
  52443. filter(query, type) {
  52444. // First we make sure the filter is restored to its
  52445. // original state
  52446. _.each(this.getAll(), function (view) {
  52447. if (view.model.contacts.length > 0) {
  52448. view.show().filter('');
  52449. }
  52450. }); // Now we can filter
  52451. query = query.toLowerCase();
  52452. if (type === 'groups') {
  52453. _.each(this.getAll(), function (view, idx) {
  52454. if (!_.includes(view.model.get('name').toLowerCase(), query.toLowerCase())) {
  52455. u.slideIn(view.el);
  52456. } else if (view.model.contacts.length > 0) {
  52457. u.slideOut(view.el);
  52458. }
  52459. });
  52460. } else {
  52461. _.each(this.getAll(), function (view) {
  52462. view.filter(query, type);
  52463. });
  52464. }
  52465. },
  52466. async syncContacts(ev) {
  52467. ev.preventDefault();
  52468. u.addClass('fa-spin', ev.target);
  52469. _converse.roster.data.save('version', null);
  52470. await _converse.roster.fetchFromServer();
  52471. _converse.xmppstatus.sendPresence();
  52472. u.removeClass('fa-spin', ev.target);
  52473. },
  52474. reset() {
  52475. _converse.roster.reset();
  52476. this.removeAll();
  52477. this.render().update();
  52478. return this;
  52479. },
  52480. onContactAdded(contact) {
  52481. this.addRosterContact(contact);
  52482. this.update();
  52483. this.updateFilter();
  52484. },
  52485. onContactChange(contact) {
  52486. this.updateChatBox(contact);
  52487. this.update();
  52488. if (_.has(contact.changed, 'subscription')) {
  52489. if (contact.changed.subscription === 'from') {
  52490. this.addContactToGroup(contact, HEADER_PENDING_CONTACTS);
  52491. } else if (_.includes(['both', 'to'], contact.get('subscription'))) {
  52492. this.addExistingContact(contact);
  52493. }
  52494. }
  52495. if (_.has(contact.changed, 'ask') && contact.changed.ask === 'subscribe') {
  52496. this.addContactToGroup(contact, HEADER_PENDING_CONTACTS);
  52497. }
  52498. if (_.has(contact.changed, 'subscription') && contact.changed.requesting === 'true') {
  52499. this.addContactToGroup(contact, HEADER_REQUESTING_CONTACTS);
  52500. }
  52501. this.updateFilter();
  52502. },
  52503. updateChatBox(contact) {
  52504. if (!this.model.chatbox) {
  52505. return this;
  52506. }
  52507. const changes = {};
  52508. if (_.has(contact.changed, 'status')) {
  52509. changes.status = contact.get('status');
  52510. }
  52511. this.model.chatbox.save(changes);
  52512. return this;
  52513. },
  52514. getGroup(name) {
  52515. /* Returns the group as specified by name.
  52516. * Creates the group if it doesn't exist.
  52517. */
  52518. const view = this.get(name);
  52519. if (view) {
  52520. return view.model;
  52521. }
  52522. return this.model.create({
  52523. name,
  52524. id: b64_sha1(name)
  52525. });
  52526. },
  52527. addContactToGroup(contact, name, options) {
  52528. this.getGroup(name).contacts.add(contact, options);
  52529. this.sortAndPositionAllItems();
  52530. },
  52531. addExistingContact(contact, options) {
  52532. let groups;
  52533. if (_converse.roster_groups) {
  52534. groups = contact.get('groups');
  52535. if (groups.length === 0) {
  52536. groups = [HEADER_UNGROUPED];
  52537. }
  52538. } else {
  52539. groups = [HEADER_CURRENT_CONTACTS];
  52540. }
  52541. _.each(groups, _.bind(this.addContactToGroup, this, contact, _, options));
  52542. },
  52543. addRosterContact(contact, options) {
  52544. if (contact.get('subscription') === 'both' || contact.get('subscription') === 'to') {
  52545. this.addExistingContact(contact, options);
  52546. } else {
  52547. if (!_converse.allow_contact_requests) {
  52548. _converse.log(`Not adding requesting or pending contact ${contact.get('jid')} ` + `because allow_contact_requests is false`, Strophe.LogLevel.DEBUG);
  52549. return;
  52550. }
  52551. if (contact.get('ask') === 'subscribe' || contact.get('subscription') === 'from') {
  52552. this.addContactToGroup(contact, HEADER_PENDING_CONTACTS, options);
  52553. } else if (contact.get('requesting') === true) {
  52554. this.addContactToGroup(contact, HEADER_REQUESTING_CONTACTS, options);
  52555. }
  52556. }
  52557. return this;
  52558. }
  52559. });
  52560. /* -------- Event Handlers ----------- */
  52561. _converse.api.listen.on('chatBoxesInitialized', () => {
  52562. _converse.chatboxes.on('change:hidden', chatbox => {
  52563. const contact = _converse.roster.findWhere({
  52564. 'jid': chatbox.get('jid')
  52565. });
  52566. if (!_.isUndefined(contact)) {
  52567. contact.trigger('highlight', contact);
  52568. }
  52569. });
  52570. });
  52571. function initRoster() {
  52572. /* Create an instance of RosterView once the RosterGroups
  52573. * collection has been created (in @converse/headless/converse-core.js)
  52574. */
  52575. if (_converse.authentication === _converse.ANONYMOUS) {
  52576. return;
  52577. }
  52578. _converse.rosterview = new _converse.RosterView({
  52579. 'model': _converse.rostergroups
  52580. });
  52581. _converse.rosterview.render();
  52582. _converse.emit('rosterViewInitialized');
  52583. }
  52584. _converse.api.listen.on('rosterInitialized', initRoster);
  52585. _converse.api.listen.on('rosterReadyAfterReconnection', initRoster);
  52586. }
  52587. });
  52588. /***/ }),
  52589. /***/ "./src/converse-singleton.js":
  52590. /*!***********************************!*\
  52591. !*** ./src/converse-singleton.js ***!
  52592. \***********************************/
  52593. /*! no exports provided */
  52594. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52595. "use strict";
  52596. __webpack_require__.r(__webpack_exports__);
  52597. /* harmony import */ var converse_chatview__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! converse-chatview */ "./src/converse-chatview.js");
  52598. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  52599. // Converse.js
  52600. // http://conversejs.org
  52601. //
  52602. // Copyright (c) 2013-2018, the Converse.js developers
  52603. // Licensed under the Mozilla Public License (MPLv2)
  52604. /* converse-singleton
  52605. * ******************
  52606. *
  52607. * A plugin which ensures that only one chat (private or groupchat) is
  52608. * visible at any one time. All other ongoing chats are hidden and kept in the
  52609. * background.
  52610. *
  52611. * This plugin makes sense in mobile or fullscreen chat environments (as
  52612. * configured by the `view_mode` setting).
  52613. */
  52614. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].env,
  52615. _ = _converse$env._,
  52616. Strophe = _converse$env.Strophe;
  52617. const u = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].env.utils;
  52618. function hideChat(view) {
  52619. if (view.model.get('id') === 'controlbox') {
  52620. return;
  52621. }
  52622. u.safeSave(view.model, {
  52623. 'hidden': true
  52624. });
  52625. view.hide();
  52626. }
  52627. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].plugins.add('converse-singleton', {
  52628. // It's possible however to make optional dependencies non-optional.
  52629. // If the setting "strict_plugin_dependencies" is set to true,
  52630. // an error will be raised if the plugin is not found.
  52631. //
  52632. // NB: These plugins need to have already been loaded via require.js.
  52633. dependencies: ['converse-chatboxes', 'converse-muc', 'converse-muc-views', 'converse-controlbox', 'converse-rosterview'],
  52634. overrides: {
  52635. // overrides mentioned here will be picked up by converse.js's
  52636. // plugin architecture they will replace existing methods on the
  52637. // relevant objects or classes.
  52638. //
  52639. // new functions which don't exist yet can also be added.
  52640. ChatBoxes: {
  52641. chatBoxMayBeShown(chatbox) {
  52642. const _converse = this.__super__._converse;
  52643. if (chatbox.get('id') === 'controlbox') {
  52644. return true;
  52645. }
  52646. if (_converse.isUniView()) {
  52647. const any_chats_visible = _converse.chatboxes.filter(cb => cb.get('id') != 'controlbox').filter(cb => !cb.get('hidden')).length > 0;
  52648. if (any_chats_visible) {
  52649. return !chatbox.get('hidden');
  52650. } else {
  52651. return true;
  52652. }
  52653. } else {
  52654. return this.__super__.chatBoxMayBeShown.apply(this, arguments);
  52655. }
  52656. },
  52657. createChatBox(jid, attrs) {
  52658. /* Make sure new chat boxes are hidden by default. */
  52659. const _converse = this.__super__._converse;
  52660. if (_converse.isUniView()) {
  52661. attrs = attrs || {};
  52662. attrs.hidden = true;
  52663. }
  52664. return this.__super__.createChatBox.call(this, jid, attrs);
  52665. }
  52666. },
  52667. ChatBoxView: {
  52668. shouldShowOnTextMessage() {
  52669. const _converse = this.__super__._converse;
  52670. if (_converse.isUniView()) {
  52671. return false;
  52672. } else {
  52673. return this.__super__.shouldShowOnTextMessage.apply(this, arguments);
  52674. }
  52675. },
  52676. _show(focus) {
  52677. /* We only have one chat visible at any one
  52678. * time. So before opening a chat, we make sure all other
  52679. * chats are hidden.
  52680. */
  52681. const _converse = this.__super__._converse;
  52682. if (_converse.isUniView()) {
  52683. _.each(this.__super__._converse.chatboxviews.xget(this.model.get('id')), hideChat);
  52684. u.safeSave(this.model, {
  52685. 'hidden': false
  52686. });
  52687. }
  52688. return this.__super__._show.apply(this, arguments);
  52689. }
  52690. },
  52691. ChatRoomView: {
  52692. show(focus) {
  52693. const _converse = this.__super__._converse;
  52694. if (_converse.isUniView()) {
  52695. _.each(this.__super__._converse.chatboxviews.xget(this.model.get('id')), hideChat);
  52696. u.safeSave(this.model, {
  52697. 'hidden': false
  52698. });
  52699. }
  52700. return this.__super__.show.apply(this, arguments);
  52701. }
  52702. }
  52703. }
  52704. });
  52705. /***/ }),
  52706. /***/ "./src/converse.js":
  52707. /*!*************************!*\
  52708. !*** ./src/converse.js ***!
  52709. \*************************/
  52710. /*! exports provided: default */
  52711. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52712. "use strict";
  52713. __webpack_require__.r(__webpack_exports__);
  52714. /* harmony import */ var converse_autocomplete__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! converse-autocomplete */ "./src/converse-autocomplete.js");
  52715. /* harmony import */ var converse_bookmarks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! converse-bookmarks */ "./src/converse-bookmarks.js");
  52716. /* harmony import */ var converse_caps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! converse-caps */ "./src/converse-caps.js");
  52717. /* harmony import */ var converse_chatview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! converse-chatview */ "./src/converse-chatview.js");
  52718. /* harmony import */ var converse_controlbox__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! converse-controlbox */ "./src/converse-controlbox.js");
  52719. /* harmony import */ var converse_dragresize__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! converse-dragresize */ "./src/converse-dragresize.js");
  52720. /* harmony import */ var converse_embedded__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! converse-embedded */ "./src/converse-embedded.js");
  52721. /* harmony import */ var converse_fullscreen__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! converse-fullscreen */ "./src/converse-fullscreen.js");
  52722. /* harmony import */ var converse_push__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! converse-push */ "./src/converse-push.js");
  52723. /* harmony import */ var converse_headline__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! converse-headline */ "./src/converse-headline.js");
  52724. /* harmony import */ var _converse_headless_converse_mam__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @converse/headless/converse-mam */ "./src/headless/converse-mam.js");
  52725. /* harmony import */ var converse_minimize__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! converse-minimize */ "./src/converse-minimize.js");
  52726. /* harmony import */ var converse_muc_views__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! converse-muc-views */ "./src/converse-muc-views.js");
  52727. /* harmony import */ var converse_notification__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! converse-notification */ "./src/converse-notification.js");
  52728. /* harmony import */ var converse_omemo__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! converse-omemo */ "./src/converse-omemo.js");
  52729. /* harmony import */ var _converse_headless_converse_ping__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @converse/headless/converse-ping */ "./src/headless/converse-ping.js");
  52730. /* harmony import */ var converse_register__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! converse-register */ "./src/converse-register.js");
  52731. /* harmony import */ var converse_roomslist__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! converse-roomslist */ "./src/converse-roomslist.js");
  52732. /* harmony import */ var converse_rosterview__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! converse-rosterview */ "./src/converse-rosterview.js");
  52733. /* harmony import */ var _converse_headless_converse_vcard__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @converse/headless/converse-vcard */ "./src/headless/converse-vcard.js");
  52734. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  52735. /* START: Removable components
  52736. * --------------------
  52737. * Any of the following components may be removed if they're not needed.
  52738. */
  52739. // XEP-0048 Bookmarks
  52740. // XEP-0115 Entity Capabilities
  52741. // Renders standalone chat boxes for single user chat
  52742. // The control box
  52743. // Allows chat boxes to be resized by dragging them
  52744. // XEP-0357 Push Notifications
  52745. // Support for headline messages
  52746. // XEP-0313 Message Archive Management
  52747. // Allows chat boxes to be minimized
  52748. // Views related to MUC
  52749. // HTML5 Notifications
  52750. // XEP-0199 XMPP Ping
  52751. // XEP-0077 In-band registration
  52752. // Show currently open chat rooms
  52753. // XEP-0054 VCard-temp
  52754. /* END: Removable components */
  52755. const WHITELISTED_PLUGINS = ['converse-autocomplete', 'converse-bookmarks', 'converse-caps', 'converse-chatboxviews', 'converse-chatview', 'converse-controlbox', 'converse-dragresize', 'converse-embedded', 'converse-fullscreen', 'converse-headline', 'converse-message-view', 'converse-minimize', 'converse-modal', 'converse-muc-views', 'converse-notification', 'converse-oauth', 'converse-omemo', 'converse-profile', 'converse-push', 'converse-register', 'converse-roomslist', 'converse-rosterview', 'converse-singleton'];
  52756. const initialize = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_20__["default"].initialize;
  52757. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_20__["default"].initialize = function (settings, callback) {
  52758. if (_converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_20__["default"].env._.isArray(settings.whitelisted_plugins)) {
  52759. settings.whitelisted_plugins = settings.whitelisted_plugins.concat(WHITELISTED_PLUGINS);
  52760. } else {
  52761. settings.whitelisted_plugins = WHITELISTED_PLUGINS;
  52762. }
  52763. return initialize(settings, callback);
  52764. };
  52765. /* harmony default export */ __webpack_exports__["default"] = (_converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_20__["default"]);
  52766. /***/ }),
  52767. /***/ "./src/headless/3rdparty/lodash.fp.js":
  52768. /*!********************************************!*\
  52769. !*** ./src/headless/3rdparty/lodash.fp.js ***!
  52770. \********************************************/
  52771. /*! no static exports found */
  52772. /***/ (function(module, exports, __webpack_require__) {
  52773. /*global module, exports, _ */
  52774. (function webpackUniversalModuleDefinition(root, factory) {
  52775. if (true) module.exports = factory();else {}
  52776. })(this, function () {
  52777. return (
  52778. /******/
  52779. function (modules) {
  52780. // webpackBootstrap
  52781. /******/
  52782. // The module cache
  52783. /******/
  52784. var installedModules = {};
  52785. /******/
  52786. // The require function
  52787. /******/
  52788. function __webpack_require__(moduleId) {
  52789. /******/
  52790. // Check if module is in cache
  52791. /******/
  52792. if (installedModules[moduleId])
  52793. /******/
  52794. return installedModules[moduleId].exports;
  52795. /******/
  52796. // Create a new module (and put it into the cache)
  52797. /******/
  52798. var module = installedModules[moduleId] = {
  52799. /******/
  52800. exports: {},
  52801. /******/
  52802. id: moduleId,
  52803. /******/
  52804. loaded: false
  52805. /******/
  52806. };
  52807. /******/
  52808. // Execute the module function
  52809. /******/
  52810. modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  52811. /******/
  52812. // Flag the module as loaded
  52813. /******/
  52814. module.loaded = true;
  52815. /******/
  52816. // Return the exports of the module
  52817. /******/
  52818. return module.exports;
  52819. /******/
  52820. }
  52821. /******/
  52822. // expose the modules object (__webpack_modules__)
  52823. /******/
  52824. __webpack_require__.m = modules;
  52825. /******/
  52826. // expose the module cache
  52827. /******/
  52828. __webpack_require__.c = installedModules;
  52829. /******/
  52830. // __webpack_public_path__
  52831. /******/
  52832. __webpack_require__.p = "";
  52833. /******/
  52834. // Load entry module and return exports
  52835. /******/
  52836. return __webpack_require__(0);
  52837. /******/
  52838. }([
  52839. /* 0 */
  52840. /***/
  52841. function (module, exports, __webpack_require__) {
  52842. var baseConvert = __webpack_require__(1);
  52843. /**
  52844. * Converts `lodash` to an immutable auto-curried iteratee-first data-last
  52845. * version with conversion `options` applied.
  52846. *
  52847. * @param {Function} lodash The lodash function to convert.
  52848. * @param {Object} [options] The options object. See `baseConvert` for more details.
  52849. * @returns {Function} Returns the converted `lodash`.
  52850. */
  52851. function browserConvert(lodash, options) {
  52852. return baseConvert(lodash, lodash, options);
  52853. }
  52854. if (typeof _ == 'function' && typeof _.runInContext == 'function') {
  52855. // XXX: Customization in order to be able to run both _ and fp in the
  52856. // non-AMD usecase.
  52857. window.fp = browserConvert(_.runInContext());
  52858. }
  52859. module.exports = browserConvert;
  52860. /***/
  52861. },
  52862. /* 1 */
  52863. /***/
  52864. function (module, exports, __webpack_require__) {
  52865. var mapping = __webpack_require__(2),
  52866. fallbackHolder = __webpack_require__(3);
  52867. /** Built-in value reference. */
  52868. var push = Array.prototype.push;
  52869. /**
  52870. * Creates a function, with an arity of `n`, that invokes `func` with the
  52871. * arguments it receives.
  52872. *
  52873. * @private
  52874. * @param {Function} func The function to wrap.
  52875. * @param {number} n The arity of the new function.
  52876. * @returns {Function} Returns the new function.
  52877. */
  52878. function baseArity(func, n) {
  52879. return n == 2 ? function (a, b) {
  52880. return func.apply(undefined, arguments);
  52881. } : function (a) {
  52882. return func.apply(undefined, arguments);
  52883. };
  52884. }
  52885. /**
  52886. * Creates a function that invokes `func`, with up to `n` arguments, ignoring
  52887. * any additional arguments.
  52888. *
  52889. * @private
  52890. * @param {Function} func The function to cap arguments for.
  52891. * @param {number} n The arity cap.
  52892. * @returns {Function} Returns the new function.
  52893. */
  52894. function baseAry(func, n) {
  52895. return n == 2 ? function (a, b) {
  52896. return func(a, b);
  52897. } : function (a) {
  52898. return func(a);
  52899. };
  52900. }
  52901. /**
  52902. * Creates a clone of `array`.
  52903. *
  52904. * @private
  52905. * @param {Array} array The array to clone.
  52906. * @returns {Array} Returns the cloned array.
  52907. */
  52908. function cloneArray(array) {
  52909. var length = array ? array.length : 0,
  52910. result = Array(length);
  52911. while (length--) {
  52912. result[length] = array[length];
  52913. }
  52914. return result;
  52915. }
  52916. /**
  52917. * Creates a function that clones a given object using the assignment `func`.
  52918. *
  52919. * @private
  52920. * @param {Function} func The assignment function.
  52921. * @returns {Function} Returns the new cloner function.
  52922. */
  52923. function createCloner(func) {
  52924. return function (object) {
  52925. return func({}, object);
  52926. };
  52927. }
  52928. /**
  52929. * A specialized version of `_.spread` which flattens the spread array into
  52930. * the arguments of the invoked `func`.
  52931. *
  52932. * @private
  52933. * @param {Function} func The function to spread arguments over.
  52934. * @param {number} start The start position of the spread.
  52935. * @returns {Function} Returns the new function.
  52936. */
  52937. function flatSpread(func, start) {
  52938. return function () {
  52939. var length = arguments.length,
  52940. lastIndex = length - 1,
  52941. args = Array(length);
  52942. while (length--) {
  52943. args[length] = arguments[length];
  52944. }
  52945. var array = args[start],
  52946. otherArgs = args.slice(0, start);
  52947. if (array) {
  52948. push.apply(otherArgs, array);
  52949. }
  52950. if (start != lastIndex) {
  52951. push.apply(otherArgs, args.slice(start + 1));
  52952. }
  52953. return func.apply(this, otherArgs);
  52954. };
  52955. }
  52956. /**
  52957. * Creates a function that wraps `func` and uses `cloner` to clone the first
  52958. * argument it receives.
  52959. *
  52960. * @private
  52961. * @param {Function} func The function to wrap.
  52962. * @param {Function} cloner The function to clone arguments.
  52963. * @returns {Function} Returns the new immutable function.
  52964. */
  52965. function wrapImmutable(func, cloner) {
  52966. return function () {
  52967. var length = arguments.length;
  52968. if (!length) {
  52969. return;
  52970. }
  52971. var args = Array(length);
  52972. while (length--) {
  52973. args[length] = arguments[length];
  52974. }
  52975. var result = args[0] = cloner.apply(undefined, args);
  52976. func.apply(undefined, args);
  52977. return result;
  52978. };
  52979. }
  52980. /**
  52981. * The base implementation of `convert` which accepts a `util` object of methods
  52982. * required to perform conversions.
  52983. *
  52984. * @param {Object} util The util object.
  52985. * @param {string} name The name of the function to convert.
  52986. * @param {Function} func The function to convert.
  52987. * @param {Object} [options] The options object.
  52988. * @param {boolean} [options.cap=true] Specify capping iteratee arguments.
  52989. * @param {boolean} [options.curry=true] Specify currying.
  52990. * @param {boolean} [options.fixed=true] Specify fixed arity.
  52991. * @param {boolean} [options.immutable=true] Specify immutable operations.
  52992. * @param {boolean} [options.rearg=true] Specify rearranging arguments.
  52993. * @returns {Function|Object} Returns the converted function or object.
  52994. */
  52995. function baseConvert(util, name, func, options) {
  52996. var setPlaceholder,
  52997. isLib = typeof name == 'function',
  52998. isObj = name === Object(name);
  52999. if (isObj) {
  53000. options = func;
  53001. func = name;
  53002. name = undefined;
  53003. }
  53004. if (func === null) {
  53005. throw new TypeError();
  53006. }
  53007. options || (options = {});
  53008. var config = {
  53009. 'cap': 'cap' in options ? options.cap : true,
  53010. 'curry': 'curry' in options ? options.curry : true,
  53011. 'fixed': 'fixed' in options ? options.fixed : true,
  53012. 'immutable': 'immutable' in options ? options.immutable : true,
  53013. 'rearg': 'rearg' in options ? options.rearg : true
  53014. };
  53015. var forceCurry = 'curry' in options && options.curry,
  53016. forceFixed = 'fixed' in options && options.fixed,
  53017. forceRearg = 'rearg' in options && options.rearg,
  53018. placeholder = isLib ? func : fallbackHolder,
  53019. pristine = isLib ? func.runInContext() : undefined;
  53020. var helpers = isLib ? func : {
  53021. 'ary': util.ary,
  53022. 'assign': util.assign,
  53023. 'clone': util.clone,
  53024. 'curry': util.curry,
  53025. 'forEach': util.forEach,
  53026. 'isArray': util.isArray,
  53027. 'isFunction': util.isFunction,
  53028. 'iteratee': util.iteratee,
  53029. 'keys': util.keys,
  53030. 'rearg': util.rearg,
  53031. 'toInteger': util.toInteger,
  53032. 'toPath': util.toPath
  53033. };
  53034. var ary = helpers.ary,
  53035. assign = helpers.assign,
  53036. clone = helpers.clone,
  53037. curry = helpers.curry,
  53038. each = helpers.forEach,
  53039. isArray = helpers.isArray,
  53040. isFunction = helpers.isFunction,
  53041. keys = helpers.keys,
  53042. rearg = helpers.rearg,
  53043. toInteger = helpers.toInteger,
  53044. toPath = helpers.toPath;
  53045. var aryMethodKeys = keys(mapping.aryMethod);
  53046. var wrappers = {
  53047. 'castArray': function castArray(_castArray) {
  53048. return function () {
  53049. var value = arguments[0];
  53050. return isArray(value) ? _castArray(cloneArray(value)) : _castArray.apply(undefined, arguments);
  53051. };
  53052. },
  53053. 'iteratee': function iteratee(_iteratee) {
  53054. return function () {
  53055. var func = arguments[0],
  53056. arity = arguments[1],
  53057. result = _iteratee(func, arity),
  53058. length = result.length;
  53059. if (config.cap && typeof arity == 'number') {
  53060. arity = arity > 2 ? arity - 2 : 1;
  53061. return length && length <= arity ? result : baseAry(result, arity);
  53062. }
  53063. return result;
  53064. };
  53065. },
  53066. 'mixin': function mixin(_mixin) {
  53067. return function (source) {
  53068. var func = this;
  53069. if (!isFunction(func)) {
  53070. return _mixin(func, Object(source));
  53071. }
  53072. var pairs = [];
  53073. each(keys(source), function (key) {
  53074. if (isFunction(source[key])) {
  53075. pairs.push([key, func.prototype[key]]);
  53076. }
  53077. });
  53078. _mixin(func, Object(source));
  53079. each(pairs, function (pair) {
  53080. var value = pair[1];
  53081. if (isFunction(value)) {
  53082. func.prototype[pair[0]] = value;
  53083. } else {
  53084. delete func.prototype[pair[0]];
  53085. }
  53086. });
  53087. return func;
  53088. };
  53089. },
  53090. 'nthArg': function nthArg(_nthArg) {
  53091. return function (n) {
  53092. var arity = n < 0 ? 1 : toInteger(n) + 1;
  53093. return curry(_nthArg(n), arity);
  53094. };
  53095. },
  53096. 'rearg': function rearg(_rearg) {
  53097. return function (func, indexes) {
  53098. var arity = indexes ? indexes.length : 0;
  53099. return curry(_rearg(func, indexes), arity);
  53100. };
  53101. },
  53102. 'runInContext': function runInContext(_runInContext) {
  53103. return function (context) {
  53104. return baseConvert(util, _runInContext(context), options);
  53105. };
  53106. }
  53107. };
  53108. /*--------------------------------------------------------------------------*/
  53109. /**
  53110. * Casts `func` to a function with an arity capped iteratee if needed.
  53111. *
  53112. * @private
  53113. * @param {string} name The name of the function to inspect.
  53114. * @param {Function} func The function to inspect.
  53115. * @returns {Function} Returns the cast function.
  53116. */
  53117. function castCap(name, func) {
  53118. if (config.cap) {
  53119. var indexes = mapping.iterateeRearg[name];
  53120. if (indexes) {
  53121. return iterateeRearg(func, indexes);
  53122. }
  53123. var n = !isLib && mapping.iterateeAry[name];
  53124. if (n) {
  53125. return iterateeAry(func, n);
  53126. }
  53127. }
  53128. return func;
  53129. }
  53130. /**
  53131. * Casts `func` to a curried function if needed.
  53132. *
  53133. * @private
  53134. * @param {string} name The name of the function to inspect.
  53135. * @param {Function} func The function to inspect.
  53136. * @param {number} n The arity of `func`.
  53137. * @returns {Function} Returns the cast function.
  53138. */
  53139. function castCurry(name, func, n) {
  53140. return forceCurry || config.curry && n > 1 ? curry(func, n) : func;
  53141. }
  53142. /**
  53143. * Casts `func` to a fixed arity function if needed.
  53144. *
  53145. * @private
  53146. * @param {string} name The name of the function to inspect.
  53147. * @param {Function} func The function to inspect.
  53148. * @param {number} n The arity cap.
  53149. * @returns {Function} Returns the cast function.
  53150. */
  53151. function castFixed(name, func, n) {
  53152. if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
  53153. var data = mapping.methodSpread[name],
  53154. start = data && data.start;
  53155. return start === undefined ? ary(func, n) : flatSpread(func, start);
  53156. }
  53157. return func;
  53158. }
  53159. /**
  53160. * Casts `func` to an rearged function if needed.
  53161. *
  53162. * @private
  53163. * @param {string} name The name of the function to inspect.
  53164. * @param {Function} func The function to inspect.
  53165. * @param {number} n The arity of `func`.
  53166. * @returns {Function} Returns the cast function.
  53167. */
  53168. function castRearg(name, func, n) {
  53169. return config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name]) ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) : func;
  53170. }
  53171. /**
  53172. * Creates a clone of `object` by `path`.
  53173. *
  53174. * @private
  53175. * @param {Object} object The object to clone.
  53176. * @param {Array|string} path The path to clone by.
  53177. * @returns {Object} Returns the cloned object.
  53178. */
  53179. function cloneByPath(object, path) {
  53180. path = toPath(path);
  53181. var index = -1,
  53182. length = path.length,
  53183. lastIndex = length - 1,
  53184. result = clone(Object(object)),
  53185. nested = result;
  53186. while (nested !== null && ++index < length) {
  53187. var key = path[index],
  53188. value = nested[key];
  53189. if (value !== null) {
  53190. nested[path[index]] = clone(index == lastIndex ? value : Object(value));
  53191. }
  53192. nested = nested[key];
  53193. }
  53194. return result;
  53195. }
  53196. /**
  53197. * Converts `lodash` to an immutable auto-curried iteratee-first data-last
  53198. * version with conversion `options` applied.
  53199. *
  53200. * @param {Object} [options] The options object. See `baseConvert` for more details.
  53201. * @returns {Function} Returns the converted `lodash`.
  53202. */
  53203. function convertLib(options) {
  53204. return _.runInContext.convert(options)(undefined);
  53205. }
  53206. /**
  53207. * Create a converter function for `func` of `name`.
  53208. *
  53209. * @param {string} name The name of the function to convert.
  53210. * @param {Function} func The function to convert.
  53211. * @returns {Function} Returns the new converter function.
  53212. */
  53213. function createConverter(name, func) {
  53214. var realName = mapping.aliasToReal[name] || name,
  53215. methodName = mapping.remap[realName] || realName,
  53216. oldOptions = options;
  53217. return function (options) {
  53218. var newUtil = isLib ? pristine : helpers,
  53219. newFunc = isLib ? pristine[methodName] : func,
  53220. newOptions = assign(assign({}, oldOptions), options);
  53221. return baseConvert(newUtil, realName, newFunc, newOptions);
  53222. };
  53223. }
  53224. /**
  53225. * Creates a function that wraps `func` to invoke its iteratee, with up to `n`
  53226. * arguments, ignoring any additional arguments.
  53227. *
  53228. * @private
  53229. * @param {Function} func The function to cap iteratee arguments for.
  53230. * @param {number} n The arity cap.
  53231. * @returns {Function} Returns the new function.
  53232. */
  53233. function iterateeAry(func, n) {
  53234. return overArg(func, function (func) {
  53235. return typeof func == 'function' ? baseAry(func, n) : func;
  53236. });
  53237. }
  53238. /**
  53239. * Creates a function that wraps `func` to invoke its iteratee with arguments
  53240. * arranged according to the specified `indexes` where the argument value at
  53241. * the first index is provided as the first argument, the argument value at
  53242. * the second index is provided as the second argument, and so on.
  53243. *
  53244. * @private
  53245. * @param {Function} func The function to rearrange iteratee arguments for.
  53246. * @param {number[]} indexes The arranged argument indexes.
  53247. * @returns {Function} Returns the new function.
  53248. */
  53249. function iterateeRearg(func, indexes) {
  53250. return overArg(func, function (func) {
  53251. var n = indexes.length;
  53252. return baseArity(rearg(baseAry(func, n), indexes), n);
  53253. });
  53254. }
  53255. /**
  53256. * Creates a function that invokes `func` with its first argument transformed.
  53257. *
  53258. * @private
  53259. * @param {Function} func The function to wrap.
  53260. * @param {Function} transform The argument transform.
  53261. * @returns {Function} Returns the new function.
  53262. */
  53263. function overArg(func, transform) {
  53264. return function () {
  53265. var length = arguments.length;
  53266. if (!length) {
  53267. return func();
  53268. }
  53269. var args = Array(length);
  53270. while (length--) {
  53271. args[length] = arguments[length];
  53272. }
  53273. var index = config.rearg ? 0 : length - 1;
  53274. args[index] = transform(args[index]);
  53275. return func.apply(undefined, args);
  53276. };
  53277. }
  53278. /**
  53279. * Creates a function that wraps `func` and applys the conversions
  53280. * rules by `name`.
  53281. *
  53282. * @private
  53283. * @param {string} name The name of the function to wrap.
  53284. * @param {Function} func The function to wrap.
  53285. * @returns {Function} Returns the converted function.
  53286. */
  53287. function wrap(name, func) {
  53288. var result,
  53289. realName = mapping.aliasToReal[name] || name,
  53290. wrapped = func,
  53291. wrapper = wrappers[realName];
  53292. if (wrapper) {
  53293. wrapped = wrapper(func);
  53294. } else if (config.immutable) {
  53295. if (mapping.mutate.array[realName]) {
  53296. wrapped = wrapImmutable(func, cloneArray);
  53297. } else if (mapping.mutate.object[realName]) {
  53298. wrapped = wrapImmutable(func, createCloner(func));
  53299. } else if (mapping.mutate.set[realName]) {
  53300. wrapped = wrapImmutable(func, cloneByPath);
  53301. }
  53302. }
  53303. each(aryMethodKeys, function (aryKey) {
  53304. each(mapping.aryMethod[aryKey], function (otherName) {
  53305. if (realName == otherName) {
  53306. var data = mapping.methodSpread[realName],
  53307. afterRearg = data && data.afterRearg;
  53308. result = afterRearg ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey);
  53309. result = castCap(realName, result);
  53310. result = castCurry(realName, result, aryKey);
  53311. return false;
  53312. }
  53313. });
  53314. return !result;
  53315. });
  53316. result || (result = wrapped);
  53317. if (result == func) {
  53318. result = forceCurry ? curry(result, 1) : function () {
  53319. return func.apply(this, arguments);
  53320. };
  53321. }
  53322. result.convert = createConverter(realName, func);
  53323. if (mapping.placeholder[realName]) {
  53324. setPlaceholder = true;
  53325. result.placeholder = func.placeholder = placeholder;
  53326. }
  53327. return result;
  53328. }
  53329. /*--------------------------------------------------------------------------*/
  53330. if (!isObj) {
  53331. return wrap(name, func);
  53332. }
  53333. var _ = func; // Convert methods by ary cap.
  53334. var pairs = [];
  53335. each(aryMethodKeys, function (aryKey) {
  53336. each(mapping.aryMethod[aryKey], function (key) {
  53337. var func = _[mapping.remap[key] || key];
  53338. if (func) {
  53339. pairs.push([key, wrap(key, func)]);
  53340. }
  53341. });
  53342. }); // Convert remaining methods.
  53343. each(keys(_), function (key) {
  53344. var func = _[key];
  53345. if (typeof func == 'function') {
  53346. var length = pairs.length;
  53347. while (length--) {
  53348. if (pairs[length][0] == key) {
  53349. return;
  53350. }
  53351. }
  53352. func.convert = createConverter(key, func);
  53353. pairs.push([key, func]);
  53354. }
  53355. }); // Assign to `_` leaving `_.prototype` unchanged to allow chaining.
  53356. each(pairs, function (pair) {
  53357. _[pair[0]] = pair[1];
  53358. });
  53359. _.convert = convertLib;
  53360. if (setPlaceholder) {
  53361. _.placeholder = placeholder;
  53362. } // Assign aliases.
  53363. each(keys(_), function (key) {
  53364. each(mapping.realToAlias[key] || [], function (alias) {
  53365. _[alias] = _[key];
  53366. });
  53367. });
  53368. return _;
  53369. }
  53370. module.exports = baseConvert;
  53371. /***/
  53372. },
  53373. /* 2 */
  53374. /***/
  53375. function (module, exports) {
  53376. /** Used to map aliases to their real names. */
  53377. exports.aliasToReal = {
  53378. // Lodash aliases.
  53379. 'each': 'forEach',
  53380. 'eachRight': 'forEachRight',
  53381. 'entries': 'toPairs',
  53382. 'entriesIn': 'toPairsIn',
  53383. 'extend': 'assignIn',
  53384. 'extendAll': 'assignInAll',
  53385. 'extendAllWith': 'assignInAllWith',
  53386. 'extendWith': 'assignInWith',
  53387. 'first': 'head',
  53388. // Methods that are curried variants of others.
  53389. 'conforms': 'conformsTo',
  53390. 'matches': 'isMatch',
  53391. 'property': 'get',
  53392. // Ramda aliases.
  53393. '__': 'placeholder',
  53394. 'F': 'stubFalse',
  53395. 'T': 'stubTrue',
  53396. 'all': 'every',
  53397. 'allPass': 'overEvery',
  53398. 'always': 'constant',
  53399. 'any': 'some',
  53400. 'anyPass': 'overSome',
  53401. 'apply': 'spread',
  53402. 'assoc': 'set',
  53403. 'assocPath': 'set',
  53404. 'complement': 'negate',
  53405. 'compose': 'flowRight',
  53406. 'contains': 'includes',
  53407. 'dissoc': 'unset',
  53408. 'dissocPath': 'unset',
  53409. 'dropLast': 'dropRight',
  53410. 'dropLastWhile': 'dropRightWhile',
  53411. 'equals': 'isEqual',
  53412. 'identical': 'eq',
  53413. 'indexBy': 'keyBy',
  53414. 'init': 'initial',
  53415. 'invertObj': 'invert',
  53416. 'juxt': 'over',
  53417. 'omitAll': 'omit',
  53418. 'nAry': 'ary',
  53419. 'path': 'get',
  53420. 'pathEq': 'matchesProperty',
  53421. 'pathOr': 'getOr',
  53422. 'paths': 'at',
  53423. 'pickAll': 'pick',
  53424. 'pipe': 'flow',
  53425. 'pluck': 'map',
  53426. 'prop': 'get',
  53427. 'propEq': 'matchesProperty',
  53428. 'propOr': 'getOr',
  53429. 'props': 'at',
  53430. 'symmetricDifference': 'xor',
  53431. 'symmetricDifferenceBy': 'xorBy',
  53432. 'symmetricDifferenceWith': 'xorWith',
  53433. 'takeLast': 'takeRight',
  53434. 'takeLastWhile': 'takeRightWhile',
  53435. 'unapply': 'rest',
  53436. 'unnest': 'flatten',
  53437. 'useWith': 'overArgs',
  53438. 'where': 'conformsTo',
  53439. 'whereEq': 'isMatch',
  53440. 'zipObj': 'zipObject'
  53441. };
  53442. /** Used to map ary to method names. */
  53443. exports.aryMethod = {
  53444. '1': ['assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll', 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words', 'zipAll'],
  53445. '2': ['add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference', 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll', 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'],
  53446. '3': ['assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr', 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight', 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy', 'xorWith', 'zipWith'],
  53447. '4': ['fill', 'setWith', 'updateWith']
  53448. };
  53449. /** Used to map ary to rearg configs. */
  53450. exports.aryRearg = {
  53451. '2': [1, 0],
  53452. '3': [2, 0, 1],
  53453. '4': [3, 2, 0, 1]
  53454. };
  53455. /** Used to map method names to their iteratee ary. */
  53456. exports.iterateeAry = {
  53457. 'dropRightWhile': 1,
  53458. 'dropWhile': 1,
  53459. 'every': 1,
  53460. 'filter': 1,
  53461. 'find': 1,
  53462. 'findFrom': 1,
  53463. 'findIndex': 1,
  53464. 'findIndexFrom': 1,
  53465. 'findKey': 1,
  53466. 'findLast': 1,
  53467. 'findLastFrom': 1,
  53468. 'findLastIndex': 1,
  53469. 'findLastIndexFrom': 1,
  53470. 'findLastKey': 1,
  53471. 'flatMap': 1,
  53472. 'flatMapDeep': 1,
  53473. 'flatMapDepth': 1,
  53474. 'forEach': 1,
  53475. 'forEachRight': 1,
  53476. 'forIn': 1,
  53477. 'forInRight': 1,
  53478. 'forOwn': 1,
  53479. 'forOwnRight': 1,
  53480. 'map': 1,
  53481. 'mapKeys': 1,
  53482. 'mapValues': 1,
  53483. 'partition': 1,
  53484. 'reduce': 2,
  53485. 'reduceRight': 2,
  53486. 'reject': 1,
  53487. 'remove': 1,
  53488. 'some': 1,
  53489. 'takeRightWhile': 1,
  53490. 'takeWhile': 1,
  53491. 'times': 1,
  53492. 'transform': 2
  53493. };
  53494. /** Used to map method names to iteratee rearg configs. */
  53495. exports.iterateeRearg = {
  53496. 'mapKeys': [1],
  53497. 'reduceRight': [1, 0]
  53498. };
  53499. /** Used to map method names to rearg configs. */
  53500. exports.methodRearg = {
  53501. 'assignInAllWith': [1, 0],
  53502. 'assignInWith': [1, 2, 0],
  53503. 'assignAllWith': [1, 0],
  53504. 'assignWith': [1, 2, 0],
  53505. 'differenceBy': [1, 2, 0],
  53506. 'differenceWith': [1, 2, 0],
  53507. 'getOr': [2, 1, 0],
  53508. 'intersectionBy': [1, 2, 0],
  53509. 'intersectionWith': [1, 2, 0],
  53510. 'isEqualWith': [1, 2, 0],
  53511. 'isMatchWith': [2, 1, 0],
  53512. 'mergeAllWith': [1, 0],
  53513. 'mergeWith': [1, 2, 0],
  53514. 'padChars': [2, 1, 0],
  53515. 'padCharsEnd': [2, 1, 0],
  53516. 'padCharsStart': [2, 1, 0],
  53517. 'pullAllBy': [2, 1, 0],
  53518. 'pullAllWith': [2, 1, 0],
  53519. 'rangeStep': [1, 2, 0],
  53520. 'rangeStepRight': [1, 2, 0],
  53521. 'setWith': [3, 1, 2, 0],
  53522. 'sortedIndexBy': [2, 1, 0],
  53523. 'sortedLastIndexBy': [2, 1, 0],
  53524. 'unionBy': [1, 2, 0],
  53525. 'unionWith': [1, 2, 0],
  53526. 'updateWith': [3, 1, 2, 0],
  53527. 'xorBy': [1, 2, 0],
  53528. 'xorWith': [1, 2, 0],
  53529. 'zipWith': [1, 2, 0]
  53530. };
  53531. /** Used to map method names to spread configs. */
  53532. exports.methodSpread = {
  53533. 'assignAll': {
  53534. 'start': 0
  53535. },
  53536. 'assignAllWith': {
  53537. 'start': 0
  53538. },
  53539. 'assignInAll': {
  53540. 'start': 0
  53541. },
  53542. 'assignInAllWith': {
  53543. 'start': 0
  53544. },
  53545. 'defaultsAll': {
  53546. 'start': 0
  53547. },
  53548. 'defaultsDeepAll': {
  53549. 'start': 0
  53550. },
  53551. 'invokeArgs': {
  53552. 'start': 2
  53553. },
  53554. 'invokeArgsMap': {
  53555. 'start': 2
  53556. },
  53557. 'mergeAll': {
  53558. 'start': 0
  53559. },
  53560. 'mergeAllWith': {
  53561. 'start': 0
  53562. },
  53563. 'partial': {
  53564. 'start': 1
  53565. },
  53566. 'partialRight': {
  53567. 'start': 1
  53568. },
  53569. 'without': {
  53570. 'start': 1
  53571. },
  53572. 'zipAll': {
  53573. 'start': 0
  53574. }
  53575. };
  53576. /** Used to identify methods which mutate arrays or objects. */
  53577. exports.mutate = {
  53578. 'array': {
  53579. 'fill': true,
  53580. 'pull': true,
  53581. 'pullAll': true,
  53582. 'pullAllBy': true,
  53583. 'pullAllWith': true,
  53584. 'pullAt': true,
  53585. 'remove': true,
  53586. 'reverse': true
  53587. },
  53588. 'object': {
  53589. 'assign': true,
  53590. 'assignAll': true,
  53591. 'assignAllWith': true,
  53592. 'assignIn': true,
  53593. 'assignInAll': true,
  53594. 'assignInAllWith': true,
  53595. 'assignInWith': true,
  53596. 'assignWith': true,
  53597. 'defaults': true,
  53598. 'defaultsAll': true,
  53599. 'defaultsDeep': true,
  53600. 'defaultsDeepAll': true,
  53601. 'merge': true,
  53602. 'mergeAll': true,
  53603. 'mergeAllWith': true,
  53604. 'mergeWith': true
  53605. },
  53606. 'set': {
  53607. 'set': true,
  53608. 'setWith': true,
  53609. 'unset': true,
  53610. 'update': true,
  53611. 'updateWith': true
  53612. }
  53613. };
  53614. /** Used to track methods with placeholder support */
  53615. exports.placeholder = {
  53616. 'bind': true,
  53617. 'bindKey': true,
  53618. 'curry': true,
  53619. 'curryRight': true,
  53620. 'partial': true,
  53621. 'partialRight': true
  53622. };
  53623. /** Used to map real names to their aliases. */
  53624. exports.realToAlias = function () {
  53625. var hasOwnProperty = Object.prototype.hasOwnProperty,
  53626. object = exports.aliasToReal,
  53627. result = {};
  53628. for (var key in object) {
  53629. if (Object.prototype.hasOwnProperty.call(object, key)) {
  53630. var value = object[key];
  53631. if (hasOwnProperty.call(result, value)) {
  53632. result[value].push(key);
  53633. } else {
  53634. result[value] = [key];
  53635. }
  53636. }
  53637. }
  53638. return result;
  53639. }();
  53640. /** Used to map method names to other names. */
  53641. exports.remap = {
  53642. 'assignAll': 'assign',
  53643. 'assignAllWith': 'assignWith',
  53644. 'assignInAll': 'assignIn',
  53645. 'assignInAllWith': 'assignInWith',
  53646. 'curryN': 'curry',
  53647. 'curryRightN': 'curryRight',
  53648. 'defaultsAll': 'defaults',
  53649. 'defaultsDeepAll': 'defaultsDeep',
  53650. 'findFrom': 'find',
  53651. 'findIndexFrom': 'findIndex',
  53652. 'findLastFrom': 'findLast',
  53653. 'findLastIndexFrom': 'findLastIndex',
  53654. 'getOr': 'get',
  53655. 'includesFrom': 'includes',
  53656. 'indexOfFrom': 'indexOf',
  53657. 'invokeArgs': 'invoke',
  53658. 'invokeArgsMap': 'invokeMap',
  53659. 'lastIndexOfFrom': 'lastIndexOf',
  53660. 'mergeAll': 'merge',
  53661. 'mergeAllWith': 'mergeWith',
  53662. 'padChars': 'pad',
  53663. 'padCharsEnd': 'padEnd',
  53664. 'padCharsStart': 'padStart',
  53665. 'propertyOf': 'get',
  53666. 'rangeStep': 'range',
  53667. 'rangeStepRight': 'rangeRight',
  53668. 'restFrom': 'rest',
  53669. 'spreadFrom': 'spread',
  53670. 'trimChars': 'trim',
  53671. 'trimCharsEnd': 'trimEnd',
  53672. 'trimCharsStart': 'trimStart',
  53673. 'zipAll': 'zip'
  53674. };
  53675. /** Used to track methods that skip fixing their arity. */
  53676. exports.skipFixed = {
  53677. 'castArray': true,
  53678. 'flow': true,
  53679. 'flowRight': true,
  53680. 'iteratee': true,
  53681. 'mixin': true,
  53682. 'rearg': true,
  53683. 'runInContext': true
  53684. };
  53685. /** Used to track methods that skip rearranging arguments. */
  53686. exports.skipRearg = {
  53687. 'add': true,
  53688. 'assign': true,
  53689. 'assignIn': true,
  53690. 'bind': true,
  53691. 'bindKey': true,
  53692. 'concat': true,
  53693. 'difference': true,
  53694. 'divide': true,
  53695. 'eq': true,
  53696. 'gt': true,
  53697. 'gte': true,
  53698. 'isEqual': true,
  53699. 'lt': true,
  53700. 'lte': true,
  53701. 'matchesProperty': true,
  53702. 'merge': true,
  53703. 'multiply': true,
  53704. 'overArgs': true,
  53705. 'partial': true,
  53706. 'partialRight': true,
  53707. 'propertyOf': true,
  53708. 'random': true,
  53709. 'range': true,
  53710. 'rangeRight': true,
  53711. 'subtract': true,
  53712. 'zip': true,
  53713. 'zipObject': true,
  53714. 'zipObjectDeep': true
  53715. };
  53716. /***/
  53717. },
  53718. /* 3 */
  53719. /***/
  53720. function (module, exports) {
  53721. /**
  53722. * The default argument placeholder value for methods.
  53723. *
  53724. * @type {Object}
  53725. */
  53726. module.exports = {};
  53727. /***/
  53728. }
  53729. /******/
  53730. ])
  53731. );
  53732. });
  53733. /***/ }),
  53734. /***/ "./src/headless/converse-chatboxes.js":
  53735. /*!********************************************!*\
  53736. !*** ./src/headless/converse-chatboxes.js ***!
  53737. \********************************************/
  53738. /*! no exports provided */
  53739. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53740. "use strict";
  53741. __webpack_require__.r(__webpack_exports__);
  53742. /* harmony import */ var _utils_emoji__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/emoji */ "./src/headless/utils/emoji.js");
  53743. /* harmony import */ var _utils_form__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/form */ "./src/headless/utils/form.js");
  53744. /* harmony import */ var _converse_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./converse-core */ "./src/headless/converse-core.js");
  53745. /* harmony import */ var filesize__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! filesize */ "./node_modules/filesize/lib/filesize.js");
  53746. /* harmony import */ var filesize__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(filesize__WEBPACK_IMPORTED_MODULE_3__);
  53747. // Converse.js
  53748. // http://conversejs.org
  53749. //
  53750. // Copyright (c) 2012-2018, the Converse.js developers
  53751. // Licensed under the Mozilla Public License (MPLv2)
  53752. const _converse$env = _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].env,
  53753. $msg = _converse$env.$msg,
  53754. Backbone = _converse$env.Backbone,
  53755. Promise = _converse$env.Promise,
  53756. Strophe = _converse$env.Strophe,
  53757. b64_sha1 = _converse$env.b64_sha1,
  53758. moment = _converse$env.moment,
  53759. sizzle = _converse$env.sizzle,
  53760. utils = _converse$env.utils,
  53761. _ = _converse$env._;
  53762. const u = _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].env.utils;
  53763. Strophe.addNamespace('MESSAGE_CORRECT', 'urn:xmpp:message-correct:0');
  53764. Strophe.addNamespace('RECEIPTS', 'urn:xmpp:receipts');
  53765. Strophe.addNamespace('REFERENCE', 'urn:xmpp:reference:0');
  53766. _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].plugins.add('converse-chatboxes', {
  53767. dependencies: ["converse-roster", "converse-vcard"],
  53768. initialize() {
  53769. /* The initialize function gets called as soon as the plugin is
  53770. * loaded by converse.js's plugin machinery.
  53771. */
  53772. const _converse = this._converse,
  53773. __ = _converse.__; // Configuration values for this plugin
  53774. // ====================================
  53775. // Refer to docs/source/configuration.rst for explanations of these
  53776. // configuration settings.
  53777. _converse.api.settings.update({
  53778. 'auto_join_private_chats': [],
  53779. 'filter_by_resource': false,
  53780. 'forward_messages': false,
  53781. 'send_chat_state_notifications': true
  53782. });
  53783. _converse.api.promises.add(['chatBoxesFetched', 'chatBoxesInitialized', 'privateChatsAutoJoined']);
  53784. function openChat(jid) {
  53785. if (!utils.isValidJID(jid)) {
  53786. return _converse.log(`Invalid JID "${jid}" provided in URL fragment`, Strophe.LogLevel.WARN);
  53787. }
  53788. _converse.api.chats.open(jid);
  53789. }
  53790. _converse.router.route('converse/chat?jid=:jid', openChat);
  53791. _converse.Message = Backbone.Model.extend({
  53792. defaults() {
  53793. return {
  53794. 'msgid': _converse.connection.getUniqueId(),
  53795. 'time': moment().format()
  53796. };
  53797. },
  53798. initialize() {
  53799. this.setVCard();
  53800. if (this.get('file')) {
  53801. this.on('change:put', this.uploadFile, this);
  53802. }
  53803. if (this.isOnlyChatStateNotification()) {
  53804. window.setTimeout(this.destroy.bind(this), 20000);
  53805. }
  53806. },
  53807. getVCardForChatroomOccupant() {
  53808. const chatbox = this.collection.chatbox,
  53809. nick = Strophe.getResourceFromJid(this.get('from'));
  53810. if (chatbox.get('nick') === nick) {
  53811. return _converse.xmppstatus.vcard;
  53812. } else {
  53813. let vcard;
  53814. if (this.get('vcard_jid')) {
  53815. vcard = _converse.vcards.findWhere({
  53816. 'jid': this.get('vcard_jid')
  53817. });
  53818. }
  53819. if (!vcard) {
  53820. let jid;
  53821. const occupant = chatbox.occupants.findWhere({
  53822. 'nick': nick
  53823. });
  53824. if (occupant && occupant.get('jid')) {
  53825. jid = occupant.get('jid');
  53826. this.save({
  53827. 'vcard_jid': jid
  53828. }, {
  53829. 'silent': true
  53830. });
  53831. } else {
  53832. jid = this.get('from');
  53833. }
  53834. vcard = _converse.vcards.findWhere({
  53835. 'jid': jid
  53836. }) || _converse.vcards.create({
  53837. 'jid': jid
  53838. });
  53839. }
  53840. return vcard;
  53841. }
  53842. },
  53843. setVCard() {
  53844. if (this.get('type') === 'error') {
  53845. return;
  53846. } else if (this.get('type') === 'groupchat') {
  53847. this.vcard = this.getVCardForChatroomOccupant();
  53848. } else {
  53849. const jid = this.get('from');
  53850. this.vcard = _converse.vcards.findWhere({
  53851. 'jid': jid
  53852. }) || _converse.vcards.create({
  53853. 'jid': jid
  53854. });
  53855. }
  53856. },
  53857. isOnlyChatStateNotification() {
  53858. return u.isOnlyChatStateNotification(this);
  53859. },
  53860. getDisplayName() {
  53861. if (this.get('type') === 'groupchat') {
  53862. return this.get('nick');
  53863. } else {
  53864. return this.vcard.get('fullname') || this.get('from');
  53865. }
  53866. },
  53867. sendSlotRequestStanza() {
  53868. /* Send out an IQ stanza to request a file upload slot.
  53869. *
  53870. * https://xmpp.org/extensions/xep-0363.html#request
  53871. */
  53872. if (_.isNil(this.file)) {
  53873. return Promise.reject(new Error("file is undefined"));
  53874. }
  53875. const iq = _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].env.$iq({
  53876. 'from': _converse.jid,
  53877. 'to': this.get('slot_request_url'),
  53878. 'type': 'get'
  53879. }).c('request', {
  53880. 'xmlns': Strophe.NS.HTTPUPLOAD,
  53881. 'filename': this.file.name,
  53882. 'size': this.file.size,
  53883. 'content-type': this.file.type
  53884. });
  53885. return _converse.api.sendIQ(iq);
  53886. },
  53887. async getRequestSlotURL() {
  53888. let stanza;
  53889. try {
  53890. stanza = await this.sendSlotRequestStanza();
  53891. } catch (e) {
  53892. _converse.log(e, Strophe.LogLevel.ERROR);
  53893. return this.save({
  53894. 'type': 'error',
  53895. 'message': __("Sorry, could not determine upload URL.")
  53896. });
  53897. }
  53898. const slot = stanza.querySelector('slot');
  53899. if (slot) {
  53900. this.save({
  53901. 'get': slot.querySelector('get').getAttribute('url'),
  53902. 'put': slot.querySelector('put').getAttribute('url')
  53903. });
  53904. } else {
  53905. return this.save({
  53906. 'type': 'error',
  53907. 'message': __("Sorry, could not determine file upload URL.")
  53908. });
  53909. }
  53910. },
  53911. uploadFile() {
  53912. const xhr = new XMLHttpRequest();
  53913. xhr.onreadystatechange = () => {
  53914. if (xhr.readyState === XMLHttpRequest.DONE) {
  53915. _converse.log("Status: " + xhr.status, Strophe.LogLevel.INFO);
  53916. if (xhr.status === 200 || xhr.status === 201) {
  53917. this.save({
  53918. 'upload': _converse.SUCCESS,
  53919. 'oob_url': this.get('get'),
  53920. 'message': this.get('get')
  53921. });
  53922. } else {
  53923. xhr.onerror();
  53924. }
  53925. }
  53926. };
  53927. xhr.upload.addEventListener("progress", evt => {
  53928. if (evt.lengthComputable) {
  53929. this.set('progress', evt.loaded / evt.total);
  53930. }
  53931. }, false);
  53932. xhr.onerror = () => {
  53933. let message;
  53934. if (xhr.responseText) {
  53935. message = __('Sorry, could not succesfully upload your file. Your server’s response: "%1$s"', xhr.responseText);
  53936. } else {
  53937. message = __('Sorry, could not succesfully upload your file.');
  53938. }
  53939. this.save({
  53940. 'type': 'error',
  53941. 'upload': _converse.FAILURE,
  53942. 'message': message
  53943. });
  53944. };
  53945. xhr.open('PUT', this.get('put'), true);
  53946. xhr.setRequestHeader("Content-type", this.file.type);
  53947. xhr.send(this.file);
  53948. }
  53949. });
  53950. _converse.Messages = Backbone.Collection.extend({
  53951. model: _converse.Message,
  53952. comparator: 'time'
  53953. });
  53954. _converse.ChatBox = Backbone.Model.extend({
  53955. defaults() {
  53956. return {
  53957. 'bookmarked': false,
  53958. 'chat_state': undefined,
  53959. 'num_unread': 0,
  53960. 'type': _converse.PRIVATE_CHAT_TYPE,
  53961. 'message_type': 'chat',
  53962. 'url': '',
  53963. 'hidden': _.includes(['mobile', 'fullscreen'], _converse.view_mode)
  53964. };
  53965. },
  53966. initialize() {
  53967. const jid = this.get('jid');
  53968. if (!jid) {
  53969. // XXX: The `validate` method will prevent this model
  53970. // from being persisted if there's no jid, but that gets
  53971. // called after model instantiation, so we have to deal
  53972. // with invalid models here also.
  53973. //
  53974. // This happens when the controlbox is in browser storage,
  53975. // but we're in embedded mode.
  53976. return;
  53977. }
  53978. this.vcard = _converse.vcards.findWhere({
  53979. 'jid': jid
  53980. }) || _converse.vcards.create({
  53981. 'jid': jid
  53982. }); // XXX: this creates a dependency on converse-roster, which we
  53983. // probably shouldn't have here, so we should probably move
  53984. // ChatBox out of converse-chatboxes
  53985. this.presence = _converse.presences.findWhere({
  53986. 'jid': jid
  53987. }) || _converse.presences.create({
  53988. 'jid': jid
  53989. });
  53990. this.messages = new _converse.Messages();
  53991. const storage = _converse.config.get('storage');
  53992. this.messages.browserStorage = new Backbone.BrowserStorage[storage](b64_sha1(`converse.messages${jid}${_converse.bare_jid}`));
  53993. this.messages.chatbox = this;
  53994. this.messages.on('change:upload', message => {
  53995. if (message.get('upload') === _converse.SUCCESS) {
  53996. this.sendMessageStanza(this.createMessageStanza(message));
  53997. }
  53998. });
  53999. this.on('change:chat_state', this.sendChatState, this); // Models get saved immediately after creation, so no need to
  54000. // call `save` here.
  54001. this.set({
  54002. // The chat_state will be set to ACTIVE once the chat box is opened
  54003. // and we listen for change:chat_state, so shouldn't set it to ACTIVE here.
  54004. 'box_id': b64_sha1(this.get('jid')),
  54005. 'time_opened': this.get('time_opened') || moment().valueOf(),
  54006. 'user_id': Strophe.getNodeFromJid(this.get('jid'))
  54007. });
  54008. },
  54009. validate(attrs, options) {
  54010. const _converse = this.__super__._converse;
  54011. if (!attrs.jid) {
  54012. return 'Ignored ChatBox without JID';
  54013. }
  54014. },
  54015. getDisplayName() {
  54016. return this.vcard.get('fullname') || this.get('jid');
  54017. },
  54018. handleMessageCorrection(stanza) {
  54019. const replace = sizzle(`replace[xmlns="${Strophe.NS.MESSAGE_CORRECT}"]`, stanza).pop();
  54020. if (replace) {
  54021. const msgid = replace && replace.getAttribute('id') || stanza.getAttribute('id'),
  54022. message = msgid && this.messages.findWhere({
  54023. msgid
  54024. });
  54025. if (!message) {
  54026. // XXX: Looks like we received a correction for a
  54027. // non-existing message, probably due to MAM.
  54028. // Not clear what can be done about this... we'll
  54029. // just create it as a separate message for now.
  54030. return false;
  54031. }
  54032. const older_versions = message.get('older_versions') || [];
  54033. older_versions.push(message.get('message'));
  54034. message.save({
  54035. 'message': _converse.chatboxes.getMessageBody(stanza),
  54036. 'references': this.getReferencesFromStanza(stanza),
  54037. 'older_versions': older_versions,
  54038. 'edited': moment().format()
  54039. });
  54040. return true;
  54041. }
  54042. return false;
  54043. },
  54044. handleReceipt(stanza) {
  54045. const to_bare_jid = Strophe.getBareJidFromJid(stanza.getAttribute('to'));
  54046. if (to_bare_jid === _converse.bare_jid) {
  54047. const receipt = sizzle(`received[xmlns="${Strophe.NS.RECEIPTS}"]`, stanza).pop();
  54048. if (receipt) {
  54049. const msgid = receipt && receipt.getAttribute('id'),
  54050. message = msgid && this.messages.findWhere({
  54051. msgid
  54052. });
  54053. if (message && !message.get('received')) {
  54054. message.save({
  54055. 'received': moment().format()
  54056. });
  54057. }
  54058. return true;
  54059. }
  54060. }
  54061. return false;
  54062. },
  54063. createMessageStanza(message) {
  54064. /* Given a _converse.Message Backbone.Model, return the XML
  54065. * stanza that represents it.
  54066. *
  54067. * Parameters:
  54068. * (Object) message - The Backbone.Model representing the message
  54069. */
  54070. const stanza = $msg({
  54071. 'from': _converse.connection.jid,
  54072. 'to': this.get('jid'),
  54073. 'type': this.get('message_type'),
  54074. 'id': message.get('edited') && _converse.connection.getUniqueId() || message.get('msgid')
  54075. }).c('body').t(message.get('message')).up().c(_converse.ACTIVE, {
  54076. 'xmlns': Strophe.NS.CHATSTATES
  54077. }).up();
  54078. if (message.get('type') === 'chat') {
  54079. stanza.c('request', {
  54080. 'xmlns': Strophe.NS.RECEIPTS
  54081. }).up();
  54082. }
  54083. if (message.get('is_spoiler')) {
  54084. if (message.get('spoiler_hint')) {
  54085. stanza.c('spoiler', {
  54086. 'xmlns': Strophe.NS.SPOILER
  54087. }, message.get('spoiler_hint')).up();
  54088. } else {
  54089. stanza.c('spoiler', {
  54090. 'xmlns': Strophe.NS.SPOILER
  54091. }).up();
  54092. }
  54093. }
  54094. (message.get('references') || []).forEach(reference => {
  54095. const attrs = {
  54096. 'xmlns': Strophe.NS.REFERENCE,
  54097. 'begin': reference.begin,
  54098. 'end': reference.end,
  54099. 'type': reference.type
  54100. };
  54101. if (reference.uri) {
  54102. attrs.uri = reference.uri;
  54103. }
  54104. stanza.c('reference', attrs).up();
  54105. });
  54106. if (message.get('oob_url')) {
  54107. stanza.c('x', {
  54108. 'xmlns': Strophe.NS.OUTOFBAND
  54109. }).c('url').t(message.get('oob_url')).up();
  54110. }
  54111. if (message.get('edited')) {
  54112. stanza.c('replace', {
  54113. 'xmlns': Strophe.NS.MESSAGE_CORRECT,
  54114. 'id': message.get('msgid')
  54115. }).up();
  54116. }
  54117. return stanza;
  54118. },
  54119. sendMessageStanza(stanza) {
  54120. _converse.api.send(stanza);
  54121. if (_converse.forward_messages) {
  54122. // Forward the message, so that other connected resources are also aware of it.
  54123. _converse.api.send($msg({
  54124. 'to': _converse.bare_jid,
  54125. 'type': this.get('message_type')
  54126. }).c('forwarded', {
  54127. 'xmlns': Strophe.NS.FORWARD
  54128. }).c('delay', {
  54129. 'xmns': Strophe.NS.DELAY,
  54130. 'stamp': moment().format()
  54131. }).up().cnode(stanza.tree()));
  54132. }
  54133. },
  54134. getOutgoingMessageAttributes(text, spoiler_hint) {
  54135. const is_spoiler = this.get('composing_spoiler');
  54136. return _.extend(this.toJSON(), {
  54137. 'id': _converse.connection.getUniqueId(),
  54138. 'fullname': _converse.xmppstatus.get('fullname'),
  54139. 'from': _converse.bare_jid,
  54140. 'sender': 'me',
  54141. 'time': moment().format(),
  54142. 'message': text ? u.httpToGeoUri(u.shortnameToUnicode(text), _converse) : undefined,
  54143. 'is_spoiler': is_spoiler,
  54144. 'spoiler_hint': is_spoiler ? spoiler_hint : undefined,
  54145. 'type': this.get('message_type')
  54146. });
  54147. },
  54148. sendMessage(attrs) {
  54149. /* Responsible for sending off a text message.
  54150. *
  54151. * Parameters:
  54152. * (Message) message - The chat message
  54153. */
  54154. let message = this.messages.findWhere('correcting');
  54155. if (message) {
  54156. const older_versions = message.get('older_versions') || [];
  54157. older_versions.push(message.get('message'));
  54158. message.save({
  54159. 'correcting': false,
  54160. 'edited': moment().format(),
  54161. 'message': attrs.message,
  54162. 'older_versions': older_versions,
  54163. 'references': attrs.references
  54164. });
  54165. } else {
  54166. message = this.messages.create(attrs);
  54167. }
  54168. return this.sendMessageStanza(this.createMessageStanza(message));
  54169. },
  54170. sendChatState() {
  54171. /* Sends a message with the status of the user in this chat session
  54172. * as taken from the 'chat_state' attribute of the chat box.
  54173. * See XEP-0085 Chat State Notifications.
  54174. */
  54175. if (_converse.send_chat_state_notifications && this.get('chat_state')) {
  54176. _converse.api.send($msg({
  54177. 'id': _converse.connection.getUniqueId(),
  54178. 'to': this.get('jid'),
  54179. 'type': 'chat'
  54180. }).c(this.get('chat_state'), {
  54181. 'xmlns': Strophe.NS.CHATSTATES
  54182. }).up().c('no-store', {
  54183. 'xmlns': Strophe.NS.HINTS
  54184. }).up().c('no-permanent-store', {
  54185. 'xmlns': Strophe.NS.HINTS
  54186. }));
  54187. }
  54188. },
  54189. async sendFiles(files) {
  54190. const result = await _converse.api.disco.supports(Strophe.NS.HTTPUPLOAD, _converse.domain),
  54191. item = result.pop();
  54192. if (!item) {
  54193. this.messages.create({
  54194. 'message': __("Sorry, looks like file upload is not supported by your server."),
  54195. 'type': 'error'
  54196. });
  54197. return;
  54198. }
  54199. const data = item.dataforms.where({
  54200. 'FORM_TYPE': {
  54201. 'value': Strophe.NS.HTTPUPLOAD,
  54202. 'type': "hidden"
  54203. }
  54204. }).pop(),
  54205. max_file_size = window.parseInt(_.get(data, 'attributes.max-file-size.value')),
  54206. slot_request_url = _.get(item, 'id');
  54207. if (!slot_request_url) {
  54208. this.messages.create({
  54209. 'message': __("Sorry, looks like file upload is not supported by your server."),
  54210. 'type': 'error'
  54211. });
  54212. return;
  54213. }
  54214. _.each(files, file => {
  54215. if (!window.isNaN(max_file_size) && window.parseInt(file.size) > max_file_size) {
  54216. return this.messages.create({
  54217. 'message': __('The size of your file, %1$s, exceeds the maximum allowed by your server, which is %2$s.', file.name, filesize__WEBPACK_IMPORTED_MODULE_3___default()(max_file_size)),
  54218. 'type': 'error'
  54219. });
  54220. } else {
  54221. const message = this.messages.create(_.extend(this.getOutgoingMessageAttributes(), {
  54222. 'file': true,
  54223. 'progress': 0,
  54224. 'slot_request_url': slot_request_url
  54225. }), {
  54226. 'silent': true
  54227. });
  54228. message.file = file;
  54229. this.messages.trigger('add', message);
  54230. message.getRequestSlotURL();
  54231. }
  54232. });
  54233. },
  54234. getReferencesFromStanza(stanza) {
  54235. const text = _.propertyOf(stanza.querySelector('body'))('textContent');
  54236. return sizzle(`reference[xmlns="${Strophe.NS.REFERENCE}"]`, stanza).map(ref => {
  54237. const begin = ref.getAttribute('begin'),
  54238. end = ref.getAttribute('end');
  54239. return {
  54240. 'begin': begin,
  54241. 'end': end,
  54242. 'type': ref.getAttribute('type'),
  54243. 'value': text.slice(begin, end),
  54244. 'uri': ref.getAttribute('uri')
  54245. };
  54246. });
  54247. },
  54248. getMessageAttributesFromStanza(stanza, original_stanza) {
  54249. /* Parses a passed in message stanza and returns an object
  54250. * of attributes.
  54251. *
  54252. * Parameters:
  54253. * (XMLElement) stanza - The message stanza
  54254. * (XMLElement) delay - The <delay> node from the
  54255. * stanza, if there was one.
  54256. * (XMLElement) original_stanza - The original stanza,
  54257. * that contains the message stanza, if it was
  54258. * contained, otherwise it's the message stanza itself.
  54259. */
  54260. const archive = sizzle(`result[xmlns="${Strophe.NS.MAM}"]`, original_stanza).pop(),
  54261. spoiler = sizzle(`spoiler[xmlns="${Strophe.NS.SPOILER}"]`, original_stanza).pop(),
  54262. delay = sizzle(`delay[xmlns="${Strophe.NS.DELAY}"]`, original_stanza).pop(),
  54263. chat_state = stanza.getElementsByTagName(_converse.COMPOSING).length && _converse.COMPOSING || stanza.getElementsByTagName(_converse.PAUSED).length && _converse.PAUSED || stanza.getElementsByTagName(_converse.INACTIVE).length && _converse.INACTIVE || stanza.getElementsByTagName(_converse.ACTIVE).length && _converse.ACTIVE || stanza.getElementsByTagName(_converse.GONE).length && _converse.GONE;
  54264. const attrs = {
  54265. 'chat_state': chat_state,
  54266. 'is_archived': !_.isNil(archive),
  54267. 'is_delayed': !_.isNil(delay),
  54268. 'is_spoiler': !_.isNil(spoiler),
  54269. 'message': _converse.chatboxes.getMessageBody(stanza) || undefined,
  54270. 'references': this.getReferencesFromStanza(stanza),
  54271. 'msgid': stanza.getAttribute('id'),
  54272. 'time': delay ? delay.getAttribute('stamp') : moment().format(),
  54273. 'type': stanza.getAttribute('type')
  54274. };
  54275. if (attrs.type === 'groupchat') {
  54276. attrs.from = stanza.getAttribute('from');
  54277. attrs.nick = Strophe.unescapeNode(Strophe.getResourceFromJid(attrs.from));
  54278. attrs.sender = attrs.nick === this.get('nick') ? 'me' : 'them';
  54279. } else {
  54280. attrs.from = Strophe.getBareJidFromJid(stanza.getAttribute('from'));
  54281. if (attrs.from === _converse.bare_jid) {
  54282. attrs.sender = 'me';
  54283. attrs.fullname = _converse.xmppstatus.get('fullname');
  54284. } else {
  54285. attrs.sender = 'them';
  54286. attrs.fullname = this.get('fullname');
  54287. }
  54288. }
  54289. _.each(sizzle(`x[xmlns="${Strophe.NS.OUTOFBAND}"]`, stanza), xform => {
  54290. attrs['oob_url'] = xform.querySelector('url').textContent;
  54291. attrs['oob_desc'] = xform.querySelector('url').textContent;
  54292. });
  54293. if (spoiler) {
  54294. attrs.spoiler_hint = spoiler.textContent.length > 0 ? spoiler.textContent : '';
  54295. }
  54296. return attrs;
  54297. },
  54298. async createMessage(message, original_stanza) {
  54299. /* Create a Backbone.Message object inside this chat box
  54300. * based on the identified message stanza.
  54301. */
  54302. const attrs = await this.getMessageAttributesFromStanza(message, original_stanza),
  54303. is_csn = u.isOnlyChatStateNotification(attrs);
  54304. if (is_csn && (attrs.is_delayed || attrs.type === 'groupchat' && Strophe.getResourceFromJid(attrs.from) == this.get('nick'))) {
  54305. // XXX: MUC leakage
  54306. // No need showing delayed or our own CSN messages
  54307. return;
  54308. } else if (!is_csn && !attrs.file && !attrs.plaintext && !attrs.message && !attrs.oob_url && attrs.type !== 'error') {
  54309. // TODO: handle <subject> messages (currently being done by ChatRoom)
  54310. return;
  54311. } else {
  54312. return this.messages.create(attrs);
  54313. }
  54314. },
  54315. isHidden() {
  54316. /* Returns a boolean to indicate whether a newly received
  54317. * message will be visible to the user or not.
  54318. */
  54319. return this.get('hidden') || this.get('minimized') || this.isScrolledUp() || _converse.windowState === 'hidden';
  54320. },
  54321. incrementUnreadMsgCounter(message) {
  54322. /* Given a newly received message, update the unread counter if
  54323. * necessary.
  54324. */
  54325. if (!message) {
  54326. return;
  54327. }
  54328. if (_.isNil(message.get('message'))) {
  54329. return;
  54330. }
  54331. if (utils.isNewMessage(message) && this.isHidden()) {
  54332. this.save({
  54333. 'num_unread': this.get('num_unread') + 1
  54334. });
  54335. _converse.incrementMsgCounter();
  54336. }
  54337. },
  54338. clearUnreadMsgCounter() {
  54339. u.safeSave(this, {
  54340. 'num_unread': 0
  54341. });
  54342. },
  54343. isScrolledUp() {
  54344. return this.get('scrolled', true);
  54345. }
  54346. });
  54347. _converse.ChatBoxes = Backbone.Collection.extend({
  54348. comparator: 'time_opened',
  54349. model(attrs, options) {
  54350. return new _converse.ChatBox(attrs, options);
  54351. },
  54352. registerMessageHandler() {
  54353. _converse.connection.addHandler(stanza => {
  54354. this.onMessage(stanza);
  54355. return true;
  54356. }, null, 'message', 'chat');
  54357. _converse.connection.addHandler(stanza => {
  54358. // Message receipts are usually without the `type` attribute. See #1353
  54359. if (!_.isNull(stanza.getAttribute('type'))) {
  54360. // TODO: currently Strophe has no way to register a handler
  54361. // for stanzas without a `type` attribute.
  54362. // We could update it to accept null to mean no attribute,
  54363. // but that would be a backward-incompatible chnge
  54364. return true; // Gets handled above.
  54365. }
  54366. this.onMessage(stanza);
  54367. return true;
  54368. }, Strophe.NS.RECEIPTS, 'message');
  54369. _converse.connection.addHandler(stanza => {
  54370. this.onErrorMessage(stanza);
  54371. return true;
  54372. }, null, 'message', 'error');
  54373. },
  54374. chatBoxMayBeShown(chatbox) {
  54375. return true;
  54376. },
  54377. onChatBoxesFetched(collection) {
  54378. /* Show chat boxes upon receiving them from sessionStorage */
  54379. collection.each(chatbox => {
  54380. if (this.chatBoxMayBeShown(chatbox)) {
  54381. chatbox.trigger('show');
  54382. }
  54383. });
  54384. _converse.emit('chatBoxesFetched');
  54385. },
  54386. onConnected() {
  54387. this.browserStorage = new Backbone.BrowserStorage.session(`converse.chatboxes-${_converse.bare_jid}`);
  54388. this.registerMessageHandler();
  54389. this.fetch({
  54390. 'add': true,
  54391. 'success': this.onChatBoxesFetched.bind(this)
  54392. });
  54393. },
  54394. onErrorMessage(message) {
  54395. /* Handler method for all incoming error message stanzas
  54396. */
  54397. const from_jid = Strophe.getBareJidFromJid(message.getAttribute('from'));
  54398. if (utils.isSameBareJID(from_jid, _converse.bare_jid)) {
  54399. return true;
  54400. }
  54401. const chatbox = this.getChatBox(from_jid);
  54402. if (!chatbox) {
  54403. return true;
  54404. }
  54405. const id = message.getAttribute('id');
  54406. if (id) {
  54407. const msgs = chatbox.messages.where({
  54408. 'msgid': id
  54409. });
  54410. if (!msgs.length || msgs.filter(m => m.get('type') === 'error').length) {
  54411. // If the error refers to a message not included in our store.
  54412. // We assume that this was a CSI message (which we don't store).
  54413. // See https://github.com/conversejs/converse.js/issues/1317
  54414. //
  54415. // We also ignore duplicate error messages.
  54416. return;
  54417. }
  54418. } else {
  54419. // An error message without id likely means that we
  54420. // sent a message without id (which shouldn't happen).
  54421. _converse.log('Received an error message without id attribute!', Strophe.LogLevel.ERROR);
  54422. _converse.log(message, Strophe.LogLevel.ERROR);
  54423. }
  54424. chatbox.createMessage(message, message);
  54425. return true;
  54426. },
  54427. getMessageBody(stanza) {
  54428. /* Given a message stanza, return the text contained in its body.
  54429. */
  54430. const type = stanza.getAttribute('type');
  54431. if (type === 'error') {
  54432. const error = stanza.querySelector('error');
  54433. return _.propertyOf(error.querySelector('text'))('textContent') || __('Sorry, an error occurred:') + ' ' + error.innerHTML;
  54434. } else {
  54435. return _.propertyOf(stanza.querySelector('body'))('textContent');
  54436. }
  54437. },
  54438. sendReceiptStanza(to_jid, id) {
  54439. const receipt_stanza = $msg({
  54440. 'from': _converse.connection.jid,
  54441. 'id': _converse.connection.getUniqueId(),
  54442. 'to': to_jid,
  54443. 'type': 'chat'
  54444. }).c('received', {
  54445. 'xmlns': Strophe.NS.RECEIPTS,
  54446. 'id': id
  54447. }).up().c('store', {
  54448. 'xmlns': Strophe.NS.HINTS
  54449. }).up();
  54450. _converse.api.send(receipt_stanza);
  54451. },
  54452. onMessage(stanza) {
  54453. /* Handler method for all incoming single-user chat "message"
  54454. * stanzas.
  54455. *
  54456. * Parameters:
  54457. * (XMLElement) stanza - The incoming message stanza
  54458. */
  54459. let to_jid = stanza.getAttribute('to');
  54460. const to_resource = Strophe.getResourceFromJid(to_jid);
  54461. if (_converse.filter_by_resource && to_resource && to_resource !== _converse.resource) {
  54462. _converse.log(`onMessage: Ignoring incoming message intended for a different resource: ${to_jid}`, Strophe.LogLevel.INFO);
  54463. return true;
  54464. } else if (utils.isHeadlineMessage(_converse, stanza)) {
  54465. // XXX: Ideally we wouldn't have to check for headline
  54466. // messages, but Prosody sends headline messages with the
  54467. // wrong type ('chat'), so we need to filter them out here.
  54468. _converse.log(`onMessage: Ignoring incoming headline message from JID: ${stanza.getAttribute('from')}`, Strophe.LogLevel.INFO);
  54469. return true;
  54470. }
  54471. let from_jid = stanza.getAttribute('from'),
  54472. is_carbon = false;
  54473. const forwarded = stanza.querySelector('forwarded'),
  54474. original_stanza = stanza;
  54475. if (!_.isNull(forwarded)) {
  54476. const forwarded_message = forwarded.querySelector('message'),
  54477. forwarded_from = forwarded_message.getAttribute('from');
  54478. is_carbon = !_.isNull(stanza.querySelector(`received[xmlns="${Strophe.NS.CARBONS}"]`));
  54479. if (is_carbon && Strophe.getBareJidFromJid(forwarded_from) !== from_jid) {
  54480. // Prevent message forging via carbons
  54481. // https://xmpp.org/extensions/xep-0280.html#security
  54482. return true;
  54483. }
  54484. stanza = forwarded_message;
  54485. from_jid = stanza.getAttribute('from');
  54486. to_jid = stanza.getAttribute('to');
  54487. }
  54488. const from_bare_jid = Strophe.getBareJidFromJid(from_jid),
  54489. from_resource = Strophe.getResourceFromJid(from_jid),
  54490. is_me = from_bare_jid === _converse.bare_jid;
  54491. const requests_receipt = !_.isUndefined(sizzle(`request[xmlns="${Strophe.NS.RECEIPTS}"]`, stanza).pop());
  54492. if (requests_receipt && !is_carbon && !is_me) {
  54493. this.sendReceiptStanza(from_jid, stanza.getAttribute('id'));
  54494. }
  54495. let contact_jid;
  54496. if (is_me) {
  54497. // I am the sender, so this must be a forwarded message...
  54498. if (_.isNull(to_jid)) {
  54499. return _converse.log(`Don't know how to handle message stanza without 'to' attribute. ${stanza.outerHTML}`, Strophe.LogLevel.ERROR);
  54500. }
  54501. contact_jid = Strophe.getBareJidFromJid(to_jid);
  54502. } else {
  54503. contact_jid = from_bare_jid;
  54504. }
  54505. const attrs = {
  54506. 'fullname': _.get(_converse.api.contacts.get(contact_jid), 'attributes.fullname') // Get chat box, but only create a new one when the message has a body.
  54507. };
  54508. const has_body = sizzle(`body, encrypted[xmlns="${Strophe.NS.OMEMO}"]`).length > 0;
  54509. const chatbox = this.getChatBox(contact_jid, attrs, has_body);
  54510. if (chatbox && !chatbox.handleMessageCorrection(stanza) && !chatbox.handleReceipt(stanza)) {
  54511. const msgid = stanza.getAttribute('id'),
  54512. message = msgid && chatbox.messages.findWhere({
  54513. msgid
  54514. });
  54515. if (!message) {
  54516. // Only create the message when we're sure it's not a duplicate
  54517. chatbox.createMessage(stanza, original_stanza).then(msg => chatbox.incrementUnreadMsgCounter(msg)).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
  54518. }
  54519. }
  54520. _converse.emit('message', {
  54521. 'stanza': original_stanza,
  54522. 'chatbox': chatbox
  54523. });
  54524. return true;
  54525. },
  54526. getChatBox(jid, attrs = {}, create) {
  54527. /* Returns a chat box or optionally return a newly
  54528. * created one if one doesn't exist.
  54529. *
  54530. * Parameters:
  54531. * (String) jid - The JID of the user whose chat box we want
  54532. * (Boolean) create - Should a new chat box be created if none exists?
  54533. * (Object) attrs - Optional chat box atributes.
  54534. */
  54535. if (_.isObject(jid)) {
  54536. create = attrs;
  54537. attrs = jid;
  54538. jid = attrs.jid;
  54539. }
  54540. jid = Strophe.getBareJidFromJid(jid.toLowerCase());
  54541. let chatbox = this.get(Strophe.getBareJidFromJid(jid));
  54542. if (!chatbox && create) {
  54543. _.extend(attrs, {
  54544. 'jid': jid,
  54545. 'id': jid
  54546. });
  54547. chatbox = this.create(attrs, {
  54548. 'error'(model, response) {
  54549. _converse.log(response.responseText);
  54550. }
  54551. });
  54552. }
  54553. return chatbox;
  54554. }
  54555. });
  54556. function autoJoinChats() {
  54557. /* Automatically join private chats, based on the
  54558. * "auto_join_private_chats" configuration setting.
  54559. */
  54560. _.each(_converse.auto_join_private_chats, function (jid) {
  54561. if (_converse.chatboxes.where({
  54562. 'jid': jid
  54563. }).length) {
  54564. return;
  54565. }
  54566. if (_.isString(jid)) {
  54567. _converse.api.chats.open(jid);
  54568. } else {
  54569. _converse.log('Invalid jid criteria specified for "auto_join_private_chats"', Strophe.LogLevel.ERROR);
  54570. }
  54571. });
  54572. _converse.emit('privateChatsAutoJoined');
  54573. }
  54574. /************************ BEGIN Event Handlers ************************/
  54575. _converse.on('chatBoxesFetched', autoJoinChats);
  54576. _converse.on('addClientFeatures', () => {
  54577. _converse.api.disco.own.features.add(Strophe.NS.MESSAGE_CORRECT);
  54578. _converse.api.disco.own.features.add(Strophe.NS.HTTPUPLOAD);
  54579. _converse.api.disco.own.features.add(Strophe.NS.OUTOFBAND);
  54580. });
  54581. _converse.api.listen.on('pluginsInitialized', () => {
  54582. _converse.chatboxes = new _converse.ChatBoxes();
  54583. _converse.emit('chatBoxesInitialized');
  54584. });
  54585. _converse.api.listen.on('presencesInitialized', () => _converse.chatboxes.onConnected());
  54586. /************************ END Event Handlers ************************/
  54587. /************************ BEGIN API ************************/
  54588. _.extend(_converse.api, {
  54589. /**
  54590. * The "chats" namespace (used for one-on-one chats)
  54591. *
  54592. * @namespace _converse.api.chats
  54593. * @memberOf _converse.api
  54594. */
  54595. 'chats': {
  54596. /**
  54597. * @method _converse.api.chats.create
  54598. * @param {string|string[]} jid|jids An jid or array of jids
  54599. * @param {object} attrs An object containing configuration attributes.
  54600. */
  54601. 'create'(jids, attrs) {
  54602. if (_.isUndefined(jids)) {
  54603. _converse.log("chats.create: You need to provide at least one JID", Strophe.LogLevel.ERROR);
  54604. return null;
  54605. }
  54606. if (_.isString(jids)) {
  54607. if (attrs && !_.get(attrs, 'fullname')) {
  54608. attrs.fullname = _.get(_converse.api.contacts.get(jids), 'attributes.fullname');
  54609. }
  54610. const chatbox = _converse.chatboxes.getChatBox(jids, attrs, true);
  54611. if (_.isNil(chatbox)) {
  54612. _converse.log("Could not open chatbox for JID: " + jids, Strophe.LogLevel.ERROR);
  54613. return;
  54614. }
  54615. return chatbox;
  54616. }
  54617. return _.map(jids, jid => {
  54618. attrs.fullname = _.get(_converse.api.contacts.get(jid), 'attributes.fullname');
  54619. return _converse.chatboxes.getChatBox(jid, attrs, true).trigger('show');
  54620. });
  54621. },
  54622. /**
  54623. * Opens a new one-on-one chat.
  54624. *
  54625. * @method _converse.api.chats.open
  54626. * @param {String|string[]} name - e.g. 'buddy@example.com' or ['buddy1@example.com', 'buddy2@example.com']
  54627. * @returns {Promise} Promise which resolves with the Backbone.Model representing the chat.
  54628. *
  54629. * @example
  54630. * // To open a single chat, provide the JID of the contact you're chatting with in that chat:
  54631. * converse.plugins.add('myplugin', {
  54632. * initialize: function() {
  54633. * var _converse = this._converse;
  54634. * // Note, buddy@example.org must be in your contacts roster!
  54635. * _converse.api.chats.open('buddy@example.com').then((chat) => {
  54636. * // Now you can do something with the chat model
  54637. * });
  54638. * }
  54639. * });
  54640. *
  54641. * @example
  54642. * // To open an array of chats, provide an array of JIDs:
  54643. * converse.plugins.add('myplugin', {
  54644. * initialize: function () {
  54645. * var _converse = this._converse;
  54646. * // Note, these users must first be in your contacts roster!
  54647. * _converse.api.chats.open(['buddy1@example.com', 'buddy2@example.com']).then((chats) => {
  54648. * // Now you can do something with the chat models
  54649. * });
  54650. * }
  54651. * });
  54652. *
  54653. */
  54654. 'open'(jids, attrs) {
  54655. return new Promise((resolve, reject) => {
  54656. Promise.all([_converse.api.waitUntil('rosterContactsFetched'), _converse.api.waitUntil('chatBoxesFetched')]).then(() => {
  54657. if (_.isUndefined(jids)) {
  54658. const err_msg = "chats.open: You need to provide at least one JID";
  54659. _converse.log(err_msg, Strophe.LogLevel.ERROR);
  54660. reject(new Error(err_msg));
  54661. } else if (_.isString(jids)) {
  54662. resolve(_converse.api.chats.create(jids, attrs).trigger('show'));
  54663. } else {
  54664. resolve(_.map(jids, jid => _converse.api.chats.create(jid, attrs).trigger('show')));
  54665. }
  54666. }).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
  54667. });
  54668. },
  54669. /**
  54670. * Returns a chat model. The chat should already be open.
  54671. *
  54672. * @method _converse.api.chats.get
  54673. * @param {String|string[]} name - e.g. 'buddy@example.com' or ['buddy1@example.com', 'buddy2@example.com']
  54674. * @returns {Backbone.Model}
  54675. *
  54676. * @example
  54677. * // To return a single chat, provide the JID of the contact you're chatting with in that chat:
  54678. * const model = _converse.api.chats.get('buddy@example.com');
  54679. *
  54680. * @example
  54681. * // To return an array of chats, provide an array of JIDs:
  54682. * const models = _converse.api.chats.get(['buddy1@example.com', 'buddy2@example.com']);
  54683. *
  54684. * @example
  54685. * // To return all open chats, call the method without any parameters::
  54686. * const models = _converse.api.chats.get();
  54687. *
  54688. */
  54689. 'get'(jids) {
  54690. if (_.isUndefined(jids)) {
  54691. const result = [];
  54692. _converse.chatboxes.each(function (chatbox) {
  54693. // FIXME: Leaky abstraction from MUC. We need to add a
  54694. // base type for chat boxes, and check for that.
  54695. if (chatbox.get('type') !== _converse.CHATROOMS_TYPE) {
  54696. result.push(chatbox);
  54697. }
  54698. });
  54699. return result;
  54700. } else if (_.isString(jids)) {
  54701. return _converse.chatboxes.getChatBox(jids);
  54702. }
  54703. return _.map(jids, _.partial(_converse.chatboxes.getChatBox.bind(_converse.chatboxes), _, {}, true));
  54704. }
  54705. }
  54706. });
  54707. /************************ END API ************************/
  54708. }
  54709. });
  54710. /***/ }),
  54711. /***/ "./src/headless/converse-core.js":
  54712. /*!***************************************!*\
  54713. !*** ./src/headless/converse-core.js ***!
  54714. \***************************************/
  54715. /*! exports provided: default */
  54716. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54717. "use strict";
  54718. __webpack_require__.r(__webpack_exports__);
  54719. /* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.js");
  54720. /* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(strophe_js__WEBPACK_IMPORTED_MODULE_0__);
  54721. /* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! backbone */ "./node_modules/backbone/backbone.js");
  54722. /* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(backbone__WEBPACK_IMPORTED_MODULE_1__);
  54723. /* harmony import */ var backbone_browserStorage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! backbone.browserStorage */ "./node_modules/backbone.browserStorage/backbone.browserStorage.js");
  54724. /* harmony import */ var backbone_browserStorage__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(backbone_browserStorage__WEBPACK_IMPORTED_MODULE_2__);
  54725. /* harmony import */ var es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! es6-promise/dist/es6-promise.auto */ "./node_modules/es6-promise/dist/es6-promise.auto.js");
  54726. /* harmony import */ var es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_3__);
  54727. /* harmony import */ var _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lodash.noconflict */ "./src/headless/lodash.noconflict.js");
  54728. /* harmony import */ var _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4__);
  54729. /* harmony import */ var _lodash_fp__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lodash.fp */ "./src/headless/lodash.fp.js");
  54730. /* harmony import */ var _lodash_fp__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lodash_fp__WEBPACK_IMPORTED_MODULE_5__);
  54731. /* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./i18n */ "./src/headless/i18n.js");
  54732. /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
  54733. /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_7__);
  54734. /* harmony import */ var pluggable_js_dist_pluggable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! pluggable.js/dist/pluggable */ "./node_modules/pluggable.js/dist/pluggable.js");
  54735. /* harmony import */ var pluggable_js_dist_pluggable__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(pluggable_js_dist_pluggable__WEBPACK_IMPORTED_MODULE_8__);
  54736. /* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./polyfill */ "./src/headless/polyfill.js");
  54737. /* harmony import */ var _polyfill__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_polyfill__WEBPACK_IMPORTED_MODULE_9__);
  54738. /* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
  54739. /* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_10__);
  54740. /* harmony import */ var _converse_headless_utils_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @converse/headless/utils/core */ "./src/headless/utils/core.js");
  54741. // Converse.js
  54742. // https://conversejs.org
  54743. //
  54744. // Copyright (c) 2013-2018, the Converse.js developers
  54745. // Licensed under the Mozilla Public License (MPLv2)
  54746. Backbone = backbone__WEBPACK_IMPORTED_MODULE_1___default.a.noConflict(); // Strophe globals
  54747. const b64_sha1 = strophe_js__WEBPACK_IMPORTED_MODULE_0__["SHA1"].b64_sha1; // Add Strophe Namespaces
  54748. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('CARBONS', 'urn:xmpp:carbons:2');
  54749. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('CHATSTATES', 'http://jabber.org/protocol/chatstates');
  54750. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('CSI', 'urn:xmpp:csi:0');
  54751. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('DELAY', 'urn:xmpp:delay');
  54752. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('FORWARD', 'urn:xmpp:forward:0');
  54753. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('HINTS', 'urn:xmpp:hints');
  54754. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('HTTPUPLOAD', 'urn:xmpp:http:upload:0');
  54755. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('IDLE', 'urn:xmpp:idle:1');
  54756. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('MAM', 'urn:xmpp:mam:2');
  54757. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('NICK', 'http://jabber.org/protocol/nick');
  54758. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('OMEMO', "eu.siacs.conversations.axolotl");
  54759. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('OUTOFBAND', 'jabber:x:oob');
  54760. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('PUBSUB', 'http://jabber.org/protocol/pubsub');
  54761. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('REGISTER', 'jabber:iq:register');
  54762. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('ROSTERX', 'http://jabber.org/protocol/rosterx');
  54763. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('RSM', 'http://jabber.org/protocol/rsm');
  54764. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('SID', 'urn:xmpp:sid:0');
  54765. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('SPOILER', 'urn:xmpp:spoiler:0');
  54766. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('VCARD', 'vcard-temp');
  54767. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('VCARDUPDATE', 'vcard-temp:x:update');
  54768. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].addNamespace('XFORM', 'jabber:x:data'); // Use Mustache style syntax for variable interpolation
  54769. /* Configuration of Lodash templates (this config is distinct to the
  54770. * config of requirejs-tpl in main.js). This one is for normal inline templates.
  54771. */
  54772. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.templateSettings = {
  54773. 'escape': /\{\{\{([\s\S]+?)\}\}\}/g,
  54774. 'evaluate': /\{\[([\s\S]+?)\]\}/g,
  54775. 'interpolate': /\{\{([\s\S]+?)\}\}/g,
  54776. 'imports': {
  54777. '_': _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a
  54778. }
  54779. }; // Setting wait to 59 instead of 60 to avoid timing conflicts with the
  54780. // webserver, which is often also set to 60 and might therefore sometimes
  54781. // return a 504 error page instead of passing through to the BOSH proxy.
  54782. const BOSH_WAIT = 59;
  54783. /**
  54784. * A private, closured object containing the private api (via `_converse.api`)
  54785. * as well as private methods and internal data-structures.
  54786. *
  54787. * @namespace _converse
  54788. */
  54789. const _converse = {
  54790. 'templates': {},
  54791. 'promises': {}
  54792. };
  54793. _converse.VERSION_NAME = "v4.0.6";
  54794. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.extend(_converse, Backbone.Events); // Make converse pluggable
  54795. pluggable_js_dist_pluggable__WEBPACK_IMPORTED_MODULE_8___default.a.enable(_converse, '_converse', 'pluggable'); // Core plugins are whitelisted automatically
  54796. // These are just the @converse/headless plugins, for the full converse,
  54797. // the other plugins are whitelisted in src/converse.js
  54798. _converse.core_plugins = ['converse-chatboxes', 'converse-core', 'converse-disco', 'converse-mam', 'converse-muc', 'converse-ping', 'converse-roster', 'converse-vcard'];
  54799. _converse.keycodes = {
  54800. TAB: 9,
  54801. ENTER: 13,
  54802. SHIFT: 16,
  54803. CTRL: 17,
  54804. ALT: 18,
  54805. ESCAPE: 27,
  54806. UP_ARROW: 38,
  54807. DOWN_ARROW: 40,
  54808. FORWARD_SLASH: 47,
  54809. AT: 50,
  54810. META: 91,
  54811. META_RIGHT: 93
  54812. }; // Module-level constants
  54813. _converse.STATUS_WEIGHTS = {
  54814. 'offline': 6,
  54815. 'unavailable': 5,
  54816. 'xa': 4,
  54817. 'away': 3,
  54818. 'dnd': 2,
  54819. 'chat': 1,
  54820. // We currently don't differentiate between "chat" and "online"
  54821. 'online': 1
  54822. };
  54823. _converse.PRETTY_CHAT_STATUS = {
  54824. 'offline': 'Offline',
  54825. 'unavailable': 'Unavailable',
  54826. 'xa': 'Extended Away',
  54827. 'away': 'Away',
  54828. 'dnd': 'Do not disturb',
  54829. 'chat': 'Chattty',
  54830. 'online': 'Online'
  54831. };
  54832. _converse.ANONYMOUS = "anonymous";
  54833. _converse.CLOSED = 'closed';
  54834. _converse.EXTERNAL = "external";
  54835. _converse.LOGIN = "login";
  54836. _converse.LOGOUT = "logout";
  54837. _converse.OPENED = 'opened';
  54838. _converse.PREBIND = "prebind";
  54839. _converse.IQ_TIMEOUT = 20000;
  54840. _converse.CONNECTION_STATUS = {
  54841. 0: 'ERROR',
  54842. 1: 'CONNECTING',
  54843. 2: 'CONNFAIL',
  54844. 3: 'AUTHENTICATING',
  54845. 4: 'AUTHFAIL',
  54846. 5: 'CONNECTED',
  54847. 6: 'DISCONNECTED',
  54848. 7: 'DISCONNECTING',
  54849. 8: 'ATTACHED',
  54850. 9: 'REDIRECT',
  54851. 10: 'RECONNECTING'
  54852. };
  54853. _converse.SUCCESS = 'success';
  54854. _converse.FAILURE = 'failure'; // Generated from css/images/user.svg
  54855. _converse.DEFAULT_IMAGE_TYPE = 'image/svg+xml';
  54856. _converse.DEFAULT_IMAGE = "PD94bWwgdmVyc2lvbj0iMS4wIj8+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCI+CiA8cmVjdCB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgZmlsbD0iIzU1NSIvPgogPGNpcmNsZSBjeD0iNjQiIGN5PSI0MSIgcj0iMjQiIGZpbGw9IiNmZmYiLz4KIDxwYXRoIGQ9Im0yOC41IDExMiB2LTEyIGMwLTEyIDEwLTI0IDI0LTI0IGgyMyBjMTQgMCAyNCAxMiAyNCAyNCB2MTIiIGZpbGw9IiNmZmYiLz4KPC9zdmc+Cg==";
  54857. _converse.TIMEOUTS = {
  54858. // Set as module attr so that we can override in tests.
  54859. 'PAUSED': 10000,
  54860. 'INACTIVE': 90000
  54861. }; // XEP-0085 Chat states
  54862. // http://xmpp.org/extensions/xep-0085.html
  54863. _converse.INACTIVE = 'inactive';
  54864. _converse.ACTIVE = 'active';
  54865. _converse.COMPOSING = 'composing';
  54866. _converse.PAUSED = 'paused';
  54867. _converse.GONE = 'gone'; // Chat types
  54868. _converse.PRIVATE_CHAT_TYPE = 'chatbox';
  54869. _converse.CHATROOMS_TYPE = 'chatroom';
  54870. _converse.HEADLINES_TYPE = 'headline';
  54871. _converse.CONTROLBOX_TYPE = 'controlbox'; // Default configuration values
  54872. // ----------------------------
  54873. _converse.default_settings = {
  54874. allow_non_roster_messaging: false,
  54875. animate: true,
  54876. authentication: 'login',
  54877. // Available values are "login", "prebind", "anonymous" and "external".
  54878. auto_away: 0,
  54879. // Seconds after which user status is set to 'away'
  54880. auto_login: false,
  54881. // Currently only used in connection with anonymous login
  54882. auto_reconnect: true,
  54883. auto_xa: 0,
  54884. // Seconds after which user status is set to 'xa'
  54885. blacklisted_plugins: [],
  54886. bosh_service_url: undefined,
  54887. connection_options: {},
  54888. credentials_url: null,
  54889. // URL from where login credentials can be fetched
  54890. csi_waiting_time: 0,
  54891. // Support for XEP-0352. Seconds before client is considered idle and CSI is sent out.
  54892. debug: false,
  54893. default_state: 'online',
  54894. expose_rid_and_sid: false,
  54895. geouri_regex: /https:\/\/www.openstreetmap.org\/.*#map=[0-9]+\/([\-0-9.]+)\/([\-0-9.]+)\S*/g,
  54896. geouri_replacement: 'https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2',
  54897. idle_presence_timeout: 300,
  54898. // Seconds after which an idle presence is sent
  54899. jid: undefined,
  54900. keepalive: true,
  54901. locales_url: 'locale/{{{locale}}}/LC_MESSAGES/converse.json',
  54902. locales: ['af', 'ar', 'bg', 'ca', 'cs', 'de', 'es', 'eu', 'en', 'fr', 'gl', 'he', 'hi', 'hu', 'id', 'it', 'ja', 'nb', 'nl', 'pl', 'pt_BR', 'ro', 'ru', 'tr', 'uk', 'zh_CN', 'zh_TW'],
  54903. message_carbons: true,
  54904. nickname: undefined,
  54905. password: undefined,
  54906. prebind_url: null,
  54907. priority: 0,
  54908. rid: undefined,
  54909. root: window.document,
  54910. sid: undefined,
  54911. strict_plugin_dependencies: false,
  54912. trusted: true,
  54913. view_mode: 'overlayed',
  54914. // Choices are 'overlayed', 'fullscreen', 'mobile'
  54915. websocket_url: undefined,
  54916. whitelisted_plugins: []
  54917. };
  54918. _converse.log = function (message, level, style = '') {
  54919. /* Logs messages to the browser's developer console.
  54920. *
  54921. * Parameters:
  54922. * (String) message - The message to be logged.
  54923. * (Integer) level - The loglevel which allows for filtering of log
  54924. * messages.
  54925. *
  54926. * Available loglevels are 0 for 'debug', 1 for 'info', 2 for 'warn',
  54927. * 3 for 'error' and 4 for 'fatal'.
  54928. *
  54929. * When using the 'error' or 'warn' loglevels, a full stacktrace will be
  54930. * logged as well.
  54931. */
  54932. if (level === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.ERROR || level === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.FATAL) {
  54933. style = style || 'color: maroon';
  54934. }
  54935. if (message instanceof Error) {
  54936. message = message.stack;
  54937. } else if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isElement(message)) {
  54938. message = message.outerHTML;
  54939. }
  54940. const prefix = style ? '%c' : '';
  54941. const logger = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.assign({
  54942. 'debug': _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.get(console, 'log') ? console.log.bind(console) : _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.noop,
  54943. 'error': _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.get(console, 'log') ? console.log.bind(console) : _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.noop,
  54944. 'info': _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.get(console, 'log') ? console.log.bind(console) : _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.noop,
  54945. 'warn': _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.get(console, 'log') ? console.log.bind(console) : _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.noop
  54946. }, console);
  54947. if (level === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.ERROR) {
  54948. logger.error(`${prefix} ERROR: ${message}`, style);
  54949. } else if (level === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.WARN) {
  54950. if (_converse.debug) {
  54951. logger.warn(`${prefix} ${moment__WEBPACK_IMPORTED_MODULE_7___default()().format()} WARNING: ${message}`, style);
  54952. }
  54953. } else if (level === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.FATAL) {
  54954. logger.error(`${prefix} FATAL: ${message}`, style);
  54955. } else if (_converse.debug) {
  54956. if (level === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.DEBUG) {
  54957. logger.debug(`${prefix} ${moment__WEBPACK_IMPORTED_MODULE_7___default()().format()} DEBUG: ${message}`, style);
  54958. } else {
  54959. logger.info(`${prefix} ${moment__WEBPACK_IMPORTED_MODULE_7___default()().format()} INFO: ${message}`, style);
  54960. }
  54961. }
  54962. };
  54963. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].log = function (level, msg) {
  54964. _converse.log(level + ' ' + msg, level);
  54965. };
  54966. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].error = function (msg) {
  54967. _converse.log(msg, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.ERROR);
  54968. };
  54969. _converse.__ = function (str) {
  54970. /* Translate the given string based on the current locale.
  54971. *
  54972. * Parameters:
  54973. * (String) str - The string to translate.
  54974. */
  54975. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(_i18n__WEBPACK_IMPORTED_MODULE_6__["default"])) {
  54976. return str;
  54977. }
  54978. return _i18n__WEBPACK_IMPORTED_MODULE_6__["default"].translate.apply(_i18n__WEBPACK_IMPORTED_MODULE_6__["default"], arguments);
  54979. };
  54980. const __ = _converse.__;
  54981. const PROMISES = ['initialized', 'connectionInitialized', 'pluginsInitialized', 'statusInitialized'];
  54982. function addPromise(promise) {
  54983. /* Private function, used to add a new promise to the ones already
  54984. * available via the `waitUntil` api method.
  54985. */
  54986. _converse.promises[promise] = _converse_headless_utils_core__WEBPACK_IMPORTED_MODULE_11__["default"].getResolveablePromise();
  54987. }
  54988. _converse.emit = function (name) {
  54989. /* Event emitter and promise resolver */
  54990. _converse.trigger.apply(this, arguments);
  54991. const promise = _converse.promises[name];
  54992. if (!_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(promise)) {
  54993. promise.resolve();
  54994. }
  54995. };
  54996. _converse.isUniView = function () {
  54997. /* We distinguish between UniView and MultiView instances.
  54998. *
  54999. * UniView means that only one chat is visible, even though there might be multiple ongoing chats.
  55000. * MultiView means that multiple chats may be visible simultaneously.
  55001. */
  55002. return _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.includes(['mobile', 'fullscreen', 'embedded'], _converse.view_mode);
  55003. };
  55004. _converse.router = new Backbone.Router();
  55005. function initPlugins() {
  55006. // If initialize gets called a second time (e.g. during tests), then we
  55007. // need to re-apply all plugins (for a new converse instance), and we
  55008. // therefore need to clear this array that prevents plugins from being
  55009. // initialized twice.
  55010. // If initialize is called for the first time, then this array is empty
  55011. // in any case.
  55012. _converse.pluggable.initialized_plugins = [];
  55013. const whitelist = _converse.core_plugins.concat(_converse.whitelisted_plugins);
  55014. if (_converse.view_mode === 'embedded') {
  55015. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.forEach([// eslint-disable-line lodash/prefer-map
  55016. "converse-bookmarks", "converse-controlbox", "converse-headline", "converse-register"], name => {
  55017. _converse.blacklisted_plugins.push(name);
  55018. });
  55019. }
  55020. _converse.pluggable.initializePlugins({
  55021. 'updateSettings'() {
  55022. _converse.log("(DEPRECATION) " + "The `updateSettings` method has been deprecated. " + "Please use `_converse.api.settings.update` instead.", strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.WARN);
  55023. _converse.api.settings.update.apply(_converse, arguments);
  55024. },
  55025. '_converse': _converse
  55026. }, whitelist, _converse.blacklisted_plugins);
  55027. _converse.emit('pluginsInitialized');
  55028. }
  55029. function initClientConfig() {
  55030. /* The client config refers to configuration of the client which is
  55031. * independent of any particular user.
  55032. * What this means is that config values need to persist across
  55033. * user sessions.
  55034. */
  55035. const id = b64_sha1('converse.client-config');
  55036. _converse.config = new Backbone.Model({
  55037. 'id': id,
  55038. 'trusted': _converse.trusted && true || false,
  55039. 'storage': _converse.trusted ? 'local' : 'session'
  55040. });
  55041. _converse.config.browserStorage = new Backbone.BrowserStorage.session(id);
  55042. _converse.config.fetch();
  55043. _converse.emit('clientConfigInitialized');
  55044. }
  55045. _converse.initConnection = function () {
  55046. /* Creates a new Strophe.Connection instance if we don't already have one.
  55047. */
  55048. if (!_converse.connection) {
  55049. if (!_converse.bosh_service_url && !_converse.websocket_url) {
  55050. throw new Error("initConnection: you must supply a value for either the bosh_service_url or websocket_url or both.");
  55051. }
  55052. if (('WebSocket' in window || 'MozWebSocket' in window) && _converse.websocket_url) {
  55053. _converse.connection = new strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Connection(_converse.websocket_url, _converse.connection_options);
  55054. } else if (_converse.bosh_service_url) {
  55055. _converse.connection = new strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Connection(_converse.bosh_service_url, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.assignIn(_converse.connection_options, {
  55056. 'keepalive': _converse.keepalive
  55057. }));
  55058. } else {
  55059. throw new Error("initConnection: this browser does not support websockets and bosh_service_url wasn't specified.");
  55060. }
  55061. }
  55062. _converse.emit('connectionInitialized');
  55063. };
  55064. function setUpXMLLogging() {
  55065. strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].log = function (level, msg) {
  55066. _converse.log(msg, level);
  55067. };
  55068. if (_converse.debug) {
  55069. _converse.connection.xmlInput = function (body) {
  55070. _converse.log(body.outerHTML, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.DEBUG, 'color: darkgoldenrod');
  55071. };
  55072. _converse.connection.xmlOutput = function (body) {
  55073. _converse.log(body.outerHTML, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.DEBUG, 'color: darkcyan');
  55074. };
  55075. }
  55076. }
  55077. function finishInitialization() {
  55078. initPlugins();
  55079. initClientConfig();
  55080. _converse.initConnection();
  55081. setUpXMLLogging();
  55082. _converse.logIn();
  55083. _converse.registerGlobalEventHandlers();
  55084. if (!Backbone.history.started) {
  55085. Backbone.history.start();
  55086. }
  55087. if (_converse.idle_presence_timeout > 0) {
  55088. _converse.on('addClientFeatures', () => {
  55089. _converse.api.disco.own.features.add(strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].NS.IDLE);
  55090. });
  55091. }
  55092. }
  55093. function unregisterGlobalEventHandlers() {
  55094. document.removeEventListener("visibilitychange", _converse.saveWindowState);
  55095. _converse.emit('unregisteredGlobalEventHandlers');
  55096. }
  55097. function cleanup() {
  55098. // Looks like _converse.initialized was called again without logging
  55099. // out or disconnecting in the previous session.
  55100. // This happens in tests. We therefore first clean up.
  55101. Backbone.history.stop();
  55102. _converse.chatboxviews.closeAllChatBoxes();
  55103. unregisterGlobalEventHandlers();
  55104. window.localStorage.clear();
  55105. window.sessionStorage.clear();
  55106. if (_converse.bookmarks) {
  55107. _converse.bookmarks.reset();
  55108. }
  55109. delete _converse.controlboxtoggle;
  55110. delete _converse.chatboxviews;
  55111. _converse.connection.reset();
  55112. _converse.tearDown();
  55113. _converse.stopListening();
  55114. _converse.off();
  55115. delete _converse.config;
  55116. initClientConfig();
  55117. }
  55118. _converse.initialize = function (settings, callback) {
  55119. settings = !_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(settings) ? settings : {};
  55120. const init_promise = _converse_headless_utils_core__WEBPACK_IMPORTED_MODULE_11__["default"].getResolveablePromise();
  55121. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.each(PROMISES, addPromise);
  55122. if (!_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(_converse.connection)) {
  55123. cleanup();
  55124. }
  55125. if ('onpagehide' in window) {
  55126. // Pagehide gets thrown in more cases than unload. Specifically it
  55127. // gets thrown when the page is cached and not just
  55128. // closed/destroyed. It's the only viable event on mobile Safari.
  55129. // https://www.webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/
  55130. _converse.unloadevent = 'pagehide';
  55131. } else if ('onbeforeunload' in window) {
  55132. _converse.unloadevent = 'beforeunload';
  55133. } else if ('onunload' in window) {
  55134. _converse.unloadevent = 'unload';
  55135. }
  55136. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.assignIn(this, this.default_settings); // Allow only whitelisted configuration attributes to be overwritten
  55137. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.assignIn(this, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.pick(settings, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.keys(this.default_settings)));
  55138. if (this.authentication === _converse.ANONYMOUS) {
  55139. if (this.auto_login && !this.jid) {
  55140. throw new Error("Config Error: you need to provide the server's " + "domain via the 'jid' option when using anonymous " + "authentication with auto_login.");
  55141. }
  55142. }
  55143. /* Localisation */
  55144. if (!_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(_i18n__WEBPACK_IMPORTED_MODULE_6__["default"])) {
  55145. _i18n__WEBPACK_IMPORTED_MODULE_6__["default"].setLocales(settings.i18n, _converse);
  55146. } else {
  55147. _converse.locale = 'en';
  55148. } // Module-level variables
  55149. // ----------------------
  55150. this.callback = callback || _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.noop;
  55151. /* When reloading the page:
  55152. * For new sessions, we need to send out a presence stanza to notify
  55153. * the server/network that we're online.
  55154. * When re-attaching to an existing session (e.g. via the keepalive
  55155. * option), we don't need to again send out a presence stanza, because
  55156. * it's as if "we never left" (see onConnectStatusChanged).
  55157. * https://github.com/jcbrand/converse.js/issues/521
  55158. */
  55159. this.send_initial_presence = true;
  55160. this.msg_counter = 0;
  55161. this.user_settings = settings; // Save the user settings so that they can be used by plugins
  55162. // Module-level functions
  55163. // ----------------------
  55164. this.generateResource = () => `/converse.js-${Math.floor(Math.random() * 139749528).toString()}`;
  55165. this.sendCSI = function (stat) {
  55166. /* Send out a Chat Status Notification (XEP-0352)
  55167. *
  55168. * Parameters:
  55169. * (String) stat: The user's chat status
  55170. */
  55171. _converse.api.send(Object(strophe_js__WEBPACK_IMPORTED_MODULE_0__["$build"])(stat, {
  55172. xmlns: strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].NS.CSI
  55173. }));
  55174. _converse.inactive = stat === _converse.INACTIVE ? true : false;
  55175. };
  55176. this.onUserActivity = function () {
  55177. /* Resets counters and flags relating to CSI and auto_away/auto_xa */
  55178. if (_converse.idle_seconds > 0) {
  55179. _converse.idle_seconds = 0;
  55180. }
  55181. if (!_converse.connection.authenticated) {
  55182. // We can't send out any stanzas when there's no authenticated connection.
  55183. // This can happen when the connection reconnects.
  55184. return;
  55185. }
  55186. if (_converse.inactive) {
  55187. _converse.sendCSI(_converse.ACTIVE);
  55188. }
  55189. if (_converse.idle) {
  55190. _converse.idle = false;
  55191. _converse.xmppstatus.sendPresence();
  55192. }
  55193. if (_converse.auto_changed_status === true) {
  55194. _converse.auto_changed_status = false; // XXX: we should really remember the original state here, and
  55195. // then set it back to that...
  55196. _converse.xmppstatus.set('status', _converse.default_state);
  55197. }
  55198. };
  55199. this.onEverySecond = function () {
  55200. /* An interval handler running every second.
  55201. * Used for CSI and the auto_away and auto_xa features.
  55202. */
  55203. if (!_converse.connection.authenticated) {
  55204. // We can't send out any stanzas when there's no authenticated connection.
  55205. // This can happen when the connection reconnects.
  55206. return;
  55207. }
  55208. const stat = _converse.xmppstatus.get('status');
  55209. _converse.idle_seconds++;
  55210. if (_converse.csi_waiting_time > 0 && _converse.idle_seconds > _converse.csi_waiting_time && !_converse.inactive) {
  55211. _converse.sendCSI(_converse.INACTIVE);
  55212. }
  55213. if (_converse.idle_presence_timeout > 0 && _converse.idle_seconds > _converse.idle_presence_timeout && !_converse.idle) {
  55214. _converse.idle = true;
  55215. _converse.xmppstatus.sendPresence();
  55216. }
  55217. if (_converse.auto_away > 0 && _converse.idle_seconds > _converse.auto_away && stat !== 'away' && stat !== 'xa' && stat !== 'dnd') {
  55218. _converse.auto_changed_status = true;
  55219. _converse.xmppstatus.set('status', 'away');
  55220. } else if (_converse.auto_xa > 0 && _converse.idle_seconds > _converse.auto_xa && stat !== 'xa' && stat !== 'dnd') {
  55221. _converse.auto_changed_status = true;
  55222. _converse.xmppstatus.set('status', 'xa');
  55223. }
  55224. };
  55225. this.registerIntervalHandler = function () {
  55226. /* Set an interval of one second and register a handler for it.
  55227. * Required for the auto_away, auto_xa and csi_waiting_time features.
  55228. */
  55229. if (_converse.auto_away < 1 && _converse.auto_xa < 1 && _converse.csi_waiting_time < 1 && _converse.idle_presence_timeout < 1) {
  55230. // Waiting time of less then one second means features aren't used.
  55231. return;
  55232. }
  55233. _converse.idle_seconds = 0;
  55234. _converse.auto_changed_status = false; // Was the user's status changed by Converse?
  55235. window.addEventListener('click', _converse.onUserActivity);
  55236. window.addEventListener('focus', _converse.onUserActivity);
  55237. window.addEventListener('keypress', _converse.onUserActivity);
  55238. window.addEventListener('mousemove', _converse.onUserActivity);
  55239. const options = {
  55240. 'once': true,
  55241. 'passive': true
  55242. };
  55243. window.addEventListener(_converse.unloadevent, _converse.onUserActivity, options);
  55244. _converse.everySecondTrigger = window.setInterval(_converse.onEverySecond, 1000);
  55245. };
  55246. this.setConnectionStatus = function (connection_status, message) {
  55247. _converse.connfeedback.set({
  55248. 'connection_status': connection_status,
  55249. 'message': message
  55250. });
  55251. };
  55252. this.rejectPresenceSubscription = function (jid, message) {
  55253. /* Reject or cancel another user's subscription to our presence updates.
  55254. *
  55255. * Parameters:
  55256. * (String) jid - The Jabber ID of the user whose subscription
  55257. * is being canceled.
  55258. * (String) message - An optional message to the user
  55259. */
  55260. const pres = Object(strophe_js__WEBPACK_IMPORTED_MODULE_0__["$pres"])({
  55261. to: jid,
  55262. type: "unsubscribed"
  55263. });
  55264. if (message && message !== "") {
  55265. pres.c("status").t(message);
  55266. }
  55267. _converse.api.send(pres);
  55268. };
  55269. this.reconnect = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.debounce(function () {
  55270. _converse.log('RECONNECTING');
  55271. _converse.log('The connection has dropped, attempting to reconnect.');
  55272. _converse.setConnectionStatus(strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.RECONNECTING, __('The connection has dropped, attempting to reconnect.'));
  55273. _converse.connection.reconnecting = true;
  55274. _converse.tearDown();
  55275. _converse.logIn(null, true);
  55276. }, 3000, {
  55277. 'leading': true
  55278. });
  55279. this.disconnect = function () {
  55280. _converse.log('DISCONNECTED');
  55281. delete _converse.connection.reconnecting;
  55282. _converse.connection.reset();
  55283. _converse.tearDown();
  55284. _converse.clearSession();
  55285. _converse.emit('disconnected');
  55286. };
  55287. this.onDisconnected = function () {
  55288. /* Gets called once strophe's status reaches Strophe.Status.DISCONNECTED.
  55289. * Will either start a teardown process for converse.js or attempt
  55290. * to reconnect.
  55291. */
  55292. const reason = _converse.disconnection_reason;
  55293. if (_converse.disconnection_cause === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.AUTHFAIL) {
  55294. if (_converse.credentials_url && _converse.auto_reconnect) {
  55295. /* In this case, we reconnect, because we might be receiving
  55296. * expirable tokens from the credentials_url.
  55297. */
  55298. _converse.emit('will-reconnect');
  55299. return _converse.reconnect();
  55300. } else {
  55301. return _converse.disconnect();
  55302. }
  55303. } else if (_converse.disconnection_cause === _converse.LOGOUT || !_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(reason) && reason === _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.get(strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"], 'ErrorCondition.NO_AUTH_MECH') || reason === "host-unknown" || reason === "remote-connection-failed" || !_converse.auto_reconnect) {
  55304. return _converse.disconnect();
  55305. }
  55306. _converse.emit('will-reconnect');
  55307. _converse.reconnect();
  55308. };
  55309. this.setDisconnectionCause = function (cause, reason, override) {
  55310. /* Used to keep track of why we got disconnected, so that we can
  55311. * decide on what the next appropriate action is (in onDisconnected)
  55312. */
  55313. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(cause)) {
  55314. delete _converse.disconnection_cause;
  55315. delete _converse.disconnection_reason;
  55316. } else if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(_converse.disconnection_cause) || override) {
  55317. _converse.disconnection_cause = cause;
  55318. _converse.disconnection_reason = reason;
  55319. }
  55320. };
  55321. this.onConnectStatusChanged = function (status, message) {
  55322. /* Callback method called by Strophe as the Strophe.Connection goes
  55323. * through various states while establishing or tearing down a
  55324. * connection.
  55325. */
  55326. _converse.log(`Status changed to: ${_converse.CONNECTION_STATUS[status]}`);
  55327. if (status === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.CONNECTED || status === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.ATTACHED) {
  55328. _converse.setConnectionStatus(status); // By default we always want to send out an initial presence stanza.
  55329. _converse.send_initial_presence = true;
  55330. _converse.setDisconnectionCause();
  55331. if (_converse.connection.reconnecting) {
  55332. _converse.log(status === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.CONNECTED ? 'Reconnected' : 'Reattached');
  55333. _converse.onConnected(true);
  55334. } else {
  55335. _converse.log(status === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.CONNECTED ? 'Connected' : 'Attached');
  55336. if (_converse.connection.restored) {
  55337. // No need to send an initial presence stanza when
  55338. // we're restoring an existing session.
  55339. _converse.send_initial_presence = false;
  55340. }
  55341. _converse.onConnected();
  55342. }
  55343. } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.DISCONNECTED) {
  55344. _converse.setDisconnectionCause(status, message);
  55345. _converse.onDisconnected();
  55346. } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.ERROR) {
  55347. _converse.setConnectionStatus(status, __('An error occurred while connecting to the chat server.'));
  55348. } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.CONNECTING) {
  55349. _converse.setConnectionStatus(status);
  55350. } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.AUTHENTICATING) {
  55351. _converse.setConnectionStatus(status);
  55352. } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.AUTHFAIL) {
  55353. if (!message) {
  55354. message = __('Your Jabber ID and/or password is incorrect. Please try again.');
  55355. }
  55356. _converse.setConnectionStatus(status, message);
  55357. _converse.setDisconnectionCause(status, message, true);
  55358. _converse.onDisconnected();
  55359. } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.CONNFAIL) {
  55360. let feedback = message;
  55361. if (message === "host-unknown" || message == "remote-connection-failed") {
  55362. feedback = __("Sorry, we could not connect to the XMPP host with domain: %1$s", `\"${strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].getDomainFromJid(_converse.connection.jid)}\"`);
  55363. } else if (!_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(message) && message === _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.get(strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"], 'ErrorCondition.NO_AUTH_MECH')) {
  55364. feedback = __("The XMPP server did not offer a supported authentication mechanism");
  55365. }
  55366. _converse.setConnectionStatus(status, feedback);
  55367. _converse.setDisconnectionCause(status, message);
  55368. } else if (status === strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.DISCONNECTING) {
  55369. _converse.setDisconnectionCause(status, message);
  55370. }
  55371. };
  55372. this.incrementMsgCounter = function () {
  55373. this.msg_counter += 1;
  55374. const unreadMsgCount = this.msg_counter;
  55375. let title = document.title;
  55376. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isNil(title)) {
  55377. return;
  55378. }
  55379. if (title.search(/^Messages \(\d+\) /) === -1) {
  55380. title = `Messages (${unreadMsgCount}) ${title}`;
  55381. } else {
  55382. title = title.replace(/^Messages \(\d+\) /, `Messages (${unreadMsgCount})`);
  55383. }
  55384. };
  55385. this.clearMsgCounter = function () {
  55386. this.msg_counter = 0;
  55387. let title = document.title;
  55388. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isNil(title)) {
  55389. return;
  55390. }
  55391. if (title.search(/^Messages \(\d+\) /) !== -1) {
  55392. title = title.replace(/^Messages \(\d+\) /, "");
  55393. }
  55394. };
  55395. this.initStatus = reconnecting => {
  55396. // If there's no xmppstatus obj, then we were never connected to
  55397. // begin with, so we set reconnecting to false.
  55398. reconnecting = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(_converse.xmppstatus) ? false : reconnecting;
  55399. if (reconnecting) {
  55400. _converse.onStatusInitialized(reconnecting);
  55401. } else {
  55402. const id = `converse.xmppstatus-${_converse.bare_jid}`;
  55403. this.xmppstatus = new this.XMPPStatus({
  55404. 'id': id
  55405. });
  55406. this.xmppstatus.browserStorage = new Backbone.BrowserStorage.session(id);
  55407. this.xmppstatus.fetch({
  55408. 'success': _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.partial(_converse.onStatusInitialized, reconnecting),
  55409. 'error': _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.partial(_converse.onStatusInitialized, reconnecting)
  55410. });
  55411. }
  55412. };
  55413. this.initSession = function () {
  55414. const id = b64_sha1('converse.bosh-session');
  55415. _converse.session = new Backbone.Model({
  55416. id
  55417. });
  55418. _converse.session.browserStorage = new Backbone.BrowserStorage.session(id);
  55419. _converse.session.fetch();
  55420. _converse.emit('sessionInitialized');
  55421. };
  55422. this.clearSession = function () {
  55423. if (!_converse.config.get('trusted')) {
  55424. window.localStorage.clear();
  55425. window.sessionStorage.clear();
  55426. } else if (!_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(this.session) && this.session.browserStorage) {
  55427. this.session.browserStorage._clear();
  55428. }
  55429. _converse.emit('clearSession');
  55430. };
  55431. this.logOut = function () {
  55432. _converse.clearSession();
  55433. _converse.setDisconnectionCause(_converse.LOGOUT, undefined, true);
  55434. if (!_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(_converse.connection)) {
  55435. _converse.connection.disconnect();
  55436. } else {
  55437. _converse.tearDown();
  55438. } // Recreate all the promises
  55439. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.each(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.keys(_converse.promises), addPromise);
  55440. _converse.emit('logout');
  55441. };
  55442. this.saveWindowState = function (ev) {
  55443. // XXX: eventually we should be able to just use
  55444. // document.visibilityState (when we drop support for older
  55445. // browsers).
  55446. let state;
  55447. const event_map = {
  55448. 'focus': "visible",
  55449. 'focusin': "visible",
  55450. 'pageshow': "visible",
  55451. 'blur': "hidden",
  55452. 'focusout': "hidden",
  55453. 'pagehide': "hidden"
  55454. };
  55455. ev = ev || document.createEvent('Events');
  55456. if (ev.type in event_map) {
  55457. state = event_map[ev.type];
  55458. } else {
  55459. state = document.hidden ? "hidden" : "visible";
  55460. }
  55461. if (state === 'visible') {
  55462. _converse.clearMsgCounter();
  55463. }
  55464. _converse.windowState = state;
  55465. _converse.emit('windowStateChanged', {
  55466. state
  55467. });
  55468. };
  55469. this.registerGlobalEventHandlers = function () {
  55470. document.addEventListener("visibilitychange", _converse.saveWindowState);
  55471. _converse.saveWindowState({
  55472. 'type': document.hidden ? "blur" : "focus"
  55473. }); // Set initial state
  55474. _converse.emit('registeredGlobalEventHandlers');
  55475. };
  55476. this.enableCarbons = function () {
  55477. /* Ask the XMPP server to enable Message Carbons
  55478. * See XEP-0280 https://xmpp.org/extensions/xep-0280.html#enabling
  55479. */
  55480. if (!this.message_carbons || this.session.get('carbons_enabled')) {
  55481. return;
  55482. }
  55483. const carbons_iq = new strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Builder('iq', {
  55484. 'from': this.connection.jid,
  55485. 'id': 'enablecarbons',
  55486. 'type': 'set'
  55487. }).c('enable', {
  55488. xmlns: strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].NS.CARBONS
  55489. });
  55490. this.connection.addHandler(iq => {
  55491. if (iq.querySelectorAll('error').length > 0) {
  55492. _converse.log('An error occurred while trying to enable message carbons.', strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.WARN);
  55493. } else {
  55494. this.session.save({
  55495. 'carbons_enabled': true
  55496. });
  55497. _converse.log('Message carbons have been enabled.');
  55498. }
  55499. }, null, "iq", null, "enablecarbons");
  55500. this.connection.send(carbons_iq);
  55501. };
  55502. this.sendInitialPresence = function () {
  55503. if (_converse.send_initial_presence) {
  55504. _converse.xmppstatus.sendPresence();
  55505. }
  55506. };
  55507. this.onStatusInitialized = function (reconnecting) {
  55508. _converse.emit('statusInitialized', reconnecting);
  55509. if (reconnecting) {
  55510. _converse.emit('reconnected');
  55511. } else {
  55512. init_promise.resolve();
  55513. _converse.emit('initialized');
  55514. _converse.emit('connected');
  55515. }
  55516. };
  55517. this.setUserJID = function () {
  55518. _converse.jid = _converse.connection.jid;
  55519. _converse.bare_jid = strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].getBareJidFromJid(_converse.connection.jid);
  55520. _converse.resource = strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].getResourceFromJid(_converse.connection.jid);
  55521. _converse.domain = strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].getDomainFromJid(_converse.connection.jid);
  55522. _converse.emit('setUserJID');
  55523. };
  55524. this.onConnected = function (reconnecting) {
  55525. /* Called as soon as a new connection has been established, either
  55526. * by logging in or by attaching to an existing BOSH session.
  55527. */
  55528. _converse.connection.flush(); // Solves problem of returned PubSub BOSH response not received by browser
  55529. _converse.setUserJID();
  55530. _converse.initSession();
  55531. _converse.enableCarbons();
  55532. _converse.initStatus(reconnecting);
  55533. };
  55534. this.ConnectionFeedback = Backbone.Model.extend({
  55535. defaults: {
  55536. 'connection_status': strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.DISCONNECTED,
  55537. 'message': ''
  55538. },
  55539. initialize() {
  55540. this.on('change', () => {
  55541. _converse.emit('connfeedback', _converse.connfeedback);
  55542. });
  55543. }
  55544. });
  55545. this.connfeedback = new this.ConnectionFeedback();
  55546. this.XMPPStatus = Backbone.Model.extend({
  55547. defaults() {
  55548. return {
  55549. "jid": _converse.bare_jid,
  55550. "status": _converse.default_state
  55551. };
  55552. },
  55553. initialize() {
  55554. this.vcard = _converse.vcards.findWhere({
  55555. 'jid': this.get('jid')
  55556. });
  55557. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isNil(this.vcard)) {
  55558. this.vcard = _converse.vcards.create({
  55559. 'jid': this.get('jid')
  55560. });
  55561. }
  55562. this.on('change:status', item => {
  55563. const status = this.get('status');
  55564. this.sendPresence(status);
  55565. _converse.emit('statusChanged', status);
  55566. });
  55567. this.on('change:status_message', () => {
  55568. const status_message = this.get('status_message');
  55569. this.sendPresence(this.get('status'), status_message);
  55570. _converse.emit('statusMessageChanged', status_message);
  55571. });
  55572. },
  55573. constructPresence(type, status_message) {
  55574. let presence;
  55575. type = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isString(type) ? type : this.get('status') || _converse.default_state;
  55576. status_message = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isString(status_message) ? status_message : this.get('status_message'); // Most of these presence types are actually not explicitly sent,
  55577. // but I add all of them here for reference and future proofing.
  55578. if (type === 'unavailable' || type === 'probe' || type === 'error' || type === 'unsubscribe' || type === 'unsubscribed' || type === 'subscribe' || type === 'subscribed') {
  55579. presence = Object(strophe_js__WEBPACK_IMPORTED_MODULE_0__["$pres"])({
  55580. 'type': type
  55581. });
  55582. } else if (type === 'offline') {
  55583. presence = Object(strophe_js__WEBPACK_IMPORTED_MODULE_0__["$pres"])({
  55584. 'type': 'unavailable'
  55585. });
  55586. } else if (type === 'online') {
  55587. presence = Object(strophe_js__WEBPACK_IMPORTED_MODULE_0__["$pres"])();
  55588. } else {
  55589. presence = Object(strophe_js__WEBPACK_IMPORTED_MODULE_0__["$pres"])().c('show').t(type).up();
  55590. }
  55591. if (status_message) {
  55592. presence.c('status').t(status_message).up();
  55593. }
  55594. presence.c('priority').t(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isNaN(Number(_converse.priority)) ? 0 : _converse.priority).up();
  55595. if (_converse.idle) {
  55596. const idle_since = new Date();
  55597. idle_since.setSeconds(idle_since.getSeconds() - _converse.idle_seconds);
  55598. presence.c('idle', {
  55599. xmlns: strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].NS.IDLE,
  55600. since: idle_since.toISOString()
  55601. });
  55602. }
  55603. return presence;
  55604. },
  55605. sendPresence(type, status_message) {
  55606. _converse.api.send(this.constructPresence(type, status_message));
  55607. }
  55608. });
  55609. this.fetchLoginCredentials = () => new es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_3___default.a((resolve, reject) => {
  55610. const xhr = new XMLHttpRequest();
  55611. xhr.open('GET', _converse.credentials_url, true);
  55612. xhr.setRequestHeader('Accept', "application/json, text/javascript");
  55613. xhr.onload = function () {
  55614. if (xhr.status >= 200 && xhr.status < 400) {
  55615. const data = JSON.parse(xhr.responseText);
  55616. resolve({
  55617. 'jid': data.jid,
  55618. 'password': data.password
  55619. });
  55620. } else {
  55621. xhr.onerror();
  55622. }
  55623. };
  55624. xhr.onerror = function () {
  55625. delete _converse.connection;
  55626. _converse.emit('noResumeableSession', this);
  55627. reject(xhr.responseText);
  55628. };
  55629. xhr.send();
  55630. });
  55631. this.startNewBOSHSession = function () {
  55632. const xhr = new XMLHttpRequest();
  55633. xhr.open('GET', _converse.prebind_url, true);
  55634. xhr.setRequestHeader('Accept', "application/json, text/javascript");
  55635. xhr.onload = function () {
  55636. if (xhr.status >= 200 && xhr.status < 400) {
  55637. const data = JSON.parse(xhr.responseText);
  55638. _converse.connection.attach(data.jid, data.sid, data.rid, _converse.onConnectStatusChanged);
  55639. } else {
  55640. xhr.onerror();
  55641. }
  55642. };
  55643. xhr.onerror = function () {
  55644. delete _converse.connection;
  55645. _converse.emit('noResumeableSession', this);
  55646. };
  55647. xhr.send();
  55648. };
  55649. this.restoreBOSHSession = function (jid_is_required) {
  55650. /* Tries to restore a cached BOSH session. */
  55651. if (!this.jid) {
  55652. const msg = "restoreBOSHSession: tried to restore a \"keepalive\" session " + "but we don't have the JID for the user!";
  55653. if (jid_is_required) {
  55654. throw new Error(msg);
  55655. } else {
  55656. _converse.log(msg);
  55657. }
  55658. }
  55659. try {
  55660. this.connection.restore(this.jid, this.onConnectStatusChanged);
  55661. return true;
  55662. } catch (e) {
  55663. _converse.log("Could not restore session for jid: " + this.jid + " Error message: " + e.message, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.WARN);
  55664. this.clearSession(); // We want to clear presences (see #555)
  55665. return false;
  55666. }
  55667. };
  55668. this.attemptPreboundSession = function (reconnecting) {
  55669. /* Handle session resumption or initialization when prebind is
  55670. * being used.
  55671. */
  55672. if (!reconnecting) {
  55673. if (this.keepalive && this.restoreBOSHSession(true)) {
  55674. return;
  55675. } // No keepalive, or session resumption has failed.
  55676. if (this.jid && this.sid && this.rid) {
  55677. return this.connection.attach(this.jid, this.sid, this.rid, this.onConnectStatusChanged);
  55678. }
  55679. }
  55680. if (this.prebind_url) {
  55681. return this.startNewBOSHSession();
  55682. } else {
  55683. throw new Error("attemptPreboundSession: If you use prebind and not keepalive, " + "then you MUST supply JID, RID and SID values or a prebind_url.");
  55684. }
  55685. };
  55686. this.attemptNonPreboundSession = function (credentials, reconnecting) {
  55687. /* Handle session resumption or initialization when prebind is not being used.
  55688. *
  55689. * Two potential options exist and are handled in this method:
  55690. * 1. keepalive
  55691. * 2. auto_login
  55692. */
  55693. if (!reconnecting && this.keepalive && this.restoreBOSHSession()) {
  55694. return;
  55695. }
  55696. if (credentials) {
  55697. // When credentials are passed in, they override prebinding
  55698. // or credentials fetching via HTTP
  55699. this.autoLogin(credentials);
  55700. } else if (this.auto_login) {
  55701. if (this.credentials_url) {
  55702. this.fetchLoginCredentials().then(this.autoLogin.bind(this), this.autoLogin.bind(this));
  55703. } else if (!this.jid) {
  55704. throw new Error("attemptNonPreboundSession: If you use auto_login, " + "you also need to give either a jid value (and if " + "applicable a password) or you need to pass in a URL " + "from where the username and password can be fetched " + "(via credentials_url).");
  55705. } else {
  55706. this.autoLogin(); // Could be ANONYMOUS or EXTERNAL
  55707. }
  55708. } else if (reconnecting) {
  55709. this.autoLogin();
  55710. }
  55711. };
  55712. this.autoLogin = function (credentials) {
  55713. if (credentials) {
  55714. // If passed in, the credentials come from credentials_url,
  55715. // so we set them on the converse object.
  55716. this.jid = credentials.jid;
  55717. }
  55718. if (this.authentication === _converse.ANONYMOUS || this.authentication === _converse.EXTERNAL) {
  55719. if (!this.jid) {
  55720. throw new Error("Config Error: when using anonymous login " + "you need to provide the server's domain via the 'jid' option. " + "Either when calling converse.initialize, or when calling " + "_converse.api.user.login.");
  55721. }
  55722. if (!this.connection.reconnecting) {
  55723. this.connection.reset();
  55724. }
  55725. this.connection.connect(this.jid.toLowerCase(), null, this.onConnectStatusChanged, BOSH_WAIT);
  55726. } else if (this.authentication === _converse.LOGIN) {
  55727. const password = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isNil(credentials) ? _converse.connection.pass || this.password : credentials.password;
  55728. if (!password) {
  55729. if (this.auto_login) {
  55730. throw new Error("initConnection: If you use auto_login and " + "authentication='login' then you also need to provide a password.");
  55731. }
  55732. _converse.setDisconnectionCause(strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].Status.AUTHFAIL, undefined, true);
  55733. _converse.disconnect();
  55734. return;
  55735. }
  55736. const resource = strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].getResourceFromJid(this.jid);
  55737. if (!resource) {
  55738. this.jid = this.jid.toLowerCase() + _converse.generateResource();
  55739. } else {
  55740. this.jid = strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].getBareJidFromJid(this.jid).toLowerCase() + '/' + resource;
  55741. }
  55742. if (!this.connection.reconnecting) {
  55743. this.connection.reset();
  55744. }
  55745. this.connection.connect(this.jid, password, this.onConnectStatusChanged, BOSH_WAIT);
  55746. }
  55747. };
  55748. this.logIn = function (credentials, reconnecting) {
  55749. // We now try to resume or automatically set up a new session.
  55750. // Otherwise the user will be shown a login form.
  55751. if (this.authentication === _converse.PREBIND) {
  55752. this.attemptPreboundSession(reconnecting);
  55753. } else {
  55754. this.attemptNonPreboundSession(credentials, reconnecting);
  55755. }
  55756. };
  55757. this.tearDown = function () {
  55758. /* Remove those views which are only allowed with a valid
  55759. * connection.
  55760. */
  55761. _converse.emit('beforeTearDown');
  55762. if (!_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(_converse.session)) {
  55763. _converse.session.destroy();
  55764. }
  55765. window.removeEventListener('click', _converse.onUserActivity);
  55766. window.removeEventListener('focus', _converse.onUserActivity);
  55767. window.removeEventListener('keypress', _converse.onUserActivity);
  55768. window.removeEventListener('mousemove', _converse.onUserActivity);
  55769. window.removeEventListener(_converse.unloadevent, _converse.onUserActivity);
  55770. window.clearInterval(_converse.everySecondTrigger);
  55771. _converse.emit('afterTearDown');
  55772. return _converse;
  55773. }; // Initialization
  55774. // --------------
  55775. // This is the end of the initialize method.
  55776. if (settings.connection) {
  55777. this.connection = settings.connection;
  55778. }
  55779. if (!_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(_converse.connection) && _converse.connection.service === 'jasmine tests') {
  55780. finishInitialization();
  55781. return _converse;
  55782. } else if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(_i18n__WEBPACK_IMPORTED_MODULE_6__["default"])) {
  55783. finishInitialization();
  55784. } else {
  55785. _i18n__WEBPACK_IMPORTED_MODULE_6__["default"].fetchTranslations(_converse.locale, _converse.locales, _converse_headless_utils_core__WEBPACK_IMPORTED_MODULE_11__["default"].interpolate(_converse.locales_url, {
  55786. 'locale': _converse.locale
  55787. })).catch(e => _converse.log(e.message, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.FATAL)).finally(finishInitialization).catch(e => _converse.log(e.message, strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"].LogLevel.FATAL));
  55788. }
  55789. return init_promise;
  55790. };
  55791. /**
  55792. * ### The private API
  55793. *
  55794. * The private API methods are only accessible via the closured {@link _converse}
  55795. * object, which is only available to plugins.
  55796. *
  55797. * These methods are kept private (i.e. not global) because they may return
  55798. * sensitive data which should be kept off-limits to other 3rd-party scripts
  55799. * that might be running in the page.
  55800. *
  55801. * @namespace _converse.api
  55802. * @memberOf _converse
  55803. */
  55804. _converse.api = {
  55805. /**
  55806. * This grouping collects API functions related to the XMPP connection.
  55807. *
  55808. * @namespace _converse.api.connection
  55809. * @memberOf _converse.api
  55810. */
  55811. 'connection': {
  55812. /**
  55813. * @method _converse.api.connection.connected
  55814. * @memberOf _converse.api.connection
  55815. * @returns {boolean} Whether there is an established connection or not.
  55816. */
  55817. 'connected'() {
  55818. return _converse.connection && _converse.connection.connected || false;
  55819. },
  55820. /**
  55821. * Terminates the connection.
  55822. *
  55823. * @method _converse.api.connection.disconnect
  55824. * @memberOf _converse.api.connection
  55825. */
  55826. 'disconnect'() {
  55827. _converse.connection.disconnect();
  55828. }
  55829. },
  55830. /**
  55831. * Lets you emit (i.e. trigger) events, which can be listened to via
  55832. * {@link _converse.api.listen.on} or {@link _converse.api.listen.once}
  55833. * (see [_converse.api.listen](http://localhost:8000/docs/html/api/-_converse.api.listen.html)).
  55834. *
  55835. * @method _converse.api.emit
  55836. */
  55837. 'emit'() {
  55838. _converse.emit.apply(_converse, arguments);
  55839. },
  55840. /**
  55841. * This grouping collects API functions related to the current logged in user.
  55842. *
  55843. * @namespace _converse.api.user
  55844. * @memberOf _converse.api
  55845. */
  55846. 'user': {
  55847. /**
  55848. * @method _converse.api.user.jid
  55849. * @returns {string} The current user's full JID (Jabber ID)
  55850. * @example _converse.api.user.jid())
  55851. */
  55852. 'jid'() {
  55853. return _converse.connection.jid;
  55854. },
  55855. /**
  55856. * Logs the user in.
  55857. *
  55858. * If called without any parameters, Converse will try
  55859. * to log the user in by calling the `prebind_url` or `credentials_url` depending
  55860. * on whether prebinding is used or not.
  55861. *
  55862. * @method _converse.api.user.login
  55863. * @param {object} [credentials] An object with the credentials.
  55864. * @example
  55865. * converse.plugins.add('myplugin', {
  55866. * initialize: function () {
  55867. *
  55868. * this._converse.api.user.login({
  55869. * 'jid': 'dummy@example.com',
  55870. * 'password': 'secret'
  55871. * });
  55872. *
  55873. * }
  55874. * });
  55875. */
  55876. 'login'(credentials) {
  55877. _converse.logIn(credentials);
  55878. },
  55879. /**
  55880. * Logs the user out of the current XMPP session.
  55881. *
  55882. * @method _converse.api.user.logout
  55883. * @example _converse.api.user.logout();
  55884. */
  55885. 'logout'() {
  55886. _converse.logOut();
  55887. },
  55888. /**
  55889. * Set and get the user's chat status, also called their *availability*.
  55890. *
  55891. * @namespace _converse.api.user.status
  55892. * @memberOf _converse.api.user
  55893. */
  55894. 'status': {
  55895. /** Return the current user's availability status.
  55896. *
  55897. * @method _converse.api.user.status.get
  55898. * @example _converse.api.user.status.get();
  55899. */
  55900. 'get'() {
  55901. return _converse.xmppstatus.get('status');
  55902. },
  55903. /**
  55904. * The user's status can be set to one of the following values:
  55905. *
  55906. * @method _converse.api.user.status.set
  55907. * @param {string} value The user's chat status (e.g. 'away', 'dnd', 'offline', 'online', 'unavailable' or 'xa')
  55908. * @param {string} [message] A custom status message
  55909. *
  55910. * @example this._converse.api.user.status.set('dnd');
  55911. * @example this._converse.api.user.status.set('dnd', 'In a meeting');
  55912. */
  55913. 'set'(value, message) {
  55914. const data = {
  55915. 'status': value
  55916. };
  55917. if (!_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.includes(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.keys(_converse.STATUS_WEIGHTS), value)) {
  55918. throw new Error('Invalid availability value. See https://xmpp.org/rfcs/rfc3921.html#rfc.section.2.2.2.1');
  55919. }
  55920. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isString(message)) {
  55921. data.status_message = message;
  55922. }
  55923. _converse.xmppstatus.sendPresence(value);
  55924. _converse.xmppstatus.save(data);
  55925. },
  55926. /**
  55927. * Set and retrieve the user's custom status message.
  55928. *
  55929. * @namespace _converse.api.user.status.message
  55930. * @memberOf _converse.api.user.status
  55931. */
  55932. 'message': {
  55933. /**
  55934. * @method _converse.api.user.status.message.get
  55935. * @returns {string} The status message
  55936. * @example const message = _converse.api.user.status.message.get()
  55937. */
  55938. 'get'() {
  55939. return _converse.xmppstatus.get('status_message');
  55940. },
  55941. /**
  55942. * @method _converse.api.user.status.message.set
  55943. * @param {string} status The status message
  55944. * @example _converse.api.user.status.message.set('In a meeting');
  55945. */
  55946. 'set'(status) {
  55947. _converse.xmppstatus.save({
  55948. 'status_message': status
  55949. });
  55950. }
  55951. }
  55952. }
  55953. },
  55954. /**
  55955. * This grouping allows access to the
  55956. * [configuration settings](/docs/html/configuration.html#configuration-settings)
  55957. * of Converse.
  55958. *
  55959. * @namespace _converse.api.settings
  55960. * @memberOf _converse.api
  55961. */
  55962. 'settings': {
  55963. /**
  55964. * Allows new configuration settings to be specified, or new default values for
  55965. * existing configuration settings to be specified.
  55966. *
  55967. * @method _converse.api.settings.update
  55968. * @param {object} settings The configuration settings
  55969. * @example
  55970. * _converse.api.settings.update({
  55971. * 'enable_foo': true
  55972. * });
  55973. *
  55974. * // The user can then override the default value of the configuration setting when
  55975. * // calling `converse.initialize`.
  55976. * converse.initialize({
  55977. * 'enable_foo': false
  55978. * });
  55979. */
  55980. 'update'(settings) {
  55981. _converse_headless_utils_core__WEBPACK_IMPORTED_MODULE_11__["default"].merge(_converse.default_settings, settings);
  55982. _converse_headless_utils_core__WEBPACK_IMPORTED_MODULE_11__["default"].merge(_converse, settings);
  55983. _converse_headless_utils_core__WEBPACK_IMPORTED_MODULE_11__["default"].applyUserSettings(_converse, settings, _converse.user_settings);
  55984. },
  55985. /**
  55986. * @method _converse.api.settings.get
  55987. * @returns {*} Value of the particular configuration setting.
  55988. * @example _converse.api.settings.get("play_sounds");
  55989. */
  55990. 'get'(key) {
  55991. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.includes(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.keys(_converse.default_settings), key)) {
  55992. return _converse[key];
  55993. }
  55994. },
  55995. /**
  55996. * Set one or many configuration settings.
  55997. *
  55998. * Note, this is not an alternative to calling {@link converse.initialize}, which still needs
  55999. * to be called. Generally, you'd use this method after Converse is already
  56000. * running and you want to change the configuration on-the-fly.
  56001. *
  56002. * @method _converse.api.settings.set
  56003. * @param {Object} [settings] An object containing configuration settings.
  56004. * @param {string} [key] Alternatively to passing in an object, you can pass in a key and a value.
  56005. * @param {string} [value]
  56006. * @example _converse.api.settings.set("play_sounds", true);
  56007. * @example
  56008. * _converse.api.settings.set({
  56009. * "play_sounds", true,
  56010. * "hide_offline_users" true
  56011. * });
  56012. */
  56013. 'set'(key, val) {
  56014. const o = {};
  56015. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isObject(key)) {
  56016. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.assignIn(_converse, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.pick(key, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.keys(_converse.default_settings)));
  56017. } else if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isString("string")) {
  56018. o[key] = val;
  56019. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.assignIn(_converse, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.pick(o, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.keys(_converse.default_settings)));
  56020. }
  56021. }
  56022. },
  56023. /**
  56024. * Converse and its plugins emit various events which you can listen to via the
  56025. * {@link _converse.api.listen} namespace.
  56026. *
  56027. * Some of these events are also available as [ES2015 Promises](http://es6-features.org/#PromiseUsage)
  56028. * although not all of them could logically act as promises, since some events
  56029. * might be fired multpile times whereas promises are to be resolved (or
  56030. * rejected) only once.
  56031. *
  56032. * Events which are also promises include:
  56033. *
  56034. * * [cachedRoster](/docs/html/events.html#cachedroster)
  56035. * * [chatBoxesFetched](/docs/html/events.html#chatBoxesFetched)
  56036. * * [pluginsInitialized](/docs/html/events.html#pluginsInitialized)
  56037. * * [roster](/docs/html/events.html#roster)
  56038. * * [rosterContactsFetched](/docs/html/events.html#rosterContactsFetched)
  56039. * * [rosterGroupsFetched](/docs/html/events.html#rosterGroupsFetched)
  56040. * * [rosterInitialized](/docs/html/events.html#rosterInitialized)
  56041. * * [statusInitialized](/docs/html/events.html#statusInitialized)
  56042. * * [roomsPanelRendered](/docs/html/events.html#roomsPanelRendered)
  56043. *
  56044. * The various plugins might also provide promises, and they do this by using the
  56045. * `promises.add` api method.
  56046. *
  56047. * @namespace _converse.api.promises
  56048. * @memberOf _converse.api
  56049. */
  56050. 'promises': {
  56051. /**
  56052. * By calling `promises.add`, a new [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
  56053. * is made available for other code or plugins to depend on via the
  56054. * {@link _converse.api.waitUntil} method.
  56055. *
  56056. * Generally, it's the responsibility of the plugin which adds the promise to
  56057. * also resolve it.
  56058. *
  56059. * This is done by calling {@link _converse.api.emit}, which not only resolves the
  56060. * promise, but also emits an event with the same name (which can be listened to
  56061. * via {@link _converse.api.listen}).
  56062. *
  56063. * @method _converse.api.promises.add
  56064. * @param {string|array} [name|names] The name or an array of names for the promise(s) to be added
  56065. * @example _converse.api.promises.add('foo-completed');
  56066. */
  56067. 'add'(promises) {
  56068. promises = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isArray(promises) ? promises : [promises];
  56069. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.each(promises, addPromise);
  56070. }
  56071. },
  56072. /**
  56073. * This namespace lets you access the BOSH tokens
  56074. *
  56075. * @namespace _converse.api.tokens
  56076. * @memberOf _converse.api
  56077. */
  56078. 'tokens': {
  56079. /**
  56080. * @method _converse.api.tokens.get
  56081. * @param {string} [id] The type of token to return ('rid' or 'sid').
  56082. * @returns 'string' A token, either the RID or SID token depending on what's asked for.
  56083. * @example _converse.api.tokens.get('rid');
  56084. */
  56085. 'get'(id) {
  56086. if (!_converse.expose_rid_and_sid || _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(_converse.connection)) {
  56087. return null;
  56088. }
  56089. if (id.toLowerCase() === 'rid') {
  56090. return _converse.connection.rid || _converse.connection._proto.rid;
  56091. } else if (id.toLowerCase() === 'sid') {
  56092. return _converse.connection.sid || _converse.connection._proto.sid;
  56093. }
  56094. }
  56095. },
  56096. /**
  56097. * Converse emits events to which you can subscribe to.
  56098. *
  56099. * The `listen` namespace exposes methods for creating event listeners
  56100. * (aka handlers) for these events.
  56101. *
  56102. * @namespace _converse.api.listen
  56103. * @memberOf _converse
  56104. */
  56105. 'listen': {
  56106. /**
  56107. * Lets you listen to an event exactly once.
  56108. *
  56109. * @method _converse.api.listen.once
  56110. * @param {string} name The event's name
  56111. * @param {function} callback The callback method to be called when the event is emitted.
  56112. * @param {object} [context] The value of the `this` parameter for the callback.
  56113. * @example _converse.api.listen.once('message', function (messageXML) { ... });
  56114. */
  56115. 'once': _converse.once.bind(_converse),
  56116. /**
  56117. * Lets you subscribe to an event.
  56118. *
  56119. * Every time the event fires, the callback method specified by `callback` will be called.
  56120. *
  56121. * @method _converse.api.listen.on
  56122. * @param {string} name The event's name
  56123. * @param {function} callback The callback method to be called when the event is emitted.
  56124. * @param {object} [context] The value of the `this` parameter for the callback.
  56125. * @example _converse.api.listen.on('message', function (messageXML) { ... });
  56126. */
  56127. 'on': _converse.on.bind(_converse),
  56128. /**
  56129. * To stop listening to an event, you can use the `not` method.
  56130. *
  56131. * Every time the event fires, the callback method specified by `callback` will be called.
  56132. *
  56133. * @method _converse.api.listen.not
  56134. * @param {string} name The event's name
  56135. * @param {function} callback The callback method that is to no longer be called when the event fires
  56136. * @example _converse.api.listen.not('message', function (messageXML);
  56137. */
  56138. 'not': _converse.off.bind(_converse),
  56139. /**
  56140. * Subscribe to an incoming stanza
  56141. *
  56142. * Every a matched stanza is received, the callback method specified by `callback` will be called.
  56143. *
  56144. * @method _converse.api.listen.stanza
  56145. * @param {string} name The stanza's name
  56146. * @param {object} options Matching options
  56147. * (e.g. 'ns' for namespace, 'type' for stanza type, also 'id' and 'from');
  56148. * @param {function} handler The callback method to be called when the stanza appears
  56149. */
  56150. 'stanza'(name, options, handler) {
  56151. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isFunction(options)) {
  56152. handler = options;
  56153. options = {};
  56154. } else {
  56155. options = options || {};
  56156. }
  56157. _converse.connection.addHandler(handler, options.ns, name, options.type, options.id, options.from, options);
  56158. }
  56159. },
  56160. /**
  56161. * Wait until a promise is resolved
  56162. *
  56163. * @method _converse.api.waitUntil
  56164. * @param {string} name The name of the promise
  56165. * @returns {Promise}
  56166. */
  56167. 'waitUntil'(name) {
  56168. const promise = _converse.promises[name];
  56169. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(promise)) {
  56170. return null;
  56171. }
  56172. return promise;
  56173. },
  56174. /**
  56175. * Allows you to send XML stanzas.
  56176. *
  56177. * @method _converse.api.send
  56178. * @example
  56179. * const msg = converse.env.$msg({
  56180. * 'from': 'juliet@example.com/balcony',
  56181. * 'to': 'romeo@example.net',
  56182. * 'type':'chat'
  56183. * });
  56184. * _converse.api.send(msg);
  56185. */
  56186. 'send'(stanza) {
  56187. _converse.connection.send(stanza);
  56188. _converse.emit('send', stanza);
  56189. },
  56190. /**
  56191. * Send an IQ stanza and receive a promise
  56192. *
  56193. * @method _converse.api.sendIQ
  56194. * @returns {Promise} A promise which resolves when we receive a `result` stanza
  56195. * or is rejected when we receive an `error` stanza.
  56196. */
  56197. 'sendIQ'(stanza, timeout) {
  56198. return new es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_3___default.a((resolve, reject) => {
  56199. _converse.connection.sendIQ(stanza, resolve, reject, timeout || _converse.IQ_TIMEOUT);
  56200. _converse.emit('send', stanza);
  56201. });
  56202. }
  56203. };
  56204. /**
  56205. * ### The Public API
  56206. *
  56207. * This namespace contains public API methods which are are
  56208. * accessible on the global `converse` object.
  56209. * They are public, because any JavaScript in the
  56210. * page can call them. Public methods therefore don’t expose any sensitive
  56211. * or closured data. To do that, you’ll need to create a plugin, which has
  56212. * access to the private API method.
  56213. *
  56214. * @namespace converse
  56215. */
  56216. const converse = {
  56217. /**
  56218. * Public API method which initializes Converse.
  56219. * This method must always be called when using Converse.
  56220. *
  56221. * @memberOf converse
  56222. * @method initialize
  56223. * @param {object} config A map of [configuration-settings](https://conversejs.org/docs/html/configuration.html#configuration-settings).
  56224. *
  56225. * @example
  56226. * converse.initialize({
  56227. * auto_list_rooms: false,
  56228. * auto_subscribe: false,
  56229. * bosh_service_url: 'https://bind.example.com',
  56230. * hide_muc_server: false,
  56231. * i18n: locales['en'],
  56232. * keepalive: true,
  56233. * play_sounds: true,
  56234. * prebind: false,
  56235. * show_controlbox_by_default: true,
  56236. * debug: false,
  56237. * roster_groups: true
  56238. * });
  56239. */
  56240. 'initialize'(settings, callback) {
  56241. return _converse.initialize(settings, callback);
  56242. },
  56243. /**
  56244. * Exposes methods for adding and removing plugins. You'll need to write a plugin
  56245. * if you want to have access to the private API methods defined further down below.
  56246. *
  56247. * For more information on plugins, read the documentation on [writing a plugin](/docs/html/plugin_development.html).
  56248. *
  56249. * @namespace plugins
  56250. * @memberOf converse
  56251. */
  56252. 'plugins': {
  56253. /** Registers a new plugin.
  56254. *
  56255. * @method converse.plugins.add
  56256. * @param {string} name The name of the plugin
  56257. * @param {object} plugin The plugin object
  56258. *
  56259. * @example
  56260. *
  56261. * const plugin = {
  56262. * initialize: function () {
  56263. * // Gets called as soon as the plugin has been loaded.
  56264. *
  56265. * // Inside this method, you have access to the private
  56266. * // API via `_covnerse.api`.
  56267. *
  56268. * // The private _converse object contains the core logic
  56269. * // and data-structures of Converse.
  56270. * }
  56271. * }
  56272. * converse.plugins.add('myplugin', plugin);
  56273. */
  56274. 'add'(name, plugin) {
  56275. plugin.__name__ = name;
  56276. if (!_lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a.isUndefined(_converse.pluggable.plugins[name])) {
  56277. throw new TypeError(`Error: plugin with name "${name}" has already been ` + 'registered!');
  56278. } else {
  56279. _converse.pluggable.plugins[name] = plugin;
  56280. }
  56281. }
  56282. },
  56283. /**
  56284. * Utility methods and globals from bundled 3rd party libraries.
  56285. * @memberOf converse
  56286. *
  56287. * @property {function} converse.env.$build - Creates a Strophe.Builder, for creating stanza objects.
  56288. * @property {function} converse.env.$iq - Creates a Strophe.Builder with an <iq/> element as the root.
  56289. * @property {function} converse.env.$msg - Creates a Strophe.Builder with an <message/> element as the root.
  56290. * @property {function} converse.env.$pres - Creates a Strophe.Builder with an <presence/> element as the root.
  56291. * @property {object} converse.env.Backbone - The [Backbone](http://backbonejs.org) object used by Converse to create models and views.
  56292. * @property {function} converse.env.Promise - The Promise implementation used by Converse.
  56293. * @property {function} converse.env.Strophe - The [Strophe](http://strophe.im/strophejs) XMPP library used by Converse.
  56294. * @property {object} converse.env._ - The instance of [lodash](http://lodash.com) used by Converse.
  56295. * @property {function} converse.env.f - And instance of Lodash with its methods wrapped to produce immutable auto-curried iteratee-first data-last methods.
  56296. * @property {function} converse.env.b64_sha1 - Utility method from Strophe for creating base64 encoded sha1 hashes.
  56297. * @property {object} converse.env.moment - [Moment](https://momentjs.com) date manipulation library.
  56298. * @property {function} converse.env.sizzle - [Sizzle](https://sizzlejs.com) CSS selector engine.
  56299. * @property {object} converse.env.utils - Module containing common utility methods used by Converse.
  56300. */
  56301. 'env': {
  56302. '$build': strophe_js__WEBPACK_IMPORTED_MODULE_0__["$build"],
  56303. '$iq': strophe_js__WEBPACK_IMPORTED_MODULE_0__["$iq"],
  56304. '$msg': strophe_js__WEBPACK_IMPORTED_MODULE_0__["$msg"],
  56305. '$pres': strophe_js__WEBPACK_IMPORTED_MODULE_0__["$pres"],
  56306. 'Backbone': Backbone,
  56307. 'Promise': es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_3___default.a,
  56308. 'Strophe': strophe_js__WEBPACK_IMPORTED_MODULE_0__["Strophe"],
  56309. '_': _lodash_noconflict__WEBPACK_IMPORTED_MODULE_4___default.a,
  56310. 'f': _lodash_fp__WEBPACK_IMPORTED_MODULE_5___default.a,
  56311. 'b64_sha1': b64_sha1,
  56312. 'moment': moment__WEBPACK_IMPORTED_MODULE_7___default.a,
  56313. 'sizzle': sizzle__WEBPACK_IMPORTED_MODULE_10___default.a,
  56314. 'utils': _converse_headless_utils_core__WEBPACK_IMPORTED_MODULE_11__["default"]
  56315. }
  56316. };
  56317. window.converse = converse;
  56318. window.dispatchEvent(new CustomEvent('converse-loaded'));
  56319. /* harmony default export */ __webpack_exports__["default"] = (converse);
  56320. /***/ }),
  56321. /***/ "./src/headless/converse-disco.js":
  56322. /*!****************************************!*\
  56323. !*** ./src/headless/converse-disco.js ***!
  56324. \****************************************/
  56325. /*! no exports provided */
  56326. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56327. "use strict";
  56328. __webpack_require__.r(__webpack_exports__);
  56329. /* harmony import */ var _converse_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./converse-core */ "./src/headless/converse-core.js");
  56330. /* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
  56331. /* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_1__);
  56332. // Converse.js
  56333. // http://conversejs.org
  56334. //
  56335. // Copyright (c) 2013-2018, the Converse developers
  56336. // Licensed under the Mozilla Public License (MPLv2)
  56337. /* This is a Converse plugin which add support for XEP-0030: Service Discovery */
  56338. const _converse$env = _converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env,
  56339. Backbone = _converse$env.Backbone,
  56340. Promise = _converse$env.Promise,
  56341. Strophe = _converse$env.Strophe,
  56342. $iq = _converse$env.$iq,
  56343. b64_sha1 = _converse$env.b64_sha1,
  56344. utils = _converse$env.utils,
  56345. _ = _converse$env._,
  56346. f = _converse$env.f;
  56347. _converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins.add('converse-disco', {
  56348. initialize() {
  56349. /* The initialize function gets called as soon as the plugin is
  56350. * loaded by converse.js's plugin machinery.
  56351. */
  56352. const _converse = this._converse; // Promises exposed by this plugin
  56353. _converse.api.promises.add('discoInitialized');
  56354. _converse.DiscoEntity = Backbone.Model.extend({
  56355. /* A Disco Entity is a JID addressable entity that can be queried
  56356. * for features.
  56357. *
  56358. * See XEP-0030: https://xmpp.org/extensions/xep-0030.html
  56359. */
  56360. idAttribute: 'jid',
  56361. initialize() {
  56362. this.waitUntilFeaturesDiscovered = utils.getResolveablePromise();
  56363. this.dataforms = new Backbone.Collection();
  56364. this.dataforms.browserStorage = new Backbone.BrowserStorage.session(b64_sha1(`converse.dataforms-{this.get('jid')}`));
  56365. this.features = new Backbone.Collection();
  56366. this.features.browserStorage = new Backbone.BrowserStorage.session(b64_sha1(`converse.features-${this.get('jid')}`));
  56367. this.features.on('add', this.onFeatureAdded, this);
  56368. this.fields = new Backbone.Collection();
  56369. this.fields.browserStorage = new Backbone.BrowserStorage.session(b64_sha1(`converse.fields-${this.get('jid')}`));
  56370. this.fields.on('add', this.onFieldAdded, this);
  56371. this.identities = new Backbone.Collection();
  56372. this.identities.browserStorage = new Backbone.BrowserStorage.session(b64_sha1(`converse.identities-${this.get('jid')}`));
  56373. this.fetchFeatures();
  56374. this.items = new _converse.DiscoEntities();
  56375. this.items.browserStorage = new Backbone.BrowserStorage.session(b64_sha1(`converse.disco-items-${this.get('jid')}`));
  56376. this.items.fetch();
  56377. },
  56378. getIdentity(category, type) {
  56379. /* Returns a Promise which resolves with a map indicating
  56380. * whether a given identity is provided.
  56381. *
  56382. * Parameters:
  56383. * (String) category - The identity category
  56384. * (String) type - The identity type
  56385. */
  56386. const entity = this;
  56387. return new Promise((resolve, reject) => {
  56388. function fulfillPromise() {
  56389. const model = entity.identities.findWhere({
  56390. 'category': category,
  56391. 'type': type
  56392. });
  56393. resolve(model);
  56394. }
  56395. entity.waitUntilFeaturesDiscovered.then(fulfillPromise).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
  56396. });
  56397. },
  56398. hasFeature(feature) {
  56399. /* Returns a Promise which resolves with a map indicating
  56400. * whether a given feature is supported.
  56401. *
  56402. * Parameters:
  56403. * (String) feature - The feature that might be supported.
  56404. */
  56405. const entity = this;
  56406. return new Promise((resolve, reject) => {
  56407. function fulfillPromise() {
  56408. if (entity.features.findWhere({
  56409. 'var': feature
  56410. })) {
  56411. resolve(entity);
  56412. } else {
  56413. resolve();
  56414. }
  56415. }
  56416. entity.waitUntilFeaturesDiscovered.then(fulfillPromise).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
  56417. });
  56418. },
  56419. onFeatureAdded(feature) {
  56420. feature.entity = this;
  56421. _converse.emit('serviceDiscovered', feature);
  56422. },
  56423. onFieldAdded(field) {
  56424. field.entity = this;
  56425. _converse.emit('discoExtensionFieldDiscovered', field);
  56426. },
  56427. fetchFeatures() {
  56428. if (this.features.browserStorage.records.length === 0) {
  56429. this.queryInfo();
  56430. } else {
  56431. this.features.fetch({
  56432. add: true,
  56433. success: () => {
  56434. this.waitUntilFeaturesDiscovered.resolve(this);
  56435. this.trigger('featuresDiscovered');
  56436. }
  56437. });
  56438. this.identities.fetch({
  56439. add: true
  56440. });
  56441. }
  56442. },
  56443. async queryInfo() {
  56444. try {
  56445. const stanza = await _converse.api.disco.info(this.get('jid'), null);
  56446. this.onInfo(stanza);
  56447. } catch (iq) {
  56448. this.waitUntilFeaturesDiscovered.resolve(this);
  56449. _converse.log(iq, Strophe.LogLevel.ERROR);
  56450. }
  56451. },
  56452. onDiscoItems(stanza) {
  56453. _.each(sizzle__WEBPACK_IMPORTED_MODULE_1___default()(`query[xmlns="${Strophe.NS.DISCO_ITEMS}"] item`, stanza), item => {
  56454. if (item.getAttribute("node")) {
  56455. // XXX: ignore nodes for now.
  56456. // See: https://xmpp.org/extensions/xep-0030.html#items-nodes
  56457. return;
  56458. }
  56459. const jid = item.getAttribute('jid');
  56460. if (_.isUndefined(this.items.get(jid))) {
  56461. const entity = _converse.disco_entities.get(jid);
  56462. if (entity) {
  56463. this.items.add(entity);
  56464. } else {
  56465. this.items.create({
  56466. 'jid': jid
  56467. });
  56468. }
  56469. }
  56470. });
  56471. },
  56472. async queryForItems() {
  56473. if (_.isEmpty(this.identities.where({
  56474. 'category': 'server'
  56475. }))) {
  56476. // Don't fetch features and items if this is not a
  56477. // server or a conference component.
  56478. return;
  56479. }
  56480. const stanza = await _converse.api.disco.items(this.get('jid'));
  56481. this.onDiscoItems(stanza);
  56482. },
  56483. onInfo(stanza) {
  56484. _.forEach(stanza.querySelectorAll('identity'), identity => {
  56485. this.identities.create({
  56486. 'category': identity.getAttribute('category'),
  56487. 'type': identity.getAttribute('type'),
  56488. 'name': identity.getAttribute('name')
  56489. });
  56490. });
  56491. _.each(sizzle__WEBPACK_IMPORTED_MODULE_1___default()(`x[type="result"][xmlns="${Strophe.NS.XFORM}"]`, stanza), form => {
  56492. const data = {};
  56493. _.each(form.querySelectorAll('field'), field => {
  56494. data[field.getAttribute('var')] = {
  56495. 'value': _.get(field.querySelector('value'), 'textContent'),
  56496. 'type': field.getAttribute('type')
  56497. };
  56498. });
  56499. this.dataforms.create(data);
  56500. });
  56501. if (stanza.querySelector(`feature[var="${Strophe.NS.DISCO_ITEMS}"]`)) {
  56502. this.queryForItems();
  56503. }
  56504. _.forEach(stanza.querySelectorAll('feature'), feature => {
  56505. this.features.create({
  56506. 'var': feature.getAttribute('var'),
  56507. 'from': stanza.getAttribute('from')
  56508. });
  56509. }); // XEP-0128 Service Discovery Extensions
  56510. _.forEach(sizzle__WEBPACK_IMPORTED_MODULE_1___default()('x[type="result"][xmlns="jabber:x:data"] field', stanza), field => {
  56511. this.fields.create({
  56512. 'var': field.getAttribute('var'),
  56513. 'value': _.get(field.querySelector('value'), 'textContent'),
  56514. 'from': stanza.getAttribute('from')
  56515. });
  56516. });
  56517. this.waitUntilFeaturesDiscovered.resolve(this);
  56518. this.trigger('featuresDiscovered');
  56519. }
  56520. });
  56521. _converse.DiscoEntities = Backbone.Collection.extend({
  56522. model: _converse.DiscoEntity,
  56523. fetchEntities() {
  56524. return new Promise((resolve, reject) => {
  56525. this.fetch({
  56526. add: true,
  56527. success: resolve,
  56528. error() {
  56529. reject(new Error("Could not fetch disco entities"));
  56530. }
  56531. });
  56532. });
  56533. }
  56534. });
  56535. function addClientFeatures() {
  56536. // See http://xmpp.org/registrar/disco-categories.html
  56537. _converse.api.disco.own.identities.add('client', 'web', 'Converse');
  56538. _converse.api.disco.own.features.add(Strophe.NS.BOSH);
  56539. _converse.api.disco.own.features.add(Strophe.NS.CHATSTATES);
  56540. _converse.api.disco.own.features.add(Strophe.NS.DISCO_INFO);
  56541. _converse.api.disco.own.features.add(Strophe.NS.ROSTERX); // Limited support
  56542. if (_converse.message_carbons) {
  56543. _converse.api.disco.own.features.add(Strophe.NS.CARBONS);
  56544. }
  56545. _converse.emit('addClientFeatures');
  56546. return this;
  56547. }
  56548. function initStreamFeatures() {
  56549. _converse.stream_features = new Backbone.Collection();
  56550. _converse.stream_features.browserStorage = new Backbone.BrowserStorage.session(b64_sha1(`converse.stream-features-${_converse.bare_jid}`));
  56551. _converse.stream_features.fetch({
  56552. success(collection) {
  56553. if (collection.length === 0 && _converse.connection.features) {
  56554. _.forEach(_converse.connection.features.childNodes, feature => {
  56555. _converse.stream_features.create({
  56556. 'name': feature.nodeName,
  56557. 'xmlns': feature.getAttribute('xmlns')
  56558. });
  56559. });
  56560. }
  56561. }
  56562. });
  56563. _converse.emit('streamFeaturesAdded');
  56564. }
  56565. async function initializeDisco() {
  56566. addClientFeatures();
  56567. _converse.connection.addHandler(onDiscoInfoRequest, Strophe.NS.DISCO_INFO, 'iq', 'get', null, null);
  56568. _converse.disco_entities = new _converse.DiscoEntities();
  56569. _converse.disco_entities.browserStorage = new Backbone.BrowserStorage.session(b64_sha1(`converse.disco-entities-${_converse.bare_jid}`));
  56570. const collection = await _converse.disco_entities.fetchEntities();
  56571. if (collection.length === 0 || !collection.get(_converse.domain)) {
  56572. // If we don't have an entity for our own XMPP server,
  56573. // create one.
  56574. _converse.disco_entities.create({
  56575. 'jid': _converse.domain
  56576. });
  56577. }
  56578. _converse.emit('discoInitialized');
  56579. }
  56580. _converse.api.listen.on('sessionInitialized', initStreamFeatures);
  56581. _converse.api.listen.on('reconnected', initializeDisco);
  56582. _converse.api.listen.on('connected', initializeDisco);
  56583. _converse.api.listen.on('beforeTearDown', () => {
  56584. if (_converse.disco_entities) {
  56585. _converse.disco_entities.each(entity => {
  56586. entity.features.reset();
  56587. entity.features.browserStorage._clear();
  56588. });
  56589. _converse.disco_entities.reset();
  56590. _converse.disco_entities.browserStorage._clear();
  56591. }
  56592. });
  56593. const plugin = this;
  56594. plugin._identities = [];
  56595. plugin._features = [];
  56596. function onDiscoInfoRequest(stanza) {
  56597. const node = stanza.getElementsByTagName('query')[0].getAttribute('node');
  56598. const attrs = {
  56599. xmlns: Strophe.NS.DISCO_INFO
  56600. };
  56601. if (node) {
  56602. attrs.node = node;
  56603. }
  56604. const iqresult = $iq({
  56605. 'type': 'result',
  56606. 'id': stanza.getAttribute('id')
  56607. });
  56608. const from = stanza.getAttribute('from');
  56609. if (from !== null) {
  56610. iqresult.attrs({
  56611. 'to': from
  56612. });
  56613. }
  56614. iqresult.c('query', attrs);
  56615. _.each(plugin._identities, identity => {
  56616. const attrs = {
  56617. 'category': identity.category,
  56618. 'type': identity.type
  56619. };
  56620. if (identity.name) {
  56621. attrs.name = identity.name;
  56622. }
  56623. if (identity.lang) {
  56624. attrs['xml:lang'] = identity.lang;
  56625. }
  56626. iqresult.c('identity', attrs).up();
  56627. });
  56628. _.each(plugin._features, feature => {
  56629. iqresult.c('feature', {
  56630. 'var': feature
  56631. }).up();
  56632. });
  56633. _converse.api.send(iqresult.tree());
  56634. return true;
  56635. }
  56636. _.extend(_converse.api, {
  56637. /**
  56638. * The XEP-0030 service discovery API
  56639. *
  56640. * This API lets you discover information about entities on the
  56641. * XMPP network.
  56642. *
  56643. * @namespace _converse.api.disco
  56644. * @memberOf _converse.api
  56645. */
  56646. 'disco': {
  56647. /**
  56648. * @namespace _converse.api.disco.stream
  56649. * @memberOf _converse.api.disco
  56650. */
  56651. 'stream': {
  56652. /**
  56653. * @method _converse.api.disco.stream.getFeature
  56654. * @param {String} name The feature name
  56655. * @param {String} xmlns The XML namespace
  56656. * @example _converse.api.disco.stream.getFeature('ver', 'urn:xmpp:features:rosterver')
  56657. */
  56658. 'getFeature': function getFeature(name, xmlns) {
  56659. if (_.isNil(name) || _.isNil(xmlns)) {
  56660. throw new Error("name and xmlns need to be provided when calling disco.stream.getFeature");
  56661. }
  56662. return _converse.stream_features.findWhere({
  56663. 'name': name,
  56664. 'xmlns': xmlns
  56665. });
  56666. }
  56667. },
  56668. /**
  56669. * @namespace _converse.api.disco.own
  56670. * @memberOf _converse.api.disco
  56671. */
  56672. 'own': {
  56673. /**
  56674. * @namespace _converse.api.disco.own.identities
  56675. * @memberOf _converse.api.disco.own
  56676. */
  56677. 'identities': {
  56678. /**
  56679. * Lets you add new identities for this client (i.e. instance of Converse)
  56680. * @method _converse.api.disco.own.identities.add
  56681. *
  56682. * @param {String} category - server, client, gateway, directory, etc.
  56683. * @param {String} type - phone, pc, web, etc.
  56684. * @param {String} name - "Converse"
  56685. * @param {String} lang - en, el, de, etc.
  56686. *
  56687. * @example _converse.api.disco.own.identities.clear();
  56688. */
  56689. add(category, type, name, lang) {
  56690. for (var i = 0; i < plugin._identities.length; i++) {
  56691. if (plugin._identities[i].category == category && plugin._identities[i].type == type && plugin._identities[i].name == name && plugin._identities[i].lang == lang) {
  56692. return false;
  56693. }
  56694. }
  56695. plugin._identities.push({
  56696. category: category,
  56697. type: type,
  56698. name: name,
  56699. lang: lang
  56700. });
  56701. },
  56702. /**
  56703. * Clears all previously registered identities.
  56704. * @method _converse.api.disco.own.identities.clear
  56705. * @example _converse.api.disco.own.identities.clear();
  56706. */
  56707. clear() {
  56708. plugin._identities = [];
  56709. },
  56710. /**
  56711. * Returns all of the identities registered for this client
  56712. * (i.e. instance of Converse).
  56713. * @method _converse.api.disco.identities.get
  56714. * @example const identities = _converse.api.disco.own.identities.get();
  56715. */
  56716. get() {
  56717. return plugin._identities;
  56718. }
  56719. },
  56720. /**
  56721. * @namespace _converse.api.disco.own.features
  56722. * @memberOf _converse.api.disco.own
  56723. */
  56724. 'features': {
  56725. /**
  56726. * Lets you register new disco features for this client (i.e. instance of Converse)
  56727. * @method _converse.api.disco.own.features.add
  56728. * @param {String} name - e.g. http://jabber.org/protocol/caps
  56729. * @example _converse.api.disco.own.features.add("http://jabber.org/protocol/caps");
  56730. */
  56731. add(name) {
  56732. for (var i = 0; i < plugin._features.length; i++) {
  56733. if (plugin._features[i] == name) {
  56734. return false;
  56735. }
  56736. }
  56737. plugin._features.push(name);
  56738. },
  56739. /**
  56740. * Clears all previously registered features.
  56741. * @method _converse.api.disco.own.features.clear
  56742. * @example _converse.api.disco.own.features.clear();
  56743. */
  56744. clear() {
  56745. plugin._features = [];
  56746. },
  56747. /**
  56748. * Returns all of the features registered for this client (i.e. instance of Converse).
  56749. * @method _converse.api.disco.own.features.get
  56750. * @example const features = _converse.api.disco.own.features.get();
  56751. */
  56752. get() {
  56753. return plugin._features;
  56754. }
  56755. }
  56756. },
  56757. /**
  56758. * Query for information about an XMPP entity
  56759. *
  56760. * @method _converse.api.disco.info
  56761. * @param {string} jid The Jabber ID of the entity to query
  56762. * @param {string} [node] A specific node identifier associated with the JID
  56763. * @returns {promise} Promise which resolves once we have a result from the server.
  56764. */
  56765. 'info'(jid, node) {
  56766. const attrs = {
  56767. xmlns: Strophe.NS.DISCO_INFO
  56768. };
  56769. if (node) {
  56770. attrs.node = node;
  56771. }
  56772. const info = $iq({
  56773. 'from': _converse.connection.jid,
  56774. 'to': jid,
  56775. 'type': 'get'
  56776. }).c('query', attrs);
  56777. return _converse.api.sendIQ(info);
  56778. },
  56779. /**
  56780. * Query for items associated with an XMPP entity
  56781. *
  56782. * @method _converse.api.disco.items
  56783. * @param {string} jid The Jabber ID of the entity to query for items
  56784. * @param {string} [node] A specific node identifier associated with the JID
  56785. * @returns {promise} Promise which resolves once we have a result from the server.
  56786. */
  56787. 'items'(jid, node) {
  56788. const attrs = {
  56789. 'xmlns': Strophe.NS.DISCO_ITEMS
  56790. };
  56791. if (node) {
  56792. attrs.node = node;
  56793. }
  56794. return _converse.api.sendIQ($iq({
  56795. 'from': _converse.connection.jid,
  56796. 'to': jid,
  56797. 'type': 'get'
  56798. }).c('query', attrs));
  56799. },
  56800. /**
  56801. * Namespace for methods associated with disco entities
  56802. *
  56803. * @namespace _converse.api.disco.entities
  56804. * @memberOf _converse.api.disco
  56805. */
  56806. 'entities': {
  56807. /**
  56808. * Get the the corresponding `DiscoEntity` instance.
  56809. *
  56810. * @method _converse.api.disco.entities.get
  56811. * @param {string} jid The Jabber ID of the entity
  56812. * @param {boolean} [create] Whether the entity should be created if it doesn't exist.
  56813. * @example _converse.api.disco.entities.get(jid);
  56814. */
  56815. async 'get'(jid, create = false) {
  56816. await _converse.api.waitUntil('discoInitialized');
  56817. if (_.isNil(jid)) {
  56818. return _converse.disco_entities;
  56819. }
  56820. const entity = _converse.disco_entities.get(jid);
  56821. if (entity || !create) {
  56822. return entity;
  56823. }
  56824. return _converse.disco_entities.create({
  56825. 'jid': jid
  56826. });
  56827. }
  56828. },
  56829. /**
  56830. * Used to determine whether an entity supports a given feature.
  56831. *
  56832. * @method _converse.api.disco.supports
  56833. * @param {string} feature The feature that might be
  56834. * supported. In the XML stanza, this is the `var`
  56835. * attribute of the `<feature>` element. For
  56836. * example: `http://jabber.org/protocol/muc`
  56837. * @param {string} jid The JID of the entity
  56838. * (and its associated items) which should be queried
  56839. * @returns {promise} A promise which resolves with a list containing
  56840. * _converse.Entity instances representing the entity
  56841. * itself or those items associated with the entity if
  56842. * they support the given feature.
  56843. *
  56844. * @example
  56845. * _converse.api.disco.supports(Strophe.NS.MAM, _converse.bare_jid)
  56846. * .then(value => {
  56847. * // `value` is a map with two keys, `supported` and `feature`.
  56848. * if (value.supported) {
  56849. * // The feature is supported
  56850. * } else {
  56851. * // The feature is not supported
  56852. * }
  56853. * }).catch(() => {
  56854. * _converse.log(
  56855. * "Error or timeout while checking for feature support",
  56856. * Strophe.LogLevel.ERROR
  56857. * );
  56858. * });
  56859. */
  56860. async 'supports'(feature, jid) {
  56861. if (_.isNil(jid)) {
  56862. throw new TypeError('api.disco.supports: You need to provide an entity JID');
  56863. }
  56864. await _converse.api.waitUntil('discoInitialized');
  56865. let entity = await _converse.api.disco.entities.get(jid, true);
  56866. entity = await entity.waitUntilFeaturesDiscovered;
  56867. const promises = _.concat(entity.items.map(item => item.hasFeature(feature)), entity.hasFeature(feature));
  56868. const result = await Promise.all(promises);
  56869. return f.filter(f.isObject, result);
  56870. },
  56871. /**
  56872. * Refresh the features (and fields and identities) associated with a
  56873. * disco entity by refetching them from the server
  56874. *
  56875. * @method _converse.api.disco.refreshFeatures
  56876. * @param {string} jid The JID of the entity whose features are refreshed.
  56877. * @returns {promise} A promise which resolves once the features have been refreshed
  56878. * @example
  56879. * await _converse.api.disco.refreshFeatures('room@conference.example.org');
  56880. */
  56881. async 'refreshFeatures'(jid) {
  56882. if (_.isNil(jid)) {
  56883. throw new TypeError('api.disco.refreshFeatures: You need to provide an entity JID');
  56884. }
  56885. await _converse.api.waitUntil('discoInitialized');
  56886. const entity = await _converse.api.disco.entities.get(jid, true);
  56887. entity.features.reset();
  56888. entity.fields.reset();
  56889. entity.identities.reset();
  56890. entity.waitUntilFeaturesDiscovered = utils.getResolveablePromise();
  56891. entity.queryInfo();
  56892. return entity.waitUntilFeaturesDiscovered;
  56893. },
  56894. /**
  56895. * Return all the features associated with a disco entity
  56896. *
  56897. * @method _converse.api.disco.getFeatures
  56898. * @param {string} jid The JID of the entity whose features are returned.
  56899. * @returns {promise} A promise which resolves with the returned features
  56900. * @example
  56901. * const features = await _converse.api.disco.getFeatures('room@conference.example.org');
  56902. */
  56903. async 'getFeatures'(jid) {
  56904. if (_.isNil(jid)) {
  56905. throw new TypeError('api.disco.getFeatures: You need to provide an entity JID');
  56906. }
  56907. await _converse.api.waitUntil('discoInitialized');
  56908. let entity = await _converse.api.disco.entities.get(jid, true);
  56909. entity = await entity.waitUntilFeaturesDiscovered;
  56910. return entity.features;
  56911. },
  56912. /**
  56913. * Return all the service discovery extensions fields
  56914. * associated with an entity.
  56915. *
  56916. * See [XEP-0129: Service Discovery Extensions](https://xmpp.org/extensions/xep-0128.html)
  56917. *
  56918. * @method _converse.api.disco.getFields
  56919. * @param {string} jid The JID of the entity whose fields are returned.
  56920. * @example
  56921. * const fields = await _converse.api.disco.getFields('room@conference.example.org');
  56922. */
  56923. async 'getFields'(jid) {
  56924. if (_.isNil(jid)) {
  56925. throw new TypeError('api.disco.getFields: You need to provide an entity JID');
  56926. }
  56927. await _converse.api.waitUntil('discoInitialized');
  56928. let entity = await _converse.api.disco.entities.get(jid, true);
  56929. entity = await entity.waitUntilFeaturesDiscovered;
  56930. return entity.fields;
  56931. },
  56932. /**
  56933. * Get the identity (with the given category and type) for a given disco entity.
  56934. *
  56935. * For example, when determining support for PEP (personal eventing protocol), you
  56936. * want to know whether the user's own JID has an identity with
  56937. * `category='pubsub'` and `type='pep'` as explained in this section of
  56938. * XEP-0163: https://xmpp.org/extensions/xep-0163.html#support
  56939. *
  56940. * @method _converse.api.disco.getIdentity
  56941. * @param {string} The identity category.
  56942. * In the XML stanza, this is the `category`
  56943. * attribute of the `<identity>` element.
  56944. * For example: 'pubsub'
  56945. * @param {string} type The identity type.
  56946. * In the XML stanza, this is the `type`
  56947. * attribute of the `<identity>` element.
  56948. * For example: 'pep'
  56949. * @param {string} jid The JID of the entity which might have the identity
  56950. * @returns {promise} A promise which resolves with a map indicating
  56951. * whether an identity with a given type is provided by the entity.
  56952. * @example
  56953. * _converse.api.disco.getIdentity('pubsub', 'pep', _converse.bare_jid).then(
  56954. * function (identity) {
  56955. * if (_.isNil(identity)) {
  56956. * // The entity DOES NOT have this identity
  56957. * } else {
  56958. * // The entity DOES have this identity
  56959. * }
  56960. * }
  56961. * ).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
  56962. */
  56963. async 'getIdentity'(category, type, jid) {
  56964. const e = await _converse.api.disco.entities.get(jid, true);
  56965. return e.getIdentity(category, type);
  56966. }
  56967. }
  56968. });
  56969. }
  56970. });
  56971. /***/ }),
  56972. /***/ "./src/headless/converse-mam.js":
  56973. /*!**************************************!*\
  56974. !*** ./src/headless/converse-mam.js ***!
  56975. \**************************************/
  56976. /*! no exports provided */
  56977. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  56978. "use strict";
  56979. __webpack_require__.r(__webpack_exports__);
  56980. /* harmony import */ var _converse_disco__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./converse-disco */ "./src/headless/converse-disco.js");
  56981. /* harmony import */ var strophejs_plugin_rsm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! strophejs-plugin-rsm */ "./node_modules/strophejs-plugin-rsm/lib/strophe.rsm.js");
  56982. /* harmony import */ var strophejs_plugin_rsm__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(strophejs_plugin_rsm__WEBPACK_IMPORTED_MODULE_1__);
  56983. /* harmony import */ var _converse_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./converse-core */ "./src/headless/converse-core.js");
  56984. /* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
  56985. /* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_3__);
  56986. // Converse.js (A browser based XMPP chat client)
  56987. // http://conversejs.org
  56988. //
  56989. // Copyright (c) 2012-2017, Jan-Carel Brand <jc@opkode.com>
  56990. // Licensed under the Mozilla Public License (MPLv2)
  56991. //
  56992. /*global define */
  56993. // XEP-0059 Result Set Management
  56994. const CHATROOMS_TYPE = 'chatroom';
  56995. const _converse$env = _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].env,
  56996. Promise = _converse$env.Promise,
  56997. Strophe = _converse$env.Strophe,
  56998. $iq = _converse$env.$iq,
  56999. _ = _converse$env._,
  57000. moment = _converse$env.moment;
  57001. const u = _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].env.utils;
  57002. const RSM_ATTRIBUTES = ['max', 'first', 'last', 'after', 'before', 'index', 'count']; // XEP-0313 Message Archive Management
  57003. const MAM_ATTRIBUTES = ['with', 'start', 'end'];
  57004. function getMessageArchiveID(stanza) {
  57005. // See https://xmpp.org/extensions/xep-0313.html#results
  57006. //
  57007. // The result messages MUST contain a <result/> element with an 'id'
  57008. // attribute that gives the current message's archive UID
  57009. const result = sizzle__WEBPACK_IMPORTED_MODULE_3___default()(`result[xmlns="${Strophe.NS.MAM}"]`, stanza).pop();
  57010. if (!_.isUndefined(result)) {
  57011. return result.getAttribute('id');
  57012. } // See: https://xmpp.org/extensions/xep-0313.html#archives_id
  57013. const stanza_id = sizzle__WEBPACK_IMPORTED_MODULE_3___default()(`stanza-id[xmlns="${Strophe.NS.SID}"]`, stanza).pop();
  57014. if (!_.isUndefined(stanza_id)) {
  57015. return stanza_id.getAttribute('id');
  57016. }
  57017. }
  57018. function queryForArchivedMessages(_converse, options, callback, errback) {
  57019. /* Internal function, called by the "archive.query" API method.
  57020. */
  57021. let date;
  57022. if (_.isFunction(options)) {
  57023. callback = options;
  57024. errback = callback;
  57025. options = null;
  57026. }
  57027. const queryid = _converse.connection.getUniqueId();
  57028. const attrs = {
  57029. 'type': 'set'
  57030. };
  57031. if (options && options.groupchat) {
  57032. if (!options['with']) {
  57033. // eslint-disable-line dot-notation
  57034. throw new Error('You need to specify a "with" value containing ' + 'the chat room JID, when querying groupchat messages.');
  57035. }
  57036. attrs.to = options['with']; // eslint-disable-line dot-notation
  57037. }
  57038. const stanza = $iq(attrs).c('query', {
  57039. 'xmlns': Strophe.NS.MAM,
  57040. 'queryid': queryid
  57041. });
  57042. if (options) {
  57043. stanza.c('x', {
  57044. 'xmlns': Strophe.NS.XFORM,
  57045. 'type': 'submit'
  57046. }).c('field', {
  57047. 'var': 'FORM_TYPE',
  57048. 'type': 'hidden'
  57049. }).c('value').t(Strophe.NS.MAM).up().up();
  57050. if (options['with'] && !options.groupchat) {
  57051. // eslint-disable-line dot-notation
  57052. stanza.c('field', {
  57053. 'var': 'with'
  57054. }).c('value').t(options['with']).up().up(); // eslint-disable-line dot-notation
  57055. }
  57056. _.each(['start', 'end'], function (t) {
  57057. if (options[t]) {
  57058. date = moment(options[t]);
  57059. if (date.isValid()) {
  57060. stanza.c('field', {
  57061. 'var': t
  57062. }).c('value').t(date.format()).up().up();
  57063. } else {
  57064. throw new TypeError(`archive.query: invalid date provided for: ${t}`);
  57065. }
  57066. }
  57067. });
  57068. stanza.up();
  57069. if (options instanceof Strophe.RSM) {
  57070. stanza.cnode(options.toXML());
  57071. } else if (_.intersection(RSM_ATTRIBUTES, _.keys(options)).length) {
  57072. stanza.cnode(new Strophe.RSM(options).toXML());
  57073. }
  57074. }
  57075. const messages = [];
  57076. const message_handler = _converse.connection.addHandler(message => {
  57077. if (options.groupchat && message.getAttribute('from') !== options['with']) {
  57078. // eslint-disable-line dot-notation
  57079. return true;
  57080. }
  57081. const result = message.querySelector('result');
  57082. if (!_.isNull(result) && result.getAttribute('queryid') === queryid) {
  57083. messages.push(message);
  57084. }
  57085. return true;
  57086. }, Strophe.NS.MAM);
  57087. _converse.api.sendIQ(stanza, _converse.message_archiving_timeout).then(iq => {
  57088. _converse.connection.deleteHandler(message_handler);
  57089. if (_.isFunction(callback)) {
  57090. const set = iq.querySelector('set');
  57091. let rsm;
  57092. if (!_.isUndefined(set)) {
  57093. rsm = new Strophe.RSM({
  57094. xml: set
  57095. });
  57096. _.extend(rsm, _.pick(options, _.concat(MAM_ATTRIBUTES, ['max'])));
  57097. }
  57098. callback(messages, rsm);
  57099. }
  57100. }).catch(e => {
  57101. _converse.connection.deleteHandler(message_handler);
  57102. if (_.isFunction(errback)) {
  57103. errback.apply(this, arguments);
  57104. }
  57105. return;
  57106. });
  57107. }
  57108. _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].plugins.add('converse-mam', {
  57109. dependencies: ['converse-chatview', 'converse-muc', 'converse-muc-views'],
  57110. overrides: {
  57111. // Overrides mentioned here will be picked up by converse.js's
  57112. // plugin architecture they will replace existing methods on the
  57113. // relevant objects or classes.
  57114. //
  57115. // New functions which don't exist yet can also be added.
  57116. ChatBox: {
  57117. async getMessageAttributesFromStanza(message, original_stanza) {
  57118. const attrs = await this.__super__.getMessageAttributesFromStanza.apply(this, arguments);
  57119. attrs.archive_id = getMessageArchiveID(original_stanza);
  57120. return attrs;
  57121. }
  57122. },
  57123. ChatBoxView: {
  57124. render() {
  57125. const result = this.__super__.render.apply(this, arguments);
  57126. if (!this.disable_mam) {
  57127. this.content.addEventListener('scroll', _.debounce(this.onScroll.bind(this), 100));
  57128. }
  57129. return result;
  57130. },
  57131. fetchNewestMessages() {
  57132. /* Fetches messages that might have been archived *after*
  57133. * the last archived message in our local cache.
  57134. */
  57135. if (this.disable_mam) {
  57136. return;
  57137. }
  57138. const _converse = this.__super__._converse,
  57139. most_recent_msg = u.getMostRecentMessage(this.model);
  57140. if (_.isNil(most_recent_msg)) {
  57141. this.fetchArchivedMessages();
  57142. } else {
  57143. const archive_id = most_recent_msg.get('archive_id');
  57144. if (archive_id) {
  57145. this.fetchArchivedMessages({
  57146. 'after': most_recent_msg.get('archive_id')
  57147. });
  57148. } else {
  57149. this.fetchArchivedMessages({
  57150. 'start': most_recent_msg.get('time')
  57151. });
  57152. }
  57153. }
  57154. },
  57155. fetchArchivedMessagesIfNecessary() {
  57156. /* Check if archived messages should be fetched, and if so, do so. */
  57157. if (this.disable_mam || this.model.get('mam_initialized')) {
  57158. return;
  57159. }
  57160. const _converse = this.__super__._converse;
  57161. _converse.api.disco.supports(Strophe.NS.MAM, _converse.bare_jid).then(result => {
  57162. // Success
  57163. if (result.length) {
  57164. this.fetchArchivedMessages();
  57165. }
  57166. this.model.save({
  57167. 'mam_initialized': true
  57168. });
  57169. }, () => {
  57170. // Error
  57171. _converse.log("Error or timeout while checking for MAM support", Strophe.LogLevel.ERROR);
  57172. }).catch(msg => {
  57173. this.clearSpinner();
  57174. _converse.log(msg, Strophe.LogLevel.FATAL);
  57175. });
  57176. },
  57177. fetchArchivedMessages(options) {
  57178. const _converse = this.__super__._converse;
  57179. if (this.disable_mam) {
  57180. return;
  57181. }
  57182. const is_groupchat = this.model.get('type') === CHATROOMS_TYPE;
  57183. let mam_jid, message_handler;
  57184. if (is_groupchat) {
  57185. mam_jid = this.model.get('jid');
  57186. message_handler = this.model.onMessage.bind(this.model);
  57187. } else {
  57188. mam_jid = _converse.bare_jid;
  57189. message_handler = _converse.chatboxes.onMessage.bind(_converse.chatboxes);
  57190. }
  57191. _converse.api.disco.supports(Strophe.NS.MAM, mam_jid).then(results => {
  57192. // Success
  57193. if (!results.length) {
  57194. return;
  57195. }
  57196. this.addSpinner();
  57197. _converse.api.archive.query(_.extend({
  57198. 'groupchat': is_groupchat,
  57199. 'before': '',
  57200. // Page backwards from the most recent message
  57201. 'max': _converse.archived_messages_page_size,
  57202. 'with': this.model.get('jid')
  57203. }, options), messages => {
  57204. // Success
  57205. this.clearSpinner();
  57206. _.each(messages, message_handler);
  57207. }, e => {
  57208. // Error
  57209. this.clearSpinner();
  57210. _converse.log("Error or timeout while trying to fetch " + "archived messages", Strophe.LogLevel.ERROR);
  57211. _converse.log(e, Strophe.LogLevel.ERROR);
  57212. });
  57213. }, () => {
  57214. // Error
  57215. _converse.log("Error or timeout while checking for MAM support", Strophe.LogLevel.ERROR);
  57216. }).catch(msg => {
  57217. this.clearSpinner();
  57218. _converse.log(msg, Strophe.LogLevel.FATAL);
  57219. });
  57220. },
  57221. onScroll(ev) {
  57222. const _converse = this.__super__._converse;
  57223. if (this.content.scrollTop === 0 && this.model.messages.length) {
  57224. const oldest_message = this.model.messages.at(0);
  57225. const archive_id = oldest_message.get('archive_id');
  57226. if (archive_id) {
  57227. this.fetchArchivedMessages({
  57228. 'before': archive_id
  57229. });
  57230. } else {
  57231. this.fetchArchivedMessages({
  57232. 'end': oldest_message.get('time')
  57233. });
  57234. }
  57235. }
  57236. }
  57237. },
  57238. ChatRoom: {
  57239. isDuplicate(message, original_stanza) {
  57240. const result = this.__super__.isDuplicate.apply(this, arguments);
  57241. if (result) {
  57242. return result;
  57243. }
  57244. const archive_id = getMessageArchiveID(original_stanza);
  57245. if (archive_id) {
  57246. return this.messages.filter({
  57247. 'archive_id': archive_id
  57248. }).length > 0;
  57249. }
  57250. }
  57251. },
  57252. ChatRoomView: {
  57253. initialize() {
  57254. const _converse = this.__super__._converse;
  57255. this.__super__.initialize.apply(this, arguments);
  57256. this.model.on('change:mam_enabled', this.fetchArchivedMessagesIfNecessary, this);
  57257. this.model.on('change:connection_status', this.fetchArchivedMessagesIfNecessary, this);
  57258. },
  57259. renderChatArea() {
  57260. const result = this.__super__.renderChatArea.apply(this, arguments);
  57261. if (!this.disable_mam) {
  57262. this.content.addEventListener('scroll', _.debounce(this.onScroll.bind(this), 100));
  57263. }
  57264. return result;
  57265. },
  57266. fetchArchivedMessagesIfNecessary() {
  57267. if (this.model.get('connection_status') !== _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].ROOMSTATUS.ENTERED || !this.model.get('mam_enabled') || this.model.get('mam_initialized')) {
  57268. return;
  57269. }
  57270. this.fetchArchivedMessages();
  57271. this.model.save({
  57272. 'mam_initialized': true
  57273. });
  57274. }
  57275. }
  57276. },
  57277. initialize() {
  57278. /* The initialize function gets called as soon as the plugin is
  57279. * loaded by Converse.js's plugin machinery.
  57280. */
  57281. const _converse = this._converse;
  57282. _converse.api.settings.update({
  57283. archived_messages_page_size: '50',
  57284. message_archiving: undefined,
  57285. // Supported values are 'always', 'never', 'roster' (https://xmpp.org/extensions/xep-0313.html#prefs)
  57286. message_archiving_timeout: 20000 // Time (in milliseconds) to wait before aborting MAM request
  57287. });
  57288. _converse.onMAMError = function (iq) {
  57289. if (iq.querySelectorAll('feature-not-implemented').length) {
  57290. _converse.log("Message Archive Management (XEP-0313) not supported by this server", Strophe.LogLevel.WARN);
  57291. } else {
  57292. _converse.log("An error occured while trying to set archiving preferences.", Strophe.LogLevel.ERROR);
  57293. _converse.log(iq);
  57294. }
  57295. };
  57296. _converse.onMAMPreferences = function (feature, iq) {
  57297. /* Handle returned IQ stanza containing Message Archive
  57298. * Management (XEP-0313) preferences.
  57299. *
  57300. * XXX: For now we only handle the global default preference.
  57301. * The XEP also provides for per-JID preferences, which is
  57302. * currently not supported in converse.js.
  57303. *
  57304. * Per JID preferences will be set in chat boxes, so it'll
  57305. * probbaly be handled elsewhere in any case.
  57306. */
  57307. const preference = sizzle__WEBPACK_IMPORTED_MODULE_3___default()(`prefs[xmlns="${Strophe.NS.MAM}"]`, iq).pop();
  57308. const default_pref = preference.getAttribute('default');
  57309. if (default_pref !== _converse.message_archiving) {
  57310. const stanza = $iq({
  57311. 'type': 'set'
  57312. }).c('prefs', {
  57313. 'xmlns': Strophe.NS.MAM,
  57314. 'default': _converse.message_archiving
  57315. });
  57316. _.each(preference.children, child => stanza.cnode(child).up()); // XXX: Strictly speaking, the server should respond with the updated prefs
  57317. // (see example 18: https://xmpp.org/extensions/xep-0313.html#config)
  57318. // but Prosody doesn't do this, so we don't rely on it.
  57319. _converse.api.sendIQ(stanza).then(() => feature.save({
  57320. 'preferences': {
  57321. 'default': _converse.message_archiving
  57322. }
  57323. })).catch(_converse.onMAMError);
  57324. } else {
  57325. feature.save({
  57326. 'preferences': {
  57327. 'default': _converse.message_archiving
  57328. }
  57329. });
  57330. }
  57331. };
  57332. /* Event handlers */
  57333. _converse.on('serviceDiscovered', feature => {
  57334. const prefs = feature.get('preferences') || {};
  57335. if (feature.get('var') === Strophe.NS.MAM && prefs['default'] !== _converse.message_archiving && // eslint-disable-line dot-notation
  57336. !_.isUndefined(_converse.message_archiving)) {
  57337. // Ask the server for archiving preferences
  57338. _converse.api.sendIQ($iq({
  57339. 'type': 'get'
  57340. }).c('prefs', {
  57341. 'xmlns': Strophe.NS.MAM
  57342. })).then(_.partial(_converse.onMAMPreferences, feature)).catch(_converse.onMAMError);
  57343. }
  57344. });
  57345. _converse.on('addClientFeatures', () => {
  57346. _converse.api.disco.own.features.add(Strophe.NS.MAM);
  57347. });
  57348. _converse.on('afterMessagesFetched', chatboxview => {
  57349. chatboxview.fetchNewestMessages();
  57350. });
  57351. _converse.on('reconnected', () => {
  57352. const private_chats = _converse.chatboxviews.filter(view => _.at(view, 'model.attributes.type')[0] === 'chatbox');
  57353. _.each(private_chats, view => view.fetchNewestMessages());
  57354. });
  57355. _.extend(_converse.api, {
  57356. /**
  57357. * The [XEP-0313](https://xmpp.org/extensions/xep-0313.html) Message Archive Management API
  57358. *
  57359. * Enables you to query an XMPP server for archived messages.
  57360. *
  57361. * See also the [message-archiving](/docs/html/configuration.html#message-archiving)
  57362. * option in the configuration settings section, which you'll
  57363. * usually want to use in conjunction with this API.
  57364. *
  57365. * @namespace _converse.api.archive
  57366. * @memberOf _converse.api
  57367. */
  57368. 'archive': {
  57369. /**
  57370. * Query for archived messages.
  57371. *
  57372. * The options parameter can also be an instance of
  57373. * Strophe.RSM to enable easy querying between results pages.
  57374. *
  57375. * @method _converse.api.archive.query
  57376. * @param {(Object|Strophe.RSM)} options Query parameters, either
  57377. * MAM-specific or also for Result Set Management.
  57378. * Can be either an object or an instance of Strophe.RSM.
  57379. * Valid query parameters are:
  57380. * * `with`
  57381. * * `start`
  57382. * * `end`
  57383. * * `first`
  57384. * * `last`
  57385. * * `after`
  57386. * * `before`
  57387. * * `index`
  57388. * * `count`
  57389. * @param {Function} callback A function to call whenever
  57390. * we receive query-relevant stanza.
  57391. * When the callback is called, a Strophe.RSM object is
  57392. * returned on which "next" or "previous" can be called
  57393. * before passing it in again to this method, to
  57394. * get the next or previous page in the result set.
  57395. * @param {Function} errback A function to call when an
  57396. * error stanza is received, for example when it
  57397. * doesn't support message archiving.
  57398. *
  57399. * @example
  57400. * // Requesting all archived messages
  57401. * // ================================
  57402. * //
  57403. * // The simplest query that can be made is to simply not pass in any parameters.
  57404. * // Such a query will return all archived messages for the current user.
  57405. * //
  57406. * // Generally, you'll however always want to pass in a callback method, to receive
  57407. * // the returned messages.
  57408. *
  57409. * this._converse.api.archive.query(
  57410. * (messages) => {
  57411. * // Do something with the messages, like showing them in your webpage.
  57412. * },
  57413. * (iq) => {
  57414. * // The query was not successful, perhaps inform the user?
  57415. * // The IQ stanza returned by the XMPP server is passed in, so that you
  57416. * // may inspect it and determine what the problem was.
  57417. * }
  57418. * )
  57419. * @example
  57420. * // Waiting until server support has been determined
  57421. * // ================================================
  57422. * //
  57423. * // The query method will only work if Converse has been able to determine that
  57424. * // the server supports MAM queries, otherwise the following error will be raised:
  57425. * //
  57426. * // "This server does not support XEP-0313, Message Archive Management"
  57427. * //
  57428. * // The very first time Converse loads in a browser tab, if you call the query
  57429. * // API too quickly, the above error might appear because service discovery has not
  57430. * // yet been completed.
  57431. * //
  57432. * // To work solve this problem, you can first listen for the `serviceDiscovered` event,
  57433. * // through which you can be informed once support for MAM has been determined.
  57434. *
  57435. * _converse.api.listen.on('serviceDiscovered', function (feature) {
  57436. * if (feature.get('var') === converse.env.Strophe.NS.MAM) {
  57437. * _converse.api.archive.query()
  57438. * }
  57439. * });
  57440. *
  57441. * @example
  57442. * // Requesting all archived messages for a particular contact or room
  57443. * // =================================================================
  57444. * //
  57445. * // To query for messages sent between the current user and another user or room,
  57446. * // the query options need to contain the the JID (Jabber ID) of the user or
  57447. * // room under the `with` key.
  57448. *
  57449. * // For a particular user
  57450. * this._converse.api.archive.query({'with': 'john@doe.net'}, callback, errback);)
  57451. *
  57452. * // For a particular room
  57453. * this._converse.api.archive.query({'with': 'discuss@conference.doglovers.net'}, callback, errback);)
  57454. *
  57455. * @example
  57456. * // Requesting all archived messages before or after a certain date
  57457. * // ===============================================================
  57458. * //
  57459. * // The `start` and `end` parameters are used to query for messages
  57460. * // within a certain timeframe. The passed in date values may either be ISO8601
  57461. * // formatted date strings, or JavaScript Date objects.
  57462. *
  57463. * const options = {
  57464. * 'with': 'john@doe.net',
  57465. * 'start': '2010-06-07T00:00:00Z',
  57466. * 'end': '2010-07-07T13:23:54Z'
  57467. * };
  57468. * this._converse.api.archive.query(options, callback, errback);
  57469. *
  57470. * @example
  57471. * // Limiting the amount of messages returned
  57472. * // ========================================
  57473. * //
  57474. * // The amount of returned messages may be limited with the `max` parameter.
  57475. * // By default, the messages are returned from oldest to newest.
  57476. *
  57477. * // Return maximum 10 archived messages
  57478. * this._converse.api.archive.query({'with': 'john@doe.net', 'max':10}, callback, errback);
  57479. *
  57480. * @example
  57481. * // Paging forwards through a set of archived messages
  57482. * // ==================================================
  57483. * //
  57484. * // When limiting the amount of messages returned per query, you might want to
  57485. * // repeatedly make a further query to fetch the next batch of messages.
  57486. * //
  57487. * // To simplify this usecase for you, the callback method receives not only an array
  57488. * // with the returned archived messages, but also a special RSM (*Result Set
  57489. * // Management*) object which contains the query parameters you passed in, as well
  57490. * // as two utility methods `next`, and `previous`.
  57491. * //
  57492. * // When you call one of these utility methods on the returned RSM object, and then
  57493. * // pass the result into a new query, you'll receive the next or previous batch of
  57494. * // archived messages. Please note, when calling these methods, pass in an integer
  57495. * // to limit your results.
  57496. *
  57497. * const callback = function (messages, rsm) {
  57498. * // Do something with the messages, like showing them in your webpage.
  57499. * // ...
  57500. * // You can now use the returned "rsm" object, to fetch the next batch of messages:
  57501. * _converse.api.archive.query(rsm.next(10), callback, errback))
  57502. *
  57503. * }
  57504. * _converse.api.archive.query({'with': 'john@doe.net', 'max':10}, callback, errback);
  57505. *
  57506. * @example
  57507. * // Paging backwards through a set of archived messages
  57508. * // ===================================================
  57509. * //
  57510. * // To page backwards through the archive, you need to know the UID of the message
  57511. * // which you'd like to page backwards from and then pass that as value for the
  57512. * // `before` parameter. If you simply want to page backwards from the most recent
  57513. * // message, pass in the `before` parameter with an empty string value `''`.
  57514. *
  57515. * _converse.api.archive.query({'before': '', 'max':5}, function (message, rsm) {
  57516. * // Do something with the messages, like showing them in your webpage.
  57517. * // ...
  57518. * // You can now use the returned "rsm" object, to fetch the previous batch of messages:
  57519. * rsm.previous(5); // Call previous method, to update the object's parameters,
  57520. * // passing in a limit value of 5.
  57521. * // Now we query again, to get the previous batch.
  57522. * _converse.api.archive.query(rsm, callback, errback);
  57523. * }
  57524. */
  57525. 'query': function query(options, callback, errback) {
  57526. if (!_converse.api.connection.connected()) {
  57527. throw new Error('Can\'t call `api.archive.query` before having established an XMPP session');
  57528. }
  57529. return queryForArchivedMessages(_converse, options, callback, errback);
  57530. }
  57531. }
  57532. });
  57533. }
  57534. });
  57535. /***/ }),
  57536. /***/ "./src/headless/converse-muc.js":
  57537. /*!**************************************!*\
  57538. !*** ./src/headless/converse-muc.js ***!
  57539. \**************************************/
  57540. /*! no exports provided */
  57541. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  57542. "use strict";
  57543. __webpack_require__.r(__webpack_exports__);
  57544. /* harmony import */ var _converse_disco__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./converse-disco */ "./src/headless/converse-disco.js");
  57545. /* harmony import */ var _utils_emoji__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/emoji */ "./src/headless/utils/emoji.js");
  57546. /* harmony import */ var _utils_muc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/muc */ "./src/headless/utils/muc.js");
  57547. /* harmony import */ var backbone_overview_backbone_orderedlistview__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! backbone.overview/backbone.orderedlistview */ "./node_modules/backbone.overview/backbone.orderedlistview.js");
  57548. /* harmony import */ var backbone_overview_backbone_orderedlistview__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(backbone_overview_backbone_orderedlistview__WEBPACK_IMPORTED_MODULE_3__);
  57549. /* harmony import */ var backbone_overview_backbone_overview__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! backbone.overview/backbone.overview */ "./node_modules/backbone.overview/backbone.overview.js");
  57550. /* harmony import */ var backbone_overview_backbone_overview__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(backbone_overview_backbone_overview__WEBPACK_IMPORTED_MODULE_4__);
  57551. /* harmony import */ var backbone_vdomview__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! backbone.vdomview */ "./node_modules/backbone.vdomview/backbone.vdomview.js");
  57552. /* harmony import */ var backbone_vdomview__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(backbone_vdomview__WEBPACK_IMPORTED_MODULE_5__);
  57553. /* harmony import */ var _converse_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./converse-core */ "./src/headless/converse-core.js");
  57554. /* harmony import */ var _utils_form__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/form */ "./src/headless/utils/form.js");
  57555. function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
  57556. function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
  57557. function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
  57558. function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
  57559. // Converse.js
  57560. // http://conversejs.org
  57561. //
  57562. // Copyright (c) 2013-2018, the Converse.js developers
  57563. // Licensed under the Mozilla Public License (MPLv2)
  57564. const MUC_ROLE_WEIGHTS = {
  57565. 'moderator': 1,
  57566. 'participant': 2,
  57567. 'visitor': 3,
  57568. 'none': 2
  57569. };
  57570. const _converse$env = _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].env,
  57571. Strophe = _converse$env.Strophe,
  57572. Backbone = _converse$env.Backbone,
  57573. Promise = _converse$env.Promise,
  57574. $iq = _converse$env.$iq,
  57575. $build = _converse$env.$build,
  57576. $msg = _converse$env.$msg,
  57577. $pres = _converse$env.$pres,
  57578. b64_sha1 = _converse$env.b64_sha1,
  57579. sizzle = _converse$env.sizzle,
  57580. f = _converse$env.f,
  57581. moment = _converse$env.moment,
  57582. _ = _converse$env._; // Add Strophe Namespaces
  57583. Strophe.addNamespace('MUC_ADMIN', Strophe.NS.MUC + "#admin");
  57584. Strophe.addNamespace('MUC_OWNER', Strophe.NS.MUC + "#owner");
  57585. Strophe.addNamespace('MUC_REGISTER', "jabber:iq:register");
  57586. Strophe.addNamespace('MUC_ROOMCONF', Strophe.NS.MUC + "#roomconfig");
  57587. Strophe.addNamespace('MUC_USER', Strophe.NS.MUC + "#user");
  57588. _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].MUC_NICK_CHANGED_CODE = "303";
  57589. _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOM_FEATURES = ['passwordprotected', 'unsecured', 'hidden', 'publicroom', 'membersonly', 'open', 'persistent', 'temporary', 'nonanonymous', 'semianonymous', 'moderated', 'unmoderated', 'mam_enabled']; // No longer used in code, but useful as reference.
  57590. //
  57591. // const ROOM_FEATURES_MAP = {
  57592. // 'passwordprotected': 'unsecured',
  57593. // 'unsecured': 'passwordprotected',
  57594. // 'hidden': 'publicroom',
  57595. // 'publicroom': 'hidden',
  57596. // 'membersonly': 'open',
  57597. // 'open': 'membersonly',
  57598. // 'persistent': 'temporary',
  57599. // 'temporary': 'persistent',
  57600. // 'nonanonymous': 'semianonymous',
  57601. // 'semianonymous': 'nonanonymous',
  57602. // 'moderated': 'unmoderated',
  57603. // 'unmoderated': 'moderated'
  57604. // };
  57605. _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS = {
  57606. CONNECTED: 0,
  57607. CONNECTING: 1,
  57608. NICKNAME_REQUIRED: 2,
  57609. PASSWORD_REQUIRED: 3,
  57610. DISCONNECTED: 4,
  57611. ENTERED: 5
  57612. };
  57613. _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].plugins.add('converse-muc', {
  57614. /* Optional dependencies are other plugins which might be
  57615. * overridden or relied upon, and therefore need to be loaded before
  57616. * this plugin. They are called "optional" because they might not be
  57617. * available, in which case any overrides applicable to them will be
  57618. * ignored.
  57619. *
  57620. * It's possible however to make optional dependencies non-optional.
  57621. * If the setting "strict_plugin_dependencies" is set to true,
  57622. * an error will be raised if the plugin is not found.
  57623. *
  57624. * NB: These plugins need to have already been loaded via require.js.
  57625. */
  57626. dependencies: ["converse-chatboxes", "converse-disco", "converse-controlbox"],
  57627. overrides: {
  57628. tearDown() {
  57629. const _converse = this.__super__._converse,
  57630. groupchats = this.chatboxes.where({
  57631. 'type': _converse.CHATROOMS_TYPE
  57632. });
  57633. _.each(groupchats, gc => _utils_form__WEBPACK_IMPORTED_MODULE_7__["default"].safeSave(gc, {
  57634. 'connection_status': _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS.DISCONNECTED
  57635. }));
  57636. this.__super__.tearDown.call(this, arguments);
  57637. },
  57638. ChatBoxes: {
  57639. model(attrs, options) {
  57640. const _converse = this.__super__._converse;
  57641. if (attrs.type == _converse.CHATROOMS_TYPE) {
  57642. return new _converse.ChatRoom(attrs, options);
  57643. } else {
  57644. return this.__super__.model.apply(this, arguments);
  57645. }
  57646. }
  57647. }
  57648. },
  57649. initialize() {
  57650. /* The initialize function gets called as soon as the plugin is
  57651. * loaded by converse.js's plugin machinery.
  57652. */
  57653. const _converse = this._converse,
  57654. __ = _converse.__; // Configuration values for this plugin
  57655. // ====================================
  57656. // Refer to docs/source/configuration.rst for explanations of these
  57657. // configuration settings.
  57658. _converse.api.settings.update({
  57659. allow_muc: true,
  57660. allow_muc_invitations: true,
  57661. auto_join_on_invite: false,
  57662. auto_join_rooms: [],
  57663. auto_register_muc_nickname: false,
  57664. muc_domain: undefined,
  57665. muc_history_max_stanzas: undefined,
  57666. muc_instant_rooms: true,
  57667. muc_nickname_from_jid: false
  57668. });
  57669. _converse.api.promises.add(['roomsAutoJoined']);
  57670. async function openRoom(jid) {
  57671. if (!_utils_form__WEBPACK_IMPORTED_MODULE_7__["default"].isValidMUCJID(jid)) {
  57672. return _converse.log(`Invalid JID "${jid}" provided in URL fragment`, Strophe.LogLevel.WARN);
  57673. }
  57674. await _converse.api.waitUntil('roomsAutoJoined');
  57675. if (_converse.allow_bookmarks) {
  57676. await _converse.api.waitUntil('bookmarksInitialized');
  57677. }
  57678. _converse.api.rooms.open(jid);
  57679. }
  57680. _converse.router.route('converse/room?jid=:jid', openRoom);
  57681. _converse.openChatRoom = function (jid, settings, bring_to_foreground) {
  57682. /* Opens a groupchat, making sure that certain attributes
  57683. * are correct, for example that the "type" is set to
  57684. * "chatroom".
  57685. */
  57686. settings.type = _converse.CHATROOMS_TYPE;
  57687. settings.id = jid;
  57688. settings.box_id = b64_sha1(jid);
  57689. const chatbox = _converse.chatboxes.getChatBox(jid, settings, true);
  57690. chatbox.trigger('show', true);
  57691. return chatbox;
  57692. };
  57693. _converse.ChatRoom = _converse.ChatBox.extend({
  57694. defaults() {
  57695. return _.assign(_.clone(_converse.ChatBox.prototype.defaults), _.zipObject(_converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOM_FEATURES, _.map(_converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOM_FEATURES, _.stubFalse)), {
  57696. // For group chats, we distinguish between generally unread
  57697. // messages and those ones that specifically mention the
  57698. // user.
  57699. //
  57700. // To keep things simple, we reuse `num_unread` from
  57701. // _converse.ChatBox to indicate unread messages which
  57702. // mention the user and `num_unread_general` to indicate
  57703. // generally unread messages (which *includes* mentions!).
  57704. 'num_unread_general': 0,
  57705. 'affiliation': null,
  57706. 'connection_status': _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS.DISCONNECTED,
  57707. 'name': '',
  57708. 'nick': _converse.xmppstatus.get('nickname') || _converse.nickname,
  57709. 'description': '',
  57710. 'features_fetched': false,
  57711. 'roomconfig': {},
  57712. 'type': _converse.CHATROOMS_TYPE,
  57713. 'message_type': 'groupchat'
  57714. });
  57715. },
  57716. initialize() {
  57717. this.constructor.__super__.initialize.apply(this, arguments);
  57718. this.on('change:connection_status', this.onConnectionStatusChanged, this);
  57719. this.occupants = new _converse.ChatRoomOccupants();
  57720. this.occupants.browserStorage = new Backbone.BrowserStorage.session(b64_sha1(`converse.occupants-${_converse.bare_jid}${this.get('jid')}`));
  57721. this.occupants.chatroom = this;
  57722. this.registerHandlers();
  57723. },
  57724. async onConnectionStatusChanged() {
  57725. if (this.get('connection_status') === _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS.ENTERED && _converse.auto_register_muc_nickname && !this.get('reserved_nick')) {
  57726. const result = await _converse.api.disco.supports(Strophe.NS.MUC_REGISTER, this.get('jid'));
  57727. if (result.length) {
  57728. this.registerNickname();
  57729. }
  57730. }
  57731. },
  57732. registerHandlers() {
  57733. /* Register presence and message handlers for this chat
  57734. * groupchat
  57735. */
  57736. const room_jid = this.get('jid');
  57737. this.removeHandlers();
  57738. this.presence_handler = _converse.connection.addHandler(stanza => {
  57739. _.each(_.values(this.handlers.presence), callback => callback(stanza));
  57740. this.onPresence(stanza);
  57741. return true;
  57742. }, null, 'presence', null, null, room_jid, {
  57743. 'ignoreNamespaceFragment': true,
  57744. 'matchBareFromJid': true
  57745. });
  57746. this.message_handler = _converse.connection.addHandler(stanza => {
  57747. _.each(_.values(this.handlers.message), callback => callback(stanza));
  57748. this.onMessage(stanza);
  57749. return true;
  57750. }, null, 'message', 'groupchat', null, room_jid, {
  57751. 'matchBareFromJid': true
  57752. });
  57753. },
  57754. removeHandlers() {
  57755. /* Remove the presence and message handlers that were
  57756. * registered for this groupchat.
  57757. */
  57758. if (this.message_handler) {
  57759. _converse.connection.deleteHandler(this.message_handler);
  57760. delete this.message_handler;
  57761. }
  57762. if (this.presence_handler) {
  57763. _converse.connection.deleteHandler(this.presence_handler);
  57764. delete this.presence_handler;
  57765. }
  57766. return this;
  57767. },
  57768. addHandler(type, name, callback) {
  57769. /* Allows 'presence' and 'message' handlers to be
  57770. * registered. These will be executed once presence or
  57771. * message stanzas are received, and *before* this model's
  57772. * own handlers are executed.
  57773. */
  57774. if (_.isNil(this.handlers)) {
  57775. this.handlers = {};
  57776. }
  57777. if (_.isNil(this.handlers[type])) {
  57778. this.handlers[type] = {};
  57779. }
  57780. this.handlers[type][name] = callback;
  57781. },
  57782. getDisplayName() {
  57783. return this.get('name') || this.get('jid');
  57784. },
  57785. join(nick, password) {
  57786. /* Join the groupchat.
  57787. *
  57788. * Parameters:
  57789. * (String) nick: The user's nickname
  57790. * (String) password: Optional password, if required by
  57791. * the groupchat.
  57792. */
  57793. nick = nick ? nick : this.get('nick');
  57794. if (!nick) {
  57795. throw new TypeError('join: You need to provide a valid nickname');
  57796. }
  57797. if (this.get('connection_status') === _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS.ENTERED) {
  57798. // We have restored a groupchat from session storage,
  57799. // so we don't send out a presence stanza again.
  57800. return this;
  57801. }
  57802. const stanza = $pres({
  57803. 'from': _converse.connection.jid,
  57804. 'to': this.getRoomJIDAndNick(nick)
  57805. }).c("x", {
  57806. 'xmlns': Strophe.NS.MUC
  57807. }).c("history", {
  57808. 'maxstanzas': this.get('mam_enabled') ? 0 : _converse.muc_history_max_stanzas
  57809. }).up();
  57810. if (password) {
  57811. stanza.cnode(Strophe.xmlElement("password", [], password));
  57812. }
  57813. this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS.CONNECTING);
  57814. _converse.api.send(stanza);
  57815. return this;
  57816. },
  57817. leave(exit_msg) {
  57818. /* Leave the groupchat.
  57819. *
  57820. * Parameters:
  57821. * (String) exit_msg: Optional message to indicate your
  57822. * reason for leaving.
  57823. */
  57824. this.occupants.browserStorage._clear();
  57825. this.occupants.reset();
  57826. if (_converse.disco_entities) {
  57827. const disco_entity = _converse.disco_entities.get(this.get('jid'));
  57828. if (disco_entity) {
  57829. disco_entity.destroy();
  57830. }
  57831. }
  57832. if (_converse.connection.connected) {
  57833. this.sendUnavailablePresence(exit_msg);
  57834. }
  57835. _utils_form__WEBPACK_IMPORTED_MODULE_7__["default"].safeSave(this, {
  57836. 'connection_status': _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS.DISCONNECTED
  57837. });
  57838. this.removeHandlers();
  57839. },
  57840. sendUnavailablePresence(exit_msg) {
  57841. const presence = $pres({
  57842. type: "unavailable",
  57843. from: _converse.connection.jid,
  57844. to: this.getRoomJIDAndNick()
  57845. });
  57846. if (exit_msg !== null) {
  57847. presence.c("status", exit_msg);
  57848. }
  57849. _converse.connection.sendPresence(presence);
  57850. },
  57851. getReferenceForMention(mention, index) {
  57852. const longest_match = _utils_form__WEBPACK_IMPORTED_MODULE_7__["default"].getLongestSubstring(mention, this.occupants.map(o => o.getDisplayName()));
  57853. if (!longest_match) {
  57854. return null;
  57855. }
  57856. if ((mention[longest_match.length] || '').match(/[A-Za-zäëïöüâêîôûáéíóúàèìòùÄËÏÖÜÂÊÎÔÛÁÉÍÓÚÀÈÌÒÙ]/i)) {
  57857. // avoid false positives, i.e. mentions that have
  57858. // further alphabetical characters than our longest
  57859. // match.
  57860. return null;
  57861. }
  57862. const occupant = this.occupants.findOccupant({
  57863. 'nick': longest_match
  57864. }) || this.occupants.findOccupant({
  57865. 'jid': longest_match
  57866. });
  57867. if (!occupant) {
  57868. return null;
  57869. }
  57870. const obj = {
  57871. 'begin': index,
  57872. 'end': index + longest_match.length,
  57873. 'value': longest_match,
  57874. 'type': 'mention'
  57875. };
  57876. if (occupant.get('jid')) {
  57877. obj.uri = `xmpp:${occupant.get('jid')}`;
  57878. }
  57879. return obj;
  57880. },
  57881. extractReference(text, index) {
  57882. for (let i = index; i < text.length; i++) {
  57883. if (text[i] !== '@') {
  57884. continue;
  57885. } else {
  57886. const match = text.slice(i + 1),
  57887. ref = this.getReferenceForMention(match, i);
  57888. if (ref) {
  57889. return [text.slice(0, i) + match, ref, i];
  57890. }
  57891. }
  57892. }
  57893. return;
  57894. },
  57895. parseTextForReferences(text) {
  57896. const refs = [];
  57897. let index = 0;
  57898. while (index < (text || '').length) {
  57899. const result = this.extractReference(text, index);
  57900. if (result) {
  57901. text = result[0]; // @ gets filtered out
  57902. refs.push(result[1]);
  57903. index = result[2];
  57904. } else {
  57905. break;
  57906. }
  57907. }
  57908. return [text, refs];
  57909. },
  57910. getOutgoingMessageAttributes(text, spoiler_hint) {
  57911. const is_spoiler = this.get('composing_spoiler');
  57912. var references;
  57913. var _this$parseTextForRef = this.parseTextForReferences(text);
  57914. var _this$parseTextForRef2 = _slicedToArray(_this$parseTextForRef, 2);
  57915. text = _this$parseTextForRef2[0];
  57916. references = _this$parseTextForRef2[1];
  57917. return {
  57918. 'from': `${this.get('jid')}/${this.get('nick')}`,
  57919. 'fullname': this.get('nick'),
  57920. 'is_spoiler': is_spoiler,
  57921. 'message': text ? _utils_form__WEBPACK_IMPORTED_MODULE_7__["default"].httpToGeoUri(_utils_form__WEBPACK_IMPORTED_MODULE_7__["default"].shortnameToUnicode(text), _converse) : undefined,
  57922. 'nick': this.get('nick'),
  57923. 'references': references,
  57924. 'sender': 'me',
  57925. 'spoiler_hint': is_spoiler ? spoiler_hint : undefined,
  57926. 'type': 'groupchat'
  57927. };
  57928. },
  57929. getRoomJIDAndNick(nick) {
  57930. /* Utility method to construct the JID for the current user
  57931. * as occupant of the groupchat.
  57932. *
  57933. * This is the groupchat JID, with the user's nick added at the
  57934. * end.
  57935. *
  57936. * For example: groupchat@conference.example.org/nickname
  57937. */
  57938. if (nick) {
  57939. this.save({
  57940. 'nick': nick
  57941. });
  57942. } else {
  57943. nick = this.get('nick');
  57944. }
  57945. const groupchat = this.get('jid');
  57946. const jid = Strophe.getBareJidFromJid(groupchat);
  57947. return jid + (nick !== null ? `/${nick}` : "");
  57948. },
  57949. sendChatState() {
  57950. /* Sends a message with the status of the user in this chat session
  57951. * as taken from the 'chat_state' attribute of the chat box.
  57952. * See XEP-0085 Chat State Notifications.
  57953. */
  57954. if (this.get('connection_status') !== _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS.ENTERED) {
  57955. return;
  57956. }
  57957. const chat_state = this.get('chat_state');
  57958. if (chat_state === _converse.GONE) {
  57959. // <gone/> is not applicable within MUC context
  57960. return;
  57961. }
  57962. _converse.api.send($msg({
  57963. 'to': this.get('jid'),
  57964. 'type': 'groupchat'
  57965. }).c(chat_state, {
  57966. 'xmlns': Strophe.NS.CHATSTATES
  57967. }).up().c('no-store', {
  57968. 'xmlns': Strophe.NS.HINTS
  57969. }).up().c('no-permanent-store', {
  57970. 'xmlns': Strophe.NS.HINTS
  57971. }));
  57972. },
  57973. directInvite(recipient, reason) {
  57974. /* Send a direct invitation as per XEP-0249
  57975. *
  57976. * Parameters:
  57977. * (String) recipient - JID of the person being invited
  57978. * (String) reason - Optional reason for the invitation
  57979. */
  57980. if (this.get('membersonly')) {
  57981. // When inviting to a members-only groupchat, we first add
  57982. // the person to the member list by giving them an
  57983. // affiliation of 'member' (if they're not affiliated
  57984. // already), otherwise they won't be able to join.
  57985. const map = {};
  57986. map[recipient] = 'member';
  57987. const deltaFunc = _.partial(_utils_form__WEBPACK_IMPORTED_MODULE_7__["default"].computeAffiliationsDelta, true, false);
  57988. this.updateMemberLists([{
  57989. 'jid': recipient,
  57990. 'affiliation': 'member',
  57991. 'reason': reason
  57992. }], ['member', 'owner', 'admin'], deltaFunc);
  57993. }
  57994. const attrs = {
  57995. 'xmlns': 'jabber:x:conference',
  57996. 'jid': this.get('jid')
  57997. };
  57998. if (reason !== null) {
  57999. attrs.reason = reason;
  58000. }
  58001. if (this.get('password')) {
  58002. attrs.password = this.get('password');
  58003. }
  58004. const invitation = $msg({
  58005. 'from': _converse.connection.jid,
  58006. 'to': recipient,
  58007. 'id': _converse.connection.getUniqueId()
  58008. }).c('x', attrs);
  58009. _converse.api.send(invitation);
  58010. _converse.api.emit('roomInviteSent', {
  58011. 'room': this,
  58012. 'recipient': recipient,
  58013. 'reason': reason
  58014. });
  58015. },
  58016. async refreshRoomFeatures() {
  58017. await _converse.api.disco.refreshFeatures(this.get('jid'));
  58018. return this.getRoomFeatures();
  58019. },
  58020. async getRoomFeatures() {
  58021. const features = await _converse.api.disco.getFeatures(this.get('jid')),
  58022. fields = await _converse.api.disco.getFields(this.get('jid')),
  58023. identity = await _converse.api.disco.getIdentity('conference', 'text', this.get('jid')),
  58024. attrs = _.extend(_.zipObject(_converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOM_FEATURES, _.map(_converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOM_FEATURES, _.stubFalse)), {
  58025. 'features_fetched': moment().format(),
  58026. 'name': identity && identity.get('name')
  58027. });
  58028. features.each(feature => {
  58029. const fieldname = feature.get('var');
  58030. if (!fieldname.startsWith('muc_')) {
  58031. if (fieldname === Strophe.NS.MAM) {
  58032. attrs.mam_enabled = true;
  58033. }
  58034. return;
  58035. }
  58036. attrs[fieldname.replace('muc_', '')] = true;
  58037. });
  58038. attrs.description = _.get(fields.findWhere({
  58039. 'var': "muc#roominfo_description"
  58040. }), 'attributes.value');
  58041. this.save(attrs);
  58042. },
  58043. requestMemberList(affiliation) {
  58044. /* Send an IQ stanza to the server, asking it for the
  58045. * member-list of this groupchat.
  58046. *
  58047. * See: http://xmpp.org/extensions/xep-0045.html#modifymember
  58048. *
  58049. * Parameters:
  58050. * (String) affiliation: The specific member list to
  58051. * fetch. 'admin', 'owner' or 'member'.
  58052. *
  58053. * Returns:
  58054. * A promise which resolves once the list has been
  58055. * retrieved.
  58056. */
  58057. affiliation = affiliation || 'member';
  58058. const iq = $iq({
  58059. to: this.get('jid'),
  58060. type: "get"
  58061. }).c("query", {
  58062. xmlns: Strophe.NS.MUC_ADMIN
  58063. }).c("item", {
  58064. 'affiliation': affiliation
  58065. });
  58066. return _converse.api.sendIQ(iq);
  58067. },
  58068. setAffiliation(affiliation, members) {
  58069. /* Send IQ stanzas to the server to set an affiliation for
  58070. * the provided JIDs.
  58071. *
  58072. * See: http://xmpp.org/extensions/xep-0045.html#modifymember
  58073. *
  58074. * XXX: Prosody doesn't accept multiple JIDs' affiliations
  58075. * being set in one IQ stanza, so as a workaround we send
  58076. * a separate stanza for each JID.
  58077. * Related ticket: https://issues.prosody.im/345
  58078. *
  58079. * Parameters:
  58080. * (String) affiliation: The affiliation
  58081. * (Object) members: A map of jids, affiliations and
  58082. * optionally reasons. Only those entries with the
  58083. * same affiliation as being currently set will be
  58084. * considered.
  58085. *
  58086. * Returns:
  58087. * A promise which resolves and fails depending on the
  58088. * XMPP server response.
  58089. */
  58090. members = _.filter(members, member => // We only want those members who have the right
  58091. // affiliation (or none, which implies the provided one).
  58092. _.isUndefined(member.affiliation) || member.affiliation === affiliation);
  58093. const promises = _.map(members, _.bind(this.sendAffiliationIQ, this, affiliation));
  58094. return Promise.all(promises);
  58095. },
  58096. saveConfiguration(form) {
  58097. /* Submit the groupchat configuration form by sending an IQ
  58098. * stanza to the server.
  58099. *
  58100. * Returns a promise which resolves once the XMPP server
  58101. * has return a response IQ.
  58102. *
  58103. * Parameters:
  58104. * (HTMLElement) form: The configuration form DOM element.
  58105. * If no form is provided, the default configuration
  58106. * values will be used.
  58107. */
  58108. return new Promise((resolve, reject) => {
  58109. const inputs = form ? sizzle(':input:not([type=button]):not([type=submit])', form) : [],
  58110. configArray = _.map(inputs, _utils_form__WEBPACK_IMPORTED_MODULE_7__["default"].webForm2xForm);
  58111. this.sendConfiguration(configArray, resolve, reject);
  58112. });
  58113. },
  58114. autoConfigureChatRoom() {
  58115. /* Automatically configure groupchat based on this model's
  58116. * 'roomconfig' data.
  58117. *
  58118. * Returns a promise which resolves once a response IQ has
  58119. * been received.
  58120. */
  58121. return new Promise((resolve, reject) => {
  58122. this.fetchRoomConfiguration().then(stanza => {
  58123. const configArray = [],
  58124. fields = stanza.querySelectorAll('field'),
  58125. config = this.get('roomconfig');
  58126. let count = fields.length;
  58127. _.each(fields, field => {
  58128. const fieldname = field.getAttribute('var').replace('muc#roomconfig_', ''),
  58129. type = field.getAttribute('type');
  58130. let value;
  58131. if (fieldname in config) {
  58132. switch (type) {
  58133. case 'boolean':
  58134. value = config[fieldname] ? 1 : 0;
  58135. break;
  58136. case 'list-multi':
  58137. // TODO: we don't yet handle "list-multi" types
  58138. value = field.innerHTML;
  58139. break;
  58140. default:
  58141. value = config[fieldname];
  58142. }
  58143. field.innerHTML = $build('value').t(value);
  58144. }
  58145. configArray.push(field);
  58146. if (! --count) {
  58147. this.sendConfiguration(configArray, resolve, reject);
  58148. }
  58149. });
  58150. });
  58151. });
  58152. },
  58153. fetchRoomConfiguration() {
  58154. /* Send an IQ stanza to fetch the groupchat configuration data.
  58155. * Returns a promise which resolves once the response IQ
  58156. * has been received.
  58157. */
  58158. return _converse.api.sendIQ($iq({
  58159. 'to': this.get('jid'),
  58160. 'type': "get"
  58161. }).c("query", {
  58162. xmlns: Strophe.NS.MUC_OWNER
  58163. }));
  58164. },
  58165. sendConfiguration(config, callback, errback) {
  58166. /* Send an IQ stanza with the groupchat configuration.
  58167. *
  58168. * Parameters:
  58169. * (Array) config: The groupchat configuration
  58170. * (Function) callback: Callback upon succesful IQ response
  58171. * The first parameter passed in is IQ containing the
  58172. * groupchat configuration.
  58173. * The second is the response IQ from the server.
  58174. * (Function) errback: Callback upon error IQ response
  58175. * The first parameter passed in is IQ containing the
  58176. * groupchat configuration.
  58177. * The second is the response IQ from the server.
  58178. */
  58179. const iq = $iq({
  58180. to: this.get('jid'),
  58181. type: "set"
  58182. }).c("query", {
  58183. xmlns: Strophe.NS.MUC_OWNER
  58184. }).c("x", {
  58185. xmlns: Strophe.NS.XFORM,
  58186. type: "submit"
  58187. });
  58188. _.each(config || [], function (node) {
  58189. iq.cnode(node).up();
  58190. });
  58191. callback = _.isUndefined(callback) ? _.noop : _.partial(callback, iq.nodeTree);
  58192. errback = _.isUndefined(errback) ? _.noop : _.partial(errback, iq.nodeTree);
  58193. return _converse.api.sendIQ(iq).then(callback).catch(errback);
  58194. },
  58195. saveAffiliationAndRole(pres) {
  58196. /* Parse the presence stanza for the current user's
  58197. * affiliation.
  58198. *
  58199. * Parameters:
  58200. * (XMLElement) pres: A <presence> stanza.
  58201. */
  58202. const item = sizzle(`x[xmlns="${Strophe.NS.MUC_USER}"] item`, pres).pop();
  58203. const is_self = pres.querySelector("status[code='110']");
  58204. if (is_self && !_.isNil(item)) {
  58205. const affiliation = item.getAttribute('affiliation');
  58206. const role = item.getAttribute('role');
  58207. if (affiliation) {
  58208. this.save({
  58209. 'affiliation': affiliation
  58210. });
  58211. }
  58212. if (role) {
  58213. this.save({
  58214. 'role': role
  58215. });
  58216. }
  58217. }
  58218. },
  58219. sendAffiliationIQ(affiliation, member) {
  58220. /* Send an IQ stanza specifying an affiliation change.
  58221. *
  58222. * Paremeters:
  58223. * (String) affiliation: affiliation (could also be stored
  58224. * on the member object).
  58225. * (Object) member: Map containing the member's jid and
  58226. * optionally a reason and affiliation.
  58227. */
  58228. const iq = $iq({
  58229. to: this.get('jid'),
  58230. type: "set"
  58231. }).c("query", {
  58232. xmlns: Strophe.NS.MUC_ADMIN
  58233. }).c("item", {
  58234. 'affiliation': member.affiliation || affiliation,
  58235. 'nick': member.nick,
  58236. 'jid': member.jid
  58237. });
  58238. if (!_.isUndefined(member.reason)) {
  58239. iq.c("reason", member.reason);
  58240. }
  58241. return _converse.api.sendIQ(iq);
  58242. },
  58243. setAffiliations(members) {
  58244. /* Send IQ stanzas to the server to modify the
  58245. * affiliations in this groupchat.
  58246. *
  58247. * See: http://xmpp.org/extensions/xep-0045.html#modifymember
  58248. *
  58249. * Parameters:
  58250. * (Object) members: A map of jids, affiliations and optionally reasons
  58251. * (Function) onSuccess: callback for a succesful response
  58252. * (Function) onError: callback for an error response
  58253. */
  58254. const affiliations = _.uniq(_.map(members, 'affiliation'));
  58255. return Promise.all(_.map(affiliations, _.partial(this.setAffiliation.bind(this), _, members)));
  58256. },
  58257. async getJidsWithAffiliations(affiliations) {
  58258. /* Returns a map of JIDs that have the affiliations
  58259. * as provided.
  58260. */
  58261. if (_.isString(affiliations)) {
  58262. affiliations = [affiliations];
  58263. }
  58264. const result = await Promise.all(affiliations.map(a => this.requestMemberList(a).then(iq => _utils_form__WEBPACK_IMPORTED_MODULE_7__["default"].parseMemberListIQ(iq)).catch(iq => {
  58265. _converse.log(iq, Strophe.LogLevel.ERROR);
  58266. })));
  58267. return [].concat.apply([], result).filter(p => p);
  58268. },
  58269. updateMemberLists(members, affiliations, deltaFunc) {
  58270. /* Fetch the lists of users with the given affiliations.
  58271. * Then compute the delta between those users and
  58272. * the passed in members, and if it exists, send the delta
  58273. * to the XMPP server to update the member list.
  58274. *
  58275. * Parameters:
  58276. * (Object) members: Map of member jids and affiliations.
  58277. * (String|Array) affiliation: An array of affiliations or
  58278. * a string if only one affiliation.
  58279. * (Function) deltaFunc: The function to compute the delta
  58280. * between old and new member lists.
  58281. *
  58282. * Returns:
  58283. * A promise which is resolved once the list has been
  58284. * updated or once it's been established there's no need
  58285. * to update the list.
  58286. */
  58287. this.getJidsWithAffiliations(affiliations).then(old_members => this.setAffiliations(deltaFunc(members, old_members))).then(() => this.occupants.fetchMembers()).catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
  58288. },
  58289. getDefaultNick() {
  58290. /* The default nickname (used when muc_nickname_from_jid is true)
  58291. * is the node part of the user's JID.
  58292. * We put this in a separate method so that it can be
  58293. * overridden by plugins.
  58294. */
  58295. const nick = _converse.xmppstatus.vcard.get('nickname');
  58296. if (nick) {
  58297. return nick;
  58298. } else if (_converse.muc_nickname_from_jid) {
  58299. return Strophe.unescapeNode(Strophe.getNodeFromJid(_converse.bare_jid));
  58300. }
  58301. },
  58302. async checkForReservedNick() {
  58303. /* Use service-discovery to ask the XMPP server whether
  58304. * this user has a reserved nickname for this groupchat.
  58305. * If so, we'll use that, otherwise we render the nickname form.
  58306. *
  58307. * Parameters:
  58308. * (Function) callback: Callback upon succesful IQ response
  58309. * (Function) errback: Callback upon error IQ response
  58310. */
  58311. const iq = await _converse.api.sendIQ($iq({
  58312. 'to': this.get('jid'),
  58313. 'from': _converse.connection.jid,
  58314. 'type': "get"
  58315. }).c("query", {
  58316. 'xmlns': Strophe.NS.DISCO_INFO,
  58317. 'node': 'x-roomuser-item'
  58318. }));
  58319. const identity_el = iq.querySelector('query[node="x-roomuser-item"] identity'),
  58320. nick = identity_el ? identity_el.getAttribute('name') : null;
  58321. this.save({
  58322. 'reserved_nick': nick,
  58323. 'nick': nick
  58324. }, {
  58325. 'silent': true
  58326. });
  58327. return iq;
  58328. },
  58329. async registerNickname() {
  58330. // See https://xmpp.org/extensions/xep-0045.html#register
  58331. const nick = this.get('nick'),
  58332. jid = this.get('jid');
  58333. let iq, err_msg;
  58334. try {
  58335. iq = await _converse.api.sendIQ($iq({
  58336. 'to': jid,
  58337. 'from': _converse.connection.jid,
  58338. 'type': 'get'
  58339. }).c('query', {
  58340. 'xmlns': Strophe.NS.MUC_REGISTER
  58341. }));
  58342. } catch (e) {
  58343. if (sizzle('not-allowed[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]', e).length) {
  58344. err_msg = __("You're not allowed to register yourself in this groupchat.");
  58345. } else if (sizzle('registration-required[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]', e).length) {
  58346. err_msg = __("You're not allowed to register in this groupchat because it's members-only.");
  58347. }
  58348. _converse.log(e, Strophe.LogLevel.ERROR);
  58349. return err_msg;
  58350. }
  58351. const required_fields = sizzle('field required', iq).map(f => f.parentElement);
  58352. if (required_fields.length > 1 && required_fields[0].getAttribute('var') !== 'muc#register_roomnick') {
  58353. return _converse.log(`Can't register the user register in the groupchat ${jid} due to the required fields`);
  58354. }
  58355. try {
  58356. await _converse.api.sendIQ($iq({
  58357. 'to': jid,
  58358. 'from': _converse.connection.jid,
  58359. 'type': 'set'
  58360. }).c('query', {
  58361. 'xmlns': Strophe.NS.MUC_REGISTER
  58362. }).c('x', {
  58363. 'xmlns': Strophe.NS.XFORM,
  58364. 'type': 'submit'
  58365. }).c('field', {
  58366. 'var': 'FORM_TYPE'
  58367. }).c('value').t('http://jabber.org/protocol/muc#register').up().up().c('field', {
  58368. 'var': 'muc#register_roomnick'
  58369. }).c('value').t(nick));
  58370. } catch (e) {
  58371. if (sizzle('service-unavailable[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]', e).length) {
  58372. err_msg = __("Can't register your nickname in this groupchat, it doesn't support registration.");
  58373. } else if (sizzle('bad-request[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]', e).length) {
  58374. err_msg = __("Can't register your nickname in this groupchat, invalid data form supplied.");
  58375. }
  58376. _converse.log(err_msg);
  58377. _converse.log(e, Strophe.LogLevel.ERROR);
  58378. return err_msg;
  58379. }
  58380. },
  58381. updateOccupantsOnPresence(pres) {
  58382. /* Given a presence stanza, update the occupant model
  58383. * based on its contents.
  58384. *
  58385. * Parameters:
  58386. * (XMLElement) pres: The presence stanza
  58387. */
  58388. const data = this.parsePresence(pres);
  58389. if (data.type === 'error' || !data.jid && !data.nick) {
  58390. return true;
  58391. }
  58392. const occupant = this.occupants.findOccupant(data);
  58393. if (data.type === 'unavailable' && occupant) {
  58394. if (!_.includes(data.states, _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].MUC_NICK_CHANGED_CODE) && !occupant.isMember()) {
  58395. // We only destroy the occupant if this is not a nickname change operation.
  58396. // and if they're not on the member lists.
  58397. // Before destroying we set the new data, so
  58398. // that we can show the disconnection message.
  58399. occupant.set(data);
  58400. occupant.destroy();
  58401. return;
  58402. }
  58403. }
  58404. const jid = Strophe.getBareJidFromJid(data.jid);
  58405. const attributes = _.extend(data, {
  58406. 'jid': jid ? jid : undefined,
  58407. 'resource': data.jid ? Strophe.getResourceFromJid(data.jid) : undefined
  58408. });
  58409. if (occupant) {
  58410. occupant.save(attributes);
  58411. } else {
  58412. this.occupants.create(attributes);
  58413. }
  58414. },
  58415. parsePresence(pres) {
  58416. const from = pres.getAttribute("from"),
  58417. type = pres.getAttribute("type"),
  58418. data = {
  58419. 'from': from,
  58420. 'nick': Strophe.getResourceFromJid(from),
  58421. 'type': type,
  58422. 'states': [],
  58423. 'show': type !== 'unavailable' ? 'online' : 'offline'
  58424. };
  58425. _.each(pres.childNodes, function (child) {
  58426. switch (child.nodeName) {
  58427. case "status":
  58428. data.status = child.textContent || null;
  58429. break;
  58430. case "show":
  58431. data.show = child.textContent || 'online';
  58432. break;
  58433. case "x":
  58434. if (child.getAttribute("xmlns") === Strophe.NS.MUC_USER) {
  58435. _.each(child.childNodes, function (item) {
  58436. switch (item.nodeName) {
  58437. case "item":
  58438. data.affiliation = item.getAttribute("affiliation");
  58439. data.role = item.getAttribute("role");
  58440. data.jid = item.getAttribute("jid");
  58441. data.nick = item.getAttribute("nick") || data.nick;
  58442. break;
  58443. case "status":
  58444. if (item.getAttribute("code")) {
  58445. data.states.push(item.getAttribute("code"));
  58446. }
  58447. }
  58448. });
  58449. } else if (child.getAttribute("xmlns") === Strophe.NS.VCARDUPDATE) {
  58450. data.image_hash = _.get(child.querySelector('photo'), 'textContent');
  58451. }
  58452. }
  58453. });
  58454. return data;
  58455. },
  58456. isDuplicate(message, original_stanza) {
  58457. // XXX: original_stanza is not used here, but in converse-mam
  58458. const msgid = message.getAttribute('id'),
  58459. jid = message.getAttribute('from');
  58460. if (msgid) {
  58461. const msg = this.messages.findWhere({
  58462. 'msgid': msgid,
  58463. 'from': jid
  58464. });
  58465. if (msg && msg.get('sender') === 'me' && !msg.get('received')) {
  58466. msg.save({
  58467. 'received': moment().format()
  58468. });
  58469. }
  58470. return msg;
  58471. }
  58472. return false;
  58473. },
  58474. fetchFeaturesIfConfigurationChanged(stanza) {
  58475. const configuration_changed = stanza.querySelector("status[code='104']"),
  58476. logging_enabled = stanza.querySelector("status[code='170']"),
  58477. logging_disabled = stanza.querySelector("status[code='171']"),
  58478. room_no_longer_anon = stanza.querySelector("status[code='172']"),
  58479. room_now_semi_anon = stanza.querySelector("status[code='173']"),
  58480. room_now_fully_anon = stanza.querySelector("status[code='173']");
  58481. if (configuration_changed || logging_enabled || logging_disabled || room_no_longer_anon || room_now_semi_anon || room_now_fully_anon) {
  58482. this.refreshRoomFeatures();
  58483. }
  58484. },
  58485. async onMessage(stanza) {
  58486. /* Handler for all MUC messages sent to this groupchat.
  58487. *
  58488. * Parameters:
  58489. * (XMLElement) stanza: The message stanza.
  58490. */
  58491. this.fetchFeaturesIfConfigurationChanged(stanza);
  58492. const original_stanza = stanza,
  58493. forwarded = sizzle(`forwarded[xmlns="${Strophe.NS.FORWARD}"]`, stanza).pop();
  58494. if (forwarded) {
  58495. stanza = forwarded.querySelector('message');
  58496. }
  58497. if (this.isDuplicate(stanza, original_stanza)) {
  58498. return;
  58499. }
  58500. const jid = stanza.getAttribute('from'),
  58501. resource = Strophe.getResourceFromJid(jid),
  58502. sender = resource && Strophe.unescapeNode(resource) || '';
  58503. if (!this.handleMessageCorrection(stanza)) {
  58504. if (sender === '') {
  58505. return;
  58506. }
  58507. const subject_el = stanza.querySelector('subject');
  58508. if (subject_el) {
  58509. const subject = _.propertyOf(subject_el)('textContent') || '';
  58510. _utils_form__WEBPACK_IMPORTED_MODULE_7__["default"].safeSave(this, {
  58511. 'subject': {
  58512. 'author': sender,
  58513. 'text': subject
  58514. }
  58515. });
  58516. }
  58517. const msg = await this.createMessage(stanza, original_stanza);
  58518. if (forwarded && msg && msg.get('sender') === 'me') {
  58519. msg.save({
  58520. 'received': moment().format()
  58521. });
  58522. }
  58523. this.incrementUnreadMsgCounter(msg);
  58524. }
  58525. if (sender !== this.get('nick')) {
  58526. // We only emit an event if it's not our own message
  58527. _converse.emit('message', {
  58528. 'stanza': original_stanza,
  58529. 'chatbox': this
  58530. });
  58531. }
  58532. },
  58533. onPresence(pres) {
  58534. /* Handles all MUC presence stanzas.
  58535. *
  58536. * Parameters:
  58537. * (XMLElement) pres: The stanza
  58538. */
  58539. if (pres.getAttribute('type') === 'error') {
  58540. this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS.DISCONNECTED);
  58541. return;
  58542. }
  58543. const is_self = pres.querySelector("status[code='110']");
  58544. if (is_self && pres.getAttribute('type') !== 'unavailable') {
  58545. this.onOwnPresence(pres);
  58546. }
  58547. this.updateOccupantsOnPresence(pres);
  58548. if (this.get('role') !== 'none' && this.get('connection_status') === _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS.CONNECTING) {
  58549. this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS.CONNECTED);
  58550. }
  58551. },
  58552. onOwnPresence(pres) {
  58553. /* Handles a received presence relating to the current
  58554. * user.
  58555. *
  58556. * For locked groupchats (which are by definition "new"), the
  58557. * groupchat will either be auto-configured or created instantly
  58558. * (with default config) or a configuration groupchat will be
  58559. * rendered.
  58560. *
  58561. * If the groupchat is not locked, then the groupchat will be
  58562. * auto-configured only if applicable and if the current
  58563. * user is the groupchat's owner.
  58564. *
  58565. * Parameters:
  58566. * (XMLElement) pres: The stanza
  58567. */
  58568. this.saveAffiliationAndRole(pres);
  58569. const locked_room = pres.querySelector("status[code='201']");
  58570. if (locked_room) {
  58571. if (this.get('auto_configure')) {
  58572. this.autoConfigureChatRoom().then(() => this.refreshRoomFeatures());
  58573. } else if (_converse.muc_instant_rooms) {
  58574. // Accept default configuration
  58575. this.saveConfiguration().then(() => this.getRoomFeatures());
  58576. } else {
  58577. this.trigger('configurationNeeded');
  58578. return; // We haven't yet entered the groupchat, so bail here.
  58579. }
  58580. } else if (!this.get('features_fetched')) {
  58581. // The features for this groupchat weren't fetched.
  58582. // That must mean it's a new groupchat without locking
  58583. // (in which case Prosody doesn't send a 201 status),
  58584. // otherwise the features would have been fetched in
  58585. // the "initialize" method already.
  58586. if (this.get('affiliation') === 'owner' && this.get('auto_configure')) {
  58587. this.autoConfigureChatRoom().then(() => this.refreshRoomFeatures());
  58588. } else {
  58589. this.getRoomFeatures();
  58590. }
  58591. }
  58592. this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS.ENTERED);
  58593. },
  58594. isUserMentioned(message) {
  58595. /* Returns a boolean to indicate whether the current user
  58596. * was mentioned in a message.
  58597. *
  58598. * Parameters:
  58599. * (String): The text message
  58600. */
  58601. const nick = this.get('nick');
  58602. if (message.get('references').length) {
  58603. const mentions = message.get('references').filter(ref => ref.type === 'mention').map(ref => ref.value);
  58604. return _.includes(mentions, nick);
  58605. } else {
  58606. return new RegExp(`\\b${nick}\\b`).test(message.get('message'));
  58607. }
  58608. },
  58609. incrementUnreadMsgCounter(message) {
  58610. /* Given a newly received message, update the unread counter if
  58611. * necessary.
  58612. *
  58613. * Parameters:
  58614. * (XMLElement): The <messsage> stanza
  58615. */
  58616. if (!message) {
  58617. return;
  58618. }
  58619. const body = message.get('message');
  58620. if (_.isNil(body)) {
  58621. return;
  58622. }
  58623. if (_utils_form__WEBPACK_IMPORTED_MODULE_7__["default"].isNewMessage(message) && this.isHidden()) {
  58624. const settings = {
  58625. 'num_unread_general': this.get('num_unread_general') + 1
  58626. };
  58627. if (this.isUserMentioned(message)) {
  58628. settings.num_unread = this.get('num_unread') + 1;
  58629. _converse.incrementMsgCounter();
  58630. }
  58631. this.save(settings);
  58632. }
  58633. },
  58634. clearUnreadMsgCounter() {
  58635. _utils_form__WEBPACK_IMPORTED_MODULE_7__["default"].safeSave(this, {
  58636. 'num_unread': 0,
  58637. 'num_unread_general': 0
  58638. });
  58639. }
  58640. });
  58641. _converse.ChatRoomOccupant = Backbone.Model.extend({
  58642. defaults: {
  58643. 'show': 'offline',
  58644. 'states': []
  58645. },
  58646. initialize(attributes) {
  58647. this.set(_.extend({
  58648. 'id': _converse.connection.getUniqueId()
  58649. }, attributes));
  58650. this.on('change:image_hash', this.onAvatarChanged, this);
  58651. },
  58652. onAvatarChanged() {
  58653. const hash = this.get('image_hash');
  58654. const vcards = [];
  58655. if (this.get('jid')) {
  58656. vcards.push(_converse.vcards.findWhere({
  58657. 'jid': this.get('jid')
  58658. }));
  58659. }
  58660. vcards.push(_converse.vcards.findWhere({
  58661. 'jid': this.get('from')
  58662. }));
  58663. _.forEach(_.filter(vcards, undefined), vcard => {
  58664. if (hash && vcard.get('image_hash') !== hash) {
  58665. _converse.api.vcard.update(vcard);
  58666. }
  58667. });
  58668. },
  58669. getDisplayName() {
  58670. return this.get('nick') || this.get('jid');
  58671. },
  58672. isMember() {
  58673. return _.includes(['admin', 'owner', 'member'], this.get('affiliation'));
  58674. },
  58675. isSelf() {
  58676. return this.get('states').includes('110');
  58677. }
  58678. });
  58679. _converse.ChatRoomOccupants = Backbone.Collection.extend({
  58680. model: _converse.ChatRoomOccupant,
  58681. comparator(occupant1, occupant2) {
  58682. const role1 = occupant1.get('role') || 'none';
  58683. const role2 = occupant2.get('role') || 'none';
  58684. if (MUC_ROLE_WEIGHTS[role1] === MUC_ROLE_WEIGHTS[role2]) {
  58685. const nick1 = occupant1.getDisplayName().toLowerCase();
  58686. const nick2 = occupant2.getDisplayName().toLowerCase();
  58687. return nick1 < nick2 ? -1 : nick1 > nick2 ? 1 : 0;
  58688. } else {
  58689. return MUC_ROLE_WEIGHTS[role1] < MUC_ROLE_WEIGHTS[role2] ? -1 : 1;
  58690. }
  58691. },
  58692. async fetchMembers() {
  58693. const new_members = await this.chatroom.getJidsWithAffiliations(['member', 'owner', 'admin']);
  58694. const new_jids = new_members.map(m => m.jid).filter(m => !_.isUndefined(m)),
  58695. new_nicks = new_members.map(m => !m.jid && m.nick || undefined).filter(m => !_.isUndefined(m)),
  58696. removed_members = this.filter(m => {
  58697. return f.includes(m.get('affiliation'), ['admin', 'member', 'owner']) && !f.includes(m.get('nick'), new_nicks) && !f.includes(m.get('jid'), new_jids);
  58698. });
  58699. _.each(removed_members, occupant => {
  58700. if (occupant.get('jid') === _converse.bare_jid) {
  58701. return;
  58702. }
  58703. if (occupant.get('show') === 'offline') {
  58704. occupant.destroy();
  58705. }
  58706. });
  58707. _.each(new_members, attrs => {
  58708. let occupant;
  58709. if (attrs.jid) {
  58710. occupant = this.findOccupant({
  58711. 'jid': attrs.jid
  58712. });
  58713. } else {
  58714. occupant = this.findOccupant({
  58715. 'nick': attrs.nick
  58716. });
  58717. }
  58718. if (occupant) {
  58719. occupant.save(attrs);
  58720. } else {
  58721. this.create(attrs);
  58722. }
  58723. });
  58724. },
  58725. findOccupant(data) {
  58726. /* Try to find an existing occupant based on the passed in
  58727. * data object.
  58728. *
  58729. * If we have a JID, we use that as lookup variable,
  58730. * otherwise we use the nick. We don't always have both,
  58731. * but should have at least one or the other.
  58732. */
  58733. const jid = Strophe.getBareJidFromJid(data.jid);
  58734. if (jid !== null) {
  58735. return this.where({
  58736. 'jid': jid
  58737. }).pop();
  58738. } else {
  58739. return this.where({
  58740. 'nick': data.nick
  58741. }).pop();
  58742. }
  58743. }
  58744. });
  58745. _converse.RoomsPanelModel = Backbone.Model.extend({
  58746. defaults: {
  58747. 'muc_domain': ''
  58748. }
  58749. });
  58750. _converse.onDirectMUCInvitation = function (message) {
  58751. /* A direct MUC invitation to join a groupchat has been received
  58752. * See XEP-0249: Direct MUC invitations.
  58753. *
  58754. * Parameters:
  58755. * (XMLElement) message: The message stanza containing the
  58756. * invitation.
  58757. */
  58758. const x_el = sizzle('x[xmlns="jabber:x:conference"]', message).pop(),
  58759. from = Strophe.getBareJidFromJid(message.getAttribute('from')),
  58760. room_jid = x_el.getAttribute('jid'),
  58761. reason = x_el.getAttribute('reason');
  58762. let contact = _converse.roster.get(from),
  58763. result;
  58764. if (_converse.auto_join_on_invite) {
  58765. result = true;
  58766. } else {
  58767. // Invite request might come from someone not your roster list
  58768. contact = contact ? contact.get('fullname') : Strophe.getNodeFromJid(from);
  58769. if (!reason) {
  58770. result = confirm(__("%1$s has invited you to join a groupchat: %2$s", contact, room_jid));
  58771. } else {
  58772. result = confirm(__('%1$s has invited you to join a groupchat: %2$s, and left the following reason: "%3$s"', contact, room_jid, reason));
  58773. }
  58774. }
  58775. if (result === true) {
  58776. const chatroom = _converse.openChatRoom(room_jid, {
  58777. 'password': x_el.getAttribute('password')
  58778. });
  58779. if (chatroom.get('connection_status') === _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS.DISCONNECTED) {
  58780. _converse.chatboxviews.get(room_jid).join();
  58781. }
  58782. }
  58783. };
  58784. if (_converse.allow_muc_invitations) {
  58785. const registerDirectInvitationHandler = function registerDirectInvitationHandler() {
  58786. _converse.connection.addHandler(message => {
  58787. _converse.onDirectMUCInvitation(message);
  58788. return true;
  58789. }, 'jabber:x:conference', 'message');
  58790. };
  58791. _converse.on('connected', registerDirectInvitationHandler);
  58792. _converse.on('reconnected', registerDirectInvitationHandler);
  58793. }
  58794. const getChatRoom = function getChatRoom(jid, attrs, create) {
  58795. jid = jid.toLowerCase();
  58796. attrs.type = _converse.CHATROOMS_TYPE;
  58797. attrs.id = jid;
  58798. attrs.box_id = b64_sha1(jid);
  58799. return _converse.chatboxes.getChatBox(jid, attrs, create);
  58800. };
  58801. const createChatRoom = function createChatRoom(jid, attrs) {
  58802. if (jid.startsWith('xmpp:') && jid.endsWith('?join')) {
  58803. jid = jid.replace(/^xmpp:/, '').replace(/\?join$/, '');
  58804. }
  58805. return getChatRoom(jid, attrs, true);
  58806. };
  58807. function autoJoinRooms() {
  58808. /* Automatically join groupchats, based on the
  58809. * "auto_join_rooms" configuration setting, which is an array
  58810. * of strings (groupchat JIDs) or objects (with groupchat JID and other
  58811. * settings).
  58812. */
  58813. _.each(_converse.auto_join_rooms, function (groupchat) {
  58814. if (_converse.chatboxes.where({
  58815. 'jid': groupchat
  58816. }).length) {
  58817. return;
  58818. }
  58819. if (_.isString(groupchat)) {
  58820. _converse.api.rooms.open(groupchat);
  58821. } else if (_.isObject(groupchat)) {
  58822. _converse.api.rooms.open(groupchat.jid, groupchat.nick);
  58823. } else {
  58824. _converse.log('Invalid groupchat criteria specified for "auto_join_rooms"', Strophe.LogLevel.ERROR);
  58825. }
  58826. });
  58827. _converse.emit('roomsAutoJoined');
  58828. }
  58829. function disconnectChatRooms() {
  58830. /* When disconnecting, mark all groupchats as
  58831. * disconnected, so that they will be properly entered again
  58832. * when fetched from session storage.
  58833. */
  58834. _converse.chatboxes.each(function (model) {
  58835. if (model.get('type') === _converse.CHATROOMS_TYPE) {
  58836. model.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].ROOMSTATUS.DISCONNECTED);
  58837. }
  58838. });
  58839. }
  58840. function fetchRegistrationForm(room_jid, user_jid) {
  58841. _converse.api.sendIQ($iq({
  58842. 'from': user_jid,
  58843. 'to': room_jid,
  58844. 'type': 'get'
  58845. }).c('query', {
  58846. 'xmlns': Strophe.NS.REGISTER
  58847. })).then(iq => {}).catch(iq => {
  58848. if (sizzle('item-not-found[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]', iq).length) {
  58849. this.feedback.set('error', __('Error: the groupchat %1$s does not exist.', this.model.getDisplayName()));
  58850. } else if (sizzle('not-allowed[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) {
  58851. this.feedback.set('error', __("Sorry, you're not allowed to register in this groupchat"));
  58852. }
  58853. });
  58854. }
  58855. /************************ BEGIN Event Handlers ************************/
  58856. _converse.on('addClientFeatures', () => {
  58857. if (_converse.allow_muc) {
  58858. _converse.api.disco.own.features.add(Strophe.NS.MUC);
  58859. }
  58860. if (_converse.allow_muc_invitations) {
  58861. _converse.api.disco.own.features.add('jabber:x:conference'); // Invites
  58862. }
  58863. });
  58864. _converse.api.listen.on('chatBoxesFetched', autoJoinRooms);
  58865. _converse.api.listen.on('disconnecting', disconnectChatRooms);
  58866. _converse.api.listen.on('statusInitialized', () => {
  58867. // XXX: For websocket connections, we disconnect from all
  58868. // chatrooms when the page reloads. This is a workaround for
  58869. // issue #1111 and should be removed once we support XEP-0198
  58870. const options = {
  58871. 'once': true,
  58872. 'passive': true
  58873. };
  58874. window.addEventListener(_converse.unloadevent, () => {
  58875. if (_converse.connection._proto instanceof Strophe.Websocket) {
  58876. disconnectChatRooms();
  58877. }
  58878. });
  58879. });
  58880. /************************ END Event Handlers ************************/
  58881. /************************ BEGIN API ************************/
  58882. // We extend the default converse.js API to add methods specific to MUC groupchats.
  58883. _.extend(_converse.api, {
  58884. /**
  58885. * The "rooms" namespace groups methods relevant to chatrooms
  58886. * (aka groupchats).
  58887. *
  58888. * @namespace _converse.api.rooms
  58889. * @memberOf _converse.api
  58890. */
  58891. 'rooms': {
  58892. /**
  58893. * Creates a new MUC chatroom (aka groupchat)
  58894. *
  58895. * Similar to {@link _converse.api.rooms.open}, but creates
  58896. * the chatroom in the background (i.e. doesn't cause a
  58897. * view to open).
  58898. *
  58899. * @method _converse.api.rooms.create
  58900. * @param {(string[]|string)} jid|jids The JID or array of
  58901. * JIDs of the chatroom(s) to create
  58902. * @param {object} [attrs] attrs The room attributes
  58903. */
  58904. 'create'(jids, attrs) {
  58905. if (_.isString(attrs)) {
  58906. attrs = {
  58907. 'nick': attrs
  58908. };
  58909. } else if (_.isUndefined(attrs)) {
  58910. attrs = {};
  58911. }
  58912. if (_.isUndefined(attrs.maximize)) {
  58913. attrs.maximize = false;
  58914. }
  58915. if (!attrs.nick && _converse.muc_nickname_from_jid) {
  58916. attrs.nick = Strophe.getNodeFromJid(_converse.bare_jid);
  58917. }
  58918. if (_.isUndefined(jids)) {
  58919. throw new TypeError('rooms.create: You need to provide at least one JID');
  58920. } else if (_.isString(jids)) {
  58921. return createChatRoom(jids, attrs);
  58922. }
  58923. return _.map(jids, _.partial(createChatRoom, _, attrs));
  58924. },
  58925. /**
  58926. * Opens a MUC chatroom (aka groupchat)
  58927. *
  58928. * Similar to {@link _converse.api.chats.open}, but for groupchats.
  58929. *
  58930. * @method _converse.api.rooms.open
  58931. * @param {string} jid The room JID or JIDs (if not specified, all
  58932. * currently open rooms will be returned).
  58933. * @param {string} attrs A map containing any extra room attributes.
  58934. * @param {string} [attrs.nick] The current user's nickname for the MUC
  58935. * @param {boolean} [attrs.auto_configure] A boolean, indicating
  58936. * whether the room should be configured automatically or not.
  58937. * If set to `true`, then it makes sense to pass in configuration settings.
  58938. * @param {object} [attrs.roomconfig] A map of configuration settings to be used when the room gets
  58939. * configured automatically. Currently it doesn't make sense to specify
  58940. * `roomconfig` values if `auto_configure` is set to `false`.
  58941. * For a list of configuration values that can be passed in, refer to these values
  58942. * in the [XEP-0045 MUC specification](http://xmpp.org/extensions/xep-0045.html#registrar-formtype-owner).
  58943. * The values should be named without the `muc#roomconfig_` prefix.
  58944. * @param {boolean} [attrs.maximize] A boolean, indicating whether minimized rooms should also be
  58945. * maximized, when opened. Set to `false` by default.
  58946. * @param {boolean} [attrs.bring_to_foreground] A boolean indicating whether the room should be
  58947. * brought to the foreground and therefore replace the currently shown chat.
  58948. * If there is no chat currently open, then this option is ineffective.
  58949. *
  58950. * @example
  58951. * this._converse.api.rooms.open('group@muc.example.com')
  58952. *
  58953. * @example
  58954. * // To return an array of rooms, provide an array of room JIDs:
  58955. * _converse.api.rooms.open(['group1@muc.example.com', 'group2@muc.example.com'])
  58956. *
  58957. * @example
  58958. * // To setup a custom nickname when joining the room, provide the optional nick argument:
  58959. * _converse.api.rooms.open('group@muc.example.com', {'nick': 'mycustomnick'})
  58960. *
  58961. * @example
  58962. * // For example, opening a room with a specific default configuration:
  58963. * _converse.api.rooms.open(
  58964. * 'myroom@conference.example.org',
  58965. * { 'nick': 'coolguy69',
  58966. * 'auto_configure': true,
  58967. * 'roomconfig': {
  58968. * 'changesubject': false,
  58969. * 'membersonly': true,
  58970. * 'persistentroom': true,
  58971. * 'publicroom': true,
  58972. * 'roomdesc': 'Comfy room for hanging out',
  58973. * 'whois': 'anyone'
  58974. * }
  58975. * },
  58976. * true
  58977. * );
  58978. */
  58979. 'open': async function open(jids, attrs) {
  58980. await _converse.api.waitUntil('chatBoxesFetched');
  58981. if (_.isUndefined(jids)) {
  58982. const err_msg = 'rooms.open: You need to provide at least one JID';
  58983. _converse.log(err_msg, Strophe.LogLevel.ERROR);
  58984. throw new TypeError(err_msg);
  58985. } else if (_.isString(jids)) {
  58986. return _converse.api.rooms.create(jids, attrs).trigger('show');
  58987. } else {
  58988. return _.map(jids, jid => _converse.api.rooms.create(jid, attrs).trigger('show'));
  58989. }
  58990. },
  58991. /**
  58992. * Returns an object representing a MUC chatroom (aka groupchat)
  58993. *
  58994. * @method _converse.api.rooms.get
  58995. * @param {string} [jid] The room JID (if not specified, all rooms will be returned).
  58996. * @param {object} attrs A map containing any extra room attributes For example, if you want
  58997. * to specify the nickname, use `{'nick': 'bloodninja'}`. Previously (before
  58998. * version 1.0.7, the second parameter only accepted the nickname (as a string
  58999. * value). This is currently still accepted, but then you can't pass in any
  59000. * other room attributes. If the nickname is not specified then the node part of
  59001. * the user's JID will be used.
  59002. * @param {boolean} create A boolean indicating whether the room should be created
  59003. * if not found (default: `false`)
  59004. * @example
  59005. * _converse.api.waitUntil('roomsAutoJoined').then(() => {
  59006. * const create_if_not_found = true;
  59007. * _converse.api.rooms.get(
  59008. * 'group@muc.example.com',
  59009. * {'nick': 'dread-pirate-roberts'},
  59010. * create_if_not_found
  59011. * )
  59012. * });
  59013. */
  59014. 'get'(jids, attrs, create) {
  59015. if (_.isString(attrs)) {
  59016. attrs = {
  59017. 'nick': attrs
  59018. };
  59019. } else if (_.isUndefined(attrs)) {
  59020. attrs = {};
  59021. }
  59022. if (_.isUndefined(jids)) {
  59023. const result = [];
  59024. _converse.chatboxes.each(function (chatbox) {
  59025. if (chatbox.get('type') === _converse.CHATROOMS_TYPE) {
  59026. result.push(chatbox);
  59027. }
  59028. });
  59029. return result;
  59030. }
  59031. if (!attrs.nick) {
  59032. attrs.nick = Strophe.getNodeFromJid(_converse.bare_jid);
  59033. }
  59034. if (_.isString(jids)) {
  59035. return getChatRoom(jids, attrs);
  59036. }
  59037. return _.map(jids, _.partial(getChatRoom, _, attrs));
  59038. }
  59039. }
  59040. });
  59041. /************************ END API ************************/
  59042. }
  59043. });
  59044. /***/ }),
  59045. /***/ "./src/headless/converse-ping.js":
  59046. /*!***************************************!*\
  59047. !*** ./src/headless/converse-ping.js ***!
  59048. \***************************************/
  59049. /*! no exports provided */
  59050. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59051. "use strict";
  59052. __webpack_require__.r(__webpack_exports__);
  59053. /* harmony import */ var strophejs_plugin_ping__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! strophejs-plugin-ping */ "./node_modules/strophejs-plugin-ping/strophe.ping.js");
  59054. /* harmony import */ var strophejs_plugin_ping__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(strophejs_plugin_ping__WEBPACK_IMPORTED_MODULE_0__);
  59055. /* harmony import */ var _converse_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./converse-core */ "./src/headless/converse-core.js");
  59056. // Converse.js
  59057. // https://conversejs.org
  59058. //
  59059. // Copyright (c) 2013-2018, the Converse.js developers
  59060. // Licensed under the Mozilla Public License (MPLv2)
  59061. /* This is a Converse.js plugin which add support for application-level pings
  59062. * as specified in XEP-0199 XMPP Ping.
  59063. */
  59064. // Strophe methods for building stanzas
  59065. const _converse$env = _converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].env,
  59066. Strophe = _converse$env.Strophe,
  59067. _ = _converse$env._;
  59068. _converse_core__WEBPACK_IMPORTED_MODULE_1__["default"].plugins.add('converse-ping', {
  59069. initialize() {
  59070. /* The initialize function gets called as soon as the plugin is
  59071. * loaded by converse.js's plugin machinery.
  59072. */
  59073. const _converse = this._converse;
  59074. _converse.api.settings.update({
  59075. ping_interval: 180 //in seconds
  59076. });
  59077. _converse.ping = function (jid, success, error, timeout) {
  59078. // XXX: We could first check here if the server advertised that
  59079. // it supports PING.
  59080. // However, some servers don't advertise while still keeping the
  59081. // connection option due to pings.
  59082. //
  59083. // var feature = _converse.disco_entities[_converse.domain].features.findWhere({'var': Strophe.NS.PING});
  59084. _converse.lastStanzaDate = new Date();
  59085. if (_.isNil(jid)) {
  59086. jid = Strophe.getDomainFromJid(_converse.bare_jid);
  59087. }
  59088. if (_.isUndefined(timeout)) {
  59089. timeout = null;
  59090. }
  59091. if (_.isUndefined(success)) {
  59092. success = null;
  59093. }
  59094. if (_.isUndefined(error)) {
  59095. error = null;
  59096. }
  59097. if (_converse.connection) {
  59098. _converse.connection.ping.ping(jid, success, error, timeout);
  59099. return true;
  59100. }
  59101. return false;
  59102. };
  59103. _converse.pong = function (ping) {
  59104. _converse.lastStanzaDate = new Date();
  59105. _converse.connection.ping.pong(ping);
  59106. return true;
  59107. };
  59108. _converse.registerPongHandler = function () {
  59109. if (!_.isUndefined(_converse.connection.disco)) {
  59110. _converse.api.disco.own.features.add(Strophe.NS.PING);
  59111. }
  59112. _converse.connection.ping.addPingHandler(_converse.pong);
  59113. };
  59114. _converse.registerPingHandler = function () {
  59115. _converse.registerPongHandler();
  59116. if (_converse.ping_interval > 0) {
  59117. _converse.connection.addHandler(function () {
  59118. /* Handler on each stanza, saves the received date
  59119. * in order to ping only when needed.
  59120. */
  59121. _converse.lastStanzaDate = new Date();
  59122. return true;
  59123. });
  59124. _converse.connection.addTimedHandler(1000, function () {
  59125. const now = new Date();
  59126. if (!_converse.lastStanzaDate) {
  59127. _converse.lastStanzaDate = now;
  59128. }
  59129. if ((now - _converse.lastStanzaDate) / 1000 > _converse.ping_interval) {
  59130. return _converse.ping();
  59131. }
  59132. return true;
  59133. });
  59134. }
  59135. };
  59136. const onConnected = function onConnected() {
  59137. // Wrapper so that we can spy on registerPingHandler in tests
  59138. _converse.registerPingHandler();
  59139. };
  59140. _converse.on('connected', onConnected);
  59141. _converse.on('reconnected', onConnected);
  59142. }
  59143. });
  59144. /***/ }),
  59145. /***/ "./src/headless/converse-roster.js":
  59146. /*!*****************************************!*\
  59147. !*** ./src/headless/converse-roster.js ***!
  59148. \*****************************************/
  59149. /*! no exports provided */
  59150. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59151. "use strict";
  59152. __webpack_require__.r(__webpack_exports__);
  59153. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  59154. // Converse.js
  59155. // http://conversejs.org
  59156. //
  59157. // Copyright (c) 2013-2018, the Converse.js developers
  59158. // Licensed under the Mozilla Public License (MPLv2)
  59159. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env,
  59160. Backbone = _converse$env.Backbone,
  59161. Promise = _converse$env.Promise,
  59162. Strophe = _converse$env.Strophe,
  59163. $iq = _converse$env.$iq,
  59164. $pres = _converse$env.$pres,
  59165. b64_sha1 = _converse$env.b64_sha1,
  59166. moment = _converse$env.moment,
  59167. sizzle = _converse$env.sizzle,
  59168. _ = _converse$env._;
  59169. const u = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env.utils;
  59170. _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins.add('converse-roster', {
  59171. dependencies: ["converse-vcard"],
  59172. initialize() {
  59173. /* The initialize function gets called as soon as the plugin is
  59174. * loaded by converse.js's plugin machinery.
  59175. */
  59176. const _converse = this._converse,
  59177. __ = _converse.__;
  59178. _converse.api.settings.update({
  59179. 'allow_contact_requests': true,
  59180. 'auto_subscribe': false,
  59181. 'synchronize_availability': true
  59182. });
  59183. _converse.api.promises.add(['cachedRoster', 'roster', 'rosterContactsFetched', 'rosterGroupsFetched', 'rosterInitialized']);
  59184. _converse.registerPresenceHandler = function () {
  59185. _converse.unregisterPresenceHandler();
  59186. _converse.presence_ref = _converse.connection.addHandler(function (presence) {
  59187. _converse.roster.presenceHandler(presence);
  59188. return true;
  59189. }, null, 'presence', null);
  59190. };
  59191. _converse.initRoster = function () {
  59192. /* Initialize the Bakcbone collections that represent the contats
  59193. * roster and the roster groups.
  59194. */
  59195. const storage = _converse.config.get('storage');
  59196. _converse.roster = new _converse.RosterContacts();
  59197. _converse.roster.browserStorage = new Backbone.BrowserStorage[storage](b64_sha1(`converse.contacts-${_converse.bare_jid}`));
  59198. _converse.roster.data = new Backbone.Model();
  59199. const id = b64_sha1(`converse-roster-model-${_converse.bare_jid}`);
  59200. _converse.roster.data.id = id;
  59201. _converse.roster.data.browserStorage = new Backbone.BrowserStorage[storage](id);
  59202. _converse.roster.data.fetch();
  59203. _converse.rostergroups = new _converse.RosterGroups();
  59204. _converse.rostergroups.browserStorage = new Backbone.BrowserStorage[storage](b64_sha1(`converse.roster.groups${_converse.bare_jid}`));
  59205. _converse.emit('rosterInitialized');
  59206. };
  59207. _converse.populateRoster = function (ignore_cache = false) {
  59208. /* Fetch all the roster groups, and then the roster contacts.
  59209. * Emit an event after fetching is done in each case.
  59210. *
  59211. * Parameters:
  59212. * (Bool) ignore_cache - If set to to true, the local cache
  59213. * will be ignored it's guaranteed that the XMPP server
  59214. * will be queried for the roster.
  59215. */
  59216. if (ignore_cache) {
  59217. _converse.send_initial_presence = true;
  59218. _converse.roster.fetchFromServer().then(() => {
  59219. _converse.emit('rosterContactsFetched');
  59220. _converse.sendInitialPresence();
  59221. }).catch(reason => {
  59222. _converse.log(reason, Strophe.LogLevel.ERROR);
  59223. _converse.sendInitialPresence();
  59224. });
  59225. } else {
  59226. _converse.rostergroups.fetchRosterGroups().then(() => {
  59227. _converse.emit('rosterGroupsFetched');
  59228. return _converse.roster.fetchRosterContacts();
  59229. }).then(() => {
  59230. _converse.emit('rosterContactsFetched');
  59231. _converse.sendInitialPresence();
  59232. }).catch(reason => {
  59233. _converse.log(reason, Strophe.LogLevel.ERROR);
  59234. _converse.sendInitialPresence();
  59235. });
  59236. }
  59237. };
  59238. _converse.Presence = Backbone.Model.extend({
  59239. defaults() {
  59240. return {
  59241. 'show': 'offline',
  59242. 'resources': {}
  59243. };
  59244. },
  59245. getHighestPriorityResource() {
  59246. /* Return the resource with the highest priority.
  59247. *
  59248. * If multiple resources have the same priority, take the
  59249. * latest one.
  59250. */
  59251. const resources = this.get('resources');
  59252. if (_.isObject(resources) && _.size(resources)) {
  59253. const val = _.flow(_.values, _.partial(_.sortBy, _, ['priority', 'timestamp']), _.reverse)(resources)[0];
  59254. if (!_.isUndefined(val)) {
  59255. return val;
  59256. }
  59257. }
  59258. },
  59259. addResource(presence) {
  59260. /* Adds a new resource and it's associated attributes as taken
  59261. * from the passed in presence stanza.
  59262. *
  59263. * Also updates the presence if the resource has higher priority (and is newer).
  59264. */
  59265. const jid = presence.getAttribute('from'),
  59266. show = _.propertyOf(presence.querySelector('show'))('textContent') || 'online',
  59267. resource = Strophe.getResourceFromJid(jid),
  59268. delay = sizzle(`delay[xmlns="${Strophe.NS.DELAY}"]`, presence).pop(),
  59269. timestamp = _.isNil(delay) ? moment().format() : moment(delay.getAttribute('stamp')).format();
  59270. let priority = _.propertyOf(presence.querySelector('priority'))('textContent') || 0;
  59271. priority = _.isNaN(parseInt(priority, 10)) ? 0 : parseInt(priority, 10);
  59272. const resources = _.isObject(this.get('resources')) ? this.get('resources') : {};
  59273. resources[resource] = {
  59274. 'name': resource,
  59275. 'priority': priority,
  59276. 'show': show,
  59277. 'timestamp': timestamp
  59278. };
  59279. const changed = {
  59280. 'resources': resources
  59281. };
  59282. const hpr = this.getHighestPriorityResource();
  59283. if (priority == hpr.priority && timestamp == hpr.timestamp) {
  59284. // Only set the "global" presence if this is the newest resource
  59285. // with the highest priority
  59286. changed.show = show;
  59287. }
  59288. this.save(changed);
  59289. return resources;
  59290. },
  59291. removeResource(resource) {
  59292. /* Remove the passed in resource from the resources map.
  59293. *
  59294. * Also redetermines the presence given that there's one less
  59295. * resource.
  59296. */
  59297. let resources = this.get('resources');
  59298. if (!_.isObject(resources)) {
  59299. resources = {};
  59300. } else {
  59301. delete resources[resource];
  59302. }
  59303. this.save({
  59304. 'resources': resources,
  59305. 'show': _.propertyOf(this.getHighestPriorityResource())('show') || 'offline'
  59306. });
  59307. }
  59308. });
  59309. _converse.Presences = Backbone.Collection.extend({
  59310. model: _converse.Presence
  59311. });
  59312. _converse.ModelWithVCardAndPresence = Backbone.Model.extend({
  59313. initialize() {
  59314. this.setVCard();
  59315. this.setPresence();
  59316. },
  59317. setVCard() {
  59318. const jid = this.get('jid');
  59319. this.vcard = _converse.vcards.findWhere({
  59320. 'jid': jid
  59321. }) || _converse.vcards.create({
  59322. 'jid': jid
  59323. });
  59324. },
  59325. setPresence() {
  59326. const jid = this.get('jid');
  59327. this.presence = _converse.presences.findWhere({
  59328. 'jid': jid
  59329. }) || _converse.presences.create({
  59330. 'jid': jid
  59331. });
  59332. }
  59333. });
  59334. _converse.RosterContact = _converse.ModelWithVCardAndPresence.extend({
  59335. defaults: {
  59336. 'chat_state': undefined,
  59337. 'image': _converse.DEFAULT_IMAGE,
  59338. 'image_type': _converse.DEFAULT_IMAGE_TYPE,
  59339. 'num_unread': 0,
  59340. 'status': ''
  59341. },
  59342. initialize(attributes) {
  59343. _converse.ModelWithVCardAndPresence.prototype.initialize.apply(this, arguments);
  59344. const jid = attributes.jid,
  59345. bare_jid = Strophe.getBareJidFromJid(jid).toLowerCase(),
  59346. resource = Strophe.getResourceFromJid(jid);
  59347. attributes.jid = bare_jid;
  59348. this.set(_.assignIn({
  59349. 'groups': [],
  59350. 'id': bare_jid,
  59351. 'jid': bare_jid,
  59352. 'user_id': Strophe.getNodeFromJid(jid)
  59353. }, attributes));
  59354. this.setChatBox();
  59355. this.presence.on('change:show', () => _converse.emit('contactPresenceChanged', this));
  59356. this.presence.on('change:show', () => this.trigger('presenceChanged'));
  59357. },
  59358. setChatBox(chatbox = null) {
  59359. chatbox = chatbox || _converse.chatboxes.get(this.get('jid'));
  59360. if (chatbox) {
  59361. this.chatbox = chatbox;
  59362. this.chatbox.on('change:hidden', this.render, this);
  59363. }
  59364. },
  59365. getDisplayName() {
  59366. return this.get('nickname') || this.vcard.get('nickname') || this.vcard.get('fullname') || this.get('jid');
  59367. },
  59368. getFullname() {
  59369. return this.vcard.get('fullname');
  59370. },
  59371. subscribe(message) {
  59372. /* Send a presence subscription request to this roster contact
  59373. *
  59374. * Parameters:
  59375. * (String) message - An optional message to explain the
  59376. * reason for the subscription request.
  59377. */
  59378. const pres = $pres({
  59379. to: this.get('jid'),
  59380. type: "subscribe"
  59381. });
  59382. if (message && message !== "") {
  59383. pres.c("status").t(message).up();
  59384. }
  59385. const nick = _converse.xmppstatus.vcard.get('nickname') || _converse.xmppstatus.vcard.get('fullname');
  59386. if (nick) {
  59387. pres.c('nick', {
  59388. 'xmlns': Strophe.NS.NICK
  59389. }).t(nick).up();
  59390. }
  59391. _converse.api.send(pres);
  59392. this.save('ask', "subscribe"); // ask === 'subscribe' Means we have asked to subscribe to them.
  59393. return this;
  59394. },
  59395. ackSubscribe() {
  59396. /* Upon receiving the presence stanza of type "subscribed",
  59397. * the user SHOULD acknowledge receipt of that subscription
  59398. * state notification by sending a presence stanza of type
  59399. * "subscribe" to the contact
  59400. */
  59401. _converse.api.send($pres({
  59402. 'type': 'subscribe',
  59403. 'to': this.get('jid')
  59404. }));
  59405. },
  59406. ackUnsubscribe() {
  59407. /* Upon receiving the presence stanza of type "unsubscribed",
  59408. * the user SHOULD acknowledge receipt of that subscription state
  59409. * notification by sending a presence stanza of type "unsubscribe"
  59410. * this step lets the user's server know that it MUST no longer
  59411. * send notification of the subscription state change to the user.
  59412. * Parameters:
  59413. * (String) jid - The Jabber ID of the user who is unsubscribing
  59414. */
  59415. _converse.api.send($pres({
  59416. 'type': 'unsubscribe',
  59417. 'to': this.get('jid')
  59418. }));
  59419. this.removeFromRoster();
  59420. this.destroy();
  59421. },
  59422. unauthorize(message) {
  59423. /* Unauthorize this contact's presence subscription
  59424. * Parameters:
  59425. * (String) message - Optional message to send to the person being unauthorized
  59426. */
  59427. _converse.rejectPresenceSubscription(this.get('jid'), message);
  59428. return this;
  59429. },
  59430. authorize(message) {
  59431. /* Authorize presence subscription
  59432. * Parameters:
  59433. * (String) message - Optional message to send to the person being authorized
  59434. */
  59435. const pres = $pres({
  59436. 'to': this.get('jid'),
  59437. 'type': "subscribed"
  59438. });
  59439. if (message && message !== "") {
  59440. pres.c("status").t(message);
  59441. }
  59442. _converse.api.send(pres);
  59443. return this;
  59444. },
  59445. removeFromRoster() {
  59446. /* Instruct the XMPP server to remove this contact from our roster
  59447. * Parameters:
  59448. * (Function) callback
  59449. */
  59450. const iq = $iq({
  59451. type: 'set'
  59452. }).c('query', {
  59453. xmlns: Strophe.NS.ROSTER
  59454. }).c('item', {
  59455. jid: this.get('jid'),
  59456. subscription: "remove"
  59457. });
  59458. return _converse.api.sendIQ(iq);
  59459. }
  59460. });
  59461. _converse.RosterContacts = Backbone.Collection.extend({
  59462. model: _converse.RosterContact,
  59463. comparator(contact1, contact2) {
  59464. const status1 = contact1.presence.get('show') || 'offline';
  59465. const status2 = contact2.presence.get('show') || 'offline';
  59466. if (_converse.STATUS_WEIGHTS[status1] === _converse.STATUS_WEIGHTS[status2]) {
  59467. const name1 = contact1.getDisplayName().toLowerCase();
  59468. const name2 = contact2.getDisplayName().toLowerCase();
  59469. return name1 < name2 ? -1 : name1 > name2 ? 1 : 0;
  59470. } else {
  59471. return _converse.STATUS_WEIGHTS[status1] < _converse.STATUS_WEIGHTS[status2] ? -1 : 1;
  59472. }
  59473. },
  59474. onConnected() {
  59475. /* Called as soon as the connection has been established
  59476. * (either after initial login, or after reconnection).
  59477. *
  59478. * Use the opportunity to register stanza handlers.
  59479. */
  59480. this.registerRosterHandler();
  59481. this.registerRosterXHandler();
  59482. },
  59483. registerRosterHandler() {
  59484. /* Register a handler for roster IQ "set" stanzas, which update
  59485. * roster contacts.
  59486. */
  59487. _converse.connection.addHandler(iq => {
  59488. _converse.roster.onRosterPush(iq);
  59489. return true;
  59490. }, Strophe.NS.ROSTER, 'iq', "set");
  59491. },
  59492. registerRosterXHandler() {
  59493. /* Register a handler for RosterX message stanzas, which are
  59494. * used to suggest roster contacts to a user.
  59495. */
  59496. let t = 0;
  59497. _converse.connection.addHandler(function (msg) {
  59498. window.setTimeout(function () {
  59499. _converse.connection.flush();
  59500. _converse.roster.subscribeToSuggestedItems.bind(_converse.roster)(msg);
  59501. }, t);
  59502. t += msg.querySelectorAll('item').length * 250;
  59503. return true;
  59504. }, Strophe.NS.ROSTERX, 'message', null);
  59505. },
  59506. async fetchRosterContacts() {
  59507. /* Fetches the roster contacts, first by trying the
  59508. * sessionStorage cache, and if that's empty, then by querying
  59509. * the XMPP server.
  59510. *
  59511. * Returns a promise which resolves once the contacts have been
  59512. * fetched.
  59513. */
  59514. let collection;
  59515. try {
  59516. collection = await new Promise((resolve, reject) => {
  59517. this.fetch({
  59518. 'add': true,
  59519. 'silent': true,
  59520. 'success': resolve,
  59521. 'error': reject
  59522. });
  59523. });
  59524. } catch (e) {
  59525. return _converse.log(e, Strophe.LogLevel.ERROR);
  59526. }
  59527. if (collection.length === 0 || this.rosterVersioningSupported() && !_converse.session.get('roster_fetched')) {
  59528. _converse.send_initial_presence = true;
  59529. _converse.roster.fetchFromServer();
  59530. } else {
  59531. _converse.emit('cachedRoster', collection);
  59532. }
  59533. },
  59534. subscribeToSuggestedItems(msg) {
  59535. _.each(msg.querySelectorAll('item'), function (item) {
  59536. if (item.getAttribute('action') === 'add') {
  59537. _converse.roster.addAndSubscribe(item.getAttribute('jid'), _converse.xmppstatus.vcard.get('nickname') || _converse.xmppstatus.vcard.get('fullname'));
  59538. }
  59539. });
  59540. return true;
  59541. },
  59542. isSelf(jid) {
  59543. return u.isSameBareJID(jid, _converse.connection.jid);
  59544. },
  59545. addAndSubscribe(jid, name, groups, message, attributes) {
  59546. /* Add a roster contact and then once we have confirmation from
  59547. * the XMPP server we subscribe to that contact's presence updates.
  59548. * Parameters:
  59549. * (String) jid - The Jabber ID of the user being added and subscribed to.
  59550. * (String) name - The name of that user
  59551. * (Array of Strings) groups - Any roster groups the user might belong to
  59552. * (String) message - An optional message to explain the
  59553. * reason for the subscription request.
  59554. * (Object) attributes - Any additional attributes to be stored on the user's model.
  59555. */
  59556. const handler = contact => {
  59557. if (contact instanceof _converse.RosterContact) {
  59558. contact.subscribe(message);
  59559. }
  59560. };
  59561. this.addContactToRoster(jid, name, groups, attributes).then(handler, handler);
  59562. },
  59563. sendContactAddIQ(jid, name, groups) {
  59564. /* Send an IQ stanza to the XMPP server to add a new roster contact.
  59565. *
  59566. * Parameters:
  59567. * (String) jid - The Jabber ID of the user being added
  59568. * (String) name - The name of that user
  59569. * (Array of Strings) groups - Any roster groups the user might belong to
  59570. * (Function) callback - A function to call once the IQ is returned
  59571. * (Function) errback - A function to call if an error occurred
  59572. */
  59573. name = _.isEmpty(name) ? jid : name;
  59574. const iq = $iq({
  59575. 'type': 'set'
  59576. }).c('query', {
  59577. 'xmlns': Strophe.NS.ROSTER
  59578. }).c('item', {
  59579. jid,
  59580. name
  59581. });
  59582. _.each(groups, group => iq.c('group').t(group).up());
  59583. return _converse.api.sendIQ(iq);
  59584. },
  59585. async addContactToRoster(jid, name, groups, attributes) {
  59586. /* Adds a RosterContact instance to _converse.roster and
  59587. * registers the contact on the XMPP server.
  59588. * Returns a promise which is resolved once the XMPP server has
  59589. * responded.
  59590. *
  59591. * Parameters:
  59592. * (String) jid - The Jabber ID of the user being added and subscribed to.
  59593. * (String) name - The name of that user
  59594. * (Array of Strings) groups - Any roster groups the user might belong to
  59595. * (Object) attributes - Any additional attributes to be stored on the user's model.
  59596. */
  59597. groups = groups || [];
  59598. try {
  59599. await this.sendContactAddIQ(jid, name, groups);
  59600. } catch (e) {
  59601. _converse.log(e, Strophe.LogLevel.ERROR);
  59602. alert(__('Sorry, there was an error while trying to add %1$s as a contact.', name));
  59603. return e;
  59604. }
  59605. return this.create(_.assignIn({
  59606. 'ask': undefined,
  59607. 'nickname': name,
  59608. groups,
  59609. jid,
  59610. 'requesting': false,
  59611. 'subscription': 'none'
  59612. }, attributes), {
  59613. 'sort': false
  59614. });
  59615. },
  59616. subscribeBack(bare_jid, presence) {
  59617. const contact = this.get(bare_jid);
  59618. if (contact instanceof _converse.RosterContact) {
  59619. contact.authorize().subscribe();
  59620. } else {
  59621. // Can happen when a subscription is retried or roster was deleted
  59622. const handler = contact => {
  59623. if (contact instanceof _converse.RosterContact) {
  59624. contact.authorize().subscribe();
  59625. }
  59626. };
  59627. const nickname = _.get(sizzle(`nick[xmlns="${Strophe.NS.NICK}"]`, presence).pop(), 'textContent', null);
  59628. this.addContactToRoster(bare_jid, nickname, [], {
  59629. 'subscription': 'from'
  59630. }).then(handler, handler);
  59631. }
  59632. },
  59633. getNumOnlineContacts() {
  59634. let ignored = ['offline', 'unavailable'];
  59635. if (_converse.show_only_online_users) {
  59636. ignored = _.union(ignored, ['dnd', 'xa', 'away']);
  59637. }
  59638. return _.sum(this.models.filter(model => !_.includes(ignored, model.presence.get('show'))));
  59639. },
  59640. onRosterPush(iq) {
  59641. /* Handle roster updates from the XMPP server.
  59642. * See: https://xmpp.org/rfcs/rfc6121.html#roster-syntax-actions-push
  59643. *
  59644. * Parameters:
  59645. * (XMLElement) IQ - The IQ stanza received from the XMPP server.
  59646. */
  59647. const id = iq.getAttribute('id');
  59648. const from = iq.getAttribute('from');
  59649. if (from && from !== _converse.bare_jid) {
  59650. // https://tools.ietf.org/html/rfc6121#page-15
  59651. //
  59652. // A receiving client MUST ignore the stanza unless it has no 'from'
  59653. // attribute (i.e., implicitly from the bare JID of the user's
  59654. // account) or it has a 'from' attribute whose value matches the
  59655. // user's bare JID <user@domainpart>.
  59656. return;
  59657. }
  59658. _converse.api.send($iq({
  59659. type: 'result',
  59660. id,
  59661. from: _converse.connection.jid
  59662. }));
  59663. const query = sizzle(`query[xmlns="${Strophe.NS.ROSTER}"]`, iq).pop();
  59664. this.data.save('version', query.getAttribute('ver'));
  59665. const items = sizzle(`item`, query);
  59666. if (items.length > 1) {
  59667. _converse.log(iq, Strophe.LogLevel.ERROR);
  59668. throw new Error('Roster push query may not contain more than one "item" element.');
  59669. }
  59670. if (items.length === 0) {
  59671. _converse.log(iq, Strophe.LogLevel.WARN);
  59672. _converse.log('Received a roster push stanza without an "item" element.', Strophe.LogLevel.WARN);
  59673. return;
  59674. }
  59675. this.updateContact(items.pop());
  59676. _converse.emit('rosterPush', iq);
  59677. return;
  59678. },
  59679. rosterVersioningSupported() {
  59680. return !!(_converse.api.disco.stream.getFeature('ver', 'urn:xmpp:features:rosterver') && this.data.get('version'));
  59681. },
  59682. async fetchFromServer() {
  59683. /* Fetch the roster from the XMPP server */
  59684. const stanza = $iq({
  59685. 'type': 'get',
  59686. 'id': _converse.connection.getUniqueId('roster')
  59687. }).c('query', {
  59688. xmlns: Strophe.NS.ROSTER
  59689. });
  59690. if (this.rosterVersioningSupported()) {
  59691. stanza.attrs({
  59692. 'ver': this.data.get('version')
  59693. });
  59694. }
  59695. let iq;
  59696. try {
  59697. iq = await _converse.api.sendIQ(stanza);
  59698. } catch (e) {
  59699. _converse.log(e, Strophe.LogLevel.ERROR);
  59700. return _converse.log("Error while trying to fetch roster from the server", Strophe.LogLevel.ERROR);
  59701. }
  59702. return this.onReceivedFromServer(iq);
  59703. },
  59704. onReceivedFromServer(iq) {
  59705. /* An IQ stanza containing the roster has been received from
  59706. * the XMPP server.
  59707. */
  59708. const query = sizzle(`query[xmlns="${Strophe.NS.ROSTER}"]`, iq).pop();
  59709. if (query) {
  59710. const items = sizzle(`item`, query);
  59711. _.each(items, item => this.updateContact(item));
  59712. this.data.save('version', query.getAttribute('ver'));
  59713. _converse.session.save('roster_fetched', true);
  59714. }
  59715. _converse.emit('roster', iq);
  59716. },
  59717. updateContact(item) {
  59718. /* Update or create RosterContact models based on items
  59719. * received in the IQ from the server.
  59720. */
  59721. const jid = item.getAttribute('jid');
  59722. if (this.isSelf(jid)) {
  59723. return;
  59724. }
  59725. const contact = this.get(jid),
  59726. subscription = item.getAttribute("subscription"),
  59727. ask = item.getAttribute("ask"),
  59728. groups = _.map(item.getElementsByTagName('group'), Strophe.getText);
  59729. if (!contact) {
  59730. if (subscription === "none" && ask === null || subscription === "remove") {
  59731. return; // We're lazy when adding contacts.
  59732. }
  59733. this.create({
  59734. 'ask': ask,
  59735. 'nickname': item.getAttribute("name"),
  59736. 'groups': groups,
  59737. 'jid': jid,
  59738. 'subscription': subscription
  59739. }, {
  59740. sort: false
  59741. });
  59742. } else {
  59743. if (subscription === "remove") {
  59744. return contact.destroy();
  59745. } // We only find out about requesting contacts via the
  59746. // presence handler, so if we receive a contact
  59747. // here, we know they aren't requesting anymore.
  59748. // see docs/DEVELOPER.rst
  59749. contact.save({
  59750. 'subscription': subscription,
  59751. 'ask': ask,
  59752. 'requesting': null,
  59753. 'groups': groups
  59754. });
  59755. }
  59756. },
  59757. createRequestingContact(presence) {
  59758. const bare_jid = Strophe.getBareJidFromJid(presence.getAttribute('from')),
  59759. nickname = _.get(sizzle(`nick[xmlns="${Strophe.NS.NICK}"]`, presence).pop(), 'textContent', null);
  59760. const user_data = {
  59761. 'jid': bare_jid,
  59762. 'subscription': 'none',
  59763. 'ask': null,
  59764. 'requesting': true,
  59765. 'nickname': nickname
  59766. };
  59767. _converse.emit('contactRequest', this.create(user_data));
  59768. },
  59769. handleIncomingSubscription(presence) {
  59770. const jid = presence.getAttribute('from'),
  59771. bare_jid = Strophe.getBareJidFromJid(jid),
  59772. contact = this.get(bare_jid);
  59773. if (!_converse.allow_contact_requests) {
  59774. _converse.rejectPresenceSubscription(jid, __("This client does not allow presence subscriptions"));
  59775. }
  59776. if (_converse.auto_subscribe) {
  59777. if (!contact || contact.get('subscription') !== 'to') {
  59778. this.subscribeBack(bare_jid, presence);
  59779. } else {
  59780. contact.authorize();
  59781. }
  59782. } else {
  59783. if (contact) {
  59784. if (contact.get('subscription') !== 'none') {
  59785. contact.authorize();
  59786. } else if (contact.get('ask') === "subscribe") {
  59787. contact.authorize();
  59788. }
  59789. } else {
  59790. this.createRequestingContact(presence);
  59791. }
  59792. }
  59793. },
  59794. handleOwnPresence(presence) {
  59795. const jid = presence.getAttribute('from'),
  59796. resource = Strophe.getResourceFromJid(jid),
  59797. presence_type = presence.getAttribute('type');
  59798. if (_converse.connection.jid !== jid && presence_type !== 'unavailable' && (_converse.synchronize_availability === true || _converse.synchronize_availability === resource)) {
  59799. // Another resource has changed its status and
  59800. // synchronize_availability option set to update,
  59801. // we'll update ours as well.
  59802. const show = _.propertyOf(presence.querySelector('show'))('textContent') || 'online';
  59803. _converse.xmppstatus.save({
  59804. 'status': show
  59805. }, {
  59806. 'silent': true
  59807. });
  59808. const status_message = _.propertyOf(presence.querySelector('status'))('textContent');
  59809. if (status_message) {
  59810. _converse.xmppstatus.save({
  59811. 'status_message': status_message
  59812. });
  59813. }
  59814. }
  59815. if (_converse.jid === jid && presence_type === 'unavailable') {
  59816. // XXX: We've received an "unavailable" presence from our
  59817. // own resource. Apparently this happens due to a
  59818. // Prosody bug, whereby we send an IQ stanza to remove
  59819. // a roster contact, and Prosody then sends
  59820. // "unavailable" globally, instead of directed to the
  59821. // particular user that's removed.
  59822. //
  59823. // Here is the bug report: https://prosody.im/issues/1121
  59824. //
  59825. // I'm not sure whether this might legitimately happen
  59826. // in other cases.
  59827. //
  59828. // As a workaround for now we simply send our presence again,
  59829. // otherwise we're treated as offline.
  59830. _converse.xmppstatus.sendPresence();
  59831. }
  59832. },
  59833. presenceHandler(presence) {
  59834. const presence_type = presence.getAttribute('type');
  59835. if (presence_type === 'error') {
  59836. return true;
  59837. }
  59838. const jid = presence.getAttribute('from'),
  59839. bare_jid = Strophe.getBareJidFromJid(jid);
  59840. if (this.isSelf(bare_jid)) {
  59841. return this.handleOwnPresence(presence);
  59842. } else if (sizzle(`query[xmlns="${Strophe.NS.MUC}"]`, presence).length) {
  59843. return; // Ignore MUC
  59844. }
  59845. const status_message = _.propertyOf(presence.querySelector('status'))('textContent'),
  59846. contact = this.get(bare_jid);
  59847. if (contact && status_message !== contact.get('status')) {
  59848. contact.save({
  59849. 'status': status_message
  59850. });
  59851. }
  59852. if (presence_type === 'subscribed' && contact) {
  59853. contact.ackSubscribe();
  59854. } else if (presence_type === 'unsubscribed' && contact) {
  59855. contact.ackUnsubscribe();
  59856. } else if (presence_type === 'unsubscribe') {
  59857. return;
  59858. } else if (presence_type === 'subscribe') {
  59859. this.handleIncomingSubscription(presence);
  59860. } else if (presence_type === 'unavailable' && contact) {
  59861. const resource = Strophe.getResourceFromJid(jid);
  59862. contact.presence.removeResource(resource);
  59863. } else if (contact) {
  59864. // presence_type is undefined
  59865. contact.presence.addResource(presence);
  59866. }
  59867. }
  59868. });
  59869. _converse.RosterGroup = Backbone.Model.extend({
  59870. initialize(attributes) {
  59871. this.set(_.assignIn({
  59872. description: __('Click to hide these contacts'),
  59873. state: _converse.OPENED
  59874. }, attributes)); // Collection of contacts belonging to this group.
  59875. this.contacts = new _converse.RosterContacts();
  59876. }
  59877. });
  59878. _converse.RosterGroups = Backbone.Collection.extend({
  59879. model: _converse.RosterGroup,
  59880. fetchRosterGroups() {
  59881. /* Fetches all the roster groups from sessionStorage.
  59882. *
  59883. * Returns a promise which resolves once the groups have been
  59884. * returned.
  59885. */
  59886. return new Promise((resolve, reject) => {
  59887. this.fetch({
  59888. silent: true,
  59889. // We need to first have all groups before
  59890. // we can start positioning them, so we set
  59891. // 'silent' to true.
  59892. success: resolve
  59893. });
  59894. });
  59895. }
  59896. });
  59897. _converse.unregisterPresenceHandler = function () {
  59898. if (!_.isUndefined(_converse.presence_ref)) {
  59899. _converse.connection.deleteHandler(_converse.presence_ref);
  59900. delete _converse.presence_ref;
  59901. }
  59902. };
  59903. /********** Event Handlers *************/
  59904. function addRelatedContactToChatbox(chatbox, contact) {
  59905. if (!_.isUndefined(contact)) {
  59906. chatbox.contact = contact;
  59907. chatbox.trigger('contactAdded', contact);
  59908. }
  59909. }
  59910. function updateUnreadCounter(chatbox) {
  59911. const contact = _converse.roster.findWhere({
  59912. 'jid': chatbox.get('jid')
  59913. });
  59914. if (!_.isUndefined(contact)) {
  59915. contact.save({
  59916. 'num_unread': chatbox.get('num_unread')
  59917. });
  59918. }
  59919. }
  59920. _converse.api.listen.on('chatBoxesInitialized', () => {
  59921. _converse.chatboxes.on('change:num_unread', updateUnreadCounter);
  59922. _converse.chatboxes.on('add', async chatbox => {
  59923. await _converse.api.waitUntil('rosterContactsFetched');
  59924. addRelatedContactToChatbox(chatbox, _converse.roster.findWhere({
  59925. 'jid': chatbox.get('jid')
  59926. }));
  59927. });
  59928. });
  59929. _converse.api.listen.on('beforeTearDown', _converse.unregisterPresenceHandler());
  59930. _converse.api.waitUntil('rosterContactsFetched').then(() => {
  59931. _converse.roster.on('add', contact => {
  59932. /* When a new contact is added, check if we already have a
  59933. * chatbox open for it, and if so attach it to the chatbox.
  59934. */
  59935. const chatbox = _converse.chatboxes.findWhere({
  59936. 'jid': contact.get('jid')
  59937. });
  59938. if (chatbox) {
  59939. addRelatedContactToChatbox(chatbox, contact);
  59940. }
  59941. });
  59942. });
  59943. _converse.api.listen.on('afterTearDown', () => {
  59944. if (_converse.presences) {
  59945. _converse.presences.off().reset(); // Remove presences
  59946. }
  59947. });
  59948. _converse.api.listen.on('clearSession', () => {
  59949. if (_converse.presences) {
  59950. _converse.presences.browserStorage._clear();
  59951. }
  59952. });
  59953. _converse.api.listen.on('statusInitialized', reconnecting => {
  59954. if (!reconnecting) {
  59955. _converse.presences = new _converse.Presences();
  59956. _converse.presences.browserStorage = new Backbone.BrowserStorage.session(b64_sha1(`converse.presences-${_converse.bare_jid}`));
  59957. _converse.presences.fetch();
  59958. }
  59959. _converse.emit('presencesInitialized', reconnecting);
  59960. });
  59961. _converse.api.listen.on('presencesInitialized', reconnecting => {
  59962. if (reconnecting) {
  59963. // No need to recreate the roster, otherwise we lose our
  59964. // cached data. However we still emit an event, to give
  59965. // event handlers a chance to register views for the
  59966. // roster and its groups, before we start populating.
  59967. _converse.emit('rosterReadyAfterReconnection');
  59968. } else {
  59969. _converse.registerIntervalHandler();
  59970. _converse.initRoster();
  59971. }
  59972. _converse.roster.onConnected();
  59973. _converse.populateRoster(reconnecting);
  59974. _converse.registerPresenceHandler();
  59975. });
  59976. /************************ API ************************/
  59977. // API methods only available to plugins
  59978. _.extend(_converse.api, {
  59979. /**
  59980. * @namespace _converse.api.contacts
  59981. * @memberOf _converse.api
  59982. */
  59983. 'contacts': {
  59984. /**
  59985. * This method is used to retrieve roster contacts.
  59986. *
  59987. * @method _converse.api.contacts.get
  59988. * @params {(string[]|string)} jid|jids The JID or JIDs of
  59989. * the contacts to be returned.
  59990. * @returns {(RosterContact[]|RosterContact)} [Backbone.Model](http://backbonejs.org/#Model)
  59991. * (or an array of them) representing the contact.
  59992. *
  59993. * @example
  59994. * // Fetch a single contact
  59995. * _converse.api.listen.on('rosterContactsFetched', function () {
  59996. * const contact = _converse.api.contacts.get('buddy@example.com')
  59997. * // ...
  59998. * });
  59999. *
  60000. * @example
  60001. * // To get multiple contacts, pass in an array of JIDs:
  60002. * _converse.api.listen.on('rosterContactsFetched', function () {
  60003. * const contacts = _converse.api.contacts.get(
  60004. * ['buddy1@example.com', 'buddy2@example.com']
  60005. * )
  60006. * // ...
  60007. * });
  60008. *
  60009. * @example
  60010. * // To return all contacts, simply call ``get`` without any parameters:
  60011. * _converse.api.listen.on('rosterContactsFetched', function () {
  60012. * const contacts = _converse.api.contacts.get();
  60013. * // ...
  60014. * });
  60015. */
  60016. 'get'(jids) {
  60017. const _getter = function _getter(jid) {
  60018. return _converse.roster.get(Strophe.getBareJidFromJid(jid)) || null;
  60019. };
  60020. if (_.isUndefined(jids)) {
  60021. jids = _converse.roster.pluck('jid');
  60022. } else if (_.isString(jids)) {
  60023. return _getter(jids);
  60024. }
  60025. return _.map(jids, _getter);
  60026. },
  60027. /**
  60028. * Add a contact.
  60029. *
  60030. * @method _converse.api.contacts.add
  60031. * @param {string} jid The JID of the contact to be added
  60032. * @param {string} [name] A custom name to show the user by
  60033. * in the roster.
  60034. * @example
  60035. * _converse.api.contacts.add('buddy@example.com')
  60036. * @example
  60037. * _converse.api.contacts.add('buddy@example.com', 'Buddy')
  60038. */
  60039. 'add'(jid, name) {
  60040. if (!_.isString(jid) || !_.includes(jid, '@')) {
  60041. throw new TypeError('contacts.add: invalid jid');
  60042. }
  60043. _converse.roster.addAndSubscribe(jid, _.isEmpty(name) ? jid : name);
  60044. }
  60045. }
  60046. });
  60047. }
  60048. });
  60049. /***/ }),
  60050. /***/ "./src/headless/converse-vcard.js":
  60051. /*!****************************************!*\
  60052. !*** ./src/headless/converse-vcard.js ***!
  60053. \****************************************/
  60054. /*! no exports provided */
  60055. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60056. "use strict";
  60057. __webpack_require__.r(__webpack_exports__);
  60058. /* harmony import */ var _converse_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./converse-core */ "./src/headless/converse-core.js");
  60059. /* harmony import */ var _templates_vcard_html__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./templates/vcard.html */ "./src/headless/templates/vcard.html");
  60060. /* harmony import */ var _templates_vcard_html__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_templates_vcard_html__WEBPACK_IMPORTED_MODULE_1__);
  60061. // Converse.js
  60062. // http://conversejs.org
  60063. //
  60064. // Copyright (c) 2013-2018, the Converse.js developers
  60065. // Licensed under the Mozilla Public License (MPLv2)
  60066. const _converse$env = _converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env,
  60067. Backbone = _converse$env.Backbone,
  60068. Promise = _converse$env.Promise,
  60069. Strophe = _converse$env.Strophe,
  60070. _ = _converse$env._,
  60071. $iq = _converse$env.$iq,
  60072. $build = _converse$env.$build,
  60073. b64_sha1 = _converse$env.b64_sha1,
  60074. moment = _converse$env.moment,
  60075. sizzle = _converse$env.sizzle;
  60076. const u = _converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env.utils;
  60077. _converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins.add('converse-vcard', {
  60078. initialize() {
  60079. /* The initialize function gets called as soon as the plugin is
  60080. * loaded by converse.js's plugin machinery.
  60081. */
  60082. const _converse = this._converse;
  60083. _converse.VCard = Backbone.Model.extend({
  60084. defaults: {
  60085. 'image': _converse.DEFAULT_IMAGE,
  60086. 'image_type': _converse.DEFAULT_IMAGE_TYPE
  60087. },
  60088. set(key, val, options) {
  60089. // Override Backbone.Model.prototype.set to make sure that the
  60090. // default `image` and `image_type` values are maintained.
  60091. let attrs;
  60092. if (typeof key === 'object') {
  60093. attrs = key;
  60094. options = val;
  60095. } else {
  60096. (attrs = {})[key] = val;
  60097. }
  60098. if (_.has(attrs, 'image') && !attrs['image']) {
  60099. attrs['image'] = _converse.DEFAULT_IMAGE;
  60100. attrs['image_type'] = _converse.DEFAULT_IMAGE_TYPE;
  60101. return Backbone.Model.prototype.set.call(this, attrs, options);
  60102. } else {
  60103. return Backbone.Model.prototype.set.apply(this, arguments);
  60104. }
  60105. }
  60106. });
  60107. _converse.VCards = Backbone.Collection.extend({
  60108. model: _converse.VCard,
  60109. initialize() {
  60110. this.on('add', vcard => _converse.api.vcard.update(vcard));
  60111. }
  60112. });
  60113. async function onVCardData(jid, iq) {
  60114. const vcard = iq.querySelector('vCard');
  60115. let result = {};
  60116. if (!_.isNull(vcard)) {
  60117. result = {
  60118. 'stanza': iq,
  60119. 'fullname': _.get(vcard.querySelector('FN'), 'textContent'),
  60120. 'nickname': _.get(vcard.querySelector('NICKNAME'), 'textContent'),
  60121. 'image': _.get(vcard.querySelector('PHOTO BINVAL'), 'textContent'),
  60122. 'image_type': _.get(vcard.querySelector('PHOTO TYPE'), 'textContent'),
  60123. 'url': _.get(vcard.querySelector('URL'), 'textContent'),
  60124. 'role': _.get(vcard.querySelector('ROLE'), 'textContent'),
  60125. 'email': _.get(vcard.querySelector('EMAIL USERID'), 'textContent'),
  60126. 'vcard_updated': moment().format(),
  60127. 'vcard_error': undefined
  60128. };
  60129. }
  60130. if (result.image) {
  60131. const buffer = u.base64ToArrayBuffer(result['image']);
  60132. const ab = await crypto.subtle.digest('SHA-1', buffer);
  60133. result['image_hash'] = u.arrayBufferToHex(ab);
  60134. }
  60135. return result;
  60136. }
  60137. function createStanza(type, jid, vcard_el) {
  60138. const iq = $iq(jid ? {
  60139. 'type': type,
  60140. 'to': jid
  60141. } : {
  60142. 'type': type
  60143. });
  60144. if (!vcard_el) {
  60145. iq.c("vCard", {
  60146. 'xmlns': Strophe.NS.VCARD
  60147. });
  60148. } else {
  60149. iq.cnode(vcard_el);
  60150. }
  60151. return iq;
  60152. }
  60153. function setVCard(jid, data) {
  60154. if (!jid) {
  60155. throw Error("No jid provided for the VCard data");
  60156. }
  60157. const vcard_el = Strophe.xmlHtmlNode(_templates_vcard_html__WEBPACK_IMPORTED_MODULE_1___default()(data)).firstElementChild;
  60158. return _converse.api.sendIQ(createStanza("set", jid, vcard_el));
  60159. }
  60160. async function getVCard(_converse, jid) {
  60161. /* Request the VCard of another user. Returns a promise.
  60162. *
  60163. * Parameters:
  60164. * (String) jid - The Jabber ID of the user whose VCard
  60165. * is being requested.
  60166. */
  60167. const to = Strophe.getBareJidFromJid(jid) === _converse.bare_jid ? null : jid;
  60168. let iq;
  60169. try {
  60170. iq = await _converse.api.sendIQ(createStanza("get", to));
  60171. } catch (iq) {
  60172. return {
  60173. 'stanza': iq,
  60174. 'jid': jid,
  60175. 'vcard_error': moment().format()
  60176. };
  60177. }
  60178. return onVCardData(jid, iq);
  60179. }
  60180. /* Event handlers */
  60181. _converse.initVCardCollection = function () {
  60182. _converse.vcards = new _converse.VCards();
  60183. const id = b64_sha1(`${_converse.bare_jid}-converse.vcards`);
  60184. _converse.vcards.browserStorage = new Backbone.BrowserStorage[_converse.config.get('storage')](id);
  60185. _converse.vcards.fetch();
  60186. };
  60187. _converse.api.listen.on('sessionInitialized', _converse.initVCardCollection);
  60188. _converse.on('addClientFeatures', () => {
  60189. _converse.api.disco.own.features.add(Strophe.NS.VCARD);
  60190. });
  60191. _.extend(_converse.api, {
  60192. /**
  60193. * The XEP-0054 VCard API
  60194. *
  60195. * This API lets you access and update user VCards
  60196. *
  60197. * @namespace _converse.api.vcard
  60198. * @memberOf _converse.api
  60199. */
  60200. 'vcard': {
  60201. /**
  60202. * Enables setting new values for a VCard.
  60203. *
  60204. * @method _converse.api.vcard.set
  60205. * @param {string} jid The JID for which the VCard should be set
  60206. * @param {object} data A map of VCard keys and values
  60207. * @example
  60208. * _converse.api.vcard.set({
  60209. * 'jid': _converse.bare_jid,
  60210. * 'fn': 'John Doe',
  60211. * 'nickname': 'jdoe'
  60212. * }).then(() => {
  60213. * // Succes
  60214. * }).catch(() => {
  60215. * // Failure
  60216. * }).
  60217. */
  60218. 'set'(jid, data) {
  60219. return setVCard(jid, data);
  60220. },
  60221. /**
  60222. * @method _converse.api.vcard.get
  60223. * @param {Backbone.Model|string} model Either a `Backbone.Model` instance, or a string JID.
  60224. * If a `Backbone.Model` instance is passed in, then it must have either a `jid`
  60225. * attribute or a `muc_jid` attribute.
  60226. * @param {boolean} [force] A boolean indicating whether the vcard should be
  60227. * fetched even if it's been fetched before.
  60228. * @returns {promise} A Promise which resolves with the VCard data for a particular JID or for
  60229. * a `Backbone.Model` instance which represents an entity with a JID (such as a roster contact,
  60230. * chat or chatroom occupant).
  60231. *
  60232. * @example
  60233. * _converse.api.waitUntil('rosterContactsFetched').then(() => {
  60234. * _converse.api.vcard.get('someone@example.org').then(
  60235. * (vcard) => {
  60236. * // Do something with the vcard...
  60237. * }
  60238. * );
  60239. * });
  60240. */
  60241. 'get'(model, force) {
  60242. if (_.isString(model)) {
  60243. return getVCard(_converse, model);
  60244. } else if (force || !model.get('vcard_updated') || !moment(model.get('vcard_error')).isSame(new Date(), "day")) {
  60245. const jid = model.get('jid');
  60246. if (!jid) {
  60247. throw new Error("No JID to get vcard for!");
  60248. }
  60249. return getVCard(_converse, jid);
  60250. } else {
  60251. return Promise.resolve({});
  60252. }
  60253. },
  60254. /**
  60255. * Fetches the VCard associated with a particular `Backbone.Model` instance
  60256. * (by using its `jid` or `muc_jid` attribute) and then updates the model with the
  60257. * returned VCard data.
  60258. *
  60259. * @method _converse.api.vcard.update
  60260. * @param {Backbone.Model} model A `Backbone.Model` instance
  60261. * @param {boolean} [force] A boolean indicating whether the vcard should be
  60262. * fetched again even if it's been fetched before.
  60263. * @returns {promise} A promise which resolves once the update has completed.
  60264. * @example
  60265. * _converse.api.waitUntil('rosterContactsFetched').then(() => {
  60266. * const chatbox = _converse.chatboxes.getChatBox('someone@example.org');
  60267. * _converse.api.vcard.update(chatbox);
  60268. * });
  60269. */
  60270. 'update'(model, force) {
  60271. return this.get(model, force).then(vcard => {
  60272. delete vcard['stanza'];
  60273. model.save(vcard);
  60274. });
  60275. }
  60276. }
  60277. });
  60278. }
  60279. });
  60280. /***/ }),
  60281. /***/ "./src/headless/i18n.js":
  60282. /*!******************************!*\
  60283. !*** ./src/headless/i18n.js ***!
  60284. \******************************/
  60285. /*! exports provided: default */
  60286. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60287. "use strict";
  60288. __webpack_require__.r(__webpack_exports__);
  60289. /* harmony import */ var moment_locale_af__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment/locale/af */ "./node_modules/moment/locale/af.js");
  60290. /* harmony import */ var moment_locale_af__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment_locale_af__WEBPACK_IMPORTED_MODULE_0__);
  60291. /* harmony import */ var moment_locale_ar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! moment/locale/ar */ "./node_modules/moment/locale/ar.js");
  60292. /* harmony import */ var moment_locale_ar__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(moment_locale_ar__WEBPACK_IMPORTED_MODULE_1__);
  60293. /* harmony import */ var moment_locale_bg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! moment/locale/bg */ "./node_modules/moment/locale/bg.js");
  60294. /* harmony import */ var moment_locale_bg__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(moment_locale_bg__WEBPACK_IMPORTED_MODULE_2__);
  60295. /* harmony import */ var moment_locale_ca__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! moment/locale/ca */ "./node_modules/moment/locale/ca.js");
  60296. /* harmony import */ var moment_locale_ca__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(moment_locale_ca__WEBPACK_IMPORTED_MODULE_3__);
  60297. /* harmony import */ var moment_locale_cs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! moment/locale/cs */ "./node_modules/moment/locale/cs.js");
  60298. /* harmony import */ var moment_locale_cs__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(moment_locale_cs__WEBPACK_IMPORTED_MODULE_4__);
  60299. /* harmony import */ var moment_locale_de__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! moment/locale/de */ "./node_modules/moment/locale/de.js");
  60300. /* harmony import */ var moment_locale_de__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(moment_locale_de__WEBPACK_IMPORTED_MODULE_5__);
  60301. /* harmony import */ var moment_locale_es__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! moment/locale/es */ "./node_modules/moment/locale/es.js");
  60302. /* harmony import */ var moment_locale_es__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(moment_locale_es__WEBPACK_IMPORTED_MODULE_6__);
  60303. /* harmony import */ var moment_locale_eu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! moment/locale/eu */ "./node_modules/moment/locale/eu.js");
  60304. /* harmony import */ var moment_locale_eu__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(moment_locale_eu__WEBPACK_IMPORTED_MODULE_7__);
  60305. /* harmony import */ var moment_locale_fr__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! moment/locale/fr */ "./node_modules/moment/locale/fr.js");
  60306. /* harmony import */ var moment_locale_fr__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(moment_locale_fr__WEBPACK_IMPORTED_MODULE_8__);
  60307. /* harmony import */ var moment_locale_gl__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! moment/locale/gl */ "./node_modules/moment/locale/gl.js");
  60308. /* harmony import */ var moment_locale_gl__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(moment_locale_gl__WEBPACK_IMPORTED_MODULE_9__);
  60309. /* harmony import */ var moment_locale_he__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! moment/locale/he */ "./node_modules/moment/locale/he.js");
  60310. /* harmony import */ var moment_locale_he__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(moment_locale_he__WEBPACK_IMPORTED_MODULE_10__);
  60311. /* harmony import */ var moment_locale_hi__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! moment/locale/hi */ "./node_modules/moment/locale/hi.js");
  60312. /* harmony import */ var moment_locale_hi__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(moment_locale_hi__WEBPACK_IMPORTED_MODULE_11__);
  60313. /* harmony import */ var moment_locale_hu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! moment/locale/hu */ "./node_modules/moment/locale/hu.js");
  60314. /* harmony import */ var moment_locale_hu__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(moment_locale_hu__WEBPACK_IMPORTED_MODULE_12__);
  60315. /* harmony import */ var moment_locale_id__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! moment/locale/id */ "./node_modules/moment/locale/id.js");
  60316. /* harmony import */ var moment_locale_id__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(moment_locale_id__WEBPACK_IMPORTED_MODULE_13__);
  60317. /* harmony import */ var moment_locale_it__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! moment/locale/it */ "./node_modules/moment/locale/it.js");
  60318. /* harmony import */ var moment_locale_it__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(moment_locale_it__WEBPACK_IMPORTED_MODULE_14__);
  60319. /* harmony import */ var moment_locale_ja__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! moment/locale/ja */ "./node_modules/moment/locale/ja.js");
  60320. /* harmony import */ var moment_locale_ja__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(moment_locale_ja__WEBPACK_IMPORTED_MODULE_15__);
  60321. /* harmony import */ var moment_locale_nb__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! moment/locale/nb */ "./node_modules/moment/locale/nb.js");
  60322. /* harmony import */ var moment_locale_nb__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(moment_locale_nb__WEBPACK_IMPORTED_MODULE_16__);
  60323. /* harmony import */ var moment_locale_nl__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! moment/locale/nl */ "./node_modules/moment/locale/nl.js");
  60324. /* harmony import */ var moment_locale_nl__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(moment_locale_nl__WEBPACK_IMPORTED_MODULE_17__);
  60325. /* harmony import */ var moment_locale_pl__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! moment/locale/pl */ "./node_modules/moment/locale/pl.js");
  60326. /* harmony import */ var moment_locale_pl__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(moment_locale_pl__WEBPACK_IMPORTED_MODULE_18__);
  60327. /* harmony import */ var moment_locale_pt_br__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! moment/locale/pt-br */ "./node_modules/moment/locale/pt-br.js");
  60328. /* harmony import */ var moment_locale_pt_br__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(moment_locale_pt_br__WEBPACK_IMPORTED_MODULE_19__);
  60329. /* harmony import */ var moment_locale_ro__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! moment/locale/ro */ "./node_modules/moment/locale/ro.js");
  60330. /* harmony import */ var moment_locale_ro__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(moment_locale_ro__WEBPACK_IMPORTED_MODULE_20__);
  60331. /* harmony import */ var moment_locale_ru__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! moment/locale/ru */ "./node_modules/moment/locale/ru.js");
  60332. /* harmony import */ var moment_locale_ru__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(moment_locale_ru__WEBPACK_IMPORTED_MODULE_21__);
  60333. /* harmony import */ var moment_locale_tr__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! moment/locale/tr */ "./node_modules/moment/locale/tr.js");
  60334. /* harmony import */ var moment_locale_tr__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(moment_locale_tr__WEBPACK_IMPORTED_MODULE_22__);
  60335. /* harmony import */ var moment_locale_uk__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! moment/locale/uk */ "./node_modules/moment/locale/uk.js");
  60336. /* harmony import */ var moment_locale_uk__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(moment_locale_uk__WEBPACK_IMPORTED_MODULE_23__);
  60337. /* harmony import */ var moment_locale_zh_cn__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! moment/locale/zh-cn */ "./node_modules/moment/locale/zh-cn.js");
  60338. /* harmony import */ var moment_locale_zh_cn__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(moment_locale_zh_cn__WEBPACK_IMPORTED_MODULE_24__);
  60339. /* harmony import */ var moment_locale_zh_tw__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! moment/locale/zh-tw */ "./node_modules/moment/locale/zh-tw.js");
  60340. /* harmony import */ var moment_locale_zh_tw__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(moment_locale_zh_tw__WEBPACK_IMPORTED_MODULE_25__);
  60341. /* harmony import */ var jed__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! jed */ "./node_modules/jed/jed.js");
  60342. /* harmony import */ var jed__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(jed__WEBPACK_IMPORTED_MODULE_26__);
  60343. /* harmony import */ var es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! es6-promise/dist/es6-promise.auto */ "./node_modules/es6-promise/dist/es6-promise.auto.js");
  60344. /* harmony import */ var es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_27__);
  60345. /* harmony import */ var _lodash_noconflict__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./lodash.noconflict */ "./src/headless/lodash.noconflict.js");
  60346. /* harmony import */ var _lodash_noconflict__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_28__);
  60347. /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
  60348. /* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_29___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_29__);
  60349. // Converse.js (A browser based XMPP chat client)
  60350. // http://conversejs.org
  60351. //
  60352. // This is the internationalization module.
  60353. //
  60354. // Copyright (c) 2013-2017, Jan-Carel Brand <jc@opkode.com>
  60355. // Licensed under the Mozilla Public License (MPLv2)
  60356. //
  60357. /*global define */
  60358. function detectLocale(library_check) {
  60359. /* Determine which locale is supported by the user's system as well
  60360. * as by the relevant library (e.g. converse.js or moment.js).
  60361. *
  60362. * Parameters:
  60363. * (Function) library_check - Returns a boolean indicating whether
  60364. * the locale is supported.
  60365. */
  60366. var locale, i;
  60367. if (window.navigator.userLanguage) {
  60368. locale = isLocaleAvailable(window.navigator.userLanguage, library_check);
  60369. }
  60370. if (window.navigator.languages && !locale) {
  60371. for (i = 0; i < window.navigator.languages.length && !locale; i++) {
  60372. locale = isLocaleAvailable(window.navigator.languages[i], library_check);
  60373. }
  60374. }
  60375. if (window.navigator.browserLanguage && !locale) {
  60376. locale = isLocaleAvailable(window.navigator.browserLanguage, library_check);
  60377. }
  60378. if (window.navigator.language && !locale) {
  60379. locale = isLocaleAvailable(window.navigator.language, library_check);
  60380. }
  60381. if (window.navigator.systemLanguage && !locale) {
  60382. locale = isLocaleAvailable(window.navigator.systemLanguage, library_check);
  60383. }
  60384. return locale || 'en';
  60385. }
  60386. function isMomentLocale(locale) {
  60387. return _lodash_noconflict__WEBPACK_IMPORTED_MODULE_28___default.a.includes(moment__WEBPACK_IMPORTED_MODULE_29___default.a.locales(), locale);
  60388. }
  60389. function isConverseLocale(locale, supported_locales) {
  60390. return _lodash_noconflict__WEBPACK_IMPORTED_MODULE_28___default.a.isString(locale) && _lodash_noconflict__WEBPACK_IMPORTED_MODULE_28___default.a.includes(supported_locales, locale);
  60391. }
  60392. function getLocale(preferred_locale, isSupportedByLibrary) {
  60393. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_28___default.a.isString(preferred_locale)) {
  60394. if (preferred_locale === 'en' || isSupportedByLibrary(preferred_locale)) {
  60395. return preferred_locale;
  60396. }
  60397. }
  60398. return detectLocale(isSupportedByLibrary) || 'en';
  60399. }
  60400. function isLocaleAvailable(locale, available) {
  60401. /* Check whether the locale or sub locale (e.g. en-US, en) is supported.
  60402. *
  60403. * Parameters:
  60404. * (String) locale - The locale to check for
  60405. * (Function) available - returns a boolean indicating whether the locale is supported
  60406. */
  60407. if (available(locale)) {
  60408. return locale;
  60409. } else {
  60410. var sublocale = locale.split("-")[0];
  60411. if (sublocale !== locale && available(sublocale)) {
  60412. return sublocale;
  60413. }
  60414. }
  60415. }
  60416. let jed_instance;
  60417. /* harmony default export */ __webpack_exports__["default"] = ({
  60418. setLocales(preferred_locale, _converse) {
  60419. _converse.locale = getLocale(preferred_locale, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_28___default.a.partial(isConverseLocale, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_28___default.a, _converse.locales));
  60420. moment__WEBPACK_IMPORTED_MODULE_29___default.a.locale(getLocale(preferred_locale, isMomentLocale));
  60421. },
  60422. translate(str) {
  60423. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_28___default.a.isNil(jed_instance)) {
  60424. return jed__WEBPACK_IMPORTED_MODULE_26___default.a.sprintf.apply(jed__WEBPACK_IMPORTED_MODULE_26___default.a, arguments);
  60425. }
  60426. var t = jed_instance.translate(str);
  60427. if (arguments.length > 1) {
  60428. return t.fetch.apply(t, [].slice.call(arguments, 1));
  60429. } else {
  60430. return t.fetch();
  60431. }
  60432. },
  60433. fetchTranslations(locale, supported_locales, locale_url) {
  60434. /* Fetch the translations for the given local at the given URL.
  60435. *
  60436. * Parameters:
  60437. * (String) locale: The given i18n locale
  60438. * (Array) supported_locales: List of locales supported
  60439. * (String) locale_url: The URL from which the translations
  60440. * should be fetched.
  60441. */
  60442. return new es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_27___default.a((resolve, reject) => {
  60443. if (!isConverseLocale(locale, supported_locales) || locale === 'en') {
  60444. return resolve();
  60445. }
  60446. const xhr = new XMLHttpRequest();
  60447. xhr.open('GET', locale_url, true);
  60448. xhr.setRequestHeader('Accept', "application/json, text/javascript");
  60449. xhr.onload = function () {
  60450. if (xhr.status >= 200 && xhr.status < 400) {
  60451. try {
  60452. const data = window.JSON.parse(xhr.responseText);
  60453. jed_instance = new jed__WEBPACK_IMPORTED_MODULE_26___default.a(data);
  60454. resolve();
  60455. } catch (e) {
  60456. xhr.onerror(e);
  60457. }
  60458. } else {
  60459. xhr.onerror();
  60460. }
  60461. };
  60462. xhr.onerror = e => {
  60463. const err_message = e ? ` Error: ${e.message}` : '';
  60464. reject(new Error(`Could not fetch translations. Status: ${xhr.statusText}. ${err_message}`));
  60465. };
  60466. xhr.send();
  60467. });
  60468. }
  60469. });
  60470. /***/ }),
  60471. /***/ "./src/headless/lodash.fp.js":
  60472. /*!***********************************!*\
  60473. !*** ./src/headless/lodash.fp.js ***!
  60474. \***********************************/
  60475. /*! no static exports found */
  60476. /***/ (function(module, exports, __webpack_require__) {
  60477. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"), __webpack_require__(/*! ./3rdparty/lodash.fp */ "./src/headless/3rdparty/lodash.fp.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (_, lodashConverter) {
  60478. var fp = lodashConverter(_.runInContext());
  60479. return fp;
  60480. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  60481. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  60482. /***/ }),
  60483. /***/ "./src/headless/lodash.noconflict.js":
  60484. /*!*******************************************!*\
  60485. !*** ./src/headless/lodash.noconflict.js ***!
  60486. \*******************************************/
  60487. /*! no static exports found */
  60488. /***/ (function(module, exports, __webpack_require__) {
  60489. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*global define */
  60490. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (_) {
  60491. return _.noConflict();
  60492. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  60493. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  60494. /***/ }),
  60495. /***/ "./src/headless/polyfill.js":
  60496. /*!**********************************!*\
  60497. !*** ./src/headless/polyfill.js ***!
  60498. \**********************************/
  60499. /*! no static exports found */
  60500. /***/ (function(module, exports) {
  60501. function CustomEvent(event, params) {
  60502. params = params || {
  60503. bubbles: false,
  60504. cancelable: false,
  60505. detail: undefined
  60506. };
  60507. var evt = document.createEvent('CustomEvent');
  60508. evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
  60509. return evt;
  60510. }
  60511. if (typeof window.CustomEvent !== "function") {
  60512. CustomEvent.prototype = window.Event.prototype;
  60513. window.CustomEvent = CustomEvent;
  60514. }
  60515. if (!String.prototype.includes) {
  60516. String.prototype.includes = function (search, start) {
  60517. 'use strict';
  60518. if (typeof start !== 'number') {
  60519. start = 0;
  60520. }
  60521. if (start + search.length > this.length) {
  60522. return false;
  60523. } else {
  60524. return this.indexOf(search, start) !== -1; // eslint-disable-line lodash/prefer-includes
  60525. }
  60526. };
  60527. }
  60528. if (!String.prototype.endsWith) {
  60529. String.prototype.endsWith = function (searchString, position) {
  60530. var subjectString = this.toString();
  60531. if (position === undefined || position > subjectString.length) {
  60532. position = subjectString.length;
  60533. }
  60534. position -= searchString.length;
  60535. var lastIndex = subjectString.indexOf(searchString, position);
  60536. return lastIndex !== -1 && lastIndex === position;
  60537. };
  60538. }
  60539. if (!String.prototype.startsWith) {
  60540. String.prototype.startsWith = function (searchString, position) {
  60541. position = position || 0;
  60542. return this.substr(position, searchString.length) === searchString;
  60543. };
  60544. }
  60545. if (!String.prototype.splitOnce) {
  60546. String.prototype.splitOnce = function (delimiter) {
  60547. var components = this.split(delimiter);
  60548. return [components.shift(), components.join(delimiter)];
  60549. };
  60550. }
  60551. if (!String.prototype.trim) {
  60552. String.prototype.trim = function () {
  60553. return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
  60554. };
  60555. }
  60556. /***/ }),
  60557. /***/ "./src/headless/templates/field.html":
  60558. /*!*******************************************!*\
  60559. !*** ./src/headless/templates/field.html ***!
  60560. \*******************************************/
  60561. /*! no static exports found */
  60562. /***/ (function(module, exports, __webpack_require__) {
  60563. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  60564. module.exports = function(o) {
  60565. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  60566. function print() { __p += __j.call(arguments, '') }
  60567. __p += '<!-- src/headless/templates/field.html -->\n<field var="' +
  60568. __e(o.name) +
  60569. '">\n';
  60570. if (o.value.constructor === Array) { ;
  60571. __p += '\n ';
  60572. o.value.forEach(function (arrayValue) { ;
  60573. __p += '<value>' +
  60574. __e(arrayValue) +
  60575. '</value>';
  60576. }); ;
  60577. __p += '\n';
  60578. } else { ;
  60579. __p += '\n <value>' +
  60580. __e(o.value) +
  60581. '</value>\n';
  60582. } ;
  60583. __p += '</field>\n';
  60584. return __p
  60585. };
  60586. /***/ }),
  60587. /***/ "./src/headless/templates/vcard.html":
  60588. /*!*******************************************!*\
  60589. !*** ./src/headless/templates/vcard.html ***!
  60590. \*******************************************/
  60591. /*! no static exports found */
  60592. /***/ (function(module, exports, __webpack_require__) {
  60593. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  60594. module.exports = function(o) {
  60595. var __t, __p = '', __e = _.escape;
  60596. __p += '<!-- src/headless/templates/vcard.html -->\n<vCard xmlns="vcard-temp">\n <FN>' +
  60597. __e(o.fn) +
  60598. '</FN>\n <NICKNAME>' +
  60599. __e(o.nickname) +
  60600. '</NICKNAME>\n <URL>' +
  60601. __e(o.url) +
  60602. '</URL>\n <ROLE>' +
  60603. __e(o.role) +
  60604. '</ROLE>\n <EMAIL><INTERNET/><PREF/><USERID>' +
  60605. __e(o.email) +
  60606. '</USERID></EMAIL>\n <PHOTO>\n <TYPE>' +
  60607. __e(o.image_type) +
  60608. '</TYPE>\n <BINVAL>' +
  60609. __e(o.image) +
  60610. '</BINVAL>\n </PHOTO>\n</vCard>\n';
  60611. return __p
  60612. };
  60613. /***/ }),
  60614. /***/ "./src/headless/utils/core.js":
  60615. /*!************************************!*\
  60616. !*** ./src/headless/utils/core.js ***!
  60617. \************************************/
  60618. /*! exports provided: default */
  60619. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60620. "use strict";
  60621. __webpack_require__.r(__webpack_exports__);
  60622. /* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! backbone */ "./node_modules/backbone/backbone.js");
  60623. /* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(backbone__WEBPACK_IMPORTED_MODULE_0__);
  60624. /* harmony import */ var es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! es6-promise/dist/es6-promise.auto */ "./node_modules/es6-promise/dist/es6-promise.auto.js");
  60625. /* harmony import */ var es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_1__);
  60626. /* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! strophe.js */ "./node_modules/strophe.js/dist/strophe.js");
  60627. /* harmony import */ var strophe_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(strophe_js__WEBPACK_IMPORTED_MODULE_2__);
  60628. /* harmony import */ var _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lodash.noconflict */ "./src/headless/lodash.noconflict.js");
  60629. /* harmony import */ var _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_3__);
  60630. /* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
  60631. /* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_4__);
  60632. // Converse.js (A browser based XMPP chat client)
  60633. // http://conversejs.org
  60634. //
  60635. // This is the utilities module.
  60636. //
  60637. // Copyright (c) 2013-2018, Jan-Carel Brand <jc@opkode.com>
  60638. // Licensed under the Mozilla Public License (MPLv2)
  60639. //
  60640. /*global escape, Uint8Array */
  60641. const u = {};
  60642. u.getLongestSubstring = function (string, candidates) {
  60643. function reducer(accumulator, current_value) {
  60644. if (string.startsWith(current_value)) {
  60645. if (current_value.length > accumulator.length) {
  60646. return current_value;
  60647. } else {
  60648. return accumulator;
  60649. }
  60650. } else {
  60651. return accumulator;
  60652. }
  60653. }
  60654. return candidates.reduce(reducer, '');
  60655. };
  60656. u.prefixMentions = function (message) {
  60657. /* Given a message object, return its text with @ chars
  60658. * inserted before the mentioned nicknames.
  60659. */
  60660. let text = message.get('message');
  60661. (message.get('references') || []).sort((a, b) => b.begin - a.begin).forEach(ref => {
  60662. text = `${text.slice(0, ref.begin)}@${text.slice(ref.begin)}`;
  60663. });
  60664. return text;
  60665. };
  60666. u.isValidJID = function (jid) {
  60667. return _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.compact(jid.split('@')).length === 2 && !jid.startsWith('@') && !jid.endsWith('@');
  60668. };
  60669. u.isValidMUCJID = function (jid) {
  60670. return !jid.startsWith('@') && !jid.endsWith('@');
  60671. };
  60672. u.isSameBareJID = function (jid1, jid2) {
  60673. return strophe_js__WEBPACK_IMPORTED_MODULE_2__["Strophe"].getBareJidFromJid(jid1).toLowerCase() === strophe_js__WEBPACK_IMPORTED_MODULE_2__["Strophe"].getBareJidFromJid(jid2).toLowerCase();
  60674. };
  60675. u.getMostRecentMessage = function (model) {
  60676. const messages = model.messages.filter('message');
  60677. return messages[messages.length - 1];
  60678. };
  60679. u.isNewMessage = function (message) {
  60680. /* Given a stanza, determine whether it's a new
  60681. * message, i.e. not a MAM archived one.
  60682. */
  60683. if (message instanceof Element) {
  60684. return !(sizzle__WEBPACK_IMPORTED_MODULE_4___default()(`result[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_2__["Strophe"].NS.MAM}"]`, message).length && sizzle__WEBPACK_IMPORTED_MODULE_4___default()(`delay[xmlns="${strophe_js__WEBPACK_IMPORTED_MODULE_2__["Strophe"].NS.DELAY}"]`, message).length);
  60685. } else {
  60686. return !(message.get('is_delayed') && message.get('is_archived'));
  60687. }
  60688. };
  60689. u.isOnlyChatStateNotification = function (attrs) {
  60690. if (attrs instanceof backbone__WEBPACK_IMPORTED_MODULE_0___default.a.Model) {
  60691. attrs = attrs.attributes;
  60692. }
  60693. return attrs['chat_state'] && !attrs['oob_url'] && !attrs['file'] && !(attrs['is_encrypted'] && attrs['plaintext']) && !attrs['message'];
  60694. };
  60695. u.isHeadlineMessage = function (_converse, message) {
  60696. const from_jid = message.getAttribute('from');
  60697. if (message.getAttribute('type') === 'headline') {
  60698. return true;
  60699. }
  60700. const chatbox = _converse.chatboxes.get(strophe_js__WEBPACK_IMPORTED_MODULE_2__["Strophe"].getBareJidFromJid(from_jid));
  60701. if (chatbox && chatbox.get('type') === _converse.CHATROOMS_TYPE) {
  60702. return false;
  60703. }
  60704. if (message.getAttribute('type') !== 'error' && !_lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.isNil(from_jid) && !_lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.includes(from_jid, '@')) {
  60705. // Some servers (I'm looking at you Prosody) don't set the message
  60706. // type to "headline" when sending server messages. For now we
  60707. // check if an @ signal is included, and if not, we assume it's
  60708. // a headline message.
  60709. return true;
  60710. }
  60711. return false;
  60712. };
  60713. u.merge = function merge(first, second) {
  60714. /* Merge the second object into the first one.
  60715. */
  60716. for (var k in second) {
  60717. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.isObject(first[k])) {
  60718. merge(first[k], second[k]);
  60719. } else {
  60720. first[k] = second[k];
  60721. }
  60722. }
  60723. };
  60724. u.applyUserSettings = function applyUserSettings(context, settings, user_settings) {
  60725. /* Configuration settings might be nested objects. We only want to
  60726. * add settings which are whitelisted.
  60727. */
  60728. for (var k in settings) {
  60729. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.isUndefined(user_settings[k])) {
  60730. continue;
  60731. }
  60732. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.isObject(settings[k]) && !_lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.isArray(settings[k])) {
  60733. applyUserSettings(context[k], settings[k], user_settings[k]);
  60734. } else {
  60735. context[k] = user_settings[k];
  60736. }
  60737. }
  60738. };
  60739. u.stringToNode = function (s) {
  60740. /* Converts an HTML string into a DOM Node.
  60741. * Expects that the HTML string has only one top-level element,
  60742. * i.e. not multiple ones.
  60743. *
  60744. * Parameters:
  60745. * (String) s - The HTML string
  60746. */
  60747. var div = document.createElement('div');
  60748. div.innerHTML = s;
  60749. return div.firstElementChild;
  60750. };
  60751. u.getOuterWidth = function (el, include_margin = false) {
  60752. var width = el.offsetWidth;
  60753. if (!include_margin) {
  60754. return width;
  60755. }
  60756. var style = window.getComputedStyle(el);
  60757. width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);
  60758. return width;
  60759. };
  60760. u.stringToElement = function (s) {
  60761. /* Converts an HTML string into a DOM element.
  60762. * Expects that the HTML string has only one top-level element,
  60763. * i.e. not multiple ones.
  60764. *
  60765. * Parameters:
  60766. * (String) s - The HTML string
  60767. */
  60768. var div = document.createElement('div');
  60769. div.innerHTML = s;
  60770. return div.firstElementChild;
  60771. };
  60772. u.matchesSelector = function (el, selector) {
  60773. /* Checks whether the DOM element matches the given selector.
  60774. *
  60775. * Parameters:
  60776. * (DOMElement) el - The DOM element
  60777. * (String) selector - The selector
  60778. */
  60779. const match = el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector;
  60780. return match ? match.call(el, selector) : false;
  60781. };
  60782. u.queryChildren = function (el, selector) {
  60783. /* Returns a list of children of the DOM element that match the
  60784. * selector.
  60785. *
  60786. * Parameters:
  60787. * (DOMElement) el - the DOM element
  60788. * (String) selector - the selector they should be matched
  60789. * against.
  60790. */
  60791. return _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.filter(el.childNodes, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.partial(u.matchesSelector, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a, selector));
  60792. };
  60793. u.contains = function (attr, query) {
  60794. return function (item) {
  60795. if (typeof attr === 'object') {
  60796. var value = false;
  60797. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.forEach(attr, function (a) {
  60798. value = value || _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.includes(item.get(a).toLowerCase(), query.toLowerCase());
  60799. });
  60800. return value;
  60801. } else if (typeof attr === 'string') {
  60802. return _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.includes(item.get(attr).toLowerCase(), query.toLowerCase());
  60803. } else {
  60804. throw new TypeError('contains: wrong attribute type. Must be string or array.');
  60805. }
  60806. };
  60807. };
  60808. u.isOfType = function (type, item) {
  60809. return item.get('type') == type;
  60810. };
  60811. u.isInstance = function (type, item) {
  60812. return item instanceof type;
  60813. };
  60814. u.getAttribute = function (key, item) {
  60815. return item.get(key);
  60816. };
  60817. u.contains.not = function (attr, query) {
  60818. return function (item) {
  60819. return !u.contains(attr, query)(item);
  60820. };
  60821. };
  60822. u.rootContains = function (root, el) {
  60823. // The document element does not have the contains method in IE.
  60824. if (root === document && !root.contains) {
  60825. return document.head.contains(el) || document.body.contains(el);
  60826. }
  60827. return root.contains ? root.contains(el) : window.HTMLElement.prototype.contains.call(root, el);
  60828. };
  60829. u.createFragmentFromText = function (markup) {
  60830. /* Returns a DocumentFragment containing DOM nodes based on the
  60831. * passed-in markup text.
  60832. */
  60833. // http://stackoverflow.com/questions/9334645/create-node-from-markup-string
  60834. var frag = document.createDocumentFragment(),
  60835. tmp = document.createElement('body'),
  60836. child;
  60837. tmp.innerHTML = markup; // Append elements in a loop to a DocumentFragment, so that the
  60838. // browser does not re-render the document for each node.
  60839. while (child = tmp.firstChild) {
  60840. // eslint-disable-line no-cond-assign
  60841. frag.appendChild(child);
  60842. }
  60843. return frag;
  60844. };
  60845. u.isPersistableModel = function (model) {
  60846. return model.collection && model.collection.browserStorage;
  60847. };
  60848. u.getResolveablePromise = function () {
  60849. /* Returns a promise object on which `resolve` or `reject` can be
  60850. * called.
  60851. */
  60852. const wrapper = {};
  60853. const promise = new es6_promise_dist_es6_promise_auto__WEBPACK_IMPORTED_MODULE_1___default.a((resolve, reject) => {
  60854. wrapper.resolve = resolve;
  60855. wrapper.reject = reject;
  60856. });
  60857. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.assign(promise, wrapper);
  60858. return promise;
  60859. };
  60860. u.interpolate = function (string, o) {
  60861. return string.replace(/{{{([^{}]*)}}}/g, (a, b) => {
  60862. var r = o[b];
  60863. return typeof r === 'string' || typeof r === 'number' ? r : a;
  60864. });
  60865. };
  60866. u.onMultipleEvents = function (events = [], callback) {
  60867. /* Call the callback once all the events have been triggered
  60868. *
  60869. * Parameters:
  60870. * (Array) events: An array of objects, with keys `object` and
  60871. * `event`, representing the event name and the object it's
  60872. * triggered upon.
  60873. * (Function) callback: The function to call once all events have
  60874. * been triggered.
  60875. */
  60876. let triggered = [];
  60877. function handler(result) {
  60878. triggered.push(result);
  60879. if (events.length === triggered.length) {
  60880. callback(triggered);
  60881. triggered = [];
  60882. }
  60883. }
  60884. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.each(events, map => map.object.on(map.event, handler));
  60885. };
  60886. u.safeSave = function (model, attributes) {
  60887. if (u.isPersistableModel(model)) {
  60888. model.save(attributes);
  60889. } else {
  60890. model.set(attributes);
  60891. }
  60892. };
  60893. u.siblingIndex = function (el) {
  60894. /* eslint-disable no-cond-assign */
  60895. for (var i = 0; el = el.previousElementSibling; i++);
  60896. return i;
  60897. };
  60898. u.getCurrentWord = function (input) {
  60899. const cursor = input.selectionEnd || undefined;
  60900. return _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.last(input.value.slice(0, cursor).split(' '));
  60901. };
  60902. u.replaceCurrentWord = function (input, new_value) {
  60903. const cursor = input.selectionEnd || undefined,
  60904. current_word = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_3___default.a.last(input.value.slice(0, cursor).split(' ')),
  60905. value = input.value;
  60906. input.value = value.slice(0, cursor - current_word.length) + `${new_value} ` + value.slice(cursor);
  60907. input.selectionEnd = cursor - current_word.length + new_value.length + 1;
  60908. };
  60909. u.triggerEvent = function (el, name, type = "Event", bubbles = true, cancelable = true) {
  60910. const evt = document.createEvent(type);
  60911. evt.initEvent(name, bubbles, cancelable);
  60912. el.dispatchEvent(evt);
  60913. };
  60914. u.geoUriToHttp = function (text, geouri_replacement) {
  60915. const regex = /geo:([\-0-9.]+),([\-0-9.]+)(?:,([\-0-9.]+))?(?:\?(.*))?/g;
  60916. return text.replace(regex, geouri_replacement);
  60917. };
  60918. u.httpToGeoUri = function (text, _converse) {
  60919. const replacement = 'geo:$1,$2';
  60920. return text.replace(_converse.geouri_regex, replacement);
  60921. };
  60922. u.getSelectValues = function (select) {
  60923. const result = [];
  60924. const options = select && select.options;
  60925. for (var i = 0, iLen = options.length; i < iLen; i++) {
  60926. const opt = options[i];
  60927. if (opt.selected) {
  60928. result.push(opt.value || opt.text);
  60929. }
  60930. }
  60931. return result;
  60932. };
  60933. u.formatFingerprint = function (fp) {
  60934. fp = fp.replace(/^05/, '');
  60935. const arr = [];
  60936. for (let i = 1; i < 8; i++) {
  60937. const idx = i * 8 + i - 1;
  60938. fp = fp.slice(0, idx) + ' ' + fp.slice(idx);
  60939. }
  60940. return fp;
  60941. };
  60942. u.appendArrayBuffer = function (buffer1, buffer2) {
  60943. const tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);
  60944. tmp.set(new Uint8Array(buffer1), 0);
  60945. tmp.set(new Uint8Array(buffer2), buffer1.byteLength);
  60946. return tmp.buffer;
  60947. };
  60948. u.arrayBufferToHex = function (ab) {
  60949. // https://stackoverflow.com/questions/40031688/javascript-arraybuffer-to-hex#40031979
  60950. return Array.prototype.map.call(new Uint8Array(ab), x => ('00' + x.toString(16)).slice(-2)).join('');
  60951. };
  60952. u.arrayBufferToString = function (ab) {
  60953. return new TextDecoder("utf-8").decode(ab);
  60954. };
  60955. u.stringToArrayBuffer = function (string) {
  60956. const bytes = new TextEncoder("utf-8").encode(string);
  60957. return bytes.buffer;
  60958. };
  60959. u.arrayBufferToBase64 = function (ab) {
  60960. return btoa(new Uint8Array(ab).reduce((data, byte) => data + String.fromCharCode(byte), ''));
  60961. };
  60962. u.base64ToArrayBuffer = function (b64) {
  60963. const binary_string = window.atob(b64),
  60964. len = binary_string.length,
  60965. bytes = new Uint8Array(len);
  60966. for (let i = 0; i < len; i++) {
  60967. bytes[i] = binary_string.charCodeAt(i);
  60968. }
  60969. return bytes.buffer;
  60970. };
  60971. u.getRandomInt = function (max) {
  60972. return Math.floor(Math.random() * Math.floor(max));
  60973. };
  60974. u.putCurserAtEnd = function (textarea) {
  60975. if (textarea !== document.activeElement) {
  60976. textarea.focus();
  60977. } // Double the length because Opera is inconsistent about whether a carriage return is one character or two.
  60978. const len = textarea.value.length * 2; // Timeout seems to be required for Blink
  60979. setTimeout(() => textarea.setSelectionRange(len, len), 1); // Scroll to the bottom, in case we're in a tall textarea
  60980. // (Necessary for Firefox and Chrome)
  60981. this.scrollTop = 999999;
  60982. };
  60983. u.getUniqueId = function () {
  60984. return 'xxxxxxxx-xxxx'.replace(/[x]/g, function (c) {
  60985. var r = Math.random() * 16 | 0,
  60986. v = c === 'x' ? r : r & 0x3 | 0x8;
  60987. return v.toString(16);
  60988. });
  60989. };
  60990. /* harmony default export */ __webpack_exports__["default"] = (u);
  60991. /***/ }),
  60992. /***/ "./src/headless/utils/emoji.js":
  60993. /*!*************************************!*\
  60994. !*** ./src/headless/utils/emoji.js ***!
  60995. \*************************************/
  60996. /*! exports provided: default */
  60997. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60998. "use strict";
  60999. __webpack_require__.r(__webpack_exports__);
  61000. /* harmony import */ var twemoji__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! twemoji */ "./node_modules/twemoji/2/esm.js");
  61001. /* harmony import */ var _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lodash.noconflict */ "./src/headless/lodash.noconflict.js");
  61002. /* harmony import */ var _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1__);
  61003. /* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./core */ "./src/headless/utils/core.js");
  61004. const emoji_list = {
  61005. ":kiss_mm:": {
  61006. "uc_base": "1f468-2764-1f48b-1f468",
  61007. "uc_output": "1f468-200d-2764-fe0f-200d-1f48b-200d-1f468",
  61008. "uc_match": "1f468-2764-fe0f-1f48b-1f468",
  61009. "uc_greedy": "1f468-2764-1f48b-1f468",
  61010. "shortnames": [":couplekiss_mm:"],
  61011. "category": "people"
  61012. },
  61013. ":kiss_woman_man:": {
  61014. "uc_base": "1f469-2764-1f48b-1f468",
  61015. "uc_output": "1f469-200d-2764-fe0f-200d-1f48b-200d-1f468",
  61016. "uc_match": "1f469-2764-fe0f-1f48b-1f468",
  61017. "uc_greedy": "1f469-2764-1f48b-1f468",
  61018. "shortnames": [],
  61019. "category": "people"
  61020. },
  61021. ":kiss_ww:": {
  61022. "uc_base": "1f469-2764-1f48b-1f469",
  61023. "uc_output": "1f469-200d-2764-fe0f-200d-1f48b-200d-1f469",
  61024. "uc_match": "1f469-2764-fe0f-1f48b-1f469",
  61025. "uc_greedy": "1f469-2764-1f48b-1f469",
  61026. "shortnames": [":couplekiss_ww:"],
  61027. "category": "people"
  61028. },
  61029. ":england:": {
  61030. "uc_base": "1f3f4-e0067-e0062-e0065-e006e-e0067-e007f",
  61031. "uc_output": "1f3f4-e0067-e0062-e0065-e006e-e0067-e007f",
  61032. "uc_match": "1f3f4-e0067-e0062-e0065-e006e-e0067-e007f",
  61033. "uc_greedy": "1f3f4-e0067-e0062-e0065-e006e-e0067-e007f",
  61034. "shortnames": [],
  61035. "category": "flags"
  61036. },
  61037. ":scotland:": {
  61038. "uc_base": "1f3f4-e0067-e0062-e0073-e0063-e0074-e007f",
  61039. "uc_output": "1f3f4-e0067-e0062-e0073-e0063-e0074-e007f",
  61040. "uc_match": "1f3f4-e0067-e0062-e0073-e0063-e0074-e007f",
  61041. "uc_greedy": "1f3f4-e0067-e0062-e0073-e0063-e0074-e007f",
  61042. "shortnames": [],
  61043. "category": "flags"
  61044. },
  61045. ":wales:": {
  61046. "uc_base": "1f3f4-e0067-e0062-e0077-e006c-e0073-e007f",
  61047. "uc_output": "1f3f4-e0067-e0062-e0077-e006c-e0073-e007f",
  61048. "uc_match": "1f3f4-e0067-e0062-e0077-e006c-e0073-e007f",
  61049. "uc_greedy": "1f3f4-e0067-e0062-e0077-e006c-e0073-e007f",
  61050. "shortnames": [],
  61051. "category": "flags"
  61052. },
  61053. ":family_mmbb:": {
  61054. "uc_base": "1f468-1f468-1f466-1f466",
  61055. "uc_output": "1f468-200d-1f468-200d-1f466-200d-1f466",
  61056. "uc_match": "1f468-1f468-1f466-1f466",
  61057. "uc_greedy": "1f468-1f468-1f466-1f466",
  61058. "shortnames": [],
  61059. "category": "people"
  61060. },
  61061. ":family_mmgb:": {
  61062. "uc_base": "1f468-1f468-1f467-1f466",
  61063. "uc_output": "1f468-200d-1f468-200d-1f467-200d-1f466",
  61064. "uc_match": "1f468-1f468-1f467-1f466",
  61065. "uc_greedy": "1f468-1f468-1f467-1f466",
  61066. "shortnames": [],
  61067. "category": "people"
  61068. },
  61069. ":family_mmgg:": {
  61070. "uc_base": "1f468-1f468-1f467-1f467",
  61071. "uc_output": "1f468-200d-1f468-200d-1f467-200d-1f467",
  61072. "uc_match": "1f468-1f468-1f467-1f467",
  61073. "uc_greedy": "1f468-1f468-1f467-1f467",
  61074. "shortnames": [],
  61075. "category": "people"
  61076. },
  61077. ":family_mwbb:": {
  61078. "uc_base": "1f468-1f469-1f466-1f466",
  61079. "uc_output": "1f468-200d-1f469-200d-1f466-200d-1f466",
  61080. "uc_match": "1f468-1f469-1f466-1f466",
  61081. "uc_greedy": "1f468-1f469-1f466-1f466",
  61082. "shortnames": [],
  61083. "category": "people"
  61084. },
  61085. ":family_mwgb:": {
  61086. "uc_base": "1f468-1f469-1f467-1f466",
  61087. "uc_output": "1f468-200d-1f469-200d-1f467-200d-1f466",
  61088. "uc_match": "1f468-1f469-1f467-1f466",
  61089. "uc_greedy": "1f468-1f469-1f467-1f466",
  61090. "shortnames": [],
  61091. "category": "people"
  61092. },
  61093. ":family_mwgg:": {
  61094. "uc_base": "1f468-1f469-1f467-1f467",
  61095. "uc_output": "1f468-200d-1f469-200d-1f467-200d-1f467",
  61096. "uc_match": "1f468-1f469-1f467-1f467",
  61097. "uc_greedy": "1f468-1f469-1f467-1f467",
  61098. "shortnames": [],
  61099. "category": "people"
  61100. },
  61101. ":family_wwbb:": {
  61102. "uc_base": "1f469-1f469-1f466-1f466",
  61103. "uc_output": "1f469-200d-1f469-200d-1f466-200d-1f466",
  61104. "uc_match": "1f469-1f469-1f466-1f466",
  61105. "uc_greedy": "1f469-1f469-1f466-1f466",
  61106. "shortnames": [],
  61107. "category": "people"
  61108. },
  61109. ":family_wwgb:": {
  61110. "uc_base": "1f469-1f469-1f467-1f466",
  61111. "uc_output": "1f469-200d-1f469-200d-1f467-200d-1f466",
  61112. "uc_match": "1f469-1f469-1f467-1f466",
  61113. "uc_greedy": "1f469-1f469-1f467-1f466",
  61114. "shortnames": [],
  61115. "category": "people"
  61116. },
  61117. ":family_wwgg:": {
  61118. "uc_base": "1f469-1f469-1f467-1f467",
  61119. "uc_output": "1f469-200d-1f469-200d-1f467-200d-1f467",
  61120. "uc_match": "1f469-1f469-1f467-1f467",
  61121. "uc_greedy": "1f469-1f469-1f467-1f467",
  61122. "shortnames": [],
  61123. "category": "people"
  61124. },
  61125. ":couple_mm:": {
  61126. "uc_base": "1f468-2764-1f468",
  61127. "uc_output": "1f468-200d-2764-fe0f-200d-1f468",
  61128. "uc_match": "1f468-2764-fe0f-1f468",
  61129. "uc_greedy": "1f468-2764-1f468",
  61130. "shortnames": [":couple_with_heart_mm:"],
  61131. "category": "people"
  61132. },
  61133. ":couple_with_heart_woman_man:": {
  61134. "uc_base": "1f469-2764-1f468",
  61135. "uc_output": "1f469-200d-2764-fe0f-200d-1f468",
  61136. "uc_match": "1f469-2764-fe0f-1f468",
  61137. "uc_greedy": "1f469-2764-1f468",
  61138. "shortnames": [],
  61139. "category": "people"
  61140. },
  61141. ":couple_ww:": {
  61142. "uc_base": "1f469-2764-1f469",
  61143. "uc_output": "1f469-200d-2764-fe0f-200d-1f469",
  61144. "uc_match": "1f469-2764-fe0f-1f469",
  61145. "uc_greedy": "1f469-2764-1f469",
  61146. "shortnames": [":couple_with_heart_ww:"],
  61147. "category": "people"
  61148. },
  61149. ":family_man_boy_boy:": {
  61150. "uc_base": "1f468-1f466-1f466",
  61151. "uc_output": "1f468-200d-1f466-200d-1f466",
  61152. "uc_match": "1f468-1f466-1f466",
  61153. "uc_greedy": "1f468-1f466-1f466",
  61154. "shortnames": [],
  61155. "category": "people"
  61156. },
  61157. ":family_man_girl_boy:": {
  61158. "uc_base": "1f468-1f467-1f466",
  61159. "uc_output": "1f468-200d-1f467-200d-1f466",
  61160. "uc_match": "1f468-1f467-1f466",
  61161. "uc_greedy": "1f468-1f467-1f466",
  61162. "shortnames": [],
  61163. "category": "people"
  61164. },
  61165. ":family_man_girl_girl:": {
  61166. "uc_base": "1f468-1f467-1f467",
  61167. "uc_output": "1f468-200d-1f467-200d-1f467",
  61168. "uc_match": "1f468-1f467-1f467",
  61169. "uc_greedy": "1f468-1f467-1f467",
  61170. "shortnames": [],
  61171. "category": "people"
  61172. },
  61173. ":family_man_woman_boy:": {
  61174. "uc_base": "1f468-1f469-1f466",
  61175. "uc_output": "1f468-200d-1f469-200d-1f466",
  61176. "uc_match": "1f468-1f469-1f466",
  61177. "uc_greedy": "1f468-1f469-1f466",
  61178. "shortnames": [],
  61179. "category": "people"
  61180. },
  61181. ":family_mmb:": {
  61182. "uc_base": "1f468-1f468-1f466",
  61183. "uc_output": "1f468-200d-1f468-200d-1f466",
  61184. "uc_match": "1f468-1f468-1f466",
  61185. "uc_greedy": "1f468-1f468-1f466",
  61186. "shortnames": [],
  61187. "category": "people"
  61188. },
  61189. ":family_mmg:": {
  61190. "uc_base": "1f468-1f468-1f467",
  61191. "uc_output": "1f468-200d-1f468-200d-1f467",
  61192. "uc_match": "1f468-1f468-1f467",
  61193. "uc_greedy": "1f468-1f468-1f467",
  61194. "shortnames": [],
  61195. "category": "people"
  61196. },
  61197. ":family_mwg:": {
  61198. "uc_base": "1f468-1f469-1f467",
  61199. "uc_output": "1f468-200d-1f469-200d-1f467",
  61200. "uc_match": "1f468-1f469-1f467",
  61201. "uc_greedy": "1f468-1f469-1f467",
  61202. "shortnames": [],
  61203. "category": "people"
  61204. },
  61205. ":family_woman_boy_boy:": {
  61206. "uc_base": "1f469-1f466-1f466",
  61207. "uc_output": "1f469-200d-1f466-200d-1f466",
  61208. "uc_match": "1f469-1f466-1f466",
  61209. "uc_greedy": "1f469-1f466-1f466",
  61210. "shortnames": [],
  61211. "category": "people"
  61212. },
  61213. ":family_woman_girl_boy:": {
  61214. "uc_base": "1f469-1f467-1f466",
  61215. "uc_output": "1f469-200d-1f467-200d-1f466",
  61216. "uc_match": "1f469-1f467-1f466",
  61217. "uc_greedy": "1f469-1f467-1f466",
  61218. "shortnames": [],
  61219. "category": "people"
  61220. },
  61221. ":family_woman_girl_girl:": {
  61222. "uc_base": "1f469-1f467-1f467",
  61223. "uc_output": "1f469-200d-1f467-200d-1f467",
  61224. "uc_match": "1f469-1f467-1f467",
  61225. "uc_greedy": "1f469-1f467-1f467",
  61226. "shortnames": [],
  61227. "category": "people"
  61228. },
  61229. ":family_wwb:": {
  61230. "uc_base": "1f469-1f469-1f466",
  61231. "uc_output": "1f469-200d-1f469-200d-1f466",
  61232. "uc_match": "1f469-1f469-1f466",
  61233. "uc_greedy": "1f469-1f469-1f466",
  61234. "shortnames": [],
  61235. "category": "people"
  61236. },
  61237. ":family_wwg:": {
  61238. "uc_base": "1f469-1f469-1f467",
  61239. "uc_output": "1f469-200d-1f469-200d-1f467",
  61240. "uc_match": "1f469-1f469-1f467",
  61241. "uc_greedy": "1f469-1f469-1f467",
  61242. "shortnames": [],
  61243. "category": "people"
  61244. },
  61245. ":blond-haired_man_tone1:": {
  61246. "uc_base": "1f471-1f3fb-2642",
  61247. "uc_output": "1f471-1f3fb-200d-2642-fe0f",
  61248. "uc_match": "1f471-1f3fb-2642-fe0f",
  61249. "uc_greedy": "1f471-1f3fb-2642",
  61250. "shortnames": [":blond-haired_man_light_skin_tone:"],
  61251. "category": "people"
  61252. },
  61253. ":blond-haired_man_tone2:": {
  61254. "uc_base": "1f471-1f3fc-2642",
  61255. "uc_output": "1f471-1f3fc-200d-2642-fe0f",
  61256. "uc_match": "1f471-1f3fc-2642-fe0f",
  61257. "uc_greedy": "1f471-1f3fc-2642",
  61258. "shortnames": [":blond-haired_man_medium_light_skin_tone:"],
  61259. "category": "people"
  61260. },
  61261. ":blond-haired_man_tone3:": {
  61262. "uc_base": "1f471-1f3fd-2642",
  61263. "uc_output": "1f471-1f3fd-200d-2642-fe0f",
  61264. "uc_match": "1f471-1f3fd-2642-fe0f",
  61265. "uc_greedy": "1f471-1f3fd-2642",
  61266. "shortnames": [":blond-haired_man_medium_skin_tone:"],
  61267. "category": "people"
  61268. },
  61269. ":blond-haired_man_tone4:": {
  61270. "uc_base": "1f471-1f3fe-2642",
  61271. "uc_output": "1f471-1f3fe-200d-2642-fe0f",
  61272. "uc_match": "1f471-1f3fe-2642-fe0f",
  61273. "uc_greedy": "1f471-1f3fe-2642",
  61274. "shortnames": [":blond-haired_man_medium_dark_skin_tone:"],
  61275. "category": "people"
  61276. },
  61277. ":blond-haired_man_tone5:": {
  61278. "uc_base": "1f471-1f3ff-2642",
  61279. "uc_output": "1f471-1f3ff-200d-2642-fe0f",
  61280. "uc_match": "1f471-1f3ff-2642-fe0f",
  61281. "uc_greedy": "1f471-1f3ff-2642",
  61282. "shortnames": [":blond-haired_man_dark_skin_tone:"],
  61283. "category": "people"
  61284. },
  61285. ":blond-haired_woman_tone1:": {
  61286. "uc_base": "1f471-1f3fb-2640",
  61287. "uc_output": "1f471-1f3fb-200d-2640-fe0f",
  61288. "uc_match": "1f471-1f3fb-2640-fe0f",
  61289. "uc_greedy": "1f471-1f3fb-2640",
  61290. "shortnames": [":blond-haired_woman_light_skin_tone:"],
  61291. "category": "people"
  61292. },
  61293. ":blond-haired_woman_tone2:": {
  61294. "uc_base": "1f471-1f3fc-2640",
  61295. "uc_output": "1f471-1f3fc-200d-2640-fe0f",
  61296. "uc_match": "1f471-1f3fc-2640-fe0f",
  61297. "uc_greedy": "1f471-1f3fc-2640",
  61298. "shortnames": [":blond-haired_woman_medium_light_skin_tone:"],
  61299. "category": "people"
  61300. },
  61301. ":blond-haired_woman_tone3:": {
  61302. "uc_base": "1f471-1f3fd-2640",
  61303. "uc_output": "1f471-1f3fd-200d-2640-fe0f",
  61304. "uc_match": "1f471-1f3fd-2640-fe0f",
  61305. "uc_greedy": "1f471-1f3fd-2640",
  61306. "shortnames": [":blond-haired_woman_medium_skin_tone:"],
  61307. "category": "people"
  61308. },
  61309. ":blond-haired_woman_tone4:": {
  61310. "uc_base": "1f471-1f3fe-2640",
  61311. "uc_output": "1f471-1f3fe-200d-2640-fe0f",
  61312. "uc_match": "1f471-1f3fe-2640-fe0f",
  61313. "uc_greedy": "1f471-1f3fe-2640",
  61314. "shortnames": [":blond-haired_woman_medium_dark_skin_tone:"],
  61315. "category": "people"
  61316. },
  61317. ":blond-haired_woman_tone5:": {
  61318. "uc_base": "1f471-1f3ff-2640",
  61319. "uc_output": "1f471-1f3ff-200d-2640-fe0f",
  61320. "uc_match": "1f471-1f3ff-2640-fe0f",
  61321. "uc_greedy": "1f471-1f3ff-2640",
  61322. "shortnames": [":blond-haired_woman_dark_skin_tone:"],
  61323. "category": "people"
  61324. },
  61325. ":eye_in_speech_bubble:": {
  61326. "uc_base": "1f441-1f5e8",
  61327. "uc_output": "1f441-fe0f-200d-1f5e8-fe0f",
  61328. "uc_match": "1f441-fe0f-200d-1f5e8",
  61329. "uc_greedy": "1f441-1f5e8",
  61330. "shortnames": [],
  61331. "category": "symbols"
  61332. },
  61333. ":man_biking_tone1:": {
  61334. "uc_base": "1f6b4-1f3fb-2642",
  61335. "uc_output": "1f6b4-1f3fb-200d-2642-fe0f",
  61336. "uc_match": "1f6b4-1f3fb-2642-fe0f",
  61337. "uc_greedy": "1f6b4-1f3fb-2642",
  61338. "shortnames": [":man_biking_light_skin_tone:"],
  61339. "category": "activity"
  61340. },
  61341. ":man_biking_tone2:": {
  61342. "uc_base": "1f6b4-1f3fc-2642",
  61343. "uc_output": "1f6b4-1f3fc-200d-2642-fe0f",
  61344. "uc_match": "1f6b4-1f3fc-2642-fe0f",
  61345. "uc_greedy": "1f6b4-1f3fc-2642",
  61346. "shortnames": [":man_biking_medium_light_skin_tone:"],
  61347. "category": "activity"
  61348. },
  61349. ":man_biking_tone3:": {
  61350. "uc_base": "1f6b4-1f3fd-2642",
  61351. "uc_output": "1f6b4-1f3fd-200d-2642-fe0f",
  61352. "uc_match": "1f6b4-1f3fd-2642-fe0f",
  61353. "uc_greedy": "1f6b4-1f3fd-2642",
  61354. "shortnames": [":man_biking_medium_skin_tone:"],
  61355. "category": "activity"
  61356. },
  61357. ":man_biking_tone4:": {
  61358. "uc_base": "1f6b4-1f3fe-2642",
  61359. "uc_output": "1f6b4-1f3fe-200d-2642-fe0f",
  61360. "uc_match": "1f6b4-1f3fe-2642-fe0f",
  61361. "uc_greedy": "1f6b4-1f3fe-2642",
  61362. "shortnames": [":man_biking_medium_dark_skin_tone:"],
  61363. "category": "activity"
  61364. },
  61365. ":man_biking_tone5:": {
  61366. "uc_base": "1f6b4-1f3ff-2642",
  61367. "uc_output": "1f6b4-1f3ff-200d-2642-fe0f",
  61368. "uc_match": "1f6b4-1f3ff-2642-fe0f",
  61369. "uc_greedy": "1f6b4-1f3ff-2642",
  61370. "shortnames": [":man_biking_dark_skin_tone:"],
  61371. "category": "activity"
  61372. },
  61373. ":man_bowing_tone1:": {
  61374. "uc_base": "1f647-1f3fb-2642",
  61375. "uc_output": "1f647-1f3fb-200d-2642-fe0f",
  61376. "uc_match": "1f647-1f3fb-2642-fe0f",
  61377. "uc_greedy": "1f647-1f3fb-2642",
  61378. "shortnames": [":man_bowing_light_skin_tone:"],
  61379. "category": "people"
  61380. },
  61381. ":man_bowing_tone2:": {
  61382. "uc_base": "1f647-1f3fc-2642",
  61383. "uc_output": "1f647-1f3fc-200d-2642-fe0f",
  61384. "uc_match": "1f647-1f3fc-2642-fe0f",
  61385. "uc_greedy": "1f647-1f3fc-2642",
  61386. "shortnames": [":man_bowing_medium_light_skin_tone:"],
  61387. "category": "people"
  61388. },
  61389. ":man_bowing_tone3:": {
  61390. "uc_base": "1f647-1f3fd-2642",
  61391. "uc_output": "1f647-1f3fd-200d-2642-fe0f",
  61392. "uc_match": "1f647-1f3fd-2642-fe0f",
  61393. "uc_greedy": "1f647-1f3fd-2642",
  61394. "shortnames": [":man_bowing_medium_skin_tone:"],
  61395. "category": "people"
  61396. },
  61397. ":man_bowing_tone4:": {
  61398. "uc_base": "1f647-1f3fe-2642",
  61399. "uc_output": "1f647-1f3fe-200d-2642-fe0f",
  61400. "uc_match": "1f647-1f3fe-2642-fe0f",
  61401. "uc_greedy": "1f647-1f3fe-2642",
  61402. "shortnames": [":man_bowing_medium_dark_skin_tone:"],
  61403. "category": "people"
  61404. },
  61405. ":man_bowing_tone5:": {
  61406. "uc_base": "1f647-1f3ff-2642",
  61407. "uc_output": "1f647-1f3ff-200d-2642-fe0f",
  61408. "uc_match": "1f647-1f3ff-2642-fe0f",
  61409. "uc_greedy": "1f647-1f3ff-2642",
  61410. "shortnames": [":man_bowing_dark_skin_tone:"],
  61411. "category": "people"
  61412. },
  61413. ":man_cartwheeling_tone1:": {
  61414. "uc_base": "1f938-1f3fb-2642",
  61415. "uc_output": "1f938-1f3fb-200d-2642-fe0f",
  61416. "uc_match": "1f938-1f3fb-2642-fe0f",
  61417. "uc_greedy": "1f938-1f3fb-2642",
  61418. "shortnames": [":man_cartwheeling_light_skin_tone:"],
  61419. "category": "activity"
  61420. },
  61421. ":man_cartwheeling_tone2:": {
  61422. "uc_base": "1f938-1f3fc-2642",
  61423. "uc_output": "1f938-1f3fc-200d-2642-fe0f",
  61424. "uc_match": "1f938-1f3fc-2642-fe0f",
  61425. "uc_greedy": "1f938-1f3fc-2642",
  61426. "shortnames": [":man_cartwheeling_medium_light_skin_tone:"],
  61427. "category": "activity"
  61428. },
  61429. ":man_cartwheeling_tone3:": {
  61430. "uc_base": "1f938-1f3fd-2642",
  61431. "uc_output": "1f938-1f3fd-200d-2642-fe0f",
  61432. "uc_match": "1f938-1f3fd-2642-fe0f",
  61433. "uc_greedy": "1f938-1f3fd-2642",
  61434. "shortnames": [":man_cartwheeling_medium_skin_tone:"],
  61435. "category": "activity"
  61436. },
  61437. ":man_cartwheeling_tone4:": {
  61438. "uc_base": "1f938-1f3fe-2642",
  61439. "uc_output": "1f938-1f3fe-200d-2642-fe0f",
  61440. "uc_match": "1f938-1f3fe-2642-fe0f",
  61441. "uc_greedy": "1f938-1f3fe-2642",
  61442. "shortnames": [":man_cartwheeling_medium_dark_skin_tone:"],
  61443. "category": "activity"
  61444. },
  61445. ":man_cartwheeling_tone5:": {
  61446. "uc_base": "1f938-1f3ff-2642",
  61447. "uc_output": "1f938-1f3ff-200d-2642-fe0f",
  61448. "uc_match": "1f938-1f3ff-2642-fe0f",
  61449. "uc_greedy": "1f938-1f3ff-2642",
  61450. "shortnames": [":man_cartwheeling_dark_skin_tone:"],
  61451. "category": "activity"
  61452. },
  61453. ":man_climbing_tone1:": {
  61454. "uc_base": "1f9d7-1f3fb-2642",
  61455. "uc_output": "1f9d7-1f3fb-200d-2642-fe0f",
  61456. "uc_match": "1f9d7-1f3fb-2642-fe0f",
  61457. "uc_greedy": "1f9d7-1f3fb-2642",
  61458. "shortnames": [":man_climbing_light_skin_tone:"],
  61459. "category": "activity"
  61460. },
  61461. ":man_climbing_tone2:": {
  61462. "uc_base": "1f9d7-1f3fc-2642",
  61463. "uc_output": "1f9d7-1f3fc-200d-2642-fe0f",
  61464. "uc_match": "1f9d7-1f3fc-2642-fe0f",
  61465. "uc_greedy": "1f9d7-1f3fc-2642",
  61466. "shortnames": [":man_climbing_medium_light_skin_tone:"],
  61467. "category": "activity"
  61468. },
  61469. ":man_climbing_tone3:": {
  61470. "uc_base": "1f9d7-1f3fd-2642",
  61471. "uc_output": "1f9d7-1f3fd-200d-2642-fe0f",
  61472. "uc_match": "1f9d7-1f3fd-2642-fe0f",
  61473. "uc_greedy": "1f9d7-1f3fd-2642",
  61474. "shortnames": [":man_climbing_medium_skin_tone:"],
  61475. "category": "activity"
  61476. },
  61477. ":man_climbing_tone4:": {
  61478. "uc_base": "1f9d7-1f3fe-2642",
  61479. "uc_output": "1f9d7-1f3fe-200d-2642-fe0f",
  61480. "uc_match": "1f9d7-1f3fe-2642-fe0f",
  61481. "uc_greedy": "1f9d7-1f3fe-2642",
  61482. "shortnames": [":man_climbing_medium_dark_skin_tone:"],
  61483. "category": "activity"
  61484. },
  61485. ":man_climbing_tone5:": {
  61486. "uc_base": "1f9d7-1f3ff-2642",
  61487. "uc_output": "1f9d7-1f3ff-200d-2642-fe0f",
  61488. "uc_match": "1f9d7-1f3ff-2642-fe0f",
  61489. "uc_greedy": "1f9d7-1f3ff-2642",
  61490. "shortnames": [":man_climbing_dark_skin_tone:"],
  61491. "category": "activity"
  61492. },
  61493. ":man_construction_worker_tone1:": {
  61494. "uc_base": "1f477-1f3fb-2642",
  61495. "uc_output": "1f477-1f3fb-200d-2642-fe0f",
  61496. "uc_match": "1f477-1f3fb-2642-fe0f",
  61497. "uc_greedy": "1f477-1f3fb-2642",
  61498. "shortnames": [":man_construction_worker_light_skin_tone:"],
  61499. "category": "people"
  61500. },
  61501. ":man_construction_worker_tone2:": {
  61502. "uc_base": "1f477-1f3fc-2642",
  61503. "uc_output": "1f477-1f3fc-200d-2642-fe0f",
  61504. "uc_match": "1f477-1f3fc-2642-fe0f",
  61505. "uc_greedy": "1f477-1f3fc-2642",
  61506. "shortnames": [":man_construction_worker_medium_light_skin_tone:"],
  61507. "category": "people"
  61508. },
  61509. ":man_construction_worker_tone3:": {
  61510. "uc_base": "1f477-1f3fd-2642",
  61511. "uc_output": "1f477-1f3fd-200d-2642-fe0f",
  61512. "uc_match": "1f477-1f3fd-2642-fe0f",
  61513. "uc_greedy": "1f477-1f3fd-2642",
  61514. "shortnames": [":man_construction_worker_medium_skin_tone:"],
  61515. "category": "people"
  61516. },
  61517. ":man_construction_worker_tone4:": {
  61518. "uc_base": "1f477-1f3fe-2642",
  61519. "uc_output": "1f477-1f3fe-200d-2642-fe0f",
  61520. "uc_match": "1f477-1f3fe-2642-fe0f",
  61521. "uc_greedy": "1f477-1f3fe-2642",
  61522. "shortnames": [":man_construction_worker_medium_dark_skin_tone:"],
  61523. "category": "people"
  61524. },
  61525. ":man_construction_worker_tone5:": {
  61526. "uc_base": "1f477-1f3ff-2642",
  61527. "uc_output": "1f477-1f3ff-200d-2642-fe0f",
  61528. "uc_match": "1f477-1f3ff-2642-fe0f",
  61529. "uc_greedy": "1f477-1f3ff-2642",
  61530. "shortnames": [":man_construction_worker_dark_skin_tone:"],
  61531. "category": "people"
  61532. },
  61533. ":man_detective_tone1:": {
  61534. "uc_base": "1f575-1f3fb-2642",
  61535. "uc_output": "1f575-1f3fb-200d-2642-fe0f",
  61536. "uc_match": "1f575-fe0f-1f3fb-2642-fe0f",
  61537. "uc_greedy": "1f575-1f3fb-2642",
  61538. "shortnames": [":man_detective_light_skin_tone:"],
  61539. "category": "people"
  61540. },
  61541. ":man_detective_tone2:": {
  61542. "uc_base": "1f575-1f3fc-2642",
  61543. "uc_output": "1f575-1f3fc-200d-2642-fe0f",
  61544. "uc_match": "1f575-fe0f-1f3fc-2642-fe0f",
  61545. "uc_greedy": "1f575-1f3fc-2642",
  61546. "shortnames": [":man_detective_medium_light_skin_tone:"],
  61547. "category": "people"
  61548. },
  61549. ":man_detective_tone3:": {
  61550. "uc_base": "1f575-1f3fd-2642",
  61551. "uc_output": "1f575-1f3fd-200d-2642-fe0f",
  61552. "uc_match": "1f575-fe0f-1f3fd-2642-fe0f",
  61553. "uc_greedy": "1f575-1f3fd-2642",
  61554. "shortnames": [":man_detective_medium_skin_tone:"],
  61555. "category": "people"
  61556. },
  61557. ":man_detective_tone4:": {
  61558. "uc_base": "1f575-1f3fe-2642",
  61559. "uc_output": "1f575-1f3fe-200d-2642-fe0f",
  61560. "uc_match": "1f575-fe0f-1f3fe-2642-fe0f",
  61561. "uc_greedy": "1f575-1f3fe-2642",
  61562. "shortnames": [":man_detective_medium_dark_skin_tone:"],
  61563. "category": "people"
  61564. },
  61565. ":man_detective_tone5:": {
  61566. "uc_base": "1f575-1f3ff-2642",
  61567. "uc_output": "1f575-1f3ff-200d-2642-fe0f",
  61568. "uc_match": "1f575-fe0f-1f3ff-2642-fe0f",
  61569. "uc_greedy": "1f575-1f3ff-2642",
  61570. "shortnames": [":man_detective_dark_skin_tone:"],
  61571. "category": "people"
  61572. },
  61573. ":man_elf_tone1:": {
  61574. "uc_base": "1f9dd-1f3fb-2642",
  61575. "uc_output": "1f9dd-1f3fb-200d-2642-fe0f",
  61576. "uc_match": "1f9dd-1f3fb-2642-fe0f",
  61577. "uc_greedy": "1f9dd-1f3fb-2642",
  61578. "shortnames": [":man_elf_light_skin_tone:"],
  61579. "category": "people"
  61580. },
  61581. ":man_elf_tone2:": {
  61582. "uc_base": "1f9dd-1f3fc-2642",
  61583. "uc_output": "1f9dd-1f3fc-200d-2642-fe0f",
  61584. "uc_match": "1f9dd-1f3fc-2642-fe0f",
  61585. "uc_greedy": "1f9dd-1f3fc-2642",
  61586. "shortnames": [":man_elf_medium_light_skin_tone:"],
  61587. "category": "people"
  61588. },
  61589. ":man_elf_tone3:": {
  61590. "uc_base": "1f9dd-1f3fd-2642",
  61591. "uc_output": "1f9dd-1f3fd-200d-2642-fe0f",
  61592. "uc_match": "1f9dd-1f3fd-2642-fe0f",
  61593. "uc_greedy": "1f9dd-1f3fd-2642",
  61594. "shortnames": [":man_elf_medium_skin_tone:"],
  61595. "category": "people"
  61596. },
  61597. ":man_elf_tone4:": {
  61598. "uc_base": "1f9dd-1f3fe-2642",
  61599. "uc_output": "1f9dd-1f3fe-200d-2642-fe0f",
  61600. "uc_match": "1f9dd-1f3fe-2642-fe0f",
  61601. "uc_greedy": "1f9dd-1f3fe-2642",
  61602. "shortnames": [":man_elf_medium_dark_skin_tone:"],
  61603. "category": "people"
  61604. },
  61605. ":man_elf_tone5:": {
  61606. "uc_base": "1f9dd-1f3ff-2642",
  61607. "uc_output": "1f9dd-1f3ff-200d-2642-fe0f",
  61608. "uc_match": "1f9dd-1f3ff-2642-fe0f",
  61609. "uc_greedy": "1f9dd-1f3ff-2642",
  61610. "shortnames": [":man_elf_dark_skin_tone:"],
  61611. "category": "people"
  61612. },
  61613. ":man_facepalming_tone1:": {
  61614. "uc_base": "1f926-1f3fb-2642",
  61615. "uc_output": "1f926-1f3fb-200d-2642-fe0f",
  61616. "uc_match": "1f926-1f3fb-2642-fe0f",
  61617. "uc_greedy": "1f926-1f3fb-2642",
  61618. "shortnames": [":man_facepalming_light_skin_tone:"],
  61619. "category": "people"
  61620. },
  61621. ":man_facepalming_tone2:": {
  61622. "uc_base": "1f926-1f3fc-2642",
  61623. "uc_output": "1f926-1f3fc-200d-2642-fe0f",
  61624. "uc_match": "1f926-1f3fc-2642-fe0f",
  61625. "uc_greedy": "1f926-1f3fc-2642",
  61626. "shortnames": [":man_facepalming_medium_light_skin_tone:"],
  61627. "category": "people"
  61628. },
  61629. ":man_facepalming_tone3:": {
  61630. "uc_base": "1f926-1f3fd-2642",
  61631. "uc_output": "1f926-1f3fd-200d-2642-fe0f",
  61632. "uc_match": "1f926-1f3fd-2642-fe0f",
  61633. "uc_greedy": "1f926-1f3fd-2642",
  61634. "shortnames": [":man_facepalming_medium_skin_tone:"],
  61635. "category": "people"
  61636. },
  61637. ":man_facepalming_tone4:": {
  61638. "uc_base": "1f926-1f3fe-2642",
  61639. "uc_output": "1f926-1f3fe-200d-2642-fe0f",
  61640. "uc_match": "1f926-1f3fe-2642-fe0f",
  61641. "uc_greedy": "1f926-1f3fe-2642",
  61642. "shortnames": [":man_facepalming_medium_dark_skin_tone:"],
  61643. "category": "people"
  61644. },
  61645. ":man_facepalming_tone5:": {
  61646. "uc_base": "1f926-1f3ff-2642",
  61647. "uc_output": "1f926-1f3ff-200d-2642-fe0f",
  61648. "uc_match": "1f926-1f3ff-2642-fe0f",
  61649. "uc_greedy": "1f926-1f3ff-2642",
  61650. "shortnames": [":man_facepalming_dark_skin_tone:"],
  61651. "category": "people"
  61652. },
  61653. ":man_fairy_tone1:": {
  61654. "uc_base": "1f9da-1f3fb-2642",
  61655. "uc_output": "1f9da-1f3fb-200d-2642-fe0f",
  61656. "uc_match": "1f9da-1f3fb-2642-fe0f",
  61657. "uc_greedy": "1f9da-1f3fb-2642",
  61658. "shortnames": [":man_fairy_light_skin_tone:"],
  61659. "category": "people"
  61660. },
  61661. ":man_fairy_tone2:": {
  61662. "uc_base": "1f9da-1f3fc-2642",
  61663. "uc_output": "1f9da-1f3fc-200d-2642-fe0f",
  61664. "uc_match": "1f9da-1f3fc-2642-fe0f",
  61665. "uc_greedy": "1f9da-1f3fc-2642",
  61666. "shortnames": [":man_fairy_medium_light_skin_tone:"],
  61667. "category": "people"
  61668. },
  61669. ":man_fairy_tone3:": {
  61670. "uc_base": "1f9da-1f3fd-2642",
  61671. "uc_output": "1f9da-1f3fd-200d-2642-fe0f",
  61672. "uc_match": "1f9da-1f3fd-2642-fe0f",
  61673. "uc_greedy": "1f9da-1f3fd-2642",
  61674. "shortnames": [":man_fairy_medium_skin_tone:"],
  61675. "category": "people"
  61676. },
  61677. ":man_fairy_tone4:": {
  61678. "uc_base": "1f9da-1f3fe-2642",
  61679. "uc_output": "1f9da-1f3fe-200d-2642-fe0f",
  61680. "uc_match": "1f9da-1f3fe-2642-fe0f",
  61681. "uc_greedy": "1f9da-1f3fe-2642",
  61682. "shortnames": [":man_fairy_medium_dark_skin_tone:"],
  61683. "category": "people"
  61684. },
  61685. ":man_fairy_tone5:": {
  61686. "uc_base": "1f9da-1f3ff-2642",
  61687. "uc_output": "1f9da-1f3ff-200d-2642-fe0f",
  61688. "uc_match": "1f9da-1f3ff-2642-fe0f",
  61689. "uc_greedy": "1f9da-1f3ff-2642",
  61690. "shortnames": [":man_fairy_dark_skin_tone:"],
  61691. "category": "people"
  61692. },
  61693. ":man_frowning_tone1:": {
  61694. "uc_base": "1f64d-1f3fb-2642",
  61695. "uc_output": "1f64d-1f3fb-200d-2642-fe0f",
  61696. "uc_match": "1f64d-1f3fb-2642-fe0f",
  61697. "uc_greedy": "1f64d-1f3fb-2642",
  61698. "shortnames": [":man_frowning_light_skin_tone:"],
  61699. "category": "people"
  61700. },
  61701. ":man_frowning_tone2:": {
  61702. "uc_base": "1f64d-1f3fc-2642",
  61703. "uc_output": "1f64d-1f3fc-200d-2642-fe0f",
  61704. "uc_match": "1f64d-1f3fc-2642-fe0f",
  61705. "uc_greedy": "1f64d-1f3fc-2642",
  61706. "shortnames": [":man_frowning_medium_light_skin_tone:"],
  61707. "category": "people"
  61708. },
  61709. ":man_frowning_tone3:": {
  61710. "uc_base": "1f64d-1f3fd-2642",
  61711. "uc_output": "1f64d-1f3fd-200d-2642-fe0f",
  61712. "uc_match": "1f64d-1f3fd-2642-fe0f",
  61713. "uc_greedy": "1f64d-1f3fd-2642",
  61714. "shortnames": [":man_frowning_medium_skin_tone:"],
  61715. "category": "people"
  61716. },
  61717. ":man_frowning_tone4:": {
  61718. "uc_base": "1f64d-1f3fe-2642",
  61719. "uc_output": "1f64d-1f3fe-200d-2642-fe0f",
  61720. "uc_match": "1f64d-1f3fe-2642-fe0f",
  61721. "uc_greedy": "1f64d-1f3fe-2642",
  61722. "shortnames": [":man_frowning_medium_dark_skin_tone:"],
  61723. "category": "people"
  61724. },
  61725. ":man_frowning_tone5:": {
  61726. "uc_base": "1f64d-1f3ff-2642",
  61727. "uc_output": "1f64d-1f3ff-200d-2642-fe0f",
  61728. "uc_match": "1f64d-1f3ff-2642-fe0f",
  61729. "uc_greedy": "1f64d-1f3ff-2642",
  61730. "shortnames": [":man_frowning_dark_skin_tone:"],
  61731. "category": "people"
  61732. },
  61733. ":man_gesturing_no_tone1:": {
  61734. "uc_base": "1f645-1f3fb-2642",
  61735. "uc_output": "1f645-1f3fb-200d-2642-fe0f",
  61736. "uc_match": "1f645-1f3fb-2642-fe0f",
  61737. "uc_greedy": "1f645-1f3fb-2642",
  61738. "shortnames": [":man_gesturing_no_light_skin_tone:"],
  61739. "category": "people"
  61740. },
  61741. ":man_gesturing_no_tone2:": {
  61742. "uc_base": "1f645-1f3fc-2642",
  61743. "uc_output": "1f645-1f3fc-200d-2642-fe0f",
  61744. "uc_match": "1f645-1f3fc-2642-fe0f",
  61745. "uc_greedy": "1f645-1f3fc-2642",
  61746. "shortnames": [":man_gesturing_no_medium_light_skin_tone:"],
  61747. "category": "people"
  61748. },
  61749. ":man_gesturing_no_tone3:": {
  61750. "uc_base": "1f645-1f3fd-2642",
  61751. "uc_output": "1f645-1f3fd-200d-2642-fe0f",
  61752. "uc_match": "1f645-1f3fd-2642-fe0f",
  61753. "uc_greedy": "1f645-1f3fd-2642",
  61754. "shortnames": [":man_gesturing_no_medium_skin_tone:"],
  61755. "category": "people"
  61756. },
  61757. ":man_gesturing_no_tone4:": {
  61758. "uc_base": "1f645-1f3fe-2642",
  61759. "uc_output": "1f645-1f3fe-200d-2642-fe0f",
  61760. "uc_match": "1f645-1f3fe-2642-fe0f",
  61761. "uc_greedy": "1f645-1f3fe-2642",
  61762. "shortnames": [":man_gesturing_no_medium_dark_skin_tone:"],
  61763. "category": "people"
  61764. },
  61765. ":man_gesturing_no_tone5:": {
  61766. "uc_base": "1f645-1f3ff-2642",
  61767. "uc_output": "1f645-1f3ff-200d-2642-fe0f",
  61768. "uc_match": "1f645-1f3ff-2642-fe0f",
  61769. "uc_greedy": "1f645-1f3ff-2642",
  61770. "shortnames": [":man_gesturing_no_dark_skin_tone:"],
  61771. "category": "people"
  61772. },
  61773. ":man_gesturing_ok_tone1:": {
  61774. "uc_base": "1f646-1f3fb-2642",
  61775. "uc_output": "1f646-1f3fb-200d-2642-fe0f",
  61776. "uc_match": "1f646-1f3fb-2642-fe0f",
  61777. "uc_greedy": "1f646-1f3fb-2642",
  61778. "shortnames": [":man_gesturing_ok_light_skin_tone:"],
  61779. "category": "people"
  61780. },
  61781. ":man_gesturing_ok_tone2:": {
  61782. "uc_base": "1f646-1f3fc-2642",
  61783. "uc_output": "1f646-1f3fc-200d-2642-fe0f",
  61784. "uc_match": "1f646-1f3fc-2642-fe0f",
  61785. "uc_greedy": "1f646-1f3fc-2642",
  61786. "shortnames": [":man_gesturing_ok_medium_light_skin_tone:"],
  61787. "category": "people"
  61788. },
  61789. ":man_gesturing_ok_tone3:": {
  61790. "uc_base": "1f646-1f3fd-2642",
  61791. "uc_output": "1f646-1f3fd-200d-2642-fe0f",
  61792. "uc_match": "1f646-1f3fd-2642-fe0f",
  61793. "uc_greedy": "1f646-1f3fd-2642",
  61794. "shortnames": [":man_gesturing_ok_medium_skin_tone:"],
  61795. "category": "people"
  61796. },
  61797. ":man_gesturing_ok_tone4:": {
  61798. "uc_base": "1f646-1f3fe-2642",
  61799. "uc_output": "1f646-1f3fe-200d-2642-fe0f",
  61800. "uc_match": "1f646-1f3fe-2642-fe0f",
  61801. "uc_greedy": "1f646-1f3fe-2642",
  61802. "shortnames": [":man_gesturing_ok_medium_dark_skin_tone:"],
  61803. "category": "people"
  61804. },
  61805. ":man_gesturing_ok_tone5:": {
  61806. "uc_base": "1f646-1f3ff-2642",
  61807. "uc_output": "1f646-1f3ff-200d-2642-fe0f",
  61808. "uc_match": "1f646-1f3ff-2642-fe0f",
  61809. "uc_greedy": "1f646-1f3ff-2642",
  61810. "shortnames": [":man_gesturing_ok_dark_skin_tone:"],
  61811. "category": "people"
  61812. },
  61813. ":man_getting_face_massage_tone1:": {
  61814. "uc_base": "1f486-1f3fb-2642",
  61815. "uc_output": "1f486-1f3fb-200d-2642-fe0f",
  61816. "uc_match": "1f486-1f3fb-2642-fe0f",
  61817. "uc_greedy": "1f486-1f3fb-2642",
  61818. "shortnames": [":man_getting_face_massage_light_skin_tone:"],
  61819. "category": "people"
  61820. },
  61821. ":man_getting_face_massage_tone2:": {
  61822. "uc_base": "1f486-1f3fc-2642",
  61823. "uc_output": "1f486-1f3fc-200d-2642-fe0f",
  61824. "uc_match": "1f486-1f3fc-2642-fe0f",
  61825. "uc_greedy": "1f486-1f3fc-2642",
  61826. "shortnames": [":man_getting_face_massage_medium_light_skin_tone:"],
  61827. "category": "people"
  61828. },
  61829. ":man_getting_face_massage_tone3:": {
  61830. "uc_base": "1f486-1f3fd-2642",
  61831. "uc_output": "1f486-1f3fd-200d-2642-fe0f",
  61832. "uc_match": "1f486-1f3fd-2642-fe0f",
  61833. "uc_greedy": "1f486-1f3fd-2642",
  61834. "shortnames": [":man_getting_face_massage_medium_skin_tone:"],
  61835. "category": "people"
  61836. },
  61837. ":man_getting_face_massage_tone4:": {
  61838. "uc_base": "1f486-1f3fe-2642",
  61839. "uc_output": "1f486-1f3fe-200d-2642-fe0f",
  61840. "uc_match": "1f486-1f3fe-2642-fe0f",
  61841. "uc_greedy": "1f486-1f3fe-2642",
  61842. "shortnames": [":man_getting_face_massage_medium_dark_skin_tone:"],
  61843. "category": "people"
  61844. },
  61845. ":man_getting_face_massage_tone5:": {
  61846. "uc_base": "1f486-1f3ff-2642",
  61847. "uc_output": "1f486-1f3ff-200d-2642-fe0f",
  61848. "uc_match": "1f486-1f3ff-2642-fe0f",
  61849. "uc_greedy": "1f486-1f3ff-2642",
  61850. "shortnames": [":man_getting_face_massage_dark_skin_tone:"],
  61851. "category": "people"
  61852. },
  61853. ":man_getting_haircut_tone1:": {
  61854. "uc_base": "1f487-1f3fb-2642",
  61855. "uc_output": "1f487-1f3fb-200d-2642-fe0f",
  61856. "uc_match": "1f487-1f3fb-2642-fe0f",
  61857. "uc_greedy": "1f487-1f3fb-2642",
  61858. "shortnames": [":man_getting_haircut_light_skin_tone:"],
  61859. "category": "people"
  61860. },
  61861. ":man_getting_haircut_tone2:": {
  61862. "uc_base": "1f487-1f3fc-2642",
  61863. "uc_output": "1f487-1f3fc-200d-2642-fe0f",
  61864. "uc_match": "1f487-1f3fc-2642-fe0f",
  61865. "uc_greedy": "1f487-1f3fc-2642",
  61866. "shortnames": [":man_getting_haircut_medium_light_skin_tone:"],
  61867. "category": "people"
  61868. },
  61869. ":man_getting_haircut_tone3:": {
  61870. "uc_base": "1f487-1f3fd-2642",
  61871. "uc_output": "1f487-1f3fd-200d-2642-fe0f",
  61872. "uc_match": "1f487-1f3fd-2642-fe0f",
  61873. "uc_greedy": "1f487-1f3fd-2642",
  61874. "shortnames": [":man_getting_haircut_medium_skin_tone:"],
  61875. "category": "people"
  61876. },
  61877. ":man_getting_haircut_tone4:": {
  61878. "uc_base": "1f487-1f3fe-2642",
  61879. "uc_output": "1f487-1f3fe-200d-2642-fe0f",
  61880. "uc_match": "1f487-1f3fe-2642-fe0f",
  61881. "uc_greedy": "1f487-1f3fe-2642",
  61882. "shortnames": [":man_getting_haircut_medium_dark_skin_tone:"],
  61883. "category": "people"
  61884. },
  61885. ":man_getting_haircut_tone5:": {
  61886. "uc_base": "1f487-1f3ff-2642",
  61887. "uc_output": "1f487-1f3ff-200d-2642-fe0f",
  61888. "uc_match": "1f487-1f3ff-2642-fe0f",
  61889. "uc_greedy": "1f487-1f3ff-2642",
  61890. "shortnames": [":man_getting_haircut_dark_skin_tone:"],
  61891. "category": "people"
  61892. },
  61893. ":man_golfing_tone1:": {
  61894. "uc_base": "1f3cc-1f3fb-2642",
  61895. "uc_output": "1f3cc-1f3fb-200d-2642-fe0f",
  61896. "uc_match": "1f3cc-fe0f-1f3fb-2642-fe0f",
  61897. "uc_greedy": "1f3cc-1f3fb-2642",
  61898. "shortnames": [":man_golfing_light_skin_tone:"],
  61899. "category": "activity"
  61900. },
  61901. ":man_golfing_tone2:": {
  61902. "uc_base": "1f3cc-1f3fc-2642",
  61903. "uc_output": "1f3cc-1f3fc-200d-2642-fe0f",
  61904. "uc_match": "1f3cc-fe0f-1f3fc-2642-fe0f",
  61905. "uc_greedy": "1f3cc-1f3fc-2642",
  61906. "shortnames": [":man_golfing_medium_light_skin_tone:"],
  61907. "category": "activity"
  61908. },
  61909. ":man_golfing_tone3:": {
  61910. "uc_base": "1f3cc-1f3fd-2642",
  61911. "uc_output": "1f3cc-1f3fd-200d-2642-fe0f",
  61912. "uc_match": "1f3cc-fe0f-1f3fd-2642-fe0f",
  61913. "uc_greedy": "1f3cc-1f3fd-2642",
  61914. "shortnames": [":man_golfing_medium_skin_tone:"],
  61915. "category": "activity"
  61916. },
  61917. ":man_golfing_tone4:": {
  61918. "uc_base": "1f3cc-1f3fe-2642",
  61919. "uc_output": "1f3cc-1f3fe-200d-2642-fe0f",
  61920. "uc_match": "1f3cc-fe0f-1f3fe-2642-fe0f",
  61921. "uc_greedy": "1f3cc-1f3fe-2642",
  61922. "shortnames": [":man_golfing_medium_dark_skin_tone:"],
  61923. "category": "activity"
  61924. },
  61925. ":man_golfing_tone5:": {
  61926. "uc_base": "1f3cc-1f3ff-2642",
  61927. "uc_output": "1f3cc-1f3ff-200d-2642-fe0f",
  61928. "uc_match": "1f3cc-fe0f-1f3ff-2642-fe0f",
  61929. "uc_greedy": "1f3cc-1f3ff-2642",
  61930. "shortnames": [":man_golfing_dark_skin_tone:"],
  61931. "category": "activity"
  61932. },
  61933. ":man_guard_tone1:": {
  61934. "uc_base": "1f482-1f3fb-2642",
  61935. "uc_output": "1f482-1f3fb-200d-2642-fe0f",
  61936. "uc_match": "1f482-1f3fb-2642-fe0f",
  61937. "uc_greedy": "1f482-1f3fb-2642",
  61938. "shortnames": [":man_guard_light_skin_tone:"],
  61939. "category": "people"
  61940. },
  61941. ":man_guard_tone2:": {
  61942. "uc_base": "1f482-1f3fc-2642",
  61943. "uc_output": "1f482-1f3fc-200d-2642-fe0f",
  61944. "uc_match": "1f482-1f3fc-2642-fe0f",
  61945. "uc_greedy": "1f482-1f3fc-2642",
  61946. "shortnames": [":man_guard_medium_light_skin_tone:"],
  61947. "category": "people"
  61948. },
  61949. ":man_guard_tone3:": {
  61950. "uc_base": "1f482-1f3fd-2642",
  61951. "uc_output": "1f482-1f3fd-200d-2642-fe0f",
  61952. "uc_match": "1f482-1f3fd-2642-fe0f",
  61953. "uc_greedy": "1f482-1f3fd-2642",
  61954. "shortnames": [":man_guard_medium_skin_tone:"],
  61955. "category": "people"
  61956. },
  61957. ":man_guard_tone4:": {
  61958. "uc_base": "1f482-1f3fe-2642",
  61959. "uc_output": "1f482-1f3fe-200d-2642-fe0f",
  61960. "uc_match": "1f482-1f3fe-2642-fe0f",
  61961. "uc_greedy": "1f482-1f3fe-2642",
  61962. "shortnames": [":man_guard_medium_dark_skin_tone:"],
  61963. "category": "people"
  61964. },
  61965. ":man_guard_tone5:": {
  61966. "uc_base": "1f482-1f3ff-2642",
  61967. "uc_output": "1f482-1f3ff-200d-2642-fe0f",
  61968. "uc_match": "1f482-1f3ff-2642-fe0f",
  61969. "uc_greedy": "1f482-1f3ff-2642",
  61970. "shortnames": [":man_guard_dark_skin_tone:"],
  61971. "category": "people"
  61972. },
  61973. ":man_health_worker_tone1:": {
  61974. "uc_base": "1f468-1f3fb-2695",
  61975. "uc_output": "1f468-1f3fb-200d-2695-fe0f",
  61976. "uc_match": "1f468-1f3fb-2695-fe0f",
  61977. "uc_greedy": "1f468-1f3fb-2695",
  61978. "shortnames": [":man_health_worker_light_skin_tone:"],
  61979. "category": "people"
  61980. },
  61981. ":man_health_worker_tone2:": {
  61982. "uc_base": "1f468-1f3fc-2695",
  61983. "uc_output": "1f468-1f3fc-200d-2695-fe0f",
  61984. "uc_match": "1f468-1f3fc-2695-fe0f",
  61985. "uc_greedy": "1f468-1f3fc-2695",
  61986. "shortnames": [":man_health_worker_medium_light_skin_tone:"],
  61987. "category": "people"
  61988. },
  61989. ":man_health_worker_tone3:": {
  61990. "uc_base": "1f468-1f3fd-2695",
  61991. "uc_output": "1f468-1f3fd-200d-2695-fe0f",
  61992. "uc_match": "1f468-1f3fd-2695-fe0f",
  61993. "uc_greedy": "1f468-1f3fd-2695",
  61994. "shortnames": [":man_health_worker_medium_skin_tone:"],
  61995. "category": "people"
  61996. },
  61997. ":man_health_worker_tone4:": {
  61998. "uc_base": "1f468-1f3fe-2695",
  61999. "uc_output": "1f468-1f3fe-200d-2695-fe0f",
  62000. "uc_match": "1f468-1f3fe-2695-fe0f",
  62001. "uc_greedy": "1f468-1f3fe-2695",
  62002. "shortnames": [":man_health_worker_medium_dark_skin_tone:"],
  62003. "category": "people"
  62004. },
  62005. ":man_health_worker_tone5:": {
  62006. "uc_base": "1f468-1f3ff-2695",
  62007. "uc_output": "1f468-1f3ff-200d-2695-fe0f",
  62008. "uc_match": "1f468-1f3ff-2695-fe0f",
  62009. "uc_greedy": "1f468-1f3ff-2695",
  62010. "shortnames": [":man_health_worker_dark_skin_tone:"],
  62011. "category": "people"
  62012. },
  62013. ":man_in_lotus_position_tone1:": {
  62014. "uc_base": "1f9d8-1f3fb-2642",
  62015. "uc_output": "1f9d8-1f3fb-200d-2642-fe0f",
  62016. "uc_match": "1f9d8-1f3fb-2642-fe0f",
  62017. "uc_greedy": "1f9d8-1f3fb-2642",
  62018. "shortnames": [":man_in_lotus_position_light_skin_tone:"],
  62019. "category": "activity"
  62020. },
  62021. ":man_in_lotus_position_tone2:": {
  62022. "uc_base": "1f9d8-1f3fc-2642",
  62023. "uc_output": "1f9d8-1f3fc-200d-2642-fe0f",
  62024. "uc_match": "1f9d8-1f3fc-2642-fe0f",
  62025. "uc_greedy": "1f9d8-1f3fc-2642",
  62026. "shortnames": [":man_in_lotus_position_medium_light_skin_tone:"],
  62027. "category": "activity"
  62028. },
  62029. ":man_in_lotus_position_tone3:": {
  62030. "uc_base": "1f9d8-1f3fd-2642",
  62031. "uc_output": "1f9d8-1f3fd-200d-2642-fe0f",
  62032. "uc_match": "1f9d8-1f3fd-2642-fe0f",
  62033. "uc_greedy": "1f9d8-1f3fd-2642",
  62034. "shortnames": [":man_in_lotus_position_medium_skin_tone:"],
  62035. "category": "activity"
  62036. },
  62037. ":man_in_lotus_position_tone4:": {
  62038. "uc_base": "1f9d8-1f3fe-2642",
  62039. "uc_output": "1f9d8-1f3fe-200d-2642-fe0f",
  62040. "uc_match": "1f9d8-1f3fe-2642-fe0f",
  62041. "uc_greedy": "1f9d8-1f3fe-2642",
  62042. "shortnames": [":man_in_lotus_position_medium_dark_skin_tone:"],
  62043. "category": "activity"
  62044. },
  62045. ":man_in_lotus_position_tone5:": {
  62046. "uc_base": "1f9d8-1f3ff-2642",
  62047. "uc_output": "1f9d8-1f3ff-200d-2642-fe0f",
  62048. "uc_match": "1f9d8-1f3ff-2642-fe0f",
  62049. "uc_greedy": "1f9d8-1f3ff-2642",
  62050. "shortnames": [":man_in_lotus_position_dark_skin_tone:"],
  62051. "category": "activity"
  62052. },
  62053. ":man_in_steamy_room_tone1:": {
  62054. "uc_base": "1f9d6-1f3fb-2642",
  62055. "uc_output": "1f9d6-1f3fb-200d-2642-fe0f",
  62056. "uc_match": "1f9d6-1f3fb-2642-fe0f",
  62057. "uc_greedy": "1f9d6-1f3fb-2642",
  62058. "shortnames": [":man_in_steamy_room_light_skin_tone:"],
  62059. "category": "people"
  62060. },
  62061. ":man_in_steamy_room_tone2:": {
  62062. "uc_base": "1f9d6-1f3fc-2642",
  62063. "uc_output": "1f9d6-1f3fc-200d-2642-fe0f",
  62064. "uc_match": "1f9d6-1f3fc-2642-fe0f",
  62065. "uc_greedy": "1f9d6-1f3fc-2642",
  62066. "shortnames": [":man_in_steamy_room_medium_light_skin_tone:"],
  62067. "category": "people"
  62068. },
  62069. ":man_in_steamy_room_tone3:": {
  62070. "uc_base": "1f9d6-1f3fd-2642",
  62071. "uc_output": "1f9d6-1f3fd-200d-2642-fe0f",
  62072. "uc_match": "1f9d6-1f3fd-2642-fe0f",
  62073. "uc_greedy": "1f9d6-1f3fd-2642",
  62074. "shortnames": [":man_in_steamy_room_medium_skin_tone:"],
  62075. "category": "people"
  62076. },
  62077. ":man_in_steamy_room_tone4:": {
  62078. "uc_base": "1f9d6-1f3fe-2642",
  62079. "uc_output": "1f9d6-1f3fe-200d-2642-fe0f",
  62080. "uc_match": "1f9d6-1f3fe-2642-fe0f",
  62081. "uc_greedy": "1f9d6-1f3fe-2642",
  62082. "shortnames": [":man_in_steamy_room_medium_dark_skin_tone:"],
  62083. "category": "people"
  62084. },
  62085. ":man_in_steamy_room_tone5:": {
  62086. "uc_base": "1f9d6-1f3ff-2642",
  62087. "uc_output": "1f9d6-1f3ff-200d-2642-fe0f",
  62088. "uc_match": "1f9d6-1f3ff-2642-fe0f",
  62089. "uc_greedy": "1f9d6-1f3ff-2642",
  62090. "shortnames": [":man_in_steamy_room_dark_skin_tone:"],
  62091. "category": "people"
  62092. },
  62093. ":man_judge_tone1:": {
  62094. "uc_base": "1f468-1f3fb-2696",
  62095. "uc_output": "1f468-1f3fb-200d-2696-fe0f",
  62096. "uc_match": "1f468-1f3fb-2696-fe0f",
  62097. "uc_greedy": "1f468-1f3fb-2696",
  62098. "shortnames": [":man_judge_light_skin_tone:"],
  62099. "category": "people"
  62100. },
  62101. ":man_judge_tone2:": {
  62102. "uc_base": "1f468-1f3fc-2696",
  62103. "uc_output": "1f468-1f3fc-200d-2696-fe0f",
  62104. "uc_match": "1f468-1f3fc-2696-fe0f",
  62105. "uc_greedy": "1f468-1f3fc-2696",
  62106. "shortnames": [":man_judge_medium_light_skin_tone:"],
  62107. "category": "people"
  62108. },
  62109. ":man_judge_tone3:": {
  62110. "uc_base": "1f468-1f3fd-2696",
  62111. "uc_output": "1f468-1f3fd-200d-2696-fe0f",
  62112. "uc_match": "1f468-1f3fd-2696-fe0f",
  62113. "uc_greedy": "1f468-1f3fd-2696",
  62114. "shortnames": [":man_judge_medium_skin_tone:"],
  62115. "category": "people"
  62116. },
  62117. ":man_judge_tone4:": {
  62118. "uc_base": "1f468-1f3fe-2696",
  62119. "uc_output": "1f468-1f3fe-200d-2696-fe0f",
  62120. "uc_match": "1f468-1f3fe-2696-fe0f",
  62121. "uc_greedy": "1f468-1f3fe-2696",
  62122. "shortnames": [":man_judge_medium_dark_skin_tone:"],
  62123. "category": "people"
  62124. },
  62125. ":man_judge_tone5:": {
  62126. "uc_base": "1f468-1f3ff-2696",
  62127. "uc_output": "1f468-1f3ff-200d-2696-fe0f",
  62128. "uc_match": "1f468-1f3ff-2696-fe0f",
  62129. "uc_greedy": "1f468-1f3ff-2696",
  62130. "shortnames": [":man_judge_dark_skin_tone:"],
  62131. "category": "people"
  62132. },
  62133. ":man_juggling_tone1:": {
  62134. "uc_base": "1f939-1f3fb-2642",
  62135. "uc_output": "1f939-1f3fb-200d-2642-fe0f",
  62136. "uc_match": "1f939-1f3fb-2642-fe0f",
  62137. "uc_greedy": "1f939-1f3fb-2642",
  62138. "shortnames": [":man_juggling_light_skin_tone:"],
  62139. "category": "activity"
  62140. },
  62141. ":man_juggling_tone2:": {
  62142. "uc_base": "1f939-1f3fc-2642",
  62143. "uc_output": "1f939-1f3fc-200d-2642-fe0f",
  62144. "uc_match": "1f939-1f3fc-2642-fe0f",
  62145. "uc_greedy": "1f939-1f3fc-2642",
  62146. "shortnames": [":man_juggling_medium_light_skin_tone:"],
  62147. "category": "activity"
  62148. },
  62149. ":man_juggling_tone3:": {
  62150. "uc_base": "1f939-1f3fd-2642",
  62151. "uc_output": "1f939-1f3fd-200d-2642-fe0f",
  62152. "uc_match": "1f939-1f3fd-2642-fe0f",
  62153. "uc_greedy": "1f939-1f3fd-2642",
  62154. "shortnames": [":man_juggling_medium_skin_tone:"],
  62155. "category": "activity"
  62156. },
  62157. ":man_juggling_tone4:": {
  62158. "uc_base": "1f939-1f3fe-2642",
  62159. "uc_output": "1f939-1f3fe-200d-2642-fe0f",
  62160. "uc_match": "1f939-1f3fe-2642-fe0f",
  62161. "uc_greedy": "1f939-1f3fe-2642",
  62162. "shortnames": [":man_juggling_medium_dark_skin_tone:"],
  62163. "category": "activity"
  62164. },
  62165. ":man_juggling_tone5:": {
  62166. "uc_base": "1f939-1f3ff-2642",
  62167. "uc_output": "1f939-1f3ff-200d-2642-fe0f",
  62168. "uc_match": "1f939-1f3ff-2642-fe0f",
  62169. "uc_greedy": "1f939-1f3ff-2642",
  62170. "shortnames": [":man_juggling_dark_skin_tone:"],
  62171. "category": "activity"
  62172. },
  62173. ":man_lifting_weights_tone1:": {
  62174. "uc_base": "1f3cb-1f3fb-2642",
  62175. "uc_output": "1f3cb-1f3fb-200d-2642-fe0f",
  62176. "uc_match": "1f3cb-fe0f-1f3fb-2642-fe0f",
  62177. "uc_greedy": "1f3cb-1f3fb-2642",
  62178. "shortnames": [":man_lifting_weights_light_skin_tone:"],
  62179. "category": "activity"
  62180. },
  62181. ":man_lifting_weights_tone2:": {
  62182. "uc_base": "1f3cb-1f3fc-2642",
  62183. "uc_output": "1f3cb-1f3fc-200d-2642-fe0f",
  62184. "uc_match": "1f3cb-fe0f-1f3fc-2642-fe0f",
  62185. "uc_greedy": "1f3cb-1f3fc-2642",
  62186. "shortnames": [":man_lifting_weights_medium_light_skin_tone:"],
  62187. "category": "activity"
  62188. },
  62189. ":man_lifting_weights_tone3:": {
  62190. "uc_base": "1f3cb-1f3fd-2642",
  62191. "uc_output": "1f3cb-1f3fd-200d-2642-fe0f",
  62192. "uc_match": "1f3cb-fe0f-1f3fd-2642-fe0f",
  62193. "uc_greedy": "1f3cb-1f3fd-2642",
  62194. "shortnames": [":man_lifting_weights_medium_skin_tone:"],
  62195. "category": "activity"
  62196. },
  62197. ":man_lifting_weights_tone4:": {
  62198. "uc_base": "1f3cb-1f3fe-2642",
  62199. "uc_output": "1f3cb-1f3fe-200d-2642-fe0f",
  62200. "uc_match": "1f3cb-fe0f-1f3fe-2642-fe0f",
  62201. "uc_greedy": "1f3cb-1f3fe-2642",
  62202. "shortnames": [":man_lifting_weights_medium_dark_skin_tone:"],
  62203. "category": "activity"
  62204. },
  62205. ":man_lifting_weights_tone5:": {
  62206. "uc_base": "1f3cb-1f3ff-2642",
  62207. "uc_output": "1f3cb-1f3ff-200d-2642-fe0f",
  62208. "uc_match": "1f3cb-fe0f-1f3ff-2642-fe0f",
  62209. "uc_greedy": "1f3cb-1f3ff-2642",
  62210. "shortnames": [":man_lifting_weights_dark_skin_tone:"],
  62211. "category": "activity"
  62212. },
  62213. ":man_mage_tone1:": {
  62214. "uc_base": "1f9d9-1f3fb-2642",
  62215. "uc_output": "1f9d9-1f3fb-200d-2642-fe0f",
  62216. "uc_match": "1f9d9-1f3fb-2642-fe0f",
  62217. "uc_greedy": "1f9d9-1f3fb-2642",
  62218. "shortnames": [":man_mage_light_skin_tone:"],
  62219. "category": "people"
  62220. },
  62221. ":man_mage_tone2:": {
  62222. "uc_base": "1f9d9-1f3fc-2642",
  62223. "uc_output": "1f9d9-1f3fc-200d-2642-fe0f",
  62224. "uc_match": "1f9d9-1f3fc-2642-fe0f",
  62225. "uc_greedy": "1f9d9-1f3fc-2642",
  62226. "shortnames": [":man_mage_medium_light_skin_tone:"],
  62227. "category": "people"
  62228. },
  62229. ":man_mage_tone3:": {
  62230. "uc_base": "1f9d9-1f3fd-2642",
  62231. "uc_output": "1f9d9-1f3fd-200d-2642-fe0f",
  62232. "uc_match": "1f9d9-1f3fd-2642-fe0f",
  62233. "uc_greedy": "1f9d9-1f3fd-2642",
  62234. "shortnames": [":man_mage_medium_skin_tone:"],
  62235. "category": "people"
  62236. },
  62237. ":man_mage_tone4:": {
  62238. "uc_base": "1f9d9-1f3fe-2642",
  62239. "uc_output": "1f9d9-1f3fe-200d-2642-fe0f",
  62240. "uc_match": "1f9d9-1f3fe-2642-fe0f",
  62241. "uc_greedy": "1f9d9-1f3fe-2642",
  62242. "shortnames": [":man_mage_medium_dark_skin_tone:"],
  62243. "category": "people"
  62244. },
  62245. ":man_mage_tone5:": {
  62246. "uc_base": "1f9d9-1f3ff-2642",
  62247. "uc_output": "1f9d9-1f3ff-200d-2642-fe0f",
  62248. "uc_match": "1f9d9-1f3ff-2642-fe0f",
  62249. "uc_greedy": "1f9d9-1f3ff-2642",
  62250. "shortnames": [":man_mage_dark_skin_tone:"],
  62251. "category": "people"
  62252. },
  62253. ":man_mountain_biking_tone1:": {
  62254. "uc_base": "1f6b5-1f3fb-2642",
  62255. "uc_output": "1f6b5-1f3fb-200d-2642-fe0f",
  62256. "uc_match": "1f6b5-1f3fb-2642-fe0f",
  62257. "uc_greedy": "1f6b5-1f3fb-2642",
  62258. "shortnames": [":man_mountain_biking_light_skin_tone:"],
  62259. "category": "activity"
  62260. },
  62261. ":man_mountain_biking_tone2:": {
  62262. "uc_base": "1f6b5-1f3fc-2642",
  62263. "uc_output": "1f6b5-1f3fc-200d-2642-fe0f",
  62264. "uc_match": "1f6b5-1f3fc-2642-fe0f",
  62265. "uc_greedy": "1f6b5-1f3fc-2642",
  62266. "shortnames": [":man_mountain_biking_medium_light_skin_tone:"],
  62267. "category": "activity"
  62268. },
  62269. ":man_mountain_biking_tone3:": {
  62270. "uc_base": "1f6b5-1f3fd-2642",
  62271. "uc_output": "1f6b5-1f3fd-200d-2642-fe0f",
  62272. "uc_match": "1f6b5-1f3fd-2642-fe0f",
  62273. "uc_greedy": "1f6b5-1f3fd-2642",
  62274. "shortnames": [":man_mountain_biking_medium_skin_tone:"],
  62275. "category": "activity"
  62276. },
  62277. ":man_mountain_biking_tone4:": {
  62278. "uc_base": "1f6b5-1f3fe-2642",
  62279. "uc_output": "1f6b5-1f3fe-200d-2642-fe0f",
  62280. "uc_match": "1f6b5-1f3fe-2642-fe0f",
  62281. "uc_greedy": "1f6b5-1f3fe-2642",
  62282. "shortnames": [":man_mountain_biking_medium_dark_skin_tone:"],
  62283. "category": "activity"
  62284. },
  62285. ":man_mountain_biking_tone5:": {
  62286. "uc_base": "1f6b5-1f3ff-2642",
  62287. "uc_output": "1f6b5-1f3ff-200d-2642-fe0f",
  62288. "uc_match": "1f6b5-1f3ff-2642-fe0f",
  62289. "uc_greedy": "1f6b5-1f3ff-2642",
  62290. "shortnames": [":man_mountain_biking_dark_skin_tone:"],
  62291. "category": "activity"
  62292. },
  62293. ":man_pilot_tone1:": {
  62294. "uc_base": "1f468-1f3fb-2708",
  62295. "uc_output": "1f468-1f3fb-200d-2708-fe0f",
  62296. "uc_match": "1f468-1f3fb-2708-fe0f",
  62297. "uc_greedy": "1f468-1f3fb-2708",
  62298. "shortnames": [":man_pilot_light_skin_tone:"],
  62299. "category": "people"
  62300. },
  62301. ":man_pilot_tone2:": {
  62302. "uc_base": "1f468-1f3fc-2708",
  62303. "uc_output": "1f468-1f3fc-200d-2708-fe0f",
  62304. "uc_match": "1f468-1f3fc-2708-fe0f",
  62305. "uc_greedy": "1f468-1f3fc-2708",
  62306. "shortnames": [":man_pilot_medium_light_skin_tone:"],
  62307. "category": "people"
  62308. },
  62309. ":man_pilot_tone3:": {
  62310. "uc_base": "1f468-1f3fd-2708",
  62311. "uc_output": "1f468-1f3fd-200d-2708-fe0f",
  62312. "uc_match": "1f468-1f3fd-2708-fe0f",
  62313. "uc_greedy": "1f468-1f3fd-2708",
  62314. "shortnames": [":man_pilot_medium_skin_tone:"],
  62315. "category": "people"
  62316. },
  62317. ":man_pilot_tone4:": {
  62318. "uc_base": "1f468-1f3fe-2708",
  62319. "uc_output": "1f468-1f3fe-200d-2708-fe0f",
  62320. "uc_match": "1f468-1f3fe-2708-fe0f",
  62321. "uc_greedy": "1f468-1f3fe-2708",
  62322. "shortnames": [":man_pilot_medium_dark_skin_tone:"],
  62323. "category": "people"
  62324. },
  62325. ":man_pilot_tone5:": {
  62326. "uc_base": "1f468-1f3ff-2708",
  62327. "uc_output": "1f468-1f3ff-200d-2708-fe0f",
  62328. "uc_match": "1f468-1f3ff-2708-fe0f",
  62329. "uc_greedy": "1f468-1f3ff-2708",
  62330. "shortnames": [":man_pilot_dark_skin_tone:"],
  62331. "category": "people"
  62332. },
  62333. ":man_playing_handball_tone1:": {
  62334. "uc_base": "1f93e-1f3fb-2642",
  62335. "uc_output": "1f93e-1f3fb-200d-2642-fe0f",
  62336. "uc_match": "1f93e-1f3fb-2642-fe0f",
  62337. "uc_greedy": "1f93e-1f3fb-2642",
  62338. "shortnames": [":man_playing_handball_light_skin_tone:"],
  62339. "category": "activity"
  62340. },
  62341. ":man_playing_handball_tone2:": {
  62342. "uc_base": "1f93e-1f3fc-2642",
  62343. "uc_output": "1f93e-1f3fc-200d-2642-fe0f",
  62344. "uc_match": "1f93e-1f3fc-2642-fe0f",
  62345. "uc_greedy": "1f93e-1f3fc-2642",
  62346. "shortnames": [":man_playing_handball_medium_light_skin_tone:"],
  62347. "category": "activity"
  62348. },
  62349. ":man_playing_handball_tone3:": {
  62350. "uc_base": "1f93e-1f3fd-2642",
  62351. "uc_output": "1f93e-1f3fd-200d-2642-fe0f",
  62352. "uc_match": "1f93e-1f3fd-2642-fe0f",
  62353. "uc_greedy": "1f93e-1f3fd-2642",
  62354. "shortnames": [":man_playing_handball_medium_skin_tone:"],
  62355. "category": "activity"
  62356. },
  62357. ":man_playing_handball_tone4:": {
  62358. "uc_base": "1f93e-1f3fe-2642",
  62359. "uc_output": "1f93e-1f3fe-200d-2642-fe0f",
  62360. "uc_match": "1f93e-1f3fe-2642-fe0f",
  62361. "uc_greedy": "1f93e-1f3fe-2642",
  62362. "shortnames": [":man_playing_handball_medium_dark_skin_tone:"],
  62363. "category": "activity"
  62364. },
  62365. ":man_playing_handball_tone5:": {
  62366. "uc_base": "1f93e-1f3ff-2642",
  62367. "uc_output": "1f93e-1f3ff-200d-2642-fe0f",
  62368. "uc_match": "1f93e-1f3ff-2642-fe0f",
  62369. "uc_greedy": "1f93e-1f3ff-2642",
  62370. "shortnames": [":man_playing_handball_dark_skin_tone:"],
  62371. "category": "activity"
  62372. },
  62373. ":man_playing_water_polo_tone1:": {
  62374. "uc_base": "1f93d-1f3fb-2642",
  62375. "uc_output": "1f93d-1f3fb-200d-2642-fe0f",
  62376. "uc_match": "1f93d-1f3fb-2642-fe0f",
  62377. "uc_greedy": "1f93d-1f3fb-2642",
  62378. "shortnames": [":man_playing_water_polo_light_skin_tone:"],
  62379. "category": "activity"
  62380. },
  62381. ":man_playing_water_polo_tone2:": {
  62382. "uc_base": "1f93d-1f3fc-2642",
  62383. "uc_output": "1f93d-1f3fc-200d-2642-fe0f",
  62384. "uc_match": "1f93d-1f3fc-2642-fe0f",
  62385. "uc_greedy": "1f93d-1f3fc-2642",
  62386. "shortnames": [":man_playing_water_polo_medium_light_skin_tone:"],
  62387. "category": "activity"
  62388. },
  62389. ":man_playing_water_polo_tone3:": {
  62390. "uc_base": "1f93d-1f3fd-2642",
  62391. "uc_output": "1f93d-1f3fd-200d-2642-fe0f",
  62392. "uc_match": "1f93d-1f3fd-2642-fe0f",
  62393. "uc_greedy": "1f93d-1f3fd-2642",
  62394. "shortnames": [":man_playing_water_polo_medium_skin_tone:"],
  62395. "category": "activity"
  62396. },
  62397. ":man_playing_water_polo_tone4:": {
  62398. "uc_base": "1f93d-1f3fe-2642",
  62399. "uc_output": "1f93d-1f3fe-200d-2642-fe0f",
  62400. "uc_match": "1f93d-1f3fe-2642-fe0f",
  62401. "uc_greedy": "1f93d-1f3fe-2642",
  62402. "shortnames": [":man_playing_water_polo_medium_dark_skin_tone:"],
  62403. "category": "activity"
  62404. },
  62405. ":man_playing_water_polo_tone5:": {
  62406. "uc_base": "1f93d-1f3ff-2642",
  62407. "uc_output": "1f93d-1f3ff-200d-2642-fe0f",
  62408. "uc_match": "1f93d-1f3ff-2642-fe0f",
  62409. "uc_greedy": "1f93d-1f3ff-2642",
  62410. "shortnames": [":man_playing_water_polo_dark_skin_tone:"],
  62411. "category": "activity"
  62412. },
  62413. ":man_police_officer_tone1:": {
  62414. "uc_base": "1f46e-1f3fb-2642",
  62415. "uc_output": "1f46e-1f3fb-200d-2642-fe0f",
  62416. "uc_match": "1f46e-1f3fb-2642-fe0f",
  62417. "uc_greedy": "1f46e-1f3fb-2642",
  62418. "shortnames": [":man_police_officer_light_skin_tone:"],
  62419. "category": "people"
  62420. },
  62421. ":man_police_officer_tone2:": {
  62422. "uc_base": "1f46e-1f3fc-2642",
  62423. "uc_output": "1f46e-1f3fc-200d-2642-fe0f",
  62424. "uc_match": "1f46e-1f3fc-2642-fe0f",
  62425. "uc_greedy": "1f46e-1f3fc-2642",
  62426. "shortnames": [":man_police_officer_medium_light_skin_tone:"],
  62427. "category": "people"
  62428. },
  62429. ":man_police_officer_tone3:": {
  62430. "uc_base": "1f46e-1f3fd-2642",
  62431. "uc_output": "1f46e-1f3fd-200d-2642-fe0f",
  62432. "uc_match": "1f46e-1f3fd-2642-fe0f",
  62433. "uc_greedy": "1f46e-1f3fd-2642",
  62434. "shortnames": [":man_police_officer_medium_skin_tone:"],
  62435. "category": "people"
  62436. },
  62437. ":man_police_officer_tone4:": {
  62438. "uc_base": "1f46e-1f3fe-2642",
  62439. "uc_output": "1f46e-1f3fe-200d-2642-fe0f",
  62440. "uc_match": "1f46e-1f3fe-2642-fe0f",
  62441. "uc_greedy": "1f46e-1f3fe-2642",
  62442. "shortnames": [":man_police_officer_medium_dark_skin_tone:"],
  62443. "category": "people"
  62444. },
  62445. ":man_police_officer_tone5:": {
  62446. "uc_base": "1f46e-1f3ff-2642",
  62447. "uc_output": "1f46e-1f3ff-200d-2642-fe0f",
  62448. "uc_match": "1f46e-1f3ff-2642-fe0f",
  62449. "uc_greedy": "1f46e-1f3ff-2642",
  62450. "shortnames": [":man_police_officer_dark_skin_tone:"],
  62451. "category": "people"
  62452. },
  62453. ":man_pouting_tone1:": {
  62454. "uc_base": "1f64e-1f3fb-2642",
  62455. "uc_output": "1f64e-1f3fb-200d-2642-fe0f",
  62456. "uc_match": "1f64e-1f3fb-2642-fe0f",
  62457. "uc_greedy": "1f64e-1f3fb-2642",
  62458. "shortnames": [":man_pouting_light_skin_tone:"],
  62459. "category": "people"
  62460. },
  62461. ":man_pouting_tone2:": {
  62462. "uc_base": "1f64e-1f3fc-2642",
  62463. "uc_output": "1f64e-1f3fc-200d-2642-fe0f",
  62464. "uc_match": "1f64e-1f3fc-2642-fe0f",
  62465. "uc_greedy": "1f64e-1f3fc-2642",
  62466. "shortnames": [":man_pouting_medium_light_skin_tone:"],
  62467. "category": "people"
  62468. },
  62469. ":man_pouting_tone3:": {
  62470. "uc_base": "1f64e-1f3fd-2642",
  62471. "uc_output": "1f64e-1f3fd-200d-2642-fe0f",
  62472. "uc_match": "1f64e-1f3fd-2642-fe0f",
  62473. "uc_greedy": "1f64e-1f3fd-2642",
  62474. "shortnames": [":man_pouting_medium_skin_tone:"],
  62475. "category": "people"
  62476. },
  62477. ":man_pouting_tone4:": {
  62478. "uc_base": "1f64e-1f3fe-2642",
  62479. "uc_output": "1f64e-1f3fe-200d-2642-fe0f",
  62480. "uc_match": "1f64e-1f3fe-2642-fe0f",
  62481. "uc_greedy": "1f64e-1f3fe-2642",
  62482. "shortnames": [":man_pouting_medium_dark_skin_tone:"],
  62483. "category": "people"
  62484. },
  62485. ":man_pouting_tone5:": {
  62486. "uc_base": "1f64e-1f3ff-2642",
  62487. "uc_output": "1f64e-1f3ff-200d-2642-fe0f",
  62488. "uc_match": "1f64e-1f3ff-2642-fe0f",
  62489. "uc_greedy": "1f64e-1f3ff-2642",
  62490. "shortnames": [":man_pouting_dark_skin_tone:"],
  62491. "category": "people"
  62492. },
  62493. ":man_raising_hand_tone1:": {
  62494. "uc_base": "1f64b-1f3fb-2642",
  62495. "uc_output": "1f64b-1f3fb-200d-2642-fe0f",
  62496. "uc_match": "1f64b-1f3fb-2642-fe0f",
  62497. "uc_greedy": "1f64b-1f3fb-2642",
  62498. "shortnames": [":man_raising_hand_light_skin_tone:"],
  62499. "category": "people"
  62500. },
  62501. ":man_raising_hand_tone2:": {
  62502. "uc_base": "1f64b-1f3fc-2642",
  62503. "uc_output": "1f64b-1f3fc-200d-2642-fe0f",
  62504. "uc_match": "1f64b-1f3fc-2642-fe0f",
  62505. "uc_greedy": "1f64b-1f3fc-2642",
  62506. "shortnames": [":man_raising_hand_medium_light_skin_tone:"],
  62507. "category": "people"
  62508. },
  62509. ":man_raising_hand_tone3:": {
  62510. "uc_base": "1f64b-1f3fd-2642",
  62511. "uc_output": "1f64b-1f3fd-200d-2642-fe0f",
  62512. "uc_match": "1f64b-1f3fd-2642-fe0f",
  62513. "uc_greedy": "1f64b-1f3fd-2642",
  62514. "shortnames": [":man_raising_hand_medium_skin_tone:"],
  62515. "category": "people"
  62516. },
  62517. ":man_raising_hand_tone4:": {
  62518. "uc_base": "1f64b-1f3fe-2642",
  62519. "uc_output": "1f64b-1f3fe-200d-2642-fe0f",
  62520. "uc_match": "1f64b-1f3fe-2642-fe0f",
  62521. "uc_greedy": "1f64b-1f3fe-2642",
  62522. "shortnames": [":man_raising_hand_medium_dark_skin_tone:"],
  62523. "category": "people"
  62524. },
  62525. ":man_raising_hand_tone5:": {
  62526. "uc_base": "1f64b-1f3ff-2642",
  62527. "uc_output": "1f64b-1f3ff-200d-2642-fe0f",
  62528. "uc_match": "1f64b-1f3ff-2642-fe0f",
  62529. "uc_greedy": "1f64b-1f3ff-2642",
  62530. "shortnames": [":man_raising_hand_dark_skin_tone:"],
  62531. "category": "people"
  62532. },
  62533. ":man_rowing_boat_tone1:": {
  62534. "uc_base": "1f6a3-1f3fb-2642",
  62535. "uc_output": "1f6a3-1f3fb-200d-2642-fe0f",
  62536. "uc_match": "1f6a3-1f3fb-2642-fe0f",
  62537. "uc_greedy": "1f6a3-1f3fb-2642",
  62538. "shortnames": [":man_rowing_boat_light_skin_tone:"],
  62539. "category": "activity"
  62540. },
  62541. ":man_rowing_boat_tone2:": {
  62542. "uc_base": "1f6a3-1f3fc-2642",
  62543. "uc_output": "1f6a3-1f3fc-200d-2642-fe0f",
  62544. "uc_match": "1f6a3-1f3fc-2642-fe0f",
  62545. "uc_greedy": "1f6a3-1f3fc-2642",
  62546. "shortnames": [":man_rowing_boat_medium_light_skin_tone:"],
  62547. "category": "activity"
  62548. },
  62549. ":man_rowing_boat_tone3:": {
  62550. "uc_base": "1f6a3-1f3fd-2642",
  62551. "uc_output": "1f6a3-1f3fd-200d-2642-fe0f",
  62552. "uc_match": "1f6a3-1f3fd-2642-fe0f",
  62553. "uc_greedy": "1f6a3-1f3fd-2642",
  62554. "shortnames": [":man_rowing_boat_medium_skin_tone:"],
  62555. "category": "activity"
  62556. },
  62557. ":man_rowing_boat_tone4:": {
  62558. "uc_base": "1f6a3-1f3fe-2642",
  62559. "uc_output": "1f6a3-1f3fe-200d-2642-fe0f",
  62560. "uc_match": "1f6a3-1f3fe-2642-fe0f",
  62561. "uc_greedy": "1f6a3-1f3fe-2642",
  62562. "shortnames": [":man_rowing_boat_medium_dark_skin_tone:"],
  62563. "category": "activity"
  62564. },
  62565. ":man_rowing_boat_tone5:": {
  62566. "uc_base": "1f6a3-1f3ff-2642",
  62567. "uc_output": "1f6a3-1f3ff-200d-2642-fe0f",
  62568. "uc_match": "1f6a3-1f3ff-2642-fe0f",
  62569. "uc_greedy": "1f6a3-1f3ff-2642",
  62570. "shortnames": [":man_rowing_boat_dark_skin_tone:"],
  62571. "category": "activity"
  62572. },
  62573. ":man_running_tone1:": {
  62574. "uc_base": "1f3c3-1f3fb-2642",
  62575. "uc_output": "1f3c3-1f3fb-200d-2642-fe0f",
  62576. "uc_match": "1f3c3-1f3fb-2642-fe0f",
  62577. "uc_greedy": "1f3c3-1f3fb-2642",
  62578. "shortnames": [":man_running_light_skin_tone:"],
  62579. "category": "people"
  62580. },
  62581. ":man_running_tone2:": {
  62582. "uc_base": "1f3c3-1f3fc-2642",
  62583. "uc_output": "1f3c3-1f3fc-200d-2642-fe0f",
  62584. "uc_match": "1f3c3-1f3fc-2642-fe0f",
  62585. "uc_greedy": "1f3c3-1f3fc-2642",
  62586. "shortnames": [":man_running_medium_light_skin_tone:"],
  62587. "category": "people"
  62588. },
  62589. ":man_running_tone3:": {
  62590. "uc_base": "1f3c3-1f3fd-2642",
  62591. "uc_output": "1f3c3-1f3fd-200d-2642-fe0f",
  62592. "uc_match": "1f3c3-1f3fd-2642-fe0f",
  62593. "uc_greedy": "1f3c3-1f3fd-2642",
  62594. "shortnames": [":man_running_medium_skin_tone:"],
  62595. "category": "people"
  62596. },
  62597. ":man_running_tone4:": {
  62598. "uc_base": "1f3c3-1f3fe-2642",
  62599. "uc_output": "1f3c3-1f3fe-200d-2642-fe0f",
  62600. "uc_match": "1f3c3-1f3fe-2642-fe0f",
  62601. "uc_greedy": "1f3c3-1f3fe-2642",
  62602. "shortnames": [":man_running_medium_dark_skin_tone:"],
  62603. "category": "people"
  62604. },
  62605. ":man_running_tone5:": {
  62606. "uc_base": "1f3c3-1f3ff-2642",
  62607. "uc_output": "1f3c3-1f3ff-200d-2642-fe0f",
  62608. "uc_match": "1f3c3-1f3ff-2642-fe0f",
  62609. "uc_greedy": "1f3c3-1f3ff-2642",
  62610. "shortnames": [":man_running_dark_skin_tone:"],
  62611. "category": "people"
  62612. },
  62613. ":man_shrugging_tone1:": {
  62614. "uc_base": "1f937-1f3fb-2642",
  62615. "uc_output": "1f937-1f3fb-200d-2642-fe0f",
  62616. "uc_match": "1f937-1f3fb-2642-fe0f",
  62617. "uc_greedy": "1f937-1f3fb-2642",
  62618. "shortnames": [":man_shrugging_light_skin_tone:"],
  62619. "category": "people"
  62620. },
  62621. ":man_shrugging_tone2:": {
  62622. "uc_base": "1f937-1f3fc-2642",
  62623. "uc_output": "1f937-1f3fc-200d-2642-fe0f",
  62624. "uc_match": "1f937-1f3fc-2642-fe0f",
  62625. "uc_greedy": "1f937-1f3fc-2642",
  62626. "shortnames": [":man_shrugging_medium_light_skin_tone:"],
  62627. "category": "people"
  62628. },
  62629. ":man_shrugging_tone3:": {
  62630. "uc_base": "1f937-1f3fd-2642",
  62631. "uc_output": "1f937-1f3fd-200d-2642-fe0f",
  62632. "uc_match": "1f937-1f3fd-2642-fe0f",
  62633. "uc_greedy": "1f937-1f3fd-2642",
  62634. "shortnames": [":man_shrugging_medium_skin_tone:"],
  62635. "category": "people"
  62636. },
  62637. ":man_shrugging_tone4:": {
  62638. "uc_base": "1f937-1f3fe-2642",
  62639. "uc_output": "1f937-1f3fe-200d-2642-fe0f",
  62640. "uc_match": "1f937-1f3fe-2642-fe0f",
  62641. "uc_greedy": "1f937-1f3fe-2642",
  62642. "shortnames": [":man_shrugging_medium_dark_skin_tone:"],
  62643. "category": "people"
  62644. },
  62645. ":man_shrugging_tone5:": {
  62646. "uc_base": "1f937-1f3ff-2642",
  62647. "uc_output": "1f937-1f3ff-200d-2642-fe0f",
  62648. "uc_match": "1f937-1f3ff-2642-fe0f",
  62649. "uc_greedy": "1f937-1f3ff-2642",
  62650. "shortnames": [":man_shrugging_dark_skin_tone:"],
  62651. "category": "people"
  62652. },
  62653. ":man_surfing_tone1:": {
  62654. "uc_base": "1f3c4-1f3fb-2642",
  62655. "uc_output": "1f3c4-1f3fb-200d-2642-fe0f",
  62656. "uc_match": "1f3c4-1f3fb-2642-fe0f",
  62657. "uc_greedy": "1f3c4-1f3fb-2642",
  62658. "shortnames": [":man_surfing_light_skin_tone:"],
  62659. "category": "activity"
  62660. },
  62661. ":man_surfing_tone2:": {
  62662. "uc_base": "1f3c4-1f3fc-2642",
  62663. "uc_output": "1f3c4-1f3fc-200d-2642-fe0f",
  62664. "uc_match": "1f3c4-1f3fc-2642-fe0f",
  62665. "uc_greedy": "1f3c4-1f3fc-2642",
  62666. "shortnames": [":man_surfing_medium_light_skin_tone:"],
  62667. "category": "activity"
  62668. },
  62669. ":man_surfing_tone3:": {
  62670. "uc_base": "1f3c4-1f3fd-2642",
  62671. "uc_output": "1f3c4-1f3fd-200d-2642-fe0f",
  62672. "uc_match": "1f3c4-1f3fd-2642-fe0f",
  62673. "uc_greedy": "1f3c4-1f3fd-2642",
  62674. "shortnames": [":man_surfing_medium_skin_tone:"],
  62675. "category": "activity"
  62676. },
  62677. ":man_surfing_tone4:": {
  62678. "uc_base": "1f3c4-1f3fe-2642",
  62679. "uc_output": "1f3c4-1f3fe-200d-2642-fe0f",
  62680. "uc_match": "1f3c4-1f3fe-2642-fe0f",
  62681. "uc_greedy": "1f3c4-1f3fe-2642",
  62682. "shortnames": [":man_surfing_medium_dark_skin_tone:"],
  62683. "category": "activity"
  62684. },
  62685. ":man_surfing_tone5:": {
  62686. "uc_base": "1f3c4-1f3ff-2642",
  62687. "uc_output": "1f3c4-1f3ff-200d-2642-fe0f",
  62688. "uc_match": "1f3c4-1f3ff-2642-fe0f",
  62689. "uc_greedy": "1f3c4-1f3ff-2642",
  62690. "shortnames": [":man_surfing_dark_skin_tone:"],
  62691. "category": "activity"
  62692. },
  62693. ":man_swimming_tone1:": {
  62694. "uc_base": "1f3ca-1f3fb-2642",
  62695. "uc_output": "1f3ca-1f3fb-200d-2642-fe0f",
  62696. "uc_match": "1f3ca-1f3fb-2642-fe0f",
  62697. "uc_greedy": "1f3ca-1f3fb-2642",
  62698. "shortnames": [":man_swimming_light_skin_tone:"],
  62699. "category": "activity"
  62700. },
  62701. ":man_swimming_tone2:": {
  62702. "uc_base": "1f3ca-1f3fc-2642",
  62703. "uc_output": "1f3ca-1f3fc-200d-2642-fe0f",
  62704. "uc_match": "1f3ca-1f3fc-2642-fe0f",
  62705. "uc_greedy": "1f3ca-1f3fc-2642",
  62706. "shortnames": [":man_swimming_medium_light_skin_tone:"],
  62707. "category": "activity"
  62708. },
  62709. ":man_swimming_tone3:": {
  62710. "uc_base": "1f3ca-1f3fd-2642",
  62711. "uc_output": "1f3ca-1f3fd-200d-2642-fe0f",
  62712. "uc_match": "1f3ca-1f3fd-2642-fe0f",
  62713. "uc_greedy": "1f3ca-1f3fd-2642",
  62714. "shortnames": [":man_swimming_medium_skin_tone:"],
  62715. "category": "activity"
  62716. },
  62717. ":man_swimming_tone4:": {
  62718. "uc_base": "1f3ca-1f3fe-2642",
  62719. "uc_output": "1f3ca-1f3fe-200d-2642-fe0f",
  62720. "uc_match": "1f3ca-1f3fe-2642-fe0f",
  62721. "uc_greedy": "1f3ca-1f3fe-2642",
  62722. "shortnames": [":man_swimming_medium_dark_skin_tone:"],
  62723. "category": "activity"
  62724. },
  62725. ":man_swimming_tone5:": {
  62726. "uc_base": "1f3ca-1f3ff-2642",
  62727. "uc_output": "1f3ca-1f3ff-200d-2642-fe0f",
  62728. "uc_match": "1f3ca-1f3ff-2642-fe0f",
  62729. "uc_greedy": "1f3ca-1f3ff-2642",
  62730. "shortnames": [":man_swimming_dark_skin_tone:"],
  62731. "category": "activity"
  62732. },
  62733. ":man_tipping_hand_tone1:": {
  62734. "uc_base": "1f481-1f3fb-2642",
  62735. "uc_output": "1f481-1f3fb-200d-2642-fe0f",
  62736. "uc_match": "1f481-1f3fb-2642-fe0f",
  62737. "uc_greedy": "1f481-1f3fb-2642",
  62738. "shortnames": [":man_tipping_hand_light_skin_tone:"],
  62739. "category": "people"
  62740. },
  62741. ":man_tipping_hand_tone2:": {
  62742. "uc_base": "1f481-1f3fc-2642",
  62743. "uc_output": "1f481-1f3fc-200d-2642-fe0f",
  62744. "uc_match": "1f481-1f3fc-2642-fe0f",
  62745. "uc_greedy": "1f481-1f3fc-2642",
  62746. "shortnames": [":man_tipping_hand_medium_light_skin_tone:"],
  62747. "category": "people"
  62748. },
  62749. ":man_tipping_hand_tone3:": {
  62750. "uc_base": "1f481-1f3fd-2642",
  62751. "uc_output": "1f481-1f3fd-200d-2642-fe0f",
  62752. "uc_match": "1f481-1f3fd-2642-fe0f",
  62753. "uc_greedy": "1f481-1f3fd-2642",
  62754. "shortnames": [":man_tipping_hand_medium_skin_tone:"],
  62755. "category": "people"
  62756. },
  62757. ":man_tipping_hand_tone4:": {
  62758. "uc_base": "1f481-1f3fe-2642",
  62759. "uc_output": "1f481-1f3fe-200d-2642-fe0f",
  62760. "uc_match": "1f481-1f3fe-2642-fe0f",
  62761. "uc_greedy": "1f481-1f3fe-2642",
  62762. "shortnames": [":man_tipping_hand_medium_dark_skin_tone:"],
  62763. "category": "people"
  62764. },
  62765. ":man_tipping_hand_tone5:": {
  62766. "uc_base": "1f481-1f3ff-2642",
  62767. "uc_output": "1f481-1f3ff-200d-2642-fe0f",
  62768. "uc_match": "1f481-1f3ff-2642-fe0f",
  62769. "uc_greedy": "1f481-1f3ff-2642",
  62770. "shortnames": [":man_tipping_hand_dark_skin_tone:"],
  62771. "category": "people"
  62772. },
  62773. ":man_vampire_tone1:": {
  62774. "uc_base": "1f9db-1f3fb-2642",
  62775. "uc_output": "1f9db-1f3fb-200d-2642-fe0f",
  62776. "uc_match": "1f9db-1f3fb-2642-fe0f",
  62777. "uc_greedy": "1f9db-1f3fb-2642",
  62778. "shortnames": [":man_vampire_light_skin_tone:"],
  62779. "category": "people"
  62780. },
  62781. ":man_vampire_tone2:": {
  62782. "uc_base": "1f9db-1f3fc-2642",
  62783. "uc_output": "1f9db-1f3fc-200d-2642-fe0f",
  62784. "uc_match": "1f9db-1f3fc-2642-fe0f",
  62785. "uc_greedy": "1f9db-1f3fc-2642",
  62786. "shortnames": [":man_vampire_medium_light_skin_tone:"],
  62787. "category": "people"
  62788. },
  62789. ":man_vampire_tone3:": {
  62790. "uc_base": "1f9db-1f3fd-2642",
  62791. "uc_output": "1f9db-1f3fd-200d-2642-fe0f",
  62792. "uc_match": "1f9db-1f3fd-2642-fe0f",
  62793. "uc_greedy": "1f9db-1f3fd-2642",
  62794. "shortnames": [":man_vampire_medium_skin_tone:"],
  62795. "category": "people"
  62796. },
  62797. ":man_vampire_tone4:": {
  62798. "uc_base": "1f9db-1f3fe-2642",
  62799. "uc_output": "1f9db-1f3fe-200d-2642-fe0f",
  62800. "uc_match": "1f9db-1f3fe-2642-fe0f",
  62801. "uc_greedy": "1f9db-1f3fe-2642",
  62802. "shortnames": [":man_vampire_medium_dark_skin_tone:"],
  62803. "category": "people"
  62804. },
  62805. ":man_vampire_tone5:": {
  62806. "uc_base": "1f9db-1f3ff-2642",
  62807. "uc_output": "1f9db-1f3ff-200d-2642-fe0f",
  62808. "uc_match": "1f9db-1f3ff-2642-fe0f",
  62809. "uc_greedy": "1f9db-1f3ff-2642",
  62810. "shortnames": [":man_vampire_dark_skin_tone:"],
  62811. "category": "people"
  62812. },
  62813. ":man_walking_tone1:": {
  62814. "uc_base": "1f6b6-1f3fb-2642",
  62815. "uc_output": "1f6b6-1f3fb-200d-2642-fe0f",
  62816. "uc_match": "1f6b6-1f3fb-2642-fe0f",
  62817. "uc_greedy": "1f6b6-1f3fb-2642",
  62818. "shortnames": [":man_walking_light_skin_tone:"],
  62819. "category": "people"
  62820. },
  62821. ":man_walking_tone2:": {
  62822. "uc_base": "1f6b6-1f3fc-2642",
  62823. "uc_output": "1f6b6-1f3fc-200d-2642-fe0f",
  62824. "uc_match": "1f6b6-1f3fc-2642-fe0f",
  62825. "uc_greedy": "1f6b6-1f3fc-2642",
  62826. "shortnames": [":man_walking_medium_light_skin_tone:"],
  62827. "category": "people"
  62828. },
  62829. ":man_walking_tone3:": {
  62830. "uc_base": "1f6b6-1f3fd-2642",
  62831. "uc_output": "1f6b6-1f3fd-200d-2642-fe0f",
  62832. "uc_match": "1f6b6-1f3fd-2642-fe0f",
  62833. "uc_greedy": "1f6b6-1f3fd-2642",
  62834. "shortnames": [":man_walking_medium_skin_tone:"],
  62835. "category": "people"
  62836. },
  62837. ":man_walking_tone4:": {
  62838. "uc_base": "1f6b6-1f3fe-2642",
  62839. "uc_output": "1f6b6-1f3fe-200d-2642-fe0f",
  62840. "uc_match": "1f6b6-1f3fe-2642-fe0f",
  62841. "uc_greedy": "1f6b6-1f3fe-2642",
  62842. "shortnames": [":man_walking_medium_dark_skin_tone:"],
  62843. "category": "people"
  62844. },
  62845. ":man_walking_tone5:": {
  62846. "uc_base": "1f6b6-1f3ff-2642",
  62847. "uc_output": "1f6b6-1f3ff-200d-2642-fe0f",
  62848. "uc_match": "1f6b6-1f3ff-2642-fe0f",
  62849. "uc_greedy": "1f6b6-1f3ff-2642",
  62850. "shortnames": [":man_walking_dark_skin_tone:"],
  62851. "category": "people"
  62852. },
  62853. ":man_wearing_turban_tone1:": {
  62854. "uc_base": "1f473-1f3fb-2642",
  62855. "uc_output": "1f473-1f3fb-200d-2642-fe0f",
  62856. "uc_match": "1f473-1f3fb-2642-fe0f",
  62857. "uc_greedy": "1f473-1f3fb-2642",
  62858. "shortnames": [":man_wearing_turban_light_skin_tone:"],
  62859. "category": "people"
  62860. },
  62861. ":man_wearing_turban_tone2:": {
  62862. "uc_base": "1f473-1f3fc-2642",
  62863. "uc_output": "1f473-1f3fc-200d-2642-fe0f",
  62864. "uc_match": "1f473-1f3fc-2642-fe0f",
  62865. "uc_greedy": "1f473-1f3fc-2642",
  62866. "shortnames": [":man_wearing_turban_medium_light_skin_tone:"],
  62867. "category": "people"
  62868. },
  62869. ":man_wearing_turban_tone3:": {
  62870. "uc_base": "1f473-1f3fd-2642",
  62871. "uc_output": "1f473-1f3fd-200d-2642-fe0f",
  62872. "uc_match": "1f473-1f3fd-2642-fe0f",
  62873. "uc_greedy": "1f473-1f3fd-2642",
  62874. "shortnames": [":man_wearing_turban_medium_skin_tone:"],
  62875. "category": "people"
  62876. },
  62877. ":man_wearing_turban_tone4:": {
  62878. "uc_base": "1f473-1f3fe-2642",
  62879. "uc_output": "1f473-1f3fe-200d-2642-fe0f",
  62880. "uc_match": "1f473-1f3fe-2642-fe0f",
  62881. "uc_greedy": "1f473-1f3fe-2642",
  62882. "shortnames": [":man_wearing_turban_medium_dark_skin_tone:"],
  62883. "category": "people"
  62884. },
  62885. ":man_wearing_turban_tone5:": {
  62886. "uc_base": "1f473-1f3ff-2642",
  62887. "uc_output": "1f473-1f3ff-200d-2642-fe0f",
  62888. "uc_match": "1f473-1f3ff-2642-fe0f",
  62889. "uc_greedy": "1f473-1f3ff-2642",
  62890. "shortnames": [":man_wearing_turban_dark_skin_tone:"],
  62891. "category": "people"
  62892. },
  62893. ":mermaid_tone1:": {
  62894. "uc_base": "1f9dc-1f3fb-2640",
  62895. "uc_output": "1f9dc-1f3fb-200d-2640-fe0f",
  62896. "uc_match": "1f9dc-1f3fb-2640-fe0f",
  62897. "uc_greedy": "1f9dc-1f3fb-2640",
  62898. "shortnames": [":mermaid_light_skin_tone:"],
  62899. "category": "people"
  62900. },
  62901. ":mermaid_tone2:": {
  62902. "uc_base": "1f9dc-1f3fc-2640",
  62903. "uc_output": "1f9dc-1f3fc-200d-2640-fe0f",
  62904. "uc_match": "1f9dc-1f3fc-2640-fe0f",
  62905. "uc_greedy": "1f9dc-1f3fc-2640",
  62906. "shortnames": [":mermaid_medium_light_skin_tone:"],
  62907. "category": "people"
  62908. },
  62909. ":mermaid_tone3:": {
  62910. "uc_base": "1f9dc-1f3fd-2640",
  62911. "uc_output": "1f9dc-1f3fd-200d-2640-fe0f",
  62912. "uc_match": "1f9dc-1f3fd-2640-fe0f",
  62913. "uc_greedy": "1f9dc-1f3fd-2640",
  62914. "shortnames": [":mermaid_medium_skin_tone:"],
  62915. "category": "people"
  62916. },
  62917. ":mermaid_tone4:": {
  62918. "uc_base": "1f9dc-1f3fe-2640",
  62919. "uc_output": "1f9dc-1f3fe-200d-2640-fe0f",
  62920. "uc_match": "1f9dc-1f3fe-2640-fe0f",
  62921. "uc_greedy": "1f9dc-1f3fe-2640",
  62922. "shortnames": [":mermaid_medium_dark_skin_tone:"],
  62923. "category": "people"
  62924. },
  62925. ":mermaid_tone5:": {
  62926. "uc_base": "1f9dc-1f3ff-2640",
  62927. "uc_output": "1f9dc-1f3ff-200d-2640-fe0f",
  62928. "uc_match": "1f9dc-1f3ff-2640-fe0f",
  62929. "uc_greedy": "1f9dc-1f3ff-2640",
  62930. "shortnames": [":mermaid_dark_skin_tone:"],
  62931. "category": "people"
  62932. },
  62933. ":merman_tone1:": {
  62934. "uc_base": "1f9dc-1f3fb-2642",
  62935. "uc_output": "1f9dc-1f3fb-200d-2642-fe0f",
  62936. "uc_match": "1f9dc-1f3fb-2642-fe0f",
  62937. "uc_greedy": "1f9dc-1f3fb-2642",
  62938. "shortnames": [":merman_light_skin_tone:"],
  62939. "category": "people"
  62940. },
  62941. ":merman_tone2:": {
  62942. "uc_base": "1f9dc-1f3fc-2642",
  62943. "uc_output": "1f9dc-1f3fc-200d-2642-fe0f",
  62944. "uc_match": "1f9dc-1f3fc-2642-fe0f",
  62945. "uc_greedy": "1f9dc-1f3fc-2642",
  62946. "shortnames": [":merman_medium_light_skin_tone:"],
  62947. "category": "people"
  62948. },
  62949. ":merman_tone3:": {
  62950. "uc_base": "1f9dc-1f3fd-2642",
  62951. "uc_output": "1f9dc-1f3fd-200d-2642-fe0f",
  62952. "uc_match": "1f9dc-1f3fd-2642-fe0f",
  62953. "uc_greedy": "1f9dc-1f3fd-2642",
  62954. "shortnames": [":merman_medium_skin_tone:"],
  62955. "category": "people"
  62956. },
  62957. ":merman_tone4:": {
  62958. "uc_base": "1f9dc-1f3fe-2642",
  62959. "uc_output": "1f9dc-1f3fe-200d-2642-fe0f",
  62960. "uc_match": "1f9dc-1f3fe-2642-fe0f",
  62961. "uc_greedy": "1f9dc-1f3fe-2642",
  62962. "shortnames": [":merman_medium_dark_skin_tone:"],
  62963. "category": "people"
  62964. },
  62965. ":merman_tone5:": {
  62966. "uc_base": "1f9dc-1f3ff-2642",
  62967. "uc_output": "1f9dc-1f3ff-200d-2642-fe0f",
  62968. "uc_match": "1f9dc-1f3ff-2642-fe0f",
  62969. "uc_greedy": "1f9dc-1f3ff-2642",
  62970. "shortnames": [":merman_dark_skin_tone:"],
  62971. "category": "people"
  62972. },
  62973. ":woman_biking_tone1:": {
  62974. "uc_base": "1f6b4-1f3fb-2640",
  62975. "uc_output": "1f6b4-1f3fb-200d-2640-fe0f",
  62976. "uc_match": "1f6b4-1f3fb-2640-fe0f",
  62977. "uc_greedy": "1f6b4-1f3fb-2640",
  62978. "shortnames": [":woman_biking_light_skin_tone:"],
  62979. "category": "activity"
  62980. },
  62981. ":woman_biking_tone2:": {
  62982. "uc_base": "1f6b4-1f3fc-2640",
  62983. "uc_output": "1f6b4-1f3fc-200d-2640-fe0f",
  62984. "uc_match": "1f6b4-1f3fc-2640-fe0f",
  62985. "uc_greedy": "1f6b4-1f3fc-2640",
  62986. "shortnames": [":woman_biking_medium_light_skin_tone:"],
  62987. "category": "activity"
  62988. },
  62989. ":woman_biking_tone3:": {
  62990. "uc_base": "1f6b4-1f3fd-2640",
  62991. "uc_output": "1f6b4-1f3fd-200d-2640-fe0f",
  62992. "uc_match": "1f6b4-1f3fd-2640-fe0f",
  62993. "uc_greedy": "1f6b4-1f3fd-2640",
  62994. "shortnames": [":woman_biking_medium_skin_tone:"],
  62995. "category": "activity"
  62996. },
  62997. ":woman_biking_tone4:": {
  62998. "uc_base": "1f6b4-1f3fe-2640",
  62999. "uc_output": "1f6b4-1f3fe-200d-2640-fe0f",
  63000. "uc_match": "1f6b4-1f3fe-2640-fe0f",
  63001. "uc_greedy": "1f6b4-1f3fe-2640",
  63002. "shortnames": [":woman_biking_medium_dark_skin_tone:"],
  63003. "category": "activity"
  63004. },
  63005. ":woman_biking_tone5:": {
  63006. "uc_base": "1f6b4-1f3ff-2640",
  63007. "uc_output": "1f6b4-1f3ff-200d-2640-fe0f",
  63008. "uc_match": "1f6b4-1f3ff-2640-fe0f",
  63009. "uc_greedy": "1f6b4-1f3ff-2640",
  63010. "shortnames": [":woman_biking_dark_skin_tone:"],
  63011. "category": "activity"
  63012. },
  63013. ":woman_bowing_tone1:": {
  63014. "uc_base": "1f647-1f3fb-2640",
  63015. "uc_output": "1f647-1f3fb-200d-2640-fe0f",
  63016. "uc_match": "1f647-1f3fb-2640-fe0f",
  63017. "uc_greedy": "1f647-1f3fb-2640",
  63018. "shortnames": [":woman_bowing_light_skin_tone:"],
  63019. "category": "people"
  63020. },
  63021. ":woman_bowing_tone2:": {
  63022. "uc_base": "1f647-1f3fc-2640",
  63023. "uc_output": "1f647-1f3fc-200d-2640-fe0f",
  63024. "uc_match": "1f647-1f3fc-2640-fe0f",
  63025. "uc_greedy": "1f647-1f3fc-2640",
  63026. "shortnames": [":woman_bowing_medium_light_skin_tone:"],
  63027. "category": "people"
  63028. },
  63029. ":woman_bowing_tone3:": {
  63030. "uc_base": "1f647-1f3fd-2640",
  63031. "uc_output": "1f647-1f3fd-200d-2640-fe0f",
  63032. "uc_match": "1f647-1f3fd-2640-fe0f",
  63033. "uc_greedy": "1f647-1f3fd-2640",
  63034. "shortnames": [":woman_bowing_medium_skin_tone:"],
  63035. "category": "people"
  63036. },
  63037. ":woman_bowing_tone4:": {
  63038. "uc_base": "1f647-1f3fe-2640",
  63039. "uc_output": "1f647-1f3fe-200d-2640-fe0f",
  63040. "uc_match": "1f647-1f3fe-2640-fe0f",
  63041. "uc_greedy": "1f647-1f3fe-2640",
  63042. "shortnames": [":woman_bowing_medium_dark_skin_tone:"],
  63043. "category": "people"
  63044. },
  63045. ":woman_bowing_tone5:": {
  63046. "uc_base": "1f647-1f3ff-2640",
  63047. "uc_output": "1f647-1f3ff-200d-2640-fe0f",
  63048. "uc_match": "1f647-1f3ff-2640-fe0f",
  63049. "uc_greedy": "1f647-1f3ff-2640",
  63050. "shortnames": [":woman_bowing_dark_skin_tone:"],
  63051. "category": "people"
  63052. },
  63053. ":woman_cartwheeling_tone1:": {
  63054. "uc_base": "1f938-1f3fb-2640",
  63055. "uc_output": "1f938-1f3fb-200d-2640-fe0f",
  63056. "uc_match": "1f938-1f3fb-2640-fe0f",
  63057. "uc_greedy": "1f938-1f3fb-2640",
  63058. "shortnames": [":woman_cartwheeling_light_skin_tone:"],
  63059. "category": "activity"
  63060. },
  63061. ":woman_cartwheeling_tone2:": {
  63062. "uc_base": "1f938-1f3fc-2640",
  63063. "uc_output": "1f938-1f3fc-200d-2640-fe0f",
  63064. "uc_match": "1f938-1f3fc-2640-fe0f",
  63065. "uc_greedy": "1f938-1f3fc-2640",
  63066. "shortnames": [":woman_cartwheeling_medium_light_skin_tone:"],
  63067. "category": "activity"
  63068. },
  63069. ":woman_cartwheeling_tone3:": {
  63070. "uc_base": "1f938-1f3fd-2640",
  63071. "uc_output": "1f938-1f3fd-200d-2640-fe0f",
  63072. "uc_match": "1f938-1f3fd-2640-fe0f",
  63073. "uc_greedy": "1f938-1f3fd-2640",
  63074. "shortnames": [":woman_cartwheeling_medium_skin_tone:"],
  63075. "category": "activity"
  63076. },
  63077. ":woman_cartwheeling_tone4:": {
  63078. "uc_base": "1f938-1f3fe-2640",
  63079. "uc_output": "1f938-1f3fe-200d-2640-fe0f",
  63080. "uc_match": "1f938-1f3fe-2640-fe0f",
  63081. "uc_greedy": "1f938-1f3fe-2640",
  63082. "shortnames": [":woman_cartwheeling_medium_dark_skin_tone:"],
  63083. "category": "activity"
  63084. },
  63085. ":woman_cartwheeling_tone5:": {
  63086. "uc_base": "1f938-1f3ff-2640",
  63087. "uc_output": "1f938-1f3ff-200d-2640-fe0f",
  63088. "uc_match": "1f938-1f3ff-2640-fe0f",
  63089. "uc_greedy": "1f938-1f3ff-2640",
  63090. "shortnames": [":woman_cartwheeling_dark_skin_tone:"],
  63091. "category": "activity"
  63092. },
  63093. ":woman_climbing_tone1:": {
  63094. "uc_base": "1f9d7-1f3fb-2640",
  63095. "uc_output": "1f9d7-1f3fb-200d-2640-fe0f",
  63096. "uc_match": "1f9d7-1f3fb-2640-fe0f",
  63097. "uc_greedy": "1f9d7-1f3fb-2640",
  63098. "shortnames": [":woman_climbing_light_skin_tone:"],
  63099. "category": "activity"
  63100. },
  63101. ":woman_climbing_tone2:": {
  63102. "uc_base": "1f9d7-1f3fc-2640",
  63103. "uc_output": "1f9d7-1f3fc-200d-2640-fe0f",
  63104. "uc_match": "1f9d7-1f3fc-2640-fe0f",
  63105. "uc_greedy": "1f9d7-1f3fc-2640",
  63106. "shortnames": [":woman_climbing_medium_light_skin_tone:"],
  63107. "category": "activity"
  63108. },
  63109. ":woman_climbing_tone3:": {
  63110. "uc_base": "1f9d7-1f3fd-2640",
  63111. "uc_output": "1f9d7-1f3fd-200d-2640-fe0f",
  63112. "uc_match": "1f9d7-1f3fd-2640-fe0f",
  63113. "uc_greedy": "1f9d7-1f3fd-2640",
  63114. "shortnames": [":woman_climbing_medium_skin_tone:"],
  63115. "category": "activity"
  63116. },
  63117. ":woman_climbing_tone4:": {
  63118. "uc_base": "1f9d7-1f3fe-2640",
  63119. "uc_output": "1f9d7-1f3fe-200d-2640-fe0f",
  63120. "uc_match": "1f9d7-1f3fe-2640-fe0f",
  63121. "uc_greedy": "1f9d7-1f3fe-2640",
  63122. "shortnames": [":woman_climbing_medium_dark_skin_tone:"],
  63123. "category": "activity"
  63124. },
  63125. ":woman_climbing_tone5:": {
  63126. "uc_base": "1f9d7-1f3ff-2640",
  63127. "uc_output": "1f9d7-1f3ff-200d-2640-fe0f",
  63128. "uc_match": "1f9d7-1f3ff-2640-fe0f",
  63129. "uc_greedy": "1f9d7-1f3ff-2640",
  63130. "shortnames": [":woman_climbing_dark_skin_tone:"],
  63131. "category": "activity"
  63132. },
  63133. ":woman_construction_worker_tone1:": {
  63134. "uc_base": "1f477-1f3fb-2640",
  63135. "uc_output": "1f477-1f3fb-200d-2640-fe0f",
  63136. "uc_match": "1f477-1f3fb-2640-fe0f",
  63137. "uc_greedy": "1f477-1f3fb-2640",
  63138. "shortnames": [":woman_construction_worker_light_skin_tone:"],
  63139. "category": "people"
  63140. },
  63141. ":woman_construction_worker_tone2:": {
  63142. "uc_base": "1f477-1f3fc-2640",
  63143. "uc_output": "1f477-1f3fc-200d-2640-fe0f",
  63144. "uc_match": "1f477-1f3fc-2640-fe0f",
  63145. "uc_greedy": "1f477-1f3fc-2640",
  63146. "shortnames": [":woman_construction_worker_medium_light_skin_tone:"],
  63147. "category": "people"
  63148. },
  63149. ":woman_construction_worker_tone3:": {
  63150. "uc_base": "1f477-1f3fd-2640",
  63151. "uc_output": "1f477-1f3fd-200d-2640-fe0f",
  63152. "uc_match": "1f477-1f3fd-2640-fe0f",
  63153. "uc_greedy": "1f477-1f3fd-2640",
  63154. "shortnames": [":woman_construction_worker_medium_skin_tone:"],
  63155. "category": "people"
  63156. },
  63157. ":woman_construction_worker_tone4:": {
  63158. "uc_base": "1f477-1f3fe-2640",
  63159. "uc_output": "1f477-1f3fe-200d-2640-fe0f",
  63160. "uc_match": "1f477-1f3fe-2640-fe0f",
  63161. "uc_greedy": "1f477-1f3fe-2640",
  63162. "shortnames": [":woman_construction_worker_medium_dark_skin_tone:"],
  63163. "category": "people"
  63164. },
  63165. ":woman_construction_worker_tone5:": {
  63166. "uc_base": "1f477-1f3ff-2640",
  63167. "uc_output": "1f477-1f3ff-200d-2640-fe0f",
  63168. "uc_match": "1f477-1f3ff-2640-fe0f",
  63169. "uc_greedy": "1f477-1f3ff-2640",
  63170. "shortnames": [":woman_construction_worker_dark_skin_tone:"],
  63171. "category": "people"
  63172. },
  63173. ":woman_detective_tone1:": {
  63174. "uc_base": "1f575-1f3fb-2640",
  63175. "uc_output": "1f575-1f3fb-200d-2640-fe0f",
  63176. "uc_match": "1f575-fe0f-1f3fb-2640-fe0f",
  63177. "uc_greedy": "1f575-1f3fb-2640",
  63178. "shortnames": [":woman_detective_light_skin_tone:"],
  63179. "category": "people"
  63180. },
  63181. ":woman_detective_tone2:": {
  63182. "uc_base": "1f575-1f3fc-2640",
  63183. "uc_output": "1f575-1f3fc-200d-2640-fe0f",
  63184. "uc_match": "1f575-fe0f-1f3fc-2640-fe0f",
  63185. "uc_greedy": "1f575-1f3fc-2640",
  63186. "shortnames": [":woman_detective_medium_light_skin_tone:"],
  63187. "category": "people"
  63188. },
  63189. ":woman_detective_tone3:": {
  63190. "uc_base": "1f575-1f3fd-2640",
  63191. "uc_output": "1f575-1f3fd-200d-2640-fe0f",
  63192. "uc_match": "1f575-fe0f-1f3fd-2640-fe0f",
  63193. "uc_greedy": "1f575-1f3fd-2640",
  63194. "shortnames": [":woman_detective_medium_skin_tone:"],
  63195. "category": "people"
  63196. },
  63197. ":woman_detective_tone4:": {
  63198. "uc_base": "1f575-1f3fe-2640",
  63199. "uc_output": "1f575-1f3fe-200d-2640-fe0f",
  63200. "uc_match": "1f575-fe0f-1f3fe-2640-fe0f",
  63201. "uc_greedy": "1f575-1f3fe-2640",
  63202. "shortnames": [":woman_detective_medium_dark_skin_tone:"],
  63203. "category": "people"
  63204. },
  63205. ":woman_detective_tone5:": {
  63206. "uc_base": "1f575-1f3ff-2640",
  63207. "uc_output": "1f575-1f3ff-200d-2640-fe0f",
  63208. "uc_match": "1f575-fe0f-1f3ff-2640-fe0f",
  63209. "uc_greedy": "1f575-1f3ff-2640",
  63210. "shortnames": [":woman_detective_dark_skin_tone:"],
  63211. "category": "people"
  63212. },
  63213. ":woman_elf_tone1:": {
  63214. "uc_base": "1f9dd-1f3fb-2640",
  63215. "uc_output": "1f9dd-1f3fb-200d-2640-fe0f",
  63216. "uc_match": "1f9dd-1f3fb-2640-fe0f",
  63217. "uc_greedy": "1f9dd-1f3fb-2640",
  63218. "shortnames": [":woman_elf_light_skin_tone:"],
  63219. "category": "people"
  63220. },
  63221. ":woman_elf_tone2:": {
  63222. "uc_base": "1f9dd-1f3fc-2640",
  63223. "uc_output": "1f9dd-1f3fc-200d-2640-fe0f",
  63224. "uc_match": "1f9dd-1f3fc-2640-fe0f",
  63225. "uc_greedy": "1f9dd-1f3fc-2640",
  63226. "shortnames": [":woman_elf_medium_light_skin_tone:"],
  63227. "category": "people"
  63228. },
  63229. ":woman_elf_tone3:": {
  63230. "uc_base": "1f9dd-1f3fd-2640",
  63231. "uc_output": "1f9dd-1f3fd-200d-2640-fe0f",
  63232. "uc_match": "1f9dd-1f3fd-2640-fe0f",
  63233. "uc_greedy": "1f9dd-1f3fd-2640",
  63234. "shortnames": [":woman_elf_medium_skin_tone:"],
  63235. "category": "people"
  63236. },
  63237. ":woman_elf_tone4:": {
  63238. "uc_base": "1f9dd-1f3fe-2640",
  63239. "uc_output": "1f9dd-1f3fe-200d-2640-fe0f",
  63240. "uc_match": "1f9dd-1f3fe-2640-fe0f",
  63241. "uc_greedy": "1f9dd-1f3fe-2640",
  63242. "shortnames": [":woman_elf_medium_dark_skin_tone:"],
  63243. "category": "people"
  63244. },
  63245. ":woman_elf_tone5:": {
  63246. "uc_base": "1f9dd-1f3ff-2640",
  63247. "uc_output": "1f9dd-1f3ff-200d-2640-fe0f",
  63248. "uc_match": "1f9dd-1f3ff-2640-fe0f",
  63249. "uc_greedy": "1f9dd-1f3ff-2640",
  63250. "shortnames": [":woman_elf_dark_skin_tone:"],
  63251. "category": "people"
  63252. },
  63253. ":woman_facepalming_tone1:": {
  63254. "uc_base": "1f926-1f3fb-2640",
  63255. "uc_output": "1f926-1f3fb-200d-2640-fe0f",
  63256. "uc_match": "1f926-1f3fb-2640-fe0f",
  63257. "uc_greedy": "1f926-1f3fb-2640",
  63258. "shortnames": [":woman_facepalming_light_skin_tone:"],
  63259. "category": "people"
  63260. },
  63261. ":woman_facepalming_tone2:": {
  63262. "uc_base": "1f926-1f3fc-2640",
  63263. "uc_output": "1f926-1f3fc-200d-2640-fe0f",
  63264. "uc_match": "1f926-1f3fc-2640-fe0f",
  63265. "uc_greedy": "1f926-1f3fc-2640",
  63266. "shortnames": [":woman_facepalming_medium_light_skin_tone:"],
  63267. "category": "people"
  63268. },
  63269. ":woman_facepalming_tone3:": {
  63270. "uc_base": "1f926-1f3fd-2640",
  63271. "uc_output": "1f926-1f3fd-200d-2640-fe0f",
  63272. "uc_match": "1f926-1f3fd-2640-fe0f",
  63273. "uc_greedy": "1f926-1f3fd-2640",
  63274. "shortnames": [":woman_facepalming_medium_skin_tone:"],
  63275. "category": "people"
  63276. },
  63277. ":woman_facepalming_tone4:": {
  63278. "uc_base": "1f926-1f3fe-2640",
  63279. "uc_output": "1f926-1f3fe-200d-2640-fe0f",
  63280. "uc_match": "1f926-1f3fe-2640-fe0f",
  63281. "uc_greedy": "1f926-1f3fe-2640",
  63282. "shortnames": [":woman_facepalming_medium_dark_skin_tone:"],
  63283. "category": "people"
  63284. },
  63285. ":woman_facepalming_tone5:": {
  63286. "uc_base": "1f926-1f3ff-2640",
  63287. "uc_output": "1f926-1f3ff-200d-2640-fe0f",
  63288. "uc_match": "1f926-1f3ff-2640-fe0f",
  63289. "uc_greedy": "1f926-1f3ff-2640",
  63290. "shortnames": [":woman_facepalming_dark_skin_tone:"],
  63291. "category": "people"
  63292. },
  63293. ":woman_fairy_tone1:": {
  63294. "uc_base": "1f9da-1f3fb-2640",
  63295. "uc_output": "1f9da-1f3fb-200d-2640-fe0f",
  63296. "uc_match": "1f9da-1f3fb-2640-fe0f",
  63297. "uc_greedy": "1f9da-1f3fb-2640",
  63298. "shortnames": [":woman_fairy_light_skin_tone:"],
  63299. "category": "people"
  63300. },
  63301. ":woman_fairy_tone2:": {
  63302. "uc_base": "1f9da-1f3fc-2640",
  63303. "uc_output": "1f9da-1f3fc-200d-2640-fe0f",
  63304. "uc_match": "1f9da-1f3fc-2640-fe0f",
  63305. "uc_greedy": "1f9da-1f3fc-2640",
  63306. "shortnames": [":woman_fairy_medium_light_skin_tone:"],
  63307. "category": "people"
  63308. },
  63309. ":woman_fairy_tone3:": {
  63310. "uc_base": "1f9da-1f3fd-2640",
  63311. "uc_output": "1f9da-1f3fd-200d-2640-fe0f",
  63312. "uc_match": "1f9da-1f3fd-2640-fe0f",
  63313. "uc_greedy": "1f9da-1f3fd-2640",
  63314. "shortnames": [":woman_fairy_medium_skin_tone:"],
  63315. "category": "people"
  63316. },
  63317. ":woman_fairy_tone4:": {
  63318. "uc_base": "1f9da-1f3fe-2640",
  63319. "uc_output": "1f9da-1f3fe-200d-2640-fe0f",
  63320. "uc_match": "1f9da-1f3fe-2640-fe0f",
  63321. "uc_greedy": "1f9da-1f3fe-2640",
  63322. "shortnames": [":woman_fairy_medium_dark_skin_tone:"],
  63323. "category": "people"
  63324. },
  63325. ":woman_fairy_tone5:": {
  63326. "uc_base": "1f9da-1f3ff-2640",
  63327. "uc_output": "1f9da-1f3ff-200d-2640-fe0f",
  63328. "uc_match": "1f9da-1f3ff-2640-fe0f",
  63329. "uc_greedy": "1f9da-1f3ff-2640",
  63330. "shortnames": [":woman_fairy_dark_skin_tone:"],
  63331. "category": "people"
  63332. },
  63333. ":woman_frowning_tone1:": {
  63334. "uc_base": "1f64d-1f3fb-2640",
  63335. "uc_output": "1f64d-1f3fb-200d-2640-fe0f",
  63336. "uc_match": "1f64d-1f3fb-2640-fe0f",
  63337. "uc_greedy": "1f64d-1f3fb-2640",
  63338. "shortnames": [":woman_frowning_light_skin_tone:"],
  63339. "category": "people"
  63340. },
  63341. ":woman_frowning_tone2:": {
  63342. "uc_base": "1f64d-1f3fc-2640",
  63343. "uc_output": "1f64d-1f3fc-200d-2640-fe0f",
  63344. "uc_match": "1f64d-1f3fc-2640-fe0f",
  63345. "uc_greedy": "1f64d-1f3fc-2640",
  63346. "shortnames": [":woman_frowning_medium_light_skin_tone:"],
  63347. "category": "people"
  63348. },
  63349. ":woman_frowning_tone3:": {
  63350. "uc_base": "1f64d-1f3fd-2640",
  63351. "uc_output": "1f64d-1f3fd-200d-2640-fe0f",
  63352. "uc_match": "1f64d-1f3fd-2640-fe0f",
  63353. "uc_greedy": "1f64d-1f3fd-2640",
  63354. "shortnames": [":woman_frowning_medium_skin_tone:"],
  63355. "category": "people"
  63356. },
  63357. ":woman_frowning_tone4:": {
  63358. "uc_base": "1f64d-1f3fe-2640",
  63359. "uc_output": "1f64d-1f3fe-200d-2640-fe0f",
  63360. "uc_match": "1f64d-1f3fe-2640-fe0f",
  63361. "uc_greedy": "1f64d-1f3fe-2640",
  63362. "shortnames": [":woman_frowning_medium_dark_skin_tone:"],
  63363. "category": "people"
  63364. },
  63365. ":woman_frowning_tone5:": {
  63366. "uc_base": "1f64d-1f3ff-2640",
  63367. "uc_output": "1f64d-1f3ff-200d-2640-fe0f",
  63368. "uc_match": "1f64d-1f3ff-2640-fe0f",
  63369. "uc_greedy": "1f64d-1f3ff-2640",
  63370. "shortnames": [":woman_frowning_dark_skin_tone:"],
  63371. "category": "people"
  63372. },
  63373. ":woman_gesturing_no_tone1:": {
  63374. "uc_base": "1f645-1f3fb-2640",
  63375. "uc_output": "1f645-1f3fb-200d-2640-fe0f",
  63376. "uc_match": "1f645-1f3fb-2640-fe0f",
  63377. "uc_greedy": "1f645-1f3fb-2640",
  63378. "shortnames": [":woman_gesturing_no_light_skin_tone:"],
  63379. "category": "people"
  63380. },
  63381. ":woman_gesturing_no_tone2:": {
  63382. "uc_base": "1f645-1f3fc-2640",
  63383. "uc_output": "1f645-1f3fc-200d-2640-fe0f",
  63384. "uc_match": "1f645-1f3fc-2640-fe0f",
  63385. "uc_greedy": "1f645-1f3fc-2640",
  63386. "shortnames": [":woman_gesturing_no_medium_light_skin_tone:"],
  63387. "category": "people"
  63388. },
  63389. ":woman_gesturing_no_tone3:": {
  63390. "uc_base": "1f645-1f3fd-2640",
  63391. "uc_output": "1f645-1f3fd-200d-2640-fe0f",
  63392. "uc_match": "1f645-1f3fd-2640-fe0f",
  63393. "uc_greedy": "1f645-1f3fd-2640",
  63394. "shortnames": [":woman_gesturing_no_medium_skin_tone:"],
  63395. "category": "people"
  63396. },
  63397. ":woman_gesturing_no_tone4:": {
  63398. "uc_base": "1f645-1f3fe-2640",
  63399. "uc_output": "1f645-1f3fe-200d-2640-fe0f",
  63400. "uc_match": "1f645-1f3fe-2640-fe0f",
  63401. "uc_greedy": "1f645-1f3fe-2640",
  63402. "shortnames": [":woman_gesturing_no_medium_dark_skin_tone:"],
  63403. "category": "people"
  63404. },
  63405. ":woman_gesturing_no_tone5:": {
  63406. "uc_base": "1f645-1f3ff-2640",
  63407. "uc_output": "1f645-1f3ff-200d-2640-fe0f",
  63408. "uc_match": "1f645-1f3ff-2640-fe0f",
  63409. "uc_greedy": "1f645-1f3ff-2640",
  63410. "shortnames": [":woman_gesturing_no_dark_skin_tone:"],
  63411. "category": "people"
  63412. },
  63413. ":woman_gesturing_ok_tone1:": {
  63414. "uc_base": "1f646-1f3fb-2640",
  63415. "uc_output": "1f646-1f3fb-200d-2640-fe0f",
  63416. "uc_match": "1f646-1f3fb-2640-fe0f",
  63417. "uc_greedy": "1f646-1f3fb-2640",
  63418. "shortnames": [":woman_gesturing_ok_light_skin_tone:"],
  63419. "category": "people"
  63420. },
  63421. ":woman_gesturing_ok_tone2:": {
  63422. "uc_base": "1f646-1f3fc-2640",
  63423. "uc_output": "1f646-1f3fc-200d-2640-fe0f",
  63424. "uc_match": "1f646-1f3fc-2640-fe0f",
  63425. "uc_greedy": "1f646-1f3fc-2640",
  63426. "shortnames": [":woman_gesturing_ok_medium_light_skin_tone:"],
  63427. "category": "people"
  63428. },
  63429. ":woman_gesturing_ok_tone3:": {
  63430. "uc_base": "1f646-1f3fd-2640",
  63431. "uc_output": "1f646-1f3fd-200d-2640-fe0f",
  63432. "uc_match": "1f646-1f3fd-2640-fe0f",
  63433. "uc_greedy": "1f646-1f3fd-2640",
  63434. "shortnames": [":woman_gesturing_ok_medium_skin_tone:"],
  63435. "category": "people"
  63436. },
  63437. ":woman_gesturing_ok_tone4:": {
  63438. "uc_base": "1f646-1f3fe-2640",
  63439. "uc_output": "1f646-1f3fe-200d-2640-fe0f",
  63440. "uc_match": "1f646-1f3fe-2640-fe0f",
  63441. "uc_greedy": "1f646-1f3fe-2640",
  63442. "shortnames": [":woman_gesturing_ok_medium_dark_skin_tone:"],
  63443. "category": "people"
  63444. },
  63445. ":woman_gesturing_ok_tone5:": {
  63446. "uc_base": "1f646-1f3ff-2640",
  63447. "uc_output": "1f646-1f3ff-200d-2640-fe0f",
  63448. "uc_match": "1f646-1f3ff-2640-fe0f",
  63449. "uc_greedy": "1f646-1f3ff-2640",
  63450. "shortnames": [":woman_gesturing_ok_dark_skin_tone:"],
  63451. "category": "people"
  63452. },
  63453. ":woman_getting_face_massage_tone1:": {
  63454. "uc_base": "1f486-1f3fb-2640",
  63455. "uc_output": "1f486-1f3fb-200d-2640-fe0f",
  63456. "uc_match": "1f486-1f3fb-2640-fe0f",
  63457. "uc_greedy": "1f486-1f3fb-2640",
  63458. "shortnames": [":woman_getting_face_massage_light_skin_tone:"],
  63459. "category": "people"
  63460. },
  63461. ":woman_getting_face_massage_tone2:": {
  63462. "uc_base": "1f486-1f3fc-2640",
  63463. "uc_output": "1f486-1f3fc-200d-2640-fe0f",
  63464. "uc_match": "1f486-1f3fc-2640-fe0f",
  63465. "uc_greedy": "1f486-1f3fc-2640",
  63466. "shortnames": [":woman_getting_face_massage_medium_light_skin_tone:"],
  63467. "category": "people"
  63468. },
  63469. ":woman_getting_face_massage_tone3:": {
  63470. "uc_base": "1f486-1f3fd-2640",
  63471. "uc_output": "1f486-1f3fd-200d-2640-fe0f",
  63472. "uc_match": "1f486-1f3fd-2640-fe0f",
  63473. "uc_greedy": "1f486-1f3fd-2640",
  63474. "shortnames": [":woman_getting_face_massage_medium_skin_tone:"],
  63475. "category": "people"
  63476. },
  63477. ":woman_getting_face_massage_tone4:": {
  63478. "uc_base": "1f486-1f3fe-2640",
  63479. "uc_output": "1f486-1f3fe-200d-2640-fe0f",
  63480. "uc_match": "1f486-1f3fe-2640-fe0f",
  63481. "uc_greedy": "1f486-1f3fe-2640",
  63482. "shortnames": [":woman_getting_face_massage_medium_dark_skin_tone:"],
  63483. "category": "people"
  63484. },
  63485. ":woman_getting_face_massage_tone5:": {
  63486. "uc_base": "1f486-1f3ff-2640",
  63487. "uc_output": "1f486-1f3ff-200d-2640-fe0f",
  63488. "uc_match": "1f486-1f3ff-2640-fe0f",
  63489. "uc_greedy": "1f486-1f3ff-2640",
  63490. "shortnames": [":woman_getting_face_massage_dark_skin_tone:"],
  63491. "category": "people"
  63492. },
  63493. ":woman_getting_haircut_tone1:": {
  63494. "uc_base": "1f487-1f3fb-2640",
  63495. "uc_output": "1f487-1f3fb-200d-2640-fe0f",
  63496. "uc_match": "1f487-1f3fb-2640-fe0f",
  63497. "uc_greedy": "1f487-1f3fb-2640",
  63498. "shortnames": [":woman_getting_haircut_light_skin_tone:"],
  63499. "category": "people"
  63500. },
  63501. ":woman_getting_haircut_tone2:": {
  63502. "uc_base": "1f487-1f3fc-2640",
  63503. "uc_output": "1f487-1f3fc-200d-2640-fe0f",
  63504. "uc_match": "1f487-1f3fc-2640-fe0f",
  63505. "uc_greedy": "1f487-1f3fc-2640",
  63506. "shortnames": [":woman_getting_haircut_medium_light_skin_tone:"],
  63507. "category": "people"
  63508. },
  63509. ":woman_getting_haircut_tone3:": {
  63510. "uc_base": "1f487-1f3fd-2640",
  63511. "uc_output": "1f487-1f3fd-200d-2640-fe0f",
  63512. "uc_match": "1f487-1f3fd-2640-fe0f",
  63513. "uc_greedy": "1f487-1f3fd-2640",
  63514. "shortnames": [":woman_getting_haircut_medium_skin_tone:"],
  63515. "category": "people"
  63516. },
  63517. ":woman_getting_haircut_tone4:": {
  63518. "uc_base": "1f487-1f3fe-2640",
  63519. "uc_output": "1f487-1f3fe-200d-2640-fe0f",
  63520. "uc_match": "1f487-1f3fe-2640-fe0f",
  63521. "uc_greedy": "1f487-1f3fe-2640",
  63522. "shortnames": [":woman_getting_haircut_medium_dark_skin_tone:"],
  63523. "category": "people"
  63524. },
  63525. ":woman_getting_haircut_tone5:": {
  63526. "uc_base": "1f487-1f3ff-2640",
  63527. "uc_output": "1f487-1f3ff-200d-2640-fe0f",
  63528. "uc_match": "1f487-1f3ff-2640-fe0f",
  63529. "uc_greedy": "1f487-1f3ff-2640",
  63530. "shortnames": [":woman_getting_haircut_dark_skin_tone:"],
  63531. "category": "people"
  63532. },
  63533. ":woman_golfing_tone1:": {
  63534. "uc_base": "1f3cc-1f3fb-2640",
  63535. "uc_output": "1f3cc-1f3fb-200d-2640-fe0f",
  63536. "uc_match": "1f3cc-fe0f-1f3fb-2640-fe0f",
  63537. "uc_greedy": "1f3cc-1f3fb-2640",
  63538. "shortnames": [":woman_golfing_light_skin_tone:"],
  63539. "category": "activity"
  63540. },
  63541. ":woman_golfing_tone2:": {
  63542. "uc_base": "1f3cc-1f3fc-2640",
  63543. "uc_output": "1f3cc-1f3fc-200d-2640-fe0f",
  63544. "uc_match": "1f3cc-fe0f-1f3fc-2640-fe0f",
  63545. "uc_greedy": "1f3cc-1f3fc-2640",
  63546. "shortnames": [":woman_golfing_medium_light_skin_tone:"],
  63547. "category": "activity"
  63548. },
  63549. ":woman_golfing_tone3:": {
  63550. "uc_base": "1f3cc-1f3fd-2640",
  63551. "uc_output": "1f3cc-1f3fd-200d-2640-fe0f",
  63552. "uc_match": "1f3cc-fe0f-1f3fd-2640-fe0f",
  63553. "uc_greedy": "1f3cc-1f3fd-2640",
  63554. "shortnames": [":woman_golfing_medium_skin_tone:"],
  63555. "category": "activity"
  63556. },
  63557. ":woman_golfing_tone4:": {
  63558. "uc_base": "1f3cc-1f3fe-2640",
  63559. "uc_output": "1f3cc-1f3fe-200d-2640-fe0f",
  63560. "uc_match": "1f3cc-fe0f-1f3fe-2640-fe0f",
  63561. "uc_greedy": "1f3cc-1f3fe-2640",
  63562. "shortnames": [":woman_golfing_medium_dark_skin_tone:"],
  63563. "category": "activity"
  63564. },
  63565. ":woman_golfing_tone5:": {
  63566. "uc_base": "1f3cc-1f3ff-2640",
  63567. "uc_output": "1f3cc-1f3ff-200d-2640-fe0f",
  63568. "uc_match": "1f3cc-fe0f-1f3ff-2640-fe0f",
  63569. "uc_greedy": "1f3cc-1f3ff-2640",
  63570. "shortnames": [":woman_golfing_dark_skin_tone:"],
  63571. "category": "activity"
  63572. },
  63573. ":woman_guard_tone1:": {
  63574. "uc_base": "1f482-1f3fb-2640",
  63575. "uc_output": "1f482-1f3fb-200d-2640-fe0f",
  63576. "uc_match": "1f482-1f3fb-2640-fe0f",
  63577. "uc_greedy": "1f482-1f3fb-2640",
  63578. "shortnames": [":woman_guard_light_skin_tone:"],
  63579. "category": "people"
  63580. },
  63581. ":woman_guard_tone2:": {
  63582. "uc_base": "1f482-1f3fc-2640",
  63583. "uc_output": "1f482-1f3fc-200d-2640-fe0f",
  63584. "uc_match": "1f482-1f3fc-2640-fe0f",
  63585. "uc_greedy": "1f482-1f3fc-2640",
  63586. "shortnames": [":woman_guard_medium_light_skin_tone:"],
  63587. "category": "people"
  63588. },
  63589. ":woman_guard_tone3:": {
  63590. "uc_base": "1f482-1f3fd-2640",
  63591. "uc_output": "1f482-1f3fd-200d-2640-fe0f",
  63592. "uc_match": "1f482-1f3fd-2640-fe0f",
  63593. "uc_greedy": "1f482-1f3fd-2640",
  63594. "shortnames": [":woman_guard_medium_skin_tone:"],
  63595. "category": "people"
  63596. },
  63597. ":woman_guard_tone4:": {
  63598. "uc_base": "1f482-1f3fe-2640",
  63599. "uc_output": "1f482-1f3fe-200d-2640-fe0f",
  63600. "uc_match": "1f482-1f3fe-2640-fe0f",
  63601. "uc_greedy": "1f482-1f3fe-2640",
  63602. "shortnames": [":woman_guard_medium_dark_skin_tone:"],
  63603. "category": "people"
  63604. },
  63605. ":woman_guard_tone5:": {
  63606. "uc_base": "1f482-1f3ff-2640",
  63607. "uc_output": "1f482-1f3ff-200d-2640-fe0f",
  63608. "uc_match": "1f482-1f3ff-2640-fe0f",
  63609. "uc_greedy": "1f482-1f3ff-2640",
  63610. "shortnames": [":woman_guard_dark_skin_tone:"],
  63611. "category": "people"
  63612. },
  63613. ":woman_health_worker_tone1:": {
  63614. "uc_base": "1f469-1f3fb-2695",
  63615. "uc_output": "1f469-1f3fb-200d-2695-fe0f",
  63616. "uc_match": "1f469-1f3fb-2695-fe0f",
  63617. "uc_greedy": "1f469-1f3fb-2695",
  63618. "shortnames": [":woman_health_worker_light_skin_tone:"],
  63619. "category": "people"
  63620. },
  63621. ":woman_health_worker_tone2:": {
  63622. "uc_base": "1f469-1f3fc-2695",
  63623. "uc_output": "1f469-1f3fc-200d-2695-fe0f",
  63624. "uc_match": "1f469-1f3fc-2695-fe0f",
  63625. "uc_greedy": "1f469-1f3fc-2695",
  63626. "shortnames": [":woman_health_worker_medium_light_skin_tone:"],
  63627. "category": "people"
  63628. },
  63629. ":woman_health_worker_tone3:": {
  63630. "uc_base": "1f469-1f3fd-2695",
  63631. "uc_output": "1f469-1f3fd-200d-2695-fe0f",
  63632. "uc_match": "1f469-1f3fd-2695-fe0f",
  63633. "uc_greedy": "1f469-1f3fd-2695",
  63634. "shortnames": [":woman_health_worker_medium_skin_tone:"],
  63635. "category": "people"
  63636. },
  63637. ":woman_health_worker_tone4:": {
  63638. "uc_base": "1f469-1f3fe-2695",
  63639. "uc_output": "1f469-1f3fe-200d-2695-fe0f",
  63640. "uc_match": "1f469-1f3fe-2695-fe0f",
  63641. "uc_greedy": "1f469-1f3fe-2695",
  63642. "shortnames": [":woman_health_worker_medium_dark_skin_tone:"],
  63643. "category": "people"
  63644. },
  63645. ":woman_health_worker_tone5:": {
  63646. "uc_base": "1f469-1f3ff-2695",
  63647. "uc_output": "1f469-1f3ff-200d-2695-fe0f",
  63648. "uc_match": "1f469-1f3ff-2695-fe0f",
  63649. "uc_greedy": "1f469-1f3ff-2695",
  63650. "shortnames": [":woman_health_worker_dark_skin_tone:"],
  63651. "category": "people"
  63652. },
  63653. ":woman_in_lotus_position_tone1:": {
  63654. "uc_base": "1f9d8-1f3fb-2640",
  63655. "uc_output": "1f9d8-1f3fb-200d-2640-fe0f",
  63656. "uc_match": "1f9d8-1f3fb-2640-fe0f",
  63657. "uc_greedy": "1f9d8-1f3fb-2640",
  63658. "shortnames": [":woman_in_lotus_position_light_skin_tone:"],
  63659. "category": "activity"
  63660. },
  63661. ":woman_in_lotus_position_tone2:": {
  63662. "uc_base": "1f9d8-1f3fc-2640",
  63663. "uc_output": "1f9d8-1f3fc-200d-2640-fe0f",
  63664. "uc_match": "1f9d8-1f3fc-2640-fe0f",
  63665. "uc_greedy": "1f9d8-1f3fc-2640",
  63666. "shortnames": [":woman_in_lotus_position_medium_light_skin_tone:"],
  63667. "category": "activity"
  63668. },
  63669. ":woman_in_lotus_position_tone3:": {
  63670. "uc_base": "1f9d8-1f3fd-2640",
  63671. "uc_output": "1f9d8-1f3fd-200d-2640-fe0f",
  63672. "uc_match": "1f9d8-1f3fd-2640-fe0f",
  63673. "uc_greedy": "1f9d8-1f3fd-2640",
  63674. "shortnames": [":woman_in_lotus_position_medium_skin_tone:"],
  63675. "category": "activity"
  63676. },
  63677. ":woman_in_lotus_position_tone4:": {
  63678. "uc_base": "1f9d8-1f3fe-2640",
  63679. "uc_output": "1f9d8-1f3fe-200d-2640-fe0f",
  63680. "uc_match": "1f9d8-1f3fe-2640-fe0f",
  63681. "uc_greedy": "1f9d8-1f3fe-2640",
  63682. "shortnames": [":woman_in_lotus_position_medium_dark_skin_tone:"],
  63683. "category": "activity"
  63684. },
  63685. ":woman_in_lotus_position_tone5:": {
  63686. "uc_base": "1f9d8-1f3ff-2640",
  63687. "uc_output": "1f9d8-1f3ff-200d-2640-fe0f",
  63688. "uc_match": "1f9d8-1f3ff-2640-fe0f",
  63689. "uc_greedy": "1f9d8-1f3ff-2640",
  63690. "shortnames": [":woman_in_lotus_position_dark_skin_tone:"],
  63691. "category": "activity"
  63692. },
  63693. ":woman_in_steamy_room_tone1:": {
  63694. "uc_base": "1f9d6-1f3fb-2640",
  63695. "uc_output": "1f9d6-1f3fb-200d-2640-fe0f",
  63696. "uc_match": "1f9d6-1f3fb-2640-fe0f",
  63697. "uc_greedy": "1f9d6-1f3fb-2640",
  63698. "shortnames": [":woman_in_steamy_room_light_skin_tone:"],
  63699. "category": "people"
  63700. },
  63701. ":woman_in_steamy_room_tone2:": {
  63702. "uc_base": "1f9d6-1f3fc-2640",
  63703. "uc_output": "1f9d6-1f3fc-200d-2640-fe0f",
  63704. "uc_match": "1f9d6-1f3fc-2640-fe0f",
  63705. "uc_greedy": "1f9d6-1f3fc-2640",
  63706. "shortnames": [":woman_in_steamy_room_medium_light_skin_tone:"],
  63707. "category": "people"
  63708. },
  63709. ":woman_in_steamy_room_tone3:": {
  63710. "uc_base": "1f9d6-1f3fd-2640",
  63711. "uc_output": "1f9d6-1f3fd-200d-2640-fe0f",
  63712. "uc_match": "1f9d6-1f3fd-2640-fe0f",
  63713. "uc_greedy": "1f9d6-1f3fd-2640",
  63714. "shortnames": [":woman_in_steamy_room_medium_skin_tone:"],
  63715. "category": "people"
  63716. },
  63717. ":woman_in_steamy_room_tone4:": {
  63718. "uc_base": "1f9d6-1f3fe-2640",
  63719. "uc_output": "1f9d6-1f3fe-200d-2640-fe0f",
  63720. "uc_match": "1f9d6-1f3fe-2640-fe0f",
  63721. "uc_greedy": "1f9d6-1f3fe-2640",
  63722. "shortnames": [":woman_in_steamy_room_medium_dark_skin_tone:"],
  63723. "category": "people"
  63724. },
  63725. ":woman_in_steamy_room_tone5:": {
  63726. "uc_base": "1f9d6-1f3ff-2640",
  63727. "uc_output": "1f9d6-1f3ff-200d-2640-fe0f",
  63728. "uc_match": "1f9d6-1f3ff-2640-fe0f",
  63729. "uc_greedy": "1f9d6-1f3ff-2640",
  63730. "shortnames": [":woman_in_steamy_room_dark_skin_tone:"],
  63731. "category": "people"
  63732. },
  63733. ":woman_judge_tone1:": {
  63734. "uc_base": "1f469-1f3fb-2696",
  63735. "uc_output": "1f469-1f3fb-200d-2696-fe0f",
  63736. "uc_match": "1f469-1f3fb-2696-fe0f",
  63737. "uc_greedy": "1f469-1f3fb-2696",
  63738. "shortnames": [":woman_judge_light_skin_tone:"],
  63739. "category": "people"
  63740. },
  63741. ":woman_judge_tone2:": {
  63742. "uc_base": "1f469-1f3fc-2696",
  63743. "uc_output": "1f469-1f3fc-200d-2696-fe0f",
  63744. "uc_match": "1f469-1f3fc-2696-fe0f",
  63745. "uc_greedy": "1f469-1f3fc-2696",
  63746. "shortnames": [":woman_judge_medium_light_skin_tone:"],
  63747. "category": "people"
  63748. },
  63749. ":woman_judge_tone3:": {
  63750. "uc_base": "1f469-1f3fd-2696",
  63751. "uc_output": "1f469-1f3fd-200d-2696-fe0f",
  63752. "uc_match": "1f469-1f3fd-2696-fe0f",
  63753. "uc_greedy": "1f469-1f3fd-2696",
  63754. "shortnames": [":woman_judge_medium_skin_tone:"],
  63755. "category": "people"
  63756. },
  63757. ":woman_judge_tone4:": {
  63758. "uc_base": "1f469-1f3fe-2696",
  63759. "uc_output": "1f469-1f3fe-200d-2696-fe0f",
  63760. "uc_match": "1f469-1f3fe-2696-fe0f",
  63761. "uc_greedy": "1f469-1f3fe-2696",
  63762. "shortnames": [":woman_judge_medium_dark_skin_tone:"],
  63763. "category": "people"
  63764. },
  63765. ":woman_judge_tone5:": {
  63766. "uc_base": "1f469-1f3ff-2696",
  63767. "uc_output": "1f469-1f3ff-200d-2696-fe0f",
  63768. "uc_match": "1f469-1f3ff-2696-fe0f",
  63769. "uc_greedy": "1f469-1f3ff-2696",
  63770. "shortnames": [":woman_judge_dark_skin_tone:"],
  63771. "category": "people"
  63772. },
  63773. ":woman_juggling_tone1:": {
  63774. "uc_base": "1f939-1f3fb-2640",
  63775. "uc_output": "1f939-1f3fb-200d-2640-fe0f",
  63776. "uc_match": "1f939-1f3fb-2640-fe0f",
  63777. "uc_greedy": "1f939-1f3fb-2640",
  63778. "shortnames": [":woman_juggling_light_skin_tone:"],
  63779. "category": "activity"
  63780. },
  63781. ":woman_juggling_tone2:": {
  63782. "uc_base": "1f939-1f3fc-2640",
  63783. "uc_output": "1f939-1f3fc-200d-2640-fe0f",
  63784. "uc_match": "1f939-1f3fc-2640-fe0f",
  63785. "uc_greedy": "1f939-1f3fc-2640",
  63786. "shortnames": [":woman_juggling_medium_light_skin_tone:"],
  63787. "category": "activity"
  63788. },
  63789. ":woman_juggling_tone3:": {
  63790. "uc_base": "1f939-1f3fd-2640",
  63791. "uc_output": "1f939-1f3fd-200d-2640-fe0f",
  63792. "uc_match": "1f939-1f3fd-2640-fe0f",
  63793. "uc_greedy": "1f939-1f3fd-2640",
  63794. "shortnames": [":woman_juggling_medium_skin_tone:"],
  63795. "category": "activity"
  63796. },
  63797. ":woman_juggling_tone4:": {
  63798. "uc_base": "1f939-1f3fe-2640",
  63799. "uc_output": "1f939-1f3fe-200d-2640-fe0f",
  63800. "uc_match": "1f939-1f3fe-2640-fe0f",
  63801. "uc_greedy": "1f939-1f3fe-2640",
  63802. "shortnames": [":woman_juggling_medium_dark_skin_tone:"],
  63803. "category": "activity"
  63804. },
  63805. ":woman_juggling_tone5:": {
  63806. "uc_base": "1f939-1f3ff-2640",
  63807. "uc_output": "1f939-1f3ff-200d-2640-fe0f",
  63808. "uc_match": "1f939-1f3ff-2640-fe0f",
  63809. "uc_greedy": "1f939-1f3ff-2640",
  63810. "shortnames": [":woman_juggling_dark_skin_tone:"],
  63811. "category": "activity"
  63812. },
  63813. ":woman_lifting_weights_tone1:": {
  63814. "uc_base": "1f3cb-1f3fb-2640",
  63815. "uc_output": "1f3cb-1f3fb-200d-2640-fe0f",
  63816. "uc_match": "1f3cb-fe0f-1f3fb-2640-fe0f",
  63817. "uc_greedy": "1f3cb-1f3fb-2640",
  63818. "shortnames": [":woman_lifting_weights_light_skin_tone:"],
  63819. "category": "activity"
  63820. },
  63821. ":woman_lifting_weights_tone2:": {
  63822. "uc_base": "1f3cb-1f3fc-2640",
  63823. "uc_output": "1f3cb-1f3fc-200d-2640-fe0f",
  63824. "uc_match": "1f3cb-fe0f-1f3fc-2640-fe0f",
  63825. "uc_greedy": "1f3cb-1f3fc-2640",
  63826. "shortnames": [":woman_lifting_weights_medium_light_skin_tone:"],
  63827. "category": "activity"
  63828. },
  63829. ":woman_lifting_weights_tone3:": {
  63830. "uc_base": "1f3cb-1f3fd-2640",
  63831. "uc_output": "1f3cb-1f3fd-200d-2640-fe0f",
  63832. "uc_match": "1f3cb-fe0f-1f3fd-2640-fe0f",
  63833. "uc_greedy": "1f3cb-1f3fd-2640",
  63834. "shortnames": [":woman_lifting_weights_medium_skin_tone:"],
  63835. "category": "activity"
  63836. },
  63837. ":woman_lifting_weights_tone4:": {
  63838. "uc_base": "1f3cb-1f3fe-2640",
  63839. "uc_output": "1f3cb-1f3fe-200d-2640-fe0f",
  63840. "uc_match": "1f3cb-fe0f-1f3fe-2640-fe0f",
  63841. "uc_greedy": "1f3cb-1f3fe-2640",
  63842. "shortnames": [":woman_lifting_weights_medium_dark_skin_tone:"],
  63843. "category": "activity"
  63844. },
  63845. ":woman_lifting_weights_tone5:": {
  63846. "uc_base": "1f3cb-1f3ff-2640",
  63847. "uc_output": "1f3cb-1f3ff-200d-2640-fe0f",
  63848. "uc_match": "1f3cb-fe0f-1f3ff-2640-fe0f",
  63849. "uc_greedy": "1f3cb-1f3ff-2640",
  63850. "shortnames": [":woman_lifting_weights_dark_skin_tone:"],
  63851. "category": "activity"
  63852. },
  63853. ":woman_mage_tone1:": {
  63854. "uc_base": "1f9d9-1f3fb-2640",
  63855. "uc_output": "1f9d9-1f3fb-200d-2640-fe0f",
  63856. "uc_match": "1f9d9-1f3fb-2640-fe0f",
  63857. "uc_greedy": "1f9d9-1f3fb-2640",
  63858. "shortnames": [":woman_mage_light_skin_tone:"],
  63859. "category": "people"
  63860. },
  63861. ":woman_mage_tone2:": {
  63862. "uc_base": "1f9d9-1f3fc-2640",
  63863. "uc_output": "1f9d9-1f3fc-200d-2640-fe0f",
  63864. "uc_match": "1f9d9-1f3fc-2640-fe0f",
  63865. "uc_greedy": "1f9d9-1f3fc-2640",
  63866. "shortnames": [":woman_mage_medium_light_skin_tone:"],
  63867. "category": "people"
  63868. },
  63869. ":woman_mage_tone3:": {
  63870. "uc_base": "1f9d9-1f3fd-2640",
  63871. "uc_output": "1f9d9-1f3fd-200d-2640-fe0f",
  63872. "uc_match": "1f9d9-1f3fd-2640-fe0f",
  63873. "uc_greedy": "1f9d9-1f3fd-2640",
  63874. "shortnames": [":woman_mage_medium_skin_tone:"],
  63875. "category": "people"
  63876. },
  63877. ":woman_mage_tone4:": {
  63878. "uc_base": "1f9d9-1f3fe-2640",
  63879. "uc_output": "1f9d9-1f3fe-200d-2640-fe0f",
  63880. "uc_match": "1f9d9-1f3fe-2640-fe0f",
  63881. "uc_greedy": "1f9d9-1f3fe-2640",
  63882. "shortnames": [":woman_mage_medium_dark_skin_tone:"],
  63883. "category": "people"
  63884. },
  63885. ":woman_mage_tone5:": {
  63886. "uc_base": "1f9d9-1f3ff-2640",
  63887. "uc_output": "1f9d9-1f3ff-200d-2640-fe0f",
  63888. "uc_match": "1f9d9-1f3ff-2640-fe0f",
  63889. "uc_greedy": "1f9d9-1f3ff-2640",
  63890. "shortnames": [":woman_mage_dark_skin_tone:"],
  63891. "category": "people"
  63892. },
  63893. ":woman_mountain_biking_tone1:": {
  63894. "uc_base": "1f6b5-1f3fb-2640",
  63895. "uc_output": "1f6b5-1f3fb-200d-2640-fe0f",
  63896. "uc_match": "1f6b5-1f3fb-2640-fe0f",
  63897. "uc_greedy": "1f6b5-1f3fb-2640",
  63898. "shortnames": [":woman_mountain_biking_light_skin_tone:"],
  63899. "category": "activity"
  63900. },
  63901. ":woman_mountain_biking_tone2:": {
  63902. "uc_base": "1f6b5-1f3fc-2640",
  63903. "uc_output": "1f6b5-1f3fc-200d-2640-fe0f",
  63904. "uc_match": "1f6b5-1f3fc-2640-fe0f",
  63905. "uc_greedy": "1f6b5-1f3fc-2640",
  63906. "shortnames": [":woman_mountain_biking_medium_light_skin_tone:"],
  63907. "category": "activity"
  63908. },
  63909. ":woman_mountain_biking_tone3:": {
  63910. "uc_base": "1f6b5-1f3fd-2640",
  63911. "uc_output": "1f6b5-1f3fd-200d-2640-fe0f",
  63912. "uc_match": "1f6b5-1f3fd-2640-fe0f",
  63913. "uc_greedy": "1f6b5-1f3fd-2640",
  63914. "shortnames": [":woman_mountain_biking_medium_skin_tone:"],
  63915. "category": "activity"
  63916. },
  63917. ":woman_mountain_biking_tone4:": {
  63918. "uc_base": "1f6b5-1f3fe-2640",
  63919. "uc_output": "1f6b5-1f3fe-200d-2640-fe0f",
  63920. "uc_match": "1f6b5-1f3fe-2640-fe0f",
  63921. "uc_greedy": "1f6b5-1f3fe-2640",
  63922. "shortnames": [":woman_mountain_biking_medium_dark_skin_tone:"],
  63923. "category": "activity"
  63924. },
  63925. ":woman_mountain_biking_tone5:": {
  63926. "uc_base": "1f6b5-1f3ff-2640",
  63927. "uc_output": "1f6b5-1f3ff-200d-2640-fe0f",
  63928. "uc_match": "1f6b5-1f3ff-2640-fe0f",
  63929. "uc_greedy": "1f6b5-1f3ff-2640",
  63930. "shortnames": [":woman_mountain_biking_dark_skin_tone:"],
  63931. "category": "activity"
  63932. },
  63933. ":woman_pilot_tone1:": {
  63934. "uc_base": "1f469-1f3fb-2708",
  63935. "uc_output": "1f469-1f3fb-200d-2708-fe0f",
  63936. "uc_match": "1f469-1f3fb-2708-fe0f",
  63937. "uc_greedy": "1f469-1f3fb-2708",
  63938. "shortnames": [":woman_pilot_light_skin_tone:"],
  63939. "category": "people"
  63940. },
  63941. ":woman_pilot_tone2:": {
  63942. "uc_base": "1f469-1f3fc-2708",
  63943. "uc_output": "1f469-1f3fc-200d-2708-fe0f",
  63944. "uc_match": "1f469-1f3fc-2708-fe0f",
  63945. "uc_greedy": "1f469-1f3fc-2708",
  63946. "shortnames": [":woman_pilot_medium_light_skin_tone:"],
  63947. "category": "people"
  63948. },
  63949. ":woman_pilot_tone3:": {
  63950. "uc_base": "1f469-1f3fd-2708",
  63951. "uc_output": "1f469-1f3fd-200d-2708-fe0f",
  63952. "uc_match": "1f469-1f3fd-2708-fe0f",
  63953. "uc_greedy": "1f469-1f3fd-2708",
  63954. "shortnames": [":woman_pilot_medium_skin_tone:"],
  63955. "category": "people"
  63956. },
  63957. ":woman_pilot_tone4:": {
  63958. "uc_base": "1f469-1f3fe-2708",
  63959. "uc_output": "1f469-1f3fe-200d-2708-fe0f",
  63960. "uc_match": "1f469-1f3fe-2708-fe0f",
  63961. "uc_greedy": "1f469-1f3fe-2708",
  63962. "shortnames": [":woman_pilot_medium_dark_skin_tone:"],
  63963. "category": "people"
  63964. },
  63965. ":woman_pilot_tone5:": {
  63966. "uc_base": "1f469-1f3ff-2708",
  63967. "uc_output": "1f469-1f3ff-200d-2708-fe0f",
  63968. "uc_match": "1f469-1f3ff-2708-fe0f",
  63969. "uc_greedy": "1f469-1f3ff-2708",
  63970. "shortnames": [":woman_pilot_dark_skin_tone:"],
  63971. "category": "people"
  63972. },
  63973. ":woman_playing_handball_tone1:": {
  63974. "uc_base": "1f93e-1f3fb-2640",
  63975. "uc_output": "1f93e-1f3fb-200d-2640-fe0f",
  63976. "uc_match": "1f93e-1f3fb-2640-fe0f",
  63977. "uc_greedy": "1f93e-1f3fb-2640",
  63978. "shortnames": [":woman_playing_handball_light_skin_tone:"],
  63979. "category": "activity"
  63980. },
  63981. ":woman_playing_handball_tone2:": {
  63982. "uc_base": "1f93e-1f3fc-2640",
  63983. "uc_output": "1f93e-1f3fc-200d-2640-fe0f",
  63984. "uc_match": "1f93e-1f3fc-2640-fe0f",
  63985. "uc_greedy": "1f93e-1f3fc-2640",
  63986. "shortnames": [":woman_playing_handball_medium_light_skin_tone:"],
  63987. "category": "activity"
  63988. },
  63989. ":woman_playing_handball_tone3:": {
  63990. "uc_base": "1f93e-1f3fd-2640",
  63991. "uc_output": "1f93e-1f3fd-200d-2640-fe0f",
  63992. "uc_match": "1f93e-1f3fd-2640-fe0f",
  63993. "uc_greedy": "1f93e-1f3fd-2640",
  63994. "shortnames": [":woman_playing_handball_medium_skin_tone:"],
  63995. "category": "activity"
  63996. },
  63997. ":woman_playing_handball_tone4:": {
  63998. "uc_base": "1f93e-1f3fe-2640",
  63999. "uc_output": "1f93e-1f3fe-200d-2640-fe0f",
  64000. "uc_match": "1f93e-1f3fe-2640-fe0f",
  64001. "uc_greedy": "1f93e-1f3fe-2640",
  64002. "shortnames": [":woman_playing_handball_medium_dark_skin_tone:"],
  64003. "category": "activity"
  64004. },
  64005. ":woman_playing_handball_tone5:": {
  64006. "uc_base": "1f93e-1f3ff-2640",
  64007. "uc_output": "1f93e-1f3ff-200d-2640-fe0f",
  64008. "uc_match": "1f93e-1f3ff-2640-fe0f",
  64009. "uc_greedy": "1f93e-1f3ff-2640",
  64010. "shortnames": [":woman_playing_handball_dark_skin_tone:"],
  64011. "category": "activity"
  64012. },
  64013. ":woman_playing_water_polo_tone1:": {
  64014. "uc_base": "1f93d-1f3fb-2640",
  64015. "uc_output": "1f93d-1f3fb-200d-2640-fe0f",
  64016. "uc_match": "1f93d-1f3fb-2640-fe0f",
  64017. "uc_greedy": "1f93d-1f3fb-2640",
  64018. "shortnames": [":woman_playing_water_polo_light_skin_tone:"],
  64019. "category": "activity"
  64020. },
  64021. ":woman_playing_water_polo_tone2:": {
  64022. "uc_base": "1f93d-1f3fc-2640",
  64023. "uc_output": "1f93d-1f3fc-200d-2640-fe0f",
  64024. "uc_match": "1f93d-1f3fc-2640-fe0f",
  64025. "uc_greedy": "1f93d-1f3fc-2640",
  64026. "shortnames": [":woman_playing_water_polo_medium_light_skin_tone:"],
  64027. "category": "activity"
  64028. },
  64029. ":woman_playing_water_polo_tone3:": {
  64030. "uc_base": "1f93d-1f3fd-2640",
  64031. "uc_output": "1f93d-1f3fd-200d-2640-fe0f",
  64032. "uc_match": "1f93d-1f3fd-2640-fe0f",
  64033. "uc_greedy": "1f93d-1f3fd-2640",
  64034. "shortnames": [":woman_playing_water_polo_medium_skin_tone:"],
  64035. "category": "activity"
  64036. },
  64037. ":woman_playing_water_polo_tone4:": {
  64038. "uc_base": "1f93d-1f3fe-2640",
  64039. "uc_output": "1f93d-1f3fe-200d-2640-fe0f",
  64040. "uc_match": "1f93d-1f3fe-2640-fe0f",
  64041. "uc_greedy": "1f93d-1f3fe-2640",
  64042. "shortnames": [":woman_playing_water_polo_medium_dark_skin_tone:"],
  64043. "category": "activity"
  64044. },
  64045. ":woman_playing_water_polo_tone5:": {
  64046. "uc_base": "1f93d-1f3ff-2640",
  64047. "uc_output": "1f93d-1f3ff-200d-2640-fe0f",
  64048. "uc_match": "1f93d-1f3ff-2640-fe0f",
  64049. "uc_greedy": "1f93d-1f3ff-2640",
  64050. "shortnames": [":woman_playing_water_polo_dark_skin_tone:"],
  64051. "category": "activity"
  64052. },
  64053. ":woman_police_officer_tone1:": {
  64054. "uc_base": "1f46e-1f3fb-2640",
  64055. "uc_output": "1f46e-1f3fb-200d-2640-fe0f",
  64056. "uc_match": "1f46e-1f3fb-2640-fe0f",
  64057. "uc_greedy": "1f46e-1f3fb-2640",
  64058. "shortnames": [":woman_police_officer_light_skin_tone:"],
  64059. "category": "people"
  64060. },
  64061. ":woman_police_officer_tone2:": {
  64062. "uc_base": "1f46e-1f3fc-2640",
  64063. "uc_output": "1f46e-1f3fc-200d-2640-fe0f",
  64064. "uc_match": "1f46e-1f3fc-2640-fe0f",
  64065. "uc_greedy": "1f46e-1f3fc-2640",
  64066. "shortnames": [":woman_police_officer_medium_light_skin_tone:"],
  64067. "category": "people"
  64068. },
  64069. ":woman_police_officer_tone3:": {
  64070. "uc_base": "1f46e-1f3fd-2640",
  64071. "uc_output": "1f46e-1f3fd-200d-2640-fe0f",
  64072. "uc_match": "1f46e-1f3fd-2640-fe0f",
  64073. "uc_greedy": "1f46e-1f3fd-2640",
  64074. "shortnames": [":woman_police_officer_medium_skin_tone:"],
  64075. "category": "people"
  64076. },
  64077. ":woman_police_officer_tone4:": {
  64078. "uc_base": "1f46e-1f3fe-2640",
  64079. "uc_output": "1f46e-1f3fe-200d-2640-fe0f",
  64080. "uc_match": "1f46e-1f3fe-2640-fe0f",
  64081. "uc_greedy": "1f46e-1f3fe-2640",
  64082. "shortnames": [":woman_police_officer_medium_dark_skin_tone:"],
  64083. "category": "people"
  64084. },
  64085. ":woman_police_officer_tone5:": {
  64086. "uc_base": "1f46e-1f3ff-2640",
  64087. "uc_output": "1f46e-1f3ff-200d-2640-fe0f",
  64088. "uc_match": "1f46e-1f3ff-2640-fe0f",
  64089. "uc_greedy": "1f46e-1f3ff-2640",
  64090. "shortnames": [":woman_police_officer_dark_skin_tone:"],
  64091. "category": "people"
  64092. },
  64093. ":woman_pouting_tone1:": {
  64094. "uc_base": "1f64e-1f3fb-2640",
  64095. "uc_output": "1f64e-1f3fb-200d-2640-fe0f",
  64096. "uc_match": "1f64e-1f3fb-2640-fe0f",
  64097. "uc_greedy": "1f64e-1f3fb-2640",
  64098. "shortnames": [":woman_pouting_light_skin_tone:"],
  64099. "category": "people"
  64100. },
  64101. ":woman_pouting_tone2:": {
  64102. "uc_base": "1f64e-1f3fc-2640",
  64103. "uc_output": "1f64e-1f3fc-200d-2640-fe0f",
  64104. "uc_match": "1f64e-1f3fc-2640-fe0f",
  64105. "uc_greedy": "1f64e-1f3fc-2640",
  64106. "shortnames": [":woman_pouting_medium_light_skin_tone:"],
  64107. "category": "people"
  64108. },
  64109. ":woman_pouting_tone3:": {
  64110. "uc_base": "1f64e-1f3fd-2640",
  64111. "uc_output": "1f64e-1f3fd-200d-2640-fe0f",
  64112. "uc_match": "1f64e-1f3fd-2640-fe0f",
  64113. "uc_greedy": "1f64e-1f3fd-2640",
  64114. "shortnames": [":woman_pouting_medium_skin_tone:"],
  64115. "category": "people"
  64116. },
  64117. ":woman_pouting_tone4:": {
  64118. "uc_base": "1f64e-1f3fe-2640",
  64119. "uc_output": "1f64e-1f3fe-200d-2640-fe0f",
  64120. "uc_match": "1f64e-1f3fe-2640-fe0f",
  64121. "uc_greedy": "1f64e-1f3fe-2640",
  64122. "shortnames": [":woman_pouting_medium_dark_skin_tone:"],
  64123. "category": "people"
  64124. },
  64125. ":woman_pouting_tone5:": {
  64126. "uc_base": "1f64e-1f3ff-2640",
  64127. "uc_output": "1f64e-1f3ff-200d-2640-fe0f",
  64128. "uc_match": "1f64e-1f3ff-2640-fe0f",
  64129. "uc_greedy": "1f64e-1f3ff-2640",
  64130. "shortnames": [":woman_pouting_dark_skin_tone:"],
  64131. "category": "people"
  64132. },
  64133. ":woman_raising_hand_tone1:": {
  64134. "uc_base": "1f64b-1f3fb-2640",
  64135. "uc_output": "1f64b-1f3fb-200d-2640-fe0f",
  64136. "uc_match": "1f64b-1f3fb-2640-fe0f",
  64137. "uc_greedy": "1f64b-1f3fb-2640",
  64138. "shortnames": [":woman_raising_hand_light_skin_tone:"],
  64139. "category": "people"
  64140. },
  64141. ":woman_raising_hand_tone2:": {
  64142. "uc_base": "1f64b-1f3fc-2640",
  64143. "uc_output": "1f64b-1f3fc-200d-2640-fe0f",
  64144. "uc_match": "1f64b-1f3fc-2640-fe0f",
  64145. "uc_greedy": "1f64b-1f3fc-2640",
  64146. "shortnames": [":woman_raising_hand_medium_light_skin_tone:"],
  64147. "category": "people"
  64148. },
  64149. ":woman_raising_hand_tone3:": {
  64150. "uc_base": "1f64b-1f3fd-2640",
  64151. "uc_output": "1f64b-1f3fd-200d-2640-fe0f",
  64152. "uc_match": "1f64b-1f3fd-2640-fe0f",
  64153. "uc_greedy": "1f64b-1f3fd-2640",
  64154. "shortnames": [":woman_raising_hand_medium_skin_tone:"],
  64155. "category": "people"
  64156. },
  64157. ":woman_raising_hand_tone4:": {
  64158. "uc_base": "1f64b-1f3fe-2640",
  64159. "uc_output": "1f64b-1f3fe-200d-2640-fe0f",
  64160. "uc_match": "1f64b-1f3fe-2640-fe0f",
  64161. "uc_greedy": "1f64b-1f3fe-2640",
  64162. "shortnames": [":woman_raising_hand_medium_dark_skin_tone:"],
  64163. "category": "people"
  64164. },
  64165. ":woman_raising_hand_tone5:": {
  64166. "uc_base": "1f64b-1f3ff-2640",
  64167. "uc_output": "1f64b-1f3ff-200d-2640-fe0f",
  64168. "uc_match": "1f64b-1f3ff-2640-fe0f",
  64169. "uc_greedy": "1f64b-1f3ff-2640",
  64170. "shortnames": [":woman_raising_hand_dark_skin_tone:"],
  64171. "category": "people"
  64172. },
  64173. ":woman_rowing_boat_tone1:": {
  64174. "uc_base": "1f6a3-1f3fb-2640",
  64175. "uc_output": "1f6a3-1f3fb-200d-2640-fe0f",
  64176. "uc_match": "1f6a3-1f3fb-2640-fe0f",
  64177. "uc_greedy": "1f6a3-1f3fb-2640",
  64178. "shortnames": [":woman_rowing_boat_light_skin_tone:"],
  64179. "category": "activity"
  64180. },
  64181. ":woman_rowing_boat_tone2:": {
  64182. "uc_base": "1f6a3-1f3fc-2640",
  64183. "uc_output": "1f6a3-1f3fc-200d-2640-fe0f",
  64184. "uc_match": "1f6a3-1f3fc-2640-fe0f",
  64185. "uc_greedy": "1f6a3-1f3fc-2640",
  64186. "shortnames": [":woman_rowing_boat_medium_light_skin_tone:"],
  64187. "category": "activity"
  64188. },
  64189. ":woman_rowing_boat_tone3:": {
  64190. "uc_base": "1f6a3-1f3fd-2640",
  64191. "uc_output": "1f6a3-1f3fd-200d-2640-fe0f",
  64192. "uc_match": "1f6a3-1f3fd-2640-fe0f",
  64193. "uc_greedy": "1f6a3-1f3fd-2640",
  64194. "shortnames": [":woman_rowing_boat_medium_skin_tone:"],
  64195. "category": "activity"
  64196. },
  64197. ":woman_rowing_boat_tone4:": {
  64198. "uc_base": "1f6a3-1f3fe-2640",
  64199. "uc_output": "1f6a3-1f3fe-200d-2640-fe0f",
  64200. "uc_match": "1f6a3-1f3fe-2640-fe0f",
  64201. "uc_greedy": "1f6a3-1f3fe-2640",
  64202. "shortnames": [":woman_rowing_boat_medium_dark_skin_tone:"],
  64203. "category": "activity"
  64204. },
  64205. ":woman_rowing_boat_tone5:": {
  64206. "uc_base": "1f6a3-1f3ff-2640",
  64207. "uc_output": "1f6a3-1f3ff-200d-2640-fe0f",
  64208. "uc_match": "1f6a3-1f3ff-2640-fe0f",
  64209. "uc_greedy": "1f6a3-1f3ff-2640",
  64210. "shortnames": [":woman_rowing_boat_dark_skin_tone:"],
  64211. "category": "activity"
  64212. },
  64213. ":woman_running_tone1:": {
  64214. "uc_base": "1f3c3-1f3fb-2640",
  64215. "uc_output": "1f3c3-1f3fb-200d-2640-fe0f",
  64216. "uc_match": "1f3c3-1f3fb-2640-fe0f",
  64217. "uc_greedy": "1f3c3-1f3fb-2640",
  64218. "shortnames": [":woman_running_light_skin_tone:"],
  64219. "category": "people"
  64220. },
  64221. ":woman_running_tone2:": {
  64222. "uc_base": "1f3c3-1f3fc-2640",
  64223. "uc_output": "1f3c3-1f3fc-200d-2640-fe0f",
  64224. "uc_match": "1f3c3-1f3fc-2640-fe0f",
  64225. "uc_greedy": "1f3c3-1f3fc-2640",
  64226. "shortnames": [":woman_running_medium_light_skin_tone:"],
  64227. "category": "people"
  64228. },
  64229. ":woman_running_tone3:": {
  64230. "uc_base": "1f3c3-1f3fd-2640",
  64231. "uc_output": "1f3c3-1f3fd-200d-2640-fe0f",
  64232. "uc_match": "1f3c3-1f3fd-2640-fe0f",
  64233. "uc_greedy": "1f3c3-1f3fd-2640",
  64234. "shortnames": [":woman_running_medium_skin_tone:"],
  64235. "category": "people"
  64236. },
  64237. ":woman_running_tone4:": {
  64238. "uc_base": "1f3c3-1f3fe-2640",
  64239. "uc_output": "1f3c3-1f3fe-200d-2640-fe0f",
  64240. "uc_match": "1f3c3-1f3fe-2640-fe0f",
  64241. "uc_greedy": "1f3c3-1f3fe-2640",
  64242. "shortnames": [":woman_running_medium_dark_skin_tone:"],
  64243. "category": "people"
  64244. },
  64245. ":woman_running_tone5:": {
  64246. "uc_base": "1f3c3-1f3ff-2640",
  64247. "uc_output": "1f3c3-1f3ff-200d-2640-fe0f",
  64248. "uc_match": "1f3c3-1f3ff-2640-fe0f",
  64249. "uc_greedy": "1f3c3-1f3ff-2640",
  64250. "shortnames": [":woman_running_dark_skin_tone:"],
  64251. "category": "people"
  64252. },
  64253. ":woman_shrugging_tone1:": {
  64254. "uc_base": "1f937-1f3fb-2640",
  64255. "uc_output": "1f937-1f3fb-200d-2640-fe0f",
  64256. "uc_match": "1f937-1f3fb-2640-fe0f",
  64257. "uc_greedy": "1f937-1f3fb-2640",
  64258. "shortnames": [":woman_shrugging_light_skin_tone:"],
  64259. "category": "people"
  64260. },
  64261. ":woman_shrugging_tone2:": {
  64262. "uc_base": "1f937-1f3fc-2640",
  64263. "uc_output": "1f937-1f3fc-200d-2640-fe0f",
  64264. "uc_match": "1f937-1f3fc-2640-fe0f",
  64265. "uc_greedy": "1f937-1f3fc-2640",
  64266. "shortnames": [":woman_shrugging_medium_light_skin_tone:"],
  64267. "category": "people"
  64268. },
  64269. ":woman_shrugging_tone3:": {
  64270. "uc_base": "1f937-1f3fd-2640",
  64271. "uc_output": "1f937-1f3fd-200d-2640-fe0f",
  64272. "uc_match": "1f937-1f3fd-2640-fe0f",
  64273. "uc_greedy": "1f937-1f3fd-2640",
  64274. "shortnames": [":woman_shrugging_medium_skin_tone:"],
  64275. "category": "people"
  64276. },
  64277. ":woman_shrugging_tone4:": {
  64278. "uc_base": "1f937-1f3fe-2640",
  64279. "uc_output": "1f937-1f3fe-200d-2640-fe0f",
  64280. "uc_match": "1f937-1f3fe-2640-fe0f",
  64281. "uc_greedy": "1f937-1f3fe-2640",
  64282. "shortnames": [":woman_shrugging_medium_dark_skin_tone:"],
  64283. "category": "people"
  64284. },
  64285. ":woman_shrugging_tone5:": {
  64286. "uc_base": "1f937-1f3ff-2640",
  64287. "uc_output": "1f937-1f3ff-200d-2640-fe0f",
  64288. "uc_match": "1f937-1f3ff-2640-fe0f",
  64289. "uc_greedy": "1f937-1f3ff-2640",
  64290. "shortnames": [":woman_shrugging_dark_skin_tone:"],
  64291. "category": "people"
  64292. },
  64293. ":woman_surfing_tone1:": {
  64294. "uc_base": "1f3c4-1f3fb-2640",
  64295. "uc_output": "1f3c4-1f3fb-200d-2640-fe0f",
  64296. "uc_match": "1f3c4-1f3fb-2640-fe0f",
  64297. "uc_greedy": "1f3c4-1f3fb-2640",
  64298. "shortnames": [":woman_surfing_light_skin_tone:"],
  64299. "category": "activity"
  64300. },
  64301. ":woman_surfing_tone2:": {
  64302. "uc_base": "1f3c4-1f3fc-2640",
  64303. "uc_output": "1f3c4-1f3fc-200d-2640-fe0f",
  64304. "uc_match": "1f3c4-1f3fc-2640-fe0f",
  64305. "uc_greedy": "1f3c4-1f3fc-2640",
  64306. "shortnames": [":woman_surfing_medium_light_skin_tone:"],
  64307. "category": "activity"
  64308. },
  64309. ":woman_surfing_tone3:": {
  64310. "uc_base": "1f3c4-1f3fd-2640",
  64311. "uc_output": "1f3c4-1f3fd-200d-2640-fe0f",
  64312. "uc_match": "1f3c4-1f3fd-2640-fe0f",
  64313. "uc_greedy": "1f3c4-1f3fd-2640",
  64314. "shortnames": [":woman_surfing_medium_skin_tone:"],
  64315. "category": "activity"
  64316. },
  64317. ":woman_surfing_tone4:": {
  64318. "uc_base": "1f3c4-1f3fe-2640",
  64319. "uc_output": "1f3c4-1f3fe-200d-2640-fe0f",
  64320. "uc_match": "1f3c4-1f3fe-2640-fe0f",
  64321. "uc_greedy": "1f3c4-1f3fe-2640",
  64322. "shortnames": [":woman_surfing_medium_dark_skin_tone:"],
  64323. "category": "activity"
  64324. },
  64325. ":woman_surfing_tone5:": {
  64326. "uc_base": "1f3c4-1f3ff-2640",
  64327. "uc_output": "1f3c4-1f3ff-200d-2640-fe0f",
  64328. "uc_match": "1f3c4-1f3ff-2640-fe0f",
  64329. "uc_greedy": "1f3c4-1f3ff-2640",
  64330. "shortnames": [":woman_surfing_dark_skin_tone:"],
  64331. "category": "activity"
  64332. },
  64333. ":woman_swimming_tone1:": {
  64334. "uc_base": "1f3ca-1f3fb-2640",
  64335. "uc_output": "1f3ca-1f3fb-200d-2640-fe0f",
  64336. "uc_match": "1f3ca-1f3fb-2640-fe0f",
  64337. "uc_greedy": "1f3ca-1f3fb-2640",
  64338. "shortnames": [":woman_swimming_light_skin_tone:"],
  64339. "category": "activity"
  64340. },
  64341. ":woman_swimming_tone2:": {
  64342. "uc_base": "1f3ca-1f3fc-2640",
  64343. "uc_output": "1f3ca-1f3fc-200d-2640-fe0f",
  64344. "uc_match": "1f3ca-1f3fc-2640-fe0f",
  64345. "uc_greedy": "1f3ca-1f3fc-2640",
  64346. "shortnames": [":woman_swimming_medium_light_skin_tone:"],
  64347. "category": "activity"
  64348. },
  64349. ":woman_swimming_tone3:": {
  64350. "uc_base": "1f3ca-1f3fd-2640",
  64351. "uc_output": "1f3ca-1f3fd-200d-2640-fe0f",
  64352. "uc_match": "1f3ca-1f3fd-2640-fe0f",
  64353. "uc_greedy": "1f3ca-1f3fd-2640",
  64354. "shortnames": [":woman_swimming_medium_skin_tone:"],
  64355. "category": "activity"
  64356. },
  64357. ":woman_swimming_tone4:": {
  64358. "uc_base": "1f3ca-1f3fe-2640",
  64359. "uc_output": "1f3ca-1f3fe-200d-2640-fe0f",
  64360. "uc_match": "1f3ca-1f3fe-2640-fe0f",
  64361. "uc_greedy": "1f3ca-1f3fe-2640",
  64362. "shortnames": [":woman_swimming_medium_dark_skin_tone:"],
  64363. "category": "activity"
  64364. },
  64365. ":woman_swimming_tone5:": {
  64366. "uc_base": "1f3ca-1f3ff-2640",
  64367. "uc_output": "1f3ca-1f3ff-200d-2640-fe0f",
  64368. "uc_match": "1f3ca-1f3ff-2640-fe0f",
  64369. "uc_greedy": "1f3ca-1f3ff-2640",
  64370. "shortnames": [":woman_swimming_dark_skin_tone:"],
  64371. "category": "activity"
  64372. },
  64373. ":woman_tipping_hand_tone1:": {
  64374. "uc_base": "1f481-1f3fb-2640",
  64375. "uc_output": "1f481-1f3fb-200d-2640-fe0f",
  64376. "uc_match": "1f481-1f3fb-2640-fe0f",
  64377. "uc_greedy": "1f481-1f3fb-2640",
  64378. "shortnames": [":woman_tipping_hand_light_skin_tone:"],
  64379. "category": "people"
  64380. },
  64381. ":woman_tipping_hand_tone2:": {
  64382. "uc_base": "1f481-1f3fc-2640",
  64383. "uc_output": "1f481-1f3fc-200d-2640-fe0f",
  64384. "uc_match": "1f481-1f3fc-2640-fe0f",
  64385. "uc_greedy": "1f481-1f3fc-2640",
  64386. "shortnames": [":woman_tipping_hand_medium_light_skin_tone:"],
  64387. "category": "people"
  64388. },
  64389. ":woman_tipping_hand_tone3:": {
  64390. "uc_base": "1f481-1f3fd-2640",
  64391. "uc_output": "1f481-1f3fd-200d-2640-fe0f",
  64392. "uc_match": "1f481-1f3fd-2640-fe0f",
  64393. "uc_greedy": "1f481-1f3fd-2640",
  64394. "shortnames": [":woman_tipping_hand_medium_skin_tone:"],
  64395. "category": "people"
  64396. },
  64397. ":woman_tipping_hand_tone4:": {
  64398. "uc_base": "1f481-1f3fe-2640",
  64399. "uc_output": "1f481-1f3fe-200d-2640-fe0f",
  64400. "uc_match": "1f481-1f3fe-2640-fe0f",
  64401. "uc_greedy": "1f481-1f3fe-2640",
  64402. "shortnames": [":woman_tipping_hand_medium_dark_skin_tone:"],
  64403. "category": "people"
  64404. },
  64405. ":woman_tipping_hand_tone5:": {
  64406. "uc_base": "1f481-1f3ff-2640",
  64407. "uc_output": "1f481-1f3ff-200d-2640-fe0f",
  64408. "uc_match": "1f481-1f3ff-2640-fe0f",
  64409. "uc_greedy": "1f481-1f3ff-2640",
  64410. "shortnames": [":woman_tipping_hand_dark_skin_tone:"],
  64411. "category": "people"
  64412. },
  64413. ":woman_vampire_tone1:": {
  64414. "uc_base": "1f9db-1f3fb-2640",
  64415. "uc_output": "1f9db-1f3fb-200d-2640-fe0f",
  64416. "uc_match": "1f9db-1f3fb-2640-fe0f",
  64417. "uc_greedy": "1f9db-1f3fb-2640",
  64418. "shortnames": [":woman_vampire_light_skin_tone:"],
  64419. "category": "people"
  64420. },
  64421. ":woman_vampire_tone2:": {
  64422. "uc_base": "1f9db-1f3fc-2640",
  64423. "uc_output": "1f9db-1f3fc-200d-2640-fe0f",
  64424. "uc_match": "1f9db-1f3fc-2640-fe0f",
  64425. "uc_greedy": "1f9db-1f3fc-2640",
  64426. "shortnames": [":woman_vampire_medium_light_skin_tone:"],
  64427. "category": "people"
  64428. },
  64429. ":woman_vampire_tone3:": {
  64430. "uc_base": "1f9db-1f3fd-2640",
  64431. "uc_output": "1f9db-1f3fd-200d-2640-fe0f",
  64432. "uc_match": "1f9db-1f3fd-2640-fe0f",
  64433. "uc_greedy": "1f9db-1f3fd-2640",
  64434. "shortnames": [":woman_vampire_medium_skin_tone:"],
  64435. "category": "people"
  64436. },
  64437. ":woman_vampire_tone4:": {
  64438. "uc_base": "1f9db-1f3fe-2640",
  64439. "uc_output": "1f9db-1f3fe-200d-2640-fe0f",
  64440. "uc_match": "1f9db-1f3fe-2640-fe0f",
  64441. "uc_greedy": "1f9db-1f3fe-2640",
  64442. "shortnames": [":woman_vampire_medium_dark_skin_tone:"],
  64443. "category": "people"
  64444. },
  64445. ":woman_vampire_tone5:": {
  64446. "uc_base": "1f9db-1f3ff-2640",
  64447. "uc_output": "1f9db-1f3ff-200d-2640-fe0f",
  64448. "uc_match": "1f9db-1f3ff-2640-fe0f",
  64449. "uc_greedy": "1f9db-1f3ff-2640",
  64450. "shortnames": [":woman_vampire_dark_skin_tone:"],
  64451. "category": "people"
  64452. },
  64453. ":woman_walking_tone1:": {
  64454. "uc_base": "1f6b6-1f3fb-2640",
  64455. "uc_output": "1f6b6-1f3fb-200d-2640-fe0f",
  64456. "uc_match": "1f6b6-1f3fb-2640-fe0f",
  64457. "uc_greedy": "1f6b6-1f3fb-2640",
  64458. "shortnames": [":woman_walking_light_skin_tone:"],
  64459. "category": "people"
  64460. },
  64461. ":woman_walking_tone2:": {
  64462. "uc_base": "1f6b6-1f3fc-2640",
  64463. "uc_output": "1f6b6-1f3fc-200d-2640-fe0f",
  64464. "uc_match": "1f6b6-1f3fc-2640-fe0f",
  64465. "uc_greedy": "1f6b6-1f3fc-2640",
  64466. "shortnames": [":woman_walking_medium_light_skin_tone:"],
  64467. "category": "people"
  64468. },
  64469. ":woman_walking_tone3:": {
  64470. "uc_base": "1f6b6-1f3fd-2640",
  64471. "uc_output": "1f6b6-1f3fd-200d-2640-fe0f",
  64472. "uc_match": "1f6b6-1f3fd-2640-fe0f",
  64473. "uc_greedy": "1f6b6-1f3fd-2640",
  64474. "shortnames": [":woman_walking_medium_skin_tone:"],
  64475. "category": "people"
  64476. },
  64477. ":woman_walking_tone4:": {
  64478. "uc_base": "1f6b6-1f3fe-2640",
  64479. "uc_output": "1f6b6-1f3fe-200d-2640-fe0f",
  64480. "uc_match": "1f6b6-1f3fe-2640-fe0f",
  64481. "uc_greedy": "1f6b6-1f3fe-2640",
  64482. "shortnames": [":woman_walking_medium_dark_skin_tone:"],
  64483. "category": "people"
  64484. },
  64485. ":woman_walking_tone5:": {
  64486. "uc_base": "1f6b6-1f3ff-2640",
  64487. "uc_output": "1f6b6-1f3ff-200d-2640-fe0f",
  64488. "uc_match": "1f6b6-1f3ff-2640-fe0f",
  64489. "uc_greedy": "1f6b6-1f3ff-2640",
  64490. "shortnames": [":woman_walking_dark_skin_tone:"],
  64491. "category": "people"
  64492. },
  64493. ":woman_wearing_turban_tone1:": {
  64494. "uc_base": "1f473-1f3fb-2640",
  64495. "uc_output": "1f473-1f3fb-200d-2640-fe0f",
  64496. "uc_match": "1f473-1f3fb-2640-fe0f",
  64497. "uc_greedy": "1f473-1f3fb-2640",
  64498. "shortnames": [":woman_wearing_turban_light_skin_tone:"],
  64499. "category": "people"
  64500. },
  64501. ":woman_wearing_turban_tone2:": {
  64502. "uc_base": "1f473-1f3fc-2640",
  64503. "uc_output": "1f473-1f3fc-200d-2640-fe0f",
  64504. "uc_match": "1f473-1f3fc-2640-fe0f",
  64505. "uc_greedy": "1f473-1f3fc-2640",
  64506. "shortnames": [":woman_wearing_turban_medium_light_skin_tone:"],
  64507. "category": "people"
  64508. },
  64509. ":woman_wearing_turban_tone3:": {
  64510. "uc_base": "1f473-1f3fd-2640",
  64511. "uc_output": "1f473-1f3fd-200d-2640-fe0f",
  64512. "uc_match": "1f473-1f3fd-2640-fe0f",
  64513. "uc_greedy": "1f473-1f3fd-2640",
  64514. "shortnames": [":woman_wearing_turban_medium_skin_tone:"],
  64515. "category": "people"
  64516. },
  64517. ":woman_wearing_turban_tone4:": {
  64518. "uc_base": "1f473-1f3fe-2640",
  64519. "uc_output": "1f473-1f3fe-200d-2640-fe0f",
  64520. "uc_match": "1f473-1f3fe-2640-fe0f",
  64521. "uc_greedy": "1f473-1f3fe-2640",
  64522. "shortnames": [":woman_wearing_turban_medium_dark_skin_tone:"],
  64523. "category": "people"
  64524. },
  64525. ":woman_wearing_turban_tone5:": {
  64526. "uc_base": "1f473-1f3ff-2640",
  64527. "uc_output": "1f473-1f3ff-200d-2640-fe0f",
  64528. "uc_match": "1f473-1f3ff-2640-fe0f",
  64529. "uc_greedy": "1f473-1f3ff-2640",
  64530. "shortnames": [":woman_wearing_turban_dark_skin_tone:"],
  64531. "category": "people"
  64532. },
  64533. ":man_bouncing_ball_tone1:": {
  64534. "uc_base": "26f9-1f3fb-2642",
  64535. "uc_output": "26f9-1f3fb-200d-2642-fe0f",
  64536. "uc_match": "26f9-fe0f-1f3fb-2642-fe0f",
  64537. "uc_greedy": "26f9-1f3fb-2642",
  64538. "shortnames": [":man_bouncing_ball_light_skin_tone:"],
  64539. "category": "activity"
  64540. },
  64541. ":man_bouncing_ball_tone2:": {
  64542. "uc_base": "26f9-1f3fc-2642",
  64543. "uc_output": "26f9-1f3fc-200d-2642-fe0f",
  64544. "uc_match": "26f9-fe0f-1f3fc-2642-fe0f",
  64545. "uc_greedy": "26f9-1f3fc-2642",
  64546. "shortnames": [":man_bouncing_ball_medium_light_skin_tone:"],
  64547. "category": "activity"
  64548. },
  64549. ":man_bouncing_ball_tone3:": {
  64550. "uc_base": "26f9-1f3fd-2642",
  64551. "uc_output": "26f9-1f3fd-200d-2642-fe0f",
  64552. "uc_match": "26f9-fe0f-1f3fd-2642-fe0f",
  64553. "uc_greedy": "26f9-1f3fd-2642",
  64554. "shortnames": [":man_bouncing_ball_medium_skin_tone:"],
  64555. "category": "activity"
  64556. },
  64557. ":man_bouncing_ball_tone4:": {
  64558. "uc_base": "26f9-1f3fe-2642",
  64559. "uc_output": "26f9-1f3fe-200d-2642-fe0f",
  64560. "uc_match": "26f9-fe0f-1f3fe-2642-fe0f",
  64561. "uc_greedy": "26f9-1f3fe-2642",
  64562. "shortnames": [":man_bouncing_ball_medium_dark_skin_tone:"],
  64563. "category": "activity"
  64564. },
  64565. ":man_bouncing_ball_tone5:": {
  64566. "uc_base": "26f9-1f3ff-2642",
  64567. "uc_output": "26f9-1f3ff-200d-2642-fe0f",
  64568. "uc_match": "26f9-fe0f-1f3ff-2642-fe0f",
  64569. "uc_greedy": "26f9-1f3ff-2642",
  64570. "shortnames": [":man_bouncing_ball_dark_skin_tone:"],
  64571. "category": "activity"
  64572. },
  64573. ":man_detective:": {
  64574. "uc_base": "1f575-2642",
  64575. "uc_output": "1f575-fe0f-200d-2642-fe0f",
  64576. "uc_match": "1f575-fe0f-200d-2642",
  64577. "uc_greedy": "1f575-2642",
  64578. "shortnames": [],
  64579. "category": "people"
  64580. },
  64581. ":man_golfing:": {
  64582. "uc_base": "1f3cc-2642",
  64583. "uc_output": "1f3cc-fe0f-200d-2642-fe0f",
  64584. "uc_match": "1f3cc-fe0f-200d-2642",
  64585. "uc_greedy": "1f3cc-2642",
  64586. "shortnames": [],
  64587. "category": "activity"
  64588. },
  64589. ":man_lifting_weights:": {
  64590. "uc_base": "1f3cb-2642",
  64591. "uc_output": "1f3cb-fe0f-200d-2642-fe0f",
  64592. "uc_match": "1f3cb-fe0f-200d-2642",
  64593. "uc_greedy": "1f3cb-2642",
  64594. "shortnames": [],
  64595. "category": "activity"
  64596. },
  64597. ":woman_bouncing_ball_tone1:": {
  64598. "uc_base": "26f9-1f3fb-2640",
  64599. "uc_output": "26f9-1f3fb-200d-2640-fe0f",
  64600. "uc_match": "26f9-fe0f-1f3fb-2640-fe0f",
  64601. "uc_greedy": "26f9-1f3fb-2640",
  64602. "shortnames": [":woman_bouncing_ball_light_skin_tone:"],
  64603. "category": "activity"
  64604. },
  64605. ":woman_bouncing_ball_tone2:": {
  64606. "uc_base": "26f9-1f3fc-2640",
  64607. "uc_output": "26f9-1f3fc-200d-2640-fe0f",
  64608. "uc_match": "26f9-fe0f-1f3fc-2640-fe0f",
  64609. "uc_greedy": "26f9-1f3fc-2640",
  64610. "shortnames": [":woman_bouncing_ball_medium_light_skin_tone:"],
  64611. "category": "activity"
  64612. },
  64613. ":woman_bouncing_ball_tone3:": {
  64614. "uc_base": "26f9-1f3fd-2640",
  64615. "uc_output": "26f9-1f3fd-200d-2640-fe0f",
  64616. "uc_match": "26f9-fe0f-1f3fd-2640-fe0f",
  64617. "uc_greedy": "26f9-1f3fd-2640",
  64618. "shortnames": [":woman_bouncing_ball_medium_skin_tone:"],
  64619. "category": "activity"
  64620. },
  64621. ":woman_bouncing_ball_tone4:": {
  64622. "uc_base": "26f9-1f3fe-2640",
  64623. "uc_output": "26f9-1f3fe-200d-2640-fe0f",
  64624. "uc_match": "26f9-fe0f-1f3fe-2640-fe0f",
  64625. "uc_greedy": "26f9-1f3fe-2640",
  64626. "shortnames": [":woman_bouncing_ball_medium_dark_skin_tone:"],
  64627. "category": "activity"
  64628. },
  64629. ":woman_bouncing_ball_tone5:": {
  64630. "uc_base": "26f9-1f3ff-2640",
  64631. "uc_output": "26f9-1f3ff-200d-2640-fe0f",
  64632. "uc_match": "26f9-fe0f-1f3ff-2640-fe0f",
  64633. "uc_greedy": "26f9-1f3ff-2640",
  64634. "shortnames": [":woman_bouncing_ball_dark_skin_tone:"],
  64635. "category": "activity"
  64636. },
  64637. ":woman_detective:": {
  64638. "uc_base": "1f575-2640",
  64639. "uc_output": "1f575-fe0f-200d-2640-fe0f",
  64640. "uc_match": "1f575-fe0f-200d-2640",
  64641. "uc_greedy": "1f575-2640",
  64642. "shortnames": [],
  64643. "category": "people"
  64644. },
  64645. ":woman_golfing:": {
  64646. "uc_base": "1f3cc-2640",
  64647. "uc_output": "1f3cc-fe0f-200d-2640-fe0f",
  64648. "uc_match": "1f3cc-fe0f-200d-2640",
  64649. "uc_greedy": "1f3cc-2640",
  64650. "shortnames": [],
  64651. "category": "activity"
  64652. },
  64653. ":woman_lifting_weights:": {
  64654. "uc_base": "1f3cb-2640",
  64655. "uc_output": "1f3cb-fe0f-200d-2640-fe0f",
  64656. "uc_match": "1f3cb-fe0f-200d-2640",
  64657. "uc_greedy": "1f3cb-2640",
  64658. "shortnames": [],
  64659. "category": "activity"
  64660. },
  64661. ":man_bouncing_ball:": {
  64662. "uc_base": "26f9-2642",
  64663. "uc_output": "26f9-fe0f-200d-2642-fe0f",
  64664. "uc_match": "26f9-fe0f-200d-2642",
  64665. "uc_greedy": "26f9-2642",
  64666. "shortnames": [],
  64667. "category": "activity"
  64668. },
  64669. ":woman_bouncing_ball:": {
  64670. "uc_base": "26f9-2640",
  64671. "uc_output": "26f9-fe0f-200d-2640-fe0f",
  64672. "uc_match": "26f9-fe0f-200d-2640",
  64673. "uc_greedy": "26f9-2640",
  64674. "shortnames": [],
  64675. "category": "activity"
  64676. },
  64677. ":man_artist_tone1:": {
  64678. "uc_base": "1f468-1f3fb-1f3a8",
  64679. "uc_output": "1f468-1f3fb-200d-1f3a8",
  64680. "uc_match": "1f468-1f3fb-1f3a8",
  64681. "uc_greedy": "1f468-1f3fb-1f3a8",
  64682. "shortnames": [":man_artist_light_skin_tone:"],
  64683. "category": "people"
  64684. },
  64685. ":man_artist_tone2:": {
  64686. "uc_base": "1f468-1f3fc-1f3a8",
  64687. "uc_output": "1f468-1f3fc-200d-1f3a8",
  64688. "uc_match": "1f468-1f3fc-1f3a8",
  64689. "uc_greedy": "1f468-1f3fc-1f3a8",
  64690. "shortnames": [":man_artist_medium_light_skin_tone:"],
  64691. "category": "people"
  64692. },
  64693. ":man_artist_tone3:": {
  64694. "uc_base": "1f468-1f3fd-1f3a8",
  64695. "uc_output": "1f468-1f3fd-200d-1f3a8",
  64696. "uc_match": "1f468-1f3fd-1f3a8",
  64697. "uc_greedy": "1f468-1f3fd-1f3a8",
  64698. "shortnames": [":man_artist_medium_skin_tone:"],
  64699. "category": "people"
  64700. },
  64701. ":man_artist_tone4:": {
  64702. "uc_base": "1f468-1f3fe-1f3a8",
  64703. "uc_output": "1f468-1f3fe-200d-1f3a8",
  64704. "uc_match": "1f468-1f3fe-1f3a8",
  64705. "uc_greedy": "1f468-1f3fe-1f3a8",
  64706. "shortnames": [":man_artist_medium_dark_skin_tone:"],
  64707. "category": "people"
  64708. },
  64709. ":man_artist_tone5:": {
  64710. "uc_base": "1f468-1f3ff-1f3a8",
  64711. "uc_output": "1f468-1f3ff-200d-1f3a8",
  64712. "uc_match": "1f468-1f3ff-1f3a8",
  64713. "uc_greedy": "1f468-1f3ff-1f3a8",
  64714. "shortnames": [":man_artist_dark_skin_tone:"],
  64715. "category": "people"
  64716. },
  64717. ":man_astronaut_tone1:": {
  64718. "uc_base": "1f468-1f3fb-1f680",
  64719. "uc_output": "1f468-1f3fb-200d-1f680",
  64720. "uc_match": "1f468-1f3fb-1f680",
  64721. "uc_greedy": "1f468-1f3fb-1f680",
  64722. "shortnames": [":man_astronaut_light_skin_tone:"],
  64723. "category": "people"
  64724. },
  64725. ":man_astronaut_tone2:": {
  64726. "uc_base": "1f468-1f3fc-1f680",
  64727. "uc_output": "1f468-1f3fc-200d-1f680",
  64728. "uc_match": "1f468-1f3fc-1f680",
  64729. "uc_greedy": "1f468-1f3fc-1f680",
  64730. "shortnames": [":man_astronaut_medium_light_skin_tone:"],
  64731. "category": "people"
  64732. },
  64733. ":man_astronaut_tone3:": {
  64734. "uc_base": "1f468-1f3fd-1f680",
  64735. "uc_output": "1f468-1f3fd-200d-1f680",
  64736. "uc_match": "1f468-1f3fd-1f680",
  64737. "uc_greedy": "1f468-1f3fd-1f680",
  64738. "shortnames": [":man_astronaut_medium_skin_tone:"],
  64739. "category": "people"
  64740. },
  64741. ":man_astronaut_tone4:": {
  64742. "uc_base": "1f468-1f3fe-1f680",
  64743. "uc_output": "1f468-1f3fe-200d-1f680",
  64744. "uc_match": "1f468-1f3fe-1f680",
  64745. "uc_greedy": "1f468-1f3fe-1f680",
  64746. "shortnames": [":man_astronaut_medium_dark_skin_tone:"],
  64747. "category": "people"
  64748. },
  64749. ":man_astronaut_tone5:": {
  64750. "uc_base": "1f468-1f3ff-1f680",
  64751. "uc_output": "1f468-1f3ff-200d-1f680",
  64752. "uc_match": "1f468-1f3ff-1f680",
  64753. "uc_greedy": "1f468-1f3ff-1f680",
  64754. "shortnames": [":man_astronaut_dark_skin_tone:"],
  64755. "category": "people"
  64756. },
  64757. ":man_cook_tone1:": {
  64758. "uc_base": "1f468-1f3fb-1f373",
  64759. "uc_output": "1f468-1f3fb-200d-1f373",
  64760. "uc_match": "1f468-1f3fb-1f373",
  64761. "uc_greedy": "1f468-1f3fb-1f373",
  64762. "shortnames": [":man_cook_light_skin_tone:"],
  64763. "category": "people"
  64764. },
  64765. ":man_cook_tone2:": {
  64766. "uc_base": "1f468-1f3fc-1f373",
  64767. "uc_output": "1f468-1f3fc-200d-1f373",
  64768. "uc_match": "1f468-1f3fc-1f373",
  64769. "uc_greedy": "1f468-1f3fc-1f373",
  64770. "shortnames": [":man_cook_medium_light_skin_tone:"],
  64771. "category": "people"
  64772. },
  64773. ":man_cook_tone3:": {
  64774. "uc_base": "1f468-1f3fd-1f373",
  64775. "uc_output": "1f468-1f3fd-200d-1f373",
  64776. "uc_match": "1f468-1f3fd-1f373",
  64777. "uc_greedy": "1f468-1f3fd-1f373",
  64778. "shortnames": [":man_cook_medium_skin_tone:"],
  64779. "category": "people"
  64780. },
  64781. ":man_cook_tone4:": {
  64782. "uc_base": "1f468-1f3fe-1f373",
  64783. "uc_output": "1f468-1f3fe-200d-1f373",
  64784. "uc_match": "1f468-1f3fe-1f373",
  64785. "uc_greedy": "1f468-1f3fe-1f373",
  64786. "shortnames": [":man_cook_medium_dark_skin_tone:"],
  64787. "category": "people"
  64788. },
  64789. ":man_cook_tone5:": {
  64790. "uc_base": "1f468-1f3ff-1f373",
  64791. "uc_output": "1f468-1f3ff-200d-1f373",
  64792. "uc_match": "1f468-1f3ff-1f373",
  64793. "uc_greedy": "1f468-1f3ff-1f373",
  64794. "shortnames": [":man_cook_dark_skin_tone:"],
  64795. "category": "people"
  64796. },
  64797. ":man_factory_worker_tone1:": {
  64798. "uc_base": "1f468-1f3fb-1f3ed",
  64799. "uc_output": "1f468-1f3fb-200d-1f3ed",
  64800. "uc_match": "1f468-1f3fb-1f3ed",
  64801. "uc_greedy": "1f468-1f3fb-1f3ed",
  64802. "shortnames": [":man_factory_worker_light_skin_tone:"],
  64803. "category": "people"
  64804. },
  64805. ":man_factory_worker_tone2:": {
  64806. "uc_base": "1f468-1f3fc-1f3ed",
  64807. "uc_output": "1f468-1f3fc-200d-1f3ed",
  64808. "uc_match": "1f468-1f3fc-1f3ed",
  64809. "uc_greedy": "1f468-1f3fc-1f3ed",
  64810. "shortnames": [":man_factory_worker_medium_light_skin_tone:"],
  64811. "category": "people"
  64812. },
  64813. ":man_factory_worker_tone3:": {
  64814. "uc_base": "1f468-1f3fd-1f3ed",
  64815. "uc_output": "1f468-1f3fd-200d-1f3ed",
  64816. "uc_match": "1f468-1f3fd-1f3ed",
  64817. "uc_greedy": "1f468-1f3fd-1f3ed",
  64818. "shortnames": [":man_factory_worker_medium_skin_tone:"],
  64819. "category": "people"
  64820. },
  64821. ":man_factory_worker_tone4:": {
  64822. "uc_base": "1f468-1f3fe-1f3ed",
  64823. "uc_output": "1f468-1f3fe-200d-1f3ed",
  64824. "uc_match": "1f468-1f3fe-1f3ed",
  64825. "uc_greedy": "1f468-1f3fe-1f3ed",
  64826. "shortnames": [":man_factory_worker_medium_dark_skin_tone:"],
  64827. "category": "people"
  64828. },
  64829. ":man_factory_worker_tone5:": {
  64830. "uc_base": "1f468-1f3ff-1f3ed",
  64831. "uc_output": "1f468-1f3ff-200d-1f3ed",
  64832. "uc_match": "1f468-1f3ff-1f3ed",
  64833. "uc_greedy": "1f468-1f3ff-1f3ed",
  64834. "shortnames": [":man_factory_worker_dark_skin_tone:"],
  64835. "category": "people"
  64836. },
  64837. ":man_farmer_tone1:": {
  64838. "uc_base": "1f468-1f3fb-1f33e",
  64839. "uc_output": "1f468-1f3fb-200d-1f33e",
  64840. "uc_match": "1f468-1f3fb-1f33e",
  64841. "uc_greedy": "1f468-1f3fb-1f33e",
  64842. "shortnames": [":man_farmer_light_skin_tone:"],
  64843. "category": "people"
  64844. },
  64845. ":man_farmer_tone2:": {
  64846. "uc_base": "1f468-1f3fc-1f33e",
  64847. "uc_output": "1f468-1f3fc-200d-1f33e",
  64848. "uc_match": "1f468-1f3fc-1f33e",
  64849. "uc_greedy": "1f468-1f3fc-1f33e",
  64850. "shortnames": [":man_farmer_medium_light_skin_tone:"],
  64851. "category": "people"
  64852. },
  64853. ":man_farmer_tone3:": {
  64854. "uc_base": "1f468-1f3fd-1f33e",
  64855. "uc_output": "1f468-1f3fd-200d-1f33e",
  64856. "uc_match": "1f468-1f3fd-1f33e",
  64857. "uc_greedy": "1f468-1f3fd-1f33e",
  64858. "shortnames": [":man_farmer_medium_skin_tone:"],
  64859. "category": "people"
  64860. },
  64861. ":man_farmer_tone4:": {
  64862. "uc_base": "1f468-1f3fe-1f33e",
  64863. "uc_output": "1f468-1f3fe-200d-1f33e",
  64864. "uc_match": "1f468-1f3fe-1f33e",
  64865. "uc_greedy": "1f468-1f3fe-1f33e",
  64866. "shortnames": [":man_farmer_medium_dark_skin_tone:"],
  64867. "category": "people"
  64868. },
  64869. ":man_farmer_tone5:": {
  64870. "uc_base": "1f468-1f3ff-1f33e",
  64871. "uc_output": "1f468-1f3ff-200d-1f33e",
  64872. "uc_match": "1f468-1f3ff-1f33e",
  64873. "uc_greedy": "1f468-1f3ff-1f33e",
  64874. "shortnames": [":man_farmer_dark_skin_tone:"],
  64875. "category": "people"
  64876. },
  64877. ":man_firefighter_tone1:": {
  64878. "uc_base": "1f468-1f3fb-1f692",
  64879. "uc_output": "1f468-1f3fb-200d-1f692",
  64880. "uc_match": "1f468-1f3fb-1f692",
  64881. "uc_greedy": "1f468-1f3fb-1f692",
  64882. "shortnames": [":man_firefighter_light_skin_tone:"],
  64883. "category": "people"
  64884. },
  64885. ":man_firefighter_tone2:": {
  64886. "uc_base": "1f468-1f3fc-1f692",
  64887. "uc_output": "1f468-1f3fc-200d-1f692",
  64888. "uc_match": "1f468-1f3fc-1f692",
  64889. "uc_greedy": "1f468-1f3fc-1f692",
  64890. "shortnames": [":man_firefighter_medium_light_skin_tone:"],
  64891. "category": "people"
  64892. },
  64893. ":man_firefighter_tone3:": {
  64894. "uc_base": "1f468-1f3fd-1f692",
  64895. "uc_output": "1f468-1f3fd-200d-1f692",
  64896. "uc_match": "1f468-1f3fd-1f692",
  64897. "uc_greedy": "1f468-1f3fd-1f692",
  64898. "shortnames": [":man_firefighter_medium_skin_tone:"],
  64899. "category": "people"
  64900. },
  64901. ":man_firefighter_tone4:": {
  64902. "uc_base": "1f468-1f3fe-1f692",
  64903. "uc_output": "1f468-1f3fe-200d-1f692",
  64904. "uc_match": "1f468-1f3fe-1f692",
  64905. "uc_greedy": "1f468-1f3fe-1f692",
  64906. "shortnames": [":man_firefighter_medium_dark_skin_tone:"],
  64907. "category": "people"
  64908. },
  64909. ":man_firefighter_tone5:": {
  64910. "uc_base": "1f468-1f3ff-1f692",
  64911. "uc_output": "1f468-1f3ff-200d-1f692",
  64912. "uc_match": "1f468-1f3ff-1f692",
  64913. "uc_greedy": "1f468-1f3ff-1f692",
  64914. "shortnames": [":man_firefighter_dark_skin_tone:"],
  64915. "category": "people"
  64916. },
  64917. ":man_mechanic_tone1:": {
  64918. "uc_base": "1f468-1f3fb-1f527",
  64919. "uc_output": "1f468-1f3fb-200d-1f527",
  64920. "uc_match": "1f468-1f3fb-1f527",
  64921. "uc_greedy": "1f468-1f3fb-1f527",
  64922. "shortnames": [":man_mechanic_light_skin_tone:"],
  64923. "category": "people"
  64924. },
  64925. ":man_mechanic_tone2:": {
  64926. "uc_base": "1f468-1f3fc-1f527",
  64927. "uc_output": "1f468-1f3fc-200d-1f527",
  64928. "uc_match": "1f468-1f3fc-1f527",
  64929. "uc_greedy": "1f468-1f3fc-1f527",
  64930. "shortnames": [":man_mechanic_medium_light_skin_tone:"],
  64931. "category": "people"
  64932. },
  64933. ":man_mechanic_tone3:": {
  64934. "uc_base": "1f468-1f3fd-1f527",
  64935. "uc_output": "1f468-1f3fd-200d-1f527",
  64936. "uc_match": "1f468-1f3fd-1f527",
  64937. "uc_greedy": "1f468-1f3fd-1f527",
  64938. "shortnames": [":man_mechanic_medium_skin_tone:"],
  64939. "category": "people"
  64940. },
  64941. ":man_mechanic_tone4:": {
  64942. "uc_base": "1f468-1f3fe-1f527",
  64943. "uc_output": "1f468-1f3fe-200d-1f527",
  64944. "uc_match": "1f468-1f3fe-1f527",
  64945. "uc_greedy": "1f468-1f3fe-1f527",
  64946. "shortnames": [":man_mechanic_medium_dark_skin_tone:"],
  64947. "category": "people"
  64948. },
  64949. ":man_mechanic_tone5:": {
  64950. "uc_base": "1f468-1f3ff-1f527",
  64951. "uc_output": "1f468-1f3ff-200d-1f527",
  64952. "uc_match": "1f468-1f3ff-1f527",
  64953. "uc_greedy": "1f468-1f3ff-1f527",
  64954. "shortnames": [":man_mechanic_dark_skin_tone:"],
  64955. "category": "people"
  64956. },
  64957. ":man_office_worker_tone1:": {
  64958. "uc_base": "1f468-1f3fb-1f4bc",
  64959. "uc_output": "1f468-1f3fb-200d-1f4bc",
  64960. "uc_match": "1f468-1f3fb-1f4bc",
  64961. "uc_greedy": "1f468-1f3fb-1f4bc",
  64962. "shortnames": [":man_office_worker_light_skin_tone:"],
  64963. "category": "people"
  64964. },
  64965. ":man_office_worker_tone2:": {
  64966. "uc_base": "1f468-1f3fc-1f4bc",
  64967. "uc_output": "1f468-1f3fc-200d-1f4bc",
  64968. "uc_match": "1f468-1f3fc-1f4bc",
  64969. "uc_greedy": "1f468-1f3fc-1f4bc",
  64970. "shortnames": [":man_office_worker_medium_light_skin_tone:"],
  64971. "category": "people"
  64972. },
  64973. ":man_office_worker_tone3:": {
  64974. "uc_base": "1f468-1f3fd-1f4bc",
  64975. "uc_output": "1f468-1f3fd-200d-1f4bc",
  64976. "uc_match": "1f468-1f3fd-1f4bc",
  64977. "uc_greedy": "1f468-1f3fd-1f4bc",
  64978. "shortnames": [":man_office_worker_medium_skin_tone:"],
  64979. "category": "people"
  64980. },
  64981. ":man_office_worker_tone4:": {
  64982. "uc_base": "1f468-1f3fe-1f4bc",
  64983. "uc_output": "1f468-1f3fe-200d-1f4bc",
  64984. "uc_match": "1f468-1f3fe-1f4bc",
  64985. "uc_greedy": "1f468-1f3fe-1f4bc",
  64986. "shortnames": [":man_office_worker_medium_dark_skin_tone:"],
  64987. "category": "people"
  64988. },
  64989. ":man_office_worker_tone5:": {
  64990. "uc_base": "1f468-1f3ff-1f4bc",
  64991. "uc_output": "1f468-1f3ff-200d-1f4bc",
  64992. "uc_match": "1f468-1f3ff-1f4bc",
  64993. "uc_greedy": "1f468-1f3ff-1f4bc",
  64994. "shortnames": [":man_office_worker_dark_skin_tone:"],
  64995. "category": "people"
  64996. },
  64997. ":man_scientist_tone1:": {
  64998. "uc_base": "1f468-1f3fb-1f52c",
  64999. "uc_output": "1f468-1f3fb-200d-1f52c",
  65000. "uc_match": "1f468-1f3fb-1f52c",
  65001. "uc_greedy": "1f468-1f3fb-1f52c",
  65002. "shortnames": [":man_scientist_light_skin_tone:"],
  65003. "category": "people"
  65004. },
  65005. ":man_scientist_tone2:": {
  65006. "uc_base": "1f468-1f3fc-1f52c",
  65007. "uc_output": "1f468-1f3fc-200d-1f52c",
  65008. "uc_match": "1f468-1f3fc-1f52c",
  65009. "uc_greedy": "1f468-1f3fc-1f52c",
  65010. "shortnames": [":man_scientist_medium_light_skin_tone:"],
  65011. "category": "people"
  65012. },
  65013. ":man_scientist_tone3:": {
  65014. "uc_base": "1f468-1f3fd-1f52c",
  65015. "uc_output": "1f468-1f3fd-200d-1f52c",
  65016. "uc_match": "1f468-1f3fd-1f52c",
  65017. "uc_greedy": "1f468-1f3fd-1f52c",
  65018. "shortnames": [":man_scientist_medium_skin_tone:"],
  65019. "category": "people"
  65020. },
  65021. ":man_scientist_tone4:": {
  65022. "uc_base": "1f468-1f3fe-1f52c",
  65023. "uc_output": "1f468-1f3fe-200d-1f52c",
  65024. "uc_match": "1f468-1f3fe-1f52c",
  65025. "uc_greedy": "1f468-1f3fe-1f52c",
  65026. "shortnames": [":man_scientist_medium_dark_skin_tone:"],
  65027. "category": "people"
  65028. },
  65029. ":man_scientist_tone5:": {
  65030. "uc_base": "1f468-1f3ff-1f52c",
  65031. "uc_output": "1f468-1f3ff-200d-1f52c",
  65032. "uc_match": "1f468-1f3ff-1f52c",
  65033. "uc_greedy": "1f468-1f3ff-1f52c",
  65034. "shortnames": [":man_scientist_dark_skin_tone:"],
  65035. "category": "people"
  65036. },
  65037. ":man_singer_tone1:": {
  65038. "uc_base": "1f468-1f3fb-1f3a4",
  65039. "uc_output": "1f468-1f3fb-200d-1f3a4",
  65040. "uc_match": "1f468-1f3fb-1f3a4",
  65041. "uc_greedy": "1f468-1f3fb-1f3a4",
  65042. "shortnames": [":man_singer_light_skin_tone:"],
  65043. "category": "people"
  65044. },
  65045. ":man_singer_tone2:": {
  65046. "uc_base": "1f468-1f3fc-1f3a4",
  65047. "uc_output": "1f468-1f3fc-200d-1f3a4",
  65048. "uc_match": "1f468-1f3fc-1f3a4",
  65049. "uc_greedy": "1f468-1f3fc-1f3a4",
  65050. "shortnames": [":man_singer_medium_light_skin_tone:"],
  65051. "category": "people"
  65052. },
  65053. ":man_singer_tone3:": {
  65054. "uc_base": "1f468-1f3fd-1f3a4",
  65055. "uc_output": "1f468-1f3fd-200d-1f3a4",
  65056. "uc_match": "1f468-1f3fd-1f3a4",
  65057. "uc_greedy": "1f468-1f3fd-1f3a4",
  65058. "shortnames": [":man_singer_medium_skin_tone:"],
  65059. "category": "people"
  65060. },
  65061. ":man_singer_tone4:": {
  65062. "uc_base": "1f468-1f3fe-1f3a4",
  65063. "uc_output": "1f468-1f3fe-200d-1f3a4",
  65064. "uc_match": "1f468-1f3fe-1f3a4",
  65065. "uc_greedy": "1f468-1f3fe-1f3a4",
  65066. "shortnames": [":man_singer_medium_dark_skin_tone:"],
  65067. "category": "people"
  65068. },
  65069. ":man_singer_tone5:": {
  65070. "uc_base": "1f468-1f3ff-1f3a4",
  65071. "uc_output": "1f468-1f3ff-200d-1f3a4",
  65072. "uc_match": "1f468-1f3ff-1f3a4",
  65073. "uc_greedy": "1f468-1f3ff-1f3a4",
  65074. "shortnames": [":man_singer_dark_skin_tone:"],
  65075. "category": "people"
  65076. },
  65077. ":man_student_tone1:": {
  65078. "uc_base": "1f468-1f3fb-1f393",
  65079. "uc_output": "1f468-1f3fb-200d-1f393",
  65080. "uc_match": "1f468-1f3fb-1f393",
  65081. "uc_greedy": "1f468-1f3fb-1f393",
  65082. "shortnames": [":man_student_light_skin_tone:"],
  65083. "category": "people"
  65084. },
  65085. ":man_student_tone2:": {
  65086. "uc_base": "1f468-1f3fc-1f393",
  65087. "uc_output": "1f468-1f3fc-200d-1f393",
  65088. "uc_match": "1f468-1f3fc-1f393",
  65089. "uc_greedy": "1f468-1f3fc-1f393",
  65090. "shortnames": [":man_student_medium_light_skin_tone:"],
  65091. "category": "people"
  65092. },
  65093. ":man_student_tone3:": {
  65094. "uc_base": "1f468-1f3fd-1f393",
  65095. "uc_output": "1f468-1f3fd-200d-1f393",
  65096. "uc_match": "1f468-1f3fd-1f393",
  65097. "uc_greedy": "1f468-1f3fd-1f393",
  65098. "shortnames": [":man_student_medium_skin_tone:"],
  65099. "category": "people"
  65100. },
  65101. ":man_student_tone4:": {
  65102. "uc_base": "1f468-1f3fe-1f393",
  65103. "uc_output": "1f468-1f3fe-200d-1f393",
  65104. "uc_match": "1f468-1f3fe-1f393",
  65105. "uc_greedy": "1f468-1f3fe-1f393",
  65106. "shortnames": [":man_student_medium_dark_skin_tone:"],
  65107. "category": "people"
  65108. },
  65109. ":man_student_tone5:": {
  65110. "uc_base": "1f468-1f3ff-1f393",
  65111. "uc_output": "1f468-1f3ff-200d-1f393",
  65112. "uc_match": "1f468-1f3ff-1f393",
  65113. "uc_greedy": "1f468-1f3ff-1f393",
  65114. "shortnames": [":man_student_dark_skin_tone:"],
  65115. "category": "people"
  65116. },
  65117. ":man_teacher_tone1:": {
  65118. "uc_base": "1f468-1f3fb-1f3eb",
  65119. "uc_output": "1f468-1f3fb-200d-1f3eb",
  65120. "uc_match": "1f468-1f3fb-1f3eb",
  65121. "uc_greedy": "1f468-1f3fb-1f3eb",
  65122. "shortnames": [":man_teacher_light_skin_tone:"],
  65123. "category": "people"
  65124. },
  65125. ":man_teacher_tone2:": {
  65126. "uc_base": "1f468-1f3fc-1f3eb",
  65127. "uc_output": "1f468-1f3fc-200d-1f3eb",
  65128. "uc_match": "1f468-1f3fc-1f3eb",
  65129. "uc_greedy": "1f468-1f3fc-1f3eb",
  65130. "shortnames": [":man_teacher_medium_light_skin_tone:"],
  65131. "category": "people"
  65132. },
  65133. ":man_teacher_tone3:": {
  65134. "uc_base": "1f468-1f3fd-1f3eb",
  65135. "uc_output": "1f468-1f3fd-200d-1f3eb",
  65136. "uc_match": "1f468-1f3fd-1f3eb",
  65137. "uc_greedy": "1f468-1f3fd-1f3eb",
  65138. "shortnames": [":man_teacher_medium_skin_tone:"],
  65139. "category": "people"
  65140. },
  65141. ":man_teacher_tone4:": {
  65142. "uc_base": "1f468-1f3fe-1f3eb",
  65143. "uc_output": "1f468-1f3fe-200d-1f3eb",
  65144. "uc_match": "1f468-1f3fe-1f3eb",
  65145. "uc_greedy": "1f468-1f3fe-1f3eb",
  65146. "shortnames": [":man_teacher_medium_dark_skin_tone:"],
  65147. "category": "people"
  65148. },
  65149. ":man_teacher_tone5:": {
  65150. "uc_base": "1f468-1f3ff-1f3eb",
  65151. "uc_output": "1f468-1f3ff-200d-1f3eb",
  65152. "uc_match": "1f468-1f3ff-1f3eb",
  65153. "uc_greedy": "1f468-1f3ff-1f3eb",
  65154. "shortnames": [":man_teacher_dark_skin_tone:"],
  65155. "category": "people"
  65156. },
  65157. ":man_technologist_tone1:": {
  65158. "uc_base": "1f468-1f3fb-1f4bb",
  65159. "uc_output": "1f468-1f3fb-200d-1f4bb",
  65160. "uc_match": "1f468-1f3fb-1f4bb",
  65161. "uc_greedy": "1f468-1f3fb-1f4bb",
  65162. "shortnames": [":man_technologist_light_skin_tone:"],
  65163. "category": "people"
  65164. },
  65165. ":man_technologist_tone2:": {
  65166. "uc_base": "1f468-1f3fc-1f4bb",
  65167. "uc_output": "1f468-1f3fc-200d-1f4bb",
  65168. "uc_match": "1f468-1f3fc-1f4bb",
  65169. "uc_greedy": "1f468-1f3fc-1f4bb",
  65170. "shortnames": [":man_technologist_medium_light_skin_tone:"],
  65171. "category": "people"
  65172. },
  65173. ":man_technologist_tone3:": {
  65174. "uc_base": "1f468-1f3fd-1f4bb",
  65175. "uc_output": "1f468-1f3fd-200d-1f4bb",
  65176. "uc_match": "1f468-1f3fd-1f4bb",
  65177. "uc_greedy": "1f468-1f3fd-1f4bb",
  65178. "shortnames": [":man_technologist_medium_skin_tone:"],
  65179. "category": "people"
  65180. },
  65181. ":man_technologist_tone4:": {
  65182. "uc_base": "1f468-1f3fe-1f4bb",
  65183. "uc_output": "1f468-1f3fe-200d-1f4bb",
  65184. "uc_match": "1f468-1f3fe-1f4bb",
  65185. "uc_greedy": "1f468-1f3fe-1f4bb",
  65186. "shortnames": [":man_technologist_medium_dark_skin_tone:"],
  65187. "category": "people"
  65188. },
  65189. ":man_technologist_tone5:": {
  65190. "uc_base": "1f468-1f3ff-1f4bb",
  65191. "uc_output": "1f468-1f3ff-200d-1f4bb",
  65192. "uc_match": "1f468-1f3ff-1f4bb",
  65193. "uc_greedy": "1f468-1f3ff-1f4bb",
  65194. "shortnames": [":man_technologist_dark_skin_tone:"],
  65195. "category": "people"
  65196. },
  65197. ":woman_artist_tone1:": {
  65198. "uc_base": "1f469-1f3fb-1f3a8",
  65199. "uc_output": "1f469-1f3fb-200d-1f3a8",
  65200. "uc_match": "1f469-1f3fb-1f3a8",
  65201. "uc_greedy": "1f469-1f3fb-1f3a8",
  65202. "shortnames": [":woman_artist_light_skin_tone:"],
  65203. "category": "people"
  65204. },
  65205. ":woman_artist_tone2:": {
  65206. "uc_base": "1f469-1f3fc-1f3a8",
  65207. "uc_output": "1f469-1f3fc-200d-1f3a8",
  65208. "uc_match": "1f469-1f3fc-1f3a8",
  65209. "uc_greedy": "1f469-1f3fc-1f3a8",
  65210. "shortnames": [":woman_artist_medium_light_skin_tone:"],
  65211. "category": "people"
  65212. },
  65213. ":woman_artist_tone3:": {
  65214. "uc_base": "1f469-1f3fd-1f3a8",
  65215. "uc_output": "1f469-1f3fd-200d-1f3a8",
  65216. "uc_match": "1f469-1f3fd-1f3a8",
  65217. "uc_greedy": "1f469-1f3fd-1f3a8",
  65218. "shortnames": [":woman_artist_medium_skin_tone:"],
  65219. "category": "people"
  65220. },
  65221. ":woman_artist_tone4:": {
  65222. "uc_base": "1f469-1f3fe-1f3a8",
  65223. "uc_output": "1f469-1f3fe-200d-1f3a8",
  65224. "uc_match": "1f469-1f3fe-1f3a8",
  65225. "uc_greedy": "1f469-1f3fe-1f3a8",
  65226. "shortnames": [":woman_artist_medium_dark_skin_tone:"],
  65227. "category": "people"
  65228. },
  65229. ":woman_artist_tone5:": {
  65230. "uc_base": "1f469-1f3ff-1f3a8",
  65231. "uc_output": "1f469-1f3ff-200d-1f3a8",
  65232. "uc_match": "1f469-1f3ff-1f3a8",
  65233. "uc_greedy": "1f469-1f3ff-1f3a8",
  65234. "shortnames": [":woman_artist_dark_skin_tone:"],
  65235. "category": "people"
  65236. },
  65237. ":woman_astronaut_tone1:": {
  65238. "uc_base": "1f469-1f3fb-1f680",
  65239. "uc_output": "1f469-1f3fb-200d-1f680",
  65240. "uc_match": "1f469-1f3fb-1f680",
  65241. "uc_greedy": "1f469-1f3fb-1f680",
  65242. "shortnames": [":woman_astronaut_light_skin_tone:"],
  65243. "category": "people"
  65244. },
  65245. ":woman_astronaut_tone2:": {
  65246. "uc_base": "1f469-1f3fc-1f680",
  65247. "uc_output": "1f469-1f3fc-200d-1f680",
  65248. "uc_match": "1f469-1f3fc-1f680",
  65249. "uc_greedy": "1f469-1f3fc-1f680",
  65250. "shortnames": [":woman_astronaut_medium_light_skin_tone:"],
  65251. "category": "people"
  65252. },
  65253. ":woman_astronaut_tone3:": {
  65254. "uc_base": "1f469-1f3fd-1f680",
  65255. "uc_output": "1f469-1f3fd-200d-1f680",
  65256. "uc_match": "1f469-1f3fd-1f680",
  65257. "uc_greedy": "1f469-1f3fd-1f680",
  65258. "shortnames": [":woman_astronaut_medium_skin_tone:"],
  65259. "category": "people"
  65260. },
  65261. ":woman_astronaut_tone4:": {
  65262. "uc_base": "1f469-1f3fe-1f680",
  65263. "uc_output": "1f469-1f3fe-200d-1f680",
  65264. "uc_match": "1f469-1f3fe-1f680",
  65265. "uc_greedy": "1f469-1f3fe-1f680",
  65266. "shortnames": [":woman_astronaut_medium_dark_skin_tone:"],
  65267. "category": "people"
  65268. },
  65269. ":woman_astronaut_tone5:": {
  65270. "uc_base": "1f469-1f3ff-1f680",
  65271. "uc_output": "1f469-1f3ff-200d-1f680",
  65272. "uc_match": "1f469-1f3ff-1f680",
  65273. "uc_greedy": "1f469-1f3ff-1f680",
  65274. "shortnames": [":woman_astronaut_dark_skin_tone:"],
  65275. "category": "people"
  65276. },
  65277. ":woman_cook_tone1:": {
  65278. "uc_base": "1f469-1f3fb-1f373",
  65279. "uc_output": "1f469-1f3fb-200d-1f373",
  65280. "uc_match": "1f469-1f3fb-1f373",
  65281. "uc_greedy": "1f469-1f3fb-1f373",
  65282. "shortnames": [":woman_cook_light_skin_tone:"],
  65283. "category": "people"
  65284. },
  65285. ":woman_cook_tone2:": {
  65286. "uc_base": "1f469-1f3fc-1f373",
  65287. "uc_output": "1f469-1f3fc-200d-1f373",
  65288. "uc_match": "1f469-1f3fc-1f373",
  65289. "uc_greedy": "1f469-1f3fc-1f373",
  65290. "shortnames": [":woman_cook_medium_light_skin_tone:"],
  65291. "category": "people"
  65292. },
  65293. ":woman_cook_tone3:": {
  65294. "uc_base": "1f469-1f3fd-1f373",
  65295. "uc_output": "1f469-1f3fd-200d-1f373",
  65296. "uc_match": "1f469-1f3fd-1f373",
  65297. "uc_greedy": "1f469-1f3fd-1f373",
  65298. "shortnames": [":woman_cook_medium_skin_tone:"],
  65299. "category": "people"
  65300. },
  65301. ":woman_cook_tone4:": {
  65302. "uc_base": "1f469-1f3fe-1f373",
  65303. "uc_output": "1f469-1f3fe-200d-1f373",
  65304. "uc_match": "1f469-1f3fe-1f373",
  65305. "uc_greedy": "1f469-1f3fe-1f373",
  65306. "shortnames": [":woman_cook_medium_dark_skin_tone:"],
  65307. "category": "people"
  65308. },
  65309. ":woman_cook_tone5:": {
  65310. "uc_base": "1f469-1f3ff-1f373",
  65311. "uc_output": "1f469-1f3ff-200d-1f373",
  65312. "uc_match": "1f469-1f3ff-1f373",
  65313. "uc_greedy": "1f469-1f3ff-1f373",
  65314. "shortnames": [":woman_cook_dark_skin_tone:"],
  65315. "category": "people"
  65316. },
  65317. ":woman_factory_worker_tone1:": {
  65318. "uc_base": "1f469-1f3fb-1f3ed",
  65319. "uc_output": "1f469-1f3fb-200d-1f3ed",
  65320. "uc_match": "1f469-1f3fb-1f3ed",
  65321. "uc_greedy": "1f469-1f3fb-1f3ed",
  65322. "shortnames": [":woman_factory_worker_light_skin_tone:"],
  65323. "category": "people"
  65324. },
  65325. ":woman_factory_worker_tone2:": {
  65326. "uc_base": "1f469-1f3fc-1f3ed",
  65327. "uc_output": "1f469-1f3fc-200d-1f3ed",
  65328. "uc_match": "1f469-1f3fc-1f3ed",
  65329. "uc_greedy": "1f469-1f3fc-1f3ed",
  65330. "shortnames": [":woman_factory_worker_medium_light_skin_tone:"],
  65331. "category": "people"
  65332. },
  65333. ":woman_factory_worker_tone3:": {
  65334. "uc_base": "1f469-1f3fd-1f3ed",
  65335. "uc_output": "1f469-1f3fd-200d-1f3ed",
  65336. "uc_match": "1f469-1f3fd-1f3ed",
  65337. "uc_greedy": "1f469-1f3fd-1f3ed",
  65338. "shortnames": [":woman_factory_worker_medium_skin_tone:"],
  65339. "category": "people"
  65340. },
  65341. ":woman_factory_worker_tone4:": {
  65342. "uc_base": "1f469-1f3fe-1f3ed",
  65343. "uc_output": "1f469-1f3fe-200d-1f3ed",
  65344. "uc_match": "1f469-1f3fe-1f3ed",
  65345. "uc_greedy": "1f469-1f3fe-1f3ed",
  65346. "shortnames": [":woman_factory_worker_medium_dark_skin_tone:"],
  65347. "category": "people"
  65348. },
  65349. ":woman_factory_worker_tone5:": {
  65350. "uc_base": "1f469-1f3ff-1f3ed",
  65351. "uc_output": "1f469-1f3ff-200d-1f3ed",
  65352. "uc_match": "1f469-1f3ff-1f3ed",
  65353. "uc_greedy": "1f469-1f3ff-1f3ed",
  65354. "shortnames": [":woman_factory_worker_dark_skin_tone:"],
  65355. "category": "people"
  65356. },
  65357. ":woman_farmer_tone1:": {
  65358. "uc_base": "1f469-1f3fb-1f33e",
  65359. "uc_output": "1f469-1f3fb-200d-1f33e",
  65360. "uc_match": "1f469-1f3fb-1f33e",
  65361. "uc_greedy": "1f469-1f3fb-1f33e",
  65362. "shortnames": [":woman_farmer_light_skin_tone:"],
  65363. "category": "people"
  65364. },
  65365. ":woman_farmer_tone2:": {
  65366. "uc_base": "1f469-1f3fc-1f33e",
  65367. "uc_output": "1f469-1f3fc-200d-1f33e",
  65368. "uc_match": "1f469-1f3fc-1f33e",
  65369. "uc_greedy": "1f469-1f3fc-1f33e",
  65370. "shortnames": [":woman_farmer_medium_light_skin_tone:"],
  65371. "category": "people"
  65372. },
  65373. ":woman_farmer_tone3:": {
  65374. "uc_base": "1f469-1f3fd-1f33e",
  65375. "uc_output": "1f469-1f3fd-200d-1f33e",
  65376. "uc_match": "1f469-1f3fd-1f33e",
  65377. "uc_greedy": "1f469-1f3fd-1f33e",
  65378. "shortnames": [":woman_farmer_medium_skin_tone:"],
  65379. "category": "people"
  65380. },
  65381. ":woman_farmer_tone4:": {
  65382. "uc_base": "1f469-1f3fe-1f33e",
  65383. "uc_output": "1f469-1f3fe-200d-1f33e",
  65384. "uc_match": "1f469-1f3fe-1f33e",
  65385. "uc_greedy": "1f469-1f3fe-1f33e",
  65386. "shortnames": [":woman_farmer_medium_dark_skin_tone:"],
  65387. "category": "people"
  65388. },
  65389. ":woman_farmer_tone5:": {
  65390. "uc_base": "1f469-1f3ff-1f33e",
  65391. "uc_output": "1f469-1f3ff-200d-1f33e",
  65392. "uc_match": "1f469-1f3ff-1f33e",
  65393. "uc_greedy": "1f469-1f3ff-1f33e",
  65394. "shortnames": [":woman_farmer_dark_skin_tone:"],
  65395. "category": "people"
  65396. },
  65397. ":woman_firefighter_tone1:": {
  65398. "uc_base": "1f469-1f3fb-1f692",
  65399. "uc_output": "1f469-1f3fb-200d-1f692",
  65400. "uc_match": "1f469-1f3fb-1f692",
  65401. "uc_greedy": "1f469-1f3fb-1f692",
  65402. "shortnames": [":woman_firefighter_light_skin_tone:"],
  65403. "category": "people"
  65404. },
  65405. ":woman_firefighter_tone2:": {
  65406. "uc_base": "1f469-1f3fc-1f692",
  65407. "uc_output": "1f469-1f3fc-200d-1f692",
  65408. "uc_match": "1f469-1f3fc-1f692",
  65409. "uc_greedy": "1f469-1f3fc-1f692",
  65410. "shortnames": [":woman_firefighter_medium_light_skin_tone:"],
  65411. "category": "people"
  65412. },
  65413. ":woman_firefighter_tone3:": {
  65414. "uc_base": "1f469-1f3fd-1f692",
  65415. "uc_output": "1f469-1f3fd-200d-1f692",
  65416. "uc_match": "1f469-1f3fd-1f692",
  65417. "uc_greedy": "1f469-1f3fd-1f692",
  65418. "shortnames": [":woman_firefighter_medium_skin_tone:"],
  65419. "category": "people"
  65420. },
  65421. ":woman_firefighter_tone4:": {
  65422. "uc_base": "1f469-1f3fe-1f692",
  65423. "uc_output": "1f469-1f3fe-200d-1f692",
  65424. "uc_match": "1f469-1f3fe-1f692",
  65425. "uc_greedy": "1f469-1f3fe-1f692",
  65426. "shortnames": [":woman_firefighter_medium_dark_skin_tone:"],
  65427. "category": "people"
  65428. },
  65429. ":woman_firefighter_tone5:": {
  65430. "uc_base": "1f469-1f3ff-1f692",
  65431. "uc_output": "1f469-1f3ff-200d-1f692",
  65432. "uc_match": "1f469-1f3ff-1f692",
  65433. "uc_greedy": "1f469-1f3ff-1f692",
  65434. "shortnames": [":woman_firefighter_dark_skin_tone:"],
  65435. "category": "people"
  65436. },
  65437. ":woman_mechanic_tone1:": {
  65438. "uc_base": "1f469-1f3fb-1f527",
  65439. "uc_output": "1f469-1f3fb-200d-1f527",
  65440. "uc_match": "1f469-1f3fb-1f527",
  65441. "uc_greedy": "1f469-1f3fb-1f527",
  65442. "shortnames": [":woman_mechanic_light_skin_tone:"],
  65443. "category": "people"
  65444. },
  65445. ":woman_mechanic_tone2:": {
  65446. "uc_base": "1f469-1f3fc-1f527",
  65447. "uc_output": "1f469-1f3fc-200d-1f527",
  65448. "uc_match": "1f469-1f3fc-1f527",
  65449. "uc_greedy": "1f469-1f3fc-1f527",
  65450. "shortnames": [":woman_mechanic_medium_light_skin_tone:"],
  65451. "category": "people"
  65452. },
  65453. ":woman_mechanic_tone3:": {
  65454. "uc_base": "1f469-1f3fd-1f527",
  65455. "uc_output": "1f469-1f3fd-200d-1f527",
  65456. "uc_match": "1f469-1f3fd-1f527",
  65457. "uc_greedy": "1f469-1f3fd-1f527",
  65458. "shortnames": [":woman_mechanic_medium_skin_tone:"],
  65459. "category": "people"
  65460. },
  65461. ":woman_mechanic_tone4:": {
  65462. "uc_base": "1f469-1f3fe-1f527",
  65463. "uc_output": "1f469-1f3fe-200d-1f527",
  65464. "uc_match": "1f469-1f3fe-1f527",
  65465. "uc_greedy": "1f469-1f3fe-1f527",
  65466. "shortnames": [":woman_mechanic_medium_dark_skin_tone:"],
  65467. "category": "people"
  65468. },
  65469. ":woman_mechanic_tone5:": {
  65470. "uc_base": "1f469-1f3ff-1f527",
  65471. "uc_output": "1f469-1f3ff-200d-1f527",
  65472. "uc_match": "1f469-1f3ff-1f527",
  65473. "uc_greedy": "1f469-1f3ff-1f527",
  65474. "shortnames": [":woman_mechanic_dark_skin_tone:"],
  65475. "category": "people"
  65476. },
  65477. ":woman_office_worker_tone1:": {
  65478. "uc_base": "1f469-1f3fb-1f4bc",
  65479. "uc_output": "1f469-1f3fb-200d-1f4bc",
  65480. "uc_match": "1f469-1f3fb-1f4bc",
  65481. "uc_greedy": "1f469-1f3fb-1f4bc",
  65482. "shortnames": [":woman_office_worker_light_skin_tone:"],
  65483. "category": "people"
  65484. },
  65485. ":woman_office_worker_tone2:": {
  65486. "uc_base": "1f469-1f3fc-1f4bc",
  65487. "uc_output": "1f469-1f3fc-200d-1f4bc",
  65488. "uc_match": "1f469-1f3fc-1f4bc",
  65489. "uc_greedy": "1f469-1f3fc-1f4bc",
  65490. "shortnames": [":woman_office_worker_medium_light_skin_tone:"],
  65491. "category": "people"
  65492. },
  65493. ":woman_office_worker_tone3:": {
  65494. "uc_base": "1f469-1f3fd-1f4bc",
  65495. "uc_output": "1f469-1f3fd-200d-1f4bc",
  65496. "uc_match": "1f469-1f3fd-1f4bc",
  65497. "uc_greedy": "1f469-1f3fd-1f4bc",
  65498. "shortnames": [":woman_office_worker_medium_skin_tone:"],
  65499. "category": "people"
  65500. },
  65501. ":woman_office_worker_tone4:": {
  65502. "uc_base": "1f469-1f3fe-1f4bc",
  65503. "uc_output": "1f469-1f3fe-200d-1f4bc",
  65504. "uc_match": "1f469-1f3fe-1f4bc",
  65505. "uc_greedy": "1f469-1f3fe-1f4bc",
  65506. "shortnames": [":woman_office_worker_medium_dark_skin_tone:"],
  65507. "category": "people"
  65508. },
  65509. ":woman_office_worker_tone5:": {
  65510. "uc_base": "1f469-1f3ff-1f4bc",
  65511. "uc_output": "1f469-1f3ff-200d-1f4bc",
  65512. "uc_match": "1f469-1f3ff-1f4bc",
  65513. "uc_greedy": "1f469-1f3ff-1f4bc",
  65514. "shortnames": [":woman_office_worker_dark_skin_tone:"],
  65515. "category": "people"
  65516. },
  65517. ":woman_scientist_tone1:": {
  65518. "uc_base": "1f469-1f3fb-1f52c",
  65519. "uc_output": "1f469-1f3fb-200d-1f52c",
  65520. "uc_match": "1f469-1f3fb-1f52c",
  65521. "uc_greedy": "1f469-1f3fb-1f52c",
  65522. "shortnames": [":woman_scientist_light_skin_tone:"],
  65523. "category": "people"
  65524. },
  65525. ":woman_scientist_tone2:": {
  65526. "uc_base": "1f469-1f3fc-1f52c",
  65527. "uc_output": "1f469-1f3fc-200d-1f52c",
  65528. "uc_match": "1f469-1f3fc-1f52c",
  65529. "uc_greedy": "1f469-1f3fc-1f52c",
  65530. "shortnames": [":woman_scientist_medium_light_skin_tone:"],
  65531. "category": "people"
  65532. },
  65533. ":woman_scientist_tone3:": {
  65534. "uc_base": "1f469-1f3fd-1f52c",
  65535. "uc_output": "1f469-1f3fd-200d-1f52c",
  65536. "uc_match": "1f469-1f3fd-1f52c",
  65537. "uc_greedy": "1f469-1f3fd-1f52c",
  65538. "shortnames": [":woman_scientist_medium_skin_tone:"],
  65539. "category": "people"
  65540. },
  65541. ":woman_scientist_tone4:": {
  65542. "uc_base": "1f469-1f3fe-1f52c",
  65543. "uc_output": "1f469-1f3fe-200d-1f52c",
  65544. "uc_match": "1f469-1f3fe-1f52c",
  65545. "uc_greedy": "1f469-1f3fe-1f52c",
  65546. "shortnames": [":woman_scientist_medium_dark_skin_tone:"],
  65547. "category": "people"
  65548. },
  65549. ":woman_scientist_tone5:": {
  65550. "uc_base": "1f469-1f3ff-1f52c",
  65551. "uc_output": "1f469-1f3ff-200d-1f52c",
  65552. "uc_match": "1f469-1f3ff-1f52c",
  65553. "uc_greedy": "1f469-1f3ff-1f52c",
  65554. "shortnames": [":woman_scientist_dark_skin_tone:"],
  65555. "category": "people"
  65556. },
  65557. ":woman_singer_tone1:": {
  65558. "uc_base": "1f469-1f3fb-1f3a4",
  65559. "uc_output": "1f469-1f3fb-200d-1f3a4",
  65560. "uc_match": "1f469-1f3fb-1f3a4",
  65561. "uc_greedy": "1f469-1f3fb-1f3a4",
  65562. "shortnames": [":woman_singer_light_skin_tone:"],
  65563. "category": "people"
  65564. },
  65565. ":woman_singer_tone2:": {
  65566. "uc_base": "1f469-1f3fc-1f3a4",
  65567. "uc_output": "1f469-1f3fc-200d-1f3a4",
  65568. "uc_match": "1f469-1f3fc-1f3a4",
  65569. "uc_greedy": "1f469-1f3fc-1f3a4",
  65570. "shortnames": [":woman_singer_medium_light_skin_tone:"],
  65571. "category": "people"
  65572. },
  65573. ":woman_singer_tone3:": {
  65574. "uc_base": "1f469-1f3fd-1f3a4",
  65575. "uc_output": "1f469-1f3fd-200d-1f3a4",
  65576. "uc_match": "1f469-1f3fd-1f3a4",
  65577. "uc_greedy": "1f469-1f3fd-1f3a4",
  65578. "shortnames": [":woman_singer_medium_skin_tone:"],
  65579. "category": "people"
  65580. },
  65581. ":woman_singer_tone4:": {
  65582. "uc_base": "1f469-1f3fe-1f3a4",
  65583. "uc_output": "1f469-1f3fe-200d-1f3a4",
  65584. "uc_match": "1f469-1f3fe-1f3a4",
  65585. "uc_greedy": "1f469-1f3fe-1f3a4",
  65586. "shortnames": [":woman_singer_medium_dark_skin_tone:"],
  65587. "category": "people"
  65588. },
  65589. ":woman_singer_tone5:": {
  65590. "uc_base": "1f469-1f3ff-1f3a4",
  65591. "uc_output": "1f469-1f3ff-200d-1f3a4",
  65592. "uc_match": "1f469-1f3ff-1f3a4",
  65593. "uc_greedy": "1f469-1f3ff-1f3a4",
  65594. "shortnames": [":woman_singer_dark_skin_tone:"],
  65595. "category": "people"
  65596. },
  65597. ":woman_student_tone1:": {
  65598. "uc_base": "1f469-1f3fb-1f393",
  65599. "uc_output": "1f469-1f3fb-200d-1f393",
  65600. "uc_match": "1f469-1f3fb-1f393",
  65601. "uc_greedy": "1f469-1f3fb-1f393",
  65602. "shortnames": [":woman_student_light_skin_tone:"],
  65603. "category": "people"
  65604. },
  65605. ":woman_student_tone2:": {
  65606. "uc_base": "1f469-1f3fc-1f393",
  65607. "uc_output": "1f469-1f3fc-200d-1f393",
  65608. "uc_match": "1f469-1f3fc-1f393",
  65609. "uc_greedy": "1f469-1f3fc-1f393",
  65610. "shortnames": [":woman_student_medium_light_skin_tone:"],
  65611. "category": "people"
  65612. },
  65613. ":woman_student_tone3:": {
  65614. "uc_base": "1f469-1f3fd-1f393",
  65615. "uc_output": "1f469-1f3fd-200d-1f393",
  65616. "uc_match": "1f469-1f3fd-1f393",
  65617. "uc_greedy": "1f469-1f3fd-1f393",
  65618. "shortnames": [":woman_student_medium_skin_tone:"],
  65619. "category": "people"
  65620. },
  65621. ":woman_student_tone4:": {
  65622. "uc_base": "1f469-1f3fe-1f393",
  65623. "uc_output": "1f469-1f3fe-200d-1f393",
  65624. "uc_match": "1f469-1f3fe-1f393",
  65625. "uc_greedy": "1f469-1f3fe-1f393",
  65626. "shortnames": [":woman_student_medium_dark_skin_tone:"],
  65627. "category": "people"
  65628. },
  65629. ":woman_student_tone5:": {
  65630. "uc_base": "1f469-1f3ff-1f393",
  65631. "uc_output": "1f469-1f3ff-200d-1f393",
  65632. "uc_match": "1f469-1f3ff-1f393",
  65633. "uc_greedy": "1f469-1f3ff-1f393",
  65634. "shortnames": [":woman_student_dark_skin_tone:"],
  65635. "category": "people"
  65636. },
  65637. ":woman_teacher_tone1:": {
  65638. "uc_base": "1f469-1f3fb-1f3eb",
  65639. "uc_output": "1f469-1f3fb-200d-1f3eb",
  65640. "uc_match": "1f469-1f3fb-1f3eb",
  65641. "uc_greedy": "1f469-1f3fb-1f3eb",
  65642. "shortnames": [":woman_teacher_light_skin_tone:"],
  65643. "category": "people"
  65644. },
  65645. ":woman_teacher_tone2:": {
  65646. "uc_base": "1f469-1f3fc-1f3eb",
  65647. "uc_output": "1f469-1f3fc-200d-1f3eb",
  65648. "uc_match": "1f469-1f3fc-1f3eb",
  65649. "uc_greedy": "1f469-1f3fc-1f3eb",
  65650. "shortnames": [":woman_teacher_medium_light_skin_tone:"],
  65651. "category": "people"
  65652. },
  65653. ":woman_teacher_tone3:": {
  65654. "uc_base": "1f469-1f3fd-1f3eb",
  65655. "uc_output": "1f469-1f3fd-200d-1f3eb",
  65656. "uc_match": "1f469-1f3fd-1f3eb",
  65657. "uc_greedy": "1f469-1f3fd-1f3eb",
  65658. "shortnames": [":woman_teacher_medium_skin_tone:"],
  65659. "category": "people"
  65660. },
  65661. ":woman_teacher_tone4:": {
  65662. "uc_base": "1f469-1f3fe-1f3eb",
  65663. "uc_output": "1f469-1f3fe-200d-1f3eb",
  65664. "uc_match": "1f469-1f3fe-1f3eb",
  65665. "uc_greedy": "1f469-1f3fe-1f3eb",
  65666. "shortnames": [":woman_teacher_medium_dark_skin_tone:"],
  65667. "category": "people"
  65668. },
  65669. ":woman_teacher_tone5:": {
  65670. "uc_base": "1f469-1f3ff-1f3eb",
  65671. "uc_output": "1f469-1f3ff-200d-1f3eb",
  65672. "uc_match": "1f469-1f3ff-1f3eb",
  65673. "uc_greedy": "1f469-1f3ff-1f3eb",
  65674. "shortnames": [":woman_teacher_dark_skin_tone:"],
  65675. "category": "people"
  65676. },
  65677. ":woman_technologist_tone1:": {
  65678. "uc_base": "1f469-1f3fb-1f4bb",
  65679. "uc_output": "1f469-1f3fb-200d-1f4bb",
  65680. "uc_match": "1f469-1f3fb-1f4bb",
  65681. "uc_greedy": "1f469-1f3fb-1f4bb",
  65682. "shortnames": [":woman_technologist_light_skin_tone:"],
  65683. "category": "people"
  65684. },
  65685. ":woman_technologist_tone2:": {
  65686. "uc_base": "1f469-1f3fc-1f4bb",
  65687. "uc_output": "1f469-1f3fc-200d-1f4bb",
  65688. "uc_match": "1f469-1f3fc-1f4bb",
  65689. "uc_greedy": "1f469-1f3fc-1f4bb",
  65690. "shortnames": [":woman_technologist_medium_light_skin_tone:"],
  65691. "category": "people"
  65692. },
  65693. ":woman_technologist_tone3:": {
  65694. "uc_base": "1f469-1f3fd-1f4bb",
  65695. "uc_output": "1f469-1f3fd-200d-1f4bb",
  65696. "uc_match": "1f469-1f3fd-1f4bb",
  65697. "uc_greedy": "1f469-1f3fd-1f4bb",
  65698. "shortnames": [":woman_technologist_medium_skin_tone:"],
  65699. "category": "people"
  65700. },
  65701. ":woman_technologist_tone4:": {
  65702. "uc_base": "1f469-1f3fe-1f4bb",
  65703. "uc_output": "1f469-1f3fe-200d-1f4bb",
  65704. "uc_match": "1f469-1f3fe-1f4bb",
  65705. "uc_greedy": "1f469-1f3fe-1f4bb",
  65706. "shortnames": [":woman_technologist_medium_dark_skin_tone:"],
  65707. "category": "people"
  65708. },
  65709. ":woman_technologist_tone5:": {
  65710. "uc_base": "1f469-1f3ff-1f4bb",
  65711. "uc_output": "1f469-1f3ff-200d-1f4bb",
  65712. "uc_match": "1f469-1f3ff-1f4bb",
  65713. "uc_greedy": "1f469-1f3ff-1f4bb",
  65714. "shortnames": [":woman_technologist_dark_skin_tone:"],
  65715. "category": "people"
  65716. },
  65717. ":rainbow_flag:": {
  65718. "uc_base": "1f3f3-1f308",
  65719. "uc_output": "1f3f3-fe0f-200d-1f308",
  65720. "uc_match": "1f3f3-fe0f-1f308",
  65721. "uc_greedy": "1f3f3-1f308",
  65722. "shortnames": [":gay_pride_flag:"],
  65723. "category": "flags"
  65724. },
  65725. ":blond-haired_man:": {
  65726. "uc_base": "1f471-2642",
  65727. "uc_output": "1f471-200d-2642-fe0f",
  65728. "uc_match": "1f471-2642-fe0f",
  65729. "uc_greedy": "1f471-2642",
  65730. "shortnames": [],
  65731. "category": "people"
  65732. },
  65733. ":blond-haired_woman:": {
  65734. "uc_base": "1f471-2640",
  65735. "uc_output": "1f471-200d-2640-fe0f",
  65736. "uc_match": "1f471-2640-fe0f",
  65737. "uc_greedy": "1f471-2640",
  65738. "shortnames": [],
  65739. "category": "people"
  65740. },
  65741. ":man_biking:": {
  65742. "uc_base": "1f6b4-2642",
  65743. "uc_output": "1f6b4-200d-2642-fe0f",
  65744. "uc_match": "1f6b4-2642-fe0f",
  65745. "uc_greedy": "1f6b4-2642",
  65746. "shortnames": [],
  65747. "category": "activity"
  65748. },
  65749. ":man_bowing:": {
  65750. "uc_base": "1f647-2642",
  65751. "uc_output": "1f647-200d-2642-fe0f",
  65752. "uc_match": "1f647-2642-fe0f",
  65753. "uc_greedy": "1f647-2642",
  65754. "shortnames": [],
  65755. "category": "people"
  65756. },
  65757. ":man_cartwheeling:": {
  65758. "uc_base": "1f938-2642",
  65759. "uc_output": "1f938-200d-2642-fe0f",
  65760. "uc_match": "1f938-2642-fe0f",
  65761. "uc_greedy": "1f938-2642",
  65762. "shortnames": [],
  65763. "category": "activity"
  65764. },
  65765. ":man_climbing:": {
  65766. "uc_base": "1f9d7-2642",
  65767. "uc_output": "1f9d7-200d-2642-fe0f",
  65768. "uc_match": "1f9d7-2642-fe0f",
  65769. "uc_greedy": "1f9d7-2642",
  65770. "shortnames": [],
  65771. "category": "activity"
  65772. },
  65773. ":man_construction_worker:": {
  65774. "uc_base": "1f477-2642",
  65775. "uc_output": "1f477-200d-2642-fe0f",
  65776. "uc_match": "1f477-2642-fe0f",
  65777. "uc_greedy": "1f477-2642",
  65778. "shortnames": [],
  65779. "category": "people"
  65780. },
  65781. ":man_elf:": {
  65782. "uc_base": "1f9dd-2642",
  65783. "uc_output": "1f9dd-200d-2642-fe0f",
  65784. "uc_match": "1f9dd-2642-fe0f",
  65785. "uc_greedy": "1f9dd-2642",
  65786. "shortnames": [],
  65787. "category": "people"
  65788. },
  65789. ":man_facepalming:": {
  65790. "uc_base": "1f926-2642",
  65791. "uc_output": "1f926-200d-2642-fe0f",
  65792. "uc_match": "1f926-2642-fe0f",
  65793. "uc_greedy": "1f926-2642",
  65794. "shortnames": [],
  65795. "category": "people"
  65796. },
  65797. ":man_fairy:": {
  65798. "uc_base": "1f9da-2642",
  65799. "uc_output": "1f9da-200d-2642-fe0f",
  65800. "uc_match": "1f9da-2642-fe0f",
  65801. "uc_greedy": "1f9da-2642",
  65802. "shortnames": [],
  65803. "category": "people"
  65804. },
  65805. ":man_frowning:": {
  65806. "uc_base": "1f64d-2642",
  65807. "uc_output": "1f64d-200d-2642-fe0f",
  65808. "uc_match": "1f64d-2642-fe0f",
  65809. "uc_greedy": "1f64d-2642",
  65810. "shortnames": [],
  65811. "category": "people"
  65812. },
  65813. ":man_genie:": {
  65814. "uc_base": "1f9de-2642",
  65815. "uc_output": "1f9de-200d-2642-fe0f",
  65816. "uc_match": "1f9de-2642-fe0f",
  65817. "uc_greedy": "1f9de-2642",
  65818. "shortnames": [],
  65819. "category": "people"
  65820. },
  65821. ":man_gesturing_no:": {
  65822. "uc_base": "1f645-2642",
  65823. "uc_output": "1f645-200d-2642-fe0f",
  65824. "uc_match": "1f645-2642-fe0f",
  65825. "uc_greedy": "1f645-2642",
  65826. "shortnames": [],
  65827. "category": "people"
  65828. },
  65829. ":man_gesturing_ok:": {
  65830. "uc_base": "1f646-2642",
  65831. "uc_output": "1f646-200d-2642-fe0f",
  65832. "uc_match": "1f646-2642-fe0f",
  65833. "uc_greedy": "1f646-2642",
  65834. "shortnames": [],
  65835. "category": "people"
  65836. },
  65837. ":man_getting_face_massage:": {
  65838. "uc_base": "1f486-2642",
  65839. "uc_output": "1f486-200d-2642-fe0f",
  65840. "uc_match": "1f486-2642-fe0f",
  65841. "uc_greedy": "1f486-2642",
  65842. "shortnames": [],
  65843. "category": "people"
  65844. },
  65845. ":man_getting_haircut:": {
  65846. "uc_base": "1f487-2642",
  65847. "uc_output": "1f487-200d-2642-fe0f",
  65848. "uc_match": "1f487-2642-fe0f",
  65849. "uc_greedy": "1f487-2642",
  65850. "shortnames": [],
  65851. "category": "people"
  65852. },
  65853. ":man_guard:": {
  65854. "uc_base": "1f482-2642",
  65855. "uc_output": "1f482-200d-2642-fe0f",
  65856. "uc_match": "1f482-2642-fe0f",
  65857. "uc_greedy": "1f482-2642",
  65858. "shortnames": [],
  65859. "category": "people"
  65860. },
  65861. ":man_health_worker:": {
  65862. "uc_base": "1f468-2695",
  65863. "uc_output": "1f468-200d-2695-fe0f",
  65864. "uc_match": "1f468-2695-fe0f",
  65865. "uc_greedy": "1f468-2695",
  65866. "shortnames": [],
  65867. "category": "people"
  65868. },
  65869. ":man_in_lotus_position:": {
  65870. "uc_base": "1f9d8-2642",
  65871. "uc_output": "1f9d8-200d-2642-fe0f",
  65872. "uc_match": "1f9d8-2642-fe0f",
  65873. "uc_greedy": "1f9d8-2642",
  65874. "shortnames": [],
  65875. "category": "activity"
  65876. },
  65877. ":man_in_steamy_room:": {
  65878. "uc_base": "1f9d6-2642",
  65879. "uc_output": "1f9d6-200d-2642-fe0f",
  65880. "uc_match": "1f9d6-2642-fe0f",
  65881. "uc_greedy": "1f9d6-2642",
  65882. "shortnames": [],
  65883. "category": "people"
  65884. },
  65885. ":man_judge:": {
  65886. "uc_base": "1f468-2696",
  65887. "uc_output": "1f468-200d-2696-fe0f",
  65888. "uc_match": "1f468-2696-fe0f",
  65889. "uc_greedy": "1f468-2696",
  65890. "shortnames": [],
  65891. "category": "people"
  65892. },
  65893. ":man_juggling:": {
  65894. "uc_base": "1f939-2642",
  65895. "uc_output": "1f939-200d-2642-fe0f",
  65896. "uc_match": "1f939-2642-fe0f",
  65897. "uc_greedy": "1f939-2642",
  65898. "shortnames": [],
  65899. "category": "activity"
  65900. },
  65901. ":man_mage:": {
  65902. "uc_base": "1f9d9-2642",
  65903. "uc_output": "1f9d9-200d-2642-fe0f",
  65904. "uc_match": "1f9d9-2642-fe0f",
  65905. "uc_greedy": "1f9d9-2642",
  65906. "shortnames": [],
  65907. "category": "people"
  65908. },
  65909. ":man_mountain_biking:": {
  65910. "uc_base": "1f6b5-2642",
  65911. "uc_output": "1f6b5-200d-2642-fe0f",
  65912. "uc_match": "1f6b5-2642-fe0f",
  65913. "uc_greedy": "1f6b5-2642",
  65914. "shortnames": [],
  65915. "category": "activity"
  65916. },
  65917. ":man_pilot:": {
  65918. "uc_base": "1f468-2708",
  65919. "uc_output": "1f468-200d-2708-fe0f",
  65920. "uc_match": "1f468-2708-fe0f",
  65921. "uc_greedy": "1f468-2708",
  65922. "shortnames": [],
  65923. "category": "people"
  65924. },
  65925. ":man_playing_handball:": {
  65926. "uc_base": "1f93e-2642",
  65927. "uc_output": "1f93e-200d-2642-fe0f",
  65928. "uc_match": "1f93e-2642-fe0f",
  65929. "uc_greedy": "1f93e-2642",
  65930. "shortnames": [],
  65931. "category": "activity"
  65932. },
  65933. ":man_playing_water_polo:": {
  65934. "uc_base": "1f93d-2642",
  65935. "uc_output": "1f93d-200d-2642-fe0f",
  65936. "uc_match": "1f93d-2642-fe0f",
  65937. "uc_greedy": "1f93d-2642",
  65938. "shortnames": [],
  65939. "category": "activity"
  65940. },
  65941. ":man_police_officer:": {
  65942. "uc_base": "1f46e-2642",
  65943. "uc_output": "1f46e-200d-2642-fe0f",
  65944. "uc_match": "1f46e-2642-fe0f",
  65945. "uc_greedy": "1f46e-2642",
  65946. "shortnames": [],
  65947. "category": "people"
  65948. },
  65949. ":man_pouting:": {
  65950. "uc_base": "1f64e-2642",
  65951. "uc_output": "1f64e-200d-2642-fe0f",
  65952. "uc_match": "1f64e-2642-fe0f",
  65953. "uc_greedy": "1f64e-2642",
  65954. "shortnames": [],
  65955. "category": "people"
  65956. },
  65957. ":man_raising_hand:": {
  65958. "uc_base": "1f64b-2642",
  65959. "uc_output": "1f64b-200d-2642-fe0f",
  65960. "uc_match": "1f64b-2642-fe0f",
  65961. "uc_greedy": "1f64b-2642",
  65962. "shortnames": [],
  65963. "category": "people"
  65964. },
  65965. ":man_rowing_boat:": {
  65966. "uc_base": "1f6a3-2642",
  65967. "uc_output": "1f6a3-200d-2642-fe0f",
  65968. "uc_match": "1f6a3-2642-fe0f",
  65969. "uc_greedy": "1f6a3-2642",
  65970. "shortnames": [],
  65971. "category": "activity"
  65972. },
  65973. ":man_running:": {
  65974. "uc_base": "1f3c3-2642",
  65975. "uc_output": "1f3c3-200d-2642-fe0f",
  65976. "uc_match": "1f3c3-2642-fe0f",
  65977. "uc_greedy": "1f3c3-2642",
  65978. "shortnames": [],
  65979. "category": "people"
  65980. },
  65981. ":man_shrugging:": {
  65982. "uc_base": "1f937-2642",
  65983. "uc_output": "1f937-200d-2642-fe0f",
  65984. "uc_match": "1f937-2642-fe0f",
  65985. "uc_greedy": "1f937-2642",
  65986. "shortnames": [],
  65987. "category": "people"
  65988. },
  65989. ":man_surfing:": {
  65990. "uc_base": "1f3c4-2642",
  65991. "uc_output": "1f3c4-200d-2642-fe0f",
  65992. "uc_match": "1f3c4-2642-fe0f",
  65993. "uc_greedy": "1f3c4-2642",
  65994. "shortnames": [],
  65995. "category": "activity"
  65996. },
  65997. ":man_swimming:": {
  65998. "uc_base": "1f3ca-2642",
  65999. "uc_output": "1f3ca-200d-2642-fe0f",
  66000. "uc_match": "1f3ca-2642-fe0f",
  66001. "uc_greedy": "1f3ca-2642",
  66002. "shortnames": [],
  66003. "category": "activity"
  66004. },
  66005. ":man_tipping_hand:": {
  66006. "uc_base": "1f481-2642",
  66007. "uc_output": "1f481-200d-2642-fe0f",
  66008. "uc_match": "1f481-2642-fe0f",
  66009. "uc_greedy": "1f481-2642",
  66010. "shortnames": [],
  66011. "category": "people"
  66012. },
  66013. ":man_vampire:": {
  66014. "uc_base": "1f9db-2642",
  66015. "uc_output": "1f9db-200d-2642-fe0f",
  66016. "uc_match": "1f9db-2642-fe0f",
  66017. "uc_greedy": "1f9db-2642",
  66018. "shortnames": [],
  66019. "category": "people"
  66020. },
  66021. ":man_walking:": {
  66022. "uc_base": "1f6b6-2642",
  66023. "uc_output": "1f6b6-200d-2642-fe0f",
  66024. "uc_match": "1f6b6-2642-fe0f",
  66025. "uc_greedy": "1f6b6-2642",
  66026. "shortnames": [],
  66027. "category": "people"
  66028. },
  66029. ":man_wearing_turban:": {
  66030. "uc_base": "1f473-2642",
  66031. "uc_output": "1f473-200d-2642-fe0f",
  66032. "uc_match": "1f473-2642-fe0f",
  66033. "uc_greedy": "1f473-2642",
  66034. "shortnames": [],
  66035. "category": "people"
  66036. },
  66037. ":man_zombie:": {
  66038. "uc_base": "1f9df-2642",
  66039. "uc_output": "1f9df-200d-2642-fe0f",
  66040. "uc_match": "1f9df-2642-fe0f",
  66041. "uc_greedy": "1f9df-2642",
  66042. "shortnames": [],
  66043. "category": "people"
  66044. },
  66045. ":men_with_bunny_ears_partying:": {
  66046. "uc_base": "1f46f-2642",
  66047. "uc_output": "1f46f-200d-2642-fe0f",
  66048. "uc_match": "1f46f-2642-fe0f",
  66049. "uc_greedy": "1f46f-2642",
  66050. "shortnames": [],
  66051. "category": "people"
  66052. },
  66053. ":men_wrestling:": {
  66054. "uc_base": "1f93c-2642",
  66055. "uc_output": "1f93c-200d-2642-fe0f",
  66056. "uc_match": "1f93c-2642-fe0f",
  66057. "uc_greedy": "1f93c-2642",
  66058. "shortnames": [],
  66059. "category": "activity"
  66060. },
  66061. ":mermaid:": {
  66062. "uc_base": "1f9dc-2640",
  66063. "uc_output": "1f9dc-200d-2640-fe0f",
  66064. "uc_match": "1f9dc-2640-fe0f",
  66065. "uc_greedy": "1f9dc-2640",
  66066. "shortnames": [],
  66067. "category": "people"
  66068. },
  66069. ":merman:": {
  66070. "uc_base": "1f9dc-2642",
  66071. "uc_output": "1f9dc-200d-2642-fe0f",
  66072. "uc_match": "1f9dc-2642-fe0f",
  66073. "uc_greedy": "1f9dc-2642",
  66074. "shortnames": [],
  66075. "category": "people"
  66076. },
  66077. ":woman_biking:": {
  66078. "uc_base": "1f6b4-2640",
  66079. "uc_output": "1f6b4-200d-2640-fe0f",
  66080. "uc_match": "1f6b4-2640-fe0f",
  66081. "uc_greedy": "1f6b4-2640",
  66082. "shortnames": [],
  66083. "category": "activity"
  66084. },
  66085. ":woman_bowing:": {
  66086. "uc_base": "1f647-2640",
  66087. "uc_output": "1f647-200d-2640-fe0f",
  66088. "uc_match": "1f647-2640-fe0f",
  66089. "uc_greedy": "1f647-2640",
  66090. "shortnames": [],
  66091. "category": "people"
  66092. },
  66093. ":woman_cartwheeling:": {
  66094. "uc_base": "1f938-2640",
  66095. "uc_output": "1f938-200d-2640-fe0f",
  66096. "uc_match": "1f938-2640-fe0f",
  66097. "uc_greedy": "1f938-2640",
  66098. "shortnames": [],
  66099. "category": "activity"
  66100. },
  66101. ":woman_climbing:": {
  66102. "uc_base": "1f9d7-2640",
  66103. "uc_output": "1f9d7-200d-2640-fe0f",
  66104. "uc_match": "1f9d7-2640-fe0f",
  66105. "uc_greedy": "1f9d7-2640",
  66106. "shortnames": [],
  66107. "category": "activity"
  66108. },
  66109. ":woman_construction_worker:": {
  66110. "uc_base": "1f477-2640",
  66111. "uc_output": "1f477-200d-2640-fe0f",
  66112. "uc_match": "1f477-2640-fe0f",
  66113. "uc_greedy": "1f477-2640",
  66114. "shortnames": [],
  66115. "category": "people"
  66116. },
  66117. ":woman_elf:": {
  66118. "uc_base": "1f9dd-2640",
  66119. "uc_output": "1f9dd-200d-2640-fe0f",
  66120. "uc_match": "1f9dd-2640-fe0f",
  66121. "uc_greedy": "1f9dd-2640",
  66122. "shortnames": [],
  66123. "category": "people"
  66124. },
  66125. ":woman_facepalming:": {
  66126. "uc_base": "1f926-2640",
  66127. "uc_output": "1f926-200d-2640-fe0f",
  66128. "uc_match": "1f926-2640-fe0f",
  66129. "uc_greedy": "1f926-2640",
  66130. "shortnames": [],
  66131. "category": "people"
  66132. },
  66133. ":woman_fairy:": {
  66134. "uc_base": "1f9da-2640",
  66135. "uc_output": "1f9da-200d-2640-fe0f",
  66136. "uc_match": "1f9da-2640-fe0f",
  66137. "uc_greedy": "1f9da-2640",
  66138. "shortnames": [],
  66139. "category": "people"
  66140. },
  66141. ":woman_frowning:": {
  66142. "uc_base": "1f64d-2640",
  66143. "uc_output": "1f64d-200d-2640-fe0f",
  66144. "uc_match": "1f64d-2640-fe0f",
  66145. "uc_greedy": "1f64d-2640",
  66146. "shortnames": [],
  66147. "category": "people"
  66148. },
  66149. ":woman_genie:": {
  66150. "uc_base": "1f9de-2640",
  66151. "uc_output": "1f9de-200d-2640-fe0f",
  66152. "uc_match": "1f9de-2640-fe0f",
  66153. "uc_greedy": "1f9de-2640",
  66154. "shortnames": [],
  66155. "category": "people"
  66156. },
  66157. ":woman_gesturing_no:": {
  66158. "uc_base": "1f645-2640",
  66159. "uc_output": "1f645-200d-2640-fe0f",
  66160. "uc_match": "1f645-2640-fe0f",
  66161. "uc_greedy": "1f645-2640",
  66162. "shortnames": [],
  66163. "category": "people"
  66164. },
  66165. ":woman_gesturing_ok:": {
  66166. "uc_base": "1f646-2640",
  66167. "uc_output": "1f646-200d-2640-fe0f",
  66168. "uc_match": "1f646-2640-fe0f",
  66169. "uc_greedy": "1f646-2640",
  66170. "shortnames": [],
  66171. "category": "people"
  66172. },
  66173. ":woman_getting_face_massage:": {
  66174. "uc_base": "1f486-2640",
  66175. "uc_output": "1f486-200d-2640-fe0f",
  66176. "uc_match": "1f486-2640-fe0f",
  66177. "uc_greedy": "1f486-2640",
  66178. "shortnames": [],
  66179. "category": "people"
  66180. },
  66181. ":woman_getting_haircut:": {
  66182. "uc_base": "1f487-2640",
  66183. "uc_output": "1f487-200d-2640-fe0f",
  66184. "uc_match": "1f487-2640-fe0f",
  66185. "uc_greedy": "1f487-2640",
  66186. "shortnames": [],
  66187. "category": "people"
  66188. },
  66189. ":woman_guard:": {
  66190. "uc_base": "1f482-2640",
  66191. "uc_output": "1f482-200d-2640-fe0f",
  66192. "uc_match": "1f482-2640-fe0f",
  66193. "uc_greedy": "1f482-2640",
  66194. "shortnames": [],
  66195. "category": "people"
  66196. },
  66197. ":woman_health_worker:": {
  66198. "uc_base": "1f469-2695",
  66199. "uc_output": "1f469-200d-2695-fe0f",
  66200. "uc_match": "1f469-2695-fe0f",
  66201. "uc_greedy": "1f469-2695",
  66202. "shortnames": [],
  66203. "category": "people"
  66204. },
  66205. ":woman_in_lotus_position:": {
  66206. "uc_base": "1f9d8-2640",
  66207. "uc_output": "1f9d8-200d-2640-fe0f",
  66208. "uc_match": "1f9d8-2640-fe0f",
  66209. "uc_greedy": "1f9d8-2640",
  66210. "shortnames": [],
  66211. "category": "activity"
  66212. },
  66213. ":woman_in_steamy_room:": {
  66214. "uc_base": "1f9d6-2640",
  66215. "uc_output": "1f9d6-200d-2640-fe0f",
  66216. "uc_match": "1f9d6-2640-fe0f",
  66217. "uc_greedy": "1f9d6-2640",
  66218. "shortnames": [],
  66219. "category": "people"
  66220. },
  66221. ":woman_judge:": {
  66222. "uc_base": "1f469-2696",
  66223. "uc_output": "1f469-200d-2696-fe0f",
  66224. "uc_match": "1f469-2696-fe0f",
  66225. "uc_greedy": "1f469-2696",
  66226. "shortnames": [],
  66227. "category": "people"
  66228. },
  66229. ":woman_juggling:": {
  66230. "uc_base": "1f939-2640",
  66231. "uc_output": "1f939-200d-2640-fe0f",
  66232. "uc_match": "1f939-2640-fe0f",
  66233. "uc_greedy": "1f939-2640",
  66234. "shortnames": [],
  66235. "category": "activity"
  66236. },
  66237. ":woman_mage:": {
  66238. "uc_base": "1f9d9-2640",
  66239. "uc_output": "1f9d9-200d-2640-fe0f",
  66240. "uc_match": "1f9d9-2640-fe0f",
  66241. "uc_greedy": "1f9d9-2640",
  66242. "shortnames": [],
  66243. "category": "people"
  66244. },
  66245. ":woman_mountain_biking:": {
  66246. "uc_base": "1f6b5-2640",
  66247. "uc_output": "1f6b5-200d-2640-fe0f",
  66248. "uc_match": "1f6b5-2640-fe0f",
  66249. "uc_greedy": "1f6b5-2640",
  66250. "shortnames": [],
  66251. "category": "activity"
  66252. },
  66253. ":woman_pilot:": {
  66254. "uc_base": "1f469-2708",
  66255. "uc_output": "1f469-200d-2708-fe0f",
  66256. "uc_match": "1f469-2708-fe0f",
  66257. "uc_greedy": "1f469-2708",
  66258. "shortnames": [],
  66259. "category": "people"
  66260. },
  66261. ":woman_playing_handball:": {
  66262. "uc_base": "1f93e-2640",
  66263. "uc_output": "1f93e-200d-2640-fe0f",
  66264. "uc_match": "1f93e-2640-fe0f",
  66265. "uc_greedy": "1f93e-2640",
  66266. "shortnames": [],
  66267. "category": "activity"
  66268. },
  66269. ":woman_playing_water_polo:": {
  66270. "uc_base": "1f93d-2640",
  66271. "uc_output": "1f93d-200d-2640-fe0f",
  66272. "uc_match": "1f93d-2640-fe0f",
  66273. "uc_greedy": "1f93d-2640",
  66274. "shortnames": [],
  66275. "category": "activity"
  66276. },
  66277. ":woman_police_officer:": {
  66278. "uc_base": "1f46e-2640",
  66279. "uc_output": "1f46e-200d-2640-fe0f",
  66280. "uc_match": "1f46e-2640-fe0f",
  66281. "uc_greedy": "1f46e-2640",
  66282. "shortnames": [],
  66283. "category": "people"
  66284. },
  66285. ":woman_pouting:": {
  66286. "uc_base": "1f64e-2640",
  66287. "uc_output": "1f64e-200d-2640-fe0f",
  66288. "uc_match": "1f64e-2640-fe0f",
  66289. "uc_greedy": "1f64e-2640",
  66290. "shortnames": [],
  66291. "category": "people"
  66292. },
  66293. ":woman_raising_hand:": {
  66294. "uc_base": "1f64b-2640",
  66295. "uc_output": "1f64b-200d-2640-fe0f",
  66296. "uc_match": "1f64b-2640-fe0f",
  66297. "uc_greedy": "1f64b-2640",
  66298. "shortnames": [],
  66299. "category": "people"
  66300. },
  66301. ":woman_rowing_boat:": {
  66302. "uc_base": "1f6a3-2640",
  66303. "uc_output": "1f6a3-200d-2640-fe0f",
  66304. "uc_match": "1f6a3-2640-fe0f",
  66305. "uc_greedy": "1f6a3-2640",
  66306. "shortnames": [],
  66307. "category": "activity"
  66308. },
  66309. ":woman_running:": {
  66310. "uc_base": "1f3c3-2640",
  66311. "uc_output": "1f3c3-200d-2640-fe0f",
  66312. "uc_match": "1f3c3-2640-fe0f",
  66313. "uc_greedy": "1f3c3-2640",
  66314. "shortnames": [],
  66315. "category": "people"
  66316. },
  66317. ":woman_shrugging:": {
  66318. "uc_base": "1f937-2640",
  66319. "uc_output": "1f937-200d-2640-fe0f",
  66320. "uc_match": "1f937-2640-fe0f",
  66321. "uc_greedy": "1f937-2640",
  66322. "shortnames": [],
  66323. "category": "people"
  66324. },
  66325. ":woman_surfing:": {
  66326. "uc_base": "1f3c4-2640",
  66327. "uc_output": "1f3c4-200d-2640-fe0f",
  66328. "uc_match": "1f3c4-2640-fe0f",
  66329. "uc_greedy": "1f3c4-2640",
  66330. "shortnames": [],
  66331. "category": "activity"
  66332. },
  66333. ":woman_swimming:": {
  66334. "uc_base": "1f3ca-2640",
  66335. "uc_output": "1f3ca-200d-2640-fe0f",
  66336. "uc_match": "1f3ca-2640-fe0f",
  66337. "uc_greedy": "1f3ca-2640",
  66338. "shortnames": [],
  66339. "category": "activity"
  66340. },
  66341. ":woman_tipping_hand:": {
  66342. "uc_base": "1f481-2640",
  66343. "uc_output": "1f481-200d-2640-fe0f",
  66344. "uc_match": "1f481-2640-fe0f",
  66345. "uc_greedy": "1f481-2640",
  66346. "shortnames": [],
  66347. "category": "people"
  66348. },
  66349. ":woman_vampire:": {
  66350. "uc_base": "1f9db-2640",
  66351. "uc_output": "1f9db-200d-2640-fe0f",
  66352. "uc_match": "1f9db-2640-fe0f",
  66353. "uc_greedy": "1f9db-2640",
  66354. "shortnames": [],
  66355. "category": "people"
  66356. },
  66357. ":woman_walking:": {
  66358. "uc_base": "1f6b6-2640",
  66359. "uc_output": "1f6b6-200d-2640-fe0f",
  66360. "uc_match": "1f6b6-2640-fe0f",
  66361. "uc_greedy": "1f6b6-2640",
  66362. "shortnames": [],
  66363. "category": "people"
  66364. },
  66365. ":woman_wearing_turban:": {
  66366. "uc_base": "1f473-2640",
  66367. "uc_output": "1f473-200d-2640-fe0f",
  66368. "uc_match": "1f473-2640-fe0f",
  66369. "uc_greedy": "1f473-2640",
  66370. "shortnames": [],
  66371. "category": "people"
  66372. },
  66373. ":woman_zombie:": {
  66374. "uc_base": "1f9df-2640",
  66375. "uc_output": "1f9df-200d-2640-fe0f",
  66376. "uc_match": "1f9df-2640-fe0f",
  66377. "uc_greedy": "1f9df-2640",
  66378. "shortnames": [],
  66379. "category": "people"
  66380. },
  66381. ":women_with_bunny_ears_partying:": {
  66382. "uc_base": "1f46f-2640",
  66383. "uc_output": "1f46f-200d-2640-fe0f",
  66384. "uc_match": "1f46f-2640-fe0f",
  66385. "uc_greedy": "1f46f-2640",
  66386. "shortnames": [],
  66387. "category": "people"
  66388. },
  66389. ":women_wrestling:": {
  66390. "uc_base": "1f93c-2640",
  66391. "uc_output": "1f93c-200d-2640-fe0f",
  66392. "uc_match": "1f93c-2640-fe0f",
  66393. "uc_greedy": "1f93c-2640",
  66394. "shortnames": [],
  66395. "category": "activity"
  66396. },
  66397. ":family_man_boy:": {
  66398. "uc_base": "1f468-1f466",
  66399. "uc_output": "1f468-200d-1f466",
  66400. "uc_match": "1f468-1f466",
  66401. "uc_greedy": "1f468-1f466",
  66402. "shortnames": [],
  66403. "category": "people"
  66404. },
  66405. ":family_man_girl:": {
  66406. "uc_base": "1f468-1f467",
  66407. "uc_output": "1f468-200d-1f467",
  66408. "uc_match": "1f468-1f467",
  66409. "uc_greedy": "1f468-1f467",
  66410. "shortnames": [],
  66411. "category": "people"
  66412. },
  66413. ":family_woman_boy:": {
  66414. "uc_base": "1f469-1f466",
  66415. "uc_output": "1f469-200d-1f466",
  66416. "uc_match": "1f469-1f466",
  66417. "uc_greedy": "1f469-1f466",
  66418. "shortnames": [],
  66419. "category": "people"
  66420. },
  66421. ":family_woman_girl:": {
  66422. "uc_base": "1f469-1f467",
  66423. "uc_output": "1f469-200d-1f467",
  66424. "uc_match": "1f469-1f467",
  66425. "uc_greedy": "1f469-1f467",
  66426. "shortnames": [],
  66427. "category": "people"
  66428. },
  66429. ":man_artist:": {
  66430. "uc_base": "1f468-1f3a8",
  66431. "uc_output": "1f468-200d-1f3a8",
  66432. "uc_match": "1f468-1f3a8",
  66433. "uc_greedy": "1f468-1f3a8",
  66434. "shortnames": [],
  66435. "category": "people"
  66436. },
  66437. ":man_astronaut:": {
  66438. "uc_base": "1f468-1f680",
  66439. "uc_output": "1f468-200d-1f680",
  66440. "uc_match": "1f468-1f680",
  66441. "uc_greedy": "1f468-1f680",
  66442. "shortnames": [],
  66443. "category": "people"
  66444. },
  66445. ":man_cook:": {
  66446. "uc_base": "1f468-1f373",
  66447. "uc_output": "1f468-200d-1f373",
  66448. "uc_match": "1f468-1f373",
  66449. "uc_greedy": "1f468-1f373",
  66450. "shortnames": [],
  66451. "category": "people"
  66452. },
  66453. ":man_factory_worker:": {
  66454. "uc_base": "1f468-1f3ed",
  66455. "uc_output": "1f468-200d-1f3ed",
  66456. "uc_match": "1f468-1f3ed",
  66457. "uc_greedy": "1f468-1f3ed",
  66458. "shortnames": [],
  66459. "category": "people"
  66460. },
  66461. ":man_farmer:": {
  66462. "uc_base": "1f468-1f33e",
  66463. "uc_output": "1f468-200d-1f33e",
  66464. "uc_match": "1f468-1f33e",
  66465. "uc_greedy": "1f468-1f33e",
  66466. "shortnames": [],
  66467. "category": "people"
  66468. },
  66469. ":man_firefighter:": {
  66470. "uc_base": "1f468-1f692",
  66471. "uc_output": "1f468-200d-1f692",
  66472. "uc_match": "1f468-1f692",
  66473. "uc_greedy": "1f468-1f692",
  66474. "shortnames": [],
  66475. "category": "people"
  66476. },
  66477. ":man_mechanic:": {
  66478. "uc_base": "1f468-1f527",
  66479. "uc_output": "1f468-200d-1f527",
  66480. "uc_match": "1f468-1f527",
  66481. "uc_greedy": "1f468-1f527",
  66482. "shortnames": [],
  66483. "category": "people"
  66484. },
  66485. ":man_office_worker:": {
  66486. "uc_base": "1f468-1f4bc",
  66487. "uc_output": "1f468-200d-1f4bc",
  66488. "uc_match": "1f468-1f4bc",
  66489. "uc_greedy": "1f468-1f4bc",
  66490. "shortnames": [],
  66491. "category": "people"
  66492. },
  66493. ":man_scientist:": {
  66494. "uc_base": "1f468-1f52c",
  66495. "uc_output": "1f468-200d-1f52c",
  66496. "uc_match": "1f468-1f52c",
  66497. "uc_greedy": "1f468-1f52c",
  66498. "shortnames": [],
  66499. "category": "people"
  66500. },
  66501. ":man_singer:": {
  66502. "uc_base": "1f468-1f3a4",
  66503. "uc_output": "1f468-200d-1f3a4",
  66504. "uc_match": "1f468-1f3a4",
  66505. "uc_greedy": "1f468-1f3a4",
  66506. "shortnames": [],
  66507. "category": "people"
  66508. },
  66509. ":man_student:": {
  66510. "uc_base": "1f468-1f393",
  66511. "uc_output": "1f468-200d-1f393",
  66512. "uc_match": "1f468-1f393",
  66513. "uc_greedy": "1f468-1f393",
  66514. "shortnames": [],
  66515. "category": "people"
  66516. },
  66517. ":man_teacher:": {
  66518. "uc_base": "1f468-1f3eb",
  66519. "uc_output": "1f468-200d-1f3eb",
  66520. "uc_match": "1f468-1f3eb",
  66521. "uc_greedy": "1f468-1f3eb",
  66522. "shortnames": [],
  66523. "category": "people"
  66524. },
  66525. ":man_technologist:": {
  66526. "uc_base": "1f468-1f4bb",
  66527. "uc_output": "1f468-200d-1f4bb",
  66528. "uc_match": "1f468-1f4bb",
  66529. "uc_greedy": "1f468-1f4bb",
  66530. "shortnames": [],
  66531. "category": "people"
  66532. },
  66533. ":woman_artist:": {
  66534. "uc_base": "1f469-1f3a8",
  66535. "uc_output": "1f469-200d-1f3a8",
  66536. "uc_match": "1f469-1f3a8",
  66537. "uc_greedy": "1f469-1f3a8",
  66538. "shortnames": [],
  66539. "category": "people"
  66540. },
  66541. ":woman_astronaut:": {
  66542. "uc_base": "1f469-1f680",
  66543. "uc_output": "1f469-200d-1f680",
  66544. "uc_match": "1f469-1f680",
  66545. "uc_greedy": "1f469-1f680",
  66546. "shortnames": [],
  66547. "category": "people"
  66548. },
  66549. ":woman_cook:": {
  66550. "uc_base": "1f469-1f373",
  66551. "uc_output": "1f469-200d-1f373",
  66552. "uc_match": "1f469-1f373",
  66553. "uc_greedy": "1f469-1f373",
  66554. "shortnames": [],
  66555. "category": "people"
  66556. },
  66557. ":woman_factory_worker:": {
  66558. "uc_base": "1f469-1f3ed",
  66559. "uc_output": "1f469-200d-1f3ed",
  66560. "uc_match": "1f469-1f3ed",
  66561. "uc_greedy": "1f469-1f3ed",
  66562. "shortnames": [],
  66563. "category": "people"
  66564. },
  66565. ":woman_farmer:": {
  66566. "uc_base": "1f469-1f33e",
  66567. "uc_output": "1f469-200d-1f33e",
  66568. "uc_match": "1f469-1f33e",
  66569. "uc_greedy": "1f469-1f33e",
  66570. "shortnames": [],
  66571. "category": "people"
  66572. },
  66573. ":woman_firefighter:": {
  66574. "uc_base": "1f469-1f692",
  66575. "uc_output": "1f469-200d-1f692",
  66576. "uc_match": "1f469-1f692",
  66577. "uc_greedy": "1f469-1f692",
  66578. "shortnames": [],
  66579. "category": "people"
  66580. },
  66581. ":woman_mechanic:": {
  66582. "uc_base": "1f469-1f527",
  66583. "uc_output": "1f469-200d-1f527",
  66584. "uc_match": "1f469-1f527",
  66585. "uc_greedy": "1f469-1f527",
  66586. "shortnames": [],
  66587. "category": "people"
  66588. },
  66589. ":woman_office_worker:": {
  66590. "uc_base": "1f469-1f4bc",
  66591. "uc_output": "1f469-200d-1f4bc",
  66592. "uc_match": "1f469-1f4bc",
  66593. "uc_greedy": "1f469-1f4bc",
  66594. "shortnames": [],
  66595. "category": "people"
  66596. },
  66597. ":woman_scientist:": {
  66598. "uc_base": "1f469-1f52c",
  66599. "uc_output": "1f469-200d-1f52c",
  66600. "uc_match": "1f469-1f52c",
  66601. "uc_greedy": "1f469-1f52c",
  66602. "shortnames": [],
  66603. "category": "people"
  66604. },
  66605. ":woman_singer:": {
  66606. "uc_base": "1f469-1f3a4",
  66607. "uc_output": "1f469-200d-1f3a4",
  66608. "uc_match": "1f469-1f3a4",
  66609. "uc_greedy": "1f469-1f3a4",
  66610. "shortnames": [],
  66611. "category": "people"
  66612. },
  66613. ":woman_student:": {
  66614. "uc_base": "1f469-1f393",
  66615. "uc_output": "1f469-200d-1f393",
  66616. "uc_match": "1f469-1f393",
  66617. "uc_greedy": "1f469-1f393",
  66618. "shortnames": [],
  66619. "category": "people"
  66620. },
  66621. ":woman_teacher:": {
  66622. "uc_base": "1f469-1f3eb",
  66623. "uc_output": "1f469-200d-1f3eb",
  66624. "uc_match": "1f469-1f3eb",
  66625. "uc_greedy": "1f469-1f3eb",
  66626. "shortnames": [],
  66627. "category": "people"
  66628. },
  66629. ":woman_technologist:": {
  66630. "uc_base": "1f469-1f4bb",
  66631. "uc_output": "1f469-200d-1f4bb",
  66632. "uc_match": "1f469-1f4bb",
  66633. "uc_greedy": "1f469-1f4bb",
  66634. "shortnames": [],
  66635. "category": "people"
  66636. },
  66637. ":asterisk:": {
  66638. "uc_base": "002a-20e3",
  66639. "uc_output": "002a-fe0f-20e3",
  66640. "uc_match": "002a-20e3",
  66641. "uc_greedy": "002a-20e3",
  66642. "shortnames": [":keycap_asterisk:"],
  66643. "category": "symbols"
  66644. },
  66645. ":eight:": {
  66646. "uc_base": "0038-20e3",
  66647. "uc_output": "0038-fe0f-20e3",
  66648. "uc_match": "0038-20e3",
  66649. "uc_greedy": "0038-20e3",
  66650. "shortnames": [],
  66651. "category": "symbols"
  66652. },
  66653. ":five:": {
  66654. "uc_base": "0035-20e3",
  66655. "uc_output": "0035-fe0f-20e3",
  66656. "uc_match": "0035-20e3",
  66657. "uc_greedy": "0035-20e3",
  66658. "shortnames": [],
  66659. "category": "symbols"
  66660. },
  66661. ":four:": {
  66662. "uc_base": "0034-20e3",
  66663. "uc_output": "0034-fe0f-20e3",
  66664. "uc_match": "0034-20e3",
  66665. "uc_greedy": "0034-20e3",
  66666. "shortnames": [],
  66667. "category": "symbols"
  66668. },
  66669. ":hash:": {
  66670. "uc_base": "0023-20e3",
  66671. "uc_output": "0023-fe0f-20e3",
  66672. "uc_match": "0023-20e3",
  66673. "uc_greedy": "0023-20e3",
  66674. "shortnames": [],
  66675. "category": "symbols"
  66676. },
  66677. ":nine:": {
  66678. "uc_base": "0039-20e3",
  66679. "uc_output": "0039-fe0f-20e3",
  66680. "uc_match": "0039-20e3",
  66681. "uc_greedy": "0039-20e3",
  66682. "shortnames": [],
  66683. "category": "symbols"
  66684. },
  66685. ":one:": {
  66686. "uc_base": "0031-20e3",
  66687. "uc_output": "0031-fe0f-20e3",
  66688. "uc_match": "0031-20e3",
  66689. "uc_greedy": "0031-20e3",
  66690. "shortnames": [],
  66691. "category": "symbols"
  66692. },
  66693. ":seven:": {
  66694. "uc_base": "0037-20e3",
  66695. "uc_output": "0037-fe0f-20e3",
  66696. "uc_match": "0037-20e3",
  66697. "uc_greedy": "0037-20e3",
  66698. "shortnames": [],
  66699. "category": "symbols"
  66700. },
  66701. ":six:": {
  66702. "uc_base": "0036-20e3",
  66703. "uc_output": "0036-fe0f-20e3",
  66704. "uc_match": "0036-20e3",
  66705. "uc_greedy": "0036-20e3",
  66706. "shortnames": [],
  66707. "category": "symbols"
  66708. },
  66709. ":three:": {
  66710. "uc_base": "0033-20e3",
  66711. "uc_output": "0033-fe0f-20e3",
  66712. "uc_match": "0033-20e3",
  66713. "uc_greedy": "0033-20e3",
  66714. "shortnames": [],
  66715. "category": "symbols"
  66716. },
  66717. ":two:": {
  66718. "uc_base": "0032-20e3",
  66719. "uc_output": "0032-fe0f-20e3",
  66720. "uc_match": "0032-20e3",
  66721. "uc_greedy": "0032-20e3",
  66722. "shortnames": [],
  66723. "category": "symbols"
  66724. },
  66725. ":zero:": {
  66726. "uc_base": "0030-20e3",
  66727. "uc_output": "0030-fe0f-20e3",
  66728. "uc_match": "0030-20e3",
  66729. "uc_greedy": "0030-20e3",
  66730. "shortnames": [],
  66731. "category": "symbols"
  66732. },
  66733. ":adult_tone1:": {
  66734. "uc_base": "1f9d1-1f3fb",
  66735. "uc_output": "1f9d1-1f3fb",
  66736. "uc_match": "1f9d1-1f3fb",
  66737. "uc_greedy": "1f9d1-1f3fb",
  66738. "shortnames": [":adult_light_skin_tone:"],
  66739. "category": "people"
  66740. },
  66741. ":adult_tone2:": {
  66742. "uc_base": "1f9d1-1f3fc",
  66743. "uc_output": "1f9d1-1f3fc",
  66744. "uc_match": "1f9d1-1f3fc",
  66745. "uc_greedy": "1f9d1-1f3fc",
  66746. "shortnames": [":adult_medium_light_skin_tone:"],
  66747. "category": "people"
  66748. },
  66749. ":adult_tone3:": {
  66750. "uc_base": "1f9d1-1f3fd",
  66751. "uc_output": "1f9d1-1f3fd",
  66752. "uc_match": "1f9d1-1f3fd",
  66753. "uc_greedy": "1f9d1-1f3fd",
  66754. "shortnames": [":adult_medium_skin_tone:"],
  66755. "category": "people"
  66756. },
  66757. ":adult_tone4:": {
  66758. "uc_base": "1f9d1-1f3fe",
  66759. "uc_output": "1f9d1-1f3fe",
  66760. "uc_match": "1f9d1-1f3fe",
  66761. "uc_greedy": "1f9d1-1f3fe",
  66762. "shortnames": [":adult_medium_dark_skin_tone:"],
  66763. "category": "people"
  66764. },
  66765. ":adult_tone5:": {
  66766. "uc_base": "1f9d1-1f3ff",
  66767. "uc_output": "1f9d1-1f3ff",
  66768. "uc_match": "1f9d1-1f3ff",
  66769. "uc_greedy": "1f9d1-1f3ff",
  66770. "shortnames": [":adult_dark_skin_tone:"],
  66771. "category": "people"
  66772. },
  66773. ":angel_tone1:": {
  66774. "uc_base": "1f47c-1f3fb",
  66775. "uc_output": "1f47c-1f3fb",
  66776. "uc_match": "1f47c-1f3fb",
  66777. "uc_greedy": "1f47c-1f3fb",
  66778. "shortnames": [],
  66779. "category": "people"
  66780. },
  66781. ":angel_tone2:": {
  66782. "uc_base": "1f47c-1f3fc",
  66783. "uc_output": "1f47c-1f3fc",
  66784. "uc_match": "1f47c-1f3fc",
  66785. "uc_greedy": "1f47c-1f3fc",
  66786. "shortnames": [],
  66787. "category": "people"
  66788. },
  66789. ":angel_tone3:": {
  66790. "uc_base": "1f47c-1f3fd",
  66791. "uc_output": "1f47c-1f3fd",
  66792. "uc_match": "1f47c-1f3fd",
  66793. "uc_greedy": "1f47c-1f3fd",
  66794. "shortnames": [],
  66795. "category": "people"
  66796. },
  66797. ":angel_tone4:": {
  66798. "uc_base": "1f47c-1f3fe",
  66799. "uc_output": "1f47c-1f3fe",
  66800. "uc_match": "1f47c-1f3fe",
  66801. "uc_greedy": "1f47c-1f3fe",
  66802. "shortnames": [],
  66803. "category": "people"
  66804. },
  66805. ":angel_tone5:": {
  66806. "uc_base": "1f47c-1f3ff",
  66807. "uc_output": "1f47c-1f3ff",
  66808. "uc_match": "1f47c-1f3ff",
  66809. "uc_greedy": "1f47c-1f3ff",
  66810. "shortnames": [],
  66811. "category": "people"
  66812. },
  66813. ":baby_tone1:": {
  66814. "uc_base": "1f476-1f3fb",
  66815. "uc_output": "1f476-1f3fb",
  66816. "uc_match": "1f476-1f3fb",
  66817. "uc_greedy": "1f476-1f3fb",
  66818. "shortnames": [],
  66819. "category": "people"
  66820. },
  66821. ":baby_tone2:": {
  66822. "uc_base": "1f476-1f3fc",
  66823. "uc_output": "1f476-1f3fc",
  66824. "uc_match": "1f476-1f3fc",
  66825. "uc_greedy": "1f476-1f3fc",
  66826. "shortnames": [],
  66827. "category": "people"
  66828. },
  66829. ":baby_tone3:": {
  66830. "uc_base": "1f476-1f3fd",
  66831. "uc_output": "1f476-1f3fd",
  66832. "uc_match": "1f476-1f3fd",
  66833. "uc_greedy": "1f476-1f3fd",
  66834. "shortnames": [],
  66835. "category": "people"
  66836. },
  66837. ":baby_tone4:": {
  66838. "uc_base": "1f476-1f3fe",
  66839. "uc_output": "1f476-1f3fe",
  66840. "uc_match": "1f476-1f3fe",
  66841. "uc_greedy": "1f476-1f3fe",
  66842. "shortnames": [],
  66843. "category": "people"
  66844. },
  66845. ":baby_tone5:": {
  66846. "uc_base": "1f476-1f3ff",
  66847. "uc_output": "1f476-1f3ff",
  66848. "uc_match": "1f476-1f3ff",
  66849. "uc_greedy": "1f476-1f3ff",
  66850. "shortnames": [],
  66851. "category": "people"
  66852. },
  66853. ":bath_tone1:": {
  66854. "uc_base": "1f6c0-1f3fb",
  66855. "uc_output": "1f6c0-1f3fb",
  66856. "uc_match": "1f6c0-1f3fb",
  66857. "uc_greedy": "1f6c0-1f3fb",
  66858. "shortnames": [],
  66859. "category": "objects"
  66860. },
  66861. ":bath_tone2:": {
  66862. "uc_base": "1f6c0-1f3fc",
  66863. "uc_output": "1f6c0-1f3fc",
  66864. "uc_match": "1f6c0-1f3fc",
  66865. "uc_greedy": "1f6c0-1f3fc",
  66866. "shortnames": [],
  66867. "category": "objects"
  66868. },
  66869. ":bath_tone3:": {
  66870. "uc_base": "1f6c0-1f3fd",
  66871. "uc_output": "1f6c0-1f3fd",
  66872. "uc_match": "1f6c0-1f3fd",
  66873. "uc_greedy": "1f6c0-1f3fd",
  66874. "shortnames": [],
  66875. "category": "objects"
  66876. },
  66877. ":bath_tone4:": {
  66878. "uc_base": "1f6c0-1f3fe",
  66879. "uc_output": "1f6c0-1f3fe",
  66880. "uc_match": "1f6c0-1f3fe",
  66881. "uc_greedy": "1f6c0-1f3fe",
  66882. "shortnames": [],
  66883. "category": "objects"
  66884. },
  66885. ":bath_tone5:": {
  66886. "uc_base": "1f6c0-1f3ff",
  66887. "uc_output": "1f6c0-1f3ff",
  66888. "uc_match": "1f6c0-1f3ff",
  66889. "uc_greedy": "1f6c0-1f3ff",
  66890. "shortnames": [],
  66891. "category": "objects"
  66892. },
  66893. ":bearded_person_tone1:": {
  66894. "uc_base": "1f9d4-1f3fb",
  66895. "uc_output": "1f9d4-1f3fb",
  66896. "uc_match": "1f9d4-1f3fb",
  66897. "uc_greedy": "1f9d4-1f3fb",
  66898. "shortnames": [":bearded_person_light_skin_tone:"],
  66899. "category": "people"
  66900. },
  66901. ":bearded_person_tone2:": {
  66902. "uc_base": "1f9d4-1f3fc",
  66903. "uc_output": "1f9d4-1f3fc",
  66904. "uc_match": "1f9d4-1f3fc",
  66905. "uc_greedy": "1f9d4-1f3fc",
  66906. "shortnames": [":bearded_person_medium_light_skin_tone:"],
  66907. "category": "people"
  66908. },
  66909. ":bearded_person_tone3:": {
  66910. "uc_base": "1f9d4-1f3fd",
  66911. "uc_output": "1f9d4-1f3fd",
  66912. "uc_match": "1f9d4-1f3fd",
  66913. "uc_greedy": "1f9d4-1f3fd",
  66914. "shortnames": [":bearded_person_medium_skin_tone:"],
  66915. "category": "people"
  66916. },
  66917. ":bearded_person_tone4:": {
  66918. "uc_base": "1f9d4-1f3fe",
  66919. "uc_output": "1f9d4-1f3fe",
  66920. "uc_match": "1f9d4-1f3fe",
  66921. "uc_greedy": "1f9d4-1f3fe",
  66922. "shortnames": [":bearded_person_medium_dark_skin_tone:"],
  66923. "category": "people"
  66924. },
  66925. ":bearded_person_tone5:": {
  66926. "uc_base": "1f9d4-1f3ff",
  66927. "uc_output": "1f9d4-1f3ff",
  66928. "uc_match": "1f9d4-1f3ff",
  66929. "uc_greedy": "1f9d4-1f3ff",
  66930. "shortnames": [":bearded_person_dark_skin_tone:"],
  66931. "category": "people"
  66932. },
  66933. ":blond_haired_person_tone1:": {
  66934. "uc_base": "1f471-1f3fb",
  66935. "uc_output": "1f471-1f3fb",
  66936. "uc_match": "1f471-1f3fb",
  66937. "uc_greedy": "1f471-1f3fb",
  66938. "shortnames": [":person_with_blond_hair_tone1:"],
  66939. "category": "people"
  66940. },
  66941. ":blond_haired_person_tone2:": {
  66942. "uc_base": "1f471-1f3fc",
  66943. "uc_output": "1f471-1f3fc",
  66944. "uc_match": "1f471-1f3fc",
  66945. "uc_greedy": "1f471-1f3fc",
  66946. "shortnames": [":person_with_blond_hair_tone2:"],
  66947. "category": "people"
  66948. },
  66949. ":blond_haired_person_tone3:": {
  66950. "uc_base": "1f471-1f3fd",
  66951. "uc_output": "1f471-1f3fd",
  66952. "uc_match": "1f471-1f3fd",
  66953. "uc_greedy": "1f471-1f3fd",
  66954. "shortnames": [":person_with_blond_hair_tone3:"],
  66955. "category": "people"
  66956. },
  66957. ":blond_haired_person_tone4:": {
  66958. "uc_base": "1f471-1f3fe",
  66959. "uc_output": "1f471-1f3fe",
  66960. "uc_match": "1f471-1f3fe",
  66961. "uc_greedy": "1f471-1f3fe",
  66962. "shortnames": [":person_with_blond_hair_tone4:"],
  66963. "category": "people"
  66964. },
  66965. ":blond_haired_person_tone5:": {
  66966. "uc_base": "1f471-1f3ff",
  66967. "uc_output": "1f471-1f3ff",
  66968. "uc_match": "1f471-1f3ff",
  66969. "uc_greedy": "1f471-1f3ff",
  66970. "shortnames": [":person_with_blond_hair_tone5:"],
  66971. "category": "people"
  66972. },
  66973. ":boy_tone1:": {
  66974. "uc_base": "1f466-1f3fb",
  66975. "uc_output": "1f466-1f3fb",
  66976. "uc_match": "1f466-1f3fb",
  66977. "uc_greedy": "1f466-1f3fb",
  66978. "shortnames": [],
  66979. "category": "people"
  66980. },
  66981. ":boy_tone2:": {
  66982. "uc_base": "1f466-1f3fc",
  66983. "uc_output": "1f466-1f3fc",
  66984. "uc_match": "1f466-1f3fc",
  66985. "uc_greedy": "1f466-1f3fc",
  66986. "shortnames": [],
  66987. "category": "people"
  66988. },
  66989. ":boy_tone3:": {
  66990. "uc_base": "1f466-1f3fd",
  66991. "uc_output": "1f466-1f3fd",
  66992. "uc_match": "1f466-1f3fd",
  66993. "uc_greedy": "1f466-1f3fd",
  66994. "shortnames": [],
  66995. "category": "people"
  66996. },
  66997. ":boy_tone4:": {
  66998. "uc_base": "1f466-1f3fe",
  66999. "uc_output": "1f466-1f3fe",
  67000. "uc_match": "1f466-1f3fe",
  67001. "uc_greedy": "1f466-1f3fe",
  67002. "shortnames": [],
  67003. "category": "people"
  67004. },
  67005. ":boy_tone5:": {
  67006. "uc_base": "1f466-1f3ff",
  67007. "uc_output": "1f466-1f3ff",
  67008. "uc_match": "1f466-1f3ff",
  67009. "uc_greedy": "1f466-1f3ff",
  67010. "shortnames": [],
  67011. "category": "people"
  67012. },
  67013. ":breast_feeding_tone1:": {
  67014. "uc_base": "1f931-1f3fb",
  67015. "uc_output": "1f931-1f3fb",
  67016. "uc_match": "1f931-1f3fb",
  67017. "uc_greedy": "1f931-1f3fb",
  67018. "shortnames": [":breast_feeding_light_skin_tone:"],
  67019. "category": "people"
  67020. },
  67021. ":breast_feeding_tone2:": {
  67022. "uc_base": "1f931-1f3fc",
  67023. "uc_output": "1f931-1f3fc",
  67024. "uc_match": "1f931-1f3fc",
  67025. "uc_greedy": "1f931-1f3fc",
  67026. "shortnames": [":breast_feeding_medium_light_skin_tone:"],
  67027. "category": "people"
  67028. },
  67029. ":breast_feeding_tone3:": {
  67030. "uc_base": "1f931-1f3fd",
  67031. "uc_output": "1f931-1f3fd",
  67032. "uc_match": "1f931-1f3fd",
  67033. "uc_greedy": "1f931-1f3fd",
  67034. "shortnames": [":breast_feeding_medium_skin_tone:"],
  67035. "category": "people"
  67036. },
  67037. ":breast_feeding_tone4:": {
  67038. "uc_base": "1f931-1f3fe",
  67039. "uc_output": "1f931-1f3fe",
  67040. "uc_match": "1f931-1f3fe",
  67041. "uc_greedy": "1f931-1f3fe",
  67042. "shortnames": [":breast_feeding_medium_dark_skin_tone:"],
  67043. "category": "people"
  67044. },
  67045. ":breast_feeding_tone5:": {
  67046. "uc_base": "1f931-1f3ff",
  67047. "uc_output": "1f931-1f3ff",
  67048. "uc_match": "1f931-1f3ff",
  67049. "uc_greedy": "1f931-1f3ff",
  67050. "shortnames": [":breast_feeding_dark_skin_tone:"],
  67051. "category": "people"
  67052. },
  67053. ":bride_with_veil_tone1:": {
  67054. "uc_base": "1f470-1f3fb",
  67055. "uc_output": "1f470-1f3fb",
  67056. "uc_match": "1f470-1f3fb",
  67057. "uc_greedy": "1f470-1f3fb",
  67058. "shortnames": [],
  67059. "category": "people"
  67060. },
  67061. ":bride_with_veil_tone2:": {
  67062. "uc_base": "1f470-1f3fc",
  67063. "uc_output": "1f470-1f3fc",
  67064. "uc_match": "1f470-1f3fc",
  67065. "uc_greedy": "1f470-1f3fc",
  67066. "shortnames": [],
  67067. "category": "people"
  67068. },
  67069. ":bride_with_veil_tone3:": {
  67070. "uc_base": "1f470-1f3fd",
  67071. "uc_output": "1f470-1f3fd",
  67072. "uc_match": "1f470-1f3fd",
  67073. "uc_greedy": "1f470-1f3fd",
  67074. "shortnames": [],
  67075. "category": "people"
  67076. },
  67077. ":bride_with_veil_tone4:": {
  67078. "uc_base": "1f470-1f3fe",
  67079. "uc_output": "1f470-1f3fe",
  67080. "uc_match": "1f470-1f3fe",
  67081. "uc_greedy": "1f470-1f3fe",
  67082. "shortnames": [],
  67083. "category": "people"
  67084. },
  67085. ":bride_with_veil_tone5:": {
  67086. "uc_base": "1f470-1f3ff",
  67087. "uc_output": "1f470-1f3ff",
  67088. "uc_match": "1f470-1f3ff",
  67089. "uc_greedy": "1f470-1f3ff",
  67090. "shortnames": [],
  67091. "category": "people"
  67092. },
  67093. ":call_me_tone1:": {
  67094. "uc_base": "1f919-1f3fb",
  67095. "uc_output": "1f919-1f3fb",
  67096. "uc_match": "1f919-1f3fb",
  67097. "uc_greedy": "1f919-1f3fb",
  67098. "shortnames": [":call_me_hand_tone1:"],
  67099. "category": "people"
  67100. },
  67101. ":call_me_tone2:": {
  67102. "uc_base": "1f919-1f3fc",
  67103. "uc_output": "1f919-1f3fc",
  67104. "uc_match": "1f919-1f3fc",
  67105. "uc_greedy": "1f919-1f3fc",
  67106. "shortnames": [":call_me_hand_tone2:"],
  67107. "category": "people"
  67108. },
  67109. ":call_me_tone3:": {
  67110. "uc_base": "1f919-1f3fd",
  67111. "uc_output": "1f919-1f3fd",
  67112. "uc_match": "1f919-1f3fd",
  67113. "uc_greedy": "1f919-1f3fd",
  67114. "shortnames": [":call_me_hand_tone3:"],
  67115. "category": "people"
  67116. },
  67117. ":call_me_tone4:": {
  67118. "uc_base": "1f919-1f3fe",
  67119. "uc_output": "1f919-1f3fe",
  67120. "uc_match": "1f919-1f3fe",
  67121. "uc_greedy": "1f919-1f3fe",
  67122. "shortnames": [":call_me_hand_tone4:"],
  67123. "category": "people"
  67124. },
  67125. ":call_me_tone5:": {
  67126. "uc_base": "1f919-1f3ff",
  67127. "uc_output": "1f919-1f3ff",
  67128. "uc_match": "1f919-1f3ff",
  67129. "uc_greedy": "1f919-1f3ff",
  67130. "shortnames": [":call_me_hand_tone5:"],
  67131. "category": "people"
  67132. },
  67133. ":child_tone1:": {
  67134. "uc_base": "1f9d2-1f3fb",
  67135. "uc_output": "1f9d2-1f3fb",
  67136. "uc_match": "1f9d2-1f3fb",
  67137. "uc_greedy": "1f9d2-1f3fb",
  67138. "shortnames": [":child_light_skin_tone:"],
  67139. "category": "people"
  67140. },
  67141. ":child_tone2:": {
  67142. "uc_base": "1f9d2-1f3fc",
  67143. "uc_output": "1f9d2-1f3fc",
  67144. "uc_match": "1f9d2-1f3fc",
  67145. "uc_greedy": "1f9d2-1f3fc",
  67146. "shortnames": [":child_medium_light_skin_tone:"],
  67147. "category": "people"
  67148. },
  67149. ":child_tone3:": {
  67150. "uc_base": "1f9d2-1f3fd",
  67151. "uc_output": "1f9d2-1f3fd",
  67152. "uc_match": "1f9d2-1f3fd",
  67153. "uc_greedy": "1f9d2-1f3fd",
  67154. "shortnames": [":child_medium_skin_tone:"],
  67155. "category": "people"
  67156. },
  67157. ":child_tone4:": {
  67158. "uc_base": "1f9d2-1f3fe",
  67159. "uc_output": "1f9d2-1f3fe",
  67160. "uc_match": "1f9d2-1f3fe",
  67161. "uc_greedy": "1f9d2-1f3fe",
  67162. "shortnames": [":child_medium_dark_skin_tone:"],
  67163. "category": "people"
  67164. },
  67165. ":child_tone5:": {
  67166. "uc_base": "1f9d2-1f3ff",
  67167. "uc_output": "1f9d2-1f3ff",
  67168. "uc_match": "1f9d2-1f3ff",
  67169. "uc_greedy": "1f9d2-1f3ff",
  67170. "shortnames": [":child_dark_skin_tone:"],
  67171. "category": "people"
  67172. },
  67173. ":clap_tone1:": {
  67174. "uc_base": "1f44f-1f3fb",
  67175. "uc_output": "1f44f-1f3fb",
  67176. "uc_match": "1f44f-1f3fb",
  67177. "uc_greedy": "1f44f-1f3fb",
  67178. "shortnames": [],
  67179. "category": "people"
  67180. },
  67181. ":clap_tone2:": {
  67182. "uc_base": "1f44f-1f3fc",
  67183. "uc_output": "1f44f-1f3fc",
  67184. "uc_match": "1f44f-1f3fc",
  67185. "uc_greedy": "1f44f-1f3fc",
  67186. "shortnames": [],
  67187. "category": "people"
  67188. },
  67189. ":clap_tone3:": {
  67190. "uc_base": "1f44f-1f3fd",
  67191. "uc_output": "1f44f-1f3fd",
  67192. "uc_match": "1f44f-1f3fd",
  67193. "uc_greedy": "1f44f-1f3fd",
  67194. "shortnames": [],
  67195. "category": "people"
  67196. },
  67197. ":clap_tone4:": {
  67198. "uc_base": "1f44f-1f3fe",
  67199. "uc_output": "1f44f-1f3fe",
  67200. "uc_match": "1f44f-1f3fe",
  67201. "uc_greedy": "1f44f-1f3fe",
  67202. "shortnames": [],
  67203. "category": "people"
  67204. },
  67205. ":clap_tone5:": {
  67206. "uc_base": "1f44f-1f3ff",
  67207. "uc_output": "1f44f-1f3ff",
  67208. "uc_match": "1f44f-1f3ff",
  67209. "uc_greedy": "1f44f-1f3ff",
  67210. "shortnames": [],
  67211. "category": "people"
  67212. },
  67213. ":construction_worker_tone1:": {
  67214. "uc_base": "1f477-1f3fb",
  67215. "uc_output": "1f477-1f3fb",
  67216. "uc_match": "1f477-1f3fb",
  67217. "uc_greedy": "1f477-1f3fb",
  67218. "shortnames": [],
  67219. "category": "people"
  67220. },
  67221. ":construction_worker_tone2:": {
  67222. "uc_base": "1f477-1f3fc",
  67223. "uc_output": "1f477-1f3fc",
  67224. "uc_match": "1f477-1f3fc",
  67225. "uc_greedy": "1f477-1f3fc",
  67226. "shortnames": [],
  67227. "category": "people"
  67228. },
  67229. ":construction_worker_tone3:": {
  67230. "uc_base": "1f477-1f3fd",
  67231. "uc_output": "1f477-1f3fd",
  67232. "uc_match": "1f477-1f3fd",
  67233. "uc_greedy": "1f477-1f3fd",
  67234. "shortnames": [],
  67235. "category": "people"
  67236. },
  67237. ":construction_worker_tone4:": {
  67238. "uc_base": "1f477-1f3fe",
  67239. "uc_output": "1f477-1f3fe",
  67240. "uc_match": "1f477-1f3fe",
  67241. "uc_greedy": "1f477-1f3fe",
  67242. "shortnames": [],
  67243. "category": "people"
  67244. },
  67245. ":construction_worker_tone5:": {
  67246. "uc_base": "1f477-1f3ff",
  67247. "uc_output": "1f477-1f3ff",
  67248. "uc_match": "1f477-1f3ff",
  67249. "uc_greedy": "1f477-1f3ff",
  67250. "shortnames": [],
  67251. "category": "people"
  67252. },
  67253. ":dancer_tone1:": {
  67254. "uc_base": "1f483-1f3fb",
  67255. "uc_output": "1f483-1f3fb",
  67256. "uc_match": "1f483-1f3fb",
  67257. "uc_greedy": "1f483-1f3fb",
  67258. "shortnames": [],
  67259. "category": "people"
  67260. },
  67261. ":dancer_tone2:": {
  67262. "uc_base": "1f483-1f3fc",
  67263. "uc_output": "1f483-1f3fc",
  67264. "uc_match": "1f483-1f3fc",
  67265. "uc_greedy": "1f483-1f3fc",
  67266. "shortnames": [],
  67267. "category": "people"
  67268. },
  67269. ":dancer_tone3:": {
  67270. "uc_base": "1f483-1f3fd",
  67271. "uc_output": "1f483-1f3fd",
  67272. "uc_match": "1f483-1f3fd",
  67273. "uc_greedy": "1f483-1f3fd",
  67274. "shortnames": [],
  67275. "category": "people"
  67276. },
  67277. ":dancer_tone4:": {
  67278. "uc_base": "1f483-1f3fe",
  67279. "uc_output": "1f483-1f3fe",
  67280. "uc_match": "1f483-1f3fe",
  67281. "uc_greedy": "1f483-1f3fe",
  67282. "shortnames": [],
  67283. "category": "people"
  67284. },
  67285. ":dancer_tone5:": {
  67286. "uc_base": "1f483-1f3ff",
  67287. "uc_output": "1f483-1f3ff",
  67288. "uc_match": "1f483-1f3ff",
  67289. "uc_greedy": "1f483-1f3ff",
  67290. "shortnames": [],
  67291. "category": "people"
  67292. },
  67293. ":detective_tone1:": {
  67294. "uc_base": "1f575-1f3fb",
  67295. "uc_output": "1f575-1f3fb",
  67296. "uc_match": "1f575-fe0f-1f3fb",
  67297. "uc_greedy": "1f575-fe0f-1f3fb",
  67298. "shortnames": [":spy_tone1:", ":sleuth_or_spy_tone1:"],
  67299. "category": "people"
  67300. },
  67301. ":detective_tone2:": {
  67302. "uc_base": "1f575-1f3fc",
  67303. "uc_output": "1f575-1f3fc",
  67304. "uc_match": "1f575-fe0f-1f3fc",
  67305. "uc_greedy": "1f575-fe0f-1f3fc",
  67306. "shortnames": [":spy_tone2:", ":sleuth_or_spy_tone2:"],
  67307. "category": "people"
  67308. },
  67309. ":detective_tone3:": {
  67310. "uc_base": "1f575-1f3fd",
  67311. "uc_output": "1f575-1f3fd",
  67312. "uc_match": "1f575-fe0f-1f3fd",
  67313. "uc_greedy": "1f575-fe0f-1f3fd",
  67314. "shortnames": [":spy_tone3:", ":sleuth_or_spy_tone3:"],
  67315. "category": "people"
  67316. },
  67317. ":detective_tone4:": {
  67318. "uc_base": "1f575-1f3fe",
  67319. "uc_output": "1f575-1f3fe",
  67320. "uc_match": "1f575-fe0f-1f3fe",
  67321. "uc_greedy": "1f575-fe0f-1f3fe",
  67322. "shortnames": [":spy_tone4:", ":sleuth_or_spy_tone4:"],
  67323. "category": "people"
  67324. },
  67325. ":detective_tone5:": {
  67326. "uc_base": "1f575-1f3ff",
  67327. "uc_output": "1f575-1f3ff",
  67328. "uc_match": "1f575-fe0f-1f3ff",
  67329. "uc_greedy": "1f575-fe0f-1f3ff",
  67330. "shortnames": [":spy_tone5:", ":sleuth_or_spy_tone5:"],
  67331. "category": "people"
  67332. },
  67333. ":ear_tone1:": {
  67334. "uc_base": "1f442-1f3fb",
  67335. "uc_output": "1f442-1f3fb",
  67336. "uc_match": "1f442-1f3fb",
  67337. "uc_greedy": "1f442-1f3fb",
  67338. "shortnames": [],
  67339. "category": "people"
  67340. },
  67341. ":ear_tone2:": {
  67342. "uc_base": "1f442-1f3fc",
  67343. "uc_output": "1f442-1f3fc",
  67344. "uc_match": "1f442-1f3fc",
  67345. "uc_greedy": "1f442-1f3fc",
  67346. "shortnames": [],
  67347. "category": "people"
  67348. },
  67349. ":ear_tone3:": {
  67350. "uc_base": "1f442-1f3fd",
  67351. "uc_output": "1f442-1f3fd",
  67352. "uc_match": "1f442-1f3fd",
  67353. "uc_greedy": "1f442-1f3fd",
  67354. "shortnames": [],
  67355. "category": "people"
  67356. },
  67357. ":ear_tone4:": {
  67358. "uc_base": "1f442-1f3fe",
  67359. "uc_output": "1f442-1f3fe",
  67360. "uc_match": "1f442-1f3fe",
  67361. "uc_greedy": "1f442-1f3fe",
  67362. "shortnames": [],
  67363. "category": "people"
  67364. },
  67365. ":ear_tone5:": {
  67366. "uc_base": "1f442-1f3ff",
  67367. "uc_output": "1f442-1f3ff",
  67368. "uc_match": "1f442-1f3ff",
  67369. "uc_greedy": "1f442-1f3ff",
  67370. "shortnames": [],
  67371. "category": "people"
  67372. },
  67373. ":elf_tone1:": {
  67374. "uc_base": "1f9dd-1f3fb",
  67375. "uc_output": "1f9dd-1f3fb",
  67376. "uc_match": "1f9dd-1f3fb",
  67377. "uc_greedy": "1f9dd-1f3fb",
  67378. "shortnames": [":elf_light_skin_tone:"],
  67379. "category": "people"
  67380. },
  67381. ":elf_tone2:": {
  67382. "uc_base": "1f9dd-1f3fc",
  67383. "uc_output": "1f9dd-1f3fc",
  67384. "uc_match": "1f9dd-1f3fc",
  67385. "uc_greedy": "1f9dd-1f3fc",
  67386. "shortnames": [":elf_medium_light_skin_tone:"],
  67387. "category": "people"
  67388. },
  67389. ":elf_tone3:": {
  67390. "uc_base": "1f9dd-1f3fd",
  67391. "uc_output": "1f9dd-1f3fd",
  67392. "uc_match": "1f9dd-1f3fd",
  67393. "uc_greedy": "1f9dd-1f3fd",
  67394. "shortnames": [":elf_medium_skin_tone:"],
  67395. "category": "people"
  67396. },
  67397. ":elf_tone4:": {
  67398. "uc_base": "1f9dd-1f3fe",
  67399. "uc_output": "1f9dd-1f3fe",
  67400. "uc_match": "1f9dd-1f3fe",
  67401. "uc_greedy": "1f9dd-1f3fe",
  67402. "shortnames": [":elf_medium_dark_skin_tone:"],
  67403. "category": "people"
  67404. },
  67405. ":elf_tone5:": {
  67406. "uc_base": "1f9dd-1f3ff",
  67407. "uc_output": "1f9dd-1f3ff",
  67408. "uc_match": "1f9dd-1f3ff",
  67409. "uc_greedy": "1f9dd-1f3ff",
  67410. "shortnames": [":elf_dark_skin_tone:"],
  67411. "category": "people"
  67412. },
  67413. ":fairy_tone1:": {
  67414. "uc_base": "1f9da-1f3fb",
  67415. "uc_output": "1f9da-1f3fb",
  67416. "uc_match": "1f9da-1f3fb",
  67417. "uc_greedy": "1f9da-1f3fb",
  67418. "shortnames": [":fairy_light_skin_tone:"],
  67419. "category": "people"
  67420. },
  67421. ":fairy_tone2:": {
  67422. "uc_base": "1f9da-1f3fc",
  67423. "uc_output": "1f9da-1f3fc",
  67424. "uc_match": "1f9da-1f3fc",
  67425. "uc_greedy": "1f9da-1f3fc",
  67426. "shortnames": [":fairy_medium_light_skin_tone:"],
  67427. "category": "people"
  67428. },
  67429. ":fairy_tone3:": {
  67430. "uc_base": "1f9da-1f3fd",
  67431. "uc_output": "1f9da-1f3fd",
  67432. "uc_match": "1f9da-1f3fd",
  67433. "uc_greedy": "1f9da-1f3fd",
  67434. "shortnames": [":fairy_medium_skin_tone:"],
  67435. "category": "people"
  67436. },
  67437. ":fairy_tone4:": {
  67438. "uc_base": "1f9da-1f3fe",
  67439. "uc_output": "1f9da-1f3fe",
  67440. "uc_match": "1f9da-1f3fe",
  67441. "uc_greedy": "1f9da-1f3fe",
  67442. "shortnames": [":fairy_medium_dark_skin_tone:"],
  67443. "category": "people"
  67444. },
  67445. ":fairy_tone5:": {
  67446. "uc_base": "1f9da-1f3ff",
  67447. "uc_output": "1f9da-1f3ff",
  67448. "uc_match": "1f9da-1f3ff",
  67449. "uc_greedy": "1f9da-1f3ff",
  67450. "shortnames": [":fairy_dark_skin_tone:"],
  67451. "category": "people"
  67452. },
  67453. ":fingers_crossed_tone1:": {
  67454. "uc_base": "1f91e-1f3fb",
  67455. "uc_output": "1f91e-1f3fb",
  67456. "uc_match": "1f91e-1f3fb",
  67457. "uc_greedy": "1f91e-1f3fb",
  67458. "shortnames": [":hand_with_index_and_middle_fingers_crossed_tone1:"],
  67459. "category": "people"
  67460. },
  67461. ":fingers_crossed_tone2:": {
  67462. "uc_base": "1f91e-1f3fc",
  67463. "uc_output": "1f91e-1f3fc",
  67464. "uc_match": "1f91e-1f3fc",
  67465. "uc_greedy": "1f91e-1f3fc",
  67466. "shortnames": [":hand_with_index_and_middle_fingers_crossed_tone2:"],
  67467. "category": "people"
  67468. },
  67469. ":fingers_crossed_tone3:": {
  67470. "uc_base": "1f91e-1f3fd",
  67471. "uc_output": "1f91e-1f3fd",
  67472. "uc_match": "1f91e-1f3fd",
  67473. "uc_greedy": "1f91e-1f3fd",
  67474. "shortnames": [":hand_with_index_and_middle_fingers_crossed_tone3:"],
  67475. "category": "people"
  67476. },
  67477. ":fingers_crossed_tone4:": {
  67478. "uc_base": "1f91e-1f3fe",
  67479. "uc_output": "1f91e-1f3fe",
  67480. "uc_match": "1f91e-1f3fe",
  67481. "uc_greedy": "1f91e-1f3fe",
  67482. "shortnames": [":hand_with_index_and_middle_fingers_crossed_tone4:"],
  67483. "category": "people"
  67484. },
  67485. ":fingers_crossed_tone5:": {
  67486. "uc_base": "1f91e-1f3ff",
  67487. "uc_output": "1f91e-1f3ff",
  67488. "uc_match": "1f91e-1f3ff",
  67489. "uc_greedy": "1f91e-1f3ff",
  67490. "shortnames": [":hand_with_index_and_middle_fingers_crossed_tone5:"],
  67491. "category": "people"
  67492. },
  67493. ":flag_ac:": {
  67494. "uc_base": "1f1e6-1f1e8",
  67495. "uc_output": "1f1e6-1f1e8",
  67496. "uc_match": "1f1e6-1f1e8",
  67497. "uc_greedy": "1f1e6-1f1e8",
  67498. "shortnames": [":ac:"],
  67499. "category": "flags"
  67500. },
  67501. ":flag_ad:": {
  67502. "uc_base": "1f1e6-1f1e9",
  67503. "uc_output": "1f1e6-1f1e9",
  67504. "uc_match": "1f1e6-1f1e9",
  67505. "uc_greedy": "1f1e6-1f1e9",
  67506. "shortnames": [":ad:"],
  67507. "category": "flags"
  67508. },
  67509. ":flag_ae:": {
  67510. "uc_base": "1f1e6-1f1ea",
  67511. "uc_output": "1f1e6-1f1ea",
  67512. "uc_match": "1f1e6-1f1ea",
  67513. "uc_greedy": "1f1e6-1f1ea",
  67514. "shortnames": [":ae:"],
  67515. "category": "flags"
  67516. },
  67517. ":flag_af:": {
  67518. "uc_base": "1f1e6-1f1eb",
  67519. "uc_output": "1f1e6-1f1eb",
  67520. "uc_match": "1f1e6-1f1eb",
  67521. "uc_greedy": "1f1e6-1f1eb",
  67522. "shortnames": [":af:"],
  67523. "category": "flags"
  67524. },
  67525. ":flag_ag:": {
  67526. "uc_base": "1f1e6-1f1ec",
  67527. "uc_output": "1f1e6-1f1ec",
  67528. "uc_match": "1f1e6-1f1ec",
  67529. "uc_greedy": "1f1e6-1f1ec",
  67530. "shortnames": [":ag:"],
  67531. "category": "flags"
  67532. },
  67533. ":flag_ai:": {
  67534. "uc_base": "1f1e6-1f1ee",
  67535. "uc_output": "1f1e6-1f1ee",
  67536. "uc_match": "1f1e6-1f1ee",
  67537. "uc_greedy": "1f1e6-1f1ee",
  67538. "shortnames": [":ai:"],
  67539. "category": "flags"
  67540. },
  67541. ":flag_al:": {
  67542. "uc_base": "1f1e6-1f1f1",
  67543. "uc_output": "1f1e6-1f1f1",
  67544. "uc_match": "1f1e6-1f1f1",
  67545. "uc_greedy": "1f1e6-1f1f1",
  67546. "shortnames": [":al:"],
  67547. "category": "flags"
  67548. },
  67549. ":flag_am:": {
  67550. "uc_base": "1f1e6-1f1f2",
  67551. "uc_output": "1f1e6-1f1f2",
  67552. "uc_match": "1f1e6-1f1f2",
  67553. "uc_greedy": "1f1e6-1f1f2",
  67554. "shortnames": [":am:"],
  67555. "category": "flags"
  67556. },
  67557. ":flag_ao:": {
  67558. "uc_base": "1f1e6-1f1f4",
  67559. "uc_output": "1f1e6-1f1f4",
  67560. "uc_match": "1f1e6-1f1f4",
  67561. "uc_greedy": "1f1e6-1f1f4",
  67562. "shortnames": [":ao:"],
  67563. "category": "flags"
  67564. },
  67565. ":flag_aq:": {
  67566. "uc_base": "1f1e6-1f1f6",
  67567. "uc_output": "1f1e6-1f1f6",
  67568. "uc_match": "1f1e6-1f1f6",
  67569. "uc_greedy": "1f1e6-1f1f6",
  67570. "shortnames": [":aq:"],
  67571. "category": "flags"
  67572. },
  67573. ":flag_ar:": {
  67574. "uc_base": "1f1e6-1f1f7",
  67575. "uc_output": "1f1e6-1f1f7",
  67576. "uc_match": "1f1e6-1f1f7",
  67577. "uc_greedy": "1f1e6-1f1f7",
  67578. "shortnames": [":ar:"],
  67579. "category": "flags"
  67580. },
  67581. ":flag_as:": {
  67582. "uc_base": "1f1e6-1f1f8",
  67583. "uc_output": "1f1e6-1f1f8",
  67584. "uc_match": "1f1e6-1f1f8",
  67585. "uc_greedy": "1f1e6-1f1f8",
  67586. "shortnames": [":as:"],
  67587. "category": "flags"
  67588. },
  67589. ":flag_at:": {
  67590. "uc_base": "1f1e6-1f1f9",
  67591. "uc_output": "1f1e6-1f1f9",
  67592. "uc_match": "1f1e6-1f1f9",
  67593. "uc_greedy": "1f1e6-1f1f9",
  67594. "shortnames": [":at:"],
  67595. "category": "flags"
  67596. },
  67597. ":flag_au:": {
  67598. "uc_base": "1f1e6-1f1fa",
  67599. "uc_output": "1f1e6-1f1fa",
  67600. "uc_match": "1f1e6-1f1fa",
  67601. "uc_greedy": "1f1e6-1f1fa",
  67602. "shortnames": [":au:"],
  67603. "category": "flags"
  67604. },
  67605. ":flag_aw:": {
  67606. "uc_base": "1f1e6-1f1fc",
  67607. "uc_output": "1f1e6-1f1fc",
  67608. "uc_match": "1f1e6-1f1fc",
  67609. "uc_greedy": "1f1e6-1f1fc",
  67610. "shortnames": [":aw:"],
  67611. "category": "flags"
  67612. },
  67613. ":flag_ax:": {
  67614. "uc_base": "1f1e6-1f1fd",
  67615. "uc_output": "1f1e6-1f1fd",
  67616. "uc_match": "1f1e6-1f1fd",
  67617. "uc_greedy": "1f1e6-1f1fd",
  67618. "shortnames": [":ax:"],
  67619. "category": "flags"
  67620. },
  67621. ":flag_az:": {
  67622. "uc_base": "1f1e6-1f1ff",
  67623. "uc_output": "1f1e6-1f1ff",
  67624. "uc_match": "1f1e6-1f1ff",
  67625. "uc_greedy": "1f1e6-1f1ff",
  67626. "shortnames": [":az:"],
  67627. "category": "flags"
  67628. },
  67629. ":flag_ba:": {
  67630. "uc_base": "1f1e7-1f1e6",
  67631. "uc_output": "1f1e7-1f1e6",
  67632. "uc_match": "1f1e7-1f1e6",
  67633. "uc_greedy": "1f1e7-1f1e6",
  67634. "shortnames": [":ba:"],
  67635. "category": "flags"
  67636. },
  67637. ":flag_bb:": {
  67638. "uc_base": "1f1e7-1f1e7",
  67639. "uc_output": "1f1e7-1f1e7",
  67640. "uc_match": "1f1e7-1f1e7",
  67641. "uc_greedy": "1f1e7-1f1e7",
  67642. "shortnames": [":bb:"],
  67643. "category": "flags"
  67644. },
  67645. ":flag_bd:": {
  67646. "uc_base": "1f1e7-1f1e9",
  67647. "uc_output": "1f1e7-1f1e9",
  67648. "uc_match": "1f1e7-1f1e9",
  67649. "uc_greedy": "1f1e7-1f1e9",
  67650. "shortnames": [":bd:"],
  67651. "category": "flags"
  67652. },
  67653. ":flag_be:": {
  67654. "uc_base": "1f1e7-1f1ea",
  67655. "uc_output": "1f1e7-1f1ea",
  67656. "uc_match": "1f1e7-1f1ea",
  67657. "uc_greedy": "1f1e7-1f1ea",
  67658. "shortnames": [":be:"],
  67659. "category": "flags"
  67660. },
  67661. ":flag_bf:": {
  67662. "uc_base": "1f1e7-1f1eb",
  67663. "uc_output": "1f1e7-1f1eb",
  67664. "uc_match": "1f1e7-1f1eb",
  67665. "uc_greedy": "1f1e7-1f1eb",
  67666. "shortnames": [":bf:"],
  67667. "category": "flags"
  67668. },
  67669. ":flag_bg:": {
  67670. "uc_base": "1f1e7-1f1ec",
  67671. "uc_output": "1f1e7-1f1ec",
  67672. "uc_match": "1f1e7-1f1ec",
  67673. "uc_greedy": "1f1e7-1f1ec",
  67674. "shortnames": [":bg:"],
  67675. "category": "flags"
  67676. },
  67677. ":flag_bh:": {
  67678. "uc_base": "1f1e7-1f1ed",
  67679. "uc_output": "1f1e7-1f1ed",
  67680. "uc_match": "1f1e7-1f1ed",
  67681. "uc_greedy": "1f1e7-1f1ed",
  67682. "shortnames": [":bh:"],
  67683. "category": "flags"
  67684. },
  67685. ":flag_bi:": {
  67686. "uc_base": "1f1e7-1f1ee",
  67687. "uc_output": "1f1e7-1f1ee",
  67688. "uc_match": "1f1e7-1f1ee",
  67689. "uc_greedy": "1f1e7-1f1ee",
  67690. "shortnames": [":bi:"],
  67691. "category": "flags"
  67692. },
  67693. ":flag_bj:": {
  67694. "uc_base": "1f1e7-1f1ef",
  67695. "uc_output": "1f1e7-1f1ef",
  67696. "uc_match": "1f1e7-1f1ef",
  67697. "uc_greedy": "1f1e7-1f1ef",
  67698. "shortnames": [":bj:"],
  67699. "category": "flags"
  67700. },
  67701. ":flag_bl:": {
  67702. "uc_base": "1f1e7-1f1f1",
  67703. "uc_output": "1f1e7-1f1f1",
  67704. "uc_match": "1f1e7-1f1f1",
  67705. "uc_greedy": "1f1e7-1f1f1",
  67706. "shortnames": [":bl:"],
  67707. "category": "flags"
  67708. },
  67709. ":flag_bm:": {
  67710. "uc_base": "1f1e7-1f1f2",
  67711. "uc_output": "1f1e7-1f1f2",
  67712. "uc_match": "1f1e7-1f1f2",
  67713. "uc_greedy": "1f1e7-1f1f2",
  67714. "shortnames": [":bm:"],
  67715. "category": "flags"
  67716. },
  67717. ":flag_bn:": {
  67718. "uc_base": "1f1e7-1f1f3",
  67719. "uc_output": "1f1e7-1f1f3",
  67720. "uc_match": "1f1e7-1f1f3",
  67721. "uc_greedy": "1f1e7-1f1f3",
  67722. "shortnames": [":bn:"],
  67723. "category": "flags"
  67724. },
  67725. ":flag_bo:": {
  67726. "uc_base": "1f1e7-1f1f4",
  67727. "uc_output": "1f1e7-1f1f4",
  67728. "uc_match": "1f1e7-1f1f4",
  67729. "uc_greedy": "1f1e7-1f1f4",
  67730. "shortnames": [":bo:"],
  67731. "category": "flags"
  67732. },
  67733. ":flag_bq:": {
  67734. "uc_base": "1f1e7-1f1f6",
  67735. "uc_output": "1f1e7-1f1f6",
  67736. "uc_match": "1f1e7-1f1f6",
  67737. "uc_greedy": "1f1e7-1f1f6",
  67738. "shortnames": [":bq:"],
  67739. "category": "flags"
  67740. },
  67741. ":flag_br:": {
  67742. "uc_base": "1f1e7-1f1f7",
  67743. "uc_output": "1f1e7-1f1f7",
  67744. "uc_match": "1f1e7-1f1f7",
  67745. "uc_greedy": "1f1e7-1f1f7",
  67746. "shortnames": [":br:"],
  67747. "category": "flags"
  67748. },
  67749. ":flag_bs:": {
  67750. "uc_base": "1f1e7-1f1f8",
  67751. "uc_output": "1f1e7-1f1f8",
  67752. "uc_match": "1f1e7-1f1f8",
  67753. "uc_greedy": "1f1e7-1f1f8",
  67754. "shortnames": [":bs:"],
  67755. "category": "flags"
  67756. },
  67757. ":flag_bt:": {
  67758. "uc_base": "1f1e7-1f1f9",
  67759. "uc_output": "1f1e7-1f1f9",
  67760. "uc_match": "1f1e7-1f1f9",
  67761. "uc_greedy": "1f1e7-1f1f9",
  67762. "shortnames": [":bt:"],
  67763. "category": "flags"
  67764. },
  67765. ":flag_bv:": {
  67766. "uc_base": "1f1e7-1f1fb",
  67767. "uc_output": "1f1e7-1f1fb",
  67768. "uc_match": "1f1e7-1f1fb",
  67769. "uc_greedy": "1f1e7-1f1fb",
  67770. "shortnames": [":bv:"],
  67771. "category": "flags"
  67772. },
  67773. ":flag_bw:": {
  67774. "uc_base": "1f1e7-1f1fc",
  67775. "uc_output": "1f1e7-1f1fc",
  67776. "uc_match": "1f1e7-1f1fc",
  67777. "uc_greedy": "1f1e7-1f1fc",
  67778. "shortnames": [":bw:"],
  67779. "category": "flags"
  67780. },
  67781. ":flag_by:": {
  67782. "uc_base": "1f1e7-1f1fe",
  67783. "uc_output": "1f1e7-1f1fe",
  67784. "uc_match": "1f1e7-1f1fe",
  67785. "uc_greedy": "1f1e7-1f1fe",
  67786. "shortnames": [":by:"],
  67787. "category": "flags"
  67788. },
  67789. ":flag_bz:": {
  67790. "uc_base": "1f1e7-1f1ff",
  67791. "uc_output": "1f1e7-1f1ff",
  67792. "uc_match": "1f1e7-1f1ff",
  67793. "uc_greedy": "1f1e7-1f1ff",
  67794. "shortnames": [":bz:"],
  67795. "category": "flags"
  67796. },
  67797. ":flag_ca:": {
  67798. "uc_base": "1f1e8-1f1e6",
  67799. "uc_output": "1f1e8-1f1e6",
  67800. "uc_match": "1f1e8-1f1e6",
  67801. "uc_greedy": "1f1e8-1f1e6",
  67802. "shortnames": [":ca:"],
  67803. "category": "flags"
  67804. },
  67805. ":flag_cc:": {
  67806. "uc_base": "1f1e8-1f1e8",
  67807. "uc_output": "1f1e8-1f1e8",
  67808. "uc_match": "1f1e8-1f1e8",
  67809. "uc_greedy": "1f1e8-1f1e8",
  67810. "shortnames": [":cc:"],
  67811. "category": "flags"
  67812. },
  67813. ":flag_cd:": {
  67814. "uc_base": "1f1e8-1f1e9",
  67815. "uc_output": "1f1e8-1f1e9",
  67816. "uc_match": "1f1e8-1f1e9",
  67817. "uc_greedy": "1f1e8-1f1e9",
  67818. "shortnames": [":congo:"],
  67819. "category": "flags"
  67820. },
  67821. ":flag_cf:": {
  67822. "uc_base": "1f1e8-1f1eb",
  67823. "uc_output": "1f1e8-1f1eb",
  67824. "uc_match": "1f1e8-1f1eb",
  67825. "uc_greedy": "1f1e8-1f1eb",
  67826. "shortnames": [":cf:"],
  67827. "category": "flags"
  67828. },
  67829. ":flag_cg:": {
  67830. "uc_base": "1f1e8-1f1ec",
  67831. "uc_output": "1f1e8-1f1ec",
  67832. "uc_match": "1f1e8-1f1ec",
  67833. "uc_greedy": "1f1e8-1f1ec",
  67834. "shortnames": [":cg:"],
  67835. "category": "flags"
  67836. },
  67837. ":flag_ch:": {
  67838. "uc_base": "1f1e8-1f1ed",
  67839. "uc_output": "1f1e8-1f1ed",
  67840. "uc_match": "1f1e8-1f1ed",
  67841. "uc_greedy": "1f1e8-1f1ed",
  67842. "shortnames": [":ch:"],
  67843. "category": "flags"
  67844. },
  67845. ":flag_ci:": {
  67846. "uc_base": "1f1e8-1f1ee",
  67847. "uc_output": "1f1e8-1f1ee",
  67848. "uc_match": "1f1e8-1f1ee",
  67849. "uc_greedy": "1f1e8-1f1ee",
  67850. "shortnames": [":ci:"],
  67851. "category": "flags"
  67852. },
  67853. ":flag_ck:": {
  67854. "uc_base": "1f1e8-1f1f0",
  67855. "uc_output": "1f1e8-1f1f0",
  67856. "uc_match": "1f1e8-1f1f0",
  67857. "uc_greedy": "1f1e8-1f1f0",
  67858. "shortnames": [":ck:"],
  67859. "category": "flags"
  67860. },
  67861. ":flag_cl:": {
  67862. "uc_base": "1f1e8-1f1f1",
  67863. "uc_output": "1f1e8-1f1f1",
  67864. "uc_match": "1f1e8-1f1f1",
  67865. "uc_greedy": "1f1e8-1f1f1",
  67866. "shortnames": [":chile:"],
  67867. "category": "flags"
  67868. },
  67869. ":flag_cm:": {
  67870. "uc_base": "1f1e8-1f1f2",
  67871. "uc_output": "1f1e8-1f1f2",
  67872. "uc_match": "1f1e8-1f1f2",
  67873. "uc_greedy": "1f1e8-1f1f2",
  67874. "shortnames": [":cm:"],
  67875. "category": "flags"
  67876. },
  67877. ":flag_cn:": {
  67878. "uc_base": "1f1e8-1f1f3",
  67879. "uc_output": "1f1e8-1f1f3",
  67880. "uc_match": "1f1e8-1f1f3",
  67881. "uc_greedy": "1f1e8-1f1f3",
  67882. "shortnames": [":cn:"],
  67883. "category": "flags"
  67884. },
  67885. ":flag_co:": {
  67886. "uc_base": "1f1e8-1f1f4",
  67887. "uc_output": "1f1e8-1f1f4",
  67888. "uc_match": "1f1e8-1f1f4",
  67889. "uc_greedy": "1f1e8-1f1f4",
  67890. "shortnames": [":co:"],
  67891. "category": "flags"
  67892. },
  67893. ":flag_cp:": {
  67894. "uc_base": "1f1e8-1f1f5",
  67895. "uc_output": "1f1e8-1f1f5",
  67896. "uc_match": "1f1e8-1f1f5",
  67897. "uc_greedy": "1f1e8-1f1f5",
  67898. "shortnames": [":cp:"],
  67899. "category": "flags"
  67900. },
  67901. ":flag_cr:": {
  67902. "uc_base": "1f1e8-1f1f7",
  67903. "uc_output": "1f1e8-1f1f7",
  67904. "uc_match": "1f1e8-1f1f7",
  67905. "uc_greedy": "1f1e8-1f1f7",
  67906. "shortnames": [":cr:"],
  67907. "category": "flags"
  67908. },
  67909. ":flag_cu:": {
  67910. "uc_base": "1f1e8-1f1fa",
  67911. "uc_output": "1f1e8-1f1fa",
  67912. "uc_match": "1f1e8-1f1fa",
  67913. "uc_greedy": "1f1e8-1f1fa",
  67914. "shortnames": [":cu:"],
  67915. "category": "flags"
  67916. },
  67917. ":flag_cv:": {
  67918. "uc_base": "1f1e8-1f1fb",
  67919. "uc_output": "1f1e8-1f1fb",
  67920. "uc_match": "1f1e8-1f1fb",
  67921. "uc_greedy": "1f1e8-1f1fb",
  67922. "shortnames": [":cv:"],
  67923. "category": "flags"
  67924. },
  67925. ":flag_cw:": {
  67926. "uc_base": "1f1e8-1f1fc",
  67927. "uc_output": "1f1e8-1f1fc",
  67928. "uc_match": "1f1e8-1f1fc",
  67929. "uc_greedy": "1f1e8-1f1fc",
  67930. "shortnames": [":cw:"],
  67931. "category": "flags"
  67932. },
  67933. ":flag_cx:": {
  67934. "uc_base": "1f1e8-1f1fd",
  67935. "uc_output": "1f1e8-1f1fd",
  67936. "uc_match": "1f1e8-1f1fd",
  67937. "uc_greedy": "1f1e8-1f1fd",
  67938. "shortnames": [":cx:"],
  67939. "category": "flags"
  67940. },
  67941. ":flag_cy:": {
  67942. "uc_base": "1f1e8-1f1fe",
  67943. "uc_output": "1f1e8-1f1fe",
  67944. "uc_match": "1f1e8-1f1fe",
  67945. "uc_greedy": "1f1e8-1f1fe",
  67946. "shortnames": [":cy:"],
  67947. "category": "flags"
  67948. },
  67949. ":flag_cz:": {
  67950. "uc_base": "1f1e8-1f1ff",
  67951. "uc_output": "1f1e8-1f1ff",
  67952. "uc_match": "1f1e8-1f1ff",
  67953. "uc_greedy": "1f1e8-1f1ff",
  67954. "shortnames": [":cz:"],
  67955. "category": "flags"
  67956. },
  67957. ":flag_de:": {
  67958. "uc_base": "1f1e9-1f1ea",
  67959. "uc_output": "1f1e9-1f1ea",
  67960. "uc_match": "1f1e9-1f1ea",
  67961. "uc_greedy": "1f1e9-1f1ea",
  67962. "shortnames": [":de:"],
  67963. "category": "flags"
  67964. },
  67965. ":flag_dg:": {
  67966. "uc_base": "1f1e9-1f1ec",
  67967. "uc_output": "1f1e9-1f1ec",
  67968. "uc_match": "1f1e9-1f1ec",
  67969. "uc_greedy": "1f1e9-1f1ec",
  67970. "shortnames": [":dg:"],
  67971. "category": "flags"
  67972. },
  67973. ":flag_dj:": {
  67974. "uc_base": "1f1e9-1f1ef",
  67975. "uc_output": "1f1e9-1f1ef",
  67976. "uc_match": "1f1e9-1f1ef",
  67977. "uc_greedy": "1f1e9-1f1ef",
  67978. "shortnames": [":dj:"],
  67979. "category": "flags"
  67980. },
  67981. ":flag_dk:": {
  67982. "uc_base": "1f1e9-1f1f0",
  67983. "uc_output": "1f1e9-1f1f0",
  67984. "uc_match": "1f1e9-1f1f0",
  67985. "uc_greedy": "1f1e9-1f1f0",
  67986. "shortnames": [":dk:"],
  67987. "category": "flags"
  67988. },
  67989. ":flag_dm:": {
  67990. "uc_base": "1f1e9-1f1f2",
  67991. "uc_output": "1f1e9-1f1f2",
  67992. "uc_match": "1f1e9-1f1f2",
  67993. "uc_greedy": "1f1e9-1f1f2",
  67994. "shortnames": [":dm:"],
  67995. "category": "flags"
  67996. },
  67997. ":flag_do:": {
  67998. "uc_base": "1f1e9-1f1f4",
  67999. "uc_output": "1f1e9-1f1f4",
  68000. "uc_match": "1f1e9-1f1f4",
  68001. "uc_greedy": "1f1e9-1f1f4",
  68002. "shortnames": [":do:"],
  68003. "category": "flags"
  68004. },
  68005. ":flag_dz:": {
  68006. "uc_base": "1f1e9-1f1ff",
  68007. "uc_output": "1f1e9-1f1ff",
  68008. "uc_match": "1f1e9-1f1ff",
  68009. "uc_greedy": "1f1e9-1f1ff",
  68010. "shortnames": [":dz:"],
  68011. "category": "flags"
  68012. },
  68013. ":flag_ea:": {
  68014. "uc_base": "1f1ea-1f1e6",
  68015. "uc_output": "1f1ea-1f1e6",
  68016. "uc_match": "1f1ea-1f1e6",
  68017. "uc_greedy": "1f1ea-1f1e6",
  68018. "shortnames": [":ea:"],
  68019. "category": "flags"
  68020. },
  68021. ":flag_ec:": {
  68022. "uc_base": "1f1ea-1f1e8",
  68023. "uc_output": "1f1ea-1f1e8",
  68024. "uc_match": "1f1ea-1f1e8",
  68025. "uc_greedy": "1f1ea-1f1e8",
  68026. "shortnames": [":ec:"],
  68027. "category": "flags"
  68028. },
  68029. ":flag_ee:": {
  68030. "uc_base": "1f1ea-1f1ea",
  68031. "uc_output": "1f1ea-1f1ea",
  68032. "uc_match": "1f1ea-1f1ea",
  68033. "uc_greedy": "1f1ea-1f1ea",
  68034. "shortnames": [":ee:"],
  68035. "category": "flags"
  68036. },
  68037. ":flag_eg:": {
  68038. "uc_base": "1f1ea-1f1ec",
  68039. "uc_output": "1f1ea-1f1ec",
  68040. "uc_match": "1f1ea-1f1ec",
  68041. "uc_greedy": "1f1ea-1f1ec",
  68042. "shortnames": [":eg:"],
  68043. "category": "flags"
  68044. },
  68045. ":flag_eh:": {
  68046. "uc_base": "1f1ea-1f1ed",
  68047. "uc_output": "1f1ea-1f1ed",
  68048. "uc_match": "1f1ea-1f1ed",
  68049. "uc_greedy": "1f1ea-1f1ed",
  68050. "shortnames": [":eh:"],
  68051. "category": "flags"
  68052. },
  68053. ":flag_er:": {
  68054. "uc_base": "1f1ea-1f1f7",
  68055. "uc_output": "1f1ea-1f1f7",
  68056. "uc_match": "1f1ea-1f1f7",
  68057. "uc_greedy": "1f1ea-1f1f7",
  68058. "shortnames": [":er:"],
  68059. "category": "flags"
  68060. },
  68061. ":flag_es:": {
  68062. "uc_base": "1f1ea-1f1f8",
  68063. "uc_output": "1f1ea-1f1f8",
  68064. "uc_match": "1f1ea-1f1f8",
  68065. "uc_greedy": "1f1ea-1f1f8",
  68066. "shortnames": [":es:"],
  68067. "category": "flags"
  68068. },
  68069. ":flag_et:": {
  68070. "uc_base": "1f1ea-1f1f9",
  68071. "uc_output": "1f1ea-1f1f9",
  68072. "uc_match": "1f1ea-1f1f9",
  68073. "uc_greedy": "1f1ea-1f1f9",
  68074. "shortnames": [":et:"],
  68075. "category": "flags"
  68076. },
  68077. ":flag_eu:": {
  68078. "uc_base": "1f1ea-1f1fa",
  68079. "uc_output": "1f1ea-1f1fa",
  68080. "uc_match": "1f1ea-1f1fa",
  68081. "uc_greedy": "1f1ea-1f1fa",
  68082. "shortnames": [":eu:"],
  68083. "category": "flags"
  68084. },
  68085. ":flag_fi:": {
  68086. "uc_base": "1f1eb-1f1ee",
  68087. "uc_output": "1f1eb-1f1ee",
  68088. "uc_match": "1f1eb-1f1ee",
  68089. "uc_greedy": "1f1eb-1f1ee",
  68090. "shortnames": [":fi:"],
  68091. "category": "flags"
  68092. },
  68093. ":flag_fj:": {
  68094. "uc_base": "1f1eb-1f1ef",
  68095. "uc_output": "1f1eb-1f1ef",
  68096. "uc_match": "1f1eb-1f1ef",
  68097. "uc_greedy": "1f1eb-1f1ef",
  68098. "shortnames": [":fj:"],
  68099. "category": "flags"
  68100. },
  68101. ":flag_fk:": {
  68102. "uc_base": "1f1eb-1f1f0",
  68103. "uc_output": "1f1eb-1f1f0",
  68104. "uc_match": "1f1eb-1f1f0",
  68105. "uc_greedy": "1f1eb-1f1f0",
  68106. "shortnames": [":fk:"],
  68107. "category": "flags"
  68108. },
  68109. ":flag_fm:": {
  68110. "uc_base": "1f1eb-1f1f2",
  68111. "uc_output": "1f1eb-1f1f2",
  68112. "uc_match": "1f1eb-1f1f2",
  68113. "uc_greedy": "1f1eb-1f1f2",
  68114. "shortnames": [":fm:"],
  68115. "category": "flags"
  68116. },
  68117. ":flag_fo:": {
  68118. "uc_base": "1f1eb-1f1f4",
  68119. "uc_output": "1f1eb-1f1f4",
  68120. "uc_match": "1f1eb-1f1f4",
  68121. "uc_greedy": "1f1eb-1f1f4",
  68122. "shortnames": [":fo:"],
  68123. "category": "flags"
  68124. },
  68125. ":flag_fr:": {
  68126. "uc_base": "1f1eb-1f1f7",
  68127. "uc_output": "1f1eb-1f1f7",
  68128. "uc_match": "1f1eb-1f1f7",
  68129. "uc_greedy": "1f1eb-1f1f7",
  68130. "shortnames": [":fr:"],
  68131. "category": "flags"
  68132. },
  68133. ":flag_ga:": {
  68134. "uc_base": "1f1ec-1f1e6",
  68135. "uc_output": "1f1ec-1f1e6",
  68136. "uc_match": "1f1ec-1f1e6",
  68137. "uc_greedy": "1f1ec-1f1e6",
  68138. "shortnames": [":ga:"],
  68139. "category": "flags"
  68140. },
  68141. ":flag_gb:": {
  68142. "uc_base": "1f1ec-1f1e7",
  68143. "uc_output": "1f1ec-1f1e7",
  68144. "uc_match": "1f1ec-1f1e7",
  68145. "uc_greedy": "1f1ec-1f1e7",
  68146. "shortnames": [":gb:"],
  68147. "category": "flags"
  68148. },
  68149. ":flag_gd:": {
  68150. "uc_base": "1f1ec-1f1e9",
  68151. "uc_output": "1f1ec-1f1e9",
  68152. "uc_match": "1f1ec-1f1e9",
  68153. "uc_greedy": "1f1ec-1f1e9",
  68154. "shortnames": [":gd:"],
  68155. "category": "flags"
  68156. },
  68157. ":flag_ge:": {
  68158. "uc_base": "1f1ec-1f1ea",
  68159. "uc_output": "1f1ec-1f1ea",
  68160. "uc_match": "1f1ec-1f1ea",
  68161. "uc_greedy": "1f1ec-1f1ea",
  68162. "shortnames": [":ge:"],
  68163. "category": "flags"
  68164. },
  68165. ":flag_gf:": {
  68166. "uc_base": "1f1ec-1f1eb",
  68167. "uc_output": "1f1ec-1f1eb",
  68168. "uc_match": "1f1ec-1f1eb",
  68169. "uc_greedy": "1f1ec-1f1eb",
  68170. "shortnames": [":gf:"],
  68171. "category": "flags"
  68172. },
  68173. ":flag_gg:": {
  68174. "uc_base": "1f1ec-1f1ec",
  68175. "uc_output": "1f1ec-1f1ec",
  68176. "uc_match": "1f1ec-1f1ec",
  68177. "uc_greedy": "1f1ec-1f1ec",
  68178. "shortnames": [":gg:"],
  68179. "category": "flags"
  68180. },
  68181. ":flag_gh:": {
  68182. "uc_base": "1f1ec-1f1ed",
  68183. "uc_output": "1f1ec-1f1ed",
  68184. "uc_match": "1f1ec-1f1ed",
  68185. "uc_greedy": "1f1ec-1f1ed",
  68186. "shortnames": [":gh:"],
  68187. "category": "flags"
  68188. },
  68189. ":flag_gi:": {
  68190. "uc_base": "1f1ec-1f1ee",
  68191. "uc_output": "1f1ec-1f1ee",
  68192. "uc_match": "1f1ec-1f1ee",
  68193. "uc_greedy": "1f1ec-1f1ee",
  68194. "shortnames": [":gi:"],
  68195. "category": "flags"
  68196. },
  68197. ":flag_gl:": {
  68198. "uc_base": "1f1ec-1f1f1",
  68199. "uc_output": "1f1ec-1f1f1",
  68200. "uc_match": "1f1ec-1f1f1",
  68201. "uc_greedy": "1f1ec-1f1f1",
  68202. "shortnames": [":gl:"],
  68203. "category": "flags"
  68204. },
  68205. ":flag_gm:": {
  68206. "uc_base": "1f1ec-1f1f2",
  68207. "uc_output": "1f1ec-1f1f2",
  68208. "uc_match": "1f1ec-1f1f2",
  68209. "uc_greedy": "1f1ec-1f1f2",
  68210. "shortnames": [":gm:"],
  68211. "category": "flags"
  68212. },
  68213. ":flag_gn:": {
  68214. "uc_base": "1f1ec-1f1f3",
  68215. "uc_output": "1f1ec-1f1f3",
  68216. "uc_match": "1f1ec-1f1f3",
  68217. "uc_greedy": "1f1ec-1f1f3",
  68218. "shortnames": [":gn:"],
  68219. "category": "flags"
  68220. },
  68221. ":flag_gp:": {
  68222. "uc_base": "1f1ec-1f1f5",
  68223. "uc_output": "1f1ec-1f1f5",
  68224. "uc_match": "1f1ec-1f1f5",
  68225. "uc_greedy": "1f1ec-1f1f5",
  68226. "shortnames": [":gp:"],
  68227. "category": "flags"
  68228. },
  68229. ":flag_gq:": {
  68230. "uc_base": "1f1ec-1f1f6",
  68231. "uc_output": "1f1ec-1f1f6",
  68232. "uc_match": "1f1ec-1f1f6",
  68233. "uc_greedy": "1f1ec-1f1f6",
  68234. "shortnames": [":gq:"],
  68235. "category": "flags"
  68236. },
  68237. ":flag_gr:": {
  68238. "uc_base": "1f1ec-1f1f7",
  68239. "uc_output": "1f1ec-1f1f7",
  68240. "uc_match": "1f1ec-1f1f7",
  68241. "uc_greedy": "1f1ec-1f1f7",
  68242. "shortnames": [":gr:"],
  68243. "category": "flags"
  68244. },
  68245. ":flag_gs:": {
  68246. "uc_base": "1f1ec-1f1f8",
  68247. "uc_output": "1f1ec-1f1f8",
  68248. "uc_match": "1f1ec-1f1f8",
  68249. "uc_greedy": "1f1ec-1f1f8",
  68250. "shortnames": [":gs:"],
  68251. "category": "flags"
  68252. },
  68253. ":flag_gt:": {
  68254. "uc_base": "1f1ec-1f1f9",
  68255. "uc_output": "1f1ec-1f1f9",
  68256. "uc_match": "1f1ec-1f1f9",
  68257. "uc_greedy": "1f1ec-1f1f9",
  68258. "shortnames": [":gt:"],
  68259. "category": "flags"
  68260. },
  68261. ":flag_gu:": {
  68262. "uc_base": "1f1ec-1f1fa",
  68263. "uc_output": "1f1ec-1f1fa",
  68264. "uc_match": "1f1ec-1f1fa",
  68265. "uc_greedy": "1f1ec-1f1fa",
  68266. "shortnames": [":gu:"],
  68267. "category": "flags"
  68268. },
  68269. ":flag_gw:": {
  68270. "uc_base": "1f1ec-1f1fc",
  68271. "uc_output": "1f1ec-1f1fc",
  68272. "uc_match": "1f1ec-1f1fc",
  68273. "uc_greedy": "1f1ec-1f1fc",
  68274. "shortnames": [":gw:"],
  68275. "category": "flags"
  68276. },
  68277. ":flag_gy:": {
  68278. "uc_base": "1f1ec-1f1fe",
  68279. "uc_output": "1f1ec-1f1fe",
  68280. "uc_match": "1f1ec-1f1fe",
  68281. "uc_greedy": "1f1ec-1f1fe",
  68282. "shortnames": [":gy:"],
  68283. "category": "flags"
  68284. },
  68285. ":flag_hk:": {
  68286. "uc_base": "1f1ed-1f1f0",
  68287. "uc_output": "1f1ed-1f1f0",
  68288. "uc_match": "1f1ed-1f1f0",
  68289. "uc_greedy": "1f1ed-1f1f0",
  68290. "shortnames": [":hk:"],
  68291. "category": "flags"
  68292. },
  68293. ":flag_hm:": {
  68294. "uc_base": "1f1ed-1f1f2",
  68295. "uc_output": "1f1ed-1f1f2",
  68296. "uc_match": "1f1ed-1f1f2",
  68297. "uc_greedy": "1f1ed-1f1f2",
  68298. "shortnames": [":hm:"],
  68299. "category": "flags"
  68300. },
  68301. ":flag_hn:": {
  68302. "uc_base": "1f1ed-1f1f3",
  68303. "uc_output": "1f1ed-1f1f3",
  68304. "uc_match": "1f1ed-1f1f3",
  68305. "uc_greedy": "1f1ed-1f1f3",
  68306. "shortnames": [":hn:"],
  68307. "category": "flags"
  68308. },
  68309. ":flag_hr:": {
  68310. "uc_base": "1f1ed-1f1f7",
  68311. "uc_output": "1f1ed-1f1f7",
  68312. "uc_match": "1f1ed-1f1f7",
  68313. "uc_greedy": "1f1ed-1f1f7",
  68314. "shortnames": [":hr:"],
  68315. "category": "flags"
  68316. },
  68317. ":flag_ht:": {
  68318. "uc_base": "1f1ed-1f1f9",
  68319. "uc_output": "1f1ed-1f1f9",
  68320. "uc_match": "1f1ed-1f1f9",
  68321. "uc_greedy": "1f1ed-1f1f9",
  68322. "shortnames": [":ht:"],
  68323. "category": "flags"
  68324. },
  68325. ":flag_hu:": {
  68326. "uc_base": "1f1ed-1f1fa",
  68327. "uc_output": "1f1ed-1f1fa",
  68328. "uc_match": "1f1ed-1f1fa",
  68329. "uc_greedy": "1f1ed-1f1fa",
  68330. "shortnames": [":hu:"],
  68331. "category": "flags"
  68332. },
  68333. ":flag_ic:": {
  68334. "uc_base": "1f1ee-1f1e8",
  68335. "uc_output": "1f1ee-1f1e8",
  68336. "uc_match": "1f1ee-1f1e8",
  68337. "uc_greedy": "1f1ee-1f1e8",
  68338. "shortnames": [":ic:"],
  68339. "category": "flags"
  68340. },
  68341. ":flag_id:": {
  68342. "uc_base": "1f1ee-1f1e9",
  68343. "uc_output": "1f1ee-1f1e9",
  68344. "uc_match": "1f1ee-1f1e9",
  68345. "uc_greedy": "1f1ee-1f1e9",
  68346. "shortnames": [":indonesia:"],
  68347. "category": "flags"
  68348. },
  68349. ":flag_ie:": {
  68350. "uc_base": "1f1ee-1f1ea",
  68351. "uc_output": "1f1ee-1f1ea",
  68352. "uc_match": "1f1ee-1f1ea",
  68353. "uc_greedy": "1f1ee-1f1ea",
  68354. "shortnames": [":ie:"],
  68355. "category": "flags"
  68356. },
  68357. ":flag_il:": {
  68358. "uc_base": "1f1ee-1f1f1",
  68359. "uc_output": "1f1ee-1f1f1",
  68360. "uc_match": "1f1ee-1f1f1",
  68361. "uc_greedy": "1f1ee-1f1f1",
  68362. "shortnames": [":il:"],
  68363. "category": "flags"
  68364. },
  68365. ":flag_im:": {
  68366. "uc_base": "1f1ee-1f1f2",
  68367. "uc_output": "1f1ee-1f1f2",
  68368. "uc_match": "1f1ee-1f1f2",
  68369. "uc_greedy": "1f1ee-1f1f2",
  68370. "shortnames": [":im:"],
  68371. "category": "flags"
  68372. },
  68373. ":flag_in:": {
  68374. "uc_base": "1f1ee-1f1f3",
  68375. "uc_output": "1f1ee-1f1f3",
  68376. "uc_match": "1f1ee-1f1f3",
  68377. "uc_greedy": "1f1ee-1f1f3",
  68378. "shortnames": [":in:"],
  68379. "category": "flags"
  68380. },
  68381. ":flag_io:": {
  68382. "uc_base": "1f1ee-1f1f4",
  68383. "uc_output": "1f1ee-1f1f4",
  68384. "uc_match": "1f1ee-1f1f4",
  68385. "uc_greedy": "1f1ee-1f1f4",
  68386. "shortnames": [":io:"],
  68387. "category": "flags"
  68388. },
  68389. ":flag_iq:": {
  68390. "uc_base": "1f1ee-1f1f6",
  68391. "uc_output": "1f1ee-1f1f6",
  68392. "uc_match": "1f1ee-1f1f6",
  68393. "uc_greedy": "1f1ee-1f1f6",
  68394. "shortnames": [":iq:"],
  68395. "category": "flags"
  68396. },
  68397. ":flag_ir:": {
  68398. "uc_base": "1f1ee-1f1f7",
  68399. "uc_output": "1f1ee-1f1f7",
  68400. "uc_match": "1f1ee-1f1f7",
  68401. "uc_greedy": "1f1ee-1f1f7",
  68402. "shortnames": [":ir:"],
  68403. "category": "flags"
  68404. },
  68405. ":flag_is:": {
  68406. "uc_base": "1f1ee-1f1f8",
  68407. "uc_output": "1f1ee-1f1f8",
  68408. "uc_match": "1f1ee-1f1f8",
  68409. "uc_greedy": "1f1ee-1f1f8",
  68410. "shortnames": [":is:"],
  68411. "category": "flags"
  68412. },
  68413. ":flag_it:": {
  68414. "uc_base": "1f1ee-1f1f9",
  68415. "uc_output": "1f1ee-1f1f9",
  68416. "uc_match": "1f1ee-1f1f9",
  68417. "uc_greedy": "1f1ee-1f1f9",
  68418. "shortnames": [":it:"],
  68419. "category": "flags"
  68420. },
  68421. ":flag_je:": {
  68422. "uc_base": "1f1ef-1f1ea",
  68423. "uc_output": "1f1ef-1f1ea",
  68424. "uc_match": "1f1ef-1f1ea",
  68425. "uc_greedy": "1f1ef-1f1ea",
  68426. "shortnames": [":je:"],
  68427. "category": "flags"
  68428. },
  68429. ":flag_jm:": {
  68430. "uc_base": "1f1ef-1f1f2",
  68431. "uc_output": "1f1ef-1f1f2",
  68432. "uc_match": "1f1ef-1f1f2",
  68433. "uc_greedy": "1f1ef-1f1f2",
  68434. "shortnames": [":jm:"],
  68435. "category": "flags"
  68436. },
  68437. ":flag_jo:": {
  68438. "uc_base": "1f1ef-1f1f4",
  68439. "uc_output": "1f1ef-1f1f4",
  68440. "uc_match": "1f1ef-1f1f4",
  68441. "uc_greedy": "1f1ef-1f1f4",
  68442. "shortnames": [":jo:"],
  68443. "category": "flags"
  68444. },
  68445. ":flag_jp:": {
  68446. "uc_base": "1f1ef-1f1f5",
  68447. "uc_output": "1f1ef-1f1f5",
  68448. "uc_match": "1f1ef-1f1f5",
  68449. "uc_greedy": "1f1ef-1f1f5",
  68450. "shortnames": [":jp:"],
  68451. "category": "flags"
  68452. },
  68453. ":flag_ke:": {
  68454. "uc_base": "1f1f0-1f1ea",
  68455. "uc_output": "1f1f0-1f1ea",
  68456. "uc_match": "1f1f0-1f1ea",
  68457. "uc_greedy": "1f1f0-1f1ea",
  68458. "shortnames": [":ke:"],
  68459. "category": "flags"
  68460. },
  68461. ":flag_kg:": {
  68462. "uc_base": "1f1f0-1f1ec",
  68463. "uc_output": "1f1f0-1f1ec",
  68464. "uc_match": "1f1f0-1f1ec",
  68465. "uc_greedy": "1f1f0-1f1ec",
  68466. "shortnames": [":kg:"],
  68467. "category": "flags"
  68468. },
  68469. ":flag_kh:": {
  68470. "uc_base": "1f1f0-1f1ed",
  68471. "uc_output": "1f1f0-1f1ed",
  68472. "uc_match": "1f1f0-1f1ed",
  68473. "uc_greedy": "1f1f0-1f1ed",
  68474. "shortnames": [":kh:"],
  68475. "category": "flags"
  68476. },
  68477. ":flag_ki:": {
  68478. "uc_base": "1f1f0-1f1ee",
  68479. "uc_output": "1f1f0-1f1ee",
  68480. "uc_match": "1f1f0-1f1ee",
  68481. "uc_greedy": "1f1f0-1f1ee",
  68482. "shortnames": [":ki:"],
  68483. "category": "flags"
  68484. },
  68485. ":flag_km:": {
  68486. "uc_base": "1f1f0-1f1f2",
  68487. "uc_output": "1f1f0-1f1f2",
  68488. "uc_match": "1f1f0-1f1f2",
  68489. "uc_greedy": "1f1f0-1f1f2",
  68490. "shortnames": [":km:"],
  68491. "category": "flags"
  68492. },
  68493. ":flag_kn:": {
  68494. "uc_base": "1f1f0-1f1f3",
  68495. "uc_output": "1f1f0-1f1f3",
  68496. "uc_match": "1f1f0-1f1f3",
  68497. "uc_greedy": "1f1f0-1f1f3",
  68498. "shortnames": [":kn:"],
  68499. "category": "flags"
  68500. },
  68501. ":flag_kp:": {
  68502. "uc_base": "1f1f0-1f1f5",
  68503. "uc_output": "1f1f0-1f1f5",
  68504. "uc_match": "1f1f0-1f1f5",
  68505. "uc_greedy": "1f1f0-1f1f5",
  68506. "shortnames": [":kp:"],
  68507. "category": "flags"
  68508. },
  68509. ":flag_kr:": {
  68510. "uc_base": "1f1f0-1f1f7",
  68511. "uc_output": "1f1f0-1f1f7",
  68512. "uc_match": "1f1f0-1f1f7",
  68513. "uc_greedy": "1f1f0-1f1f7",
  68514. "shortnames": [":kr:"],
  68515. "category": "flags"
  68516. },
  68517. ":flag_kw:": {
  68518. "uc_base": "1f1f0-1f1fc",
  68519. "uc_output": "1f1f0-1f1fc",
  68520. "uc_match": "1f1f0-1f1fc",
  68521. "uc_greedy": "1f1f0-1f1fc",
  68522. "shortnames": [":kw:"],
  68523. "category": "flags"
  68524. },
  68525. ":flag_ky:": {
  68526. "uc_base": "1f1f0-1f1fe",
  68527. "uc_output": "1f1f0-1f1fe",
  68528. "uc_match": "1f1f0-1f1fe",
  68529. "uc_greedy": "1f1f0-1f1fe",
  68530. "shortnames": [":ky:"],
  68531. "category": "flags"
  68532. },
  68533. ":flag_kz:": {
  68534. "uc_base": "1f1f0-1f1ff",
  68535. "uc_output": "1f1f0-1f1ff",
  68536. "uc_match": "1f1f0-1f1ff",
  68537. "uc_greedy": "1f1f0-1f1ff",
  68538. "shortnames": [":kz:"],
  68539. "category": "flags"
  68540. },
  68541. ":flag_la:": {
  68542. "uc_base": "1f1f1-1f1e6",
  68543. "uc_output": "1f1f1-1f1e6",
  68544. "uc_match": "1f1f1-1f1e6",
  68545. "uc_greedy": "1f1f1-1f1e6",
  68546. "shortnames": [":la:"],
  68547. "category": "flags"
  68548. },
  68549. ":flag_lb:": {
  68550. "uc_base": "1f1f1-1f1e7",
  68551. "uc_output": "1f1f1-1f1e7",
  68552. "uc_match": "1f1f1-1f1e7",
  68553. "uc_greedy": "1f1f1-1f1e7",
  68554. "shortnames": [":lb:"],
  68555. "category": "flags"
  68556. },
  68557. ":flag_lc:": {
  68558. "uc_base": "1f1f1-1f1e8",
  68559. "uc_output": "1f1f1-1f1e8",
  68560. "uc_match": "1f1f1-1f1e8",
  68561. "uc_greedy": "1f1f1-1f1e8",
  68562. "shortnames": [":lc:"],
  68563. "category": "flags"
  68564. },
  68565. ":flag_li:": {
  68566. "uc_base": "1f1f1-1f1ee",
  68567. "uc_output": "1f1f1-1f1ee",
  68568. "uc_match": "1f1f1-1f1ee",
  68569. "uc_greedy": "1f1f1-1f1ee",
  68570. "shortnames": [":li:"],
  68571. "category": "flags"
  68572. },
  68573. ":flag_lk:": {
  68574. "uc_base": "1f1f1-1f1f0",
  68575. "uc_output": "1f1f1-1f1f0",
  68576. "uc_match": "1f1f1-1f1f0",
  68577. "uc_greedy": "1f1f1-1f1f0",
  68578. "shortnames": [":lk:"],
  68579. "category": "flags"
  68580. },
  68581. ":flag_lr:": {
  68582. "uc_base": "1f1f1-1f1f7",
  68583. "uc_output": "1f1f1-1f1f7",
  68584. "uc_match": "1f1f1-1f1f7",
  68585. "uc_greedy": "1f1f1-1f1f7",
  68586. "shortnames": [":lr:"],
  68587. "category": "flags"
  68588. },
  68589. ":flag_ls:": {
  68590. "uc_base": "1f1f1-1f1f8",
  68591. "uc_output": "1f1f1-1f1f8",
  68592. "uc_match": "1f1f1-1f1f8",
  68593. "uc_greedy": "1f1f1-1f1f8",
  68594. "shortnames": [":ls:"],
  68595. "category": "flags"
  68596. },
  68597. ":flag_lt:": {
  68598. "uc_base": "1f1f1-1f1f9",
  68599. "uc_output": "1f1f1-1f1f9",
  68600. "uc_match": "1f1f1-1f1f9",
  68601. "uc_greedy": "1f1f1-1f1f9",
  68602. "shortnames": [":lt:"],
  68603. "category": "flags"
  68604. },
  68605. ":flag_lu:": {
  68606. "uc_base": "1f1f1-1f1fa",
  68607. "uc_output": "1f1f1-1f1fa",
  68608. "uc_match": "1f1f1-1f1fa",
  68609. "uc_greedy": "1f1f1-1f1fa",
  68610. "shortnames": [":lu:"],
  68611. "category": "flags"
  68612. },
  68613. ":flag_lv:": {
  68614. "uc_base": "1f1f1-1f1fb",
  68615. "uc_output": "1f1f1-1f1fb",
  68616. "uc_match": "1f1f1-1f1fb",
  68617. "uc_greedy": "1f1f1-1f1fb",
  68618. "shortnames": [":lv:"],
  68619. "category": "flags"
  68620. },
  68621. ":flag_ly:": {
  68622. "uc_base": "1f1f1-1f1fe",
  68623. "uc_output": "1f1f1-1f1fe",
  68624. "uc_match": "1f1f1-1f1fe",
  68625. "uc_greedy": "1f1f1-1f1fe",
  68626. "shortnames": [":ly:"],
  68627. "category": "flags"
  68628. },
  68629. ":flag_ma:": {
  68630. "uc_base": "1f1f2-1f1e6",
  68631. "uc_output": "1f1f2-1f1e6",
  68632. "uc_match": "1f1f2-1f1e6",
  68633. "uc_greedy": "1f1f2-1f1e6",
  68634. "shortnames": [":ma:"],
  68635. "category": "flags"
  68636. },
  68637. ":flag_mc:": {
  68638. "uc_base": "1f1f2-1f1e8",
  68639. "uc_output": "1f1f2-1f1e8",
  68640. "uc_match": "1f1f2-1f1e8",
  68641. "uc_greedy": "1f1f2-1f1e8",
  68642. "shortnames": [":mc:"],
  68643. "category": "flags"
  68644. },
  68645. ":flag_md:": {
  68646. "uc_base": "1f1f2-1f1e9",
  68647. "uc_output": "1f1f2-1f1e9",
  68648. "uc_match": "1f1f2-1f1e9",
  68649. "uc_greedy": "1f1f2-1f1e9",
  68650. "shortnames": [":md:"],
  68651. "category": "flags"
  68652. },
  68653. ":flag_me:": {
  68654. "uc_base": "1f1f2-1f1ea",
  68655. "uc_output": "1f1f2-1f1ea",
  68656. "uc_match": "1f1f2-1f1ea",
  68657. "uc_greedy": "1f1f2-1f1ea",
  68658. "shortnames": [":me:"],
  68659. "category": "flags"
  68660. },
  68661. ":flag_mf:": {
  68662. "uc_base": "1f1f2-1f1eb",
  68663. "uc_output": "1f1f2-1f1eb",
  68664. "uc_match": "1f1f2-1f1eb",
  68665. "uc_greedy": "1f1f2-1f1eb",
  68666. "shortnames": [":mf:"],
  68667. "category": "flags"
  68668. },
  68669. ":flag_mg:": {
  68670. "uc_base": "1f1f2-1f1ec",
  68671. "uc_output": "1f1f2-1f1ec",
  68672. "uc_match": "1f1f2-1f1ec",
  68673. "uc_greedy": "1f1f2-1f1ec",
  68674. "shortnames": [":mg:"],
  68675. "category": "flags"
  68676. },
  68677. ":flag_mh:": {
  68678. "uc_base": "1f1f2-1f1ed",
  68679. "uc_output": "1f1f2-1f1ed",
  68680. "uc_match": "1f1f2-1f1ed",
  68681. "uc_greedy": "1f1f2-1f1ed",
  68682. "shortnames": [":mh:"],
  68683. "category": "flags"
  68684. },
  68685. ":flag_mk:": {
  68686. "uc_base": "1f1f2-1f1f0",
  68687. "uc_output": "1f1f2-1f1f0",
  68688. "uc_match": "1f1f2-1f1f0",
  68689. "uc_greedy": "1f1f2-1f1f0",
  68690. "shortnames": [":mk:"],
  68691. "category": "flags"
  68692. },
  68693. ":flag_ml:": {
  68694. "uc_base": "1f1f2-1f1f1",
  68695. "uc_output": "1f1f2-1f1f1",
  68696. "uc_match": "1f1f2-1f1f1",
  68697. "uc_greedy": "1f1f2-1f1f1",
  68698. "shortnames": [":ml:"],
  68699. "category": "flags"
  68700. },
  68701. ":flag_mm:": {
  68702. "uc_base": "1f1f2-1f1f2",
  68703. "uc_output": "1f1f2-1f1f2",
  68704. "uc_match": "1f1f2-1f1f2",
  68705. "uc_greedy": "1f1f2-1f1f2",
  68706. "shortnames": [":mm:"],
  68707. "category": "flags"
  68708. },
  68709. ":flag_mn:": {
  68710. "uc_base": "1f1f2-1f1f3",
  68711. "uc_output": "1f1f2-1f1f3",
  68712. "uc_match": "1f1f2-1f1f3",
  68713. "uc_greedy": "1f1f2-1f1f3",
  68714. "shortnames": [":mn:"],
  68715. "category": "flags"
  68716. },
  68717. ":flag_mo:": {
  68718. "uc_base": "1f1f2-1f1f4",
  68719. "uc_output": "1f1f2-1f1f4",
  68720. "uc_match": "1f1f2-1f1f4",
  68721. "uc_greedy": "1f1f2-1f1f4",
  68722. "shortnames": [":mo:"],
  68723. "category": "flags"
  68724. },
  68725. ":flag_mp:": {
  68726. "uc_base": "1f1f2-1f1f5",
  68727. "uc_output": "1f1f2-1f1f5",
  68728. "uc_match": "1f1f2-1f1f5",
  68729. "uc_greedy": "1f1f2-1f1f5",
  68730. "shortnames": [":mp:"],
  68731. "category": "flags"
  68732. },
  68733. ":flag_mq:": {
  68734. "uc_base": "1f1f2-1f1f6",
  68735. "uc_output": "1f1f2-1f1f6",
  68736. "uc_match": "1f1f2-1f1f6",
  68737. "uc_greedy": "1f1f2-1f1f6",
  68738. "shortnames": [":mq:"],
  68739. "category": "flags"
  68740. },
  68741. ":flag_mr:": {
  68742. "uc_base": "1f1f2-1f1f7",
  68743. "uc_output": "1f1f2-1f1f7",
  68744. "uc_match": "1f1f2-1f1f7",
  68745. "uc_greedy": "1f1f2-1f1f7",
  68746. "shortnames": [":mr:"],
  68747. "category": "flags"
  68748. },
  68749. ":flag_ms:": {
  68750. "uc_base": "1f1f2-1f1f8",
  68751. "uc_output": "1f1f2-1f1f8",
  68752. "uc_match": "1f1f2-1f1f8",
  68753. "uc_greedy": "1f1f2-1f1f8",
  68754. "shortnames": [":ms:"],
  68755. "category": "flags"
  68756. },
  68757. ":flag_mt:": {
  68758. "uc_base": "1f1f2-1f1f9",
  68759. "uc_output": "1f1f2-1f1f9",
  68760. "uc_match": "1f1f2-1f1f9",
  68761. "uc_greedy": "1f1f2-1f1f9",
  68762. "shortnames": [":mt:"],
  68763. "category": "flags"
  68764. },
  68765. ":flag_mu:": {
  68766. "uc_base": "1f1f2-1f1fa",
  68767. "uc_output": "1f1f2-1f1fa",
  68768. "uc_match": "1f1f2-1f1fa",
  68769. "uc_greedy": "1f1f2-1f1fa",
  68770. "shortnames": [":mu:"],
  68771. "category": "flags"
  68772. },
  68773. ":flag_mv:": {
  68774. "uc_base": "1f1f2-1f1fb",
  68775. "uc_output": "1f1f2-1f1fb",
  68776. "uc_match": "1f1f2-1f1fb",
  68777. "uc_greedy": "1f1f2-1f1fb",
  68778. "shortnames": [":mv:"],
  68779. "category": "flags"
  68780. },
  68781. ":flag_mw:": {
  68782. "uc_base": "1f1f2-1f1fc",
  68783. "uc_output": "1f1f2-1f1fc",
  68784. "uc_match": "1f1f2-1f1fc",
  68785. "uc_greedy": "1f1f2-1f1fc",
  68786. "shortnames": [":mw:"],
  68787. "category": "flags"
  68788. },
  68789. ":flag_mx:": {
  68790. "uc_base": "1f1f2-1f1fd",
  68791. "uc_output": "1f1f2-1f1fd",
  68792. "uc_match": "1f1f2-1f1fd",
  68793. "uc_greedy": "1f1f2-1f1fd",
  68794. "shortnames": [":mx:"],
  68795. "category": "flags"
  68796. },
  68797. ":flag_my:": {
  68798. "uc_base": "1f1f2-1f1fe",
  68799. "uc_output": "1f1f2-1f1fe",
  68800. "uc_match": "1f1f2-1f1fe",
  68801. "uc_greedy": "1f1f2-1f1fe",
  68802. "shortnames": [":my:"],
  68803. "category": "flags"
  68804. },
  68805. ":flag_mz:": {
  68806. "uc_base": "1f1f2-1f1ff",
  68807. "uc_output": "1f1f2-1f1ff",
  68808. "uc_match": "1f1f2-1f1ff",
  68809. "uc_greedy": "1f1f2-1f1ff",
  68810. "shortnames": [":mz:"],
  68811. "category": "flags"
  68812. },
  68813. ":flag_na:": {
  68814. "uc_base": "1f1f3-1f1e6",
  68815. "uc_output": "1f1f3-1f1e6",
  68816. "uc_match": "1f1f3-1f1e6",
  68817. "uc_greedy": "1f1f3-1f1e6",
  68818. "shortnames": [":na:"],
  68819. "category": "flags"
  68820. },
  68821. ":flag_nc:": {
  68822. "uc_base": "1f1f3-1f1e8",
  68823. "uc_output": "1f1f3-1f1e8",
  68824. "uc_match": "1f1f3-1f1e8",
  68825. "uc_greedy": "1f1f3-1f1e8",
  68826. "shortnames": [":nc:"],
  68827. "category": "flags"
  68828. },
  68829. ":flag_ne:": {
  68830. "uc_base": "1f1f3-1f1ea",
  68831. "uc_output": "1f1f3-1f1ea",
  68832. "uc_match": "1f1f3-1f1ea",
  68833. "uc_greedy": "1f1f3-1f1ea",
  68834. "shortnames": [":ne:"],
  68835. "category": "flags"
  68836. },
  68837. ":flag_nf:": {
  68838. "uc_base": "1f1f3-1f1eb",
  68839. "uc_output": "1f1f3-1f1eb",
  68840. "uc_match": "1f1f3-1f1eb",
  68841. "uc_greedy": "1f1f3-1f1eb",
  68842. "shortnames": [":nf:"],
  68843. "category": "flags"
  68844. },
  68845. ":flag_ng:": {
  68846. "uc_base": "1f1f3-1f1ec",
  68847. "uc_output": "1f1f3-1f1ec",
  68848. "uc_match": "1f1f3-1f1ec",
  68849. "uc_greedy": "1f1f3-1f1ec",
  68850. "shortnames": [":nigeria:"],
  68851. "category": "flags"
  68852. },
  68853. ":flag_ni:": {
  68854. "uc_base": "1f1f3-1f1ee",
  68855. "uc_output": "1f1f3-1f1ee",
  68856. "uc_match": "1f1f3-1f1ee",
  68857. "uc_greedy": "1f1f3-1f1ee",
  68858. "shortnames": [":ni:"],
  68859. "category": "flags"
  68860. },
  68861. ":flag_nl:": {
  68862. "uc_base": "1f1f3-1f1f1",
  68863. "uc_output": "1f1f3-1f1f1",
  68864. "uc_match": "1f1f3-1f1f1",
  68865. "uc_greedy": "1f1f3-1f1f1",
  68866. "shortnames": [":nl:"],
  68867. "category": "flags"
  68868. },
  68869. ":flag_no:": {
  68870. "uc_base": "1f1f3-1f1f4",
  68871. "uc_output": "1f1f3-1f1f4",
  68872. "uc_match": "1f1f3-1f1f4",
  68873. "uc_greedy": "1f1f3-1f1f4",
  68874. "shortnames": [":no:"],
  68875. "category": "flags"
  68876. },
  68877. ":flag_np:": {
  68878. "uc_base": "1f1f3-1f1f5",
  68879. "uc_output": "1f1f3-1f1f5",
  68880. "uc_match": "1f1f3-1f1f5",
  68881. "uc_greedy": "1f1f3-1f1f5",
  68882. "shortnames": [":np:"],
  68883. "category": "flags"
  68884. },
  68885. ":flag_nr:": {
  68886. "uc_base": "1f1f3-1f1f7",
  68887. "uc_output": "1f1f3-1f1f7",
  68888. "uc_match": "1f1f3-1f1f7",
  68889. "uc_greedy": "1f1f3-1f1f7",
  68890. "shortnames": [":nr:"],
  68891. "category": "flags"
  68892. },
  68893. ":flag_nu:": {
  68894. "uc_base": "1f1f3-1f1fa",
  68895. "uc_output": "1f1f3-1f1fa",
  68896. "uc_match": "1f1f3-1f1fa",
  68897. "uc_greedy": "1f1f3-1f1fa",
  68898. "shortnames": [":nu:"],
  68899. "category": "flags"
  68900. },
  68901. ":flag_nz:": {
  68902. "uc_base": "1f1f3-1f1ff",
  68903. "uc_output": "1f1f3-1f1ff",
  68904. "uc_match": "1f1f3-1f1ff",
  68905. "uc_greedy": "1f1f3-1f1ff",
  68906. "shortnames": [":nz:"],
  68907. "category": "flags"
  68908. },
  68909. ":flag_om:": {
  68910. "uc_base": "1f1f4-1f1f2",
  68911. "uc_output": "1f1f4-1f1f2",
  68912. "uc_match": "1f1f4-1f1f2",
  68913. "uc_greedy": "1f1f4-1f1f2",
  68914. "shortnames": [":om:"],
  68915. "category": "flags"
  68916. },
  68917. ":flag_pa:": {
  68918. "uc_base": "1f1f5-1f1e6",
  68919. "uc_output": "1f1f5-1f1e6",
  68920. "uc_match": "1f1f5-1f1e6",
  68921. "uc_greedy": "1f1f5-1f1e6",
  68922. "shortnames": [":pa:"],
  68923. "category": "flags"
  68924. },
  68925. ":flag_pe:": {
  68926. "uc_base": "1f1f5-1f1ea",
  68927. "uc_output": "1f1f5-1f1ea",
  68928. "uc_match": "1f1f5-1f1ea",
  68929. "uc_greedy": "1f1f5-1f1ea",
  68930. "shortnames": [":pe:"],
  68931. "category": "flags"
  68932. },
  68933. ":flag_pf:": {
  68934. "uc_base": "1f1f5-1f1eb",
  68935. "uc_output": "1f1f5-1f1eb",
  68936. "uc_match": "1f1f5-1f1eb",
  68937. "uc_greedy": "1f1f5-1f1eb",
  68938. "shortnames": [":pf:"],
  68939. "category": "flags"
  68940. },
  68941. ":flag_pg:": {
  68942. "uc_base": "1f1f5-1f1ec",
  68943. "uc_output": "1f1f5-1f1ec",
  68944. "uc_match": "1f1f5-1f1ec",
  68945. "uc_greedy": "1f1f5-1f1ec",
  68946. "shortnames": [":pg:"],
  68947. "category": "flags"
  68948. },
  68949. ":flag_ph:": {
  68950. "uc_base": "1f1f5-1f1ed",
  68951. "uc_output": "1f1f5-1f1ed",
  68952. "uc_match": "1f1f5-1f1ed",
  68953. "uc_greedy": "1f1f5-1f1ed",
  68954. "shortnames": [":ph:"],
  68955. "category": "flags"
  68956. },
  68957. ":flag_pk:": {
  68958. "uc_base": "1f1f5-1f1f0",
  68959. "uc_output": "1f1f5-1f1f0",
  68960. "uc_match": "1f1f5-1f1f0",
  68961. "uc_greedy": "1f1f5-1f1f0",
  68962. "shortnames": [":pk:"],
  68963. "category": "flags"
  68964. },
  68965. ":flag_pl:": {
  68966. "uc_base": "1f1f5-1f1f1",
  68967. "uc_output": "1f1f5-1f1f1",
  68968. "uc_match": "1f1f5-1f1f1",
  68969. "uc_greedy": "1f1f5-1f1f1",
  68970. "shortnames": [":pl:"],
  68971. "category": "flags"
  68972. },
  68973. ":flag_pm:": {
  68974. "uc_base": "1f1f5-1f1f2",
  68975. "uc_output": "1f1f5-1f1f2",
  68976. "uc_match": "1f1f5-1f1f2",
  68977. "uc_greedy": "1f1f5-1f1f2",
  68978. "shortnames": [":pm:"],
  68979. "category": "flags"
  68980. },
  68981. ":flag_pn:": {
  68982. "uc_base": "1f1f5-1f1f3",
  68983. "uc_output": "1f1f5-1f1f3",
  68984. "uc_match": "1f1f5-1f1f3",
  68985. "uc_greedy": "1f1f5-1f1f3",
  68986. "shortnames": [":pn:"],
  68987. "category": "flags"
  68988. },
  68989. ":flag_pr:": {
  68990. "uc_base": "1f1f5-1f1f7",
  68991. "uc_output": "1f1f5-1f1f7",
  68992. "uc_match": "1f1f5-1f1f7",
  68993. "uc_greedy": "1f1f5-1f1f7",
  68994. "shortnames": [":pr:"],
  68995. "category": "flags"
  68996. },
  68997. ":flag_ps:": {
  68998. "uc_base": "1f1f5-1f1f8",
  68999. "uc_output": "1f1f5-1f1f8",
  69000. "uc_match": "1f1f5-1f1f8",
  69001. "uc_greedy": "1f1f5-1f1f8",
  69002. "shortnames": [":ps:"],
  69003. "category": "flags"
  69004. },
  69005. ":flag_pt:": {
  69006. "uc_base": "1f1f5-1f1f9",
  69007. "uc_output": "1f1f5-1f1f9",
  69008. "uc_match": "1f1f5-1f1f9",
  69009. "uc_greedy": "1f1f5-1f1f9",
  69010. "shortnames": [":pt:"],
  69011. "category": "flags"
  69012. },
  69013. ":flag_pw:": {
  69014. "uc_base": "1f1f5-1f1fc",
  69015. "uc_output": "1f1f5-1f1fc",
  69016. "uc_match": "1f1f5-1f1fc",
  69017. "uc_greedy": "1f1f5-1f1fc",
  69018. "shortnames": [":pw:"],
  69019. "category": "flags"
  69020. },
  69021. ":flag_py:": {
  69022. "uc_base": "1f1f5-1f1fe",
  69023. "uc_output": "1f1f5-1f1fe",
  69024. "uc_match": "1f1f5-1f1fe",
  69025. "uc_greedy": "1f1f5-1f1fe",
  69026. "shortnames": [":py:"],
  69027. "category": "flags"
  69028. },
  69029. ":flag_qa:": {
  69030. "uc_base": "1f1f6-1f1e6",
  69031. "uc_output": "1f1f6-1f1e6",
  69032. "uc_match": "1f1f6-1f1e6",
  69033. "uc_greedy": "1f1f6-1f1e6",
  69034. "shortnames": [":qa:"],
  69035. "category": "flags"
  69036. },
  69037. ":flag_re:": {
  69038. "uc_base": "1f1f7-1f1ea",
  69039. "uc_output": "1f1f7-1f1ea",
  69040. "uc_match": "1f1f7-1f1ea",
  69041. "uc_greedy": "1f1f7-1f1ea",
  69042. "shortnames": [":re:"],
  69043. "category": "flags"
  69044. },
  69045. ":flag_ro:": {
  69046. "uc_base": "1f1f7-1f1f4",
  69047. "uc_output": "1f1f7-1f1f4",
  69048. "uc_match": "1f1f7-1f1f4",
  69049. "uc_greedy": "1f1f7-1f1f4",
  69050. "shortnames": [":ro:"],
  69051. "category": "flags"
  69052. },
  69053. ":flag_rs:": {
  69054. "uc_base": "1f1f7-1f1f8",
  69055. "uc_output": "1f1f7-1f1f8",
  69056. "uc_match": "1f1f7-1f1f8",
  69057. "uc_greedy": "1f1f7-1f1f8",
  69058. "shortnames": [":rs:"],
  69059. "category": "flags"
  69060. },
  69061. ":flag_ru:": {
  69062. "uc_base": "1f1f7-1f1fa",
  69063. "uc_output": "1f1f7-1f1fa",
  69064. "uc_match": "1f1f7-1f1fa",
  69065. "uc_greedy": "1f1f7-1f1fa",
  69066. "shortnames": [":ru:"],
  69067. "category": "flags"
  69068. },
  69069. ":flag_rw:": {
  69070. "uc_base": "1f1f7-1f1fc",
  69071. "uc_output": "1f1f7-1f1fc",
  69072. "uc_match": "1f1f7-1f1fc",
  69073. "uc_greedy": "1f1f7-1f1fc",
  69074. "shortnames": [":rw:"],
  69075. "category": "flags"
  69076. },
  69077. ":flag_sa:": {
  69078. "uc_base": "1f1f8-1f1e6",
  69079. "uc_output": "1f1f8-1f1e6",
  69080. "uc_match": "1f1f8-1f1e6",
  69081. "uc_greedy": "1f1f8-1f1e6",
  69082. "shortnames": [":saudiarabia:", ":saudi:"],
  69083. "category": "flags"
  69084. },
  69085. ":flag_sb:": {
  69086. "uc_base": "1f1f8-1f1e7",
  69087. "uc_output": "1f1f8-1f1e7",
  69088. "uc_match": "1f1f8-1f1e7",
  69089. "uc_greedy": "1f1f8-1f1e7",
  69090. "shortnames": [":sb:"],
  69091. "category": "flags"
  69092. },
  69093. ":flag_sc:": {
  69094. "uc_base": "1f1f8-1f1e8",
  69095. "uc_output": "1f1f8-1f1e8",
  69096. "uc_match": "1f1f8-1f1e8",
  69097. "uc_greedy": "1f1f8-1f1e8",
  69098. "shortnames": [":sc:"],
  69099. "category": "flags"
  69100. },
  69101. ":flag_sd:": {
  69102. "uc_base": "1f1f8-1f1e9",
  69103. "uc_output": "1f1f8-1f1e9",
  69104. "uc_match": "1f1f8-1f1e9",
  69105. "uc_greedy": "1f1f8-1f1e9",
  69106. "shortnames": [":sd:"],
  69107. "category": "flags"
  69108. },
  69109. ":flag_se:": {
  69110. "uc_base": "1f1f8-1f1ea",
  69111. "uc_output": "1f1f8-1f1ea",
  69112. "uc_match": "1f1f8-1f1ea",
  69113. "uc_greedy": "1f1f8-1f1ea",
  69114. "shortnames": [":se:"],
  69115. "category": "flags"
  69116. },
  69117. ":flag_sg:": {
  69118. "uc_base": "1f1f8-1f1ec",
  69119. "uc_output": "1f1f8-1f1ec",
  69120. "uc_match": "1f1f8-1f1ec",
  69121. "uc_greedy": "1f1f8-1f1ec",
  69122. "shortnames": [":sg:"],
  69123. "category": "flags"
  69124. },
  69125. ":flag_sh:": {
  69126. "uc_base": "1f1f8-1f1ed",
  69127. "uc_output": "1f1f8-1f1ed",
  69128. "uc_match": "1f1f8-1f1ed",
  69129. "uc_greedy": "1f1f8-1f1ed",
  69130. "shortnames": [":sh:"],
  69131. "category": "flags"
  69132. },
  69133. ":flag_si:": {
  69134. "uc_base": "1f1f8-1f1ee",
  69135. "uc_output": "1f1f8-1f1ee",
  69136. "uc_match": "1f1f8-1f1ee",
  69137. "uc_greedy": "1f1f8-1f1ee",
  69138. "shortnames": [":si:"],
  69139. "category": "flags"
  69140. },
  69141. ":flag_sj:": {
  69142. "uc_base": "1f1f8-1f1ef",
  69143. "uc_output": "1f1f8-1f1ef",
  69144. "uc_match": "1f1f8-1f1ef",
  69145. "uc_greedy": "1f1f8-1f1ef",
  69146. "shortnames": [":sj:"],
  69147. "category": "flags"
  69148. },
  69149. ":flag_sk:": {
  69150. "uc_base": "1f1f8-1f1f0",
  69151. "uc_output": "1f1f8-1f1f0",
  69152. "uc_match": "1f1f8-1f1f0",
  69153. "uc_greedy": "1f1f8-1f1f0",
  69154. "shortnames": [":sk:"],
  69155. "category": "flags"
  69156. },
  69157. ":flag_sl:": {
  69158. "uc_base": "1f1f8-1f1f1",
  69159. "uc_output": "1f1f8-1f1f1",
  69160. "uc_match": "1f1f8-1f1f1",
  69161. "uc_greedy": "1f1f8-1f1f1",
  69162. "shortnames": [":sl:"],
  69163. "category": "flags"
  69164. },
  69165. ":flag_sm:": {
  69166. "uc_base": "1f1f8-1f1f2",
  69167. "uc_output": "1f1f8-1f1f2",
  69168. "uc_match": "1f1f8-1f1f2",
  69169. "uc_greedy": "1f1f8-1f1f2",
  69170. "shortnames": [":sm:"],
  69171. "category": "flags"
  69172. },
  69173. ":flag_sn:": {
  69174. "uc_base": "1f1f8-1f1f3",
  69175. "uc_output": "1f1f8-1f1f3",
  69176. "uc_match": "1f1f8-1f1f3",
  69177. "uc_greedy": "1f1f8-1f1f3",
  69178. "shortnames": [":sn:"],
  69179. "category": "flags"
  69180. },
  69181. ":flag_so:": {
  69182. "uc_base": "1f1f8-1f1f4",
  69183. "uc_output": "1f1f8-1f1f4",
  69184. "uc_match": "1f1f8-1f1f4",
  69185. "uc_greedy": "1f1f8-1f1f4",
  69186. "shortnames": [":so:"],
  69187. "category": "flags"
  69188. },
  69189. ":flag_sr:": {
  69190. "uc_base": "1f1f8-1f1f7",
  69191. "uc_output": "1f1f8-1f1f7",
  69192. "uc_match": "1f1f8-1f1f7",
  69193. "uc_greedy": "1f1f8-1f1f7",
  69194. "shortnames": [":sr:"],
  69195. "category": "flags"
  69196. },
  69197. ":flag_ss:": {
  69198. "uc_base": "1f1f8-1f1f8",
  69199. "uc_output": "1f1f8-1f1f8",
  69200. "uc_match": "1f1f8-1f1f8",
  69201. "uc_greedy": "1f1f8-1f1f8",
  69202. "shortnames": [":ss:"],
  69203. "category": "flags"
  69204. },
  69205. ":flag_st:": {
  69206. "uc_base": "1f1f8-1f1f9",
  69207. "uc_output": "1f1f8-1f1f9",
  69208. "uc_match": "1f1f8-1f1f9",
  69209. "uc_greedy": "1f1f8-1f1f9",
  69210. "shortnames": [":st:"],
  69211. "category": "flags"
  69212. },
  69213. ":flag_sv:": {
  69214. "uc_base": "1f1f8-1f1fb",
  69215. "uc_output": "1f1f8-1f1fb",
  69216. "uc_match": "1f1f8-1f1fb",
  69217. "uc_greedy": "1f1f8-1f1fb",
  69218. "shortnames": [":sv:"],
  69219. "category": "flags"
  69220. },
  69221. ":flag_sx:": {
  69222. "uc_base": "1f1f8-1f1fd",
  69223. "uc_output": "1f1f8-1f1fd",
  69224. "uc_match": "1f1f8-1f1fd",
  69225. "uc_greedy": "1f1f8-1f1fd",
  69226. "shortnames": [":sx:"],
  69227. "category": "flags"
  69228. },
  69229. ":flag_sy:": {
  69230. "uc_base": "1f1f8-1f1fe",
  69231. "uc_output": "1f1f8-1f1fe",
  69232. "uc_match": "1f1f8-1f1fe",
  69233. "uc_greedy": "1f1f8-1f1fe",
  69234. "shortnames": [":sy:"],
  69235. "category": "flags"
  69236. },
  69237. ":flag_sz:": {
  69238. "uc_base": "1f1f8-1f1ff",
  69239. "uc_output": "1f1f8-1f1ff",
  69240. "uc_match": "1f1f8-1f1ff",
  69241. "uc_greedy": "1f1f8-1f1ff",
  69242. "shortnames": [":sz:"],
  69243. "category": "flags"
  69244. },
  69245. ":flag_ta:": {
  69246. "uc_base": "1f1f9-1f1e6",
  69247. "uc_output": "1f1f9-1f1e6",
  69248. "uc_match": "1f1f9-1f1e6",
  69249. "uc_greedy": "1f1f9-1f1e6",
  69250. "shortnames": [":ta:"],
  69251. "category": "flags"
  69252. },
  69253. ":flag_tc:": {
  69254. "uc_base": "1f1f9-1f1e8",
  69255. "uc_output": "1f1f9-1f1e8",
  69256. "uc_match": "1f1f9-1f1e8",
  69257. "uc_greedy": "1f1f9-1f1e8",
  69258. "shortnames": [":tc:"],
  69259. "category": "flags"
  69260. },
  69261. ":flag_td:": {
  69262. "uc_base": "1f1f9-1f1e9",
  69263. "uc_output": "1f1f9-1f1e9",
  69264. "uc_match": "1f1f9-1f1e9",
  69265. "uc_greedy": "1f1f9-1f1e9",
  69266. "shortnames": [":td:"],
  69267. "category": "flags"
  69268. },
  69269. ":flag_tf:": {
  69270. "uc_base": "1f1f9-1f1eb",
  69271. "uc_output": "1f1f9-1f1eb",
  69272. "uc_match": "1f1f9-1f1eb",
  69273. "uc_greedy": "1f1f9-1f1eb",
  69274. "shortnames": [":tf:"],
  69275. "category": "flags"
  69276. },
  69277. ":flag_tg:": {
  69278. "uc_base": "1f1f9-1f1ec",
  69279. "uc_output": "1f1f9-1f1ec",
  69280. "uc_match": "1f1f9-1f1ec",
  69281. "uc_greedy": "1f1f9-1f1ec",
  69282. "shortnames": [":tg:"],
  69283. "category": "flags"
  69284. },
  69285. ":flag_th:": {
  69286. "uc_base": "1f1f9-1f1ed",
  69287. "uc_output": "1f1f9-1f1ed",
  69288. "uc_match": "1f1f9-1f1ed",
  69289. "uc_greedy": "1f1f9-1f1ed",
  69290. "shortnames": [":th:"],
  69291. "category": "flags"
  69292. },
  69293. ":flag_tj:": {
  69294. "uc_base": "1f1f9-1f1ef",
  69295. "uc_output": "1f1f9-1f1ef",
  69296. "uc_match": "1f1f9-1f1ef",
  69297. "uc_greedy": "1f1f9-1f1ef",
  69298. "shortnames": [":tj:"],
  69299. "category": "flags"
  69300. },
  69301. ":flag_tk:": {
  69302. "uc_base": "1f1f9-1f1f0",
  69303. "uc_output": "1f1f9-1f1f0",
  69304. "uc_match": "1f1f9-1f1f0",
  69305. "uc_greedy": "1f1f9-1f1f0",
  69306. "shortnames": [":tk:"],
  69307. "category": "flags"
  69308. },
  69309. ":flag_tl:": {
  69310. "uc_base": "1f1f9-1f1f1",
  69311. "uc_output": "1f1f9-1f1f1",
  69312. "uc_match": "1f1f9-1f1f1",
  69313. "uc_greedy": "1f1f9-1f1f1",
  69314. "shortnames": [":tl:"],
  69315. "category": "flags"
  69316. },
  69317. ":flag_tm:": {
  69318. "uc_base": "1f1f9-1f1f2",
  69319. "uc_output": "1f1f9-1f1f2",
  69320. "uc_match": "1f1f9-1f1f2",
  69321. "uc_greedy": "1f1f9-1f1f2",
  69322. "shortnames": [":turkmenistan:"],
  69323. "category": "flags"
  69324. },
  69325. ":flag_tn:": {
  69326. "uc_base": "1f1f9-1f1f3",
  69327. "uc_output": "1f1f9-1f1f3",
  69328. "uc_match": "1f1f9-1f1f3",
  69329. "uc_greedy": "1f1f9-1f1f3",
  69330. "shortnames": [":tn:"],
  69331. "category": "flags"
  69332. },
  69333. ":flag_to:": {
  69334. "uc_base": "1f1f9-1f1f4",
  69335. "uc_output": "1f1f9-1f1f4",
  69336. "uc_match": "1f1f9-1f1f4",
  69337. "uc_greedy": "1f1f9-1f1f4",
  69338. "shortnames": [":to:"],
  69339. "category": "flags"
  69340. },
  69341. ":flag_tr:": {
  69342. "uc_base": "1f1f9-1f1f7",
  69343. "uc_output": "1f1f9-1f1f7",
  69344. "uc_match": "1f1f9-1f1f7",
  69345. "uc_greedy": "1f1f9-1f1f7",
  69346. "shortnames": [":tr:"],
  69347. "category": "flags"
  69348. },
  69349. ":flag_tt:": {
  69350. "uc_base": "1f1f9-1f1f9",
  69351. "uc_output": "1f1f9-1f1f9",
  69352. "uc_match": "1f1f9-1f1f9",
  69353. "uc_greedy": "1f1f9-1f1f9",
  69354. "shortnames": [":tt:"],
  69355. "category": "flags"
  69356. },
  69357. ":flag_tv:": {
  69358. "uc_base": "1f1f9-1f1fb",
  69359. "uc_output": "1f1f9-1f1fb",
  69360. "uc_match": "1f1f9-1f1fb",
  69361. "uc_greedy": "1f1f9-1f1fb",
  69362. "shortnames": [":tuvalu:"],
  69363. "category": "flags"
  69364. },
  69365. ":flag_tw:": {
  69366. "uc_base": "1f1f9-1f1fc",
  69367. "uc_output": "1f1f9-1f1fc",
  69368. "uc_match": "1f1f9-1f1fc",
  69369. "uc_greedy": "1f1f9-1f1fc",
  69370. "shortnames": [":tw:"],
  69371. "category": "flags"
  69372. },
  69373. ":flag_tz:": {
  69374. "uc_base": "1f1f9-1f1ff",
  69375. "uc_output": "1f1f9-1f1ff",
  69376. "uc_match": "1f1f9-1f1ff",
  69377. "uc_greedy": "1f1f9-1f1ff",
  69378. "shortnames": [":tz:"],
  69379. "category": "flags"
  69380. },
  69381. ":flag_ua:": {
  69382. "uc_base": "1f1fa-1f1e6",
  69383. "uc_output": "1f1fa-1f1e6",
  69384. "uc_match": "1f1fa-1f1e6",
  69385. "uc_greedy": "1f1fa-1f1e6",
  69386. "shortnames": [":ua:"],
  69387. "category": "flags"
  69388. },
  69389. ":flag_ug:": {
  69390. "uc_base": "1f1fa-1f1ec",
  69391. "uc_output": "1f1fa-1f1ec",
  69392. "uc_match": "1f1fa-1f1ec",
  69393. "uc_greedy": "1f1fa-1f1ec",
  69394. "shortnames": [":ug:"],
  69395. "category": "flags"
  69396. },
  69397. ":flag_um:": {
  69398. "uc_base": "1f1fa-1f1f2",
  69399. "uc_output": "1f1fa-1f1f2",
  69400. "uc_match": "1f1fa-1f1f2",
  69401. "uc_greedy": "1f1fa-1f1f2",
  69402. "shortnames": [":um:"],
  69403. "category": "flags"
  69404. },
  69405. ":flag_us:": {
  69406. "uc_base": "1f1fa-1f1f8",
  69407. "uc_output": "1f1fa-1f1f8",
  69408. "uc_match": "1f1fa-1f1f8",
  69409. "uc_greedy": "1f1fa-1f1f8",
  69410. "shortnames": [":us:"],
  69411. "category": "flags"
  69412. },
  69413. ":flag_uy:": {
  69414. "uc_base": "1f1fa-1f1fe",
  69415. "uc_output": "1f1fa-1f1fe",
  69416. "uc_match": "1f1fa-1f1fe",
  69417. "uc_greedy": "1f1fa-1f1fe",
  69418. "shortnames": [":uy:"],
  69419. "category": "flags"
  69420. },
  69421. ":flag_uz:": {
  69422. "uc_base": "1f1fa-1f1ff",
  69423. "uc_output": "1f1fa-1f1ff",
  69424. "uc_match": "1f1fa-1f1ff",
  69425. "uc_greedy": "1f1fa-1f1ff",
  69426. "shortnames": [":uz:"],
  69427. "category": "flags"
  69428. },
  69429. ":flag_va:": {
  69430. "uc_base": "1f1fb-1f1e6",
  69431. "uc_output": "1f1fb-1f1e6",
  69432. "uc_match": "1f1fb-1f1e6",
  69433. "uc_greedy": "1f1fb-1f1e6",
  69434. "shortnames": [":va:"],
  69435. "category": "flags"
  69436. },
  69437. ":flag_vc:": {
  69438. "uc_base": "1f1fb-1f1e8",
  69439. "uc_output": "1f1fb-1f1e8",
  69440. "uc_match": "1f1fb-1f1e8",
  69441. "uc_greedy": "1f1fb-1f1e8",
  69442. "shortnames": [":vc:"],
  69443. "category": "flags"
  69444. },
  69445. ":flag_ve:": {
  69446. "uc_base": "1f1fb-1f1ea",
  69447. "uc_output": "1f1fb-1f1ea",
  69448. "uc_match": "1f1fb-1f1ea",
  69449. "uc_greedy": "1f1fb-1f1ea",
  69450. "shortnames": [":ve:"],
  69451. "category": "flags"
  69452. },
  69453. ":flag_vg:": {
  69454. "uc_base": "1f1fb-1f1ec",
  69455. "uc_output": "1f1fb-1f1ec",
  69456. "uc_match": "1f1fb-1f1ec",
  69457. "uc_greedy": "1f1fb-1f1ec",
  69458. "shortnames": [":vg:"],
  69459. "category": "flags"
  69460. },
  69461. ":flag_vi:": {
  69462. "uc_base": "1f1fb-1f1ee",
  69463. "uc_output": "1f1fb-1f1ee",
  69464. "uc_match": "1f1fb-1f1ee",
  69465. "uc_greedy": "1f1fb-1f1ee",
  69466. "shortnames": [":vi:"],
  69467. "category": "flags"
  69468. },
  69469. ":flag_vn:": {
  69470. "uc_base": "1f1fb-1f1f3",
  69471. "uc_output": "1f1fb-1f1f3",
  69472. "uc_match": "1f1fb-1f1f3",
  69473. "uc_greedy": "1f1fb-1f1f3",
  69474. "shortnames": [":vn:"],
  69475. "category": "flags"
  69476. },
  69477. ":flag_vu:": {
  69478. "uc_base": "1f1fb-1f1fa",
  69479. "uc_output": "1f1fb-1f1fa",
  69480. "uc_match": "1f1fb-1f1fa",
  69481. "uc_greedy": "1f1fb-1f1fa",
  69482. "shortnames": [":vu:"],
  69483. "category": "flags"
  69484. },
  69485. ":flag_wf:": {
  69486. "uc_base": "1f1fc-1f1eb",
  69487. "uc_output": "1f1fc-1f1eb",
  69488. "uc_match": "1f1fc-1f1eb",
  69489. "uc_greedy": "1f1fc-1f1eb",
  69490. "shortnames": [":wf:"],
  69491. "category": "flags"
  69492. },
  69493. ":flag_ws:": {
  69494. "uc_base": "1f1fc-1f1f8",
  69495. "uc_output": "1f1fc-1f1f8",
  69496. "uc_match": "1f1fc-1f1f8",
  69497. "uc_greedy": "1f1fc-1f1f8",
  69498. "shortnames": [":ws:"],
  69499. "category": "flags"
  69500. },
  69501. ":flag_xk:": {
  69502. "uc_base": "1f1fd-1f1f0",
  69503. "uc_output": "1f1fd-1f1f0",
  69504. "uc_match": "1f1fd-1f1f0",
  69505. "uc_greedy": "1f1fd-1f1f0",
  69506. "shortnames": [":xk:"],
  69507. "category": "flags"
  69508. },
  69509. ":flag_ye:": {
  69510. "uc_base": "1f1fe-1f1ea",
  69511. "uc_output": "1f1fe-1f1ea",
  69512. "uc_match": "1f1fe-1f1ea",
  69513. "uc_greedy": "1f1fe-1f1ea",
  69514. "shortnames": [":ye:"],
  69515. "category": "flags"
  69516. },
  69517. ":flag_yt:": {
  69518. "uc_base": "1f1fe-1f1f9",
  69519. "uc_output": "1f1fe-1f1f9",
  69520. "uc_match": "1f1fe-1f1f9",
  69521. "uc_greedy": "1f1fe-1f1f9",
  69522. "shortnames": [":yt:"],
  69523. "category": "flags"
  69524. },
  69525. ":flag_za:": {
  69526. "uc_base": "1f1ff-1f1e6",
  69527. "uc_output": "1f1ff-1f1e6",
  69528. "uc_match": "1f1ff-1f1e6",
  69529. "uc_greedy": "1f1ff-1f1e6",
  69530. "shortnames": [":za:"],
  69531. "category": "flags"
  69532. },
  69533. ":flag_zm:": {
  69534. "uc_base": "1f1ff-1f1f2",
  69535. "uc_output": "1f1ff-1f1f2",
  69536. "uc_match": "1f1ff-1f1f2",
  69537. "uc_greedy": "1f1ff-1f1f2",
  69538. "shortnames": [":zm:"],
  69539. "category": "flags"
  69540. },
  69541. ":flag_zw:": {
  69542. "uc_base": "1f1ff-1f1fc",
  69543. "uc_output": "1f1ff-1f1fc",
  69544. "uc_match": "1f1ff-1f1fc",
  69545. "uc_greedy": "1f1ff-1f1fc",
  69546. "shortnames": [":zw:"],
  69547. "category": "flags"
  69548. },
  69549. ":girl_tone1:": {
  69550. "uc_base": "1f467-1f3fb",
  69551. "uc_output": "1f467-1f3fb",
  69552. "uc_match": "1f467-1f3fb",
  69553. "uc_greedy": "1f467-1f3fb",
  69554. "shortnames": [],
  69555. "category": "people"
  69556. },
  69557. ":girl_tone2:": {
  69558. "uc_base": "1f467-1f3fc",
  69559. "uc_output": "1f467-1f3fc",
  69560. "uc_match": "1f467-1f3fc",
  69561. "uc_greedy": "1f467-1f3fc",
  69562. "shortnames": [],
  69563. "category": "people"
  69564. },
  69565. ":girl_tone3:": {
  69566. "uc_base": "1f467-1f3fd",
  69567. "uc_output": "1f467-1f3fd",
  69568. "uc_match": "1f467-1f3fd",
  69569. "uc_greedy": "1f467-1f3fd",
  69570. "shortnames": [],
  69571. "category": "people"
  69572. },
  69573. ":girl_tone4:": {
  69574. "uc_base": "1f467-1f3fe",
  69575. "uc_output": "1f467-1f3fe",
  69576. "uc_match": "1f467-1f3fe",
  69577. "uc_greedy": "1f467-1f3fe",
  69578. "shortnames": [],
  69579. "category": "people"
  69580. },
  69581. ":girl_tone5:": {
  69582. "uc_base": "1f467-1f3ff",
  69583. "uc_output": "1f467-1f3ff",
  69584. "uc_match": "1f467-1f3ff",
  69585. "uc_greedy": "1f467-1f3ff",
  69586. "shortnames": [],
  69587. "category": "people"
  69588. },
  69589. ":guard_tone1:": {
  69590. "uc_base": "1f482-1f3fb",
  69591. "uc_output": "1f482-1f3fb",
  69592. "uc_match": "1f482-1f3fb",
  69593. "uc_greedy": "1f482-1f3fb",
  69594. "shortnames": [":guardsman_tone1:"],
  69595. "category": "people"
  69596. },
  69597. ":guard_tone2:": {
  69598. "uc_base": "1f482-1f3fc",
  69599. "uc_output": "1f482-1f3fc",
  69600. "uc_match": "1f482-1f3fc",
  69601. "uc_greedy": "1f482-1f3fc",
  69602. "shortnames": [":guardsman_tone2:"],
  69603. "category": "people"
  69604. },
  69605. ":guard_tone3:": {
  69606. "uc_base": "1f482-1f3fd",
  69607. "uc_output": "1f482-1f3fd",
  69608. "uc_match": "1f482-1f3fd",
  69609. "uc_greedy": "1f482-1f3fd",
  69610. "shortnames": [":guardsman_tone3:"],
  69611. "category": "people"
  69612. },
  69613. ":guard_tone4:": {
  69614. "uc_base": "1f482-1f3fe",
  69615. "uc_output": "1f482-1f3fe",
  69616. "uc_match": "1f482-1f3fe",
  69617. "uc_greedy": "1f482-1f3fe",
  69618. "shortnames": [":guardsman_tone4:"],
  69619. "category": "people"
  69620. },
  69621. ":guard_tone5:": {
  69622. "uc_base": "1f482-1f3ff",
  69623. "uc_output": "1f482-1f3ff",
  69624. "uc_match": "1f482-1f3ff",
  69625. "uc_greedy": "1f482-1f3ff",
  69626. "shortnames": [":guardsman_tone5:"],
  69627. "category": "people"
  69628. },
  69629. ":hand_splayed_tone1:": {
  69630. "uc_base": "1f590-1f3fb",
  69631. "uc_output": "1f590-1f3fb",
  69632. "uc_match": "1f590-fe0f-1f3fb",
  69633. "uc_greedy": "1f590-fe0f-1f3fb",
  69634. "shortnames": [":raised_hand_with_fingers_splayed_tone1:"],
  69635. "category": "people"
  69636. },
  69637. ":hand_splayed_tone2:": {
  69638. "uc_base": "1f590-1f3fc",
  69639. "uc_output": "1f590-1f3fc",
  69640. "uc_match": "1f590-fe0f-1f3fc",
  69641. "uc_greedy": "1f590-fe0f-1f3fc",
  69642. "shortnames": [":raised_hand_with_fingers_splayed_tone2:"],
  69643. "category": "people"
  69644. },
  69645. ":hand_splayed_tone3:": {
  69646. "uc_base": "1f590-1f3fd",
  69647. "uc_output": "1f590-1f3fd",
  69648. "uc_match": "1f590-fe0f-1f3fd",
  69649. "uc_greedy": "1f590-fe0f-1f3fd",
  69650. "shortnames": [":raised_hand_with_fingers_splayed_tone3:"],
  69651. "category": "people"
  69652. },
  69653. ":hand_splayed_tone4:": {
  69654. "uc_base": "1f590-1f3fe",
  69655. "uc_output": "1f590-1f3fe",
  69656. "uc_match": "1f590-fe0f-1f3fe",
  69657. "uc_greedy": "1f590-fe0f-1f3fe",
  69658. "shortnames": [":raised_hand_with_fingers_splayed_tone4:"],
  69659. "category": "people"
  69660. },
  69661. ":hand_splayed_tone5:": {
  69662. "uc_base": "1f590-1f3ff",
  69663. "uc_output": "1f590-1f3ff",
  69664. "uc_match": "1f590-fe0f-1f3ff",
  69665. "uc_greedy": "1f590-fe0f-1f3ff",
  69666. "shortnames": [":raised_hand_with_fingers_splayed_tone5:"],
  69667. "category": "people"
  69668. },
  69669. ":horse_racing_tone1:": {
  69670. "uc_base": "1f3c7-1f3fb",
  69671. "uc_output": "1f3c7-1f3fb",
  69672. "uc_match": "1f3c7-1f3fb",
  69673. "uc_greedy": "1f3c7-1f3fb",
  69674. "shortnames": [],
  69675. "category": "activity"
  69676. },
  69677. ":horse_racing_tone2:": {
  69678. "uc_base": "1f3c7-1f3fc",
  69679. "uc_output": "1f3c7-1f3fc",
  69680. "uc_match": "1f3c7-1f3fc",
  69681. "uc_greedy": "1f3c7-1f3fc",
  69682. "shortnames": [],
  69683. "category": "activity"
  69684. },
  69685. ":horse_racing_tone3:": {
  69686. "uc_base": "1f3c7-1f3fd",
  69687. "uc_output": "1f3c7-1f3fd",
  69688. "uc_match": "1f3c7-1f3fd",
  69689. "uc_greedy": "1f3c7-1f3fd",
  69690. "shortnames": [],
  69691. "category": "activity"
  69692. },
  69693. ":horse_racing_tone4:": {
  69694. "uc_base": "1f3c7-1f3fe",
  69695. "uc_output": "1f3c7-1f3fe",
  69696. "uc_match": "1f3c7-1f3fe",
  69697. "uc_greedy": "1f3c7-1f3fe",
  69698. "shortnames": [],
  69699. "category": "activity"
  69700. },
  69701. ":horse_racing_tone5:": {
  69702. "uc_base": "1f3c7-1f3ff",
  69703. "uc_output": "1f3c7-1f3ff",
  69704. "uc_match": "1f3c7-1f3ff",
  69705. "uc_greedy": "1f3c7-1f3ff",
  69706. "shortnames": [],
  69707. "category": "activity"
  69708. },
  69709. ":left_facing_fist_tone1:": {
  69710. "uc_base": "1f91b-1f3fb",
  69711. "uc_output": "1f91b-1f3fb",
  69712. "uc_match": "1f91b-1f3fb",
  69713. "uc_greedy": "1f91b-1f3fb",
  69714. "shortnames": [":left_fist_tone1:"],
  69715. "category": "people"
  69716. },
  69717. ":left_facing_fist_tone2:": {
  69718. "uc_base": "1f91b-1f3fc",
  69719. "uc_output": "1f91b-1f3fc",
  69720. "uc_match": "1f91b-1f3fc",
  69721. "uc_greedy": "1f91b-1f3fc",
  69722. "shortnames": [":left_fist_tone2:"],
  69723. "category": "people"
  69724. },
  69725. ":left_facing_fist_tone3:": {
  69726. "uc_base": "1f91b-1f3fd",
  69727. "uc_output": "1f91b-1f3fd",
  69728. "uc_match": "1f91b-1f3fd",
  69729. "uc_greedy": "1f91b-1f3fd",
  69730. "shortnames": [":left_fist_tone3:"],
  69731. "category": "people"
  69732. },
  69733. ":left_facing_fist_tone4:": {
  69734. "uc_base": "1f91b-1f3fe",
  69735. "uc_output": "1f91b-1f3fe",
  69736. "uc_match": "1f91b-1f3fe",
  69737. "uc_greedy": "1f91b-1f3fe",
  69738. "shortnames": [":left_fist_tone4:"],
  69739. "category": "people"
  69740. },
  69741. ":left_facing_fist_tone5:": {
  69742. "uc_base": "1f91b-1f3ff",
  69743. "uc_output": "1f91b-1f3ff",
  69744. "uc_match": "1f91b-1f3ff",
  69745. "uc_greedy": "1f91b-1f3ff",
  69746. "shortnames": [":left_fist_tone5:"],
  69747. "category": "people"
  69748. },
  69749. ":levitate_tone1:": {
  69750. "uc_base": "1f574-1f3fb",
  69751. "uc_output": "1f574-1f3fb",
  69752. "uc_match": "1f574-fe0f-1f3fb",
  69753. "uc_greedy": "1f574-fe0f-1f3fb",
  69754. "shortnames": [":man_in_business_suit_levitating_tone1:", ":man_in_business_suit_levitating_light_skin_tone:"],
  69755. "category": "people"
  69756. },
  69757. ":levitate_tone2:": {
  69758. "uc_base": "1f574-1f3fc",
  69759. "uc_output": "1f574-1f3fc",
  69760. "uc_match": "1f574-fe0f-1f3fc",
  69761. "uc_greedy": "1f574-fe0f-1f3fc",
  69762. "shortnames": [":man_in_business_suit_levitating_tone2:", ":man_in_business_suit_levitating_medium_light_skin_tone:"],
  69763. "category": "people"
  69764. },
  69765. ":levitate_tone3:": {
  69766. "uc_base": "1f574-1f3fd",
  69767. "uc_output": "1f574-1f3fd",
  69768. "uc_match": "1f574-fe0f-1f3fd",
  69769. "uc_greedy": "1f574-fe0f-1f3fd",
  69770. "shortnames": [":man_in_business_suit_levitating_tone3:", ":man_in_business_suit_levitating_medium_skin_tone:"],
  69771. "category": "people"
  69772. },
  69773. ":levitate_tone4:": {
  69774. "uc_base": "1f574-1f3fe",
  69775. "uc_output": "1f574-1f3fe",
  69776. "uc_match": "1f574-fe0f-1f3fe",
  69777. "uc_greedy": "1f574-fe0f-1f3fe",
  69778. "shortnames": [":man_in_business_suit_levitating_tone4:", ":man_in_business_suit_levitating_medium_dark_skin_tone:"],
  69779. "category": "people"
  69780. },
  69781. ":levitate_tone5:": {
  69782. "uc_base": "1f574-1f3ff",
  69783. "uc_output": "1f574-1f3ff",
  69784. "uc_match": "1f574-fe0f-1f3ff",
  69785. "uc_greedy": "1f574-fe0f-1f3ff",
  69786. "shortnames": [":man_in_business_suit_levitating_tone5:", ":man_in_business_suit_levitating_dark_skin_tone:"],
  69787. "category": "people"
  69788. },
  69789. ":love_you_gesture_tone1:": {
  69790. "uc_base": "1f91f-1f3fb",
  69791. "uc_output": "1f91f-1f3fb",
  69792. "uc_match": "1f91f-1f3fb",
  69793. "uc_greedy": "1f91f-1f3fb",
  69794. "shortnames": [":love_you_gesture_light_skin_tone:"],
  69795. "category": "people"
  69796. },
  69797. ":love_you_gesture_tone2:": {
  69798. "uc_base": "1f91f-1f3fc",
  69799. "uc_output": "1f91f-1f3fc",
  69800. "uc_match": "1f91f-1f3fc",
  69801. "uc_greedy": "1f91f-1f3fc",
  69802. "shortnames": [":love_you_gesture_medium_light_skin_tone:"],
  69803. "category": "people"
  69804. },
  69805. ":love_you_gesture_tone3:": {
  69806. "uc_base": "1f91f-1f3fd",
  69807. "uc_output": "1f91f-1f3fd",
  69808. "uc_match": "1f91f-1f3fd",
  69809. "uc_greedy": "1f91f-1f3fd",
  69810. "shortnames": [":love_you_gesture_medium_skin_tone:"],
  69811. "category": "people"
  69812. },
  69813. ":love_you_gesture_tone4:": {
  69814. "uc_base": "1f91f-1f3fe",
  69815. "uc_output": "1f91f-1f3fe",
  69816. "uc_match": "1f91f-1f3fe",
  69817. "uc_greedy": "1f91f-1f3fe",
  69818. "shortnames": [":love_you_gesture_medium_dark_skin_tone:"],
  69819. "category": "people"
  69820. },
  69821. ":love_you_gesture_tone5:": {
  69822. "uc_base": "1f91f-1f3ff",
  69823. "uc_output": "1f91f-1f3ff",
  69824. "uc_match": "1f91f-1f3ff",
  69825. "uc_greedy": "1f91f-1f3ff",
  69826. "shortnames": [":love_you_gesture_dark_skin_tone:"],
  69827. "category": "people"
  69828. },
  69829. ":mage_tone1:": {
  69830. "uc_base": "1f9d9-1f3fb",
  69831. "uc_output": "1f9d9-1f3fb",
  69832. "uc_match": "1f9d9-1f3fb",
  69833. "uc_greedy": "1f9d9-1f3fb",
  69834. "shortnames": [":mage_light_skin_tone:"],
  69835. "category": "people"
  69836. },
  69837. ":mage_tone2:": {
  69838. "uc_base": "1f9d9-1f3fc",
  69839. "uc_output": "1f9d9-1f3fc",
  69840. "uc_match": "1f9d9-1f3fc",
  69841. "uc_greedy": "1f9d9-1f3fc",
  69842. "shortnames": [":mage_medium_light_skin_tone:"],
  69843. "category": "people"
  69844. },
  69845. ":mage_tone3:": {
  69846. "uc_base": "1f9d9-1f3fd",
  69847. "uc_output": "1f9d9-1f3fd",
  69848. "uc_match": "1f9d9-1f3fd",
  69849. "uc_greedy": "1f9d9-1f3fd",
  69850. "shortnames": [":mage_medium_skin_tone:"],
  69851. "category": "people"
  69852. },
  69853. ":mage_tone4:": {
  69854. "uc_base": "1f9d9-1f3fe",
  69855. "uc_output": "1f9d9-1f3fe",
  69856. "uc_match": "1f9d9-1f3fe",
  69857. "uc_greedy": "1f9d9-1f3fe",
  69858. "shortnames": [":mage_medium_dark_skin_tone:"],
  69859. "category": "people"
  69860. },
  69861. ":mage_tone5:": {
  69862. "uc_base": "1f9d9-1f3ff",
  69863. "uc_output": "1f9d9-1f3ff",
  69864. "uc_match": "1f9d9-1f3ff",
  69865. "uc_greedy": "1f9d9-1f3ff",
  69866. "shortnames": [":mage_dark_skin_tone:"],
  69867. "category": "people"
  69868. },
  69869. ":man_dancing_tone1:": {
  69870. "uc_base": "1f57a-1f3fb",
  69871. "uc_output": "1f57a-1f3fb",
  69872. "uc_match": "1f57a-1f3fb",
  69873. "uc_greedy": "1f57a-1f3fb",
  69874. "shortnames": [":male_dancer_tone1:"],
  69875. "category": "people"
  69876. },
  69877. ":man_dancing_tone2:": {
  69878. "uc_base": "1f57a-1f3fc",
  69879. "uc_output": "1f57a-1f3fc",
  69880. "uc_match": "1f57a-1f3fc",
  69881. "uc_greedy": "1f57a-1f3fc",
  69882. "shortnames": [":male_dancer_tone2:"],
  69883. "category": "people"
  69884. },
  69885. ":man_dancing_tone3:": {
  69886. "uc_base": "1f57a-1f3fd",
  69887. "uc_output": "1f57a-1f3fd",
  69888. "uc_match": "1f57a-1f3fd",
  69889. "uc_greedy": "1f57a-1f3fd",
  69890. "shortnames": [":male_dancer_tone3:"],
  69891. "category": "people"
  69892. },
  69893. ":man_dancing_tone4:": {
  69894. "uc_base": "1f57a-1f3fe",
  69895. "uc_output": "1f57a-1f3fe",
  69896. "uc_match": "1f57a-1f3fe",
  69897. "uc_greedy": "1f57a-1f3fe",
  69898. "shortnames": [":male_dancer_tone4:"],
  69899. "category": "people"
  69900. },
  69901. ":man_dancing_tone5:": {
  69902. "uc_base": "1f57a-1f3ff",
  69903. "uc_output": "1f57a-1f3ff",
  69904. "uc_match": "1f57a-1f3ff",
  69905. "uc_greedy": "1f57a-1f3ff",
  69906. "shortnames": [":male_dancer_tone5:"],
  69907. "category": "people"
  69908. },
  69909. ":man_in_tuxedo_tone1:": {
  69910. "uc_base": "1f935-1f3fb",
  69911. "uc_output": "1f935-1f3fb",
  69912. "uc_match": "1f935-1f3fb",
  69913. "uc_greedy": "1f935-1f3fb",
  69914. "shortnames": [":tuxedo_tone1:"],
  69915. "category": "people"
  69916. },
  69917. ":man_in_tuxedo_tone2:": {
  69918. "uc_base": "1f935-1f3fc",
  69919. "uc_output": "1f935-1f3fc",
  69920. "uc_match": "1f935-1f3fc",
  69921. "uc_greedy": "1f935-1f3fc",
  69922. "shortnames": [":tuxedo_tone2:"],
  69923. "category": "people"
  69924. },
  69925. ":man_in_tuxedo_tone3:": {
  69926. "uc_base": "1f935-1f3fd",
  69927. "uc_output": "1f935-1f3fd",
  69928. "uc_match": "1f935-1f3fd",
  69929. "uc_greedy": "1f935-1f3fd",
  69930. "shortnames": [":tuxedo_tone3:"],
  69931. "category": "people"
  69932. },
  69933. ":man_in_tuxedo_tone4:": {
  69934. "uc_base": "1f935-1f3fe",
  69935. "uc_output": "1f935-1f3fe",
  69936. "uc_match": "1f935-1f3fe",
  69937. "uc_greedy": "1f935-1f3fe",
  69938. "shortnames": [":tuxedo_tone4:"],
  69939. "category": "people"
  69940. },
  69941. ":man_in_tuxedo_tone5:": {
  69942. "uc_base": "1f935-1f3ff",
  69943. "uc_output": "1f935-1f3ff",
  69944. "uc_match": "1f935-1f3ff",
  69945. "uc_greedy": "1f935-1f3ff",
  69946. "shortnames": [":tuxedo_tone5:"],
  69947. "category": "people"
  69948. },
  69949. ":man_tone1:": {
  69950. "uc_base": "1f468-1f3fb",
  69951. "uc_output": "1f468-1f3fb",
  69952. "uc_match": "1f468-1f3fb",
  69953. "uc_greedy": "1f468-1f3fb",
  69954. "shortnames": [],
  69955. "category": "people"
  69956. },
  69957. ":man_tone2:": {
  69958. "uc_base": "1f468-1f3fc",
  69959. "uc_output": "1f468-1f3fc",
  69960. "uc_match": "1f468-1f3fc",
  69961. "uc_greedy": "1f468-1f3fc",
  69962. "shortnames": [],
  69963. "category": "people"
  69964. },
  69965. ":man_tone3:": {
  69966. "uc_base": "1f468-1f3fd",
  69967. "uc_output": "1f468-1f3fd",
  69968. "uc_match": "1f468-1f3fd",
  69969. "uc_greedy": "1f468-1f3fd",
  69970. "shortnames": [],
  69971. "category": "people"
  69972. },
  69973. ":man_tone4:": {
  69974. "uc_base": "1f468-1f3fe",
  69975. "uc_output": "1f468-1f3fe",
  69976. "uc_match": "1f468-1f3fe",
  69977. "uc_greedy": "1f468-1f3fe",
  69978. "shortnames": [],
  69979. "category": "people"
  69980. },
  69981. ":man_tone5:": {
  69982. "uc_base": "1f468-1f3ff",
  69983. "uc_output": "1f468-1f3ff",
  69984. "uc_match": "1f468-1f3ff",
  69985. "uc_greedy": "1f468-1f3ff",
  69986. "shortnames": [],
  69987. "category": "people"
  69988. },
  69989. ":man_with_chinese_cap_tone1:": {
  69990. "uc_base": "1f472-1f3fb",
  69991. "uc_output": "1f472-1f3fb",
  69992. "uc_match": "1f472-1f3fb",
  69993. "uc_greedy": "1f472-1f3fb",
  69994. "shortnames": [":man_with_gua_pi_mao_tone1:"],
  69995. "category": "people"
  69996. },
  69997. ":man_with_chinese_cap_tone2:": {
  69998. "uc_base": "1f472-1f3fc",
  69999. "uc_output": "1f472-1f3fc",
  70000. "uc_match": "1f472-1f3fc",
  70001. "uc_greedy": "1f472-1f3fc",
  70002. "shortnames": [":man_with_gua_pi_mao_tone2:"],
  70003. "category": "people"
  70004. },
  70005. ":man_with_chinese_cap_tone3:": {
  70006. "uc_base": "1f472-1f3fd",
  70007. "uc_output": "1f472-1f3fd",
  70008. "uc_match": "1f472-1f3fd",
  70009. "uc_greedy": "1f472-1f3fd",
  70010. "shortnames": [":man_with_gua_pi_mao_tone3:"],
  70011. "category": "people"
  70012. },
  70013. ":man_with_chinese_cap_tone4:": {
  70014. "uc_base": "1f472-1f3fe",
  70015. "uc_output": "1f472-1f3fe",
  70016. "uc_match": "1f472-1f3fe",
  70017. "uc_greedy": "1f472-1f3fe",
  70018. "shortnames": [":man_with_gua_pi_mao_tone4:"],
  70019. "category": "people"
  70020. },
  70021. ":man_with_chinese_cap_tone5:": {
  70022. "uc_base": "1f472-1f3ff",
  70023. "uc_output": "1f472-1f3ff",
  70024. "uc_match": "1f472-1f3ff",
  70025. "uc_greedy": "1f472-1f3ff",
  70026. "shortnames": [":man_with_gua_pi_mao_tone5:"],
  70027. "category": "people"
  70028. },
  70029. ":merperson_tone1:": {
  70030. "uc_base": "1f9dc-1f3fb",
  70031. "uc_output": "1f9dc-1f3fb",
  70032. "uc_match": "1f9dc-1f3fb",
  70033. "uc_greedy": "1f9dc-1f3fb",
  70034. "shortnames": [":merperson_light_skin_tone:"],
  70035. "category": "people"
  70036. },
  70037. ":merperson_tone2:": {
  70038. "uc_base": "1f9dc-1f3fc",
  70039. "uc_output": "1f9dc-1f3fc",
  70040. "uc_match": "1f9dc-1f3fc",
  70041. "uc_greedy": "1f9dc-1f3fc",
  70042. "shortnames": [":merperson_medium_light_skin_tone:"],
  70043. "category": "people"
  70044. },
  70045. ":merperson_tone3:": {
  70046. "uc_base": "1f9dc-1f3fd",
  70047. "uc_output": "1f9dc-1f3fd",
  70048. "uc_match": "1f9dc-1f3fd",
  70049. "uc_greedy": "1f9dc-1f3fd",
  70050. "shortnames": [":merperson_medium_skin_tone:"],
  70051. "category": "people"
  70052. },
  70053. ":merperson_tone4:": {
  70054. "uc_base": "1f9dc-1f3fe",
  70055. "uc_output": "1f9dc-1f3fe",
  70056. "uc_match": "1f9dc-1f3fe",
  70057. "uc_greedy": "1f9dc-1f3fe",
  70058. "shortnames": [":merperson_medium_dark_skin_tone:"],
  70059. "category": "people"
  70060. },
  70061. ":merperson_tone5:": {
  70062. "uc_base": "1f9dc-1f3ff",
  70063. "uc_output": "1f9dc-1f3ff",
  70064. "uc_match": "1f9dc-1f3ff",
  70065. "uc_greedy": "1f9dc-1f3ff",
  70066. "shortnames": [":merperson_dark_skin_tone:"],
  70067. "category": "people"
  70068. },
  70069. ":metal_tone1:": {
  70070. "uc_base": "1f918-1f3fb",
  70071. "uc_output": "1f918-1f3fb",
  70072. "uc_match": "1f918-1f3fb",
  70073. "uc_greedy": "1f918-1f3fb",
  70074. "shortnames": [":sign_of_the_horns_tone1:"],
  70075. "category": "people"
  70076. },
  70077. ":metal_tone2:": {
  70078. "uc_base": "1f918-1f3fc",
  70079. "uc_output": "1f918-1f3fc",
  70080. "uc_match": "1f918-1f3fc",
  70081. "uc_greedy": "1f918-1f3fc",
  70082. "shortnames": [":sign_of_the_horns_tone2:"],
  70083. "category": "people"
  70084. },
  70085. ":metal_tone3:": {
  70086. "uc_base": "1f918-1f3fd",
  70087. "uc_output": "1f918-1f3fd",
  70088. "uc_match": "1f918-1f3fd",
  70089. "uc_greedy": "1f918-1f3fd",
  70090. "shortnames": [":sign_of_the_horns_tone3:"],
  70091. "category": "people"
  70092. },
  70093. ":metal_tone4:": {
  70094. "uc_base": "1f918-1f3fe",
  70095. "uc_output": "1f918-1f3fe",
  70096. "uc_match": "1f918-1f3fe",
  70097. "uc_greedy": "1f918-1f3fe",
  70098. "shortnames": [":sign_of_the_horns_tone4:"],
  70099. "category": "people"
  70100. },
  70101. ":metal_tone5:": {
  70102. "uc_base": "1f918-1f3ff",
  70103. "uc_output": "1f918-1f3ff",
  70104. "uc_match": "1f918-1f3ff",
  70105. "uc_greedy": "1f918-1f3ff",
  70106. "shortnames": [":sign_of_the_horns_tone5:"],
  70107. "category": "people"
  70108. },
  70109. ":middle_finger_tone1:": {
  70110. "uc_base": "1f595-1f3fb",
  70111. "uc_output": "1f595-1f3fb",
  70112. "uc_match": "1f595-1f3fb",
  70113. "uc_greedy": "1f595-1f3fb",
  70114. "shortnames": [":reversed_hand_with_middle_finger_extended_tone1:"],
  70115. "category": "people"
  70116. },
  70117. ":middle_finger_tone2:": {
  70118. "uc_base": "1f595-1f3fc",
  70119. "uc_output": "1f595-1f3fc",
  70120. "uc_match": "1f595-1f3fc",
  70121. "uc_greedy": "1f595-1f3fc",
  70122. "shortnames": [":reversed_hand_with_middle_finger_extended_tone2:"],
  70123. "category": "people"
  70124. },
  70125. ":middle_finger_tone3:": {
  70126. "uc_base": "1f595-1f3fd",
  70127. "uc_output": "1f595-1f3fd",
  70128. "uc_match": "1f595-1f3fd",
  70129. "uc_greedy": "1f595-1f3fd",
  70130. "shortnames": [":reversed_hand_with_middle_finger_extended_tone3:"],
  70131. "category": "people"
  70132. },
  70133. ":middle_finger_tone4:": {
  70134. "uc_base": "1f595-1f3fe",
  70135. "uc_output": "1f595-1f3fe",
  70136. "uc_match": "1f595-1f3fe",
  70137. "uc_greedy": "1f595-1f3fe",
  70138. "shortnames": [":reversed_hand_with_middle_finger_extended_tone4:"],
  70139. "category": "people"
  70140. },
  70141. ":middle_finger_tone5:": {
  70142. "uc_base": "1f595-1f3ff",
  70143. "uc_output": "1f595-1f3ff",
  70144. "uc_match": "1f595-1f3ff",
  70145. "uc_greedy": "1f595-1f3ff",
  70146. "shortnames": [":reversed_hand_with_middle_finger_extended_tone5:"],
  70147. "category": "people"
  70148. },
  70149. ":mrs_claus_tone1:": {
  70150. "uc_base": "1f936-1f3fb",
  70151. "uc_output": "1f936-1f3fb",
  70152. "uc_match": "1f936-1f3fb",
  70153. "uc_greedy": "1f936-1f3fb",
  70154. "shortnames": [":mother_christmas_tone1:"],
  70155. "category": "people"
  70156. },
  70157. ":mrs_claus_tone2:": {
  70158. "uc_base": "1f936-1f3fc",
  70159. "uc_output": "1f936-1f3fc",
  70160. "uc_match": "1f936-1f3fc",
  70161. "uc_greedy": "1f936-1f3fc",
  70162. "shortnames": [":mother_christmas_tone2:"],
  70163. "category": "people"
  70164. },
  70165. ":mrs_claus_tone3:": {
  70166. "uc_base": "1f936-1f3fd",
  70167. "uc_output": "1f936-1f3fd",
  70168. "uc_match": "1f936-1f3fd",
  70169. "uc_greedy": "1f936-1f3fd",
  70170. "shortnames": [":mother_christmas_tone3:"],
  70171. "category": "people"
  70172. },
  70173. ":mrs_claus_tone4:": {
  70174. "uc_base": "1f936-1f3fe",
  70175. "uc_output": "1f936-1f3fe",
  70176. "uc_match": "1f936-1f3fe",
  70177. "uc_greedy": "1f936-1f3fe",
  70178. "shortnames": [":mother_christmas_tone4:"],
  70179. "category": "people"
  70180. },
  70181. ":mrs_claus_tone5:": {
  70182. "uc_base": "1f936-1f3ff",
  70183. "uc_output": "1f936-1f3ff",
  70184. "uc_match": "1f936-1f3ff",
  70185. "uc_greedy": "1f936-1f3ff",
  70186. "shortnames": [":mother_christmas_tone5:"],
  70187. "category": "people"
  70188. },
  70189. ":muscle_tone1:": {
  70190. "uc_base": "1f4aa-1f3fb",
  70191. "uc_output": "1f4aa-1f3fb",
  70192. "uc_match": "1f4aa-1f3fb",
  70193. "uc_greedy": "1f4aa-1f3fb",
  70194. "shortnames": [],
  70195. "category": "people"
  70196. },
  70197. ":muscle_tone2:": {
  70198. "uc_base": "1f4aa-1f3fc",
  70199. "uc_output": "1f4aa-1f3fc",
  70200. "uc_match": "1f4aa-1f3fc",
  70201. "uc_greedy": "1f4aa-1f3fc",
  70202. "shortnames": [],
  70203. "category": "people"
  70204. },
  70205. ":muscle_tone3:": {
  70206. "uc_base": "1f4aa-1f3fd",
  70207. "uc_output": "1f4aa-1f3fd",
  70208. "uc_match": "1f4aa-1f3fd",
  70209. "uc_greedy": "1f4aa-1f3fd",
  70210. "shortnames": [],
  70211. "category": "people"
  70212. },
  70213. ":muscle_tone4:": {
  70214. "uc_base": "1f4aa-1f3fe",
  70215. "uc_output": "1f4aa-1f3fe",
  70216. "uc_match": "1f4aa-1f3fe",
  70217. "uc_greedy": "1f4aa-1f3fe",
  70218. "shortnames": [],
  70219. "category": "people"
  70220. },
  70221. ":muscle_tone5:": {
  70222. "uc_base": "1f4aa-1f3ff",
  70223. "uc_output": "1f4aa-1f3ff",
  70224. "uc_match": "1f4aa-1f3ff",
  70225. "uc_greedy": "1f4aa-1f3ff",
  70226. "shortnames": [],
  70227. "category": "people"
  70228. },
  70229. ":nail_care_tone1:": {
  70230. "uc_base": "1f485-1f3fb",
  70231. "uc_output": "1f485-1f3fb",
  70232. "uc_match": "1f485-1f3fb",
  70233. "uc_greedy": "1f485-1f3fb",
  70234. "shortnames": [],
  70235. "category": "people"
  70236. },
  70237. ":nail_care_tone2:": {
  70238. "uc_base": "1f485-1f3fc",
  70239. "uc_output": "1f485-1f3fc",
  70240. "uc_match": "1f485-1f3fc",
  70241. "uc_greedy": "1f485-1f3fc",
  70242. "shortnames": [],
  70243. "category": "people"
  70244. },
  70245. ":nail_care_tone3:": {
  70246. "uc_base": "1f485-1f3fd",
  70247. "uc_output": "1f485-1f3fd",
  70248. "uc_match": "1f485-1f3fd",
  70249. "uc_greedy": "1f485-1f3fd",
  70250. "shortnames": [],
  70251. "category": "people"
  70252. },
  70253. ":nail_care_tone4:": {
  70254. "uc_base": "1f485-1f3fe",
  70255. "uc_output": "1f485-1f3fe",
  70256. "uc_match": "1f485-1f3fe",
  70257. "uc_greedy": "1f485-1f3fe",
  70258. "shortnames": [],
  70259. "category": "people"
  70260. },
  70261. ":nail_care_tone5:": {
  70262. "uc_base": "1f485-1f3ff",
  70263. "uc_output": "1f485-1f3ff",
  70264. "uc_match": "1f485-1f3ff",
  70265. "uc_greedy": "1f485-1f3ff",
  70266. "shortnames": [],
  70267. "category": "people"
  70268. },
  70269. ":nose_tone1:": {
  70270. "uc_base": "1f443-1f3fb",
  70271. "uc_output": "1f443-1f3fb",
  70272. "uc_match": "1f443-1f3fb",
  70273. "uc_greedy": "1f443-1f3fb",
  70274. "shortnames": [],
  70275. "category": "people"
  70276. },
  70277. ":nose_tone2:": {
  70278. "uc_base": "1f443-1f3fc",
  70279. "uc_output": "1f443-1f3fc",
  70280. "uc_match": "1f443-1f3fc",
  70281. "uc_greedy": "1f443-1f3fc",
  70282. "shortnames": [],
  70283. "category": "people"
  70284. },
  70285. ":nose_tone3:": {
  70286. "uc_base": "1f443-1f3fd",
  70287. "uc_output": "1f443-1f3fd",
  70288. "uc_match": "1f443-1f3fd",
  70289. "uc_greedy": "1f443-1f3fd",
  70290. "shortnames": [],
  70291. "category": "people"
  70292. },
  70293. ":nose_tone4:": {
  70294. "uc_base": "1f443-1f3fe",
  70295. "uc_output": "1f443-1f3fe",
  70296. "uc_match": "1f443-1f3fe",
  70297. "uc_greedy": "1f443-1f3fe",
  70298. "shortnames": [],
  70299. "category": "people"
  70300. },
  70301. ":nose_tone5:": {
  70302. "uc_base": "1f443-1f3ff",
  70303. "uc_output": "1f443-1f3ff",
  70304. "uc_match": "1f443-1f3ff",
  70305. "uc_greedy": "1f443-1f3ff",
  70306. "shortnames": [],
  70307. "category": "people"
  70308. },
  70309. ":ok_hand_tone1:": {
  70310. "uc_base": "1f44c-1f3fb",
  70311. "uc_output": "1f44c-1f3fb",
  70312. "uc_match": "1f44c-1f3fb",
  70313. "uc_greedy": "1f44c-1f3fb",
  70314. "shortnames": [],
  70315. "category": "people"
  70316. },
  70317. ":ok_hand_tone2:": {
  70318. "uc_base": "1f44c-1f3fc",
  70319. "uc_output": "1f44c-1f3fc",
  70320. "uc_match": "1f44c-1f3fc",
  70321. "uc_greedy": "1f44c-1f3fc",
  70322. "shortnames": [],
  70323. "category": "people"
  70324. },
  70325. ":ok_hand_tone3:": {
  70326. "uc_base": "1f44c-1f3fd",
  70327. "uc_output": "1f44c-1f3fd",
  70328. "uc_match": "1f44c-1f3fd",
  70329. "uc_greedy": "1f44c-1f3fd",
  70330. "shortnames": [],
  70331. "category": "people"
  70332. },
  70333. ":ok_hand_tone4:": {
  70334. "uc_base": "1f44c-1f3fe",
  70335. "uc_output": "1f44c-1f3fe",
  70336. "uc_match": "1f44c-1f3fe",
  70337. "uc_greedy": "1f44c-1f3fe",
  70338. "shortnames": [],
  70339. "category": "people"
  70340. },
  70341. ":ok_hand_tone5:": {
  70342. "uc_base": "1f44c-1f3ff",
  70343. "uc_output": "1f44c-1f3ff",
  70344. "uc_match": "1f44c-1f3ff",
  70345. "uc_greedy": "1f44c-1f3ff",
  70346. "shortnames": [],
  70347. "category": "people"
  70348. },
  70349. ":older_adult_tone1:": {
  70350. "uc_base": "1f9d3-1f3fb",
  70351. "uc_output": "1f9d3-1f3fb",
  70352. "uc_match": "1f9d3-1f3fb",
  70353. "uc_greedy": "1f9d3-1f3fb",
  70354. "shortnames": [":older_adult_light_skin_tone:"],
  70355. "category": "people"
  70356. },
  70357. ":older_adult_tone2:": {
  70358. "uc_base": "1f9d3-1f3fc",
  70359. "uc_output": "1f9d3-1f3fc",
  70360. "uc_match": "1f9d3-1f3fc",
  70361. "uc_greedy": "1f9d3-1f3fc",
  70362. "shortnames": [":older_adult_medium_light_skin_tone:"],
  70363. "category": "people"
  70364. },
  70365. ":older_adult_tone3:": {
  70366. "uc_base": "1f9d3-1f3fd",
  70367. "uc_output": "1f9d3-1f3fd",
  70368. "uc_match": "1f9d3-1f3fd",
  70369. "uc_greedy": "1f9d3-1f3fd",
  70370. "shortnames": [":older_adult_medium_skin_tone:"],
  70371. "category": "people"
  70372. },
  70373. ":older_adult_tone4:": {
  70374. "uc_base": "1f9d3-1f3fe",
  70375. "uc_output": "1f9d3-1f3fe",
  70376. "uc_match": "1f9d3-1f3fe",
  70377. "uc_greedy": "1f9d3-1f3fe",
  70378. "shortnames": [":older_adult_medium_dark_skin_tone:"],
  70379. "category": "people"
  70380. },
  70381. ":older_adult_tone5:": {
  70382. "uc_base": "1f9d3-1f3ff",
  70383. "uc_output": "1f9d3-1f3ff",
  70384. "uc_match": "1f9d3-1f3ff",
  70385. "uc_greedy": "1f9d3-1f3ff",
  70386. "shortnames": [":older_adult_dark_skin_tone:"],
  70387. "category": "people"
  70388. },
  70389. ":older_man_tone1:": {
  70390. "uc_base": "1f474-1f3fb",
  70391. "uc_output": "1f474-1f3fb",
  70392. "uc_match": "1f474-1f3fb",
  70393. "uc_greedy": "1f474-1f3fb",
  70394. "shortnames": [],
  70395. "category": "people"
  70396. },
  70397. ":older_man_tone2:": {
  70398. "uc_base": "1f474-1f3fc",
  70399. "uc_output": "1f474-1f3fc",
  70400. "uc_match": "1f474-1f3fc",
  70401. "uc_greedy": "1f474-1f3fc",
  70402. "shortnames": [],
  70403. "category": "people"
  70404. },
  70405. ":older_man_tone3:": {
  70406. "uc_base": "1f474-1f3fd",
  70407. "uc_output": "1f474-1f3fd",
  70408. "uc_match": "1f474-1f3fd",
  70409. "uc_greedy": "1f474-1f3fd",
  70410. "shortnames": [],
  70411. "category": "people"
  70412. },
  70413. ":older_man_tone4:": {
  70414. "uc_base": "1f474-1f3fe",
  70415. "uc_output": "1f474-1f3fe",
  70416. "uc_match": "1f474-1f3fe",
  70417. "uc_greedy": "1f474-1f3fe",
  70418. "shortnames": [],
  70419. "category": "people"
  70420. },
  70421. ":older_man_tone5:": {
  70422. "uc_base": "1f474-1f3ff",
  70423. "uc_output": "1f474-1f3ff",
  70424. "uc_match": "1f474-1f3ff",
  70425. "uc_greedy": "1f474-1f3ff",
  70426. "shortnames": [],
  70427. "category": "people"
  70428. },
  70429. ":older_woman_tone1:": {
  70430. "uc_base": "1f475-1f3fb",
  70431. "uc_output": "1f475-1f3fb",
  70432. "uc_match": "1f475-1f3fb",
  70433. "uc_greedy": "1f475-1f3fb",
  70434. "shortnames": [":grandma_tone1:"],
  70435. "category": "people"
  70436. },
  70437. ":older_woman_tone2:": {
  70438. "uc_base": "1f475-1f3fc",
  70439. "uc_output": "1f475-1f3fc",
  70440. "uc_match": "1f475-1f3fc",
  70441. "uc_greedy": "1f475-1f3fc",
  70442. "shortnames": [":grandma_tone2:"],
  70443. "category": "people"
  70444. },
  70445. ":older_woman_tone3:": {
  70446. "uc_base": "1f475-1f3fd",
  70447. "uc_output": "1f475-1f3fd",
  70448. "uc_match": "1f475-1f3fd",
  70449. "uc_greedy": "1f475-1f3fd",
  70450. "shortnames": [":grandma_tone3:"],
  70451. "category": "people"
  70452. },
  70453. ":older_woman_tone4:": {
  70454. "uc_base": "1f475-1f3fe",
  70455. "uc_output": "1f475-1f3fe",
  70456. "uc_match": "1f475-1f3fe",
  70457. "uc_greedy": "1f475-1f3fe",
  70458. "shortnames": [":grandma_tone4:"],
  70459. "category": "people"
  70460. },
  70461. ":older_woman_tone5:": {
  70462. "uc_base": "1f475-1f3ff",
  70463. "uc_output": "1f475-1f3ff",
  70464. "uc_match": "1f475-1f3ff",
  70465. "uc_greedy": "1f475-1f3ff",
  70466. "shortnames": [":grandma_tone5:"],
  70467. "category": "people"
  70468. },
  70469. ":open_hands_tone1:": {
  70470. "uc_base": "1f450-1f3fb",
  70471. "uc_output": "1f450-1f3fb",
  70472. "uc_match": "1f450-1f3fb",
  70473. "uc_greedy": "1f450-1f3fb",
  70474. "shortnames": [],
  70475. "category": "people"
  70476. },
  70477. ":open_hands_tone2:": {
  70478. "uc_base": "1f450-1f3fc",
  70479. "uc_output": "1f450-1f3fc",
  70480. "uc_match": "1f450-1f3fc",
  70481. "uc_greedy": "1f450-1f3fc",
  70482. "shortnames": [],
  70483. "category": "people"
  70484. },
  70485. ":open_hands_tone3:": {
  70486. "uc_base": "1f450-1f3fd",
  70487. "uc_output": "1f450-1f3fd",
  70488. "uc_match": "1f450-1f3fd",
  70489. "uc_greedy": "1f450-1f3fd",
  70490. "shortnames": [],
  70491. "category": "people"
  70492. },
  70493. ":open_hands_tone4:": {
  70494. "uc_base": "1f450-1f3fe",
  70495. "uc_output": "1f450-1f3fe",
  70496. "uc_match": "1f450-1f3fe",
  70497. "uc_greedy": "1f450-1f3fe",
  70498. "shortnames": [],
  70499. "category": "people"
  70500. },
  70501. ":open_hands_tone5:": {
  70502. "uc_base": "1f450-1f3ff",
  70503. "uc_output": "1f450-1f3ff",
  70504. "uc_match": "1f450-1f3ff",
  70505. "uc_greedy": "1f450-1f3ff",
  70506. "shortnames": [],
  70507. "category": "people"
  70508. },
  70509. ":palms_up_together_tone1:": {
  70510. "uc_base": "1f932-1f3fb",
  70511. "uc_output": "1f932-1f3fb",
  70512. "uc_match": "1f932-1f3fb",
  70513. "uc_greedy": "1f932-1f3fb",
  70514. "shortnames": [":palms_up_together_light_skin_tone:"],
  70515. "category": "people"
  70516. },
  70517. ":palms_up_together_tone2:": {
  70518. "uc_base": "1f932-1f3fc",
  70519. "uc_output": "1f932-1f3fc",
  70520. "uc_match": "1f932-1f3fc",
  70521. "uc_greedy": "1f932-1f3fc",
  70522. "shortnames": [":palms_up_together_medium_light_skin_tone:"],
  70523. "category": "people"
  70524. },
  70525. ":palms_up_together_tone3:": {
  70526. "uc_base": "1f932-1f3fd",
  70527. "uc_output": "1f932-1f3fd",
  70528. "uc_match": "1f932-1f3fd",
  70529. "uc_greedy": "1f932-1f3fd",
  70530. "shortnames": [":palms_up_together_medium_skin_tone:"],
  70531. "category": "people"
  70532. },
  70533. ":palms_up_together_tone4:": {
  70534. "uc_base": "1f932-1f3fe",
  70535. "uc_output": "1f932-1f3fe",
  70536. "uc_match": "1f932-1f3fe",
  70537. "uc_greedy": "1f932-1f3fe",
  70538. "shortnames": [":palms_up_together_medium_dark_skin_tone:"],
  70539. "category": "people"
  70540. },
  70541. ":palms_up_together_tone5:": {
  70542. "uc_base": "1f932-1f3ff",
  70543. "uc_output": "1f932-1f3ff",
  70544. "uc_match": "1f932-1f3ff",
  70545. "uc_greedy": "1f932-1f3ff",
  70546. "shortnames": [":palms_up_together_dark_skin_tone:"],
  70547. "category": "people"
  70548. },
  70549. ":person_biking_tone1:": {
  70550. "uc_base": "1f6b4-1f3fb",
  70551. "uc_output": "1f6b4-1f3fb",
  70552. "uc_match": "1f6b4-1f3fb",
  70553. "uc_greedy": "1f6b4-1f3fb",
  70554. "shortnames": [":bicyclist_tone1:"],
  70555. "category": "activity"
  70556. },
  70557. ":person_biking_tone2:": {
  70558. "uc_base": "1f6b4-1f3fc",
  70559. "uc_output": "1f6b4-1f3fc",
  70560. "uc_match": "1f6b4-1f3fc",
  70561. "uc_greedy": "1f6b4-1f3fc",
  70562. "shortnames": [":bicyclist_tone2:"],
  70563. "category": "activity"
  70564. },
  70565. ":person_biking_tone3:": {
  70566. "uc_base": "1f6b4-1f3fd",
  70567. "uc_output": "1f6b4-1f3fd",
  70568. "uc_match": "1f6b4-1f3fd",
  70569. "uc_greedy": "1f6b4-1f3fd",
  70570. "shortnames": [":bicyclist_tone3:"],
  70571. "category": "activity"
  70572. },
  70573. ":person_biking_tone4:": {
  70574. "uc_base": "1f6b4-1f3fe",
  70575. "uc_output": "1f6b4-1f3fe",
  70576. "uc_match": "1f6b4-1f3fe",
  70577. "uc_greedy": "1f6b4-1f3fe",
  70578. "shortnames": [":bicyclist_tone4:"],
  70579. "category": "activity"
  70580. },
  70581. ":person_biking_tone5:": {
  70582. "uc_base": "1f6b4-1f3ff",
  70583. "uc_output": "1f6b4-1f3ff",
  70584. "uc_match": "1f6b4-1f3ff",
  70585. "uc_greedy": "1f6b4-1f3ff",
  70586. "shortnames": [":bicyclist_tone5:"],
  70587. "category": "activity"
  70588. },
  70589. ":person_bowing_tone1:": {
  70590. "uc_base": "1f647-1f3fb",
  70591. "uc_output": "1f647-1f3fb",
  70592. "uc_match": "1f647-1f3fb",
  70593. "uc_greedy": "1f647-1f3fb",
  70594. "shortnames": [":bow_tone1:"],
  70595. "category": "people"
  70596. },
  70597. ":person_bowing_tone2:": {
  70598. "uc_base": "1f647-1f3fc",
  70599. "uc_output": "1f647-1f3fc",
  70600. "uc_match": "1f647-1f3fc",
  70601. "uc_greedy": "1f647-1f3fc",
  70602. "shortnames": [":bow_tone2:"],
  70603. "category": "people"
  70604. },
  70605. ":person_bowing_tone3:": {
  70606. "uc_base": "1f647-1f3fd",
  70607. "uc_output": "1f647-1f3fd",
  70608. "uc_match": "1f647-1f3fd",
  70609. "uc_greedy": "1f647-1f3fd",
  70610. "shortnames": [":bow_tone3:"],
  70611. "category": "people"
  70612. },
  70613. ":person_bowing_tone4:": {
  70614. "uc_base": "1f647-1f3fe",
  70615. "uc_output": "1f647-1f3fe",
  70616. "uc_match": "1f647-1f3fe",
  70617. "uc_greedy": "1f647-1f3fe",
  70618. "shortnames": [":bow_tone4:"],
  70619. "category": "people"
  70620. },
  70621. ":person_bowing_tone5:": {
  70622. "uc_base": "1f647-1f3ff",
  70623. "uc_output": "1f647-1f3ff",
  70624. "uc_match": "1f647-1f3ff",
  70625. "uc_greedy": "1f647-1f3ff",
  70626. "shortnames": [":bow_tone5:"],
  70627. "category": "people"
  70628. },
  70629. ":person_climbing_tone1:": {
  70630. "uc_base": "1f9d7-1f3fb",
  70631. "uc_output": "1f9d7-1f3fb",
  70632. "uc_match": "1f9d7-1f3fb",
  70633. "uc_greedy": "1f9d7-1f3fb",
  70634. "shortnames": [":person_climbing_light_skin_tone:"],
  70635. "category": "activity"
  70636. },
  70637. ":person_climbing_tone2:": {
  70638. "uc_base": "1f9d7-1f3fc",
  70639. "uc_output": "1f9d7-1f3fc",
  70640. "uc_match": "1f9d7-1f3fc",
  70641. "uc_greedy": "1f9d7-1f3fc",
  70642. "shortnames": [":person_climbing_medium_light_skin_tone:"],
  70643. "category": "activity"
  70644. },
  70645. ":person_climbing_tone3:": {
  70646. "uc_base": "1f9d7-1f3fd",
  70647. "uc_output": "1f9d7-1f3fd",
  70648. "uc_match": "1f9d7-1f3fd",
  70649. "uc_greedy": "1f9d7-1f3fd",
  70650. "shortnames": [":person_climbing_medium_skin_tone:"],
  70651. "category": "activity"
  70652. },
  70653. ":person_climbing_tone4:": {
  70654. "uc_base": "1f9d7-1f3fe",
  70655. "uc_output": "1f9d7-1f3fe",
  70656. "uc_match": "1f9d7-1f3fe",
  70657. "uc_greedy": "1f9d7-1f3fe",
  70658. "shortnames": [":person_climbing_medium_dark_skin_tone:"],
  70659. "category": "activity"
  70660. },
  70661. ":person_climbing_tone5:": {
  70662. "uc_base": "1f9d7-1f3ff",
  70663. "uc_output": "1f9d7-1f3ff",
  70664. "uc_match": "1f9d7-1f3ff",
  70665. "uc_greedy": "1f9d7-1f3ff",
  70666. "shortnames": [":person_climbing_dark_skin_tone:"],
  70667. "category": "activity"
  70668. },
  70669. ":person_doing_cartwheel_tone1:": {
  70670. "uc_base": "1f938-1f3fb",
  70671. "uc_output": "1f938-1f3fb",
  70672. "uc_match": "1f938-1f3fb",
  70673. "uc_greedy": "1f938-1f3fb",
  70674. "shortnames": [":cartwheel_tone1:"],
  70675. "category": "activity"
  70676. },
  70677. ":person_doing_cartwheel_tone2:": {
  70678. "uc_base": "1f938-1f3fc",
  70679. "uc_output": "1f938-1f3fc",
  70680. "uc_match": "1f938-1f3fc",
  70681. "uc_greedy": "1f938-1f3fc",
  70682. "shortnames": [":cartwheel_tone2:"],
  70683. "category": "activity"
  70684. },
  70685. ":person_doing_cartwheel_tone3:": {
  70686. "uc_base": "1f938-1f3fd",
  70687. "uc_output": "1f938-1f3fd",
  70688. "uc_match": "1f938-1f3fd",
  70689. "uc_greedy": "1f938-1f3fd",
  70690. "shortnames": [":cartwheel_tone3:"],
  70691. "category": "activity"
  70692. },
  70693. ":person_doing_cartwheel_tone4:": {
  70694. "uc_base": "1f938-1f3fe",
  70695. "uc_output": "1f938-1f3fe",
  70696. "uc_match": "1f938-1f3fe",
  70697. "uc_greedy": "1f938-1f3fe",
  70698. "shortnames": [":cartwheel_tone4:"],
  70699. "category": "activity"
  70700. },
  70701. ":person_doing_cartwheel_tone5:": {
  70702. "uc_base": "1f938-1f3ff",
  70703. "uc_output": "1f938-1f3ff",
  70704. "uc_match": "1f938-1f3ff",
  70705. "uc_greedy": "1f938-1f3ff",
  70706. "shortnames": [":cartwheel_tone5:"],
  70707. "category": "activity"
  70708. },
  70709. ":person_facepalming_tone1:": {
  70710. "uc_base": "1f926-1f3fb",
  70711. "uc_output": "1f926-1f3fb",
  70712. "uc_match": "1f926-1f3fb",
  70713. "uc_greedy": "1f926-1f3fb",
  70714. "shortnames": [":face_palm_tone1:", ":facepalm_tone1:"],
  70715. "category": "people"
  70716. },
  70717. ":person_facepalming_tone2:": {
  70718. "uc_base": "1f926-1f3fc",
  70719. "uc_output": "1f926-1f3fc",
  70720. "uc_match": "1f926-1f3fc",
  70721. "uc_greedy": "1f926-1f3fc",
  70722. "shortnames": [":face_palm_tone2:", ":facepalm_tone2:"],
  70723. "category": "people"
  70724. },
  70725. ":person_facepalming_tone3:": {
  70726. "uc_base": "1f926-1f3fd",
  70727. "uc_output": "1f926-1f3fd",
  70728. "uc_match": "1f926-1f3fd",
  70729. "uc_greedy": "1f926-1f3fd",
  70730. "shortnames": [":face_palm_tone3:", ":facepalm_tone3:"],
  70731. "category": "people"
  70732. },
  70733. ":person_facepalming_tone4:": {
  70734. "uc_base": "1f926-1f3fe",
  70735. "uc_output": "1f926-1f3fe",
  70736. "uc_match": "1f926-1f3fe",
  70737. "uc_greedy": "1f926-1f3fe",
  70738. "shortnames": [":face_palm_tone4:", ":facepalm_tone4:"],
  70739. "category": "people"
  70740. },
  70741. ":person_facepalming_tone5:": {
  70742. "uc_base": "1f926-1f3ff",
  70743. "uc_output": "1f926-1f3ff",
  70744. "uc_match": "1f926-1f3ff",
  70745. "uc_greedy": "1f926-1f3ff",
  70746. "shortnames": [":face_palm_tone5:", ":facepalm_tone5:"],
  70747. "category": "people"
  70748. },
  70749. ":person_frowning_tone1:": {
  70750. "uc_base": "1f64d-1f3fb",
  70751. "uc_output": "1f64d-1f3fb",
  70752. "uc_match": "1f64d-1f3fb",
  70753. "uc_greedy": "1f64d-1f3fb",
  70754. "shortnames": [],
  70755. "category": "people"
  70756. },
  70757. ":person_frowning_tone2:": {
  70758. "uc_base": "1f64d-1f3fc",
  70759. "uc_output": "1f64d-1f3fc",
  70760. "uc_match": "1f64d-1f3fc",
  70761. "uc_greedy": "1f64d-1f3fc",
  70762. "shortnames": [],
  70763. "category": "people"
  70764. },
  70765. ":person_frowning_tone3:": {
  70766. "uc_base": "1f64d-1f3fd",
  70767. "uc_output": "1f64d-1f3fd",
  70768. "uc_match": "1f64d-1f3fd",
  70769. "uc_greedy": "1f64d-1f3fd",
  70770. "shortnames": [],
  70771. "category": "people"
  70772. },
  70773. ":person_frowning_tone4:": {
  70774. "uc_base": "1f64d-1f3fe",
  70775. "uc_output": "1f64d-1f3fe",
  70776. "uc_match": "1f64d-1f3fe",
  70777. "uc_greedy": "1f64d-1f3fe",
  70778. "shortnames": [],
  70779. "category": "people"
  70780. },
  70781. ":person_frowning_tone5:": {
  70782. "uc_base": "1f64d-1f3ff",
  70783. "uc_output": "1f64d-1f3ff",
  70784. "uc_match": "1f64d-1f3ff",
  70785. "uc_greedy": "1f64d-1f3ff",
  70786. "shortnames": [],
  70787. "category": "people"
  70788. },
  70789. ":person_gesturing_no_tone1:": {
  70790. "uc_base": "1f645-1f3fb",
  70791. "uc_output": "1f645-1f3fb",
  70792. "uc_match": "1f645-1f3fb",
  70793. "uc_greedy": "1f645-1f3fb",
  70794. "shortnames": [":no_good_tone1:"],
  70795. "category": "people"
  70796. },
  70797. ":person_gesturing_no_tone2:": {
  70798. "uc_base": "1f645-1f3fc",
  70799. "uc_output": "1f645-1f3fc",
  70800. "uc_match": "1f645-1f3fc",
  70801. "uc_greedy": "1f645-1f3fc",
  70802. "shortnames": [":no_good_tone2:"],
  70803. "category": "people"
  70804. },
  70805. ":person_gesturing_no_tone3:": {
  70806. "uc_base": "1f645-1f3fd",
  70807. "uc_output": "1f645-1f3fd",
  70808. "uc_match": "1f645-1f3fd",
  70809. "uc_greedy": "1f645-1f3fd",
  70810. "shortnames": [":no_good_tone3:"],
  70811. "category": "people"
  70812. },
  70813. ":person_gesturing_no_tone4:": {
  70814. "uc_base": "1f645-1f3fe",
  70815. "uc_output": "1f645-1f3fe",
  70816. "uc_match": "1f645-1f3fe",
  70817. "uc_greedy": "1f645-1f3fe",
  70818. "shortnames": [":no_good_tone4:"],
  70819. "category": "people"
  70820. },
  70821. ":person_gesturing_no_tone5:": {
  70822. "uc_base": "1f645-1f3ff",
  70823. "uc_output": "1f645-1f3ff",
  70824. "uc_match": "1f645-1f3ff",
  70825. "uc_greedy": "1f645-1f3ff",
  70826. "shortnames": [":no_good_tone5:"],
  70827. "category": "people"
  70828. },
  70829. ":person_gesturing_ok_tone1:": {
  70830. "uc_base": "1f646-1f3fb",
  70831. "uc_output": "1f646-1f3fb",
  70832. "uc_match": "1f646-1f3fb",
  70833. "uc_greedy": "1f646-1f3fb",
  70834. "shortnames": [":ok_woman_tone1:"],
  70835. "category": "people"
  70836. },
  70837. ":person_gesturing_ok_tone2:": {
  70838. "uc_base": "1f646-1f3fc",
  70839. "uc_output": "1f646-1f3fc",
  70840. "uc_match": "1f646-1f3fc",
  70841. "uc_greedy": "1f646-1f3fc",
  70842. "shortnames": [":ok_woman_tone2:"],
  70843. "category": "people"
  70844. },
  70845. ":person_gesturing_ok_tone3:": {
  70846. "uc_base": "1f646-1f3fd",
  70847. "uc_output": "1f646-1f3fd",
  70848. "uc_match": "1f646-1f3fd",
  70849. "uc_greedy": "1f646-1f3fd",
  70850. "shortnames": [":ok_woman_tone3:"],
  70851. "category": "people"
  70852. },
  70853. ":person_gesturing_ok_tone4:": {
  70854. "uc_base": "1f646-1f3fe",
  70855. "uc_output": "1f646-1f3fe",
  70856. "uc_match": "1f646-1f3fe",
  70857. "uc_greedy": "1f646-1f3fe",
  70858. "shortnames": [":ok_woman_tone4:"],
  70859. "category": "people"
  70860. },
  70861. ":person_gesturing_ok_tone5:": {
  70862. "uc_base": "1f646-1f3ff",
  70863. "uc_output": "1f646-1f3ff",
  70864. "uc_match": "1f646-1f3ff",
  70865. "uc_greedy": "1f646-1f3ff",
  70866. "shortnames": [":ok_woman_tone5:"],
  70867. "category": "people"
  70868. },
  70869. ":person_getting_haircut_tone1:": {
  70870. "uc_base": "1f487-1f3fb",
  70871. "uc_output": "1f487-1f3fb",
  70872. "uc_match": "1f487-1f3fb",
  70873. "uc_greedy": "1f487-1f3fb",
  70874. "shortnames": [":haircut_tone1:"],
  70875. "category": "people"
  70876. },
  70877. ":person_getting_haircut_tone2:": {
  70878. "uc_base": "1f487-1f3fc",
  70879. "uc_output": "1f487-1f3fc",
  70880. "uc_match": "1f487-1f3fc",
  70881. "uc_greedy": "1f487-1f3fc",
  70882. "shortnames": [":haircut_tone2:"],
  70883. "category": "people"
  70884. },
  70885. ":person_getting_haircut_tone3:": {
  70886. "uc_base": "1f487-1f3fd",
  70887. "uc_output": "1f487-1f3fd",
  70888. "uc_match": "1f487-1f3fd",
  70889. "uc_greedy": "1f487-1f3fd",
  70890. "shortnames": [":haircut_tone3:"],
  70891. "category": "people"
  70892. },
  70893. ":person_getting_haircut_tone4:": {
  70894. "uc_base": "1f487-1f3fe",
  70895. "uc_output": "1f487-1f3fe",
  70896. "uc_match": "1f487-1f3fe",
  70897. "uc_greedy": "1f487-1f3fe",
  70898. "shortnames": [":haircut_tone4:"],
  70899. "category": "people"
  70900. },
  70901. ":person_getting_haircut_tone5:": {
  70902. "uc_base": "1f487-1f3ff",
  70903. "uc_output": "1f487-1f3ff",
  70904. "uc_match": "1f487-1f3ff",
  70905. "uc_greedy": "1f487-1f3ff",
  70906. "shortnames": [":haircut_tone5:"],
  70907. "category": "people"
  70908. },
  70909. ":person_getting_massage_tone1:": {
  70910. "uc_base": "1f486-1f3fb",
  70911. "uc_output": "1f486-1f3fb",
  70912. "uc_match": "1f486-1f3fb",
  70913. "uc_greedy": "1f486-1f3fb",
  70914. "shortnames": [":massage_tone1:"],
  70915. "category": "people"
  70916. },
  70917. ":person_getting_massage_tone2:": {
  70918. "uc_base": "1f486-1f3fc",
  70919. "uc_output": "1f486-1f3fc",
  70920. "uc_match": "1f486-1f3fc",
  70921. "uc_greedy": "1f486-1f3fc",
  70922. "shortnames": [":massage_tone2:"],
  70923. "category": "people"
  70924. },
  70925. ":person_getting_massage_tone3:": {
  70926. "uc_base": "1f486-1f3fd",
  70927. "uc_output": "1f486-1f3fd",
  70928. "uc_match": "1f486-1f3fd",
  70929. "uc_greedy": "1f486-1f3fd",
  70930. "shortnames": [":massage_tone3:"],
  70931. "category": "people"
  70932. },
  70933. ":person_getting_massage_tone4:": {
  70934. "uc_base": "1f486-1f3fe",
  70935. "uc_output": "1f486-1f3fe",
  70936. "uc_match": "1f486-1f3fe",
  70937. "uc_greedy": "1f486-1f3fe",
  70938. "shortnames": [":massage_tone4:"],
  70939. "category": "people"
  70940. },
  70941. ":person_getting_massage_tone5:": {
  70942. "uc_base": "1f486-1f3ff",
  70943. "uc_output": "1f486-1f3ff",
  70944. "uc_match": "1f486-1f3ff",
  70945. "uc_greedy": "1f486-1f3ff",
  70946. "shortnames": [":massage_tone5:"],
  70947. "category": "people"
  70948. },
  70949. ":person_golfing_tone1:": {
  70950. "uc_base": "1f3cc-1f3fb",
  70951. "uc_output": "1f3cc-1f3fb",
  70952. "uc_match": "1f3cc-fe0f-1f3fb",
  70953. "uc_greedy": "1f3cc-fe0f-1f3fb",
  70954. "shortnames": [":person_golfing_light_skin_tone:"],
  70955. "category": "activity"
  70956. },
  70957. ":person_golfing_tone2:": {
  70958. "uc_base": "1f3cc-1f3fc",
  70959. "uc_output": "1f3cc-1f3fc",
  70960. "uc_match": "1f3cc-fe0f-1f3fc",
  70961. "uc_greedy": "1f3cc-fe0f-1f3fc",
  70962. "shortnames": [":person_golfing_medium_light_skin_tone:"],
  70963. "category": "activity"
  70964. },
  70965. ":person_golfing_tone3:": {
  70966. "uc_base": "1f3cc-1f3fd",
  70967. "uc_output": "1f3cc-1f3fd",
  70968. "uc_match": "1f3cc-fe0f-1f3fd",
  70969. "uc_greedy": "1f3cc-fe0f-1f3fd",
  70970. "shortnames": [":person_golfing_medium_skin_tone:"],
  70971. "category": "activity"
  70972. },
  70973. ":person_golfing_tone4:": {
  70974. "uc_base": "1f3cc-1f3fe",
  70975. "uc_output": "1f3cc-1f3fe",
  70976. "uc_match": "1f3cc-fe0f-1f3fe",
  70977. "uc_greedy": "1f3cc-fe0f-1f3fe",
  70978. "shortnames": [":person_golfing_medium_dark_skin_tone:"],
  70979. "category": "activity"
  70980. },
  70981. ":person_golfing_tone5:": {
  70982. "uc_base": "1f3cc-1f3ff",
  70983. "uc_output": "1f3cc-1f3ff",
  70984. "uc_match": "1f3cc-fe0f-1f3ff",
  70985. "uc_greedy": "1f3cc-fe0f-1f3ff",
  70986. "shortnames": [":person_golfing_dark_skin_tone:"],
  70987. "category": "activity"
  70988. },
  70989. ":person_in_bed_tone1:": {
  70990. "uc_base": "1f6cc-1f3fb",
  70991. "uc_output": "1f6cc-1f3fb",
  70992. "uc_match": "1f6cc-1f3fb",
  70993. "uc_greedy": "1f6cc-1f3fb",
  70994. "shortnames": [":person_in_bed_light_skin_tone:"],
  70995. "category": "objects"
  70996. },
  70997. ":person_in_bed_tone2:": {
  70998. "uc_base": "1f6cc-1f3fc",
  70999. "uc_output": "1f6cc-1f3fc",
  71000. "uc_match": "1f6cc-1f3fc",
  71001. "uc_greedy": "1f6cc-1f3fc",
  71002. "shortnames": [":person_in_bed_medium_light_skin_tone:"],
  71003. "category": "objects"
  71004. },
  71005. ":person_in_bed_tone3:": {
  71006. "uc_base": "1f6cc-1f3fd",
  71007. "uc_output": "1f6cc-1f3fd",
  71008. "uc_match": "1f6cc-1f3fd",
  71009. "uc_greedy": "1f6cc-1f3fd",
  71010. "shortnames": [":person_in_bed_medium_skin_tone:"],
  71011. "category": "objects"
  71012. },
  71013. ":person_in_bed_tone4:": {
  71014. "uc_base": "1f6cc-1f3fe",
  71015. "uc_output": "1f6cc-1f3fe",
  71016. "uc_match": "1f6cc-1f3fe",
  71017. "uc_greedy": "1f6cc-1f3fe",
  71018. "shortnames": [":person_in_bed_medium_dark_skin_tone:"],
  71019. "category": "objects"
  71020. },
  71021. ":person_in_bed_tone5:": {
  71022. "uc_base": "1f6cc-1f3ff",
  71023. "uc_output": "1f6cc-1f3ff",
  71024. "uc_match": "1f6cc-1f3ff",
  71025. "uc_greedy": "1f6cc-1f3ff",
  71026. "shortnames": [":person_in_bed_dark_skin_tone:"],
  71027. "category": "objects"
  71028. },
  71029. ":person_in_lotus_position_tone1:": {
  71030. "uc_base": "1f9d8-1f3fb",
  71031. "uc_output": "1f9d8-1f3fb",
  71032. "uc_match": "1f9d8-1f3fb",
  71033. "uc_greedy": "1f9d8-1f3fb",
  71034. "shortnames": [":person_in_lotus_position_light_skin_tone:"],
  71035. "category": "activity"
  71036. },
  71037. ":person_in_lotus_position_tone2:": {
  71038. "uc_base": "1f9d8-1f3fc",
  71039. "uc_output": "1f9d8-1f3fc",
  71040. "uc_match": "1f9d8-1f3fc",
  71041. "uc_greedy": "1f9d8-1f3fc",
  71042. "shortnames": [":person_in_lotus_position_medium_light_skin_tone:"],
  71043. "category": "activity"
  71044. },
  71045. ":person_in_lotus_position_tone3:": {
  71046. "uc_base": "1f9d8-1f3fd",
  71047. "uc_output": "1f9d8-1f3fd",
  71048. "uc_match": "1f9d8-1f3fd",
  71049. "uc_greedy": "1f9d8-1f3fd",
  71050. "shortnames": [":person_in_lotus_position_medium_skin_tone:"],
  71051. "category": "activity"
  71052. },
  71053. ":person_in_lotus_position_tone4:": {
  71054. "uc_base": "1f9d8-1f3fe",
  71055. "uc_output": "1f9d8-1f3fe",
  71056. "uc_match": "1f9d8-1f3fe",
  71057. "uc_greedy": "1f9d8-1f3fe",
  71058. "shortnames": [":person_in_lotus_position_medium_dark_skin_tone:"],
  71059. "category": "activity"
  71060. },
  71061. ":person_in_lotus_position_tone5:": {
  71062. "uc_base": "1f9d8-1f3ff",
  71063. "uc_output": "1f9d8-1f3ff",
  71064. "uc_match": "1f9d8-1f3ff",
  71065. "uc_greedy": "1f9d8-1f3ff",
  71066. "shortnames": [":person_in_lotus_position_dark_skin_tone:"],
  71067. "category": "activity"
  71068. },
  71069. ":person_in_steamy_room_tone1:": {
  71070. "uc_base": "1f9d6-1f3fb",
  71071. "uc_output": "1f9d6-1f3fb",
  71072. "uc_match": "1f9d6-1f3fb",
  71073. "uc_greedy": "1f9d6-1f3fb",
  71074. "shortnames": [":person_in_steamy_room_light_skin_tone:"],
  71075. "category": "people"
  71076. },
  71077. ":person_in_steamy_room_tone2:": {
  71078. "uc_base": "1f9d6-1f3fc",
  71079. "uc_output": "1f9d6-1f3fc",
  71080. "uc_match": "1f9d6-1f3fc",
  71081. "uc_greedy": "1f9d6-1f3fc",
  71082. "shortnames": [":person_in_steamy_room_medium_light_skin_tone:"],
  71083. "category": "people"
  71084. },
  71085. ":person_in_steamy_room_tone3:": {
  71086. "uc_base": "1f9d6-1f3fd",
  71087. "uc_output": "1f9d6-1f3fd",
  71088. "uc_match": "1f9d6-1f3fd",
  71089. "uc_greedy": "1f9d6-1f3fd",
  71090. "shortnames": [":person_in_steamy_room_medium_skin_tone:"],
  71091. "category": "people"
  71092. },
  71093. ":person_in_steamy_room_tone4:": {
  71094. "uc_base": "1f9d6-1f3fe",
  71095. "uc_output": "1f9d6-1f3fe",
  71096. "uc_match": "1f9d6-1f3fe",
  71097. "uc_greedy": "1f9d6-1f3fe",
  71098. "shortnames": [":person_in_steamy_room_medium_dark_skin_tone:"],
  71099. "category": "people"
  71100. },
  71101. ":person_in_steamy_room_tone5:": {
  71102. "uc_base": "1f9d6-1f3ff",
  71103. "uc_output": "1f9d6-1f3ff",
  71104. "uc_match": "1f9d6-1f3ff",
  71105. "uc_greedy": "1f9d6-1f3ff",
  71106. "shortnames": [":person_in_steamy_room_dark_skin_tone:"],
  71107. "category": "people"
  71108. },
  71109. ":person_juggling_tone1:": {
  71110. "uc_base": "1f939-1f3fb",
  71111. "uc_output": "1f939-1f3fb",
  71112. "uc_match": "1f939-1f3fb",
  71113. "uc_greedy": "1f939-1f3fb",
  71114. "shortnames": [":juggling_tone1:", ":juggler_tone1:"],
  71115. "category": "activity"
  71116. },
  71117. ":person_juggling_tone2:": {
  71118. "uc_base": "1f939-1f3fc",
  71119. "uc_output": "1f939-1f3fc",
  71120. "uc_match": "1f939-1f3fc",
  71121. "uc_greedy": "1f939-1f3fc",
  71122. "shortnames": [":juggling_tone2:", ":juggler_tone2:"],
  71123. "category": "activity"
  71124. },
  71125. ":person_juggling_tone3:": {
  71126. "uc_base": "1f939-1f3fd",
  71127. "uc_output": "1f939-1f3fd",
  71128. "uc_match": "1f939-1f3fd",
  71129. "uc_greedy": "1f939-1f3fd",
  71130. "shortnames": [":juggling_tone3:", ":juggler_tone3:"],
  71131. "category": "activity"
  71132. },
  71133. ":person_juggling_tone4:": {
  71134. "uc_base": "1f939-1f3fe",
  71135. "uc_output": "1f939-1f3fe",
  71136. "uc_match": "1f939-1f3fe",
  71137. "uc_greedy": "1f939-1f3fe",
  71138. "shortnames": [":juggling_tone4:", ":juggler_tone4:"],
  71139. "category": "activity"
  71140. },
  71141. ":person_juggling_tone5:": {
  71142. "uc_base": "1f939-1f3ff",
  71143. "uc_output": "1f939-1f3ff",
  71144. "uc_match": "1f939-1f3ff",
  71145. "uc_greedy": "1f939-1f3ff",
  71146. "shortnames": [":juggling_tone5:", ":juggler_tone5:"],
  71147. "category": "activity"
  71148. },
  71149. ":person_lifting_weights_tone1:": {
  71150. "uc_base": "1f3cb-1f3fb",
  71151. "uc_output": "1f3cb-1f3fb",
  71152. "uc_match": "1f3cb-fe0f-1f3fb",
  71153. "uc_greedy": "1f3cb-fe0f-1f3fb",
  71154. "shortnames": [":lifter_tone1:", ":weight_lifter_tone1:"],
  71155. "category": "activity"
  71156. },
  71157. ":person_lifting_weights_tone2:": {
  71158. "uc_base": "1f3cb-1f3fc",
  71159. "uc_output": "1f3cb-1f3fc",
  71160. "uc_match": "1f3cb-fe0f-1f3fc",
  71161. "uc_greedy": "1f3cb-fe0f-1f3fc",
  71162. "shortnames": [":lifter_tone2:", ":weight_lifter_tone2:"],
  71163. "category": "activity"
  71164. },
  71165. ":person_lifting_weights_tone3:": {
  71166. "uc_base": "1f3cb-1f3fd",
  71167. "uc_output": "1f3cb-1f3fd",
  71168. "uc_match": "1f3cb-fe0f-1f3fd",
  71169. "uc_greedy": "1f3cb-fe0f-1f3fd",
  71170. "shortnames": [":lifter_tone3:", ":weight_lifter_tone3:"],
  71171. "category": "activity"
  71172. },
  71173. ":person_lifting_weights_tone4:": {
  71174. "uc_base": "1f3cb-1f3fe",
  71175. "uc_output": "1f3cb-1f3fe",
  71176. "uc_match": "1f3cb-fe0f-1f3fe",
  71177. "uc_greedy": "1f3cb-fe0f-1f3fe",
  71178. "shortnames": [":lifter_tone4:", ":weight_lifter_tone4:"],
  71179. "category": "activity"
  71180. },
  71181. ":person_lifting_weights_tone5:": {
  71182. "uc_base": "1f3cb-1f3ff",
  71183. "uc_output": "1f3cb-1f3ff",
  71184. "uc_match": "1f3cb-fe0f-1f3ff",
  71185. "uc_greedy": "1f3cb-fe0f-1f3ff",
  71186. "shortnames": [":lifter_tone5:", ":weight_lifter_tone5:"],
  71187. "category": "activity"
  71188. },
  71189. ":person_mountain_biking_tone1:": {
  71190. "uc_base": "1f6b5-1f3fb",
  71191. "uc_output": "1f6b5-1f3fb",
  71192. "uc_match": "1f6b5-1f3fb",
  71193. "uc_greedy": "1f6b5-1f3fb",
  71194. "shortnames": [":mountain_bicyclist_tone1:"],
  71195. "category": "activity"
  71196. },
  71197. ":person_mountain_biking_tone2:": {
  71198. "uc_base": "1f6b5-1f3fc",
  71199. "uc_output": "1f6b5-1f3fc",
  71200. "uc_match": "1f6b5-1f3fc",
  71201. "uc_greedy": "1f6b5-1f3fc",
  71202. "shortnames": [":mountain_bicyclist_tone2:"],
  71203. "category": "activity"
  71204. },
  71205. ":person_mountain_biking_tone3:": {
  71206. "uc_base": "1f6b5-1f3fd",
  71207. "uc_output": "1f6b5-1f3fd",
  71208. "uc_match": "1f6b5-1f3fd",
  71209. "uc_greedy": "1f6b5-1f3fd",
  71210. "shortnames": [":mountain_bicyclist_tone3:"],
  71211. "category": "activity"
  71212. },
  71213. ":person_mountain_biking_tone4:": {
  71214. "uc_base": "1f6b5-1f3fe",
  71215. "uc_output": "1f6b5-1f3fe",
  71216. "uc_match": "1f6b5-1f3fe",
  71217. "uc_greedy": "1f6b5-1f3fe",
  71218. "shortnames": [":mountain_bicyclist_tone4:"],
  71219. "category": "activity"
  71220. },
  71221. ":person_mountain_biking_tone5:": {
  71222. "uc_base": "1f6b5-1f3ff",
  71223. "uc_output": "1f6b5-1f3ff",
  71224. "uc_match": "1f6b5-1f3ff",
  71225. "uc_greedy": "1f6b5-1f3ff",
  71226. "shortnames": [":mountain_bicyclist_tone5:"],
  71227. "category": "activity"
  71228. },
  71229. ":person_playing_handball_tone1:": {
  71230. "uc_base": "1f93e-1f3fb",
  71231. "uc_output": "1f93e-1f3fb",
  71232. "uc_match": "1f93e-1f3fb",
  71233. "uc_greedy": "1f93e-1f3fb",
  71234. "shortnames": [":handball_tone1:"],
  71235. "category": "activity"
  71236. },
  71237. ":person_playing_handball_tone2:": {
  71238. "uc_base": "1f93e-1f3fc",
  71239. "uc_output": "1f93e-1f3fc",
  71240. "uc_match": "1f93e-1f3fc",
  71241. "uc_greedy": "1f93e-1f3fc",
  71242. "shortnames": [":handball_tone2:"],
  71243. "category": "activity"
  71244. },
  71245. ":person_playing_handball_tone3:": {
  71246. "uc_base": "1f93e-1f3fd",
  71247. "uc_output": "1f93e-1f3fd",
  71248. "uc_match": "1f93e-1f3fd",
  71249. "uc_greedy": "1f93e-1f3fd",
  71250. "shortnames": [":handball_tone3:"],
  71251. "category": "activity"
  71252. },
  71253. ":person_playing_handball_tone4:": {
  71254. "uc_base": "1f93e-1f3fe",
  71255. "uc_output": "1f93e-1f3fe",
  71256. "uc_match": "1f93e-1f3fe",
  71257. "uc_greedy": "1f93e-1f3fe",
  71258. "shortnames": [":handball_tone4:"],
  71259. "category": "activity"
  71260. },
  71261. ":person_playing_handball_tone5:": {
  71262. "uc_base": "1f93e-1f3ff",
  71263. "uc_output": "1f93e-1f3ff",
  71264. "uc_match": "1f93e-1f3ff",
  71265. "uc_greedy": "1f93e-1f3ff",
  71266. "shortnames": [":handball_tone5:"],
  71267. "category": "activity"
  71268. },
  71269. ":person_playing_water_polo_tone1:": {
  71270. "uc_base": "1f93d-1f3fb",
  71271. "uc_output": "1f93d-1f3fb",
  71272. "uc_match": "1f93d-1f3fb",
  71273. "uc_greedy": "1f93d-1f3fb",
  71274. "shortnames": [":water_polo_tone1:"],
  71275. "category": "activity"
  71276. },
  71277. ":person_playing_water_polo_tone2:": {
  71278. "uc_base": "1f93d-1f3fc",
  71279. "uc_output": "1f93d-1f3fc",
  71280. "uc_match": "1f93d-1f3fc",
  71281. "uc_greedy": "1f93d-1f3fc",
  71282. "shortnames": [":water_polo_tone2:"],
  71283. "category": "activity"
  71284. },
  71285. ":person_playing_water_polo_tone3:": {
  71286. "uc_base": "1f93d-1f3fd",
  71287. "uc_output": "1f93d-1f3fd",
  71288. "uc_match": "1f93d-1f3fd",
  71289. "uc_greedy": "1f93d-1f3fd",
  71290. "shortnames": [":water_polo_tone3:"],
  71291. "category": "activity"
  71292. },
  71293. ":person_playing_water_polo_tone4:": {
  71294. "uc_base": "1f93d-1f3fe",
  71295. "uc_output": "1f93d-1f3fe",
  71296. "uc_match": "1f93d-1f3fe",
  71297. "uc_greedy": "1f93d-1f3fe",
  71298. "shortnames": [":water_polo_tone4:"],
  71299. "category": "activity"
  71300. },
  71301. ":person_playing_water_polo_tone5:": {
  71302. "uc_base": "1f93d-1f3ff",
  71303. "uc_output": "1f93d-1f3ff",
  71304. "uc_match": "1f93d-1f3ff",
  71305. "uc_greedy": "1f93d-1f3ff",
  71306. "shortnames": [":water_polo_tone5:"],
  71307. "category": "activity"
  71308. },
  71309. ":person_pouting_tone1:": {
  71310. "uc_base": "1f64e-1f3fb",
  71311. "uc_output": "1f64e-1f3fb",
  71312. "uc_match": "1f64e-1f3fb",
  71313. "uc_greedy": "1f64e-1f3fb",
  71314. "shortnames": [":person_with_pouting_face_tone1:"],
  71315. "category": "people"
  71316. },
  71317. ":person_pouting_tone2:": {
  71318. "uc_base": "1f64e-1f3fc",
  71319. "uc_output": "1f64e-1f3fc",
  71320. "uc_match": "1f64e-1f3fc",
  71321. "uc_greedy": "1f64e-1f3fc",
  71322. "shortnames": [":person_with_pouting_face_tone2:"],
  71323. "category": "people"
  71324. },
  71325. ":person_pouting_tone3:": {
  71326. "uc_base": "1f64e-1f3fd",
  71327. "uc_output": "1f64e-1f3fd",
  71328. "uc_match": "1f64e-1f3fd",
  71329. "uc_greedy": "1f64e-1f3fd",
  71330. "shortnames": [":person_with_pouting_face_tone3:"],
  71331. "category": "people"
  71332. },
  71333. ":person_pouting_tone4:": {
  71334. "uc_base": "1f64e-1f3fe",
  71335. "uc_output": "1f64e-1f3fe",
  71336. "uc_match": "1f64e-1f3fe",
  71337. "uc_greedy": "1f64e-1f3fe",
  71338. "shortnames": [":person_with_pouting_face_tone4:"],
  71339. "category": "people"
  71340. },
  71341. ":person_pouting_tone5:": {
  71342. "uc_base": "1f64e-1f3ff",
  71343. "uc_output": "1f64e-1f3ff",
  71344. "uc_match": "1f64e-1f3ff",
  71345. "uc_greedy": "1f64e-1f3ff",
  71346. "shortnames": [":person_with_pouting_face_tone5:"],
  71347. "category": "people"
  71348. },
  71349. ":person_raising_hand_tone1:": {
  71350. "uc_base": "1f64b-1f3fb",
  71351. "uc_output": "1f64b-1f3fb",
  71352. "uc_match": "1f64b-1f3fb",
  71353. "uc_greedy": "1f64b-1f3fb",
  71354. "shortnames": [":raising_hand_tone1:"],
  71355. "category": "people"
  71356. },
  71357. ":person_raising_hand_tone2:": {
  71358. "uc_base": "1f64b-1f3fc",
  71359. "uc_output": "1f64b-1f3fc",
  71360. "uc_match": "1f64b-1f3fc",
  71361. "uc_greedy": "1f64b-1f3fc",
  71362. "shortnames": [":raising_hand_tone2:"],
  71363. "category": "people"
  71364. },
  71365. ":person_raising_hand_tone3:": {
  71366. "uc_base": "1f64b-1f3fd",
  71367. "uc_output": "1f64b-1f3fd",
  71368. "uc_match": "1f64b-1f3fd",
  71369. "uc_greedy": "1f64b-1f3fd",
  71370. "shortnames": [":raising_hand_tone3:"],
  71371. "category": "people"
  71372. },
  71373. ":person_raising_hand_tone4:": {
  71374. "uc_base": "1f64b-1f3fe",
  71375. "uc_output": "1f64b-1f3fe",
  71376. "uc_match": "1f64b-1f3fe",
  71377. "uc_greedy": "1f64b-1f3fe",
  71378. "shortnames": [":raising_hand_tone4:"],
  71379. "category": "people"
  71380. },
  71381. ":person_raising_hand_tone5:": {
  71382. "uc_base": "1f64b-1f3ff",
  71383. "uc_output": "1f64b-1f3ff",
  71384. "uc_match": "1f64b-1f3ff",
  71385. "uc_greedy": "1f64b-1f3ff",
  71386. "shortnames": [":raising_hand_tone5:"],
  71387. "category": "people"
  71388. },
  71389. ":person_rowing_boat_tone1:": {
  71390. "uc_base": "1f6a3-1f3fb",
  71391. "uc_output": "1f6a3-1f3fb",
  71392. "uc_match": "1f6a3-1f3fb",
  71393. "uc_greedy": "1f6a3-1f3fb",
  71394. "shortnames": [":rowboat_tone1:"],
  71395. "category": "activity"
  71396. },
  71397. ":person_rowing_boat_tone2:": {
  71398. "uc_base": "1f6a3-1f3fc",
  71399. "uc_output": "1f6a3-1f3fc",
  71400. "uc_match": "1f6a3-1f3fc",
  71401. "uc_greedy": "1f6a3-1f3fc",
  71402. "shortnames": [":rowboat_tone2:"],
  71403. "category": "activity"
  71404. },
  71405. ":person_rowing_boat_tone3:": {
  71406. "uc_base": "1f6a3-1f3fd",
  71407. "uc_output": "1f6a3-1f3fd",
  71408. "uc_match": "1f6a3-1f3fd",
  71409. "uc_greedy": "1f6a3-1f3fd",
  71410. "shortnames": [":rowboat_tone3:"],
  71411. "category": "activity"
  71412. },
  71413. ":person_rowing_boat_tone4:": {
  71414. "uc_base": "1f6a3-1f3fe",
  71415. "uc_output": "1f6a3-1f3fe",
  71416. "uc_match": "1f6a3-1f3fe",
  71417. "uc_greedy": "1f6a3-1f3fe",
  71418. "shortnames": [":rowboat_tone4:"],
  71419. "category": "activity"
  71420. },
  71421. ":person_rowing_boat_tone5:": {
  71422. "uc_base": "1f6a3-1f3ff",
  71423. "uc_output": "1f6a3-1f3ff",
  71424. "uc_match": "1f6a3-1f3ff",
  71425. "uc_greedy": "1f6a3-1f3ff",
  71426. "shortnames": [":rowboat_tone5:"],
  71427. "category": "activity"
  71428. },
  71429. ":person_running_tone1:": {
  71430. "uc_base": "1f3c3-1f3fb",
  71431. "uc_output": "1f3c3-1f3fb",
  71432. "uc_match": "1f3c3-1f3fb",
  71433. "uc_greedy": "1f3c3-1f3fb",
  71434. "shortnames": [":runner_tone1:"],
  71435. "category": "people"
  71436. },
  71437. ":person_running_tone2:": {
  71438. "uc_base": "1f3c3-1f3fc",
  71439. "uc_output": "1f3c3-1f3fc",
  71440. "uc_match": "1f3c3-1f3fc",
  71441. "uc_greedy": "1f3c3-1f3fc",
  71442. "shortnames": [":runner_tone2:"],
  71443. "category": "people"
  71444. },
  71445. ":person_running_tone3:": {
  71446. "uc_base": "1f3c3-1f3fd",
  71447. "uc_output": "1f3c3-1f3fd",
  71448. "uc_match": "1f3c3-1f3fd",
  71449. "uc_greedy": "1f3c3-1f3fd",
  71450. "shortnames": [":runner_tone3:"],
  71451. "category": "people"
  71452. },
  71453. ":person_running_tone4:": {
  71454. "uc_base": "1f3c3-1f3fe",
  71455. "uc_output": "1f3c3-1f3fe",
  71456. "uc_match": "1f3c3-1f3fe",
  71457. "uc_greedy": "1f3c3-1f3fe",
  71458. "shortnames": [":runner_tone4:"],
  71459. "category": "people"
  71460. },
  71461. ":person_running_tone5:": {
  71462. "uc_base": "1f3c3-1f3ff",
  71463. "uc_output": "1f3c3-1f3ff",
  71464. "uc_match": "1f3c3-1f3ff",
  71465. "uc_greedy": "1f3c3-1f3ff",
  71466. "shortnames": [":runner_tone5:"],
  71467. "category": "people"
  71468. },
  71469. ":person_shrugging_tone1:": {
  71470. "uc_base": "1f937-1f3fb",
  71471. "uc_output": "1f937-1f3fb",
  71472. "uc_match": "1f937-1f3fb",
  71473. "uc_greedy": "1f937-1f3fb",
  71474. "shortnames": [":shrug_tone1:"],
  71475. "category": "people"
  71476. },
  71477. ":person_shrugging_tone2:": {
  71478. "uc_base": "1f937-1f3fc",
  71479. "uc_output": "1f937-1f3fc",
  71480. "uc_match": "1f937-1f3fc",
  71481. "uc_greedy": "1f937-1f3fc",
  71482. "shortnames": [":shrug_tone2:"],
  71483. "category": "people"
  71484. },
  71485. ":person_shrugging_tone3:": {
  71486. "uc_base": "1f937-1f3fd",
  71487. "uc_output": "1f937-1f3fd",
  71488. "uc_match": "1f937-1f3fd",
  71489. "uc_greedy": "1f937-1f3fd",
  71490. "shortnames": [":shrug_tone3:"],
  71491. "category": "people"
  71492. },
  71493. ":person_shrugging_tone4:": {
  71494. "uc_base": "1f937-1f3fe",
  71495. "uc_output": "1f937-1f3fe",
  71496. "uc_match": "1f937-1f3fe",
  71497. "uc_greedy": "1f937-1f3fe",
  71498. "shortnames": [":shrug_tone4:"],
  71499. "category": "people"
  71500. },
  71501. ":person_shrugging_tone5:": {
  71502. "uc_base": "1f937-1f3ff",
  71503. "uc_output": "1f937-1f3ff",
  71504. "uc_match": "1f937-1f3ff",
  71505. "uc_greedy": "1f937-1f3ff",
  71506. "shortnames": [":shrug_tone5:"],
  71507. "category": "people"
  71508. },
  71509. ":person_surfing_tone1:": {
  71510. "uc_base": "1f3c4-1f3fb",
  71511. "uc_output": "1f3c4-1f3fb",
  71512. "uc_match": "1f3c4-1f3fb",
  71513. "uc_greedy": "1f3c4-1f3fb",
  71514. "shortnames": [":surfer_tone1:"],
  71515. "category": "activity"
  71516. },
  71517. ":person_surfing_tone2:": {
  71518. "uc_base": "1f3c4-1f3fc",
  71519. "uc_output": "1f3c4-1f3fc",
  71520. "uc_match": "1f3c4-1f3fc",
  71521. "uc_greedy": "1f3c4-1f3fc",
  71522. "shortnames": [":surfer_tone2:"],
  71523. "category": "activity"
  71524. },
  71525. ":person_surfing_tone3:": {
  71526. "uc_base": "1f3c4-1f3fd",
  71527. "uc_output": "1f3c4-1f3fd",
  71528. "uc_match": "1f3c4-1f3fd",
  71529. "uc_greedy": "1f3c4-1f3fd",
  71530. "shortnames": [":surfer_tone3:"],
  71531. "category": "activity"
  71532. },
  71533. ":person_surfing_tone4:": {
  71534. "uc_base": "1f3c4-1f3fe",
  71535. "uc_output": "1f3c4-1f3fe",
  71536. "uc_match": "1f3c4-1f3fe",
  71537. "uc_greedy": "1f3c4-1f3fe",
  71538. "shortnames": [":surfer_tone4:"],
  71539. "category": "activity"
  71540. },
  71541. ":person_surfing_tone5:": {
  71542. "uc_base": "1f3c4-1f3ff",
  71543. "uc_output": "1f3c4-1f3ff",
  71544. "uc_match": "1f3c4-1f3ff",
  71545. "uc_greedy": "1f3c4-1f3ff",
  71546. "shortnames": [":surfer_tone5:"],
  71547. "category": "activity"
  71548. },
  71549. ":person_swimming_tone1:": {
  71550. "uc_base": "1f3ca-1f3fb",
  71551. "uc_output": "1f3ca-1f3fb",
  71552. "uc_match": "1f3ca-1f3fb",
  71553. "uc_greedy": "1f3ca-1f3fb",
  71554. "shortnames": [":swimmer_tone1:"],
  71555. "category": "activity"
  71556. },
  71557. ":person_swimming_tone2:": {
  71558. "uc_base": "1f3ca-1f3fc",
  71559. "uc_output": "1f3ca-1f3fc",
  71560. "uc_match": "1f3ca-1f3fc",
  71561. "uc_greedy": "1f3ca-1f3fc",
  71562. "shortnames": [":swimmer_tone2:"],
  71563. "category": "activity"
  71564. },
  71565. ":person_swimming_tone3:": {
  71566. "uc_base": "1f3ca-1f3fd",
  71567. "uc_output": "1f3ca-1f3fd",
  71568. "uc_match": "1f3ca-1f3fd",
  71569. "uc_greedy": "1f3ca-1f3fd",
  71570. "shortnames": [":swimmer_tone3:"],
  71571. "category": "activity"
  71572. },
  71573. ":person_swimming_tone4:": {
  71574. "uc_base": "1f3ca-1f3fe",
  71575. "uc_output": "1f3ca-1f3fe",
  71576. "uc_match": "1f3ca-1f3fe",
  71577. "uc_greedy": "1f3ca-1f3fe",
  71578. "shortnames": [":swimmer_tone4:"],
  71579. "category": "activity"
  71580. },
  71581. ":person_swimming_tone5:": {
  71582. "uc_base": "1f3ca-1f3ff",
  71583. "uc_output": "1f3ca-1f3ff",
  71584. "uc_match": "1f3ca-1f3ff",
  71585. "uc_greedy": "1f3ca-1f3ff",
  71586. "shortnames": [":swimmer_tone5:"],
  71587. "category": "activity"
  71588. },
  71589. ":person_tipping_hand_tone1:": {
  71590. "uc_base": "1f481-1f3fb",
  71591. "uc_output": "1f481-1f3fb",
  71592. "uc_match": "1f481-1f3fb",
  71593. "uc_greedy": "1f481-1f3fb",
  71594. "shortnames": [":information_desk_person_tone1:"],
  71595. "category": "people"
  71596. },
  71597. ":person_tipping_hand_tone2:": {
  71598. "uc_base": "1f481-1f3fc",
  71599. "uc_output": "1f481-1f3fc",
  71600. "uc_match": "1f481-1f3fc",
  71601. "uc_greedy": "1f481-1f3fc",
  71602. "shortnames": [":information_desk_person_tone2:"],
  71603. "category": "people"
  71604. },
  71605. ":person_tipping_hand_tone3:": {
  71606. "uc_base": "1f481-1f3fd",
  71607. "uc_output": "1f481-1f3fd",
  71608. "uc_match": "1f481-1f3fd",
  71609. "uc_greedy": "1f481-1f3fd",
  71610. "shortnames": [":information_desk_person_tone3:"],
  71611. "category": "people"
  71612. },
  71613. ":person_tipping_hand_tone4:": {
  71614. "uc_base": "1f481-1f3fe",
  71615. "uc_output": "1f481-1f3fe",
  71616. "uc_match": "1f481-1f3fe",
  71617. "uc_greedy": "1f481-1f3fe",
  71618. "shortnames": [":information_desk_person_tone4:"],
  71619. "category": "people"
  71620. },
  71621. ":person_tipping_hand_tone5:": {
  71622. "uc_base": "1f481-1f3ff",
  71623. "uc_output": "1f481-1f3ff",
  71624. "uc_match": "1f481-1f3ff",
  71625. "uc_greedy": "1f481-1f3ff",
  71626. "shortnames": [":information_desk_person_tone5:"],
  71627. "category": "people"
  71628. },
  71629. ":person_walking_tone1:": {
  71630. "uc_base": "1f6b6-1f3fb",
  71631. "uc_output": "1f6b6-1f3fb",
  71632. "uc_match": "1f6b6-1f3fb",
  71633. "uc_greedy": "1f6b6-1f3fb",
  71634. "shortnames": [":walking_tone1:"],
  71635. "category": "people"
  71636. },
  71637. ":person_walking_tone2:": {
  71638. "uc_base": "1f6b6-1f3fc",
  71639. "uc_output": "1f6b6-1f3fc",
  71640. "uc_match": "1f6b6-1f3fc",
  71641. "uc_greedy": "1f6b6-1f3fc",
  71642. "shortnames": [":walking_tone2:"],
  71643. "category": "people"
  71644. },
  71645. ":person_walking_tone3:": {
  71646. "uc_base": "1f6b6-1f3fd",
  71647. "uc_output": "1f6b6-1f3fd",
  71648. "uc_match": "1f6b6-1f3fd",
  71649. "uc_greedy": "1f6b6-1f3fd",
  71650. "shortnames": [":walking_tone3:"],
  71651. "category": "people"
  71652. },
  71653. ":person_walking_tone4:": {
  71654. "uc_base": "1f6b6-1f3fe",
  71655. "uc_output": "1f6b6-1f3fe",
  71656. "uc_match": "1f6b6-1f3fe",
  71657. "uc_greedy": "1f6b6-1f3fe",
  71658. "shortnames": [":walking_tone4:"],
  71659. "category": "people"
  71660. },
  71661. ":person_walking_tone5:": {
  71662. "uc_base": "1f6b6-1f3ff",
  71663. "uc_output": "1f6b6-1f3ff",
  71664. "uc_match": "1f6b6-1f3ff",
  71665. "uc_greedy": "1f6b6-1f3ff",
  71666. "shortnames": [":walking_tone5:"],
  71667. "category": "people"
  71668. },
  71669. ":person_wearing_turban_tone1:": {
  71670. "uc_base": "1f473-1f3fb",
  71671. "uc_output": "1f473-1f3fb",
  71672. "uc_match": "1f473-1f3fb",
  71673. "uc_greedy": "1f473-1f3fb",
  71674. "shortnames": [":man_with_turban_tone1:"],
  71675. "category": "people"
  71676. },
  71677. ":person_wearing_turban_tone2:": {
  71678. "uc_base": "1f473-1f3fc",
  71679. "uc_output": "1f473-1f3fc",
  71680. "uc_match": "1f473-1f3fc",
  71681. "uc_greedy": "1f473-1f3fc",
  71682. "shortnames": [":man_with_turban_tone2:"],
  71683. "category": "people"
  71684. },
  71685. ":person_wearing_turban_tone3:": {
  71686. "uc_base": "1f473-1f3fd",
  71687. "uc_output": "1f473-1f3fd",
  71688. "uc_match": "1f473-1f3fd",
  71689. "uc_greedy": "1f473-1f3fd",
  71690. "shortnames": [":man_with_turban_tone3:"],
  71691. "category": "people"
  71692. },
  71693. ":person_wearing_turban_tone4:": {
  71694. "uc_base": "1f473-1f3fe",
  71695. "uc_output": "1f473-1f3fe",
  71696. "uc_match": "1f473-1f3fe",
  71697. "uc_greedy": "1f473-1f3fe",
  71698. "shortnames": [":man_with_turban_tone4:"],
  71699. "category": "people"
  71700. },
  71701. ":person_wearing_turban_tone5:": {
  71702. "uc_base": "1f473-1f3ff",
  71703. "uc_output": "1f473-1f3ff",
  71704. "uc_match": "1f473-1f3ff",
  71705. "uc_greedy": "1f473-1f3ff",
  71706. "shortnames": [":man_with_turban_tone5:"],
  71707. "category": "people"
  71708. },
  71709. ":point_down_tone1:": {
  71710. "uc_base": "1f447-1f3fb",
  71711. "uc_output": "1f447-1f3fb",
  71712. "uc_match": "1f447-1f3fb",
  71713. "uc_greedy": "1f447-1f3fb",
  71714. "shortnames": [],
  71715. "category": "people"
  71716. },
  71717. ":point_down_tone2:": {
  71718. "uc_base": "1f447-1f3fc",
  71719. "uc_output": "1f447-1f3fc",
  71720. "uc_match": "1f447-1f3fc",
  71721. "uc_greedy": "1f447-1f3fc",
  71722. "shortnames": [],
  71723. "category": "people"
  71724. },
  71725. ":point_down_tone3:": {
  71726. "uc_base": "1f447-1f3fd",
  71727. "uc_output": "1f447-1f3fd",
  71728. "uc_match": "1f447-1f3fd",
  71729. "uc_greedy": "1f447-1f3fd",
  71730. "shortnames": [],
  71731. "category": "people"
  71732. },
  71733. ":point_down_tone4:": {
  71734. "uc_base": "1f447-1f3fe",
  71735. "uc_output": "1f447-1f3fe",
  71736. "uc_match": "1f447-1f3fe",
  71737. "uc_greedy": "1f447-1f3fe",
  71738. "shortnames": [],
  71739. "category": "people"
  71740. },
  71741. ":point_down_tone5:": {
  71742. "uc_base": "1f447-1f3ff",
  71743. "uc_output": "1f447-1f3ff",
  71744. "uc_match": "1f447-1f3ff",
  71745. "uc_greedy": "1f447-1f3ff",
  71746. "shortnames": [],
  71747. "category": "people"
  71748. },
  71749. ":point_left_tone1:": {
  71750. "uc_base": "1f448-1f3fb",
  71751. "uc_output": "1f448-1f3fb",
  71752. "uc_match": "1f448-1f3fb",
  71753. "uc_greedy": "1f448-1f3fb",
  71754. "shortnames": [],
  71755. "category": "people"
  71756. },
  71757. ":point_left_tone2:": {
  71758. "uc_base": "1f448-1f3fc",
  71759. "uc_output": "1f448-1f3fc",
  71760. "uc_match": "1f448-1f3fc",
  71761. "uc_greedy": "1f448-1f3fc",
  71762. "shortnames": [],
  71763. "category": "people"
  71764. },
  71765. ":point_left_tone3:": {
  71766. "uc_base": "1f448-1f3fd",
  71767. "uc_output": "1f448-1f3fd",
  71768. "uc_match": "1f448-1f3fd",
  71769. "uc_greedy": "1f448-1f3fd",
  71770. "shortnames": [],
  71771. "category": "people"
  71772. },
  71773. ":point_left_tone4:": {
  71774. "uc_base": "1f448-1f3fe",
  71775. "uc_output": "1f448-1f3fe",
  71776. "uc_match": "1f448-1f3fe",
  71777. "uc_greedy": "1f448-1f3fe",
  71778. "shortnames": [],
  71779. "category": "people"
  71780. },
  71781. ":point_left_tone5:": {
  71782. "uc_base": "1f448-1f3ff",
  71783. "uc_output": "1f448-1f3ff",
  71784. "uc_match": "1f448-1f3ff",
  71785. "uc_greedy": "1f448-1f3ff",
  71786. "shortnames": [],
  71787. "category": "people"
  71788. },
  71789. ":point_right_tone1:": {
  71790. "uc_base": "1f449-1f3fb",
  71791. "uc_output": "1f449-1f3fb",
  71792. "uc_match": "1f449-1f3fb",
  71793. "uc_greedy": "1f449-1f3fb",
  71794. "shortnames": [],
  71795. "category": "people"
  71796. },
  71797. ":point_right_tone2:": {
  71798. "uc_base": "1f449-1f3fc",
  71799. "uc_output": "1f449-1f3fc",
  71800. "uc_match": "1f449-1f3fc",
  71801. "uc_greedy": "1f449-1f3fc",
  71802. "shortnames": [],
  71803. "category": "people"
  71804. },
  71805. ":point_right_tone3:": {
  71806. "uc_base": "1f449-1f3fd",
  71807. "uc_output": "1f449-1f3fd",
  71808. "uc_match": "1f449-1f3fd",
  71809. "uc_greedy": "1f449-1f3fd",
  71810. "shortnames": [],
  71811. "category": "people"
  71812. },
  71813. ":point_right_tone4:": {
  71814. "uc_base": "1f449-1f3fe",
  71815. "uc_output": "1f449-1f3fe",
  71816. "uc_match": "1f449-1f3fe",
  71817. "uc_greedy": "1f449-1f3fe",
  71818. "shortnames": [],
  71819. "category": "people"
  71820. },
  71821. ":point_right_tone5:": {
  71822. "uc_base": "1f449-1f3ff",
  71823. "uc_output": "1f449-1f3ff",
  71824. "uc_match": "1f449-1f3ff",
  71825. "uc_greedy": "1f449-1f3ff",
  71826. "shortnames": [],
  71827. "category": "people"
  71828. },
  71829. ":point_up_2_tone1:": {
  71830. "uc_base": "1f446-1f3fb",
  71831. "uc_output": "1f446-1f3fb",
  71832. "uc_match": "1f446-1f3fb",
  71833. "uc_greedy": "1f446-1f3fb",
  71834. "shortnames": [],
  71835. "category": "people"
  71836. },
  71837. ":point_up_2_tone2:": {
  71838. "uc_base": "1f446-1f3fc",
  71839. "uc_output": "1f446-1f3fc",
  71840. "uc_match": "1f446-1f3fc",
  71841. "uc_greedy": "1f446-1f3fc",
  71842. "shortnames": [],
  71843. "category": "people"
  71844. },
  71845. ":point_up_2_tone3:": {
  71846. "uc_base": "1f446-1f3fd",
  71847. "uc_output": "1f446-1f3fd",
  71848. "uc_match": "1f446-1f3fd",
  71849. "uc_greedy": "1f446-1f3fd",
  71850. "shortnames": [],
  71851. "category": "people"
  71852. },
  71853. ":point_up_2_tone4:": {
  71854. "uc_base": "1f446-1f3fe",
  71855. "uc_output": "1f446-1f3fe",
  71856. "uc_match": "1f446-1f3fe",
  71857. "uc_greedy": "1f446-1f3fe",
  71858. "shortnames": [],
  71859. "category": "people"
  71860. },
  71861. ":point_up_2_tone5:": {
  71862. "uc_base": "1f446-1f3ff",
  71863. "uc_output": "1f446-1f3ff",
  71864. "uc_match": "1f446-1f3ff",
  71865. "uc_greedy": "1f446-1f3ff",
  71866. "shortnames": [],
  71867. "category": "people"
  71868. },
  71869. ":police_officer_tone1:": {
  71870. "uc_base": "1f46e-1f3fb",
  71871. "uc_output": "1f46e-1f3fb",
  71872. "uc_match": "1f46e-1f3fb",
  71873. "uc_greedy": "1f46e-1f3fb",
  71874. "shortnames": [":cop_tone1:"],
  71875. "category": "people"
  71876. },
  71877. ":police_officer_tone2:": {
  71878. "uc_base": "1f46e-1f3fc",
  71879. "uc_output": "1f46e-1f3fc",
  71880. "uc_match": "1f46e-1f3fc",
  71881. "uc_greedy": "1f46e-1f3fc",
  71882. "shortnames": [":cop_tone2:"],
  71883. "category": "people"
  71884. },
  71885. ":police_officer_tone3:": {
  71886. "uc_base": "1f46e-1f3fd",
  71887. "uc_output": "1f46e-1f3fd",
  71888. "uc_match": "1f46e-1f3fd",
  71889. "uc_greedy": "1f46e-1f3fd",
  71890. "shortnames": [":cop_tone3:"],
  71891. "category": "people"
  71892. },
  71893. ":police_officer_tone4:": {
  71894. "uc_base": "1f46e-1f3fe",
  71895. "uc_output": "1f46e-1f3fe",
  71896. "uc_match": "1f46e-1f3fe",
  71897. "uc_greedy": "1f46e-1f3fe",
  71898. "shortnames": [":cop_tone4:"],
  71899. "category": "people"
  71900. },
  71901. ":police_officer_tone5:": {
  71902. "uc_base": "1f46e-1f3ff",
  71903. "uc_output": "1f46e-1f3ff",
  71904. "uc_match": "1f46e-1f3ff",
  71905. "uc_greedy": "1f46e-1f3ff",
  71906. "shortnames": [":cop_tone5:"],
  71907. "category": "people"
  71908. },
  71909. ":pray_tone1:": {
  71910. "uc_base": "1f64f-1f3fb",
  71911. "uc_output": "1f64f-1f3fb",
  71912. "uc_match": "1f64f-1f3fb",
  71913. "uc_greedy": "1f64f-1f3fb",
  71914. "shortnames": [],
  71915. "category": "people"
  71916. },
  71917. ":pray_tone2:": {
  71918. "uc_base": "1f64f-1f3fc",
  71919. "uc_output": "1f64f-1f3fc",
  71920. "uc_match": "1f64f-1f3fc",
  71921. "uc_greedy": "1f64f-1f3fc",
  71922. "shortnames": [],
  71923. "category": "people"
  71924. },
  71925. ":pray_tone3:": {
  71926. "uc_base": "1f64f-1f3fd",
  71927. "uc_output": "1f64f-1f3fd",
  71928. "uc_match": "1f64f-1f3fd",
  71929. "uc_greedy": "1f64f-1f3fd",
  71930. "shortnames": [],
  71931. "category": "people"
  71932. },
  71933. ":pray_tone4:": {
  71934. "uc_base": "1f64f-1f3fe",
  71935. "uc_output": "1f64f-1f3fe",
  71936. "uc_match": "1f64f-1f3fe",
  71937. "uc_greedy": "1f64f-1f3fe",
  71938. "shortnames": [],
  71939. "category": "people"
  71940. },
  71941. ":pray_tone5:": {
  71942. "uc_base": "1f64f-1f3ff",
  71943. "uc_output": "1f64f-1f3ff",
  71944. "uc_match": "1f64f-1f3ff",
  71945. "uc_greedy": "1f64f-1f3ff",
  71946. "shortnames": [],
  71947. "category": "people"
  71948. },
  71949. ":pregnant_woman_tone1:": {
  71950. "uc_base": "1f930-1f3fb",
  71951. "uc_output": "1f930-1f3fb",
  71952. "uc_match": "1f930-1f3fb",
  71953. "uc_greedy": "1f930-1f3fb",
  71954. "shortnames": [":expecting_woman_tone1:"],
  71955. "category": "people"
  71956. },
  71957. ":pregnant_woman_tone2:": {
  71958. "uc_base": "1f930-1f3fc",
  71959. "uc_output": "1f930-1f3fc",
  71960. "uc_match": "1f930-1f3fc",
  71961. "uc_greedy": "1f930-1f3fc",
  71962. "shortnames": [":expecting_woman_tone2:"],
  71963. "category": "people"
  71964. },
  71965. ":pregnant_woman_tone3:": {
  71966. "uc_base": "1f930-1f3fd",
  71967. "uc_output": "1f930-1f3fd",
  71968. "uc_match": "1f930-1f3fd",
  71969. "uc_greedy": "1f930-1f3fd",
  71970. "shortnames": [":expecting_woman_tone3:"],
  71971. "category": "people"
  71972. },
  71973. ":pregnant_woman_tone4:": {
  71974. "uc_base": "1f930-1f3fe",
  71975. "uc_output": "1f930-1f3fe",
  71976. "uc_match": "1f930-1f3fe",
  71977. "uc_greedy": "1f930-1f3fe",
  71978. "shortnames": [":expecting_woman_tone4:"],
  71979. "category": "people"
  71980. },
  71981. ":pregnant_woman_tone5:": {
  71982. "uc_base": "1f930-1f3ff",
  71983. "uc_output": "1f930-1f3ff",
  71984. "uc_match": "1f930-1f3ff",
  71985. "uc_greedy": "1f930-1f3ff",
  71986. "shortnames": [":expecting_woman_tone5:"],
  71987. "category": "people"
  71988. },
  71989. ":prince_tone1:": {
  71990. "uc_base": "1f934-1f3fb",
  71991. "uc_output": "1f934-1f3fb",
  71992. "uc_match": "1f934-1f3fb",
  71993. "uc_greedy": "1f934-1f3fb",
  71994. "shortnames": [],
  71995. "category": "people"
  71996. },
  71997. ":prince_tone2:": {
  71998. "uc_base": "1f934-1f3fc",
  71999. "uc_output": "1f934-1f3fc",
  72000. "uc_match": "1f934-1f3fc",
  72001. "uc_greedy": "1f934-1f3fc",
  72002. "shortnames": [],
  72003. "category": "people"
  72004. },
  72005. ":prince_tone3:": {
  72006. "uc_base": "1f934-1f3fd",
  72007. "uc_output": "1f934-1f3fd",
  72008. "uc_match": "1f934-1f3fd",
  72009. "uc_greedy": "1f934-1f3fd",
  72010. "shortnames": [],
  72011. "category": "people"
  72012. },
  72013. ":prince_tone4:": {
  72014. "uc_base": "1f934-1f3fe",
  72015. "uc_output": "1f934-1f3fe",
  72016. "uc_match": "1f934-1f3fe",
  72017. "uc_greedy": "1f934-1f3fe",
  72018. "shortnames": [],
  72019. "category": "people"
  72020. },
  72021. ":prince_tone5:": {
  72022. "uc_base": "1f934-1f3ff",
  72023. "uc_output": "1f934-1f3ff",
  72024. "uc_match": "1f934-1f3ff",
  72025. "uc_greedy": "1f934-1f3ff",
  72026. "shortnames": [],
  72027. "category": "people"
  72028. },
  72029. ":princess_tone1:": {
  72030. "uc_base": "1f478-1f3fb",
  72031. "uc_output": "1f478-1f3fb",
  72032. "uc_match": "1f478-1f3fb",
  72033. "uc_greedy": "1f478-1f3fb",
  72034. "shortnames": [],
  72035. "category": "people"
  72036. },
  72037. ":princess_tone2:": {
  72038. "uc_base": "1f478-1f3fc",
  72039. "uc_output": "1f478-1f3fc",
  72040. "uc_match": "1f478-1f3fc",
  72041. "uc_greedy": "1f478-1f3fc",
  72042. "shortnames": [],
  72043. "category": "people"
  72044. },
  72045. ":princess_tone3:": {
  72046. "uc_base": "1f478-1f3fd",
  72047. "uc_output": "1f478-1f3fd",
  72048. "uc_match": "1f478-1f3fd",
  72049. "uc_greedy": "1f478-1f3fd",
  72050. "shortnames": [],
  72051. "category": "people"
  72052. },
  72053. ":princess_tone4:": {
  72054. "uc_base": "1f478-1f3fe",
  72055. "uc_output": "1f478-1f3fe",
  72056. "uc_match": "1f478-1f3fe",
  72057. "uc_greedy": "1f478-1f3fe",
  72058. "shortnames": [],
  72059. "category": "people"
  72060. },
  72061. ":princess_tone5:": {
  72062. "uc_base": "1f478-1f3ff",
  72063. "uc_output": "1f478-1f3ff",
  72064. "uc_match": "1f478-1f3ff",
  72065. "uc_greedy": "1f478-1f3ff",
  72066. "shortnames": [],
  72067. "category": "people"
  72068. },
  72069. ":punch_tone1:": {
  72070. "uc_base": "1f44a-1f3fb",
  72071. "uc_output": "1f44a-1f3fb",
  72072. "uc_match": "1f44a-1f3fb",
  72073. "uc_greedy": "1f44a-1f3fb",
  72074. "shortnames": [],
  72075. "category": "people"
  72076. },
  72077. ":punch_tone2:": {
  72078. "uc_base": "1f44a-1f3fc",
  72079. "uc_output": "1f44a-1f3fc",
  72080. "uc_match": "1f44a-1f3fc",
  72081. "uc_greedy": "1f44a-1f3fc",
  72082. "shortnames": [],
  72083. "category": "people"
  72084. },
  72085. ":punch_tone3:": {
  72086. "uc_base": "1f44a-1f3fd",
  72087. "uc_output": "1f44a-1f3fd",
  72088. "uc_match": "1f44a-1f3fd",
  72089. "uc_greedy": "1f44a-1f3fd",
  72090. "shortnames": [],
  72091. "category": "people"
  72092. },
  72093. ":punch_tone4:": {
  72094. "uc_base": "1f44a-1f3fe",
  72095. "uc_output": "1f44a-1f3fe",
  72096. "uc_match": "1f44a-1f3fe",
  72097. "uc_greedy": "1f44a-1f3fe",
  72098. "shortnames": [],
  72099. "category": "people"
  72100. },
  72101. ":punch_tone5:": {
  72102. "uc_base": "1f44a-1f3ff",
  72103. "uc_output": "1f44a-1f3ff",
  72104. "uc_match": "1f44a-1f3ff",
  72105. "uc_greedy": "1f44a-1f3ff",
  72106. "shortnames": [],
  72107. "category": "people"
  72108. },
  72109. ":raised_back_of_hand_tone1:": {
  72110. "uc_base": "1f91a-1f3fb",
  72111. "uc_output": "1f91a-1f3fb",
  72112. "uc_match": "1f91a-1f3fb",
  72113. "uc_greedy": "1f91a-1f3fb",
  72114. "shortnames": [":back_of_hand_tone1:"],
  72115. "category": "people"
  72116. },
  72117. ":raised_back_of_hand_tone2:": {
  72118. "uc_base": "1f91a-1f3fc",
  72119. "uc_output": "1f91a-1f3fc",
  72120. "uc_match": "1f91a-1f3fc",
  72121. "uc_greedy": "1f91a-1f3fc",
  72122. "shortnames": [":back_of_hand_tone2:"],
  72123. "category": "people"
  72124. },
  72125. ":raised_back_of_hand_tone3:": {
  72126. "uc_base": "1f91a-1f3fd",
  72127. "uc_output": "1f91a-1f3fd",
  72128. "uc_match": "1f91a-1f3fd",
  72129. "uc_greedy": "1f91a-1f3fd",
  72130. "shortnames": [":back_of_hand_tone3:"],
  72131. "category": "people"
  72132. },
  72133. ":raised_back_of_hand_tone4:": {
  72134. "uc_base": "1f91a-1f3fe",
  72135. "uc_output": "1f91a-1f3fe",
  72136. "uc_match": "1f91a-1f3fe",
  72137. "uc_greedy": "1f91a-1f3fe",
  72138. "shortnames": [":back_of_hand_tone4:"],
  72139. "category": "people"
  72140. },
  72141. ":raised_back_of_hand_tone5:": {
  72142. "uc_base": "1f91a-1f3ff",
  72143. "uc_output": "1f91a-1f3ff",
  72144. "uc_match": "1f91a-1f3ff",
  72145. "uc_greedy": "1f91a-1f3ff",
  72146. "shortnames": [":back_of_hand_tone5:"],
  72147. "category": "people"
  72148. },
  72149. ":raised_hands_tone1:": {
  72150. "uc_base": "1f64c-1f3fb",
  72151. "uc_output": "1f64c-1f3fb",
  72152. "uc_match": "1f64c-1f3fb",
  72153. "uc_greedy": "1f64c-1f3fb",
  72154. "shortnames": [],
  72155. "category": "people"
  72156. },
  72157. ":raised_hands_tone2:": {
  72158. "uc_base": "1f64c-1f3fc",
  72159. "uc_output": "1f64c-1f3fc",
  72160. "uc_match": "1f64c-1f3fc",
  72161. "uc_greedy": "1f64c-1f3fc",
  72162. "shortnames": [],
  72163. "category": "people"
  72164. },
  72165. ":raised_hands_tone3:": {
  72166. "uc_base": "1f64c-1f3fd",
  72167. "uc_output": "1f64c-1f3fd",
  72168. "uc_match": "1f64c-1f3fd",
  72169. "uc_greedy": "1f64c-1f3fd",
  72170. "shortnames": [],
  72171. "category": "people"
  72172. },
  72173. ":raised_hands_tone4:": {
  72174. "uc_base": "1f64c-1f3fe",
  72175. "uc_output": "1f64c-1f3fe",
  72176. "uc_match": "1f64c-1f3fe",
  72177. "uc_greedy": "1f64c-1f3fe",
  72178. "shortnames": [],
  72179. "category": "people"
  72180. },
  72181. ":raised_hands_tone5:": {
  72182. "uc_base": "1f64c-1f3ff",
  72183. "uc_output": "1f64c-1f3ff",
  72184. "uc_match": "1f64c-1f3ff",
  72185. "uc_greedy": "1f64c-1f3ff",
  72186. "shortnames": [],
  72187. "category": "people"
  72188. },
  72189. ":right_facing_fist_tone1:": {
  72190. "uc_base": "1f91c-1f3fb",
  72191. "uc_output": "1f91c-1f3fb",
  72192. "uc_match": "1f91c-1f3fb",
  72193. "uc_greedy": "1f91c-1f3fb",
  72194. "shortnames": [":right_fist_tone1:"],
  72195. "category": "people"
  72196. },
  72197. ":right_facing_fist_tone2:": {
  72198. "uc_base": "1f91c-1f3fc",
  72199. "uc_output": "1f91c-1f3fc",
  72200. "uc_match": "1f91c-1f3fc",
  72201. "uc_greedy": "1f91c-1f3fc",
  72202. "shortnames": [":right_fist_tone2:"],
  72203. "category": "people"
  72204. },
  72205. ":right_facing_fist_tone3:": {
  72206. "uc_base": "1f91c-1f3fd",
  72207. "uc_output": "1f91c-1f3fd",
  72208. "uc_match": "1f91c-1f3fd",
  72209. "uc_greedy": "1f91c-1f3fd",
  72210. "shortnames": [":right_fist_tone3:"],
  72211. "category": "people"
  72212. },
  72213. ":right_facing_fist_tone4:": {
  72214. "uc_base": "1f91c-1f3fe",
  72215. "uc_output": "1f91c-1f3fe",
  72216. "uc_match": "1f91c-1f3fe",
  72217. "uc_greedy": "1f91c-1f3fe",
  72218. "shortnames": [":right_fist_tone4:"],
  72219. "category": "people"
  72220. },
  72221. ":right_facing_fist_tone5:": {
  72222. "uc_base": "1f91c-1f3ff",
  72223. "uc_output": "1f91c-1f3ff",
  72224. "uc_match": "1f91c-1f3ff",
  72225. "uc_greedy": "1f91c-1f3ff",
  72226. "shortnames": [":right_fist_tone5:"],
  72227. "category": "people"
  72228. },
  72229. ":santa_tone1:": {
  72230. "uc_base": "1f385-1f3fb",
  72231. "uc_output": "1f385-1f3fb",
  72232. "uc_match": "1f385-1f3fb",
  72233. "uc_greedy": "1f385-1f3fb",
  72234. "shortnames": [],
  72235. "category": "people"
  72236. },
  72237. ":santa_tone2:": {
  72238. "uc_base": "1f385-1f3fc",
  72239. "uc_output": "1f385-1f3fc",
  72240. "uc_match": "1f385-1f3fc",
  72241. "uc_greedy": "1f385-1f3fc",
  72242. "shortnames": [],
  72243. "category": "people"
  72244. },
  72245. ":santa_tone3:": {
  72246. "uc_base": "1f385-1f3fd",
  72247. "uc_output": "1f385-1f3fd",
  72248. "uc_match": "1f385-1f3fd",
  72249. "uc_greedy": "1f385-1f3fd",
  72250. "shortnames": [],
  72251. "category": "people"
  72252. },
  72253. ":santa_tone4:": {
  72254. "uc_base": "1f385-1f3fe",
  72255. "uc_output": "1f385-1f3fe",
  72256. "uc_match": "1f385-1f3fe",
  72257. "uc_greedy": "1f385-1f3fe",
  72258. "shortnames": [],
  72259. "category": "people"
  72260. },
  72261. ":santa_tone5:": {
  72262. "uc_base": "1f385-1f3ff",
  72263. "uc_output": "1f385-1f3ff",
  72264. "uc_match": "1f385-1f3ff",
  72265. "uc_greedy": "1f385-1f3ff",
  72266. "shortnames": [],
  72267. "category": "people"
  72268. },
  72269. ":selfie_tone1:": {
  72270. "uc_base": "1f933-1f3fb",
  72271. "uc_output": "1f933-1f3fb",
  72272. "uc_match": "1f933-1f3fb",
  72273. "uc_greedy": "1f933-1f3fb",
  72274. "shortnames": [],
  72275. "category": "people"
  72276. },
  72277. ":selfie_tone2:": {
  72278. "uc_base": "1f933-1f3fc",
  72279. "uc_output": "1f933-1f3fc",
  72280. "uc_match": "1f933-1f3fc",
  72281. "uc_greedy": "1f933-1f3fc",
  72282. "shortnames": [],
  72283. "category": "people"
  72284. },
  72285. ":selfie_tone3:": {
  72286. "uc_base": "1f933-1f3fd",
  72287. "uc_output": "1f933-1f3fd",
  72288. "uc_match": "1f933-1f3fd",
  72289. "uc_greedy": "1f933-1f3fd",
  72290. "shortnames": [],
  72291. "category": "people"
  72292. },
  72293. ":selfie_tone4:": {
  72294. "uc_base": "1f933-1f3fe",
  72295. "uc_output": "1f933-1f3fe",
  72296. "uc_match": "1f933-1f3fe",
  72297. "uc_greedy": "1f933-1f3fe",
  72298. "shortnames": [],
  72299. "category": "people"
  72300. },
  72301. ":selfie_tone5:": {
  72302. "uc_base": "1f933-1f3ff",
  72303. "uc_output": "1f933-1f3ff",
  72304. "uc_match": "1f933-1f3ff",
  72305. "uc_greedy": "1f933-1f3ff",
  72306. "shortnames": [],
  72307. "category": "people"
  72308. },
  72309. ":snowboarder_tone1:": {
  72310. "uc_base": "1f3c2-1f3fb",
  72311. "uc_output": "1f3c2-1f3fb",
  72312. "uc_match": "1f3c2-1f3fb",
  72313. "uc_greedy": "1f3c2-1f3fb",
  72314. "shortnames": [":snowboarder_light_skin_tone:"],
  72315. "category": "activity"
  72316. },
  72317. ":snowboarder_tone2:": {
  72318. "uc_base": "1f3c2-1f3fc",
  72319. "uc_output": "1f3c2-1f3fc",
  72320. "uc_match": "1f3c2-1f3fc",
  72321. "uc_greedy": "1f3c2-1f3fc",
  72322. "shortnames": [":snowboarder_medium_light_skin_tone:"],
  72323. "category": "activity"
  72324. },
  72325. ":snowboarder_tone3:": {
  72326. "uc_base": "1f3c2-1f3fd",
  72327. "uc_output": "1f3c2-1f3fd",
  72328. "uc_match": "1f3c2-1f3fd",
  72329. "uc_greedy": "1f3c2-1f3fd",
  72330. "shortnames": [":snowboarder_medium_skin_tone:"],
  72331. "category": "activity"
  72332. },
  72333. ":snowboarder_tone4:": {
  72334. "uc_base": "1f3c2-1f3fe",
  72335. "uc_output": "1f3c2-1f3fe",
  72336. "uc_match": "1f3c2-1f3fe",
  72337. "uc_greedy": "1f3c2-1f3fe",
  72338. "shortnames": [":snowboarder_medium_dark_skin_tone:"],
  72339. "category": "activity"
  72340. },
  72341. ":snowboarder_tone5:": {
  72342. "uc_base": "1f3c2-1f3ff",
  72343. "uc_output": "1f3c2-1f3ff",
  72344. "uc_match": "1f3c2-1f3ff",
  72345. "uc_greedy": "1f3c2-1f3ff",
  72346. "shortnames": [":snowboarder_dark_skin_tone:"],
  72347. "category": "activity"
  72348. },
  72349. ":thumbsdown_tone1:": {
  72350. "uc_base": "1f44e-1f3fb",
  72351. "uc_output": "1f44e-1f3fb",
  72352. "uc_match": "1f44e-1f3fb",
  72353. "uc_greedy": "1f44e-1f3fb",
  72354. "shortnames": [":-1_tone1:", ":thumbdown_tone1:"],
  72355. "category": "people"
  72356. },
  72357. ":thumbsdown_tone2:": {
  72358. "uc_base": "1f44e-1f3fc",
  72359. "uc_output": "1f44e-1f3fc",
  72360. "uc_match": "1f44e-1f3fc",
  72361. "uc_greedy": "1f44e-1f3fc",
  72362. "shortnames": [":-1_tone2:", ":thumbdown_tone2:"],
  72363. "category": "people"
  72364. },
  72365. ":thumbsdown_tone3:": {
  72366. "uc_base": "1f44e-1f3fd",
  72367. "uc_output": "1f44e-1f3fd",
  72368. "uc_match": "1f44e-1f3fd",
  72369. "uc_greedy": "1f44e-1f3fd",
  72370. "shortnames": [":-1_tone3:", ":thumbdown_tone3:"],
  72371. "category": "people"
  72372. },
  72373. ":thumbsdown_tone4:": {
  72374. "uc_base": "1f44e-1f3fe",
  72375. "uc_output": "1f44e-1f3fe",
  72376. "uc_match": "1f44e-1f3fe",
  72377. "uc_greedy": "1f44e-1f3fe",
  72378. "shortnames": [":-1_tone4:", ":thumbdown_tone4:"],
  72379. "category": "people"
  72380. },
  72381. ":thumbsdown_tone5:": {
  72382. "uc_base": "1f44e-1f3ff",
  72383. "uc_output": "1f44e-1f3ff",
  72384. "uc_match": "1f44e-1f3ff",
  72385. "uc_greedy": "1f44e-1f3ff",
  72386. "shortnames": [":-1_tone5:", ":thumbdown_tone5:"],
  72387. "category": "people"
  72388. },
  72389. ":thumbsup_tone1:": {
  72390. "uc_base": "1f44d-1f3fb",
  72391. "uc_output": "1f44d-1f3fb",
  72392. "uc_match": "1f44d-1f3fb",
  72393. "uc_greedy": "1f44d-1f3fb",
  72394. "shortnames": [":+1_tone1:", ":thumbup_tone1:"],
  72395. "category": "people"
  72396. },
  72397. ":thumbsup_tone2:": {
  72398. "uc_base": "1f44d-1f3fc",
  72399. "uc_output": "1f44d-1f3fc",
  72400. "uc_match": "1f44d-1f3fc",
  72401. "uc_greedy": "1f44d-1f3fc",
  72402. "shortnames": [":+1_tone2:", ":thumbup_tone2:"],
  72403. "category": "people"
  72404. },
  72405. ":thumbsup_tone3:": {
  72406. "uc_base": "1f44d-1f3fd",
  72407. "uc_output": "1f44d-1f3fd",
  72408. "uc_match": "1f44d-1f3fd",
  72409. "uc_greedy": "1f44d-1f3fd",
  72410. "shortnames": [":+1_tone3:", ":thumbup_tone3:"],
  72411. "category": "people"
  72412. },
  72413. ":thumbsup_tone4:": {
  72414. "uc_base": "1f44d-1f3fe",
  72415. "uc_output": "1f44d-1f3fe",
  72416. "uc_match": "1f44d-1f3fe",
  72417. "uc_greedy": "1f44d-1f3fe",
  72418. "shortnames": [":+1_tone4:", ":thumbup_tone4:"],
  72419. "category": "people"
  72420. },
  72421. ":thumbsup_tone5:": {
  72422. "uc_base": "1f44d-1f3ff",
  72423. "uc_output": "1f44d-1f3ff",
  72424. "uc_match": "1f44d-1f3ff",
  72425. "uc_greedy": "1f44d-1f3ff",
  72426. "shortnames": [":+1_tone5:", ":thumbup_tone5:"],
  72427. "category": "people"
  72428. },
  72429. ":united_nations:": {
  72430. "uc_base": "1f1fa-1f1f3",
  72431. "uc_output": "1f1fa-1f1f3",
  72432. "uc_match": "1f1fa-1f1f3",
  72433. "uc_greedy": "1f1fa-1f1f3",
  72434. "shortnames": [],
  72435. "category": "flags"
  72436. },
  72437. ":vampire_tone1:": {
  72438. "uc_base": "1f9db-1f3fb",
  72439. "uc_output": "1f9db-1f3fb",
  72440. "uc_match": "1f9db-1f3fb",
  72441. "uc_greedy": "1f9db-1f3fb",
  72442. "shortnames": [":vampire_light_skin_tone:"],
  72443. "category": "people"
  72444. },
  72445. ":vampire_tone2:": {
  72446. "uc_base": "1f9db-1f3fc",
  72447. "uc_output": "1f9db-1f3fc",
  72448. "uc_match": "1f9db-1f3fc",
  72449. "uc_greedy": "1f9db-1f3fc",
  72450. "shortnames": [":vampire_medium_light_skin_tone:"],
  72451. "category": "people"
  72452. },
  72453. ":vampire_tone3:": {
  72454. "uc_base": "1f9db-1f3fd",
  72455. "uc_output": "1f9db-1f3fd",
  72456. "uc_match": "1f9db-1f3fd",
  72457. "uc_greedy": "1f9db-1f3fd",
  72458. "shortnames": [":vampire_medium_skin_tone:"],
  72459. "category": "people"
  72460. },
  72461. ":vampire_tone4:": {
  72462. "uc_base": "1f9db-1f3fe",
  72463. "uc_output": "1f9db-1f3fe",
  72464. "uc_match": "1f9db-1f3fe",
  72465. "uc_greedy": "1f9db-1f3fe",
  72466. "shortnames": [":vampire_medium_dark_skin_tone:"],
  72467. "category": "people"
  72468. },
  72469. ":vampire_tone5:": {
  72470. "uc_base": "1f9db-1f3ff",
  72471. "uc_output": "1f9db-1f3ff",
  72472. "uc_match": "1f9db-1f3ff",
  72473. "uc_greedy": "1f9db-1f3ff",
  72474. "shortnames": [":vampire_dark_skin_tone:"],
  72475. "category": "people"
  72476. },
  72477. ":vulcan_tone1:": {
  72478. "uc_base": "1f596-1f3fb",
  72479. "uc_output": "1f596-1f3fb",
  72480. "uc_match": "1f596-1f3fb",
  72481. "uc_greedy": "1f596-1f3fb",
  72482. "shortnames": [":raised_hand_with_part_between_middle_and_ring_fingers_tone1:"],
  72483. "category": "people"
  72484. },
  72485. ":vulcan_tone2:": {
  72486. "uc_base": "1f596-1f3fc",
  72487. "uc_output": "1f596-1f3fc",
  72488. "uc_match": "1f596-1f3fc",
  72489. "uc_greedy": "1f596-1f3fc",
  72490. "shortnames": [":raised_hand_with_part_between_middle_and_ring_fingers_tone2:"],
  72491. "category": "people"
  72492. },
  72493. ":vulcan_tone3:": {
  72494. "uc_base": "1f596-1f3fd",
  72495. "uc_output": "1f596-1f3fd",
  72496. "uc_match": "1f596-1f3fd",
  72497. "uc_greedy": "1f596-1f3fd",
  72498. "shortnames": [":raised_hand_with_part_between_middle_and_ring_fingers_tone3:"],
  72499. "category": "people"
  72500. },
  72501. ":vulcan_tone4:": {
  72502. "uc_base": "1f596-1f3fe",
  72503. "uc_output": "1f596-1f3fe",
  72504. "uc_match": "1f596-1f3fe",
  72505. "uc_greedy": "1f596-1f3fe",
  72506. "shortnames": [":raised_hand_with_part_between_middle_and_ring_fingers_tone4:"],
  72507. "category": "people"
  72508. },
  72509. ":vulcan_tone5:": {
  72510. "uc_base": "1f596-1f3ff",
  72511. "uc_output": "1f596-1f3ff",
  72512. "uc_match": "1f596-1f3ff",
  72513. "uc_greedy": "1f596-1f3ff",
  72514. "shortnames": [":raised_hand_with_part_between_middle_and_ring_fingers_tone5:"],
  72515. "category": "people"
  72516. },
  72517. ":wave_tone1:": {
  72518. "uc_base": "1f44b-1f3fb",
  72519. "uc_output": "1f44b-1f3fb",
  72520. "uc_match": "1f44b-1f3fb",
  72521. "uc_greedy": "1f44b-1f3fb",
  72522. "shortnames": [],
  72523. "category": "people"
  72524. },
  72525. ":wave_tone2:": {
  72526. "uc_base": "1f44b-1f3fc",
  72527. "uc_output": "1f44b-1f3fc",
  72528. "uc_match": "1f44b-1f3fc",
  72529. "uc_greedy": "1f44b-1f3fc",
  72530. "shortnames": [],
  72531. "category": "people"
  72532. },
  72533. ":wave_tone3:": {
  72534. "uc_base": "1f44b-1f3fd",
  72535. "uc_output": "1f44b-1f3fd",
  72536. "uc_match": "1f44b-1f3fd",
  72537. "uc_greedy": "1f44b-1f3fd",
  72538. "shortnames": [],
  72539. "category": "people"
  72540. },
  72541. ":wave_tone4:": {
  72542. "uc_base": "1f44b-1f3fe",
  72543. "uc_output": "1f44b-1f3fe",
  72544. "uc_match": "1f44b-1f3fe",
  72545. "uc_greedy": "1f44b-1f3fe",
  72546. "shortnames": [],
  72547. "category": "people"
  72548. },
  72549. ":wave_tone5:": {
  72550. "uc_base": "1f44b-1f3ff",
  72551. "uc_output": "1f44b-1f3ff",
  72552. "uc_match": "1f44b-1f3ff",
  72553. "uc_greedy": "1f44b-1f3ff",
  72554. "shortnames": [],
  72555. "category": "people"
  72556. },
  72557. ":woman_tone1:": {
  72558. "uc_base": "1f469-1f3fb",
  72559. "uc_output": "1f469-1f3fb",
  72560. "uc_match": "1f469-1f3fb",
  72561. "uc_greedy": "1f469-1f3fb",
  72562. "shortnames": [],
  72563. "category": "people"
  72564. },
  72565. ":woman_tone2:": {
  72566. "uc_base": "1f469-1f3fc",
  72567. "uc_output": "1f469-1f3fc",
  72568. "uc_match": "1f469-1f3fc",
  72569. "uc_greedy": "1f469-1f3fc",
  72570. "shortnames": [],
  72571. "category": "people"
  72572. },
  72573. ":woman_tone3:": {
  72574. "uc_base": "1f469-1f3fd",
  72575. "uc_output": "1f469-1f3fd",
  72576. "uc_match": "1f469-1f3fd",
  72577. "uc_greedy": "1f469-1f3fd",
  72578. "shortnames": [],
  72579. "category": "people"
  72580. },
  72581. ":woman_tone4:": {
  72582. "uc_base": "1f469-1f3fe",
  72583. "uc_output": "1f469-1f3fe",
  72584. "uc_match": "1f469-1f3fe",
  72585. "uc_greedy": "1f469-1f3fe",
  72586. "shortnames": [],
  72587. "category": "people"
  72588. },
  72589. ":woman_tone5:": {
  72590. "uc_base": "1f469-1f3ff",
  72591. "uc_output": "1f469-1f3ff",
  72592. "uc_match": "1f469-1f3ff",
  72593. "uc_greedy": "1f469-1f3ff",
  72594. "shortnames": [],
  72595. "category": "people"
  72596. },
  72597. ":woman_with_headscarf_tone1:": {
  72598. "uc_base": "1f9d5-1f3fb",
  72599. "uc_output": "1f9d5-1f3fb",
  72600. "uc_match": "1f9d5-1f3fb",
  72601. "uc_greedy": "1f9d5-1f3fb",
  72602. "shortnames": [":woman_with_headscarf_light_skin_tone:"],
  72603. "category": "people"
  72604. },
  72605. ":woman_with_headscarf_tone2:": {
  72606. "uc_base": "1f9d5-1f3fc",
  72607. "uc_output": "1f9d5-1f3fc",
  72608. "uc_match": "1f9d5-1f3fc",
  72609. "uc_greedy": "1f9d5-1f3fc",
  72610. "shortnames": [":woman_with_headscarf_medium_light_skin_tone:"],
  72611. "category": "people"
  72612. },
  72613. ":woman_with_headscarf_tone3:": {
  72614. "uc_base": "1f9d5-1f3fd",
  72615. "uc_output": "1f9d5-1f3fd",
  72616. "uc_match": "1f9d5-1f3fd",
  72617. "uc_greedy": "1f9d5-1f3fd",
  72618. "shortnames": [":woman_with_headscarf_medium_skin_tone:"],
  72619. "category": "people"
  72620. },
  72621. ":woman_with_headscarf_tone4:": {
  72622. "uc_base": "1f9d5-1f3fe",
  72623. "uc_output": "1f9d5-1f3fe",
  72624. "uc_match": "1f9d5-1f3fe",
  72625. "uc_greedy": "1f9d5-1f3fe",
  72626. "shortnames": [":woman_with_headscarf_medium_dark_skin_tone:"],
  72627. "category": "people"
  72628. },
  72629. ":woman_with_headscarf_tone5:": {
  72630. "uc_base": "1f9d5-1f3ff",
  72631. "uc_output": "1f9d5-1f3ff",
  72632. "uc_match": "1f9d5-1f3ff",
  72633. "uc_greedy": "1f9d5-1f3ff",
  72634. "shortnames": [":woman_with_headscarf_dark_skin_tone:"],
  72635. "category": "people"
  72636. },
  72637. ":fist_tone1:": {
  72638. "uc_base": "270a-1f3fb",
  72639. "uc_output": "270a-1f3fb",
  72640. "uc_match": "270a-1f3fb",
  72641. "uc_greedy": "270a-1f3fb",
  72642. "shortnames": [],
  72643. "category": "people"
  72644. },
  72645. ":fist_tone2:": {
  72646. "uc_base": "270a-1f3fc",
  72647. "uc_output": "270a-1f3fc",
  72648. "uc_match": "270a-1f3fc",
  72649. "uc_greedy": "270a-1f3fc",
  72650. "shortnames": [],
  72651. "category": "people"
  72652. },
  72653. ":fist_tone3:": {
  72654. "uc_base": "270a-1f3fd",
  72655. "uc_output": "270a-1f3fd",
  72656. "uc_match": "270a-1f3fd",
  72657. "uc_greedy": "270a-1f3fd",
  72658. "shortnames": [],
  72659. "category": "people"
  72660. },
  72661. ":fist_tone4:": {
  72662. "uc_base": "270a-1f3fe",
  72663. "uc_output": "270a-1f3fe",
  72664. "uc_match": "270a-1f3fe",
  72665. "uc_greedy": "270a-1f3fe",
  72666. "shortnames": [],
  72667. "category": "people"
  72668. },
  72669. ":fist_tone5:": {
  72670. "uc_base": "270a-1f3ff",
  72671. "uc_output": "270a-1f3ff",
  72672. "uc_match": "270a-1f3ff",
  72673. "uc_greedy": "270a-1f3ff",
  72674. "shortnames": [],
  72675. "category": "people"
  72676. },
  72677. ":person_bouncing_ball_tone1:": {
  72678. "uc_base": "26f9-1f3fb",
  72679. "uc_output": "26f9-1f3fb",
  72680. "uc_match": "26f9-fe0f-1f3fb",
  72681. "uc_greedy": "26f9-fe0f-1f3fb",
  72682. "shortnames": [":basketball_player_tone1:", ":person_with_ball_tone1:"],
  72683. "category": "activity"
  72684. },
  72685. ":person_bouncing_ball_tone2:": {
  72686. "uc_base": "26f9-1f3fc",
  72687. "uc_output": "26f9-1f3fc",
  72688. "uc_match": "26f9-fe0f-1f3fc",
  72689. "uc_greedy": "26f9-fe0f-1f3fc",
  72690. "shortnames": [":basketball_player_tone2:", ":person_with_ball_tone2:"],
  72691. "category": "activity"
  72692. },
  72693. ":person_bouncing_ball_tone3:": {
  72694. "uc_base": "26f9-1f3fd",
  72695. "uc_output": "26f9-1f3fd",
  72696. "uc_match": "26f9-fe0f-1f3fd",
  72697. "uc_greedy": "26f9-fe0f-1f3fd",
  72698. "shortnames": [":basketball_player_tone3:", ":person_with_ball_tone3:"],
  72699. "category": "activity"
  72700. },
  72701. ":person_bouncing_ball_tone4:": {
  72702. "uc_base": "26f9-1f3fe",
  72703. "uc_output": "26f9-1f3fe",
  72704. "uc_match": "26f9-fe0f-1f3fe",
  72705. "uc_greedy": "26f9-fe0f-1f3fe",
  72706. "shortnames": [":basketball_player_tone4:", ":person_with_ball_tone4:"],
  72707. "category": "activity"
  72708. },
  72709. ":person_bouncing_ball_tone5:": {
  72710. "uc_base": "26f9-1f3ff",
  72711. "uc_output": "26f9-1f3ff",
  72712. "uc_match": "26f9-fe0f-1f3ff",
  72713. "uc_greedy": "26f9-fe0f-1f3ff",
  72714. "shortnames": [":basketball_player_tone5:", ":person_with_ball_tone5:"],
  72715. "category": "activity"
  72716. },
  72717. ":point_up_tone1:": {
  72718. "uc_base": "261d-1f3fb",
  72719. "uc_output": "261d-1f3fb",
  72720. "uc_match": "261d-fe0f-1f3fb",
  72721. "uc_greedy": "261d-fe0f-1f3fb",
  72722. "shortnames": [],
  72723. "category": "people"
  72724. },
  72725. ":point_up_tone2:": {
  72726. "uc_base": "261d-1f3fc",
  72727. "uc_output": "261d-1f3fc",
  72728. "uc_match": "261d-fe0f-1f3fc",
  72729. "uc_greedy": "261d-fe0f-1f3fc",
  72730. "shortnames": [],
  72731. "category": "people"
  72732. },
  72733. ":point_up_tone3:": {
  72734. "uc_base": "261d-1f3fd",
  72735. "uc_output": "261d-1f3fd",
  72736. "uc_match": "261d-fe0f-1f3fd",
  72737. "uc_greedy": "261d-fe0f-1f3fd",
  72738. "shortnames": [],
  72739. "category": "people"
  72740. },
  72741. ":point_up_tone4:": {
  72742. "uc_base": "261d-1f3fe",
  72743. "uc_output": "261d-1f3fe",
  72744. "uc_match": "261d-fe0f-1f3fe",
  72745. "uc_greedy": "261d-fe0f-1f3fe",
  72746. "shortnames": [],
  72747. "category": "people"
  72748. },
  72749. ":point_up_tone5:": {
  72750. "uc_base": "261d-1f3ff",
  72751. "uc_output": "261d-1f3ff",
  72752. "uc_match": "261d-fe0f-1f3ff",
  72753. "uc_greedy": "261d-fe0f-1f3ff",
  72754. "shortnames": [],
  72755. "category": "people"
  72756. },
  72757. ":raised_hand_tone1:": {
  72758. "uc_base": "270b-1f3fb",
  72759. "uc_output": "270b-1f3fb",
  72760. "uc_match": "270b-1f3fb",
  72761. "uc_greedy": "270b-1f3fb",
  72762. "shortnames": [],
  72763. "category": "people"
  72764. },
  72765. ":raised_hand_tone2:": {
  72766. "uc_base": "270b-1f3fc",
  72767. "uc_output": "270b-1f3fc",
  72768. "uc_match": "270b-1f3fc",
  72769. "uc_greedy": "270b-1f3fc",
  72770. "shortnames": [],
  72771. "category": "people"
  72772. },
  72773. ":raised_hand_tone3:": {
  72774. "uc_base": "270b-1f3fd",
  72775. "uc_output": "270b-1f3fd",
  72776. "uc_match": "270b-1f3fd",
  72777. "uc_greedy": "270b-1f3fd",
  72778. "shortnames": [],
  72779. "category": "people"
  72780. },
  72781. ":raised_hand_tone4:": {
  72782. "uc_base": "270b-1f3fe",
  72783. "uc_output": "270b-1f3fe",
  72784. "uc_match": "270b-1f3fe",
  72785. "uc_greedy": "270b-1f3fe",
  72786. "shortnames": [],
  72787. "category": "people"
  72788. },
  72789. ":raised_hand_tone5:": {
  72790. "uc_base": "270b-1f3ff",
  72791. "uc_output": "270b-1f3ff",
  72792. "uc_match": "270b-1f3ff",
  72793. "uc_greedy": "270b-1f3ff",
  72794. "shortnames": [],
  72795. "category": "people"
  72796. },
  72797. ":v_tone1:": {
  72798. "uc_base": "270c-1f3fb",
  72799. "uc_output": "270c-1f3fb",
  72800. "uc_match": "270c-fe0f-1f3fb",
  72801. "uc_greedy": "270c-fe0f-1f3fb",
  72802. "shortnames": [],
  72803. "category": "people"
  72804. },
  72805. ":v_tone2:": {
  72806. "uc_base": "270c-1f3fc",
  72807. "uc_output": "270c-1f3fc",
  72808. "uc_match": "270c-fe0f-1f3fc",
  72809. "uc_greedy": "270c-fe0f-1f3fc",
  72810. "shortnames": [],
  72811. "category": "people"
  72812. },
  72813. ":v_tone3:": {
  72814. "uc_base": "270c-1f3fd",
  72815. "uc_output": "270c-1f3fd",
  72816. "uc_match": "270c-fe0f-1f3fd",
  72817. "uc_greedy": "270c-fe0f-1f3fd",
  72818. "shortnames": [],
  72819. "category": "people"
  72820. },
  72821. ":v_tone4:": {
  72822. "uc_base": "270c-1f3fe",
  72823. "uc_output": "270c-1f3fe",
  72824. "uc_match": "270c-fe0f-1f3fe",
  72825. "uc_greedy": "270c-fe0f-1f3fe",
  72826. "shortnames": [],
  72827. "category": "people"
  72828. },
  72829. ":v_tone5:": {
  72830. "uc_base": "270c-1f3ff",
  72831. "uc_output": "270c-1f3ff",
  72832. "uc_match": "270c-fe0f-1f3ff",
  72833. "uc_greedy": "270c-fe0f-1f3ff",
  72834. "shortnames": [],
  72835. "category": "people"
  72836. },
  72837. ":writing_hand_tone1:": {
  72838. "uc_base": "270d-1f3fb",
  72839. "uc_output": "270d-1f3fb",
  72840. "uc_match": "270d-fe0f-1f3fb",
  72841. "uc_greedy": "270d-fe0f-1f3fb",
  72842. "shortnames": [],
  72843. "category": "people"
  72844. },
  72845. ":writing_hand_tone2:": {
  72846. "uc_base": "270d-1f3fc",
  72847. "uc_output": "270d-1f3fc",
  72848. "uc_match": "270d-fe0f-1f3fc",
  72849. "uc_greedy": "270d-fe0f-1f3fc",
  72850. "shortnames": [],
  72851. "category": "people"
  72852. },
  72853. ":writing_hand_tone3:": {
  72854. "uc_base": "270d-1f3fd",
  72855. "uc_output": "270d-1f3fd",
  72856. "uc_match": "270d-fe0f-1f3fd",
  72857. "uc_greedy": "270d-fe0f-1f3fd",
  72858. "shortnames": [],
  72859. "category": "people"
  72860. },
  72861. ":writing_hand_tone4:": {
  72862. "uc_base": "270d-1f3fe",
  72863. "uc_output": "270d-1f3fe",
  72864. "uc_match": "270d-fe0f-1f3fe",
  72865. "uc_greedy": "270d-fe0f-1f3fe",
  72866. "shortnames": [],
  72867. "category": "people"
  72868. },
  72869. ":writing_hand_tone5:": {
  72870. "uc_base": "270d-1f3ff",
  72871. "uc_output": "270d-1f3ff",
  72872. "uc_match": "270d-fe0f-1f3ff",
  72873. "uc_greedy": "270d-fe0f-1f3ff",
  72874. "shortnames": [],
  72875. "category": "people"
  72876. },
  72877. ":100:": {
  72878. "uc_base": "1f4af",
  72879. "uc_output": "1f4af",
  72880. "uc_match": "1f4af",
  72881. "uc_greedy": "1f4af",
  72882. "shortnames": [],
  72883. "category": "symbols"
  72884. },
  72885. ":1234:": {
  72886. "uc_base": "1f522",
  72887. "uc_output": "1f522",
  72888. "uc_match": "1f522",
  72889. "uc_greedy": "1f522",
  72890. "shortnames": [],
  72891. "category": "symbols"
  72892. },
  72893. ":8ball:": {
  72894. "uc_base": "1f3b1",
  72895. "uc_output": "1f3b1",
  72896. "uc_match": "1f3b1",
  72897. "uc_greedy": "1f3b1",
  72898. "shortnames": [],
  72899. "category": "activity"
  72900. },
  72901. ":a:": {
  72902. "uc_base": "1f170",
  72903. "uc_output": "1f170",
  72904. "uc_match": "1f170-fe0f",
  72905. "uc_greedy": "1f170-fe0f",
  72906. "shortnames": [],
  72907. "category": "symbols"
  72908. },
  72909. ":ab:": {
  72910. "uc_base": "1f18e",
  72911. "uc_output": "1f18e",
  72912. "uc_match": "1f18e",
  72913. "uc_greedy": "1f18e",
  72914. "shortnames": [],
  72915. "category": "symbols"
  72916. },
  72917. ":abc:": {
  72918. "uc_base": "1f524",
  72919. "uc_output": "1f524",
  72920. "uc_match": "1f524",
  72921. "uc_greedy": "1f524",
  72922. "shortnames": [],
  72923. "category": "symbols"
  72924. },
  72925. ":abcd:": {
  72926. "uc_base": "1f521",
  72927. "uc_output": "1f521",
  72928. "uc_match": "1f521",
  72929. "uc_greedy": "1f521",
  72930. "shortnames": [],
  72931. "category": "symbols"
  72932. },
  72933. ":accept:": {
  72934. "uc_base": "1f251",
  72935. "uc_output": "1f251",
  72936. "uc_match": "1f251",
  72937. "uc_greedy": "1f251",
  72938. "shortnames": [],
  72939. "category": "symbols"
  72940. },
  72941. ":adult:": {
  72942. "uc_base": "1f9d1",
  72943. "uc_output": "1f9d1",
  72944. "uc_match": "1f9d1",
  72945. "uc_greedy": "1f9d1",
  72946. "shortnames": [],
  72947. "category": "people"
  72948. },
  72949. ":aerial_tramway:": {
  72950. "uc_base": "1f6a1",
  72951. "uc_output": "1f6a1",
  72952. "uc_match": "1f6a1",
  72953. "uc_greedy": "1f6a1",
  72954. "shortnames": [],
  72955. "category": "travel"
  72956. },
  72957. ":airplane_arriving:": {
  72958. "uc_base": "1f6ec",
  72959. "uc_output": "1f6ec",
  72960. "uc_match": "1f6ec",
  72961. "uc_greedy": "1f6ec",
  72962. "shortnames": [],
  72963. "category": "travel"
  72964. },
  72965. ":airplane_departure:": {
  72966. "uc_base": "1f6eb",
  72967. "uc_output": "1f6eb",
  72968. "uc_match": "1f6eb",
  72969. "uc_greedy": "1f6eb",
  72970. "shortnames": [],
  72971. "category": "travel"
  72972. },
  72973. ":airplane_small:": {
  72974. "uc_base": "1f6e9",
  72975. "uc_output": "1f6e9",
  72976. "uc_match": "1f6e9-fe0f",
  72977. "uc_greedy": "1f6e9-fe0f",
  72978. "shortnames": [":small_airplane:"],
  72979. "category": "travel"
  72980. },
  72981. ":alien:": {
  72982. "uc_base": "1f47d",
  72983. "uc_output": "1f47d",
  72984. "uc_match": "1f47d-fe0f",
  72985. "uc_greedy": "1f47d-fe0f",
  72986. "shortnames": [],
  72987. "category": "people"
  72988. },
  72989. ":ambulance:": {
  72990. "uc_base": "1f691",
  72991. "uc_output": "1f691",
  72992. "uc_match": "1f691-fe0f",
  72993. "uc_greedy": "1f691-fe0f",
  72994. "shortnames": [],
  72995. "category": "travel"
  72996. },
  72997. ":amphora:": {
  72998. "uc_base": "1f3fa",
  72999. "uc_output": "1f3fa",
  73000. "uc_match": "1f3fa",
  73001. "uc_greedy": "1f3fa",
  73002. "shortnames": [],
  73003. "category": "objects"
  73004. },
  73005. ":angel:": {
  73006. "uc_base": "1f47c",
  73007. "uc_output": "1f47c",
  73008. "uc_match": "1f47c",
  73009. "uc_greedy": "1f47c",
  73010. "shortnames": [],
  73011. "category": "people"
  73012. },
  73013. ":anger:": {
  73014. "uc_base": "1f4a2",
  73015. "uc_output": "1f4a2",
  73016. "uc_match": "1f4a2",
  73017. "uc_greedy": "1f4a2",
  73018. "shortnames": [],
  73019. "category": "symbols"
  73020. },
  73021. ":anger_right:": {
  73022. "uc_base": "1f5ef",
  73023. "uc_output": "1f5ef",
  73024. "uc_match": "1f5ef-fe0f",
  73025. "uc_greedy": "1f5ef-fe0f",
  73026. "shortnames": [":right_anger_bubble:"],
  73027. "category": "symbols"
  73028. },
  73029. ":angry:": {
  73030. "uc_base": "1f620",
  73031. "uc_output": "1f620",
  73032. "uc_match": "1f620",
  73033. "uc_greedy": "1f620",
  73034. "shortnames": [],
  73035. "category": "people"
  73036. },
  73037. ":anguished:": {
  73038. "uc_base": "1f627",
  73039. "uc_output": "1f627",
  73040. "uc_match": "1f627",
  73041. "uc_greedy": "1f627",
  73042. "shortnames": [],
  73043. "category": "people"
  73044. },
  73045. ":ant:": {
  73046. "uc_base": "1f41c",
  73047. "uc_output": "1f41c",
  73048. "uc_match": "1f41c",
  73049. "uc_greedy": "1f41c",
  73050. "shortnames": [],
  73051. "category": "nature"
  73052. },
  73053. ":apple:": {
  73054. "uc_base": "1f34e",
  73055. "uc_output": "1f34e",
  73056. "uc_match": "1f34e",
  73057. "uc_greedy": "1f34e",
  73058. "shortnames": [],
  73059. "category": "food"
  73060. },
  73061. ":arrow_down_small:": {
  73062. "uc_base": "1f53d",
  73063. "uc_output": "1f53d",
  73064. "uc_match": "1f53d",
  73065. "uc_greedy": "1f53d",
  73066. "shortnames": [],
  73067. "category": "symbols"
  73068. },
  73069. ":arrow_up_small:": {
  73070. "uc_base": "1f53c",
  73071. "uc_output": "1f53c",
  73072. "uc_match": "1f53c",
  73073. "uc_greedy": "1f53c",
  73074. "shortnames": [],
  73075. "category": "symbols"
  73076. },
  73077. ":arrows_clockwise:": {
  73078. "uc_base": "1f503",
  73079. "uc_output": "1f503",
  73080. "uc_match": "1f503",
  73081. "uc_greedy": "1f503",
  73082. "shortnames": [],
  73083. "category": "symbols"
  73084. },
  73085. ":arrows_counterclockwise:": {
  73086. "uc_base": "1f504",
  73087. "uc_output": "1f504",
  73088. "uc_match": "1f504",
  73089. "uc_greedy": "1f504",
  73090. "shortnames": [],
  73091. "category": "symbols"
  73092. },
  73093. ":art:": {
  73094. "uc_base": "1f3a8",
  73095. "uc_output": "1f3a8",
  73096. "uc_match": "1f3a8",
  73097. "uc_greedy": "1f3a8",
  73098. "shortnames": [],
  73099. "category": "activity"
  73100. },
  73101. ":articulated_lorry:": {
  73102. "uc_base": "1f69b",
  73103. "uc_output": "1f69b",
  73104. "uc_match": "1f69b",
  73105. "uc_greedy": "1f69b",
  73106. "shortnames": [],
  73107. "category": "travel"
  73108. },
  73109. ":astonished:": {
  73110. "uc_base": "1f632",
  73111. "uc_output": "1f632",
  73112. "uc_match": "1f632",
  73113. "uc_greedy": "1f632",
  73114. "shortnames": [],
  73115. "category": "people"
  73116. },
  73117. ":athletic_shoe:": {
  73118. "uc_base": "1f45f",
  73119. "uc_output": "1f45f",
  73120. "uc_match": "1f45f",
  73121. "uc_greedy": "1f45f",
  73122. "shortnames": [],
  73123. "category": "people"
  73124. },
  73125. ":atm:": {
  73126. "uc_base": "1f3e7",
  73127. "uc_output": "1f3e7",
  73128. "uc_match": "1f3e7",
  73129. "uc_greedy": "1f3e7",
  73130. "shortnames": [],
  73131. "category": "symbols"
  73132. },
  73133. ":avocado:": {
  73134. "uc_base": "1f951",
  73135. "uc_output": "1f951",
  73136. "uc_match": "1f951",
  73137. "uc_greedy": "1f951",
  73138. "shortnames": [],
  73139. "category": "food"
  73140. },
  73141. ":b:": {
  73142. "uc_base": "1f171",
  73143. "uc_output": "1f171",
  73144. "uc_match": "1f171-fe0f",
  73145. "uc_greedy": "1f171-fe0f",
  73146. "shortnames": [],
  73147. "category": "symbols"
  73148. },
  73149. ":baby:": {
  73150. "uc_base": "1f476",
  73151. "uc_output": "1f476",
  73152. "uc_match": "1f476",
  73153. "uc_greedy": "1f476",
  73154. "shortnames": [],
  73155. "category": "people"
  73156. },
  73157. ":baby_bottle:": {
  73158. "uc_base": "1f37c",
  73159. "uc_output": "1f37c",
  73160. "uc_match": "1f37c",
  73161. "uc_greedy": "1f37c",
  73162. "shortnames": [],
  73163. "category": "food"
  73164. },
  73165. ":baby_chick:": {
  73166. "uc_base": "1f424",
  73167. "uc_output": "1f424",
  73168. "uc_match": "1f424",
  73169. "uc_greedy": "1f424",
  73170. "shortnames": [],
  73171. "category": "nature"
  73172. },
  73173. ":baby_symbol:": {
  73174. "uc_base": "1f6bc",
  73175. "uc_output": "1f6bc",
  73176. "uc_match": "1f6bc-fe0f",
  73177. "uc_greedy": "1f6bc-fe0f",
  73178. "shortnames": [],
  73179. "category": "symbols"
  73180. },
  73181. ":back:": {
  73182. "uc_base": "1f519",
  73183. "uc_output": "1f519",
  73184. "uc_match": "1f519",
  73185. "uc_greedy": "1f519",
  73186. "shortnames": [],
  73187. "category": "symbols"
  73188. },
  73189. ":bacon:": {
  73190. "uc_base": "1f953",
  73191. "uc_output": "1f953",
  73192. "uc_match": "1f953",
  73193. "uc_greedy": "1f953",
  73194. "shortnames": [],
  73195. "category": "food"
  73196. },
  73197. ":badminton:": {
  73198. "uc_base": "1f3f8",
  73199. "uc_output": "1f3f8",
  73200. "uc_match": "1f3f8",
  73201. "uc_greedy": "1f3f8",
  73202. "shortnames": [],
  73203. "category": "activity"
  73204. },
  73205. ":baggage_claim:": {
  73206. "uc_base": "1f6c4",
  73207. "uc_output": "1f6c4",
  73208. "uc_match": "1f6c4",
  73209. "uc_greedy": "1f6c4",
  73210. "shortnames": [],
  73211. "category": "symbols"
  73212. },
  73213. ":balloon:": {
  73214. "uc_base": "1f388",
  73215. "uc_output": "1f388",
  73216. "uc_match": "1f388",
  73217. "uc_greedy": "1f388",
  73218. "shortnames": [],
  73219. "category": "objects"
  73220. },
  73221. ":ballot_box:": {
  73222. "uc_base": "1f5f3",
  73223. "uc_output": "1f5f3",
  73224. "uc_match": "1f5f3-fe0f",
  73225. "uc_greedy": "1f5f3-fe0f",
  73226. "shortnames": [":ballot_box_with_ballot:"],
  73227. "category": "objects"
  73228. },
  73229. ":bamboo:": {
  73230. "uc_base": "1f38d",
  73231. "uc_output": "1f38d",
  73232. "uc_match": "1f38d",
  73233. "uc_greedy": "1f38d",
  73234. "shortnames": [],
  73235. "category": "nature"
  73236. },
  73237. ":banana:": {
  73238. "uc_base": "1f34c",
  73239. "uc_output": "1f34c",
  73240. "uc_match": "1f34c",
  73241. "uc_greedy": "1f34c",
  73242. "shortnames": [],
  73243. "category": "food"
  73244. },
  73245. ":bank:": {
  73246. "uc_base": "1f3e6",
  73247. "uc_output": "1f3e6",
  73248. "uc_match": "1f3e6",
  73249. "uc_greedy": "1f3e6",
  73250. "shortnames": [],
  73251. "category": "travel"
  73252. },
  73253. ":bar_chart:": {
  73254. "uc_base": "1f4ca",
  73255. "uc_output": "1f4ca",
  73256. "uc_match": "1f4ca",
  73257. "uc_greedy": "1f4ca",
  73258. "shortnames": [],
  73259. "category": "objects"
  73260. },
  73261. ":barber:": {
  73262. "uc_base": "1f488",
  73263. "uc_output": "1f488",
  73264. "uc_match": "1f488",
  73265. "uc_greedy": "1f488",
  73266. "shortnames": [],
  73267. "category": "objects"
  73268. },
  73269. ":basketball:": {
  73270. "uc_base": "1f3c0",
  73271. "uc_output": "1f3c0",
  73272. "uc_match": "1f3c0",
  73273. "uc_greedy": "1f3c0",
  73274. "shortnames": [],
  73275. "category": "activity"
  73276. },
  73277. ":bat:": {
  73278. "uc_base": "1f987",
  73279. "uc_output": "1f987",
  73280. "uc_match": "1f987",
  73281. "uc_greedy": "1f987",
  73282. "shortnames": [],
  73283. "category": "nature"
  73284. },
  73285. ":bath:": {
  73286. "uc_base": "1f6c0",
  73287. "uc_output": "1f6c0",
  73288. "uc_match": "1f6c0",
  73289. "uc_greedy": "1f6c0",
  73290. "shortnames": [],
  73291. "category": "objects"
  73292. },
  73293. ":bathtub:": {
  73294. "uc_base": "1f6c1",
  73295. "uc_output": "1f6c1",
  73296. "uc_match": "1f6c1",
  73297. "uc_greedy": "1f6c1",
  73298. "shortnames": [],
  73299. "category": "objects"
  73300. },
  73301. ":battery:": {
  73302. "uc_base": "1f50b",
  73303. "uc_output": "1f50b",
  73304. "uc_match": "1f50b",
  73305. "uc_greedy": "1f50b",
  73306. "shortnames": [],
  73307. "category": "objects"
  73308. },
  73309. ":beach:": {
  73310. "uc_base": "1f3d6",
  73311. "uc_output": "1f3d6",
  73312. "uc_match": "1f3d6-fe0f",
  73313. "uc_greedy": "1f3d6-fe0f",
  73314. "shortnames": [":beach_with_umbrella:"],
  73315. "category": "travel"
  73316. },
  73317. ":bear:": {
  73318. "uc_base": "1f43b",
  73319. "uc_output": "1f43b",
  73320. "uc_match": "1f43b",
  73321. "uc_greedy": "1f43b",
  73322. "shortnames": [],
  73323. "category": "nature"
  73324. },
  73325. ":bearded_person:": {
  73326. "uc_base": "1f9d4",
  73327. "uc_output": "1f9d4",
  73328. "uc_match": "1f9d4",
  73329. "uc_greedy": "1f9d4",
  73330. "shortnames": [],
  73331. "category": "people"
  73332. },
  73333. ":bed:": {
  73334. "uc_base": "1f6cf",
  73335. "uc_output": "1f6cf",
  73336. "uc_match": "1f6cf-fe0f",
  73337. "uc_greedy": "1f6cf-fe0f",
  73338. "shortnames": [],
  73339. "category": "objects"
  73340. },
  73341. ":bee:": {
  73342. "uc_base": "1f41d",
  73343. "uc_output": "1f41d",
  73344. "uc_match": "1f41d",
  73345. "uc_greedy": "1f41d",
  73346. "shortnames": [],
  73347. "category": "nature"
  73348. },
  73349. ":beer:": {
  73350. "uc_base": "1f37a",
  73351. "uc_output": "1f37a",
  73352. "uc_match": "1f37a",
  73353. "uc_greedy": "1f37a",
  73354. "shortnames": [],
  73355. "category": "food"
  73356. },
  73357. ":beers:": {
  73358. "uc_base": "1f37b",
  73359. "uc_output": "1f37b",
  73360. "uc_match": "1f37b",
  73361. "uc_greedy": "1f37b",
  73362. "shortnames": [],
  73363. "category": "food"
  73364. },
  73365. ":beetle:": {
  73366. "uc_base": "1f41e",
  73367. "uc_output": "1f41e",
  73368. "uc_match": "1f41e",
  73369. "uc_greedy": "1f41e",
  73370. "shortnames": [],
  73371. "category": "nature"
  73372. },
  73373. ":beginner:": {
  73374. "uc_base": "1f530",
  73375. "uc_output": "1f530",
  73376. "uc_match": "1f530",
  73377. "uc_greedy": "1f530",
  73378. "shortnames": [],
  73379. "category": "symbols"
  73380. },
  73381. ":bell:": {
  73382. "uc_base": "1f514",
  73383. "uc_output": "1f514",
  73384. "uc_match": "1f514",
  73385. "uc_greedy": "1f514",
  73386. "shortnames": [],
  73387. "category": "symbols"
  73388. },
  73389. ":bellhop:": {
  73390. "uc_base": "1f6ce",
  73391. "uc_output": "1f6ce",
  73392. "uc_match": "1f6ce-fe0f",
  73393. "uc_greedy": "1f6ce-fe0f",
  73394. "shortnames": [":bellhop_bell:"],
  73395. "category": "objects"
  73396. },
  73397. ":bento:": {
  73398. "uc_base": "1f371",
  73399. "uc_output": "1f371",
  73400. "uc_match": "1f371",
  73401. "uc_greedy": "1f371",
  73402. "shortnames": [],
  73403. "category": "food"
  73404. },
  73405. ":bike:": {
  73406. "uc_base": "1f6b2",
  73407. "uc_output": "1f6b2",
  73408. "uc_match": "1f6b2-fe0f",
  73409. "uc_greedy": "1f6b2-fe0f",
  73410. "shortnames": [],
  73411. "category": "travel"
  73412. },
  73413. ":bikini:": {
  73414. "uc_base": "1f459",
  73415. "uc_output": "1f459",
  73416. "uc_match": "1f459",
  73417. "uc_greedy": "1f459",
  73418. "shortnames": [],
  73419. "category": "people"
  73420. },
  73421. ":billed_cap:": {
  73422. "uc_base": "1f9e2",
  73423. "uc_output": "1f9e2",
  73424. "uc_match": "1f9e2",
  73425. "uc_greedy": "1f9e2",
  73426. "shortnames": [],
  73427. "category": "people"
  73428. },
  73429. ":bird:": {
  73430. "uc_base": "1f426",
  73431. "uc_output": "1f426",
  73432. "uc_match": "1f426-fe0f",
  73433. "uc_greedy": "1f426-fe0f",
  73434. "shortnames": [],
  73435. "category": "nature"
  73436. },
  73437. ":birthday:": {
  73438. "uc_base": "1f382",
  73439. "uc_output": "1f382",
  73440. "uc_match": "1f382",
  73441. "uc_greedy": "1f382",
  73442. "shortnames": [],
  73443. "category": "food"
  73444. },
  73445. ":black_heart:": {
  73446. "uc_base": "1f5a4",
  73447. "uc_output": "1f5a4",
  73448. "uc_match": "1f5a4",
  73449. "uc_greedy": "1f5a4",
  73450. "shortnames": [],
  73451. "category": "symbols"
  73452. },
  73453. ":black_joker:": {
  73454. "uc_base": "1f0cf",
  73455. "uc_output": "1f0cf",
  73456. "uc_match": "1f0cf",
  73457. "uc_greedy": "1f0cf",
  73458. "shortnames": [],
  73459. "category": "symbols"
  73460. },
  73461. ":black_square_button:": {
  73462. "uc_base": "1f532",
  73463. "uc_output": "1f532",
  73464. "uc_match": "1f532",
  73465. "uc_greedy": "1f532",
  73466. "shortnames": [],
  73467. "category": "symbols"
  73468. },
  73469. ":blond_haired_person:": {
  73470. "uc_base": "1f471",
  73471. "uc_output": "1f471",
  73472. "uc_match": "1f471",
  73473. "uc_greedy": "1f471",
  73474. "shortnames": [":person_with_blond_hair:"],
  73475. "category": "people"
  73476. },
  73477. ":blossom:": {
  73478. "uc_base": "1f33c",
  73479. "uc_output": "1f33c",
  73480. "uc_match": "1f33c",
  73481. "uc_greedy": "1f33c",
  73482. "shortnames": [],
  73483. "category": "nature"
  73484. },
  73485. ":blowfish:": {
  73486. "uc_base": "1f421",
  73487. "uc_output": "1f421",
  73488. "uc_match": "1f421",
  73489. "uc_greedy": "1f421",
  73490. "shortnames": [],
  73491. "category": "nature"
  73492. },
  73493. ":blue_book:": {
  73494. "uc_base": "1f4d8",
  73495. "uc_output": "1f4d8",
  73496. "uc_match": "1f4d8",
  73497. "uc_greedy": "1f4d8",
  73498. "shortnames": [],
  73499. "category": "objects"
  73500. },
  73501. ":blue_car:": {
  73502. "uc_base": "1f699",
  73503. "uc_output": "1f699",
  73504. "uc_match": "1f699",
  73505. "uc_greedy": "1f699",
  73506. "shortnames": [],
  73507. "category": "travel"
  73508. },
  73509. ":blue_circle:": {
  73510. "uc_base": "1f535",
  73511. "uc_output": "1f535",
  73512. "uc_match": "1f535",
  73513. "uc_greedy": "1f535",
  73514. "shortnames": [],
  73515. "category": "symbols"
  73516. },
  73517. ":blue_heart:": {
  73518. "uc_base": "1f499",
  73519. "uc_output": "1f499",
  73520. "uc_match": "1f499",
  73521. "uc_greedy": "1f499",
  73522. "shortnames": [],
  73523. "category": "symbols"
  73524. },
  73525. ":blush:": {
  73526. "uc_base": "1f60a",
  73527. "uc_output": "1f60a",
  73528. "uc_match": "1f60a",
  73529. "uc_greedy": "1f60a",
  73530. "shortnames": [],
  73531. "category": "people"
  73532. },
  73533. ":boar:": {
  73534. "uc_base": "1f417",
  73535. "uc_output": "1f417",
  73536. "uc_match": "1f417",
  73537. "uc_greedy": "1f417",
  73538. "shortnames": [],
  73539. "category": "nature"
  73540. },
  73541. ":bomb:": {
  73542. "uc_base": "1f4a3",
  73543. "uc_output": "1f4a3",
  73544. "uc_match": "1f4a3-fe0f",
  73545. "uc_greedy": "1f4a3-fe0f",
  73546. "shortnames": [],
  73547. "category": "objects"
  73548. },
  73549. ":book:": {
  73550. "uc_base": "1f4d6",
  73551. "uc_output": "1f4d6",
  73552. "uc_match": "1f4d6",
  73553. "uc_greedy": "1f4d6",
  73554. "shortnames": [],
  73555. "category": "objects"
  73556. },
  73557. ":bookmark:": {
  73558. "uc_base": "1f516",
  73559. "uc_output": "1f516",
  73560. "uc_match": "1f516",
  73561. "uc_greedy": "1f516",
  73562. "shortnames": [],
  73563. "category": "objects"
  73564. },
  73565. ":bookmark_tabs:": {
  73566. "uc_base": "1f4d1",
  73567. "uc_output": "1f4d1",
  73568. "uc_match": "1f4d1",
  73569. "uc_greedy": "1f4d1",
  73570. "shortnames": [],
  73571. "category": "objects"
  73572. },
  73573. ":books:": {
  73574. "uc_base": "1f4da",
  73575. "uc_output": "1f4da",
  73576. "uc_match": "1f4da-fe0f",
  73577. "uc_greedy": "1f4da-fe0f",
  73578. "shortnames": [],
  73579. "category": "objects"
  73580. },
  73581. ":boom:": {
  73582. "uc_base": "1f4a5",
  73583. "uc_output": "1f4a5",
  73584. "uc_match": "1f4a5",
  73585. "uc_greedy": "1f4a5",
  73586. "shortnames": [],
  73587. "category": "nature"
  73588. },
  73589. ":boot:": {
  73590. "uc_base": "1f462",
  73591. "uc_output": "1f462",
  73592. "uc_match": "1f462",
  73593. "uc_greedy": "1f462",
  73594. "shortnames": [],
  73595. "category": "people"
  73596. },
  73597. ":bouquet:": {
  73598. "uc_base": "1f490",
  73599. "uc_output": "1f490",
  73600. "uc_match": "1f490",
  73601. "uc_greedy": "1f490",
  73602. "shortnames": [],
  73603. "category": "nature"
  73604. },
  73605. ":bow_and_arrow:": {
  73606. "uc_base": "1f3f9",
  73607. "uc_output": "1f3f9",
  73608. "uc_match": "1f3f9",
  73609. "uc_greedy": "1f3f9",
  73610. "shortnames": [":archery:"],
  73611. "category": "activity"
  73612. },
  73613. ":bowl_with_spoon:": {
  73614. "uc_base": "1f963",
  73615. "uc_output": "1f963",
  73616. "uc_match": "1f963",
  73617. "uc_greedy": "1f963",
  73618. "shortnames": [],
  73619. "category": "food"
  73620. },
  73621. ":bowling:": {
  73622. "uc_base": "1f3b3",
  73623. "uc_output": "1f3b3",
  73624. "uc_match": "1f3b3",
  73625. "uc_greedy": "1f3b3",
  73626. "shortnames": [],
  73627. "category": "activity"
  73628. },
  73629. ":boxing_glove:": {
  73630. "uc_base": "1f94a",
  73631. "uc_output": "1f94a",
  73632. "uc_match": "1f94a",
  73633. "uc_greedy": "1f94a",
  73634. "shortnames": [":boxing_gloves:"],
  73635. "category": "activity"
  73636. },
  73637. ":boy:": {
  73638. "uc_base": "1f466",
  73639. "uc_output": "1f466",
  73640. "uc_match": "1f466",
  73641. "uc_greedy": "1f466",
  73642. "shortnames": [],
  73643. "category": "people"
  73644. },
  73645. ":brain:": {
  73646. "uc_base": "1f9e0",
  73647. "uc_output": "1f9e0",
  73648. "uc_match": "1f9e0",
  73649. "uc_greedy": "1f9e0",
  73650. "shortnames": [],
  73651. "category": "people"
  73652. },
  73653. ":bread:": {
  73654. "uc_base": "1f35e",
  73655. "uc_output": "1f35e",
  73656. "uc_match": "1f35e",
  73657. "uc_greedy": "1f35e",
  73658. "shortnames": [],
  73659. "category": "food"
  73660. },
  73661. ":breast_feeding:": {
  73662. "uc_base": "1f931",
  73663. "uc_output": "1f931",
  73664. "uc_match": "1f931",
  73665. "uc_greedy": "1f931",
  73666. "shortnames": [],
  73667. "category": "people"
  73668. },
  73669. ":bride_with_veil:": {
  73670. "uc_base": "1f470",
  73671. "uc_output": "1f470",
  73672. "uc_match": "1f470",
  73673. "uc_greedy": "1f470",
  73674. "shortnames": [],
  73675. "category": "people"
  73676. },
  73677. ":bridge_at_night:": {
  73678. "uc_base": "1f309",
  73679. "uc_output": "1f309",
  73680. "uc_match": "1f309",
  73681. "uc_greedy": "1f309",
  73682. "shortnames": [],
  73683. "category": "travel"
  73684. },
  73685. ":briefcase:": {
  73686. "uc_base": "1f4bc",
  73687. "uc_output": "1f4bc",
  73688. "uc_match": "1f4bc",
  73689. "uc_greedy": "1f4bc",
  73690. "shortnames": [],
  73691. "category": "people"
  73692. },
  73693. ":broccoli:": {
  73694. "uc_base": "1f966",
  73695. "uc_output": "1f966",
  73696. "uc_match": "1f966",
  73697. "uc_greedy": "1f966",
  73698. "shortnames": [],
  73699. "category": "food"
  73700. },
  73701. ":broken_heart:": {
  73702. "uc_base": "1f494",
  73703. "uc_output": "1f494",
  73704. "uc_match": "1f494",
  73705. "uc_greedy": "1f494",
  73706. "shortnames": [],
  73707. "category": "symbols"
  73708. },
  73709. ":bug:": {
  73710. "uc_base": "1f41b",
  73711. "uc_output": "1f41b",
  73712. "uc_match": "1f41b",
  73713. "uc_greedy": "1f41b",
  73714. "shortnames": [],
  73715. "category": "nature"
  73716. },
  73717. ":bulb:": {
  73718. "uc_base": "1f4a1",
  73719. "uc_output": "1f4a1",
  73720. "uc_match": "1f4a1",
  73721. "uc_greedy": "1f4a1",
  73722. "shortnames": [],
  73723. "category": "objects"
  73724. },
  73725. ":bullettrain_front:": {
  73726. "uc_base": "1f685",
  73727. "uc_output": "1f685",
  73728. "uc_match": "1f685",
  73729. "uc_greedy": "1f685",
  73730. "shortnames": [],
  73731. "category": "travel"
  73732. },
  73733. ":bullettrain_side:": {
  73734. "uc_base": "1f684",
  73735. "uc_output": "1f684",
  73736. "uc_match": "1f684",
  73737. "uc_greedy": "1f684",
  73738. "shortnames": [],
  73739. "category": "travel"
  73740. },
  73741. ":burrito:": {
  73742. "uc_base": "1f32f",
  73743. "uc_output": "1f32f",
  73744. "uc_match": "1f32f",
  73745. "uc_greedy": "1f32f",
  73746. "shortnames": [],
  73747. "category": "food"
  73748. },
  73749. ":bus:": {
  73750. "uc_base": "1f68c",
  73751. "uc_output": "1f68c",
  73752. "uc_match": "1f68c",
  73753. "uc_greedy": "1f68c",
  73754. "shortnames": [],
  73755. "category": "travel"
  73756. },
  73757. ":busstop:": {
  73758. "uc_base": "1f68f",
  73759. "uc_output": "1f68f",
  73760. "uc_match": "1f68f",
  73761. "uc_greedy": "1f68f",
  73762. "shortnames": [],
  73763. "category": "travel"
  73764. },
  73765. ":bust_in_silhouette:": {
  73766. "uc_base": "1f464",
  73767. "uc_output": "1f464",
  73768. "uc_match": "1f464",
  73769. "uc_greedy": "1f464",
  73770. "shortnames": [],
  73771. "category": "people"
  73772. },
  73773. ":busts_in_silhouette:": {
  73774. "uc_base": "1f465",
  73775. "uc_output": "1f465",
  73776. "uc_match": "1f465",
  73777. "uc_greedy": "1f465",
  73778. "shortnames": [],
  73779. "category": "people"
  73780. },
  73781. ":butterfly:": {
  73782. "uc_base": "1f98b",
  73783. "uc_output": "1f98b",
  73784. "uc_match": "1f98b",
  73785. "uc_greedy": "1f98b",
  73786. "shortnames": [],
  73787. "category": "nature"
  73788. },
  73789. ":cactus:": {
  73790. "uc_base": "1f335",
  73791. "uc_output": "1f335",
  73792. "uc_match": "1f335",
  73793. "uc_greedy": "1f335",
  73794. "shortnames": [],
  73795. "category": "nature"
  73796. },
  73797. ":cake:": {
  73798. "uc_base": "1f370",
  73799. "uc_output": "1f370",
  73800. "uc_match": "1f370",
  73801. "uc_greedy": "1f370",
  73802. "shortnames": [],
  73803. "category": "food"
  73804. },
  73805. ":calendar:": {
  73806. "uc_base": "1f4c6",
  73807. "uc_output": "1f4c6",
  73808. "uc_match": "1f4c6",
  73809. "uc_greedy": "1f4c6",
  73810. "shortnames": [],
  73811. "category": "objects"
  73812. },
  73813. ":calendar_spiral:": {
  73814. "uc_base": "1f5d3",
  73815. "uc_output": "1f5d3",
  73816. "uc_match": "1f5d3-fe0f",
  73817. "uc_greedy": "1f5d3-fe0f",
  73818. "shortnames": [":spiral_calendar_pad:"],
  73819. "category": "objects"
  73820. },
  73821. ":call_me:": {
  73822. "uc_base": "1f919",
  73823. "uc_output": "1f919",
  73824. "uc_match": "1f919",
  73825. "uc_greedy": "1f919",
  73826. "shortnames": [":call_me_hand:"],
  73827. "category": "people"
  73828. },
  73829. ":calling:": {
  73830. "uc_base": "1f4f2",
  73831. "uc_output": "1f4f2",
  73832. "uc_match": "1f4f2",
  73833. "uc_greedy": "1f4f2",
  73834. "shortnames": [],
  73835. "category": "objects"
  73836. },
  73837. ":camel:": {
  73838. "uc_base": "1f42b",
  73839. "uc_output": "1f42b",
  73840. "uc_match": "1f42b",
  73841. "uc_greedy": "1f42b",
  73842. "shortnames": [],
  73843. "category": "nature"
  73844. },
  73845. ":camera:": {
  73846. "uc_base": "1f4f7",
  73847. "uc_output": "1f4f7",
  73848. "uc_match": "1f4f7-fe0f",
  73849. "uc_greedy": "1f4f7-fe0f",
  73850. "shortnames": [],
  73851. "category": "objects"
  73852. },
  73853. ":camera_with_flash:": {
  73854. "uc_base": "1f4f8",
  73855. "uc_output": "1f4f8",
  73856. "uc_match": "1f4f8",
  73857. "uc_greedy": "1f4f8",
  73858. "shortnames": [],
  73859. "category": "objects"
  73860. },
  73861. ":camping:": {
  73862. "uc_base": "1f3d5",
  73863. "uc_output": "1f3d5",
  73864. "uc_match": "1f3d5-fe0f",
  73865. "uc_greedy": "1f3d5-fe0f",
  73866. "shortnames": [],
  73867. "category": "travel"
  73868. },
  73869. ":candle:": {
  73870. "uc_base": "1f56f",
  73871. "uc_output": "1f56f",
  73872. "uc_match": "1f56f-fe0f",
  73873. "uc_greedy": "1f56f-fe0f",
  73874. "shortnames": [],
  73875. "category": "objects"
  73876. },
  73877. ":candy:": {
  73878. "uc_base": "1f36c",
  73879. "uc_output": "1f36c",
  73880. "uc_match": "1f36c",
  73881. "uc_greedy": "1f36c",
  73882. "shortnames": [],
  73883. "category": "food"
  73884. },
  73885. ":canned_food:": {
  73886. "uc_base": "1f96b",
  73887. "uc_output": "1f96b",
  73888. "uc_match": "1f96b",
  73889. "uc_greedy": "1f96b",
  73890. "shortnames": [],
  73891. "category": "food"
  73892. },
  73893. ":canoe:": {
  73894. "uc_base": "1f6f6",
  73895. "uc_output": "1f6f6",
  73896. "uc_match": "1f6f6",
  73897. "uc_greedy": "1f6f6",
  73898. "shortnames": [":kayak:"],
  73899. "category": "travel"
  73900. },
  73901. ":capital_abcd:": {
  73902. "uc_base": "1f520",
  73903. "uc_output": "1f520",
  73904. "uc_match": "1f520",
  73905. "uc_greedy": "1f520",
  73906. "shortnames": [],
  73907. "category": "symbols"
  73908. },
  73909. ":card_box:": {
  73910. "uc_base": "1f5c3",
  73911. "uc_output": "1f5c3",
  73912. "uc_match": "1f5c3-fe0f",
  73913. "uc_greedy": "1f5c3-fe0f",
  73914. "shortnames": [":card_file_box:"],
  73915. "category": "objects"
  73916. },
  73917. ":card_index:": {
  73918. "uc_base": "1f4c7",
  73919. "uc_output": "1f4c7",
  73920. "uc_match": "1f4c7",
  73921. "uc_greedy": "1f4c7",
  73922. "shortnames": [],
  73923. "category": "objects"
  73924. },
  73925. ":carousel_horse:": {
  73926. "uc_base": "1f3a0",
  73927. "uc_output": "1f3a0",
  73928. "uc_match": "1f3a0",
  73929. "uc_greedy": "1f3a0",
  73930. "shortnames": [],
  73931. "category": "travel"
  73932. },
  73933. ":carrot:": {
  73934. "uc_base": "1f955",
  73935. "uc_output": "1f955",
  73936. "uc_match": "1f955",
  73937. "uc_greedy": "1f955",
  73938. "shortnames": [],
  73939. "category": "food"
  73940. },
  73941. ":cat2:": {
  73942. "uc_base": "1f408",
  73943. "uc_output": "1f408",
  73944. "uc_match": "1f408-fe0f",
  73945. "uc_greedy": "1f408-fe0f",
  73946. "shortnames": [],
  73947. "category": "nature"
  73948. },
  73949. ":cat:": {
  73950. "uc_base": "1f431",
  73951. "uc_output": "1f431",
  73952. "uc_match": "1f431",
  73953. "uc_greedy": "1f431",
  73954. "shortnames": [],
  73955. "category": "nature"
  73956. },
  73957. ":cd:": {
  73958. "uc_base": "1f4bf",
  73959. "uc_output": "1f4bf",
  73960. "uc_match": "1f4bf-fe0f",
  73961. "uc_greedy": "1f4bf-fe0f",
  73962. "shortnames": [],
  73963. "category": "objects"
  73964. },
  73965. ":champagne:": {
  73966. "uc_base": "1f37e",
  73967. "uc_output": "1f37e",
  73968. "uc_match": "1f37e",
  73969. "uc_greedy": "1f37e",
  73970. "shortnames": [":bottle_with_popping_cork:"],
  73971. "category": "food"
  73972. },
  73973. ":champagne_glass:": {
  73974. "uc_base": "1f942",
  73975. "uc_output": "1f942",
  73976. "uc_match": "1f942",
  73977. "uc_greedy": "1f942",
  73978. "shortnames": [":clinking_glass:"],
  73979. "category": "food"
  73980. },
  73981. ":chart:": {
  73982. "uc_base": "1f4b9",
  73983. "uc_output": "1f4b9",
  73984. "uc_match": "1f4b9",
  73985. "uc_greedy": "1f4b9",
  73986. "shortnames": [],
  73987. "category": "symbols"
  73988. },
  73989. ":chart_with_downwards_trend:": {
  73990. "uc_base": "1f4c9",
  73991. "uc_output": "1f4c9",
  73992. "uc_match": "1f4c9",
  73993. "uc_greedy": "1f4c9",
  73994. "shortnames": [],
  73995. "category": "objects"
  73996. },
  73997. ":chart_with_upwards_trend:": {
  73998. "uc_base": "1f4c8",
  73999. "uc_output": "1f4c8",
  74000. "uc_match": "1f4c8",
  74001. "uc_greedy": "1f4c8",
  74002. "shortnames": [],
  74003. "category": "objects"
  74004. },
  74005. ":checkered_flag:": {
  74006. "uc_base": "1f3c1",
  74007. "uc_output": "1f3c1",
  74008. "uc_match": "1f3c1",
  74009. "uc_greedy": "1f3c1",
  74010. "shortnames": [],
  74011. "category": "flags"
  74012. },
  74013. ":cheese:": {
  74014. "uc_base": "1f9c0",
  74015. "uc_output": "1f9c0",
  74016. "uc_match": "1f9c0",
  74017. "uc_greedy": "1f9c0",
  74018. "shortnames": [":cheese_wedge:"],
  74019. "category": "food"
  74020. },
  74021. ":cherries:": {
  74022. "uc_base": "1f352",
  74023. "uc_output": "1f352",
  74024. "uc_match": "1f352",
  74025. "uc_greedy": "1f352",
  74026. "shortnames": [],
  74027. "category": "food"
  74028. },
  74029. ":cherry_blossom:": {
  74030. "uc_base": "1f338",
  74031. "uc_output": "1f338",
  74032. "uc_match": "1f338",
  74033. "uc_greedy": "1f338",
  74034. "shortnames": [],
  74035. "category": "nature"
  74036. },
  74037. ":chestnut:": {
  74038. "uc_base": "1f330",
  74039. "uc_output": "1f330",
  74040. "uc_match": "1f330",
  74041. "uc_greedy": "1f330",
  74042. "shortnames": [],
  74043. "category": "food"
  74044. },
  74045. ":chicken:": {
  74046. "uc_base": "1f414",
  74047. "uc_output": "1f414",
  74048. "uc_match": "1f414",
  74049. "uc_greedy": "1f414",
  74050. "shortnames": [],
  74051. "category": "nature"
  74052. },
  74053. ":child:": {
  74054. "uc_base": "1f9d2",
  74055. "uc_output": "1f9d2",
  74056. "uc_match": "1f9d2",
  74057. "uc_greedy": "1f9d2",
  74058. "shortnames": [],
  74059. "category": "people"
  74060. },
  74061. ":children_crossing:": {
  74062. "uc_base": "1f6b8",
  74063. "uc_output": "1f6b8",
  74064. "uc_match": "1f6b8",
  74065. "uc_greedy": "1f6b8",
  74066. "shortnames": [],
  74067. "category": "symbols"
  74068. },
  74069. ":chipmunk:": {
  74070. "uc_base": "1f43f",
  74071. "uc_output": "1f43f",
  74072. "uc_match": "1f43f-fe0f",
  74073. "uc_greedy": "1f43f-fe0f",
  74074. "shortnames": [],
  74075. "category": "nature"
  74076. },
  74077. ":chocolate_bar:": {
  74078. "uc_base": "1f36b",
  74079. "uc_output": "1f36b",
  74080. "uc_match": "1f36b",
  74081. "uc_greedy": "1f36b",
  74082. "shortnames": [],
  74083. "category": "food"
  74084. },
  74085. ":chopsticks:": {
  74086. "uc_base": "1f962",
  74087. "uc_output": "1f962",
  74088. "uc_match": "1f962",
  74089. "uc_greedy": "1f962",
  74090. "shortnames": [],
  74091. "category": "food"
  74092. },
  74093. ":christmas_tree:": {
  74094. "uc_base": "1f384",
  74095. "uc_output": "1f384",
  74096. "uc_match": "1f384",
  74097. "uc_greedy": "1f384",
  74098. "shortnames": [],
  74099. "category": "nature"
  74100. },
  74101. ":cinema:": {
  74102. "uc_base": "1f3a6",
  74103. "uc_output": "1f3a6",
  74104. "uc_match": "1f3a6",
  74105. "uc_greedy": "1f3a6",
  74106. "shortnames": [],
  74107. "category": "symbols"
  74108. },
  74109. ":circus_tent:": {
  74110. "uc_base": "1f3aa",
  74111. "uc_output": "1f3aa",
  74112. "uc_match": "1f3aa",
  74113. "uc_greedy": "1f3aa",
  74114. "shortnames": [],
  74115. "category": "activity"
  74116. },
  74117. ":city_dusk:": {
  74118. "uc_base": "1f306",
  74119. "uc_output": "1f306",
  74120. "uc_match": "1f306",
  74121. "uc_greedy": "1f306",
  74122. "shortnames": [],
  74123. "category": "travel"
  74124. },
  74125. ":city_sunset:": {
  74126. "uc_base": "1f307",
  74127. "uc_output": "1f307",
  74128. "uc_match": "1f307",
  74129. "uc_greedy": "1f307",
  74130. "shortnames": [":city_sunrise:"],
  74131. "category": "travel"
  74132. },
  74133. ":cityscape:": {
  74134. "uc_base": "1f3d9",
  74135. "uc_output": "1f3d9",
  74136. "uc_match": "1f3d9-fe0f",
  74137. "uc_greedy": "1f3d9-fe0f",
  74138. "shortnames": [],
  74139. "category": "travel"
  74140. },
  74141. ":cl:": {
  74142. "uc_base": "1f191",
  74143. "uc_output": "1f191",
  74144. "uc_match": "1f191",
  74145. "uc_greedy": "1f191",
  74146. "shortnames": [],
  74147. "category": "symbols"
  74148. },
  74149. ":clap:": {
  74150. "uc_base": "1f44f",
  74151. "uc_output": "1f44f",
  74152. "uc_match": "1f44f",
  74153. "uc_greedy": "1f44f",
  74154. "shortnames": [],
  74155. "category": "people"
  74156. },
  74157. ":clapper:": {
  74158. "uc_base": "1f3ac",
  74159. "uc_output": "1f3ac",
  74160. "uc_match": "1f3ac-fe0f",
  74161. "uc_greedy": "1f3ac-fe0f",
  74162. "shortnames": [],
  74163. "category": "activity"
  74164. },
  74165. ":classical_building:": {
  74166. "uc_base": "1f3db",
  74167. "uc_output": "1f3db",
  74168. "uc_match": "1f3db-fe0f",
  74169. "uc_greedy": "1f3db-fe0f",
  74170. "shortnames": [],
  74171. "category": "travel"
  74172. },
  74173. ":clipboard:": {
  74174. "uc_base": "1f4cb",
  74175. "uc_output": "1f4cb",
  74176. "uc_match": "1f4cb-fe0f",
  74177. "uc_greedy": "1f4cb-fe0f",
  74178. "shortnames": [],
  74179. "category": "objects"
  74180. },
  74181. ":clock1030:": {
  74182. "uc_base": "1f565",
  74183. "uc_output": "1f565",
  74184. "uc_match": "1f565-fe0f",
  74185. "uc_greedy": "1f565-fe0f",
  74186. "shortnames": [],
  74187. "category": "symbols"
  74188. },
  74189. ":clock10:": {
  74190. "uc_base": "1f559",
  74191. "uc_output": "1f559",
  74192. "uc_match": "1f559-fe0f",
  74193. "uc_greedy": "1f559-fe0f",
  74194. "shortnames": [],
  74195. "category": "symbols"
  74196. },
  74197. ":clock1130:": {
  74198. "uc_base": "1f566",
  74199. "uc_output": "1f566",
  74200. "uc_match": "1f566-fe0f",
  74201. "uc_greedy": "1f566-fe0f",
  74202. "shortnames": [],
  74203. "category": "symbols"
  74204. },
  74205. ":clock11:": {
  74206. "uc_base": "1f55a",
  74207. "uc_output": "1f55a",
  74208. "uc_match": "1f55a-fe0f",
  74209. "uc_greedy": "1f55a-fe0f",
  74210. "shortnames": [],
  74211. "category": "symbols"
  74212. },
  74213. ":clock1230:": {
  74214. "uc_base": "1f567",
  74215. "uc_output": "1f567",
  74216. "uc_match": "1f567-fe0f",
  74217. "uc_greedy": "1f567-fe0f",
  74218. "shortnames": [],
  74219. "category": "symbols"
  74220. },
  74221. ":clock12:": {
  74222. "uc_base": "1f55b",
  74223. "uc_output": "1f55b",
  74224. "uc_match": "1f55b-fe0f",
  74225. "uc_greedy": "1f55b-fe0f",
  74226. "shortnames": [],
  74227. "category": "symbols"
  74228. },
  74229. ":clock130:": {
  74230. "uc_base": "1f55c",
  74231. "uc_output": "1f55c",
  74232. "uc_match": "1f55c-fe0f",
  74233. "uc_greedy": "1f55c-fe0f",
  74234. "shortnames": [],
  74235. "category": "symbols"
  74236. },
  74237. ":clock1:": {
  74238. "uc_base": "1f550",
  74239. "uc_output": "1f550",
  74240. "uc_match": "1f550-fe0f",
  74241. "uc_greedy": "1f550-fe0f",
  74242. "shortnames": [],
  74243. "category": "symbols"
  74244. },
  74245. ":clock230:": {
  74246. "uc_base": "1f55d",
  74247. "uc_output": "1f55d",
  74248. "uc_match": "1f55d-fe0f",
  74249. "uc_greedy": "1f55d-fe0f",
  74250. "shortnames": [],
  74251. "category": "symbols"
  74252. },
  74253. ":clock2:": {
  74254. "uc_base": "1f551",
  74255. "uc_output": "1f551",
  74256. "uc_match": "1f551-fe0f",
  74257. "uc_greedy": "1f551-fe0f",
  74258. "shortnames": [],
  74259. "category": "symbols"
  74260. },
  74261. ":clock330:": {
  74262. "uc_base": "1f55e",
  74263. "uc_output": "1f55e",
  74264. "uc_match": "1f55e-fe0f",
  74265. "uc_greedy": "1f55e-fe0f",
  74266. "shortnames": [],
  74267. "category": "symbols"
  74268. },
  74269. ":clock3:": {
  74270. "uc_base": "1f552",
  74271. "uc_output": "1f552",
  74272. "uc_match": "1f552-fe0f",
  74273. "uc_greedy": "1f552-fe0f",
  74274. "shortnames": [],
  74275. "category": "symbols"
  74276. },
  74277. ":clock430:": {
  74278. "uc_base": "1f55f",
  74279. "uc_output": "1f55f",
  74280. "uc_match": "1f55f-fe0f",
  74281. "uc_greedy": "1f55f-fe0f",
  74282. "shortnames": [],
  74283. "category": "symbols"
  74284. },
  74285. ":clock4:": {
  74286. "uc_base": "1f553",
  74287. "uc_output": "1f553",
  74288. "uc_match": "1f553-fe0f",
  74289. "uc_greedy": "1f553-fe0f",
  74290. "shortnames": [],
  74291. "category": "symbols"
  74292. },
  74293. ":clock530:": {
  74294. "uc_base": "1f560",
  74295. "uc_output": "1f560",
  74296. "uc_match": "1f560-fe0f",
  74297. "uc_greedy": "1f560-fe0f",
  74298. "shortnames": [],
  74299. "category": "symbols"
  74300. },
  74301. ":clock5:": {
  74302. "uc_base": "1f554",
  74303. "uc_output": "1f554",
  74304. "uc_match": "1f554-fe0f",
  74305. "uc_greedy": "1f554-fe0f",
  74306. "shortnames": [],
  74307. "category": "symbols"
  74308. },
  74309. ":clock630:": {
  74310. "uc_base": "1f561",
  74311. "uc_output": "1f561",
  74312. "uc_match": "1f561-fe0f",
  74313. "uc_greedy": "1f561-fe0f",
  74314. "shortnames": [],
  74315. "category": "symbols"
  74316. },
  74317. ":clock6:": {
  74318. "uc_base": "1f555",
  74319. "uc_output": "1f555",
  74320. "uc_match": "1f555-fe0f",
  74321. "uc_greedy": "1f555-fe0f",
  74322. "shortnames": [],
  74323. "category": "symbols"
  74324. },
  74325. ":clock730:": {
  74326. "uc_base": "1f562",
  74327. "uc_output": "1f562",
  74328. "uc_match": "1f562-fe0f",
  74329. "uc_greedy": "1f562-fe0f",
  74330. "shortnames": [],
  74331. "category": "symbols"
  74332. },
  74333. ":clock7:": {
  74334. "uc_base": "1f556",
  74335. "uc_output": "1f556",
  74336. "uc_match": "1f556-fe0f",
  74337. "uc_greedy": "1f556-fe0f",
  74338. "shortnames": [],
  74339. "category": "symbols"
  74340. },
  74341. ":clock830:": {
  74342. "uc_base": "1f563",
  74343. "uc_output": "1f563",
  74344. "uc_match": "1f563-fe0f",
  74345. "uc_greedy": "1f563-fe0f",
  74346. "shortnames": [],
  74347. "category": "symbols"
  74348. },
  74349. ":clock8:": {
  74350. "uc_base": "1f557",
  74351. "uc_output": "1f557",
  74352. "uc_match": "1f557-fe0f",
  74353. "uc_greedy": "1f557-fe0f",
  74354. "shortnames": [],
  74355. "category": "symbols"
  74356. },
  74357. ":clock930:": {
  74358. "uc_base": "1f564",
  74359. "uc_output": "1f564",
  74360. "uc_match": "1f564-fe0f",
  74361. "uc_greedy": "1f564-fe0f",
  74362. "shortnames": [],
  74363. "category": "symbols"
  74364. },
  74365. ":clock9:": {
  74366. "uc_base": "1f558",
  74367. "uc_output": "1f558",
  74368. "uc_match": "1f558-fe0f",
  74369. "uc_greedy": "1f558-fe0f",
  74370. "shortnames": [],
  74371. "category": "symbols"
  74372. },
  74373. ":clock:": {
  74374. "uc_base": "1f570",
  74375. "uc_output": "1f570",
  74376. "uc_match": "1f570-fe0f",
  74377. "uc_greedy": "1f570-fe0f",
  74378. "shortnames": [":mantlepiece_clock:"],
  74379. "category": "objects"
  74380. },
  74381. ":closed_book:": {
  74382. "uc_base": "1f4d5",
  74383. "uc_output": "1f4d5",
  74384. "uc_match": "1f4d5",
  74385. "uc_greedy": "1f4d5",
  74386. "shortnames": [],
  74387. "category": "objects"
  74388. },
  74389. ":closed_lock_with_key:": {
  74390. "uc_base": "1f510",
  74391. "uc_output": "1f510",
  74392. "uc_match": "1f510",
  74393. "uc_greedy": "1f510",
  74394. "shortnames": [],
  74395. "category": "objects"
  74396. },
  74397. ":closed_umbrella:": {
  74398. "uc_base": "1f302",
  74399. "uc_output": "1f302",
  74400. "uc_match": "1f302",
  74401. "uc_greedy": "1f302",
  74402. "shortnames": [],
  74403. "category": "people"
  74404. },
  74405. ":cloud_lightning:": {
  74406. "uc_base": "1f329",
  74407. "uc_output": "1f329",
  74408. "uc_match": "1f329-fe0f",
  74409. "uc_greedy": "1f329-fe0f",
  74410. "shortnames": [":cloud_with_lightning:"],
  74411. "category": "nature"
  74412. },
  74413. ":cloud_rain:": {
  74414. "uc_base": "1f327",
  74415. "uc_output": "1f327",
  74416. "uc_match": "1f327-fe0f",
  74417. "uc_greedy": "1f327-fe0f",
  74418. "shortnames": [":cloud_with_rain:"],
  74419. "category": "nature"
  74420. },
  74421. ":cloud_snow:": {
  74422. "uc_base": "1f328",
  74423. "uc_output": "1f328",
  74424. "uc_match": "1f328-fe0f",
  74425. "uc_greedy": "1f328-fe0f",
  74426. "shortnames": [":cloud_with_snow:"],
  74427. "category": "nature"
  74428. },
  74429. ":cloud_tornado:": {
  74430. "uc_base": "1f32a",
  74431. "uc_output": "1f32a",
  74432. "uc_match": "1f32a-fe0f",
  74433. "uc_greedy": "1f32a-fe0f",
  74434. "shortnames": [":cloud_with_tornado:"],
  74435. "category": "nature"
  74436. },
  74437. ":clown:": {
  74438. "uc_base": "1f921",
  74439. "uc_output": "1f921",
  74440. "uc_match": "1f921",
  74441. "uc_greedy": "1f921",
  74442. "shortnames": [":clown_face:"],
  74443. "category": "people"
  74444. },
  74445. ":coat:": {
  74446. "uc_base": "1f9e5",
  74447. "uc_output": "1f9e5",
  74448. "uc_match": "1f9e5",
  74449. "uc_greedy": "1f9e5",
  74450. "shortnames": [],
  74451. "category": "people"
  74452. },
  74453. ":cocktail:": {
  74454. "uc_base": "1f378",
  74455. "uc_output": "1f378",
  74456. "uc_match": "1f378-fe0f",
  74457. "uc_greedy": "1f378-fe0f",
  74458. "shortnames": [],
  74459. "category": "food"
  74460. },
  74461. ":coconut:": {
  74462. "uc_base": "1f965",
  74463. "uc_output": "1f965",
  74464. "uc_match": "1f965",
  74465. "uc_greedy": "1f965",
  74466. "shortnames": [],
  74467. "category": "food"
  74468. },
  74469. ":cold_sweat:": {
  74470. "uc_base": "1f630",
  74471. "uc_output": "1f630",
  74472. "uc_match": "1f630",
  74473. "uc_greedy": "1f630",
  74474. "shortnames": [],
  74475. "category": "people"
  74476. },
  74477. ":compression:": {
  74478. "uc_base": "1f5dc",
  74479. "uc_output": "1f5dc",
  74480. "uc_match": "1f5dc-fe0f",
  74481. "uc_greedy": "1f5dc-fe0f",
  74482. "shortnames": [],
  74483. "category": "objects"
  74484. },
  74485. ":computer:": {
  74486. "uc_base": "1f4bb",
  74487. "uc_output": "1f4bb",
  74488. "uc_match": "1f4bb-fe0f",
  74489. "uc_greedy": "1f4bb-fe0f",
  74490. "shortnames": [],
  74491. "category": "objects"
  74492. },
  74493. ":confetti_ball:": {
  74494. "uc_base": "1f38a",
  74495. "uc_output": "1f38a",
  74496. "uc_match": "1f38a",
  74497. "uc_greedy": "1f38a",
  74498. "shortnames": [],
  74499. "category": "objects"
  74500. },
  74501. ":confounded:": {
  74502. "uc_base": "1f616",
  74503. "uc_output": "1f616",
  74504. "uc_match": "1f616",
  74505. "uc_greedy": "1f616",
  74506. "shortnames": [],
  74507. "category": "people"
  74508. },
  74509. ":confused:": {
  74510. "uc_base": "1f615",
  74511. "uc_output": "1f615",
  74512. "uc_match": "1f615",
  74513. "uc_greedy": "1f615",
  74514. "shortnames": [],
  74515. "category": "people"
  74516. },
  74517. ":construction:": {
  74518. "uc_base": "1f6a7",
  74519. "uc_output": "1f6a7",
  74520. "uc_match": "1f6a7",
  74521. "uc_greedy": "1f6a7",
  74522. "shortnames": [],
  74523. "category": "travel"
  74524. },
  74525. ":construction_site:": {
  74526. "uc_base": "1f3d7",
  74527. "uc_output": "1f3d7",
  74528. "uc_match": "1f3d7-fe0f",
  74529. "uc_greedy": "1f3d7-fe0f",
  74530. "shortnames": [":building_construction:"],
  74531. "category": "travel"
  74532. },
  74533. ":construction_worker:": {
  74534. "uc_base": "1f477",
  74535. "uc_output": "1f477",
  74536. "uc_match": "1f477",
  74537. "uc_greedy": "1f477",
  74538. "shortnames": [],
  74539. "category": "people"
  74540. },
  74541. ":control_knobs:": {
  74542. "uc_base": "1f39b",
  74543. "uc_output": "1f39b",
  74544. "uc_match": "1f39b-fe0f",
  74545. "uc_greedy": "1f39b-fe0f",
  74546. "shortnames": [],
  74547. "category": "objects"
  74548. },
  74549. ":convenience_store:": {
  74550. "uc_base": "1f3ea",
  74551. "uc_output": "1f3ea",
  74552. "uc_match": "1f3ea",
  74553. "uc_greedy": "1f3ea",
  74554. "shortnames": [],
  74555. "category": "travel"
  74556. },
  74557. ":cookie:": {
  74558. "uc_base": "1f36a",
  74559. "uc_output": "1f36a",
  74560. "uc_match": "1f36a",
  74561. "uc_greedy": "1f36a",
  74562. "shortnames": [],
  74563. "category": "food"
  74564. },
  74565. ":cooking:": {
  74566. "uc_base": "1f373",
  74567. "uc_output": "1f373",
  74568. "uc_match": "1f373",
  74569. "uc_greedy": "1f373",
  74570. "shortnames": [],
  74571. "category": "food"
  74572. },
  74573. ":cool:": {
  74574. "uc_base": "1f192",
  74575. "uc_output": "1f192",
  74576. "uc_match": "1f192",
  74577. "uc_greedy": "1f192",
  74578. "shortnames": [],
  74579. "category": "symbols"
  74580. },
  74581. ":corn:": {
  74582. "uc_base": "1f33d",
  74583. "uc_output": "1f33d",
  74584. "uc_match": "1f33d",
  74585. "uc_greedy": "1f33d",
  74586. "shortnames": [],
  74587. "category": "food"
  74588. },
  74589. ":couch:": {
  74590. "uc_base": "1f6cb",
  74591. "uc_output": "1f6cb",
  74592. "uc_match": "1f6cb-fe0f",
  74593. "uc_greedy": "1f6cb-fe0f",
  74594. "shortnames": [":couch_and_lamp:"],
  74595. "category": "objects"
  74596. },
  74597. ":couple:": {
  74598. "uc_base": "1f46b",
  74599. "uc_output": "1f46b",
  74600. "uc_match": "1f46b",
  74601. "uc_greedy": "1f46b",
  74602. "shortnames": [],
  74603. "category": "people"
  74604. },
  74605. ":couple_with_heart:": {
  74606. "uc_base": "1f491",
  74607. "uc_output": "1f491",
  74608. "uc_match": "1f491",
  74609. "uc_greedy": "1f491",
  74610. "shortnames": [],
  74611. "category": "people"
  74612. },
  74613. ":couplekiss:": {
  74614. "uc_base": "1f48f",
  74615. "uc_output": "1f48f",
  74616. "uc_match": "1f48f",
  74617. "uc_greedy": "1f48f",
  74618. "shortnames": [],
  74619. "category": "people"
  74620. },
  74621. ":cow2:": {
  74622. "uc_base": "1f404",
  74623. "uc_output": "1f404",
  74624. "uc_match": "1f404",
  74625. "uc_greedy": "1f404",
  74626. "shortnames": [],
  74627. "category": "nature"
  74628. },
  74629. ":cow:": {
  74630. "uc_base": "1f42e",
  74631. "uc_output": "1f42e",
  74632. "uc_match": "1f42e",
  74633. "uc_greedy": "1f42e",
  74634. "shortnames": [],
  74635. "category": "nature"
  74636. },
  74637. ":cowboy:": {
  74638. "uc_base": "1f920",
  74639. "uc_output": "1f920",
  74640. "uc_match": "1f920",
  74641. "uc_greedy": "1f920",
  74642. "shortnames": [":face_with_cowboy_hat:"],
  74643. "category": "people"
  74644. },
  74645. ":crab:": {
  74646. "uc_base": "1f980",
  74647. "uc_output": "1f980",
  74648. "uc_match": "1f980",
  74649. "uc_greedy": "1f980",
  74650. "shortnames": [],
  74651. "category": "nature"
  74652. },
  74653. ":crayon:": {
  74654. "uc_base": "1f58d",
  74655. "uc_output": "1f58d",
  74656. "uc_match": "1f58d-fe0f",
  74657. "uc_greedy": "1f58d-fe0f",
  74658. "shortnames": [":lower_left_crayon:"],
  74659. "category": "objects"
  74660. },
  74661. ":crazy_face:": {
  74662. "uc_base": "1f92a",
  74663. "uc_output": "1f92a",
  74664. "uc_match": "1f92a",
  74665. "uc_greedy": "1f92a",
  74666. "shortnames": [],
  74667. "category": "people"
  74668. },
  74669. ":credit_card:": {
  74670. "uc_base": "1f4b3",
  74671. "uc_output": "1f4b3",
  74672. "uc_match": "1f4b3-fe0f",
  74673. "uc_greedy": "1f4b3-fe0f",
  74674. "shortnames": [],
  74675. "category": "objects"
  74676. },
  74677. ":crescent_moon:": {
  74678. "uc_base": "1f319",
  74679. "uc_output": "1f319",
  74680. "uc_match": "1f319",
  74681. "uc_greedy": "1f319",
  74682. "shortnames": [],
  74683. "category": "nature"
  74684. },
  74685. ":cricket:": {
  74686. "uc_base": "1f997",
  74687. "uc_output": "1f997",
  74688. "uc_match": "1f997",
  74689. "uc_greedy": "1f997",
  74690. "shortnames": [],
  74691. "category": "nature"
  74692. },
  74693. ":cricket_game:": {
  74694. "uc_base": "1f3cf",
  74695. "uc_output": "1f3cf",
  74696. "uc_match": "1f3cf",
  74697. "uc_greedy": "1f3cf",
  74698. "shortnames": [":cricket_bat_ball:"],
  74699. "category": "activity"
  74700. },
  74701. ":crocodile:": {
  74702. "uc_base": "1f40a",
  74703. "uc_output": "1f40a",
  74704. "uc_match": "1f40a",
  74705. "uc_greedy": "1f40a",
  74706. "shortnames": [],
  74707. "category": "nature"
  74708. },
  74709. ":croissant:": {
  74710. "uc_base": "1f950",
  74711. "uc_output": "1f950",
  74712. "uc_match": "1f950",
  74713. "uc_greedy": "1f950",
  74714. "shortnames": [],
  74715. "category": "food"
  74716. },
  74717. ":crossed_flags:": {
  74718. "uc_base": "1f38c",
  74719. "uc_output": "1f38c",
  74720. "uc_match": "1f38c",
  74721. "uc_greedy": "1f38c",
  74722. "shortnames": [],
  74723. "category": "flags"
  74724. },
  74725. ":crown:": {
  74726. "uc_base": "1f451",
  74727. "uc_output": "1f451",
  74728. "uc_match": "1f451",
  74729. "uc_greedy": "1f451",
  74730. "shortnames": [],
  74731. "category": "people"
  74732. },
  74733. ":cruise_ship:": {
  74734. "uc_base": "1f6f3",
  74735. "uc_output": "1f6f3",
  74736. "uc_match": "1f6f3-fe0f",
  74737. "uc_greedy": "1f6f3-fe0f",
  74738. "shortnames": [":passenger_ship:"],
  74739. "category": "travel"
  74740. },
  74741. ":cry:": {
  74742. "uc_base": "1f622",
  74743. "uc_output": "1f622",
  74744. "uc_match": "1f622",
  74745. "uc_greedy": "1f622",
  74746. "shortnames": [],
  74747. "category": "people"
  74748. },
  74749. ":crying_cat_face:": {
  74750. "uc_base": "1f63f",
  74751. "uc_output": "1f63f",
  74752. "uc_match": "1f63f",
  74753. "uc_greedy": "1f63f",
  74754. "shortnames": [],
  74755. "category": "people"
  74756. },
  74757. ":crystal_ball:": {
  74758. "uc_base": "1f52e",
  74759. "uc_output": "1f52e",
  74760. "uc_match": "1f52e",
  74761. "uc_greedy": "1f52e",
  74762. "shortnames": [],
  74763. "category": "objects"
  74764. },
  74765. ":cucumber:": {
  74766. "uc_base": "1f952",
  74767. "uc_output": "1f952",
  74768. "uc_match": "1f952",
  74769. "uc_greedy": "1f952",
  74770. "shortnames": [],
  74771. "category": "food"
  74772. },
  74773. ":cup_with_straw:": {
  74774. "uc_base": "1f964",
  74775. "uc_output": "1f964",
  74776. "uc_match": "1f964",
  74777. "uc_greedy": "1f964",
  74778. "shortnames": [],
  74779. "category": "food"
  74780. },
  74781. ":cupid:": {
  74782. "uc_base": "1f498",
  74783. "uc_output": "1f498",
  74784. "uc_match": "1f498",
  74785. "uc_greedy": "1f498",
  74786. "shortnames": [],
  74787. "category": "symbols"
  74788. },
  74789. ":curling_stone:": {
  74790. "uc_base": "1f94c",
  74791. "uc_output": "1f94c",
  74792. "uc_match": "1f94c",
  74793. "uc_greedy": "1f94c",
  74794. "shortnames": [],
  74795. "category": "activity"
  74796. },
  74797. ":currency_exchange:": {
  74798. "uc_base": "1f4b1",
  74799. "uc_output": "1f4b1",
  74800. "uc_match": "1f4b1",
  74801. "uc_greedy": "1f4b1",
  74802. "shortnames": [],
  74803. "category": "symbols"
  74804. },
  74805. ":curry:": {
  74806. "uc_base": "1f35b",
  74807. "uc_output": "1f35b",
  74808. "uc_match": "1f35b",
  74809. "uc_greedy": "1f35b",
  74810. "shortnames": [],
  74811. "category": "food"
  74812. },
  74813. ":custard:": {
  74814. "uc_base": "1f36e",
  74815. "uc_output": "1f36e",
  74816. "uc_match": "1f36e",
  74817. "uc_greedy": "1f36e",
  74818. "shortnames": [":pudding:", ":flan:"],
  74819. "category": "food"
  74820. },
  74821. ":customs:": {
  74822. "uc_base": "1f6c3",
  74823. "uc_output": "1f6c3",
  74824. "uc_match": "1f6c3",
  74825. "uc_greedy": "1f6c3",
  74826. "shortnames": [],
  74827. "category": "symbols"
  74828. },
  74829. ":cut_of_meat:": {
  74830. "uc_base": "1f969",
  74831. "uc_output": "1f969",
  74832. "uc_match": "1f969",
  74833. "uc_greedy": "1f969",
  74834. "shortnames": [],
  74835. "category": "food"
  74836. },
  74837. ":cyclone:": {
  74838. "uc_base": "1f300",
  74839. "uc_output": "1f300",
  74840. "uc_match": "1f300",
  74841. "uc_greedy": "1f300",
  74842. "shortnames": [],
  74843. "category": "symbols"
  74844. },
  74845. ":dagger:": {
  74846. "uc_base": "1f5e1",
  74847. "uc_output": "1f5e1",
  74848. "uc_match": "1f5e1-fe0f",
  74849. "uc_greedy": "1f5e1-fe0f",
  74850. "shortnames": [":dagger_knife:"],
  74851. "category": "objects"
  74852. },
  74853. ":dancer:": {
  74854. "uc_base": "1f483",
  74855. "uc_output": "1f483",
  74856. "uc_match": "1f483",
  74857. "uc_greedy": "1f483",
  74858. "shortnames": [],
  74859. "category": "people"
  74860. },
  74861. ":dango:": {
  74862. "uc_base": "1f361",
  74863. "uc_output": "1f361",
  74864. "uc_match": "1f361",
  74865. "uc_greedy": "1f361",
  74866. "shortnames": [],
  74867. "category": "food"
  74868. },
  74869. ":dark_sunglasses:": {
  74870. "uc_base": "1f576",
  74871. "uc_output": "1f576",
  74872. "uc_match": "1f576-fe0f",
  74873. "uc_greedy": "1f576-fe0f",
  74874. "shortnames": [],
  74875. "category": "people"
  74876. },
  74877. ":dart:": {
  74878. "uc_base": "1f3af",
  74879. "uc_output": "1f3af",
  74880. "uc_match": "1f3af",
  74881. "uc_greedy": "1f3af",
  74882. "shortnames": [],
  74883. "category": "activity"
  74884. },
  74885. ":dash:": {
  74886. "uc_base": "1f4a8",
  74887. "uc_output": "1f4a8",
  74888. "uc_match": "1f4a8",
  74889. "uc_greedy": "1f4a8",
  74890. "shortnames": [],
  74891. "category": "nature"
  74892. },
  74893. ":date:": {
  74894. "uc_base": "1f4c5",
  74895. "uc_output": "1f4c5",
  74896. "uc_match": "1f4c5",
  74897. "uc_greedy": "1f4c5",
  74898. "shortnames": [],
  74899. "category": "objects"
  74900. },
  74901. ":deciduous_tree:": {
  74902. "uc_base": "1f333",
  74903. "uc_output": "1f333",
  74904. "uc_match": "1f333",
  74905. "uc_greedy": "1f333",
  74906. "shortnames": [],
  74907. "category": "nature"
  74908. },
  74909. ":deer:": {
  74910. "uc_base": "1f98c",
  74911. "uc_output": "1f98c",
  74912. "uc_match": "1f98c",
  74913. "uc_greedy": "1f98c",
  74914. "shortnames": [],
  74915. "category": "nature"
  74916. },
  74917. ":department_store:": {
  74918. "uc_base": "1f3ec",
  74919. "uc_output": "1f3ec",
  74920. "uc_match": "1f3ec",
  74921. "uc_greedy": "1f3ec",
  74922. "shortnames": [],
  74923. "category": "travel"
  74924. },
  74925. ":desert:": {
  74926. "uc_base": "1f3dc",
  74927. "uc_output": "1f3dc",
  74928. "uc_match": "1f3dc-fe0f",
  74929. "uc_greedy": "1f3dc-fe0f",
  74930. "shortnames": [],
  74931. "category": "travel"
  74932. },
  74933. ":desktop:": {
  74934. "uc_base": "1f5a5",
  74935. "uc_output": "1f5a5",
  74936. "uc_match": "1f5a5-fe0f",
  74937. "uc_greedy": "1f5a5-fe0f",
  74938. "shortnames": [":desktop_computer:"],
  74939. "category": "objects"
  74940. },
  74941. ":detective:": {
  74942. "uc_base": "1f575",
  74943. "uc_output": "1f575",
  74944. "uc_match": "1f575-fe0f",
  74945. "uc_greedy": "1f575-fe0f",
  74946. "shortnames": [":spy:", ":sleuth_or_spy:"],
  74947. "category": "people"
  74948. },
  74949. ":diamond_shape_with_a_dot_inside:": {
  74950. "uc_base": "1f4a0",
  74951. "uc_output": "1f4a0",
  74952. "uc_match": "1f4a0",
  74953. "uc_greedy": "1f4a0",
  74954. "shortnames": [],
  74955. "category": "symbols"
  74956. },
  74957. ":disappointed:": {
  74958. "uc_base": "1f61e",
  74959. "uc_output": "1f61e",
  74960. "uc_match": "1f61e",
  74961. "uc_greedy": "1f61e",
  74962. "shortnames": [],
  74963. "category": "people"
  74964. },
  74965. ":disappointed_relieved:": {
  74966. "uc_base": "1f625",
  74967. "uc_output": "1f625",
  74968. "uc_match": "1f625",
  74969. "uc_greedy": "1f625",
  74970. "shortnames": [],
  74971. "category": "people"
  74972. },
  74973. ":dividers:": {
  74974. "uc_base": "1f5c2",
  74975. "uc_output": "1f5c2",
  74976. "uc_match": "1f5c2-fe0f",
  74977. "uc_greedy": "1f5c2-fe0f",
  74978. "shortnames": [":card_index_dividers:"],
  74979. "category": "objects"
  74980. },
  74981. ":dizzy:": {
  74982. "uc_base": "1f4ab",
  74983. "uc_output": "1f4ab",
  74984. "uc_match": "1f4ab",
  74985. "uc_greedy": "1f4ab",
  74986. "shortnames": [],
  74987. "category": "nature"
  74988. },
  74989. ":dizzy_face:": {
  74990. "uc_base": "1f635",
  74991. "uc_output": "1f635",
  74992. "uc_match": "1f635",
  74993. "uc_greedy": "1f635",
  74994. "shortnames": [],
  74995. "category": "people"
  74996. },
  74997. ":do_not_litter:": {
  74998. "uc_base": "1f6af",
  74999. "uc_output": "1f6af",
  75000. "uc_match": "1f6af",
  75001. "uc_greedy": "1f6af",
  75002. "shortnames": [],
  75003. "category": "symbols"
  75004. },
  75005. ":dog2:": {
  75006. "uc_base": "1f415",
  75007. "uc_output": "1f415",
  75008. "uc_match": "1f415-fe0f",
  75009. "uc_greedy": "1f415-fe0f",
  75010. "shortnames": [],
  75011. "category": "nature"
  75012. },
  75013. ":dog:": {
  75014. "uc_base": "1f436",
  75015. "uc_output": "1f436",
  75016. "uc_match": "1f436",
  75017. "uc_greedy": "1f436",
  75018. "shortnames": [],
  75019. "category": "nature"
  75020. },
  75021. ":dollar:": {
  75022. "uc_base": "1f4b5",
  75023. "uc_output": "1f4b5",
  75024. "uc_match": "1f4b5",
  75025. "uc_greedy": "1f4b5",
  75026. "shortnames": [],
  75027. "category": "objects"
  75028. },
  75029. ":dolls:": {
  75030. "uc_base": "1f38e",
  75031. "uc_output": "1f38e",
  75032. "uc_match": "1f38e",
  75033. "uc_greedy": "1f38e",
  75034. "shortnames": [],
  75035. "category": "objects"
  75036. },
  75037. ":dolphin:": {
  75038. "uc_base": "1f42c",
  75039. "uc_output": "1f42c",
  75040. "uc_match": "1f42c",
  75041. "uc_greedy": "1f42c",
  75042. "shortnames": [],
  75043. "category": "nature"
  75044. },
  75045. ":door:": {
  75046. "uc_base": "1f6aa",
  75047. "uc_output": "1f6aa",
  75048. "uc_match": "1f6aa",
  75049. "uc_greedy": "1f6aa",
  75050. "shortnames": [],
  75051. "category": "objects"
  75052. },
  75053. ":doughnut:": {
  75054. "uc_base": "1f369",
  75055. "uc_output": "1f369",
  75056. "uc_match": "1f369",
  75057. "uc_greedy": "1f369",
  75058. "shortnames": [],
  75059. "category": "food"
  75060. },
  75061. ":dove:": {
  75062. "uc_base": "1f54a",
  75063. "uc_output": "1f54a",
  75064. "uc_match": "1f54a-fe0f",
  75065. "uc_greedy": "1f54a-fe0f",
  75066. "shortnames": [":dove_of_peace:"],
  75067. "category": "nature"
  75068. },
  75069. ":dragon:": {
  75070. "uc_base": "1f409",
  75071. "uc_output": "1f409",
  75072. "uc_match": "1f409",
  75073. "uc_greedy": "1f409",
  75074. "shortnames": [],
  75075. "category": "nature"
  75076. },
  75077. ":dragon_face:": {
  75078. "uc_base": "1f432",
  75079. "uc_output": "1f432",
  75080. "uc_match": "1f432",
  75081. "uc_greedy": "1f432",
  75082. "shortnames": [],
  75083. "category": "nature"
  75084. },
  75085. ":dress:": {
  75086. "uc_base": "1f457",
  75087. "uc_output": "1f457",
  75088. "uc_match": "1f457",
  75089. "uc_greedy": "1f457",
  75090. "shortnames": [],
  75091. "category": "people"
  75092. },
  75093. ":dromedary_camel:": {
  75094. "uc_base": "1f42a",
  75095. "uc_output": "1f42a",
  75096. "uc_match": "1f42a",
  75097. "uc_greedy": "1f42a",
  75098. "shortnames": [],
  75099. "category": "nature"
  75100. },
  75101. ":drooling_face:": {
  75102. "uc_base": "1f924",
  75103. "uc_output": "1f924",
  75104. "uc_match": "1f924",
  75105. "uc_greedy": "1f924",
  75106. "shortnames": [":drool:"],
  75107. "category": "people"
  75108. },
  75109. ":droplet:": {
  75110. "uc_base": "1f4a7",
  75111. "uc_output": "1f4a7",
  75112. "uc_match": "1f4a7",
  75113. "uc_greedy": "1f4a7",
  75114. "shortnames": [],
  75115. "category": "nature"
  75116. },
  75117. ":drum:": {
  75118. "uc_base": "1f941",
  75119. "uc_output": "1f941",
  75120. "uc_match": "1f941",
  75121. "uc_greedy": "1f941",
  75122. "shortnames": [":drum_with_drumsticks:"],
  75123. "category": "activity"
  75124. },
  75125. ":duck:": {
  75126. "uc_base": "1f986",
  75127. "uc_output": "1f986",
  75128. "uc_match": "1f986",
  75129. "uc_greedy": "1f986",
  75130. "shortnames": [],
  75131. "category": "nature"
  75132. },
  75133. ":dumpling:": {
  75134. "uc_base": "1f95f",
  75135. "uc_output": "1f95f",
  75136. "uc_match": "1f95f",
  75137. "uc_greedy": "1f95f",
  75138. "shortnames": [],
  75139. "category": "food"
  75140. },
  75141. ":dvd:": {
  75142. "uc_base": "1f4c0",
  75143. "uc_output": "1f4c0",
  75144. "uc_match": "1f4c0",
  75145. "uc_greedy": "1f4c0",
  75146. "shortnames": [],
  75147. "category": "objects"
  75148. },
  75149. ":e-mail:": {
  75150. "uc_base": "1f4e7",
  75151. "uc_output": "1f4e7",
  75152. "uc_match": "1f4e7",
  75153. "uc_greedy": "1f4e7",
  75154. "shortnames": [":email:"],
  75155. "category": "objects"
  75156. },
  75157. ":eagle:": {
  75158. "uc_base": "1f985",
  75159. "uc_output": "1f985",
  75160. "uc_match": "1f985",
  75161. "uc_greedy": "1f985",
  75162. "shortnames": [],
  75163. "category": "nature"
  75164. },
  75165. ":ear:": {
  75166. "uc_base": "1f442",
  75167. "uc_output": "1f442",
  75168. "uc_match": "1f442-fe0f",
  75169. "uc_greedy": "1f442-fe0f",
  75170. "shortnames": [],
  75171. "category": "people"
  75172. },
  75173. ":ear_of_rice:": {
  75174. "uc_base": "1f33e",
  75175. "uc_output": "1f33e",
  75176. "uc_match": "1f33e",
  75177. "uc_greedy": "1f33e",
  75178. "shortnames": [],
  75179. "category": "nature"
  75180. },
  75181. ":earth_africa:": {
  75182. "uc_base": "1f30d",
  75183. "uc_output": "1f30d",
  75184. "uc_match": "1f30d-fe0f",
  75185. "uc_greedy": "1f30d-fe0f",
  75186. "shortnames": [],
  75187. "category": "nature"
  75188. },
  75189. ":earth_americas:": {
  75190. "uc_base": "1f30e",
  75191. "uc_output": "1f30e",
  75192. "uc_match": "1f30e-fe0f",
  75193. "uc_greedy": "1f30e-fe0f",
  75194. "shortnames": [],
  75195. "category": "nature"
  75196. },
  75197. ":earth_asia:": {
  75198. "uc_base": "1f30f",
  75199. "uc_output": "1f30f",
  75200. "uc_match": "1f30f-fe0f",
  75201. "uc_greedy": "1f30f-fe0f",
  75202. "shortnames": [],
  75203. "category": "nature"
  75204. },
  75205. ":egg:": {
  75206. "uc_base": "1f95a",
  75207. "uc_output": "1f95a",
  75208. "uc_match": "1f95a",
  75209. "uc_greedy": "1f95a",
  75210. "shortnames": [],
  75211. "category": "food"
  75212. },
  75213. ":eggplant:": {
  75214. "uc_base": "1f346",
  75215. "uc_output": "1f346",
  75216. "uc_match": "1f346",
  75217. "uc_greedy": "1f346",
  75218. "shortnames": [],
  75219. "category": "food"
  75220. },
  75221. ":electric_plug:": {
  75222. "uc_base": "1f50c",
  75223. "uc_output": "1f50c",
  75224. "uc_match": "1f50c",
  75225. "uc_greedy": "1f50c",
  75226. "shortnames": [],
  75227. "category": "objects"
  75228. },
  75229. ":elephant:": {
  75230. "uc_base": "1f418",
  75231. "uc_output": "1f418",
  75232. "uc_match": "1f418",
  75233. "uc_greedy": "1f418",
  75234. "shortnames": [],
  75235. "category": "nature"
  75236. },
  75237. ":elf:": {
  75238. "uc_base": "1f9dd",
  75239. "uc_output": "1f9dd",
  75240. "uc_match": "1f9dd",
  75241. "uc_greedy": "1f9dd",
  75242. "shortnames": [],
  75243. "category": "people"
  75244. },
  75245. ":end:": {
  75246. "uc_base": "1f51a",
  75247. "uc_output": "1f51a",
  75248. "uc_match": "1f51a",
  75249. "uc_greedy": "1f51a",
  75250. "shortnames": [],
  75251. "category": "symbols"
  75252. },
  75253. ":envelope_with_arrow:": {
  75254. "uc_base": "1f4e9",
  75255. "uc_output": "1f4e9",
  75256. "uc_match": "1f4e9",
  75257. "uc_greedy": "1f4e9",
  75258. "shortnames": [],
  75259. "category": "objects"
  75260. },
  75261. ":euro:": {
  75262. "uc_base": "1f4b6",
  75263. "uc_output": "1f4b6",
  75264. "uc_match": "1f4b6",
  75265. "uc_greedy": "1f4b6",
  75266. "shortnames": [],
  75267. "category": "objects"
  75268. },
  75269. ":european_castle:": {
  75270. "uc_base": "1f3f0",
  75271. "uc_output": "1f3f0",
  75272. "uc_match": "1f3f0",
  75273. "uc_greedy": "1f3f0",
  75274. "shortnames": [],
  75275. "category": "travel"
  75276. },
  75277. ":european_post_office:": {
  75278. "uc_base": "1f3e4",
  75279. "uc_output": "1f3e4",
  75280. "uc_match": "1f3e4",
  75281. "uc_greedy": "1f3e4",
  75282. "shortnames": [],
  75283. "category": "travel"
  75284. },
  75285. ":evergreen_tree:": {
  75286. "uc_base": "1f332",
  75287. "uc_output": "1f332",
  75288. "uc_match": "1f332",
  75289. "uc_greedy": "1f332",
  75290. "shortnames": [],
  75291. "category": "nature"
  75292. },
  75293. ":exploding_head:": {
  75294. "uc_base": "1f92f",
  75295. "uc_output": "1f92f",
  75296. "uc_match": "1f92f",
  75297. "uc_greedy": "1f92f",
  75298. "shortnames": [],
  75299. "category": "people"
  75300. },
  75301. ":expressionless:": {
  75302. "uc_base": "1f611",
  75303. "uc_output": "1f611",
  75304. "uc_match": "1f611",
  75305. "uc_greedy": "1f611",
  75306. "shortnames": [],
  75307. "category": "people"
  75308. },
  75309. ":eye:": {
  75310. "uc_base": "1f441",
  75311. "uc_output": "1f441",
  75312. "uc_match": "1f441-fe0f",
  75313. "uc_greedy": "1f441-fe0f",
  75314. "shortnames": [],
  75315. "category": "people"
  75316. },
  75317. ":eyeglasses:": {
  75318. "uc_base": "1f453",
  75319. "uc_output": "1f453",
  75320. "uc_match": "1f453-fe0f",
  75321. "uc_greedy": "1f453-fe0f",
  75322. "shortnames": [],
  75323. "category": "people"
  75324. },
  75325. ":eyes:": {
  75326. "uc_base": "1f440",
  75327. "uc_output": "1f440",
  75328. "uc_match": "1f440",
  75329. "uc_greedy": "1f440",
  75330. "shortnames": [],
  75331. "category": "people"
  75332. },
  75333. ":face_vomiting:": {
  75334. "uc_base": "1f92e",
  75335. "uc_output": "1f92e",
  75336. "uc_match": "1f92e",
  75337. "uc_greedy": "1f92e",
  75338. "shortnames": [],
  75339. "category": "people"
  75340. },
  75341. ":face_with_hand_over_mouth:": {
  75342. "uc_base": "1f92d",
  75343. "uc_output": "1f92d",
  75344. "uc_match": "1f92d",
  75345. "uc_greedy": "1f92d",
  75346. "shortnames": [],
  75347. "category": "people"
  75348. },
  75349. ":face_with_monocle:": {
  75350. "uc_base": "1f9d0",
  75351. "uc_output": "1f9d0",
  75352. "uc_match": "1f9d0",
  75353. "uc_greedy": "1f9d0",
  75354. "shortnames": [],
  75355. "category": "people"
  75356. },
  75357. ":face_with_raised_eyebrow:": {
  75358. "uc_base": "1f928",
  75359. "uc_output": "1f928",
  75360. "uc_match": "1f928",
  75361. "uc_greedy": "1f928",
  75362. "shortnames": [],
  75363. "category": "people"
  75364. },
  75365. ":face_with_symbols_over_mouth:": {
  75366. "uc_base": "1f92c",
  75367. "uc_output": "1f92c",
  75368. "uc_match": "1f92c",
  75369. "uc_greedy": "1f92c",
  75370. "shortnames": [],
  75371. "category": "people"
  75372. },
  75373. ":factory:": {
  75374. "uc_base": "1f3ed",
  75375. "uc_output": "1f3ed",
  75376. "uc_match": "1f3ed-fe0f",
  75377. "uc_greedy": "1f3ed-fe0f",
  75378. "shortnames": [],
  75379. "category": "travel"
  75380. },
  75381. ":fairy:": {
  75382. "uc_base": "1f9da",
  75383. "uc_output": "1f9da",
  75384. "uc_match": "1f9da",
  75385. "uc_greedy": "1f9da",
  75386. "shortnames": [],
  75387. "category": "people"
  75388. },
  75389. ":fallen_leaf:": {
  75390. "uc_base": "1f342",
  75391. "uc_output": "1f342",
  75392. "uc_match": "1f342",
  75393. "uc_greedy": "1f342",
  75394. "shortnames": [],
  75395. "category": "nature"
  75396. },
  75397. ":family:": {
  75398. "uc_base": "1f46a",
  75399. "uc_output": "1f46a",
  75400. "uc_match": "1f46a-fe0f",
  75401. "uc_greedy": "1f46a-fe0f",
  75402. "shortnames": [],
  75403. "category": "people"
  75404. },
  75405. ":fax:": {
  75406. "uc_base": "1f4e0",
  75407. "uc_output": "1f4e0",
  75408. "uc_match": "1f4e0",
  75409. "uc_greedy": "1f4e0",
  75410. "shortnames": [],
  75411. "category": "objects"
  75412. },
  75413. ":fearful:": {
  75414. "uc_base": "1f628",
  75415. "uc_output": "1f628",
  75416. "uc_match": "1f628",
  75417. "uc_greedy": "1f628",
  75418. "shortnames": [],
  75419. "category": "people"
  75420. },
  75421. ":feet:": {
  75422. "uc_base": "1f43e",
  75423. "uc_output": "1f43e",
  75424. "uc_match": "1f43e",
  75425. "uc_greedy": "1f43e",
  75426. "shortnames": [":paw_prints:"],
  75427. "category": "nature"
  75428. },
  75429. ":ferris_wheel:": {
  75430. "uc_base": "1f3a1",
  75431. "uc_output": "1f3a1",
  75432. "uc_match": "1f3a1",
  75433. "uc_greedy": "1f3a1",
  75434. "shortnames": [],
  75435. "category": "travel"
  75436. },
  75437. ":field_hockey:": {
  75438. "uc_base": "1f3d1",
  75439. "uc_output": "1f3d1",
  75440. "uc_match": "1f3d1",
  75441. "uc_greedy": "1f3d1",
  75442. "shortnames": [],
  75443. "category": "activity"
  75444. },
  75445. ":file_cabinet:": {
  75446. "uc_base": "1f5c4",
  75447. "uc_output": "1f5c4",
  75448. "uc_match": "1f5c4-fe0f",
  75449. "uc_greedy": "1f5c4-fe0f",
  75450. "shortnames": [],
  75451. "category": "objects"
  75452. },
  75453. ":file_folder:": {
  75454. "uc_base": "1f4c1",
  75455. "uc_output": "1f4c1",
  75456. "uc_match": "1f4c1",
  75457. "uc_greedy": "1f4c1",
  75458. "shortnames": [],
  75459. "category": "objects"
  75460. },
  75461. ":film_frames:": {
  75462. "uc_base": "1f39e",
  75463. "uc_output": "1f39e",
  75464. "uc_match": "1f39e-fe0f",
  75465. "uc_greedy": "1f39e-fe0f",
  75466. "shortnames": [],
  75467. "category": "objects"
  75468. },
  75469. ":fingers_crossed:": {
  75470. "uc_base": "1f91e",
  75471. "uc_output": "1f91e",
  75472. "uc_match": "1f91e",
  75473. "uc_greedy": "1f91e",
  75474. "shortnames": [":hand_with_index_and_middle_finger_crossed:"],
  75475. "category": "people"
  75476. },
  75477. ":fire:": {
  75478. "uc_base": "1f525",
  75479. "uc_output": "1f525",
  75480. "uc_match": "1f525",
  75481. "uc_greedy": "1f525",
  75482. "shortnames": [":flame:"],
  75483. "category": "nature"
  75484. },
  75485. ":fire_engine:": {
  75486. "uc_base": "1f692",
  75487. "uc_output": "1f692",
  75488. "uc_match": "1f692",
  75489. "uc_greedy": "1f692",
  75490. "shortnames": [],
  75491. "category": "travel"
  75492. },
  75493. ":fireworks:": {
  75494. "uc_base": "1f386",
  75495. "uc_output": "1f386",
  75496. "uc_match": "1f386",
  75497. "uc_greedy": "1f386",
  75498. "shortnames": [],
  75499. "category": "travel"
  75500. },
  75501. ":first_place:": {
  75502. "uc_base": "1f947",
  75503. "uc_output": "1f947",
  75504. "uc_match": "1f947",
  75505. "uc_greedy": "1f947",
  75506. "shortnames": [":first_place_medal:"],
  75507. "category": "activity"
  75508. },
  75509. ":first_quarter_moon:": {
  75510. "uc_base": "1f313",
  75511. "uc_output": "1f313",
  75512. "uc_match": "1f313",
  75513. "uc_greedy": "1f313",
  75514. "shortnames": [],
  75515. "category": "nature"
  75516. },
  75517. ":first_quarter_moon_with_face:": {
  75518. "uc_base": "1f31b",
  75519. "uc_output": "1f31b",
  75520. "uc_match": "1f31b",
  75521. "uc_greedy": "1f31b",
  75522. "shortnames": [],
  75523. "category": "nature"
  75524. },
  75525. ":fish:": {
  75526. "uc_base": "1f41f",
  75527. "uc_output": "1f41f",
  75528. "uc_match": "1f41f-fe0f",
  75529. "uc_greedy": "1f41f-fe0f",
  75530. "shortnames": [],
  75531. "category": "nature"
  75532. },
  75533. ":fish_cake:": {
  75534. "uc_base": "1f365",
  75535. "uc_output": "1f365",
  75536. "uc_match": "1f365",
  75537. "uc_greedy": "1f365",
  75538. "shortnames": [],
  75539. "category": "food"
  75540. },
  75541. ":fishing_pole_and_fish:": {
  75542. "uc_base": "1f3a3",
  75543. "uc_output": "1f3a3",
  75544. "uc_match": "1f3a3",
  75545. "uc_greedy": "1f3a3",
  75546. "shortnames": [],
  75547. "category": "activity"
  75548. },
  75549. ":flag_black:": {
  75550. "uc_base": "1f3f4",
  75551. "uc_output": "1f3f4",
  75552. "uc_match": "1f3f4",
  75553. "uc_greedy": "1f3f4",
  75554. "shortnames": [":waving_black_flag:"],
  75555. "category": "flags"
  75556. },
  75557. ":flag_white:": {
  75558. "uc_base": "1f3f3",
  75559. "uc_output": "1f3f3",
  75560. "uc_match": "1f3f3-fe0f",
  75561. "uc_greedy": "1f3f3-fe0f",
  75562. "shortnames": [":waving_white_flag:"],
  75563. "category": "flags"
  75564. },
  75565. ":flags:": {
  75566. "uc_base": "1f38f",
  75567. "uc_output": "1f38f",
  75568. "uc_match": "1f38f",
  75569. "uc_greedy": "1f38f",
  75570. "shortnames": [],
  75571. "category": "objects"
  75572. },
  75573. ":flashlight:": {
  75574. "uc_base": "1f526",
  75575. "uc_output": "1f526",
  75576. "uc_match": "1f526",
  75577. "uc_greedy": "1f526",
  75578. "shortnames": [],
  75579. "category": "objects"
  75580. },
  75581. ":floppy_disk:": {
  75582. "uc_base": "1f4be",
  75583. "uc_output": "1f4be",
  75584. "uc_match": "1f4be",
  75585. "uc_greedy": "1f4be",
  75586. "shortnames": [],
  75587. "category": "objects"
  75588. },
  75589. ":flower_playing_cards:": {
  75590. "uc_base": "1f3b4",
  75591. "uc_output": "1f3b4",
  75592. "uc_match": "1f3b4",
  75593. "uc_greedy": "1f3b4",
  75594. "shortnames": [],
  75595. "category": "symbols"
  75596. },
  75597. ":flushed:": {
  75598. "uc_base": "1f633",
  75599. "uc_output": "1f633",
  75600. "uc_match": "1f633",
  75601. "uc_greedy": "1f633",
  75602. "shortnames": [],
  75603. "category": "people"
  75604. },
  75605. ":flying_saucer:": {
  75606. "uc_base": "1f6f8",
  75607. "uc_output": "1f6f8",
  75608. "uc_match": "1f6f8",
  75609. "uc_greedy": "1f6f8",
  75610. "shortnames": [],
  75611. "category": "travel"
  75612. },
  75613. ":fog:": {
  75614. "uc_base": "1f32b",
  75615. "uc_output": "1f32b",
  75616. "uc_match": "1f32b-fe0f",
  75617. "uc_greedy": "1f32b-fe0f",
  75618. "shortnames": [],
  75619. "category": "nature"
  75620. },
  75621. ":foggy:": {
  75622. "uc_base": "1f301",
  75623. "uc_output": "1f301",
  75624. "uc_match": "1f301",
  75625. "uc_greedy": "1f301",
  75626. "shortnames": [],
  75627. "category": "travel"
  75628. },
  75629. ":football:": {
  75630. "uc_base": "1f3c8",
  75631. "uc_output": "1f3c8",
  75632. "uc_match": "1f3c8",
  75633. "uc_greedy": "1f3c8",
  75634. "shortnames": [],
  75635. "category": "activity"
  75636. },
  75637. ":footprints:": {
  75638. "uc_base": "1f463",
  75639. "uc_output": "1f463",
  75640. "uc_match": "1f463",
  75641. "uc_greedy": "1f463",
  75642. "shortnames": [],
  75643. "category": "people"
  75644. },
  75645. ":fork_and_knife:": {
  75646. "uc_base": "1f374",
  75647. "uc_output": "1f374",
  75648. "uc_match": "1f374",
  75649. "uc_greedy": "1f374",
  75650. "shortnames": [],
  75651. "category": "food"
  75652. },
  75653. ":fork_knife_plate:": {
  75654. "uc_base": "1f37d",
  75655. "uc_output": "1f37d",
  75656. "uc_match": "1f37d-fe0f",
  75657. "uc_greedy": "1f37d-fe0f",
  75658. "shortnames": [":fork_and_knife_with_plate:"],
  75659. "category": "food"
  75660. },
  75661. ":fortune_cookie:": {
  75662. "uc_base": "1f960",
  75663. "uc_output": "1f960",
  75664. "uc_match": "1f960",
  75665. "uc_greedy": "1f960",
  75666. "shortnames": [],
  75667. "category": "food"
  75668. },
  75669. ":four_leaf_clover:": {
  75670. "uc_base": "1f340",
  75671. "uc_output": "1f340",
  75672. "uc_match": "1f340",
  75673. "uc_greedy": "1f340",
  75674. "shortnames": [],
  75675. "category": "nature"
  75676. },
  75677. ":fox:": {
  75678. "uc_base": "1f98a",
  75679. "uc_output": "1f98a",
  75680. "uc_match": "1f98a",
  75681. "uc_greedy": "1f98a",
  75682. "shortnames": [":fox_face:"],
  75683. "category": "nature"
  75684. },
  75685. ":frame_photo:": {
  75686. "uc_base": "1f5bc",
  75687. "uc_output": "1f5bc",
  75688. "uc_match": "1f5bc-fe0f",
  75689. "uc_greedy": "1f5bc-fe0f",
  75690. "shortnames": [":frame_with_picture:"],
  75691. "category": "objects"
  75692. },
  75693. ":free:": {
  75694. "uc_base": "1f193",
  75695. "uc_output": "1f193",
  75696. "uc_match": "1f193",
  75697. "uc_greedy": "1f193",
  75698. "shortnames": [],
  75699. "category": "symbols"
  75700. },
  75701. ":french_bread:": {
  75702. "uc_base": "1f956",
  75703. "uc_output": "1f956",
  75704. "uc_match": "1f956",
  75705. "uc_greedy": "1f956",
  75706. "shortnames": [":baguette_bread:"],
  75707. "category": "food"
  75708. },
  75709. ":fried_shrimp:": {
  75710. "uc_base": "1f364",
  75711. "uc_output": "1f364",
  75712. "uc_match": "1f364",
  75713. "uc_greedy": "1f364",
  75714. "shortnames": [],
  75715. "category": "food"
  75716. },
  75717. ":fries:": {
  75718. "uc_base": "1f35f",
  75719. "uc_output": "1f35f",
  75720. "uc_match": "1f35f",
  75721. "uc_greedy": "1f35f",
  75722. "shortnames": [],
  75723. "category": "food"
  75724. },
  75725. ":frog:": {
  75726. "uc_base": "1f438",
  75727. "uc_output": "1f438",
  75728. "uc_match": "1f438",
  75729. "uc_greedy": "1f438",
  75730. "shortnames": [],
  75731. "category": "nature"
  75732. },
  75733. ":frowning:": {
  75734. "uc_base": "1f626",
  75735. "uc_output": "1f626",
  75736. "uc_match": "1f626",
  75737. "uc_greedy": "1f626",
  75738. "shortnames": [],
  75739. "category": "people"
  75740. },
  75741. ":full_moon:": {
  75742. "uc_base": "1f315",
  75743. "uc_output": "1f315",
  75744. "uc_match": "1f315-fe0f",
  75745. "uc_greedy": "1f315-fe0f",
  75746. "shortnames": [],
  75747. "category": "nature"
  75748. },
  75749. ":full_moon_with_face:": {
  75750. "uc_base": "1f31d",
  75751. "uc_output": "1f31d",
  75752. "uc_match": "1f31d",
  75753. "uc_greedy": "1f31d",
  75754. "shortnames": [],
  75755. "category": "nature"
  75756. },
  75757. ":game_die:": {
  75758. "uc_base": "1f3b2",
  75759. "uc_output": "1f3b2",
  75760. "uc_match": "1f3b2",
  75761. "uc_greedy": "1f3b2",
  75762. "shortnames": [],
  75763. "category": "activity"
  75764. },
  75765. ":gem:": {
  75766. "uc_base": "1f48e",
  75767. "uc_output": "1f48e",
  75768. "uc_match": "1f48e",
  75769. "uc_greedy": "1f48e",
  75770. "shortnames": [],
  75771. "category": "objects"
  75772. },
  75773. ":genie:": {
  75774. "uc_base": "1f9de",
  75775. "uc_output": "1f9de",
  75776. "uc_match": "1f9de",
  75777. "uc_greedy": "1f9de",
  75778. "shortnames": [],
  75779. "category": "people"
  75780. },
  75781. ":ghost:": {
  75782. "uc_base": "1f47b",
  75783. "uc_output": "1f47b",
  75784. "uc_match": "1f47b",
  75785. "uc_greedy": "1f47b",
  75786. "shortnames": [],
  75787. "category": "people"
  75788. },
  75789. ":gift:": {
  75790. "uc_base": "1f381",
  75791. "uc_output": "1f381",
  75792. "uc_match": "1f381",
  75793. "uc_greedy": "1f381",
  75794. "shortnames": [],
  75795. "category": "objects"
  75796. },
  75797. ":gift_heart:": {
  75798. "uc_base": "1f49d",
  75799. "uc_output": "1f49d",
  75800. "uc_match": "1f49d",
  75801. "uc_greedy": "1f49d",
  75802. "shortnames": [],
  75803. "category": "symbols"
  75804. },
  75805. ":giraffe:": {
  75806. "uc_base": "1f992",
  75807. "uc_output": "1f992",
  75808. "uc_match": "1f992",
  75809. "uc_greedy": "1f992",
  75810. "shortnames": [],
  75811. "category": "nature"
  75812. },
  75813. ":girl:": {
  75814. "uc_base": "1f467",
  75815. "uc_output": "1f467",
  75816. "uc_match": "1f467",
  75817. "uc_greedy": "1f467",
  75818. "shortnames": [],
  75819. "category": "people"
  75820. },
  75821. ":globe_with_meridians:": {
  75822. "uc_base": "1f310",
  75823. "uc_output": "1f310",
  75824. "uc_match": "1f310",
  75825. "uc_greedy": "1f310",
  75826. "shortnames": [],
  75827. "category": "symbols"
  75828. },
  75829. ":gloves:": {
  75830. "uc_base": "1f9e4",
  75831. "uc_output": "1f9e4",
  75832. "uc_match": "1f9e4",
  75833. "uc_greedy": "1f9e4",
  75834. "shortnames": [],
  75835. "category": "people"
  75836. },
  75837. ":goal:": {
  75838. "uc_base": "1f945",
  75839. "uc_output": "1f945",
  75840. "uc_match": "1f945",
  75841. "uc_greedy": "1f945",
  75842. "shortnames": [":goal_net:"],
  75843. "category": "activity"
  75844. },
  75845. ":goat:": {
  75846. "uc_base": "1f410",
  75847. "uc_output": "1f410",
  75848. "uc_match": "1f410",
  75849. "uc_greedy": "1f410",
  75850. "shortnames": [],
  75851. "category": "nature"
  75852. },
  75853. ":gorilla:": {
  75854. "uc_base": "1f98d",
  75855. "uc_output": "1f98d",
  75856. "uc_match": "1f98d",
  75857. "uc_greedy": "1f98d",
  75858. "shortnames": [],
  75859. "category": "nature"
  75860. },
  75861. ":grapes:": {
  75862. "uc_base": "1f347",
  75863. "uc_output": "1f347",
  75864. "uc_match": "1f347",
  75865. "uc_greedy": "1f347",
  75866. "shortnames": [],
  75867. "category": "food"
  75868. },
  75869. ":green_apple:": {
  75870. "uc_base": "1f34f",
  75871. "uc_output": "1f34f",
  75872. "uc_match": "1f34f",
  75873. "uc_greedy": "1f34f",
  75874. "shortnames": [],
  75875. "category": "food"
  75876. },
  75877. ":green_book:": {
  75878. "uc_base": "1f4d7",
  75879. "uc_output": "1f4d7",
  75880. "uc_match": "1f4d7",
  75881. "uc_greedy": "1f4d7",
  75882. "shortnames": [],
  75883. "category": "objects"
  75884. },
  75885. ":green_heart:": {
  75886. "uc_base": "1f49a",
  75887. "uc_output": "1f49a",
  75888. "uc_match": "1f49a",
  75889. "uc_greedy": "1f49a",
  75890. "shortnames": [],
  75891. "category": "symbols"
  75892. },
  75893. ":grimacing:": {
  75894. "uc_base": "1f62c",
  75895. "uc_output": "1f62c",
  75896. "uc_match": "1f62c",
  75897. "uc_greedy": "1f62c",
  75898. "shortnames": [],
  75899. "category": "people"
  75900. },
  75901. ":grin:": {
  75902. "uc_base": "1f601",
  75903. "uc_output": "1f601",
  75904. "uc_match": "1f601",
  75905. "uc_greedy": "1f601",
  75906. "shortnames": [],
  75907. "category": "people"
  75908. },
  75909. ":grinning:": {
  75910. "uc_base": "1f600",
  75911. "uc_output": "1f600",
  75912. "uc_match": "1f600",
  75913. "uc_greedy": "1f600",
  75914. "shortnames": [],
  75915. "category": "people"
  75916. },
  75917. ":guard:": {
  75918. "uc_base": "1f482",
  75919. "uc_output": "1f482",
  75920. "uc_match": "1f482",
  75921. "uc_greedy": "1f482",
  75922. "shortnames": [":guardsman:"],
  75923. "category": "people"
  75924. },
  75925. ":guitar:": {
  75926. "uc_base": "1f3b8",
  75927. "uc_output": "1f3b8",
  75928. "uc_match": "1f3b8",
  75929. "uc_greedy": "1f3b8",
  75930. "shortnames": [],
  75931. "category": "activity"
  75932. },
  75933. ":gun:": {
  75934. "uc_base": "1f52b",
  75935. "uc_output": "1f52b",
  75936. "uc_match": "1f52b",
  75937. "uc_greedy": "1f52b",
  75938. "shortnames": [],
  75939. "category": "objects"
  75940. },
  75941. ":hamburger:": {
  75942. "uc_base": "1f354",
  75943. "uc_output": "1f354",
  75944. "uc_match": "1f354",
  75945. "uc_greedy": "1f354",
  75946. "shortnames": [],
  75947. "category": "food"
  75948. },
  75949. ":hammer:": {
  75950. "uc_base": "1f528",
  75951. "uc_output": "1f528",
  75952. "uc_match": "1f528",
  75953. "uc_greedy": "1f528",
  75954. "shortnames": [],
  75955. "category": "objects"
  75956. },
  75957. ":hamster:": {
  75958. "uc_base": "1f439",
  75959. "uc_output": "1f439",
  75960. "uc_match": "1f439",
  75961. "uc_greedy": "1f439",
  75962. "shortnames": [],
  75963. "category": "nature"
  75964. },
  75965. ":hand_splayed:": {
  75966. "uc_base": "1f590",
  75967. "uc_output": "1f590",
  75968. "uc_match": "1f590-fe0f",
  75969. "uc_greedy": "1f590-fe0f",
  75970. "shortnames": [":raised_hand_with_fingers_splayed:"],
  75971. "category": "people"
  75972. },
  75973. ":handbag:": {
  75974. "uc_base": "1f45c",
  75975. "uc_output": "1f45c",
  75976. "uc_match": "1f45c",
  75977. "uc_greedy": "1f45c",
  75978. "shortnames": [],
  75979. "category": "people"
  75980. },
  75981. ":handshake:": {
  75982. "uc_base": "1f91d",
  75983. "uc_output": "1f91d",
  75984. "uc_match": "1f91d",
  75985. "uc_greedy": "1f91d",
  75986. "shortnames": [":shaking_hands:"],
  75987. "category": "people"
  75988. },
  75989. ":hatched_chick:": {
  75990. "uc_base": "1f425",
  75991. "uc_output": "1f425",
  75992. "uc_match": "1f425",
  75993. "uc_greedy": "1f425",
  75994. "shortnames": [],
  75995. "category": "nature"
  75996. },
  75997. ":hatching_chick:": {
  75998. "uc_base": "1f423",
  75999. "uc_output": "1f423",
  76000. "uc_match": "1f423",
  76001. "uc_greedy": "1f423",
  76002. "shortnames": [],
  76003. "category": "nature"
  76004. },
  76005. ":head_bandage:": {
  76006. "uc_base": "1f915",
  76007. "uc_output": "1f915",
  76008. "uc_match": "1f915",
  76009. "uc_greedy": "1f915",
  76010. "shortnames": [":face_with_head_bandage:"],
  76011. "category": "people"
  76012. },
  76013. ":headphones:": {
  76014. "uc_base": "1f3a7",
  76015. "uc_output": "1f3a7",
  76016. "uc_match": "1f3a7-fe0f",
  76017. "uc_greedy": "1f3a7-fe0f",
  76018. "shortnames": [],
  76019. "category": "activity"
  76020. },
  76021. ":hear_no_evil:": {
  76022. "uc_base": "1f649",
  76023. "uc_output": "1f649",
  76024. "uc_match": "1f649",
  76025. "uc_greedy": "1f649",
  76026. "shortnames": [],
  76027. "category": "nature"
  76028. },
  76029. ":heart_decoration:": {
  76030. "uc_base": "1f49f",
  76031. "uc_output": "1f49f",
  76032. "uc_match": "1f49f",
  76033. "uc_greedy": "1f49f",
  76034. "shortnames": [],
  76035. "category": "symbols"
  76036. },
  76037. ":heart_eyes:": {
  76038. "uc_base": "1f60d",
  76039. "uc_output": "1f60d",
  76040. "uc_match": "1f60d",
  76041. "uc_greedy": "1f60d",
  76042. "shortnames": [],
  76043. "category": "people"
  76044. },
  76045. ":heart_eyes_cat:": {
  76046. "uc_base": "1f63b",
  76047. "uc_output": "1f63b",
  76048. "uc_match": "1f63b",
  76049. "uc_greedy": "1f63b",
  76050. "shortnames": [],
  76051. "category": "people"
  76052. },
  76053. ":heartbeat:": {
  76054. "uc_base": "1f493",
  76055. "uc_output": "1f493",
  76056. "uc_match": "1f493",
  76057. "uc_greedy": "1f493",
  76058. "shortnames": [],
  76059. "category": "symbols"
  76060. },
  76061. ":heartpulse:": {
  76062. "uc_base": "1f497",
  76063. "uc_output": "1f497",
  76064. "uc_match": "1f497",
  76065. "uc_greedy": "1f497",
  76066. "shortnames": [],
  76067. "category": "symbols"
  76068. },
  76069. ":heavy_dollar_sign:": {
  76070. "uc_base": "1f4b2",
  76071. "uc_output": "1f4b2",
  76072. "uc_match": "1f4b2",
  76073. "uc_greedy": "1f4b2",
  76074. "shortnames": [],
  76075. "category": "symbols"
  76076. },
  76077. ":hedgehog:": {
  76078. "uc_base": "1f994",
  76079. "uc_output": "1f994",
  76080. "uc_match": "1f994",
  76081. "uc_greedy": "1f994",
  76082. "shortnames": [],
  76083. "category": "nature"
  76084. },
  76085. ":helicopter:": {
  76086. "uc_base": "1f681",
  76087. "uc_output": "1f681",
  76088. "uc_match": "1f681",
  76089. "uc_greedy": "1f681",
  76090. "shortnames": [],
  76091. "category": "travel"
  76092. },
  76093. ":herb:": {
  76094. "uc_base": "1f33f",
  76095. "uc_output": "1f33f",
  76096. "uc_match": "1f33f",
  76097. "uc_greedy": "1f33f",
  76098. "shortnames": [],
  76099. "category": "nature"
  76100. },
  76101. ":hibiscus:": {
  76102. "uc_base": "1f33a",
  76103. "uc_output": "1f33a",
  76104. "uc_match": "1f33a",
  76105. "uc_greedy": "1f33a",
  76106. "shortnames": [],
  76107. "category": "nature"
  76108. },
  76109. ":high_brightness:": {
  76110. "uc_base": "1f506",
  76111. "uc_output": "1f506",
  76112. "uc_match": "1f506",
  76113. "uc_greedy": "1f506",
  76114. "shortnames": [],
  76115. "category": "symbols"
  76116. },
  76117. ":high_heel:": {
  76118. "uc_base": "1f460",
  76119. "uc_output": "1f460",
  76120. "uc_match": "1f460",
  76121. "uc_greedy": "1f460",
  76122. "shortnames": [],
  76123. "category": "people"
  76124. },
  76125. ":hockey:": {
  76126. "uc_base": "1f3d2",
  76127. "uc_output": "1f3d2",
  76128. "uc_match": "1f3d2",
  76129. "uc_greedy": "1f3d2",
  76130. "shortnames": [],
  76131. "category": "activity"
  76132. },
  76133. ":hole:": {
  76134. "uc_base": "1f573",
  76135. "uc_output": "1f573",
  76136. "uc_match": "1f573-fe0f",
  76137. "uc_greedy": "1f573-fe0f",
  76138. "shortnames": [],
  76139. "category": "objects"
  76140. },
  76141. ":homes:": {
  76142. "uc_base": "1f3d8",
  76143. "uc_output": "1f3d8",
  76144. "uc_match": "1f3d8-fe0f",
  76145. "uc_greedy": "1f3d8-fe0f",
  76146. "shortnames": [":house_buildings:"],
  76147. "category": "travel"
  76148. },
  76149. ":honey_pot:": {
  76150. "uc_base": "1f36f",
  76151. "uc_output": "1f36f",
  76152. "uc_match": "1f36f",
  76153. "uc_greedy": "1f36f",
  76154. "shortnames": [],
  76155. "category": "food"
  76156. },
  76157. ":horse:": {
  76158. "uc_base": "1f434",
  76159. "uc_output": "1f434",
  76160. "uc_match": "1f434",
  76161. "uc_greedy": "1f434",
  76162. "shortnames": [],
  76163. "category": "nature"
  76164. },
  76165. ":horse_racing:": {
  76166. "uc_base": "1f3c7",
  76167. "uc_output": "1f3c7",
  76168. "uc_match": "1f3c7",
  76169. "uc_greedy": "1f3c7",
  76170. "shortnames": [],
  76171. "category": "activity"
  76172. },
  76173. ":hospital:": {
  76174. "uc_base": "1f3e5",
  76175. "uc_output": "1f3e5",
  76176. "uc_match": "1f3e5",
  76177. "uc_greedy": "1f3e5",
  76178. "shortnames": [],
  76179. "category": "travel"
  76180. },
  76181. ":hot_pepper:": {
  76182. "uc_base": "1f336",
  76183. "uc_output": "1f336",
  76184. "uc_match": "1f336-fe0f",
  76185. "uc_greedy": "1f336-fe0f",
  76186. "shortnames": [],
  76187. "category": "food"
  76188. },
  76189. ":hotdog:": {
  76190. "uc_base": "1f32d",
  76191. "uc_output": "1f32d",
  76192. "uc_match": "1f32d",
  76193. "uc_greedy": "1f32d",
  76194. "shortnames": [":hot_dog:"],
  76195. "category": "food"
  76196. },
  76197. ":hotel:": {
  76198. "uc_base": "1f3e8",
  76199. "uc_output": "1f3e8",
  76200. "uc_match": "1f3e8",
  76201. "uc_greedy": "1f3e8",
  76202. "shortnames": [],
  76203. "category": "travel"
  76204. },
  76205. ":house:": {
  76206. "uc_base": "1f3e0",
  76207. "uc_output": "1f3e0",
  76208. "uc_match": "1f3e0-fe0f",
  76209. "uc_greedy": "1f3e0-fe0f",
  76210. "shortnames": [],
  76211. "category": "travel"
  76212. },
  76213. ":house_abandoned:": {
  76214. "uc_base": "1f3da",
  76215. "uc_output": "1f3da",
  76216. "uc_match": "1f3da-fe0f",
  76217. "uc_greedy": "1f3da-fe0f",
  76218. "shortnames": [":derelict_house_building:"],
  76219. "category": "travel"
  76220. },
  76221. ":house_with_garden:": {
  76222. "uc_base": "1f3e1",
  76223. "uc_output": "1f3e1",
  76224. "uc_match": "1f3e1",
  76225. "uc_greedy": "1f3e1",
  76226. "shortnames": [],
  76227. "category": "travel"
  76228. },
  76229. ":hugging:": {
  76230. "uc_base": "1f917",
  76231. "uc_output": "1f917",
  76232. "uc_match": "1f917",
  76233. "uc_greedy": "1f917",
  76234. "shortnames": [":hugging_face:"],
  76235. "category": "people"
  76236. },
  76237. ":hushed:": {
  76238. "uc_base": "1f62f",
  76239. "uc_output": "1f62f",
  76240. "uc_match": "1f62f",
  76241. "uc_greedy": "1f62f",
  76242. "shortnames": [],
  76243. "category": "people"
  76244. },
  76245. ":ice_cream:": {
  76246. "uc_base": "1f368",
  76247. "uc_output": "1f368",
  76248. "uc_match": "1f368",
  76249. "uc_greedy": "1f368",
  76250. "shortnames": [],
  76251. "category": "food"
  76252. },
  76253. ":icecream:": {
  76254. "uc_base": "1f366",
  76255. "uc_output": "1f366",
  76256. "uc_match": "1f366",
  76257. "uc_greedy": "1f366",
  76258. "shortnames": [],
  76259. "category": "food"
  76260. },
  76261. ":id:": {
  76262. "uc_base": "1f194",
  76263. "uc_output": "1f194",
  76264. "uc_match": "1f194",
  76265. "uc_greedy": "1f194",
  76266. "shortnames": [],
  76267. "category": "symbols"
  76268. },
  76269. ":ideograph_advantage:": {
  76270. "uc_base": "1f250",
  76271. "uc_output": "1f250",
  76272. "uc_match": "1f250",
  76273. "uc_greedy": "1f250",
  76274. "shortnames": [],
  76275. "category": "symbols"
  76276. },
  76277. ":imp:": {
  76278. "uc_base": "1f47f",
  76279. "uc_output": "1f47f",
  76280. "uc_match": "1f47f",
  76281. "uc_greedy": "1f47f",
  76282. "shortnames": [],
  76283. "category": "people"
  76284. },
  76285. ":inbox_tray:": {
  76286. "uc_base": "1f4e5",
  76287. "uc_output": "1f4e5",
  76288. "uc_match": "1f4e5-fe0f",
  76289. "uc_greedy": "1f4e5-fe0f",
  76290. "shortnames": [],
  76291. "category": "objects"
  76292. },
  76293. ":incoming_envelope:": {
  76294. "uc_base": "1f4e8",
  76295. "uc_output": "1f4e8",
  76296. "uc_match": "1f4e8",
  76297. "uc_greedy": "1f4e8",
  76298. "shortnames": [],
  76299. "category": "objects"
  76300. },
  76301. ":innocent:": {
  76302. "uc_base": "1f607",
  76303. "uc_output": "1f607",
  76304. "uc_match": "1f607",
  76305. "uc_greedy": "1f607",
  76306. "shortnames": [],
  76307. "category": "people"
  76308. },
  76309. ":iphone:": {
  76310. "uc_base": "1f4f1",
  76311. "uc_output": "1f4f1",
  76312. "uc_match": "1f4f1",
  76313. "uc_greedy": "1f4f1",
  76314. "shortnames": [],
  76315. "category": "objects"
  76316. },
  76317. ":island:": {
  76318. "uc_base": "1f3dd",
  76319. "uc_output": "1f3dd",
  76320. "uc_match": "1f3dd-fe0f",
  76321. "uc_greedy": "1f3dd-fe0f",
  76322. "shortnames": [":desert_island:"],
  76323. "category": "travel"
  76324. },
  76325. ":izakaya_lantern:": {
  76326. "uc_base": "1f3ee",
  76327. "uc_output": "1f3ee",
  76328. "uc_match": "1f3ee",
  76329. "uc_greedy": "1f3ee",
  76330. "shortnames": [],
  76331. "category": "objects"
  76332. },
  76333. ":jack_o_lantern:": {
  76334. "uc_base": "1f383",
  76335. "uc_output": "1f383",
  76336. "uc_match": "1f383",
  76337. "uc_greedy": "1f383",
  76338. "shortnames": [],
  76339. "category": "people"
  76340. },
  76341. ":japan:": {
  76342. "uc_base": "1f5fe",
  76343. "uc_output": "1f5fe",
  76344. "uc_match": "1f5fe",
  76345. "uc_greedy": "1f5fe",
  76346. "shortnames": [],
  76347. "category": "travel"
  76348. },
  76349. ":japanese_castle:": {
  76350. "uc_base": "1f3ef",
  76351. "uc_output": "1f3ef",
  76352. "uc_match": "1f3ef",
  76353. "uc_greedy": "1f3ef",
  76354. "shortnames": [],
  76355. "category": "travel"
  76356. },
  76357. ":japanese_goblin:": {
  76358. "uc_base": "1f47a",
  76359. "uc_output": "1f47a",
  76360. "uc_match": "1f47a",
  76361. "uc_greedy": "1f47a",
  76362. "shortnames": [],
  76363. "category": "people"
  76364. },
  76365. ":japanese_ogre:": {
  76366. "uc_base": "1f479",
  76367. "uc_output": "1f479",
  76368. "uc_match": "1f479",
  76369. "uc_greedy": "1f479",
  76370. "shortnames": [],
  76371. "category": "people"
  76372. },
  76373. ":jeans:": {
  76374. "uc_base": "1f456",
  76375. "uc_output": "1f456",
  76376. "uc_match": "1f456",
  76377. "uc_greedy": "1f456",
  76378. "shortnames": [],
  76379. "category": "people"
  76380. },
  76381. ":joy:": {
  76382. "uc_base": "1f602",
  76383. "uc_output": "1f602",
  76384. "uc_match": "1f602",
  76385. "uc_greedy": "1f602",
  76386. "shortnames": [],
  76387. "category": "people"
  76388. },
  76389. ":joy_cat:": {
  76390. "uc_base": "1f639",
  76391. "uc_output": "1f639",
  76392. "uc_match": "1f639",
  76393. "uc_greedy": "1f639",
  76394. "shortnames": [],
  76395. "category": "people"
  76396. },
  76397. ":joystick:": {
  76398. "uc_base": "1f579",
  76399. "uc_output": "1f579",
  76400. "uc_match": "1f579-fe0f",
  76401. "uc_greedy": "1f579-fe0f",
  76402. "shortnames": [],
  76403. "category": "objects"
  76404. },
  76405. ":kaaba:": {
  76406. "uc_base": "1f54b",
  76407. "uc_output": "1f54b",
  76408. "uc_match": "1f54b",
  76409. "uc_greedy": "1f54b",
  76410. "shortnames": [],
  76411. "category": "travel"
  76412. },
  76413. ":key2:": {
  76414. "uc_base": "1f5dd",
  76415. "uc_output": "1f5dd",
  76416. "uc_match": "1f5dd-fe0f",
  76417. "uc_greedy": "1f5dd",
  76418. "shortnames": [":old_key:"],
  76419. "category": "objects"
  76420. },
  76421. ":key:": {
  76422. "uc_base": "1f511",
  76423. "uc_output": "1f511",
  76424. "uc_match": "1f511",
  76425. "uc_greedy": "1f511",
  76426. "shortnames": [],
  76427. "category": "objects"
  76428. },
  76429. ":keycap_ten:": {
  76430. "uc_base": "1f51f",
  76431. "uc_output": "1f51f",
  76432. "uc_match": "1f51f",
  76433. "uc_greedy": "1f51f",
  76434. "shortnames": [],
  76435. "category": "symbols"
  76436. },
  76437. ":kimono:": {
  76438. "uc_base": "1f458",
  76439. "uc_output": "1f458",
  76440. "uc_match": "1f458",
  76441. "uc_greedy": "1f458",
  76442. "shortnames": [],
  76443. "category": "people"
  76444. },
  76445. ":kiss:": {
  76446. "uc_base": "1f48b",
  76447. "uc_output": "1f48b",
  76448. "uc_match": "1f48b",
  76449. "uc_greedy": "1f48b",
  76450. "shortnames": [],
  76451. "category": "people"
  76452. },
  76453. ":kissing:": {
  76454. "uc_base": "1f617",
  76455. "uc_output": "1f617",
  76456. "uc_match": "1f617",
  76457. "uc_greedy": "1f617",
  76458. "shortnames": [],
  76459. "category": "people"
  76460. },
  76461. ":kissing_cat:": {
  76462. "uc_base": "1f63d",
  76463. "uc_output": "1f63d",
  76464. "uc_match": "1f63d",
  76465. "uc_greedy": "1f63d",
  76466. "shortnames": [],
  76467. "category": "people"
  76468. },
  76469. ":kissing_closed_eyes:": {
  76470. "uc_base": "1f61a",
  76471. "uc_output": "1f61a",
  76472. "uc_match": "1f61a",
  76473. "uc_greedy": "1f61a",
  76474. "shortnames": [],
  76475. "category": "people"
  76476. },
  76477. ":kissing_heart:": {
  76478. "uc_base": "1f618",
  76479. "uc_output": "1f618",
  76480. "uc_match": "1f618",
  76481. "uc_greedy": "1f618",
  76482. "shortnames": [],
  76483. "category": "people"
  76484. },
  76485. ":kissing_smiling_eyes:": {
  76486. "uc_base": "1f619",
  76487. "uc_output": "1f619",
  76488. "uc_match": "1f619",
  76489. "uc_greedy": "1f619",
  76490. "shortnames": [],
  76491. "category": "people"
  76492. },
  76493. ":kiwi:": {
  76494. "uc_base": "1f95d",
  76495. "uc_output": "1f95d",
  76496. "uc_match": "1f95d",
  76497. "uc_greedy": "1f95d",
  76498. "shortnames": [":kiwifruit:"],
  76499. "category": "food"
  76500. },
  76501. ":knife:": {
  76502. "uc_base": "1f52a",
  76503. "uc_output": "1f52a",
  76504. "uc_match": "1f52a",
  76505. "uc_greedy": "1f52a",
  76506. "shortnames": [],
  76507. "category": "objects"
  76508. },
  76509. ":koala:": {
  76510. "uc_base": "1f428",
  76511. "uc_output": "1f428",
  76512. "uc_match": "1f428",
  76513. "uc_greedy": "1f428",
  76514. "shortnames": [],
  76515. "category": "nature"
  76516. },
  76517. ":koko:": {
  76518. "uc_base": "1f201",
  76519. "uc_output": "1f201",
  76520. "uc_match": "1f201",
  76521. "uc_greedy": "1f201",
  76522. "shortnames": [],
  76523. "category": "symbols"
  76524. },
  76525. ":label:": {
  76526. "uc_base": "1f3f7",
  76527. "uc_output": "1f3f7",
  76528. "uc_match": "1f3f7-fe0f",
  76529. "uc_greedy": "1f3f7-fe0f",
  76530. "shortnames": [],
  76531. "category": "objects"
  76532. },
  76533. ":large_blue_diamond:": {
  76534. "uc_base": "1f537",
  76535. "uc_output": "1f537",
  76536. "uc_match": "1f537",
  76537. "uc_greedy": "1f537",
  76538. "shortnames": [],
  76539. "category": "symbols"
  76540. },
  76541. ":large_orange_diamond:": {
  76542. "uc_base": "1f536",
  76543. "uc_output": "1f536",
  76544. "uc_match": "1f536",
  76545. "uc_greedy": "1f536",
  76546. "shortnames": [],
  76547. "category": "symbols"
  76548. },
  76549. ":last_quarter_moon:": {
  76550. "uc_base": "1f317",
  76551. "uc_output": "1f317",
  76552. "uc_match": "1f317",
  76553. "uc_greedy": "1f317",
  76554. "shortnames": [],
  76555. "category": "nature"
  76556. },
  76557. ":last_quarter_moon_with_face:": {
  76558. "uc_base": "1f31c",
  76559. "uc_output": "1f31c",
  76560. "uc_match": "1f31c-fe0f",
  76561. "uc_greedy": "1f31c-fe0f",
  76562. "shortnames": [],
  76563. "category": "nature"
  76564. },
  76565. ":laughing:": {
  76566. "uc_base": "1f606",
  76567. "uc_output": "1f606",
  76568. "uc_match": "1f606",
  76569. "uc_greedy": "1f606",
  76570. "shortnames": [":satisfied:"],
  76571. "category": "people"
  76572. },
  76573. ":leaves:": {
  76574. "uc_base": "1f343",
  76575. "uc_output": "1f343",
  76576. "uc_match": "1f343",
  76577. "uc_greedy": "1f343",
  76578. "shortnames": [],
  76579. "category": "nature"
  76580. },
  76581. ":ledger:": {
  76582. "uc_base": "1f4d2",
  76583. "uc_output": "1f4d2",
  76584. "uc_match": "1f4d2",
  76585. "uc_greedy": "1f4d2",
  76586. "shortnames": [],
  76587. "category": "objects"
  76588. },
  76589. ":left_facing_fist:": {
  76590. "uc_base": "1f91b",
  76591. "uc_output": "1f91b",
  76592. "uc_match": "1f91b",
  76593. "uc_greedy": "1f91b",
  76594. "shortnames": [":left_fist:"],
  76595. "category": "people"
  76596. },
  76597. ":left_luggage:": {
  76598. "uc_base": "1f6c5",
  76599. "uc_output": "1f6c5",
  76600. "uc_match": "1f6c5",
  76601. "uc_greedy": "1f6c5",
  76602. "shortnames": [],
  76603. "category": "symbols"
  76604. },
  76605. ":lemon:": {
  76606. "uc_base": "1f34b",
  76607. "uc_output": "1f34b",
  76608. "uc_match": "1f34b",
  76609. "uc_greedy": "1f34b",
  76610. "shortnames": [],
  76611. "category": "food"
  76612. },
  76613. ":leopard:": {
  76614. "uc_base": "1f406",
  76615. "uc_output": "1f406",
  76616. "uc_match": "1f406",
  76617. "uc_greedy": "1f406",
  76618. "shortnames": [],
  76619. "category": "nature"
  76620. },
  76621. ":level_slider:": {
  76622. "uc_base": "1f39a",
  76623. "uc_output": "1f39a",
  76624. "uc_match": "1f39a-fe0f",
  76625. "uc_greedy": "1f39a-fe0f",
  76626. "shortnames": [],
  76627. "category": "objects"
  76628. },
  76629. ":levitate:": {
  76630. "uc_base": "1f574",
  76631. "uc_output": "1f574",
  76632. "uc_match": "1f574-fe0f",
  76633. "uc_greedy": "1f574-fe0f",
  76634. "shortnames": [":man_in_business_suit_levitating:"],
  76635. "category": "people"
  76636. },
  76637. ":light_rail:": {
  76638. "uc_base": "1f688",
  76639. "uc_output": "1f688",
  76640. "uc_match": "1f688",
  76641. "uc_greedy": "1f688",
  76642. "shortnames": [],
  76643. "category": "travel"
  76644. },
  76645. ":link:": {
  76646. "uc_base": "1f517",
  76647. "uc_output": "1f517",
  76648. "uc_match": "1f517",
  76649. "uc_greedy": "1f517",
  76650. "shortnames": [],
  76651. "category": "objects"
  76652. },
  76653. ":lion_face:": {
  76654. "uc_base": "1f981",
  76655. "uc_output": "1f981",
  76656. "uc_match": "1f981",
  76657. "uc_greedy": "1f981",
  76658. "shortnames": [":lion:"],
  76659. "category": "nature"
  76660. },
  76661. ":lips:": {
  76662. "uc_base": "1f444",
  76663. "uc_output": "1f444",
  76664. "uc_match": "1f444",
  76665. "uc_greedy": "1f444",
  76666. "shortnames": [],
  76667. "category": "people"
  76668. },
  76669. ":lipstick:": {
  76670. "uc_base": "1f484",
  76671. "uc_output": "1f484",
  76672. "uc_match": "1f484",
  76673. "uc_greedy": "1f484",
  76674. "shortnames": [],
  76675. "category": "people"
  76676. },
  76677. ":lizard:": {
  76678. "uc_base": "1f98e",
  76679. "uc_output": "1f98e",
  76680. "uc_match": "1f98e",
  76681. "uc_greedy": "1f98e",
  76682. "shortnames": [],
  76683. "category": "nature"
  76684. },
  76685. ":lock:": {
  76686. "uc_base": "1f512",
  76687. "uc_output": "1f512",
  76688. "uc_match": "1f512-fe0f",
  76689. "uc_greedy": "1f512-fe0f",
  76690. "shortnames": [],
  76691. "category": "objects"
  76692. },
  76693. ":lock_with_ink_pen:": {
  76694. "uc_base": "1f50f",
  76695. "uc_output": "1f50f",
  76696. "uc_match": "1f50f",
  76697. "uc_greedy": "1f50f",
  76698. "shortnames": [],
  76699. "category": "objects"
  76700. },
  76701. ":lollipop:": {
  76702. "uc_base": "1f36d",
  76703. "uc_output": "1f36d",
  76704. "uc_match": "1f36d",
  76705. "uc_greedy": "1f36d",
  76706. "shortnames": [],
  76707. "category": "food"
  76708. },
  76709. ":loud_sound:": {
  76710. "uc_base": "1f50a",
  76711. "uc_output": "1f50a",
  76712. "uc_match": "1f50a",
  76713. "uc_greedy": "1f50a",
  76714. "shortnames": [],
  76715. "category": "symbols"
  76716. },
  76717. ":loudspeaker:": {
  76718. "uc_base": "1f4e2",
  76719. "uc_output": "1f4e2",
  76720. "uc_match": "1f4e2",
  76721. "uc_greedy": "1f4e2",
  76722. "shortnames": [],
  76723. "category": "symbols"
  76724. },
  76725. ":love_hotel:": {
  76726. "uc_base": "1f3e9",
  76727. "uc_output": "1f3e9",
  76728. "uc_match": "1f3e9",
  76729. "uc_greedy": "1f3e9",
  76730. "shortnames": [],
  76731. "category": "travel"
  76732. },
  76733. ":love_letter:": {
  76734. "uc_base": "1f48c",
  76735. "uc_output": "1f48c",
  76736. "uc_match": "1f48c",
  76737. "uc_greedy": "1f48c",
  76738. "shortnames": [],
  76739. "category": "objects"
  76740. },
  76741. ":love_you_gesture:": {
  76742. "uc_base": "1f91f",
  76743. "uc_output": "1f91f",
  76744. "uc_match": "1f91f",
  76745. "uc_greedy": "1f91f",
  76746. "shortnames": [],
  76747. "category": "people"
  76748. },
  76749. ":low_brightness:": {
  76750. "uc_base": "1f505",
  76751. "uc_output": "1f505",
  76752. "uc_match": "1f505",
  76753. "uc_greedy": "1f505",
  76754. "shortnames": [],
  76755. "category": "symbols"
  76756. },
  76757. ":lying_face:": {
  76758. "uc_base": "1f925",
  76759. "uc_output": "1f925",
  76760. "uc_match": "1f925",
  76761. "uc_greedy": "1f925",
  76762. "shortnames": [":liar:"],
  76763. "category": "people"
  76764. },
  76765. ":mag:": {
  76766. "uc_base": "1f50d",
  76767. "uc_output": "1f50d",
  76768. "uc_match": "1f50d-fe0f",
  76769. "uc_greedy": "1f50d-fe0f",
  76770. "shortnames": [],
  76771. "category": "objects"
  76772. },
  76773. ":mag_right:": {
  76774. "uc_base": "1f50e",
  76775. "uc_output": "1f50e",
  76776. "uc_match": "1f50e",
  76777. "uc_greedy": "1f50e",
  76778. "shortnames": [],
  76779. "category": "objects"
  76780. },
  76781. ":mage:": {
  76782. "uc_base": "1f9d9",
  76783. "uc_output": "1f9d9",
  76784. "uc_match": "1f9d9",
  76785. "uc_greedy": "1f9d9",
  76786. "shortnames": [],
  76787. "category": "people"
  76788. },
  76789. ":mahjong:": {
  76790. "uc_base": "1f004",
  76791. "uc_output": "1f004",
  76792. "uc_match": "1f004-fe0f",
  76793. "uc_greedy": "1f004-fe0f",
  76794. "shortnames": [],
  76795. "category": "symbols"
  76796. },
  76797. ":mailbox:": {
  76798. "uc_base": "1f4eb",
  76799. "uc_output": "1f4eb",
  76800. "uc_match": "1f4eb-fe0f",
  76801. "uc_greedy": "1f4eb-fe0f",
  76802. "shortnames": [],
  76803. "category": "objects"
  76804. },
  76805. ":mailbox_closed:": {
  76806. "uc_base": "1f4ea",
  76807. "uc_output": "1f4ea",
  76808. "uc_match": "1f4ea-fe0f",
  76809. "uc_greedy": "1f4ea-fe0f",
  76810. "shortnames": [],
  76811. "category": "objects"
  76812. },
  76813. ":mailbox_with_mail:": {
  76814. "uc_base": "1f4ec",
  76815. "uc_output": "1f4ec",
  76816. "uc_match": "1f4ec-fe0f",
  76817. "uc_greedy": "1f4ec-fe0f",
  76818. "shortnames": [],
  76819. "category": "objects"
  76820. },
  76821. ":mailbox_with_no_mail:": {
  76822. "uc_base": "1f4ed",
  76823. "uc_output": "1f4ed",
  76824. "uc_match": "1f4ed-fe0f",
  76825. "uc_greedy": "1f4ed-fe0f",
  76826. "shortnames": [],
  76827. "category": "objects"
  76828. },
  76829. ":man:": {
  76830. "uc_base": "1f468",
  76831. "uc_output": "1f468",
  76832. "uc_match": "1f468",
  76833. "uc_greedy": "1f468",
  76834. "shortnames": [],
  76835. "category": "people"
  76836. },
  76837. ":man_dancing:": {
  76838. "uc_base": "1f57a",
  76839. "uc_output": "1f57a",
  76840. "uc_match": "1f57a",
  76841. "uc_greedy": "1f57a",
  76842. "shortnames": [":male_dancer:"],
  76843. "category": "people"
  76844. },
  76845. ":man_in_tuxedo:": {
  76846. "uc_base": "1f935",
  76847. "uc_output": "1f935",
  76848. "uc_match": "1f935",
  76849. "uc_greedy": "1f935",
  76850. "shortnames": [],
  76851. "category": "people"
  76852. },
  76853. ":man_with_chinese_cap:": {
  76854. "uc_base": "1f472",
  76855. "uc_output": "1f472",
  76856. "uc_match": "1f472",
  76857. "uc_greedy": "1f472",
  76858. "shortnames": [":man_with_gua_pi_mao:"],
  76859. "category": "people"
  76860. },
  76861. ":mans_shoe:": {
  76862. "uc_base": "1f45e",
  76863. "uc_output": "1f45e",
  76864. "uc_match": "1f45e",
  76865. "uc_greedy": "1f45e",
  76866. "shortnames": [],
  76867. "category": "people"
  76868. },
  76869. ":map:": {
  76870. "uc_base": "1f5fa",
  76871. "uc_output": "1f5fa",
  76872. "uc_match": "1f5fa-fe0f",
  76873. "uc_greedy": "1f5fa-fe0f",
  76874. "shortnames": [":world_map:"],
  76875. "category": "travel"
  76876. },
  76877. ":maple_leaf:": {
  76878. "uc_base": "1f341",
  76879. "uc_output": "1f341",
  76880. "uc_match": "1f341",
  76881. "uc_greedy": "1f341",
  76882. "shortnames": [],
  76883. "category": "nature"
  76884. },
  76885. ":martial_arts_uniform:": {
  76886. "uc_base": "1f94b",
  76887. "uc_output": "1f94b",
  76888. "uc_match": "1f94b",
  76889. "uc_greedy": "1f94b",
  76890. "shortnames": [":karate_uniform:"],
  76891. "category": "activity"
  76892. },
  76893. ":mask:": {
  76894. "uc_base": "1f637",
  76895. "uc_output": "1f637",
  76896. "uc_match": "1f637",
  76897. "uc_greedy": "1f637",
  76898. "shortnames": [],
  76899. "category": "people"
  76900. },
  76901. ":meat_on_bone:": {
  76902. "uc_base": "1f356",
  76903. "uc_output": "1f356",
  76904. "uc_match": "1f356",
  76905. "uc_greedy": "1f356",
  76906. "shortnames": [],
  76907. "category": "food"
  76908. },
  76909. ":medal:": {
  76910. "uc_base": "1f3c5",
  76911. "uc_output": "1f3c5",
  76912. "uc_match": "1f3c5",
  76913. "uc_greedy": "1f3c5",
  76914. "shortnames": [":sports_medal:"],
  76915. "category": "activity"
  76916. },
  76917. ":mega:": {
  76918. "uc_base": "1f4e3",
  76919. "uc_output": "1f4e3",
  76920. "uc_match": "1f4e3",
  76921. "uc_greedy": "1f4e3",
  76922. "shortnames": [],
  76923. "category": "symbols"
  76924. },
  76925. ":melon:": {
  76926. "uc_base": "1f348",
  76927. "uc_output": "1f348",
  76928. "uc_match": "1f348",
  76929. "uc_greedy": "1f348",
  76930. "shortnames": [],
  76931. "category": "food"
  76932. },
  76933. ":menorah:": {
  76934. "uc_base": "1f54e",
  76935. "uc_output": "1f54e",
  76936. "uc_match": "1f54e",
  76937. "uc_greedy": "1f54e",
  76938. "shortnames": [],
  76939. "category": "symbols"
  76940. },
  76941. ":mens:": {
  76942. "uc_base": "1f6b9",
  76943. "uc_output": "1f6b9",
  76944. "uc_match": "1f6b9-fe0f",
  76945. "uc_greedy": "1f6b9-fe0f",
  76946. "shortnames": [],
  76947. "category": "symbols"
  76948. },
  76949. ":merperson:": {
  76950. "uc_base": "1f9dc",
  76951. "uc_output": "1f9dc",
  76952. "uc_match": "1f9dc",
  76953. "uc_greedy": "1f9dc",
  76954. "shortnames": [],
  76955. "category": "people"
  76956. },
  76957. ":metal:": {
  76958. "uc_base": "1f918",
  76959. "uc_output": "1f918",
  76960. "uc_match": "1f918",
  76961. "uc_greedy": "1f918",
  76962. "shortnames": [":sign_of_the_horns:"],
  76963. "category": "people"
  76964. },
  76965. ":metro:": {
  76966. "uc_base": "1f687",
  76967. "uc_output": "1f687",
  76968. "uc_match": "1f687-fe0f",
  76969. "uc_greedy": "1f687-fe0f",
  76970. "shortnames": [],
  76971. "category": "travel"
  76972. },
  76973. ":microphone2:": {
  76974. "uc_base": "1f399",
  76975. "uc_output": "1f399",
  76976. "uc_match": "1f399-fe0f",
  76977. "uc_greedy": "1f399-fe0f",
  76978. "shortnames": [":studio_microphone:"],
  76979. "category": "objects"
  76980. },
  76981. ":microphone:": {
  76982. "uc_base": "1f3a4",
  76983. "uc_output": "1f3a4",
  76984. "uc_match": "1f3a4",
  76985. "uc_greedy": "1f3a4",
  76986. "shortnames": [],
  76987. "category": "activity"
  76988. },
  76989. ":microscope:": {
  76990. "uc_base": "1f52c",
  76991. "uc_output": "1f52c",
  76992. "uc_match": "1f52c",
  76993. "uc_greedy": "1f52c",
  76994. "shortnames": [],
  76995. "category": "objects"
  76996. },
  76997. ":middle_finger:": {
  76998. "uc_base": "1f595",
  76999. "uc_output": "1f595",
  77000. "uc_match": "1f595",
  77001. "uc_greedy": "1f595",
  77002. "shortnames": [":reversed_hand_with_middle_finger_extended:"],
  77003. "category": "people"
  77004. },
  77005. ":military_medal:": {
  77006. "uc_base": "1f396",
  77007. "uc_output": "1f396",
  77008. "uc_match": "1f396-fe0f",
  77009. "uc_greedy": "1f396-fe0f",
  77010. "shortnames": [],
  77011. "category": "activity"
  77012. },
  77013. ":milk:": {
  77014. "uc_base": "1f95b",
  77015. "uc_output": "1f95b",
  77016. "uc_match": "1f95b",
  77017. "uc_greedy": "1f95b",
  77018. "shortnames": [":glass_of_milk:"],
  77019. "category": "food"
  77020. },
  77021. ":milky_way:": {
  77022. "uc_base": "1f30c",
  77023. "uc_output": "1f30c",
  77024. "uc_match": "1f30c",
  77025. "uc_greedy": "1f30c",
  77026. "shortnames": [],
  77027. "category": "travel"
  77028. },
  77029. ":minibus:": {
  77030. "uc_base": "1f690",
  77031. "uc_output": "1f690",
  77032. "uc_match": "1f690",
  77033. "uc_greedy": "1f690",
  77034. "shortnames": [],
  77035. "category": "travel"
  77036. },
  77037. ":minidisc:": {
  77038. "uc_base": "1f4bd",
  77039. "uc_output": "1f4bd",
  77040. "uc_match": "1f4bd",
  77041. "uc_greedy": "1f4bd",
  77042. "shortnames": [],
  77043. "category": "objects"
  77044. },
  77045. ":mobile_phone_off:": {
  77046. "uc_base": "1f4f4",
  77047. "uc_output": "1f4f4",
  77048. "uc_match": "1f4f4",
  77049. "uc_greedy": "1f4f4",
  77050. "shortnames": [],
  77051. "category": "symbols"
  77052. },
  77053. ":money_mouth:": {
  77054. "uc_base": "1f911",
  77055. "uc_output": "1f911",
  77056. "uc_match": "1f911",
  77057. "uc_greedy": "1f911",
  77058. "shortnames": [":money_mouth_face:"],
  77059. "category": "people"
  77060. },
  77061. ":money_with_wings:": {
  77062. "uc_base": "1f4b8",
  77063. "uc_output": "1f4b8",
  77064. "uc_match": "1f4b8",
  77065. "uc_greedy": "1f4b8",
  77066. "shortnames": [],
  77067. "category": "objects"
  77068. },
  77069. ":moneybag:": {
  77070. "uc_base": "1f4b0",
  77071. "uc_output": "1f4b0",
  77072. "uc_match": "1f4b0-fe0f",
  77073. "uc_greedy": "1f4b0-fe0f",
  77074. "shortnames": [],
  77075. "category": "objects"
  77076. },
  77077. ":monkey:": {
  77078. "uc_base": "1f412",
  77079. "uc_output": "1f412",
  77080. "uc_match": "1f412",
  77081. "uc_greedy": "1f412",
  77082. "shortnames": [],
  77083. "category": "nature"
  77084. },
  77085. ":monkey_face:": {
  77086. "uc_base": "1f435",
  77087. "uc_output": "1f435",
  77088. "uc_match": "1f435",
  77089. "uc_greedy": "1f435",
  77090. "shortnames": [],
  77091. "category": "nature"
  77092. },
  77093. ":monorail:": {
  77094. "uc_base": "1f69d",
  77095. "uc_output": "1f69d",
  77096. "uc_match": "1f69d",
  77097. "uc_greedy": "1f69d",
  77098. "shortnames": [],
  77099. "category": "travel"
  77100. },
  77101. ":mortar_board:": {
  77102. "uc_base": "1f393",
  77103. "uc_output": "1f393",
  77104. "uc_match": "1f393-fe0f",
  77105. "uc_greedy": "1f393-fe0f",
  77106. "shortnames": [],
  77107. "category": "people"
  77108. },
  77109. ":mosque:": {
  77110. "uc_base": "1f54c",
  77111. "uc_output": "1f54c",
  77112. "uc_match": "1f54c",
  77113. "uc_greedy": "1f54c",
  77114. "shortnames": [],
  77115. "category": "travel"
  77116. },
  77117. ":motor_scooter:": {
  77118. "uc_base": "1f6f5",
  77119. "uc_output": "1f6f5",
  77120. "uc_match": "1f6f5",
  77121. "uc_greedy": "1f6f5",
  77122. "shortnames": [":motorbike:"],
  77123. "category": "travel"
  77124. },
  77125. ":motorboat:": {
  77126. "uc_base": "1f6e5",
  77127. "uc_output": "1f6e5",
  77128. "uc_match": "1f6e5-fe0f",
  77129. "uc_greedy": "1f6e5-fe0f",
  77130. "shortnames": [],
  77131. "category": "travel"
  77132. },
  77133. ":motorcycle:": {
  77134. "uc_base": "1f3cd",
  77135. "uc_output": "1f3cd",
  77136. "uc_match": "1f3cd-fe0f",
  77137. "uc_greedy": "1f3cd-fe0f",
  77138. "shortnames": [":racing_motorcycle:"],
  77139. "category": "travel"
  77140. },
  77141. ":motorway:": {
  77142. "uc_base": "1f6e3",
  77143. "uc_output": "1f6e3",
  77144. "uc_match": "1f6e3-fe0f",
  77145. "uc_greedy": "1f6e3-fe0f",
  77146. "shortnames": [],
  77147. "category": "travel"
  77148. },
  77149. ":mount_fuji:": {
  77150. "uc_base": "1f5fb",
  77151. "uc_output": "1f5fb",
  77152. "uc_match": "1f5fb",
  77153. "uc_greedy": "1f5fb",
  77154. "shortnames": [],
  77155. "category": "travel"
  77156. },
  77157. ":mountain_cableway:": {
  77158. "uc_base": "1f6a0",
  77159. "uc_output": "1f6a0",
  77160. "uc_match": "1f6a0",
  77161. "uc_greedy": "1f6a0",
  77162. "shortnames": [],
  77163. "category": "travel"
  77164. },
  77165. ":mountain_railway:": {
  77166. "uc_base": "1f69e",
  77167. "uc_output": "1f69e",
  77168. "uc_match": "1f69e",
  77169. "uc_greedy": "1f69e",
  77170. "shortnames": [],
  77171. "category": "travel"
  77172. },
  77173. ":mountain_snow:": {
  77174. "uc_base": "1f3d4",
  77175. "uc_output": "1f3d4",
  77176. "uc_match": "1f3d4-fe0f",
  77177. "uc_greedy": "1f3d4-fe0f",
  77178. "shortnames": [":snow_capped_mountain:"],
  77179. "category": "travel"
  77180. },
  77181. ":mouse2:": {
  77182. "uc_base": "1f401",
  77183. "uc_output": "1f401",
  77184. "uc_match": "1f401",
  77185. "uc_greedy": "1f401",
  77186. "shortnames": [],
  77187. "category": "nature"
  77188. },
  77189. ":mouse:": {
  77190. "uc_base": "1f42d",
  77191. "uc_output": "1f42d",
  77192. "uc_match": "1f42d",
  77193. "uc_greedy": "1f42d",
  77194. "shortnames": [],
  77195. "category": "nature"
  77196. },
  77197. ":mouse_three_button:": {
  77198. "uc_base": "1f5b1",
  77199. "uc_output": "1f5b1",
  77200. "uc_match": "1f5b1-fe0f",
  77201. "uc_greedy": "1f5b1-fe0f",
  77202. "shortnames": [":three_button_mouse:"],
  77203. "category": "objects"
  77204. },
  77205. ":movie_camera:": {
  77206. "uc_base": "1f3a5",
  77207. "uc_output": "1f3a5",
  77208. "uc_match": "1f3a5",
  77209. "uc_greedy": "1f3a5",
  77210. "shortnames": [],
  77211. "category": "objects"
  77212. },
  77213. ":moyai:": {
  77214. "uc_base": "1f5ff",
  77215. "uc_output": "1f5ff",
  77216. "uc_match": "1f5ff",
  77217. "uc_greedy": "1f5ff",
  77218. "shortnames": [],
  77219. "category": "travel"
  77220. },
  77221. ":mrs_claus:": {
  77222. "uc_base": "1f936",
  77223. "uc_output": "1f936",
  77224. "uc_match": "1f936",
  77225. "uc_greedy": "1f936",
  77226. "shortnames": [":mother_christmas:"],
  77227. "category": "people"
  77228. },
  77229. ":muscle:": {
  77230. "uc_base": "1f4aa",
  77231. "uc_output": "1f4aa",
  77232. "uc_match": "1f4aa",
  77233. "uc_greedy": "1f4aa",
  77234. "shortnames": [],
  77235. "category": "people"
  77236. },
  77237. ":mushroom:": {
  77238. "uc_base": "1f344",
  77239. "uc_output": "1f344",
  77240. "uc_match": "1f344",
  77241. "uc_greedy": "1f344",
  77242. "shortnames": [],
  77243. "category": "nature"
  77244. },
  77245. ":musical_keyboard:": {
  77246. "uc_base": "1f3b9",
  77247. "uc_output": "1f3b9",
  77248. "uc_match": "1f3b9",
  77249. "uc_greedy": "1f3b9",
  77250. "shortnames": [],
  77251. "category": "activity"
  77252. },
  77253. ":musical_note:": {
  77254. "uc_base": "1f3b5",
  77255. "uc_output": "1f3b5",
  77256. "uc_match": "1f3b5",
  77257. "uc_greedy": "1f3b5",
  77258. "shortnames": [],
  77259. "category": "symbols"
  77260. },
  77261. ":musical_score:": {
  77262. "uc_base": "1f3bc",
  77263. "uc_output": "1f3bc",
  77264. "uc_match": "1f3bc",
  77265. "uc_greedy": "1f3bc",
  77266. "shortnames": [],
  77267. "category": "activity"
  77268. },
  77269. ":mute:": {
  77270. "uc_base": "1f507",
  77271. "uc_output": "1f507",
  77272. "uc_match": "1f507",
  77273. "uc_greedy": "1f507",
  77274. "shortnames": [],
  77275. "category": "symbols"
  77276. },
  77277. ":nail_care:": {
  77278. "uc_base": "1f485",
  77279. "uc_output": "1f485",
  77280. "uc_match": "1f485",
  77281. "uc_greedy": "1f485",
  77282. "shortnames": [],
  77283. "category": "people"
  77284. },
  77285. ":name_badge:": {
  77286. "uc_base": "1f4db",
  77287. "uc_output": "1f4db",
  77288. "uc_match": "1f4db",
  77289. "uc_greedy": "1f4db",
  77290. "shortnames": [],
  77291. "category": "symbols"
  77292. },
  77293. ":nauseated_face:": {
  77294. "uc_base": "1f922",
  77295. "uc_output": "1f922",
  77296. "uc_match": "1f922",
  77297. "uc_greedy": "1f922",
  77298. "shortnames": [":sick:"],
  77299. "category": "people"
  77300. },
  77301. ":necktie:": {
  77302. "uc_base": "1f454",
  77303. "uc_output": "1f454",
  77304. "uc_match": "1f454",
  77305. "uc_greedy": "1f454",
  77306. "shortnames": [],
  77307. "category": "people"
  77308. },
  77309. ":nerd:": {
  77310. "uc_base": "1f913",
  77311. "uc_output": "1f913",
  77312. "uc_match": "1f913",
  77313. "uc_greedy": "1f913",
  77314. "shortnames": [":nerd_face:"],
  77315. "category": "people"
  77316. },
  77317. ":neutral_face:": {
  77318. "uc_base": "1f610",
  77319. "uc_output": "1f610",
  77320. "uc_match": "1f610-fe0f",
  77321. "uc_greedy": "1f610-fe0f",
  77322. "shortnames": [],
  77323. "category": "people"
  77324. },
  77325. ":new:": {
  77326. "uc_base": "1f195",
  77327. "uc_output": "1f195",
  77328. "uc_match": "1f195",
  77329. "uc_greedy": "1f195",
  77330. "shortnames": [],
  77331. "category": "symbols"
  77332. },
  77333. ":new_moon:": {
  77334. "uc_base": "1f311",
  77335. "uc_output": "1f311",
  77336. "uc_match": "1f311",
  77337. "uc_greedy": "1f311",
  77338. "shortnames": [],
  77339. "category": "nature"
  77340. },
  77341. ":new_moon_with_face:": {
  77342. "uc_base": "1f31a",
  77343. "uc_output": "1f31a",
  77344. "uc_match": "1f31a",
  77345. "uc_greedy": "1f31a",
  77346. "shortnames": [],
  77347. "category": "nature"
  77348. },
  77349. ":newspaper2:": {
  77350. "uc_base": "1f5de",
  77351. "uc_output": "1f5de",
  77352. "uc_match": "1f5de-fe0f",
  77353. "uc_greedy": "1f5de-fe0f",
  77354. "shortnames": [":rolled_up_newspaper:"],
  77355. "category": "objects"
  77356. },
  77357. ":newspaper:": {
  77358. "uc_base": "1f4f0",
  77359. "uc_output": "1f4f0",
  77360. "uc_match": "1f4f0",
  77361. "uc_greedy": "1f4f0",
  77362. "shortnames": [],
  77363. "category": "objects"
  77364. },
  77365. ":ng:": {
  77366. "uc_base": "1f196",
  77367. "uc_output": "1f196",
  77368. "uc_match": "1f196",
  77369. "uc_greedy": "1f196",
  77370. "shortnames": [],
  77371. "category": "symbols"
  77372. },
  77373. ":night_with_stars:": {
  77374. "uc_base": "1f303",
  77375. "uc_output": "1f303",
  77376. "uc_match": "1f303",
  77377. "uc_greedy": "1f303",
  77378. "shortnames": [],
  77379. "category": "travel"
  77380. },
  77381. ":no_bell:": {
  77382. "uc_base": "1f515",
  77383. "uc_output": "1f515",
  77384. "uc_match": "1f515",
  77385. "uc_greedy": "1f515",
  77386. "shortnames": [],
  77387. "category": "symbols"
  77388. },
  77389. ":no_bicycles:": {
  77390. "uc_base": "1f6b3",
  77391. "uc_output": "1f6b3",
  77392. "uc_match": "1f6b3",
  77393. "uc_greedy": "1f6b3",
  77394. "shortnames": [],
  77395. "category": "symbols"
  77396. },
  77397. ":no_entry_sign:": {
  77398. "uc_base": "1f6ab",
  77399. "uc_output": "1f6ab",
  77400. "uc_match": "1f6ab",
  77401. "uc_greedy": "1f6ab",
  77402. "shortnames": [],
  77403. "category": "symbols"
  77404. },
  77405. ":no_mobile_phones:": {
  77406. "uc_base": "1f4f5",
  77407. "uc_output": "1f4f5",
  77408. "uc_match": "1f4f5",
  77409. "uc_greedy": "1f4f5",
  77410. "shortnames": [],
  77411. "category": "symbols"
  77412. },
  77413. ":no_mouth:": {
  77414. "uc_base": "1f636",
  77415. "uc_output": "1f636",
  77416. "uc_match": "1f636",
  77417. "uc_greedy": "1f636",
  77418. "shortnames": [],
  77419. "category": "people"
  77420. },
  77421. ":no_pedestrians:": {
  77422. "uc_base": "1f6b7",
  77423. "uc_output": "1f6b7",
  77424. "uc_match": "1f6b7",
  77425. "uc_greedy": "1f6b7",
  77426. "shortnames": [],
  77427. "category": "symbols"
  77428. },
  77429. ":no_smoking:": {
  77430. "uc_base": "1f6ad",
  77431. "uc_output": "1f6ad",
  77432. "uc_match": "1f6ad-fe0f",
  77433. "uc_greedy": "1f6ad-fe0f",
  77434. "shortnames": [],
  77435. "category": "symbols"
  77436. },
  77437. ":non-potable_water:": {
  77438. "uc_base": "1f6b1",
  77439. "uc_output": "1f6b1",
  77440. "uc_match": "1f6b1",
  77441. "uc_greedy": "1f6b1",
  77442. "shortnames": [],
  77443. "category": "symbols"
  77444. },
  77445. ":nose:": {
  77446. "uc_base": "1f443",
  77447. "uc_output": "1f443",
  77448. "uc_match": "1f443",
  77449. "uc_greedy": "1f443",
  77450. "shortnames": [],
  77451. "category": "people"
  77452. },
  77453. ":notebook:": {
  77454. "uc_base": "1f4d3",
  77455. "uc_output": "1f4d3",
  77456. "uc_match": "1f4d3",
  77457. "uc_greedy": "1f4d3",
  77458. "shortnames": [],
  77459. "category": "objects"
  77460. },
  77461. ":notebook_with_decorative_cover:": {
  77462. "uc_base": "1f4d4",
  77463. "uc_output": "1f4d4",
  77464. "uc_match": "1f4d4",
  77465. "uc_greedy": "1f4d4",
  77466. "shortnames": [],
  77467. "category": "objects"
  77468. },
  77469. ":notepad_spiral:": {
  77470. "uc_base": "1f5d2",
  77471. "uc_output": "1f5d2",
  77472. "uc_match": "1f5d2-fe0f",
  77473. "uc_greedy": "1f5d2-fe0f",
  77474. "shortnames": [":spiral_note_pad:"],
  77475. "category": "objects"
  77476. },
  77477. ":notes:": {
  77478. "uc_base": "1f3b6",
  77479. "uc_output": "1f3b6",
  77480. "uc_match": "1f3b6",
  77481. "uc_greedy": "1f3b6",
  77482. "shortnames": [],
  77483. "category": "symbols"
  77484. },
  77485. ":nut_and_bolt:": {
  77486. "uc_base": "1f529",
  77487. "uc_output": "1f529",
  77488. "uc_match": "1f529",
  77489. "uc_greedy": "1f529",
  77490. "shortnames": [],
  77491. "category": "objects"
  77492. },
  77493. ":o2:": {
  77494. "uc_base": "1f17e",
  77495. "uc_output": "1f17e",
  77496. "uc_match": "1f17e-fe0f",
  77497. "uc_greedy": "1f17e-fe0f",
  77498. "shortnames": [],
  77499. "category": "symbols"
  77500. },
  77501. ":ocean:": {
  77502. "uc_base": "1f30a",
  77503. "uc_output": "1f30a",
  77504. "uc_match": "1f30a",
  77505. "uc_greedy": "1f30a",
  77506. "shortnames": [],
  77507. "category": "nature"
  77508. },
  77509. ":octagonal_sign:": {
  77510. "uc_base": "1f6d1",
  77511. "uc_output": "1f6d1",
  77512. "uc_match": "1f6d1",
  77513. "uc_greedy": "1f6d1",
  77514. "shortnames": [":stop_sign:"],
  77515. "category": "symbols"
  77516. },
  77517. ":octopus:": {
  77518. "uc_base": "1f419",
  77519. "uc_output": "1f419",
  77520. "uc_match": "1f419",
  77521. "uc_greedy": "1f419",
  77522. "shortnames": [],
  77523. "category": "nature"
  77524. },
  77525. ":oden:": {
  77526. "uc_base": "1f362",
  77527. "uc_output": "1f362",
  77528. "uc_match": "1f362",
  77529. "uc_greedy": "1f362",
  77530. "shortnames": [],
  77531. "category": "food"
  77532. },
  77533. ":office:": {
  77534. "uc_base": "1f3e2",
  77535. "uc_output": "1f3e2",
  77536. "uc_match": "1f3e2",
  77537. "uc_greedy": "1f3e2",
  77538. "shortnames": [],
  77539. "category": "travel"
  77540. },
  77541. ":oil:": {
  77542. "uc_base": "1f6e2",
  77543. "uc_output": "1f6e2",
  77544. "uc_match": "1f6e2-fe0f",
  77545. "uc_greedy": "1f6e2-fe0f",
  77546. "shortnames": [":oil_drum:"],
  77547. "category": "objects"
  77548. },
  77549. ":ok:": {
  77550. "uc_base": "1f197",
  77551. "uc_output": "1f197",
  77552. "uc_match": "1f197",
  77553. "uc_greedy": "1f197",
  77554. "shortnames": [],
  77555. "category": "symbols"
  77556. },
  77557. ":ok_hand:": {
  77558. "uc_base": "1f44c",
  77559. "uc_output": "1f44c",
  77560. "uc_match": "1f44c",
  77561. "uc_greedy": "1f44c",
  77562. "shortnames": [],
  77563. "category": "people"
  77564. },
  77565. ":older_adult:": {
  77566. "uc_base": "1f9d3",
  77567. "uc_output": "1f9d3",
  77568. "uc_match": "1f9d3",
  77569. "uc_greedy": "1f9d3",
  77570. "shortnames": [],
  77571. "category": "people"
  77572. },
  77573. ":older_man:": {
  77574. "uc_base": "1f474",
  77575. "uc_output": "1f474",
  77576. "uc_match": "1f474",
  77577. "uc_greedy": "1f474",
  77578. "shortnames": [],
  77579. "category": "people"
  77580. },
  77581. ":older_woman:": {
  77582. "uc_base": "1f475",
  77583. "uc_output": "1f475",
  77584. "uc_match": "1f475",
  77585. "uc_greedy": "1f475",
  77586. "shortnames": [":grandma:"],
  77587. "category": "people"
  77588. },
  77589. ":om_symbol:": {
  77590. "uc_base": "1f549",
  77591. "uc_output": "1f549",
  77592. "uc_match": "1f549-fe0f",
  77593. "uc_greedy": "1f549",
  77594. "shortnames": [],
  77595. "category": "symbols"
  77596. },
  77597. ":on:": {
  77598. "uc_base": "1f51b",
  77599. "uc_output": "1f51b",
  77600. "uc_match": "1f51b",
  77601. "uc_greedy": "1f51b",
  77602. "shortnames": [],
  77603. "category": "symbols"
  77604. },
  77605. ":oncoming_automobile:": {
  77606. "uc_base": "1f698",
  77607. "uc_output": "1f698",
  77608. "uc_match": "1f698-fe0f",
  77609. "uc_greedy": "1f698-fe0f",
  77610. "shortnames": [],
  77611. "category": "travel"
  77612. },
  77613. ":oncoming_bus:": {
  77614. "uc_base": "1f68d",
  77615. "uc_output": "1f68d",
  77616. "uc_match": "1f68d-fe0f",
  77617. "uc_greedy": "1f68d-fe0f",
  77618. "shortnames": [],
  77619. "category": "travel"
  77620. },
  77621. ":oncoming_police_car:": {
  77622. "uc_base": "1f694",
  77623. "uc_output": "1f694",
  77624. "uc_match": "1f694-fe0f",
  77625. "uc_greedy": "1f694-fe0f",
  77626. "shortnames": [],
  77627. "category": "travel"
  77628. },
  77629. ":oncoming_taxi:": {
  77630. "uc_base": "1f696",
  77631. "uc_output": "1f696",
  77632. "uc_match": "1f696",
  77633. "uc_greedy": "1f696",
  77634. "shortnames": [],
  77635. "category": "travel"
  77636. },
  77637. ":open_file_folder:": {
  77638. "uc_base": "1f4c2",
  77639. "uc_output": "1f4c2",
  77640. "uc_match": "1f4c2",
  77641. "uc_greedy": "1f4c2",
  77642. "shortnames": [],
  77643. "category": "objects"
  77644. },
  77645. ":open_hands:": {
  77646. "uc_base": "1f450",
  77647. "uc_output": "1f450",
  77648. "uc_match": "1f450",
  77649. "uc_greedy": "1f450",
  77650. "shortnames": [],
  77651. "category": "people"
  77652. },
  77653. ":open_mouth:": {
  77654. "uc_base": "1f62e",
  77655. "uc_output": "1f62e",
  77656. "uc_match": "1f62e",
  77657. "uc_greedy": "1f62e",
  77658. "shortnames": [],
  77659. "category": "people"
  77660. },
  77661. ":orange_book:": {
  77662. "uc_base": "1f4d9",
  77663. "uc_output": "1f4d9",
  77664. "uc_match": "1f4d9",
  77665. "uc_greedy": "1f4d9",
  77666. "shortnames": [],
  77667. "category": "objects"
  77668. },
  77669. ":orange_heart:": {
  77670. "uc_base": "1f9e1",
  77671. "uc_output": "1f9e1",
  77672. "uc_match": "1f9e1",
  77673. "uc_greedy": "1f9e1",
  77674. "shortnames": [],
  77675. "category": "symbols"
  77676. },
  77677. ":outbox_tray:": {
  77678. "uc_base": "1f4e4",
  77679. "uc_output": "1f4e4",
  77680. "uc_match": "1f4e4-fe0f",
  77681. "uc_greedy": "1f4e4-fe0f",
  77682. "shortnames": [],
  77683. "category": "objects"
  77684. },
  77685. ":owl:": {
  77686. "uc_base": "1f989",
  77687. "uc_output": "1f989",
  77688. "uc_match": "1f989",
  77689. "uc_greedy": "1f989",
  77690. "shortnames": [],
  77691. "category": "nature"
  77692. },
  77693. ":ox:": {
  77694. "uc_base": "1f402",
  77695. "uc_output": "1f402",
  77696. "uc_match": "1f402",
  77697. "uc_greedy": "1f402",
  77698. "shortnames": [],
  77699. "category": "nature"
  77700. },
  77701. ":package:": {
  77702. "uc_base": "1f4e6",
  77703. "uc_output": "1f4e6",
  77704. "uc_match": "1f4e6-fe0f",
  77705. "uc_greedy": "1f4e6-fe0f",
  77706. "shortnames": [],
  77707. "category": "objects"
  77708. },
  77709. ":page_facing_up:": {
  77710. "uc_base": "1f4c4",
  77711. "uc_output": "1f4c4",
  77712. "uc_match": "1f4c4",
  77713. "uc_greedy": "1f4c4",
  77714. "shortnames": [],
  77715. "category": "objects"
  77716. },
  77717. ":page_with_curl:": {
  77718. "uc_base": "1f4c3",
  77719. "uc_output": "1f4c3",
  77720. "uc_match": "1f4c3",
  77721. "uc_greedy": "1f4c3",
  77722. "shortnames": [],
  77723. "category": "objects"
  77724. },
  77725. ":pager:": {
  77726. "uc_base": "1f4df",
  77727. "uc_output": "1f4df",
  77728. "uc_match": "1f4df-fe0f",
  77729. "uc_greedy": "1f4df-fe0f",
  77730. "shortnames": [],
  77731. "category": "objects"
  77732. },
  77733. ":paintbrush:": {
  77734. "uc_base": "1f58c",
  77735. "uc_output": "1f58c",
  77736. "uc_match": "1f58c-fe0f",
  77737. "uc_greedy": "1f58c-fe0f",
  77738. "shortnames": [":lower_left_paintbrush:"],
  77739. "category": "objects"
  77740. },
  77741. ":palm_tree:": {
  77742. "uc_base": "1f334",
  77743. "uc_output": "1f334",
  77744. "uc_match": "1f334",
  77745. "uc_greedy": "1f334",
  77746. "shortnames": [],
  77747. "category": "nature"
  77748. },
  77749. ":palms_up_together:": {
  77750. "uc_base": "1f932",
  77751. "uc_output": "1f932",
  77752. "uc_match": "1f932",
  77753. "uc_greedy": "1f932",
  77754. "shortnames": [],
  77755. "category": "people"
  77756. },
  77757. ":pancakes:": {
  77758. "uc_base": "1f95e",
  77759. "uc_output": "1f95e",
  77760. "uc_match": "1f95e",
  77761. "uc_greedy": "1f95e",
  77762. "shortnames": [],
  77763. "category": "food"
  77764. },
  77765. ":panda_face:": {
  77766. "uc_base": "1f43c",
  77767. "uc_output": "1f43c",
  77768. "uc_match": "1f43c",
  77769. "uc_greedy": "1f43c",
  77770. "shortnames": [],
  77771. "category": "nature"
  77772. },
  77773. ":paperclip:": {
  77774. "uc_base": "1f4ce",
  77775. "uc_output": "1f4ce",
  77776. "uc_match": "1f4ce",
  77777. "uc_greedy": "1f4ce",
  77778. "shortnames": [],
  77779. "category": "objects"
  77780. },
  77781. ":paperclips:": {
  77782. "uc_base": "1f587",
  77783. "uc_output": "1f587",
  77784. "uc_match": "1f587-fe0f",
  77785. "uc_greedy": "1f587-fe0f",
  77786. "shortnames": [":linked_paperclips:"],
  77787. "category": "objects"
  77788. },
  77789. ":park:": {
  77790. "uc_base": "1f3de",
  77791. "uc_output": "1f3de",
  77792. "uc_match": "1f3de-fe0f",
  77793. "uc_greedy": "1f3de-fe0f",
  77794. "shortnames": [":national_park:"],
  77795. "category": "travel"
  77796. },
  77797. ":parking:": {
  77798. "uc_base": "1f17f",
  77799. "uc_output": "1f17f",
  77800. "uc_match": "1f17f-fe0f",
  77801. "uc_greedy": "1f17f-fe0f",
  77802. "shortnames": [],
  77803. "category": "symbols"
  77804. },
  77805. ":passport_control:": {
  77806. "uc_base": "1f6c2",
  77807. "uc_output": "1f6c2",
  77808. "uc_match": "1f6c2",
  77809. "uc_greedy": "1f6c2",
  77810. "shortnames": [],
  77811. "category": "symbols"
  77812. },
  77813. ":peach:": {
  77814. "uc_base": "1f351",
  77815. "uc_output": "1f351",
  77816. "uc_match": "1f351",
  77817. "uc_greedy": "1f351",
  77818. "shortnames": [],
  77819. "category": "food"
  77820. },
  77821. ":peanuts:": {
  77822. "uc_base": "1f95c",
  77823. "uc_output": "1f95c",
  77824. "uc_match": "1f95c",
  77825. "uc_greedy": "1f95c",
  77826. "shortnames": [":shelled_peanut:"],
  77827. "category": "food"
  77828. },
  77829. ":pear:": {
  77830. "uc_base": "1f350",
  77831. "uc_output": "1f350",
  77832. "uc_match": "1f350",
  77833. "uc_greedy": "1f350",
  77834. "shortnames": [],
  77835. "category": "food"
  77836. },
  77837. ":pen_ballpoint:": {
  77838. "uc_base": "1f58a",
  77839. "uc_output": "1f58a",
  77840. "uc_match": "1f58a-fe0f",
  77841. "uc_greedy": "1f58a-fe0f",
  77842. "shortnames": [":lower_left_ballpoint_pen:"],
  77843. "category": "objects"
  77844. },
  77845. ":pen_fountain:": {
  77846. "uc_base": "1f58b",
  77847. "uc_output": "1f58b",
  77848. "uc_match": "1f58b-fe0f",
  77849. "uc_greedy": "1f58b-fe0f",
  77850. "shortnames": [":lower_left_fountain_pen:"],
  77851. "category": "objects"
  77852. },
  77853. ":pencil:": {
  77854. "uc_base": "1f4dd",
  77855. "uc_output": "1f4dd",
  77856. "uc_match": "1f4dd",
  77857. "uc_greedy": "1f4dd",
  77858. "shortnames": [":memo:"],
  77859. "category": "objects"
  77860. },
  77861. ":penguin:": {
  77862. "uc_base": "1f427",
  77863. "uc_output": "1f427",
  77864. "uc_match": "1f427",
  77865. "uc_greedy": "1f427",
  77866. "shortnames": [],
  77867. "category": "nature"
  77868. },
  77869. ":pensive:": {
  77870. "uc_base": "1f614",
  77871. "uc_output": "1f614",
  77872. "uc_match": "1f614",
  77873. "uc_greedy": "1f614",
  77874. "shortnames": [],
  77875. "category": "people"
  77876. },
  77877. ":people_with_bunny_ears_partying:": {
  77878. "uc_base": "1f46f",
  77879. "uc_output": "1f46f",
  77880. "uc_match": "1f46f",
  77881. "uc_greedy": "1f46f",
  77882. "shortnames": [":dancers:"],
  77883. "category": "people"
  77884. },
  77885. ":people_wrestling:": {
  77886. "uc_base": "1f93c",
  77887. "uc_output": "1f93c",
  77888. "uc_match": "1f93c",
  77889. "uc_greedy": "1f93c",
  77890. "shortnames": [":wrestlers:", ":wrestling:"],
  77891. "category": "activity"
  77892. },
  77893. ":performing_arts:": {
  77894. "uc_base": "1f3ad",
  77895. "uc_output": "1f3ad",
  77896. "uc_match": "1f3ad-fe0f",
  77897. "uc_greedy": "1f3ad-fe0f",
  77898. "shortnames": [],
  77899. "category": "activity"
  77900. },
  77901. ":persevere:": {
  77902. "uc_base": "1f623",
  77903. "uc_output": "1f623",
  77904. "uc_match": "1f623",
  77905. "uc_greedy": "1f623",
  77906. "shortnames": [],
  77907. "category": "people"
  77908. },
  77909. ":person_biking:": {
  77910. "uc_base": "1f6b4",
  77911. "uc_output": "1f6b4",
  77912. "uc_match": "1f6b4",
  77913. "uc_greedy": "1f6b4",
  77914. "shortnames": [":bicyclist:"],
  77915. "category": "activity"
  77916. },
  77917. ":person_bowing:": {
  77918. "uc_base": "1f647",
  77919. "uc_output": "1f647",
  77920. "uc_match": "1f647",
  77921. "uc_greedy": "1f647",
  77922. "shortnames": [":bow:"],
  77923. "category": "people"
  77924. },
  77925. ":person_climbing:": {
  77926. "uc_base": "1f9d7",
  77927. "uc_output": "1f9d7",
  77928. "uc_match": "1f9d7",
  77929. "uc_greedy": "1f9d7",
  77930. "shortnames": [],
  77931. "category": "activity"
  77932. },
  77933. ":person_doing_cartwheel:": {
  77934. "uc_base": "1f938",
  77935. "uc_output": "1f938",
  77936. "uc_match": "1f938",
  77937. "uc_greedy": "1f938",
  77938. "shortnames": [":cartwheel:"],
  77939. "category": "activity"
  77940. },
  77941. ":person_facepalming:": {
  77942. "uc_base": "1f926",
  77943. "uc_output": "1f926",
  77944. "uc_match": "1f926",
  77945. "uc_greedy": "1f926",
  77946. "shortnames": [":face_palm:", ":facepalm:"],
  77947. "category": "people"
  77948. },
  77949. ":person_fencing:": {
  77950. "uc_base": "1f93a",
  77951. "uc_output": "1f93a",
  77952. "uc_match": "1f93a",
  77953. "uc_greedy": "1f93a",
  77954. "shortnames": [":fencer:", ":fencing:"],
  77955. "category": "activity"
  77956. },
  77957. ":person_frowning:": {
  77958. "uc_base": "1f64d",
  77959. "uc_output": "1f64d",
  77960. "uc_match": "1f64d",
  77961. "uc_greedy": "1f64d",
  77962. "shortnames": [],
  77963. "category": "people"
  77964. },
  77965. ":person_gesturing_no:": {
  77966. "uc_base": "1f645",
  77967. "uc_output": "1f645",
  77968. "uc_match": "1f645",
  77969. "uc_greedy": "1f645",
  77970. "shortnames": [":no_good:"],
  77971. "category": "people"
  77972. },
  77973. ":person_gesturing_ok:": {
  77974. "uc_base": "1f646",
  77975. "uc_output": "1f646",
  77976. "uc_match": "1f646",
  77977. "uc_greedy": "1f646",
  77978. "shortnames": [":ok_woman:"],
  77979. "category": "people"
  77980. },
  77981. ":person_getting_haircut:": {
  77982. "uc_base": "1f487",
  77983. "uc_output": "1f487",
  77984. "uc_match": "1f487",
  77985. "uc_greedy": "1f487",
  77986. "shortnames": [":haircut:"],
  77987. "category": "people"
  77988. },
  77989. ":person_getting_massage:": {
  77990. "uc_base": "1f486",
  77991. "uc_output": "1f486",
  77992. "uc_match": "1f486",
  77993. "uc_greedy": "1f486",
  77994. "shortnames": [":massage:"],
  77995. "category": "people"
  77996. },
  77997. ":person_golfing:": {
  77998. "uc_base": "1f3cc",
  77999. "uc_output": "1f3cc",
  78000. "uc_match": "1f3cc-fe0f",
  78001. "uc_greedy": "1f3cc-fe0f",
  78002. "shortnames": [":golfer:"],
  78003. "category": "activity"
  78004. },
  78005. ":person_in_lotus_position:": {
  78006. "uc_base": "1f9d8",
  78007. "uc_output": "1f9d8",
  78008. "uc_match": "1f9d8",
  78009. "uc_greedy": "1f9d8",
  78010. "shortnames": [],
  78011. "category": "activity"
  78012. },
  78013. ":person_in_steamy_room:": {
  78014. "uc_base": "1f9d6",
  78015. "uc_output": "1f9d6",
  78016. "uc_match": "1f9d6",
  78017. "uc_greedy": "1f9d6",
  78018. "shortnames": [],
  78019. "category": "people"
  78020. },
  78021. ":person_juggling:": {
  78022. "uc_base": "1f939",
  78023. "uc_output": "1f939",
  78024. "uc_match": "1f939",
  78025. "uc_greedy": "1f939",
  78026. "shortnames": [":juggling:", ":juggler:"],
  78027. "category": "activity"
  78028. },
  78029. ":person_lifting_weights:": {
  78030. "uc_base": "1f3cb",
  78031. "uc_output": "1f3cb",
  78032. "uc_match": "1f3cb-fe0f",
  78033. "uc_greedy": "1f3cb-fe0f",
  78034. "shortnames": [":lifter:", ":weight_lifter:"],
  78035. "category": "activity"
  78036. },
  78037. ":person_mountain_biking:": {
  78038. "uc_base": "1f6b5",
  78039. "uc_output": "1f6b5",
  78040. "uc_match": "1f6b5",
  78041. "uc_greedy": "1f6b5",
  78042. "shortnames": [":mountain_bicyclist:"],
  78043. "category": "activity"
  78044. },
  78045. ":person_playing_handball:": {
  78046. "uc_base": "1f93e",
  78047. "uc_output": "1f93e",
  78048. "uc_match": "1f93e",
  78049. "uc_greedy": "1f93e",
  78050. "shortnames": [":handball:"],
  78051. "category": "activity"
  78052. },
  78053. ":person_playing_water_polo:": {
  78054. "uc_base": "1f93d",
  78055. "uc_output": "1f93d",
  78056. "uc_match": "1f93d",
  78057. "uc_greedy": "1f93d",
  78058. "shortnames": [":water_polo:"],
  78059. "category": "activity"
  78060. },
  78061. ":person_pouting:": {
  78062. "uc_base": "1f64e",
  78063. "uc_output": "1f64e",
  78064. "uc_match": "1f64e",
  78065. "uc_greedy": "1f64e",
  78066. "shortnames": [":person_with_pouting_face:"],
  78067. "category": "people"
  78068. },
  78069. ":person_raising_hand:": {
  78070. "uc_base": "1f64b",
  78071. "uc_output": "1f64b",
  78072. "uc_match": "1f64b",
  78073. "uc_greedy": "1f64b",
  78074. "shortnames": [":raising_hand:"],
  78075. "category": "people"
  78076. },
  78077. ":person_rowing_boat:": {
  78078. "uc_base": "1f6a3",
  78079. "uc_output": "1f6a3",
  78080. "uc_match": "1f6a3",
  78081. "uc_greedy": "1f6a3",
  78082. "shortnames": [":rowboat:"],
  78083. "category": "activity"
  78084. },
  78085. ":person_running:": {
  78086. "uc_base": "1f3c3",
  78087. "uc_output": "1f3c3",
  78088. "uc_match": "1f3c3",
  78089. "uc_greedy": "1f3c3",
  78090. "shortnames": [":runner:"],
  78091. "category": "people"
  78092. },
  78093. ":person_shrugging:": {
  78094. "uc_base": "1f937",
  78095. "uc_output": "1f937",
  78096. "uc_match": "1f937",
  78097. "uc_greedy": "1f937",
  78098. "shortnames": [":shrug:"],
  78099. "category": "people"
  78100. },
  78101. ":person_surfing:": {
  78102. "uc_base": "1f3c4",
  78103. "uc_output": "1f3c4",
  78104. "uc_match": "1f3c4-fe0f",
  78105. "uc_greedy": "1f3c4-fe0f",
  78106. "shortnames": [":surfer:"],
  78107. "category": "activity"
  78108. },
  78109. ":person_swimming:": {
  78110. "uc_base": "1f3ca",
  78111. "uc_output": "1f3ca",
  78112. "uc_match": "1f3ca-fe0f",
  78113. "uc_greedy": "1f3ca-fe0f",
  78114. "shortnames": [":swimmer:"],
  78115. "category": "activity"
  78116. },
  78117. ":person_tipping_hand:": {
  78118. "uc_base": "1f481",
  78119. "uc_output": "1f481",
  78120. "uc_match": "1f481",
  78121. "uc_greedy": "1f481",
  78122. "shortnames": [":information_desk_person:"],
  78123. "category": "people"
  78124. },
  78125. ":person_walking:": {
  78126. "uc_base": "1f6b6",
  78127. "uc_output": "1f6b6",
  78128. "uc_match": "1f6b6",
  78129. "uc_greedy": "1f6b6",
  78130. "shortnames": [":walking:"],
  78131. "category": "people"
  78132. },
  78133. ":person_wearing_turban:": {
  78134. "uc_base": "1f473",
  78135. "uc_output": "1f473",
  78136. "uc_match": "1f473",
  78137. "uc_greedy": "1f473",
  78138. "shortnames": [":man_with_turban:"],
  78139. "category": "people"
  78140. },
  78141. ":pie:": {
  78142. "uc_base": "1f967",
  78143. "uc_output": "1f967",
  78144. "uc_match": "1f967",
  78145. "uc_greedy": "1f967",
  78146. "shortnames": [],
  78147. "category": "food"
  78148. },
  78149. ":pig2:": {
  78150. "uc_base": "1f416",
  78151. "uc_output": "1f416",
  78152. "uc_match": "1f416",
  78153. "uc_greedy": "1f416",
  78154. "shortnames": [],
  78155. "category": "nature"
  78156. },
  78157. ":pig:": {
  78158. "uc_base": "1f437",
  78159. "uc_output": "1f437",
  78160. "uc_match": "1f437",
  78161. "uc_greedy": "1f437",
  78162. "shortnames": [],
  78163. "category": "nature"
  78164. },
  78165. ":pig_nose:": {
  78166. "uc_base": "1f43d",
  78167. "uc_output": "1f43d",
  78168. "uc_match": "1f43d",
  78169. "uc_greedy": "1f43d",
  78170. "shortnames": [],
  78171. "category": "nature"
  78172. },
  78173. ":pill:": {
  78174. "uc_base": "1f48a",
  78175. "uc_output": "1f48a",
  78176. "uc_match": "1f48a",
  78177. "uc_greedy": "1f48a",
  78178. "shortnames": [],
  78179. "category": "objects"
  78180. },
  78181. ":pineapple:": {
  78182. "uc_base": "1f34d",
  78183. "uc_output": "1f34d",
  78184. "uc_match": "1f34d",
  78185. "uc_greedy": "1f34d",
  78186. "shortnames": [],
  78187. "category": "food"
  78188. },
  78189. ":ping_pong:": {
  78190. "uc_base": "1f3d3",
  78191. "uc_output": "1f3d3",
  78192. "uc_match": "1f3d3",
  78193. "uc_greedy": "1f3d3",
  78194. "shortnames": [":table_tennis:"],
  78195. "category": "activity"
  78196. },
  78197. ":pizza:": {
  78198. "uc_base": "1f355",
  78199. "uc_output": "1f355",
  78200. "uc_match": "1f355",
  78201. "uc_greedy": "1f355",
  78202. "shortnames": [],
  78203. "category": "food"
  78204. },
  78205. ":place_of_worship:": {
  78206. "uc_base": "1f6d0",
  78207. "uc_output": "1f6d0",
  78208. "uc_match": "1f6d0",
  78209. "uc_greedy": "1f6d0",
  78210. "shortnames": [":worship_symbol:"],
  78211. "category": "symbols"
  78212. },
  78213. ":point_down:": {
  78214. "uc_base": "1f447",
  78215. "uc_output": "1f447",
  78216. "uc_match": "1f447-fe0f",
  78217. "uc_greedy": "1f447-fe0f",
  78218. "shortnames": [],
  78219. "category": "people"
  78220. },
  78221. ":point_left:": {
  78222. "uc_base": "1f448",
  78223. "uc_output": "1f448",
  78224. "uc_match": "1f448-fe0f",
  78225. "uc_greedy": "1f448-fe0f",
  78226. "shortnames": [],
  78227. "category": "people"
  78228. },
  78229. ":point_right:": {
  78230. "uc_base": "1f449",
  78231. "uc_output": "1f449",
  78232. "uc_match": "1f449-fe0f",
  78233. "uc_greedy": "1f449-fe0f",
  78234. "shortnames": [],
  78235. "category": "people"
  78236. },
  78237. ":point_up_2:": {
  78238. "uc_base": "1f446",
  78239. "uc_output": "1f446",
  78240. "uc_match": "1f446-fe0f",
  78241. "uc_greedy": "1f446-fe0f",
  78242. "shortnames": [],
  78243. "category": "people"
  78244. },
  78245. ":police_car:": {
  78246. "uc_base": "1f693",
  78247. "uc_output": "1f693",
  78248. "uc_match": "1f693",
  78249. "uc_greedy": "1f693",
  78250. "shortnames": [],
  78251. "category": "travel"
  78252. },
  78253. ":police_officer:": {
  78254. "uc_base": "1f46e",
  78255. "uc_output": "1f46e",
  78256. "uc_match": "1f46e",
  78257. "uc_greedy": "1f46e",
  78258. "shortnames": [":cop:"],
  78259. "category": "people"
  78260. },
  78261. ":poodle:": {
  78262. "uc_base": "1f429",
  78263. "uc_output": "1f429",
  78264. "uc_match": "1f429",
  78265. "uc_greedy": "1f429",
  78266. "shortnames": [],
  78267. "category": "nature"
  78268. },
  78269. ":poop:": {
  78270. "uc_base": "1f4a9",
  78271. "uc_output": "1f4a9",
  78272. "uc_match": "1f4a9",
  78273. "uc_greedy": "1f4a9",
  78274. "shortnames": [":shit:", ":hankey:", ":poo:"],
  78275. "category": "people"
  78276. },
  78277. ":popcorn:": {
  78278. "uc_base": "1f37f",
  78279. "uc_output": "1f37f",
  78280. "uc_match": "1f37f",
  78281. "uc_greedy": "1f37f",
  78282. "shortnames": [],
  78283. "category": "food"
  78284. },
  78285. ":post_office:": {
  78286. "uc_base": "1f3e3",
  78287. "uc_output": "1f3e3",
  78288. "uc_match": "1f3e3",
  78289. "uc_greedy": "1f3e3",
  78290. "shortnames": [],
  78291. "category": "travel"
  78292. },
  78293. ":postal_horn:": {
  78294. "uc_base": "1f4ef",
  78295. "uc_output": "1f4ef",
  78296. "uc_match": "1f4ef",
  78297. "uc_greedy": "1f4ef",
  78298. "shortnames": [],
  78299. "category": "objects"
  78300. },
  78301. ":postbox:": {
  78302. "uc_base": "1f4ee",
  78303. "uc_output": "1f4ee",
  78304. "uc_match": "1f4ee",
  78305. "uc_greedy": "1f4ee",
  78306. "shortnames": [],
  78307. "category": "objects"
  78308. },
  78309. ":potable_water:": {
  78310. "uc_base": "1f6b0",
  78311. "uc_output": "1f6b0",
  78312. "uc_match": "1f6b0",
  78313. "uc_greedy": "1f6b0",
  78314. "shortnames": [],
  78315. "category": "objects"
  78316. },
  78317. ":potato:": {
  78318. "uc_base": "1f954",
  78319. "uc_output": "1f954",
  78320. "uc_match": "1f954",
  78321. "uc_greedy": "1f954",
  78322. "shortnames": [],
  78323. "category": "food"
  78324. },
  78325. ":pouch:": {
  78326. "uc_base": "1f45d",
  78327. "uc_output": "1f45d",
  78328. "uc_match": "1f45d",
  78329. "uc_greedy": "1f45d",
  78330. "shortnames": [],
  78331. "category": "people"
  78332. },
  78333. ":poultry_leg:": {
  78334. "uc_base": "1f357",
  78335. "uc_output": "1f357",
  78336. "uc_match": "1f357",
  78337. "uc_greedy": "1f357",
  78338. "shortnames": [],
  78339. "category": "food"
  78340. },
  78341. ":pound:": {
  78342. "uc_base": "1f4b7",
  78343. "uc_output": "1f4b7",
  78344. "uc_match": "1f4b7",
  78345. "uc_greedy": "1f4b7",
  78346. "shortnames": [],
  78347. "category": "objects"
  78348. },
  78349. ":pouting_cat:": {
  78350. "uc_base": "1f63e",
  78351. "uc_output": "1f63e",
  78352. "uc_match": "1f63e",
  78353. "uc_greedy": "1f63e",
  78354. "shortnames": [],
  78355. "category": "people"
  78356. },
  78357. ":pray:": {
  78358. "uc_base": "1f64f",
  78359. "uc_output": "1f64f",
  78360. "uc_match": "1f64f",
  78361. "uc_greedy": "1f64f",
  78362. "shortnames": [],
  78363. "category": "people"
  78364. },
  78365. ":prayer_beads:": {
  78366. "uc_base": "1f4ff",
  78367. "uc_output": "1f4ff",
  78368. "uc_match": "1f4ff",
  78369. "uc_greedy": "1f4ff",
  78370. "shortnames": [],
  78371. "category": "objects"
  78372. },
  78373. ":pregnant_woman:": {
  78374. "uc_base": "1f930",
  78375. "uc_output": "1f930",
  78376. "uc_match": "1f930",
  78377. "uc_greedy": "1f930",
  78378. "shortnames": [":expecting_woman:"],
  78379. "category": "people"
  78380. },
  78381. ":pretzel:": {
  78382. "uc_base": "1f968",
  78383. "uc_output": "1f968",
  78384. "uc_match": "1f968",
  78385. "uc_greedy": "1f968",
  78386. "shortnames": [],
  78387. "category": "food"
  78388. },
  78389. ":prince:": {
  78390. "uc_base": "1f934",
  78391. "uc_output": "1f934",
  78392. "uc_match": "1f934",
  78393. "uc_greedy": "1f934",
  78394. "shortnames": [],
  78395. "category": "people"
  78396. },
  78397. ":princess:": {
  78398. "uc_base": "1f478",
  78399. "uc_output": "1f478",
  78400. "uc_match": "1f478",
  78401. "uc_greedy": "1f478",
  78402. "shortnames": [],
  78403. "category": "people"
  78404. },
  78405. ":printer:": {
  78406. "uc_base": "1f5a8",
  78407. "uc_output": "1f5a8",
  78408. "uc_match": "1f5a8-fe0f",
  78409. "uc_greedy": "1f5a8-fe0f",
  78410. "shortnames": [],
  78411. "category": "objects"
  78412. },
  78413. ":projector:": {
  78414. "uc_base": "1f4fd",
  78415. "uc_output": "1f4fd",
  78416. "uc_match": "1f4fd-fe0f",
  78417. "uc_greedy": "1f4fd-fe0f",
  78418. "shortnames": [":film_projector:"],
  78419. "category": "objects"
  78420. },
  78421. ":punch:": {
  78422. "uc_base": "1f44a",
  78423. "uc_output": "1f44a",
  78424. "uc_match": "1f44a",
  78425. "uc_greedy": "1f44a",
  78426. "shortnames": [],
  78427. "category": "people"
  78428. },
  78429. ":purple_heart:": {
  78430. "uc_base": "1f49c",
  78431. "uc_output": "1f49c",
  78432. "uc_match": "1f49c",
  78433. "uc_greedy": "1f49c",
  78434. "shortnames": [],
  78435. "category": "symbols"
  78436. },
  78437. ":purse:": {
  78438. "uc_base": "1f45b",
  78439. "uc_output": "1f45b",
  78440. "uc_match": "1f45b",
  78441. "uc_greedy": "1f45b",
  78442. "shortnames": [],
  78443. "category": "people"
  78444. },
  78445. ":pushpin:": {
  78446. "uc_base": "1f4cc",
  78447. "uc_output": "1f4cc",
  78448. "uc_match": "1f4cc",
  78449. "uc_greedy": "1f4cc",
  78450. "shortnames": [],
  78451. "category": "objects"
  78452. },
  78453. ":put_litter_in_its_place:": {
  78454. "uc_base": "1f6ae",
  78455. "uc_output": "1f6ae",
  78456. "uc_match": "1f6ae",
  78457. "uc_greedy": "1f6ae",
  78458. "shortnames": [],
  78459. "category": "symbols"
  78460. },
  78461. ":rabbit2:": {
  78462. "uc_base": "1f407",
  78463. "uc_output": "1f407",
  78464. "uc_match": "1f407",
  78465. "uc_greedy": "1f407",
  78466. "shortnames": [],
  78467. "category": "nature"
  78468. },
  78469. ":rabbit:": {
  78470. "uc_base": "1f430",
  78471. "uc_output": "1f430",
  78472. "uc_match": "1f430",
  78473. "uc_greedy": "1f430",
  78474. "shortnames": [],
  78475. "category": "nature"
  78476. },
  78477. ":race_car:": {
  78478. "uc_base": "1f3ce",
  78479. "uc_output": "1f3ce",
  78480. "uc_match": "1f3ce-fe0f",
  78481. "uc_greedy": "1f3ce-fe0f",
  78482. "shortnames": [":racing_car:"],
  78483. "category": "travel"
  78484. },
  78485. ":racehorse:": {
  78486. "uc_base": "1f40e",
  78487. "uc_output": "1f40e",
  78488. "uc_match": "1f40e",
  78489. "uc_greedy": "1f40e",
  78490. "shortnames": [],
  78491. "category": "nature"
  78492. },
  78493. ":radio:": {
  78494. "uc_base": "1f4fb",
  78495. "uc_output": "1f4fb",
  78496. "uc_match": "1f4fb-fe0f",
  78497. "uc_greedy": "1f4fb-fe0f",
  78498. "shortnames": [],
  78499. "category": "objects"
  78500. },
  78501. ":radio_button:": {
  78502. "uc_base": "1f518",
  78503. "uc_output": "1f518",
  78504. "uc_match": "1f518",
  78505. "uc_greedy": "1f518",
  78506. "shortnames": [],
  78507. "category": "symbols"
  78508. },
  78509. ":rage:": {
  78510. "uc_base": "1f621",
  78511. "uc_output": "1f621",
  78512. "uc_match": "1f621",
  78513. "uc_greedy": "1f621",
  78514. "shortnames": [],
  78515. "category": "people"
  78516. },
  78517. ":railway_car:": {
  78518. "uc_base": "1f683",
  78519. "uc_output": "1f683",
  78520. "uc_match": "1f683",
  78521. "uc_greedy": "1f683",
  78522. "shortnames": [],
  78523. "category": "travel"
  78524. },
  78525. ":railway_track:": {
  78526. "uc_base": "1f6e4",
  78527. "uc_output": "1f6e4",
  78528. "uc_match": "1f6e4-fe0f",
  78529. "uc_greedy": "1f6e4-fe0f",
  78530. "shortnames": [":railroad_track:"],
  78531. "category": "travel"
  78532. },
  78533. ":rainbow:": {
  78534. "uc_base": "1f308",
  78535. "uc_output": "1f308",
  78536. "uc_match": "1f308",
  78537. "uc_greedy": "1f308",
  78538. "shortnames": [],
  78539. "category": "nature"
  78540. },
  78541. ":raised_back_of_hand:": {
  78542. "uc_base": "1f91a",
  78543. "uc_output": "1f91a",
  78544. "uc_match": "1f91a",
  78545. "uc_greedy": "1f91a",
  78546. "shortnames": [":back_of_hand:"],
  78547. "category": "people"
  78548. },
  78549. ":raised_hands:": {
  78550. "uc_base": "1f64c",
  78551. "uc_output": "1f64c",
  78552. "uc_match": "1f64c",
  78553. "uc_greedy": "1f64c",
  78554. "shortnames": [],
  78555. "category": "people"
  78556. },
  78557. ":ram:": {
  78558. "uc_base": "1f40f",
  78559. "uc_output": "1f40f",
  78560. "uc_match": "1f40f",
  78561. "uc_greedy": "1f40f",
  78562. "shortnames": [],
  78563. "category": "nature"
  78564. },
  78565. ":ramen:": {
  78566. "uc_base": "1f35c",
  78567. "uc_output": "1f35c",
  78568. "uc_match": "1f35c",
  78569. "uc_greedy": "1f35c",
  78570. "shortnames": [],
  78571. "category": "food"
  78572. },
  78573. ":rat:": {
  78574. "uc_base": "1f400",
  78575. "uc_output": "1f400",
  78576. "uc_match": "1f400",
  78577. "uc_greedy": "1f400",
  78578. "shortnames": [],
  78579. "category": "nature"
  78580. },
  78581. ":red_car:": {
  78582. "uc_base": "1f697",
  78583. "uc_output": "1f697",
  78584. "uc_match": "1f697",
  78585. "uc_greedy": "1f697",
  78586. "shortnames": [],
  78587. "category": "travel"
  78588. },
  78589. ":red_circle:": {
  78590. "uc_base": "1f534",
  78591. "uc_output": "1f534",
  78592. "uc_match": "1f534",
  78593. "uc_greedy": "1f534",
  78594. "shortnames": [],
  78595. "category": "symbols"
  78596. },
  78597. ":regional_indicator_a:": {
  78598. "uc_base": "1f1e6",
  78599. "uc_output": "1f1e6",
  78600. "uc_match": "1f1e6",
  78601. "uc_greedy": "1f1e6",
  78602. "shortnames": [],
  78603. "category": "regional"
  78604. },
  78605. ":regional_indicator_b:": {
  78606. "uc_base": "1f1e7",
  78607. "uc_output": "1f1e7",
  78608. "uc_match": "1f1e7",
  78609. "uc_greedy": "1f1e7",
  78610. "shortnames": [],
  78611. "category": "regional"
  78612. },
  78613. ":regional_indicator_c:": {
  78614. "uc_base": "1f1e8",
  78615. "uc_output": "1f1e8",
  78616. "uc_match": "1f1e8",
  78617. "uc_greedy": "1f1e8",
  78618. "shortnames": [],
  78619. "category": "regional"
  78620. },
  78621. ":regional_indicator_d:": {
  78622. "uc_base": "1f1e9",
  78623. "uc_output": "1f1e9",
  78624. "uc_match": "1f1e9",
  78625. "uc_greedy": "1f1e9",
  78626. "shortnames": [],
  78627. "category": "regional"
  78628. },
  78629. ":regional_indicator_e:": {
  78630. "uc_base": "1f1ea",
  78631. "uc_output": "1f1ea",
  78632. "uc_match": "1f1ea",
  78633. "uc_greedy": "1f1ea",
  78634. "shortnames": [],
  78635. "category": "regional"
  78636. },
  78637. ":regional_indicator_f:": {
  78638. "uc_base": "1f1eb",
  78639. "uc_output": "1f1eb",
  78640. "uc_match": "1f1eb",
  78641. "uc_greedy": "1f1eb",
  78642. "shortnames": [],
  78643. "category": "regional"
  78644. },
  78645. ":regional_indicator_g:": {
  78646. "uc_base": "1f1ec",
  78647. "uc_output": "1f1ec",
  78648. "uc_match": "1f1ec",
  78649. "uc_greedy": "1f1ec",
  78650. "shortnames": [],
  78651. "category": "regional"
  78652. },
  78653. ":regional_indicator_h:": {
  78654. "uc_base": "1f1ed",
  78655. "uc_output": "1f1ed",
  78656. "uc_match": "1f1ed",
  78657. "uc_greedy": "1f1ed",
  78658. "shortnames": [],
  78659. "category": "regional"
  78660. },
  78661. ":regional_indicator_i:": {
  78662. "uc_base": "1f1ee",
  78663. "uc_output": "1f1ee",
  78664. "uc_match": "1f1ee",
  78665. "uc_greedy": "1f1ee",
  78666. "shortnames": [],
  78667. "category": "regional"
  78668. },
  78669. ":regional_indicator_j:": {
  78670. "uc_base": "1f1ef",
  78671. "uc_output": "1f1ef",
  78672. "uc_match": "1f1ef",
  78673. "uc_greedy": "1f1ef",
  78674. "shortnames": [],
  78675. "category": "regional"
  78676. },
  78677. ":regional_indicator_k:": {
  78678. "uc_base": "1f1f0",
  78679. "uc_output": "1f1f0",
  78680. "uc_match": "1f1f0",
  78681. "uc_greedy": "1f1f0",
  78682. "shortnames": [],
  78683. "category": "regional"
  78684. },
  78685. ":regional_indicator_l:": {
  78686. "uc_base": "1f1f1",
  78687. "uc_output": "1f1f1",
  78688. "uc_match": "1f1f1",
  78689. "uc_greedy": "1f1f1",
  78690. "shortnames": [],
  78691. "category": "regional"
  78692. },
  78693. ":regional_indicator_m:": {
  78694. "uc_base": "1f1f2",
  78695. "uc_output": "1f1f2",
  78696. "uc_match": "1f1f2",
  78697. "uc_greedy": "1f1f2",
  78698. "shortnames": [],
  78699. "category": "regional"
  78700. },
  78701. ":regional_indicator_n:": {
  78702. "uc_base": "1f1f3",
  78703. "uc_output": "1f1f3",
  78704. "uc_match": "1f1f3",
  78705. "uc_greedy": "1f1f3",
  78706. "shortnames": [],
  78707. "category": "regional"
  78708. },
  78709. ":regional_indicator_o:": {
  78710. "uc_base": "1f1f4",
  78711. "uc_output": "1f1f4",
  78712. "uc_match": "1f1f4",
  78713. "uc_greedy": "1f1f4",
  78714. "shortnames": [],
  78715. "category": "regional"
  78716. },
  78717. ":regional_indicator_p:": {
  78718. "uc_base": "1f1f5",
  78719. "uc_output": "1f1f5",
  78720. "uc_match": "1f1f5",
  78721. "uc_greedy": "1f1f5",
  78722. "shortnames": [],
  78723. "category": "regional"
  78724. },
  78725. ":regional_indicator_q:": {
  78726. "uc_base": "1f1f6",
  78727. "uc_output": "1f1f6",
  78728. "uc_match": "1f1f6",
  78729. "uc_greedy": "1f1f6",
  78730. "shortnames": [],
  78731. "category": "regional"
  78732. },
  78733. ":regional_indicator_r:": {
  78734. "uc_base": "1f1f7",
  78735. "uc_output": "1f1f7",
  78736. "uc_match": "1f1f7",
  78737. "uc_greedy": "1f1f7",
  78738. "shortnames": [],
  78739. "category": "regional"
  78740. },
  78741. ":regional_indicator_s:": {
  78742. "uc_base": "1f1f8",
  78743. "uc_output": "1f1f8",
  78744. "uc_match": "1f1f8",
  78745. "uc_greedy": "1f1f8",
  78746. "shortnames": [],
  78747. "category": "regional"
  78748. },
  78749. ":regional_indicator_t:": {
  78750. "uc_base": "1f1f9",
  78751. "uc_output": "1f1f9",
  78752. "uc_match": "1f1f9",
  78753. "uc_greedy": "1f1f9",
  78754. "shortnames": [],
  78755. "category": "regional"
  78756. },
  78757. ":regional_indicator_u:": {
  78758. "uc_base": "1f1fa",
  78759. "uc_output": "1f1fa",
  78760. "uc_match": "1f1fa",
  78761. "uc_greedy": "1f1fa",
  78762. "shortnames": [],
  78763. "category": "regional"
  78764. },
  78765. ":regional_indicator_v:": {
  78766. "uc_base": "1f1fb",
  78767. "uc_output": "1f1fb",
  78768. "uc_match": "1f1fb",
  78769. "uc_greedy": "1f1fb",
  78770. "shortnames": [],
  78771. "category": "regional"
  78772. },
  78773. ":regional_indicator_w:": {
  78774. "uc_base": "1f1fc",
  78775. "uc_output": "1f1fc",
  78776. "uc_match": "1f1fc",
  78777. "uc_greedy": "1f1fc",
  78778. "shortnames": [],
  78779. "category": "regional"
  78780. },
  78781. ":regional_indicator_x:": {
  78782. "uc_base": "1f1fd",
  78783. "uc_output": "1f1fd",
  78784. "uc_match": "1f1fd",
  78785. "uc_greedy": "1f1fd",
  78786. "shortnames": [],
  78787. "category": "regional"
  78788. },
  78789. ":regional_indicator_y:": {
  78790. "uc_base": "1f1fe",
  78791. "uc_output": "1f1fe",
  78792. "uc_match": "1f1fe",
  78793. "uc_greedy": "1f1fe",
  78794. "shortnames": [],
  78795. "category": "regional"
  78796. },
  78797. ":regional_indicator_z:": {
  78798. "uc_base": "1f1ff",
  78799. "uc_output": "1f1ff",
  78800. "uc_match": "1f1ff",
  78801. "uc_greedy": "1f1ff",
  78802. "shortnames": [],
  78803. "category": "regional"
  78804. },
  78805. ":relieved:": {
  78806. "uc_base": "1f60c",
  78807. "uc_output": "1f60c",
  78808. "uc_match": "1f60c",
  78809. "uc_greedy": "1f60c",
  78810. "shortnames": [],
  78811. "category": "people"
  78812. },
  78813. ":reminder_ribbon:": {
  78814. "uc_base": "1f397",
  78815. "uc_output": "1f397",
  78816. "uc_match": "1f397-fe0f",
  78817. "uc_greedy": "1f397-fe0f",
  78818. "shortnames": [],
  78819. "category": "activity"
  78820. },
  78821. ":repeat:": {
  78822. "uc_base": "1f501",
  78823. "uc_output": "1f501",
  78824. "uc_match": "1f501",
  78825. "uc_greedy": "1f501",
  78826. "shortnames": [],
  78827. "category": "symbols"
  78828. },
  78829. ":repeat_one:": {
  78830. "uc_base": "1f502",
  78831. "uc_output": "1f502",
  78832. "uc_match": "1f502",
  78833. "uc_greedy": "1f502",
  78834. "shortnames": [],
  78835. "category": "symbols"
  78836. },
  78837. ":restroom:": {
  78838. "uc_base": "1f6bb",
  78839. "uc_output": "1f6bb",
  78840. "uc_match": "1f6bb",
  78841. "uc_greedy": "1f6bb",
  78842. "shortnames": [],
  78843. "category": "symbols"
  78844. },
  78845. ":revolving_hearts:": {
  78846. "uc_base": "1f49e",
  78847. "uc_output": "1f49e",
  78848. "uc_match": "1f49e",
  78849. "uc_greedy": "1f49e",
  78850. "shortnames": [],
  78851. "category": "symbols"
  78852. },
  78853. ":rhino:": {
  78854. "uc_base": "1f98f",
  78855. "uc_output": "1f98f",
  78856. "uc_match": "1f98f",
  78857. "uc_greedy": "1f98f",
  78858. "shortnames": [":rhinoceros:"],
  78859. "category": "nature"
  78860. },
  78861. ":ribbon:": {
  78862. "uc_base": "1f380",
  78863. "uc_output": "1f380",
  78864. "uc_match": "1f380",
  78865. "uc_greedy": "1f380",
  78866. "shortnames": [],
  78867. "category": "objects"
  78868. },
  78869. ":rice:": {
  78870. "uc_base": "1f35a",
  78871. "uc_output": "1f35a",
  78872. "uc_match": "1f35a",
  78873. "uc_greedy": "1f35a",
  78874. "shortnames": [],
  78875. "category": "food"
  78876. },
  78877. ":rice_ball:": {
  78878. "uc_base": "1f359",
  78879. "uc_output": "1f359",
  78880. "uc_match": "1f359",
  78881. "uc_greedy": "1f359",
  78882. "shortnames": [],
  78883. "category": "food"
  78884. },
  78885. ":rice_cracker:": {
  78886. "uc_base": "1f358",
  78887. "uc_output": "1f358",
  78888. "uc_match": "1f358",
  78889. "uc_greedy": "1f358",
  78890. "shortnames": [],
  78891. "category": "food"
  78892. },
  78893. ":rice_scene:": {
  78894. "uc_base": "1f391",
  78895. "uc_output": "1f391",
  78896. "uc_match": "1f391",
  78897. "uc_greedy": "1f391",
  78898. "shortnames": [],
  78899. "category": "travel"
  78900. },
  78901. ":right_facing_fist:": {
  78902. "uc_base": "1f91c",
  78903. "uc_output": "1f91c",
  78904. "uc_match": "1f91c",
  78905. "uc_greedy": "1f91c",
  78906. "shortnames": [":right_fist:"],
  78907. "category": "people"
  78908. },
  78909. ":ring:": {
  78910. "uc_base": "1f48d",
  78911. "uc_output": "1f48d",
  78912. "uc_match": "1f48d",
  78913. "uc_greedy": "1f48d",
  78914. "shortnames": [],
  78915. "category": "people"
  78916. },
  78917. ":robot:": {
  78918. "uc_base": "1f916",
  78919. "uc_output": "1f916",
  78920. "uc_match": "1f916",
  78921. "uc_greedy": "1f916",
  78922. "shortnames": [":robot_face:"],
  78923. "category": "people"
  78924. },
  78925. ":rocket:": {
  78926. "uc_base": "1f680",
  78927. "uc_output": "1f680",
  78928. "uc_match": "1f680",
  78929. "uc_greedy": "1f680",
  78930. "shortnames": [],
  78931. "category": "travel"
  78932. },
  78933. ":rofl:": {
  78934. "uc_base": "1f923",
  78935. "uc_output": "1f923",
  78936. "uc_match": "1f923",
  78937. "uc_greedy": "1f923",
  78938. "shortnames": [":rolling_on_the_floor_laughing:"],
  78939. "category": "people"
  78940. },
  78941. ":roller_coaster:": {
  78942. "uc_base": "1f3a2",
  78943. "uc_output": "1f3a2",
  78944. "uc_match": "1f3a2",
  78945. "uc_greedy": "1f3a2",
  78946. "shortnames": [],
  78947. "category": "travel"
  78948. },
  78949. ":rolling_eyes:": {
  78950. "uc_base": "1f644",
  78951. "uc_output": "1f644",
  78952. "uc_match": "1f644",
  78953. "uc_greedy": "1f644",
  78954. "shortnames": [":face_with_rolling_eyes:"],
  78955. "category": "people"
  78956. },
  78957. ":rooster:": {
  78958. "uc_base": "1f413",
  78959. "uc_output": "1f413",
  78960. "uc_match": "1f413",
  78961. "uc_greedy": "1f413",
  78962. "shortnames": [],
  78963. "category": "nature"
  78964. },
  78965. ":rose:": {
  78966. "uc_base": "1f339",
  78967. "uc_output": "1f339",
  78968. "uc_match": "1f339",
  78969. "uc_greedy": "1f339",
  78970. "shortnames": [],
  78971. "category": "nature"
  78972. },
  78973. ":rosette:": {
  78974. "uc_base": "1f3f5",
  78975. "uc_output": "1f3f5",
  78976. "uc_match": "1f3f5-fe0f",
  78977. "uc_greedy": "1f3f5-fe0f",
  78978. "shortnames": [],
  78979. "category": "activity"
  78980. },
  78981. ":rotating_light:": {
  78982. "uc_base": "1f6a8",
  78983. "uc_output": "1f6a8",
  78984. "uc_match": "1f6a8",
  78985. "uc_greedy": "1f6a8",
  78986. "shortnames": [],
  78987. "category": "travel"
  78988. },
  78989. ":round_pushpin:": {
  78990. "uc_base": "1f4cd",
  78991. "uc_output": "1f4cd",
  78992. "uc_match": "1f4cd",
  78993. "uc_greedy": "1f4cd",
  78994. "shortnames": [],
  78995. "category": "objects"
  78996. },
  78997. ":rugby_football:": {
  78998. "uc_base": "1f3c9",
  78999. "uc_output": "1f3c9",
  79000. "uc_match": "1f3c9",
  79001. "uc_greedy": "1f3c9",
  79002. "shortnames": [],
  79003. "category": "activity"
  79004. },
  79005. ":running_shirt_with_sash:": {
  79006. "uc_base": "1f3bd",
  79007. "uc_output": "1f3bd",
  79008. "uc_match": "1f3bd",
  79009. "uc_greedy": "1f3bd",
  79010. "shortnames": [],
  79011. "category": "activity"
  79012. },
  79013. ":sa:": {
  79014. "uc_base": "1f202",
  79015. "uc_output": "1f202",
  79016. "uc_match": "1f202-fe0f",
  79017. "uc_greedy": "1f202-fe0f",
  79018. "shortnames": [],
  79019. "category": "symbols"
  79020. },
  79021. ":sake:": {
  79022. "uc_base": "1f376",
  79023. "uc_output": "1f376",
  79024. "uc_match": "1f376",
  79025. "uc_greedy": "1f376",
  79026. "shortnames": [],
  79027. "category": "food"
  79028. },
  79029. ":salad:": {
  79030. "uc_base": "1f957",
  79031. "uc_output": "1f957",
  79032. "uc_match": "1f957",
  79033. "uc_greedy": "1f957",
  79034. "shortnames": [":green_salad:"],
  79035. "category": "food"
  79036. },
  79037. ":sandal:": {
  79038. "uc_base": "1f461",
  79039. "uc_output": "1f461",
  79040. "uc_match": "1f461",
  79041. "uc_greedy": "1f461",
  79042. "shortnames": [],
  79043. "category": "people"
  79044. },
  79045. ":sandwich:": {
  79046. "uc_base": "1f96a",
  79047. "uc_output": "1f96a",
  79048. "uc_match": "1f96a",
  79049. "uc_greedy": "1f96a",
  79050. "shortnames": [],
  79051. "category": "food"
  79052. },
  79053. ":santa:": {
  79054. "uc_base": "1f385",
  79055. "uc_output": "1f385",
  79056. "uc_match": "1f385",
  79057. "uc_greedy": "1f385",
  79058. "shortnames": [],
  79059. "category": "people"
  79060. },
  79061. ":satellite:": {
  79062. "uc_base": "1f4e1",
  79063. "uc_output": "1f4e1",
  79064. "uc_match": "1f4e1",
  79065. "uc_greedy": "1f4e1",
  79066. "shortnames": [],
  79067. "category": "objects"
  79068. },
  79069. ":satellite_orbital:": {
  79070. "uc_base": "1f6f0",
  79071. "uc_output": "1f6f0",
  79072. "uc_match": "1f6f0-fe0f",
  79073. "uc_greedy": "1f6f0-fe0f",
  79074. "shortnames": [],
  79075. "category": "travel"
  79076. },
  79077. ":sauropod:": {
  79078. "uc_base": "1f995",
  79079. "uc_output": "1f995",
  79080. "uc_match": "1f995",
  79081. "uc_greedy": "1f995",
  79082. "shortnames": [],
  79083. "category": "nature"
  79084. },
  79085. ":saxophone:": {
  79086. "uc_base": "1f3b7",
  79087. "uc_output": "1f3b7",
  79088. "uc_match": "1f3b7",
  79089. "uc_greedy": "1f3b7",
  79090. "shortnames": [],
  79091. "category": "activity"
  79092. },
  79093. ":scarf:": {
  79094. "uc_base": "1f9e3",
  79095. "uc_output": "1f9e3",
  79096. "uc_match": "1f9e3",
  79097. "uc_greedy": "1f9e3",
  79098. "shortnames": [],
  79099. "category": "people"
  79100. },
  79101. ":school:": {
  79102. "uc_base": "1f3eb",
  79103. "uc_output": "1f3eb",
  79104. "uc_match": "1f3eb",
  79105. "uc_greedy": "1f3eb",
  79106. "shortnames": [],
  79107. "category": "travel"
  79108. },
  79109. ":school_satchel:": {
  79110. "uc_base": "1f392",
  79111. "uc_output": "1f392",
  79112. "uc_match": "1f392",
  79113. "uc_greedy": "1f392",
  79114. "shortnames": [],
  79115. "category": "people"
  79116. },
  79117. ":scooter:": {
  79118. "uc_base": "1f6f4",
  79119. "uc_output": "1f6f4",
  79120. "uc_match": "1f6f4",
  79121. "uc_greedy": "1f6f4",
  79122. "shortnames": [],
  79123. "category": "travel"
  79124. },
  79125. ":scorpion:": {
  79126. "uc_base": "1f982",
  79127. "uc_output": "1f982",
  79128. "uc_match": "1f982",
  79129. "uc_greedy": "1f982",
  79130. "shortnames": [],
  79131. "category": "nature"
  79132. },
  79133. ":scream:": {
  79134. "uc_base": "1f631",
  79135. "uc_output": "1f631",
  79136. "uc_match": "1f631",
  79137. "uc_greedy": "1f631",
  79138. "shortnames": [],
  79139. "category": "people"
  79140. },
  79141. ":scream_cat:": {
  79142. "uc_base": "1f640",
  79143. "uc_output": "1f640",
  79144. "uc_match": "1f640",
  79145. "uc_greedy": "1f640",
  79146. "shortnames": [],
  79147. "category": "people"
  79148. },
  79149. ":scroll:": {
  79150. "uc_base": "1f4dc",
  79151. "uc_output": "1f4dc",
  79152. "uc_match": "1f4dc",
  79153. "uc_greedy": "1f4dc",
  79154. "shortnames": [],
  79155. "category": "objects"
  79156. },
  79157. ":seat:": {
  79158. "uc_base": "1f4ba",
  79159. "uc_output": "1f4ba",
  79160. "uc_match": "1f4ba",
  79161. "uc_greedy": "1f4ba",
  79162. "shortnames": [],
  79163. "category": "travel"
  79164. },
  79165. ":second_place:": {
  79166. "uc_base": "1f948",
  79167. "uc_output": "1f948",
  79168. "uc_match": "1f948",
  79169. "uc_greedy": "1f948",
  79170. "shortnames": [":second_place_medal:"],
  79171. "category": "activity"
  79172. },
  79173. ":see_no_evil:": {
  79174. "uc_base": "1f648",
  79175. "uc_output": "1f648",
  79176. "uc_match": "1f648",
  79177. "uc_greedy": "1f648",
  79178. "shortnames": [],
  79179. "category": "nature"
  79180. },
  79181. ":seedling:": {
  79182. "uc_base": "1f331",
  79183. "uc_output": "1f331",
  79184. "uc_match": "1f331",
  79185. "uc_greedy": "1f331",
  79186. "shortnames": [],
  79187. "category": "nature"
  79188. },
  79189. ":selfie:": {
  79190. "uc_base": "1f933",
  79191. "uc_output": "1f933",
  79192. "uc_match": "1f933",
  79193. "uc_greedy": "1f933",
  79194. "shortnames": [],
  79195. "category": "people"
  79196. },
  79197. ":shallow_pan_of_food:": {
  79198. "uc_base": "1f958",
  79199. "uc_output": "1f958",
  79200. "uc_match": "1f958",
  79201. "uc_greedy": "1f958",
  79202. "shortnames": [":paella:"],
  79203. "category": "food"
  79204. },
  79205. ":shark:": {
  79206. "uc_base": "1f988",
  79207. "uc_output": "1f988",
  79208. "uc_match": "1f988",
  79209. "uc_greedy": "1f988",
  79210. "shortnames": [],
  79211. "category": "nature"
  79212. },
  79213. ":shaved_ice:": {
  79214. "uc_base": "1f367",
  79215. "uc_output": "1f367",
  79216. "uc_match": "1f367",
  79217. "uc_greedy": "1f367",
  79218. "shortnames": [],
  79219. "category": "food"
  79220. },
  79221. ":sheep:": {
  79222. "uc_base": "1f411",
  79223. "uc_output": "1f411",
  79224. "uc_match": "1f411",
  79225. "uc_greedy": "1f411",
  79226. "shortnames": [],
  79227. "category": "nature"
  79228. },
  79229. ":shell:": {
  79230. "uc_base": "1f41a",
  79231. "uc_output": "1f41a",
  79232. "uc_match": "1f41a",
  79233. "uc_greedy": "1f41a",
  79234. "shortnames": [],
  79235. "category": "nature"
  79236. },
  79237. ":shield:": {
  79238. "uc_base": "1f6e1",
  79239. "uc_output": "1f6e1",
  79240. "uc_match": "1f6e1-fe0f",
  79241. "uc_greedy": "1f6e1-fe0f",
  79242. "shortnames": [],
  79243. "category": "objects"
  79244. },
  79245. ":ship:": {
  79246. "uc_base": "1f6a2",
  79247. "uc_output": "1f6a2",
  79248. "uc_match": "1f6a2",
  79249. "uc_greedy": "1f6a2",
  79250. "shortnames": [],
  79251. "category": "travel"
  79252. },
  79253. ":shirt:": {
  79254. "uc_base": "1f455",
  79255. "uc_output": "1f455",
  79256. "uc_match": "1f455",
  79257. "uc_greedy": "1f455",
  79258. "shortnames": [],
  79259. "category": "people"
  79260. },
  79261. ":shopping_bags:": {
  79262. "uc_base": "1f6cd",
  79263. "uc_output": "1f6cd",
  79264. "uc_match": "1f6cd-fe0f",
  79265. "uc_greedy": "1f6cd-fe0f",
  79266. "shortnames": [],
  79267. "category": "objects"
  79268. },
  79269. ":shopping_cart:": {
  79270. "uc_base": "1f6d2",
  79271. "uc_output": "1f6d2",
  79272. "uc_match": "1f6d2",
  79273. "uc_greedy": "1f6d2",
  79274. "shortnames": [":shopping_trolley:"],
  79275. "category": "objects"
  79276. },
  79277. ":shower:": {
  79278. "uc_base": "1f6bf",
  79279. "uc_output": "1f6bf",
  79280. "uc_match": "1f6bf",
  79281. "uc_greedy": "1f6bf",
  79282. "shortnames": [],
  79283. "category": "objects"
  79284. },
  79285. ":shrimp:": {
  79286. "uc_base": "1f990",
  79287. "uc_output": "1f990",
  79288. "uc_match": "1f990",
  79289. "uc_greedy": "1f990",
  79290. "shortnames": [],
  79291. "category": "nature"
  79292. },
  79293. ":shushing_face:": {
  79294. "uc_base": "1f92b",
  79295. "uc_output": "1f92b",
  79296. "uc_match": "1f92b",
  79297. "uc_greedy": "1f92b",
  79298. "shortnames": [],
  79299. "category": "people"
  79300. },
  79301. ":signal_strength:": {
  79302. "uc_base": "1f4f6",
  79303. "uc_output": "1f4f6",
  79304. "uc_match": "1f4f6",
  79305. "uc_greedy": "1f4f6",
  79306. "shortnames": [],
  79307. "category": "symbols"
  79308. },
  79309. ":six_pointed_star:": {
  79310. "uc_base": "1f52f",
  79311. "uc_output": "1f52f",
  79312. "uc_match": "1f52f",
  79313. "uc_greedy": "1f52f",
  79314. "shortnames": [],
  79315. "category": "symbols"
  79316. },
  79317. ":ski:": {
  79318. "uc_base": "1f3bf",
  79319. "uc_output": "1f3bf",
  79320. "uc_match": "1f3bf",
  79321. "uc_greedy": "1f3bf",
  79322. "shortnames": [],
  79323. "category": "activity"
  79324. },
  79325. ":skull:": {
  79326. "uc_base": "1f480",
  79327. "uc_output": "1f480",
  79328. "uc_match": "1f480",
  79329. "uc_greedy": "1f480",
  79330. "shortnames": [":skeleton:"],
  79331. "category": "people"
  79332. },
  79333. ":sled:": {
  79334. "uc_base": "1f6f7",
  79335. "uc_output": "1f6f7",
  79336. "uc_match": "1f6f7",
  79337. "uc_greedy": "1f6f7",
  79338. "shortnames": [],
  79339. "category": "activity"
  79340. },
  79341. ":sleeping:": {
  79342. "uc_base": "1f634",
  79343. "uc_output": "1f634",
  79344. "uc_match": "1f634",
  79345. "uc_greedy": "1f634",
  79346. "shortnames": [],
  79347. "category": "people"
  79348. },
  79349. ":sleeping_accommodation:": {
  79350. "uc_base": "1f6cc",
  79351. "uc_output": "1f6cc",
  79352. "uc_match": "1f6cc",
  79353. "uc_greedy": "1f6cc",
  79354. "shortnames": [],
  79355. "category": "objects"
  79356. },
  79357. ":sleepy:": {
  79358. "uc_base": "1f62a",
  79359. "uc_output": "1f62a",
  79360. "uc_match": "1f62a",
  79361. "uc_greedy": "1f62a",
  79362. "shortnames": [],
  79363. "category": "people"
  79364. },
  79365. ":slight_frown:": {
  79366. "uc_base": "1f641",
  79367. "uc_output": "1f641",
  79368. "uc_match": "1f641",
  79369. "uc_greedy": "1f641",
  79370. "shortnames": [":slightly_frowning_face:"],
  79371. "category": "people"
  79372. },
  79373. ":slight_smile:": {
  79374. "uc_base": "1f642",
  79375. "uc_output": "1f642",
  79376. "uc_match": "1f642",
  79377. "uc_greedy": "1f642",
  79378. "shortnames": [":slightly_smiling_face:"],
  79379. "category": "people"
  79380. },
  79381. ":slot_machine:": {
  79382. "uc_base": "1f3b0",
  79383. "uc_output": "1f3b0",
  79384. "uc_match": "1f3b0",
  79385. "uc_greedy": "1f3b0",
  79386. "shortnames": [],
  79387. "category": "activity"
  79388. },
  79389. ":small_blue_diamond:": {
  79390. "uc_base": "1f539",
  79391. "uc_output": "1f539",
  79392. "uc_match": "1f539",
  79393. "uc_greedy": "1f539",
  79394. "shortnames": [],
  79395. "category": "symbols"
  79396. },
  79397. ":small_orange_diamond:": {
  79398. "uc_base": "1f538",
  79399. "uc_output": "1f538",
  79400. "uc_match": "1f538",
  79401. "uc_greedy": "1f538",
  79402. "shortnames": [],
  79403. "category": "symbols"
  79404. },
  79405. ":small_red_triangle:": {
  79406. "uc_base": "1f53a",
  79407. "uc_output": "1f53a",
  79408. "uc_match": "1f53a",
  79409. "uc_greedy": "1f53a",
  79410. "shortnames": [],
  79411. "category": "symbols"
  79412. },
  79413. ":small_red_triangle_down:": {
  79414. "uc_base": "1f53b",
  79415. "uc_output": "1f53b",
  79416. "uc_match": "1f53b",
  79417. "uc_greedy": "1f53b",
  79418. "shortnames": [],
  79419. "category": "symbols"
  79420. },
  79421. ":smile:": {
  79422. "uc_base": "1f604",
  79423. "uc_output": "1f604",
  79424. "uc_match": "1f604",
  79425. "uc_greedy": "1f604",
  79426. "shortnames": [],
  79427. "category": "people"
  79428. },
  79429. ":smile_cat:": {
  79430. "uc_base": "1f638",
  79431. "uc_output": "1f638",
  79432. "uc_match": "1f638",
  79433. "uc_greedy": "1f638",
  79434. "shortnames": [],
  79435. "category": "people"
  79436. },
  79437. ":smiley:": {
  79438. "uc_base": "1f603",
  79439. "uc_output": "1f603",
  79440. "uc_match": "1f603",
  79441. "uc_greedy": "1f603",
  79442. "shortnames": [],
  79443. "category": "people"
  79444. },
  79445. ":smiley_cat:": {
  79446. "uc_base": "1f63a",
  79447. "uc_output": "1f63a",
  79448. "uc_match": "1f63a",
  79449. "uc_greedy": "1f63a",
  79450. "shortnames": [],
  79451. "category": "people"
  79452. },
  79453. ":smiling_imp:": {
  79454. "uc_base": "1f608",
  79455. "uc_output": "1f608",
  79456. "uc_match": "1f608",
  79457. "uc_greedy": "1f608",
  79458. "shortnames": [],
  79459. "category": "people"
  79460. },
  79461. ":smirk:": {
  79462. "uc_base": "1f60f",
  79463. "uc_output": "1f60f",
  79464. "uc_match": "1f60f",
  79465. "uc_greedy": "1f60f",
  79466. "shortnames": [],
  79467. "category": "people"
  79468. },
  79469. ":smirk_cat:": {
  79470. "uc_base": "1f63c",
  79471. "uc_output": "1f63c",
  79472. "uc_match": "1f63c",
  79473. "uc_greedy": "1f63c",
  79474. "shortnames": [],
  79475. "category": "people"
  79476. },
  79477. ":smoking:": {
  79478. "uc_base": "1f6ac",
  79479. "uc_output": "1f6ac",
  79480. "uc_match": "1f6ac",
  79481. "uc_greedy": "1f6ac",
  79482. "shortnames": [],
  79483. "category": "objects"
  79484. },
  79485. ":snail:": {
  79486. "uc_base": "1f40c",
  79487. "uc_output": "1f40c",
  79488. "uc_match": "1f40c",
  79489. "uc_greedy": "1f40c",
  79490. "shortnames": [],
  79491. "category": "nature"
  79492. },
  79493. ":snake:": {
  79494. "uc_base": "1f40d",
  79495. "uc_output": "1f40d",
  79496. "uc_match": "1f40d",
  79497. "uc_greedy": "1f40d",
  79498. "shortnames": [],
  79499. "category": "nature"
  79500. },
  79501. ":sneezing_face:": {
  79502. "uc_base": "1f927",
  79503. "uc_output": "1f927",
  79504. "uc_match": "1f927",
  79505. "uc_greedy": "1f927",
  79506. "shortnames": [":sneeze:"],
  79507. "category": "people"
  79508. },
  79509. ":snowboarder:": {
  79510. "uc_base": "1f3c2",
  79511. "uc_output": "1f3c2",
  79512. "uc_match": "1f3c2-fe0f",
  79513. "uc_greedy": "1f3c2-fe0f",
  79514. "shortnames": [],
  79515. "category": "activity"
  79516. },
  79517. ":sob:": {
  79518. "uc_base": "1f62d",
  79519. "uc_output": "1f62d",
  79520. "uc_match": "1f62d",
  79521. "uc_greedy": "1f62d",
  79522. "shortnames": [],
  79523. "category": "people"
  79524. },
  79525. ":socks:": {
  79526. "uc_base": "1f9e6",
  79527. "uc_output": "1f9e6",
  79528. "uc_match": "1f9e6",
  79529. "uc_greedy": "1f9e6",
  79530. "shortnames": [],
  79531. "category": "people"
  79532. },
  79533. ":soon:": {
  79534. "uc_base": "1f51c",
  79535. "uc_output": "1f51c",
  79536. "uc_match": "1f51c",
  79537. "uc_greedy": "1f51c",
  79538. "shortnames": [],
  79539. "category": "symbols"
  79540. },
  79541. ":sos:": {
  79542. "uc_base": "1f198",
  79543. "uc_output": "1f198",
  79544. "uc_match": "1f198",
  79545. "uc_greedy": "1f198",
  79546. "shortnames": [],
  79547. "category": "symbols"
  79548. },
  79549. ":sound:": {
  79550. "uc_base": "1f509",
  79551. "uc_output": "1f509",
  79552. "uc_match": "1f509",
  79553. "uc_greedy": "1f509",
  79554. "shortnames": [],
  79555. "category": "symbols"
  79556. },
  79557. ":space_invader:": {
  79558. "uc_base": "1f47e",
  79559. "uc_output": "1f47e",
  79560. "uc_match": "1f47e",
  79561. "uc_greedy": "1f47e",
  79562. "shortnames": [],
  79563. "category": "people"
  79564. },
  79565. ":spaghetti:": {
  79566. "uc_base": "1f35d",
  79567. "uc_output": "1f35d",
  79568. "uc_match": "1f35d",
  79569. "uc_greedy": "1f35d",
  79570. "shortnames": [],
  79571. "category": "food"
  79572. },
  79573. ":sparkler:": {
  79574. "uc_base": "1f387",
  79575. "uc_output": "1f387",
  79576. "uc_match": "1f387",
  79577. "uc_greedy": "1f387",
  79578. "shortnames": [],
  79579. "category": "travel"
  79580. },
  79581. ":sparkling_heart:": {
  79582. "uc_base": "1f496",
  79583. "uc_output": "1f496",
  79584. "uc_match": "1f496",
  79585. "uc_greedy": "1f496",
  79586. "shortnames": [],
  79587. "category": "symbols"
  79588. },
  79589. ":speak_no_evil:": {
  79590. "uc_base": "1f64a",
  79591. "uc_output": "1f64a",
  79592. "uc_match": "1f64a",
  79593. "uc_greedy": "1f64a",
  79594. "shortnames": [],
  79595. "category": "nature"
  79596. },
  79597. ":speaker:": {
  79598. "uc_base": "1f508",
  79599. "uc_output": "1f508",
  79600. "uc_match": "1f508-fe0f",
  79601. "uc_greedy": "1f508-fe0f",
  79602. "shortnames": [],
  79603. "category": "symbols"
  79604. },
  79605. ":speaking_head:": {
  79606. "uc_base": "1f5e3",
  79607. "uc_output": "1f5e3",
  79608. "uc_match": "1f5e3-fe0f",
  79609. "uc_greedy": "1f5e3-fe0f",
  79610. "shortnames": [":speaking_head_in_silhouette:"],
  79611. "category": "people"
  79612. },
  79613. ":speech_balloon:": {
  79614. "uc_base": "1f4ac",
  79615. "uc_output": "1f4ac",
  79616. "uc_match": "1f4ac",
  79617. "uc_greedy": "1f4ac",
  79618. "shortnames": [],
  79619. "category": "symbols"
  79620. },
  79621. ":speech_left:": {
  79622. "uc_base": "1f5e8",
  79623. "uc_output": "1f5e8",
  79624. "uc_match": "1f5e8-fe0f",
  79625. "uc_greedy": "1f5e8-fe0f",
  79626. "shortnames": [":left_speech_bubble:"],
  79627. "category": "symbols"
  79628. },
  79629. ":speedboat:": {
  79630. "uc_base": "1f6a4",
  79631. "uc_output": "1f6a4",
  79632. "uc_match": "1f6a4",
  79633. "uc_greedy": "1f6a4",
  79634. "shortnames": [],
  79635. "category": "travel"
  79636. },
  79637. ":spider:": {
  79638. "uc_base": "1f577",
  79639. "uc_output": "1f577",
  79640. "uc_match": "1f577-fe0f",
  79641. "uc_greedy": "1f577-fe0f",
  79642. "shortnames": [],
  79643. "category": "nature"
  79644. },
  79645. ":spider_web:": {
  79646. "uc_base": "1f578",
  79647. "uc_output": "1f578",
  79648. "uc_match": "1f578-fe0f",
  79649. "uc_greedy": "1f578-fe0f",
  79650. "shortnames": [],
  79651. "category": "nature"
  79652. },
  79653. ":spoon:": {
  79654. "uc_base": "1f944",
  79655. "uc_output": "1f944",
  79656. "uc_match": "1f944",
  79657. "uc_greedy": "1f944",
  79658. "shortnames": [],
  79659. "category": "food"
  79660. },
  79661. ":squid:": {
  79662. "uc_base": "1f991",
  79663. "uc_output": "1f991",
  79664. "uc_match": "1f991",
  79665. "uc_greedy": "1f991",
  79666. "shortnames": [],
  79667. "category": "nature"
  79668. },
  79669. ":stadium:": {
  79670. "uc_base": "1f3df",
  79671. "uc_output": "1f3df",
  79672. "uc_match": "1f3df-fe0f",
  79673. "uc_greedy": "1f3df-fe0f",
  79674. "shortnames": [],
  79675. "category": "travel"
  79676. },
  79677. ":star2:": {
  79678. "uc_base": "1f31f",
  79679. "uc_output": "1f31f",
  79680. "uc_match": "1f31f",
  79681. "uc_greedy": "1f31f",
  79682. "shortnames": [],
  79683. "category": "nature"
  79684. },
  79685. ":star_struck:": {
  79686. "uc_base": "1f929",
  79687. "uc_output": "1f929",
  79688. "uc_match": "1f929",
  79689. "uc_greedy": "1f929",
  79690. "shortnames": [],
  79691. "category": "people"
  79692. },
  79693. ":stars:": {
  79694. "uc_base": "1f320",
  79695. "uc_output": "1f320",
  79696. "uc_match": "1f320",
  79697. "uc_greedy": "1f320",
  79698. "shortnames": [],
  79699. "category": "travel"
  79700. },
  79701. ":station:": {
  79702. "uc_base": "1f689",
  79703. "uc_output": "1f689",
  79704. "uc_match": "1f689",
  79705. "uc_greedy": "1f689",
  79706. "shortnames": [],
  79707. "category": "travel"
  79708. },
  79709. ":statue_of_liberty:": {
  79710. "uc_base": "1f5fd",
  79711. "uc_output": "1f5fd",
  79712. "uc_match": "1f5fd",
  79713. "uc_greedy": "1f5fd",
  79714. "shortnames": [],
  79715. "category": "travel"
  79716. },
  79717. ":steam_locomotive:": {
  79718. "uc_base": "1f682",
  79719. "uc_output": "1f682",
  79720. "uc_match": "1f682",
  79721. "uc_greedy": "1f682",
  79722. "shortnames": [],
  79723. "category": "travel"
  79724. },
  79725. ":stew:": {
  79726. "uc_base": "1f372",
  79727. "uc_output": "1f372",
  79728. "uc_match": "1f372",
  79729. "uc_greedy": "1f372",
  79730. "shortnames": [],
  79731. "category": "food"
  79732. },
  79733. ":straight_ruler:": {
  79734. "uc_base": "1f4cf",
  79735. "uc_output": "1f4cf",
  79736. "uc_match": "1f4cf",
  79737. "uc_greedy": "1f4cf",
  79738. "shortnames": [],
  79739. "category": "objects"
  79740. },
  79741. ":strawberry:": {
  79742. "uc_base": "1f353",
  79743. "uc_output": "1f353",
  79744. "uc_match": "1f353",
  79745. "uc_greedy": "1f353",
  79746. "shortnames": [],
  79747. "category": "food"
  79748. },
  79749. ":stuck_out_tongue:": {
  79750. "uc_base": "1f61b",
  79751. "uc_output": "1f61b",
  79752. "uc_match": "1f61b",
  79753. "uc_greedy": "1f61b",
  79754. "shortnames": [],
  79755. "category": "people"
  79756. },
  79757. ":stuck_out_tongue_closed_eyes:": {
  79758. "uc_base": "1f61d",
  79759. "uc_output": "1f61d",
  79760. "uc_match": "1f61d",
  79761. "uc_greedy": "1f61d",
  79762. "shortnames": [],
  79763. "category": "people"
  79764. },
  79765. ":stuck_out_tongue_winking_eye:": {
  79766. "uc_base": "1f61c",
  79767. "uc_output": "1f61c",
  79768. "uc_match": "1f61c",
  79769. "uc_greedy": "1f61c",
  79770. "shortnames": [],
  79771. "category": "people"
  79772. },
  79773. ":stuffed_flatbread:": {
  79774. "uc_base": "1f959",
  79775. "uc_output": "1f959",
  79776. "uc_match": "1f959",
  79777. "uc_greedy": "1f959",
  79778. "shortnames": [":stuffed_pita:"],
  79779. "category": "food"
  79780. },
  79781. ":sun_with_face:": {
  79782. "uc_base": "1f31e",
  79783. "uc_output": "1f31e",
  79784. "uc_match": "1f31e",
  79785. "uc_greedy": "1f31e",
  79786. "shortnames": [],
  79787. "category": "nature"
  79788. },
  79789. ":sunflower:": {
  79790. "uc_base": "1f33b",
  79791. "uc_output": "1f33b",
  79792. "uc_match": "1f33b",
  79793. "uc_greedy": "1f33b",
  79794. "shortnames": [],
  79795. "category": "nature"
  79796. },
  79797. ":sunglasses:": {
  79798. "uc_base": "1f60e",
  79799. "uc_output": "1f60e",
  79800. "uc_match": "1f60e",
  79801. "uc_greedy": "1f60e",
  79802. "shortnames": [],
  79803. "category": "people"
  79804. },
  79805. ":sunrise:": {
  79806. "uc_base": "1f305",
  79807. "uc_output": "1f305",
  79808. "uc_match": "1f305",
  79809. "uc_greedy": "1f305",
  79810. "shortnames": [],
  79811. "category": "travel"
  79812. },
  79813. ":sunrise_over_mountains:": {
  79814. "uc_base": "1f304",
  79815. "uc_output": "1f304",
  79816. "uc_match": "1f304",
  79817. "uc_greedy": "1f304",
  79818. "shortnames": [],
  79819. "category": "travel"
  79820. },
  79821. ":sushi:": {
  79822. "uc_base": "1f363",
  79823. "uc_output": "1f363",
  79824. "uc_match": "1f363",
  79825. "uc_greedy": "1f363",
  79826. "shortnames": [],
  79827. "category": "food"
  79828. },
  79829. ":suspension_railway:": {
  79830. "uc_base": "1f69f",
  79831. "uc_output": "1f69f",
  79832. "uc_match": "1f69f",
  79833. "uc_greedy": "1f69f",
  79834. "shortnames": [],
  79835. "category": "travel"
  79836. },
  79837. ":sweat:": {
  79838. "uc_base": "1f613",
  79839. "uc_output": "1f613",
  79840. "uc_match": "1f613",
  79841. "uc_greedy": "1f613",
  79842. "shortnames": [],
  79843. "category": "people"
  79844. },
  79845. ":sweat_drops:": {
  79846. "uc_base": "1f4a6",
  79847. "uc_output": "1f4a6",
  79848. "uc_match": "1f4a6",
  79849. "uc_greedy": "1f4a6",
  79850. "shortnames": [],
  79851. "category": "nature"
  79852. },
  79853. ":sweat_smile:": {
  79854. "uc_base": "1f605",
  79855. "uc_output": "1f605",
  79856. "uc_match": "1f605",
  79857. "uc_greedy": "1f605",
  79858. "shortnames": [],
  79859. "category": "people"
  79860. },
  79861. ":sweet_potato:": {
  79862. "uc_base": "1f360",
  79863. "uc_output": "1f360",
  79864. "uc_match": "1f360",
  79865. "uc_greedy": "1f360",
  79866. "shortnames": [],
  79867. "category": "food"
  79868. },
  79869. ":symbols:": {
  79870. "uc_base": "1f523",
  79871. "uc_output": "1f523",
  79872. "uc_match": "1f523",
  79873. "uc_greedy": "1f523",
  79874. "shortnames": [],
  79875. "category": "symbols"
  79876. },
  79877. ":synagogue:": {
  79878. "uc_base": "1f54d",
  79879. "uc_output": "1f54d",
  79880. "uc_match": "1f54d",
  79881. "uc_greedy": "1f54d",
  79882. "shortnames": [],
  79883. "category": "travel"
  79884. },
  79885. ":syringe:": {
  79886. "uc_base": "1f489",
  79887. "uc_output": "1f489",
  79888. "uc_match": "1f489",
  79889. "uc_greedy": "1f489",
  79890. "shortnames": [],
  79891. "category": "objects"
  79892. },
  79893. ":t_rex:": {
  79894. "uc_base": "1f996",
  79895. "uc_output": "1f996",
  79896. "uc_match": "1f996",
  79897. "uc_greedy": "1f996",
  79898. "shortnames": [],
  79899. "category": "nature"
  79900. },
  79901. ":taco:": {
  79902. "uc_base": "1f32e",
  79903. "uc_output": "1f32e",
  79904. "uc_match": "1f32e",
  79905. "uc_greedy": "1f32e",
  79906. "shortnames": [],
  79907. "category": "food"
  79908. },
  79909. ":tada:": {
  79910. "uc_base": "1f389",
  79911. "uc_output": "1f389",
  79912. "uc_match": "1f389",
  79913. "uc_greedy": "1f389",
  79914. "shortnames": [],
  79915. "category": "objects"
  79916. },
  79917. ":takeout_box:": {
  79918. "uc_base": "1f961",
  79919. "uc_output": "1f961",
  79920. "uc_match": "1f961",
  79921. "uc_greedy": "1f961",
  79922. "shortnames": [],
  79923. "category": "food"
  79924. },
  79925. ":tanabata_tree:": {
  79926. "uc_base": "1f38b",
  79927. "uc_output": "1f38b",
  79928. "uc_match": "1f38b",
  79929. "uc_greedy": "1f38b",
  79930. "shortnames": [],
  79931. "category": "nature"
  79932. },
  79933. ":tangerine:": {
  79934. "uc_base": "1f34a",
  79935. "uc_output": "1f34a",
  79936. "uc_match": "1f34a",
  79937. "uc_greedy": "1f34a",
  79938. "shortnames": [],
  79939. "category": "food"
  79940. },
  79941. ":taxi:": {
  79942. "uc_base": "1f695",
  79943. "uc_output": "1f695",
  79944. "uc_match": "1f695",
  79945. "uc_greedy": "1f695",
  79946. "shortnames": [],
  79947. "category": "travel"
  79948. },
  79949. ":tea:": {
  79950. "uc_base": "1f375",
  79951. "uc_output": "1f375",
  79952. "uc_match": "1f375",
  79953. "uc_greedy": "1f375",
  79954. "shortnames": [],
  79955. "category": "food"
  79956. },
  79957. ":telephone_receiver:": {
  79958. "uc_base": "1f4de",
  79959. "uc_output": "1f4de",
  79960. "uc_match": "1f4de",
  79961. "uc_greedy": "1f4de",
  79962. "shortnames": [],
  79963. "category": "objects"
  79964. },
  79965. ":telescope:": {
  79966. "uc_base": "1f52d",
  79967. "uc_output": "1f52d",
  79968. "uc_match": "1f52d",
  79969. "uc_greedy": "1f52d",
  79970. "shortnames": [],
  79971. "category": "objects"
  79972. },
  79973. ":tennis:": {
  79974. "uc_base": "1f3be",
  79975. "uc_output": "1f3be",
  79976. "uc_match": "1f3be",
  79977. "uc_greedy": "1f3be",
  79978. "shortnames": [],
  79979. "category": "activity"
  79980. },
  79981. ":thermometer:": {
  79982. "uc_base": "1f321",
  79983. "uc_output": "1f321",
  79984. "uc_match": "1f321-fe0f",
  79985. "uc_greedy": "1f321-fe0f",
  79986. "shortnames": [],
  79987. "category": "objects"
  79988. },
  79989. ":thermometer_face:": {
  79990. "uc_base": "1f912",
  79991. "uc_output": "1f912",
  79992. "uc_match": "1f912",
  79993. "uc_greedy": "1f912",
  79994. "shortnames": [":face_with_thermometer:"],
  79995. "category": "people"
  79996. },
  79997. ":thinking:": {
  79998. "uc_base": "1f914",
  79999. "uc_output": "1f914",
  80000. "uc_match": "1f914",
  80001. "uc_greedy": "1f914",
  80002. "shortnames": [":thinking_face:"],
  80003. "category": "people"
  80004. },
  80005. ":third_place:": {
  80006. "uc_base": "1f949",
  80007. "uc_output": "1f949",
  80008. "uc_match": "1f949",
  80009. "uc_greedy": "1f949",
  80010. "shortnames": [":third_place_medal:"],
  80011. "category": "activity"
  80012. },
  80013. ":thought_balloon:": {
  80014. "uc_base": "1f4ad",
  80015. "uc_output": "1f4ad",
  80016. "uc_match": "1f4ad",
  80017. "uc_greedy": "1f4ad",
  80018. "shortnames": [],
  80019. "category": "symbols"
  80020. },
  80021. ":thumbsdown:": {
  80022. "uc_base": "1f44e",
  80023. "uc_output": "1f44e",
  80024. "uc_match": "1f44e-fe0f",
  80025. "uc_greedy": "1f44e-fe0f",
  80026. "shortnames": [":-1:", ":thumbdown:"],
  80027. "category": "people"
  80028. },
  80029. ":thumbsup:": {
  80030. "uc_base": "1f44d",
  80031. "uc_output": "1f44d",
  80032. "uc_match": "1f44d-fe0f",
  80033. "uc_greedy": "1f44d-fe0f",
  80034. "shortnames": [":+1:", ":thumbup:"],
  80035. "category": "people"
  80036. },
  80037. ":ticket:": {
  80038. "uc_base": "1f3ab",
  80039. "uc_output": "1f3ab",
  80040. "uc_match": "1f3ab",
  80041. "uc_greedy": "1f3ab",
  80042. "shortnames": [],
  80043. "category": "activity"
  80044. },
  80045. ":tickets:": {
  80046. "uc_base": "1f39f",
  80047. "uc_output": "1f39f",
  80048. "uc_match": "1f39f-fe0f",
  80049. "uc_greedy": "1f39f-fe0f",
  80050. "shortnames": [":admission_tickets:"],
  80051. "category": "activity"
  80052. },
  80053. ":tiger2:": {
  80054. "uc_base": "1f405",
  80055. "uc_output": "1f405",
  80056. "uc_match": "1f405",
  80057. "uc_greedy": "1f405",
  80058. "shortnames": [],
  80059. "category": "nature"
  80060. },
  80061. ":tiger:": {
  80062. "uc_base": "1f42f",
  80063. "uc_output": "1f42f",
  80064. "uc_match": "1f42f",
  80065. "uc_greedy": "1f42f",
  80066. "shortnames": [],
  80067. "category": "nature"
  80068. },
  80069. ":tired_face:": {
  80070. "uc_base": "1f62b",
  80071. "uc_output": "1f62b",
  80072. "uc_match": "1f62b",
  80073. "uc_greedy": "1f62b",
  80074. "shortnames": [],
  80075. "category": "people"
  80076. },
  80077. ":toilet:": {
  80078. "uc_base": "1f6bd",
  80079. "uc_output": "1f6bd",
  80080. "uc_match": "1f6bd",
  80081. "uc_greedy": "1f6bd",
  80082. "shortnames": [],
  80083. "category": "objects"
  80084. },
  80085. ":tokyo_tower:": {
  80086. "uc_base": "1f5fc",
  80087. "uc_output": "1f5fc",
  80088. "uc_match": "1f5fc",
  80089. "uc_greedy": "1f5fc",
  80090. "shortnames": [],
  80091. "category": "travel"
  80092. },
  80093. ":tomato:": {
  80094. "uc_base": "1f345",
  80095. "uc_output": "1f345",
  80096. "uc_match": "1f345",
  80097. "uc_greedy": "1f345",
  80098. "shortnames": [],
  80099. "category": "food"
  80100. },
  80101. ":tone1:": {
  80102. "uc_base": "1f3fb",
  80103. "uc_output": "1f3fb",
  80104. "uc_match": "1f3fb",
  80105. "uc_greedy": "1f3fb",
  80106. "shortnames": [],
  80107. "category": "modifier"
  80108. },
  80109. ":tone2:": {
  80110. "uc_base": "1f3fc",
  80111. "uc_output": "1f3fc",
  80112. "uc_match": "1f3fc",
  80113. "uc_greedy": "1f3fc",
  80114. "shortnames": [],
  80115. "category": "modifier"
  80116. },
  80117. ":tone3:": {
  80118. "uc_base": "1f3fd",
  80119. "uc_output": "1f3fd",
  80120. "uc_match": "1f3fd",
  80121. "uc_greedy": "1f3fd",
  80122. "shortnames": [],
  80123. "category": "modifier"
  80124. },
  80125. ":tone4:": {
  80126. "uc_base": "1f3fe",
  80127. "uc_output": "1f3fe",
  80128. "uc_match": "1f3fe",
  80129. "uc_greedy": "1f3fe",
  80130. "shortnames": [],
  80131. "category": "modifier"
  80132. },
  80133. ":tone5:": {
  80134. "uc_base": "1f3ff",
  80135. "uc_output": "1f3ff",
  80136. "uc_match": "1f3ff",
  80137. "uc_greedy": "1f3ff",
  80138. "shortnames": [],
  80139. "category": "modifier"
  80140. },
  80141. ":tongue:": {
  80142. "uc_base": "1f445",
  80143. "uc_output": "1f445",
  80144. "uc_match": "1f445",
  80145. "uc_greedy": "1f445",
  80146. "shortnames": [],
  80147. "category": "people"
  80148. },
  80149. ":tools:": {
  80150. "uc_base": "1f6e0",
  80151. "uc_output": "1f6e0",
  80152. "uc_match": "1f6e0-fe0f",
  80153. "uc_greedy": "1f6e0-fe0f",
  80154. "shortnames": [":hammer_and_wrench:"],
  80155. "category": "objects"
  80156. },
  80157. ":top:": {
  80158. "uc_base": "1f51d",
  80159. "uc_output": "1f51d",
  80160. "uc_match": "1f51d",
  80161. "uc_greedy": "1f51d",
  80162. "shortnames": [],
  80163. "category": "symbols"
  80164. },
  80165. ":tophat:": {
  80166. "uc_base": "1f3a9",
  80167. "uc_output": "1f3a9",
  80168. "uc_match": "1f3a9",
  80169. "uc_greedy": "1f3a9",
  80170. "shortnames": [],
  80171. "category": "people"
  80172. },
  80173. ":trackball:": {
  80174. "uc_base": "1f5b2",
  80175. "uc_output": "1f5b2",
  80176. "uc_match": "1f5b2-fe0f",
  80177. "uc_greedy": "1f5b2-fe0f",
  80178. "shortnames": [],
  80179. "category": "objects"
  80180. },
  80181. ":tractor:": {
  80182. "uc_base": "1f69c",
  80183. "uc_output": "1f69c",
  80184. "uc_match": "1f69c",
  80185. "uc_greedy": "1f69c",
  80186. "shortnames": [],
  80187. "category": "travel"
  80188. },
  80189. ":traffic_light:": {
  80190. "uc_base": "1f6a5",
  80191. "uc_output": "1f6a5",
  80192. "uc_match": "1f6a5",
  80193. "uc_greedy": "1f6a5",
  80194. "shortnames": [],
  80195. "category": "travel"
  80196. },
  80197. ":train2:": {
  80198. "uc_base": "1f686",
  80199. "uc_output": "1f686",
  80200. "uc_match": "1f686",
  80201. "uc_greedy": "1f686",
  80202. "shortnames": [],
  80203. "category": "travel"
  80204. },
  80205. ":train:": {
  80206. "uc_base": "1f68b",
  80207. "uc_output": "1f68b",
  80208. "uc_match": "1f68b",
  80209. "uc_greedy": "1f68b",
  80210. "shortnames": [],
  80211. "category": "travel"
  80212. },
  80213. ":tram:": {
  80214. "uc_base": "1f68a",
  80215. "uc_output": "1f68a",
  80216. "uc_match": "1f68a",
  80217. "uc_greedy": "1f68a",
  80218. "shortnames": [],
  80219. "category": "travel"
  80220. },
  80221. ":triangular_flag_on_post:": {
  80222. "uc_base": "1f6a9",
  80223. "uc_output": "1f6a9",
  80224. "uc_match": "1f6a9",
  80225. "uc_greedy": "1f6a9",
  80226. "shortnames": [],
  80227. "category": "flags"
  80228. },
  80229. ":triangular_ruler:": {
  80230. "uc_base": "1f4d0",
  80231. "uc_output": "1f4d0",
  80232. "uc_match": "1f4d0",
  80233. "uc_greedy": "1f4d0",
  80234. "shortnames": [],
  80235. "category": "objects"
  80236. },
  80237. ":trident:": {
  80238. "uc_base": "1f531",
  80239. "uc_output": "1f531",
  80240. "uc_match": "1f531",
  80241. "uc_greedy": "1f531",
  80242. "shortnames": [],
  80243. "category": "symbols"
  80244. },
  80245. ":triumph:": {
  80246. "uc_base": "1f624",
  80247. "uc_output": "1f624",
  80248. "uc_match": "1f624",
  80249. "uc_greedy": "1f624",
  80250. "shortnames": [],
  80251. "category": "people"
  80252. },
  80253. ":trolleybus:": {
  80254. "uc_base": "1f68e",
  80255. "uc_output": "1f68e",
  80256. "uc_match": "1f68e",
  80257. "uc_greedy": "1f68e",
  80258. "shortnames": [],
  80259. "category": "travel"
  80260. },
  80261. ":trophy:": {
  80262. "uc_base": "1f3c6",
  80263. "uc_output": "1f3c6",
  80264. "uc_match": "1f3c6-fe0f",
  80265. "uc_greedy": "1f3c6-fe0f",
  80266. "shortnames": [],
  80267. "category": "activity"
  80268. },
  80269. ":tropical_drink:": {
  80270. "uc_base": "1f379",
  80271. "uc_output": "1f379",
  80272. "uc_match": "1f379",
  80273. "uc_greedy": "1f379",
  80274. "shortnames": [],
  80275. "category": "food"
  80276. },
  80277. ":tropical_fish:": {
  80278. "uc_base": "1f420",
  80279. "uc_output": "1f420",
  80280. "uc_match": "1f420",
  80281. "uc_greedy": "1f420",
  80282. "shortnames": [],
  80283. "category": "nature"
  80284. },
  80285. ":truck:": {
  80286. "uc_base": "1f69a",
  80287. "uc_output": "1f69a",
  80288. "uc_match": "1f69a",
  80289. "uc_greedy": "1f69a",
  80290. "shortnames": [],
  80291. "category": "travel"
  80292. },
  80293. ":trumpet:": {
  80294. "uc_base": "1f3ba",
  80295. "uc_output": "1f3ba",
  80296. "uc_match": "1f3ba",
  80297. "uc_greedy": "1f3ba",
  80298. "shortnames": [],
  80299. "category": "activity"
  80300. },
  80301. ":tulip:": {
  80302. "uc_base": "1f337",
  80303. "uc_output": "1f337",
  80304. "uc_match": "1f337",
  80305. "uc_greedy": "1f337",
  80306. "shortnames": [],
  80307. "category": "nature"
  80308. },
  80309. ":tumbler_glass:": {
  80310. "uc_base": "1f943",
  80311. "uc_output": "1f943",
  80312. "uc_match": "1f943",
  80313. "uc_greedy": "1f943",
  80314. "shortnames": [":whisky:"],
  80315. "category": "food"
  80316. },
  80317. ":turkey:": {
  80318. "uc_base": "1f983",
  80319. "uc_output": "1f983",
  80320. "uc_match": "1f983",
  80321. "uc_greedy": "1f983",
  80322. "shortnames": [],
  80323. "category": "nature"
  80324. },
  80325. ":turtle:": {
  80326. "uc_base": "1f422",
  80327. "uc_output": "1f422",
  80328. "uc_match": "1f422",
  80329. "uc_greedy": "1f422",
  80330. "shortnames": [],
  80331. "category": "nature"
  80332. },
  80333. ":tv:": {
  80334. "uc_base": "1f4fa",
  80335. "uc_output": "1f4fa",
  80336. "uc_match": "1f4fa-fe0f",
  80337. "uc_greedy": "1f4fa-fe0f",
  80338. "shortnames": [],
  80339. "category": "objects"
  80340. },
  80341. ":twisted_rightwards_arrows:": {
  80342. "uc_base": "1f500",
  80343. "uc_output": "1f500",
  80344. "uc_match": "1f500",
  80345. "uc_greedy": "1f500",
  80346. "shortnames": [],
  80347. "category": "symbols"
  80348. },
  80349. ":two_hearts:": {
  80350. "uc_base": "1f495",
  80351. "uc_output": "1f495",
  80352. "uc_match": "1f495",
  80353. "uc_greedy": "1f495",
  80354. "shortnames": [],
  80355. "category": "symbols"
  80356. },
  80357. ":two_men_holding_hands:": {
  80358. "uc_base": "1f46c",
  80359. "uc_output": "1f46c",
  80360. "uc_match": "1f46c",
  80361. "uc_greedy": "1f46c",
  80362. "shortnames": [],
  80363. "category": "people"
  80364. },
  80365. ":two_women_holding_hands:": {
  80366. "uc_base": "1f46d",
  80367. "uc_output": "1f46d",
  80368. "uc_match": "1f46d",
  80369. "uc_greedy": "1f46d",
  80370. "shortnames": [],
  80371. "category": "people"
  80372. },
  80373. ":u5272:": {
  80374. "uc_base": "1f239",
  80375. "uc_output": "1f239",
  80376. "uc_match": "1f239",
  80377. "uc_greedy": "1f239",
  80378. "shortnames": [],
  80379. "category": "symbols"
  80380. },
  80381. ":u5408:": {
  80382. "uc_base": "1f234",
  80383. "uc_output": "1f234",
  80384. "uc_match": "1f234",
  80385. "uc_greedy": "1f234",
  80386. "shortnames": [],
  80387. "category": "symbols"
  80388. },
  80389. ":u55b6:": {
  80390. "uc_base": "1f23a",
  80391. "uc_output": "1f23a",
  80392. "uc_match": "1f23a",
  80393. "uc_greedy": "1f23a",
  80394. "shortnames": [],
  80395. "category": "symbols"
  80396. },
  80397. ":u6307:": {
  80398. "uc_base": "1f22f",
  80399. "uc_output": "1f22f",
  80400. "uc_match": "1f22f-fe0f",
  80401. "uc_greedy": "1f22f-fe0f",
  80402. "shortnames": [],
  80403. "category": "symbols"
  80404. },
  80405. ":u6708:": {
  80406. "uc_base": "1f237",
  80407. "uc_output": "1f237",
  80408. "uc_match": "1f237-fe0f",
  80409. "uc_greedy": "1f237-fe0f",
  80410. "shortnames": [],
  80411. "category": "symbols"
  80412. },
  80413. ":u6709:": {
  80414. "uc_base": "1f236",
  80415. "uc_output": "1f236",
  80416. "uc_match": "1f236",
  80417. "uc_greedy": "1f236",
  80418. "shortnames": [],
  80419. "category": "symbols"
  80420. },
  80421. ":u6e80:": {
  80422. "uc_base": "1f235",
  80423. "uc_output": "1f235",
  80424. "uc_match": "1f235",
  80425. "uc_greedy": "1f235",
  80426. "shortnames": [],
  80427. "category": "symbols"
  80428. },
  80429. ":u7121:": {
  80430. "uc_base": "1f21a",
  80431. "uc_output": "1f21a",
  80432. "uc_match": "1f21a-fe0f",
  80433. "uc_greedy": "1f21a-fe0f",
  80434. "shortnames": [],
  80435. "category": "symbols"
  80436. },
  80437. ":u7533:": {
  80438. "uc_base": "1f238",
  80439. "uc_output": "1f238",
  80440. "uc_match": "1f238",
  80441. "uc_greedy": "1f238",
  80442. "shortnames": [],
  80443. "category": "symbols"
  80444. },
  80445. ":u7981:": {
  80446. "uc_base": "1f232",
  80447. "uc_output": "1f232",
  80448. "uc_match": "1f232",
  80449. "uc_greedy": "1f232",
  80450. "shortnames": [],
  80451. "category": "symbols"
  80452. },
  80453. ":u7a7a:": {
  80454. "uc_base": "1f233",
  80455. "uc_output": "1f233",
  80456. "uc_match": "1f233",
  80457. "uc_greedy": "1f233",
  80458. "shortnames": [],
  80459. "category": "symbols"
  80460. },
  80461. ":unamused:": {
  80462. "uc_base": "1f612",
  80463. "uc_output": "1f612",
  80464. "uc_match": "1f612",
  80465. "uc_greedy": "1f612",
  80466. "shortnames": [],
  80467. "category": "people"
  80468. },
  80469. ":underage:": {
  80470. "uc_base": "1f51e",
  80471. "uc_output": "1f51e",
  80472. "uc_match": "1f51e",
  80473. "uc_greedy": "1f51e",
  80474. "shortnames": [],
  80475. "category": "symbols"
  80476. },
  80477. ":unicorn:": {
  80478. "uc_base": "1f984",
  80479. "uc_output": "1f984",
  80480. "uc_match": "1f984",
  80481. "uc_greedy": "1f984",
  80482. "shortnames": [":unicorn_face:"],
  80483. "category": "nature"
  80484. },
  80485. ":unlock:": {
  80486. "uc_base": "1f513",
  80487. "uc_output": "1f513",
  80488. "uc_match": "1f513-fe0f",
  80489. "uc_greedy": "1f513-fe0f",
  80490. "shortnames": [],
  80491. "category": "objects"
  80492. },
  80493. ":up:": {
  80494. "uc_base": "1f199",
  80495. "uc_output": "1f199",
  80496. "uc_match": "1f199",
  80497. "uc_greedy": "1f199",
  80498. "shortnames": [],
  80499. "category": "symbols"
  80500. },
  80501. ":upside_down:": {
  80502. "uc_base": "1f643",
  80503. "uc_output": "1f643",
  80504. "uc_match": "1f643",
  80505. "uc_greedy": "1f643",
  80506. "shortnames": [":upside_down_face:"],
  80507. "category": "people"
  80508. },
  80509. ":vampire:": {
  80510. "uc_base": "1f9db",
  80511. "uc_output": "1f9db",
  80512. "uc_match": "1f9db",
  80513. "uc_greedy": "1f9db",
  80514. "shortnames": [],
  80515. "category": "people"
  80516. },
  80517. ":vertical_traffic_light:": {
  80518. "uc_base": "1f6a6",
  80519. "uc_output": "1f6a6",
  80520. "uc_match": "1f6a6",
  80521. "uc_greedy": "1f6a6",
  80522. "shortnames": [],
  80523. "category": "travel"
  80524. },
  80525. ":vhs:": {
  80526. "uc_base": "1f4fc",
  80527. "uc_output": "1f4fc",
  80528. "uc_match": "1f4fc",
  80529. "uc_greedy": "1f4fc",
  80530. "shortnames": [],
  80531. "category": "objects"
  80532. },
  80533. ":vibration_mode:": {
  80534. "uc_base": "1f4f3",
  80535. "uc_output": "1f4f3",
  80536. "uc_match": "1f4f3",
  80537. "uc_greedy": "1f4f3",
  80538. "shortnames": [],
  80539. "category": "symbols"
  80540. },
  80541. ":video_camera:": {
  80542. "uc_base": "1f4f9",
  80543. "uc_output": "1f4f9",
  80544. "uc_match": "1f4f9-fe0f",
  80545. "uc_greedy": "1f4f9-fe0f",
  80546. "shortnames": [],
  80547. "category": "objects"
  80548. },
  80549. ":video_game:": {
  80550. "uc_base": "1f3ae",
  80551. "uc_output": "1f3ae",
  80552. "uc_match": "1f3ae-fe0f",
  80553. "uc_greedy": "1f3ae-fe0f",
  80554. "shortnames": [],
  80555. "category": "activity"
  80556. },
  80557. ":violin:": {
  80558. "uc_base": "1f3bb",
  80559. "uc_output": "1f3bb",
  80560. "uc_match": "1f3bb",
  80561. "uc_greedy": "1f3bb",
  80562. "shortnames": [],
  80563. "category": "activity"
  80564. },
  80565. ":volcano:": {
  80566. "uc_base": "1f30b",
  80567. "uc_output": "1f30b",
  80568. "uc_match": "1f30b",
  80569. "uc_greedy": "1f30b",
  80570. "shortnames": [],
  80571. "category": "travel"
  80572. },
  80573. ":volleyball:": {
  80574. "uc_base": "1f3d0",
  80575. "uc_output": "1f3d0",
  80576. "uc_match": "1f3d0",
  80577. "uc_greedy": "1f3d0",
  80578. "shortnames": [],
  80579. "category": "activity"
  80580. },
  80581. ":vs:": {
  80582. "uc_base": "1f19a",
  80583. "uc_output": "1f19a",
  80584. "uc_match": "1f19a",
  80585. "uc_greedy": "1f19a",
  80586. "shortnames": [],
  80587. "category": "symbols"
  80588. },
  80589. ":vulcan:": {
  80590. "uc_base": "1f596",
  80591. "uc_output": "1f596",
  80592. "uc_match": "1f596",
  80593. "uc_greedy": "1f596",
  80594. "shortnames": [":raised_hand_with_part_between_middle_and_ring_fingers:"],
  80595. "category": "people"
  80596. },
  80597. ":waning_crescent_moon:": {
  80598. "uc_base": "1f318",
  80599. "uc_output": "1f318",
  80600. "uc_match": "1f318",
  80601. "uc_greedy": "1f318",
  80602. "shortnames": [],
  80603. "category": "nature"
  80604. },
  80605. ":waning_gibbous_moon:": {
  80606. "uc_base": "1f316",
  80607. "uc_output": "1f316",
  80608. "uc_match": "1f316",
  80609. "uc_greedy": "1f316",
  80610. "shortnames": [],
  80611. "category": "nature"
  80612. },
  80613. ":wastebasket:": {
  80614. "uc_base": "1f5d1",
  80615. "uc_output": "1f5d1",
  80616. "uc_match": "1f5d1-fe0f",
  80617. "uc_greedy": "1f5d1-fe0f",
  80618. "shortnames": [],
  80619. "category": "objects"
  80620. },
  80621. ":water_buffalo:": {
  80622. "uc_base": "1f403",
  80623. "uc_output": "1f403",
  80624. "uc_match": "1f403",
  80625. "uc_greedy": "1f403",
  80626. "shortnames": [],
  80627. "category": "nature"
  80628. },
  80629. ":watermelon:": {
  80630. "uc_base": "1f349",
  80631. "uc_output": "1f349",
  80632. "uc_match": "1f349",
  80633. "uc_greedy": "1f349",
  80634. "shortnames": [],
  80635. "category": "food"
  80636. },
  80637. ":wave:": {
  80638. "uc_base": "1f44b",
  80639. "uc_output": "1f44b",
  80640. "uc_match": "1f44b",
  80641. "uc_greedy": "1f44b",
  80642. "shortnames": [],
  80643. "category": "people"
  80644. },
  80645. ":waxing_crescent_moon:": {
  80646. "uc_base": "1f312",
  80647. "uc_output": "1f312",
  80648. "uc_match": "1f312",
  80649. "uc_greedy": "1f312",
  80650. "shortnames": [],
  80651. "category": "nature"
  80652. },
  80653. ":waxing_gibbous_moon:": {
  80654. "uc_base": "1f314",
  80655. "uc_output": "1f314",
  80656. "uc_match": "1f314",
  80657. "uc_greedy": "1f314",
  80658. "shortnames": [],
  80659. "category": "nature"
  80660. },
  80661. ":wc:": {
  80662. "uc_base": "1f6be",
  80663. "uc_output": "1f6be",
  80664. "uc_match": "1f6be",
  80665. "uc_greedy": "1f6be",
  80666. "shortnames": [],
  80667. "category": "symbols"
  80668. },
  80669. ":weary:": {
  80670. "uc_base": "1f629",
  80671. "uc_output": "1f629",
  80672. "uc_match": "1f629",
  80673. "uc_greedy": "1f629",
  80674. "shortnames": [],
  80675. "category": "people"
  80676. },
  80677. ":wedding:": {
  80678. "uc_base": "1f492",
  80679. "uc_output": "1f492",
  80680. "uc_match": "1f492",
  80681. "uc_greedy": "1f492",
  80682. "shortnames": [],
  80683. "category": "travel"
  80684. },
  80685. ":whale2:": {
  80686. "uc_base": "1f40b",
  80687. "uc_output": "1f40b",
  80688. "uc_match": "1f40b",
  80689. "uc_greedy": "1f40b",
  80690. "shortnames": [],
  80691. "category": "nature"
  80692. },
  80693. ":whale:": {
  80694. "uc_base": "1f433",
  80695. "uc_output": "1f433",
  80696. "uc_match": "1f433",
  80697. "uc_greedy": "1f433",
  80698. "shortnames": [],
  80699. "category": "nature"
  80700. },
  80701. ":white_flower:": {
  80702. "uc_base": "1f4ae",
  80703. "uc_output": "1f4ae",
  80704. "uc_match": "1f4ae",
  80705. "uc_greedy": "1f4ae",
  80706. "shortnames": [],
  80707. "category": "symbols"
  80708. },
  80709. ":white_square_button:": {
  80710. "uc_base": "1f533",
  80711. "uc_output": "1f533",
  80712. "uc_match": "1f533",
  80713. "uc_greedy": "1f533",
  80714. "shortnames": [],
  80715. "category": "symbols"
  80716. },
  80717. ":white_sun_cloud:": {
  80718. "uc_base": "1f325",
  80719. "uc_output": "1f325",
  80720. "uc_match": "1f325-fe0f",
  80721. "uc_greedy": "1f325-fe0f",
  80722. "shortnames": [":white_sun_behind_cloud:"],
  80723. "category": "nature"
  80724. },
  80725. ":white_sun_rain_cloud:": {
  80726. "uc_base": "1f326",
  80727. "uc_output": "1f326",
  80728. "uc_match": "1f326-fe0f",
  80729. "uc_greedy": "1f326-fe0f",
  80730. "shortnames": [":white_sun_behind_cloud_with_rain:"],
  80731. "category": "nature"
  80732. },
  80733. ":white_sun_small_cloud:": {
  80734. "uc_base": "1f324",
  80735. "uc_output": "1f324",
  80736. "uc_match": "1f324-fe0f",
  80737. "uc_greedy": "1f324-fe0f",
  80738. "shortnames": [":white_sun_with_small_cloud:"],
  80739. "category": "nature"
  80740. },
  80741. ":wilted_rose:": {
  80742. "uc_base": "1f940",
  80743. "uc_output": "1f940",
  80744. "uc_match": "1f940",
  80745. "uc_greedy": "1f940",
  80746. "shortnames": [":wilted_flower:"],
  80747. "category": "nature"
  80748. },
  80749. ":wind_blowing_face:": {
  80750. "uc_base": "1f32c",
  80751. "uc_output": "1f32c",
  80752. "uc_match": "1f32c-fe0f",
  80753. "uc_greedy": "1f32c-fe0f",
  80754. "shortnames": [],
  80755. "category": "nature"
  80756. },
  80757. ":wind_chime:": {
  80758. "uc_base": "1f390",
  80759. "uc_output": "1f390",
  80760. "uc_match": "1f390",
  80761. "uc_greedy": "1f390",
  80762. "shortnames": [],
  80763. "category": "objects"
  80764. },
  80765. ":wine_glass:": {
  80766. "uc_base": "1f377",
  80767. "uc_output": "1f377",
  80768. "uc_match": "1f377",
  80769. "uc_greedy": "1f377",
  80770. "shortnames": [],
  80771. "category": "food"
  80772. },
  80773. ":wink:": {
  80774. "uc_base": "1f609",
  80775. "uc_output": "1f609",
  80776. "uc_match": "1f609",
  80777. "uc_greedy": "1f609",
  80778. "shortnames": [],
  80779. "category": "people"
  80780. },
  80781. ":wolf:": {
  80782. "uc_base": "1f43a",
  80783. "uc_output": "1f43a",
  80784. "uc_match": "1f43a",
  80785. "uc_greedy": "1f43a",
  80786. "shortnames": [],
  80787. "category": "nature"
  80788. },
  80789. ":woman:": {
  80790. "uc_base": "1f469",
  80791. "uc_output": "1f469",
  80792. "uc_match": "1f469",
  80793. "uc_greedy": "1f469",
  80794. "shortnames": [],
  80795. "category": "people"
  80796. },
  80797. ":woman_with_headscarf:": {
  80798. "uc_base": "1f9d5",
  80799. "uc_output": "1f9d5",
  80800. "uc_match": "1f9d5",
  80801. "uc_greedy": "1f9d5",
  80802. "shortnames": [],
  80803. "category": "people"
  80804. },
  80805. ":womans_clothes:": {
  80806. "uc_base": "1f45a",
  80807. "uc_output": "1f45a",
  80808. "uc_match": "1f45a",
  80809. "uc_greedy": "1f45a",
  80810. "shortnames": [],
  80811. "category": "people"
  80812. },
  80813. ":womans_hat:": {
  80814. "uc_base": "1f452",
  80815. "uc_output": "1f452",
  80816. "uc_match": "1f452",
  80817. "uc_greedy": "1f452",
  80818. "shortnames": [],
  80819. "category": "people"
  80820. },
  80821. ":womens:": {
  80822. "uc_base": "1f6ba",
  80823. "uc_output": "1f6ba",
  80824. "uc_match": "1f6ba-fe0f",
  80825. "uc_greedy": "1f6ba-fe0f",
  80826. "shortnames": [],
  80827. "category": "symbols"
  80828. },
  80829. ":worried:": {
  80830. "uc_base": "1f61f",
  80831. "uc_output": "1f61f",
  80832. "uc_match": "1f61f",
  80833. "uc_greedy": "1f61f",
  80834. "shortnames": [],
  80835. "category": "people"
  80836. },
  80837. ":wrench:": {
  80838. "uc_base": "1f527",
  80839. "uc_output": "1f527",
  80840. "uc_match": "1f527",
  80841. "uc_greedy": "1f527",
  80842. "shortnames": [],
  80843. "category": "objects"
  80844. },
  80845. ":yellow_heart:": {
  80846. "uc_base": "1f49b",
  80847. "uc_output": "1f49b",
  80848. "uc_match": "1f49b",
  80849. "uc_greedy": "1f49b",
  80850. "shortnames": [],
  80851. "category": "symbols"
  80852. },
  80853. ":yen:": {
  80854. "uc_base": "1f4b4",
  80855. "uc_output": "1f4b4",
  80856. "uc_match": "1f4b4",
  80857. "uc_greedy": "1f4b4",
  80858. "shortnames": [],
  80859. "category": "objects"
  80860. },
  80861. ":yum:": {
  80862. "uc_base": "1f60b",
  80863. "uc_output": "1f60b",
  80864. "uc_match": "1f60b",
  80865. "uc_greedy": "1f60b",
  80866. "shortnames": [],
  80867. "category": "people"
  80868. },
  80869. ":zebra:": {
  80870. "uc_base": "1f993",
  80871. "uc_output": "1f993",
  80872. "uc_match": "1f993",
  80873. "uc_greedy": "1f993",
  80874. "shortnames": [],
  80875. "category": "nature"
  80876. },
  80877. ":zipper_mouth:": {
  80878. "uc_base": "1f910",
  80879. "uc_output": "1f910",
  80880. "uc_match": "1f910",
  80881. "uc_greedy": "1f910",
  80882. "shortnames": [":zipper_mouth_face:"],
  80883. "category": "people"
  80884. },
  80885. ":zombie:": {
  80886. "uc_base": "1f9df",
  80887. "uc_output": "1f9df",
  80888. "uc_match": "1f9df",
  80889. "uc_greedy": "1f9df",
  80890. "shortnames": [],
  80891. "category": "people"
  80892. },
  80893. ":zzz:": {
  80894. "uc_base": "1f4a4",
  80895. "uc_output": "1f4a4",
  80896. "uc_match": "1f4a4",
  80897. "uc_greedy": "1f4a4",
  80898. "shortnames": [],
  80899. "category": "symbols"
  80900. },
  80901. ":airplane:": {
  80902. "uc_base": "2708",
  80903. "uc_output": "2708",
  80904. "uc_match": "2708-fe0f",
  80905. "uc_greedy": "2708-fe0f",
  80906. "shortnames": [],
  80907. "category": "travel"
  80908. },
  80909. ":alarm_clock:": {
  80910. "uc_base": "23f0",
  80911. "uc_output": "23f0",
  80912. "uc_match": "23f0",
  80913. "uc_greedy": "23f0",
  80914. "shortnames": [],
  80915. "category": "objects"
  80916. },
  80917. ":alembic:": {
  80918. "uc_base": "2697",
  80919. "uc_output": "2697",
  80920. "uc_match": "2697-fe0f",
  80921. "uc_greedy": "2697-fe0f",
  80922. "shortnames": [],
  80923. "category": "objects"
  80924. },
  80925. ":anchor:": {
  80926. "uc_base": "2693",
  80927. "uc_output": "2693",
  80928. "uc_match": "2693-fe0f",
  80929. "uc_greedy": "2693-fe0f",
  80930. "shortnames": [],
  80931. "category": "travel"
  80932. },
  80933. ":aquarius:": {
  80934. "uc_base": "2652",
  80935. "uc_output": "2652",
  80936. "uc_match": "2652-fe0f",
  80937. "uc_greedy": "2652-fe0f",
  80938. "shortnames": [],
  80939. "category": "symbols"
  80940. },
  80941. ":aries:": {
  80942. "uc_base": "2648",
  80943. "uc_output": "2648",
  80944. "uc_match": "2648-fe0f",
  80945. "uc_greedy": "2648-fe0f",
  80946. "shortnames": [],
  80947. "category": "symbols"
  80948. },
  80949. ":arrow_backward:": {
  80950. "uc_base": "25c0",
  80951. "uc_output": "25c0",
  80952. "uc_match": "25c0-fe0f",
  80953. "uc_greedy": "25c0",
  80954. "shortnames": [],
  80955. "category": "symbols"
  80956. },
  80957. ":arrow_double_down:": {
  80958. "uc_base": "23ec",
  80959. "uc_output": "23ec",
  80960. "uc_match": "23ec",
  80961. "uc_greedy": "23ec",
  80962. "shortnames": [],
  80963. "category": "symbols"
  80964. },
  80965. ":arrow_double_up:": {
  80966. "uc_base": "23eb",
  80967. "uc_output": "23eb",
  80968. "uc_match": "23eb",
  80969. "uc_greedy": "23eb",
  80970. "shortnames": [],
  80971. "category": "symbols"
  80972. },
  80973. ":arrow_down:": {
  80974. "uc_base": "2b07",
  80975. "uc_output": "2b07",
  80976. "uc_match": "2b07-fe0f",
  80977. "uc_greedy": "2b07",
  80978. "shortnames": [],
  80979. "category": "symbols"
  80980. },
  80981. ":arrow_forward:": {
  80982. "uc_base": "25b6",
  80983. "uc_output": "25b6",
  80984. "uc_match": "25b6-fe0f",
  80985. "uc_greedy": "25b6",
  80986. "shortnames": [],
  80987. "category": "symbols"
  80988. },
  80989. ":arrow_heading_down:": {
  80990. "uc_base": "2935",
  80991. "uc_output": "2935",
  80992. "uc_match": "2935-fe0f",
  80993. "uc_greedy": "2935",
  80994. "shortnames": [],
  80995. "category": "symbols"
  80996. },
  80997. ":arrow_heading_up:": {
  80998. "uc_base": "2934",
  80999. "uc_output": "2934",
  81000. "uc_match": "2934-fe0f",
  81001. "uc_greedy": "2934",
  81002. "shortnames": [],
  81003. "category": "symbols"
  81004. },
  81005. ":arrow_left:": {
  81006. "uc_base": "2b05",
  81007. "uc_output": "2b05",
  81008. "uc_match": "2b05-fe0f",
  81009. "uc_greedy": "2b05",
  81010. "shortnames": [],
  81011. "category": "symbols"
  81012. },
  81013. ":arrow_lower_left:": {
  81014. "uc_base": "2199",
  81015. "uc_output": "2199",
  81016. "uc_match": "2199-fe0f",
  81017. "uc_greedy": "2199",
  81018. "shortnames": [],
  81019. "category": "symbols"
  81020. },
  81021. ":arrow_lower_right:": {
  81022. "uc_base": "2198",
  81023. "uc_output": "2198",
  81024. "uc_match": "2198-fe0f",
  81025. "uc_greedy": "2198",
  81026. "shortnames": [],
  81027. "category": "symbols"
  81028. },
  81029. ":arrow_right:": {
  81030. "uc_base": "27a1",
  81031. "uc_output": "27a1",
  81032. "uc_match": "27a1-fe0f",
  81033. "uc_greedy": "27a1",
  81034. "shortnames": [],
  81035. "category": "symbols"
  81036. },
  81037. ":arrow_right_hook:": {
  81038. "uc_base": "21aa",
  81039. "uc_output": "21aa",
  81040. "uc_match": "21aa-fe0f",
  81041. "uc_greedy": "21aa",
  81042. "shortnames": [],
  81043. "category": "symbols"
  81044. },
  81045. ":arrow_up:": {
  81046. "uc_base": "2b06",
  81047. "uc_output": "2b06",
  81048. "uc_match": "2b06-fe0f",
  81049. "uc_greedy": "2b06",
  81050. "shortnames": [],
  81051. "category": "symbols"
  81052. },
  81053. ":arrow_up_down:": {
  81054. "uc_base": "2195",
  81055. "uc_output": "2195",
  81056. "uc_match": "2195-fe0f",
  81057. "uc_greedy": "2195",
  81058. "shortnames": [],
  81059. "category": "symbols"
  81060. },
  81061. ":arrow_upper_left:": {
  81062. "uc_base": "2196",
  81063. "uc_output": "2196",
  81064. "uc_match": "2196-fe0f",
  81065. "uc_greedy": "2196",
  81066. "shortnames": [],
  81067. "category": "symbols"
  81068. },
  81069. ":arrow_upper_right:": {
  81070. "uc_base": "2197",
  81071. "uc_output": "2197",
  81072. "uc_match": "2197-fe0f",
  81073. "uc_greedy": "2197",
  81074. "shortnames": [],
  81075. "category": "symbols"
  81076. },
  81077. ":atom:": {
  81078. "uc_base": "269b",
  81079. "uc_output": "269b",
  81080. "uc_match": "269b-fe0f",
  81081. "uc_greedy": "269b",
  81082. "shortnames": [":atom_symbol:"],
  81083. "category": "symbols"
  81084. },
  81085. ":ballot_box_with_check:": {
  81086. "uc_base": "2611",
  81087. "uc_output": "2611",
  81088. "uc_match": "2611-fe0f",
  81089. "uc_greedy": "2611",
  81090. "shortnames": [],
  81091. "category": "symbols"
  81092. },
  81093. ":bangbang:": {
  81094. "uc_base": "203c",
  81095. "uc_output": "203c",
  81096. "uc_match": "203c-fe0f",
  81097. "uc_greedy": "203c",
  81098. "shortnames": [],
  81099. "category": "symbols"
  81100. },
  81101. ":baseball:": {
  81102. "uc_base": "26be",
  81103. "uc_output": "26be",
  81104. "uc_match": "26be-fe0f",
  81105. "uc_greedy": "26be-fe0f",
  81106. "shortnames": [],
  81107. "category": "activity"
  81108. },
  81109. ":beach_umbrella:": {
  81110. "uc_base": "26f1",
  81111. "uc_output": "26f1",
  81112. "uc_match": "26f1-fe0f",
  81113. "uc_greedy": "26f1-fe0f",
  81114. "shortnames": [":umbrella_on_ground:"],
  81115. "category": "travel"
  81116. },
  81117. ":biohazard:": {
  81118. "uc_base": "2623",
  81119. "uc_output": "2623",
  81120. "uc_match": "2623-fe0f",
  81121. "uc_greedy": "2623",
  81122. "shortnames": [":biohazard_sign:"],
  81123. "category": "symbols"
  81124. },
  81125. ":black_circle:": {
  81126. "uc_base": "26ab",
  81127. "uc_output": "26ab",
  81128. "uc_match": "26ab-fe0f",
  81129. "uc_greedy": "26ab-fe0f",
  81130. "shortnames": [],
  81131. "category": "symbols"
  81132. },
  81133. ":black_large_square:": {
  81134. "uc_base": "2b1b",
  81135. "uc_output": "2b1b",
  81136. "uc_match": "2b1b-fe0f",
  81137. "uc_greedy": "2b1b-fe0f",
  81138. "shortnames": [],
  81139. "category": "symbols"
  81140. },
  81141. ":black_medium_small_square:": {
  81142. "uc_base": "25fe",
  81143. "uc_output": "25fe",
  81144. "uc_match": "25fe-fe0f",
  81145. "uc_greedy": "25fe-fe0f",
  81146. "shortnames": [],
  81147. "category": "symbols"
  81148. },
  81149. ":black_medium_square:": {
  81150. "uc_base": "25fc",
  81151. "uc_output": "25fc",
  81152. "uc_match": "25fc-fe0f",
  81153. "uc_greedy": "25fc",
  81154. "shortnames": [],
  81155. "category": "symbols"
  81156. },
  81157. ":black_nib:": {
  81158. "uc_base": "2712",
  81159. "uc_output": "2712",
  81160. "uc_match": "2712-fe0f",
  81161. "uc_greedy": "2712-fe0f",
  81162. "shortnames": [],
  81163. "category": "objects"
  81164. },
  81165. ":black_small_square:": {
  81166. "uc_base": "25aa",
  81167. "uc_output": "25aa",
  81168. "uc_match": "25aa-fe0f",
  81169. "uc_greedy": "25aa",
  81170. "shortnames": [],
  81171. "category": "symbols"
  81172. },
  81173. ":cancer:": {
  81174. "uc_base": "264b",
  81175. "uc_output": "264b",
  81176. "uc_match": "264b-fe0f",
  81177. "uc_greedy": "264b-fe0f",
  81178. "shortnames": [],
  81179. "category": "symbols"
  81180. },
  81181. ":capricorn:": {
  81182. "uc_base": "2651",
  81183. "uc_output": "2651",
  81184. "uc_match": "2651-fe0f",
  81185. "uc_greedy": "2651-fe0f",
  81186. "shortnames": [],
  81187. "category": "symbols"
  81188. },
  81189. ":chains:": {
  81190. "uc_base": "26d3",
  81191. "uc_output": "26d3",
  81192. "uc_match": "26d3-fe0f",
  81193. "uc_greedy": "26d3-fe0f",
  81194. "shortnames": [],
  81195. "category": "objects"
  81196. },
  81197. ":church:": {
  81198. "uc_base": "26ea",
  81199. "uc_output": "26ea",
  81200. "uc_match": "26ea-fe0f",
  81201. "uc_greedy": "26ea-fe0f",
  81202. "shortnames": [],
  81203. "category": "travel"
  81204. },
  81205. ":cloud:": {
  81206. "uc_base": "2601",
  81207. "uc_output": "2601",
  81208. "uc_match": "2601-fe0f",
  81209. "uc_greedy": "2601-fe0f",
  81210. "shortnames": [],
  81211. "category": "nature"
  81212. },
  81213. ":clubs:": {
  81214. "uc_base": "2663",
  81215. "uc_output": "2663",
  81216. "uc_match": "2663-fe0f",
  81217. "uc_greedy": "2663-fe0f",
  81218. "shortnames": [],
  81219. "category": "symbols"
  81220. },
  81221. ":coffee:": {
  81222. "uc_base": "2615",
  81223. "uc_output": "2615",
  81224. "uc_match": "2615-fe0f",
  81225. "uc_greedy": "2615-fe0f",
  81226. "shortnames": [],
  81227. "category": "food"
  81228. },
  81229. ":coffin:": {
  81230. "uc_base": "26b0",
  81231. "uc_output": "26b0",
  81232. "uc_match": "26b0-fe0f",
  81233. "uc_greedy": "26b0-fe0f",
  81234. "shortnames": [],
  81235. "category": "objects"
  81236. },
  81237. ":comet:": {
  81238. "uc_base": "2604",
  81239. "uc_output": "2604",
  81240. "uc_match": "2604-fe0f",
  81241. "uc_greedy": "2604-fe0f",
  81242. "shortnames": [],
  81243. "category": "nature"
  81244. },
  81245. ":congratulations:": {
  81246. "uc_base": "3297",
  81247. "uc_output": "3297",
  81248. "uc_match": "3297-fe0f",
  81249. "uc_greedy": "3297-fe0f",
  81250. "shortnames": [],
  81251. "category": "symbols"
  81252. },
  81253. ":copyright:": {
  81254. "uc_base": "00a9",
  81255. "uc_output": "00a9",
  81256. "uc_match": "00a9-fe0f",
  81257. "uc_greedy": "00a9",
  81258. "shortnames": [],
  81259. "category": "symbols"
  81260. },
  81261. ":cross:": {
  81262. "uc_base": "271d",
  81263. "uc_output": "271d",
  81264. "uc_match": "271d-fe0f",
  81265. "uc_greedy": "271d",
  81266. "shortnames": [":latin_cross:"],
  81267. "category": "symbols"
  81268. },
  81269. ":crossed_swords:": {
  81270. "uc_base": "2694",
  81271. "uc_output": "2694",
  81272. "uc_match": "2694-fe0f",
  81273. "uc_greedy": "2694-fe0f",
  81274. "shortnames": [],
  81275. "category": "objects"
  81276. },
  81277. ":curly_loop:": {
  81278. "uc_base": "27b0",
  81279. "uc_output": "27b0",
  81280. "uc_match": "27b0",
  81281. "uc_greedy": "27b0",
  81282. "shortnames": [],
  81283. "category": "symbols"
  81284. },
  81285. ":diamonds:": {
  81286. "uc_base": "2666",
  81287. "uc_output": "2666",
  81288. "uc_match": "2666-fe0f",
  81289. "uc_greedy": "2666-fe0f",
  81290. "shortnames": [],
  81291. "category": "symbols"
  81292. },
  81293. ":eight_pointed_black_star:": {
  81294. "uc_base": "2734",
  81295. "uc_output": "2734",
  81296. "uc_match": "2734-fe0f",
  81297. "uc_greedy": "2734-fe0f",
  81298. "shortnames": [],
  81299. "category": "symbols"
  81300. },
  81301. ":eight_spoked_asterisk:": {
  81302. "uc_base": "2733",
  81303. "uc_output": "2733",
  81304. "uc_match": "2733-fe0f",
  81305. "uc_greedy": "2733-fe0f",
  81306. "shortnames": [],
  81307. "category": "symbols"
  81308. },
  81309. ":eject:": {
  81310. "uc_base": "23cf",
  81311. "uc_output": "23cf",
  81312. "uc_match": "23cf-fe0f",
  81313. "uc_greedy": "23cf",
  81314. "shortnames": [":eject_symbol:"],
  81315. "category": "symbols"
  81316. },
  81317. ":envelope:": {
  81318. "uc_base": "2709",
  81319. "uc_output": "2709",
  81320. "uc_match": "2709-fe0f",
  81321. "uc_greedy": "2709-fe0f",
  81322. "shortnames": [],
  81323. "category": "objects"
  81324. },
  81325. ":exclamation:": {
  81326. "uc_base": "2757",
  81327. "uc_output": "2757",
  81328. "uc_match": "2757-fe0f",
  81329. "uc_greedy": "2757-fe0f",
  81330. "shortnames": [],
  81331. "category": "symbols"
  81332. },
  81333. ":fast_forward:": {
  81334. "uc_base": "23e9",
  81335. "uc_output": "23e9",
  81336. "uc_match": "23e9-fe0f",
  81337. "uc_greedy": "23e9-fe0f",
  81338. "shortnames": [],
  81339. "category": "symbols"
  81340. },
  81341. ":female_sign:": {
  81342. "uc_base": "2640",
  81343. "uc_output": "2640",
  81344. "uc_match": "2640-fe0f",
  81345. "uc_greedy": "2640",
  81346. "shortnames": [],
  81347. "category": "symbols"
  81348. },
  81349. ":ferry:": {
  81350. "uc_base": "26f4",
  81351. "uc_output": "26f4",
  81352. "uc_match": "26f4-fe0f",
  81353. "uc_greedy": "26f4-fe0f",
  81354. "shortnames": [],
  81355. "category": "travel"
  81356. },
  81357. ":fist:": {
  81358. "uc_base": "270a",
  81359. "uc_output": "270a",
  81360. "uc_match": "270a",
  81361. "uc_greedy": "270a",
  81362. "shortnames": [],
  81363. "category": "people"
  81364. },
  81365. ":fleur-de-lis:": {
  81366. "uc_base": "269c",
  81367. "uc_output": "269c",
  81368. "uc_match": "269c-fe0f",
  81369. "uc_greedy": "269c-fe0f",
  81370. "shortnames": [],
  81371. "category": "symbols"
  81372. },
  81373. ":fountain:": {
  81374. "uc_base": "26f2",
  81375. "uc_output": "26f2",
  81376. "uc_match": "26f2-fe0f",
  81377. "uc_greedy": "26f2-fe0f",
  81378. "shortnames": [],
  81379. "category": "travel"
  81380. },
  81381. ":frowning2:": {
  81382. "uc_base": "2639",
  81383. "uc_output": "2639",
  81384. "uc_match": "2639-fe0f",
  81385. "uc_greedy": "2639-fe0f",
  81386. "shortnames": [":white_frowning_face:"],
  81387. "category": "people"
  81388. },
  81389. ":fuelpump:": {
  81390. "uc_base": "26fd",
  81391. "uc_output": "26fd",
  81392. "uc_match": "26fd-fe0f",
  81393. "uc_greedy": "26fd-fe0f",
  81394. "shortnames": [],
  81395. "category": "travel"
  81396. },
  81397. ":gear:": {
  81398. "uc_base": "2699",
  81399. "uc_output": "2699",
  81400. "uc_match": "2699-fe0f",
  81401. "uc_greedy": "2699-fe0f",
  81402. "shortnames": [],
  81403. "category": "objects"
  81404. },
  81405. ":gemini:": {
  81406. "uc_base": "264a",
  81407. "uc_output": "264a",
  81408. "uc_match": "264a-fe0f",
  81409. "uc_greedy": "264a-fe0f",
  81410. "shortnames": [],
  81411. "category": "symbols"
  81412. },
  81413. ":golf:": {
  81414. "uc_base": "26f3",
  81415. "uc_output": "26f3",
  81416. "uc_match": "26f3-fe0f",
  81417. "uc_greedy": "26f3-fe0f",
  81418. "shortnames": [],
  81419. "category": "activity"
  81420. },
  81421. ":grey_exclamation:": {
  81422. "uc_base": "2755",
  81423. "uc_output": "2755",
  81424. "uc_match": "2755",
  81425. "uc_greedy": "2755",
  81426. "shortnames": [],
  81427. "category": "symbols"
  81428. },
  81429. ":grey_question:": {
  81430. "uc_base": "2754",
  81431. "uc_output": "2754",
  81432. "uc_match": "2754",
  81433. "uc_greedy": "2754",
  81434. "shortnames": [],
  81435. "category": "symbols"
  81436. },
  81437. ":hammer_pick:": {
  81438. "uc_base": "2692",
  81439. "uc_output": "2692",
  81440. "uc_match": "2692-fe0f",
  81441. "uc_greedy": "2692-fe0f",
  81442. "shortnames": [":hammer_and_pick:"],
  81443. "category": "objects"
  81444. },
  81445. ":heart:": {
  81446. "uc_base": "2764",
  81447. "uc_output": "2764",
  81448. "uc_match": "2764-fe0f",
  81449. "uc_greedy": "2764-fe0f",
  81450. "shortnames": [],
  81451. "category": "symbols"
  81452. },
  81453. ":heart_exclamation:": {
  81454. "uc_base": "2763",
  81455. "uc_output": "2763",
  81456. "uc_match": "2763-fe0f",
  81457. "uc_greedy": "2763-fe0f",
  81458. "shortnames": [":heavy_heart_exclamation_mark_ornament:"],
  81459. "category": "symbols"
  81460. },
  81461. ":hearts:": {
  81462. "uc_base": "2665",
  81463. "uc_output": "2665",
  81464. "uc_match": "2665-fe0f",
  81465. "uc_greedy": "2665-fe0f",
  81466. "shortnames": [],
  81467. "category": "symbols"
  81468. },
  81469. ":heavy_check_mark:": {
  81470. "uc_base": "2714",
  81471. "uc_output": "2714",
  81472. "uc_match": "2714-fe0f",
  81473. "uc_greedy": "2714",
  81474. "shortnames": [],
  81475. "category": "symbols"
  81476. },
  81477. ":heavy_division_sign:": {
  81478. "uc_base": "2797",
  81479. "uc_output": "2797",
  81480. "uc_match": "2797",
  81481. "uc_greedy": "2797",
  81482. "shortnames": [],
  81483. "category": "symbols"
  81484. },
  81485. ":heavy_minus_sign:": {
  81486. "uc_base": "2796",
  81487. "uc_output": "2796",
  81488. "uc_match": "2796",
  81489. "uc_greedy": "2796",
  81490. "shortnames": [],
  81491. "category": "symbols"
  81492. },
  81493. ":heavy_multiplication_x:": {
  81494. "uc_base": "2716",
  81495. "uc_output": "2716",
  81496. "uc_match": "2716-fe0f",
  81497. "uc_greedy": "2716",
  81498. "shortnames": [],
  81499. "category": "symbols"
  81500. },
  81501. ":heavy_plus_sign:": {
  81502. "uc_base": "2795",
  81503. "uc_output": "2795",
  81504. "uc_match": "2795",
  81505. "uc_greedy": "2795",
  81506. "shortnames": [],
  81507. "category": "symbols"
  81508. },
  81509. ":helmet_with_cross:": {
  81510. "uc_base": "26d1",
  81511. "uc_output": "26d1",
  81512. "uc_match": "26d1-fe0f",
  81513. "uc_greedy": "26d1-fe0f",
  81514. "shortnames": [":helmet_with_white_cross:"],
  81515. "category": "people"
  81516. },
  81517. ":hotsprings:": {
  81518. "uc_base": "2668",
  81519. "uc_output": "2668",
  81520. "uc_match": "2668-fe0f",
  81521. "uc_greedy": "2668-fe0f",
  81522. "shortnames": [],
  81523. "category": "symbols"
  81524. },
  81525. ":hourglass:": {
  81526. "uc_base": "231b",
  81527. "uc_output": "231b",
  81528. "uc_match": "231b-fe0f",
  81529. "uc_greedy": "231b-fe0f",
  81530. "shortnames": [],
  81531. "category": "objects"
  81532. },
  81533. ":hourglass_flowing_sand:": {
  81534. "uc_base": "23f3",
  81535. "uc_output": "23f3",
  81536. "uc_match": "23f3-fe0f",
  81537. "uc_greedy": "23f3-fe0f",
  81538. "shortnames": [],
  81539. "category": "objects"
  81540. },
  81541. ":ice_skate:": {
  81542. "uc_base": "26f8",
  81543. "uc_output": "26f8",
  81544. "uc_match": "26f8-fe0f",
  81545. "uc_greedy": "26f8-fe0f",
  81546. "shortnames": [],
  81547. "category": "activity"
  81548. },
  81549. ":information_source:": {
  81550. "uc_base": "2139",
  81551. "uc_output": "2139",
  81552. "uc_match": "2139-fe0f",
  81553. "uc_greedy": "2139",
  81554. "shortnames": [],
  81555. "category": "symbols"
  81556. },
  81557. ":interrobang:": {
  81558. "uc_base": "2049",
  81559. "uc_output": "2049",
  81560. "uc_match": "2049-fe0f",
  81561. "uc_greedy": "2049",
  81562. "shortnames": [],
  81563. "category": "symbols"
  81564. },
  81565. ":keyboard:": {
  81566. "uc_base": "2328",
  81567. "uc_output": "2328",
  81568. "uc_match": "2328-fe0f",
  81569. "uc_greedy": "2328-fe0f",
  81570. "shortnames": [],
  81571. "category": "objects"
  81572. },
  81573. ":left_right_arrow:": {
  81574. "uc_base": "2194",
  81575. "uc_output": "2194",
  81576. "uc_match": "2194-fe0f",
  81577. "uc_greedy": "2194",
  81578. "shortnames": [],
  81579. "category": "symbols"
  81580. },
  81581. ":leftwards_arrow_with_hook:": {
  81582. "uc_base": "21a9",
  81583. "uc_output": "21a9",
  81584. "uc_match": "21a9-fe0f",
  81585. "uc_greedy": "21a9",
  81586. "shortnames": [],
  81587. "category": "symbols"
  81588. },
  81589. ":leo:": {
  81590. "uc_base": "264c",
  81591. "uc_output": "264c",
  81592. "uc_match": "264c-fe0f",
  81593. "uc_greedy": "264c-fe0f",
  81594. "shortnames": [],
  81595. "category": "symbols"
  81596. },
  81597. ":libra:": {
  81598. "uc_base": "264e",
  81599. "uc_output": "264e",
  81600. "uc_match": "264e-fe0f",
  81601. "uc_greedy": "264e-fe0f",
  81602. "shortnames": [],
  81603. "category": "symbols"
  81604. },
  81605. ":loop:": {
  81606. "uc_base": "27bf",
  81607. "uc_output": "27bf",
  81608. "uc_match": "27bf",
  81609. "uc_greedy": "27bf",
  81610. "shortnames": [],
  81611. "category": "symbols"
  81612. },
  81613. ":m:": {
  81614. "uc_base": "24c2",
  81615. "uc_output": "24c2",
  81616. "uc_match": "24c2-fe0f",
  81617. "uc_greedy": "24c2-fe0f",
  81618. "shortnames": [],
  81619. "category": "symbols"
  81620. },
  81621. ":male_sign:": {
  81622. "uc_base": "2642",
  81623. "uc_output": "2642",
  81624. "uc_match": "2642-fe0f",
  81625. "uc_greedy": "2642",
  81626. "shortnames": [],
  81627. "category": "symbols"
  81628. },
  81629. ":medical_symbol:": {
  81630. "uc_base": "2695",
  81631. "uc_output": "2695",
  81632. "uc_match": "2695-fe0f",
  81633. "uc_greedy": "2695",
  81634. "shortnames": [],
  81635. "category": "symbols"
  81636. },
  81637. ":mountain:": {
  81638. "uc_base": "26f0",
  81639. "uc_output": "26f0",
  81640. "uc_match": "26f0-fe0f",
  81641. "uc_greedy": "26f0-fe0f",
  81642. "shortnames": [],
  81643. "category": "travel"
  81644. },
  81645. ":negative_squared_cross_mark:": {
  81646. "uc_base": "274e",
  81647. "uc_output": "274e",
  81648. "uc_match": "274e",
  81649. "uc_greedy": "274e",
  81650. "shortnames": [],
  81651. "category": "symbols"
  81652. },
  81653. ":no_entry:": {
  81654. "uc_base": "26d4",
  81655. "uc_output": "26d4",
  81656. "uc_match": "26d4-fe0f",
  81657. "uc_greedy": "26d4-fe0f",
  81658. "shortnames": [],
  81659. "category": "symbols"
  81660. },
  81661. ":o:": {
  81662. "uc_base": "2b55",
  81663. "uc_output": "2b55",
  81664. "uc_match": "2b55-fe0f",
  81665. "uc_greedy": "2b55-fe0f",
  81666. "shortnames": [],
  81667. "category": "symbols"
  81668. },
  81669. ":ophiuchus:": {
  81670. "uc_base": "26ce",
  81671. "uc_output": "26ce",
  81672. "uc_match": "26ce",
  81673. "uc_greedy": "26ce",
  81674. "shortnames": [],
  81675. "category": "symbols"
  81676. },
  81677. ":orthodox_cross:": {
  81678. "uc_base": "2626",
  81679. "uc_output": "2626",
  81680. "uc_match": "2626-fe0f",
  81681. "uc_greedy": "2626",
  81682. "shortnames": [],
  81683. "category": "symbols"
  81684. },
  81685. ":part_alternation_mark:": {
  81686. "uc_base": "303d",
  81687. "uc_output": "303d",
  81688. "uc_match": "303d-fe0f",
  81689. "uc_greedy": "303d-fe0f",
  81690. "shortnames": [],
  81691. "category": "symbols"
  81692. },
  81693. ":partly_sunny:": {
  81694. "uc_base": "26c5",
  81695. "uc_output": "26c5",
  81696. "uc_match": "26c5-fe0f",
  81697. "uc_greedy": "26c5-fe0f",
  81698. "shortnames": [],
  81699. "category": "nature"
  81700. },
  81701. ":pause_button:": {
  81702. "uc_base": "23f8",
  81703. "uc_output": "23f8",
  81704. "uc_match": "23f8-fe0f",
  81705. "uc_greedy": "23f8",
  81706. "shortnames": [":double_vertical_bar:"],
  81707. "category": "symbols"
  81708. },
  81709. ":peace:": {
  81710. "uc_base": "262e",
  81711. "uc_output": "262e",
  81712. "uc_match": "262e-fe0f",
  81713. "uc_greedy": "262e",
  81714. "shortnames": [":peace_symbol:"],
  81715. "category": "symbols"
  81716. },
  81717. ":pencil2:": {
  81718. "uc_base": "270f",
  81719. "uc_output": "270f",
  81720. "uc_match": "270f-fe0f",
  81721. "uc_greedy": "270f-fe0f",
  81722. "shortnames": [],
  81723. "category": "objects"
  81724. },
  81725. ":person_bouncing_ball:": {
  81726. "uc_base": "26f9",
  81727. "uc_output": "26f9",
  81728. "uc_match": "26f9-fe0f",
  81729. "uc_greedy": "26f9-fe0f",
  81730. "shortnames": [":basketball_player:", ":person_with_ball:"],
  81731. "category": "activity"
  81732. },
  81733. ":pick:": {
  81734. "uc_base": "26cf",
  81735. "uc_output": "26cf",
  81736. "uc_match": "26cf-fe0f",
  81737. "uc_greedy": "26cf-fe0f",
  81738. "shortnames": [],
  81739. "category": "objects"
  81740. },
  81741. ":pisces:": {
  81742. "uc_base": "2653",
  81743. "uc_output": "2653",
  81744. "uc_match": "2653-fe0f",
  81745. "uc_greedy": "2653-fe0f",
  81746. "shortnames": [],
  81747. "category": "symbols"
  81748. },
  81749. ":play_pause:": {
  81750. "uc_base": "23ef",
  81751. "uc_output": "23ef",
  81752. "uc_match": "23ef-fe0f",
  81753. "uc_greedy": "23ef",
  81754. "shortnames": [],
  81755. "category": "symbols"
  81756. },
  81757. ":point_up:": {
  81758. "uc_base": "261d",
  81759. "uc_output": "261d",
  81760. "uc_match": "261d-fe0f",
  81761. "uc_greedy": "261d-fe0f",
  81762. "shortnames": [],
  81763. "category": "people"
  81764. },
  81765. ":question:": {
  81766. "uc_base": "2753",
  81767. "uc_output": "2753",
  81768. "uc_match": "2753-fe0f",
  81769. "uc_greedy": "2753-fe0f",
  81770. "shortnames": [],
  81771. "category": "symbols"
  81772. },
  81773. ":radioactive:": {
  81774. "uc_base": "2622",
  81775. "uc_output": "2622",
  81776. "uc_match": "2622-fe0f",
  81777. "uc_greedy": "2622",
  81778. "shortnames": [":radioactive_sign:"],
  81779. "category": "symbols"
  81780. },
  81781. ":raised_hand:": {
  81782. "uc_base": "270b",
  81783. "uc_output": "270b",
  81784. "uc_match": "270b",
  81785. "uc_greedy": "270b",
  81786. "shortnames": [],
  81787. "category": "people"
  81788. },
  81789. ":record_button:": {
  81790. "uc_base": "23fa",
  81791. "uc_output": "23fa",
  81792. "uc_match": "23fa-fe0f",
  81793. "uc_greedy": "23fa",
  81794. "shortnames": [],
  81795. "category": "symbols"
  81796. },
  81797. ":recycle:": {
  81798. "uc_base": "267b",
  81799. "uc_output": "267b",
  81800. "uc_match": "267b-fe0f",
  81801. "uc_greedy": "267b-fe0f",
  81802. "shortnames": [],
  81803. "category": "symbols"
  81804. },
  81805. ":registered:": {
  81806. "uc_base": "00ae",
  81807. "uc_output": "00ae",
  81808. "uc_match": "00ae-fe0f",
  81809. "uc_greedy": "00ae",
  81810. "shortnames": [],
  81811. "category": "symbols"
  81812. },
  81813. ":relaxed:": {
  81814. "uc_base": "263a",
  81815. "uc_output": "263a",
  81816. "uc_match": "263a-fe0f",
  81817. "uc_greedy": "263a-fe0f",
  81818. "shortnames": [],
  81819. "category": "people"
  81820. },
  81821. ":rewind:": {
  81822. "uc_base": "23ea",
  81823. "uc_output": "23ea",
  81824. "uc_match": "23ea-fe0f",
  81825. "uc_greedy": "23ea-fe0f",
  81826. "shortnames": [],
  81827. "category": "symbols"
  81828. },
  81829. ":sagittarius:": {
  81830. "uc_base": "2650",
  81831. "uc_output": "2650",
  81832. "uc_match": "2650-fe0f",
  81833. "uc_greedy": "2650-fe0f",
  81834. "shortnames": [],
  81835. "category": "symbols"
  81836. },
  81837. ":sailboat:": {
  81838. "uc_base": "26f5",
  81839. "uc_output": "26f5",
  81840. "uc_match": "26f5-fe0f",
  81841. "uc_greedy": "26f5-fe0f",
  81842. "shortnames": [],
  81843. "category": "travel"
  81844. },
  81845. ":scales:": {
  81846. "uc_base": "2696",
  81847. "uc_output": "2696",
  81848. "uc_match": "2696-fe0f",
  81849. "uc_greedy": "2696-fe0f",
  81850. "shortnames": [],
  81851. "category": "objects"
  81852. },
  81853. ":scissors:": {
  81854. "uc_base": "2702",
  81855. "uc_output": "2702",
  81856. "uc_match": "2702-fe0f",
  81857. "uc_greedy": "2702-fe0f",
  81858. "shortnames": [],
  81859. "category": "objects"
  81860. },
  81861. ":scorpius:": {
  81862. "uc_base": "264f",
  81863. "uc_output": "264f",
  81864. "uc_match": "264f-fe0f",
  81865. "uc_greedy": "264f-fe0f",
  81866. "shortnames": [],
  81867. "category": "symbols"
  81868. },
  81869. ":secret:": {
  81870. "uc_base": "3299",
  81871. "uc_output": "3299",
  81872. "uc_match": "3299-fe0f",
  81873. "uc_greedy": "3299-fe0f",
  81874. "shortnames": [],
  81875. "category": "symbols"
  81876. },
  81877. ":shamrock:": {
  81878. "uc_base": "2618",
  81879. "uc_output": "2618",
  81880. "uc_match": "2618-fe0f",
  81881. "uc_greedy": "2618-fe0f",
  81882. "shortnames": [],
  81883. "category": "nature"
  81884. },
  81885. ":shinto_shrine:": {
  81886. "uc_base": "26e9",
  81887. "uc_output": "26e9",
  81888. "uc_match": "26e9-fe0f",
  81889. "uc_greedy": "26e9-fe0f",
  81890. "shortnames": [],
  81891. "category": "travel"
  81892. },
  81893. ":skier:": {
  81894. "uc_base": "26f7",
  81895. "uc_output": "26f7",
  81896. "uc_match": "26f7-fe0f",
  81897. "uc_greedy": "26f7-fe0f",
  81898. "shortnames": [],
  81899. "category": "activity"
  81900. },
  81901. ":skull_crossbones:": {
  81902. "uc_base": "2620",
  81903. "uc_output": "2620",
  81904. "uc_match": "2620-fe0f",
  81905. "uc_greedy": "2620-fe0f",
  81906. "shortnames": [":skull_and_crossbones:"],
  81907. "category": "people"
  81908. },
  81909. ":snowflake:": {
  81910. "uc_base": "2744",
  81911. "uc_output": "2744",
  81912. "uc_match": "2744-fe0f",
  81913. "uc_greedy": "2744-fe0f",
  81914. "shortnames": [],
  81915. "category": "nature"
  81916. },
  81917. ":snowman2:": {
  81918. "uc_base": "2603",
  81919. "uc_output": "2603",
  81920. "uc_match": "2603-fe0f",
  81921. "uc_greedy": "2603-fe0f",
  81922. "shortnames": [],
  81923. "category": "nature"
  81924. },
  81925. ":snowman:": {
  81926. "uc_base": "26c4",
  81927. "uc_output": "26c4",
  81928. "uc_match": "26c4-fe0f",
  81929. "uc_greedy": "26c4-fe0f",
  81930. "shortnames": [],
  81931. "category": "nature"
  81932. },
  81933. ":soccer:": {
  81934. "uc_base": "26bd",
  81935. "uc_output": "26bd",
  81936. "uc_match": "26bd-fe0f",
  81937. "uc_greedy": "26bd-fe0f",
  81938. "shortnames": [],
  81939. "category": "activity"
  81940. },
  81941. ":spades:": {
  81942. "uc_base": "2660",
  81943. "uc_output": "2660",
  81944. "uc_match": "2660-fe0f",
  81945. "uc_greedy": "2660-fe0f",
  81946. "shortnames": [],
  81947. "category": "symbols"
  81948. },
  81949. ":sparkle:": {
  81950. "uc_base": "2747",
  81951. "uc_output": "2747",
  81952. "uc_match": "2747-fe0f",
  81953. "uc_greedy": "2747-fe0f",
  81954. "shortnames": [],
  81955. "category": "symbols"
  81956. },
  81957. ":sparkles:": {
  81958. "uc_base": "2728",
  81959. "uc_output": "2728",
  81960. "uc_match": "2728",
  81961. "uc_greedy": "2728",
  81962. "shortnames": [],
  81963. "category": "nature"
  81964. },
  81965. ":star:": {
  81966. "uc_base": "2b50",
  81967. "uc_output": "2b50",
  81968. "uc_match": "2b50-fe0f",
  81969. "uc_greedy": "2b50-fe0f",
  81970. "shortnames": [],
  81971. "category": "nature"
  81972. },
  81973. ":star_and_crescent:": {
  81974. "uc_base": "262a",
  81975. "uc_output": "262a",
  81976. "uc_match": "262a-fe0f",
  81977. "uc_greedy": "262a",
  81978. "shortnames": [],
  81979. "category": "symbols"
  81980. },
  81981. ":star_of_david:": {
  81982. "uc_base": "2721",
  81983. "uc_output": "2721",
  81984. "uc_match": "2721-fe0f",
  81985. "uc_greedy": "2721",
  81986. "shortnames": [],
  81987. "category": "symbols"
  81988. },
  81989. ":stop_button:": {
  81990. "uc_base": "23f9",
  81991. "uc_output": "23f9",
  81992. "uc_match": "23f9-fe0f",
  81993. "uc_greedy": "23f9",
  81994. "shortnames": [],
  81995. "category": "symbols"
  81996. },
  81997. ":stopwatch:": {
  81998. "uc_base": "23f1",
  81999. "uc_output": "23f1",
  82000. "uc_match": "23f1-fe0f",
  82001. "uc_greedy": "23f1-fe0f",
  82002. "shortnames": [],
  82003. "category": "objects"
  82004. },
  82005. ":sunny:": {
  82006. "uc_base": "2600",
  82007. "uc_output": "2600",
  82008. "uc_match": "2600-fe0f",
  82009. "uc_greedy": "2600-fe0f",
  82010. "shortnames": [],
  82011. "category": "nature"
  82012. },
  82013. ":taurus:": {
  82014. "uc_base": "2649",
  82015. "uc_output": "2649",
  82016. "uc_match": "2649-fe0f",
  82017. "uc_greedy": "2649-fe0f",
  82018. "shortnames": [],
  82019. "category": "symbols"
  82020. },
  82021. ":telephone:": {
  82022. "uc_base": "260e",
  82023. "uc_output": "260e",
  82024. "uc_match": "260e-fe0f",
  82025. "uc_greedy": "260e-fe0f",
  82026. "shortnames": [],
  82027. "category": "objects"
  82028. },
  82029. ":tent:": {
  82030. "uc_base": "26fa",
  82031. "uc_output": "26fa",
  82032. "uc_match": "26fa-fe0f",
  82033. "uc_greedy": "26fa-fe0f",
  82034. "shortnames": [],
  82035. "category": "travel"
  82036. },
  82037. ":thunder_cloud_rain:": {
  82038. "uc_base": "26c8",
  82039. "uc_output": "26c8",
  82040. "uc_match": "26c8-fe0f",
  82041. "uc_greedy": "26c8-fe0f",
  82042. "shortnames": [":thunder_cloud_and_rain:"],
  82043. "category": "nature"
  82044. },
  82045. ":timer:": {
  82046. "uc_base": "23f2",
  82047. "uc_output": "23f2",
  82048. "uc_match": "23f2-fe0f",
  82049. "uc_greedy": "23f2-fe0f",
  82050. "shortnames": [":timer_clock:"],
  82051. "category": "objects"
  82052. },
  82053. ":tm:": {
  82054. "uc_base": "2122",
  82055. "uc_output": "2122",
  82056. "uc_match": "2122-fe0f",
  82057. "uc_greedy": "2122",
  82058. "shortnames": [],
  82059. "category": "symbols"
  82060. },
  82061. ":track_next:": {
  82062. "uc_base": "23ed",
  82063. "uc_output": "23ed",
  82064. "uc_match": "23ed-fe0f",
  82065. "uc_greedy": "23ed",
  82066. "shortnames": [":next_track:"],
  82067. "category": "symbols"
  82068. },
  82069. ":track_previous:": {
  82070. "uc_base": "23ee",
  82071. "uc_output": "23ee",
  82072. "uc_match": "23ee-fe0f",
  82073. "uc_greedy": "23ee",
  82074. "shortnames": [":previous_track:"],
  82075. "category": "symbols"
  82076. },
  82077. ":umbrella2:": {
  82078. "uc_base": "2602",
  82079. "uc_output": "2602",
  82080. "uc_match": "2602-fe0f",
  82081. "uc_greedy": "2602-fe0f",
  82082. "shortnames": [],
  82083. "category": "nature"
  82084. },
  82085. ":umbrella:": {
  82086. "uc_base": "2614",
  82087. "uc_output": "2614",
  82088. "uc_match": "2614-fe0f",
  82089. "uc_greedy": "2614-fe0f",
  82090. "shortnames": [],
  82091. "category": "nature"
  82092. },
  82093. ":urn:": {
  82094. "uc_base": "26b1",
  82095. "uc_output": "26b1",
  82096. "uc_match": "26b1-fe0f",
  82097. "uc_greedy": "26b1-fe0f",
  82098. "shortnames": [":funeral_urn:"],
  82099. "category": "objects"
  82100. },
  82101. ":v:": {
  82102. "uc_base": "270c",
  82103. "uc_output": "270c",
  82104. "uc_match": "270c-fe0f",
  82105. "uc_greedy": "270c-fe0f",
  82106. "shortnames": [],
  82107. "category": "people"
  82108. },
  82109. ":virgo:": {
  82110. "uc_base": "264d",
  82111. "uc_output": "264d",
  82112. "uc_match": "264d-fe0f",
  82113. "uc_greedy": "264d-fe0f",
  82114. "shortnames": [],
  82115. "category": "symbols"
  82116. },
  82117. ":warning:": {
  82118. "uc_base": "26a0",
  82119. "uc_output": "26a0",
  82120. "uc_match": "26a0-fe0f",
  82121. "uc_greedy": "26a0",
  82122. "shortnames": [],
  82123. "category": "symbols"
  82124. },
  82125. ":watch:": {
  82126. "uc_base": "231a",
  82127. "uc_output": "231a",
  82128. "uc_match": "231a-fe0f",
  82129. "uc_greedy": "231a-fe0f",
  82130. "shortnames": [],
  82131. "category": "objects"
  82132. },
  82133. ":wavy_dash:": {
  82134. "uc_base": "3030",
  82135. "uc_output": "3030",
  82136. "uc_match": "3030-fe0f",
  82137. "uc_greedy": "3030",
  82138. "shortnames": [],
  82139. "category": "symbols"
  82140. },
  82141. ":wheel_of_dharma:": {
  82142. "uc_base": "2638",
  82143. "uc_output": "2638",
  82144. "uc_match": "2638-fe0f",
  82145. "uc_greedy": "2638",
  82146. "shortnames": [],
  82147. "category": "symbols"
  82148. },
  82149. ":wheelchair:": {
  82150. "uc_base": "267f",
  82151. "uc_output": "267f",
  82152. "uc_match": "267f-fe0f",
  82153. "uc_greedy": "267f-fe0f",
  82154. "shortnames": [],
  82155. "category": "symbols"
  82156. },
  82157. ":white_check_mark:": {
  82158. "uc_base": "2705",
  82159. "uc_output": "2705",
  82160. "uc_match": "2705",
  82161. "uc_greedy": "2705",
  82162. "shortnames": [],
  82163. "category": "symbols"
  82164. },
  82165. ":white_circle:": {
  82166. "uc_base": "26aa",
  82167. "uc_output": "26aa",
  82168. "uc_match": "26aa-fe0f",
  82169. "uc_greedy": "26aa-fe0f",
  82170. "shortnames": [],
  82171. "category": "symbols"
  82172. },
  82173. ":white_large_square:": {
  82174. "uc_base": "2b1c",
  82175. "uc_output": "2b1c",
  82176. "uc_match": "2b1c-fe0f",
  82177. "uc_greedy": "2b1c-fe0f",
  82178. "shortnames": [],
  82179. "category": "symbols"
  82180. },
  82181. ":white_medium_small_square:": {
  82182. "uc_base": "25fd",
  82183. "uc_output": "25fd",
  82184. "uc_match": "25fd-fe0f",
  82185. "uc_greedy": "25fd-fe0f",
  82186. "shortnames": [],
  82187. "category": "symbols"
  82188. },
  82189. ":white_medium_square:": {
  82190. "uc_base": "25fb",
  82191. "uc_output": "25fb",
  82192. "uc_match": "25fb-fe0f",
  82193. "uc_greedy": "25fb",
  82194. "shortnames": [],
  82195. "category": "symbols"
  82196. },
  82197. ":white_small_square:": {
  82198. "uc_base": "25ab",
  82199. "uc_output": "25ab",
  82200. "uc_match": "25ab-fe0f",
  82201. "uc_greedy": "25ab",
  82202. "shortnames": [],
  82203. "category": "symbols"
  82204. },
  82205. ":writing_hand:": {
  82206. "uc_base": "270d",
  82207. "uc_output": "270d",
  82208. "uc_match": "270d-fe0f",
  82209. "uc_greedy": "270d-fe0f",
  82210. "shortnames": [],
  82211. "category": "people"
  82212. },
  82213. ":x:": {
  82214. "uc_base": "274c",
  82215. "uc_output": "274c",
  82216. "uc_match": "274c",
  82217. "uc_greedy": "274c",
  82218. "shortnames": [],
  82219. "category": "symbols"
  82220. },
  82221. ":yin_yang:": {
  82222. "uc_base": "262f",
  82223. "uc_output": "262f",
  82224. "uc_match": "262f-fe0f",
  82225. "uc_greedy": "262f",
  82226. "shortnames": [],
  82227. "category": "symbols"
  82228. },
  82229. ":zap:": {
  82230. "uc_base": "26a1",
  82231. "uc_output": "26a1",
  82232. "uc_match": "26a1-fe0f",
  82233. "uc_greedy": "26a1-fe0f",
  82234. "shortnames": [],
  82235. "category": "nature"
  82236. }
  82237. };
  82238. const ascii_list = {
  82239. '*\\0/*': '1f646',
  82240. '*\\O/*': '1f646',
  82241. '-___-': '1f611',
  82242. ':\'-)': '1f602',
  82243. '\':-)': '1f605',
  82244. '\':-D': '1f605',
  82245. '>:-)': '1f606',
  82246. '\':-(': '1f613',
  82247. '>:-(': '1f620',
  82248. ':\'-(': '1f622',
  82249. 'O:-)': '1f607',
  82250. '0:-3': '1f607',
  82251. '0:-)': '1f607',
  82252. '0;^)': '1f607',
  82253. 'O;-)': '1f607',
  82254. '0;-)': '1f607',
  82255. 'O:-3': '1f607',
  82256. '-__-': '1f611',
  82257. ':-Þ': '1f61b',
  82258. '</3': '1f494',
  82259. ':\')': '1f602',
  82260. ':-D': '1f603',
  82261. '\':)': '1f605',
  82262. '\'=)': '1f605',
  82263. '\':D': '1f605',
  82264. '\'=D': '1f605',
  82265. '>:)': '1f606',
  82266. '>;)': '1f606',
  82267. '>=)': '1f606',
  82268. ';-)': '1f609',
  82269. '*-)': '1f609',
  82270. ';-]': '1f609',
  82271. ';^)': '1f609',
  82272. '\':(': '1f613',
  82273. '\'=(': '1f613',
  82274. ':-*': '1f618',
  82275. ':^*': '1f618',
  82276. '>:P': '1f61c',
  82277. 'X-P': '1f61c',
  82278. '>:[': '1f61e',
  82279. ':-(': '1f61e',
  82280. ':-[': '1f61e',
  82281. '>:(': '1f620',
  82282. ':\'(': '1f622',
  82283. ';-(': '1f622',
  82284. '>.<': '1f623',
  82285. '#-)': '1f635',
  82286. '%-)': '1f635',
  82287. 'X-)': '1f635',
  82288. '\\0/': '1f646',
  82289. '\\O/': '1f646',
  82290. '0:3': '1f607',
  82291. '0:)': '1f607',
  82292. 'O:)': '1f607',
  82293. 'O=)': '1f607',
  82294. 'O:3': '1f607',
  82295. 'B-)': '1f60e',
  82296. '8-)': '1f60e',
  82297. 'B-D': '1f60e',
  82298. '8-D': '1f60e',
  82299. '-_-': '1f611',
  82300. '>:\\': '1f615',
  82301. '>:/': '1f615',
  82302. ':-/': '1f615',
  82303. ':-.': '1f615',
  82304. ':-P': '1f61b',
  82305. ':Þ': '1f61b',
  82306. ':-b': '1f61b',
  82307. ':-O': '1f62e',
  82308. 'O_O': '1f62e',
  82309. '>:O': '1f62e',
  82310. ':-X': '1f636',
  82311. ':-#': '1f636',
  82312. ':-)': '1f642',
  82313. '(y)': '1f44d',
  82314. '<3': '2764',
  82315. ':D': '1f603',
  82316. '=D': '1f603',
  82317. ';)': '1f609',
  82318. '*)': '1f609',
  82319. ';]': '1f609',
  82320. ';D': '1f609',
  82321. ':*': '1f618',
  82322. '=*': '1f618',
  82323. ':(': '1f61e',
  82324. ':[': '1f61e',
  82325. '=(': '1f61e',
  82326. ':@': '1f620',
  82327. ';(': '1f622',
  82328. 'D:': '1f628',
  82329. ':$': '1f633',
  82330. '=$': '1f633',
  82331. '#)': '1f635',
  82332. '%)': '1f635',
  82333. 'X)': '1f635',
  82334. 'B)': '1f60e',
  82335. '8)': '1f60e',
  82336. ':/': '1f615',
  82337. ':\\': '1f615',
  82338. '=/': '1f615',
  82339. '=\\': '1f615',
  82340. ':L': '1f615',
  82341. '=L': '1f615',
  82342. ':P': '1f61b',
  82343. '=P': '1f61b',
  82344. ':b': '1f61b',
  82345. ':O': '1f62e',
  82346. ':X': '1f636',
  82347. ':#': '1f636',
  82348. '=X': '1f636',
  82349. '=#': '1f636',
  82350. ':)': '1f642',
  82351. '=]': '1f642',
  82352. '=)': '1f642',
  82353. ':]': '1f642'
  82354. };
  82355. let shortnames = [];
  82356. for (var emoji in emoji_list) {
  82357. if (!Object.prototype.hasOwnProperty.call(emoji_list, emoji) || emoji === '') continue;
  82358. shortnames.push(emoji.replace(/[+]/g, "\\$&"));
  82359. for (var i = 0; i < emoji_list[emoji].shortnames.length; i++) {
  82360. shortnames.push(emoji_list[emoji].shortnames[i].replace(/[+]/g, "\\$&"));
  82361. }
  82362. }
  82363. shortnames = shortnames.join('|');
  82364. const SHORTNAMES_REGEX = new RegExp("<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|(" + shortnames + ")", "gi");
  82365. const ASCII_REGEX = '(\\*\\\\0\\/\\*|\\*\\\\O\\/\\*|\\-___\\-|\\:\'\\-\\)|\'\\:\\-\\)|\'\\:\\-D|\\>\\:\\-\\)|>\\:\\-\\)|\'\\:\\-\\(|\\>\\:\\-\\(|>\\:\\-\\(|\\:\'\\-\\(|O\\:\\-\\)|0\\:\\-3|0\\:\\-\\)|0;\\^\\)|O;\\-\\)|0;\\-\\)|O\\:\\-3|\\-__\\-|\\:\\-Þ|\\:\\-Þ|\\<\\/3|<\\/3|\\:\'\\)|\\:\\-D|\'\\:\\)|\'\\=\\)|\'\\:D|\'\\=D|\\>\\:\\)|>\\:\\)|\\>;\\)|>;\\)|\\>\\=\\)|>\\=\\)|;\\-\\)|\\*\\-\\)|;\\-\\]|;\\^\\)|\'\\:\\(|\'\\=\\(|\\:\\-\\*|\\:\\^\\*|\\>\\:P|>\\:P|X\\-P|\\>\\:\\[|>\\:\\[|\\:\\-\\(|\\:\\-\\[|\\>\\:\\(|>\\:\\(|\\:\'\\(|;\\-\\(|\\>\\.\\<|>\\.<|#\\-\\)|%\\-\\)|X\\-\\)|\\\\0\\/|\\\\O\\/|0\\:3|0\\:\\)|O\\:\\)|O\\=\\)|O\\:3|B\\-\\)|8\\-\\)|B\\-D|8\\-D|\\-_\\-|\\>\\:\\\\|>\\:\\\\|\\>\\:\\/|>\\:\\/|\\:\\-\\/|\\:\\-\\.|\\:\\-P|\\:Þ|\\:Þ|\\:\\-b|\\:\\-O|O_O|\\>\\:O|>\\:O|\\:\\-X|\\:\\-#|\\:\\-\\)|\\(y\\)|\\<3|<3|\\:D|\\=D|;\\)|\\*\\)|;\\]|;D|\\:\\*|\\=\\*|\\:\\(|\\:\\[|\\=\\(|\\:@|;\\(|D\\:|\\:\\$|\\=\\$|#\\)|%\\)|X\\)|B\\)|8\\)|\\:\\/|\\:\\\\|\\=\\/|\\=\\\\|\\:L|\\=L|\\:P|\\=P|\\:b|\\:O|\\:X|\\:#|\\=X|\\=#|\\:\\)|\\=\\]|\\=\\)|\\:\\])';
  82366. const ASCII_REPLACE_REGEX = new RegExp("<object[^>]*>.*?<\/object>|<span[^>]*>.*?<\/span>|<(?:object|embed|svg|img|div|span|p|a)[^>]*>|((\\s|^)" + ASCII_REGEX + "(?=\\s|$|[!,.?]))", "gi");
  82367. function convert(unicode) {
  82368. /* For converting unicode code points and code pairs
  82369. * to their respective characters
  82370. */
  82371. if (unicode.indexOf("-") > -1) {
  82372. const parts = [],
  82373. s = unicode.split('-');
  82374. for (let i = 0; i < s.length; i++) {
  82375. let part = parseInt(s[i], 16);
  82376. if (part >= 0x10000 && part <= 0x10FFFF) {
  82377. const hi = Math.floor((part - 0x10000) / 0x400) + 0xD800;
  82378. const lo = (part - 0x10000) % 0x400 + 0xDC00;
  82379. part = String.fromCharCode(hi) + String.fromCharCode(lo);
  82380. } else {
  82381. part = String.fromCharCode(part);
  82382. }
  82383. parts.push(part);
  82384. }
  82385. return parts.join('');
  82386. }
  82387. return twemoji__WEBPACK_IMPORTED_MODULE_0__["default"].convert.fromCodePoint(unicode);
  82388. }
  82389. _core__WEBPACK_IMPORTED_MODULE_2__["default"].shortnameToUnicode = function (str) {
  82390. /* will output unicode from shortname
  82391. * useful for sending emojis back to mobile devices
  82392. */
  82393. // Replace regular shortnames first
  82394. str = str.replace(SHORTNAMES_REGEX, shortname => {
  82395. if (typeof shortname === 'undefined' || shortname === '' || !(shortname in emoji_list)) {
  82396. // if the shortname doesnt exist just return the entire matchhju
  82397. return shortname;
  82398. }
  82399. const unicode = emoji_list[shortname].uc_output.toUpperCase();
  82400. return convert(unicode);
  82401. }); // Also replace ASCII smileys
  82402. str = str.replace(ASCII_REPLACE_REGEX, (entire, m1, m2, m3) => {
  82403. if (typeof m3 === 'undefined' || m3 === '' || !(_core__WEBPACK_IMPORTED_MODULE_2__["default"].unescapeHTML(m3) in ascii_list)) {
  82404. // if the ascii doesnt exist just return the entire match
  82405. return entire;
  82406. }
  82407. m3 = _core__WEBPACK_IMPORTED_MODULE_2__["default"].unescapeHTML(m3);
  82408. const unicode = ascii_list[m3].toUpperCase();
  82409. return m2 + convert(unicode);
  82410. });
  82411. return str;
  82412. };
  82413. _core__WEBPACK_IMPORTED_MODULE_2__["default"].addEmoji = function (_converse, text) {
  82414. if (_converse.use_system_emojis) {
  82415. return _core__WEBPACK_IMPORTED_MODULE_2__["default"].shortnameToUnicode(text);
  82416. } else {
  82417. return twemoji__WEBPACK_IMPORTED_MODULE_0__["default"].parse(text);
  82418. }
  82419. };
  82420. _core__WEBPACK_IMPORTED_MODULE_2__["default"].getEmojisByCategory = function (_converse) {
  82421. /* Return a dict of emojis with the categories as keys and
  82422. * lists of emojis in that category as values.
  82423. */
  82424. if (_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isUndefined(_converse.emojis_by_category)) {
  82425. const emojis = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.values(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.mapValues(emoji_list, function (value, key, o) {
  82426. value._shortname = key;
  82427. return value;
  82428. }));
  82429. const tones = [':tone1:', ':tone2:', ':tone3:', ':tone4:', ':tone5:'];
  82430. const excluded = [':kiss_ww:', ':kiss_mm:', ':kiss_woman_man:'];
  82431. const excluded_substrings = [':woman', ':man', ':women_', ':men_', '_man_', '_woman_', '_woman:', '_man:'];
  82432. const excluded_categories = ['modifier', 'regional'];
  82433. const categories = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.difference(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.uniq(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.map(emojis, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.partial(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a, 'category'))), excluded_categories);
  82434. const emojis_by_category = {};
  82435. _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.forEach(categories, cat => {
  82436. let list = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.sortBy(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.filter(emojis, ['category', cat]), ['uc_base']);
  82437. list = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.filter(list, item => !_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.includes(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.concat(tones, excluded), item._shortname) && !_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.some(excluded_substrings, _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.partial(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.includes, item._shortname)));
  82438. if (cat === 'people') {
  82439. const idx = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.findIndex(list, ['uc_base', '1f600']);
  82440. list = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.union(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.slice(list, idx), _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.slice(list, 0, idx + 1));
  82441. } else if (cat === 'activity') {
  82442. list = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.union(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.slice(list, 27 - 1), _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.slice(list, 0, 27));
  82443. } else if (cat === 'objects') {
  82444. list = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.union(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.slice(list, 24 - 1), _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.slice(list, 0, 24));
  82445. } else if (cat === 'travel') {
  82446. list = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.union(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.slice(list, 17 - 1), _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.slice(list, 0, 17));
  82447. } else if (cat === 'symbols') {
  82448. list = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.union(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.slice(list, 60 - 1), _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.slice(list, 0, 60));
  82449. }
  82450. emojis_by_category[cat] = list;
  82451. });
  82452. _converse.emojis_by_category = emojis_by_category;
  82453. }
  82454. return _converse.emojis_by_category;
  82455. };
  82456. _core__WEBPACK_IMPORTED_MODULE_2__["default"].getTonedEmojis = function (_converse) {
  82457. _converse.toned_emojis = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.uniq(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.map(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.filter(_core__WEBPACK_IMPORTED_MODULE_2__["default"].getEmojisByCategory(_converse).people, person => _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.includes(person._shortname, '_tone')), person => person._shortname.replace(/_tone[1-5]/, '')));
  82458. return _converse.toned_emojis;
  82459. };
  82460. _core__WEBPACK_IMPORTED_MODULE_2__["default"].getEmojiRenderer = function (_converse) {
  82461. return _converse.use_system_emojis ? _core__WEBPACK_IMPORTED_MODULE_2__["default"].shortnameToUnicode : _lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.flow(_core__WEBPACK_IMPORTED_MODULE_2__["default"].shortnameToUnicode, twemoji__WEBPACK_IMPORTED_MODULE_0__["default"].parse);
  82462. };
  82463. /* harmony default export */ __webpack_exports__["default"] = (_core__WEBPACK_IMPORTED_MODULE_2__["default"]);
  82464. /***/ }),
  82465. /***/ "./src/headless/utils/form.js":
  82466. /*!************************************!*\
  82467. !*** ./src/headless/utils/form.js ***!
  82468. \************************************/
  82469. /*! exports provided: default */
  82470. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82471. "use strict";
  82472. __webpack_require__.r(__webpack_exports__);
  82473. /* harmony import */ var _lodash_noconflict__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lodash.noconflict */ "./src/headless/lodash.noconflict.js");
  82474. /* harmony import */ var _lodash_noconflict__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lodash_noconflict__WEBPACK_IMPORTED_MODULE_0__);
  82475. /* harmony import */ var _templates_field_html__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../templates/field.html */ "./src/headless/templates/field.html");
  82476. /* harmony import */ var _templates_field_html__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_templates_field_html__WEBPACK_IMPORTED_MODULE_1__);
  82477. /* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./core */ "./src/headless/utils/core.js");
  82478. // Converse.js (A browser based XMPP chat client)
  82479. // http://conversejs.org
  82480. //
  82481. // This is the utilities module.
  82482. //
  82483. // Copyright (c) 2013-2018, Jan-Carel Brand <jc@opkode.com>
  82484. // Licensed under the Mozilla Public License (MPLv2)
  82485. _core__WEBPACK_IMPORTED_MODULE_2__["default"].webForm2xForm = function (field) {
  82486. /* Takes an HTML DOM and turns it into an XForm field.
  82487. *
  82488. * Parameters:
  82489. * (DOMElement) field - the field to convert
  82490. */
  82491. let value;
  82492. if (field.getAttribute('type') === 'checkbox') {
  82493. value = field.checked && 1 || 0;
  82494. } else if (field.tagName == "TEXTAREA") {
  82495. value = _lodash_noconflict__WEBPACK_IMPORTED_MODULE_0___default.a.filter(field.value.split('\n'), _lodash_noconflict__WEBPACK_IMPORTED_MODULE_0___default.a.trim);
  82496. } else if (field.tagName == "SELECT") {
  82497. value = _core__WEBPACK_IMPORTED_MODULE_2__["default"].getSelectValues(field);
  82498. } else {
  82499. value = field.value;
  82500. }
  82501. return _core__WEBPACK_IMPORTED_MODULE_2__["default"].stringToNode(_templates_field_html__WEBPACK_IMPORTED_MODULE_1___default()({
  82502. 'name': field.getAttribute('name'),
  82503. 'value': value
  82504. }));
  82505. };
  82506. /* harmony default export */ __webpack_exports__["default"] = (_core__WEBPACK_IMPORTED_MODULE_2__["default"]);
  82507. /***/ }),
  82508. /***/ "./src/headless/utils/muc.js":
  82509. /*!***********************************!*\
  82510. !*** ./src/headless/utils/muc.js ***!
  82511. \***********************************/
  82512. /*! no exports provided */
  82513. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82514. "use strict";
  82515. __webpack_require__.r(__webpack_exports__);
  82516. /* harmony import */ var _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @converse/headless/converse-core */ "./src/headless/converse-core.js");
  82517. /* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./core */ "./src/headless/utils/core.js");
  82518. // Converse.js (A browser based XMPP chat client)
  82519. // http://conversejs.org
  82520. //
  82521. // This is the utilities module.
  82522. //
  82523. // Copyright (c) 2013-2018, Jan-Carel Brand <jc@opkode.com>
  82524. // Licensed under the Mozilla Public License (MPLv2)
  82525. //
  82526. /*global escape, Jed */
  82527. const _converse$env = _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].env,
  82528. Strophe = _converse$env.Strophe,
  82529. sizzle = _converse$env.sizzle,
  82530. _ = _converse$env._;
  82531. _core__WEBPACK_IMPORTED_MODULE_1__["default"].computeAffiliationsDelta = function computeAffiliationsDelta(exclude_existing, remove_absentees, new_list, old_list) {
  82532. /* Given two lists of objects with 'jid', 'affiliation' and
  82533. * 'reason' properties, return a new list containing
  82534. * those objects that are new, changed or removed
  82535. * (depending on the 'remove_absentees' boolean).
  82536. *
  82537. * The affiliations for new and changed members stay the
  82538. * same, for removed members, the affiliation is set to 'none'.
  82539. *
  82540. * The 'reason' property is not taken into account when
  82541. * comparing whether affiliations have been changed.
  82542. *
  82543. * Parameters:
  82544. * (Boolean) exclude_existing: Indicates whether JIDs from
  82545. * the new list which are also in the old list
  82546. * (regardless of affiliation) should be excluded
  82547. * from the delta. One reason to do this
  82548. * would be when you want to add a JID only if it
  82549. * doesn't have *any* existing affiliation at all.
  82550. * (Boolean) remove_absentees: Indicates whether JIDs
  82551. * from the old list which are not in the new list
  82552. * should be considered removed and therefore be
  82553. * included in the delta with affiliation set
  82554. * to 'none'.
  82555. * (Array) new_list: Array containing the new affiliations
  82556. * (Array) old_list: Array containing the old affiliations
  82557. */
  82558. const new_jids = _.map(new_list, 'jid');
  82559. const old_jids = _.map(old_list, 'jid'); // Get the new affiliations
  82560. let delta = _.map(_.difference(new_jids, old_jids), jid => new_list[_.indexOf(new_jids, jid)]);
  82561. if (!exclude_existing) {
  82562. // Get the changed affiliations
  82563. delta = delta.concat(_.filter(new_list, function (item) {
  82564. const idx = _.indexOf(old_jids, item.jid);
  82565. if (idx >= 0) {
  82566. return item.affiliation !== old_list[idx].affiliation;
  82567. }
  82568. return false;
  82569. }));
  82570. }
  82571. if (remove_absentees) {
  82572. // Get the removed affiliations
  82573. delta = delta.concat(_.map(_.difference(old_jids, new_jids), jid => ({
  82574. 'jid': jid,
  82575. 'affiliation': 'none'
  82576. })));
  82577. }
  82578. return delta;
  82579. };
  82580. _core__WEBPACK_IMPORTED_MODULE_1__["default"].parseMemberListIQ = function parseMemberListIQ(iq) {
  82581. /* Given an IQ stanza with a member list, create an array of member objects.
  82582. */
  82583. return _.map(sizzle(`query[xmlns="${Strophe.NS.MUC_ADMIN}"] item`, iq), item => {
  82584. const data = {
  82585. 'affiliation': item.getAttribute('affiliation')
  82586. };
  82587. const jid = item.getAttribute('jid');
  82588. if (_core__WEBPACK_IMPORTED_MODULE_1__["default"].isValidJID(jid)) {
  82589. data['jid'] = jid;
  82590. } else {
  82591. // XXX: Prosody sends nick for the jid attribute value
  82592. // Perhaps for anonymous room?
  82593. data['nick'] = jid;
  82594. }
  82595. const nick = item.getAttribute('nick');
  82596. if (nick) {
  82597. data['nick'] = nick;
  82598. }
  82599. const role = item.getAttribute('role');
  82600. if (role) {
  82601. data['role'] = nick;
  82602. }
  82603. return data;
  82604. });
  82605. };
  82606. /***/ }),
  82607. /***/ "./src/jquery-stub.js":
  82608. /*!****************************!*\
  82609. !*** ./src/jquery-stub.js ***!
  82610. \****************************/
  82611. /*! no static exports found */
  82612. /***/ (function(module, exports, __webpack_require__) {
  82613. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*global define */
  82614. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  82615. return Object;
  82616. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  82617. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  82618. /***/ }),
  82619. /***/ "./src/templates/add_chatroom_modal.html":
  82620. /*!***********************************************!*\
  82621. !*** ./src/templates/add_chatroom_modal.html ***!
  82622. \***********************************************/
  82623. /*! no static exports found */
  82624. /***/ (function(module, exports, __webpack_require__) {
  82625. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  82626. module.exports = function(o) {
  82627. var __t, __p = '', __e = _.escape;
  82628. __p += '<!-- src/templates/add_chatroom_modal.html -->\n<div class="modal fade" id="add-chatroom-modal" tabindex="-1" role="dialog" aria-labelledby="add-chatroom-modal-label" aria-hidden="true">\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title"\n id="add-chatroom-modal-label">' +
  82629. __e(o.heading_new_chatroom) +
  82630. '</h5>\n <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n <span aria-hidden="true">×</span>\n </button>\n </div>\n <div class="modal-body">\n <form class="converse-form add-chatroom">\n <div class="form-group">\n <label for="chatroom">' +
  82631. __e(o.label_room_address) +
  82632. ':</label>\n <input type="text" required="required" name="chatroom" class="form-control" placeholder="' +
  82633. __e(o.chatroom_placeholder) +
  82634. '"/>\n </div>\n <div class="form-group">\n <label for="nickname">' +
  82635. __e(o.label_nickname) +
  82636. ':</label>\n <input type="text" name="nickname" value="' +
  82637. __e(o.nick) +
  82638. '" class="form-control"/>\n </div>\n <input type="submit" class="btn btn-primary" name="join" value="' +
  82639. __e(o.label_join) +
  82640. '"/>\n </form>\n </div>\n </div>\n </div>\n</div>\n';
  82641. return __p
  82642. };
  82643. /***/ }),
  82644. /***/ "./src/templates/add_contact_modal.html":
  82645. /*!**********************************************!*\
  82646. !*** ./src/templates/add_contact_modal.html ***!
  82647. \**********************************************/
  82648. /*! no static exports found */
  82649. /***/ (function(module, exports, __webpack_require__) {
  82650. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  82651. module.exports = function(o) {
  82652. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  82653. function print() { __p += __j.call(arguments, '') }
  82654. __p += '<!-- src/templates/add_contact_modal.html -->\n<!-- Add contact Modal -->\n<div class="modal fade" id="add-contact-modal" tabindex="-1" role="dialog" aria-labelledby="addContactModalLabel" aria-hidden="true">\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="addContactModalLabel">' +
  82655. __e(o.heading_new_contact) +
  82656. '</h5>\n <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>\n </div>\n <form class="converse-form add-xmpp-contact">\n <div class="modal-body">\n <div class="form-group ';
  82657. if (o._converse.xhr_user_search_url) { ;
  82658. __p += ' hidden ';
  82659. } ;
  82660. __p += '">\n <label class="clearfix" for="jid">' +
  82661. __e(o.label_xmpp_address) +
  82662. ':</label>\n <input type="text" name="jid" required="required" value="' +
  82663. __e(o.jid) +
  82664. '"\n class="form-control"\n placeholder="' +
  82665. __e(o.contact_placeholder) +
  82666. '"/>\n <div class="invalid-feedback">' +
  82667. __e(o.error_message) +
  82668. '</div>\n </div>\n <div class="form-group">\n <label class="clearfix" for="name">' +
  82669. __e(o.label_nickname) +
  82670. ':</label>\n <input type="text" name="name" value="' +
  82671. __e(o.nickname) +
  82672. '"\n class="form-control"\n placeholder="' +
  82673. __e(o.nickname_placeholder) +
  82674. '"/>\n </div>\n <button type="submit" class="btn btn-primary">' +
  82675. __e(o.label_add) +
  82676. '</button>\n </div>\n </form>\n </div>\n </div>\n</div>\n';
  82677. return __p
  82678. };
  82679. /***/ }),
  82680. /***/ "./src/templates/alert.html":
  82681. /*!**********************************!*\
  82682. !*** ./src/templates/alert.html ***!
  82683. \**********************************/
  82684. /*! no static exports found */
  82685. /***/ (function(module, exports, __webpack_require__) {
  82686. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  82687. module.exports = function(o) {
  82688. var __t, __p = '', __e = _.escape;
  82689. __p += '<!-- src/templates/alert.html -->\n<div class="alert ' +
  82690. __e(o.type) +
  82691. '" role="alert"><p>' +
  82692. __e(o.message) +
  82693. '</p></div>\n';
  82694. return __p
  82695. };
  82696. /***/ }),
  82697. /***/ "./src/templates/alert_modal.html":
  82698. /*!****************************************!*\
  82699. !*** ./src/templates/alert_modal.html ***!
  82700. \****************************************/
  82701. /*! no static exports found */
  82702. /***/ (function(module, exports, __webpack_require__) {
  82703. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  82704. module.exports = function(o) {
  82705. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  82706. function print() { __p += __j.call(arguments, '') }
  82707. __p += '<!-- src/templates/alert_modal.html -->\n<div class="modal" tabindex="-1" role="dialog">\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header ' +
  82708. __e(o.type) +
  82709. '">\n <h5 class="modal-title">' +
  82710. __e(o.title) +
  82711. '</h5>\n <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n <span aria-hidden="true">×</span>\n </button>\n </div>\n <div class="modal-body">';
  82712. o.messages.forEach(function (message) { ;
  82713. __p += '\n <p>' +
  82714. __e(message) +
  82715. '</p>\n ';
  82716. }) ;
  82717. __p += '\n </div>\n </div>\n </div>\n</div>\n';
  82718. return __p
  82719. };
  82720. /***/ }),
  82721. /***/ "./src/templates/audio.html":
  82722. /*!**********************************!*\
  82723. !*** ./src/templates/audio.html ***!
  82724. \**********************************/
  82725. /*! no static exports found */
  82726. /***/ (function(module, exports, __webpack_require__) {
  82727. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  82728. module.exports = function(o) {
  82729. var __t, __p = '', __e = _.escape;
  82730. __p += '<!-- src/templates/audio.html -->\n<audio controls src="' +
  82731. __e(o.url) +
  82732. '"></audio>\n<a target="_blank" rel="noopener" href="' +
  82733. __e(o.url) +
  82734. '">' +
  82735. __e(o.label_download) +
  82736. '</a>\n';
  82737. return __p
  82738. };
  82739. /***/ }),
  82740. /***/ "./src/templates/avatar.svg":
  82741. /*!**********************************!*\
  82742. !*** ./src/templates/avatar.svg ***!
  82743. \**********************************/
  82744. /*! no static exports found */
  82745. /***/ (function(module, exports, __webpack_require__) {
  82746. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  82747. module.exports = function(o) {
  82748. var __t, __p = '', __e = _.escape;
  82749. __p += '<!-- src/templates/avatar.svg -->\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="' +
  82750. __e(o.classes) +
  82751. '" width="' +
  82752. __e(o.width) +
  82753. '" height="' +
  82754. __e(o.height) +
  82755. '">\n <image width="' +
  82756. __e(o.width) +
  82757. '" height="' +
  82758. __e(o.height) +
  82759. '" preserveAspectRatio="xMidYMid meet" xlink:href="' +
  82760. __e(o.image) +
  82761. '"/>\n</svg>\n';
  82762. return __p
  82763. };
  82764. /***/ }),
  82765. /***/ "./src/templates/bookmark.html":
  82766. /*!*************************************!*\
  82767. !*** ./src/templates/bookmark.html ***!
  82768. \*************************************/
  82769. /*! no static exports found */
  82770. /***/ (function(module, exports, __webpack_require__) {
  82771. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  82772. module.exports = function(o) {
  82773. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  82774. function print() { __p += __j.call(arguments, '') }
  82775. __p += '<!-- src/templates/bookmark.html -->\n<div class="list-item controlbox-padded room-item available-chatroom d-flex flex-row ';
  82776. if (o.hidden) { ;
  82777. __p += ' hidden ';
  82778. } ;
  82779. __p += '" data-room-jid="' +
  82780. __e(o.jid) +
  82781. '">\n <a class="list-item-link open-room w-100" data-room-jid="' +
  82782. __e(o.jid) +
  82783. '" title="' +
  82784. __e(o.open_title) +
  82785. '" href="#">' +
  82786. __e(o.name) +
  82787. '</a>\n <a class="list-item-action remove-bookmark fa fa-bookmark align-self-center ';
  82788. if (o.bookmarked) { ;
  82789. __p += ' button-on ';
  82790. } ;
  82791. __p += '"\n data-room-jid="' +
  82792. __e(o.jid) +
  82793. '" data-bookmark-name="' +
  82794. __e(o.name) +
  82795. '"\n title="' +
  82796. __e(o.info_remove_bookmark) +
  82797. '" href="#"></a>\n</div>\n';
  82798. return __p
  82799. };
  82800. /***/ }),
  82801. /***/ "./src/templates/bookmarks_list.html":
  82802. /*!*******************************************!*\
  82803. !*** ./src/templates/bookmarks_list.html ***!
  82804. \*******************************************/
  82805. /*! no static exports found */
  82806. /***/ (function(module, exports, __webpack_require__) {
  82807. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  82808. module.exports = function(o) {
  82809. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  82810. function print() { __p += __j.call(arguments, '') }
  82811. __p += '<!-- src/templates/bookmarks_list.html -->\n<a href="#" class="list-toggle bookmarks-toggle controlbox-padded" title="' +
  82812. __e(o.desc_bookmarks) +
  82813. '">\n <span class="fa ';
  82814. if (o.toggle_state === o._converse.OPENED) { ;
  82815. __p += ' fa-caret-down ';
  82816. } else { ;
  82817. __p += ' fa-caret-right ';
  82818. } ;
  82819. __p += '">\n </span> ' +
  82820. __e(o.label_bookmarks) +
  82821. '</a>\n<div class="items-list bookmarks rooms-list ';
  82822. if (o.toggle_state !== o._converse.OPENED) { ;
  82823. __p += ' hidden ';
  82824. } ;
  82825. __p += '"></div>\n';
  82826. return __p
  82827. };
  82828. /***/ }),
  82829. /***/ "./src/templates/chat_status_modal.html":
  82830. /*!**********************************************!*\
  82831. !*** ./src/templates/chat_status_modal.html ***!
  82832. \**********************************************/
  82833. /*! no static exports found */
  82834. /***/ (function(module, exports, __webpack_require__) {
  82835. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  82836. module.exports = function(o) {
  82837. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  82838. function print() { __p += __j.call(arguments, '') }
  82839. __p += '<!-- src/templates/chat_status_modal.html -->\n<!-- Change status Modal -->\n<div class="modal fade" id="modal-status-change" tabindex="-1" role="dialog" aria-labelledby="changeStatusModalLabel" aria-hidden="true">\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="changeStatusModalLabel">' +
  82840. __e(o.modal_title) +
  82841. '</h5>\n <button type="button" class="close" data-dismiss="modal" aria-label="' +
  82842. __e(o.label_close) +
  82843. '">\n <span aria-hidden="true">×</span>\n </button>\n </div>\n <div class="modal-body">\n <form class="converse-form set-xmpp-status" id="set-xmpp-status">\n <div class="form-group">\n <div class="custom-control custom-radio">\n <input ';
  82844. if (o.status === 'online') { ;
  82845. __p += ' checked="checked" ';
  82846. } ;
  82847. __p += '\n type="radio" id="radio-online" value="online" name="chat_status" class="custom-control-input"/>\n <label class="custom-control-label" for="radio-online">\n <span class="fa fa-circle chat-status chat-status--online"></span>' +
  82848. __e(o.label_online) +
  82849. '</label>\n </div>\n <div class="custom-control custom-radio">\n <input ';
  82850. if (o.status === 'busy') { ;
  82851. __p += ' checked="checked" ';
  82852. } ;
  82853. __p += '\n type="radio" id="radio-busy" value="dnd" name="chat_status" class="custom-control-input"/>\n <label class="custom-control-label" for="radio-busy">\n <span class="fa fa-minus-circle chat-status chat-status--busy"></span>' +
  82854. __e(o.label_busy) +
  82855. '</label>\n </div>\n <div class="custom-control custom-radio">\n <input ';
  82856. if (o.status === 'away') { ;
  82857. __p += ' checked="checked" ';
  82858. } ;
  82859. __p += '\n type="radio" id="radio-away" value="away" name="chat_status" class="custom-control-input"/>\n <label class="custom-control-label" for="radio-away">\n <span class="fa fa-circle chat-status chat-status--away"></span>' +
  82860. __e(o.label_away) +
  82861. '</label>\n </div>\n <div class="custom-control custom-radio">\n <input ';
  82862. if (o.status === 'xa') { ;
  82863. __p += ' checked="checked" ';
  82864. } ;
  82865. __p += '\n type="radio" id="radio-xa" value="xa" name="chat_status" class="custom-control-input"/>\n <label class="custom-control-label" for="radio-xa">\n <span class="far fa-circle chat-status chat-status--xa"></span>' +
  82866. __e(o.label_xa) +
  82867. '</label>\n </div>\n </div>\n <div class="form-group">\n <div class="btn-group w-100">\n <input name="status_message" type="text" class="form-control" \n value="' +
  82868. __e(o.status_message) +
  82869. '" placeholder="' +
  82870. __e(o.placeholder_status_message) +
  82871. '"/>\n <span class="clear-input fa fa-times ';
  82872. if (!o.status_message) { ;
  82873. __p += ' hidden ';
  82874. } ;
  82875. __p += '"></span>\n </div>\n </div>\n <button type="submit" class="btn btn-primary">' +
  82876. __e(o.label_save) +
  82877. '</button>\n </form>\n </div>\n </div>\n </div>\n</div>\n';
  82878. return __p
  82879. };
  82880. /***/ }),
  82881. /***/ "./src/templates/chatarea.html":
  82882. /*!*************************************!*\
  82883. !*** ./src/templates/chatarea.html ***!
  82884. \*************************************/
  82885. /*! no static exports found */
  82886. /***/ (function(module, exports, __webpack_require__) {
  82887. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  82888. module.exports = function(o) {
  82889. var __t, __p = '', __j = Array.prototype.join;
  82890. function print() { __p += __j.call(arguments, '') }
  82891. __p += '<!-- src/templates/chatarea.html -->\n<div class="chat-area col-md-9 col-8">\n <div class="chat-content ';
  82892. if (o.show_send_button) { ;
  82893. __p += 'chat-content-sendbutton';
  82894. } ;
  82895. __p += '"></div>\n <div class="message-form-container"/>\n</div>\n';
  82896. return __p
  82897. };
  82898. /***/ }),
  82899. /***/ "./src/templates/chatbox.html":
  82900. /*!************************************!*\
  82901. !*** ./src/templates/chatbox.html ***!
  82902. \************************************/
  82903. /*! no static exports found */
  82904. /***/ (function(module, exports, __webpack_require__) {
  82905. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  82906. module.exports = function(o) {
  82907. var __t, __p = '', __j = Array.prototype.join;
  82908. function print() { __p += __j.call(arguments, '') }
  82909. __p += '<!-- src/templates/chatbox.html -->\n<div class="flyout box-flyout">\n <div class="chat-body">\n <div class="chat-content ';
  82910. if (o.show_send_button) { ;
  82911. __p += 'chat-content-sendbutton';
  82912. } ;
  82913. __p += '"></div>\n <div class="message-form-container"></div>\n </div>\n</div>\n';
  82914. return __p
  82915. };
  82916. /***/ }),
  82917. /***/ "./src/templates/chatbox_head.html":
  82918. /*!*****************************************!*\
  82919. !*** ./src/templates/chatbox_head.html ***!
  82920. \*****************************************/
  82921. /*! no static exports found */
  82922. /***/ (function(module, exports, __webpack_require__) {
  82923. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  82924. module.exports = function(o) {
  82925. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  82926. function print() { __p += __j.call(arguments, '') }
  82927. __p += '<!-- src/templates/chatbox_head.html -->\n<div class="chat-head chat-head-chatbox row no-gutters">\n <div class="chatbox-navback"><i class="fa fa-arrow-left"></i></div>\n <div class="chatbox-title">\n <div class="row no-gutters">\n <canvas class="avatar" height="36" width="36"></canvas>\n <div class="col chat-title" title="' +
  82928. __e(o.jid) +
  82929. '">\n ';
  82930. if (o.url) { ;
  82931. __p += '\n <a href="' +
  82932. __e(o.url) +
  82933. '" target="_blank" rel="noopener" class="user">\n ';
  82934. } ;
  82935. __p += '\n ' +
  82936. __e( o.nickname || o.fullname || o.jid ) +
  82937. '\n ';
  82938. if (o.url) { ;
  82939. __p += '\n </a>\n ';
  82940. } ;
  82941. __p += '\n <p class="user-custom-message">' +
  82942. __e( o.status ) +
  82943. '</p>\n </div>\n </div>\n </div>\n <div class="chatbox-buttons row no-gutters">\n <a class="chatbox-btn close-chatbox-button fa fa-times" title="' +
  82944. __e(o.info_close) +
  82945. '"></a>\n <a class="chatbox-btn show-user-details-modal fa fa-id-card" title="' +
  82946. __e(o.info_details) +
  82947. '"></a>\n </div>\n</div>\n';
  82948. return __p
  82949. };
  82950. /***/ }),
  82951. /***/ "./src/templates/chatbox_message_form.html":
  82952. /*!*************************************************!*\
  82953. !*** ./src/templates/chatbox_message_form.html ***!
  82954. \*************************************************/
  82955. /*! no static exports found */
  82956. /***/ (function(module, exports, __webpack_require__) {
  82957. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  82958. module.exports = function(o) {
  82959. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  82960. function print() { __p += __j.call(arguments, '') }
  82961. __p += '<!-- src/templates/chatbox_message_form.html -->\n<div class="message-form-container">\n<div class="new-msgs-indicator hidden">▼ ' +
  82962. __e( o.unread_msgs ) +
  82963. ' ▼</div>\n<form class="sendXMPPMessage">\n ';
  82964. if (o.show_toolbar) { ;
  82965. __p += '\n <ul class="chat-toolbar no-text-select"></ul>\n ';
  82966. } ;
  82967. __p += '\n <input type="text" placeholder="' +
  82968. ((__t = (o.label_spoiler_hint)) == null ? '' : __t) +
  82969. '" value="' +
  82970. ((__t = ( o.hint_value )) == null ? '' : __t) +
  82971. '"\n class="';
  82972. if (!o.composing_spoiler) { ;
  82973. __p += ' hidden ';
  82974. } ;
  82975. __p += ' spoiler-hint"/>\n\n <div class="suggestion-box">\n <ul class="suggestion-box__results suggestion-box__results--above" hidden=""></ul>\n <textarea\n type="text"\n class="chat-textarea suggestion-box__input\n ';
  82976. if (o.show_send_button) { ;
  82977. __p += ' chat-textarea-send-button ';
  82978. } ;
  82979. __p += '\n ';
  82980. if (o.composing_spoiler) { ;
  82981. __p += ' spoiler ';
  82982. } ;
  82983. __p += '"\n placeholder="' +
  82984. __e(o.label_message) +
  82985. '">' +
  82986. ((__t = ( o.message_value )) == null ? '' : __t) +
  82987. '</textarea>\n <span class="suggestion-box__additions visually-hidden" role="status" aria-live="assertive" aria-relevant="additions"></span>\n\n ';
  82988. if (o.show_send_button) { ;
  82989. __p += '\n <button type="submit" class="pure-button send-button">' +
  82990. __e( o.label_send ) +
  82991. '</button>\n ';
  82992. } ;
  82993. __p += '\n </div>\n</form>\n</div>\n';
  82994. return __p
  82995. };
  82996. /***/ }),
  82997. /***/ "./src/templates/chatbox_minimize.html":
  82998. /*!*********************************************!*\
  82999. !*** ./src/templates/chatbox_minimize.html ***!
  83000. \*********************************************/
  83001. /*! no static exports found */
  83002. /***/ (function(module, exports, __webpack_require__) {
  83003. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83004. module.exports = function(o) {
  83005. var __t, __p = '', __e = _.escape;
  83006. __p += '<!-- src/templates/chatbox_minimize.html -->\n<a class="chatbox-btn toggle-chatbox-button fa fa-minus" title="' +
  83007. __e(o.info_minimize) +
  83008. '"></a>\n';
  83009. return __p
  83010. };
  83011. /***/ }),
  83012. /***/ "./src/templates/chatboxes.html":
  83013. /*!**************************************!*\
  83014. !*** ./src/templates/chatboxes.html ***!
  83015. \**************************************/
  83016. /*! no static exports found */
  83017. /***/ (function(module, exports, __webpack_require__) {
  83018. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83019. module.exports = function(o) {
  83020. var __t, __p = '';
  83021. __p += '<!-- src/templates/chatboxes.html -->\n<div class="converse-chatboxes row no-gutters"></div>\n<div id="converse-modals" class="modals"></div>\n';
  83022. return __p
  83023. };
  83024. /***/ }),
  83025. /***/ "./src/templates/chatroom.html":
  83026. /*!*************************************!*\
  83027. !*** ./src/templates/chatroom.html ***!
  83028. \*************************************/
  83029. /*! no static exports found */
  83030. /***/ (function(module, exports, __webpack_require__) {
  83031. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83032. module.exports = function(o) {
  83033. var __t, __p = '';
  83034. __p += '<!-- src/templates/chatroom.html -->\n<div class="flyout box-flyout">\n <div class="chat-head chat-head-chatroom row no-gutters"></div>\n <div class="chat-body chatroom-body row no-gutters">\n <div class="disconnect-container hidden"></div>\n </div>\n</div>\n';
  83035. return __p
  83036. };
  83037. /***/ }),
  83038. /***/ "./src/templates/chatroom_bookmark_form.html":
  83039. /*!***************************************************!*\
  83040. !*** ./src/templates/chatroom_bookmark_form.html ***!
  83041. \***************************************************/
  83042. /*! no static exports found */
  83043. /***/ (function(module, exports, __webpack_require__) {
  83044. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83045. module.exports = function(o) {
  83046. var __t, __p = '', __e = _.escape;
  83047. __p += '<!-- src/templates/chatroom_bookmark_form.html -->\n<div class="chatroom-form-container">\n <form class="converse-form chatroom-form">\n <legend>' +
  83048. __e(o.heading) +
  83049. '</legend>\n <fieldset class="form-group">\n <label for="converse_muc_bookmark_name">' +
  83050. __e(o.label_name) +
  83051. '</label>\n <input class="form-control" type="text" value="' +
  83052. __e(o.name) +
  83053. '" name="name" required="required" id="converse_muc_bookmark_name"/>\n </fieldset>\n <fieldset class="form-group">\n <label for="converse_muc_bookmark_nick">' +
  83054. __e(o.label_nick) +
  83055. '</label>\n <input class="form-control" type="text" name="nick" value="' +
  83056. __e(o.default_nick) +
  83057. '" id="converse_muc_bookmark_nick"/>\n </fieldset>\n <fieldset class="form-group form-check">\n <input class="form-check-input" id="converse_muc_bookmark_autojoin" type="checkbox" name="autojoin"/>\n <label class="form-check-label" for="converse_muc_bookmark_autojoin">' +
  83058. __e(o.label_autojoin) +
  83059. '</label>\n </fieldset>\n <fieldset class="form-group">\n <input class="btn btn-primary" type="submit" value="' +
  83060. __e(o.label_submit) +
  83061. '"/>\n <input class="btn btn-secondary button-cancel" type="button" value="' +
  83062. __e(o.label_cancel) +
  83063. '"/>\n </fieldset>\n </form>\n</div>\n';
  83064. return __p
  83065. };
  83066. /***/ }),
  83067. /***/ "./src/templates/chatroom_bookmark_toggle.html":
  83068. /*!*****************************************************!*\
  83069. !*** ./src/templates/chatroom_bookmark_toggle.html ***!
  83070. \*****************************************************/
  83071. /*! no static exports found */
  83072. /***/ (function(module, exports, __webpack_require__) {
  83073. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83074. module.exports = function(o) {
  83075. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83076. function print() { __p += __j.call(arguments, '') }
  83077. __p += '<!-- src/templates/chatroom_bookmark_toggle.html -->\n<a class="chatbox-btn toggle-bookmark fa fa-bookmark\n ';
  83078. if (o.bookmarked) {;
  83079. __p += ' button-on ';
  83080. } ;
  83081. __p += '" title="' +
  83082. __e(o.info_toggle_bookmark) +
  83083. '"></a>\n';
  83084. return __p
  83085. };
  83086. /***/ }),
  83087. /***/ "./src/templates/chatroom_destroyed.html":
  83088. /*!***********************************************!*\
  83089. !*** ./src/templates/chatroom_destroyed.html ***!
  83090. \***********************************************/
  83091. /*! no static exports found */
  83092. /***/ (function(module, exports, __webpack_require__) {
  83093. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83094. module.exports = function(o) {
  83095. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83096. function print() { __p += __j.call(arguments, '') }
  83097. __p += '<!-- src/templates/chatroom_destroyed.html -->\n<div class="alert alert-danger">\n <h3 class="alert-heading disconnect-msg">' +
  83098. __e(o.__('This groupchat no longer exists')) +
  83099. '</h3>\n\n <p class="destroyed-reason">' +
  83100. __e(o.reason) +
  83101. '</p>\n\n ';
  83102. if (o.jid) { ;
  83103. __p += '\n <p class="moved-label">\n ' +
  83104. __e(o.__('The conversation has moved. Click below to enter.') ) +
  83105. '\n </p>\n <p class="moved-link"><a class="switch-chat" href="#">' +
  83106. __e(o.jid) +
  83107. '</a></p>\n ';
  83108. } ;
  83109. __p += '\n</div>\n';
  83110. return __p
  83111. };
  83112. /***/ }),
  83113. /***/ "./src/templates/chatroom_details_modal.html":
  83114. /*!***************************************************!*\
  83115. !*** ./src/templates/chatroom_details_modal.html ***!
  83116. \***************************************************/
  83117. /*! no static exports found */
  83118. /***/ (function(module, exports, __webpack_require__) {
  83119. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83120. module.exports = function(o) {
  83121. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83122. function print() { __p += __j.call(arguments, '') }
  83123. __p += '<!-- src/templates/chatroom_details_modal.html -->\n<div class="modal fade" id="room-details-modal" tabindex="-1" role="dialog" aria-labelledby="room-details-modal-label" aria-hidden="true">\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="room-details-modal-label">' +
  83124. __e(o.display_name) +
  83125. '</h5>\n <button type="button" class="close" data-dismiss="modal" aria-label="' +
  83126. __e(o.label_close) +
  83127. '"><span aria-hidden="true">×</span></button>\n </div>\n <div class="modal-body">\n <div class="room-info">\n <p class="room-info"><strong>' +
  83128. __e(o.__('Name')) +
  83129. '</strong>: ' +
  83130. __e(o.name) +
  83131. '</p>\n <p class="room-info"><strong>' +
  83132. __e(o.__('Groupchat address (JID)')) +
  83133. '</strong>: ' +
  83134. __e(o.jid) +
  83135. '</p>\n <p class="room-info"><strong>' +
  83136. __e(o.__('Description')) +
  83137. '</strong>: ' +
  83138. __e(o.description) +
  83139. '</p>\n ';
  83140. if (o.subject) { ;
  83141. __p += '\n <p class="room-info"><strong>' +
  83142. __e(o.__('Topic')) +
  83143. '</strong>: ' +
  83144. ((__t = (o.topic)) == null ? '' : __t) +
  83145. '</p> <!-- Sanitized in converse-muc-views. We want to render links. -->\n <p class="room-info"><strong>' +
  83146. __e(o.__('Topic author')) +
  83147. '</strong>: ' +
  83148. __e(o._.get(o.subject, 'author')) +
  83149. '</p>\n ';
  83150. } ;
  83151. __p += '\n <p class="room-info"><strong>' +
  83152. __e(o.__('Online users')) +
  83153. '</strong>: ' +
  83154. __e(o.num_occupants) +
  83155. '</p>\n <p class="room-info"><strong>' +
  83156. __e(o.__('Features')) +
  83157. '</strong>:\n <div class="chatroom-features">\n <ul class="features-list">\n ';
  83158. if (o.passwordprotected) { ;
  83159. __p += '\n <li class="feature" ><span class="fa fa-lock"></span>' +
  83160. __e( o.__('Password protected') ) +
  83161. ' - <em>' +
  83162. __e( o.__('This groupchat requires a password before entry') ) +
  83163. '</em></li>\n ';
  83164. } ;
  83165. __p += '\n ';
  83166. if (o.unsecured) { ;
  83167. __p += '\n <li class="feature" ><span class="fa fa-unlock"></span>' +
  83168. __e( o.__('No password required') ) +
  83169. ' - <em>' +
  83170. __e( o.__('This groupchat does not require a password upon entry') ) +
  83171. '</em></li>\n ';
  83172. } ;
  83173. __p += '\n ';
  83174. if (o.hidden) { ;
  83175. __p += '\n <li class="feature" ><span class="fa fa-eye-slash"></span>' +
  83176. __e( o.__('Hidden') ) +
  83177. ' - <em>' +
  83178. __e( o.__('This groupchat is not publicly searchable') ) +
  83179. '</em></li>\n ';
  83180. } ;
  83181. __p += '\n ';
  83182. if (o.public_room) { ;
  83183. __p += '\n <li class="feature" ><span class="fa fa-eye"></span>' +
  83184. __e( o.__('Public') ) +
  83185. ' - <em>' +
  83186. __e( o.__('This groupchat is publicly searchable') ) +
  83187. '</em></li>\n ';
  83188. } ;
  83189. __p += '\n ';
  83190. if (o.membersonly) { ;
  83191. __p += '\n <li class="feature" ><span class="fa fa-address-book"></span>' +
  83192. __e( o.__('Members only') ) +
  83193. ' - <em>' +
  83194. __e( o.__('This groupchat is restricted to members only') ) +
  83195. '</em></li>\n ';
  83196. } ;
  83197. __p += '\n ';
  83198. if (o.open) { ;
  83199. __p += '\n <li class="feature" ><span class="fa fa-globe"></span>' +
  83200. __e( o.__('Open') ) +
  83201. ' - <em>' +
  83202. __e( o.__('Anyone can join this groupchat') ) +
  83203. '</em></li>\n ';
  83204. } ;
  83205. __p += '\n ';
  83206. if (o.persistent) { ;
  83207. __p += '\n <li class="feature" ><span class="fa fa-save"></span>' +
  83208. __e( o.__('Persistent') ) +
  83209. ' - <em>' +
  83210. __e( o.__('This groupchat persists even if it\'s unoccupied') ) +
  83211. '</em></li>\n ';
  83212. } ;
  83213. __p += '\n ';
  83214. if (o.temporary) { ;
  83215. __p += '\n <li class="feature" ><span class="fa fa-snowflake-o"></span>' +
  83216. __e( o.__('Temporary') ) +
  83217. ' - <em>' +
  83218. __e( o.__('This groupchat will disappear once the last person leaves') ) +
  83219. '</em></li>\n ';
  83220. } ;
  83221. __p += '\n ';
  83222. if (o.nonanonymous) { ;
  83223. __p += '\n <li class="feature" ><span class="fa fa-id-card"></span>' +
  83224. __e( o.__('Not anonymous') ) +
  83225. ' - <em>' +
  83226. __e( o.__('All other groupchat participants can see your XMPP username') ) +
  83227. '</em></li>\n ';
  83228. } ;
  83229. __p += '\n ';
  83230. if (o.semianonymous) { ;
  83231. __p += '\n <li class="feature" ><span class="fa fa-user-secret"></span>' +
  83232. __e( o.__('Semi-anonymous') ) +
  83233. ' - <em>' +
  83234. __e( o.__('Only moderators can see your XMPP username') ) +
  83235. '</em></li>\n ';
  83236. } ;
  83237. __p += '\n ';
  83238. if (o.moderated) { ;
  83239. __p += '\n <li class="feature" ><span class="fa fa-gavel"></span>' +
  83240. __e( o.__('Moderated') ) +
  83241. ' - <em>' +
  83242. __e( o.__('Participants entering this groupchat need to request permission to write') ) +
  83243. '</em></li>\n ';
  83244. } ;
  83245. __p += '\n ';
  83246. if (o.unmoderated) { ;
  83247. __p += '\n <li class="feature" ><span class="fa fa-info-circle"></span>' +
  83248. __e( o.__('Not moderated') ) +
  83249. ' - <em>' +
  83250. __e( o.__('Participants entering this groupchat can write right away') ) +
  83251. '</em></li>\n ';
  83252. } ;
  83253. __p += '\n ';
  83254. if (o.mam_enabled) { ;
  83255. __p += '\n <li class="feature" ><span class="fa fa-database"></span>' +
  83256. __e( o.__('Message archiving') ) +
  83257. ' - <em>' +
  83258. __e( o.__('Messages are archived on the server') ) +
  83259. '</em></li>\n ';
  83260. } ;
  83261. __p += '\n </ul>\n </div>\n </p>\n </div>\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-warning" data-dismiss="modal">' +
  83262. __e(o.__('Close')) +
  83263. '</button>\n </div>\n </div>\n </div>\n</div>\n';
  83264. return __p
  83265. };
  83266. /***/ }),
  83267. /***/ "./src/templates/chatroom_disconnect.html":
  83268. /*!************************************************!*\
  83269. !*** ./src/templates/chatroom_disconnect.html ***!
  83270. \************************************************/
  83271. /*! no static exports found */
  83272. /***/ (function(module, exports, __webpack_require__) {
  83273. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83274. module.exports = function(o) {
  83275. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83276. function print() { __p += __j.call(arguments, '') }
  83277. __p += '<!-- src/templates/chatroom_disconnect.html -->\n<div class="alert alert-danger">\n <h3 class="alert-heading disconnect-msg">' +
  83278. __e(o.disconnect_messages[0]) +
  83279. '</h3>\n\n ';
  83280. o._.forEach(o.disconnect_messages.slice(1), function (msg) { ;
  83281. __p += '\n <p class="disconnect-msg">' +
  83282. __e(msg) +
  83283. '</p>\n ';
  83284. }); ;
  83285. __p += '\n</div>\n';
  83286. return __p
  83287. };
  83288. /***/ }),
  83289. /***/ "./src/templates/chatroom_features.html":
  83290. /*!**********************************************!*\
  83291. !*** ./src/templates/chatroom_features.html ***!
  83292. \**********************************************/
  83293. /*! no static exports found */
  83294. /***/ (function(module, exports, __webpack_require__) {
  83295. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83296. module.exports = function(o) {
  83297. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83298. function print() { __p += __j.call(arguments, '') }
  83299. __p += '<!-- src/templates/chatroom_features.html -->\n';
  83300. if (o.has_features) { ;
  83301. __p += '\n<p class="occupants-heading">' +
  83302. __e(o.__('Features')) +
  83303. '</p>\n';
  83304. } ;
  83305. __p += '\n<ul class="features-list">\n';
  83306. if (o.passwordprotected) { ;
  83307. __p += '\n<li class="feature" title="' +
  83308. __e( o.__('This groupchat requires a password before entry') ) +
  83309. '"><span class="fa fa-lock"></span>' +
  83310. __e( o.__('Password protected') ) +
  83311. '</li>\n';
  83312. } ;
  83313. __p += '\n';
  83314. if (o.unsecured) { ;
  83315. __p += '\n<li class="feature" title="' +
  83316. __e( o.__('This groupchat does not require a password upon entry') ) +
  83317. '"><span class="fa fa-unlock"></span>' +
  83318. __e( o.__('No password') ) +
  83319. '</li>\n';
  83320. } ;
  83321. __p += '\n';
  83322. if (o.hidden) { ;
  83323. __p += '\n<li class="feature" title="' +
  83324. __e( o.__('This groupchat is not publicly searchable') ) +
  83325. '"><span class="fa fa-eye-slash"></span>' +
  83326. __e( o.__('Hidden') ) +
  83327. '</li>\n';
  83328. } ;
  83329. __p += '\n';
  83330. if (o.public_room) { ;
  83331. __p += '\n<li class="feature" title="' +
  83332. __e( o.__('This groupchat is publicly searchable') ) +
  83333. '"><span class="fa fa-eye"></span>' +
  83334. __e( o.__('Public') ) +
  83335. '</li>\n';
  83336. } ;
  83337. __p += '\n';
  83338. if (o.membersonly) { ;
  83339. __p += '\n<li class="feature" title="' +
  83340. __e( o.__('this groupchat is restricted to members only') ) +
  83341. '"><span class="fa fa-address-book"></span>' +
  83342. __e( o.__('Members only') ) +
  83343. '</li>\n';
  83344. } ;
  83345. __p += '\n';
  83346. if (o.open) { ;
  83347. __p += '\n<li class="feature" title="' +
  83348. __e( o.__('Anyone can join this groupchat') ) +
  83349. '"><span class="fa fa-globe"></span>' +
  83350. __e( o.__('Open') ) +
  83351. '</li>\n';
  83352. } ;
  83353. __p += '\n';
  83354. if (o.persistent) { ;
  83355. __p += '\n<li class="feature" title="' +
  83356. __e( o.__('This groupchat persists even if it\'s unoccupied') ) +
  83357. '"><span class="fa fa-save"></span>' +
  83358. __e( o.__('Persistent') ) +
  83359. '</li>\n';
  83360. } ;
  83361. __p += '\n';
  83362. if (o.temporary) { ;
  83363. __p += '\n<li class="feature" title="' +
  83364. __e( o.__('This groupchat will disappear once the last person leaves') ) +
  83365. '"><span class="fa fa-snowflake-o"></span>' +
  83366. __e( o.__('Temporary') ) +
  83367. '</li>\n';
  83368. } ;
  83369. __p += '\n';
  83370. if (o.nonanonymous) { ;
  83371. __p += '\n<li class="feature" title="' +
  83372. __e( o.__('All other groupchat participants can see your XMPP username') ) +
  83373. '"><span class="fa fa-id-card"></span>' +
  83374. __e( o.__('Not anonymous') ) +
  83375. '</li>\n';
  83376. } ;
  83377. __p += '\n';
  83378. if (o.semianonymous) { ;
  83379. __p += '\n<li class="feature" title="' +
  83380. __e( o.__('Only moderators can see your XMPP username') ) +
  83381. '"><span class="fa fa-user-secret"></span>' +
  83382. __e( o.__('Semi-anonymous') ) +
  83383. '</li>\n';
  83384. } ;
  83385. __p += '\n';
  83386. if (o.moderated) { ;
  83387. __p += '\n<li class="feature" title="' +
  83388. __e( o.__('Participants entering this groupchat need to request permission to write') ) +
  83389. '"><span class="fa fa-gavel"></span>' +
  83390. __e( o.__('Moderated') ) +
  83391. '</li>\n';
  83392. } ;
  83393. __p += '\n';
  83394. if (o.unmoderated) { ;
  83395. __p += '\n<li class="feature" title="' +
  83396. __e( o.__('Participants entering this groupchat can write right away') ) +
  83397. '"><span class="fa fa-info-circle"></span>' +
  83398. __e( o.__('Not moderated') ) +
  83399. '</li>\n';
  83400. } ;
  83401. __p += '\n';
  83402. if (o.mam_enabled) { ;
  83403. __p += '\n<li class="feature" title="' +
  83404. __e( o.__('Messages are archived on the server') ) +
  83405. '"><span class="fa fa-database"></span>' +
  83406. __e( o.__('Message archiving') ) +
  83407. '</li>\n';
  83408. } ;
  83409. __p += '\n</ul>\n';
  83410. return __p
  83411. };
  83412. /***/ }),
  83413. /***/ "./src/templates/chatroom_form.html":
  83414. /*!******************************************!*\
  83415. !*** ./src/templates/chatroom_form.html ***!
  83416. \******************************************/
  83417. /*! no static exports found */
  83418. /***/ (function(module, exports, __webpack_require__) {
  83419. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83420. module.exports = function(o) {
  83421. var __t, __p = '';
  83422. __p += '<!-- src/templates/chatroom_form.html -->\n<div class="chatroom-form-container">\n <form class="converse-form chatroom-form">\n <fieldset class="form-group">\n <span class="spinner fa fa-spinner centered"/>\n </fieldset>\n </form>\n</div>\n';
  83423. return __p
  83424. };
  83425. /***/ }),
  83426. /***/ "./src/templates/chatroom_head.html":
  83427. /*!******************************************!*\
  83428. !*** ./src/templates/chatroom_head.html ***!
  83429. \******************************************/
  83430. /*! no static exports found */
  83431. /***/ (function(module, exports, __webpack_require__) {
  83432. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83433. module.exports = function(o) {
  83434. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83435. function print() { __p += __j.call(arguments, '') }
  83436. __p += '<!-- src/templates/chatroom_head.html -->\n<div class="chatbox-navback"><i class="fa fa-arrow-left"></i></div>\n<div class="chatbox-title">\n <div class="chat-title" title="' +
  83437. __e(o.jid) +
  83438. '">\n ';
  83439. if (o.name && o.name !== o.Strophe.getNodeFromJid(o.jid)) { ;
  83440. __p += '\n ' +
  83441. __e( o.name ) +
  83442. '\n ';
  83443. } else { ;
  83444. __p += '\n ' +
  83445. __e( o.Strophe.getNodeFromJid(o.jid) ) +
  83446. '@' +
  83447. __e( o.Strophe.getDomainFromJid(o.jid) ) +
  83448. '\n ';
  83449. } ;
  83450. __p += '\n </div>\n <!-- Sanitized in converse-muc-views. We want to render links. -->\n <p class="chatroom-description">' +
  83451. ((__t = (o.description)) == null ? '' : __t) +
  83452. '</p>\n</div>\n<div class="chatbox-buttons row no-gutters">\n <a class="chatbox-btn close-chatbox-button fa fa-sign-out-alt" title="' +
  83453. __e(o.info_close) +
  83454. '"></a>\n ';
  83455. if (o.affiliation == 'owner') { ;
  83456. __p += '\n <a class="chatbox-btn configure-chatroom-button fa fa-wrench" title="' +
  83457. __e(o.info_configure) +
  83458. ' "></a>\n ';
  83459. } ;
  83460. __p += '\n <a class="chatbox-btn show-room-details-modal fa fa-info-circle" title="' +
  83461. __e(o.info_details) +
  83462. '"></a>\n</div>\n';
  83463. return __p
  83464. };
  83465. /***/ }),
  83466. /***/ "./src/templates/chatroom_invite.html":
  83467. /*!********************************************!*\
  83468. !*** ./src/templates/chatroom_invite.html ***!
  83469. \********************************************/
  83470. /*! no static exports found */
  83471. /***/ (function(module, exports, __webpack_require__) {
  83472. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83473. module.exports = function(o) {
  83474. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83475. function print() { __p += __j.call(arguments, '') }
  83476. __p += '<!-- src/templates/chatroom_invite.html -->\n<form class="room-invite">\n ';
  83477. if (o.error_message) { ;
  83478. __p += '\n <span class="error">' +
  83479. __e(o.error_message) +
  83480. '</span>\n ';
  83481. } ;
  83482. __p += '\n <input class="form-control invited-contact" placeholder="' +
  83483. __e(o.label_invitation) +
  83484. '" type="text"/>\n</form>\n';
  83485. return __p
  83486. };
  83487. /***/ }),
  83488. /***/ "./src/templates/chatroom_nickname_form.html":
  83489. /*!***************************************************!*\
  83490. !*** ./src/templates/chatroom_nickname_form.html ***!
  83491. \***************************************************/
  83492. /*! no static exports found */
  83493. /***/ (function(module, exports, __webpack_require__) {
  83494. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83495. module.exports = function(o) {
  83496. var __t, __p = '', __e = _.escape;
  83497. __p += '<!-- src/templates/chatroom_nickname_form.html -->\n<div class="chatroom-form-container">\n <form class="converse-form chatroom-form converse-centered-form">\n <fieldset class="form-group">\n <label>' +
  83498. __e(o.heading) +
  83499. '</label>\n <p class="validation-message">' +
  83500. __e(o.validation_message) +
  83501. '</p>\n <input type="text" required="required" name="nick" class="form-control" placeholder="' +
  83502. __e(o.label_nickname) +
  83503. '"/>\n </fieldset>\n <input type="submit" class="btn btn-primary" name="join" value="' +
  83504. __e(o.label_join) +
  83505. '"/>\n </form>\n</div>\n';
  83506. return __p
  83507. };
  83508. /***/ }),
  83509. /***/ "./src/templates/chatroom_password_form.html":
  83510. /*!***************************************************!*\
  83511. !*** ./src/templates/chatroom_password_form.html ***!
  83512. \***************************************************/
  83513. /*! no static exports found */
  83514. /***/ (function(module, exports, __webpack_require__) {
  83515. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83516. module.exports = function(o) {
  83517. var __t, __p = '', __e = _.escape;
  83518. __p += '<!-- src/templates/chatroom_password_form.html -->\n<div class="chatroom-form-container">\n <form class="pure-form converse-form chatroom-form">\n <fieldset class="form-group">\n <legend>' +
  83519. __e(o.heading) +
  83520. '</legend>\n <label>' +
  83521. __e(o.label_password) +
  83522. '</label>\n <input type="password" name="password"/>\n </fieldset>\n <input class="btn btn-primary" type="submit" value="' +
  83523. __e(o.label_submit) +
  83524. '"/>\n </form>\n</div>\n';
  83525. return __p
  83526. };
  83527. /***/ }),
  83528. /***/ "./src/templates/chatroom_sidebar.html":
  83529. /*!*********************************************!*\
  83530. !*** ./src/templates/chatroom_sidebar.html ***!
  83531. \*********************************************/
  83532. /*! no static exports found */
  83533. /***/ (function(module, exports, __webpack_require__) {
  83534. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83535. module.exports = function(o) {
  83536. var __t, __p = '', __e = _.escape;
  83537. __p += '<!-- src/templates/chatroom_sidebar.html -->\n<!-- <div class="occupants"> -->\n<div class="occupants-header">\n <i class="hide-occupants fa fa-times"></i>\n <p class="occupants-heading">' +
  83538. __e(o.label_occupants) +
  83539. '</p>\n</div>\n<ul class="occupant-list"></ul>\n<div class="chatroom-features"></div>\n<!-- </div> -->\n';
  83540. return __p
  83541. };
  83542. /***/ }),
  83543. /***/ "./src/templates/chats_panel.html":
  83544. /*!****************************************!*\
  83545. !*** ./src/templates/chats_panel.html ***!
  83546. \****************************************/
  83547. /*! no static exports found */
  83548. /***/ (function(module, exports, __webpack_require__) {
  83549. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83550. module.exports = function(o) {
  83551. var __t, __p = '';
  83552. __p += '<!-- src/templates/chats_panel.html -->\n<a id="toggle-minimized-chats" href="#" class="row no-gutters"></a>\n<div class="flyout minimized-chats-flyout row no-gutters"></div>\n';
  83553. return __p
  83554. };
  83555. /***/ }),
  83556. /***/ "./src/templates/client_info_modal.html":
  83557. /*!**********************************************!*\
  83558. !*** ./src/templates/client_info_modal.html ***!
  83559. \**********************************************/
  83560. /*! no static exports found */
  83561. /***/ (function(module, exports, __webpack_require__) {
  83562. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83563. module.exports = function(o) {
  83564. var __t, __p = '', __e = _.escape;
  83565. __p += '<!-- src/templates/client_info_modal.html -->\n<!-- Change status Modal -->\n<div class="modal fade" id="modal-status-change" tabindex="-1" role="dialog" aria-labelledby="changeStatusModalLabel" aria-hidden="true">\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="changeStatusModalLabel">' +
  83566. __e(o.modal_title) +
  83567. '</h5>\n <button type="button" class="close" data-dismiss="modal" aria-label="' +
  83568. __e(o.label_close) +
  83569. '">\n <span aria-hidden="true">×</span>\n </button>\n </div>\n <div class="modal-body">\n <div class="container brand-heading-container">\n <h6 class="brand-heading"><i class="icon-conversejs"></i>Converse</h6>\n <p class="brand-subtitle">' +
  83570. __e(o.version_name) +
  83571. '</p>\n <p class="brand-subtitle">' +
  83572. ((__t = (o.first_subtitle)) == null ? '' : __t) +
  83573. '</p>\n <p class="brand-subtitle">' +
  83574. ((__t = (o.second_subtitle)) == null ? '' : __t) +
  83575. '</p>\n </div>\n </div>\n </div>\n </div>\n</div>\n';
  83576. return __p
  83577. };
  83578. /***/ }),
  83579. /***/ "./src/templates/controlbox.html":
  83580. /*!***************************************!*\
  83581. !*** ./src/templates/controlbox.html ***!
  83582. \***************************************/
  83583. /*! no static exports found */
  83584. /***/ (function(module, exports, __webpack_require__) {
  83585. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83586. module.exports = function(o) {
  83587. var __t, __p = '', __j = Array.prototype.join;
  83588. function print() { __p += __j.call(arguments, '') }
  83589. __p += '<!-- src/templates/controlbox.html -->\n<div class="flyout box-flyout">\n <div class="chat-head controlbox-head">\n ';
  83590. if (!o.sticky_controlbox) { ;
  83591. __p += '\n <a class="chatbox-btn close-chatbox-button fa fa-times"></a>\n ';
  83592. } ;
  83593. __p += '\n </div>\n <div class="controlbox-panes"></div>\n</div>\n';
  83594. return __p
  83595. };
  83596. /***/ }),
  83597. /***/ "./src/templates/controlbox_toggle.html":
  83598. /*!**********************************************!*\
  83599. !*** ./src/templates/controlbox_toggle.html ***!
  83600. \**********************************************/
  83601. /*! no static exports found */
  83602. /***/ (function(module, exports, __webpack_require__) {
  83603. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83604. module.exports = function(o) {
  83605. var __t, __p = '', __e = _.escape;
  83606. __p += '<!-- src/templates/controlbox_toggle.html -->\n<span class="toggle-feedback">' +
  83607. __e(o.label_toggle) +
  83608. '</span>\n';
  83609. return __p
  83610. };
  83611. /***/ }),
  83612. /***/ "./src/templates/converse_brand_heading.html":
  83613. /*!***************************************************!*\
  83614. !*** ./src/templates/converse_brand_heading.html ***!
  83615. \***************************************************/
  83616. /*! no static exports found */
  83617. /***/ (function(module, exports, __webpack_require__) {
  83618. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83619. module.exports = function(o) {
  83620. var __t, __p = '';
  83621. __p += '<!-- src/templates/converse_brand_heading.html -->\n<span class="brand-heading-container">\n <div class="brand-heading">\n <a href="https://conversejs.org" target="_blank" rel="noopener">\n <i class="icon-conversejs"></i><span class="brand-name">converse</span>\n </a>\n </div>\n</span>\n';
  83622. return __p
  83623. };
  83624. /***/ }),
  83625. /***/ "./src/templates/csn.html":
  83626. /*!********************************!*\
  83627. !*** ./src/templates/csn.html ***!
  83628. \********************************/
  83629. /*! no static exports found */
  83630. /***/ (function(module, exports, __webpack_require__) {
  83631. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83632. module.exports = function(o) {
  83633. var __t, __p = '', __e = _.escape;
  83634. __p += '<!-- src/templates/csn.html -->\n<div class="message chat-info chat-state-notification"\n data-isodate="' +
  83635. __e(o.isodate) +
  83636. '"\n data-csn="' +
  83637. __e(o.from) +
  83638. '">' +
  83639. __e(o.message) +
  83640. '</div>\n';
  83641. return __p
  83642. };
  83643. /***/ }),
  83644. /***/ "./src/templates/dragresize.html":
  83645. /*!***************************************!*\
  83646. !*** ./src/templates/dragresize.html ***!
  83647. \***************************************/
  83648. /*! no static exports found */
  83649. /***/ (function(module, exports, __webpack_require__) {
  83650. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83651. module.exports = function(o) {
  83652. var __t, __p = '';
  83653. __p += '<!-- src/templates/dragresize.html -->\n<div class="dragresize dragresize-top"></div>\n<div class="dragresize dragresize-topleft"></div>\n<div class="dragresize dragresize-left"></div>\n';
  83654. return __p
  83655. };
  83656. /***/ }),
  83657. /***/ "./src/templates/emojis.html":
  83658. /*!***********************************!*\
  83659. !*** ./src/templates/emojis.html ***!
  83660. \***********************************/
  83661. /*! no static exports found */
  83662. /***/ (function(module, exports, __webpack_require__) {
  83663. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83664. module.exports = function(o) {
  83665. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83666. function print() { __p += __j.call(arguments, '') }
  83667. __p += '<!-- src/templates/emojis.html -->\n<div class="emoji-picker-container">\n';
  83668. o._.forEach(o.emojis_by_category, function (obj, category) { ;
  83669. __p += '\n <ul class="emoji-picker emoji-picker-' +
  83670. __e(category) +
  83671. ' ';
  83672. if (o.current_category !== category) { ;
  83673. __p += ' hidden ';
  83674. } ;
  83675. __p += '">\n ';
  83676. o._.forEach(o.emojis_by_category[category], function (emoji) { ;
  83677. __p += '\n <li class="emoji insert-emoji ';
  83678. if (o.shouldBeHidden(emoji._shortname, o.current_skintone, o.toned_emojis)) { ;
  83679. __p += ' hidden ';
  83680. }; ;
  83681. __p += '"\n data-emoji="' +
  83682. __e(emoji._shortname) +
  83683. '">\n <a href="#" data-emoji="' +
  83684. __e(emoji._shortname) +
  83685. '"> ' +
  83686. ((__t = ( o.transform(emoji._shortname) )) == null ? '' : __t) +
  83687. ' </a>\n </li>\n ';
  83688. }); ;
  83689. __p += '\n </ul>\n';
  83690. }); ;
  83691. __p += '\n<ul class="emoji-toolbar">\n <li class="emoji-category-picker">\n <ul>\n ';
  83692. o._.forEach(o.emojis_by_category, function (obj, category) { ;
  83693. __p += '\n <li data-category="' +
  83694. __e(category) +
  83695. '" class="emoji-category ';
  83696. if (o.current_category === category) { ;
  83697. __p += ' picked ';
  83698. } ;
  83699. __p += '">\n <a class="pick-category" href="#" data-category="' +
  83700. __e(category) +
  83701. '"> ' +
  83702. ((__t = ( o.transform(o.emojis_by_category[category][0]._shortname) )) == null ? '' : __t) +
  83703. ' </a>\n </li>\n ';
  83704. }); ;
  83705. __p += '\n </ul>\n </li>\n <li class="emoji-skintone-picker">\n <ul>\n ';
  83706. o._.forEach(o.skintones, function (skintone) { ;
  83707. __p += '\n <li data-skintone="' +
  83708. __e(skintone) +
  83709. '" class="emoji-skintone ';
  83710. if (o.current_skintone === skintone) { ;
  83711. __p += ' picked ';
  83712. } ;
  83713. __p += '">\n <a class="pick-skintone" href="#" data-skintone="' +
  83714. __e(skintone) +
  83715. '"> ' +
  83716. ((__t = ( o.transform(':'+skintone+':') )) == null ? '' : __t) +
  83717. ' </a>\n </li>\n ';
  83718. }); ;
  83719. __p += '\n </ul>\n </li>\n</ul>\n</div>\n';
  83720. return __p
  83721. };
  83722. /***/ }),
  83723. /***/ "./src/templates/error_message.html":
  83724. /*!******************************************!*\
  83725. !*** ./src/templates/error_message.html ***!
  83726. \******************************************/
  83727. /*! no static exports found */
  83728. /***/ (function(module, exports, __webpack_require__) {
  83729. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83730. module.exports = function(o) {
  83731. var __t, __p = '', __e = _.escape;
  83732. __p += '<!-- src/templates/error_message.html -->\n<div class="message chat-info chat-error" data-isodate="' +
  83733. __e(o.isodate) +
  83734. '">' +
  83735. __e(o.message) +
  83736. '</div>\n';
  83737. return __p
  83738. };
  83739. /***/ }),
  83740. /***/ "./src/templates/file.html":
  83741. /*!*********************************!*\
  83742. !*** ./src/templates/file.html ***!
  83743. \*********************************/
  83744. /*! no static exports found */
  83745. /***/ (function(module, exports, __webpack_require__) {
  83746. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83747. module.exports = function(o) {
  83748. var __t, __p = '', __e = _.escape;
  83749. __p += '<!-- src/templates/file.html -->\n<a target="_blank" rel="noopener" href="' +
  83750. __e(o.url) +
  83751. '">' +
  83752. __e(o.label_download) +
  83753. '</a>\n';
  83754. return __p
  83755. };
  83756. /***/ }),
  83757. /***/ "./src/templates/file_progress.html":
  83758. /*!******************************************!*\
  83759. !*** ./src/templates/file_progress.html ***!
  83760. \******************************************/
  83761. /*! no static exports found */
  83762. /***/ (function(module, exports, __webpack_require__) {
  83763. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83764. module.exports = function(o) {
  83765. var __t, __p = '', __e = _.escape;
  83766. __p += '<!-- src/templates/file_progress.html -->\n<div class="message chat-msg" data-isodate="' +
  83767. __e(o.time) +
  83768. '" data-msgid="' +
  83769. __e(o.msgid) +
  83770. '">\n <canvas class="avatar chat-msg__avatar" height="36" width="36"></canvas>\n <div class="chat-msg__content">\n <span class="chat-msg__text">' +
  83771. __e(o.__('Uploading file:')) +
  83772. ' <strong>' +
  83773. __e(o.filename) +
  83774. '</strong>, ' +
  83775. __e(o.filesize) +
  83776. '</span>\n <progress value="' +
  83777. __e(o.progress) +
  83778. '"/>\n </div>\n</div>\n';
  83779. return __p
  83780. };
  83781. /***/ }),
  83782. /***/ "./src/templates/form_captcha.html":
  83783. /*!*****************************************!*\
  83784. !*** ./src/templates/form_captcha.html ***!
  83785. \*****************************************/
  83786. /*! no static exports found */
  83787. /***/ (function(module, exports, __webpack_require__) {
  83788. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83789. module.exports = function(o) {
  83790. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83791. function print() { __p += __j.call(arguments, '') }
  83792. __p += '<!-- src/templates/form_captcha.html -->\n';
  83793. if (o.label) { ;
  83794. __p += '\n<label>\n ' +
  83795. __e(o.label) +
  83796. '\n</label>\n';
  83797. } ;
  83798. __p += '\n<img src="data:' +
  83799. __e(o.type) +
  83800. ';base64,' +
  83801. __e(o.data) +
  83802. '">\n<input name="' +
  83803. __e(o.name) +
  83804. '" type="text" ';
  83805. if (o.required) { ;
  83806. __p += ' class="required" ';
  83807. } ;
  83808. __p += ' />\n\n\n';
  83809. return __p
  83810. };
  83811. /***/ }),
  83812. /***/ "./src/templates/form_checkbox.html":
  83813. /*!******************************************!*\
  83814. !*** ./src/templates/form_checkbox.html ***!
  83815. \******************************************/
  83816. /*! no static exports found */
  83817. /***/ (function(module, exports, __webpack_require__) {
  83818. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83819. module.exports = function(o) {
  83820. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83821. function print() { __p += __j.call(arguments, '') }
  83822. __p += '<!-- src/templates/form_checkbox.html -->\n<div class="form-group">\n <input id="' +
  83823. __e(o.id) +
  83824. '" name="' +
  83825. __e(o.name) +
  83826. '" type="checkbox" ' +
  83827. __e(o.checked) +
  83828. ' ';
  83829. if (o.required) { ;
  83830. __p += ' required ';
  83831. } ;
  83832. __p += ' />\n <label class="form-check-label" for="' +
  83833. __e(o.id) +
  83834. '">' +
  83835. __e(o.label) +
  83836. '</label>\n</div>\n';
  83837. return __p
  83838. };
  83839. /***/ }),
  83840. /***/ "./src/templates/form_input.html":
  83841. /*!***************************************!*\
  83842. !*** ./src/templates/form_input.html ***!
  83843. \***************************************/
  83844. /*! no static exports found */
  83845. /***/ (function(module, exports, __webpack_require__) {
  83846. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83847. module.exports = function(o) {
  83848. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83849. function print() { __p += __j.call(arguments, '') }
  83850. __p += '<!-- src/templates/form_input.html -->\n<div class="form-group">\n ';
  83851. if (o.type !== 'hidden') { ;
  83852. __p += '\n <label for="' +
  83853. __e(o.id) +
  83854. '">' +
  83855. __e(o.label) +
  83856. '</label>\n ';
  83857. } ;
  83858. __p += '\n <input class="form-control" name="' +
  83859. __e(o.name) +
  83860. '" type="' +
  83861. __e(o.type) +
  83862. '" id="' +
  83863. __e(o.id) +
  83864. '"\n ';
  83865. if (o.placeholder) { ;
  83866. __p += ' placeholder="' +
  83867. __e(o.placeholder) +
  83868. '" ';
  83869. } ;
  83870. __p += '\n ';
  83871. if (o.value) { ;
  83872. __p += ' value="' +
  83873. __e(o.value) +
  83874. '" ';
  83875. } ;
  83876. __p += '\n ';
  83877. if (o.required) { ;
  83878. __p += ' required ';
  83879. } ;
  83880. __p += ' />\n</div>\n';
  83881. return __p
  83882. };
  83883. /***/ }),
  83884. /***/ "./src/templates/form_select.html":
  83885. /*!****************************************!*\
  83886. !*** ./src/templates/form_select.html ***!
  83887. \****************************************/
  83888. /*! no static exports found */
  83889. /***/ (function(module, exports, __webpack_require__) {
  83890. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83891. module.exports = function(o) {
  83892. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83893. function print() { __p += __j.call(arguments, '') }
  83894. __p += '<!-- src/templates/form_select.html -->\n<div class="form-group">\n <label for="' +
  83895. __e(o.id) +
  83896. '">' +
  83897. __e(o.label) +
  83898. '</label>\n <select class="form-control" id="' +
  83899. __e(o.id) +
  83900. '" name="' +
  83901. __e(o.name) +
  83902. '" ';
  83903. if (o.multiple) { ;
  83904. __p += ' multiple="multiple" ';
  83905. } ;
  83906. __p += '>' +
  83907. ((__t = (o.options)) == null ? '' : __t) +
  83908. '</select>\n</div>\n';
  83909. return __p
  83910. };
  83911. /***/ }),
  83912. /***/ "./src/templates/form_textarea.html":
  83913. /*!******************************************!*\
  83914. !*** ./src/templates/form_textarea.html ***!
  83915. \******************************************/
  83916. /*! no static exports found */
  83917. /***/ (function(module, exports, __webpack_require__) {
  83918. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83919. module.exports = function(o) {
  83920. var __t, __p = '', __e = _.escape;
  83921. __p += '<!-- src/templates/form_textarea.html -->\n<label class="label-ta">' +
  83922. __e(o.label) +
  83923. '</label>\n<textarea name="' +
  83924. __e(o.name) +
  83925. '">' +
  83926. __e(o.value) +
  83927. '</textarea>\n';
  83928. return __p
  83929. };
  83930. /***/ }),
  83931. /***/ "./src/templates/form_url.html":
  83932. /*!*************************************!*\
  83933. !*** ./src/templates/form_url.html ***!
  83934. \*************************************/
  83935. /*! no static exports found */
  83936. /***/ (function(module, exports, __webpack_require__) {
  83937. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83938. module.exports = function(o) {
  83939. var __t, __p = '', __e = _.escape;
  83940. __p += '<!-- src/templates/form_url.html -->\n<label>\n ' +
  83941. __e(o.label) +
  83942. '\n <a class="form-url" target="_blank" rel="noopener" href="' +
  83943. __e(o.value) +
  83944. '">' +
  83945. __e(o.value) +
  83946. '</a>\n</label>\n';
  83947. return __p
  83948. };
  83949. /***/ }),
  83950. /***/ "./src/templates/form_username.html":
  83951. /*!******************************************!*\
  83952. !*** ./src/templates/form_username.html ***!
  83953. \******************************************/
  83954. /*! no static exports found */
  83955. /***/ (function(module, exports, __webpack_require__) {
  83956. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83957. module.exports = function(o) {
  83958. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83959. function print() { __p += __j.call(arguments, '') }
  83960. __p += '<!-- src/templates/form_username.html -->\n<div class="form-group">\n ';
  83961. if (o.label) { ;
  83962. __p += '\n <label>\n ' +
  83963. __e(o.label) +
  83964. '\n </label>\n ';
  83965. } ;
  83966. __p += '\n <div class="input-group">\n <div class="input-group-prepend">\n <input name="' +
  83967. __e(o.name) +
  83968. '" type="' +
  83969. __e(o.type) +
  83970. '"\n ';
  83971. if (o.value) { ;
  83972. __p += ' value="' +
  83973. __e(o.value) +
  83974. '" ';
  83975. } ;
  83976. __p += '\n ';
  83977. if (o.required) { ;
  83978. __p += ' class="required" ';
  83979. } ;
  83980. __p += ' />\n <div class="input-group-text col" title="' +
  83981. __e(o.domain) +
  83982. '">' +
  83983. __e(o.domain) +
  83984. '</div>\n </div>\n </div>\n</div>\n';
  83985. return __p
  83986. };
  83987. /***/ }),
  83988. /***/ "./src/templates/group_header.html":
  83989. /*!*****************************************!*\
  83990. !*** ./src/templates/group_header.html ***!
  83991. \*****************************************/
  83992. /*! no static exports found */
  83993. /***/ (function(module, exports, __webpack_require__) {
  83994. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  83995. module.exports = function(o) {
  83996. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  83997. function print() { __p += __j.call(arguments, '') }
  83998. __p += '<!-- src/templates/group_header.html -->\n<a href="#" class="list-toggle group-toggle controlbox-padded" title="' +
  83999. __e(o.desc_group_toggle) +
  84000. '">\n <span class="fa ';
  84001. if (o.toggle_state === o._converse.OPENED) { ;
  84002. __p += ' fa-caret-down ';
  84003. } else { ;
  84004. __p += ' fa-caret-right ';
  84005. } ;
  84006. __p += '">\n </span> ' +
  84007. __e(o.label_group) +
  84008. '</a>\n<ul class="items-list roster-group-contacts ';
  84009. if (o.toggle_state === o._converse.CLOSED) { ;
  84010. __p += ' collapsed ';
  84011. } ;
  84012. __p += '"></ul>\n';
  84013. return __p
  84014. };
  84015. /***/ }),
  84016. /***/ "./src/templates/help_message.html":
  84017. /*!*****************************************!*\
  84018. !*** ./src/templates/help_message.html ***!
  84019. \*****************************************/
  84020. /*! no static exports found */
  84021. /***/ (function(module, exports, __webpack_require__) {
  84022. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84023. module.exports = function(o) {
  84024. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84025. function print() { __p += __j.call(arguments, '') }
  84026. __p += '<!-- src/templates/help_message.html -->\n<div class="message chat-info ';
  84027. if (o.type !== 'info') { ;
  84028. __p += ' chat-' +
  84029. __e(o.type) +
  84030. ' ';
  84031. } ;
  84032. __p += '" data-isodate="' +
  84033. __e(o.isodate) +
  84034. '">' +
  84035. ((__t = (o.message)) == null ? '' : __t) +
  84036. '</div>\n';
  84037. return __p
  84038. };
  84039. /***/ }),
  84040. /***/ "./src/templates/image.html":
  84041. /*!**********************************!*\
  84042. !*** ./src/templates/image.html ***!
  84043. \**********************************/
  84044. /*! no static exports found */
  84045. /***/ (function(module, exports, __webpack_require__) {
  84046. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84047. module.exports = function(o) {
  84048. var __t, __p = '', __e = _.escape;
  84049. __p += '<!-- src/templates/image.html -->\n<a href="' +
  84050. __e(o.url) +
  84051. '" target="_blank" rel="noopener"><img class="chat-image img-thumbnail" src="' +
  84052. __e(o.url) +
  84053. '"/></a>\n';
  84054. return __p
  84055. };
  84056. /***/ }),
  84057. /***/ "./src/templates/info.html":
  84058. /*!*********************************!*\
  84059. !*** ./src/templates/info.html ***!
  84060. \*********************************/
  84061. /*! no static exports found */
  84062. /***/ (function(module, exports, __webpack_require__) {
  84063. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84064. module.exports = function(o) {
  84065. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84066. function print() { __p += __j.call(arguments, '') }
  84067. __p += '<!-- src/templates/info.html -->\n';
  84068. if (o.render_message) { ;
  84069. __p += '\n <!-- XXX: Should only ever be rendered if the message text has been sanitized already -->\n <div class="message chat-info ' +
  84070. __e(o.extra_classes) +
  84071. '"\n data-isodate="' +
  84072. __e(o.isodate) +
  84073. '" ';
  84074. if (o.data_name) { ;
  84075. __p += ' data-' +
  84076. __e(o.data_name) +
  84077. '="' +
  84078. __e(o.data_value) +
  84079. '"';
  84080. } ;
  84081. __p += '>' +
  84082. ((__t = (o.message)) == null ? '' : __t) +
  84083. '</div>\n';
  84084. } else { ;
  84085. __p += '\n <div class="message chat-info ' +
  84086. __e(o.extra_classes) +
  84087. '"\n data-isodate="' +
  84088. __e(o.isodate) +
  84089. '" ';
  84090. if (o.data_name) { ;
  84091. __p += ' data-' +
  84092. __e(o.data_name) +
  84093. '="' +
  84094. __e(o.data_value) +
  84095. '"';
  84096. } ;
  84097. __p += '>' +
  84098. __e(o.message) +
  84099. '</div>\n';
  84100. } ;
  84101. __p += '\n';
  84102. return __p
  84103. };
  84104. /***/ }),
  84105. /***/ "./src/templates/inverse_brand_heading.html":
  84106. /*!**************************************************!*\
  84107. !*** ./src/templates/inverse_brand_heading.html ***!
  84108. \**************************************************/
  84109. /*! no static exports found */
  84110. /***/ (function(module, exports, __webpack_require__) {
  84111. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84112. module.exports = function(o) {
  84113. var __t, __p = '', __e = _.escape;
  84114. __p += '<!-- src/templates/inverse_brand_heading.html -->\n<div class="row">\n <div class="container brand-heading-container">\n <h1 class="brand-heading"><i class="icon-conversejs"></i>Converse</h1>\n <p class="brand-subtitle">' +
  84115. __e(o.version_name) +
  84116. '</p>\n <p class="brand-subtitle"><a target="_blank" rel="nofollow" href="https://conversejs.org">Open Source</a> XMPP chat client brought to you by <a target="_blank" rel="nofollow" href="https://opkode.com">Opkode</a> </p>\n <p class="brand-subtitle"><a target="_blank" rel="nofollow" href="https://hosted.weblate.org/projects/conversejs/#languages">Translate</a> it into your own language</p>\n </div>\n</div>\n';
  84117. return __p
  84118. };
  84119. /***/ }),
  84120. /***/ "./src/templates/list_chatrooms_modal.html":
  84121. /*!*************************************************!*\
  84122. !*** ./src/templates/list_chatrooms_modal.html ***!
  84123. \*************************************************/
  84124. /*! no static exports found */
  84125. /***/ (function(module, exports, __webpack_require__) {
  84126. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84127. module.exports = function(o) {
  84128. var __t, __p = '', __e = _.escape;
  84129. __p += '<!-- src/templates/list_chatrooms_modal.html -->\n<div class="modal fade" id="list-chatrooms-modal" tabindex="-1" role="dialog" aria-labelledby="list-chatrooms-modal-label" aria-hidden="true">\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title"\n id="list-chatrooms-modal-label">' +
  84130. __e(o.heading_list_chatrooms) +
  84131. '</h5>\n <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n <span aria-hidden="true">×</span>\n </button>\n </div>\n <div class="modal-body">\n <form class="converse-form list-chatrooms">\n <div class="form-group">\n <label for="chatroom">' +
  84132. __e(o.label_server_address) +
  84133. ':</label>\n <input type="text" value="' +
  84134. __e(o.muc_domain) +
  84135. '" required="required" name="server" class="form-control" placeholder="' +
  84136. __e(o.server_placeholder) +
  84137. '"/>\n </div>\n <input type="submit" class="btn btn-primary" name="join" value="' +
  84138. __e(o.label_query) +
  84139. '"/>\n </form>\n <ul class="available-chatrooms list-group"></ul>\n </div>\n </div>\n </div>\n</div>\n';
  84140. return __p
  84141. };
  84142. /***/ }),
  84143. /***/ "./src/templates/login_panel.html":
  84144. /*!****************************************!*\
  84145. !*** ./src/templates/login_panel.html ***!
  84146. \****************************************/
  84147. /*! no static exports found */
  84148. /***/ (function(module, exports, __webpack_require__) {
  84149. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84150. module.exports = function(o) {
  84151. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84152. function print() { __p += __j.call(arguments, '') }
  84153. __p += '<!-- src/templates/login_panel.html -->\n<div id="converse-login-panel" class="controlbox-pane fade-in row no-gutters">\n <form id="converse-login" class="converse-form" method="post">\n <div class="conn-feedback fade-in ';
  84154. if (!o.conn_feedback_subject) { ;
  84155. __p += ' hidden ';
  84156. } ;
  84157. __p += ' ' +
  84158. __e(o.conn_feedback_class) +
  84159. '">\n <p class="feedback-subject">' +
  84160. __e( o.conn_feedback_subject ) +
  84161. '</p>\n <p class="feedback-message ';
  84162. if (!o.conn_feedback_message) { ;
  84163. __p += ' hidden ';
  84164. } ;
  84165. __p += '">' +
  84166. __e(o.conn_feedback_message) +
  84167. '</p>\n </div>\n ';
  84168. if (o.auto_login || o._converse.CONNECTION_STATUS[o.connection_status] === 'CONNECTING') { ;
  84169. __p += '\n <span class="spinner fa fa-spinner centered"/>\n ';
  84170. } else { ;
  84171. __p += '\n ';
  84172. if (o.authentication == o.LOGIN || o.authentication == o.EXTERNAL) { ;
  84173. __p += '\n <div class="form-group">\n <label for="converse-login-jid">' +
  84174. __e(o.__("XMPP Username:")) +
  84175. '</label>\n <input id="converse-login-jid" class="form-control" autofocus required="required" type="text" name="jid" placeholder="' +
  84176. __e(o.placeholder_username) +
  84177. '"/>\n </div>\n ';
  84178. if (o.authentication !== o.EXTERNAL) { ;
  84179. __p += '\n <div class="form-group">\n <label for="converse-login-password">' +
  84180. __e(o.__("Password:")) +
  84181. '</label>\n <input id="converse-login-password" class="form-control" required="required" type="password" name="password" placeholder="' +
  84182. __e(o.__('password')) +
  84183. '"/>\n </div>\n ';
  84184. } ;
  84185. __p += '\n ';
  84186. if (o.show_trust_checkbox) { ;
  84187. __p += '\n <div class="form-group form-check login-trusted">\n <input id="converse-login-trusted" type="checkbox" class="form-check-input" name="trusted" ';
  84188. if (o._converse.config.get('trusted')) { ;
  84189. __p += ' checked="checked" ';
  84190. } ;
  84191. __p += '/>\n <label for="converse-login-trusted" class="form-check-label login-trusted__desc">' +
  84192. __e(o.__('This is a trusted device')) +
  84193. '</label>\n <i class="fa fa-info-circle" data-toggle="popover"\n data-title="Trusted device?"\n data-content="' +
  84194. __e(o.__('To improve performance, we cache your data in this browser. Uncheck this box if this is a public computer or if you want your data to be deleted when you log out. It\'s important that you explicitly log out, otherwise not all cached data might be deleted. Please note, when using an untrusted device, OMEMO encryption is NOT available.')) +
  84195. '"></i>\n </div>\n ';
  84196. } ;
  84197. __p += '\n\n <fieldset class="buttons">\n <input class="btn btn-primary" type="submit" value="' +
  84198. __e(o.__('Log in')) +
  84199. '"/>\n </fieldset>\n ';
  84200. } ;
  84201. __p += '\n ';
  84202. if (o.authentication == o.ANONYMOUS) { ;
  84203. __p += '\n <input class="btn btn-primary login-anon" type="submit" value="' +
  84204. __e(o.__('Click here to log in anonymously')) +
  84205. '"/>\n ';
  84206. } ;
  84207. __p += '\n ';
  84208. if (o.authentication == o.PREBIND) { ;
  84209. __p += '\n <p>Disconnected.</p>\n ';
  84210. } ;
  84211. __p += '\n ';
  84212. } ;
  84213. __p += '\n </form>\n</div>\n';
  84214. return __p
  84215. };
  84216. /***/ }),
  84217. /***/ "./src/templates/message.html":
  84218. /*!************************************!*\
  84219. !*** ./src/templates/message.html ***!
  84220. \************************************/
  84221. /*! no static exports found */
  84222. /***/ (function(module, exports, __webpack_require__) {
  84223. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84224. module.exports = function(o) {
  84225. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84226. function print() { __p += __j.call(arguments, '') }
  84227. __p += '<!-- src/templates/message.html -->\n<div class="message chat-msg ' +
  84228. __e(o.type) +
  84229. ' ';
  84230. if (o.is_me_message) { ;
  84231. __p += ' chat-msg--action ';
  84232. } ;
  84233. __p += ' ' +
  84234. __e(o.extra_classes) +
  84235. '"\n data-isodate="' +
  84236. __e(o.time) +
  84237. '" data-msgid="' +
  84238. __e(o.msgid) +
  84239. '" data-from="' +
  84240. __e(o.from) +
  84241. '" data-encrypted="' +
  84242. __e(o.is_encrypted) +
  84243. '">\n ';
  84244. if (o.type !== 'headline' && !o.is_me_message) { ;
  84245. __p += '\n <canvas class="avatar chat-msg__avatar" height="36" width="36"></canvas>\n ';
  84246. } ;
  84247. __p += '\n <div class="chat-msg__content ';
  84248. if (o.is_me_message) { ;
  84249. __p += 'chat-msg__content--action';
  84250. } ;
  84251. __p += '">\n <span class="chat-msg__heading">\n ';
  84252. if (o.is_me_message) { ;
  84253. __p += '<time timestamp="' +
  84254. __e(o.isodate) +
  84255. '" class="chat-msg__time">' +
  84256. __e(o.pretty_time) +
  84257. '</time>';
  84258. } ;
  84259. __p += '\n <span class="chat-msg__author chat-msg__' +
  84260. __e(o.sender) +
  84261. '">';
  84262. if (o.is_me_message) { ;
  84263. __p += '**';
  84264. }; ;
  84265. __p +=
  84266. __e(o.username) +
  84267. '</span>\n ';
  84268. if (!o.is_me_message) { ;
  84269. __p += '\n ';
  84270. o.roles.forEach(function (role) { ;
  84271. __p += ' <span class="badge badge-secondary">' +
  84272. __e(role) +
  84273. '</span> ';
  84274. }); ;
  84275. __p += '\n <time timestamp="' +
  84276. __e(o.isodate) +
  84277. '" class="chat-msg__time">' +
  84278. __e(o.pretty_time) +
  84279. '</time>\n ';
  84280. } ;
  84281. __p += '\n ';
  84282. if (o.is_encrypted) { ;
  84283. __p += '<span class="fa fa-lock"></span>';
  84284. } ;
  84285. __p += '\n </span>\n ';
  84286. if (!o.is_me_message) { ;
  84287. __p += '<div class="chat-msg__body">';
  84288. } ;
  84289. __p += '\n ';
  84290. if (o.received) { ;
  84291. __p += ' <span class="fa fa-check chat-msg__receipt"></span> ';
  84292. } ;
  84293. __p += '\n ';
  84294. if (o.edited) { ;
  84295. __p += ' <i title="' +
  84296. __e(o.__('This message has been edited')) +
  84297. '" class="fa fa-edit chat-msg__edit-modal"></i> ';
  84298. } ;
  84299. __p += '\n ';
  84300. if (!o.is_me_message) { ;
  84301. __p += '<div class="chat-msg__message">';
  84302. } ;
  84303. __p += '\n ';
  84304. if (o.is_spoiler) { ;
  84305. __p += '\n <div class="chat-msg__spoiler-hint">\n <span class="spoiler-hint">' +
  84306. __e(o.spoiler_hint) +
  84307. '</span>\n <a class="badge badge-info spoiler-toggle" data-toggle-state="closed" href="#"><i class="fa fa-eye"></i>' +
  84308. __e(o.label_show) +
  84309. '</a>\n </div>\n ';
  84310. } ;
  84311. __p += '\n <div class="chat-msg__text';
  84312. if (o.is_spoiler) { ;
  84313. __p += ' spoiler collapsed';
  84314. } ;
  84315. __p += '"><!-- message gets added here via renderMessage --></div>\n <div class="chat-msg__media"></div>\n ';
  84316. if (!o.is_me_message) { ;
  84317. __p += '</div>';
  84318. } ;
  84319. __p += '\n ';
  84320. if (o.type !== 'headline' && !o.is_me_message && o.sender === 'me') { ;
  84321. __p += '\n <div class="chat-msg__actions">\n <button class="chat-msg__action chat-msg__action-edit fa fa-pencil-alt" title="' +
  84322. __e(o.__('Edit this message')) +
  84323. '"></button>\n </div>\n ';
  84324. } ;
  84325. __p += '\n\n ';
  84326. if (!o.is_me_message) { ;
  84327. __p += '</div>';
  84328. } ;
  84329. __p += '\n </div>\n</div>\n';
  84330. return __p
  84331. };
  84332. /***/ }),
  84333. /***/ "./src/templates/message_versions_modal.html":
  84334. /*!***************************************************!*\
  84335. !*** ./src/templates/message_versions_modal.html ***!
  84336. \***************************************************/
  84337. /*! no static exports found */
  84338. /***/ (function(module, exports, __webpack_require__) {
  84339. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84340. module.exports = function(o) {
  84341. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84342. function print() { __p += __j.call(arguments, '') }
  84343. __p += '<!-- src/templates/message_versions_modal.html -->\n<div class="modal fade" id="message-versions-modal" tabindex="-1" role="dialog" aria-labelledby="message-versions-modal-label" aria-hidden="true">\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h4 class="modal-title" id="message-versions-modal-label">' +
  84344. __e(o.__('Message versions')) +
  84345. '</h4>\n <button type="button" class="close" data-dismiss="modal" aria-label="' +
  84346. __e(o.label_close) +
  84347. '"><span aria-hidden="true">×</span></button>\n </div>\n <div class="modal-body">\n <h4>Older versions</h4>\n ';
  84348. o.older_versions.forEach(function (text) { ;
  84349. __p += ' <p class="older-msg">' +
  84350. __e(text) +
  84351. '</p> ';
  84352. }); ;
  84353. __p += '\n <hr/>\n <h4>Current version</h4>\n <p>' +
  84354. __e(o.message) +
  84355. '</p>\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-secondary" data-dismiss="modal">' +
  84356. __e(o.__('Close')) +
  84357. '</button>\n </div>\n </div>\n </div>\n</div>\n';
  84358. return __p
  84359. };
  84360. /***/ }),
  84361. /***/ "./src/templates/new_day.html":
  84362. /*!************************************!*\
  84363. !*** ./src/templates/new_day.html ***!
  84364. \************************************/
  84365. /*! no static exports found */
  84366. /***/ (function(module, exports, __webpack_require__) {
  84367. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84368. module.exports = function(o) {
  84369. var __t, __p = '', __e = _.escape;
  84370. __p += '<!-- src/templates/new_day.html -->\n<div class="message date-separator" data-isodate="' +
  84371. __e(o.isodate) +
  84372. '">\n <hr class="separator"/>\n <time class="separator-text" datetime="' +
  84373. __e(o.isodate) +
  84374. '"><span>' +
  84375. __e(o.datestring) +
  84376. '</span></time>\n</div>\n';
  84377. return __p
  84378. };
  84379. /***/ }),
  84380. /***/ "./src/templates/occupant.html":
  84381. /*!*************************************!*\
  84382. !*** ./src/templates/occupant.html ***!
  84383. \*************************************/
  84384. /*! no static exports found */
  84385. /***/ (function(module, exports, __webpack_require__) {
  84386. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84387. module.exports = function(o) {
  84388. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84389. function print() { __p += __j.call(arguments, '') }
  84390. __p += '<!-- src/templates/occupant.html -->\n<li class="occupant" id="' +
  84391. __e( o.id ) +
  84392. '"\n ';
  84393. if (o.role === "moderator") { ;
  84394. __p += '\n title="' +
  84395. __e( o.jid ) +
  84396. ' ' +
  84397. __e( o.desc_moderator ) +
  84398. ' ' +
  84399. __e( o.hint_occupant ) +
  84400. '"\n ';
  84401. } ;
  84402. __p += '\n ';
  84403. if (o.role === "participant") { ;
  84404. __p += '\n title="' +
  84405. __e( o.jid ) +
  84406. ' ' +
  84407. __e( o.desc_participant ) +
  84408. ' ' +
  84409. __e( o.hint_occupant ) +
  84410. '"\n ';
  84411. } ;
  84412. __p += '\n ';
  84413. if (o.role === "visitor") { ;
  84414. __p += '\n title="' +
  84415. __e( o.jid ) +
  84416. ' ' +
  84417. __e( o.desc_visitor ) +
  84418. ' ' +
  84419. __e( o.hint_occupant ) +
  84420. '"\n ';
  84421. } ;
  84422. __p += '\n ';
  84423. if (!o._.includes(["visitor", "participant", "moderator"], o.role)) { ;
  84424. __p += '\n title="' +
  84425. __e( o.jid ) +
  84426. ' ' +
  84427. __e( o.hint_occupant ) +
  84428. '"\n ';
  84429. } ;
  84430. __p += '>\n <div class="row no-gutters">\n <div class="col-auto">\n <div class="occupant-status occupant-' +
  84431. __e(o.show) +
  84432. ' circle" title="' +
  84433. __e(o.hint_show) +
  84434. '"></div>\n </div>\n <div class="col occupant-nick-badge">\n <span class="occupant-nick">' +
  84435. __e(o.nick || o.jid) +
  84436. '</span>\n <span class="occupant-badges">\n ';
  84437. if (o.affiliation === "owner") { ;
  84438. __p += '\n <span class="badge badge-groupchat">' +
  84439. __e(o.label_owner) +
  84440. '</span>\n ';
  84441. } ;
  84442. __p += '\n ';
  84443. if (o.affiliation === "admin") { ;
  84444. __p += '\n <span class="badge badge-info">' +
  84445. __e(o.label_admin) +
  84446. '</span>\n ';
  84447. } ;
  84448. __p += '\n ';
  84449. if (o.affiliation === "member") { ;
  84450. __p += '\n <span class="badge badge-info">' +
  84451. __e(o.label_member) +
  84452. '</span>\n ';
  84453. } ;
  84454. __p += '\n\n ';
  84455. if (o.role === "moderator") { ;
  84456. __p += '\n <span class="badge badge-info">' +
  84457. __e(o.label_moderator) +
  84458. '</span>\n ';
  84459. } ;
  84460. __p += '\n ';
  84461. if (o.role === "visitor") { ;
  84462. __p += '\n <span class="badge badge-secondary">' +
  84463. __e(o.label_visitor) +
  84464. '</span>\n ';
  84465. } ;
  84466. __p += '\n </span>\n </div>\n </div>\n</li>\n';
  84467. return __p
  84468. };
  84469. /***/ }),
  84470. /***/ "./src/templates/pending_contact.html":
  84471. /*!********************************************!*\
  84472. !*** ./src/templates/pending_contact.html ***!
  84473. \********************************************/
  84474. /*! no static exports found */
  84475. /***/ (function(module, exports, __webpack_require__) {
  84476. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84477. module.exports = function(o) {
  84478. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84479. function print() { __p += __j.call(arguments, '') }
  84480. __p += '<!-- src/templates/pending_contact.html -->\n';
  84481. if (o.allow_chat_pending_contacts) { ;
  84482. __p += '\n<a class="list-item-link open-chat w-100" href="#">\n';
  84483. } ;
  84484. __p += '\n<span class="pending-contact-name" title="JID: ' +
  84485. __e(o.jid) +
  84486. '">' +
  84487. __e(o.display_name) +
  84488. '</span> \n';
  84489. if (o.allow_chat_pending_contacts) { ;
  84490. __p += '</a>';
  84491. } ;
  84492. __p += '\n<a class="list-item-action remove-xmpp-contact far fa-trash-alt" title="' +
  84493. __e(o.desc_remove) +
  84494. '" href="#"></a>\n';
  84495. return __p
  84496. };
  84497. /***/ }),
  84498. /***/ "./src/templates/profile_modal.html":
  84499. /*!******************************************!*\
  84500. !*** ./src/templates/profile_modal.html ***!
  84501. \******************************************/
  84502. /*! no static exports found */
  84503. /***/ (function(module, exports, __webpack_require__) {
  84504. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84505. module.exports = function(o) {
  84506. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84507. function print() { __p += __j.call(arguments, '') }
  84508. __p += '<!-- src/templates/profile_modal.html -->\n<div class="modal fade" id="user-profile-modal" tabindex="-1" role="dialog" aria-labelledby="user-profile-modal-label" aria-hidden="true">\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="user-profile-modal-label">' +
  84509. __e(o.heading_profile) +
  84510. '</h5>\n <button type="button" class="close" data-dismiss="modal" aria-label="' +
  84511. __e(o.label_close) +
  84512. '"><span aria-hidden="true">×</span></button>\n </div>\n <div class="modal-body">\n ';
  84513. if (o._converse.pluggable.plugins['converse-omemo'].enabled(o._converse)) { ;
  84514. __p += '\n <ul class="nav nav-pills justify-content-center">\n <li role="presentation" class="nav-item">\n <a class="nav-link active" id="profile-tab" href="#profile-tabpanel" aria-controls="profile-tabpanel" role="tab" data-toggle="tab">Profile</a>\n </li>\n <li role="presentation" class="nav-item">\n <a class="nav-link" id="omemo-tab" href="#omemo-tabpanel" aria-controls="omemo-tabpanel" role="tab" data-toggle="tab">OMEMO</a>\n </li>\n </ul>\n ';
  84515. } ;
  84516. __p += '\n <div class="tab-content">\n <div class="tab-pane fade show active" id="profile-tabpanel" role="tabpanel" aria-labelledby="profile-tab">\n <form class="converse-form converse-form--modal profile-form" action="#">\n <div class="row">\n <div class="col-auto">\n <a class="change-avatar" href="#">\n ';
  84517. if (o.image) { ;
  84518. __p += '\n <img alt="' +
  84519. __e(o.alt_avatar) +
  84520. '" class="img-thumbnail avatar align-self-center" height="100px" width="100px" src="data:' +
  84521. __e(o.image_type) +
  84522. ';base64,' +
  84523. __e(o.image) +
  84524. '"/>\n ';
  84525. } ;
  84526. __p += '\n ';
  84527. if (!o.image) { ;
  84528. __p += '\n <canvas class="avatar" height="100px" width="100px"></canvas>\n ';
  84529. } ;
  84530. __p += '\n </a>\n <input class="hidden" name="image" type="file"/>\n </div>\n <div class="col">\n <div class="form-group">\n <label class="col-form-label">' +
  84531. __e(o.label_jid) +
  84532. ':</label>\n <div>' +
  84533. __e(o.jid) +
  84534. '</div>\n </div>\n </div>\n </div>\n <div class="form-group">\n <label for="vcard-fullname" class="col-form-label">' +
  84535. __e(o.label_fullname) +
  84536. ':</label>\n <input id="vcard-fullname" type="text" class="form-control" name="fn" value="' +
  84537. __e(o.fullname) +
  84538. '"/>\n </div>\n <div class="form-group">\n <label for="vcard-nickname" class="col-form-label">' +
  84539. __e(o.label_nickname) +
  84540. ':</label>\n <input id="vcard-nickname" type="text" class="form-control" name="nickname" value="' +
  84541. __e(o.nickname) +
  84542. '"/>\n </div>\n <div class="form-group">\n <label for="vcard-url" class="col-form-label">' +
  84543. __e(o.label_url) +
  84544. ':</label>\n <input id="vcard-url" type="url" class="form-control" name="url" value="' +
  84545. __e(o.url) +
  84546. '"/>\n </div>\n <div class="form-group">\n <label for="vcard-email" class="col-form-label">' +
  84547. __e(o.label_email) +
  84548. ':</label>\n <input id="vcard-email" type="email" class="form-control" name="email" value="' +
  84549. __e(o.email) +
  84550. '"/>\n </div>\n <div class="form-group">\n <label for="vcard-role" class="col-form-label">' +
  84551. __e(o.label_role) +
  84552. ':</label>\n <input id="vcard-role" type="text" class="form-control" name="role" value="' +
  84553. __e(o.role) +
  84554. '" aria-describedby="vcard-role-help"/>\n <small id="vcard-role-help" class="form-text text-muted">' +
  84555. __e(o.label_role_help) +
  84556. '</small>\n </div>\n <hr/>\n <div class="form-group">\n <button type="submit" class="save-form btn btn-primary">' +
  84557. __e(o.__('Save and close')) +
  84558. '</button>\n </div>\n </form>\n </div>\n ';
  84559. if (o._converse.pluggable.plugins['converse-omemo'].enabled(o._converse)) { ;
  84560. __p += '\n <div class="tab-pane fade" id="omemo-tabpanel" role="tabpanel" aria-labelledby="omemo-tab">\n <form class="converse-form fingerprint-removal">\n <ul class="list-group fingerprints">\n <li class="list-group-item active">' +
  84561. __e(o.__("This device's OMEMO fingerprint")) +
  84562. '</li>\n <li class="list-group-item">\n ';
  84563. if (o.view.current_device && o.view.current_device.get('bundle') && o.view.current_device.get('bundle').fingerprint) { ;
  84564. __p += '\n <span class="fingerprint">' +
  84565. __e(o.utils.formatFingerprint(o.view.current_device.get('bundle').fingerprint)) +
  84566. '</span>\n ';
  84567. } else {;
  84568. __p += '\n <span class="spinner fa fa-spinner centered"/>\n ';
  84569. } ;
  84570. __p += '\n </li>\n </ul>\n <div class="form-group">\n <button type="button" class="generate-bundle btn btn-danger">' +
  84571. __e(o.__('Generate new keys and fingerprint')) +
  84572. '</button>\n </div>\n\n ';
  84573. if (o.view.other_devices.length) { ;
  84574. __p += '\n <ul class="list-group fingerprints">\n <li class="list-group-item nopadding active">\n <label>\n <input type="checkbox" class="select-all" title="' +
  84575. __e(o.__('Select all')) +
  84576. '"\n aria-label="' +
  84577. __e(o.__('Checkbox to select fingerprints of all other OMEMO devices')) +
  84578. '"/>\n ' +
  84579. __e(o.__('Other OMEMO-enabled devices')) +
  84580. '\n </label>\n </li>\n ';
  84581. o._.forEach(o.view.other_devices, function (device) { ;
  84582. __p += '\n ';
  84583. if (device.get('bundle') && device.get('bundle').fingerprint) { ;
  84584. __p += '\n <li class="fingerprint-removal-item list-group-item nopadding">\n <label>\n <input type="checkbox" value="' +
  84585. __e(device.get('id')) +
  84586. '"\n aria-label="' +
  84587. __e(o.__('Checkbox for selecting the following fingerprint')) +
  84588. '"/>\n <span class="fingerprint">' +
  84589. __e(o.utils.formatFingerprint(device.get('bundle').fingerprint)) +
  84590. '</span>\n </label>\n </li>\n ';
  84591. } else {;
  84592. __p += '\n <li class="fingerprint-removal-item list-group-item nopadding">\n <label>\n <input type="checkbox" value="' +
  84593. __e(device.get('id')) +
  84594. '"\n aria-label="' +
  84595. __e(o.__('Checkbox for selecting the following fingerprint')) +
  84596. '"/>\n <span>' +
  84597. __e(o.__('Device without a fingerprint')) +
  84598. '</span>\n </label>\n </li>\n ';
  84599. } ;
  84600. __p += '\n ';
  84601. }); ;
  84602. __p += '\n </ul>\n <div class="form-group">\n <button type="submit" class="save-form btn btn-primary">' +
  84603. __e(o.__('Remove checked devices and close')) +
  84604. '</button>\n </div>\n ';
  84605. } ;
  84606. __p += '\n </form>\n </div>\n ';
  84607. } ;
  84608. __p += '\n </div>\n </div>\n </div>\n </div>\n</div>\n';
  84609. return __p
  84610. };
  84611. /***/ }),
  84612. /***/ "./src/templates/profile_view.html":
  84613. /*!*****************************************!*\
  84614. !*** ./src/templates/profile_view.html ***!
  84615. \*****************************************/
  84616. /*! no static exports found */
  84617. /***/ (function(module, exports, __webpack_require__) {
  84618. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84619. module.exports = function(o) {
  84620. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84621. function print() { __p += __j.call(arguments, '') }
  84622. __p += '<!-- src/templates/profile_view.html -->\n<div class="userinfo controlbox-padded">\n<div class="controlbox-section profile d-flex">\n <a class="show-profile" href="#">\n <canvas class="avatar align-self-center" height="40" width="40"></canvas>\n </a>\n <span class="username w-100 align-self-center">' +
  84623. __e(o.fullname) +
  84624. '</span>\n <a class="controlbox-heading__btn show-client-info fa fa-info-circle align-self-center" title="' +
  84625. __e(o.info_details) +
  84626. '"></a>\n ';
  84627. if (o._converse.allow_logout) { ;
  84628. __p += '\n <a class="controlbox-heading__btn logout fa fa-sign-out-alt align-self-center" title="' +
  84629. __e(o.title_log_out) +
  84630. '"></a>\n ';
  84631. } ;
  84632. __p += '\n</div>\n<div class="d-flex xmpp-status">\n <span class="' +
  84633. __e(o.chat_status) +
  84634. ' w-100 align-self-center" data-value="' +
  84635. __e(o.chat_status) +
  84636. '">\n <span class="\n ';
  84637. if (o.chat_status === 'online') { ;
  84638. __p += ' fa fa-circle chat-status chat-status--online';
  84639. } ;
  84640. __p += '\n ';
  84641. if (o.chat_status === 'dnd') { ;
  84642. __p += ' fa fa-minus-circle chat-status chat-status--busy ';
  84643. } ;
  84644. __p += '\n ';
  84645. if (o.chat_status === 'away') { ;
  84646. __p += ' fa fa-circle chat-status chat-status--away';
  84647. } ;
  84648. __p += '\n ';
  84649. if (o.chat_status === 'xa') { ;
  84650. __p += ' far fa-circle chat-status chat-status--xa ';
  84651. } ;
  84652. __p += '\n ';
  84653. if (o.chat_status === 'offline') { ;
  84654. __p += ' fa fa-circle chat-status chat-status--offline';
  84655. } ;
  84656. __p += '"></span> ' +
  84657. __e(o.status_message) +
  84658. '</span>\n <a class="controlbox-heading__btn change-status fa fa-pencil-alt" title="' +
  84659. __e(o.title_change_status) +
  84660. '" data-toggle="modal" data-target="#changeStatusModal"></a>\n</div>\n</div>\n';
  84661. return __p
  84662. };
  84663. /***/ }),
  84664. /***/ "./src/templates/register_link.html":
  84665. /*!******************************************!*\
  84666. !*** ./src/templates/register_link.html ***!
  84667. \******************************************/
  84668. /*! no static exports found */
  84669. /***/ (function(module, exports, __webpack_require__) {
  84670. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84671. module.exports = function(o) {
  84672. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84673. function print() { __p += __j.call(arguments, '') }
  84674. __p += '<!-- src/templates/register_link.html -->\n<fieldset class="switch-form">\n ';
  84675. if (!o._converse.auto_login && o._converse.CONNECTION_STATUS[o.connection_status] !== 'CONNECTING') { ;
  84676. __p += '\n <p>' +
  84677. __e( o.__("Don't have a chat account?") ) +
  84678. '</p>\n <p><a class="register-account toggle-register-login" href="#converse/register">' +
  84679. __e(o.__("Create an account")) +
  84680. '</a></p>\n ';
  84681. } ;
  84682. __p += '\n</fieldset>\n';
  84683. return __p
  84684. };
  84685. /***/ }),
  84686. /***/ "./src/templates/register_panel.html":
  84687. /*!*******************************************!*\
  84688. !*** ./src/templates/register_panel.html ***!
  84689. \*******************************************/
  84690. /*! no static exports found */
  84691. /***/ (function(module, exports, __webpack_require__) {
  84692. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84693. module.exports = function(o) {
  84694. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84695. function print() { __p += __j.call(arguments, '') }
  84696. __p += '<!-- src/templates/register_panel.html -->\n<div class="row">\n <form id="converse-register" class="converse-form">\n <legend class="col-form-label">' +
  84697. __e(o.__("Create your account")) +
  84698. '</legend>\n\n <div class="form-group">\n <label>' +
  84699. __e(o.__("Please enter the XMPP provider to register with:")) +
  84700. '</label>\n <div class="form-errors hidden"></div>\n\n ';
  84701. if (o.default_domain) { ;
  84702. __p += '\n ' +
  84703. __e(o.default_domain) +
  84704. '\n </div>\n ';
  84705. } else { ;
  84706. __p += '\n <input class="form-control" autofocus="autofocus" required="required" type="text" name="domain" placeholder="' +
  84707. __e(o.domain_placeholder) +
  84708. '"/>\n <p class="form-text text-muted">' +
  84709. __e(o.help_providers) +
  84710. ' <a href="' +
  84711. __e(o.href_providers) +
  84712. '" class="url" target="_blank" rel="noopener">' +
  84713. __e(o.help_providers_link) +
  84714. '</a>.</p>\n </div>\n <fieldset class="buttons">\n <input class="btn btn-primary" type="submit" value="' +
  84715. __e(o.label_register) +
  84716. '"/>\n <div class="switch-form">\n <p>' +
  84717. __e( o.__("Already have a chat account?") ) +
  84718. '</p>\n <p><a class="login-here toggle-register-login" href="#converse/login">' +
  84719. __e(o.__("Log in here")) +
  84720. '</a></p>\n </div>\n </fieldset>\n ';
  84721. } ;
  84722. __p += '\n <!--</div>-->\n </form>\n</div>\n';
  84723. return __p
  84724. };
  84725. /***/ }),
  84726. /***/ "./src/templates/registration_form.html":
  84727. /*!**********************************************!*\
  84728. !*** ./src/templates/registration_form.html ***!
  84729. \**********************************************/
  84730. /*! no static exports found */
  84731. /***/ (function(module, exports, __webpack_require__) {
  84732. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84733. module.exports = function(o) {
  84734. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84735. function print() { __p += __j.call(arguments, '') }
  84736. __p += '<!-- src/templates/registration_form.html -->\n<legend class="col-form-label">' +
  84737. __e(o.__("Account Registration:")) +
  84738. ' ' +
  84739. __e(o.domain) +
  84740. '</legend>\n<p class="title">' +
  84741. __e(o.title) +
  84742. '</p>\n<p class="form-help instructions">' +
  84743. __e(o.instructions) +
  84744. '</p>\n<div class="form-errors hidden"></div>\n\n<fieldset class="buttons">\n <input type="submit" class="btn btn-primary" value="' +
  84745. __e(o.__('Register')) +
  84746. '"/>\n ';
  84747. if (!o.registration_domain) { ;
  84748. __p += '\n <input type="button" class="btn btn-secondary button-cancel" value="' +
  84749. __e(o.__('Choose a different provider')) +
  84750. '"/>\n ';
  84751. } ;
  84752. __p += '\n <div class="switch-form">\n <p>' +
  84753. __e( o.__("Already have a chat account?") ) +
  84754. '</p>\n <p><a class="login-here toggle-register-login" href="#converse/login">' +
  84755. __e(o.__("Log in here")) +
  84756. '</a></p>\n </div>\n</fieldset>\n';
  84757. return __p
  84758. };
  84759. /***/ }),
  84760. /***/ "./src/templates/registration_request.html":
  84761. /*!*************************************************!*\
  84762. !*** ./src/templates/registration_request.html ***!
  84763. \*************************************************/
  84764. /*! no static exports found */
  84765. /***/ (function(module, exports, __webpack_require__) {
  84766. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84767. module.exports = function(o) {
  84768. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84769. function print() { __p += __j.call(arguments, '') }
  84770. __p += '<!-- src/templates/registration_request.html -->\n<span class="spinner login-submit fa fa-spinner"></span>\n<p class="info">' +
  84771. __e(o.__("Hold tight, we're fetching the registration form…")) +
  84772. '</p>\n';
  84773. if (o.cancel) { ;
  84774. __p += '\n <button class="btn btn-secondary button-cancel hor_centered">' +
  84775. __e(o.__('Cancel')) +
  84776. '</button>\n';
  84777. } ;
  84778. __p += '\n';
  84779. return __p
  84780. };
  84781. /***/ }),
  84782. /***/ "./src/templates/requesting_contact.html":
  84783. /*!***********************************************!*\
  84784. !*** ./src/templates/requesting_contact.html ***!
  84785. \***********************************************/
  84786. /*! no static exports found */
  84787. /***/ (function(module, exports, __webpack_require__) {
  84788. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84789. module.exports = function(o) {
  84790. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84791. function print() { __p += __j.call(arguments, '') }
  84792. __p += '<!-- src/templates/requesting_contact.html -->\n';
  84793. if (o.allow_chat_pending_contacts) { ;
  84794. __p += '\n<a class="open-chat w-100"href="#">\n';
  84795. } ;
  84796. __p += '\n<span class="req-contact-name w-100" title="JID: ' +
  84797. __e(o.jid) +
  84798. '">' +
  84799. __e(o.display_name) +
  84800. '</span>\n';
  84801. if (o.allow_chat_pending_contacts) { ;
  84802. __p += '\n</a>\n';
  84803. } ;
  84804. __p += '\n<a class="accept-xmpp-request list-item-action list-item-action--visible fa fa-check"\n aria-label="' +
  84805. __e(o.desc_accept) +
  84806. '" title="' +
  84807. __e(o.desc_accept) +
  84808. '" href="#"></a>\n<a class="decline-xmpp-request list-item-action list-item-action--visible fa fa-times"\n aria-label="' +
  84809. __e(o.desc_decline) +
  84810. '" title="' +
  84811. __e(o.desc_decline) +
  84812. '" href="#"></a>\n';
  84813. return __p
  84814. };
  84815. /***/ }),
  84816. /***/ "./src/templates/room_description.html":
  84817. /*!*********************************************!*\
  84818. !*** ./src/templates/room_description.html ***!
  84819. \*********************************************/
  84820. /*! no static exports found */
  84821. /***/ (function(module, exports, __webpack_require__) {
  84822. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84823. module.exports = function(o) {
  84824. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84825. function print() { __p += __j.call(arguments, '') }
  84826. __p += '<!-- src/templates/room_description.html -->\n<!-- FIXME: check markup in mockup -->\n<div class="room-info">\n<p class="room-info"><strong>' +
  84827. __e(o.label_jid) +
  84828. '</strong> ' +
  84829. __e(o.jid) +
  84830. '</p>\n<p class="room-info"><strong>' +
  84831. __e(o.label_desc) +
  84832. '</strong> ' +
  84833. __e(o.desc) +
  84834. '</p>\n<p class="room-info"><strong>' +
  84835. __e(o.label_occ) +
  84836. '</strong> ' +
  84837. __e(o.occ) +
  84838. '</p>\n<p class="room-info"><strong>' +
  84839. __e(o.label_features) +
  84840. '</strong>\n <ul>\n ';
  84841. if (o.passwordprotected) { ;
  84842. __p += '\n <li class="room-info locked">' +
  84843. __e(o.label_requires_auth) +
  84844. '</li>\n ';
  84845. } ;
  84846. __p += '\n ';
  84847. if (o.hidden) { ;
  84848. __p += '\n <li class="room-info">' +
  84849. __e(o.label_hidden) +
  84850. '</li>\n ';
  84851. } ;
  84852. __p += '\n ';
  84853. if (o.membersonly) { ;
  84854. __p += '\n <li class="room-info">' +
  84855. __e(o.label_requires_invite) +
  84856. '</li>\n ';
  84857. } ;
  84858. __p += '\n ';
  84859. if (o.moderated) { ;
  84860. __p += '\n <li class="room-info">' +
  84861. __e(o.label_moderated) +
  84862. '</li>\n ';
  84863. } ;
  84864. __p += '\n ';
  84865. if (o.nonanonymous) { ;
  84866. __p += '\n <li class="room-info">' +
  84867. __e(o.label_non_anon) +
  84868. '</li>\n ';
  84869. } ;
  84870. __p += '\n ';
  84871. if (o.open) { ;
  84872. __p += '\n <li class="room-info">' +
  84873. __e(o.label_open_room) +
  84874. '</li>\n ';
  84875. } ;
  84876. __p += '\n ';
  84877. if (o.persistent) { ;
  84878. __p += '\n <li class="room-info">' +
  84879. __e(o.label_permanent_room) +
  84880. '</li>\n ';
  84881. } ;
  84882. __p += '\n ';
  84883. if (o.publicroom) { ;
  84884. __p += '\n <li class="room-info">' +
  84885. __e(o.label_public) +
  84886. '</li>\n ';
  84887. } ;
  84888. __p += '\n ';
  84889. if (o.semianonymous) { ;
  84890. __p += '\n <li class="room-info">' +
  84891. __e(o.label_semi_anon) +
  84892. '</li>\n ';
  84893. } ;
  84894. __p += '\n ';
  84895. if (o.temporary) { ;
  84896. __p += '\n <li class="room-info">' +
  84897. __e(o.label_temp_room) +
  84898. '</li>\n ';
  84899. } ;
  84900. __p += '\n ';
  84901. if (o.unmoderated) { ;
  84902. __p += '\n <li class="room-info">' +
  84903. __e(o.label_unmoderated) +
  84904. '</li>\n ';
  84905. } ;
  84906. __p += '\n </ul>\n</p>\n</div>\n';
  84907. return __p
  84908. };
  84909. /***/ }),
  84910. /***/ "./src/templates/room_item.html":
  84911. /*!**************************************!*\
  84912. !*** ./src/templates/room_item.html ***!
  84913. \**************************************/
  84914. /*! no static exports found */
  84915. /***/ (function(module, exports, __webpack_require__) {
  84916. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84917. module.exports = function(o) {
  84918. var __t, __p = '', __e = _.escape;
  84919. __p += '<!-- src/templates/room_item.html -->\n<li class="room-item list-group-item">\n <div class="available-chatroom d-flex flex-row">\n <a class="open-room available-room w-100"\n data-room-jid="' +
  84920. __e(o.jid) +
  84921. '"\n data-room-name="' +
  84922. __e(o.name) +
  84923. '"\n title="' +
  84924. __e(o.open_title) +
  84925. '"\n href="#">' +
  84926. __e(o.name) +
  84927. '</a>\n <a class="right room-info icon-room-info"\n data-room-jid="' +
  84928. __e(o.jid) +
  84929. '"\n title="' +
  84930. __e(o.info_title) +
  84931. '" href="#"></a>\n </div>\n</li>\n';
  84932. return __p
  84933. };
  84934. /***/ }),
  84935. /***/ "./src/templates/room_panel.html":
  84936. /*!***************************************!*\
  84937. !*** ./src/templates/room_panel.html ***!
  84938. \***************************************/
  84939. /*! no static exports found */
  84940. /***/ (function(module, exports, __webpack_require__) {
  84941. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84942. module.exports = function(o) {
  84943. var __t, __p = '', __e = _.escape;
  84944. __p += '<!-- src/templates/room_panel.html -->\n<!-- <div id="chatrooms"> -->\n<div class="d-flex controlbox-padded">\n <span class="w-100 controlbox-heading controlbox-heading--groupchats">' +
  84945. __e(o.heading_chatrooms) +
  84946. '</span>\n <a class="controlbox-heading__btn show-list-muc-modal fa fa-list-ul" title="' +
  84947. __e(o.title_list_rooms) +
  84948. '" data-toggle="modal" data-target="#list-chatrooms-modal"></a>\n <a class="controlbox-heading__btn show-add-muc-modal fa fa-plus" title="' +
  84949. __e(o.title_new_room) +
  84950. '" data-toggle="modal" data-target="#add-chatrooms-modal"></a>\n</div>\n<div class="list-container open-rooms-list rooms-list-container"></div>\n<div class="list-container bookmarks-list rooms-list-container"></div>\n<!-- </div> -->\n';
  84951. return __p
  84952. };
  84953. /***/ }),
  84954. /***/ "./src/templates/rooms_list.html":
  84955. /*!***************************************!*\
  84956. !*** ./src/templates/rooms_list.html ***!
  84957. \***************************************/
  84958. /*! no static exports found */
  84959. /***/ (function(module, exports, __webpack_require__) {
  84960. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84961. module.exports = function(o) {
  84962. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84963. function print() { __p += __j.call(arguments, '') }
  84964. __p += '<!-- src/templates/rooms_list.html -->\n<a href="#" class="list-toggle open-rooms-toggle controlbox-padded" title="' +
  84965. __e(o.desc_rooms) +
  84966. '">\n <span class="fa ';
  84967. if (o.toggle_state === o._converse.OPENED) { ;
  84968. __p += ' fa-caret-down ';
  84969. } else { ;
  84970. __p += ' fa-caret-right ';
  84971. } ;
  84972. __p += '">\n </span> ' +
  84973. __e(o.label_rooms) +
  84974. '</a>\n<div class="items-list rooms-list open-rooms-list"></div>\n';
  84975. return __p
  84976. };
  84977. /***/ }),
  84978. /***/ "./src/templates/rooms_list_item.html":
  84979. /*!********************************************!*\
  84980. !*** ./src/templates/rooms_list_item.html ***!
  84981. \********************************************/
  84982. /*! no static exports found */
  84983. /***/ (function(module, exports, __webpack_require__) {
  84984. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  84985. module.exports = function(o) {
  84986. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  84987. function print() { __p += __j.call(arguments, '') }
  84988. __p += '<!-- src/templates/rooms_list_item.html -->\n<div class="list-item controlbox-padded available-chatroom d-flex flex-row\n ';
  84989. if (o.currently_open) { ;
  84990. __p += ' open ';
  84991. } ;
  84992. __p += '\n ';
  84993. if (o.num_unread_general) { ;
  84994. __p += ' unread-msgs ';
  84995. } ;
  84996. __p += '"\n data-room-jid="' +
  84997. __e(o.jid) +
  84998. '">\n\n';
  84999. if (o.num_unread) { ;
  85000. __p += '\n <span class="list-item-badge badge badge-room-color msgs-indicator">' +
  85001. __e( o.num_unread ) +
  85002. '</span>\n';
  85003. } ;
  85004. __p += '\n<a class="list-item-link open-room available-room w-100"\n data-room-jid="' +
  85005. __e(o.jid) +
  85006. '"\n title="' +
  85007. __e(o.open_title) +
  85008. '" href="#">' +
  85009. __e(o.name || o.jid) +
  85010. '</a>\n\n';
  85011. if (o.allow_bookmarks) { ;
  85012. __p += '\n<a class="list-item-action fa ';
  85013. if (o.bookmarked) { ;
  85014. __p += ' fa-bookmark remove-bookmark button-on ';
  85015. } else { ;
  85016. __p += ' add-bookmark fa-bookmark ';
  85017. } ;
  85018. __p += '"\n data-room-jid="' +
  85019. __e(o.jid) +
  85020. '" data-bookmark-name="' +
  85021. __e(o.name) +
  85022. '"\n title="';
  85023. if (o.bookmarked) { ;
  85024. __p += ' ' +
  85025. __e(o.info_remove_bookmark) +
  85026. ' ';
  85027. } else { ;
  85028. __p += ' ' +
  85029. __e(o.info_add_bookmark) +
  85030. ' ';
  85031. } ;
  85032. __p += '"\n href="#"></a>\n';
  85033. } ;
  85034. __p += '\n\n<a class="list-item-action room-info fa fa-info-circle" data-room-jid="' +
  85035. __e(o.jid) +
  85036. '"\n title="' +
  85037. __e(o.info_title) +
  85038. '" href="#"></a>\n\n<a class="list-item-action fa fa-sign-out-alt close-room"\n data-room-jid="' +
  85039. __e(o.jid) +
  85040. '"\n data-room-name="' +
  85041. __e(o.name || o.jid) +
  85042. '"\n title="' +
  85043. __e(o.info_leave_room) +
  85044. '" href="#"></a>\n\n</div>\n';
  85045. return __p
  85046. };
  85047. /***/ }),
  85048. /***/ "./src/templates/rooms_results.html":
  85049. /*!******************************************!*\
  85050. !*** ./src/templates/rooms_results.html ***!
  85051. \******************************************/
  85052. /*! no static exports found */
  85053. /***/ (function(module, exports, __webpack_require__) {
  85054. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85055. module.exports = function(o) {
  85056. var __t, __p = '', __e = _.escape;
  85057. __p += '<!-- src/templates/rooms_results.html -->\n<li class="list-group-item active">' +
  85058. __e( o.feedback_text ) +
  85059. '</li>\n';
  85060. return __p
  85061. };
  85062. /***/ }),
  85063. /***/ "./src/templates/roster.html":
  85064. /*!***********************************!*\
  85065. !*** ./src/templates/roster.html ***!
  85066. \***********************************/
  85067. /*! no static exports found */
  85068. /***/ (function(module, exports, __webpack_require__) {
  85069. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85070. module.exports = function(o) {
  85071. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  85072. function print() { __p += __j.call(arguments, '') }
  85073. __p += '<!-- src/templates/roster.html -->\n<div class="d-flex controlbox-padded">\n <span class="w-100 controlbox-heading controlbox-heading--contacts">' +
  85074. __e(o.heading_contacts) +
  85075. '</span>\n <a class="controlbox-heading__btn sync-contacts fa fa-sync" title="' +
  85076. __e(o.title_sync_contacts) +
  85077. '"></a>\n ';
  85078. if (o.allow_contact_requests) { ;
  85079. __p += '\n <a class="controlbox-heading__btn add-contact fa fa-user-plus"\n title="' +
  85080. __e(o.title_add_contact) +
  85081. '"\n data-toggle="modal"\n data-target="#add-contact-modal"></a>\n ';
  85082. } ;
  85083. __p += '\n</div>\n\n<form class="roster-filter-form"></form>\n\n<div class="list-container roster-contacts"></div>\n';
  85084. return __p
  85085. };
  85086. /***/ }),
  85087. /***/ "./src/templates/roster_filter.html":
  85088. /*!******************************************!*\
  85089. !*** ./src/templates/roster_filter.html ***!
  85090. \******************************************/
  85091. /*! no static exports found */
  85092. /***/ (function(module, exports, __webpack_require__) {
  85093. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85094. module.exports = function(o) {
  85095. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  85096. function print() { __p += __j.call(arguments, '') }
  85097. __p += '<!-- src/templates/roster_filter.html -->\n<form class="controlbox-padded roster-filter-form input-button-group ';
  85098. if (!o.visible) { ;
  85099. __p += ' hidden ';
  85100. } ;
  85101. __p += '">\n <div class="form-inline flex-nowrap">\n <div class="btn-group">\n <input ';
  85102. if (o.filter_text) { ;
  85103. __p += ' value="' +
  85104. __e(o.filter_text) +
  85105. '" ';
  85106. } ;
  85107. __p += '\n class="roster-filter form-control ';
  85108. if (o.filter_type === 'state') { ;
  85109. __p += ' hidden ';
  85110. } ;
  85111. __p += '"\n placeholder="' +
  85112. __e(o.placeholder) +
  85113. '"/>\n <span class="clear-input fa fa-times ';
  85114. if (!o.filter_text || o.filter_type === 'state') { ;
  85115. __p += ' hidden ';
  85116. } ;
  85117. __p += '"></span>\n </div>\n\n <select class="form-control state-type ';
  85118. if (o.filter_type !== 'state') { ;
  85119. __p += ' hidden ';
  85120. } ;
  85121. __p += '">\n <option value="">' +
  85122. __e(o.label_any) +
  85123. '</option>\n <option ';
  85124. if (o.chat_state === 'unread_messages') { ;
  85125. __p += ' selected="selected" ';
  85126. } ;
  85127. __p += '\n value="unread_messages">' +
  85128. __e(o.label_unread_messages) +
  85129. '</option>\n <option ';
  85130. if (o.chat_state === 'online') { ;
  85131. __p += ' selected="selected" ';
  85132. } ;
  85133. __p += '\n value="online">' +
  85134. __e(o.label_online) +
  85135. '</option>\n <option ';
  85136. if (o.chat_state === 'chat') { ;
  85137. __p += ' selected="selected" ';
  85138. } ;
  85139. __p += '\n value="chat">' +
  85140. __e(o.label_chatty) +
  85141. '</option>\n <option ';
  85142. if (o.chat_state === 'dnd') { ;
  85143. __p += ' selected="selected" ';
  85144. } ;
  85145. __p += '\n value="dnd">' +
  85146. __e(o.label_busy) +
  85147. '</option>\n <option ';
  85148. if (o.chat_state === 'away') { ;
  85149. __p += ' selected="selected" ';
  85150. } ;
  85151. __p += '\n value="away">' +
  85152. __e(o.label_away) +
  85153. '</option>\n <option ';
  85154. if (o.chat_state === 'xa') { ;
  85155. __p += ' selected="selected" ';
  85156. } ;
  85157. __p += '\n value="xa">' +
  85158. __e(o.label_xa) +
  85159. '</option>\n <option ';
  85160. if (o.chat_state === 'offline') { ;
  85161. __p += ' selected="selected" ';
  85162. } ;
  85163. __p += '\n value="offline">' +
  85164. __e(o.label_offline) +
  85165. '</option>\n </select>\n\n <div class="filter-by d-flex flex-nowrap">\n <span class="fa fa-user ';
  85166. if (o.filter_type === 'contacts') { ;
  85167. __p += ' selected ';
  85168. } ;
  85169. __p += '" data-type="contacts" title="' +
  85170. __e(o.title_contact_filter) +
  85171. '"></span>\n <span class="fa fa-users ';
  85172. if (o.filter_type === 'groups') { ;
  85173. __p += ' selected ';
  85174. } ;
  85175. __p += '" data-type="groups" title="' +
  85176. __e(o.title_group_filter) +
  85177. '"></span>\n <span class="fa fa-circle ';
  85178. if (o.filter_type === 'state') { ;
  85179. __p += ' selected ';
  85180. } ;
  85181. __p += '" data-type="state" title="' +
  85182. __e(o.title_status_filter) +
  85183. '"></span>\n </div>\n </div>\n</form>\n';
  85184. return __p
  85185. };
  85186. /***/ }),
  85187. /***/ "./src/templates/roster_item.html":
  85188. /*!****************************************!*\
  85189. !*** ./src/templates/roster_item.html ***!
  85190. \****************************************/
  85191. /*! no static exports found */
  85192. /***/ (function(module, exports, __webpack_require__) {
  85193. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85194. module.exports = function(o) {
  85195. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  85196. function print() { __p += __j.call(arguments, '') }
  85197. __p += '<!-- src/templates/roster_item.html -->\n<a class="list-item-link cbox-list-item open-chat w-100 ';
  85198. if (o.num_unread) { ;
  85199. __p += ' unread-msgs ';
  85200. } ;
  85201. __p += '"\n title="' +
  85202. __e(o.desc_chat) +
  85203. '" href="#">\n <span class="' +
  85204. __e(o.status_icon) +
  85205. '" title="' +
  85206. __e(o.desc_status) +
  85207. '"></span>\n ';
  85208. if (o.num_unread) { ;
  85209. __p += '\n <span class="msgs-indicator">' +
  85210. __e( o.num_unread ) +
  85211. '</span>\n ';
  85212. } ;
  85213. __p += '\n <span class="contact-name ';
  85214. if (o.num_unread) { ;
  85215. __p += ' unread-msgs ';
  85216. } ;
  85217. __p += '">' +
  85218. __e(o.display_name) +
  85219. '</span></a>\n';
  85220. if (o.allow_contact_removal) { ;
  85221. __p += '\n<a class="list-item-action remove-xmpp-contact far fa-trash-alt" title="' +
  85222. __e(o.desc_remove) +
  85223. '" href="#"></a>\n';
  85224. } ;
  85225. __p += '\n';
  85226. return __p
  85227. };
  85228. /***/ }),
  85229. /***/ "./src/templates/search_contact.html":
  85230. /*!*******************************************!*\
  85231. !*** ./src/templates/search_contact.html ***!
  85232. \*******************************************/
  85233. /*! no static exports found */
  85234. /***/ (function(module, exports, __webpack_require__) {
  85235. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85236. module.exports = function(o) {
  85237. var __t, __p = '', __e = _.escape;
  85238. __p += '<!-- src/templates/search_contact.html -->\n<li>\n <form class="search-xmpp-contact">\n <input type="text"\n name="identifier"\n class="username"\n placeholder="' +
  85239. __e(o.label_contact_name) +
  85240. '"/>\n <button type="submit">' +
  85241. __e(o.label_search) +
  85242. '</button>\n </form>\n</li>\n';
  85243. return __p
  85244. };
  85245. /***/ }),
  85246. /***/ "./src/templates/select_option.html":
  85247. /*!******************************************!*\
  85248. !*** ./src/templates/select_option.html ***!
  85249. \******************************************/
  85250. /*! no static exports found */
  85251. /***/ (function(module, exports, __webpack_require__) {
  85252. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85253. module.exports = function(o) {
  85254. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  85255. function print() { __p += __j.call(arguments, '') }
  85256. __p += '<!-- src/templates/select_option.html -->\n<option value="' +
  85257. __e(o.value) +
  85258. '" ';
  85259. if (o.selected) { ;
  85260. __p += ' selected="selected" ';
  85261. } ;
  85262. __p += ' >' +
  85263. __e(o.label) +
  85264. '</option>\n';
  85265. return __p
  85266. };
  85267. /***/ }),
  85268. /***/ "./src/templates/spinner.html":
  85269. /*!************************************!*\
  85270. !*** ./src/templates/spinner.html ***!
  85271. \************************************/
  85272. /*! no static exports found */
  85273. /***/ (function(module, exports, __webpack_require__) {
  85274. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85275. module.exports = function(o) {
  85276. var __t, __p = '';
  85277. __p += '<!-- src/templates/spinner.html -->\n<span class="spinner fa fa-spinner centered"/>\n';
  85278. return __p
  85279. };
  85280. /***/ }),
  85281. /***/ "./src/templates/spoiler_button.html":
  85282. /*!*******************************************!*\
  85283. !*** ./src/templates/spoiler_button.html ***!
  85284. \*******************************************/
  85285. /*! no static exports found */
  85286. /***/ (function(module, exports, __webpack_require__) {
  85287. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85288. module.exports = function(o) {
  85289. var __t, __p = '', __j = Array.prototype.join;
  85290. function print() { __p += __j.call(arguments, '') }
  85291. __p += '<!-- src/templates/spoiler_button.html -->\n<li class="toggle-compose-spoiler fa ';
  85292. if (o.composing_spoiler) { ;
  85293. __p += ' fa-eye-slash ';
  85294. } ;
  85295. __p += ' ';
  85296. if (!o.composing_spoiler) { ;
  85297. __p += ' fa-eye ';
  85298. } ;
  85299. __p += '"\n title="' +
  85300. ((__t = ( o.label_toggle_spoiler )) == null ? '' : __t) +
  85301. '">\n</li>\n';
  85302. return __p
  85303. };
  85304. /***/ }),
  85305. /***/ "./src/templates/status_message.html":
  85306. /*!*******************************************!*\
  85307. !*** ./src/templates/status_message.html ***!
  85308. \*******************************************/
  85309. /*! no static exports found */
  85310. /***/ (function(module, exports, __webpack_require__) {
  85311. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85312. module.exports = function(o) {
  85313. var __t, __p = '', __e = _.escape;
  85314. __p += '<!-- src/templates/status_message.html -->\n<div class="message chat-info chat-status"\n data-isodate="' +
  85315. __e(o.isodate) +
  85316. '"\n data-status="' +
  85317. __e(o.from) +
  85318. '">' +
  85319. __e(o.message) +
  85320. '</div>\n';
  85321. return __p
  85322. };
  85323. /***/ }),
  85324. /***/ "./src/templates/status_option.html":
  85325. /*!******************************************!*\
  85326. !*** ./src/templates/status_option.html ***!
  85327. \******************************************/
  85328. /*! no static exports found */
  85329. /***/ (function(module, exports, __webpack_require__) {
  85330. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85331. module.exports = function(o) {
  85332. var __t, __p = '', __e = _.escape;
  85333. __p += '<!-- src/templates/status_option.html -->\n<li>\n <a href="#" class="' +
  85334. __e( o.value ) +
  85335. '" data-value="' +
  85336. __e( o.value ) +
  85337. '">\n <span class="icon-' +
  85338. __e( o.value ) +
  85339. '"></span>\n ' +
  85340. __e( o.text ) +
  85341. '\n </a>\n</li>\n';
  85342. return __p
  85343. };
  85344. /***/ }),
  85345. /***/ "./src/templates/toggle_chats.html":
  85346. /*!*****************************************!*\
  85347. !*** ./src/templates/toggle_chats.html ***!
  85348. \*****************************************/
  85349. /*! no static exports found */
  85350. /***/ (function(module, exports, __webpack_require__) {
  85351. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85352. module.exports = function(o) {
  85353. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  85354. function print() { __p += __j.call(arguments, '') }
  85355. __p += '<!-- src/templates/toggle_chats.html -->\n' +
  85356. __e(o.num_minimized) +
  85357. ' ' +
  85358. __e(o.Minimized) +
  85359. '\n<span class="unread-message-count ';
  85360. if (!o.num_unread) { ;
  85361. __p += ' unread-message-count-hidden ';
  85362. } ;
  85363. __p += '" href="#">' +
  85364. __e(o.num_unread) +
  85365. '</span>\n';
  85366. return __p
  85367. };
  85368. /***/ }),
  85369. /***/ "./src/templates/toolbar.html":
  85370. /*!************************************!*\
  85371. !*** ./src/templates/toolbar.html ***!
  85372. \************************************/
  85373. /*! no static exports found */
  85374. /***/ (function(module, exports, __webpack_require__) {
  85375. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85376. module.exports = function(o) {
  85377. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  85378. function print() { __p += __j.call(arguments, '') }
  85379. __p += '<!-- src/templates/toolbar.html -->\n';
  85380. if (o.use_emoji) { ;
  85381. __p += '\n<li class="toggle-toolbar-menu toggle-smiley dropup">\n <a class="toggle-smiley far fa-smile" title="' +
  85382. __e(o.tooltip_insert_smiley) +
  85383. '" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></a> \n <div class="emoji-picker dropdown-menu toolbar-menu"></div>\n</li>\n';
  85384. } ;
  85385. __p += '\n';
  85386. if (o.show_call_button) { ;
  85387. __p += '\n<li class="toggle-call fa fa-phone" title="' +
  85388. __e(o.label_start_call) +
  85389. '"></li>\n';
  85390. } ;
  85391. __p += '\n';
  85392. if (o.show_occupants_toggle) { ;
  85393. __p += '\n<li class="toggle-occupants fa ';
  85394. if (o.hidden_occupants) { ;
  85395. __p += ' fa-angle-double-left ';
  85396. } else { ;
  85397. __p += ' fa-angle-double-right ';
  85398. } ;
  85399. __p += '"\n title="' +
  85400. __e(o.label_hide_occupants) +
  85401. '"></li>\n';
  85402. } ;
  85403. __p += '\n';
  85404. return __p
  85405. };
  85406. /***/ }),
  85407. /***/ "./src/templates/toolbar_fileupload.html":
  85408. /*!***********************************************!*\
  85409. !*** ./src/templates/toolbar_fileupload.html ***!
  85410. \***********************************************/
  85411. /*! no static exports found */
  85412. /***/ (function(module, exports, __webpack_require__) {
  85413. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85414. module.exports = function(o) {
  85415. var __t, __p = '', __e = _.escape;
  85416. __p += '<!-- src/templates/toolbar_fileupload.html -->\n<li class="upload-file">\n <a class="fa fa-paperclip" title="' +
  85417. __e(o.tooltip_upload_file) +
  85418. '"></a>\n <input type="file" class="fileupload" multiple="" style="display:none"/>\n</li> \n';
  85419. return __p
  85420. };
  85421. /***/ }),
  85422. /***/ "./src/templates/toolbar_omemo.html":
  85423. /*!******************************************!*\
  85424. !*** ./src/templates/toolbar_omemo.html ***!
  85425. \******************************************/
  85426. /*! no static exports found */
  85427. /***/ (function(module, exports, __webpack_require__) {
  85428. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85429. module.exports = function(o) {
  85430. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  85431. function print() { __p += __j.call(arguments, '') }
  85432. __p += '<!-- src/templates/toolbar_omemo.html -->\n<li class="toggle-omemo fa \n ';
  85433. if (!o.omemo_supported) { ;
  85434. __p += ' disabled ';
  85435. } ;
  85436. __p += '\n ';
  85437. if (o.omemo_active) { ;
  85438. __p += ' fa-lock ';
  85439. } else { ;
  85440. __p += ' fa-unlock ';
  85441. } ;
  85442. __p += '"\n title="' +
  85443. __e(o.__('Messages are being sent in plaintext')) +
  85444. '"></li>\n';
  85445. return __p
  85446. };
  85447. /***/ }),
  85448. /***/ "./src/templates/trimmed_chat.html":
  85449. /*!*****************************************!*\
  85450. !*** ./src/templates/trimmed_chat.html ***!
  85451. \*****************************************/
  85452. /*! no static exports found */
  85453. /***/ (function(module, exports, __webpack_require__) {
  85454. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85455. module.exports = function(o) {
  85456. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  85457. function print() { __p += __j.call(arguments, '') }
  85458. __p += '<!-- src/templates/trimmed_chat.html -->\n<a href="#" class="restore-chat w-100 align-self-center" title="' +
  85459. __e(o.tooltip) +
  85460. '">\n ';
  85461. if (o.num_unread) { ;
  85462. __p += ' \n <span class="message-count badge badge-light">' +
  85463. __e(o.num_unread) +
  85464. '</span>\n ';
  85465. } ;
  85466. __p += '\n ' +
  85467. __e(o.title || o.jid ) +
  85468. '\n</a>\n<a class="chatbox-btn close-chatbox-button fa fa-times"></a>\n';
  85469. return __p
  85470. };
  85471. /***/ }),
  85472. /***/ "./src/templates/user_details_modal.html":
  85473. /*!***********************************************!*\
  85474. !*** ./src/templates/user_details_modal.html ***!
  85475. \***********************************************/
  85476. /*! no static exports found */
  85477. /***/ (function(module, exports, __webpack_require__) {
  85478. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85479. module.exports = function(o) {
  85480. var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
  85481. function print() { __p += __j.call(arguments, '') }
  85482. __p += '<!-- src/templates/user_details_modal.html -->\n<div class="modal fade" id="user-details-modal" tabindex="-1" role="dialog" aria-labelledby="user-details-modal-label" aria-hidden="true">\n <div class="modal-dialog" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title" id="user-details-modal-label">' +
  85483. __e(o.display_name) +
  85484. '</h5>\n <button type="button" class="close" data-dismiss="modal" aria-label="' +
  85485. __e(o.__('Close')) +
  85486. '"><span aria-hidden="true">×</span></button>\n </div>\n <div class="modal-body">\n ';
  85487. if (o.image) { ;
  85488. __p += '\n <img alt="' +
  85489. __e(o.__('The User\'s Profile Image')) +
  85490. '"\n class="img-thumbnail avatar align-self-center mb-3"\n height="100" width="100" src="data:' +
  85491. __e(o.image_type) +
  85492. ';base64,' +
  85493. __e(o.image) +
  85494. '"/>\n ';
  85495. } ;
  85496. __p += '\n ';
  85497. if (o.fullname) { ;
  85498. __p += '\n <p><label>' +
  85499. __e(o.__('Full Name:')) +
  85500. '</label> ' +
  85501. __e(o.fullname) +
  85502. '</p>\n ';
  85503. } ;
  85504. __p += '\n <p><label>' +
  85505. __e(o.__('XMPP Address:')) +
  85506. '</label> <a href="xmpp:' +
  85507. __e(o.jid) +
  85508. '">' +
  85509. __e(o.jid) +
  85510. '</a></p>\n ';
  85511. if (o.nickname) { ;
  85512. __p += '\n <p><label>' +
  85513. __e(o.__('Nickname:')) +
  85514. '</label> ' +
  85515. __e(o.nickname) +
  85516. '</p>\n ';
  85517. } ;
  85518. __p += '\n ';
  85519. if (o.url) { ;
  85520. __p += '\n <p><label>' +
  85521. __e(o.__('URL:')) +
  85522. '</label> <a target="_blank" rel="noopener" href="' +
  85523. __e(o.url) +
  85524. '">' +
  85525. __e(o.url) +
  85526. '</a></p>\n ';
  85527. } ;
  85528. __p += '\n ';
  85529. if (o.email) { ;
  85530. __p += '\n <p><label>' +
  85531. __e(o.__('Email:')) +
  85532. '</label> <a href="mailto:' +
  85533. __e(o.email) +
  85534. '">' +
  85535. __e(o.email) +
  85536. '</a></p>\n ';
  85537. } ;
  85538. __p += '\n ';
  85539. if (o.role) { ;
  85540. __p += '\n <p><label>' +
  85541. __e(o.__('Role:')) +
  85542. '</label> ' +
  85543. __e(o.role) +
  85544. '</p>\n ';
  85545. } ;
  85546. __p += '\n\n ';
  85547. if (o._converse.pluggable.plugins['converse-omemo'].enabled(o._converse)) { ;
  85548. __p += '\n <hr/>\n <ul class="list-group fingerprints">\n <li class="list-group-item active">' +
  85549. __e(o.__('OMEMO Fingerprints')) +
  85550. '</li>\n ';
  85551. if (!o.view.devicelist.devices) { ;
  85552. __p += '\n <li class="list-group-item"><span class="spinner fa fa-spinner centered"/></li>\n ';
  85553. } ;
  85554. __p += '\n ';
  85555. if (o.view.devicelist.devices) { ;
  85556. __p += '\n ';
  85557. o.view.devicelist.devices.each(function (device) { ;
  85558. __p += '\n ';
  85559. if (device.get('bundle') && device.get('bundle').fingerprint) { ;
  85560. __p += '\n <li class="list-group-item">\n <form class="fingerprint-trust">\n <div class="btn-group btn-group-toggle">\n <label class="btn btn--small ';
  85561. if (device.get('trusted') !== -1) { ;
  85562. __p += ' btn-primary active ';
  85563. } else { ;
  85564. __p += ' btn-secondary ';
  85565. } ;
  85566. __p += '">\n <input type="radio" name="' +
  85567. __e(device.get('id')) +
  85568. '" value="1"\n ';
  85569. if (device.get('trusted') !== -1) { ;
  85570. __p += ' checked="checked" ';
  85571. } ;
  85572. __p += '/>' +
  85573. __e(o.__('Trusted')) +
  85574. '\n </label>\n <label class="btn btn--small ';
  85575. if (device.get('trusted') === -1) { ;
  85576. __p += ' btn-primary active ';
  85577. } else { ;
  85578. __p += ' btn-secondary ';
  85579. } ;
  85580. __p += '">\n <input type="radio" name="' +
  85581. __e(device.get('id')) +
  85582. '" value="-1"\n ';
  85583. if (device.get('trusted') === -1) { ;
  85584. __p += ' checked="checked" ';
  85585. } ;
  85586. __p += '/>' +
  85587. __e(o.__('Untrusted')) +
  85588. '\n </label>\n </div>\n <span class="fingerprint">' +
  85589. __e(o.utils.formatFingerprint(device.get('bundle').fingerprint)) +
  85590. '</span>\n </form>\n </li>\n ';
  85591. } ;
  85592. __p += '\n ';
  85593. }); ;
  85594. __p += '\n ';
  85595. } ;
  85596. __p += '\n </ul>\n ';
  85597. } ;
  85598. __p += '\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-warning" data-dismiss="modal">' +
  85599. __e(o.__('Close')) +
  85600. '</button>\n <button type="button" class="btn btn-info refresh-contact"><i class="fa fa-refresh"> </i>' +
  85601. __e(o.__('Refresh')) +
  85602. '</button>\n ';
  85603. if (o.allow_contact_removal && o.is_roster_contact) { ;
  85604. __p += '\n <button type="button" class="btn btn-danger remove-contact"><i class="far fa-trash-alt"> </i>' +
  85605. __e(o.__('Remove as contact')) +
  85606. '</button>\n ';
  85607. } ;
  85608. __p += '\n </div>\n </div>\n </div>\n</div>\n';
  85609. return __p
  85610. };
  85611. /***/ }),
  85612. /***/ "./src/templates/video.html":
  85613. /*!**********************************!*\
  85614. !*** ./src/templates/video.html ***!
  85615. \**********************************/
  85616. /*! no static exports found */
  85617. /***/ (function(module, exports, __webpack_require__) {
  85618. var _ = {escape:__webpack_require__(/*! ./node_modules/lodash/escape.js */ "./node_modules/lodash/escape.js")};
  85619. module.exports = function(o) {
  85620. var __t, __p = '', __e = _.escape;
  85621. __p += '<!-- src/templates/video.html -->\n<video controls src="' +
  85622. __e(o.url) +
  85623. '" style="max-height: 50vh"></video>\n<a target="_blank" rel="noopener" href="' +
  85624. __e(o.url) +
  85625. '">' +
  85626. __e(o.label_download) +
  85627. '</a>\n';
  85628. return __p
  85629. };
  85630. /***/ }),
  85631. /***/ "./src/underscore-shim.js":
  85632. /*!********************************!*\
  85633. !*** ./src/underscore-shim.js ***!
  85634. \********************************/
  85635. /*! no static exports found */
  85636. /***/ (function(module, exports, __webpack_require__) {
  85637. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*global define */
  85638. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (_) {
  85639. return _.noConflict();
  85640. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  85641. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  85642. /***/ }),
  85643. /***/ "./src/utils/html.js":
  85644. /*!***************************!*\
  85645. !*** ./src/utils/html.js ***!
  85646. \***************************/
  85647. /*! exports provided: default */
  85648. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  85649. "use strict";
  85650. __webpack_require__.r(__webpack_exports__);
  85651. /* harmony import */ var urijs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! urijs */ "./node_modules/urijs/src/URI.js");
  85652. /* harmony import */ var urijs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(urijs__WEBPACK_IMPORTED_MODULE_0__);
  85653. /* harmony import */ var _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../headless/lodash.noconflict */ "./src/headless/lodash.noconflict.js");
  85654. /* harmony import */ var _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1__);
  85655. /* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! sizzle */ "./node_modules/sizzle/dist/sizzle.js");
  85656. /* harmony import */ var sizzle__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(sizzle__WEBPACK_IMPORTED_MODULE_2__);
  85657. /* harmony import */ var _templates_audio_html__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../templates/audio.html */ "./src/templates/audio.html");
  85658. /* harmony import */ var _templates_audio_html__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_templates_audio_html__WEBPACK_IMPORTED_MODULE_3__);
  85659. /* harmony import */ var _converse_headless_templates_field_html__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @converse/headless/templates/field.html */ "./src/headless/templates/field.html");
  85660. /* harmony import */ var _converse_headless_templates_field_html__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_converse_headless_templates_field_html__WEBPACK_IMPORTED_MODULE_4__);
  85661. /* harmony import */ var _templates_file_html__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../templates/file.html */ "./src/templates/file.html");
  85662. /* harmony import */ var _templates_file_html__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_templates_file_html__WEBPACK_IMPORTED_MODULE_5__);
  85663. /* harmony import */ var _templates_form_captcha_html__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../templates/form_captcha.html */ "./src/templates/form_captcha.html");
  85664. /* harmony import */ var _templates_form_captcha_html__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_templates_form_captcha_html__WEBPACK_IMPORTED_MODULE_6__);
  85665. /* harmony import */ var _templates_form_checkbox_html__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../templates/form_checkbox.html */ "./src/templates/form_checkbox.html");
  85666. /* harmony import */ var _templates_form_checkbox_html__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_templates_form_checkbox_html__WEBPACK_IMPORTED_MODULE_7__);
  85667. /* harmony import */ var _templates_form_input_html__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../templates/form_input.html */ "./src/templates/form_input.html");
  85668. /* harmony import */ var _templates_form_input_html__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_templates_form_input_html__WEBPACK_IMPORTED_MODULE_8__);
  85669. /* harmony import */ var _templates_form_select_html__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../templates/form_select.html */ "./src/templates/form_select.html");
  85670. /* harmony import */ var _templates_form_select_html__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_templates_form_select_html__WEBPACK_IMPORTED_MODULE_9__);
  85671. /* harmony import */ var _templates_form_textarea_html__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../templates/form_textarea.html */ "./src/templates/form_textarea.html");
  85672. /* harmony import */ var _templates_form_textarea_html__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_templates_form_textarea_html__WEBPACK_IMPORTED_MODULE_10__);
  85673. /* harmony import */ var _templates_form_url_html__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../templates/form_url.html */ "./src/templates/form_url.html");
  85674. /* harmony import */ var _templates_form_url_html__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_templates_form_url_html__WEBPACK_IMPORTED_MODULE_11__);
  85675. /* harmony import */ var _templates_form_username_html__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../templates/form_username.html */ "./src/templates/form_username.html");
  85676. /* harmony import */ var _templates_form_username_html__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_templates_form_username_html__WEBPACK_IMPORTED_MODULE_12__);
  85677. /* harmony import */ var _templates_image_html__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../templates/image.html */ "./src/templates/image.html");
  85678. /* harmony import */ var _templates_image_html__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_templates_image_html__WEBPACK_IMPORTED_MODULE_13__);
  85679. /* harmony import */ var _templates_select_option_html__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../templates/select_option.html */ "./src/templates/select_option.html");
  85680. /* harmony import */ var _templates_select_option_html__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_templates_select_option_html__WEBPACK_IMPORTED_MODULE_14__);
  85681. /* harmony import */ var _templates_video_html__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../templates/video.html */ "./src/templates/video.html");
  85682. /* harmony import */ var _templates_video_html__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_templates_video_html__WEBPACK_IMPORTED_MODULE_15__);
  85683. /* harmony import */ var _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../headless/utils/core */ "./src/headless/utils/core.js");
  85684. // Converse.js (A browser based XMPP chat client)
  85685. // http://conversejs.org
  85686. //
  85687. // This is a form utilities module.
  85688. //
  85689. // Copyright (c) 2013-2018, Jan-Carel Brand <jc@opkode.com>
  85690. // Licensed under the Mozilla Public License (MPLv2)
  85691. const URL_REGEX = /\b(https?:\/\/|www\.|https?:\/\/www\.)[^\s<>]{2,200}\b\/?/g;
  85692. const logger = _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.assign({
  85693. 'debug': _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get(console, 'log') ? console.log.bind(console) : _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.noop,
  85694. 'error': _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get(console, 'log') ? console.log.bind(console) : _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.noop,
  85695. 'info': _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get(console, 'log') ? console.log.bind(console) : _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.noop,
  85696. 'warn': _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get(console, 'log') ? console.log.bind(console) : _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.noop
  85697. }, console);
  85698. const XFORM_TYPE_MAP = {
  85699. 'text-private': 'password',
  85700. 'text-single': 'text',
  85701. 'fixed': 'label',
  85702. 'boolean': 'checkbox',
  85703. 'hidden': 'hidden',
  85704. 'jid-multi': 'textarea',
  85705. 'list-single': 'dropdown',
  85706. 'list-multi': 'dropdown'
  85707. };
  85708. function slideOutWrapup(el) {
  85709. /* Wrapup function for slideOut. */
  85710. el.removeAttribute('data-slider-marker');
  85711. el.classList.remove('collapsed');
  85712. el.style.overflow = "";
  85713. el.style.height = "";
  85714. }
  85715. const isImage = function isImage(url) {
  85716. return new Promise((resolve, reject) => {
  85717. var img = new Image();
  85718. var timer = window.setTimeout(function () {
  85719. reject(new Error("Could not determine whether it's an image"));
  85720. img = null;
  85721. }, 3000);
  85722. img.onerror = img.onabort = function () {
  85723. clearTimeout(timer);
  85724. reject(new Error("Could not determine whether it's an image"));
  85725. };
  85726. img.onload = function () {
  85727. clearTimeout(timer);
  85728. resolve(img);
  85729. };
  85730. img.src = url;
  85731. });
  85732. };
  85733. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].isAudioURL = function (url) {
  85734. if (!(url instanceof urijs__WEBPACK_IMPORTED_MODULE_0___default.a)) {
  85735. url = new urijs__WEBPACK_IMPORTED_MODULE_0___default.a(url);
  85736. }
  85737. const filename = url.filename().toLowerCase();
  85738. if (url.protocol().toLowerCase() !== "https") {
  85739. return false;
  85740. }
  85741. return filename.endsWith('.ogg') || filename.endsWith('.mp3') || filename.endsWith('.m4a');
  85742. };
  85743. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].isImageURL = function (url) {
  85744. if (!(url instanceof urijs__WEBPACK_IMPORTED_MODULE_0___default.a)) {
  85745. url = new urijs__WEBPACK_IMPORTED_MODULE_0___default.a(url);
  85746. }
  85747. const filename = url.filename().toLowerCase();
  85748. if (url.protocol().toLowerCase() !== "https") {
  85749. return false;
  85750. }
  85751. return filename.endsWith('.jpg') || filename.endsWith('.jpeg') || filename.endsWith('.png') || filename.endsWith('.gif') || filename.endsWith('.bmp') || filename.endsWith('.tiff') || filename.endsWith('.svg');
  85752. };
  85753. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].isVideoURL = function (url) {
  85754. if (!(url instanceof urijs__WEBPACK_IMPORTED_MODULE_0___default.a)) {
  85755. url = new urijs__WEBPACK_IMPORTED_MODULE_0___default.a(url);
  85756. }
  85757. const filename = url.filename().toLowerCase();
  85758. if (url.protocol().toLowerCase() !== "https") {
  85759. return false;
  85760. }
  85761. return filename.endsWith('.mp4') || filename.endsWith('.webm');
  85762. };
  85763. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].renderAudioURL = function (_converse, url) {
  85764. const uri = new urijs__WEBPACK_IMPORTED_MODULE_0___default.a(url);
  85765. if (_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].isAudioURL(uri)) {
  85766. const __ = _converse.__;
  85767. return _templates_audio_html__WEBPACK_IMPORTED_MODULE_3___default()({
  85768. 'url': url,
  85769. 'label_download': __('Download audio file "%1$s"', decodeURI(uri.filename()))
  85770. });
  85771. }
  85772. return url;
  85773. };
  85774. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].renderFileURL = function (_converse, url) {
  85775. const uri = new urijs__WEBPACK_IMPORTED_MODULE_0___default.a(url);
  85776. if (_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].isImageURL(uri) || _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].isVideoURL(uri) || _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].isAudioURL(uri)) {
  85777. return url;
  85778. }
  85779. const __ = _converse.__,
  85780. filename = uri.filename();
  85781. return _templates_file_html__WEBPACK_IMPORTED_MODULE_5___default()({
  85782. 'url': url,
  85783. 'label_download': __('Download file "%1$s"', decodeURI(filename))
  85784. });
  85785. };
  85786. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].renderImageURL = function (_converse, url) {
  85787. if (!_converse.show_images_inline) {
  85788. return _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].addHyperlinks(url);
  85789. }
  85790. const uri = new urijs__WEBPACK_IMPORTED_MODULE_0___default.a(url);
  85791. if (_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].isImageURL(uri)) {
  85792. const __ = _converse.__;
  85793. return _templates_image_html__WEBPACK_IMPORTED_MODULE_13___default()({
  85794. 'url': url,
  85795. 'label_download': __('Download image "%1$s"', decodeURI(uri.filename()))
  85796. });
  85797. }
  85798. return url;
  85799. };
  85800. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].renderImageURLs = function (_converse, el) {
  85801. /* Returns a Promise which resolves once all images have been loaded.
  85802. */
  85803. if (!_converse.show_images_inline) {
  85804. return Promise.resolve();
  85805. }
  85806. const __ = _converse.__;
  85807. const list = el.textContent.match(URL_REGEX) || [];
  85808. return Promise.all(_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.map(list, url => new Promise((resolve, reject) => {
  85809. if (_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].isImageURL(url)) {
  85810. return isImage(url).then(img => {
  85811. const i = new Image();
  85812. i.src = img.src;
  85813. i.addEventListener('load', resolve); // We also resolve for non-images, otherwise the
  85814. // Promise.all resolves prematurely.
  85815. i.addEventListener('error', resolve);
  85816. const __ = _converse.__;
  85817. _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.each(sizzle__WEBPACK_IMPORTED_MODULE_2___default()(`a[href="${url}"]`, el), a => {
  85818. a.outerHTML = _templates_image_html__WEBPACK_IMPORTED_MODULE_13___default()({
  85819. 'url': url,
  85820. 'label_download': __('Download')
  85821. });
  85822. });
  85823. }).catch(resolve);
  85824. } else {
  85825. return resolve();
  85826. }
  85827. })));
  85828. };
  85829. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].renderMovieURL = function (_converse, url) {
  85830. const uri = new urijs__WEBPACK_IMPORTED_MODULE_0___default.a(url);
  85831. if (_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].isVideoURL(uri)) {
  85832. const __ = _converse.__;
  85833. return _templates_video_html__WEBPACK_IMPORTED_MODULE_15___default()({
  85834. 'url': url,
  85835. 'label_download': __('Download video file "%1$s"', decodeURI(uri.filename()))
  85836. });
  85837. }
  85838. return url;
  85839. };
  85840. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].renderNewLines = function (text) {
  85841. return text.replace(/\n\n+/g, '<br/><br/>').replace(/\n/g, '<br/>');
  85842. };
  85843. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].calculateElementHeight = function (el) {
  85844. /* Return the height of the passed in DOM element,
  85845. * based on the heights of its children.
  85846. */
  85847. return _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.reduce(el.children, (result, child) => result + child.offsetHeight, 0);
  85848. };
  85849. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].getNextElement = function (el, selector = '*') {
  85850. let next_el = el.nextElementSibling;
  85851. while (!_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNull(next_el) && !sizzle__WEBPACK_IMPORTED_MODULE_2___default.a.matchesSelector(next_el, selector)) {
  85852. next_el = next_el.nextElementSibling;
  85853. }
  85854. return next_el;
  85855. };
  85856. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].getPreviousElement = function (el, selector = '*') {
  85857. let prev_el = el.previousSibling;
  85858. while (!_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNull(prev_el) && !sizzle__WEBPACK_IMPORTED_MODULE_2___default.a.matchesSelector(prev_el, selector)) {
  85859. prev_el = prev_el.previousSibling;
  85860. }
  85861. return prev_el;
  85862. };
  85863. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].getFirstChildElement = function (el, selector = '*') {
  85864. let first_el = el.firstElementChild;
  85865. while (!_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNull(first_el) && !sizzle__WEBPACK_IMPORTED_MODULE_2___default.a.matchesSelector(first_el, selector)) {
  85866. first_el = first_el.nextSibling;
  85867. }
  85868. return first_el;
  85869. };
  85870. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].getLastChildElement = function (el, selector = '*') {
  85871. let last_el = el.lastElementChild;
  85872. while (!_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNull(last_el) && !sizzle__WEBPACK_IMPORTED_MODULE_2___default.a.matchesSelector(last_el, selector)) {
  85873. last_el = last_el.previousSibling;
  85874. }
  85875. return last_el;
  85876. };
  85877. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].hasClass = function (className, el) {
  85878. return _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.includes(el.classList, className);
  85879. };
  85880. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].addClass = function (className, el) {
  85881. if (el instanceof Element) {
  85882. el.classList.add(className);
  85883. }
  85884. };
  85885. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].removeClass = function (className, el) {
  85886. if (el instanceof Element) {
  85887. el.classList.remove(className);
  85888. }
  85889. return el;
  85890. };
  85891. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].removeElement = function (el) {
  85892. if (!_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(el) && !_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(el.parentNode)) {
  85893. el.parentNode.removeChild(el);
  85894. }
  85895. };
  85896. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].showElement = _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.flow(_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.partial(_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].removeClass, 'collapsed'), _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.partial(_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].removeClass, 'hidden'));
  85897. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].hideElement = function (el) {
  85898. if (!_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(el)) {
  85899. el.classList.add('hidden');
  85900. }
  85901. return el;
  85902. };
  85903. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].ancestor = function (el, selector) {
  85904. let parent = el;
  85905. while (!_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(parent) && !sizzle__WEBPACK_IMPORTED_MODULE_2___default.a.matchesSelector(parent, selector)) {
  85906. parent = parent.parentElement;
  85907. }
  85908. return parent;
  85909. };
  85910. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].nextUntil = function (el, selector, include_self = false) {
  85911. /* Return the element's siblings until one matches the selector. */
  85912. const matches = [];
  85913. let sibling_el = el.nextElementSibling;
  85914. while (!_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(sibling_el) && !sibling_el.matches(selector)) {
  85915. matches.push(sibling_el);
  85916. sibling_el = sibling_el.nextElementSibling;
  85917. }
  85918. return matches;
  85919. };
  85920. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].unescapeHTML = function (string) {
  85921. /* Helper method that replace HTML-escaped symbols with equivalent characters
  85922. * (e.g. transform occurrences of '&amp;' to '&')
  85923. *
  85924. * Parameters:
  85925. * (String) string: a String containing the HTML-escaped symbols.
  85926. */
  85927. var div = document.createElement('div');
  85928. div.innerHTML = string;
  85929. return div.innerText;
  85930. };
  85931. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].escapeHTML = function (string) {
  85932. return string.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
  85933. };
  85934. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].addMentionsMarkup = function (text, references, chatbox) {
  85935. if (chatbox.get('message_type') !== 'groupchat') {
  85936. return text;
  85937. }
  85938. const nick = chatbox.get('nick');
  85939. references.sort((a, b) => b.begin - a.begin).forEach(ref => {
  85940. const mention = text.slice(ref.begin, ref.end);
  85941. chatbox;
  85942. if (mention === nick) {
  85943. text = text.slice(0, ref.begin) + `<span class="mention mention--self badge badge-info">${mention}</span>` + text.slice(ref.end);
  85944. } else {
  85945. text = text.slice(0, ref.begin) + `<span class="mention">${mention}</span>` + text.slice(ref.end);
  85946. }
  85947. });
  85948. return text;
  85949. };
  85950. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].addHyperlinks = function (text) {
  85951. return urijs__WEBPACK_IMPORTED_MODULE_0___default.a.withinString(text, url => {
  85952. const uri = new urijs__WEBPACK_IMPORTED_MODULE_0___default.a(url);
  85953. url = uri.normalize()._string;
  85954. const pretty_url = uri._parts.urn ? url : uri.readable();
  85955. if (!uri._parts.protocol && !url.startsWith('http://') && !url.startsWith('https://')) {
  85956. url = 'http://' + url;
  85957. }
  85958. if (uri._parts.protocol === 'xmpp' && uri._parts.query === 'join') {
  85959. return `<a target="_blank" rel="noopener" class="open-chatroom" href="${url}">${_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].escapeHTML(pretty_url)}</a>`;
  85960. }
  85961. return `<a target="_blank" rel="noopener" href="${url}">${_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].escapeHTML(pretty_url)}</a>`;
  85962. }, {
  85963. 'start': /\b(?:([a-z][a-z0-9.+-]*:\/\/)|xmpp:|mailto:|www\.)/gi
  85964. });
  85965. };
  85966. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].slideInAllElements = function (elements, duration = 300) {
  85967. return Promise.all(_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.map(elements, _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.partial(_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].slideIn, _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a, duration)));
  85968. };
  85969. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].slideToggleElement = function (el, duration) {
  85970. if (_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.includes(el.classList, 'collapsed') || _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.includes(el.classList, 'hidden')) {
  85971. return _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].slideOut(el, duration);
  85972. } else {
  85973. return _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].slideIn(el, duration);
  85974. }
  85975. };
  85976. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].slideOut = function (el, duration = 200) {
  85977. /* Shows/expands an element by sliding it out of itself
  85978. *
  85979. * Parameters:
  85980. * (HTMLElement) el - The HTML string
  85981. * (Number) duration - The duration amount in milliseconds
  85982. */
  85983. return new Promise((resolve, reject) => {
  85984. if (_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(el)) {
  85985. const err = "Undefined or null element passed into slideOut";
  85986. logger.warn(err);
  85987. reject(new Error(err));
  85988. return;
  85989. }
  85990. const marker = el.getAttribute('data-slider-marker');
  85991. if (marker) {
  85992. el.removeAttribute('data-slider-marker');
  85993. window.cancelAnimationFrame(marker);
  85994. }
  85995. const end_height = _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].calculateElementHeight(el);
  85996. if (window.converse_disable_effects) {
  85997. // Effects are disabled (for tests)
  85998. el.style.height = end_height + 'px';
  85999. slideOutWrapup(el);
  86000. resolve();
  86001. return;
  86002. }
  86003. if (!_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].hasClass('collapsed', el) && !_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].hasClass('hidden', el)) {
  86004. resolve();
  86005. return;
  86006. }
  86007. const steps = duration / 17; // We assume 17ms per animation which is ~60FPS
  86008. let height = 0;
  86009. function draw() {
  86010. height += end_height / steps;
  86011. if (height < end_height) {
  86012. el.style.height = height + 'px';
  86013. el.setAttribute('data-slider-marker', window.requestAnimationFrame(draw));
  86014. } else {
  86015. // We recalculate the height to work around an apparent
  86016. // browser bug where browsers don't know the correct
  86017. // offsetHeight beforehand.
  86018. el.removeAttribute('data-slider-marker');
  86019. el.style.height = _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].calculateElementHeight(el) + 'px';
  86020. el.style.overflow = "";
  86021. el.style.height = "";
  86022. resolve();
  86023. }
  86024. }
  86025. el.style.height = '0';
  86026. el.style.overflow = 'hidden';
  86027. el.classList.remove('hidden');
  86028. el.classList.remove('collapsed');
  86029. el.setAttribute('data-slider-marker', window.requestAnimationFrame(draw));
  86030. });
  86031. };
  86032. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].slideIn = function (el, duration = 200) {
  86033. /* Hides/collapses an element by sliding it into itself. */
  86034. return new Promise((resolve, reject) => {
  86035. if (_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(el)) {
  86036. const err = "Undefined or null element passed into slideIn";
  86037. logger.warn(err);
  86038. return reject(new Error(err));
  86039. } else if (_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.includes(el.classList, 'collapsed')) {
  86040. return resolve(el);
  86041. } else if (window.converse_disable_effects) {
  86042. // Effects are disabled (for tests)
  86043. el.classList.add('collapsed');
  86044. el.style.height = "";
  86045. return resolve(el);
  86046. }
  86047. const marker = el.getAttribute('data-slider-marker');
  86048. if (marker) {
  86049. el.removeAttribute('data-slider-marker');
  86050. window.cancelAnimationFrame(marker);
  86051. }
  86052. const original_height = el.offsetHeight,
  86053. steps = duration / 17; // We assume 17ms per animation which is ~60FPS
  86054. let height = original_height;
  86055. el.style.overflow = 'hidden';
  86056. function draw() {
  86057. height -= original_height / steps;
  86058. if (height > 0) {
  86059. el.style.height = height + 'px';
  86060. el.setAttribute('data-slider-marker', window.requestAnimationFrame(draw));
  86061. } else {
  86062. el.removeAttribute('data-slider-marker');
  86063. el.classList.add('collapsed');
  86064. el.style.height = "";
  86065. resolve(el);
  86066. }
  86067. }
  86068. el.setAttribute('data-slider-marker', window.requestAnimationFrame(draw));
  86069. });
  86070. };
  86071. function afterAnimationEnds(el, callback) {
  86072. el.classList.remove('visible');
  86073. if (_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isFunction(callback)) {
  86074. callback();
  86075. }
  86076. }
  86077. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].isVisible = function (el) {
  86078. if (_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].hasClass('hidden', el)) {
  86079. return false;
  86080. } // XXX: Taken from jQuery's "visible" implementation
  86081. return el.offsetWidth > 0 || el.offsetHeight > 0 || el.getClientRects().length > 0;
  86082. };
  86083. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].fadeIn = function (el, callback) {
  86084. if (_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(el)) {
  86085. logger.warn("Undefined or null element passed into fadeIn");
  86086. }
  86087. if (window.converse_disable_effects) {
  86088. el.classList.remove('hidden');
  86089. return afterAnimationEnds(el, callback);
  86090. }
  86091. if (_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.includes(el.classList, 'hidden')) {
  86092. el.classList.add('visible');
  86093. el.classList.remove('hidden');
  86094. el.addEventListener("webkitAnimationEnd", _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.partial(afterAnimationEnds, el, callback));
  86095. el.addEventListener("animationend", _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.partial(afterAnimationEnds, el, callback));
  86096. el.addEventListener("oanimationend", _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.partial(afterAnimationEnds, el, callback));
  86097. } else {
  86098. afterAnimationEnds(el, callback);
  86099. }
  86100. };
  86101. _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].xForm2webForm = function (field, stanza, domain) {
  86102. /* Takes a field in XMPP XForm (XEP-004: Data Forms) format
  86103. * and turns it into an HTML field.
  86104. *
  86105. * Returns either text or a DOM element (which is not ideal, but fine
  86106. * for now).
  86107. *
  86108. * Parameters:
  86109. * (XMLElement) field - the field to convert
  86110. */
  86111. if (field.getAttribute('type')) {
  86112. if (field.getAttribute('type') === 'list-single' || field.getAttribute('type') === 'list-multi') {
  86113. const values = _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.map(_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].queryChildren(field, 'value'), _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.partial(_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get, _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a, 'textContent'));
  86114. const options = _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.map(_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].queryChildren(field, 'option'), function (option) {
  86115. const value = _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get(option.querySelector('value'), 'textContent');
  86116. return _templates_select_option_html__WEBPACK_IMPORTED_MODULE_14___default()({
  86117. 'value': value,
  86118. 'label': option.getAttribute('label'),
  86119. 'selected': _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.includes(values, value),
  86120. 'required': !_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(field.querySelector('required'))
  86121. });
  86122. });
  86123. return _templates_form_select_html__WEBPACK_IMPORTED_MODULE_9___default()({
  86124. 'id': _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].getUniqueId(),
  86125. 'name': field.getAttribute('var'),
  86126. 'label': field.getAttribute('label'),
  86127. 'options': options.join(''),
  86128. 'multiple': field.getAttribute('type') === 'list-multi',
  86129. 'required': !_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(field.querySelector('required'))
  86130. });
  86131. } else if (field.getAttribute('type') === 'fixed') {
  86132. const text = _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get(field.querySelector('value'), 'textContent');
  86133. return '<p class="form-help">' + text + '</p>';
  86134. } else if (field.getAttribute('type') === 'jid-multi') {
  86135. return _templates_form_textarea_html__WEBPACK_IMPORTED_MODULE_10___default()({
  86136. 'name': field.getAttribute('var'),
  86137. 'label': field.getAttribute('label') || '',
  86138. 'value': _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get(field.querySelector('value'), 'textContent'),
  86139. 'required': !_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(field.querySelector('required'))
  86140. });
  86141. } else if (field.getAttribute('type') === 'boolean') {
  86142. return _templates_form_checkbox_html__WEBPACK_IMPORTED_MODULE_7___default()({
  86143. 'id': _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].getUniqueId(),
  86144. 'name': field.getAttribute('var'),
  86145. 'label': field.getAttribute('label') || '',
  86146. 'checked': _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get(field.querySelector('value'), 'textContent') === "1" && 'checked="1"' || '',
  86147. 'required': !_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(field.querySelector('required'))
  86148. });
  86149. } else if (field.getAttribute('var') === 'url') {
  86150. return _templates_form_url_html__WEBPACK_IMPORTED_MODULE_11___default()({
  86151. 'label': field.getAttribute('label') || '',
  86152. 'value': _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get(field.querySelector('value'), 'textContent')
  86153. });
  86154. } else if (field.getAttribute('var') === 'username') {
  86155. return _templates_form_username_html__WEBPACK_IMPORTED_MODULE_12___default()({
  86156. 'domain': ' @' + domain,
  86157. 'name': field.getAttribute('var'),
  86158. 'type': XFORM_TYPE_MAP[field.getAttribute('type')],
  86159. 'label': field.getAttribute('label') || '',
  86160. 'value': _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get(field.querySelector('value'), 'textContent'),
  86161. 'required': !_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(field.querySelector('required'))
  86162. });
  86163. } else {
  86164. return _templates_form_input_html__WEBPACK_IMPORTED_MODULE_8___default()({
  86165. 'id': _headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"].getUniqueId(),
  86166. 'label': field.getAttribute('label') || '',
  86167. 'name': field.getAttribute('var'),
  86168. 'placeholder': null,
  86169. 'required': !_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(field.querySelector('required')),
  86170. 'type': XFORM_TYPE_MAP[field.getAttribute('type')],
  86171. 'value': _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get(field.querySelector('value'), 'textContent')
  86172. });
  86173. }
  86174. } else {
  86175. if (field.getAttribute('var') === 'ocr') {
  86176. // Captcha
  86177. const uri = field.querySelector('uri');
  86178. const el = sizzle__WEBPACK_IMPORTED_MODULE_2___default()('data[cid="' + uri.textContent.replace(/^cid:/, '') + '"]', stanza)[0];
  86179. return _templates_form_captcha_html__WEBPACK_IMPORTED_MODULE_6___default()({
  86180. 'label': field.getAttribute('label'),
  86181. 'name': field.getAttribute('var'),
  86182. 'data': _headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.get(el, 'textContent'),
  86183. 'type': uri.getAttribute('type'),
  86184. 'required': !_headless_lodash_noconflict__WEBPACK_IMPORTED_MODULE_1___default.a.isNil(field.querySelector('required'))
  86185. });
  86186. }
  86187. }
  86188. };
  86189. /* harmony default export */ __webpack_exports__["default"] = (_headless_utils_core__WEBPACK_IMPORTED_MODULE_16__["default"]);
  86190. /***/ })
  86191. /******/ });
  86192. //# sourceMappingURL=converse.js.map