main.js 348 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559
  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. /******/ // identity function for calling harmony imports with the correct context
  37. /******/ __webpack_require__.i = function(value) { return value; };
  38. /******/
  39. /******/ // define getter function for harmony exports
  40. /******/ __webpack_require__.d = function(exports, name, getter) {
  41. /******/ if(!__webpack_require__.o(exports, name)) {
  42. /******/ Object.defineProperty(exports, name, {
  43. /******/ configurable: false,
  44. /******/ enumerable: true,
  45. /******/ get: getter
  46. /******/ });
  47. /******/ }
  48. /******/ };
  49. /******/
  50. /******/ // getDefaultExport function for compatibility with non-harmony modules
  51. /******/ __webpack_require__.n = function(module) {
  52. /******/ var getter = module && module.__esModule ?
  53. /******/ function getDefault() { return module['default']; } :
  54. /******/ function getModuleExports() { return module; };
  55. /******/ __webpack_require__.d(getter, 'a', getter);
  56. /******/ return getter;
  57. /******/ };
  58. /******/
  59. /******/ // Object.prototype.hasOwnProperty.call
  60. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  61. /******/
  62. /******/ // __webpack_public_path__
  63. /******/ __webpack_require__.p = "";
  64. /******/
  65. /******/ // Load entry module and return exports
  66. /******/ return __webpack_require__(__webpack_require__.s = 85);
  67. /******/ })
  68. /************************************************************************/
  69. /******/ ([
  70. /* 0 */
  71. /***/ (function(module, exports, __webpack_require__) {
  72. "use strict";
  73. // Utilities
  74. //
  75. function _class(obj) { return Object.prototype.toString.call(obj); }
  76. function isString(obj) { return _class(obj) === '[object String]'; }
  77. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  78. function has(object, key) {
  79. return _hasOwnProperty.call(object, key);
  80. }
  81. // Merge objects
  82. //
  83. function assign(obj /*from1, from2, from3, ...*/) {
  84. var sources = Array.prototype.slice.call(arguments, 1);
  85. sources.forEach(function (source) {
  86. if (!source) { return; }
  87. if (typeof source !== 'object') {
  88. throw new TypeError(source + 'must be object');
  89. }
  90. Object.keys(source).forEach(function (key) {
  91. obj[key] = source[key];
  92. });
  93. });
  94. return obj;
  95. }
  96. // Remove element from array and put another array at those position.
  97. // Useful for some operations with tokens
  98. function arrayReplaceAt(src, pos, newElements) {
  99. return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
  100. }
  101. ////////////////////////////////////////////////////////////////////////////////
  102. function isValidEntityCode(c) {
  103. /*eslint no-bitwise:0*/
  104. // broken sequence
  105. if (c >= 0xD800 && c <= 0xDFFF) { return false; }
  106. // never used
  107. if (c >= 0xFDD0 && c <= 0xFDEF) { return false; }
  108. if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false; }
  109. // control codes
  110. if (c >= 0x00 && c <= 0x08) { return false; }
  111. if (c === 0x0B) { return false; }
  112. if (c >= 0x0E && c <= 0x1F) { return false; }
  113. if (c >= 0x7F && c <= 0x9F) { return false; }
  114. // out of range
  115. if (c > 0x10FFFF) { return false; }
  116. return true;
  117. }
  118. function fromCodePoint(c) {
  119. /*eslint no-bitwise:0*/
  120. if (c > 0xffff) {
  121. c -= 0x10000;
  122. var surrogate1 = 0xd800 + (c >> 10),
  123. surrogate2 = 0xdc00 + (c & 0x3ff);
  124. return String.fromCharCode(surrogate1, surrogate2);
  125. }
  126. return String.fromCharCode(c);
  127. }
  128. var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g;
  129. var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;
  130. var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi');
  131. var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;
  132. var entities = __webpack_require__(11);
  133. function replaceEntityPattern(match, name) {
  134. var code = 0;
  135. if (has(entities, name)) {
  136. return entities[name];
  137. }
  138. if (name.charCodeAt(0) === 0x23/* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {
  139. code = name[1].toLowerCase() === 'x' ?
  140. parseInt(name.slice(2), 16)
  141. :
  142. parseInt(name.slice(1), 10);
  143. if (isValidEntityCode(code)) {
  144. return fromCodePoint(code);
  145. }
  146. }
  147. return match;
  148. }
  149. /*function replaceEntities(str) {
  150. if (str.indexOf('&') < 0) { return str; }
  151. return str.replace(ENTITY_RE, replaceEntityPattern);
  152. }*/
  153. function unescapeMd(str) {
  154. if (str.indexOf('\\') < 0) { return str; }
  155. return str.replace(UNESCAPE_MD_RE, '$1');
  156. }
  157. function unescapeAll(str) {
  158. if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { return str; }
  159. return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) {
  160. if (escaped) { return escaped; }
  161. return replaceEntityPattern(match, entity);
  162. });
  163. }
  164. ////////////////////////////////////////////////////////////////////////////////
  165. var HTML_ESCAPE_TEST_RE = /[&<>"]/;
  166. var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
  167. var HTML_REPLACEMENTS = {
  168. '&': '&amp;',
  169. '<': '&lt;',
  170. '>': '&gt;',
  171. '"': '&quot;'
  172. };
  173. function replaceUnsafeChar(ch) {
  174. return HTML_REPLACEMENTS[ch];
  175. }
  176. function escapeHtml(str) {
  177. if (HTML_ESCAPE_TEST_RE.test(str)) {
  178. return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
  179. }
  180. return str;
  181. }
  182. ////////////////////////////////////////////////////////////////////////////////
  183. var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
  184. function escapeRE(str) {
  185. return str.replace(REGEXP_ESCAPE_RE, '\\$&');
  186. }
  187. ////////////////////////////////////////////////////////////////////////////////
  188. function isSpace(code) {
  189. switch (code) {
  190. case 0x09:
  191. case 0x20:
  192. return true;
  193. }
  194. return false;
  195. }
  196. // Zs (unicode class) || [\t\f\v\r\n]
  197. function isWhiteSpace(code) {
  198. if (code >= 0x2000 && code <= 0x200A) { return true; }
  199. switch (code) {
  200. case 0x09: // \t
  201. case 0x0A: // \n
  202. case 0x0B: // \v
  203. case 0x0C: // \f
  204. case 0x0D: // \r
  205. case 0x20:
  206. case 0xA0:
  207. case 0x1680:
  208. case 0x202F:
  209. case 0x205F:
  210. case 0x3000:
  211. return true;
  212. }
  213. return false;
  214. }
  215. ////////////////////////////////////////////////////////////////////////////////
  216. /*eslint-disable max-len*/
  217. var UNICODE_PUNCT_RE = __webpack_require__(5);
  218. // Currently without astral characters support.
  219. function isPunctChar(ch) {
  220. return UNICODE_PUNCT_RE.test(ch);
  221. }
  222. // Markdown ASCII punctuation characters.
  223. //
  224. // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
  225. // http://spec.commonmark.org/0.15/#ascii-punctuation-character
  226. //
  227. // Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.
  228. //
  229. function isMdAsciiPunct(ch) {
  230. switch (ch) {
  231. case 0x21/* ! */:
  232. case 0x22/* " */:
  233. case 0x23/* # */:
  234. case 0x24/* $ */:
  235. case 0x25/* % */:
  236. case 0x26/* & */:
  237. case 0x27/* ' */:
  238. case 0x28/* ( */:
  239. case 0x29/* ) */:
  240. case 0x2A/* * */:
  241. case 0x2B/* + */:
  242. case 0x2C/* , */:
  243. case 0x2D/* - */:
  244. case 0x2E/* . */:
  245. case 0x2F/* / */:
  246. case 0x3A/* : */:
  247. case 0x3B/* ; */:
  248. case 0x3C/* < */:
  249. case 0x3D/* = */:
  250. case 0x3E/* > */:
  251. case 0x3F/* ? */:
  252. case 0x40/* @ */:
  253. case 0x5B/* [ */:
  254. case 0x5C/* \ */:
  255. case 0x5D/* ] */:
  256. case 0x5E/* ^ */:
  257. case 0x5F/* _ */:
  258. case 0x60/* ` */:
  259. case 0x7B/* { */:
  260. case 0x7C/* | */:
  261. case 0x7D/* } */:
  262. case 0x7E/* ~ */:
  263. return true;
  264. default:
  265. return false;
  266. }
  267. }
  268. // Hepler to unify [reference labels].
  269. //
  270. function normalizeReference(str) {
  271. // use .toUpperCase() instead of .toLowerCase()
  272. // here to avoid a conflict with Object.prototype
  273. // members (most notably, `__proto__`)
  274. return str.trim().replace(/\s+/g, ' ').toUpperCase();
  275. }
  276. ////////////////////////////////////////////////////////////////////////////////
  277. // Re-export libraries commonly used in both markdown-it and its plugins,
  278. // so plugins won't have to depend on them explicitly, which reduces their
  279. // bundled size (e.g. a browser build).
  280. //
  281. exports.lib = {};
  282. exports.lib.mdurl = __webpack_require__(15);
  283. exports.lib.ucmicro = __webpack_require__(83);
  284. exports.assign = assign;
  285. exports.isString = isString;
  286. exports.has = has;
  287. exports.unescapeMd = unescapeMd;
  288. exports.unescapeAll = unescapeAll;
  289. exports.isValidEntityCode = isValidEntityCode;
  290. exports.fromCodePoint = fromCodePoint;
  291. // exports.replaceEntities = replaceEntities;
  292. exports.escapeHtml = escapeHtml;
  293. exports.arrayReplaceAt = arrayReplaceAt;
  294. exports.isSpace = isSpace;
  295. exports.isWhiteSpace = isWhiteSpace;
  296. exports.isMdAsciiPunct = isMdAsciiPunct;
  297. exports.isPunctChar = isPunctChar;
  298. exports.escapeRE = escapeRE;
  299. exports.normalizeReference = normalizeReference;
  300. /***/ }),
  301. /* 1 */
  302. /***/ (function(module, exports, __webpack_require__) {
  303. /* WEBPACK VAR INJECTION */(function(setImmediate, global) {;(function() {
  304. "use strict"
  305. function Vnode(tag, key, attrs0, children, text, dom) {
  306. return {tag: tag, key: key, attrs: attrs0, children: children, text: text, dom: dom, domSize: undefined, state: undefined, _state: undefined, events: undefined, instance: undefined, skip: false}
  307. }
  308. Vnode.normalize = function(node) {
  309. if (Array.isArray(node)) return Vnode("[", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)
  310. if (node != null && typeof node !== "object") return Vnode("#", undefined, undefined, node === false ? "" : node, undefined, undefined)
  311. return node
  312. }
  313. Vnode.normalizeChildren = function normalizeChildren(children) {
  314. for (var i = 0; i < children.length; i++) {
  315. children[i] = Vnode.normalize(children[i])
  316. }
  317. return children
  318. }
  319. var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g
  320. var selectorCache = {}
  321. var hasOwn = {}.hasOwnProperty
  322. function compileSelector(selector) {
  323. var match, tag = "div", classes = [], attrs = {}
  324. while (match = selectorParser.exec(selector)) {
  325. var type = match[1], value = match[2]
  326. if (type === "" && value !== "") tag = value
  327. else if (type === "#") attrs.id = value
  328. else if (type === ".") classes.push(value)
  329. else if (match[3][0] === "[") {
  330. var attrValue = match[6]
  331. if (attrValue) attrValue = attrValue.replace(/\\(["'])/g, "$1").replace(/\\\\/g, "\\")
  332. if (match[4] === "class") classes.push(attrValue)
  333. else attrs[match[4]] = attrValue || true
  334. }
  335. }
  336. if (classes.length > 0) attrs.className = classes.join(" ")
  337. return selectorCache[selector] = {tag: tag, attrs: attrs}
  338. }
  339. function execSelector(state, attrs, children) {
  340. var hasAttrs = false, childList, text
  341. var className = attrs.className || attrs.class
  342. for (var key in state.attrs) {
  343. if (hasOwn.call(state.attrs, key)) {
  344. attrs[key] = state.attrs[key]
  345. }
  346. }
  347. if (className !== undefined) {
  348. if (attrs.class !== undefined) {
  349. attrs.class = undefined
  350. attrs.className = className
  351. }
  352. if (state.attrs.className != null) {
  353. attrs.className = state.attrs.className + " " + className
  354. }
  355. }
  356. for (var key in attrs) {
  357. if (hasOwn.call(attrs, key) && key !== "key") {
  358. hasAttrs = true
  359. break
  360. }
  361. }
  362. if (Array.isArray(children) && children.length === 1 && children[0] != null && children[0].tag === "#") {
  363. text = children[0].children
  364. } else {
  365. childList = children
  366. }
  367. return Vnode(state.tag, attrs.key, hasAttrs ? attrs : undefined, childList, text)
  368. }
  369. function hyperscript(selector) {
  370. // Because sloppy mode sucks
  371. var attrs = arguments[1], start = 2, children
  372. if (selector == null || typeof selector !== "string" && typeof selector !== "function" && typeof selector.view !== "function") {
  373. throw Error("The selector must be either a string or a component.");
  374. }
  375. if (typeof selector === "string") {
  376. var cached = selectorCache[selector] || compileSelector(selector)
  377. }
  378. if (attrs == null) {
  379. attrs = {}
  380. } else if (typeof attrs !== "object" || attrs.tag != null || Array.isArray(attrs)) {
  381. attrs = {}
  382. start = 1
  383. }
  384. if (arguments.length === start + 1) {
  385. children = arguments[start]
  386. if (!Array.isArray(children)) children = [children]
  387. } else {
  388. children = []
  389. while (start < arguments.length) children.push(arguments[start++])
  390. }
  391. var normalized = Vnode.normalizeChildren(children)
  392. if (typeof selector === "string") {
  393. return execSelector(cached, attrs, normalized)
  394. } else {
  395. return Vnode(selector, attrs.key, attrs, normalized)
  396. }
  397. }
  398. hyperscript.trust = function(html) {
  399. if (html == null) html = ""
  400. return Vnode("<", undefined, undefined, html, undefined, undefined)
  401. }
  402. hyperscript.fragment = function(attrs1, children) {
  403. return Vnode("[", attrs1.key, attrs1, Vnode.normalizeChildren(children), undefined, undefined)
  404. }
  405. var m = hyperscript
  406. /** @constructor */
  407. var PromisePolyfill = function(executor) {
  408. if (!(this instanceof PromisePolyfill)) throw new Error("Promise must be called with `new`")
  409. if (typeof executor !== "function") throw new TypeError("executor must be a function")
  410. var self = this, resolvers = [], rejectors = [], resolveCurrent = handler(resolvers, true), rejectCurrent = handler(rejectors, false)
  411. var instance = self._instance = {resolvers: resolvers, rejectors: rejectors}
  412. var callAsync = typeof setImmediate === "function" ? setImmediate : setTimeout
  413. function handler(list, shouldAbsorb) {
  414. return function execute(value) {
  415. var then
  416. try {
  417. if (shouldAbsorb && value != null && (typeof value === "object" || typeof value === "function") && typeof (then = value.then) === "function") {
  418. if (value === self) throw new TypeError("Promise can't be resolved w/ itself")
  419. executeOnce(then.bind(value))
  420. }
  421. else {
  422. callAsync(function() {
  423. if (!shouldAbsorb && list.length === 0) console.error("Possible unhandled promise rejection:", value)
  424. for (var i = 0; i < list.length; i++) list[i](value)
  425. resolvers.length = 0, rejectors.length = 0
  426. instance.state = shouldAbsorb
  427. instance.retry = function() {execute(value)}
  428. })
  429. }
  430. }
  431. catch (e) {
  432. rejectCurrent(e)
  433. }
  434. }
  435. }
  436. function executeOnce(then) {
  437. var runs = 0
  438. function run(fn) {
  439. return function(value) {
  440. if (runs++ > 0) return
  441. fn(value)
  442. }
  443. }
  444. var onerror = run(rejectCurrent)
  445. try {then(run(resolveCurrent), onerror)} catch (e) {onerror(e)}
  446. }
  447. executeOnce(executor)
  448. }
  449. PromisePolyfill.prototype.then = function(onFulfilled, onRejection) {
  450. var self = this, instance = self._instance
  451. function handle(callback, list, next, state) {
  452. list.push(function(value) {
  453. if (typeof callback !== "function") next(value)
  454. else try {resolveNext(callback(value))} catch (e) {if (rejectNext) rejectNext(e)}
  455. })
  456. if (typeof instance.retry === "function" && state === instance.state) instance.retry()
  457. }
  458. var resolveNext, rejectNext
  459. var promise = new PromisePolyfill(function(resolve, reject) {resolveNext = resolve, rejectNext = reject})
  460. handle(onFulfilled, instance.resolvers, resolveNext, true), handle(onRejection, instance.rejectors, rejectNext, false)
  461. return promise
  462. }
  463. PromisePolyfill.prototype.catch = function(onRejection) {
  464. return this.then(null, onRejection)
  465. }
  466. PromisePolyfill.resolve = function(value) {
  467. if (value instanceof PromisePolyfill) return value
  468. return new PromisePolyfill(function(resolve) {resolve(value)})
  469. }
  470. PromisePolyfill.reject = function(value) {
  471. return new PromisePolyfill(function(resolve, reject) {reject(value)})
  472. }
  473. PromisePolyfill.all = function(list) {
  474. return new PromisePolyfill(function(resolve, reject) {
  475. var total = list.length, count = 0, values = []
  476. if (list.length === 0) resolve([])
  477. else for (var i = 0; i < list.length; i++) {
  478. (function(i) {
  479. function consume(value) {
  480. count++
  481. values[i] = value
  482. if (count === total) resolve(values)
  483. }
  484. if (list[i] != null && (typeof list[i] === "object" || typeof list[i] === "function") && typeof list[i].then === "function") {
  485. list[i].then(consume, reject)
  486. }
  487. else consume(list[i])
  488. })(i)
  489. }
  490. })
  491. }
  492. PromisePolyfill.race = function(list) {
  493. return new PromisePolyfill(function(resolve, reject) {
  494. for (var i = 0; i < list.length; i++) {
  495. list[i].then(resolve, reject)
  496. }
  497. })
  498. }
  499. if (typeof window !== "undefined") {
  500. if (typeof window.Promise === "undefined") window.Promise = PromisePolyfill
  501. var PromisePolyfill = window.Promise
  502. } else if (typeof global !== "undefined") {
  503. if (typeof global.Promise === "undefined") global.Promise = PromisePolyfill
  504. var PromisePolyfill = global.Promise
  505. } else {
  506. }
  507. var buildQueryString = function(object) {
  508. if (Object.prototype.toString.call(object) !== "[object Object]") return ""
  509. var args = []
  510. for (var key0 in object) {
  511. destructure(key0, object[key0])
  512. }
  513. return args.join("&")
  514. function destructure(key0, value) {
  515. if (Array.isArray(value)) {
  516. for (var i = 0; i < value.length; i++) {
  517. destructure(key0 + "[" + i + "]", value[i])
  518. }
  519. }
  520. else if (Object.prototype.toString.call(value) === "[object Object]") {
  521. for (var i in value) {
  522. destructure(key0 + "[" + i + "]", value[i])
  523. }
  524. }
  525. else args.push(encodeURIComponent(key0) + (value != null && value !== "" ? "=" + encodeURIComponent(value) : ""))
  526. }
  527. }
  528. var FILE_PROTOCOL_REGEX = new RegExp("^file://", "i")
  529. var _8 = function($window, Promise) {
  530. var callbackCount = 0
  531. var oncompletion
  532. function setCompletionCallback(callback) {oncompletion = callback}
  533. function finalizer() {
  534. var count = 0
  535. function complete() {if (--count === 0 && typeof oncompletion === "function") oncompletion()}
  536. return function finalize(promise0) {
  537. var then0 = promise0.then
  538. promise0.then = function() {
  539. count++
  540. var next = then0.apply(promise0, arguments)
  541. next.then(complete, function(e) {
  542. complete()
  543. if (count === 0) throw e
  544. })
  545. return finalize(next)
  546. }
  547. return promise0
  548. }
  549. }
  550. function normalize(args, extra) {
  551. if (typeof args === "string") {
  552. var url = args
  553. args = extra || {}
  554. if (args.url == null) args.url = url
  555. }
  556. return args
  557. }
  558. function request(args, extra) {
  559. var finalize = finalizer()
  560. args = normalize(args, extra)
  561. var promise0 = new Promise(function(resolve, reject) {
  562. if (args.method == null) args.method = "GET"
  563. args.method = args.method.toUpperCase()
  564. var useBody = (args.method === "GET" || args.method === "TRACE") ? false : (typeof args.useBody === "boolean" ? args.useBody : true)
  565. if (typeof args.serialize !== "function") args.serialize = typeof FormData !== "undefined" && args.data instanceof FormData ? function(value) {return value} : JSON.stringify
  566. if (typeof args.deserialize !== "function") args.deserialize = deserialize
  567. if (typeof args.extract !== "function") args.extract = extract
  568. args.url = interpolate(args.url, args.data)
  569. if (useBody) args.data = args.serialize(args.data)
  570. else args.url = assemble(args.url, args.data)
  571. var xhr = new $window.XMLHttpRequest(),
  572. aborted = false,
  573. _abort = xhr.abort
  574. xhr.abort = function abort() {
  575. aborted = true
  576. _abort.call(xhr)
  577. }
  578. xhr.open(args.method, args.url, typeof args.async === "boolean" ? args.async : true, typeof args.user === "string" ? args.user : undefined, typeof args.password === "string" ? args.password : undefined)
  579. if (args.serialize === JSON.stringify && useBody) {
  580. xhr.setRequestHeader("Content-Type", "application/json; charset=utf-8")
  581. }
  582. if (args.deserialize === deserialize) {
  583. xhr.setRequestHeader("Accept", "application/json, text/*")
  584. }
  585. if (args.withCredentials) xhr.withCredentials = args.withCredentials
  586. for (var key in args.headers) if ({}.hasOwnProperty.call(args.headers, key)) {
  587. xhr.setRequestHeader(key, args.headers[key])
  588. }
  589. if (typeof args.config === "function") xhr = args.config(xhr, args) || xhr
  590. xhr.onreadystatechange = function() {
  591. // Don't throw errors on xhr.abort().
  592. if(aborted) return
  593. if (xhr.readyState === 4) {
  594. try {
  595. var response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args))
  596. if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || FILE_PROTOCOL_REGEX.test(args.url)) {
  597. resolve(cast(args.type, response))
  598. }
  599. else {
  600. var error = new Error(xhr.responseText)
  601. for (var key in response) error[key] = response[key]
  602. reject(error)
  603. }
  604. }
  605. catch (e) {
  606. reject(e)
  607. }
  608. }
  609. }
  610. if (useBody && (args.data != null)) xhr.send(args.data)
  611. else xhr.send()
  612. })
  613. return args.background === true ? promise0 : finalize(promise0)
  614. }
  615. function jsonp(args, extra) {
  616. var finalize = finalizer()
  617. args = normalize(args, extra)
  618. var promise0 = new Promise(function(resolve, reject) {
  619. var callbackName = args.callbackName || "_mithril_" + Math.round(Math.random() * 1e16) + "_" + callbackCount++
  620. var script = $window.document.createElement("script")
  621. $window[callbackName] = function(data) {
  622. script.parentNode.removeChild(script)
  623. resolve(cast(args.type, data))
  624. delete $window[callbackName]
  625. }
  626. script.onerror = function() {
  627. script.parentNode.removeChild(script)
  628. reject(new Error("JSONP request failed"))
  629. delete $window[callbackName]
  630. }
  631. if (args.data == null) args.data = {}
  632. args.url = interpolate(args.url, args.data)
  633. args.data[args.callbackKey || "callback"] = callbackName
  634. script.src = assemble(args.url, args.data)
  635. $window.document.documentElement.appendChild(script)
  636. })
  637. return args.background === true? promise0 : finalize(promise0)
  638. }
  639. function interpolate(url, data) {
  640. if (data == null) return url
  641. var tokens = url.match(/:[^\/]+/gi) || []
  642. for (var i = 0; i < tokens.length; i++) {
  643. var key = tokens[i].slice(1)
  644. if (data[key] != null) {
  645. url = url.replace(tokens[i], data[key])
  646. }
  647. }
  648. return url
  649. }
  650. function assemble(url, data) {
  651. var querystring = buildQueryString(data)
  652. if (querystring !== "") {
  653. var prefix = url.indexOf("?") < 0 ? "?" : "&"
  654. url += prefix + querystring
  655. }
  656. return url
  657. }
  658. function deserialize(data) {
  659. try {return data !== "" ? JSON.parse(data) : null}
  660. catch (e) {throw new Error(data)}
  661. }
  662. function extract(xhr) {return xhr.responseText}
  663. function cast(type0, data) {
  664. if (typeof type0 === "function") {
  665. if (Array.isArray(data)) {
  666. for (var i = 0; i < data.length; i++) {
  667. data[i] = new type0(data[i])
  668. }
  669. }
  670. else return new type0(data)
  671. }
  672. return data
  673. }
  674. return {request: request, jsonp: jsonp, setCompletionCallback: setCompletionCallback}
  675. }
  676. var requestService = _8(window, PromisePolyfill)
  677. var coreRenderer = function($window) {
  678. var $doc = $window.document
  679. var $emptyFragment = $doc.createDocumentFragment()
  680. var onevent
  681. function setEventCallback(callback) {return onevent = callback}
  682. //create
  683. function createNodes(parent, vnodes, start, end, hooks, nextSibling, ns) {
  684. for (var i = start; i < end; i++) {
  685. var vnode = vnodes[i]
  686. if (vnode != null) {
  687. createNode(parent, vnode, hooks, ns, nextSibling)
  688. }
  689. }
  690. }
  691. function createNode(parent, vnode, hooks, ns, nextSibling) {
  692. var tag = vnode.tag
  693. if (typeof tag === "string") {
  694. vnode.state = {}
  695. if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)
  696. switch (tag) {
  697. case "#": return createText(parent, vnode, nextSibling)
  698. case "<": return createHTML(parent, vnode, nextSibling)
  699. case "[": return createFragment(parent, vnode, hooks, ns, nextSibling)
  700. default: return createElement(parent, vnode, hooks, ns, nextSibling)
  701. }
  702. }
  703. else return createComponent(parent, vnode, hooks, ns, nextSibling)
  704. }
  705. function createText(parent, vnode, nextSibling) {
  706. vnode.dom = $doc.createTextNode(vnode.children)
  707. insertNode(parent, vnode.dom, nextSibling)
  708. return vnode.dom
  709. }
  710. function createHTML(parent, vnode, nextSibling) {
  711. var match1 = vnode.children.match(/^\s*?<(\w+)/im) || []
  712. var parent1 = {caption: "table", thead: "table", tbody: "table", tfoot: "table", tr: "tbody", th: "tr", td: "tr", colgroup: "table", col: "colgroup"}[match1[1]] || "div"
  713. var temp = $doc.createElement(parent1)
  714. temp.innerHTML = vnode.children
  715. vnode.dom = temp.firstChild
  716. vnode.domSize = temp.childNodes.length
  717. var fragment = $doc.createDocumentFragment()
  718. var child
  719. while (child = temp.firstChild) {
  720. fragment.appendChild(child)
  721. }
  722. insertNode(parent, fragment, nextSibling)
  723. return fragment
  724. }
  725. function createFragment(parent, vnode, hooks, ns, nextSibling) {
  726. var fragment = $doc.createDocumentFragment()
  727. if (vnode.children != null) {
  728. var children = vnode.children
  729. createNodes(fragment, children, 0, children.length, hooks, null, ns)
  730. }
  731. vnode.dom = fragment.firstChild
  732. vnode.domSize = fragment.childNodes.length
  733. insertNode(parent, fragment, nextSibling)
  734. return fragment
  735. }
  736. function createElement(parent, vnode, hooks, ns, nextSibling) {
  737. var tag = vnode.tag
  738. switch (vnode.tag) {
  739. case "svg": ns = "http://www.w3.org/2000/svg"; break
  740. case "math": ns = "http://www.w3.org/1998/Math/MathML"; break
  741. }
  742. var attrs2 = vnode.attrs
  743. var is = attrs2 && attrs2.is
  744. var element = ns ?
  745. is ? $doc.createElementNS(ns, tag, {is: is}) : $doc.createElementNS(ns, tag) :
  746. is ? $doc.createElement(tag, {is: is}) : $doc.createElement(tag)
  747. vnode.dom = element
  748. if (attrs2 != null) {
  749. setAttrs(vnode, attrs2, ns)
  750. }
  751. insertNode(parent, element, nextSibling)
  752. if (vnode.attrs != null && vnode.attrs.contenteditable != null) {
  753. setContentEditable(vnode)
  754. }
  755. else {
  756. if (vnode.text != null) {
  757. if (vnode.text !== "") element.textContent = vnode.text
  758. else vnode.children = [Vnode("#", undefined, undefined, vnode.text, undefined, undefined)]
  759. }
  760. if (vnode.children != null) {
  761. var children = vnode.children
  762. createNodes(element, children, 0, children.length, hooks, null, ns)
  763. setLateAttrs(vnode)
  764. }
  765. }
  766. return element
  767. }
  768. function initComponent(vnode, hooks) {
  769. var sentinel
  770. if (typeof vnode.tag.view === "function") {
  771. vnode.state = Object.create(vnode.tag)
  772. sentinel = vnode.state.view
  773. if (sentinel.$$reentrantLock$$ != null) return $emptyFragment
  774. sentinel.$$reentrantLock$$ = true
  775. } else {
  776. vnode.state = void 0
  777. sentinel = vnode.tag
  778. if (sentinel.$$reentrantLock$$ != null) return $emptyFragment
  779. sentinel.$$reentrantLock$$ = true
  780. vnode.state = (vnode.tag.prototype != null && typeof vnode.tag.prototype.view === "function") ? new vnode.tag(vnode) : vnode.tag(vnode)
  781. }
  782. vnode._state = vnode.state
  783. if (vnode.attrs != null) initLifecycle(vnode.attrs, vnode, hooks)
  784. initLifecycle(vnode._state, vnode, hooks)
  785. vnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))
  786. if (vnode.instance === vnode) throw Error("A view cannot return the vnode it received as argument")
  787. sentinel.$$reentrantLock$$ = null
  788. }
  789. function createComponent(parent, vnode, hooks, ns, nextSibling) {
  790. initComponent(vnode, hooks)
  791. if (vnode.instance != null) {
  792. var element = createNode(parent, vnode.instance, hooks, ns, nextSibling)
  793. vnode.dom = vnode.instance.dom
  794. vnode.domSize = vnode.dom != null ? vnode.instance.domSize : 0
  795. insertNode(parent, element, nextSibling)
  796. return element
  797. }
  798. else {
  799. vnode.domSize = 0
  800. return $emptyFragment
  801. }
  802. }
  803. //update
  804. function updateNodes(parent, old, vnodes, recycling, hooks, nextSibling, ns) {
  805. if (old === vnodes || old == null && vnodes == null) return
  806. else if (old == null) createNodes(parent, vnodes, 0, vnodes.length, hooks, nextSibling, undefined)
  807. else if (vnodes == null) removeNodes(old, 0, old.length, vnodes)
  808. else {
  809. if (old.length === vnodes.length) {
  810. var isUnkeyed = false
  811. for (var i = 0; i < vnodes.length; i++) {
  812. if (vnodes[i] != null && old[i] != null) {
  813. isUnkeyed = vnodes[i].key == null && old[i].key == null
  814. break
  815. }
  816. }
  817. if (isUnkeyed) {
  818. for (var i = 0; i < old.length; i++) {
  819. if (old[i] === vnodes[i]) continue
  820. else if (old[i] == null && vnodes[i] != null) createNode(parent, vnodes[i], hooks, ns, getNextSibling(old, i + 1, nextSibling))
  821. else if (vnodes[i] == null) removeNodes(old, i, i + 1, vnodes)
  822. else updateNode(parent, old[i], vnodes[i], hooks, getNextSibling(old, i + 1, nextSibling), recycling, ns)
  823. }
  824. return
  825. }
  826. }
  827. recycling = recycling || isRecyclable(old, vnodes)
  828. if (recycling) {
  829. var pool = old.pool
  830. old = old.concat(old.pool)
  831. }
  832. var oldStart = 0, start = 0, oldEnd = old.length - 1, end = vnodes.length - 1, map
  833. while (oldEnd >= oldStart && end >= start) {
  834. var o = old[oldStart], v = vnodes[start]
  835. if (o === v && !recycling) oldStart++, start++
  836. else if (o == null) oldStart++
  837. else if (v == null) start++
  838. else if (o.key === v.key) {
  839. var shouldRecycle = (pool != null && oldStart >= old.length - pool.length) || ((pool == null) && recycling)
  840. oldStart++, start++
  841. updateNode(parent, o, v, hooks, getNextSibling(old, oldStart, nextSibling), shouldRecycle, ns)
  842. if (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)
  843. }
  844. else {
  845. var o = old[oldEnd]
  846. if (o === v && !recycling) oldEnd--, start++
  847. else if (o == null) oldEnd--
  848. else if (v == null) start++
  849. else if (o.key === v.key) {
  850. var shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)
  851. updateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)
  852. if (recycling || start < end) insertNode(parent, toFragment(o), getNextSibling(old, oldStart, nextSibling))
  853. oldEnd--, start++
  854. }
  855. else break
  856. }
  857. }
  858. while (oldEnd >= oldStart && end >= start) {
  859. var o = old[oldEnd], v = vnodes[end]
  860. if (o === v && !recycling) oldEnd--, end--
  861. else if (o == null) oldEnd--
  862. else if (v == null) end--
  863. else if (o.key === v.key) {
  864. var shouldRecycle = (pool != null && oldEnd >= old.length - pool.length) || ((pool == null) && recycling)
  865. updateNode(parent, o, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), shouldRecycle, ns)
  866. if (recycling && o.tag === v.tag) insertNode(parent, toFragment(o), nextSibling)
  867. if (o.dom != null) nextSibling = o.dom
  868. oldEnd--, end--
  869. }
  870. else {
  871. if (!map) map = getKeyMap(old, oldEnd)
  872. if (v != null) {
  873. var oldIndex = map[v.key]
  874. if (oldIndex != null) {
  875. var movable = old[oldIndex]
  876. var shouldRecycle = (pool != null && oldIndex >= old.length - pool.length) || ((pool == null) && recycling)
  877. updateNode(parent, movable, v, hooks, getNextSibling(old, oldEnd + 1, nextSibling), recycling, ns)
  878. insertNode(parent, toFragment(movable), nextSibling)
  879. old[oldIndex].skip = true
  880. if (movable.dom != null) nextSibling = movable.dom
  881. }
  882. else {
  883. var dom = createNode(parent, v, hooks, undefined, nextSibling)
  884. nextSibling = dom
  885. }
  886. }
  887. end--
  888. }
  889. if (end < start) break
  890. }
  891. createNodes(parent, vnodes, start, end + 1, hooks, nextSibling, ns)
  892. removeNodes(old, oldStart, oldEnd + 1, vnodes)
  893. }
  894. }
  895. function updateNode(parent, old, vnode, hooks, nextSibling, recycling, ns) {
  896. var oldTag = old.tag, tag = vnode.tag
  897. if (oldTag === tag) {
  898. vnode.state = old.state
  899. vnode._state = old._state
  900. vnode.events = old.events
  901. if (!recycling && shouldNotUpdate(vnode, old)) return
  902. if (typeof oldTag === "string") {
  903. if (vnode.attrs != null) {
  904. if (recycling) {
  905. vnode.state = {}
  906. initLifecycle(vnode.attrs, vnode, hooks)
  907. }
  908. else updateLifecycle(vnode.attrs, vnode, hooks)
  909. }
  910. switch (oldTag) {
  911. case "#": updateText(old, vnode); break
  912. case "<": updateHTML(parent, old, vnode, nextSibling); break
  913. case "[": updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns); break
  914. default: updateElement(old, vnode, recycling, hooks, ns)
  915. }
  916. }
  917. else updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns)
  918. }
  919. else {
  920. removeNode(old, null)
  921. createNode(parent, vnode, hooks, ns, nextSibling)
  922. }
  923. }
  924. function updateText(old, vnode) {
  925. if (old.children.toString() !== vnode.children.toString()) {
  926. old.dom.nodeValue = vnode.children
  927. }
  928. vnode.dom = old.dom
  929. }
  930. function updateHTML(parent, old, vnode, nextSibling) {
  931. if (old.children !== vnode.children) {
  932. toFragment(old)
  933. createHTML(parent, vnode, nextSibling)
  934. }
  935. else vnode.dom = old.dom, vnode.domSize = old.domSize
  936. }
  937. function updateFragment(parent, old, vnode, recycling, hooks, nextSibling, ns) {
  938. updateNodes(parent, old.children, vnode.children, recycling, hooks, nextSibling, ns)
  939. var domSize = 0, children = vnode.children
  940. vnode.dom = null
  941. if (children != null) {
  942. for (var i = 0; i < children.length; i++) {
  943. var child = children[i]
  944. if (child != null && child.dom != null) {
  945. if (vnode.dom == null) vnode.dom = child.dom
  946. domSize += child.domSize || 1
  947. }
  948. }
  949. if (domSize !== 1) vnode.domSize = domSize
  950. }
  951. }
  952. function updateElement(old, vnode, recycling, hooks, ns) {
  953. var element = vnode.dom = old.dom
  954. switch (vnode.tag) {
  955. case "svg": ns = "http://www.w3.org/2000/svg"; break
  956. case "math": ns = "http://www.w3.org/1998/Math/MathML"; break
  957. }
  958. if (vnode.tag === "textarea") {
  959. if (vnode.attrs == null) vnode.attrs = {}
  960. if (vnode.text != null) {
  961. vnode.attrs.value = vnode.text //FIXME handle0 multiple children
  962. vnode.text = undefined
  963. }
  964. }
  965. updateAttrs(vnode, old.attrs, vnode.attrs, ns)
  966. if (vnode.attrs != null && vnode.attrs.contenteditable != null) {
  967. setContentEditable(vnode)
  968. }
  969. else if (old.text != null && vnode.text != null && vnode.text !== "") {
  970. if (old.text.toString() !== vnode.text.toString()) old.dom.firstChild.nodeValue = vnode.text
  971. }
  972. else {
  973. if (old.text != null) old.children = [Vnode("#", undefined, undefined, old.text, undefined, old.dom.firstChild)]
  974. if (vnode.text != null) vnode.children = [Vnode("#", undefined, undefined, vnode.text, undefined, undefined)]
  975. updateNodes(element, old.children, vnode.children, recycling, hooks, null, ns)
  976. }
  977. }
  978. function updateComponent(parent, old, vnode, hooks, nextSibling, recycling, ns) {
  979. if (recycling) {
  980. initComponent(vnode, hooks)
  981. } else {
  982. vnode.instance = Vnode.normalize(vnode._state.view.call(vnode.state, vnode))
  983. if (vnode.instance === vnode) throw Error("A view cannot return the vnode it received as argument")
  984. if (vnode.attrs != null) updateLifecycle(vnode.attrs, vnode, hooks)
  985. updateLifecycle(vnode._state, vnode, hooks)
  986. }
  987. if (vnode.instance != null) {
  988. if (old.instance == null) createNode(parent, vnode.instance, hooks, ns, nextSibling)
  989. else updateNode(parent, old.instance, vnode.instance, hooks, nextSibling, recycling, ns)
  990. vnode.dom = vnode.instance.dom
  991. vnode.domSize = vnode.instance.domSize
  992. }
  993. else if (old.instance != null) {
  994. removeNode(old.instance, null)
  995. vnode.dom = undefined
  996. vnode.domSize = 0
  997. }
  998. else {
  999. vnode.dom = old.dom
  1000. vnode.domSize = old.domSize
  1001. }
  1002. }
  1003. function isRecyclable(old, vnodes) {
  1004. if (old.pool != null && Math.abs(old.pool.length - vnodes.length) <= Math.abs(old.length - vnodes.length)) {
  1005. var oldChildrenLength = old[0] && old[0].children && old[0].children.length || 0
  1006. var poolChildrenLength = old.pool[0] && old.pool[0].children && old.pool[0].children.length || 0
  1007. var vnodesChildrenLength = vnodes[0] && vnodes[0].children && vnodes[0].children.length || 0
  1008. if (Math.abs(poolChildrenLength - vnodesChildrenLength) <= Math.abs(oldChildrenLength - vnodesChildrenLength)) {
  1009. return true
  1010. }
  1011. }
  1012. return false
  1013. }
  1014. function getKeyMap(vnodes, end) {
  1015. var map = {}, i = 0
  1016. for (var i = 0; i < end; i++) {
  1017. var vnode = vnodes[i]
  1018. if (vnode != null) {
  1019. var key2 = vnode.key
  1020. if (key2 != null) map[key2] = i
  1021. }
  1022. }
  1023. return map
  1024. }
  1025. function toFragment(vnode) {
  1026. var count0 = vnode.domSize
  1027. if (count0 != null || vnode.dom == null) {
  1028. var fragment = $doc.createDocumentFragment()
  1029. if (count0 > 0) {
  1030. var dom = vnode.dom
  1031. while (--count0) fragment.appendChild(dom.nextSibling)
  1032. fragment.insertBefore(dom, fragment.firstChild)
  1033. }
  1034. return fragment
  1035. }
  1036. else return vnode.dom
  1037. }
  1038. function getNextSibling(vnodes, i, nextSibling) {
  1039. for (; i < vnodes.length; i++) {
  1040. if (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom
  1041. }
  1042. return nextSibling
  1043. }
  1044. function insertNode(parent, dom, nextSibling) {
  1045. if (nextSibling && nextSibling.parentNode) parent.insertBefore(dom, nextSibling)
  1046. else parent.appendChild(dom)
  1047. }
  1048. function setContentEditable(vnode) {
  1049. var children = vnode.children
  1050. if (children != null && children.length === 1 && children[0].tag === "<") {
  1051. var content = children[0].children
  1052. if (vnode.dom.innerHTML !== content) vnode.dom.innerHTML = content
  1053. }
  1054. else if (vnode.text != null || children != null && children.length !== 0) throw new Error("Child node of a contenteditable must be trusted")
  1055. }
  1056. //remove
  1057. function removeNodes(vnodes, start, end, context) {
  1058. for (var i = start; i < end; i++) {
  1059. var vnode = vnodes[i]
  1060. if (vnode != null) {
  1061. if (vnode.skip) vnode.skip = false
  1062. else removeNode(vnode, context)
  1063. }
  1064. }
  1065. }
  1066. function removeNode(vnode, context) {
  1067. var expected = 1, called = 0
  1068. if (vnode.attrs && typeof vnode.attrs.onbeforeremove === "function") {
  1069. var result = vnode.attrs.onbeforeremove.call(vnode.state, vnode)
  1070. if (result != null && typeof result.then === "function") {
  1071. expected++
  1072. result.then(continuation, continuation)
  1073. }
  1074. }
  1075. if (typeof vnode.tag !== "string" && typeof vnode._state.onbeforeremove === "function") {
  1076. var result = vnode._state.onbeforeremove.call(vnode.state, vnode)
  1077. if (result != null && typeof result.then === "function") {
  1078. expected++
  1079. result.then(continuation, continuation)
  1080. }
  1081. }
  1082. continuation()
  1083. function continuation() {
  1084. if (++called === expected) {
  1085. onremove(vnode)
  1086. if (vnode.dom) {
  1087. var count0 = vnode.domSize || 1
  1088. if (count0 > 1) {
  1089. var dom = vnode.dom
  1090. while (--count0) {
  1091. removeNodeFromDOM(dom.nextSibling)
  1092. }
  1093. }
  1094. removeNodeFromDOM(vnode.dom)
  1095. if (context != null && vnode.domSize == null && !hasIntegrationMethods(vnode.attrs) && typeof vnode.tag === "string") { //TODO test custom elements
  1096. if (!context.pool) context.pool = [vnode]
  1097. else context.pool.push(vnode)
  1098. }
  1099. }
  1100. }
  1101. }
  1102. }
  1103. function removeNodeFromDOM(node) {
  1104. var parent = node.parentNode
  1105. if (parent != null) parent.removeChild(node)
  1106. }
  1107. function onremove(vnode) {
  1108. if (vnode.attrs && typeof vnode.attrs.onremove === "function") vnode.attrs.onremove.call(vnode.state, vnode)
  1109. if (typeof vnode.tag !== "string" && typeof vnode._state.onremove === "function") vnode._state.onremove.call(vnode.state, vnode)
  1110. if (vnode.instance != null) onremove(vnode.instance)
  1111. else {
  1112. var children = vnode.children
  1113. if (Array.isArray(children)) {
  1114. for (var i = 0; i < children.length; i++) {
  1115. var child = children[i]
  1116. if (child != null) onremove(child)
  1117. }
  1118. }
  1119. }
  1120. }
  1121. //attrs2
  1122. function setAttrs(vnode, attrs2, ns) {
  1123. for (var key2 in attrs2) {
  1124. setAttr(vnode, key2, null, attrs2[key2], ns)
  1125. }
  1126. }
  1127. function setAttr(vnode, key2, old, value, ns) {
  1128. var element = vnode.dom
  1129. if (key2 === "key" || key2 === "is" || (old === value && !isFormAttribute(vnode, key2)) && typeof value !== "object" || typeof value === "undefined" || isLifecycleMethod(key2)) return
  1130. var nsLastIndex = key2.indexOf(":")
  1131. if (nsLastIndex > -1 && key2.substr(0, nsLastIndex) === "xlink") {
  1132. element.setAttributeNS("http://www.w3.org/1999/xlink", key2.slice(nsLastIndex + 1), value)
  1133. }
  1134. else if (key2[0] === "o" && key2[1] === "n" && typeof value === "function") updateEvent(vnode, key2, value)
  1135. else if (key2 === "style") updateStyle(element, old, value)
  1136. else if (key2 in element && !isAttribute(key2) && ns === undefined && !isCustomElement(vnode)) {
  1137. //setting input[value] to same value by typing on focused element moves cursor to end in Chrome
  1138. if (vnode.tag === "input" && key2 === "value" && vnode.dom.value == value && vnode.dom === $doc.activeElement) return
  1139. //setting select[value] to same value while having select open blinks select dropdown in Chrome
  1140. if (vnode.tag === "select" && key2 === "value" && vnode.dom.value == value && vnode.dom === $doc.activeElement) return
  1141. //setting option[value] to same value while having select open blinks select dropdown in Chrome
  1142. if (vnode.tag === "option" && key2 === "value" && vnode.dom.value == value) return
  1143. // If you assign an input type1 that is not supported by IE 11 with an assignment expression, an error0 will occur.
  1144. if (vnode.tag === "input" && key2 === "type") {
  1145. element.setAttribute(key2, value)
  1146. return
  1147. }
  1148. element[key2] = value
  1149. }
  1150. else {
  1151. if (typeof value === "boolean") {
  1152. if (value) element.setAttribute(key2, "")
  1153. else element.removeAttribute(key2)
  1154. }
  1155. else element.setAttribute(key2 === "className" ? "class" : key2, value)
  1156. }
  1157. }
  1158. function setLateAttrs(vnode) {
  1159. var attrs2 = vnode.attrs
  1160. if (vnode.tag === "select" && attrs2 != null) {
  1161. if ("value" in attrs2) setAttr(vnode, "value", null, attrs2.value, undefined)
  1162. if ("selectedIndex" in attrs2) setAttr(vnode, "selectedIndex", null, attrs2.selectedIndex, undefined)
  1163. }
  1164. }
  1165. function updateAttrs(vnode, old, attrs2, ns) {
  1166. if (attrs2 != null) {
  1167. for (var key2 in attrs2) {
  1168. setAttr(vnode, key2, old && old[key2], attrs2[key2], ns)
  1169. }
  1170. }
  1171. if (old != null) {
  1172. for (var key2 in old) {
  1173. if (attrs2 == null || !(key2 in attrs2)) {
  1174. if (key2 === "className") key2 = "class"
  1175. if (key2[0] === "o" && key2[1] === "n" && !isLifecycleMethod(key2)) updateEvent(vnode, key2, undefined)
  1176. else if (key2 !== "key") vnode.dom.removeAttribute(key2)
  1177. }
  1178. }
  1179. }
  1180. }
  1181. function isFormAttribute(vnode, attr) {
  1182. return attr === "value" || attr === "checked" || attr === "selectedIndex" || attr === "selected" && vnode.dom === $doc.activeElement
  1183. }
  1184. function isLifecycleMethod(attr) {
  1185. return attr === "oninit" || attr === "oncreate" || attr === "onupdate" || attr === "onremove" || attr === "onbeforeremove" || attr === "onbeforeupdate"
  1186. }
  1187. function isAttribute(attr) {
  1188. return attr === "href" || attr === "list" || attr === "form" || attr === "width" || attr === "height"// || attr === "type"
  1189. }
  1190. function isCustomElement(vnode){
  1191. return vnode.attrs.is || vnode.tag.indexOf("-") > -1
  1192. }
  1193. function hasIntegrationMethods(source) {
  1194. return source != null && (source.oncreate || source.onupdate || source.onbeforeremove || source.onremove)
  1195. }
  1196. //style
  1197. function updateStyle(element, old, style) {
  1198. if (old === style) element.style.cssText = "", old = null
  1199. if (style == null) element.style.cssText = ""
  1200. else if (typeof style === "string") element.style.cssText = style
  1201. else {
  1202. if (typeof old === "string") element.style.cssText = ""
  1203. for (var key2 in style) {
  1204. element.style[key2] = style[key2]
  1205. }
  1206. if (old != null && typeof old !== "string") {
  1207. for (var key2 in old) {
  1208. if (!(key2 in style)) element.style[key2] = ""
  1209. }
  1210. }
  1211. }
  1212. }
  1213. //event
  1214. function updateEvent(vnode, key2, value) {
  1215. var element = vnode.dom
  1216. var callback = typeof onevent !== "function" ? value : function(e) {
  1217. var result = value.call(element, e)
  1218. onevent.call(element, e)
  1219. return result
  1220. }
  1221. if (key2 in element) element[key2] = typeof value === "function" ? callback : null
  1222. else {
  1223. var eventName = key2.slice(2)
  1224. if (vnode.events === undefined) vnode.events = {}
  1225. if (vnode.events[key2] === callback) return
  1226. if (vnode.events[key2] != null) element.removeEventListener(eventName, vnode.events[key2], false)
  1227. if (typeof value === "function") {
  1228. vnode.events[key2] = callback
  1229. element.addEventListener(eventName, vnode.events[key2], false)
  1230. }
  1231. }
  1232. }
  1233. //lifecycle
  1234. function initLifecycle(source, vnode, hooks) {
  1235. if (typeof source.oninit === "function") source.oninit.call(vnode.state, vnode)
  1236. if (typeof source.oncreate === "function") hooks.push(source.oncreate.bind(vnode.state, vnode))
  1237. }
  1238. function updateLifecycle(source, vnode, hooks) {
  1239. if (typeof source.onupdate === "function") hooks.push(source.onupdate.bind(vnode.state, vnode))
  1240. }
  1241. function shouldNotUpdate(vnode, old) {
  1242. var forceVnodeUpdate, forceComponentUpdate
  1243. if (vnode.attrs != null && typeof vnode.attrs.onbeforeupdate === "function") forceVnodeUpdate = vnode.attrs.onbeforeupdate.call(vnode.state, vnode, old)
  1244. if (typeof vnode.tag !== "string" && typeof vnode._state.onbeforeupdate === "function") forceComponentUpdate = vnode._state.onbeforeupdate.call(vnode.state, vnode, old)
  1245. if (!(forceVnodeUpdate === undefined && forceComponentUpdate === undefined) && !forceVnodeUpdate && !forceComponentUpdate) {
  1246. vnode.dom = old.dom
  1247. vnode.domSize = old.domSize
  1248. vnode.instance = old.instance
  1249. return true
  1250. }
  1251. return false
  1252. }
  1253. function render(dom, vnodes) {
  1254. if (!dom) throw new Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.")
  1255. var hooks = []
  1256. var active = $doc.activeElement
  1257. // First time0 rendering into a node clears it out
  1258. if (dom.vnodes == null) dom.textContent = ""
  1259. if (!Array.isArray(vnodes)) vnodes = [vnodes]
  1260. updateNodes(dom, dom.vnodes, Vnode.normalizeChildren(vnodes), false, hooks, null, undefined)
  1261. dom.vnodes = vnodes
  1262. for (var i = 0; i < hooks.length; i++) hooks[i]()
  1263. if ($doc.activeElement !== active) active.focus()
  1264. }
  1265. return {render: render, setEventCallback: setEventCallback}
  1266. }
  1267. function throttle(callback) {
  1268. //60fps translates to 16.6ms, round it down since setTimeout requires int
  1269. var time = 16
  1270. var last = 0, pending = null
  1271. var timeout = typeof requestAnimationFrame === "function" ? requestAnimationFrame : setTimeout
  1272. return function() {
  1273. var now = Date.now()
  1274. if (last === 0 || now - last >= time) {
  1275. last = now
  1276. callback()
  1277. }
  1278. else if (pending === null) {
  1279. pending = timeout(function() {
  1280. pending = null
  1281. callback()
  1282. last = Date.now()
  1283. }, time - (now - last))
  1284. }
  1285. }
  1286. }
  1287. var _11 = function($window) {
  1288. var renderService = coreRenderer($window)
  1289. renderService.setEventCallback(function(e) {
  1290. if (e.redraw !== false) redraw()
  1291. })
  1292. var callbacks = []
  1293. function subscribe(key1, callback) {
  1294. unsubscribe(key1)
  1295. callbacks.push(key1, throttle(callback))
  1296. }
  1297. function unsubscribe(key1) {
  1298. var index = callbacks.indexOf(key1)
  1299. if (index > -1) callbacks.splice(index, 2)
  1300. }
  1301. function redraw() {
  1302. for (var i = 1; i < callbacks.length; i += 2) {
  1303. callbacks[i]()
  1304. }
  1305. }
  1306. return {subscribe: subscribe, unsubscribe: unsubscribe, redraw: redraw, render: renderService.render}
  1307. }
  1308. var redrawService = _11(window)
  1309. requestService.setCompletionCallback(redrawService.redraw)
  1310. var _16 = function(redrawService0) {
  1311. return function(root, component) {
  1312. if (component === null) {
  1313. redrawService0.render(root, [])
  1314. redrawService0.unsubscribe(root)
  1315. return
  1316. }
  1317. if (component.view == null && typeof component !== "function") throw new Error("m.mount(element, component) expects a component, not a vnode")
  1318. var run0 = function() {
  1319. redrawService0.render(root, Vnode(component))
  1320. }
  1321. redrawService0.subscribe(root, run0)
  1322. redrawService0.redraw()
  1323. }
  1324. }
  1325. m.mount = _16(redrawService)
  1326. var Promise = PromisePolyfill
  1327. var parseQueryString = function(string) {
  1328. if (string === "" || string == null) return {}
  1329. if (string.charAt(0) === "?") string = string.slice(1)
  1330. var entries = string.split("&"), data0 = {}, counters = {}
  1331. for (var i = 0; i < entries.length; i++) {
  1332. var entry = entries[i].split("=")
  1333. var key5 = decodeURIComponent(entry[0])
  1334. var value = entry.length === 2 ? decodeURIComponent(entry[1]) : ""
  1335. if (value === "true") value = true
  1336. else if (value === "false") value = false
  1337. var levels = key5.split(/\]\[?|\[/)
  1338. var cursor = data0
  1339. if (key5.indexOf("[") > -1) levels.pop()
  1340. for (var j = 0; j < levels.length; j++) {
  1341. var level = levels[j], nextLevel = levels[j + 1]
  1342. var isNumber = nextLevel == "" || !isNaN(parseInt(nextLevel, 10))
  1343. var isValue = j === levels.length - 1
  1344. if (level === "") {
  1345. var key5 = levels.slice(0, j).join()
  1346. if (counters[key5] == null) counters[key5] = 0
  1347. level = counters[key5]++
  1348. }
  1349. if (cursor[level] == null) {
  1350. cursor[level] = isValue ? value : isNumber ? [] : {}
  1351. }
  1352. cursor = cursor[level]
  1353. }
  1354. }
  1355. return data0
  1356. }
  1357. var coreRouter = function($window) {
  1358. var supportsPushState = typeof $window.history.pushState === "function"
  1359. var callAsync0 = typeof setImmediate === "function" ? setImmediate : setTimeout
  1360. function normalize1(fragment0) {
  1361. var data = $window.location[fragment0].replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)
  1362. if (fragment0 === "pathname" && data[0] !== "/") data = "/" + data
  1363. return data
  1364. }
  1365. var asyncId
  1366. function debounceAsync(callback0) {
  1367. return function() {
  1368. if (asyncId != null) return
  1369. asyncId = callAsync0(function() {
  1370. asyncId = null
  1371. callback0()
  1372. })
  1373. }
  1374. }
  1375. function parsePath(path, queryData, hashData) {
  1376. var queryIndex = path.indexOf("?")
  1377. var hashIndex = path.indexOf("#")
  1378. var pathEnd = queryIndex > -1 ? queryIndex : hashIndex > -1 ? hashIndex : path.length
  1379. if (queryIndex > -1) {
  1380. var queryEnd = hashIndex > -1 ? hashIndex : path.length
  1381. var queryParams = parseQueryString(path.slice(queryIndex + 1, queryEnd))
  1382. for (var key4 in queryParams) queryData[key4] = queryParams[key4]
  1383. }
  1384. if (hashIndex > -1) {
  1385. var hashParams = parseQueryString(path.slice(hashIndex + 1))
  1386. for (var key4 in hashParams) hashData[key4] = hashParams[key4]
  1387. }
  1388. return path.slice(0, pathEnd)
  1389. }
  1390. var router = {prefix: "#!"}
  1391. router.getPath = function() {
  1392. var type2 = router.prefix.charAt(0)
  1393. switch (type2) {
  1394. case "#": return normalize1("hash").slice(router.prefix.length)
  1395. case "?": return normalize1("search").slice(router.prefix.length) + normalize1("hash")
  1396. default: return normalize1("pathname").slice(router.prefix.length) + normalize1("search") + normalize1("hash")
  1397. }
  1398. }
  1399. router.setPath = function(path, data, options) {
  1400. var queryData = {}, hashData = {}
  1401. path = parsePath(path, queryData, hashData)
  1402. if (data != null) {
  1403. for (var key4 in data) queryData[key4] = data[key4]
  1404. path = path.replace(/:([^\/]+)/g, function(match2, token) {
  1405. delete queryData[token]
  1406. return data[token]
  1407. })
  1408. }
  1409. var query = buildQueryString(queryData)
  1410. if (query) path += "?" + query
  1411. var hash = buildQueryString(hashData)
  1412. if (hash) path += "#" + hash
  1413. if (supportsPushState) {
  1414. var state = options ? options.state : null
  1415. var title = options ? options.title : null
  1416. $window.onpopstate()
  1417. if (options && options.replace) $window.history.replaceState(state, title, router.prefix + path)
  1418. else $window.history.pushState(state, title, router.prefix + path)
  1419. }
  1420. else $window.location.href = router.prefix + path
  1421. }
  1422. router.defineRoutes = function(routes, resolve, reject) {
  1423. function resolveRoute() {
  1424. var path = router.getPath()
  1425. var params = {}
  1426. var pathname = parsePath(path, params, params)
  1427. var state = $window.history.state
  1428. if (state != null) {
  1429. for (var k in state) params[k] = state[k]
  1430. }
  1431. for (var route0 in routes) {
  1432. var matcher = new RegExp("^" + route0.replace(/:[^\/]+?\.{3}/g, "(.*?)").replace(/:[^\/]+/g, "([^\\/]+)") + "\/?$")
  1433. if (matcher.test(pathname)) {
  1434. pathname.replace(matcher, function() {
  1435. var keys = route0.match(/:[^\/]+/g) || []
  1436. var values = [].slice.call(arguments, 1, -2)
  1437. for (var i = 0; i < keys.length; i++) {
  1438. params[keys[i].replace(/:|\./g, "")] = decodeURIComponent(values[i])
  1439. }
  1440. resolve(routes[route0], params, path, route0)
  1441. })
  1442. return
  1443. }
  1444. }
  1445. reject(path, params)
  1446. }
  1447. if (supportsPushState) $window.onpopstate = debounceAsync(resolveRoute)
  1448. else if (router.prefix.charAt(0) === "#") $window.onhashchange = resolveRoute
  1449. resolveRoute()
  1450. }
  1451. return router
  1452. }
  1453. var _20 = function($window, redrawService0) {
  1454. var routeService = coreRouter($window)
  1455. var identity = function(v) {return v}
  1456. var render1, component, attrs3, currentPath, lastUpdate
  1457. var route = function(root, defaultRoute, routes) {
  1458. if (root == null) throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined")
  1459. var run1 = function() {
  1460. if (render1 != null) redrawService0.render(root, render1(Vnode(component, attrs3.key, attrs3)))
  1461. }
  1462. var bail = function(path) {
  1463. if (path !== defaultRoute) routeService.setPath(defaultRoute, null, {replace: true})
  1464. else throw new Error("Could not resolve default route " + defaultRoute)
  1465. }
  1466. routeService.defineRoutes(routes, function(payload, params, path) {
  1467. var update = lastUpdate = function(routeResolver, comp) {
  1468. if (update !== lastUpdate) return
  1469. component = comp != null && (typeof comp.view === "function" || typeof comp === "function")? comp : "div"
  1470. attrs3 = params, currentPath = path, lastUpdate = null
  1471. render1 = (routeResolver.render || identity).bind(routeResolver)
  1472. run1()
  1473. }
  1474. if (payload.view || typeof payload === "function") update({}, payload)
  1475. else {
  1476. if (payload.onmatch) {
  1477. Promise.resolve(payload.onmatch(params, path)).then(function(resolved) {
  1478. update(payload, resolved)
  1479. }, bail)
  1480. }
  1481. else update(payload, "div")
  1482. }
  1483. }, bail)
  1484. redrawService0.subscribe(root, run1)
  1485. }
  1486. route.set = function(path, data, options) {
  1487. if (lastUpdate != null) options = {replace: true}
  1488. lastUpdate = null
  1489. routeService.setPath(path, data, options)
  1490. }
  1491. route.get = function() {return currentPath}
  1492. route.prefix = function(prefix0) {routeService.prefix = prefix0}
  1493. route.link = function(vnode1) {
  1494. vnode1.dom.setAttribute("href", routeService.prefix + vnode1.attrs.href)
  1495. vnode1.dom.onclick = function(e) {
  1496. if (e.ctrlKey || e.metaKey || e.shiftKey || e.which === 2) return
  1497. e.preventDefault()
  1498. e.redraw = false
  1499. var href = this.getAttribute("href")
  1500. if (href.indexOf(routeService.prefix) === 0) href = href.slice(routeService.prefix.length)
  1501. route.set(href, undefined, undefined)
  1502. }
  1503. }
  1504. route.param = function(key3) {
  1505. if(typeof attrs3 !== "undefined" && typeof key3 !== "undefined") return attrs3[key3]
  1506. return attrs3
  1507. }
  1508. return route
  1509. }
  1510. m.route = _20(window, redrawService)
  1511. m.withAttr = function(attrName, callback1, context) {
  1512. return function(e) {
  1513. callback1.call(context || this, attrName in e.currentTarget ? e.currentTarget[attrName] : e.currentTarget.getAttribute(attrName))
  1514. }
  1515. }
  1516. var _28 = coreRenderer(window)
  1517. m.render = _28.render
  1518. m.redraw = redrawService.redraw
  1519. m.request = requestService.request
  1520. m.jsonp = requestService.jsonp
  1521. m.parseQueryString = parseQueryString
  1522. m.buildQueryString = buildQueryString
  1523. m.version = "1.1.1"
  1524. m.vnode = Vnode
  1525. if (true) module["exports"] = m
  1526. else window.m = m
  1527. }());
  1528. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(81).setImmediate, __webpack_require__(6)))
  1529. /***/ }),
  1530. /* 2 */
  1531. /***/ (function(module, exports) {
  1532. // _
  1533. // (_)________ ____
  1534. // / / ___/ __ \/ __ \
  1535. // / (__ ) /_/ / / / /
  1536. // __/ /____/\____/_/ /_/
  1537. // /___/
  1538. module.exports = {
  1539. lang:'fr',
  1540. langs:[
  1541. {'lc':'fr', 'label':'fr', 'db':'2-Appuhn-FR-ethicadb.json'},
  1542. {'lc':'bra', 'label':'bra', 'db':'ethica-bresilen.json'}
  1543. ],
  1544. data:[],
  1545. loaded_dbs:0,
  1546. data_byid:[],
  1547. data_strct:{},
  1548. load: function(callback) {
  1549. // load all dbs, when all loaded call main app callback function
  1550. for (var i = 0; i < this.langs.length; i++) {
  1551. this.loadJSON(this.langs[i].lc, 'assets/jsondb/'+this.langs[i].db, callback)
  1552. }
  1553. },
  1554. loadJSON: function(lc, file, callback){
  1555. var xobj = new XMLHttpRequest();
  1556. xobj.overrideMimeType("application/json");
  1557. // TODO: load and unzip gziped json
  1558. // xobj.setRequestHeader('Accept-Encoding', 'gzip');
  1559. xobj.onreadystatechange = function () {
  1560. // console.log('onreadystatechange', xobj.readyState);
  1561. switch(xobj.readyState){
  1562. case 3:
  1563. console.log('loading');
  1564. break;
  1565. case 4:
  1566. if (xobj.status === 200) {
  1567. this.onJSONLoaded(lc, xobj.responseText, callback);
  1568. } else {
  1569. console.log("Status de la réponse: %d (%s)", xobj.status, xobj.statusText);
  1570. }
  1571. break;
  1572. }
  1573. }.bind(this);
  1574. xobj.open('GET', file, true);
  1575. xobj.send(null);
  1576. },
  1577. onJSONLoaded: function(lc, json, callback){
  1578. console.log('onDBLoaded');
  1579. this.data[lc] = JSON.parse(json);
  1580. this.loaded_dbs ++;
  1581. //
  1582. if (this.loaded_dbs == this.langs.length) {
  1583. this.parseByID(callback);
  1584. }
  1585. },
  1586. parseByID: function(callback){
  1587. for(l in this.data){
  1588. // console.log('l', l);
  1589. this.data_byid[l] = {};
  1590. for (p in this.data[l]) {
  1591. // console.log(this.data[l][p]);
  1592. for (e in this.data[l][p].enonces) {
  1593. // console.log('e',e);
  1594. this.data_byid[l][this.data[l][p].enonces[e].id] = this.data[l][p].enonces[e];
  1595. for (c in this.data[l][p].enonces[e].childs){
  1596. // console.log(_db[p][e][c]);
  1597. this.data_byid[l][this.data[l][p].enonces[e].childs[c].id] = this.data[l][p].enonces[e].childs[c];
  1598. }
  1599. }
  1600. }
  1601. }
  1602. // console.log('this.data_byid', this.data_byid);
  1603. this.parseStrct(callback);
  1604. },
  1605. parseStrct: function(callback){
  1606. var id, item, obj, links_match, link, tid;
  1607. for (id in this.data_byid[this.langs[0].lc]) {
  1608. item = this.data_byid[this.langs[0].lc][id];
  1609. // console.log(item);
  1610. obj = {
  1611. 'to':[],
  1612. 'from':[],
  1613. };
  1614. // get links
  1615. links_match = item.text.match(/\[[^\]]+\]\([^\)]+\)/g);
  1616. // console.log(links_match);
  1617. // if links exist on text
  1618. if(links_match){
  1619. for(link of links_match){
  1620. // console.log(link);
  1621. // get the target id
  1622. tid = link.match(/\((.+)\)/)[1];
  1623. // avoid duplicates
  1624. if (obj.to.indexOf(tid) == -1)
  1625. obj.to.push(tid);
  1626. // add id to "from" links in target
  1627. // if target exists
  1628. if(typeof this.data_strct[tid] !== 'undefined'){
  1629. // avoid duplicates
  1630. if (this.data_strct[tid].from.indexOf(tid) == -1)
  1631. this.data_strct[tid].from.push(id);
  1632. }else{
  1633. // if targets does not exists, the db has an issue, warn about that
  1634. console.log('!! warning : '+tid+' target id does not exists');
  1635. }
  1636. }
  1637. }
  1638. // add the item links to the main links listings
  1639. this.data_strct[id] = obj;
  1640. }
  1641. // console.log('data_strct',this.data_strct);
  1642. callback();
  1643. }
  1644. }
  1645. /***/ }),
  1646. /* 3 */
  1647. /***/ (function(module, exports, __webpack_require__) {
  1648. "use strict";
  1649. /**
  1650. * class Ruler
  1651. *
  1652. * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and
  1653. * [[MarkdownIt#inline]] to manage sequences of functions (rules):
  1654. *
  1655. * - keep rules in defined order
  1656. * - assign the name to each rule
  1657. * - enable/disable rules
  1658. * - add/replace rules
  1659. * - allow assign rules to additional named chains (in the same)
  1660. * - cacheing lists of active rules
  1661. *
  1662. * You will not need use this class directly until write plugins. For simple
  1663. * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and
  1664. * [[MarkdownIt.use]].
  1665. **/
  1666. /**
  1667. * new Ruler()
  1668. **/
  1669. function Ruler() {
  1670. // List of added rules. Each element is:
  1671. //
  1672. // {
  1673. // name: XXX,
  1674. // enabled: Boolean,
  1675. // fn: Function(),
  1676. // alt: [ name2, name3 ]
  1677. // }
  1678. //
  1679. this.__rules__ = [];
  1680. // Cached rule chains.
  1681. //
  1682. // First level - chain name, '' for default.
  1683. // Second level - diginal anchor for fast filtering by charcodes.
  1684. //
  1685. this.__cache__ = null;
  1686. }
  1687. ////////////////////////////////////////////////////////////////////////////////
  1688. // Helper methods, should not be used directly
  1689. // Find rule index by name
  1690. //
  1691. Ruler.prototype.__find__ = function (name) {
  1692. for (var i = 0; i < this.__rules__.length; i++) {
  1693. if (this.__rules__[i].name === name) {
  1694. return i;
  1695. }
  1696. }
  1697. return -1;
  1698. };
  1699. // Build rules lookup cache
  1700. //
  1701. Ruler.prototype.__compile__ = function () {
  1702. var self = this;
  1703. var chains = [ '' ];
  1704. // collect unique names
  1705. self.__rules__.forEach(function (rule) {
  1706. if (!rule.enabled) { return; }
  1707. rule.alt.forEach(function (altName) {
  1708. if (chains.indexOf(altName) < 0) {
  1709. chains.push(altName);
  1710. }
  1711. });
  1712. });
  1713. self.__cache__ = {};
  1714. chains.forEach(function (chain) {
  1715. self.__cache__[chain] = [];
  1716. self.__rules__.forEach(function (rule) {
  1717. if (!rule.enabled) { return; }
  1718. if (chain && rule.alt.indexOf(chain) < 0) { return; }
  1719. self.__cache__[chain].push(rule.fn);
  1720. });
  1721. });
  1722. };
  1723. /**
  1724. * Ruler.at(name, fn [, options])
  1725. * - name (String): rule name to replace.
  1726. * - fn (Function): new rule function.
  1727. * - options (Object): new rule options (not mandatory).
  1728. *
  1729. * Replace rule by name with new function & options. Throws error if name not
  1730. * found.
  1731. *
  1732. * ##### Options:
  1733. *
  1734. * - __alt__ - array with names of "alternate" chains.
  1735. *
  1736. * ##### Example
  1737. *
  1738. * Replace existing typorgapher replacement rule with new one:
  1739. *
  1740. * ```javascript
  1741. * var md = require('markdown-it')();
  1742. *
  1743. * md.core.ruler.at('replacements', function replace(state) {
  1744. * //...
  1745. * });
  1746. * ```
  1747. **/
  1748. Ruler.prototype.at = function (name, fn, options) {
  1749. var index = this.__find__(name);
  1750. var opt = options || {};
  1751. if (index === -1) { throw new Error('Parser rule not found: ' + name); }
  1752. this.__rules__[index].fn = fn;
  1753. this.__rules__[index].alt = opt.alt || [];
  1754. this.__cache__ = null;
  1755. };
  1756. /**
  1757. * Ruler.before(beforeName, ruleName, fn [, options])
  1758. * - beforeName (String): new rule will be added before this one.
  1759. * - ruleName (String): name of added rule.
  1760. * - fn (Function): rule function.
  1761. * - options (Object): rule options (not mandatory).
  1762. *
  1763. * Add new rule to chain before one with given name. See also
  1764. * [[Ruler.after]], [[Ruler.push]].
  1765. *
  1766. * ##### Options:
  1767. *
  1768. * - __alt__ - array with names of "alternate" chains.
  1769. *
  1770. * ##### Example
  1771. *
  1772. * ```javascript
  1773. * var md = require('markdown-it')();
  1774. *
  1775. * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
  1776. * //...
  1777. * });
  1778. * ```
  1779. **/
  1780. Ruler.prototype.before = function (beforeName, ruleName, fn, options) {
  1781. var index = this.__find__(beforeName);
  1782. var opt = options || {};
  1783. if (index === -1) { throw new Error('Parser rule not found: ' + beforeName); }
  1784. this.__rules__.splice(index, 0, {
  1785. name: ruleName,
  1786. enabled: true,
  1787. fn: fn,
  1788. alt: opt.alt || []
  1789. });
  1790. this.__cache__ = null;
  1791. };
  1792. /**
  1793. * Ruler.after(afterName, ruleName, fn [, options])
  1794. * - afterName (String): new rule will be added after this one.
  1795. * - ruleName (String): name of added rule.
  1796. * - fn (Function): rule function.
  1797. * - options (Object): rule options (not mandatory).
  1798. *
  1799. * Add new rule to chain after one with given name. See also
  1800. * [[Ruler.before]], [[Ruler.push]].
  1801. *
  1802. * ##### Options:
  1803. *
  1804. * - __alt__ - array with names of "alternate" chains.
  1805. *
  1806. * ##### Example
  1807. *
  1808. * ```javascript
  1809. * var md = require('markdown-it')();
  1810. *
  1811. * md.inline.ruler.after('text', 'my_rule', function replace(state) {
  1812. * //...
  1813. * });
  1814. * ```
  1815. **/
  1816. Ruler.prototype.after = function (afterName, ruleName, fn, options) {
  1817. var index = this.__find__(afterName);
  1818. var opt = options || {};
  1819. if (index === -1) { throw new Error('Parser rule not found: ' + afterName); }
  1820. this.__rules__.splice(index + 1, 0, {
  1821. name: ruleName,
  1822. enabled: true,
  1823. fn: fn,
  1824. alt: opt.alt || []
  1825. });
  1826. this.__cache__ = null;
  1827. };
  1828. /**
  1829. * Ruler.push(ruleName, fn [, options])
  1830. * - ruleName (String): name of added rule.
  1831. * - fn (Function): rule function.
  1832. * - options (Object): rule options (not mandatory).
  1833. *
  1834. * Push new rule to the end of chain. See also
  1835. * [[Ruler.before]], [[Ruler.after]].
  1836. *
  1837. * ##### Options:
  1838. *
  1839. * - __alt__ - array with names of "alternate" chains.
  1840. *
  1841. * ##### Example
  1842. *
  1843. * ```javascript
  1844. * var md = require('markdown-it')();
  1845. *
  1846. * md.core.ruler.push('my_rule', function replace(state) {
  1847. * //...
  1848. * });
  1849. * ```
  1850. **/
  1851. Ruler.prototype.push = function (ruleName, fn, options) {
  1852. var opt = options || {};
  1853. this.__rules__.push({
  1854. name: ruleName,
  1855. enabled: true,
  1856. fn: fn,
  1857. alt: opt.alt || []
  1858. });
  1859. this.__cache__ = null;
  1860. };
  1861. /**
  1862. * Ruler.enable(list [, ignoreInvalid]) -> Array
  1863. * - list (String|Array): list of rule names to enable.
  1864. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  1865. *
  1866. * Enable rules with given names. If any rule name not found - throw Error.
  1867. * Errors can be disabled by second param.
  1868. *
  1869. * Returns list of found rule names (if no exception happened).
  1870. *
  1871. * See also [[Ruler.disable]], [[Ruler.enableOnly]].
  1872. **/
  1873. Ruler.prototype.enable = function (list, ignoreInvalid) {
  1874. if (!Array.isArray(list)) { list = [ list ]; }
  1875. var result = [];
  1876. // Search by name and enable
  1877. list.forEach(function (name) {
  1878. var idx = this.__find__(name);
  1879. if (idx < 0) {
  1880. if (ignoreInvalid) { return; }
  1881. throw new Error('Rules manager: invalid rule name ' + name);
  1882. }
  1883. this.__rules__[idx].enabled = true;
  1884. result.push(name);
  1885. }, this);
  1886. this.__cache__ = null;
  1887. return result;
  1888. };
  1889. /**
  1890. * Ruler.enableOnly(list [, ignoreInvalid])
  1891. * - list (String|Array): list of rule names to enable (whitelist).
  1892. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  1893. *
  1894. * Enable rules with given names, and disable everything else. If any rule name
  1895. * not found - throw Error. Errors can be disabled by second param.
  1896. *
  1897. * See also [[Ruler.disable]], [[Ruler.enable]].
  1898. **/
  1899. Ruler.prototype.enableOnly = function (list, ignoreInvalid) {
  1900. if (!Array.isArray(list)) { list = [ list ]; }
  1901. this.__rules__.forEach(function (rule) { rule.enabled = false; });
  1902. this.enable(list, ignoreInvalid);
  1903. };
  1904. /**
  1905. * Ruler.disable(list [, ignoreInvalid]) -> Array
  1906. * - list (String|Array): list of rule names to disable.
  1907. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  1908. *
  1909. * Disable rules with given names. If any rule name not found - throw Error.
  1910. * Errors can be disabled by second param.
  1911. *
  1912. * Returns list of found rule names (if no exception happened).
  1913. *
  1914. * See also [[Ruler.enable]], [[Ruler.enableOnly]].
  1915. **/
  1916. Ruler.prototype.disable = function (list, ignoreInvalid) {
  1917. if (!Array.isArray(list)) { list = [ list ]; }
  1918. var result = [];
  1919. // Search by name and disable
  1920. list.forEach(function (name) {
  1921. var idx = this.__find__(name);
  1922. if (idx < 0) {
  1923. if (ignoreInvalid) { return; }
  1924. throw new Error('Rules manager: invalid rule name ' + name);
  1925. }
  1926. this.__rules__[idx].enabled = false;
  1927. result.push(name);
  1928. }, this);
  1929. this.__cache__ = null;
  1930. return result;
  1931. };
  1932. /**
  1933. * Ruler.getRules(chainName) -> Array
  1934. *
  1935. * Return array of active functions (rules) for given chain name. It analyzes
  1936. * rules configuration, compiles caches if not exists and returns result.
  1937. *
  1938. * Default chain name is `''` (empty string). It can't be skipped. That's
  1939. * done intentionally, to keep signature monomorphic for high speed.
  1940. **/
  1941. Ruler.prototype.getRules = function (chainName) {
  1942. if (this.__cache__ === null) {
  1943. this.__compile__();
  1944. }
  1945. // Chain can be empty, if rules disabled. But we still have to return Array.
  1946. return this.__cache__[chainName] || [];
  1947. };
  1948. module.exports = Ruler;
  1949. /***/ }),
  1950. /* 4 */
  1951. /***/ (function(module, exports, __webpack_require__) {
  1952. "use strict";
  1953. // Token class
  1954. /**
  1955. * class Token
  1956. **/
  1957. /**
  1958. * new Token(type, tag, nesting)
  1959. *
  1960. * Create new token and fill passed properties.
  1961. **/
  1962. function Token(type, tag, nesting) {
  1963. /**
  1964. * Token#type -> String
  1965. *
  1966. * Type of the token (string, e.g. "paragraph_open")
  1967. **/
  1968. this.type = type;
  1969. /**
  1970. * Token#tag -> String
  1971. *
  1972. * html tag name, e.g. "p"
  1973. **/
  1974. this.tag = tag;
  1975. /**
  1976. * Token#attrs -> Array
  1977. *
  1978. * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`
  1979. **/
  1980. this.attrs = null;
  1981. /**
  1982. * Token#map -> Array
  1983. *
  1984. * Source map info. Format: `[ line_begin, line_end ]`
  1985. **/
  1986. this.map = null;
  1987. /**
  1988. * Token#nesting -> Number
  1989. *
  1990. * Level change (number in {-1, 0, 1} set), where:
  1991. *
  1992. * - `1` means the tag is opening
  1993. * - `0` means the tag is self-closing
  1994. * - `-1` means the tag is closing
  1995. **/
  1996. this.nesting = nesting;
  1997. /**
  1998. * Token#level -> Number
  1999. *
  2000. * nesting level, the same as `state.level`
  2001. **/
  2002. this.level = 0;
  2003. /**
  2004. * Token#children -> Array
  2005. *
  2006. * An array of child nodes (inline and img tokens)
  2007. **/
  2008. this.children = null;
  2009. /**
  2010. * Token#content -> String
  2011. *
  2012. * In a case of self-closing tag (code, html, fence, etc.),
  2013. * it has contents of this tag.
  2014. **/
  2015. this.content = '';
  2016. /**
  2017. * Token#markup -> String
  2018. *
  2019. * '*' or '_' for emphasis, fence string for fence, etc.
  2020. **/
  2021. this.markup = '';
  2022. /**
  2023. * Token#info -> String
  2024. *
  2025. * fence infostring
  2026. **/
  2027. this.info = '';
  2028. /**
  2029. * Token#meta -> Object
  2030. *
  2031. * A place for plugins to store an arbitrary data
  2032. **/
  2033. this.meta = null;
  2034. /**
  2035. * Token#block -> Boolean
  2036. *
  2037. * True for block-level tokens, false for inline tokens.
  2038. * Used in renderer to calculate line breaks
  2039. **/
  2040. this.block = false;
  2041. /**
  2042. * Token#hidden -> Boolean
  2043. *
  2044. * If it's true, ignore this element when rendering. Used for tight lists
  2045. * to hide paragraphs.
  2046. **/
  2047. this.hidden = false;
  2048. }
  2049. /**
  2050. * Token.attrIndex(name) -> Number
  2051. *
  2052. * Search attribute index by name.
  2053. **/
  2054. Token.prototype.attrIndex = function attrIndex(name) {
  2055. var attrs, i, len;
  2056. if (!this.attrs) { return -1; }
  2057. attrs = this.attrs;
  2058. for (i = 0, len = attrs.length; i < len; i++) {
  2059. if (attrs[i][0] === name) { return i; }
  2060. }
  2061. return -1;
  2062. };
  2063. /**
  2064. * Token.attrPush(attrData)
  2065. *
  2066. * Add `[ name, value ]` attribute to list. Init attrs if necessary
  2067. **/
  2068. Token.prototype.attrPush = function attrPush(attrData) {
  2069. if (this.attrs) {
  2070. this.attrs.push(attrData);
  2071. } else {
  2072. this.attrs = [ attrData ];
  2073. }
  2074. };
  2075. /**
  2076. * Token.attrSet(name, value)
  2077. *
  2078. * Set `name` attribute to `value`. Override old value if exists.
  2079. **/
  2080. Token.prototype.attrSet = function attrSet(name, value) {
  2081. var idx = this.attrIndex(name),
  2082. attrData = [ name, value ];
  2083. if (idx < 0) {
  2084. this.attrPush(attrData);
  2085. } else {
  2086. this.attrs[idx] = attrData;
  2087. }
  2088. };
  2089. /**
  2090. * Token.attrGet(name)
  2091. *
  2092. * Get the value of attribute `name`, or null if it does not exist.
  2093. **/
  2094. Token.prototype.attrGet = function attrGet(name) {
  2095. var idx = this.attrIndex(name), value = null;
  2096. if (idx >= 0) {
  2097. value = this.attrs[idx][1];
  2098. }
  2099. return value;
  2100. };
  2101. /**
  2102. * Token.attrJoin(name, value)
  2103. *
  2104. * Join value to existing attribute via space. Or create new attribute if not
  2105. * exists. Useful to operate with token classes.
  2106. **/
  2107. Token.prototype.attrJoin = function attrJoin(name, value) {
  2108. var idx = this.attrIndex(name);
  2109. if (idx < 0) {
  2110. this.attrPush([ name, value ]);
  2111. } else {
  2112. this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value;
  2113. }
  2114. };
  2115. module.exports = Token;
  2116. /***/ }),
  2117. /* 5 */
  2118. /***/ (function(module, exports) {
  2119. module.exports=/[!-#%-\*,-/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E44\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/
  2120. /***/ }),
  2121. /* 6 */
  2122. /***/ (function(module, exports) {
  2123. var g;
  2124. // This works in non-strict mode
  2125. g = (function() {
  2126. return this;
  2127. })();
  2128. try {
  2129. // This works if eval is allowed (see CSP)
  2130. g = g || Function("return this")() || (1,eval)("this");
  2131. } catch(e) {
  2132. // This works if the window reference is available
  2133. if(typeof window === "object")
  2134. g = window;
  2135. }
  2136. // g can still be undefined, but nothing to do about it...
  2137. // We return undefined, instead of nothing here, so it's
  2138. // easier to handle this case. if(!global) { ...}
  2139. module.exports = g;
  2140. /***/ }),
  2141. /* 7 */
  2142. /***/ (function(module, exports, __webpack_require__) {
  2143. var m = __webpack_require__(1);
  2144. // ____ __
  2145. // / __/___ ____ / /____ _____
  2146. // / /_/ __ \/ __ \/ __/ _ \/ ___/
  2147. // / __/ /_/ / /_/ / /_/ __/ /
  2148. // /_/ \____/\____/\__/\___/_/
  2149. module.exports = {
  2150. view: function(vn){
  2151. return m('footer', [
  2152. m('p', m.trust('© 2017 <a href="./">Ethica Spinoza</a>'))
  2153. ]);
  2154. }
  2155. }
  2156. /***/ }),
  2157. /* 8 */
  2158. /***/ (function(module, exports, __webpack_require__) {
  2159. var m = __webpack_require__(1);
  2160. var _dbs = __webpack_require__(2);
  2161. // __ __ __
  2162. // / / / /__ ____ _____/ /__ _____
  2163. // / /_/ / _ \/ __ `/ __ / _ \/ ___/
  2164. // / __ / __/ /_/ / /_/ / __/ /
  2165. // /_/ /_/\___/\__,_/\__,_/\___/_/
  2166. module.exports = {
  2167. view: function(vn){
  2168. return m('header', [
  2169. m('h1', 'Ethica'),
  2170. m('nav', {'id':"menus"}, [
  2171. m(_RouteMenu),
  2172. m(_LangMenu)
  2173. ])
  2174. ]);
  2175. }
  2176. }
  2177. var _RouteMenu = {
  2178. view: function(){
  2179. // create ul dom
  2180. return m('ul', {id:"routes"}, [
  2181. m('li', m('a', {'href':'#!/tree'}, "tree")),
  2182. m('li', m('a', {'href':'#!/dots'}, "dots")),
  2183. ]
  2184. );
  2185. }
  2186. }
  2187. // __ __ ___
  2188. // / / ____ _____ ____ _/ |/ /__ ____ __ __
  2189. // / / / __ `/ __ \/ __ `/ /|_/ / _ \/ __ \/ / / /
  2190. // / /___/ /_/ / / / / /_/ / / / / __/ / / / /_/ /
  2191. // /_____/\__,_/_/ /_/\__, /_/ /_/\___/_/ /_/\__,_/
  2192. // /____/
  2193. var _LangMenu = {
  2194. view: function(){
  2195. // create ul dom
  2196. return m('ul', {id:"languages"}, _dbs.langs.map(function(lang){
  2197. // create li dom for each lank link
  2198. return m('li',
  2199. // create a dom
  2200. m('a', {
  2201. 'lang':lang.lc,
  2202. 'href':'/?lang='+lang.lc,
  2203. onclick:function(e){
  2204. e.preventDefault();
  2205. // console.log('click lang', e);
  2206. var lang = e.target.getAttribute('lang');
  2207. console.log(lang);
  2208. if(lang != _dbs.lang){
  2209. // change url variable
  2210. // change db
  2211. _dbs.lang = lang;
  2212. // redraw UI
  2213. // m.redraw();
  2214. }
  2215. return false;
  2216. }
  2217. }, lang.label)
  2218. );
  2219. })
  2220. );
  2221. }
  2222. }
  2223. /***/ }),
  2224. /* 9 */
  2225. /***/ (function(module, exports, __webpack_require__) {
  2226. "use strict";
  2227. // Process footnotes
  2228. //
  2229. ////////////////////////////////////////////////////////////////////////////////
  2230. // Renderer partials
  2231. function render_footnote_anchor_name(tokens, idx, options, env/*, slf*/) {
  2232. var n = Number(tokens[idx].meta.id + 1).toString();
  2233. var prefix = '';
  2234. if (typeof env.docId === 'string') {
  2235. prefix = '-' + env.docId + '-';
  2236. }
  2237. return prefix + n;
  2238. }
  2239. function render_footnote_caption(tokens, idx/*, options, env, slf*/) {
  2240. var n = Number(tokens[idx].meta.id + 1).toString();
  2241. if (tokens[idx].meta.subId > 0) {
  2242. n += ':' + tokens[idx].meta.subId;
  2243. }
  2244. return '[' + n + ']';
  2245. }
  2246. function render_footnote_ref(tokens, idx, options, env, slf) {
  2247. var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
  2248. var caption = slf.rules.footnote_caption(tokens, idx, options, env, slf);
  2249. var refid = id;
  2250. if (tokens[idx].meta.subId > 0) {
  2251. refid += ':' + tokens[idx].meta.subId;
  2252. }
  2253. return '<sup class="footnote-ref"><a href="#fn' + id + '" id="fnref' + refid + '">' + caption + '</a></sup>';
  2254. }
  2255. function render_footnote_block_open(tokens, idx, options) {
  2256. return (options.xhtmlOut ? '<hr class="footnotes-sep" />\n' : '<hr class="footnotes-sep">\n') +
  2257. '<section class="footnotes">\n' +
  2258. '<ol class="footnotes-list">\n';
  2259. }
  2260. function render_footnote_block_close() {
  2261. return '</ol>\n</section>\n';
  2262. }
  2263. function render_footnote_open(tokens, idx, options, env, slf) {
  2264. var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
  2265. if (tokens[idx].meta.subId > 0) {
  2266. id += ':' + tokens[idx].meta.subId;
  2267. }
  2268. return '<li id="fn' + id + '" class="footnote-item">';
  2269. }
  2270. function render_footnote_close() {
  2271. return '</li>\n';
  2272. }
  2273. function render_footnote_anchor(tokens, idx, options, env, slf) {
  2274. var id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
  2275. if (tokens[idx].meta.subId > 0) {
  2276. id += ':' + tokens[idx].meta.subId;
  2277. }
  2278. /* ↩ with escape code to prevent display as Apple Emoji on iOS */
  2279. return ' <a href="#fnref' + id + '" class="footnote-backref">\u21a9\uFE0E</a>';
  2280. }
  2281. module.exports = function footnote_plugin(md) {
  2282. var parseLinkLabel = md.helpers.parseLinkLabel,
  2283. isSpace = md.utils.isSpace;
  2284. md.renderer.rules.footnote_ref = render_footnote_ref;
  2285. md.renderer.rules.footnote_block_open = render_footnote_block_open;
  2286. md.renderer.rules.footnote_block_close = render_footnote_block_close;
  2287. md.renderer.rules.footnote_open = render_footnote_open;
  2288. md.renderer.rules.footnote_close = render_footnote_close;
  2289. md.renderer.rules.footnote_anchor = render_footnote_anchor;
  2290. // helpers (only used in other rules, no tokens are attached to those)
  2291. md.renderer.rules.footnote_caption = render_footnote_caption;
  2292. md.renderer.rules.footnote_anchor_name = render_footnote_anchor_name;
  2293. // Process footnote block definition
  2294. function footnote_def(state, startLine, endLine, silent) {
  2295. var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,
  2296. initial, offset, ch, posAfterColon,
  2297. start = state.bMarks[startLine] + state.tShift[startLine],
  2298. max = state.eMarks[startLine];
  2299. // line should be at least 5 chars - "[^x]:"
  2300. if (start + 4 > max) { return false; }
  2301. if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }
  2302. if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }
  2303. for (pos = start + 2; pos < max; pos++) {
  2304. if (state.src.charCodeAt(pos) === 0x20) { return false; }
  2305. if (state.src.charCodeAt(pos) === 0x5D /* ] */) {
  2306. break;
  2307. }
  2308. }
  2309. if (pos === start + 2) { return false; } // no empty footnote labels
  2310. if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }
  2311. if (silent) { return true; }
  2312. pos++;
  2313. if (!state.env.footnotes) { state.env.footnotes = {}; }
  2314. if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }
  2315. label = state.src.slice(start + 2, pos - 2);
  2316. state.env.footnotes.refs[':' + label] = -1;
  2317. token = new state.Token('footnote_reference_open', '', 1);
  2318. token.meta = { label: label };
  2319. token.level = state.level++;
  2320. state.tokens.push(token);
  2321. oldBMark = state.bMarks[startLine];
  2322. oldTShift = state.tShift[startLine];
  2323. oldSCount = state.sCount[startLine];
  2324. oldParentType = state.parentType;
  2325. posAfterColon = pos;
  2326. initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);
  2327. while (pos < max) {
  2328. ch = state.src.charCodeAt(pos);
  2329. if (isSpace(ch)) {
  2330. if (ch === 0x09) {
  2331. offset += 4 - offset % 4;
  2332. } else {
  2333. offset++;
  2334. }
  2335. } else {
  2336. break;
  2337. }
  2338. pos++;
  2339. }
  2340. state.tShift[startLine] = pos - posAfterColon;
  2341. state.sCount[startLine] = offset - initial;
  2342. state.bMarks[startLine] = posAfterColon;
  2343. state.blkIndent += 4;
  2344. state.parentType = 'footnote';
  2345. if (state.sCount[startLine] < state.blkIndent) {
  2346. state.sCount[startLine] += state.blkIndent;
  2347. }
  2348. state.md.block.tokenize(state, startLine, endLine, true);
  2349. state.parentType = oldParentType;
  2350. state.blkIndent -= 4;
  2351. state.tShift[startLine] = oldTShift;
  2352. state.sCount[startLine] = oldSCount;
  2353. state.bMarks[startLine] = oldBMark;
  2354. token = new state.Token('footnote_reference_close', '', -1);
  2355. token.level = --state.level;
  2356. state.tokens.push(token);
  2357. return true;
  2358. }
  2359. // Process inline footnotes (^[...])
  2360. function footnote_inline(state, silent) {
  2361. var labelStart,
  2362. labelEnd,
  2363. footnoteId,
  2364. token,
  2365. tokens,
  2366. max = state.posMax,
  2367. start = state.pos;
  2368. if (start + 2 >= max) { return false; }
  2369. if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }
  2370. if (state.src.charCodeAt(start + 1) !== 0x5B/* [ */) { return false; }
  2371. labelStart = start + 2;
  2372. labelEnd = parseLinkLabel(state, start + 1);
  2373. // parser failed to find ']', so it's not a valid note
  2374. if (labelEnd < 0) { return false; }
  2375. // We found the end of the link, and know for a fact it's a valid link;
  2376. // so all that's left to do is to call tokenizer.
  2377. //
  2378. if (!silent) {
  2379. if (!state.env.footnotes) { state.env.footnotes = {}; }
  2380. if (!state.env.footnotes.list) { state.env.footnotes.list = []; }
  2381. footnoteId = state.env.footnotes.list.length;
  2382. state.md.inline.parse(
  2383. state.src.slice(labelStart, labelEnd),
  2384. state.md,
  2385. state.env,
  2386. tokens = []
  2387. );
  2388. token = state.push('footnote_ref', '', 0);
  2389. token.meta = { id: footnoteId };
  2390. state.env.footnotes.list[footnoteId] = { tokens: tokens };
  2391. }
  2392. state.pos = labelEnd + 1;
  2393. state.posMax = max;
  2394. return true;
  2395. }
  2396. // Process footnote references ([^...])
  2397. function footnote_ref(state, silent) {
  2398. var label,
  2399. pos,
  2400. footnoteId,
  2401. footnoteSubId,
  2402. token,
  2403. max = state.posMax,
  2404. start = state.pos;
  2405. // should be at least 4 chars - "[^x]"
  2406. if (start + 3 > max) { return false; }
  2407. if (!state.env.footnotes || !state.env.footnotes.refs) { return false; }
  2408. if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }
  2409. if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }
  2410. for (pos = start + 2; pos < max; pos++) {
  2411. if (state.src.charCodeAt(pos) === 0x20) { return false; }
  2412. if (state.src.charCodeAt(pos) === 0x0A) { return false; }
  2413. if (state.src.charCodeAt(pos) === 0x5D /* ] */) {
  2414. break;
  2415. }
  2416. }
  2417. if (pos === start + 2) { return false; } // no empty footnote labels
  2418. if (pos >= max) { return false; }
  2419. pos++;
  2420. label = state.src.slice(start + 2, pos - 1);
  2421. if (typeof state.env.footnotes.refs[':' + label] === 'undefined') { return false; }
  2422. if (!silent) {
  2423. if (!state.env.footnotes.list) { state.env.footnotes.list = []; }
  2424. if (state.env.footnotes.refs[':' + label] < 0) {
  2425. footnoteId = state.env.footnotes.list.length;
  2426. state.env.footnotes.list[footnoteId] = { label: label, count: 0 };
  2427. state.env.footnotes.refs[':' + label] = footnoteId;
  2428. } else {
  2429. footnoteId = state.env.footnotes.refs[':' + label];
  2430. }
  2431. footnoteSubId = state.env.footnotes.list[footnoteId].count;
  2432. state.env.footnotes.list[footnoteId].count++;
  2433. token = state.push('footnote_ref', '', 0);
  2434. token.meta = { id: footnoteId, subId: footnoteSubId, label: label };
  2435. }
  2436. state.pos = pos;
  2437. state.posMax = max;
  2438. return true;
  2439. }
  2440. // Glue footnote tokens to end of token stream
  2441. function footnote_tail(state) {
  2442. var i, l, j, t, lastParagraph, list, token, tokens, current, currentLabel,
  2443. insideRef = false,
  2444. refTokens = {};
  2445. if (!state.env.footnotes) { return; }
  2446. state.tokens = state.tokens.filter(function (tok) {
  2447. if (tok.type === 'footnote_reference_open') {
  2448. insideRef = true;
  2449. current = [];
  2450. currentLabel = tok.meta.label;
  2451. return false;
  2452. }
  2453. if (tok.type === 'footnote_reference_close') {
  2454. insideRef = false;
  2455. // prepend ':' to avoid conflict with Object.prototype members
  2456. refTokens[':' + currentLabel] = current;
  2457. return false;
  2458. }
  2459. if (insideRef) { current.push(tok); }
  2460. return !insideRef;
  2461. });
  2462. if (!state.env.footnotes.list) { return; }
  2463. list = state.env.footnotes.list;
  2464. token = new state.Token('footnote_block_open', '', 1);
  2465. state.tokens.push(token);
  2466. for (i = 0, l = list.length; i < l; i++) {
  2467. token = new state.Token('footnote_open', '', 1);
  2468. token.meta = { id: i, label: list[i].label };
  2469. state.tokens.push(token);
  2470. if (list[i].tokens) {
  2471. tokens = [];
  2472. token = new state.Token('paragraph_open', 'p', 1);
  2473. token.block = true;
  2474. tokens.push(token);
  2475. token = new state.Token('inline', '', 0);
  2476. token.children = list[i].tokens;
  2477. token.content = '';
  2478. tokens.push(token);
  2479. token = new state.Token('paragraph_close', 'p', -1);
  2480. token.block = true;
  2481. tokens.push(token);
  2482. } else if (list[i].label) {
  2483. tokens = refTokens[':' + list[i].label];
  2484. }
  2485. state.tokens = state.tokens.concat(tokens);
  2486. if (state.tokens[state.tokens.length - 1].type === 'paragraph_close') {
  2487. lastParagraph = state.tokens.pop();
  2488. } else {
  2489. lastParagraph = null;
  2490. }
  2491. t = list[i].count > 0 ? list[i].count : 1;
  2492. for (j = 0; j < t; j++) {
  2493. token = new state.Token('footnote_anchor', '', 0);
  2494. token.meta = { id: i, subId: j, label: list[i].label };
  2495. state.tokens.push(token);
  2496. }
  2497. if (lastParagraph) {
  2498. state.tokens.push(lastParagraph);
  2499. }
  2500. token = new state.Token('footnote_close', '', -1);
  2501. state.tokens.push(token);
  2502. }
  2503. token = new state.Token('footnote_block_close', '', -1);
  2504. state.tokens.push(token);
  2505. }
  2506. md.block.ruler.before('reference', 'footnote_def', footnote_def, { alt: [ 'paragraph', 'reference' ] });
  2507. md.inline.ruler.after('image', 'footnote_inline', footnote_inline);
  2508. md.inline.ruler.after('footnote_inline', 'footnote_ref', footnote_ref);
  2509. md.core.ruler.after('inline', 'footnote_tail', footnote_tail);
  2510. };
  2511. /***/ }),
  2512. /* 10 */
  2513. /***/ (function(module, exports, __webpack_require__) {
  2514. "use strict";
  2515. module.exports = __webpack_require__(35);
  2516. /***/ }),
  2517. /* 11 */
  2518. /***/ (function(module, exports, __webpack_require__) {
  2519. "use strict";
  2520. // HTML5 entities map: { name -> utf16string }
  2521. //
  2522. /*eslint quotes:0*/
  2523. module.exports = __webpack_require__(23);
  2524. /***/ }),
  2525. /* 12 */
  2526. /***/ (function(module, exports, __webpack_require__) {
  2527. "use strict";
  2528. // Regexps to match html elements
  2529. var attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*';
  2530. var unquoted = '[^"\'=<>`\\x00-\\x20]+';
  2531. var single_quoted = "'[^']*'";
  2532. var double_quoted = '"[^"]*"';
  2533. var attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')';
  2534. var attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)';
  2535. var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>';
  2536. var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>';
  2537. var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->';
  2538. var processing = '<[?].*?[?]>';
  2539. var declaration = '<![A-Z]+\\s+[^>]*>';
  2540. var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>';
  2541. var HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment +
  2542. '|' + processing + '|' + declaration + '|' + cdata + ')');
  2543. var HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')');
  2544. module.exports.HTML_TAG_RE = HTML_TAG_RE;
  2545. module.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE;
  2546. /***/ }),
  2547. /* 13 */
  2548. /***/ (function(module, exports, __webpack_require__) {
  2549. "use strict";
  2550. // Process *this* and _that_
  2551. //
  2552. // Insert each marker as a separate text token, and add it to delimiter list
  2553. //
  2554. module.exports.tokenize = function emphasis(state, silent) {
  2555. var i, scanned, token,
  2556. start = state.pos,
  2557. marker = state.src.charCodeAt(start);
  2558. if (silent) { return false; }
  2559. if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false; }
  2560. scanned = state.scanDelims(state.pos, marker === 0x2A);
  2561. for (i = 0; i < scanned.length; i++) {
  2562. token = state.push('text', '', 0);
  2563. token.content = String.fromCharCode(marker);
  2564. state.delimiters.push({
  2565. // Char code of the starting marker (number).
  2566. //
  2567. marker: marker,
  2568. // Total length of these series of delimiters.
  2569. //
  2570. length: scanned.length,
  2571. // An amount of characters before this one that's equivalent to
  2572. // current one. In plain English: if this delimiter does not open
  2573. // an emphasis, neither do previous `jump` characters.
  2574. //
  2575. // Used to skip sequences like "*****" in one step, for 1st asterisk
  2576. // value will be 0, for 2nd it's 1 and so on.
  2577. //
  2578. jump: i,
  2579. // A position of the token this delimiter corresponds to.
  2580. //
  2581. token: state.tokens.length - 1,
  2582. // Token level.
  2583. //
  2584. level: state.level,
  2585. // If this delimiter is matched as a valid opener, `end` will be
  2586. // equal to its position, otherwise it's `-1`.
  2587. //
  2588. end: -1,
  2589. // Boolean flags that determine if this delimiter could open or close
  2590. // an emphasis.
  2591. //
  2592. open: scanned.can_open,
  2593. close: scanned.can_close
  2594. });
  2595. }
  2596. state.pos += scanned.length;
  2597. return true;
  2598. };
  2599. // Walk through delimiter list and replace text tokens with tags
  2600. //
  2601. module.exports.postProcess = function emphasis(state) {
  2602. var i,
  2603. startDelim,
  2604. endDelim,
  2605. token,
  2606. ch,
  2607. isStrong,
  2608. delimiters = state.delimiters,
  2609. max = state.delimiters.length;
  2610. for (i = 0; i < max; i++) {
  2611. startDelim = delimiters[i];
  2612. if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) {
  2613. continue;
  2614. }
  2615. // Process only opening markers
  2616. if (startDelim.end === -1) {
  2617. continue;
  2618. }
  2619. endDelim = delimiters[startDelim.end];
  2620. // If the next delimiter has the same marker and is adjacent to this one,
  2621. // merge those into one strong delimiter.
  2622. //
  2623. // `<em><em>whatever</em></em>` -> `<strong>whatever</strong>`
  2624. //
  2625. isStrong = i + 1 < max &&
  2626. delimiters[i + 1].end === startDelim.end - 1 &&
  2627. delimiters[i + 1].token === startDelim.token + 1 &&
  2628. delimiters[startDelim.end - 1].token === endDelim.token - 1 &&
  2629. delimiters[i + 1].marker === startDelim.marker;
  2630. ch = String.fromCharCode(startDelim.marker);
  2631. token = state.tokens[startDelim.token];
  2632. token.type = isStrong ? 'strong_open' : 'em_open';
  2633. token.tag = isStrong ? 'strong' : 'em';
  2634. token.nesting = 1;
  2635. token.markup = isStrong ? ch + ch : ch;
  2636. token.content = '';
  2637. token = state.tokens[endDelim.token];
  2638. token.type = isStrong ? 'strong_close' : 'em_close';
  2639. token.tag = isStrong ? 'strong' : 'em';
  2640. token.nesting = -1;
  2641. token.markup = isStrong ? ch + ch : ch;
  2642. token.content = '';
  2643. if (isStrong) {
  2644. state.tokens[delimiters[i + 1].token].content = '';
  2645. state.tokens[delimiters[startDelim.end - 1].token].content = '';
  2646. i++;
  2647. }
  2648. }
  2649. };
  2650. /***/ }),
  2651. /* 14 */
  2652. /***/ (function(module, exports, __webpack_require__) {
  2653. "use strict";
  2654. // ~~strike through~~
  2655. //
  2656. // Insert each marker as a separate text token, and add it to delimiter list
  2657. //
  2658. module.exports.tokenize = function strikethrough(state, silent) {
  2659. var i, scanned, token, len, ch,
  2660. start = state.pos,
  2661. marker = state.src.charCodeAt(start);
  2662. if (silent) { return false; }
  2663. if (marker !== 0x7E/* ~ */) { return false; }
  2664. scanned = state.scanDelims(state.pos, true);
  2665. len = scanned.length;
  2666. ch = String.fromCharCode(marker);
  2667. if (len < 2) { return false; }
  2668. if (len % 2) {
  2669. token = state.push('text', '', 0);
  2670. token.content = ch;
  2671. len--;
  2672. }
  2673. for (i = 0; i < len; i += 2) {
  2674. token = state.push('text', '', 0);
  2675. token.content = ch + ch;
  2676. state.delimiters.push({
  2677. marker: marker,
  2678. jump: i,
  2679. token: state.tokens.length - 1,
  2680. level: state.level,
  2681. end: -1,
  2682. open: scanned.can_open,
  2683. close: scanned.can_close
  2684. });
  2685. }
  2686. state.pos += scanned.length;
  2687. return true;
  2688. };
  2689. // Walk through delimiter list and replace text tokens with tags
  2690. //
  2691. module.exports.postProcess = function strikethrough(state) {
  2692. var i, j,
  2693. startDelim,
  2694. endDelim,
  2695. token,
  2696. loneMarkers = [],
  2697. delimiters = state.delimiters,
  2698. max = state.delimiters.length;
  2699. for (i = 0; i < max; i++) {
  2700. startDelim = delimiters[i];
  2701. if (startDelim.marker !== 0x7E/* ~ */) {
  2702. continue;
  2703. }
  2704. if (startDelim.end === -1) {
  2705. continue;
  2706. }
  2707. endDelim = delimiters[startDelim.end];
  2708. token = state.tokens[startDelim.token];
  2709. token.type = 's_open';
  2710. token.tag = 's';
  2711. token.nesting = 1;
  2712. token.markup = '~~';
  2713. token.content = '';
  2714. token = state.tokens[endDelim.token];
  2715. token.type = 's_close';
  2716. token.tag = 's';
  2717. token.nesting = -1;
  2718. token.markup = '~~';
  2719. token.content = '';
  2720. if (state.tokens[endDelim.token - 1].type === 'text' &&
  2721. state.tokens[endDelim.token - 1].content === '~') {
  2722. loneMarkers.push(endDelim.token - 1);
  2723. }
  2724. }
  2725. // If a marker sequence has an odd number of characters, it's splitted
  2726. // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the
  2727. // start of the sequence.
  2728. //
  2729. // So, we have to move all those markers after subsequent s_close tags.
  2730. //
  2731. while (loneMarkers.length) {
  2732. i = loneMarkers.pop();
  2733. j = i + 1;
  2734. while (j < state.tokens.length && state.tokens[j].type === 's_close') {
  2735. j++;
  2736. }
  2737. j--;
  2738. if (i !== j) {
  2739. token = state.tokens[j];
  2740. state.tokens[j] = state.tokens[i];
  2741. state.tokens[i] = token;
  2742. }
  2743. }
  2744. };
  2745. /***/ }),
  2746. /* 15 */
  2747. /***/ (function(module, exports, __webpack_require__) {
  2748. "use strict";
  2749. module.exports.encode = __webpack_require__(75);
  2750. module.exports.decode = __webpack_require__(74);
  2751. module.exports.format = __webpack_require__(76);
  2752. module.exports.parse = __webpack_require__(77);
  2753. /***/ }),
  2754. /* 16 */
  2755. /***/ (function(module, exports) {
  2756. module.exports=/[\0-\x1F\x7F-\x9F]/
  2757. /***/ }),
  2758. /* 17 */
  2759. /***/ (function(module, exports) {
  2760. module.exports=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/
  2761. /***/ }),
  2762. /* 18 */
  2763. /***/ (function(module, exports) {
  2764. module.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/
  2765. /***/ }),
  2766. /* 19 */
  2767. /***/ (function(module, exports, __webpack_require__) {
  2768. /**
  2769. * @Author: Bachir Soussi Chiadmi <bach>
  2770. * @Date: 16-04-2017
  2771. * @Email: bachir@figureslibres.io
  2772. * @Last modified by: bach
  2773. * @Last modified time: 18-04-2017
  2774. * @License: GPL-V3
  2775. */
  2776. __webpack_require__(27);
  2777. __webpack_require__(24);
  2778. __webpack_require__(25);
  2779. __webpack_require__(26);
  2780. var m = __webpack_require__(1);
  2781. // var marked = require('marked');
  2782. // var _helpers = require('modules/helpers');
  2783. var _dbs = __webpack_require__(2);
  2784. var _Tree = __webpack_require__(22);
  2785. var _Dots = __webpack_require__(21);
  2786. function init(){
  2787. _dbs.load(function(){
  2788. console.log("Init _dbs.data", _dbs.data);
  2789. console.log("Init _dbs.data_byid", _dbs.data_byid);
  2790. console.log("Init _dbs.data_strct", _dbs.data_strct);
  2791. m.route(document.body, "/tree", {
  2792. "/tree": _Tree,
  2793. "/dots": _Dots,
  2794. });
  2795. });
  2796. };
  2797. // ___
  2798. // / | ____ ____
  2799. // / /| | / __ \/ __ \
  2800. // / ___ |/ /_/ / /_/ /
  2801. // /_/ |_/ .___/ .___/
  2802. // /_/ /_/
  2803. // var _App = {
  2804. // view: function(){
  2805. // console.log('_App view', _lang);
  2806. // return [
  2807. // m('header', [
  2808. // m('h1', 'Ethica'),
  2809. // m('aside', {'id':"menus"}, m(_LangMenu) )
  2810. // ]),
  2811. // m(_Tree),
  2812. // m('footer', [
  2813. // m('p', m.trust('© 2017 <a href="./">Ethica Spinoza</a>'))
  2814. // ])
  2815. // ]
  2816. // }
  2817. // }
  2818. // _ _ __
  2819. // (_)___ (_) /_
  2820. // / / __ \/ / __/
  2821. // / / / / / / /_
  2822. // /_/_/ /_/_/\__/
  2823. init()
  2824. /***/ }),
  2825. /* 20 */
  2826. /***/ (function(module, exports) {
  2827. // removed by extract-text-webpack-plugin
  2828. /***/ }),
  2829. /* 21 */
  2830. /***/ (function(module, exports, __webpack_require__) {
  2831. var m = __webpack_require__(1);
  2832. // https://github.com/markdown-it/markdown-it
  2833. var markdown = __webpack_require__(10)()
  2834. .use(__webpack_require__(9));
  2835. var _dbs = __webpack_require__(2);
  2836. var _Header = __webpack_require__(8);
  2837. var _Footer = __webpack_require__(7);
  2838. // var _lang = require('../main.js')._langs;
  2839. // ____ __
  2840. // / __ \____ / /_
  2841. // / / / / __ \/ __/
  2842. // / /_/ / /_/ / /_
  2843. // /_____/\____/\__/
  2844. var _Dot = {
  2845. id:null,
  2846. type:'',
  2847. text:'',
  2848. summary:'',
  2849. active:true,
  2850. opened:false,
  2851. links:null,
  2852. parents:[],
  2853. oninit: function(vn){
  2854. this.id = vn.attrs.id;
  2855. this.type = vn.attrs.type;
  2856. // construct text
  2857. this.text = markdown.render(vn.attrs.text);
  2858. // construct summary
  2859. // TODO: summary needs more work (strip tags, markdown render)
  2860. this.summary = vn.attrs.text.match('([^ ]*[ ]{0,1}){1,6}')[0];
  2861. this.summary = this.summary.trim().replace(/_([^_]+)$/g, "_$1_");
  2862. this.summary = this.summary.replace(/\[([^\]]+)$/g, "$1");
  2863. this.summary = markdown.renderInline(this.summary) + "&nbsp;…";
  2864. if(typeof vn.attrs.active !== 'undefined')
  2865. this.active = vn.attrs.active;
  2866. // links
  2867. this.links = _dbs.data_strct[this.id];
  2868. // console.log(this.links);
  2869. // parents memorize where do we come from to avoid duplicates and looping nav
  2870. if(vn.attrs.parents){
  2871. this.parents = this.parents.concat(vn.attrs.parents);
  2872. // console.log('_Dot init '+this.id+' parents :',this.parents);
  2873. }
  2874. },
  2875. oncreate: function(vn){
  2876. if(this.active){
  2877. vn.dom.classList.remove('disabled');
  2878. }else{
  2879. vn.dom.classList.add('disabled');
  2880. }
  2881. },
  2882. onbeforeupdate: function(vn){
  2883. },
  2884. view: function(vn){
  2885. if (this.active && this.opened) {
  2886. // full view of dot with linked dots
  2887. // console.log('_Dot view '+this.id+' parents :',this.parents);
  2888. var dot_content = [
  2889. // links to
  2890. this.links.to.length
  2891. ? m('nav', {'class':'links to'}, this.links.to.map(function(id){
  2892. // console.log(id);
  2893. return m(_Dot, {
  2894. "id":id,
  2895. 'text':_dbs.data_byid[_dbs.lang][id].text,
  2896. 'type':'',
  2897. // passe the memory of crossed dots plus the current one
  2898. 'parents':vn.state.parents.concat([vn.state.id]),
  2899. // activate link only if not in parents (already went through it)
  2900. 'active':vn.state.parents.indexOf(id) == -1 ? true:false
  2901. });
  2902. })
  2903. )
  2904. : null,
  2905. // id
  2906. m('span', {'class':'id'}, this.id), // this.type+' '+
  2907. // bullet
  2908. m('span', {'class':'bullet'}, m.trust('&#9899;')),
  2909. // full text
  2910. m('section', {
  2911. 'class':'text',
  2912. onmouseover: function(e){
  2913. e.preventDefault();
  2914. if(e.target.nodeName == "A" ){
  2915. // console.log("over e.target", e.target);
  2916. // console.log('over vn', vn);
  2917. var id = e.target.getAttribute("href");
  2918. // add highlight class
  2919. vn.dom.querySelector('nav.links>div[uid="'+id+'"]').classList.add('highlight');
  2920. }else{
  2921. // remove all hilight class
  2922. for (link of vn.dom.querySelectorAll('nav.links>div.dot')) {
  2923. link.classList.remove('highlight');
  2924. }
  2925. }
  2926. },
  2927. onclick:function(e){
  2928. e.preventDefault();
  2929. if(e.target.nodeName == "A" ){
  2930. // console.log("over e.target", e.target);
  2931. // console.log('over vn', vn);
  2932. var id = e.target.getAttribute("href");
  2933. // add highlight class
  2934. vn.dom.querySelector('nav.links>div[uid="'+id+'"]>.summary').click();
  2935. }
  2936. }
  2937. }, m.trust(this.text)),
  2938. // links from
  2939. this.links.from.length
  2940. ? m('nav', {'class':'links from'}, this.links.from.map(function(id){
  2941. // retrun a dot
  2942. return m(_Dot, {
  2943. "id":id,
  2944. 'text':_dbs.data_byid[_dbs.lang][id].text,
  2945. 'type':'',
  2946. // passe the memory of crossed dots plus the current one
  2947. 'parents':vn.state.parents.concat([vn.state.id]),
  2948. // activate link only if not in parents (already went through it)
  2949. 'active':vn.state.parents.indexOf(id) == -1 ? true:false
  2950. });
  2951. })
  2952. )
  2953. : null
  2954. ];
  2955. }else{
  2956. // preview dot
  2957. var dot_content = [
  2958. m('span', {'class':'id'}, this.id), // this.type+' '+
  2959. m('span', {'class':'bullet'}, m.trust('&#8226;')),
  2960. m('p', {
  2961. 'class':'summary',
  2962. onclick:function(e){
  2963. vn.state.opened = true;
  2964. }
  2965. }, m.trust(this.summary))
  2966. ];
  2967. }
  2968. return m('div',{
  2969. 'uid':this.id,
  2970. 'class':'dot'
  2971. },
  2972. dot_content
  2973. );
  2974. },
  2975. onupdate: function(vn){
  2976. // console.log('_Dot : onupdate', vn);
  2977. if(this.active){
  2978. if (this.opened){
  2979. vn.dom.classList.add('opened');
  2980. if(this.links.to.length)
  2981. vn.dom.classList.add('to-links');
  2982. if(this.links.from.length)
  2983. vn.dom.classList.add('from-links');
  2984. }else{
  2985. vn.dom.classList.remove('opened');
  2986. }
  2987. }
  2988. }
  2989. }
  2990. /*
  2991. down vote
  2992. Here's full list of black dotlikes from unicode
  2993. ● - &#9679; - Black Circle
  2994. ⏺ - &#9210; - Black Circle for Record
  2995. ⚫ - &#9899; - Medium Black Circle
  2996. ⬤ - &#11044; - Black Large Circle
  2997. ⧭ - &#10733; - Black Circle with Down Arrow
  2998. 🞄 - &#128900; - Black Slightly Small Circle
  2999. • - &#8226; - Bullet
  3000. ∙ - &#8729; - Bullet Operator
  3001. ⋅ - &#8901; - Dot Operator
  3002. 🌑 - &#127761; - New Moon Symbol
  3003. */
  3004. // _______ _ __ __
  3005. // / ___/ / (_) /__/ /
  3006. // / /__/ _ \/ / / _ /
  3007. // \___/_//_/_/_/\_,_/
  3008. var _Child = {
  3009. id:null,
  3010. part:null,
  3011. type:null,
  3012. // nested:false,
  3013. text:'',
  3014. oninit: function(vn){
  3015. // console.log('vn.attrs', vn.attrs);
  3016. this.id = vn.attrs.id;
  3017. this.type = vn.attrs.type;
  3018. // vn.state.part = vn.state.slug.match(/^(\d)(.+)/)[1];
  3019. this.text = vn.attrs.text;
  3020. // this.nested = vn.attrs.nested || false;
  3021. },
  3022. onbeforeupdate: function(vn, old){
  3023. // this.nested = vn.attrs.nested || false;
  3024. this.type = vn.attrs.type;
  3025. this.text = vn.attrs.text;
  3026. },
  3027. view: function(vn){
  3028. return m(_Dot, {"id":this.id, 'text':this.text, 'type':this.type});
  3029. }
  3030. };
  3031. // ______
  3032. // / ____/___ ____ ____ ________
  3033. // / __/ / __ \/ __ \/ __ \/ ___/ _ \
  3034. // / /___/ / / / /_/ / / / / /__/ __/
  3035. // /_____/_/ /_/\____/_/ /_/\___/\___/
  3036. var _Enonce = {
  3037. partid:null,
  3038. id:null,
  3039. title:null,
  3040. text:null,
  3041. // nested:false,
  3042. childs:[],
  3043. oninit:function(vn){
  3044. // // console.log('Enonce on init', vn);
  3045. this.partid = vn.attrs.partid;
  3046. this.id = vn.attrs.id;
  3047. this.title = vn.attrs.title;
  3048. this.text = vn.attrs.text;
  3049. this.childs = vn.attrs.childs;
  3050. // this.nested = vn.attrs.nested || false;
  3051. },
  3052. onbeforeupdate:function(vn, old) {
  3053. // console.log(vn.attrs.childs);
  3054. this.title = vn.attrs.title;
  3055. this.text = vn.attrs.text;
  3056. this.childs = vn.attrs.childs;
  3057. // this.nested = vn.attrs.nested || false;
  3058. // if(vn.attrs.id == '1d1') console.log('_Enonce UPDATE, text :', vn.attrs.text);
  3059. },
  3060. view: function(vn){
  3061. // if(vn.attrs.id == '1d1') console.log('_Enonce VIEW, text :', vn.attrs.text);
  3062. return [
  3063. // create dot
  3064. m(_Dot, {"id":this.id, 'text':this.text,'type':this.title}),
  3065. // addd children
  3066. this.childs.map(function(c){
  3067. return m(_Child, c);
  3068. })
  3069. ]
  3070. }
  3071. }
  3072. // ____ __
  3073. // / __ \____ ______/ /_
  3074. // / /_/ / __ `/ ___/ __/
  3075. // / ____/ /_/ / / / /_
  3076. // /_/ \__,_/_/ \__/
  3077. var _Part = {
  3078. oninit: function(vn){
  3079. this.id = vn.attrs.id;
  3080. this.title = vn.attrs.title;
  3081. this.enonces = vn.attrs.enonces;
  3082. },
  3083. onbeforeupdate: function(vn, old){
  3084. // console.log('_Part, onbeforeupdate old',old);
  3085. this.title = vn.attrs.title;
  3086. this.enonces = vn.attrs.enonces;
  3087. },
  3088. view: function(vn){
  3089. // console.log(vn.attrs.enonces);
  3090. return m("section", {
  3091. 'id' :this.id,
  3092. 'class' :'part'
  3093. },
  3094. [
  3095. // create title node
  3096. m("h1", {'class':'part'}, m.trust(markdown.renderInline(this.title))),
  3097. // create text node
  3098. this.enonces.map(function(e){
  3099. // console.log(e.text);
  3100. return m(_Enonce, Object.assign({"partid":this.id},e))
  3101. })
  3102. ]
  3103. )
  3104. }
  3105. }
  3106. // ____ __
  3107. // / __ \____ / /______
  3108. // / / / / __ \/ __/ ___/
  3109. // / /_/ / /_/ / /_(__ )
  3110. // /_____/\____/\__/____/
  3111. module.exports = {
  3112. view: function(){
  3113. // console.log('_Dots view', _dbs.lang);
  3114. return [
  3115. m(_Header),
  3116. m('main', {id:"content", 'class':'dots'}, _dbs.data[_dbs.lang].map(function(p){
  3117. return m(_Part,p);
  3118. })
  3119. ),
  3120. m(_Footer)
  3121. ];
  3122. }
  3123. }
  3124. // function(){
  3125. // switch(_dbs.lang){
  3126. // case 'fr':
  3127. // return "Hello dots !";
  3128. // break;
  3129. // case 'bra':
  3130. // return '"Hola dots !"'
  3131. // break;
  3132. // }
  3133. // }
  3134. /***/ }),
  3135. /* 22 */
  3136. /***/ (function(module, exports, __webpack_require__) {
  3137. var m = __webpack_require__(1);
  3138. // https://github.com/markdown-it/markdown-it
  3139. var markdown = __webpack_require__(10)()
  3140. .use(__webpack_require__(9));
  3141. var _dbs = __webpack_require__(2);
  3142. var _Header = __webpack_require__(8);
  3143. var _Footer = __webpack_require__(7);
  3144. // __ _ __
  3145. // / / (_)___ / /__
  3146. // / / / / __ \/ //_/
  3147. // / /___/ / / / / ,<
  3148. // /_____/_/_/ /_/_/|_|
  3149. var _Link = {
  3150. tid:"",
  3151. opened:false,
  3152. oninit: function(vn){
  3153. // console.log("INIT LINK : vn", vn);
  3154. // define target id
  3155. this.tid = vn.attrs.href;
  3156. },
  3157. onbeforeupdate: function(vn){
  3158. this.tid = vn.attrs.href;
  3159. },
  3160. view: function(vn){
  3161. this.tid_known = typeof _dbs.data_byid[_dbs.lang][this.tid] === 'undefined' ? false : true;
  3162. if (!this.tid_known) {
  3163. console.log('!! target id '+this.tid+' unkonwn !!');
  3164. }
  3165. if(this.opened && this.tid_known){
  3166. // console.log('this.tid', vn.state);
  3167. return m('div', {'class':'opened-link'},
  3168. [
  3169. m('span', {'class':"link text"}, vn.children),
  3170. typeof _dbs.data_byid[_dbs.lang][this.tid].childs != "undefined"
  3171. ? m(_Enonce, _dbs.data_byid[_dbs.lang][this.tid])
  3172. : m(_Item, _dbs.data_byid[_dbs.lang][this.tid])
  3173. ]
  3174. );
  3175. }else{
  3176. // console.log(vn);
  3177. return m('a', {
  3178. 'class':'link',
  3179. 'href':'#'+this.tid,
  3180. 'rel':this.tid,
  3181. onclick:function(e){
  3182. e.preventDefault();
  3183. console.log('click', this);
  3184. vn.state.opened = true;
  3185. return false;
  3186. }
  3187. }, vn.children); // c'est quoi ce vn.children ?
  3188. }
  3189. }
  3190. }
  3191. // ______ __
  3192. // /_ __/__ _ __/ /_
  3193. // / / / _ \| |/_/ __/
  3194. // / / / __/> </ /_
  3195. // /_/ \___/_/|_|\__/
  3196. // recusive function to record information of all subnodes
  3197. function parseTextDom(nodes){
  3198. var list = [];
  3199. // loop through childNodes
  3200. for (var i = 0; i < nodes.length; i++) {
  3201. var n = {};
  3202. if(typeof nodes[i].localName != "undefined"){
  3203. n.tag=nodes[i].localName;
  3204. if (n.tag == 'p') {
  3205. // replace p by div as we will insert other div in them
  3206. n.tag = 'div';
  3207. n.attrs = {'class':'paragraph'};
  3208. }
  3209. if (n.tag == 'a') {
  3210. // record the href attribute for cross reference
  3211. n.attrs = {'href':nodes[i].attributes.href.value};
  3212. }
  3213. if(nodes[i].childNodes.length){
  3214. // again parse node's childs
  3215. n.childs = parseTextDom(nodes[i].childNodes);
  3216. }
  3217. }else if (nodes[i].textContent.length > 1){
  3218. // if node has no localName it is probably a #text node
  3219. // we record it if it's not empty
  3220. n.tag='#text';
  3221. n.text=nodes[i].textContent;
  3222. }
  3223. // add the node to the list if it has a tag
  3224. if(typeof n.tag != "undefined")
  3225. list.push(n);
  3226. }
  3227. return list;
  3228. }
  3229. // recusive fucntion to generate mithril object from information recorded with parseTextDom()
  3230. function populateTextDom(n,i){
  3231. // console.log('populateTextDom : '+i,n);
  3232. return n.tag == "#text"
  3233. ? m.trust(n.text)
  3234. : m(
  3235. n.tag != 'a' ? n.tag : _Link,
  3236. typeof n.attrs != "undefined" ? n.attrs : {},
  3237. typeof n.childs != "undefined"
  3238. ? n.childs.map(populateTextDom)
  3239. : typeof n.text != "undefined"
  3240. ? m.trust(n.text)
  3241. : null
  3242. );
  3243. }
  3244. var _Text = {
  3245. id:null,
  3246. text:"",
  3247. texthtml:"",
  3248. textdom:null,
  3249. textchilds:[],
  3250. parsetext: function(){
  3251. // console.log('parsetext', this);
  3252. // !! we need to convert markdown to html here because parseTextDom() is recursive through nodes tree
  3253. // convert markdown to html
  3254. this.texthtml = markdown.render(this.text)
  3255. // TODO: fixe number link text disapear [3](1d3) ( in 104d )
  3256. // TODO: fixe parenthèse disparait _(par les Défin. [test 3](1d3) et [test 5](1d5))_ ( in 104d )
  3257. // parse html string to virtual dom
  3258. this.textdom = new DOMParser().parseFromString(this.texthtml, "text/html");
  3259. // get the text nodes (avoid html document extra)
  3260. this.textchilds = parseTextDom(this.textdom.getElementsByTagName('body')[0].childNodes);
  3261. },
  3262. oninit: function(vn){
  3263. this.id = vn.attrs.id;
  3264. this.text = vn.attrs.text;
  3265. this.parsetext();
  3266. },
  3267. onbeforeupdate: function(vn,old){
  3268. this.text = vn.attrs.text;
  3269. this.parsetext();
  3270. },
  3271. view: function(vn){
  3272. // console.log('_Text :: view : '+vn.attrs.slug, vn);
  3273. return m('div',
  3274. {'class':'text'},
  3275. // loop through childNodes list generated by parseTextDom() in init
  3276. this.textchilds.map(populateTextDom)
  3277. ); // /m.div.text
  3278. } // view:
  3279. }
  3280. // ______
  3281. // / _/ /____ ____ ___
  3282. // / // __/ _ \/ __ `__ \
  3283. // _/ // /_/ __/ / / / / /
  3284. // /___/\__/\___/_/ /_/ /_/
  3285. var _Item = {
  3286. id:null,
  3287. part:null,
  3288. type:null,
  3289. nested:false,
  3290. oninit: function(vn){
  3291. // console.log('vn.attrs', vn.attrs);
  3292. this.id = vn.attrs.id;
  3293. this.type = vn.attrs.type;
  3294. // vn.state.part = vn.state.slug.match(/^(\d)(.+)/)[1];
  3295. this.text = vn.attrs.text;
  3296. this.nested = vn.attrs.nested || false;
  3297. },
  3298. onbeforeupdate: function(vn, old){
  3299. this.nested = vn.attrs.nested || false;
  3300. this.type = vn.attrs.type;
  3301. this.text = vn.attrs.text;
  3302. },
  3303. view: function(vn){
  3304. return m("section", {
  3305. 'id':this.id,
  3306. 'class':'item'+(this.nested ? ' nested':'')
  3307. },
  3308. [
  3309. // create title node
  3310. m("h3", {
  3311. // 'ref':vn.attrs.href,
  3312. onclick: function(e){
  3313. vn.state.active = vn.state.active ? 0 : 1;
  3314. }
  3315. }, this.type),
  3316. // create text node
  3317. m(_Text, {'text':this.text, 'id':this.id})
  3318. ]
  3319. )
  3320. }
  3321. };
  3322. // ______
  3323. // / ____/___ ____ ____ ________
  3324. // / __/ / __ \/ __ \/ __ \/ ___/ _ \
  3325. // / /___/ / / / /_/ / / / / /__/ __/
  3326. // /_____/_/ /_/\____/_/ /_/\___/\___/
  3327. var _Enonce = {
  3328. partid:null,
  3329. id:null,
  3330. title:null,
  3331. text:null,
  3332. nested:false,
  3333. childs:[],
  3334. oninit:function(vn){
  3335. // // console.log('Enonce on init', vn);
  3336. this.partid = vn.attrs.partid;
  3337. this.id = vn.attrs.id;
  3338. this.title = vn.attrs.title;
  3339. this.text = vn.attrs.text;
  3340. this.childs = vn.attrs.childs;
  3341. this.nested = vn.attrs.nested || false;
  3342. },
  3343. onbeforeupdate:function(vn, old) {
  3344. // console.log(vn.attrs.childs);
  3345. this.title = vn.attrs.title;
  3346. this.text = vn.attrs.text;
  3347. this.childs = vn.attrs.childs;
  3348. this.nested = vn.attrs.nested || false;
  3349. // if(vn.attrs.id == '1d1') console.log('_Enonce UPDATE, text :', vn.attrs.text);
  3350. },
  3351. view: function(vn){
  3352. // if(vn.attrs.id == '1d1') console.log('_Enonce VIEW, text :', vn.attrs.text);
  3353. return m("section", {
  3354. 'id' :this.id,
  3355. 'class' :'enonce'+(this.nested ? ' nested':'')
  3356. },
  3357. [
  3358. // create title node
  3359. m("h2", {}, this.title),
  3360. // create text node
  3361. m(_Text, {'text':this.text, 'id':this.id}),
  3362. // addd children
  3363. this.childs.map(function(c){
  3364. return m(_Item, c)
  3365. })
  3366. ])
  3367. }
  3368. }
  3369. // ____ __
  3370. // / __ \____ ______/ /_
  3371. // / /_/ / __ `/ ___/ __/
  3372. // / ____/ /_/ / / / /_
  3373. // /_/ \__,_/_/ \__/
  3374. var _Part = {
  3375. oninit: function(vn){
  3376. this.id = vn.attrs.id;
  3377. this.title = vn.attrs.title;
  3378. this.enonces = vn.attrs.enonces;
  3379. },
  3380. onbeforeupdate: function(vn, old){
  3381. // console.log('_Part, onbeforeupdate old',old);
  3382. this.title = vn.attrs.title;
  3383. this.enonces = vn.attrs.enonces;
  3384. },
  3385. view: function(vn){
  3386. // console.log(vn.attrs.enonces);
  3387. return m("section", {
  3388. 'id' :this.id,
  3389. 'class' :'part'
  3390. },
  3391. [
  3392. // create title node
  3393. m("h1", {'class':'part'}, m.trust(markdown.renderInline(this.title))),
  3394. // create text node
  3395. this.enonces.map(function(e){
  3396. // console.log(e.text);
  3397. return m(_Enonce, Object.assign({"partid":this.id},e))
  3398. })
  3399. ]
  3400. )
  3401. }
  3402. }
  3403. // ______
  3404. // /_ __/_______ ___
  3405. // / / / ___/ _ \/ _ \
  3406. // / / / / / __/ __/
  3407. // /_/ /_/ \___/\___/
  3408. module.exports = {
  3409. view: function(){
  3410. console.log('_Tree view', _dbs.lang);
  3411. return [
  3412. m(_Header),
  3413. m('main', {id:"content", 'class':'tree'}, _dbs.data[_dbs.lang].map(function(p){
  3414. // console.log("MAP _dbs", p);
  3415. return m(_Part,p);
  3416. })
  3417. ),
  3418. m(_Footer)
  3419. ]
  3420. }
  3421. }
  3422. /***/ }),
  3423. /* 23 */
  3424. /***/ (function(module, exports) {
  3425. module.exports = {
  3426. "Aacute": "Á",
  3427. "aacute": "á",
  3428. "Abreve": "Ă",
  3429. "abreve": "ă",
  3430. "ac": "∾",
  3431. "acd": "∿",
  3432. "acE": "∾̳",
  3433. "Acirc": "Â",
  3434. "acirc": "â",
  3435. "acute": "´",
  3436. "Acy": "А",
  3437. "acy": "а",
  3438. "AElig": "Æ",
  3439. "aelig": "æ",
  3440. "af": "⁡",
  3441. "Afr": "𝔄",
  3442. "afr": "𝔞",
  3443. "Agrave": "À",
  3444. "agrave": "à",
  3445. "alefsym": "ℵ",
  3446. "aleph": "ℵ",
  3447. "Alpha": "Α",
  3448. "alpha": "α",
  3449. "Amacr": "Ā",
  3450. "amacr": "ā",
  3451. "amalg": "⨿",
  3452. "amp": "&",
  3453. "AMP": "&",
  3454. "andand": "⩕",
  3455. "And": "⩓",
  3456. "and": "∧",
  3457. "andd": "⩜",
  3458. "andslope": "⩘",
  3459. "andv": "⩚",
  3460. "ang": "∠",
  3461. "ange": "⦤",
  3462. "angle": "∠",
  3463. "angmsdaa": "⦨",
  3464. "angmsdab": "⦩",
  3465. "angmsdac": "⦪",
  3466. "angmsdad": "⦫",
  3467. "angmsdae": "⦬",
  3468. "angmsdaf": "⦭",
  3469. "angmsdag": "⦮",
  3470. "angmsdah": "⦯",
  3471. "angmsd": "∡",
  3472. "angrt": "∟",
  3473. "angrtvb": "⊾",
  3474. "angrtvbd": "⦝",
  3475. "angsph": "∢",
  3476. "angst": "Å",
  3477. "angzarr": "⍼",
  3478. "Aogon": "Ą",
  3479. "aogon": "ą",
  3480. "Aopf": "𝔸",
  3481. "aopf": "𝕒",
  3482. "apacir": "⩯",
  3483. "ap": "≈",
  3484. "apE": "⩰",
  3485. "ape": "≊",
  3486. "apid": "≋",
  3487. "apos": "'",
  3488. "ApplyFunction": "⁡",
  3489. "approx": "≈",
  3490. "approxeq": "≊",
  3491. "Aring": "Å",
  3492. "aring": "å",
  3493. "Ascr": "𝒜",
  3494. "ascr": "𝒶",
  3495. "Assign": "≔",
  3496. "ast": "*",
  3497. "asymp": "≈",
  3498. "asympeq": "≍",
  3499. "Atilde": "Ã",
  3500. "atilde": "ã",
  3501. "Auml": "Ä",
  3502. "auml": "ä",
  3503. "awconint": "∳",
  3504. "awint": "⨑",
  3505. "backcong": "≌",
  3506. "backepsilon": "϶",
  3507. "backprime": "‵",
  3508. "backsim": "∽",
  3509. "backsimeq": "⋍",
  3510. "Backslash": "∖",
  3511. "Barv": "⫧",
  3512. "barvee": "⊽",
  3513. "barwed": "⌅",
  3514. "Barwed": "⌆",
  3515. "barwedge": "⌅",
  3516. "bbrk": "⎵",
  3517. "bbrktbrk": "⎶",
  3518. "bcong": "≌",
  3519. "Bcy": "Б",
  3520. "bcy": "б",
  3521. "bdquo": "„",
  3522. "becaus": "∵",
  3523. "because": "∵",
  3524. "Because": "∵",
  3525. "bemptyv": "⦰",
  3526. "bepsi": "϶",
  3527. "bernou": "ℬ",
  3528. "Bernoullis": "ℬ",
  3529. "Beta": "Β",
  3530. "beta": "β",
  3531. "beth": "ℶ",
  3532. "between": "≬",
  3533. "Bfr": "𝔅",
  3534. "bfr": "𝔟",
  3535. "bigcap": "⋂",
  3536. "bigcirc": "◯",
  3537. "bigcup": "⋃",
  3538. "bigodot": "⨀",
  3539. "bigoplus": "⨁",
  3540. "bigotimes": "⨂",
  3541. "bigsqcup": "⨆",
  3542. "bigstar": "★",
  3543. "bigtriangledown": "▽",
  3544. "bigtriangleup": "△",
  3545. "biguplus": "⨄",
  3546. "bigvee": "⋁",
  3547. "bigwedge": "⋀",
  3548. "bkarow": "⤍",
  3549. "blacklozenge": "⧫",
  3550. "blacksquare": "▪",
  3551. "blacktriangle": "▴",
  3552. "blacktriangledown": "▾",
  3553. "blacktriangleleft": "◂",
  3554. "blacktriangleright": "▸",
  3555. "blank": "␣",
  3556. "blk12": "▒",
  3557. "blk14": "░",
  3558. "blk34": "▓",
  3559. "block": "█",
  3560. "bne": "=⃥",
  3561. "bnequiv": "≡⃥",
  3562. "bNot": "⫭",
  3563. "bnot": "⌐",
  3564. "Bopf": "𝔹",
  3565. "bopf": "𝕓",
  3566. "bot": "⊥",
  3567. "bottom": "⊥",
  3568. "bowtie": "⋈",
  3569. "boxbox": "⧉",
  3570. "boxdl": "┐",
  3571. "boxdL": "╕",
  3572. "boxDl": "╖",
  3573. "boxDL": "╗",
  3574. "boxdr": "┌",
  3575. "boxdR": "╒",
  3576. "boxDr": "╓",
  3577. "boxDR": "╔",
  3578. "boxh": "─",
  3579. "boxH": "═",
  3580. "boxhd": "┬",
  3581. "boxHd": "╤",
  3582. "boxhD": "╥",
  3583. "boxHD": "╦",
  3584. "boxhu": "┴",
  3585. "boxHu": "╧",
  3586. "boxhU": "╨",
  3587. "boxHU": "╩",
  3588. "boxminus": "⊟",
  3589. "boxplus": "⊞",
  3590. "boxtimes": "⊠",
  3591. "boxul": "┘",
  3592. "boxuL": "╛",
  3593. "boxUl": "╜",
  3594. "boxUL": "╝",
  3595. "boxur": "└",
  3596. "boxuR": "╘",
  3597. "boxUr": "╙",
  3598. "boxUR": "╚",
  3599. "boxv": "│",
  3600. "boxV": "║",
  3601. "boxvh": "┼",
  3602. "boxvH": "╪",
  3603. "boxVh": "╫",
  3604. "boxVH": "╬",
  3605. "boxvl": "┤",
  3606. "boxvL": "╡",
  3607. "boxVl": "╢",
  3608. "boxVL": "╣",
  3609. "boxvr": "├",
  3610. "boxvR": "╞",
  3611. "boxVr": "╟",
  3612. "boxVR": "╠",
  3613. "bprime": "‵",
  3614. "breve": "˘",
  3615. "Breve": "˘",
  3616. "brvbar": "¦",
  3617. "bscr": "𝒷",
  3618. "Bscr": "ℬ",
  3619. "bsemi": "⁏",
  3620. "bsim": "∽",
  3621. "bsime": "⋍",
  3622. "bsolb": "⧅",
  3623. "bsol": "\\",
  3624. "bsolhsub": "⟈",
  3625. "bull": "•",
  3626. "bullet": "•",
  3627. "bump": "≎",
  3628. "bumpE": "⪮",
  3629. "bumpe": "≏",
  3630. "Bumpeq": "≎",
  3631. "bumpeq": "≏",
  3632. "Cacute": "Ć",
  3633. "cacute": "ć",
  3634. "capand": "⩄",
  3635. "capbrcup": "⩉",
  3636. "capcap": "⩋",
  3637. "cap": "∩",
  3638. "Cap": "⋒",
  3639. "capcup": "⩇",
  3640. "capdot": "⩀",
  3641. "CapitalDifferentialD": "ⅅ",
  3642. "caps": "∩︀",
  3643. "caret": "⁁",
  3644. "caron": "ˇ",
  3645. "Cayleys": "ℭ",
  3646. "ccaps": "⩍",
  3647. "Ccaron": "Č",
  3648. "ccaron": "č",
  3649. "Ccedil": "Ç",
  3650. "ccedil": "ç",
  3651. "Ccirc": "Ĉ",
  3652. "ccirc": "ĉ",
  3653. "Cconint": "∰",
  3654. "ccups": "⩌",
  3655. "ccupssm": "⩐",
  3656. "Cdot": "Ċ",
  3657. "cdot": "ċ",
  3658. "cedil": "¸",
  3659. "Cedilla": "¸",
  3660. "cemptyv": "⦲",
  3661. "cent": "¢",
  3662. "centerdot": "·",
  3663. "CenterDot": "·",
  3664. "cfr": "𝔠",
  3665. "Cfr": "ℭ",
  3666. "CHcy": "Ч",
  3667. "chcy": "ч",
  3668. "check": "✓",
  3669. "checkmark": "✓",
  3670. "Chi": "Χ",
  3671. "chi": "χ",
  3672. "circ": "ˆ",
  3673. "circeq": "≗",
  3674. "circlearrowleft": "↺",
  3675. "circlearrowright": "↻",
  3676. "circledast": "⊛",
  3677. "circledcirc": "⊚",
  3678. "circleddash": "⊝",
  3679. "CircleDot": "⊙",
  3680. "circledR": "®",
  3681. "circledS": "Ⓢ",
  3682. "CircleMinus": "⊖",
  3683. "CirclePlus": "⊕",
  3684. "CircleTimes": "⊗",
  3685. "cir": "○",
  3686. "cirE": "⧃",
  3687. "cire": "≗",
  3688. "cirfnint": "⨐",
  3689. "cirmid": "⫯",
  3690. "cirscir": "⧂",
  3691. "ClockwiseContourIntegral": "∲",
  3692. "CloseCurlyDoubleQuote": "”",
  3693. "CloseCurlyQuote": "’",
  3694. "clubs": "♣",
  3695. "clubsuit": "♣",
  3696. "colon": ":",
  3697. "Colon": "∷",
  3698. "Colone": "⩴",
  3699. "colone": "≔",
  3700. "coloneq": "≔",
  3701. "comma": ",",
  3702. "commat": "@",
  3703. "comp": "∁",
  3704. "compfn": "∘",
  3705. "complement": "∁",
  3706. "complexes": "ℂ",
  3707. "cong": "≅",
  3708. "congdot": "⩭",
  3709. "Congruent": "≡",
  3710. "conint": "∮",
  3711. "Conint": "∯",
  3712. "ContourIntegral": "∮",
  3713. "copf": "𝕔",
  3714. "Copf": "ℂ",
  3715. "coprod": "∐",
  3716. "Coproduct": "∐",
  3717. "copy": "©",
  3718. "COPY": "©",
  3719. "copysr": "℗",
  3720. "CounterClockwiseContourIntegral": "∳",
  3721. "crarr": "↵",
  3722. "cross": "✗",
  3723. "Cross": "⨯",
  3724. "Cscr": "𝒞",
  3725. "cscr": "𝒸",
  3726. "csub": "⫏",
  3727. "csube": "⫑",
  3728. "csup": "⫐",
  3729. "csupe": "⫒",
  3730. "ctdot": "⋯",
  3731. "cudarrl": "⤸",
  3732. "cudarrr": "⤵",
  3733. "cuepr": "⋞",
  3734. "cuesc": "⋟",
  3735. "cularr": "↶",
  3736. "cularrp": "⤽",
  3737. "cupbrcap": "⩈",
  3738. "cupcap": "⩆",
  3739. "CupCap": "≍",
  3740. "cup": "∪",
  3741. "Cup": "⋓",
  3742. "cupcup": "⩊",
  3743. "cupdot": "⊍",
  3744. "cupor": "⩅",
  3745. "cups": "∪︀",
  3746. "curarr": "↷",
  3747. "curarrm": "⤼",
  3748. "curlyeqprec": "⋞",
  3749. "curlyeqsucc": "⋟",
  3750. "curlyvee": "⋎",
  3751. "curlywedge": "⋏",
  3752. "curren": "¤",
  3753. "curvearrowleft": "↶",
  3754. "curvearrowright": "↷",
  3755. "cuvee": "⋎",
  3756. "cuwed": "⋏",
  3757. "cwconint": "∲",
  3758. "cwint": "∱",
  3759. "cylcty": "⌭",
  3760. "dagger": "†",
  3761. "Dagger": "‡",
  3762. "daleth": "ℸ",
  3763. "darr": "↓",
  3764. "Darr": "↡",
  3765. "dArr": "⇓",
  3766. "dash": "‐",
  3767. "Dashv": "⫤",
  3768. "dashv": "⊣",
  3769. "dbkarow": "⤏",
  3770. "dblac": "˝",
  3771. "Dcaron": "Ď",
  3772. "dcaron": "ď",
  3773. "Dcy": "Д",
  3774. "dcy": "д",
  3775. "ddagger": "‡",
  3776. "ddarr": "⇊",
  3777. "DD": "ⅅ",
  3778. "dd": "ⅆ",
  3779. "DDotrahd": "⤑",
  3780. "ddotseq": "⩷",
  3781. "deg": "°",
  3782. "Del": "∇",
  3783. "Delta": "Δ",
  3784. "delta": "δ",
  3785. "demptyv": "⦱",
  3786. "dfisht": "⥿",
  3787. "Dfr": "𝔇",
  3788. "dfr": "𝔡",
  3789. "dHar": "⥥",
  3790. "dharl": "⇃",
  3791. "dharr": "⇂",
  3792. "DiacriticalAcute": "´",
  3793. "DiacriticalDot": "˙",
  3794. "DiacriticalDoubleAcute": "˝",
  3795. "DiacriticalGrave": "`",
  3796. "DiacriticalTilde": "˜",
  3797. "diam": "⋄",
  3798. "diamond": "⋄",
  3799. "Diamond": "⋄",
  3800. "diamondsuit": "♦",
  3801. "diams": "♦",
  3802. "die": "¨",
  3803. "DifferentialD": "ⅆ",
  3804. "digamma": "ϝ",
  3805. "disin": "⋲",
  3806. "div": "÷",
  3807. "divide": "÷",
  3808. "divideontimes": "⋇",
  3809. "divonx": "⋇",
  3810. "DJcy": "Ђ",
  3811. "djcy": "ђ",
  3812. "dlcorn": "⌞",
  3813. "dlcrop": "⌍",
  3814. "dollar": "$",
  3815. "Dopf": "𝔻",
  3816. "dopf": "𝕕",
  3817. "Dot": "¨",
  3818. "dot": "˙",
  3819. "DotDot": "⃜",
  3820. "doteq": "≐",
  3821. "doteqdot": "≑",
  3822. "DotEqual": "≐",
  3823. "dotminus": "∸",
  3824. "dotplus": "∔",
  3825. "dotsquare": "⊡",
  3826. "doublebarwedge": "⌆",
  3827. "DoubleContourIntegral": "∯",
  3828. "DoubleDot": "¨",
  3829. "DoubleDownArrow": "⇓",
  3830. "DoubleLeftArrow": "⇐",
  3831. "DoubleLeftRightArrow": "⇔",
  3832. "DoubleLeftTee": "⫤",
  3833. "DoubleLongLeftArrow": "⟸",
  3834. "DoubleLongLeftRightArrow": "⟺",
  3835. "DoubleLongRightArrow": "⟹",
  3836. "DoubleRightArrow": "⇒",
  3837. "DoubleRightTee": "⊨",
  3838. "DoubleUpArrow": "⇑",
  3839. "DoubleUpDownArrow": "⇕",
  3840. "DoubleVerticalBar": "∥",
  3841. "DownArrowBar": "⤓",
  3842. "downarrow": "↓",
  3843. "DownArrow": "↓",
  3844. "Downarrow": "⇓",
  3845. "DownArrowUpArrow": "⇵",
  3846. "DownBreve": "̑",
  3847. "downdownarrows": "⇊",
  3848. "downharpoonleft": "⇃",
  3849. "downharpoonright": "⇂",
  3850. "DownLeftRightVector": "⥐",
  3851. "DownLeftTeeVector": "⥞",
  3852. "DownLeftVectorBar": "⥖",
  3853. "DownLeftVector": "↽",
  3854. "DownRightTeeVector": "⥟",
  3855. "DownRightVectorBar": "⥗",
  3856. "DownRightVector": "⇁",
  3857. "DownTeeArrow": "↧",
  3858. "DownTee": "⊤",
  3859. "drbkarow": "⤐",
  3860. "drcorn": "⌟",
  3861. "drcrop": "⌌",
  3862. "Dscr": "𝒟",
  3863. "dscr": "𝒹",
  3864. "DScy": "Ѕ",
  3865. "dscy": "ѕ",
  3866. "dsol": "⧶",
  3867. "Dstrok": "Đ",
  3868. "dstrok": "đ",
  3869. "dtdot": "⋱",
  3870. "dtri": "▿",
  3871. "dtrif": "▾",
  3872. "duarr": "⇵",
  3873. "duhar": "⥯",
  3874. "dwangle": "⦦",
  3875. "DZcy": "Џ",
  3876. "dzcy": "џ",
  3877. "dzigrarr": "⟿",
  3878. "Eacute": "É",
  3879. "eacute": "é",
  3880. "easter": "⩮",
  3881. "Ecaron": "Ě",
  3882. "ecaron": "ě",
  3883. "Ecirc": "Ê",
  3884. "ecirc": "ê",
  3885. "ecir": "≖",
  3886. "ecolon": "≕",
  3887. "Ecy": "Э",
  3888. "ecy": "э",
  3889. "eDDot": "⩷",
  3890. "Edot": "Ė",
  3891. "edot": "ė",
  3892. "eDot": "≑",
  3893. "ee": "ⅇ",
  3894. "efDot": "≒",
  3895. "Efr": "𝔈",
  3896. "efr": "𝔢",
  3897. "eg": "⪚",
  3898. "Egrave": "È",
  3899. "egrave": "è",
  3900. "egs": "⪖",
  3901. "egsdot": "⪘",
  3902. "el": "⪙",
  3903. "Element": "∈",
  3904. "elinters": "⏧",
  3905. "ell": "ℓ",
  3906. "els": "⪕",
  3907. "elsdot": "⪗",
  3908. "Emacr": "Ē",
  3909. "emacr": "ē",
  3910. "empty": "∅",
  3911. "emptyset": "∅",
  3912. "EmptySmallSquare": "◻",
  3913. "emptyv": "∅",
  3914. "EmptyVerySmallSquare": "▫",
  3915. "emsp13": " ",
  3916. "emsp14": " ",
  3917. "emsp": " ",
  3918. "ENG": "Ŋ",
  3919. "eng": "ŋ",
  3920. "ensp": " ",
  3921. "Eogon": "Ę",
  3922. "eogon": "ę",
  3923. "Eopf": "𝔼",
  3924. "eopf": "𝕖",
  3925. "epar": "⋕",
  3926. "eparsl": "⧣",
  3927. "eplus": "⩱",
  3928. "epsi": "ε",
  3929. "Epsilon": "Ε",
  3930. "epsilon": "ε",
  3931. "epsiv": "ϵ",
  3932. "eqcirc": "≖",
  3933. "eqcolon": "≕",
  3934. "eqsim": "≂",
  3935. "eqslantgtr": "⪖",
  3936. "eqslantless": "⪕",
  3937. "Equal": "⩵",
  3938. "equals": "=",
  3939. "EqualTilde": "≂",
  3940. "equest": "≟",
  3941. "Equilibrium": "⇌",
  3942. "equiv": "≡",
  3943. "equivDD": "⩸",
  3944. "eqvparsl": "⧥",
  3945. "erarr": "⥱",
  3946. "erDot": "≓",
  3947. "escr": "ℯ",
  3948. "Escr": "ℰ",
  3949. "esdot": "≐",
  3950. "Esim": "⩳",
  3951. "esim": "≂",
  3952. "Eta": "Η",
  3953. "eta": "η",
  3954. "ETH": "Ð",
  3955. "eth": "ð",
  3956. "Euml": "Ë",
  3957. "euml": "ë",
  3958. "euro": "€",
  3959. "excl": "!",
  3960. "exist": "∃",
  3961. "Exists": "∃",
  3962. "expectation": "ℰ",
  3963. "exponentiale": "ⅇ",
  3964. "ExponentialE": "ⅇ",
  3965. "fallingdotseq": "≒",
  3966. "Fcy": "Ф",
  3967. "fcy": "ф",
  3968. "female": "♀",
  3969. "ffilig": "ffi",
  3970. "fflig": "ff",
  3971. "ffllig": "ffl",
  3972. "Ffr": "𝔉",
  3973. "ffr": "𝔣",
  3974. "filig": "fi",
  3975. "FilledSmallSquare": "◼",
  3976. "FilledVerySmallSquare": "▪",
  3977. "fjlig": "fj",
  3978. "flat": "♭",
  3979. "fllig": "fl",
  3980. "fltns": "▱",
  3981. "fnof": "ƒ",
  3982. "Fopf": "𝔽",
  3983. "fopf": "𝕗",
  3984. "forall": "∀",
  3985. "ForAll": "∀",
  3986. "fork": "⋔",
  3987. "forkv": "⫙",
  3988. "Fouriertrf": "ℱ",
  3989. "fpartint": "⨍",
  3990. "frac12": "½",
  3991. "frac13": "⅓",
  3992. "frac14": "¼",
  3993. "frac15": "⅕",
  3994. "frac16": "⅙",
  3995. "frac18": "⅛",
  3996. "frac23": "⅔",
  3997. "frac25": "⅖",
  3998. "frac34": "¾",
  3999. "frac35": "⅗",
  4000. "frac38": "⅜",
  4001. "frac45": "⅘",
  4002. "frac56": "⅚",
  4003. "frac58": "⅝",
  4004. "frac78": "⅞",
  4005. "frasl": "⁄",
  4006. "frown": "⌢",
  4007. "fscr": "𝒻",
  4008. "Fscr": "ℱ",
  4009. "gacute": "ǵ",
  4010. "Gamma": "Γ",
  4011. "gamma": "γ",
  4012. "Gammad": "Ϝ",
  4013. "gammad": "ϝ",
  4014. "gap": "⪆",
  4015. "Gbreve": "Ğ",
  4016. "gbreve": "ğ",
  4017. "Gcedil": "Ģ",
  4018. "Gcirc": "Ĝ",
  4019. "gcirc": "ĝ",
  4020. "Gcy": "Г",
  4021. "gcy": "г",
  4022. "Gdot": "Ġ",
  4023. "gdot": "ġ",
  4024. "ge": "≥",
  4025. "gE": "≧",
  4026. "gEl": "⪌",
  4027. "gel": "⋛",
  4028. "geq": "≥",
  4029. "geqq": "≧",
  4030. "geqslant": "⩾",
  4031. "gescc": "⪩",
  4032. "ges": "⩾",
  4033. "gesdot": "⪀",
  4034. "gesdoto": "⪂",
  4035. "gesdotol": "⪄",
  4036. "gesl": "⋛︀",
  4037. "gesles": "⪔",
  4038. "Gfr": "𝔊",
  4039. "gfr": "𝔤",
  4040. "gg": "≫",
  4041. "Gg": "⋙",
  4042. "ggg": "⋙",
  4043. "gimel": "ℷ",
  4044. "GJcy": "Ѓ",
  4045. "gjcy": "ѓ",
  4046. "gla": "⪥",
  4047. "gl": "≷",
  4048. "glE": "⪒",
  4049. "glj": "⪤",
  4050. "gnap": "⪊",
  4051. "gnapprox": "⪊",
  4052. "gne": "⪈",
  4053. "gnE": "≩",
  4054. "gneq": "⪈",
  4055. "gneqq": "≩",
  4056. "gnsim": "⋧",
  4057. "Gopf": "𝔾",
  4058. "gopf": "𝕘",
  4059. "grave": "`",
  4060. "GreaterEqual": "≥",
  4061. "GreaterEqualLess": "⋛",
  4062. "GreaterFullEqual": "≧",
  4063. "GreaterGreater": "⪢",
  4064. "GreaterLess": "≷",
  4065. "GreaterSlantEqual": "⩾",
  4066. "GreaterTilde": "≳",
  4067. "Gscr": "𝒢",
  4068. "gscr": "ℊ",
  4069. "gsim": "≳",
  4070. "gsime": "⪎",
  4071. "gsiml": "⪐",
  4072. "gtcc": "⪧",
  4073. "gtcir": "⩺",
  4074. "gt": ">",
  4075. "GT": ">",
  4076. "Gt": "≫",
  4077. "gtdot": "⋗",
  4078. "gtlPar": "⦕",
  4079. "gtquest": "⩼",
  4080. "gtrapprox": "⪆",
  4081. "gtrarr": "⥸",
  4082. "gtrdot": "⋗",
  4083. "gtreqless": "⋛",
  4084. "gtreqqless": "⪌",
  4085. "gtrless": "≷",
  4086. "gtrsim": "≳",
  4087. "gvertneqq": "≩︀",
  4088. "gvnE": "≩︀",
  4089. "Hacek": "ˇ",
  4090. "hairsp": " ",
  4091. "half": "½",
  4092. "hamilt": "ℋ",
  4093. "HARDcy": "Ъ",
  4094. "hardcy": "ъ",
  4095. "harrcir": "⥈",
  4096. "harr": "↔",
  4097. "hArr": "⇔",
  4098. "harrw": "↭",
  4099. "Hat": "^",
  4100. "hbar": "ℏ",
  4101. "Hcirc": "Ĥ",
  4102. "hcirc": "ĥ",
  4103. "hearts": "♥",
  4104. "heartsuit": "♥",
  4105. "hellip": "…",
  4106. "hercon": "⊹",
  4107. "hfr": "𝔥",
  4108. "Hfr": "ℌ",
  4109. "HilbertSpace": "ℋ",
  4110. "hksearow": "⤥",
  4111. "hkswarow": "⤦",
  4112. "hoarr": "⇿",
  4113. "homtht": "∻",
  4114. "hookleftarrow": "↩",
  4115. "hookrightarrow": "↪",
  4116. "hopf": "𝕙",
  4117. "Hopf": "ℍ",
  4118. "horbar": "―",
  4119. "HorizontalLine": "─",
  4120. "hscr": "𝒽",
  4121. "Hscr": "ℋ",
  4122. "hslash": "ℏ",
  4123. "Hstrok": "Ħ",
  4124. "hstrok": "ħ",
  4125. "HumpDownHump": "≎",
  4126. "HumpEqual": "≏",
  4127. "hybull": "⁃",
  4128. "hyphen": "‐",
  4129. "Iacute": "Í",
  4130. "iacute": "í",
  4131. "ic": "⁣",
  4132. "Icirc": "Î",
  4133. "icirc": "î",
  4134. "Icy": "И",
  4135. "icy": "и",
  4136. "Idot": "İ",
  4137. "IEcy": "Е",
  4138. "iecy": "е",
  4139. "iexcl": "¡",
  4140. "iff": "⇔",
  4141. "ifr": "𝔦",
  4142. "Ifr": "ℑ",
  4143. "Igrave": "Ì",
  4144. "igrave": "ì",
  4145. "ii": "ⅈ",
  4146. "iiiint": "⨌",
  4147. "iiint": "∭",
  4148. "iinfin": "⧜",
  4149. "iiota": "℩",
  4150. "IJlig": "IJ",
  4151. "ijlig": "ij",
  4152. "Imacr": "Ī",
  4153. "imacr": "ī",
  4154. "image": "ℑ",
  4155. "ImaginaryI": "ⅈ",
  4156. "imagline": "ℐ",
  4157. "imagpart": "ℑ",
  4158. "imath": "ı",
  4159. "Im": "ℑ",
  4160. "imof": "⊷",
  4161. "imped": "Ƶ",
  4162. "Implies": "⇒",
  4163. "incare": "℅",
  4164. "in": "∈",
  4165. "infin": "∞",
  4166. "infintie": "⧝",
  4167. "inodot": "ı",
  4168. "intcal": "⊺",
  4169. "int": "∫",
  4170. "Int": "∬",
  4171. "integers": "ℤ",
  4172. "Integral": "∫",
  4173. "intercal": "⊺",
  4174. "Intersection": "⋂",
  4175. "intlarhk": "⨗",
  4176. "intprod": "⨼",
  4177. "InvisibleComma": "⁣",
  4178. "InvisibleTimes": "⁢",
  4179. "IOcy": "Ё",
  4180. "iocy": "ё",
  4181. "Iogon": "Į",
  4182. "iogon": "į",
  4183. "Iopf": "𝕀",
  4184. "iopf": "𝕚",
  4185. "Iota": "Ι",
  4186. "iota": "ι",
  4187. "iprod": "⨼",
  4188. "iquest": "¿",
  4189. "iscr": "𝒾",
  4190. "Iscr": "ℐ",
  4191. "isin": "∈",
  4192. "isindot": "⋵",
  4193. "isinE": "⋹",
  4194. "isins": "⋴",
  4195. "isinsv": "⋳",
  4196. "isinv": "∈",
  4197. "it": "⁢",
  4198. "Itilde": "Ĩ",
  4199. "itilde": "ĩ",
  4200. "Iukcy": "І",
  4201. "iukcy": "і",
  4202. "Iuml": "Ï",
  4203. "iuml": "ï",
  4204. "Jcirc": "Ĵ",
  4205. "jcirc": "ĵ",
  4206. "Jcy": "Й",
  4207. "jcy": "й",
  4208. "Jfr": "𝔍",
  4209. "jfr": "𝔧",
  4210. "jmath": "ȷ",
  4211. "Jopf": "𝕁",
  4212. "jopf": "𝕛",
  4213. "Jscr": "𝒥",
  4214. "jscr": "𝒿",
  4215. "Jsercy": "Ј",
  4216. "jsercy": "ј",
  4217. "Jukcy": "Є",
  4218. "jukcy": "є",
  4219. "Kappa": "Κ",
  4220. "kappa": "κ",
  4221. "kappav": "ϰ",
  4222. "Kcedil": "Ķ",
  4223. "kcedil": "ķ",
  4224. "Kcy": "К",
  4225. "kcy": "к",
  4226. "Kfr": "𝔎",
  4227. "kfr": "𝔨",
  4228. "kgreen": "ĸ",
  4229. "KHcy": "Х",
  4230. "khcy": "х",
  4231. "KJcy": "Ќ",
  4232. "kjcy": "ќ",
  4233. "Kopf": "𝕂",
  4234. "kopf": "𝕜",
  4235. "Kscr": "𝒦",
  4236. "kscr": "𝓀",
  4237. "lAarr": "⇚",
  4238. "Lacute": "Ĺ",
  4239. "lacute": "ĺ",
  4240. "laemptyv": "⦴",
  4241. "lagran": "ℒ",
  4242. "Lambda": "Λ",
  4243. "lambda": "λ",
  4244. "lang": "⟨",
  4245. "Lang": "⟪",
  4246. "langd": "⦑",
  4247. "langle": "⟨",
  4248. "lap": "⪅",
  4249. "Laplacetrf": "ℒ",
  4250. "laquo": "«",
  4251. "larrb": "⇤",
  4252. "larrbfs": "⤟",
  4253. "larr": "←",
  4254. "Larr": "↞",
  4255. "lArr": "⇐",
  4256. "larrfs": "⤝",
  4257. "larrhk": "↩",
  4258. "larrlp": "↫",
  4259. "larrpl": "⤹",
  4260. "larrsim": "⥳",
  4261. "larrtl": "↢",
  4262. "latail": "⤙",
  4263. "lAtail": "⤛",
  4264. "lat": "⪫",
  4265. "late": "⪭",
  4266. "lates": "⪭︀",
  4267. "lbarr": "⤌",
  4268. "lBarr": "⤎",
  4269. "lbbrk": "❲",
  4270. "lbrace": "{",
  4271. "lbrack": "[",
  4272. "lbrke": "⦋",
  4273. "lbrksld": "⦏",
  4274. "lbrkslu": "⦍",
  4275. "Lcaron": "Ľ",
  4276. "lcaron": "ľ",
  4277. "Lcedil": "Ļ",
  4278. "lcedil": "ļ",
  4279. "lceil": "⌈",
  4280. "lcub": "{",
  4281. "Lcy": "Л",
  4282. "lcy": "л",
  4283. "ldca": "⤶",
  4284. "ldquo": "“",
  4285. "ldquor": "„",
  4286. "ldrdhar": "⥧",
  4287. "ldrushar": "⥋",
  4288. "ldsh": "↲",
  4289. "le": "≤",
  4290. "lE": "≦",
  4291. "LeftAngleBracket": "⟨",
  4292. "LeftArrowBar": "⇤",
  4293. "leftarrow": "←",
  4294. "LeftArrow": "←",
  4295. "Leftarrow": "⇐",
  4296. "LeftArrowRightArrow": "⇆",
  4297. "leftarrowtail": "↢",
  4298. "LeftCeiling": "⌈",
  4299. "LeftDoubleBracket": "⟦",
  4300. "LeftDownTeeVector": "⥡",
  4301. "LeftDownVectorBar": "⥙",
  4302. "LeftDownVector": "⇃",
  4303. "LeftFloor": "⌊",
  4304. "leftharpoondown": "↽",
  4305. "leftharpoonup": "↼",
  4306. "leftleftarrows": "⇇",
  4307. "leftrightarrow": "↔",
  4308. "LeftRightArrow": "↔",
  4309. "Leftrightarrow": "⇔",
  4310. "leftrightarrows": "⇆",
  4311. "leftrightharpoons": "⇋",
  4312. "leftrightsquigarrow": "↭",
  4313. "LeftRightVector": "⥎",
  4314. "LeftTeeArrow": "↤",
  4315. "LeftTee": "⊣",
  4316. "LeftTeeVector": "⥚",
  4317. "leftthreetimes": "⋋",
  4318. "LeftTriangleBar": "⧏",
  4319. "LeftTriangle": "⊲",
  4320. "LeftTriangleEqual": "⊴",
  4321. "LeftUpDownVector": "⥑",
  4322. "LeftUpTeeVector": "⥠",
  4323. "LeftUpVectorBar": "⥘",
  4324. "LeftUpVector": "↿",
  4325. "LeftVectorBar": "⥒",
  4326. "LeftVector": "↼",
  4327. "lEg": "⪋",
  4328. "leg": "⋚",
  4329. "leq": "≤",
  4330. "leqq": "≦",
  4331. "leqslant": "⩽",
  4332. "lescc": "⪨",
  4333. "les": "⩽",
  4334. "lesdot": "⩿",
  4335. "lesdoto": "⪁",
  4336. "lesdotor": "⪃",
  4337. "lesg": "⋚︀",
  4338. "lesges": "⪓",
  4339. "lessapprox": "⪅",
  4340. "lessdot": "⋖",
  4341. "lesseqgtr": "⋚",
  4342. "lesseqqgtr": "⪋",
  4343. "LessEqualGreater": "⋚",
  4344. "LessFullEqual": "≦",
  4345. "LessGreater": "≶",
  4346. "lessgtr": "≶",
  4347. "LessLess": "⪡",
  4348. "lesssim": "≲",
  4349. "LessSlantEqual": "⩽",
  4350. "LessTilde": "≲",
  4351. "lfisht": "⥼",
  4352. "lfloor": "⌊",
  4353. "Lfr": "𝔏",
  4354. "lfr": "𝔩",
  4355. "lg": "≶",
  4356. "lgE": "⪑",
  4357. "lHar": "⥢",
  4358. "lhard": "↽",
  4359. "lharu": "↼",
  4360. "lharul": "⥪",
  4361. "lhblk": "▄",
  4362. "LJcy": "Љ",
  4363. "ljcy": "љ",
  4364. "llarr": "⇇",
  4365. "ll": "≪",
  4366. "Ll": "⋘",
  4367. "llcorner": "⌞",
  4368. "Lleftarrow": "⇚",
  4369. "llhard": "⥫",
  4370. "lltri": "◺",
  4371. "Lmidot": "Ŀ",
  4372. "lmidot": "ŀ",
  4373. "lmoustache": "⎰",
  4374. "lmoust": "⎰",
  4375. "lnap": "⪉",
  4376. "lnapprox": "⪉",
  4377. "lne": "⪇",
  4378. "lnE": "≨",
  4379. "lneq": "⪇",
  4380. "lneqq": "≨",
  4381. "lnsim": "⋦",
  4382. "loang": "⟬",
  4383. "loarr": "⇽",
  4384. "lobrk": "⟦",
  4385. "longleftarrow": "⟵",
  4386. "LongLeftArrow": "⟵",
  4387. "Longleftarrow": "⟸",
  4388. "longleftrightarrow": "⟷",
  4389. "LongLeftRightArrow": "⟷",
  4390. "Longleftrightarrow": "⟺",
  4391. "longmapsto": "⟼",
  4392. "longrightarrow": "⟶",
  4393. "LongRightArrow": "⟶",
  4394. "Longrightarrow": "⟹",
  4395. "looparrowleft": "↫",
  4396. "looparrowright": "↬",
  4397. "lopar": "⦅",
  4398. "Lopf": "𝕃",
  4399. "lopf": "𝕝",
  4400. "loplus": "⨭",
  4401. "lotimes": "⨴",
  4402. "lowast": "∗",
  4403. "lowbar": "_",
  4404. "LowerLeftArrow": "↙",
  4405. "LowerRightArrow": "↘",
  4406. "loz": "◊",
  4407. "lozenge": "◊",
  4408. "lozf": "⧫",
  4409. "lpar": "(",
  4410. "lparlt": "⦓",
  4411. "lrarr": "⇆",
  4412. "lrcorner": "⌟",
  4413. "lrhar": "⇋",
  4414. "lrhard": "⥭",
  4415. "lrm": "‎",
  4416. "lrtri": "⊿",
  4417. "lsaquo": "‹",
  4418. "lscr": "𝓁",
  4419. "Lscr": "ℒ",
  4420. "lsh": "↰",
  4421. "Lsh": "↰",
  4422. "lsim": "≲",
  4423. "lsime": "⪍",
  4424. "lsimg": "⪏",
  4425. "lsqb": "[",
  4426. "lsquo": "‘",
  4427. "lsquor": "‚",
  4428. "Lstrok": "Ł",
  4429. "lstrok": "ł",
  4430. "ltcc": "⪦",
  4431. "ltcir": "⩹",
  4432. "lt": "<",
  4433. "LT": "<",
  4434. "Lt": "≪",
  4435. "ltdot": "⋖",
  4436. "lthree": "⋋",
  4437. "ltimes": "⋉",
  4438. "ltlarr": "⥶",
  4439. "ltquest": "⩻",
  4440. "ltri": "◃",
  4441. "ltrie": "⊴",
  4442. "ltrif": "◂",
  4443. "ltrPar": "⦖",
  4444. "lurdshar": "⥊",
  4445. "luruhar": "⥦",
  4446. "lvertneqq": "≨︀",
  4447. "lvnE": "≨︀",
  4448. "macr": "¯",
  4449. "male": "♂",
  4450. "malt": "✠",
  4451. "maltese": "✠",
  4452. "Map": "⤅",
  4453. "map": "↦",
  4454. "mapsto": "↦",
  4455. "mapstodown": "↧",
  4456. "mapstoleft": "↤",
  4457. "mapstoup": "↥",
  4458. "marker": "▮",
  4459. "mcomma": "⨩",
  4460. "Mcy": "М",
  4461. "mcy": "м",
  4462. "mdash": "—",
  4463. "mDDot": "∺",
  4464. "measuredangle": "∡",
  4465. "MediumSpace": " ",
  4466. "Mellintrf": "ℳ",
  4467. "Mfr": "𝔐",
  4468. "mfr": "𝔪",
  4469. "mho": "℧",
  4470. "micro": "µ",
  4471. "midast": "*",
  4472. "midcir": "⫰",
  4473. "mid": "∣",
  4474. "middot": "·",
  4475. "minusb": "⊟",
  4476. "minus": "−",
  4477. "minusd": "∸",
  4478. "minusdu": "⨪",
  4479. "MinusPlus": "∓",
  4480. "mlcp": "⫛",
  4481. "mldr": "…",
  4482. "mnplus": "∓",
  4483. "models": "⊧",
  4484. "Mopf": "𝕄",
  4485. "mopf": "𝕞",
  4486. "mp": "∓",
  4487. "mscr": "𝓂",
  4488. "Mscr": "ℳ",
  4489. "mstpos": "∾",
  4490. "Mu": "Μ",
  4491. "mu": "μ",
  4492. "multimap": "⊸",
  4493. "mumap": "⊸",
  4494. "nabla": "∇",
  4495. "Nacute": "Ń",
  4496. "nacute": "ń",
  4497. "nang": "∠⃒",
  4498. "nap": "≉",
  4499. "napE": "⩰̸",
  4500. "napid": "≋̸",
  4501. "napos": "ʼn",
  4502. "napprox": "≉",
  4503. "natural": "♮",
  4504. "naturals": "ℕ",
  4505. "natur": "♮",
  4506. "nbsp": " ",
  4507. "nbump": "≎̸",
  4508. "nbumpe": "≏̸",
  4509. "ncap": "⩃",
  4510. "Ncaron": "Ň",
  4511. "ncaron": "ň",
  4512. "Ncedil": "Ņ",
  4513. "ncedil": "ņ",
  4514. "ncong": "≇",
  4515. "ncongdot": "⩭̸",
  4516. "ncup": "⩂",
  4517. "Ncy": "Н",
  4518. "ncy": "н",
  4519. "ndash": "–",
  4520. "nearhk": "⤤",
  4521. "nearr": "↗",
  4522. "neArr": "⇗",
  4523. "nearrow": "↗",
  4524. "ne": "≠",
  4525. "nedot": "≐̸",
  4526. "NegativeMediumSpace": "​",
  4527. "NegativeThickSpace": "​",
  4528. "NegativeThinSpace": "​",
  4529. "NegativeVeryThinSpace": "​",
  4530. "nequiv": "≢",
  4531. "nesear": "⤨",
  4532. "nesim": "≂̸",
  4533. "NestedGreaterGreater": "≫",
  4534. "NestedLessLess": "≪",
  4535. "NewLine": "\n",
  4536. "nexist": "∄",
  4537. "nexists": "∄",
  4538. "Nfr": "𝔑",
  4539. "nfr": "𝔫",
  4540. "ngE": "≧̸",
  4541. "nge": "≱",
  4542. "ngeq": "≱",
  4543. "ngeqq": "≧̸",
  4544. "ngeqslant": "⩾̸",
  4545. "nges": "⩾̸",
  4546. "nGg": "⋙̸",
  4547. "ngsim": "≵",
  4548. "nGt": "≫⃒",
  4549. "ngt": "≯",
  4550. "ngtr": "≯",
  4551. "nGtv": "≫̸",
  4552. "nharr": "↮",
  4553. "nhArr": "⇎",
  4554. "nhpar": "⫲",
  4555. "ni": "∋",
  4556. "nis": "⋼",
  4557. "nisd": "⋺",
  4558. "niv": "∋",
  4559. "NJcy": "Њ",
  4560. "njcy": "њ",
  4561. "nlarr": "↚",
  4562. "nlArr": "⇍",
  4563. "nldr": "‥",
  4564. "nlE": "≦̸",
  4565. "nle": "≰",
  4566. "nleftarrow": "↚",
  4567. "nLeftarrow": "⇍",
  4568. "nleftrightarrow": "↮",
  4569. "nLeftrightarrow": "⇎",
  4570. "nleq": "≰",
  4571. "nleqq": "≦̸",
  4572. "nleqslant": "⩽̸",
  4573. "nles": "⩽̸",
  4574. "nless": "≮",
  4575. "nLl": "⋘̸",
  4576. "nlsim": "≴",
  4577. "nLt": "≪⃒",
  4578. "nlt": "≮",
  4579. "nltri": "⋪",
  4580. "nltrie": "⋬",
  4581. "nLtv": "≪̸",
  4582. "nmid": "∤",
  4583. "NoBreak": "⁠",
  4584. "NonBreakingSpace": " ",
  4585. "nopf": "𝕟",
  4586. "Nopf": "ℕ",
  4587. "Not": "⫬",
  4588. "not": "¬",
  4589. "NotCongruent": "≢",
  4590. "NotCupCap": "≭",
  4591. "NotDoubleVerticalBar": "∦",
  4592. "NotElement": "∉",
  4593. "NotEqual": "≠",
  4594. "NotEqualTilde": "≂̸",
  4595. "NotExists": "∄",
  4596. "NotGreater": "≯",
  4597. "NotGreaterEqual": "≱",
  4598. "NotGreaterFullEqual": "≧̸",
  4599. "NotGreaterGreater": "≫̸",
  4600. "NotGreaterLess": "≹",
  4601. "NotGreaterSlantEqual": "⩾̸",
  4602. "NotGreaterTilde": "≵",
  4603. "NotHumpDownHump": "≎̸",
  4604. "NotHumpEqual": "≏̸",
  4605. "notin": "∉",
  4606. "notindot": "⋵̸",
  4607. "notinE": "⋹̸",
  4608. "notinva": "∉",
  4609. "notinvb": "⋷",
  4610. "notinvc": "⋶",
  4611. "NotLeftTriangleBar": "⧏̸",
  4612. "NotLeftTriangle": "⋪",
  4613. "NotLeftTriangleEqual": "⋬",
  4614. "NotLess": "≮",
  4615. "NotLessEqual": "≰",
  4616. "NotLessGreater": "≸",
  4617. "NotLessLess": "≪̸",
  4618. "NotLessSlantEqual": "⩽̸",
  4619. "NotLessTilde": "≴",
  4620. "NotNestedGreaterGreater": "⪢̸",
  4621. "NotNestedLessLess": "⪡̸",
  4622. "notni": "∌",
  4623. "notniva": "∌",
  4624. "notnivb": "⋾",
  4625. "notnivc": "⋽",
  4626. "NotPrecedes": "⊀",
  4627. "NotPrecedesEqual": "⪯̸",
  4628. "NotPrecedesSlantEqual": "⋠",
  4629. "NotReverseElement": "∌",
  4630. "NotRightTriangleBar": "⧐̸",
  4631. "NotRightTriangle": "⋫",
  4632. "NotRightTriangleEqual": "⋭",
  4633. "NotSquareSubset": "⊏̸",
  4634. "NotSquareSubsetEqual": "⋢",
  4635. "NotSquareSuperset": "⊐̸",
  4636. "NotSquareSupersetEqual": "⋣",
  4637. "NotSubset": "⊂⃒",
  4638. "NotSubsetEqual": "⊈",
  4639. "NotSucceeds": "⊁",
  4640. "NotSucceedsEqual": "⪰̸",
  4641. "NotSucceedsSlantEqual": "⋡",
  4642. "NotSucceedsTilde": "≿̸",
  4643. "NotSuperset": "⊃⃒",
  4644. "NotSupersetEqual": "⊉",
  4645. "NotTilde": "≁",
  4646. "NotTildeEqual": "≄",
  4647. "NotTildeFullEqual": "≇",
  4648. "NotTildeTilde": "≉",
  4649. "NotVerticalBar": "∤",
  4650. "nparallel": "∦",
  4651. "npar": "∦",
  4652. "nparsl": "⫽⃥",
  4653. "npart": "∂̸",
  4654. "npolint": "⨔",
  4655. "npr": "⊀",
  4656. "nprcue": "⋠",
  4657. "nprec": "⊀",
  4658. "npreceq": "⪯̸",
  4659. "npre": "⪯̸",
  4660. "nrarrc": "⤳̸",
  4661. "nrarr": "↛",
  4662. "nrArr": "⇏",
  4663. "nrarrw": "↝̸",
  4664. "nrightarrow": "↛",
  4665. "nRightarrow": "⇏",
  4666. "nrtri": "⋫",
  4667. "nrtrie": "⋭",
  4668. "nsc": "⊁",
  4669. "nsccue": "⋡",
  4670. "nsce": "⪰̸",
  4671. "Nscr": "𝒩",
  4672. "nscr": "𝓃",
  4673. "nshortmid": "∤",
  4674. "nshortparallel": "∦",
  4675. "nsim": "≁",
  4676. "nsime": "≄",
  4677. "nsimeq": "≄",
  4678. "nsmid": "∤",
  4679. "nspar": "∦",
  4680. "nsqsube": "⋢",
  4681. "nsqsupe": "⋣",
  4682. "nsub": "⊄",
  4683. "nsubE": "⫅̸",
  4684. "nsube": "⊈",
  4685. "nsubset": "⊂⃒",
  4686. "nsubseteq": "⊈",
  4687. "nsubseteqq": "⫅̸",
  4688. "nsucc": "⊁",
  4689. "nsucceq": "⪰̸",
  4690. "nsup": "⊅",
  4691. "nsupE": "⫆̸",
  4692. "nsupe": "⊉",
  4693. "nsupset": "⊃⃒",
  4694. "nsupseteq": "⊉",
  4695. "nsupseteqq": "⫆̸",
  4696. "ntgl": "≹",
  4697. "Ntilde": "Ñ",
  4698. "ntilde": "ñ",
  4699. "ntlg": "≸",
  4700. "ntriangleleft": "⋪",
  4701. "ntrianglelefteq": "⋬",
  4702. "ntriangleright": "⋫",
  4703. "ntrianglerighteq": "⋭",
  4704. "Nu": "Ν",
  4705. "nu": "ν",
  4706. "num": "#",
  4707. "numero": "№",
  4708. "numsp": " ",
  4709. "nvap": "≍⃒",
  4710. "nvdash": "⊬",
  4711. "nvDash": "⊭",
  4712. "nVdash": "⊮",
  4713. "nVDash": "⊯",
  4714. "nvge": "≥⃒",
  4715. "nvgt": ">⃒",
  4716. "nvHarr": "⤄",
  4717. "nvinfin": "⧞",
  4718. "nvlArr": "⤂",
  4719. "nvle": "≤⃒",
  4720. "nvlt": "<⃒",
  4721. "nvltrie": "⊴⃒",
  4722. "nvrArr": "⤃",
  4723. "nvrtrie": "⊵⃒",
  4724. "nvsim": "∼⃒",
  4725. "nwarhk": "⤣",
  4726. "nwarr": "↖",
  4727. "nwArr": "⇖",
  4728. "nwarrow": "↖",
  4729. "nwnear": "⤧",
  4730. "Oacute": "Ó",
  4731. "oacute": "ó",
  4732. "oast": "⊛",
  4733. "Ocirc": "Ô",
  4734. "ocirc": "ô",
  4735. "ocir": "⊚",
  4736. "Ocy": "О",
  4737. "ocy": "о",
  4738. "odash": "⊝",
  4739. "Odblac": "Ő",
  4740. "odblac": "ő",
  4741. "odiv": "⨸",
  4742. "odot": "⊙",
  4743. "odsold": "⦼",
  4744. "OElig": "Œ",
  4745. "oelig": "œ",
  4746. "ofcir": "⦿",
  4747. "Ofr": "𝔒",
  4748. "ofr": "𝔬",
  4749. "ogon": "˛",
  4750. "Ograve": "Ò",
  4751. "ograve": "ò",
  4752. "ogt": "⧁",
  4753. "ohbar": "⦵",
  4754. "ohm": "Ω",
  4755. "oint": "∮",
  4756. "olarr": "↺",
  4757. "olcir": "⦾",
  4758. "olcross": "⦻",
  4759. "oline": "‾",
  4760. "olt": "⧀",
  4761. "Omacr": "Ō",
  4762. "omacr": "ō",
  4763. "Omega": "Ω",
  4764. "omega": "ω",
  4765. "Omicron": "Ο",
  4766. "omicron": "ο",
  4767. "omid": "⦶",
  4768. "ominus": "⊖",
  4769. "Oopf": "𝕆",
  4770. "oopf": "𝕠",
  4771. "opar": "⦷",
  4772. "OpenCurlyDoubleQuote": "“",
  4773. "OpenCurlyQuote": "‘",
  4774. "operp": "⦹",
  4775. "oplus": "⊕",
  4776. "orarr": "↻",
  4777. "Or": "⩔",
  4778. "or": "∨",
  4779. "ord": "⩝",
  4780. "order": "ℴ",
  4781. "orderof": "ℴ",
  4782. "ordf": "ª",
  4783. "ordm": "º",
  4784. "origof": "⊶",
  4785. "oror": "⩖",
  4786. "orslope": "⩗",
  4787. "orv": "⩛",
  4788. "oS": "Ⓢ",
  4789. "Oscr": "𝒪",
  4790. "oscr": "ℴ",
  4791. "Oslash": "Ø",
  4792. "oslash": "ø",
  4793. "osol": "⊘",
  4794. "Otilde": "Õ",
  4795. "otilde": "õ",
  4796. "otimesas": "⨶",
  4797. "Otimes": "⨷",
  4798. "otimes": "⊗",
  4799. "Ouml": "Ö",
  4800. "ouml": "ö",
  4801. "ovbar": "⌽",
  4802. "OverBar": "‾",
  4803. "OverBrace": "⏞",
  4804. "OverBracket": "⎴",
  4805. "OverParenthesis": "⏜",
  4806. "para": "¶",
  4807. "parallel": "∥",
  4808. "par": "∥",
  4809. "parsim": "⫳",
  4810. "parsl": "⫽",
  4811. "part": "∂",
  4812. "PartialD": "∂",
  4813. "Pcy": "П",
  4814. "pcy": "п",
  4815. "percnt": "%",
  4816. "period": ".",
  4817. "permil": "‰",
  4818. "perp": "⊥",
  4819. "pertenk": "‱",
  4820. "Pfr": "𝔓",
  4821. "pfr": "𝔭",
  4822. "Phi": "Φ",
  4823. "phi": "φ",
  4824. "phiv": "ϕ",
  4825. "phmmat": "ℳ",
  4826. "phone": "☎",
  4827. "Pi": "Π",
  4828. "pi": "π",
  4829. "pitchfork": "⋔",
  4830. "piv": "ϖ",
  4831. "planck": "ℏ",
  4832. "planckh": "ℎ",
  4833. "plankv": "ℏ",
  4834. "plusacir": "⨣",
  4835. "plusb": "⊞",
  4836. "pluscir": "⨢",
  4837. "plus": "+",
  4838. "plusdo": "∔",
  4839. "plusdu": "⨥",
  4840. "pluse": "⩲",
  4841. "PlusMinus": "±",
  4842. "plusmn": "±",
  4843. "plussim": "⨦",
  4844. "plustwo": "⨧",
  4845. "pm": "±",
  4846. "Poincareplane": "ℌ",
  4847. "pointint": "⨕",
  4848. "popf": "𝕡",
  4849. "Popf": "ℙ",
  4850. "pound": "£",
  4851. "prap": "⪷",
  4852. "Pr": "⪻",
  4853. "pr": "≺",
  4854. "prcue": "≼",
  4855. "precapprox": "⪷",
  4856. "prec": "≺",
  4857. "preccurlyeq": "≼",
  4858. "Precedes": "≺",
  4859. "PrecedesEqual": "⪯",
  4860. "PrecedesSlantEqual": "≼",
  4861. "PrecedesTilde": "≾",
  4862. "preceq": "⪯",
  4863. "precnapprox": "⪹",
  4864. "precneqq": "⪵",
  4865. "precnsim": "⋨",
  4866. "pre": "⪯",
  4867. "prE": "⪳",
  4868. "precsim": "≾",
  4869. "prime": "′",
  4870. "Prime": "″",
  4871. "primes": "ℙ",
  4872. "prnap": "⪹",
  4873. "prnE": "⪵",
  4874. "prnsim": "⋨",
  4875. "prod": "∏",
  4876. "Product": "∏",
  4877. "profalar": "⌮",
  4878. "profline": "⌒",
  4879. "profsurf": "⌓",
  4880. "prop": "∝",
  4881. "Proportional": "∝",
  4882. "Proportion": "∷",
  4883. "propto": "∝",
  4884. "prsim": "≾",
  4885. "prurel": "⊰",
  4886. "Pscr": "𝒫",
  4887. "pscr": "𝓅",
  4888. "Psi": "Ψ",
  4889. "psi": "ψ",
  4890. "puncsp": " ",
  4891. "Qfr": "𝔔",
  4892. "qfr": "𝔮",
  4893. "qint": "⨌",
  4894. "qopf": "𝕢",
  4895. "Qopf": "ℚ",
  4896. "qprime": "⁗",
  4897. "Qscr": "𝒬",
  4898. "qscr": "𝓆",
  4899. "quaternions": "ℍ",
  4900. "quatint": "⨖",
  4901. "quest": "?",
  4902. "questeq": "≟",
  4903. "quot": "\"",
  4904. "QUOT": "\"",
  4905. "rAarr": "⇛",
  4906. "race": "∽̱",
  4907. "Racute": "Ŕ",
  4908. "racute": "ŕ",
  4909. "radic": "√",
  4910. "raemptyv": "⦳",
  4911. "rang": "⟩",
  4912. "Rang": "⟫",
  4913. "rangd": "⦒",
  4914. "range": "⦥",
  4915. "rangle": "⟩",
  4916. "raquo": "»",
  4917. "rarrap": "⥵",
  4918. "rarrb": "⇥",
  4919. "rarrbfs": "⤠",
  4920. "rarrc": "⤳",
  4921. "rarr": "→",
  4922. "Rarr": "↠",
  4923. "rArr": "⇒",
  4924. "rarrfs": "⤞",
  4925. "rarrhk": "↪",
  4926. "rarrlp": "↬",
  4927. "rarrpl": "⥅",
  4928. "rarrsim": "⥴",
  4929. "Rarrtl": "⤖",
  4930. "rarrtl": "↣",
  4931. "rarrw": "↝",
  4932. "ratail": "⤚",
  4933. "rAtail": "⤜",
  4934. "ratio": "∶",
  4935. "rationals": "ℚ",
  4936. "rbarr": "⤍",
  4937. "rBarr": "⤏",
  4938. "RBarr": "⤐",
  4939. "rbbrk": "❳",
  4940. "rbrace": "}",
  4941. "rbrack": "]",
  4942. "rbrke": "⦌",
  4943. "rbrksld": "⦎",
  4944. "rbrkslu": "⦐",
  4945. "Rcaron": "Ř",
  4946. "rcaron": "ř",
  4947. "Rcedil": "Ŗ",
  4948. "rcedil": "ŗ",
  4949. "rceil": "⌉",
  4950. "rcub": "}",
  4951. "Rcy": "Р",
  4952. "rcy": "р",
  4953. "rdca": "⤷",
  4954. "rdldhar": "⥩",
  4955. "rdquo": "”",
  4956. "rdquor": "”",
  4957. "rdsh": "↳",
  4958. "real": "ℜ",
  4959. "realine": "ℛ",
  4960. "realpart": "ℜ",
  4961. "reals": "ℝ",
  4962. "Re": "ℜ",
  4963. "rect": "▭",
  4964. "reg": "®",
  4965. "REG": "®",
  4966. "ReverseElement": "∋",
  4967. "ReverseEquilibrium": "⇋",
  4968. "ReverseUpEquilibrium": "⥯",
  4969. "rfisht": "⥽",
  4970. "rfloor": "⌋",
  4971. "rfr": "𝔯",
  4972. "Rfr": "ℜ",
  4973. "rHar": "⥤",
  4974. "rhard": "⇁",
  4975. "rharu": "⇀",
  4976. "rharul": "⥬",
  4977. "Rho": "Ρ",
  4978. "rho": "ρ",
  4979. "rhov": "ϱ",
  4980. "RightAngleBracket": "⟩",
  4981. "RightArrowBar": "⇥",
  4982. "rightarrow": "→",
  4983. "RightArrow": "→",
  4984. "Rightarrow": "⇒",
  4985. "RightArrowLeftArrow": "⇄",
  4986. "rightarrowtail": "↣",
  4987. "RightCeiling": "⌉",
  4988. "RightDoubleBracket": "⟧",
  4989. "RightDownTeeVector": "⥝",
  4990. "RightDownVectorBar": "⥕",
  4991. "RightDownVector": "⇂",
  4992. "RightFloor": "⌋",
  4993. "rightharpoondown": "⇁",
  4994. "rightharpoonup": "⇀",
  4995. "rightleftarrows": "⇄",
  4996. "rightleftharpoons": "⇌",
  4997. "rightrightarrows": "⇉",
  4998. "rightsquigarrow": "↝",
  4999. "RightTeeArrow": "↦",
  5000. "RightTee": "⊢",
  5001. "RightTeeVector": "⥛",
  5002. "rightthreetimes": "⋌",
  5003. "RightTriangleBar": "⧐",
  5004. "RightTriangle": "⊳",
  5005. "RightTriangleEqual": "⊵",
  5006. "RightUpDownVector": "⥏",
  5007. "RightUpTeeVector": "⥜",
  5008. "RightUpVectorBar": "⥔",
  5009. "RightUpVector": "↾",
  5010. "RightVectorBar": "⥓",
  5011. "RightVector": "⇀",
  5012. "ring": "˚",
  5013. "risingdotseq": "≓",
  5014. "rlarr": "⇄",
  5015. "rlhar": "⇌",
  5016. "rlm": "‏",
  5017. "rmoustache": "⎱",
  5018. "rmoust": "⎱",
  5019. "rnmid": "⫮",
  5020. "roang": "⟭",
  5021. "roarr": "⇾",
  5022. "robrk": "⟧",
  5023. "ropar": "⦆",
  5024. "ropf": "𝕣",
  5025. "Ropf": "ℝ",
  5026. "roplus": "⨮",
  5027. "rotimes": "⨵",
  5028. "RoundImplies": "⥰",
  5029. "rpar": ")",
  5030. "rpargt": "⦔",
  5031. "rppolint": "⨒",
  5032. "rrarr": "⇉",
  5033. "Rrightarrow": "⇛",
  5034. "rsaquo": "›",
  5035. "rscr": "𝓇",
  5036. "Rscr": "ℛ",
  5037. "rsh": "↱",
  5038. "Rsh": "↱",
  5039. "rsqb": "]",
  5040. "rsquo": "’",
  5041. "rsquor": "’",
  5042. "rthree": "⋌",
  5043. "rtimes": "⋊",
  5044. "rtri": "▹",
  5045. "rtrie": "⊵",
  5046. "rtrif": "▸",
  5047. "rtriltri": "⧎",
  5048. "RuleDelayed": "⧴",
  5049. "ruluhar": "⥨",
  5050. "rx": "℞",
  5051. "Sacute": "Ś",
  5052. "sacute": "ś",
  5053. "sbquo": "‚",
  5054. "scap": "⪸",
  5055. "Scaron": "Š",
  5056. "scaron": "š",
  5057. "Sc": "⪼",
  5058. "sc": "≻",
  5059. "sccue": "≽",
  5060. "sce": "⪰",
  5061. "scE": "⪴",
  5062. "Scedil": "Ş",
  5063. "scedil": "ş",
  5064. "Scirc": "Ŝ",
  5065. "scirc": "ŝ",
  5066. "scnap": "⪺",
  5067. "scnE": "⪶",
  5068. "scnsim": "⋩",
  5069. "scpolint": "⨓",
  5070. "scsim": "≿",
  5071. "Scy": "С",
  5072. "scy": "с",
  5073. "sdotb": "⊡",
  5074. "sdot": "⋅",
  5075. "sdote": "⩦",
  5076. "searhk": "⤥",
  5077. "searr": "↘",
  5078. "seArr": "⇘",
  5079. "searrow": "↘",
  5080. "sect": "§",
  5081. "semi": ";",
  5082. "seswar": "⤩",
  5083. "setminus": "∖",
  5084. "setmn": "∖",
  5085. "sext": "✶",
  5086. "Sfr": "𝔖",
  5087. "sfr": "𝔰",
  5088. "sfrown": "⌢",
  5089. "sharp": "♯",
  5090. "SHCHcy": "Щ",
  5091. "shchcy": "щ",
  5092. "SHcy": "Ш",
  5093. "shcy": "ш",
  5094. "ShortDownArrow": "↓",
  5095. "ShortLeftArrow": "←",
  5096. "shortmid": "∣",
  5097. "shortparallel": "∥",
  5098. "ShortRightArrow": "→",
  5099. "ShortUpArrow": "↑",
  5100. "shy": "­",
  5101. "Sigma": "Σ",
  5102. "sigma": "σ",
  5103. "sigmaf": "ς",
  5104. "sigmav": "ς",
  5105. "sim": "∼",
  5106. "simdot": "⩪",
  5107. "sime": "≃",
  5108. "simeq": "≃",
  5109. "simg": "⪞",
  5110. "simgE": "⪠",
  5111. "siml": "⪝",
  5112. "simlE": "⪟",
  5113. "simne": "≆",
  5114. "simplus": "⨤",
  5115. "simrarr": "⥲",
  5116. "slarr": "←",
  5117. "SmallCircle": "∘",
  5118. "smallsetminus": "∖",
  5119. "smashp": "⨳",
  5120. "smeparsl": "⧤",
  5121. "smid": "∣",
  5122. "smile": "⌣",
  5123. "smt": "⪪",
  5124. "smte": "⪬",
  5125. "smtes": "⪬︀",
  5126. "SOFTcy": "Ь",
  5127. "softcy": "ь",
  5128. "solbar": "⌿",
  5129. "solb": "⧄",
  5130. "sol": "/",
  5131. "Sopf": "𝕊",
  5132. "sopf": "𝕤",
  5133. "spades": "♠",
  5134. "spadesuit": "♠",
  5135. "spar": "∥",
  5136. "sqcap": "⊓",
  5137. "sqcaps": "⊓︀",
  5138. "sqcup": "⊔",
  5139. "sqcups": "⊔︀",
  5140. "Sqrt": "√",
  5141. "sqsub": "⊏",
  5142. "sqsube": "⊑",
  5143. "sqsubset": "⊏",
  5144. "sqsubseteq": "⊑",
  5145. "sqsup": "⊐",
  5146. "sqsupe": "⊒",
  5147. "sqsupset": "⊐",
  5148. "sqsupseteq": "⊒",
  5149. "square": "□",
  5150. "Square": "□",
  5151. "SquareIntersection": "⊓",
  5152. "SquareSubset": "⊏",
  5153. "SquareSubsetEqual": "⊑",
  5154. "SquareSuperset": "⊐",
  5155. "SquareSupersetEqual": "⊒",
  5156. "SquareUnion": "⊔",
  5157. "squarf": "▪",
  5158. "squ": "□",
  5159. "squf": "▪",
  5160. "srarr": "→",
  5161. "Sscr": "𝒮",
  5162. "sscr": "𝓈",
  5163. "ssetmn": "∖",
  5164. "ssmile": "⌣",
  5165. "sstarf": "⋆",
  5166. "Star": "⋆",
  5167. "star": "☆",
  5168. "starf": "★",
  5169. "straightepsilon": "ϵ",
  5170. "straightphi": "ϕ",
  5171. "strns": "¯",
  5172. "sub": "⊂",
  5173. "Sub": "⋐",
  5174. "subdot": "⪽",
  5175. "subE": "⫅",
  5176. "sube": "⊆",
  5177. "subedot": "⫃",
  5178. "submult": "⫁",
  5179. "subnE": "⫋",
  5180. "subne": "⊊",
  5181. "subplus": "⪿",
  5182. "subrarr": "⥹",
  5183. "subset": "⊂",
  5184. "Subset": "⋐",
  5185. "subseteq": "⊆",
  5186. "subseteqq": "⫅",
  5187. "SubsetEqual": "⊆",
  5188. "subsetneq": "⊊",
  5189. "subsetneqq": "⫋",
  5190. "subsim": "⫇",
  5191. "subsub": "⫕",
  5192. "subsup": "⫓",
  5193. "succapprox": "⪸",
  5194. "succ": "≻",
  5195. "succcurlyeq": "≽",
  5196. "Succeeds": "≻",
  5197. "SucceedsEqual": "⪰",
  5198. "SucceedsSlantEqual": "≽",
  5199. "SucceedsTilde": "≿",
  5200. "succeq": "⪰",
  5201. "succnapprox": "⪺",
  5202. "succneqq": "⪶",
  5203. "succnsim": "⋩",
  5204. "succsim": "≿",
  5205. "SuchThat": "∋",
  5206. "sum": "∑",
  5207. "Sum": "∑",
  5208. "sung": "♪",
  5209. "sup1": "¹",
  5210. "sup2": "²",
  5211. "sup3": "³",
  5212. "sup": "⊃",
  5213. "Sup": "⋑",
  5214. "supdot": "⪾",
  5215. "supdsub": "⫘",
  5216. "supE": "⫆",
  5217. "supe": "⊇",
  5218. "supedot": "⫄",
  5219. "Superset": "⊃",
  5220. "SupersetEqual": "⊇",
  5221. "suphsol": "⟉",
  5222. "suphsub": "⫗",
  5223. "suplarr": "⥻",
  5224. "supmult": "⫂",
  5225. "supnE": "⫌",
  5226. "supne": "⊋",
  5227. "supplus": "⫀",
  5228. "supset": "⊃",
  5229. "Supset": "⋑",
  5230. "supseteq": "⊇",
  5231. "supseteqq": "⫆",
  5232. "supsetneq": "⊋",
  5233. "supsetneqq": "⫌",
  5234. "supsim": "⫈",
  5235. "supsub": "⫔",
  5236. "supsup": "⫖",
  5237. "swarhk": "⤦",
  5238. "swarr": "↙",
  5239. "swArr": "⇙",
  5240. "swarrow": "↙",
  5241. "swnwar": "⤪",
  5242. "szlig": "ß",
  5243. "Tab": "\t",
  5244. "target": "⌖",
  5245. "Tau": "Τ",
  5246. "tau": "τ",
  5247. "tbrk": "⎴",
  5248. "Tcaron": "Ť",
  5249. "tcaron": "ť",
  5250. "Tcedil": "Ţ",
  5251. "tcedil": "ţ",
  5252. "Tcy": "Т",
  5253. "tcy": "т",
  5254. "tdot": "⃛",
  5255. "telrec": "⌕",
  5256. "Tfr": "𝔗",
  5257. "tfr": "𝔱",
  5258. "there4": "∴",
  5259. "therefore": "∴",
  5260. "Therefore": "∴",
  5261. "Theta": "Θ",
  5262. "theta": "θ",
  5263. "thetasym": "ϑ",
  5264. "thetav": "ϑ",
  5265. "thickapprox": "≈",
  5266. "thicksim": "∼",
  5267. "ThickSpace": "  ",
  5268. "ThinSpace": " ",
  5269. "thinsp": " ",
  5270. "thkap": "≈",
  5271. "thksim": "∼",
  5272. "THORN": "Þ",
  5273. "thorn": "þ",
  5274. "tilde": "˜",
  5275. "Tilde": "∼",
  5276. "TildeEqual": "≃",
  5277. "TildeFullEqual": "≅",
  5278. "TildeTilde": "≈",
  5279. "timesbar": "⨱",
  5280. "timesb": "⊠",
  5281. "times": "×",
  5282. "timesd": "⨰",
  5283. "tint": "∭",
  5284. "toea": "⤨",
  5285. "topbot": "⌶",
  5286. "topcir": "⫱",
  5287. "top": "⊤",
  5288. "Topf": "𝕋",
  5289. "topf": "𝕥",
  5290. "topfork": "⫚",
  5291. "tosa": "⤩",
  5292. "tprime": "‴",
  5293. "trade": "™",
  5294. "TRADE": "™",
  5295. "triangle": "▵",
  5296. "triangledown": "▿",
  5297. "triangleleft": "◃",
  5298. "trianglelefteq": "⊴",
  5299. "triangleq": "≜",
  5300. "triangleright": "▹",
  5301. "trianglerighteq": "⊵",
  5302. "tridot": "◬",
  5303. "trie": "≜",
  5304. "triminus": "⨺",
  5305. "TripleDot": "⃛",
  5306. "triplus": "⨹",
  5307. "trisb": "⧍",
  5308. "tritime": "⨻",
  5309. "trpezium": "⏢",
  5310. "Tscr": "𝒯",
  5311. "tscr": "𝓉",
  5312. "TScy": "Ц",
  5313. "tscy": "ц",
  5314. "TSHcy": "Ћ",
  5315. "tshcy": "ћ",
  5316. "Tstrok": "Ŧ",
  5317. "tstrok": "ŧ",
  5318. "twixt": "≬",
  5319. "twoheadleftarrow": "↞",
  5320. "twoheadrightarrow": "↠",
  5321. "Uacute": "Ú",
  5322. "uacute": "ú",
  5323. "uarr": "↑",
  5324. "Uarr": "↟",
  5325. "uArr": "⇑",
  5326. "Uarrocir": "⥉",
  5327. "Ubrcy": "Ў",
  5328. "ubrcy": "ў",
  5329. "Ubreve": "Ŭ",
  5330. "ubreve": "ŭ",
  5331. "Ucirc": "Û",
  5332. "ucirc": "û",
  5333. "Ucy": "У",
  5334. "ucy": "у",
  5335. "udarr": "⇅",
  5336. "Udblac": "Ű",
  5337. "udblac": "ű",
  5338. "udhar": "⥮",
  5339. "ufisht": "⥾",
  5340. "Ufr": "𝔘",
  5341. "ufr": "𝔲",
  5342. "Ugrave": "Ù",
  5343. "ugrave": "ù",
  5344. "uHar": "⥣",
  5345. "uharl": "↿",
  5346. "uharr": "↾",
  5347. "uhblk": "▀",
  5348. "ulcorn": "⌜",
  5349. "ulcorner": "⌜",
  5350. "ulcrop": "⌏",
  5351. "ultri": "◸",
  5352. "Umacr": "Ū",
  5353. "umacr": "ū",
  5354. "uml": "¨",
  5355. "UnderBar": "_",
  5356. "UnderBrace": "⏟",
  5357. "UnderBracket": "⎵",
  5358. "UnderParenthesis": "⏝",
  5359. "Union": "⋃",
  5360. "UnionPlus": "⊎",
  5361. "Uogon": "Ų",
  5362. "uogon": "ų",
  5363. "Uopf": "𝕌",
  5364. "uopf": "𝕦",
  5365. "UpArrowBar": "⤒",
  5366. "uparrow": "↑",
  5367. "UpArrow": "↑",
  5368. "Uparrow": "⇑",
  5369. "UpArrowDownArrow": "⇅",
  5370. "updownarrow": "↕",
  5371. "UpDownArrow": "↕",
  5372. "Updownarrow": "⇕",
  5373. "UpEquilibrium": "⥮",
  5374. "upharpoonleft": "↿",
  5375. "upharpoonright": "↾",
  5376. "uplus": "⊎",
  5377. "UpperLeftArrow": "↖",
  5378. "UpperRightArrow": "↗",
  5379. "upsi": "υ",
  5380. "Upsi": "ϒ",
  5381. "upsih": "ϒ",
  5382. "Upsilon": "Υ",
  5383. "upsilon": "υ",
  5384. "UpTeeArrow": "↥",
  5385. "UpTee": "⊥",
  5386. "upuparrows": "⇈",
  5387. "urcorn": "⌝",
  5388. "urcorner": "⌝",
  5389. "urcrop": "⌎",
  5390. "Uring": "Ů",
  5391. "uring": "ů",
  5392. "urtri": "◹",
  5393. "Uscr": "𝒰",
  5394. "uscr": "𝓊",
  5395. "utdot": "⋰",
  5396. "Utilde": "Ũ",
  5397. "utilde": "ũ",
  5398. "utri": "▵",
  5399. "utrif": "▴",
  5400. "uuarr": "⇈",
  5401. "Uuml": "Ü",
  5402. "uuml": "ü",
  5403. "uwangle": "⦧",
  5404. "vangrt": "⦜",
  5405. "varepsilon": "ϵ",
  5406. "varkappa": "ϰ",
  5407. "varnothing": "∅",
  5408. "varphi": "ϕ",
  5409. "varpi": "ϖ",
  5410. "varpropto": "∝",
  5411. "varr": "↕",
  5412. "vArr": "⇕",
  5413. "varrho": "ϱ",
  5414. "varsigma": "ς",
  5415. "varsubsetneq": "⊊︀",
  5416. "varsubsetneqq": "⫋︀",
  5417. "varsupsetneq": "⊋︀",
  5418. "varsupsetneqq": "⫌︀",
  5419. "vartheta": "ϑ",
  5420. "vartriangleleft": "⊲",
  5421. "vartriangleright": "⊳",
  5422. "vBar": "⫨",
  5423. "Vbar": "⫫",
  5424. "vBarv": "⫩",
  5425. "Vcy": "В",
  5426. "vcy": "в",
  5427. "vdash": "⊢",
  5428. "vDash": "⊨",
  5429. "Vdash": "⊩",
  5430. "VDash": "⊫",
  5431. "Vdashl": "⫦",
  5432. "veebar": "⊻",
  5433. "vee": "∨",
  5434. "Vee": "⋁",
  5435. "veeeq": "≚",
  5436. "vellip": "⋮",
  5437. "verbar": "|",
  5438. "Verbar": "‖",
  5439. "vert": "|",
  5440. "Vert": "‖",
  5441. "VerticalBar": "∣",
  5442. "VerticalLine": "|",
  5443. "VerticalSeparator": "❘",
  5444. "VerticalTilde": "≀",
  5445. "VeryThinSpace": " ",
  5446. "Vfr": "𝔙",
  5447. "vfr": "𝔳",
  5448. "vltri": "⊲",
  5449. "vnsub": "⊂⃒",
  5450. "vnsup": "⊃⃒",
  5451. "Vopf": "𝕍",
  5452. "vopf": "𝕧",
  5453. "vprop": "∝",
  5454. "vrtri": "⊳",
  5455. "Vscr": "𝒱",
  5456. "vscr": "𝓋",
  5457. "vsubnE": "⫋︀",
  5458. "vsubne": "⊊︀",
  5459. "vsupnE": "⫌︀",
  5460. "vsupne": "⊋︀",
  5461. "Vvdash": "⊪",
  5462. "vzigzag": "⦚",
  5463. "Wcirc": "Ŵ",
  5464. "wcirc": "ŵ",
  5465. "wedbar": "⩟",
  5466. "wedge": "∧",
  5467. "Wedge": "⋀",
  5468. "wedgeq": "≙",
  5469. "weierp": "℘",
  5470. "Wfr": "𝔚",
  5471. "wfr": "𝔴",
  5472. "Wopf": "𝕎",
  5473. "wopf": "𝕨",
  5474. "wp": "℘",
  5475. "wr": "≀",
  5476. "wreath": "≀",
  5477. "Wscr": "𝒲",
  5478. "wscr": "𝓌",
  5479. "xcap": "⋂",
  5480. "xcirc": "◯",
  5481. "xcup": "⋃",
  5482. "xdtri": "▽",
  5483. "Xfr": "𝔛",
  5484. "xfr": "𝔵",
  5485. "xharr": "⟷",
  5486. "xhArr": "⟺",
  5487. "Xi": "Ξ",
  5488. "xi": "ξ",
  5489. "xlarr": "⟵",
  5490. "xlArr": "⟸",
  5491. "xmap": "⟼",
  5492. "xnis": "⋻",
  5493. "xodot": "⨀",
  5494. "Xopf": "𝕏",
  5495. "xopf": "𝕩",
  5496. "xoplus": "⨁",
  5497. "xotime": "⨂",
  5498. "xrarr": "⟶",
  5499. "xrArr": "⟹",
  5500. "Xscr": "𝒳",
  5501. "xscr": "𝓍",
  5502. "xsqcup": "⨆",
  5503. "xuplus": "⨄",
  5504. "xutri": "△",
  5505. "xvee": "⋁",
  5506. "xwedge": "⋀",
  5507. "Yacute": "Ý",
  5508. "yacute": "ý",
  5509. "YAcy": "Я",
  5510. "yacy": "я",
  5511. "Ycirc": "Ŷ",
  5512. "ycirc": "ŷ",
  5513. "Ycy": "Ы",
  5514. "ycy": "ы",
  5515. "yen": "¥",
  5516. "Yfr": "𝔜",
  5517. "yfr": "𝔶",
  5518. "YIcy": "Ї",
  5519. "yicy": "ї",
  5520. "Yopf": "𝕐",
  5521. "yopf": "𝕪",
  5522. "Yscr": "𝒴",
  5523. "yscr": "𝓎",
  5524. "YUcy": "Ю",
  5525. "yucy": "ю",
  5526. "yuml": "ÿ",
  5527. "Yuml": "Ÿ",
  5528. "Zacute": "Ź",
  5529. "zacute": "ź",
  5530. "Zcaron": "Ž",
  5531. "zcaron": "ž",
  5532. "Zcy": "З",
  5533. "zcy": "з",
  5534. "Zdot": "Ż",
  5535. "zdot": "ż",
  5536. "zeetrf": "ℨ",
  5537. "ZeroWidthSpace": "​",
  5538. "Zeta": "Ζ",
  5539. "zeta": "ζ",
  5540. "zfr": "𝔷",
  5541. "Zfr": "ℨ",
  5542. "ZHcy": "Ж",
  5543. "zhcy": "ж",
  5544. "zigrarr": "⇝",
  5545. "zopf": "𝕫",
  5546. "Zopf": "ℤ",
  5547. "Zscr": "𝒵",
  5548. "zscr": "𝓏",
  5549. "zwj": "‍",
  5550. "zwnj": "‌"
  5551. };
  5552. /***/ }),
  5553. /* 24 */
  5554. /***/ (function(module, exports) {
  5555. // removed by extract-text-webpack-plugin
  5556. /***/ }),
  5557. /* 25 */
  5558. /***/ (function(module, exports) {
  5559. // removed by extract-text-webpack-plugin
  5560. /***/ }),
  5561. /* 26 */
  5562. /***/ (function(module, exports) {
  5563. // removed by extract-text-webpack-plugin
  5564. /***/ }),
  5565. /* 27 */
  5566. /***/ (function(module, exports) {
  5567. // removed by extract-text-webpack-plugin
  5568. /***/ }),
  5569. /* 28 */
  5570. /***/ (function(module, exports, __webpack_require__) {
  5571. "use strict";
  5572. ////////////////////////////////////////////////////////////////////////////////
  5573. // Helpers
  5574. // Merge objects
  5575. //
  5576. function assign(obj /*from1, from2, from3, ...*/) {
  5577. var sources = Array.prototype.slice.call(arguments, 1);
  5578. sources.forEach(function (source) {
  5579. if (!source) { return; }
  5580. Object.keys(source).forEach(function (key) {
  5581. obj[key] = source[key];
  5582. });
  5583. });
  5584. return obj;
  5585. }
  5586. function _class(obj) { return Object.prototype.toString.call(obj); }
  5587. function isString(obj) { return _class(obj) === '[object String]'; }
  5588. function isObject(obj) { return _class(obj) === '[object Object]'; }
  5589. function isRegExp(obj) { return _class(obj) === '[object RegExp]'; }
  5590. function isFunction(obj) { return _class(obj) === '[object Function]'; }
  5591. function escapeRE(str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); }
  5592. ////////////////////////////////////////////////////////////////////////////////
  5593. var defaultOptions = {
  5594. fuzzyLink: true,
  5595. fuzzyEmail: true,
  5596. fuzzyIP: false
  5597. };
  5598. function isOptionsObj(obj) {
  5599. return Object.keys(obj || {}).reduce(function (acc, k) {
  5600. return acc || defaultOptions.hasOwnProperty(k);
  5601. }, false);
  5602. }
  5603. var defaultSchemas = {
  5604. 'http:': {
  5605. validate: function (text, pos, self) {
  5606. var tail = text.slice(pos);
  5607. if (!self.re.http) {
  5608. // compile lazily, because "host"-containing variables can change on tlds update.
  5609. self.re.http = new RegExp(
  5610. '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'
  5611. );
  5612. }
  5613. if (self.re.http.test(tail)) {
  5614. return tail.match(self.re.http)[0].length;
  5615. }
  5616. return 0;
  5617. }
  5618. },
  5619. 'https:': 'http:',
  5620. 'ftp:': 'http:',
  5621. '//': {
  5622. validate: function (text, pos, self) {
  5623. var tail = text.slice(pos);
  5624. if (!self.re.no_http) {
  5625. // compile lazily, because "host"-containing variables can change on tlds update.
  5626. self.re.no_http = new RegExp(
  5627. '^' +
  5628. self.re.src_auth +
  5629. // Don't allow single-level domains, because of false positives like '//test'
  5630. // with code comments
  5631. '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' +
  5632. self.re.src_port +
  5633. self.re.src_host_terminator +
  5634. self.re.src_path,
  5635. 'i'
  5636. );
  5637. }
  5638. if (self.re.no_http.test(tail)) {
  5639. // should not be `://` & `///`, that protects from errors in protocol name
  5640. if (pos >= 3 && text[pos - 3] === ':') { return 0; }
  5641. if (pos >= 3 && text[pos - 3] === '/') { return 0; }
  5642. return tail.match(self.re.no_http)[0].length;
  5643. }
  5644. return 0;
  5645. }
  5646. },
  5647. 'mailto:': {
  5648. validate: function (text, pos, self) {
  5649. var tail = text.slice(pos);
  5650. if (!self.re.mailto) {
  5651. self.re.mailto = new RegExp(
  5652. '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'
  5653. );
  5654. }
  5655. if (self.re.mailto.test(tail)) {
  5656. return tail.match(self.re.mailto)[0].length;
  5657. }
  5658. return 0;
  5659. }
  5660. }
  5661. };
  5662. /*eslint-disable max-len*/
  5663. // RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)
  5664. var tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
  5665. // DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
  5666. var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
  5667. /*eslint-enable max-len*/
  5668. ////////////////////////////////////////////////////////////////////////////////
  5669. function resetScanCache(self) {
  5670. self.__index__ = -1;
  5671. self.__text_cache__ = '';
  5672. }
  5673. function createValidator(re) {
  5674. return function (text, pos) {
  5675. var tail = text.slice(pos);
  5676. if (re.test(tail)) {
  5677. return tail.match(re)[0].length;
  5678. }
  5679. return 0;
  5680. };
  5681. }
  5682. function createNormalizer() {
  5683. return function (match, self) {
  5684. self.normalize(match);
  5685. };
  5686. }
  5687. // Schemas compiler. Build regexps.
  5688. //
  5689. function compile(self) {
  5690. // Load & clone RE patterns.
  5691. var re = self.re = __webpack_require__(29)(self.__opts__);
  5692. // Define dynamic patterns
  5693. var tlds = self.__tlds__.slice();
  5694. self.onCompile();
  5695. if (!self.__tlds_replaced__) {
  5696. tlds.push(tlds_2ch_src_re);
  5697. }
  5698. tlds.push(re.src_xn);
  5699. re.src_tlds = tlds.join('|');
  5700. function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); }
  5701. re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i');
  5702. re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i');
  5703. re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i');
  5704. re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i');
  5705. //
  5706. // Compile each schema
  5707. //
  5708. var aliases = [];
  5709. self.__compiled__ = {}; // Reset compiled data
  5710. function schemaError(name, val) {
  5711. throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val);
  5712. }
  5713. Object.keys(self.__schemas__).forEach(function (name) {
  5714. var val = self.__schemas__[name];
  5715. // skip disabled methods
  5716. if (val === null) { return; }
  5717. var compiled = { validate: null, link: null };
  5718. self.__compiled__[name] = compiled;
  5719. if (isObject(val)) {
  5720. if (isRegExp(val.validate)) {
  5721. compiled.validate = createValidator(val.validate);
  5722. } else if (isFunction(val.validate)) {
  5723. compiled.validate = val.validate;
  5724. } else {
  5725. schemaError(name, val);
  5726. }
  5727. if (isFunction(val.normalize)) {
  5728. compiled.normalize = val.normalize;
  5729. } else if (!val.normalize) {
  5730. compiled.normalize = createNormalizer();
  5731. } else {
  5732. schemaError(name, val);
  5733. }
  5734. return;
  5735. }
  5736. if (isString(val)) {
  5737. aliases.push(name);
  5738. return;
  5739. }
  5740. schemaError(name, val);
  5741. });
  5742. //
  5743. // Compile postponed aliases
  5744. //
  5745. aliases.forEach(function (alias) {
  5746. if (!self.__compiled__[self.__schemas__[alias]]) {
  5747. // Silently fail on missed schemas to avoid errons on disable.
  5748. // schemaError(alias, self.__schemas__[alias]);
  5749. return;
  5750. }
  5751. self.__compiled__[alias].validate =
  5752. self.__compiled__[self.__schemas__[alias]].validate;
  5753. self.__compiled__[alias].normalize =
  5754. self.__compiled__[self.__schemas__[alias]].normalize;
  5755. });
  5756. //
  5757. // Fake record for guessed links
  5758. //
  5759. self.__compiled__[''] = { validate: null, normalize: createNormalizer() };
  5760. //
  5761. // Build schema condition
  5762. //
  5763. var slist = Object.keys(self.__compiled__)
  5764. .filter(function (name) {
  5765. // Filter disabled & fake schemas
  5766. return name.length > 0 && self.__compiled__[name];
  5767. })
  5768. .map(escapeRE)
  5769. .join('|');
  5770. // (?!_) cause 1.5x slowdown
  5771. self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i');
  5772. self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig');
  5773. self.re.pretest = RegExp(
  5774. '(' + self.re.schema_test.source + ')|' +
  5775. '(' + self.re.host_fuzzy_test.source + ')|' +
  5776. '@',
  5777. 'i');
  5778. //
  5779. // Cleanup
  5780. //
  5781. resetScanCache(self);
  5782. }
  5783. /**
  5784. * class Match
  5785. *
  5786. * Match result. Single element of array, returned by [[LinkifyIt#match]]
  5787. **/
  5788. function Match(self, shift) {
  5789. var start = self.__index__,
  5790. end = self.__last_index__,
  5791. text = self.__text_cache__.slice(start, end);
  5792. /**
  5793. * Match#schema -> String
  5794. *
  5795. * Prefix (protocol) for matched string.
  5796. **/
  5797. this.schema = self.__schema__.toLowerCase();
  5798. /**
  5799. * Match#index -> Number
  5800. *
  5801. * First position of matched string.
  5802. **/
  5803. this.index = start + shift;
  5804. /**
  5805. * Match#lastIndex -> Number
  5806. *
  5807. * Next position after matched string.
  5808. **/
  5809. this.lastIndex = end + shift;
  5810. /**
  5811. * Match#raw -> String
  5812. *
  5813. * Matched string.
  5814. **/
  5815. this.raw = text;
  5816. /**
  5817. * Match#text -> String
  5818. *
  5819. * Notmalized text of matched string.
  5820. **/
  5821. this.text = text;
  5822. /**
  5823. * Match#url -> String
  5824. *
  5825. * Normalized url of matched string.
  5826. **/
  5827. this.url = text;
  5828. }
  5829. function createMatch(self, shift) {
  5830. var match = new Match(self, shift);
  5831. self.__compiled__[match.schema].normalize(match, self);
  5832. return match;
  5833. }
  5834. /**
  5835. * class LinkifyIt
  5836. **/
  5837. /**
  5838. * new LinkifyIt(schemas, options)
  5839. * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)
  5840. * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
  5841. *
  5842. * Creates new linkifier instance with optional additional schemas.
  5843. * Can be called without `new` keyword for convenience.
  5844. *
  5845. * By default understands:
  5846. *
  5847. * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
  5848. * - "fuzzy" links and emails (example.com, foo@bar.com).
  5849. *
  5850. * `schemas` is an object, where each key/value describes protocol/rule:
  5851. *
  5852. * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`
  5853. * for example). `linkify-it` makes shure that prefix is not preceeded with
  5854. * alphanumeric char and symbols. Only whitespaces and punctuation allowed.
  5855. * - __value__ - rule to check tail after link prefix
  5856. * - _String_ - just alias to existing rule
  5857. * - _Object_
  5858. * - _validate_ - validator function (should return matched length on success),
  5859. * or `RegExp`.
  5860. * - _normalize_ - optional function to normalize text & url of matched result
  5861. * (for example, for @twitter mentions).
  5862. *
  5863. * `options`:
  5864. *
  5865. * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.
  5866. * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts
  5867. * like version numbers. Default `false`.
  5868. * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.
  5869. *
  5870. **/
  5871. function LinkifyIt(schemas, options) {
  5872. if (!(this instanceof LinkifyIt)) {
  5873. return new LinkifyIt(schemas, options);
  5874. }
  5875. if (!options) {
  5876. if (isOptionsObj(schemas)) {
  5877. options = schemas;
  5878. schemas = {};
  5879. }
  5880. }
  5881. this.__opts__ = assign({}, defaultOptions, options);
  5882. // Cache last tested result. Used to skip repeating steps on next `match` call.
  5883. this.__index__ = -1;
  5884. this.__last_index__ = -1; // Next scan position
  5885. this.__schema__ = '';
  5886. this.__text_cache__ = '';
  5887. this.__schemas__ = assign({}, defaultSchemas, schemas);
  5888. this.__compiled__ = {};
  5889. this.__tlds__ = tlds_default;
  5890. this.__tlds_replaced__ = false;
  5891. this.re = {};
  5892. compile(this);
  5893. }
  5894. /** chainable
  5895. * LinkifyIt#add(schema, definition)
  5896. * - schema (String): rule name (fixed pattern prefix)
  5897. * - definition (String|RegExp|Object): schema definition
  5898. *
  5899. * Add new rule definition. See constructor description for details.
  5900. **/
  5901. LinkifyIt.prototype.add = function add(schema, definition) {
  5902. this.__schemas__[schema] = definition;
  5903. compile(this);
  5904. return this;
  5905. };
  5906. /** chainable
  5907. * LinkifyIt#set(options)
  5908. * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
  5909. *
  5910. * Set recognition options for links without schema.
  5911. **/
  5912. LinkifyIt.prototype.set = function set(options) {
  5913. this.__opts__ = assign(this.__opts__, options);
  5914. return this;
  5915. };
  5916. /**
  5917. * LinkifyIt#test(text) -> Boolean
  5918. *
  5919. * Searches linkifiable pattern and returns `true` on success or `false` on fail.
  5920. **/
  5921. LinkifyIt.prototype.test = function test(text) {
  5922. // Reset scan cache
  5923. this.__text_cache__ = text;
  5924. this.__index__ = -1;
  5925. if (!text.length) { return false; }
  5926. var m, ml, me, len, shift, next, re, tld_pos, at_pos;
  5927. // try to scan for link with schema - that's the most simple rule
  5928. if (this.re.schema_test.test(text)) {
  5929. re = this.re.schema_search;
  5930. re.lastIndex = 0;
  5931. while ((m = re.exec(text)) !== null) {
  5932. len = this.testSchemaAt(text, m[2], re.lastIndex);
  5933. if (len) {
  5934. this.__schema__ = m[2];
  5935. this.__index__ = m.index + m[1].length;
  5936. this.__last_index__ = m.index + m[0].length + len;
  5937. break;
  5938. }
  5939. }
  5940. }
  5941. if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
  5942. // guess schemaless links
  5943. tld_pos = text.search(this.re.host_fuzzy_test);
  5944. if (tld_pos >= 0) {
  5945. // if tld is located after found link - no need to check fuzzy pattern
  5946. if (this.__index__ < 0 || tld_pos < this.__index__) {
  5947. if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
  5948. shift = ml.index + ml[1].length;
  5949. if (this.__index__ < 0 || shift < this.__index__) {
  5950. this.__schema__ = '';
  5951. this.__index__ = shift;
  5952. this.__last_index__ = ml.index + ml[0].length;
  5953. }
  5954. }
  5955. }
  5956. }
  5957. }
  5958. if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
  5959. // guess schemaless emails
  5960. at_pos = text.indexOf('@');
  5961. if (at_pos >= 0) {
  5962. // We can't skip this check, because this cases are possible:
  5963. // 192.168.1.1@gmail.com, my.in@example.com
  5964. if ((me = text.match(this.re.email_fuzzy)) !== null) {
  5965. shift = me.index + me[1].length;
  5966. next = me.index + me[0].length;
  5967. if (this.__index__ < 0 || shift < this.__index__ ||
  5968. (shift === this.__index__ && next > this.__last_index__)) {
  5969. this.__schema__ = 'mailto:';
  5970. this.__index__ = shift;
  5971. this.__last_index__ = next;
  5972. }
  5973. }
  5974. }
  5975. }
  5976. return this.__index__ >= 0;
  5977. };
  5978. /**
  5979. * LinkifyIt#pretest(text) -> Boolean
  5980. *
  5981. * Very quick check, that can give false positives. Returns true if link MAY BE
  5982. * can exists. Can be used for speed optimization, when you need to check that
  5983. * link NOT exists.
  5984. **/
  5985. LinkifyIt.prototype.pretest = function pretest(text) {
  5986. return this.re.pretest.test(text);
  5987. };
  5988. /**
  5989. * LinkifyIt#testSchemaAt(text, name, position) -> Number
  5990. * - text (String): text to scan
  5991. * - name (String): rule (schema) name
  5992. * - position (Number): text offset to check from
  5993. *
  5994. * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly
  5995. * at given position. Returns length of found pattern (0 on fail).
  5996. **/
  5997. LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {
  5998. // If not supported schema check requested - terminate
  5999. if (!this.__compiled__[schema.toLowerCase()]) {
  6000. return 0;
  6001. }
  6002. return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);
  6003. };
  6004. /**
  6005. * LinkifyIt#match(text) -> Array|null
  6006. *
  6007. * Returns array of found link descriptions or `null` on fail. We strongly
  6008. * recommend to use [[LinkifyIt#test]] first, for best speed.
  6009. *
  6010. * ##### Result match description
  6011. *
  6012. * - __schema__ - link schema, can be empty for fuzzy links, or `//` for
  6013. * protocol-neutral links.
  6014. * - __index__ - offset of matched text
  6015. * - __lastIndex__ - index of next char after mathch end
  6016. * - __raw__ - matched text
  6017. * - __text__ - normalized text
  6018. * - __url__ - link, generated from matched text
  6019. **/
  6020. LinkifyIt.prototype.match = function match(text) {
  6021. var shift = 0, result = [];
  6022. // Try to take previous element from cache, if .test() called before
  6023. if (this.__index__ >= 0 && this.__text_cache__ === text) {
  6024. result.push(createMatch(this, shift));
  6025. shift = this.__last_index__;
  6026. }
  6027. // Cut head if cache was used
  6028. var tail = shift ? text.slice(shift) : text;
  6029. // Scan string until end reached
  6030. while (this.test(tail)) {
  6031. result.push(createMatch(this, shift));
  6032. tail = tail.slice(this.__last_index__);
  6033. shift += this.__last_index__;
  6034. }
  6035. if (result.length) {
  6036. return result;
  6037. }
  6038. return null;
  6039. };
  6040. /** chainable
  6041. * LinkifyIt#tlds(list [, keepOld]) -> this
  6042. * - list (Array): list of tlds
  6043. * - keepOld (Boolean): merge with current list if `true` (`false` by default)
  6044. *
  6045. * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)
  6046. * to avoid false positives. By default this algorythm used:
  6047. *
  6048. * - hostname with any 2-letter root zones are ok.
  6049. * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
  6050. * are ok.
  6051. * - encoded (`xn--...`) root zones are ok.
  6052. *
  6053. * If list is replaced, then exact match for 2-chars root zones will be checked.
  6054. **/
  6055. LinkifyIt.prototype.tlds = function tlds(list, keepOld) {
  6056. list = Array.isArray(list) ? list : [ list ];
  6057. if (!keepOld) {
  6058. this.__tlds__ = list.slice();
  6059. this.__tlds_replaced__ = true;
  6060. compile(this);
  6061. return this;
  6062. }
  6063. this.__tlds__ = this.__tlds__.concat(list)
  6064. .sort()
  6065. .filter(function (el, idx, arr) {
  6066. return el !== arr[idx - 1];
  6067. })
  6068. .reverse();
  6069. compile(this);
  6070. return this;
  6071. };
  6072. /**
  6073. * LinkifyIt#normalize(match)
  6074. *
  6075. * Default normalizer (if schema does not define it's own).
  6076. **/
  6077. LinkifyIt.prototype.normalize = function normalize(match) {
  6078. // Do minimal possible changes by default. Need to collect feedback prior
  6079. // to move forward https://github.com/markdown-it/linkify-it/issues/1
  6080. if (!match.schema) { match.url = 'http://' + match.url; }
  6081. if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {
  6082. match.url = 'mailto:' + match.url;
  6083. }
  6084. };
  6085. /**
  6086. * LinkifyIt#onCompile()
  6087. *
  6088. * Override to modify basic RegExp-s.
  6089. **/
  6090. LinkifyIt.prototype.onCompile = function onCompile() {
  6091. };
  6092. module.exports = LinkifyIt;
  6093. /***/ }),
  6094. /* 29 */
  6095. /***/ (function(module, exports, __webpack_require__) {
  6096. "use strict";
  6097. module.exports = function (opts) {
  6098. var re = {};
  6099. // Use direct extract instead of `regenerate` to reduse browserified size
  6100. re.src_Any = __webpack_require__(18).source;
  6101. re.src_Cc = __webpack_require__(16).source;
  6102. re.src_Z = __webpack_require__(17).source;
  6103. re.src_P = __webpack_require__(5).source;
  6104. // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation)
  6105. re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join('|');
  6106. // \p{\Z\Cc} (white spaces + control)
  6107. re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|');
  6108. // Experimental. List of chars, completely prohibited in links
  6109. // because can separate it from other part of text
  6110. var text_separators = '[><\uff5c]';
  6111. // All possible word characters (everything without punctuation, spaces & controls)
  6112. // Defined via punctuation & spaces to save space
  6113. // Should be something like \p{\L\N\S\M} (\w but without `_`)
  6114. re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')';
  6115. // The same as abothe but without [0-9]
  6116. // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
  6117. ////////////////////////////////////////////////////////////////////////////////
  6118. re.src_ip4 =
  6119. '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
  6120. // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch.
  6121. re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?';
  6122. re.src_port =
  6123. '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?';
  6124. re.src_host_terminator =
  6125. '(?=$|' + text_separators + '|' + re.src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))';
  6126. re.src_path =
  6127. '(?:' +
  6128. '[/?#]' +
  6129. '(?:' +
  6130. '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-]).|' +
  6131. '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' +
  6132. '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' +
  6133. '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' +
  6134. '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' +
  6135. "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" +
  6136. "\\'(?=" + re.src_pseudo_letter + '|[-]).|' + // allow `I'm_king` if no pair found
  6137. '\\.{2,3}[a-zA-Z0-9%/]|' + // github has ... in commit range links. Restrict to
  6138. // - english
  6139. // - percent-encoded
  6140. // - parts of file path
  6141. // until more examples found.
  6142. '\\.(?!' + re.src_ZCc + '|[.]).|' +
  6143. (opts && opts['---'] ?
  6144. '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate
  6145. :
  6146. '\\-+|'
  6147. ) +
  6148. '\\,(?!' + re.src_ZCc + ').|' + // allow `,,,` in paths
  6149. '\\!(?!' + re.src_ZCc + '|[!]).|' +
  6150. '\\?(?!' + re.src_ZCc + '|[?]).' +
  6151. ')+' +
  6152. '|\\/' +
  6153. ')?';
  6154. re.src_email_name =
  6155. '[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+';
  6156. re.src_xn =
  6157. 'xn--[a-z0-9\\-]{1,59}';
  6158. // More to read about domain names
  6159. // http://serverfault.com/questions/638260/
  6160. re.src_domain_root =
  6161. // Allow letters & digits (http://test1)
  6162. '(?:' +
  6163. re.src_xn +
  6164. '|' +
  6165. re.src_pseudo_letter + '{1,63}' +
  6166. ')';
  6167. re.src_domain =
  6168. '(?:' +
  6169. re.src_xn +
  6170. '|' +
  6171. '(?:' + re.src_pseudo_letter + ')' +
  6172. '|' +
  6173. // don't allow `--` in domain names, because:
  6174. // - that can conflict with markdown &mdash; / &ndash;
  6175. // - nobody use those anyway
  6176. '(?:' + re.src_pseudo_letter + '(?:-(?!-)|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' +
  6177. ')';
  6178. re.src_host =
  6179. '(?:' +
  6180. // Don't need IP check, because digits are already allowed in normal domain names
  6181. // src_ip4 +
  6182. // '|' +
  6183. '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain/*_root*/ + ')' +
  6184. ')';
  6185. re.tpl_host_fuzzy =
  6186. '(?:' +
  6187. re.src_ip4 +
  6188. '|' +
  6189. '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' +
  6190. ')';
  6191. re.tpl_host_no_ip_fuzzy =
  6192. '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))';
  6193. re.src_host_strict =
  6194. re.src_host + re.src_host_terminator;
  6195. re.tpl_host_fuzzy_strict =
  6196. re.tpl_host_fuzzy + re.src_host_terminator;
  6197. re.src_host_port_strict =
  6198. re.src_host + re.src_port + re.src_host_terminator;
  6199. re.tpl_host_port_fuzzy_strict =
  6200. re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
  6201. re.tpl_host_port_no_ip_fuzzy_strict =
  6202. re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
  6203. ////////////////////////////////////////////////////////////////////////////////
  6204. // Main rules
  6205. // Rude test fuzzy links by host, for quick deny
  6206. re.tpl_host_fuzzy_test =
  6207. 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))';
  6208. re.tpl_email_fuzzy =
  6209. '(^|' + text_separators + '|\\(|' + re.src_ZCc + ')(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')';
  6210. re.tpl_link_fuzzy =
  6211. // Fuzzy link can't be prepended with .:/\- and non punctuation.
  6212. // but can start with > (markdown blockquote)
  6213. '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
  6214. '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')';
  6215. re.tpl_link_no_ip_fuzzy =
  6216. // Fuzzy link can't be prepended with .:/\- and non punctuation.
  6217. // but can start with > (markdown blockquote)
  6218. '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' +
  6219. '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')';
  6220. return re;
  6221. };
  6222. /***/ }),
  6223. /* 30 */
  6224. /***/ (function(module, exports, __webpack_require__) {
  6225. "use strict";
  6226. // List of valid html blocks names, accorting to commonmark spec
  6227. // http://jgm.github.io/CommonMark/spec.html#html-blocks
  6228. module.exports = [
  6229. 'address',
  6230. 'article',
  6231. 'aside',
  6232. 'base',
  6233. 'basefont',
  6234. 'blockquote',
  6235. 'body',
  6236. 'caption',
  6237. 'center',
  6238. 'col',
  6239. 'colgroup',
  6240. 'dd',
  6241. 'details',
  6242. 'dialog',
  6243. 'dir',
  6244. 'div',
  6245. 'dl',
  6246. 'dt',
  6247. 'fieldset',
  6248. 'figcaption',
  6249. 'figure',
  6250. 'footer',
  6251. 'form',
  6252. 'frame',
  6253. 'frameset',
  6254. 'h1',
  6255. 'h2',
  6256. 'h3',
  6257. 'h4',
  6258. 'h5',
  6259. 'h6',
  6260. 'head',
  6261. 'header',
  6262. 'hr',
  6263. 'html',
  6264. 'iframe',
  6265. 'legend',
  6266. 'li',
  6267. 'link',
  6268. 'main',
  6269. 'menu',
  6270. 'menuitem',
  6271. 'meta',
  6272. 'nav',
  6273. 'noframes',
  6274. 'ol',
  6275. 'optgroup',
  6276. 'option',
  6277. 'p',
  6278. 'param',
  6279. 'pre',
  6280. 'section',
  6281. 'source',
  6282. 'title',
  6283. 'summary',
  6284. 'table',
  6285. 'tbody',
  6286. 'td',
  6287. 'tfoot',
  6288. 'th',
  6289. 'thead',
  6290. 'title',
  6291. 'tr',
  6292. 'track',
  6293. 'ul'
  6294. ];
  6295. /***/ }),
  6296. /* 31 */
  6297. /***/ (function(module, exports, __webpack_require__) {
  6298. "use strict";
  6299. // Just a shortcut for bulk export
  6300. exports.parseLinkLabel = __webpack_require__(33);
  6301. exports.parseLinkDestination = __webpack_require__(32);
  6302. exports.parseLinkTitle = __webpack_require__(34);
  6303. /***/ }),
  6304. /* 32 */
  6305. /***/ (function(module, exports, __webpack_require__) {
  6306. "use strict";
  6307. // Parse link destination
  6308. //
  6309. var isSpace = __webpack_require__(0).isSpace;
  6310. var unescapeAll = __webpack_require__(0).unescapeAll;
  6311. module.exports = function parseLinkDestination(str, pos, max) {
  6312. var code, level,
  6313. lines = 0,
  6314. start = pos,
  6315. result = {
  6316. ok: false,
  6317. pos: 0,
  6318. lines: 0,
  6319. str: ''
  6320. };
  6321. if (str.charCodeAt(pos) === 0x3C /* < */) {
  6322. pos++;
  6323. while (pos < max) {
  6324. code = str.charCodeAt(pos);
  6325. if (code === 0x0A /* \n */ || isSpace(code)) { return result; }
  6326. if (code === 0x3E /* > */) {
  6327. result.pos = pos + 1;
  6328. result.str = unescapeAll(str.slice(start + 1, pos));
  6329. result.ok = true;
  6330. return result;
  6331. }
  6332. if (code === 0x5C /* \ */ && pos + 1 < max) {
  6333. pos += 2;
  6334. continue;
  6335. }
  6336. pos++;
  6337. }
  6338. // no closing '>'
  6339. return result;
  6340. }
  6341. // this should be ... } else { ... branch
  6342. level = 0;
  6343. while (pos < max) {
  6344. code = str.charCodeAt(pos);
  6345. if (code === 0x20) { break; }
  6346. // ascii control characters
  6347. if (code < 0x20 || code === 0x7F) { break; }
  6348. if (code === 0x5C /* \ */ && pos + 1 < max) {
  6349. pos += 2;
  6350. continue;
  6351. }
  6352. if (code === 0x28 /* ( */) {
  6353. level++;
  6354. if (level > 1) { break; }
  6355. }
  6356. if (code === 0x29 /* ) */) {
  6357. level--;
  6358. if (level < 0) { break; }
  6359. }
  6360. pos++;
  6361. }
  6362. if (start === pos) { return result; }
  6363. result.str = unescapeAll(str.slice(start, pos));
  6364. result.lines = lines;
  6365. result.pos = pos;
  6366. result.ok = true;
  6367. return result;
  6368. };
  6369. /***/ }),
  6370. /* 33 */
  6371. /***/ (function(module, exports, __webpack_require__) {
  6372. "use strict";
  6373. // Parse link label
  6374. //
  6375. // this function assumes that first character ("[") already matches;
  6376. // returns the end of the label
  6377. //
  6378. module.exports = function parseLinkLabel(state, start, disableNested) {
  6379. var level, found, marker, prevPos,
  6380. labelEnd = -1,
  6381. max = state.posMax,
  6382. oldPos = state.pos;
  6383. state.pos = start + 1;
  6384. level = 1;
  6385. while (state.pos < max) {
  6386. marker = state.src.charCodeAt(state.pos);
  6387. if (marker === 0x5D /* ] */) {
  6388. level--;
  6389. if (level === 0) {
  6390. found = true;
  6391. break;
  6392. }
  6393. }
  6394. prevPos = state.pos;
  6395. state.md.inline.skipToken(state);
  6396. if (marker === 0x5B /* [ */) {
  6397. if (prevPos === state.pos - 1) {
  6398. // increase level if we find text `[`, which is not a part of any token
  6399. level++;
  6400. } else if (disableNested) {
  6401. state.pos = oldPos;
  6402. return -1;
  6403. }
  6404. }
  6405. }
  6406. if (found) {
  6407. labelEnd = state.pos;
  6408. }
  6409. // restore old state
  6410. state.pos = oldPos;
  6411. return labelEnd;
  6412. };
  6413. /***/ }),
  6414. /* 34 */
  6415. /***/ (function(module, exports, __webpack_require__) {
  6416. "use strict";
  6417. // Parse link title
  6418. //
  6419. var unescapeAll = __webpack_require__(0).unescapeAll;
  6420. module.exports = function parseLinkTitle(str, pos, max) {
  6421. var code,
  6422. marker,
  6423. lines = 0,
  6424. start = pos,
  6425. result = {
  6426. ok: false,
  6427. pos: 0,
  6428. lines: 0,
  6429. str: ''
  6430. };
  6431. if (pos >= max) { return result; }
  6432. marker = str.charCodeAt(pos);
  6433. if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return result; }
  6434. pos++;
  6435. // if opening marker is "(", switch it to closing marker ")"
  6436. if (marker === 0x28) { marker = 0x29; }
  6437. while (pos < max) {
  6438. code = str.charCodeAt(pos);
  6439. if (code === marker) {
  6440. result.pos = pos + 1;
  6441. result.lines = lines;
  6442. result.str = unescapeAll(str.slice(start + 1, pos));
  6443. result.ok = true;
  6444. return result;
  6445. } else if (code === 0x0A) {
  6446. lines++;
  6447. } else if (code === 0x5C /* \ */ && pos + 1 < max) {
  6448. pos++;
  6449. if (str.charCodeAt(pos) === 0x0A) {
  6450. lines++;
  6451. }
  6452. }
  6453. pos++;
  6454. }
  6455. return result;
  6456. };
  6457. /***/ }),
  6458. /* 35 */
  6459. /***/ (function(module, exports, __webpack_require__) {
  6460. "use strict";
  6461. // Main parser class
  6462. var utils = __webpack_require__(0);
  6463. var helpers = __webpack_require__(31);
  6464. var Renderer = __webpack_require__(42);
  6465. var ParserCore = __webpack_require__(37);
  6466. var ParserBlock = __webpack_require__(36);
  6467. var ParserInline = __webpack_require__(38);
  6468. var LinkifyIt = __webpack_require__(28);
  6469. var mdurl = __webpack_require__(15);
  6470. var punycode = __webpack_require__(79);
  6471. var config = {
  6472. 'default': __webpack_require__(40),
  6473. zero: __webpack_require__(41),
  6474. commonmark: __webpack_require__(39)
  6475. };
  6476. ////////////////////////////////////////////////////////////////////////////////
  6477. //
  6478. // This validator can prohibit more than really needed to prevent XSS. It's a
  6479. // tradeoff to keep code simple and to be secure by default.
  6480. //
  6481. // If you need different setup - override validator method as you wish. Or
  6482. // replace it with dummy function and use external sanitizer.
  6483. //
  6484. var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
  6485. var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
  6486. function validateLink(url) {
  6487. // url should be normalized at this point, and existing entities are decoded
  6488. var str = url.trim().toLowerCase();
  6489. return BAD_PROTO_RE.test(str) ? (GOOD_DATA_RE.test(str) ? true : false) : true;
  6490. }
  6491. ////////////////////////////////////////////////////////////////////////////////
  6492. var RECODE_HOSTNAME_FOR = [ 'http:', 'https:', 'mailto:' ];
  6493. function normalizeLink(url) {
  6494. var parsed = mdurl.parse(url, true);
  6495. if (parsed.hostname) {
  6496. // Encode hostnames in urls like:
  6497. // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
  6498. //
  6499. // We don't encode unknown schemas, because it's likely that we encode
  6500. // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
  6501. //
  6502. if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
  6503. try {
  6504. parsed.hostname = punycode.toASCII(parsed.hostname);
  6505. } catch (er) { /**/ }
  6506. }
  6507. }
  6508. return mdurl.encode(mdurl.format(parsed));
  6509. }
  6510. function normalizeLinkText(url) {
  6511. var parsed = mdurl.parse(url, true);
  6512. if (parsed.hostname) {
  6513. // Encode hostnames in urls like:
  6514. // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`
  6515. //
  6516. // We don't encode unknown schemas, because it's likely that we encode
  6517. // something we shouldn't (e.g. `skype:name` treated as `skype:host`)
  6518. //
  6519. if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
  6520. try {
  6521. parsed.hostname = punycode.toUnicode(parsed.hostname);
  6522. } catch (er) { /**/ }
  6523. }
  6524. }
  6525. return mdurl.decode(mdurl.format(parsed));
  6526. }
  6527. /**
  6528. * class MarkdownIt
  6529. *
  6530. * Main parser/renderer class.
  6531. *
  6532. * ##### Usage
  6533. *
  6534. * ```javascript
  6535. * // node.js, "classic" way:
  6536. * var MarkdownIt = require('markdown-it'),
  6537. * md = new MarkdownIt();
  6538. * var result = md.render('# markdown-it rulezz!');
  6539. *
  6540. * // node.js, the same, but with sugar:
  6541. * var md = require('markdown-it')();
  6542. * var result = md.render('# markdown-it rulezz!');
  6543. *
  6544. * // browser without AMD, added to "window" on script load
  6545. * // Note, there are no dash.
  6546. * var md = window.markdownit();
  6547. * var result = md.render('# markdown-it rulezz!');
  6548. * ```
  6549. *
  6550. * Single line rendering, without paragraph wrap:
  6551. *
  6552. * ```javascript
  6553. * var md = require('markdown-it')();
  6554. * var result = md.renderInline('__markdown-it__ rulezz!');
  6555. * ```
  6556. **/
  6557. /**
  6558. * new MarkdownIt([presetName, options])
  6559. * - presetName (String): optional, `commonmark` / `zero`
  6560. * - options (Object)
  6561. *
  6562. * Creates parser instanse with given config. Can be called without `new`.
  6563. *
  6564. * ##### presetName
  6565. *
  6566. * MarkdownIt provides named presets as a convenience to quickly
  6567. * enable/disable active syntax rules and options for common use cases.
  6568. *
  6569. * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.js) -
  6570. * configures parser to strict [CommonMark](http://commonmark.org/) mode.
  6571. * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.js) -
  6572. * similar to GFM, used when no preset name given. Enables all available rules,
  6573. * but still without html, typographer & autolinker.
  6574. * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.js) -
  6575. * all rules disabled. Useful to quickly setup your config via `.enable()`.
  6576. * For example, when you need only `bold` and `italic` markup and nothing else.
  6577. *
  6578. * ##### options:
  6579. *
  6580. * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!
  6581. * That's not safe! You may need external sanitizer to protect output from XSS.
  6582. * It's better to extend features via plugins, instead of enabling HTML.
  6583. * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags
  6584. * (`<br />`). This is needed only for full CommonMark compatibility. In real
  6585. * world you will need HTML output.
  6586. * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `<br>`.
  6587. * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.
  6588. * Can be useful for external highlighters.
  6589. * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.
  6590. * - __typographer__ - `false`. Set `true` to enable [some language-neutral
  6591. * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js) +
  6592. * quotes beautification (smartquotes).
  6593. * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement
  6594. * pairs, when typographer enabled and smartquotes on. For example, you can
  6595. * use `'«»„“'` for Russian, `'„“‚‘'` for German, and
  6596. * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp).
  6597. * - __highlight__ - `null`. Highlighter function for fenced code blocks.
  6598. * Highlighter `function (str, lang)` should return escaped HTML. It can also
  6599. * return empty string if the source was not changed and should be escaped
  6600. * externaly. If result starts with <pre... internal wrapper is skipped.
  6601. *
  6602. * ##### Example
  6603. *
  6604. * ```javascript
  6605. * // commonmark mode
  6606. * var md = require('markdown-it')('commonmark');
  6607. *
  6608. * // default mode
  6609. * var md = require('markdown-it')();
  6610. *
  6611. * // enable everything
  6612. * var md = require('markdown-it')({
  6613. * html: true,
  6614. * linkify: true,
  6615. * typographer: true
  6616. * });
  6617. * ```
  6618. *
  6619. * ##### Syntax highlighting
  6620. *
  6621. * ```js
  6622. * var hljs = require('highlight.js') // https://highlightjs.org/
  6623. *
  6624. * var md = require('markdown-it')({
  6625. * highlight: function (str, lang) {
  6626. * if (lang && hljs.getLanguage(lang)) {
  6627. * try {
  6628. * return hljs.highlight(lang, str, true).value;
  6629. * } catch (__) {}
  6630. * }
  6631. *
  6632. * return ''; // use external default escaping
  6633. * }
  6634. * });
  6635. * ```
  6636. *
  6637. * Or with full wrapper override (if you need assign class to `<pre>`):
  6638. *
  6639. * ```javascript
  6640. * var hljs = require('highlight.js') // https://highlightjs.org/
  6641. *
  6642. * // Actual default values
  6643. * var md = require('markdown-it')({
  6644. * highlight: function (str, lang) {
  6645. * if (lang && hljs.getLanguage(lang)) {
  6646. * try {
  6647. * return '<pre class="hljs"><code>' +
  6648. * hljs.highlight(lang, str, true).value +
  6649. * '</code></pre>';
  6650. * } catch (__) {}
  6651. * }
  6652. *
  6653. * return '<pre class="hljs"><code>' + md.utils.escapeHtml(str) + '</code></pre>';
  6654. * }
  6655. * });
  6656. * ```
  6657. *
  6658. **/
  6659. function MarkdownIt(presetName, options) {
  6660. if (!(this instanceof MarkdownIt)) {
  6661. return new MarkdownIt(presetName, options);
  6662. }
  6663. if (!options) {
  6664. if (!utils.isString(presetName)) {
  6665. options = presetName || {};
  6666. presetName = 'default';
  6667. }
  6668. }
  6669. /**
  6670. * MarkdownIt#inline -> ParserInline
  6671. *
  6672. * Instance of [[ParserInline]]. You may need it to add new rules when
  6673. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6674. * [[MarkdownIt.enable]].
  6675. **/
  6676. this.inline = new ParserInline();
  6677. /**
  6678. * MarkdownIt#block -> ParserBlock
  6679. *
  6680. * Instance of [[ParserBlock]]. You may need it to add new rules when
  6681. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6682. * [[MarkdownIt.enable]].
  6683. **/
  6684. this.block = new ParserBlock();
  6685. /**
  6686. * MarkdownIt#core -> Core
  6687. *
  6688. * Instance of [[Core]] chain executor. You may need it to add new rules when
  6689. * writing plugins. For simple rules control use [[MarkdownIt.disable]] and
  6690. * [[MarkdownIt.enable]].
  6691. **/
  6692. this.core = new ParserCore();
  6693. /**
  6694. * MarkdownIt#renderer -> Renderer
  6695. *
  6696. * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering
  6697. * rules for new token types, generated by plugins.
  6698. *
  6699. * ##### Example
  6700. *
  6701. * ```javascript
  6702. * var md = require('markdown-it')();
  6703. *
  6704. * function myToken(tokens, idx, options, env, self) {
  6705. * //...
  6706. * return result;
  6707. * };
  6708. *
  6709. * md.renderer.rules['my_token'] = myToken
  6710. * ```
  6711. *
  6712. * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js).
  6713. **/
  6714. this.renderer = new Renderer();
  6715. /**
  6716. * MarkdownIt#linkify -> LinkifyIt
  6717. *
  6718. * [linkify-it](https://github.com/markdown-it/linkify-it) instance.
  6719. * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.js)
  6720. * rule.
  6721. **/
  6722. this.linkify = new LinkifyIt();
  6723. /**
  6724. * MarkdownIt#validateLink(url) -> Boolean
  6725. *
  6726. * Link validation function. CommonMark allows too much in links. By default
  6727. * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
  6728. * except some embedded image types.
  6729. *
  6730. * You can change this behaviour:
  6731. *
  6732. * ```javascript
  6733. * var md = require('markdown-it')();
  6734. * // enable everything
  6735. * md.validateLink = function () { return true; }
  6736. * ```
  6737. **/
  6738. this.validateLink = validateLink;
  6739. /**
  6740. * MarkdownIt#normalizeLink(url) -> String
  6741. *
  6742. * Function used to encode link url to a machine-readable format,
  6743. * which includes url-encoding, punycode, etc.
  6744. **/
  6745. this.normalizeLink = normalizeLink;
  6746. /**
  6747. * MarkdownIt#normalizeLinkText(url) -> String
  6748. *
  6749. * Function used to decode link url to a human-readable format`
  6750. **/
  6751. this.normalizeLinkText = normalizeLinkText;
  6752. // Expose utils & helpers for easy acces from plugins
  6753. /**
  6754. * MarkdownIt#utils -> utils
  6755. *
  6756. * Assorted utility functions, useful to write plugins. See details
  6757. * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js).
  6758. **/
  6759. this.utils = utils;
  6760. /**
  6761. * MarkdownIt#helpers -> helpers
  6762. *
  6763. * Link components parser functions, useful to write plugins. See details
  6764. * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).
  6765. **/
  6766. this.helpers = utils.assign({}, helpers);
  6767. this.options = {};
  6768. this.configure(presetName);
  6769. if (options) { this.set(options); }
  6770. }
  6771. /** chainable
  6772. * MarkdownIt.set(options)
  6773. *
  6774. * Set parser options (in the same format as in constructor). Probably, you
  6775. * will never need it, but you can change options after constructor call.
  6776. *
  6777. * ##### Example
  6778. *
  6779. * ```javascript
  6780. * var md = require('markdown-it')()
  6781. * .set({ html: true, breaks: true })
  6782. * .set({ typographer, true });
  6783. * ```
  6784. *
  6785. * __Note:__ To achieve the best possible performance, don't modify a
  6786. * `markdown-it` instance options on the fly. If you need multiple configurations
  6787. * it's best to create multiple instances and initialize each with separate
  6788. * config.
  6789. **/
  6790. MarkdownIt.prototype.set = function (options) {
  6791. utils.assign(this.options, options);
  6792. return this;
  6793. };
  6794. /** chainable, internal
  6795. * MarkdownIt.configure(presets)
  6796. *
  6797. * Batch load of all options and compenent settings. This is internal method,
  6798. * and you probably will not need it. But if you with - see available presets
  6799. * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)
  6800. *
  6801. * We strongly recommend to use presets instead of direct config loads. That
  6802. * will give better compatibility with next versions.
  6803. **/
  6804. MarkdownIt.prototype.configure = function (presets) {
  6805. var self = this, presetName;
  6806. if (utils.isString(presets)) {
  6807. presetName = presets;
  6808. presets = config[presetName];
  6809. if (!presets) { throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); }
  6810. }
  6811. if (!presets) { throw new Error('Wrong `markdown-it` preset, can\'t be empty'); }
  6812. if (presets.options) { self.set(presets.options); }
  6813. if (presets.components) {
  6814. Object.keys(presets.components).forEach(function (name) {
  6815. if (presets.components[name].rules) {
  6816. self[name].ruler.enableOnly(presets.components[name].rules);
  6817. }
  6818. if (presets.components[name].rules2) {
  6819. self[name].ruler2.enableOnly(presets.components[name].rules2);
  6820. }
  6821. });
  6822. }
  6823. return this;
  6824. };
  6825. /** chainable
  6826. * MarkdownIt.enable(list, ignoreInvalid)
  6827. * - list (String|Array): rule name or list of rule names to enable
  6828. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  6829. *
  6830. * Enable list or rules. It will automatically find appropriate components,
  6831. * containing rules with given names. If rule not found, and `ignoreInvalid`
  6832. * not set - throws exception.
  6833. *
  6834. * ##### Example
  6835. *
  6836. * ```javascript
  6837. * var md = require('markdown-it')()
  6838. * .enable(['sub', 'sup'])
  6839. * .disable('smartquotes');
  6840. * ```
  6841. **/
  6842. MarkdownIt.prototype.enable = function (list, ignoreInvalid) {
  6843. var result = [];
  6844. if (!Array.isArray(list)) { list = [ list ]; }
  6845. [ 'core', 'block', 'inline' ].forEach(function (chain) {
  6846. result = result.concat(this[chain].ruler.enable(list, true));
  6847. }, this);
  6848. result = result.concat(this.inline.ruler2.enable(list, true));
  6849. var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
  6850. if (missed.length && !ignoreInvalid) {
  6851. throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed);
  6852. }
  6853. return this;
  6854. };
  6855. /** chainable
  6856. * MarkdownIt.disable(list, ignoreInvalid)
  6857. * - list (String|Array): rule name or list of rule names to disable.
  6858. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.
  6859. *
  6860. * The same as [[MarkdownIt.enable]], but turn specified rules off.
  6861. **/
  6862. MarkdownIt.prototype.disable = function (list, ignoreInvalid) {
  6863. var result = [];
  6864. if (!Array.isArray(list)) { list = [ list ]; }
  6865. [ 'core', 'block', 'inline' ].forEach(function (chain) {
  6866. result = result.concat(this[chain].ruler.disable(list, true));
  6867. }, this);
  6868. result = result.concat(this.inline.ruler2.disable(list, true));
  6869. var missed = list.filter(function (name) { return result.indexOf(name) < 0; });
  6870. if (missed.length && !ignoreInvalid) {
  6871. throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed);
  6872. }
  6873. return this;
  6874. };
  6875. /** chainable
  6876. * MarkdownIt.use(plugin, params)
  6877. *
  6878. * Load specified plugin with given params into current parser instance.
  6879. * It's just a sugar to call `plugin(md, params)` with curring.
  6880. *
  6881. * ##### Example
  6882. *
  6883. * ```javascript
  6884. * var iterator = require('markdown-it-for-inline');
  6885. * var md = require('markdown-it')()
  6886. * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
  6887. * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');
  6888. * });
  6889. * ```
  6890. **/
  6891. MarkdownIt.prototype.use = function (plugin /*, params, ... */) {
  6892. var args = [ this ].concat(Array.prototype.slice.call(arguments, 1));
  6893. plugin.apply(plugin, args);
  6894. return this;
  6895. };
  6896. /** internal
  6897. * MarkdownIt.parse(src, env) -> Array
  6898. * - src (String): source string
  6899. * - env (Object): environment sandbox
  6900. *
  6901. * Parse input string and returns list of block tokens (special token type
  6902. * "inline" will contain list of inline tokens). You should not call this
  6903. * method directly, until you write custom renderer (for example, to produce
  6904. * AST).
  6905. *
  6906. * `env` is used to pass data between "distributed" rules and return additional
  6907. * metadata like reference info, needed for the renderer. It also can be used to
  6908. * inject data in specific cases. Usually, you will be ok to pass `{}`,
  6909. * and then pass updated object to renderer.
  6910. **/
  6911. MarkdownIt.prototype.parse = function (src, env) {
  6912. if (typeof src !== 'string') {
  6913. throw new Error('Input data should be a String');
  6914. }
  6915. var state = new this.core.State(src, this, env);
  6916. this.core.process(state);
  6917. return state.tokens;
  6918. };
  6919. /**
  6920. * MarkdownIt.render(src [, env]) -> String
  6921. * - src (String): source string
  6922. * - env (Object): environment sandbox
  6923. *
  6924. * Render markdown string into html. It does all magic for you :).
  6925. *
  6926. * `env` can be used to inject additional metadata (`{}` by default).
  6927. * But you will not need it with high probability. See also comment
  6928. * in [[MarkdownIt.parse]].
  6929. **/
  6930. MarkdownIt.prototype.render = function (src, env) {
  6931. env = env || {};
  6932. return this.renderer.render(this.parse(src, env), this.options, env);
  6933. };
  6934. /** internal
  6935. * MarkdownIt.parseInline(src, env) -> Array
  6936. * - src (String): source string
  6937. * - env (Object): environment sandbox
  6938. *
  6939. * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the
  6940. * block tokens list with the single `inline` element, containing parsed inline
  6941. * tokens in `children` property. Also updates `env` object.
  6942. **/
  6943. MarkdownIt.prototype.parseInline = function (src, env) {
  6944. var state = new this.core.State(src, this, env);
  6945. state.inlineMode = true;
  6946. this.core.process(state);
  6947. return state.tokens;
  6948. };
  6949. /**
  6950. * MarkdownIt.renderInline(src [, env]) -> String
  6951. * - src (String): source string
  6952. * - env (Object): environment sandbox
  6953. *
  6954. * Similar to [[MarkdownIt.render]] but for single paragraph content. Result
  6955. * will NOT be wrapped into `<p>` tags.
  6956. **/
  6957. MarkdownIt.prototype.renderInline = function (src, env) {
  6958. env = env || {};
  6959. return this.renderer.render(this.parseInline(src, env), this.options, env);
  6960. };
  6961. module.exports = MarkdownIt;
  6962. /***/ }),
  6963. /* 36 */
  6964. /***/ (function(module, exports, __webpack_require__) {
  6965. "use strict";
  6966. /** internal
  6967. * class ParserBlock
  6968. *
  6969. * Block-level tokenizer.
  6970. **/
  6971. var Ruler = __webpack_require__(3);
  6972. var _rules = [
  6973. // First 2 params - rule name & source. Secondary array - list of rules,
  6974. // which can be terminated by this one.
  6975. [ 'table', __webpack_require__(54), [ 'paragraph', 'reference' ] ],
  6976. [ 'code', __webpack_require__(44) ],
  6977. [ 'fence', __webpack_require__(45), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
  6978. [ 'blockquote', __webpack_require__(43), [ 'paragraph', 'reference', 'list' ] ],
  6979. [ 'hr', __webpack_require__(47), [ 'paragraph', 'reference', 'blockquote', 'list' ] ],
  6980. [ 'list', __webpack_require__(50), [ 'paragraph', 'reference', 'blockquote' ] ],
  6981. [ 'reference', __webpack_require__(52) ],
  6982. [ 'heading', __webpack_require__(46), [ 'paragraph', 'reference', 'blockquote' ] ],
  6983. [ 'lheading', __webpack_require__(49) ],
  6984. [ 'html_block', __webpack_require__(48), [ 'paragraph', 'reference', 'blockquote' ] ],
  6985. [ 'paragraph', __webpack_require__(51) ]
  6986. ];
  6987. /**
  6988. * new ParserBlock()
  6989. **/
  6990. function ParserBlock() {
  6991. /**
  6992. * ParserBlock#ruler -> Ruler
  6993. *
  6994. * [[Ruler]] instance. Keep configuration of block rules.
  6995. **/
  6996. this.ruler = new Ruler();
  6997. for (var i = 0; i < _rules.length; i++) {
  6998. this.ruler.push(_rules[i][0], _rules[i][1], { alt: (_rules[i][2] || []).slice() });
  6999. }
  7000. }
  7001. // Generate tokens for input range
  7002. //
  7003. ParserBlock.prototype.tokenize = function (state, startLine, endLine) {
  7004. var ok, i,
  7005. rules = this.ruler.getRules(''),
  7006. len = rules.length,
  7007. line = startLine,
  7008. hasEmptyLines = false,
  7009. maxNesting = state.md.options.maxNesting;
  7010. while (line < endLine) {
  7011. state.line = line = state.skipEmptyLines(line);
  7012. if (line >= endLine) { break; }
  7013. // Termination condition for nested calls.
  7014. // Nested calls currently used for blockquotes & lists
  7015. if (state.sCount[line] < state.blkIndent) { break; }
  7016. // If nesting level exceeded - skip tail to the end. That's not ordinary
  7017. // situation and we should not care about content.
  7018. if (state.level >= maxNesting) {
  7019. state.line = endLine;
  7020. break;
  7021. }
  7022. // Try all possible rules.
  7023. // On success, rule should:
  7024. //
  7025. // - update `state.line`
  7026. // - update `state.tokens`
  7027. // - return true
  7028. for (i = 0; i < len; i++) {
  7029. ok = rules[i](state, line, endLine, false);
  7030. if (ok) { break; }
  7031. }
  7032. // set state.tight iff we had an empty line before current tag
  7033. // i.e. latest empty line should not count
  7034. state.tight = !hasEmptyLines;
  7035. // paragraph might "eat" one newline after it in nested lists
  7036. if (state.isEmpty(state.line - 1)) {
  7037. hasEmptyLines = true;
  7038. }
  7039. line = state.line;
  7040. if (line < endLine && state.isEmpty(line)) {
  7041. hasEmptyLines = true;
  7042. line++;
  7043. state.line = line;
  7044. }
  7045. }
  7046. };
  7047. /**
  7048. * ParserBlock.parse(str, md, env, outTokens)
  7049. *
  7050. * Process input string and push block tokens into `outTokens`
  7051. **/
  7052. ParserBlock.prototype.parse = function (src, md, env, outTokens) {
  7053. var state;
  7054. if (!src) { return; }
  7055. state = new this.State(src, md, env, outTokens);
  7056. this.tokenize(state, state.line, state.lineMax);
  7057. };
  7058. ParserBlock.prototype.State = __webpack_require__(53);
  7059. module.exports = ParserBlock;
  7060. /***/ }),
  7061. /* 37 */
  7062. /***/ (function(module, exports, __webpack_require__) {
  7063. "use strict";
  7064. /** internal
  7065. * class Core
  7066. *
  7067. * Top-level rules executor. Glues block/inline parsers and does intermediate
  7068. * transformations.
  7069. **/
  7070. var Ruler = __webpack_require__(3);
  7071. var _rules = [
  7072. [ 'normalize', __webpack_require__(58) ],
  7073. [ 'block', __webpack_require__(55) ],
  7074. [ 'inline', __webpack_require__(56) ],
  7075. [ 'linkify', __webpack_require__(57) ],
  7076. [ 'replacements', __webpack_require__(59) ],
  7077. [ 'smartquotes', __webpack_require__(60) ]
  7078. ];
  7079. /**
  7080. * new Core()
  7081. **/
  7082. function Core() {
  7083. /**
  7084. * Core#ruler -> Ruler
  7085. *
  7086. * [[Ruler]] instance. Keep configuration of core rules.
  7087. **/
  7088. this.ruler = new Ruler();
  7089. for (var i = 0; i < _rules.length; i++) {
  7090. this.ruler.push(_rules[i][0], _rules[i][1]);
  7091. }
  7092. }
  7093. /**
  7094. * Core.process(state)
  7095. *
  7096. * Executes core chain rules.
  7097. **/
  7098. Core.prototype.process = function (state) {
  7099. var i, l, rules;
  7100. rules = this.ruler.getRules('');
  7101. for (i = 0, l = rules.length; i < l; i++) {
  7102. rules[i](state);
  7103. }
  7104. };
  7105. Core.prototype.State = __webpack_require__(61);
  7106. module.exports = Core;
  7107. /***/ }),
  7108. /* 38 */
  7109. /***/ (function(module, exports, __webpack_require__) {
  7110. "use strict";
  7111. /** internal
  7112. * class ParserInline
  7113. *
  7114. * Tokenizes paragraph content.
  7115. **/
  7116. var Ruler = __webpack_require__(3);
  7117. ////////////////////////////////////////////////////////////////////////////////
  7118. // Parser rules
  7119. var _rules = [
  7120. [ 'text', __webpack_require__(72) ],
  7121. [ 'newline', __webpack_require__(70) ],
  7122. [ 'escape', __webpack_require__(66) ],
  7123. [ 'backticks', __webpack_require__(63) ],
  7124. [ 'strikethrough', __webpack_require__(14).tokenize ],
  7125. [ 'emphasis', __webpack_require__(13).tokenize ],
  7126. [ 'link', __webpack_require__(69) ],
  7127. [ 'image', __webpack_require__(68) ],
  7128. [ 'autolink', __webpack_require__(62) ],
  7129. [ 'html_inline', __webpack_require__(67) ],
  7130. [ 'entity', __webpack_require__(65) ]
  7131. ];
  7132. var _rules2 = [
  7133. [ 'balance_pairs', __webpack_require__(64) ],
  7134. [ 'strikethrough', __webpack_require__(14).postProcess ],
  7135. [ 'emphasis', __webpack_require__(13).postProcess ],
  7136. [ 'text_collapse', __webpack_require__(73) ]
  7137. ];
  7138. /**
  7139. * new ParserInline()
  7140. **/
  7141. function ParserInline() {
  7142. var i;
  7143. /**
  7144. * ParserInline#ruler -> Ruler
  7145. *
  7146. * [[Ruler]] instance. Keep configuration of inline rules.
  7147. **/
  7148. this.ruler = new Ruler();
  7149. for (i = 0; i < _rules.length; i++) {
  7150. this.ruler.push(_rules[i][0], _rules[i][1]);
  7151. }
  7152. /**
  7153. * ParserInline#ruler2 -> Ruler
  7154. *
  7155. * [[Ruler]] instance. Second ruler used for post-processing
  7156. * (e.g. in emphasis-like rules).
  7157. **/
  7158. this.ruler2 = new Ruler();
  7159. for (i = 0; i < _rules2.length; i++) {
  7160. this.ruler2.push(_rules2[i][0], _rules2[i][1]);
  7161. }
  7162. }
  7163. // Skip single token by running all rules in validation mode;
  7164. // returns `true` if any rule reported success
  7165. //
  7166. ParserInline.prototype.skipToken = function (state) {
  7167. var ok, i, pos = state.pos,
  7168. rules = this.ruler.getRules(''),
  7169. len = rules.length,
  7170. maxNesting = state.md.options.maxNesting,
  7171. cache = state.cache;
  7172. if (typeof cache[pos] !== 'undefined') {
  7173. state.pos = cache[pos];
  7174. return;
  7175. }
  7176. if (state.level < maxNesting) {
  7177. for (i = 0; i < len; i++) {
  7178. // Increment state.level and decrement it later to limit recursion.
  7179. // It's harmless to do here, because no tokens are created. But ideally,
  7180. // we'd need a separate private state variable for this purpose.
  7181. //
  7182. state.level++;
  7183. ok = rules[i](state, true);
  7184. state.level--;
  7185. if (ok) { break; }
  7186. }
  7187. } else {
  7188. // Too much nesting, just skip until the end of the paragraph.
  7189. //
  7190. // NOTE: this will cause links to behave incorrectly in the following case,
  7191. // when an amount of `[` is exactly equal to `maxNesting + 1`:
  7192. //
  7193. // [[[[[[[[[[[[[[[[[[[[[foo]()
  7194. //
  7195. // TODO: remove this workaround when CM standard will allow nested links
  7196. // (we can replace it by preventing links from being parsed in
  7197. // validation mode)
  7198. //
  7199. state.pos = state.posMax;
  7200. }
  7201. if (!ok) { state.pos++; }
  7202. cache[pos] = state.pos;
  7203. };
  7204. // Generate tokens for input range
  7205. //
  7206. ParserInline.prototype.tokenize = function (state) {
  7207. var ok, i,
  7208. rules = this.ruler.getRules(''),
  7209. len = rules.length,
  7210. end = state.posMax,
  7211. maxNesting = state.md.options.maxNesting;
  7212. while (state.pos < end) {
  7213. // Try all possible rules.
  7214. // On success, rule should:
  7215. //
  7216. // - update `state.pos`
  7217. // - update `state.tokens`
  7218. // - return true
  7219. if (state.level < maxNesting) {
  7220. for (i = 0; i < len; i++) {
  7221. ok = rules[i](state, false);
  7222. if (ok) { break; }
  7223. }
  7224. }
  7225. if (ok) {
  7226. if (state.pos >= end) { break; }
  7227. continue;
  7228. }
  7229. state.pending += state.src[state.pos++];
  7230. }
  7231. if (state.pending) {
  7232. state.pushPending();
  7233. }
  7234. };
  7235. /**
  7236. * ParserInline.parse(str, md, env, outTokens)
  7237. *
  7238. * Process input string and push inline tokens into `outTokens`
  7239. **/
  7240. ParserInline.prototype.parse = function (str, md, env, outTokens) {
  7241. var i, rules, len;
  7242. var state = new this.State(str, md, env, outTokens);
  7243. this.tokenize(state);
  7244. rules = this.ruler2.getRules('');
  7245. len = rules.length;
  7246. for (i = 0; i < len; i++) {
  7247. rules[i](state);
  7248. }
  7249. };
  7250. ParserInline.prototype.State = __webpack_require__(71);
  7251. module.exports = ParserInline;
  7252. /***/ }),
  7253. /* 39 */
  7254. /***/ (function(module, exports, __webpack_require__) {
  7255. "use strict";
  7256. // Commonmark default options
  7257. module.exports = {
  7258. options: {
  7259. html: true, // Enable HTML tags in source
  7260. xhtmlOut: true, // Use '/' to close single tags (<br />)
  7261. breaks: false, // Convert '\n' in paragraphs into <br>
  7262. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7263. linkify: false, // autoconvert URL-like texts to links
  7264. // Enable some language-neutral replacements + quotes beautification
  7265. typographer: false,
  7266. // Double + single quotes replacement pairs, when typographer enabled,
  7267. // and smartquotes on. Could be either a String or an Array.
  7268. //
  7269. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7270. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7271. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7272. // Highlighter function. Should return escaped HTML,
  7273. // or '' if the source string is not changed and should be escaped externaly.
  7274. // If result starts with <pre... internal wrapper is skipped.
  7275. //
  7276. // function (/*str, lang*/) { return ''; }
  7277. //
  7278. highlight: null,
  7279. maxNesting: 20 // Internal protection, recursion limit
  7280. },
  7281. components: {
  7282. core: {
  7283. rules: [
  7284. 'normalize',
  7285. 'block',
  7286. 'inline'
  7287. ]
  7288. },
  7289. block: {
  7290. rules: [
  7291. 'blockquote',
  7292. 'code',
  7293. 'fence',
  7294. 'heading',
  7295. 'hr',
  7296. 'html_block',
  7297. 'lheading',
  7298. 'list',
  7299. 'reference',
  7300. 'paragraph'
  7301. ]
  7302. },
  7303. inline: {
  7304. rules: [
  7305. 'autolink',
  7306. 'backticks',
  7307. 'emphasis',
  7308. 'entity',
  7309. 'escape',
  7310. 'html_inline',
  7311. 'image',
  7312. 'link',
  7313. 'newline',
  7314. 'text'
  7315. ],
  7316. rules2: [
  7317. 'balance_pairs',
  7318. 'emphasis',
  7319. 'text_collapse'
  7320. ]
  7321. }
  7322. }
  7323. };
  7324. /***/ }),
  7325. /* 40 */
  7326. /***/ (function(module, exports, __webpack_require__) {
  7327. "use strict";
  7328. // markdown-it default options
  7329. module.exports = {
  7330. options: {
  7331. html: false, // Enable HTML tags in source
  7332. xhtmlOut: false, // Use '/' to close single tags (<br />)
  7333. breaks: false, // Convert '\n' in paragraphs into <br>
  7334. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7335. linkify: false, // autoconvert URL-like texts to links
  7336. // Enable some language-neutral replacements + quotes beautification
  7337. typographer: false,
  7338. // Double + single quotes replacement pairs, when typographer enabled,
  7339. // and smartquotes on. Could be either a String or an Array.
  7340. //
  7341. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7342. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7343. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7344. // Highlighter function. Should return escaped HTML,
  7345. // or '' if the source string is not changed and should be escaped externaly.
  7346. // If result starts with <pre... internal wrapper is skipped.
  7347. //
  7348. // function (/*str, lang*/) { return ''; }
  7349. //
  7350. highlight: null,
  7351. maxNesting: 100 // Internal protection, recursion limit
  7352. },
  7353. components: {
  7354. core: {},
  7355. block: {},
  7356. inline: {}
  7357. }
  7358. };
  7359. /***/ }),
  7360. /* 41 */
  7361. /***/ (function(module, exports, __webpack_require__) {
  7362. "use strict";
  7363. // "Zero" preset, with nothing enabled. Useful for manual configuring of simple
  7364. // modes. For example, to parse bold/italic only.
  7365. module.exports = {
  7366. options: {
  7367. html: false, // Enable HTML tags in source
  7368. xhtmlOut: false, // Use '/' to close single tags (<br />)
  7369. breaks: false, // Convert '\n' in paragraphs into <br>
  7370. langPrefix: 'language-', // CSS language prefix for fenced blocks
  7371. linkify: false, // autoconvert URL-like texts to links
  7372. // Enable some language-neutral replacements + quotes beautification
  7373. typographer: false,
  7374. // Double + single quotes replacement pairs, when typographer enabled,
  7375. // and smartquotes on. Could be either a String or an Array.
  7376. //
  7377. // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
  7378. // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
  7379. quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */
  7380. // Highlighter function. Should return escaped HTML,
  7381. // or '' if the source string is not changed and should be escaped externaly.
  7382. // If result starts with <pre... internal wrapper is skipped.
  7383. //
  7384. // function (/*str, lang*/) { return ''; }
  7385. //
  7386. highlight: null,
  7387. maxNesting: 20 // Internal protection, recursion limit
  7388. },
  7389. components: {
  7390. core: {
  7391. rules: [
  7392. 'normalize',
  7393. 'block',
  7394. 'inline'
  7395. ]
  7396. },
  7397. block: {
  7398. rules: [
  7399. 'paragraph'
  7400. ]
  7401. },
  7402. inline: {
  7403. rules: [
  7404. 'text'
  7405. ],
  7406. rules2: [
  7407. 'balance_pairs',
  7408. 'text_collapse'
  7409. ]
  7410. }
  7411. }
  7412. };
  7413. /***/ }),
  7414. /* 42 */
  7415. /***/ (function(module, exports, __webpack_require__) {
  7416. "use strict";
  7417. /**
  7418. * class Renderer
  7419. *
  7420. * Generates HTML from parsed token stream. Each instance has independent
  7421. * copy of rules. Those can be rewritten with ease. Also, you can add new
  7422. * rules if you create plugin and adds new token types.
  7423. **/
  7424. var assign = __webpack_require__(0).assign;
  7425. var unescapeAll = __webpack_require__(0).unescapeAll;
  7426. var escapeHtml = __webpack_require__(0).escapeHtml;
  7427. ////////////////////////////////////////////////////////////////////////////////
  7428. var default_rules = {};
  7429. default_rules.code_inline = function (tokens, idx, options, env, slf) {
  7430. var token = tokens[idx];
  7431. return '<code' + slf.renderAttrs(token) + '>' +
  7432. escapeHtml(tokens[idx].content) +
  7433. '</code>';
  7434. };
  7435. default_rules.code_block = function (tokens, idx, options, env, slf) {
  7436. var token = tokens[idx];
  7437. return '<pre' + slf.renderAttrs(token) + '><code>' +
  7438. escapeHtml(tokens[idx].content) +
  7439. '</code></pre>\n';
  7440. };
  7441. default_rules.fence = function (tokens, idx, options, env, slf) {
  7442. var token = tokens[idx],
  7443. info = token.info ? unescapeAll(token.info).trim() : '',
  7444. langName = '',
  7445. highlighted, i, tmpAttrs, tmpToken;
  7446. if (info) {
  7447. langName = info.split(/\s+/g)[0];
  7448. }
  7449. if (options.highlight) {
  7450. highlighted = options.highlight(token.content, langName) || escapeHtml(token.content);
  7451. } else {
  7452. highlighted = escapeHtml(token.content);
  7453. }
  7454. if (highlighted.indexOf('<pre') === 0) {
  7455. return highlighted + '\n';
  7456. }
  7457. // If language exists, inject class gently, without mudofying original token.
  7458. // May be, one day we will add .clone() for token and simplify this part, but
  7459. // now we prefer to keep things local.
  7460. if (info) {
  7461. i = token.attrIndex('class');
  7462. tmpAttrs = token.attrs ? token.attrs.slice() : [];
  7463. if (i < 0) {
  7464. tmpAttrs.push([ 'class', options.langPrefix + langName ]);
  7465. } else {
  7466. tmpAttrs[i][1] += ' ' + options.langPrefix + langName;
  7467. }
  7468. // Fake token just to render attributes
  7469. tmpToken = {
  7470. attrs: tmpAttrs
  7471. };
  7472. return '<pre><code' + slf.renderAttrs(tmpToken) + '>'
  7473. + highlighted
  7474. + '</code></pre>\n';
  7475. }
  7476. return '<pre><code' + slf.renderAttrs(token) + '>'
  7477. + highlighted
  7478. + '</code></pre>\n';
  7479. };
  7480. default_rules.image = function (tokens, idx, options, env, slf) {
  7481. var token = tokens[idx];
  7482. // "alt" attr MUST be set, even if empty. Because it's mandatory and
  7483. // should be placed on proper position for tests.
  7484. //
  7485. // Replace content with actual value
  7486. token.attrs[token.attrIndex('alt')][1] =
  7487. slf.renderInlineAsText(token.children, options, env);
  7488. return slf.renderToken(tokens, idx, options);
  7489. };
  7490. default_rules.hardbreak = function (tokens, idx, options /*, env */) {
  7491. return options.xhtmlOut ? '<br />\n' : '<br>\n';
  7492. };
  7493. default_rules.softbreak = function (tokens, idx, options /*, env */) {
  7494. return options.breaks ? (options.xhtmlOut ? '<br />\n' : '<br>\n') : '\n';
  7495. };
  7496. default_rules.text = function (tokens, idx /*, options, env */) {
  7497. return escapeHtml(tokens[idx].content);
  7498. };
  7499. default_rules.html_block = function (tokens, idx /*, options, env */) {
  7500. return tokens[idx].content;
  7501. };
  7502. default_rules.html_inline = function (tokens, idx /*, options, env */) {
  7503. return tokens[idx].content;
  7504. };
  7505. /**
  7506. * new Renderer()
  7507. *
  7508. * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.
  7509. **/
  7510. function Renderer() {
  7511. /**
  7512. * Renderer#rules -> Object
  7513. *
  7514. * Contains render rules for tokens. Can be updated and extended.
  7515. *
  7516. * ##### Example
  7517. *
  7518. * ```javascript
  7519. * var md = require('markdown-it')();
  7520. *
  7521. * md.renderer.rules.strong_open = function () { return '<b>'; };
  7522. * md.renderer.rules.strong_close = function () { return '</b>'; };
  7523. *
  7524. * var result = md.renderInline(...);
  7525. * ```
  7526. *
  7527. * Each rule is called as independed static function with fixed signature:
  7528. *
  7529. * ```javascript
  7530. * function my_token_render(tokens, idx, options, env, renderer) {
  7531. * // ...
  7532. * return renderedHTML;
  7533. * }
  7534. * ```
  7535. *
  7536. * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.js)
  7537. * for more details and examples.
  7538. **/
  7539. this.rules = assign({}, default_rules);
  7540. }
  7541. /**
  7542. * Renderer.renderAttrs(token) -> String
  7543. *
  7544. * Render token attributes to string.
  7545. **/
  7546. Renderer.prototype.renderAttrs = function renderAttrs(token) {
  7547. var i, l, result;
  7548. if (!token.attrs) { return ''; }
  7549. result = '';
  7550. for (i = 0, l = token.attrs.length; i < l; i++) {
  7551. result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"';
  7552. }
  7553. return result;
  7554. };
  7555. /**
  7556. * Renderer.renderToken(tokens, idx, options) -> String
  7557. * - tokens (Array): list of tokens
  7558. * - idx (Numbed): token index to render
  7559. * - options (Object): params of parser instance
  7560. *
  7561. * Default token renderer. Can be overriden by custom function
  7562. * in [[Renderer#rules]].
  7563. **/
  7564. Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
  7565. var nextToken,
  7566. result = '',
  7567. needLf = false,
  7568. token = tokens[idx];
  7569. // Tight list paragraphs
  7570. if (token.hidden) {
  7571. return '';
  7572. }
  7573. // Insert a newline between hidden paragraph and subsequent opening
  7574. // block-level tag.
  7575. //
  7576. // For example, here we should insert a newline before blockquote:
  7577. // - a
  7578. // >
  7579. //
  7580. if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
  7581. result += '\n';
  7582. }
  7583. // Add token name, e.g. `<img`
  7584. result += (token.nesting === -1 ? '</' : '<') + token.tag;
  7585. // Encode attributes, e.g. `<img src="foo"`
  7586. result += this.renderAttrs(token);
  7587. // Add a slash for self-closing tags, e.g. `<img src="foo" /`
  7588. if (token.nesting === 0 && options.xhtmlOut) {
  7589. result += ' /';
  7590. }
  7591. // Check if we need to add a newline after this tag
  7592. if (token.block) {
  7593. needLf = true;
  7594. if (token.nesting === 1) {
  7595. if (idx + 1 < tokens.length) {
  7596. nextToken = tokens[idx + 1];
  7597. if (nextToken.type === 'inline' || nextToken.hidden) {
  7598. // Block-level tag containing an inline tag.
  7599. //
  7600. needLf = false;
  7601. } else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
  7602. // Opening tag + closing tag of the same type. E.g. `<li></li>`.
  7603. //
  7604. needLf = false;
  7605. }
  7606. }
  7607. }
  7608. }
  7609. result += needLf ? '>\n' : '>';
  7610. return result;
  7611. };
  7612. /**
  7613. * Renderer.renderInline(tokens, options, env) -> String
  7614. * - tokens (Array): list on block tokens to renter
  7615. * - options (Object): params of parser instance
  7616. * - env (Object): additional data from parsed input (references, for example)
  7617. *
  7618. * The same as [[Renderer.render]], but for single token of `inline` type.
  7619. **/
  7620. Renderer.prototype.renderInline = function (tokens, options, env) {
  7621. var type,
  7622. result = '',
  7623. rules = this.rules;
  7624. for (var i = 0, len = tokens.length; i < len; i++) {
  7625. type = tokens[i].type;
  7626. if (typeof rules[type] !== 'undefined') {
  7627. result += rules[type](tokens, i, options, env, this);
  7628. } else {
  7629. result += this.renderToken(tokens, i, options);
  7630. }
  7631. }
  7632. return result;
  7633. };
  7634. /** internal
  7635. * Renderer.renderInlineAsText(tokens, options, env) -> String
  7636. * - tokens (Array): list on block tokens to renter
  7637. * - options (Object): params of parser instance
  7638. * - env (Object): additional data from parsed input (references, for example)
  7639. *
  7640. * Special kludge for image `alt` attributes to conform CommonMark spec.
  7641. * Don't try to use it! Spec requires to show `alt` content with stripped markup,
  7642. * instead of simple escaping.
  7643. **/
  7644. Renderer.prototype.renderInlineAsText = function (tokens, options, env) {
  7645. var result = '';
  7646. for (var i = 0, len = tokens.length; i < len; i++) {
  7647. if (tokens[i].type === 'text') {
  7648. result += tokens[i].content;
  7649. } else if (tokens[i].type === 'image') {
  7650. result += this.renderInlineAsText(tokens[i].children, options, env);
  7651. }
  7652. }
  7653. return result;
  7654. };
  7655. /**
  7656. * Renderer.render(tokens, options, env) -> String
  7657. * - tokens (Array): list on block tokens to renter
  7658. * - options (Object): params of parser instance
  7659. * - env (Object): additional data from parsed input (references, for example)
  7660. *
  7661. * Takes token stream and generates HTML. Probably, you will never need to call
  7662. * this method directly.
  7663. **/
  7664. Renderer.prototype.render = function (tokens, options, env) {
  7665. var i, len, type,
  7666. result = '',
  7667. rules = this.rules;
  7668. for (i = 0, len = tokens.length; i < len; i++) {
  7669. type = tokens[i].type;
  7670. if (type === 'inline') {
  7671. result += this.renderInline(tokens[i].children, options, env);
  7672. } else if (typeof rules[type] !== 'undefined') {
  7673. result += rules[tokens[i].type](tokens, i, options, env, this);
  7674. } else {
  7675. result += this.renderToken(tokens, i, options, env);
  7676. }
  7677. }
  7678. return result;
  7679. };
  7680. module.exports = Renderer;
  7681. /***/ }),
  7682. /* 43 */
  7683. /***/ (function(module, exports, __webpack_require__) {
  7684. "use strict";
  7685. // Block quotes
  7686. var isSpace = __webpack_require__(0).isSpace;
  7687. module.exports = function blockquote(state, startLine, endLine, silent) {
  7688. var adjustTab,
  7689. ch,
  7690. i,
  7691. initial,
  7692. isOutdented,
  7693. l,
  7694. lastLineEmpty,
  7695. lines,
  7696. nextLine,
  7697. offset,
  7698. oldBMarks,
  7699. oldBSCount,
  7700. oldIndent,
  7701. oldParentType,
  7702. oldSCount,
  7703. oldTShift,
  7704. spaceAfterMarker,
  7705. terminate,
  7706. terminatorRules,
  7707. token,
  7708. oldLineMax = state.lineMax,
  7709. pos = state.bMarks[startLine] + state.tShift[startLine],
  7710. max = state.eMarks[startLine];
  7711. // if it's indented more than 3 spaces, it should be a code block
  7712. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  7713. // check the block quote marker
  7714. if (state.src.charCodeAt(pos++) !== 0x3E/* > */) { return false; }
  7715. // we know that it's going to be a valid blockquote,
  7716. // so no point trying to find the end of it in silent mode
  7717. if (silent) { return true; }
  7718. // skip spaces after ">" and re-calculate offset
  7719. initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);
  7720. // skip one optional space after '>'
  7721. if (state.src.charCodeAt(pos) === 0x20 /* space */) {
  7722. // ' > test '
  7723. // ^ -- position start of line here:
  7724. pos++;
  7725. initial++;
  7726. offset++;
  7727. adjustTab = false;
  7728. spaceAfterMarker = true;
  7729. } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
  7730. spaceAfterMarker = true;
  7731. if ((state.bsCount[startLine] + offset) % 4 === 3) {
  7732. // ' >\t test '
  7733. // ^ -- position start of line here (tab has width===1)
  7734. pos++;
  7735. initial++;
  7736. offset++;
  7737. adjustTab = false;
  7738. } else {
  7739. // ' >\t test '
  7740. // ^ -- position start of line here + shift bsCount slightly
  7741. // to make extra space appear
  7742. adjustTab = true;
  7743. }
  7744. } else {
  7745. spaceAfterMarker = false;
  7746. }
  7747. oldBMarks = [ state.bMarks[startLine] ];
  7748. state.bMarks[startLine] = pos;
  7749. while (pos < max) {
  7750. ch = state.src.charCodeAt(pos);
  7751. if (isSpace(ch)) {
  7752. if (ch === 0x09) {
  7753. offset += 4 - (offset + state.bsCount[startLine] + (adjustTab ? 1 : 0)) % 4;
  7754. } else {
  7755. offset++;
  7756. }
  7757. } else {
  7758. break;
  7759. }
  7760. pos++;
  7761. }
  7762. oldBSCount = [ state.bsCount[startLine] ];
  7763. state.bsCount[startLine] = state.sCount[startLine] + 1 + (spaceAfterMarker ? 1 : 0);
  7764. lastLineEmpty = pos >= max;
  7765. oldSCount = [ state.sCount[startLine] ];
  7766. state.sCount[startLine] = offset - initial;
  7767. oldTShift = [ state.tShift[startLine] ];
  7768. state.tShift[startLine] = pos - state.bMarks[startLine];
  7769. terminatorRules = state.md.block.ruler.getRules('blockquote');
  7770. oldParentType = state.parentType;
  7771. state.parentType = 'blockquote';
  7772. // Search the end of the block
  7773. //
  7774. // Block ends with either:
  7775. // 1. an empty line outside:
  7776. // ```
  7777. // > test
  7778. //
  7779. // ```
  7780. // 2. an empty line inside:
  7781. // ```
  7782. // >
  7783. // test
  7784. // ```
  7785. // 3. another tag:
  7786. // ```
  7787. // > test
  7788. // - - -
  7789. // ```
  7790. for (nextLine = startLine + 1; nextLine < endLine; nextLine++) {
  7791. // check if it's outdented, i.e. it's inside list item and indented
  7792. // less than said list item:
  7793. //
  7794. // ```
  7795. // 1. anything
  7796. // > current blockquote
  7797. // 2. checking this line
  7798. // ```
  7799. isOutdented = state.sCount[nextLine] < state.blkIndent;
  7800. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  7801. max = state.eMarks[nextLine];
  7802. if (pos >= max) {
  7803. // Case 1: line is not inside the blockquote, and this line is empty.
  7804. break;
  7805. }
  7806. if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !isOutdented) {
  7807. // This line is inside the blockquote.
  7808. // skip spaces after ">" and re-calculate offset
  7809. initial = offset = state.sCount[nextLine] + pos - (state.bMarks[nextLine] + state.tShift[nextLine]);
  7810. // skip one optional space after '>'
  7811. if (state.src.charCodeAt(pos) === 0x20 /* space */) {
  7812. // ' > test '
  7813. // ^ -- position start of line here:
  7814. pos++;
  7815. initial++;
  7816. offset++;
  7817. adjustTab = false;
  7818. spaceAfterMarker = true;
  7819. } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
  7820. spaceAfterMarker = true;
  7821. if ((state.bsCount[nextLine] + offset) % 4 === 3) {
  7822. // ' >\t test '
  7823. // ^ -- position start of line here (tab has width===1)
  7824. pos++;
  7825. initial++;
  7826. offset++;
  7827. adjustTab = false;
  7828. } else {
  7829. // ' >\t test '
  7830. // ^ -- position start of line here + shift bsCount slightly
  7831. // to make extra space appear
  7832. adjustTab = true;
  7833. }
  7834. } else {
  7835. spaceAfterMarker = false;
  7836. }
  7837. oldBMarks.push(state.bMarks[nextLine]);
  7838. state.bMarks[nextLine] = pos;
  7839. while (pos < max) {
  7840. ch = state.src.charCodeAt(pos);
  7841. if (isSpace(ch)) {
  7842. if (ch === 0x09) {
  7843. offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
  7844. } else {
  7845. offset++;
  7846. }
  7847. } else {
  7848. break;
  7849. }
  7850. pos++;
  7851. }
  7852. lastLineEmpty = pos >= max;
  7853. oldBSCount.push(state.bsCount[nextLine]);
  7854. state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
  7855. oldSCount.push(state.sCount[nextLine]);
  7856. state.sCount[nextLine] = offset - initial;
  7857. oldTShift.push(state.tShift[nextLine]);
  7858. state.tShift[nextLine] = pos - state.bMarks[nextLine];
  7859. continue;
  7860. }
  7861. // Case 2: line is not inside the blockquote, and the last line was empty.
  7862. if (lastLineEmpty) { break; }
  7863. // Case 3: another tag found.
  7864. terminate = false;
  7865. for (i = 0, l = terminatorRules.length; i < l; i++) {
  7866. if (terminatorRules[i](state, nextLine, endLine, true)) {
  7867. terminate = true;
  7868. break;
  7869. }
  7870. }
  7871. if (terminate) {
  7872. // Quirk to enforce "hard termination mode" for paragraphs;
  7873. // normally if you call `tokenize(state, startLine, nextLine)`,
  7874. // paragraphs will look below nextLine for paragraph continuation,
  7875. // but if blockquote is terminated by another tag, they shouldn't
  7876. state.lineMax = nextLine;
  7877. if (state.blkIndent !== 0) {
  7878. // state.blkIndent was non-zero, we now set it to zero,
  7879. // so we need to re-calculate all offsets to appear as
  7880. // if indent wasn't changed
  7881. oldBMarks.push(state.bMarks[nextLine]);
  7882. oldBSCount.push(state.bsCount[nextLine]);
  7883. oldTShift.push(state.tShift[nextLine]);
  7884. oldSCount.push(state.sCount[nextLine]);
  7885. state.sCount[nextLine] -= state.blkIndent;
  7886. }
  7887. break;
  7888. }
  7889. if (isOutdented) break;
  7890. oldBMarks.push(state.bMarks[nextLine]);
  7891. oldBSCount.push(state.bsCount[nextLine]);
  7892. oldTShift.push(state.tShift[nextLine]);
  7893. oldSCount.push(state.sCount[nextLine]);
  7894. // A negative indentation means that this is a paragraph continuation
  7895. //
  7896. state.sCount[nextLine] = -1;
  7897. }
  7898. oldIndent = state.blkIndent;
  7899. state.blkIndent = 0;
  7900. token = state.push('blockquote_open', 'blockquote', 1);
  7901. token.markup = '>';
  7902. token.map = lines = [ startLine, 0 ];
  7903. state.md.block.tokenize(state, startLine, nextLine);
  7904. token = state.push('blockquote_close', 'blockquote', -1);
  7905. token.markup = '>';
  7906. state.lineMax = oldLineMax;
  7907. state.parentType = oldParentType;
  7908. lines[1] = state.line;
  7909. // Restore original tShift; this might not be necessary since the parser
  7910. // has already been here, but just to make sure we can do that.
  7911. for (i = 0; i < oldTShift.length; i++) {
  7912. state.bMarks[i + startLine] = oldBMarks[i];
  7913. state.tShift[i + startLine] = oldTShift[i];
  7914. state.sCount[i + startLine] = oldSCount[i];
  7915. state.bsCount[i + startLine] = oldBSCount[i];
  7916. }
  7917. state.blkIndent = oldIndent;
  7918. return true;
  7919. };
  7920. /***/ }),
  7921. /* 44 */
  7922. /***/ (function(module, exports, __webpack_require__) {
  7923. "use strict";
  7924. // Code block (4 spaces padded)
  7925. module.exports = function code(state, startLine, endLine/*, silent*/) {
  7926. var nextLine, last, token;
  7927. if (state.sCount[startLine] - state.blkIndent < 4) { return false; }
  7928. last = nextLine = startLine + 1;
  7929. while (nextLine < endLine) {
  7930. if (state.isEmpty(nextLine)) {
  7931. nextLine++;
  7932. continue;
  7933. }
  7934. if (state.sCount[nextLine] - state.blkIndent >= 4) {
  7935. nextLine++;
  7936. last = nextLine;
  7937. continue;
  7938. }
  7939. break;
  7940. }
  7941. state.line = last;
  7942. token = state.push('code_block', 'code', 0);
  7943. token.content = state.getLines(startLine, last, 4 + state.blkIndent, true);
  7944. token.map = [ startLine, state.line ];
  7945. return true;
  7946. };
  7947. /***/ }),
  7948. /* 45 */
  7949. /***/ (function(module, exports, __webpack_require__) {
  7950. "use strict";
  7951. // fences (``` lang, ~~~ lang)
  7952. module.exports = function fence(state, startLine, endLine, silent) {
  7953. var marker, len, params, nextLine, mem, token, markup,
  7954. haveEndMarker = false,
  7955. pos = state.bMarks[startLine] + state.tShift[startLine],
  7956. max = state.eMarks[startLine];
  7957. // if it's indented more than 3 spaces, it should be a code block
  7958. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  7959. if (pos + 3 > max) { return false; }
  7960. marker = state.src.charCodeAt(pos);
  7961. if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {
  7962. return false;
  7963. }
  7964. // scan marker length
  7965. mem = pos;
  7966. pos = state.skipChars(pos, marker);
  7967. len = pos - mem;
  7968. if (len < 3) { return false; }
  7969. markup = state.src.slice(mem, pos);
  7970. params = state.src.slice(pos, max);
  7971. if (params.indexOf(String.fromCharCode(marker)) >= 0) { return false; }
  7972. // Since start is found, we can report success here in validation mode
  7973. if (silent) { return true; }
  7974. // search end of block
  7975. nextLine = startLine;
  7976. for (;;) {
  7977. nextLine++;
  7978. if (nextLine >= endLine) {
  7979. // unclosed block should be autoclosed by end of document.
  7980. // also block seems to be autoclosed by end of parent
  7981. break;
  7982. }
  7983. pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
  7984. max = state.eMarks[nextLine];
  7985. if (pos < max && state.sCount[nextLine] < state.blkIndent) {
  7986. // non-empty line with negative indent should stop the list:
  7987. // - ```
  7988. // test
  7989. break;
  7990. }
  7991. if (state.src.charCodeAt(pos) !== marker) { continue; }
  7992. if (state.sCount[nextLine] - state.blkIndent >= 4) {
  7993. // closing fence should be indented less than 4 spaces
  7994. continue;
  7995. }
  7996. pos = state.skipChars(pos, marker);
  7997. // closing code fence must be at least as long as the opening one
  7998. if (pos - mem < len) { continue; }
  7999. // make sure tail has spaces only
  8000. pos = state.skipSpaces(pos);
  8001. if (pos < max) { continue; }
  8002. haveEndMarker = true;
  8003. // found!
  8004. break;
  8005. }
  8006. // If a fence has heading spaces, they should be removed from its inner block
  8007. len = state.sCount[startLine];
  8008. state.line = nextLine + (haveEndMarker ? 1 : 0);
  8009. token = state.push('fence', 'code', 0);
  8010. token.info = params;
  8011. token.content = state.getLines(startLine + 1, nextLine, len, true);
  8012. token.markup = markup;
  8013. token.map = [ startLine, state.line ];
  8014. return true;
  8015. };
  8016. /***/ }),
  8017. /* 46 */
  8018. /***/ (function(module, exports, __webpack_require__) {
  8019. "use strict";
  8020. // heading (#, ##, ...)
  8021. var isSpace = __webpack_require__(0).isSpace;
  8022. module.exports = function heading(state, startLine, endLine, silent) {
  8023. var ch, level, tmp, token,
  8024. pos = state.bMarks[startLine] + state.tShift[startLine],
  8025. max = state.eMarks[startLine];
  8026. // if it's indented more than 3 spaces, it should be a code block
  8027. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8028. ch = state.src.charCodeAt(pos);
  8029. if (ch !== 0x23/* # */ || pos >= max) { return false; }
  8030. // count heading level
  8031. level = 1;
  8032. ch = state.src.charCodeAt(++pos);
  8033. while (ch === 0x23/* # */ && pos < max && level <= 6) {
  8034. level++;
  8035. ch = state.src.charCodeAt(++pos);
  8036. }
  8037. if (level > 6 || (pos < max && !isSpace(ch))) { return false; }
  8038. if (silent) { return true; }
  8039. // Let's cut tails like ' ### ' from the end of string
  8040. max = state.skipSpacesBack(max, pos);
  8041. tmp = state.skipCharsBack(max, 0x23, pos); // #
  8042. if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
  8043. max = tmp;
  8044. }
  8045. state.line = startLine + 1;
  8046. token = state.push('heading_open', 'h' + String(level), 1);
  8047. token.markup = '########'.slice(0, level);
  8048. token.map = [ startLine, state.line ];
  8049. token = state.push('inline', '', 0);
  8050. token.content = state.src.slice(pos, max).trim();
  8051. token.map = [ startLine, state.line ];
  8052. token.children = [];
  8053. token = state.push('heading_close', 'h' + String(level), -1);
  8054. token.markup = '########'.slice(0, level);
  8055. return true;
  8056. };
  8057. /***/ }),
  8058. /* 47 */
  8059. /***/ (function(module, exports, __webpack_require__) {
  8060. "use strict";
  8061. // Horizontal rule
  8062. var isSpace = __webpack_require__(0).isSpace;
  8063. module.exports = function hr(state, startLine, endLine, silent) {
  8064. var marker, cnt, ch, token,
  8065. pos = state.bMarks[startLine] + state.tShift[startLine],
  8066. max = state.eMarks[startLine];
  8067. // if it's indented more than 3 spaces, it should be a code block
  8068. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8069. marker = state.src.charCodeAt(pos++);
  8070. // Check hr marker
  8071. if (marker !== 0x2A/* * */ &&
  8072. marker !== 0x2D/* - */ &&
  8073. marker !== 0x5F/* _ */) {
  8074. return false;
  8075. }
  8076. // markers can be mixed with spaces, but there should be at least 3 of them
  8077. cnt = 1;
  8078. while (pos < max) {
  8079. ch = state.src.charCodeAt(pos++);
  8080. if (ch !== marker && !isSpace(ch)) { return false; }
  8081. if (ch === marker) { cnt++; }
  8082. }
  8083. if (cnt < 3) { return false; }
  8084. if (silent) { return true; }
  8085. state.line = startLine + 1;
  8086. token = state.push('hr', 'hr', 0);
  8087. token.map = [ startLine, state.line ];
  8088. token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
  8089. return true;
  8090. };
  8091. /***/ }),
  8092. /* 48 */
  8093. /***/ (function(module, exports, __webpack_require__) {
  8094. "use strict";
  8095. // HTML block
  8096. var block_names = __webpack_require__(30);
  8097. var HTML_OPEN_CLOSE_TAG_RE = __webpack_require__(12).HTML_OPEN_CLOSE_TAG_RE;
  8098. // An array of opening and corresponding closing sequences for html tags,
  8099. // last argument defines whether it can terminate a paragraph or not
  8100. //
  8101. var HTML_SEQUENCES = [
  8102. [ /^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true ],
  8103. [ /^<!--/, /-->/, true ],
  8104. [ /^<\?/, /\?>/, true ],
  8105. [ /^<![A-Z]/, />/, true ],
  8106. [ /^<!\[CDATA\[/, /\]\]>/, true ],
  8107. [ new RegExp('^</?(' + block_names.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true ],
  8108. [ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false ]
  8109. ];
  8110. module.exports = function html_block(state, startLine, endLine, silent) {
  8111. var i, nextLine, token, lineText,
  8112. pos = state.bMarks[startLine] + state.tShift[startLine],
  8113. max = state.eMarks[startLine];
  8114. // if it's indented more than 3 spaces, it should be a code block
  8115. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8116. if (!state.md.options.html) { return false; }
  8117. if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
  8118. lineText = state.src.slice(pos, max);
  8119. for (i = 0; i < HTML_SEQUENCES.length; i++) {
  8120. if (HTML_SEQUENCES[i][0].test(lineText)) { break; }
  8121. }
  8122. if (i === HTML_SEQUENCES.length) { return false; }
  8123. if (silent) {
  8124. // true if this sequence can be a terminator, false otherwise
  8125. return HTML_SEQUENCES[i][2];
  8126. }
  8127. nextLine = startLine + 1;
  8128. // If we are here - we detected HTML block.
  8129. // Let's roll down till block end.
  8130. if (!HTML_SEQUENCES[i][1].test(lineText)) {
  8131. for (; nextLine < endLine; nextLine++) {
  8132. if (state.sCount[nextLine] < state.blkIndent) { break; }
  8133. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  8134. max = state.eMarks[nextLine];
  8135. lineText = state.src.slice(pos, max);
  8136. if (HTML_SEQUENCES[i][1].test(lineText)) {
  8137. if (lineText.length !== 0) { nextLine++; }
  8138. break;
  8139. }
  8140. }
  8141. }
  8142. state.line = nextLine;
  8143. token = state.push('html_block', '', 0);
  8144. token.map = [ startLine, nextLine ];
  8145. token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
  8146. return true;
  8147. };
  8148. /***/ }),
  8149. /* 49 */
  8150. /***/ (function(module, exports, __webpack_require__) {
  8151. "use strict";
  8152. // lheading (---, ===)
  8153. module.exports = function lheading(state, startLine, endLine/*, silent*/) {
  8154. var content, terminate, i, l, token, pos, max, level, marker,
  8155. nextLine = startLine + 1, oldParentType,
  8156. terminatorRules = state.md.block.ruler.getRules('paragraph');
  8157. // if it's indented more than 3 spaces, it should be a code block
  8158. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8159. oldParentType = state.parentType;
  8160. state.parentType = 'paragraph'; // use paragraph to match terminatorRules
  8161. // jump line-by-line until empty one or EOF
  8162. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8163. // this would be a code block normally, but after paragraph
  8164. // it's considered a lazy continuation regardless of what's there
  8165. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8166. //
  8167. // Check for underline in setext header
  8168. //
  8169. if (state.sCount[nextLine] >= state.blkIndent) {
  8170. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  8171. max = state.eMarks[nextLine];
  8172. if (pos < max) {
  8173. marker = state.src.charCodeAt(pos);
  8174. if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {
  8175. pos = state.skipChars(pos, marker);
  8176. pos = state.skipSpaces(pos);
  8177. if (pos >= max) {
  8178. level = (marker === 0x3D/* = */ ? 1 : 2);
  8179. break;
  8180. }
  8181. }
  8182. }
  8183. }
  8184. // quirk for blockquotes, this line should already be checked by that rule
  8185. if (state.sCount[nextLine] < 0) { continue; }
  8186. // Some tags can terminate paragraph without empty line.
  8187. terminate = false;
  8188. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8189. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8190. terminate = true;
  8191. break;
  8192. }
  8193. }
  8194. if (terminate) { break; }
  8195. }
  8196. if (!level) {
  8197. // Didn't find valid underline
  8198. return false;
  8199. }
  8200. content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8201. state.line = nextLine + 1;
  8202. token = state.push('heading_open', 'h' + String(level), 1);
  8203. token.markup = String.fromCharCode(marker);
  8204. token.map = [ startLine, state.line ];
  8205. token = state.push('inline', '', 0);
  8206. token.content = content;
  8207. token.map = [ startLine, state.line - 1 ];
  8208. token.children = [];
  8209. token = state.push('heading_close', 'h' + String(level), -1);
  8210. token.markup = String.fromCharCode(marker);
  8211. state.parentType = oldParentType;
  8212. return true;
  8213. };
  8214. /***/ }),
  8215. /* 50 */
  8216. /***/ (function(module, exports, __webpack_require__) {
  8217. "use strict";
  8218. // Lists
  8219. var isSpace = __webpack_require__(0).isSpace;
  8220. // Search `[-+*][\n ]`, returns next pos arter marker on success
  8221. // or -1 on fail.
  8222. function skipBulletListMarker(state, startLine) {
  8223. var marker, pos, max, ch;
  8224. pos = state.bMarks[startLine] + state.tShift[startLine];
  8225. max = state.eMarks[startLine];
  8226. marker = state.src.charCodeAt(pos++);
  8227. // Check bullet
  8228. if (marker !== 0x2A/* * */ &&
  8229. marker !== 0x2D/* - */ &&
  8230. marker !== 0x2B/* + */) {
  8231. return -1;
  8232. }
  8233. if (pos < max) {
  8234. ch = state.src.charCodeAt(pos);
  8235. if (!isSpace(ch)) {
  8236. // " -test " - is not a list item
  8237. return -1;
  8238. }
  8239. }
  8240. return pos;
  8241. }
  8242. // Search `\d+[.)][\n ]`, returns next pos arter marker on success
  8243. // or -1 on fail.
  8244. function skipOrderedListMarker(state, startLine) {
  8245. var ch,
  8246. start = state.bMarks[startLine] + state.tShift[startLine],
  8247. pos = start,
  8248. max = state.eMarks[startLine];
  8249. // List marker should have at least 2 chars (digit + dot)
  8250. if (pos + 1 >= max) { return -1; }
  8251. ch = state.src.charCodeAt(pos++);
  8252. if (ch < 0x30/* 0 */ || ch > 0x39/* 9 */) { return -1; }
  8253. for (;;) {
  8254. // EOL -> fail
  8255. if (pos >= max) { return -1; }
  8256. ch = state.src.charCodeAt(pos++);
  8257. if (ch >= 0x30/* 0 */ && ch <= 0x39/* 9 */) {
  8258. // List marker should have no more than 9 digits
  8259. // (prevents integer overflow in browsers)
  8260. if (pos - start >= 10) { return -1; }
  8261. continue;
  8262. }
  8263. // found valid marker
  8264. if (ch === 0x29/* ) */ || ch === 0x2e/* . */) {
  8265. break;
  8266. }
  8267. return -1;
  8268. }
  8269. if (pos < max) {
  8270. ch = state.src.charCodeAt(pos);
  8271. if (!isSpace(ch)) {
  8272. // " 1.test " - is not a list item
  8273. return -1;
  8274. }
  8275. }
  8276. return pos;
  8277. }
  8278. function markTightParagraphs(state, idx) {
  8279. var i, l,
  8280. level = state.level + 2;
  8281. for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {
  8282. if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {
  8283. state.tokens[i + 2].hidden = true;
  8284. state.tokens[i].hidden = true;
  8285. i += 2;
  8286. }
  8287. }
  8288. }
  8289. module.exports = function list(state, startLine, endLine, silent) {
  8290. var ch,
  8291. contentStart,
  8292. i,
  8293. indent,
  8294. indentAfterMarker,
  8295. initial,
  8296. isOrdered,
  8297. itemLines,
  8298. l,
  8299. listLines,
  8300. listTokIdx,
  8301. markerCharCode,
  8302. markerValue,
  8303. max,
  8304. nextLine,
  8305. offset,
  8306. oldIndent,
  8307. oldLIndent,
  8308. oldParentType,
  8309. oldTShift,
  8310. oldTight,
  8311. pos,
  8312. posAfterMarker,
  8313. prevEmptyEnd,
  8314. start,
  8315. terminate,
  8316. terminatorRules,
  8317. token,
  8318. isTerminatingParagraph = false,
  8319. tight = true;
  8320. // if it's indented more than 3 spaces, it should be a code block
  8321. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8322. // limit conditions when list can interrupt
  8323. // a paragraph (validation mode only)
  8324. if (silent && state.parentType === 'paragraph') {
  8325. // Next list item should still terminate previous list item;
  8326. //
  8327. // This code can fail if plugins use blkIndent as well as lists,
  8328. // but I hope the spec gets fixed long before that happens.
  8329. //
  8330. if (state.tShift[startLine] >= state.blkIndent) {
  8331. isTerminatingParagraph = true;
  8332. }
  8333. }
  8334. // Detect list type and position after marker
  8335. if ((posAfterMarker = skipOrderedListMarker(state, startLine)) >= 0) {
  8336. isOrdered = true;
  8337. start = state.bMarks[startLine] + state.tShift[startLine];
  8338. markerValue = Number(state.src.substr(start, posAfterMarker - start - 1));
  8339. // If we're starting a new ordered list right after
  8340. // a paragraph, it should start with 1.
  8341. if (isTerminatingParagraph && markerValue !== 1) return false;
  8342. } else if ((posAfterMarker = skipBulletListMarker(state, startLine)) >= 0) {
  8343. isOrdered = false;
  8344. } else {
  8345. return false;
  8346. }
  8347. // If we're starting a new unordered list right after
  8348. // a paragraph, first line should not be empty.
  8349. if (isTerminatingParagraph) {
  8350. if (state.skipSpaces(posAfterMarker) >= state.eMarks[startLine]) return false;
  8351. }
  8352. // We should terminate list on style change. Remember first one to compare.
  8353. markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
  8354. // For validation mode we can terminate immediately
  8355. if (silent) { return true; }
  8356. // Start list
  8357. listTokIdx = state.tokens.length;
  8358. if (isOrdered) {
  8359. token = state.push('ordered_list_open', 'ol', 1);
  8360. if (markerValue !== 1) {
  8361. token.attrs = [ [ 'start', markerValue ] ];
  8362. }
  8363. } else {
  8364. token = state.push('bullet_list_open', 'ul', 1);
  8365. }
  8366. token.map = listLines = [ startLine, 0 ];
  8367. token.markup = String.fromCharCode(markerCharCode);
  8368. //
  8369. // Iterate list items
  8370. //
  8371. nextLine = startLine;
  8372. prevEmptyEnd = false;
  8373. terminatorRules = state.md.block.ruler.getRules('list');
  8374. oldParentType = state.parentType;
  8375. state.parentType = 'list';
  8376. while (nextLine < endLine) {
  8377. pos = posAfterMarker;
  8378. max = state.eMarks[nextLine];
  8379. initial = offset = state.sCount[nextLine] + posAfterMarker - (state.bMarks[startLine] + state.tShift[startLine]);
  8380. while (pos < max) {
  8381. ch = state.src.charCodeAt(pos);
  8382. if (isSpace(ch)) {
  8383. if (ch === 0x09) {
  8384. offset += 4 - (offset + state.bsCount[nextLine]) % 4;
  8385. } else {
  8386. offset++;
  8387. }
  8388. } else {
  8389. break;
  8390. }
  8391. pos++;
  8392. }
  8393. contentStart = pos;
  8394. if (contentStart >= max) {
  8395. // trimming space in "- \n 3" case, indent is 1 here
  8396. indentAfterMarker = 1;
  8397. } else {
  8398. indentAfterMarker = offset - initial;
  8399. }
  8400. // If we have more than 4 spaces, the indent is 1
  8401. // (the rest is just indented code block)
  8402. if (indentAfterMarker > 4) { indentAfterMarker = 1; }
  8403. // " - test"
  8404. // ^^^^^ - calculating total length of this thing
  8405. indent = initial + indentAfterMarker;
  8406. // Run subparser & write tokens
  8407. token = state.push('list_item_open', 'li', 1);
  8408. token.markup = String.fromCharCode(markerCharCode);
  8409. token.map = itemLines = [ startLine, 0 ];
  8410. oldIndent = state.blkIndent;
  8411. oldTight = state.tight;
  8412. oldTShift = state.tShift[startLine];
  8413. oldLIndent = state.sCount[startLine];
  8414. state.blkIndent = indent;
  8415. state.tight = true;
  8416. state.tShift[startLine] = contentStart - state.bMarks[startLine];
  8417. state.sCount[startLine] = offset;
  8418. if (contentStart >= max && state.isEmpty(startLine + 1)) {
  8419. // workaround for this case
  8420. // (list item is empty, list terminates before "foo"):
  8421. // ~~~~~~~~
  8422. // -
  8423. //
  8424. // foo
  8425. // ~~~~~~~~
  8426. state.line = Math.min(state.line + 2, endLine);
  8427. } else {
  8428. state.md.block.tokenize(state, startLine, endLine, true);
  8429. }
  8430. // If any of list item is tight, mark list as tight
  8431. if (!state.tight || prevEmptyEnd) {
  8432. tight = false;
  8433. }
  8434. // Item become loose if finish with empty line,
  8435. // but we should filter last element, because it means list finish
  8436. prevEmptyEnd = (state.line - startLine) > 1 && state.isEmpty(state.line - 1);
  8437. state.blkIndent = oldIndent;
  8438. state.tShift[startLine] = oldTShift;
  8439. state.sCount[startLine] = oldLIndent;
  8440. state.tight = oldTight;
  8441. token = state.push('list_item_close', 'li', -1);
  8442. token.markup = String.fromCharCode(markerCharCode);
  8443. nextLine = startLine = state.line;
  8444. itemLines[1] = nextLine;
  8445. contentStart = state.bMarks[startLine];
  8446. if (nextLine >= endLine) { break; }
  8447. //
  8448. // Try to check if list is terminated or continued.
  8449. //
  8450. if (state.sCount[nextLine] < state.blkIndent) { break; }
  8451. // fail if terminating block found
  8452. terminate = false;
  8453. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8454. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8455. terminate = true;
  8456. break;
  8457. }
  8458. }
  8459. if (terminate) { break; }
  8460. // fail if list has another type
  8461. if (isOrdered) {
  8462. posAfterMarker = skipOrderedListMarker(state, nextLine);
  8463. if (posAfterMarker < 0) { break; }
  8464. } else {
  8465. posAfterMarker = skipBulletListMarker(state, nextLine);
  8466. if (posAfterMarker < 0) { break; }
  8467. }
  8468. if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; }
  8469. }
  8470. // Finilize list
  8471. if (isOrdered) {
  8472. token = state.push('ordered_list_close', 'ol', -1);
  8473. } else {
  8474. token = state.push('bullet_list_close', 'ul', -1);
  8475. }
  8476. token.markup = String.fromCharCode(markerCharCode);
  8477. listLines[1] = nextLine;
  8478. state.line = nextLine;
  8479. state.parentType = oldParentType;
  8480. // mark paragraphs tight if needed
  8481. if (tight) {
  8482. markTightParagraphs(state, listTokIdx);
  8483. }
  8484. return true;
  8485. };
  8486. /***/ }),
  8487. /* 51 */
  8488. /***/ (function(module, exports, __webpack_require__) {
  8489. "use strict";
  8490. // Paragraph
  8491. module.exports = function paragraph(state, startLine/*, endLine*/) {
  8492. var content, terminate, i, l, token, oldParentType,
  8493. nextLine = startLine + 1,
  8494. terminatorRules = state.md.block.ruler.getRules('paragraph'),
  8495. endLine = state.lineMax;
  8496. oldParentType = state.parentType;
  8497. state.parentType = 'paragraph';
  8498. // jump line-by-line until empty one or EOF
  8499. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8500. // this would be a code block normally, but after paragraph
  8501. // it's considered a lazy continuation regardless of what's there
  8502. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8503. // quirk for blockquotes, this line should already be checked by that rule
  8504. if (state.sCount[nextLine] < 0) { continue; }
  8505. // Some tags can terminate paragraph without empty line.
  8506. terminate = false;
  8507. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8508. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8509. terminate = true;
  8510. break;
  8511. }
  8512. }
  8513. if (terminate) { break; }
  8514. }
  8515. content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8516. state.line = nextLine;
  8517. token = state.push('paragraph_open', 'p', 1);
  8518. token.map = [ startLine, state.line ];
  8519. token = state.push('inline', '', 0);
  8520. token.content = content;
  8521. token.map = [ startLine, state.line ];
  8522. token.children = [];
  8523. token = state.push('paragraph_close', 'p', -1);
  8524. state.parentType = oldParentType;
  8525. return true;
  8526. };
  8527. /***/ }),
  8528. /* 52 */
  8529. /***/ (function(module, exports, __webpack_require__) {
  8530. "use strict";
  8531. var normalizeReference = __webpack_require__(0).normalizeReference;
  8532. var isSpace = __webpack_require__(0).isSpace;
  8533. module.exports = function reference(state, startLine, _endLine, silent) {
  8534. var ch,
  8535. destEndPos,
  8536. destEndLineNo,
  8537. endLine,
  8538. href,
  8539. i,
  8540. l,
  8541. label,
  8542. labelEnd,
  8543. oldParentType,
  8544. res,
  8545. start,
  8546. str,
  8547. terminate,
  8548. terminatorRules,
  8549. title,
  8550. lines = 0,
  8551. pos = state.bMarks[startLine] + state.tShift[startLine],
  8552. max = state.eMarks[startLine],
  8553. nextLine = startLine + 1;
  8554. // if it's indented more than 3 spaces, it should be a code block
  8555. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8556. if (state.src.charCodeAt(pos) !== 0x5B/* [ */) { return false; }
  8557. // Simple check to quickly interrupt scan on [link](url) at the start of line.
  8558. // Can be useful on practice: https://github.com/markdown-it/markdown-it/issues/54
  8559. while (++pos < max) {
  8560. if (state.src.charCodeAt(pos) === 0x5D /* ] */ &&
  8561. state.src.charCodeAt(pos - 1) !== 0x5C/* \ */) {
  8562. if (pos + 1 === max) { return false; }
  8563. if (state.src.charCodeAt(pos + 1) !== 0x3A/* : */) { return false; }
  8564. break;
  8565. }
  8566. }
  8567. endLine = state.lineMax;
  8568. // jump line-by-line until empty one or EOF
  8569. terminatorRules = state.md.block.ruler.getRules('reference');
  8570. oldParentType = state.parentType;
  8571. state.parentType = 'reference';
  8572. for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
  8573. // this would be a code block normally, but after paragraph
  8574. // it's considered a lazy continuation regardless of what's there
  8575. if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
  8576. // quirk for blockquotes, this line should already be checked by that rule
  8577. if (state.sCount[nextLine] < 0) { continue; }
  8578. // Some tags can terminate paragraph without empty line.
  8579. terminate = false;
  8580. for (i = 0, l = terminatorRules.length; i < l; i++) {
  8581. if (terminatorRules[i](state, nextLine, endLine, true)) {
  8582. terminate = true;
  8583. break;
  8584. }
  8585. }
  8586. if (terminate) { break; }
  8587. }
  8588. str = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
  8589. max = str.length;
  8590. for (pos = 1; pos < max; pos++) {
  8591. ch = str.charCodeAt(pos);
  8592. if (ch === 0x5B /* [ */) {
  8593. return false;
  8594. } else if (ch === 0x5D /* ] */) {
  8595. labelEnd = pos;
  8596. break;
  8597. } else if (ch === 0x0A /* \n */) {
  8598. lines++;
  8599. } else if (ch === 0x5C /* \ */) {
  8600. pos++;
  8601. if (pos < max && str.charCodeAt(pos) === 0x0A) {
  8602. lines++;
  8603. }
  8604. }
  8605. }
  8606. if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A/* : */) { return false; }
  8607. // [label]: destination 'title'
  8608. // ^^^ skip optional whitespace here
  8609. for (pos = labelEnd + 2; pos < max; pos++) {
  8610. ch = str.charCodeAt(pos);
  8611. if (ch === 0x0A) {
  8612. lines++;
  8613. } else if (isSpace(ch)) {
  8614. /*eslint no-empty:0*/
  8615. } else {
  8616. break;
  8617. }
  8618. }
  8619. // [label]: destination 'title'
  8620. // ^^^^^^^^^^^ parse this
  8621. res = state.md.helpers.parseLinkDestination(str, pos, max);
  8622. if (!res.ok) { return false; }
  8623. href = state.md.normalizeLink(res.str);
  8624. if (!state.md.validateLink(href)) { return false; }
  8625. pos = res.pos;
  8626. lines += res.lines;
  8627. // save cursor state, we could require to rollback later
  8628. destEndPos = pos;
  8629. destEndLineNo = lines;
  8630. // [label]: destination 'title'
  8631. // ^^^ skipping those spaces
  8632. start = pos;
  8633. for (; pos < max; pos++) {
  8634. ch = str.charCodeAt(pos);
  8635. if (ch === 0x0A) {
  8636. lines++;
  8637. } else if (isSpace(ch)) {
  8638. /*eslint no-empty:0*/
  8639. } else {
  8640. break;
  8641. }
  8642. }
  8643. // [label]: destination 'title'
  8644. // ^^^^^^^ parse this
  8645. res = state.md.helpers.parseLinkTitle(str, pos, max);
  8646. if (pos < max && start !== pos && res.ok) {
  8647. title = res.str;
  8648. pos = res.pos;
  8649. lines += res.lines;
  8650. } else {
  8651. title = '';
  8652. pos = destEndPos;
  8653. lines = destEndLineNo;
  8654. }
  8655. // skip trailing spaces until the rest of the line
  8656. while (pos < max) {
  8657. ch = str.charCodeAt(pos);
  8658. if (!isSpace(ch)) { break; }
  8659. pos++;
  8660. }
  8661. if (pos < max && str.charCodeAt(pos) !== 0x0A) {
  8662. if (title) {
  8663. // garbage at the end of the line after title,
  8664. // but it could still be a valid reference if we roll back
  8665. title = '';
  8666. pos = destEndPos;
  8667. lines = destEndLineNo;
  8668. while (pos < max) {
  8669. ch = str.charCodeAt(pos);
  8670. if (!isSpace(ch)) { break; }
  8671. pos++;
  8672. }
  8673. }
  8674. }
  8675. if (pos < max && str.charCodeAt(pos) !== 0x0A) {
  8676. // garbage at the end of the line
  8677. return false;
  8678. }
  8679. label = normalizeReference(str.slice(1, labelEnd));
  8680. if (!label) {
  8681. // CommonMark 0.20 disallows empty labels
  8682. return false;
  8683. }
  8684. // Reference can not terminate anything. This check is for safety only.
  8685. /*istanbul ignore if*/
  8686. if (silent) { return true; }
  8687. if (typeof state.env.references === 'undefined') {
  8688. state.env.references = {};
  8689. }
  8690. if (typeof state.env.references[label] === 'undefined') {
  8691. state.env.references[label] = { title: title, href: href };
  8692. }
  8693. state.parentType = oldParentType;
  8694. state.line = startLine + lines + 1;
  8695. return true;
  8696. };
  8697. /***/ }),
  8698. /* 53 */
  8699. /***/ (function(module, exports, __webpack_require__) {
  8700. "use strict";
  8701. // Parser state class
  8702. var Token = __webpack_require__(4);
  8703. var isSpace = __webpack_require__(0).isSpace;
  8704. function StateBlock(src, md, env, tokens) {
  8705. var ch, s, start, pos, len, indent, offset, indent_found;
  8706. this.src = src;
  8707. // link to parser instance
  8708. this.md = md;
  8709. this.env = env;
  8710. //
  8711. // Internal state vartiables
  8712. //
  8713. this.tokens = tokens;
  8714. this.bMarks = []; // line begin offsets for fast jumps
  8715. this.eMarks = []; // line end offsets for fast jumps
  8716. this.tShift = []; // offsets of the first non-space characters (tabs not expanded)
  8717. this.sCount = []; // indents for each line (tabs expanded)
  8718. // An amount of virtual spaces (tabs expanded) between beginning
  8719. // of each line (bMarks) and real beginning of that line.
  8720. //
  8721. // It exists only as a hack because blockquotes override bMarks
  8722. // losing information in the process.
  8723. //
  8724. // It's used only when expanding tabs, you can think about it as
  8725. // an initial tab length, e.g. bsCount=21 applied to string `\t123`
  8726. // means first tab should be expanded to 4-21%4 === 3 spaces.
  8727. //
  8728. this.bsCount = [];
  8729. // block parser variables
  8730. this.blkIndent = 0; // required block content indent
  8731. // (for example, if we are in list)
  8732. this.line = 0; // line index in src
  8733. this.lineMax = 0; // lines count
  8734. this.tight = false; // loose/tight mode for lists
  8735. this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any)
  8736. // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'
  8737. // used in lists to determine if they interrupt a paragraph
  8738. this.parentType = 'root';
  8739. this.level = 0;
  8740. // renderer
  8741. this.result = '';
  8742. // Create caches
  8743. // Generate markers.
  8744. s = this.src;
  8745. indent_found = false;
  8746. for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) {
  8747. ch = s.charCodeAt(pos);
  8748. if (!indent_found) {
  8749. if (isSpace(ch)) {
  8750. indent++;
  8751. if (ch === 0x09) {
  8752. offset += 4 - offset % 4;
  8753. } else {
  8754. offset++;
  8755. }
  8756. continue;
  8757. } else {
  8758. indent_found = true;
  8759. }
  8760. }
  8761. if (ch === 0x0A || pos === len - 1) {
  8762. if (ch !== 0x0A) { pos++; }
  8763. this.bMarks.push(start);
  8764. this.eMarks.push(pos);
  8765. this.tShift.push(indent);
  8766. this.sCount.push(offset);
  8767. this.bsCount.push(0);
  8768. indent_found = false;
  8769. indent = 0;
  8770. offset = 0;
  8771. start = pos + 1;
  8772. }
  8773. }
  8774. // Push fake entry to simplify cache bounds checks
  8775. this.bMarks.push(s.length);
  8776. this.eMarks.push(s.length);
  8777. this.tShift.push(0);
  8778. this.sCount.push(0);
  8779. this.bsCount.push(0);
  8780. this.lineMax = this.bMarks.length - 1; // don't count last fake line
  8781. }
  8782. // Push new token to "stream".
  8783. //
  8784. StateBlock.prototype.push = function (type, tag, nesting) {
  8785. var token = new Token(type, tag, nesting);
  8786. token.block = true;
  8787. if (nesting < 0) { this.level--; }
  8788. token.level = this.level;
  8789. if (nesting > 0) { this.level++; }
  8790. this.tokens.push(token);
  8791. return token;
  8792. };
  8793. StateBlock.prototype.isEmpty = function isEmpty(line) {
  8794. return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
  8795. };
  8796. StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
  8797. for (var max = this.lineMax; from < max; from++) {
  8798. if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
  8799. break;
  8800. }
  8801. }
  8802. return from;
  8803. };
  8804. // Skip spaces from given position.
  8805. StateBlock.prototype.skipSpaces = function skipSpaces(pos) {
  8806. var ch;
  8807. for (var max = this.src.length; pos < max; pos++) {
  8808. ch = this.src.charCodeAt(pos);
  8809. if (!isSpace(ch)) { break; }
  8810. }
  8811. return pos;
  8812. };
  8813. // Skip spaces from given position in reverse.
  8814. StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {
  8815. if (pos <= min) { return pos; }
  8816. while (pos > min) {
  8817. if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1; }
  8818. }
  8819. return pos;
  8820. };
  8821. // Skip char codes from given position
  8822. StateBlock.prototype.skipChars = function skipChars(pos, code) {
  8823. for (var max = this.src.length; pos < max; pos++) {
  8824. if (this.src.charCodeAt(pos) !== code) { break; }
  8825. }
  8826. return pos;
  8827. };
  8828. // Skip char codes reverse from given position - 1
  8829. StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {
  8830. if (pos <= min) { return pos; }
  8831. while (pos > min) {
  8832. if (code !== this.src.charCodeAt(--pos)) { return pos + 1; }
  8833. }
  8834. return pos;
  8835. };
  8836. // cut lines range from source.
  8837. StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {
  8838. var i, lineIndent, ch, first, last, queue, lineStart,
  8839. line = begin;
  8840. if (begin >= end) {
  8841. return '';
  8842. }
  8843. queue = new Array(end - begin);
  8844. for (i = 0; line < end; line++, i++) {
  8845. lineIndent = 0;
  8846. lineStart = first = this.bMarks[line];
  8847. if (line + 1 < end || keepLastLF) {
  8848. // No need for bounds check because we have fake entry on tail.
  8849. last = this.eMarks[line] + 1;
  8850. } else {
  8851. last = this.eMarks[line];
  8852. }
  8853. while (first < last && lineIndent < indent) {
  8854. ch = this.src.charCodeAt(first);
  8855. if (isSpace(ch)) {
  8856. if (ch === 0x09) {
  8857. lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
  8858. } else {
  8859. lineIndent++;
  8860. }
  8861. } else if (first - lineStart < this.tShift[line]) {
  8862. // patched tShift masked characters to look like spaces (blockquotes, list markers)
  8863. lineIndent++;
  8864. } else {
  8865. break;
  8866. }
  8867. first++;
  8868. }
  8869. if (lineIndent > indent) {
  8870. // partially expanding tabs in code blocks, e.g '\t\tfoobar'
  8871. // with indent=2 becomes ' \tfoobar'
  8872. queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last);
  8873. } else {
  8874. queue[i] = this.src.slice(first, last);
  8875. }
  8876. }
  8877. return queue.join('');
  8878. };
  8879. // re-export Token class to use in block rules
  8880. StateBlock.prototype.Token = Token;
  8881. module.exports = StateBlock;
  8882. /***/ }),
  8883. /* 54 */
  8884. /***/ (function(module, exports, __webpack_require__) {
  8885. "use strict";
  8886. // GFM table, non-standard
  8887. var isSpace = __webpack_require__(0).isSpace;
  8888. function getLine(state, line) {
  8889. var pos = state.bMarks[line] + state.blkIndent,
  8890. max = state.eMarks[line];
  8891. return state.src.substr(pos, max - pos);
  8892. }
  8893. function escapedSplit(str) {
  8894. var result = [],
  8895. pos = 0,
  8896. max = str.length,
  8897. ch,
  8898. escapes = 0,
  8899. lastPos = 0,
  8900. backTicked = false,
  8901. lastBackTick = 0;
  8902. ch = str.charCodeAt(pos);
  8903. while (pos < max) {
  8904. if (ch === 0x60/* ` */) {
  8905. if (backTicked) {
  8906. // make \` close code sequence, but not open it;
  8907. // the reason is: `\` is correct code block
  8908. backTicked = false;
  8909. lastBackTick = pos;
  8910. } else if (escapes % 2 === 0) {
  8911. backTicked = true;
  8912. lastBackTick = pos;
  8913. }
  8914. } else if (ch === 0x7c/* | */ && (escapes % 2 === 0) && !backTicked) {
  8915. result.push(str.substring(lastPos, pos));
  8916. lastPos = pos + 1;
  8917. }
  8918. if (ch === 0x5c/* \ */) {
  8919. escapes++;
  8920. } else {
  8921. escapes = 0;
  8922. }
  8923. pos++;
  8924. // If there was an un-closed backtick, go back to just after
  8925. // the last backtick, but as if it was a normal character
  8926. if (pos === max && backTicked) {
  8927. backTicked = false;
  8928. pos = lastBackTick + 1;
  8929. }
  8930. ch = str.charCodeAt(pos);
  8931. }
  8932. result.push(str.substring(lastPos));
  8933. return result;
  8934. }
  8935. module.exports = function table(state, startLine, endLine, silent) {
  8936. var ch, lineText, pos, i, nextLine, columns, columnCount, token,
  8937. aligns, t, tableLines, tbodyLines;
  8938. // should have at least two lines
  8939. if (startLine + 2 > endLine) { return false; }
  8940. nextLine = startLine + 1;
  8941. if (state.sCount[nextLine] < state.blkIndent) { return false; }
  8942. // if it's indented more than 3 spaces, it should be a code block
  8943. if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; }
  8944. // first character of the second line should be '|', '-', ':',
  8945. // and no other characters are allowed but spaces;
  8946. // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp
  8947. pos = state.bMarks[nextLine] + state.tShift[nextLine];
  8948. if (pos >= state.eMarks[nextLine]) { return false; }
  8949. ch = state.src.charCodeAt(pos++);
  8950. if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */) { return false; }
  8951. while (pos < state.eMarks[nextLine]) {
  8952. ch = state.src.charCodeAt(pos);
  8953. if (ch !== 0x7C/* | */ && ch !== 0x2D/* - */ && ch !== 0x3A/* : */ && !isSpace(ch)) { return false; }
  8954. pos++;
  8955. }
  8956. lineText = getLine(state, startLine + 1);
  8957. columns = lineText.split('|');
  8958. aligns = [];
  8959. for (i = 0; i < columns.length; i++) {
  8960. t = columns[i].trim();
  8961. if (!t) {
  8962. // allow empty columns before and after table, but not in between columns;
  8963. // e.g. allow ` |---| `, disallow ` ---||--- `
  8964. if (i === 0 || i === columns.length - 1) {
  8965. continue;
  8966. } else {
  8967. return false;
  8968. }
  8969. }
  8970. if (!/^:?-+:?$/.test(t)) { return false; }
  8971. if (t.charCodeAt(t.length - 1) === 0x3A/* : */) {
  8972. aligns.push(t.charCodeAt(0) === 0x3A/* : */ ? 'center' : 'right');
  8973. } else if (t.charCodeAt(0) === 0x3A/* : */) {
  8974. aligns.push('left');
  8975. } else {
  8976. aligns.push('');
  8977. }
  8978. }
  8979. lineText = getLine(state, startLine).trim();
  8980. if (lineText.indexOf('|') === -1) { return false; }
  8981. if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
  8982. columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
  8983. // header row will define an amount of columns in the entire table,
  8984. // and align row shouldn't be smaller than that (the rest of the rows can)
  8985. columnCount = columns.length;
  8986. if (columnCount > aligns.length) { return false; }
  8987. if (silent) { return true; }
  8988. token = state.push('table_open', 'table', 1);
  8989. token.map = tableLines = [ startLine, 0 ];
  8990. token = state.push('thead_open', 'thead', 1);
  8991. token.map = [ startLine, startLine + 1 ];
  8992. token = state.push('tr_open', 'tr', 1);
  8993. token.map = [ startLine, startLine + 1 ];
  8994. for (i = 0; i < columns.length; i++) {
  8995. token = state.push('th_open', 'th', 1);
  8996. token.map = [ startLine, startLine + 1 ];
  8997. if (aligns[i]) {
  8998. token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
  8999. }
  9000. token = state.push('inline', '', 0);
  9001. token.content = columns[i].trim();
  9002. token.map = [ startLine, startLine + 1 ];
  9003. token.children = [];
  9004. token = state.push('th_close', 'th', -1);
  9005. }
  9006. token = state.push('tr_close', 'tr', -1);
  9007. token = state.push('thead_close', 'thead', -1);
  9008. token = state.push('tbody_open', 'tbody', 1);
  9009. token.map = tbodyLines = [ startLine + 2, 0 ];
  9010. for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
  9011. if (state.sCount[nextLine] < state.blkIndent) { break; }
  9012. lineText = getLine(state, nextLine).trim();
  9013. if (lineText.indexOf('|') === -1) { break; }
  9014. if (state.sCount[nextLine] - state.blkIndent >= 4) { break; }
  9015. columns = escapedSplit(lineText.replace(/^\||\|$/g, ''));
  9016. token = state.push('tr_open', 'tr', 1);
  9017. for (i = 0; i < columnCount; i++) {
  9018. token = state.push('td_open', 'td', 1);
  9019. if (aligns[i]) {
  9020. token.attrs = [ [ 'style', 'text-align:' + aligns[i] ] ];
  9021. }
  9022. token = state.push('inline', '', 0);
  9023. token.content = columns[i] ? columns[i].trim() : '';
  9024. token.children = [];
  9025. token = state.push('td_close', 'td', -1);
  9026. }
  9027. token = state.push('tr_close', 'tr', -1);
  9028. }
  9029. token = state.push('tbody_close', 'tbody', -1);
  9030. token = state.push('table_close', 'table', -1);
  9031. tableLines[1] = tbodyLines[1] = nextLine;
  9032. state.line = nextLine;
  9033. return true;
  9034. };
  9035. /***/ }),
  9036. /* 55 */
  9037. /***/ (function(module, exports, __webpack_require__) {
  9038. "use strict";
  9039. module.exports = function block(state) {
  9040. var token;
  9041. if (state.inlineMode) {
  9042. token = new state.Token('inline', '', 0);
  9043. token.content = state.src;
  9044. token.map = [ 0, 1 ];
  9045. token.children = [];
  9046. state.tokens.push(token);
  9047. } else {
  9048. state.md.block.parse(state.src, state.md, state.env, state.tokens);
  9049. }
  9050. };
  9051. /***/ }),
  9052. /* 56 */
  9053. /***/ (function(module, exports, __webpack_require__) {
  9054. "use strict";
  9055. module.exports = function inline(state) {
  9056. var tokens = state.tokens, tok, i, l;
  9057. // Parse inlines
  9058. for (i = 0, l = tokens.length; i < l; i++) {
  9059. tok = tokens[i];
  9060. if (tok.type === 'inline') {
  9061. state.md.inline.parse(tok.content, state.md, state.env, tok.children);
  9062. }
  9063. }
  9064. };
  9065. /***/ }),
  9066. /* 57 */
  9067. /***/ (function(module, exports, __webpack_require__) {
  9068. "use strict";
  9069. // Replace link-like texts with link nodes.
  9070. //
  9071. // Currently restricted by `md.validateLink()` to http/https/ftp
  9072. //
  9073. var arrayReplaceAt = __webpack_require__(0).arrayReplaceAt;
  9074. function isLinkOpen(str) {
  9075. return /^<a[>\s]/i.test(str);
  9076. }
  9077. function isLinkClose(str) {
  9078. return /^<\/a\s*>/i.test(str);
  9079. }
  9080. module.exports = function linkify(state) {
  9081. var i, j, l, tokens, token, currentToken, nodes, ln, text, pos, lastPos,
  9082. level, htmlLinkLevel, url, fullUrl, urlText,
  9083. blockTokens = state.tokens,
  9084. links;
  9085. if (!state.md.options.linkify) { return; }
  9086. for (j = 0, l = blockTokens.length; j < l; j++) {
  9087. if (blockTokens[j].type !== 'inline' ||
  9088. !state.md.linkify.pretest(blockTokens[j].content)) {
  9089. continue;
  9090. }
  9091. tokens = blockTokens[j].children;
  9092. htmlLinkLevel = 0;
  9093. // We scan from the end, to keep position when new tags added.
  9094. // Use reversed logic in links start/end match
  9095. for (i = tokens.length - 1; i >= 0; i--) {
  9096. currentToken = tokens[i];
  9097. // Skip content of markdown links
  9098. if (currentToken.type === 'link_close') {
  9099. i--;
  9100. while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') {
  9101. i--;
  9102. }
  9103. continue;
  9104. }
  9105. // Skip content of html tag links
  9106. if (currentToken.type === 'html_inline') {
  9107. if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
  9108. htmlLinkLevel--;
  9109. }
  9110. if (isLinkClose(currentToken.content)) {
  9111. htmlLinkLevel++;
  9112. }
  9113. }
  9114. if (htmlLinkLevel > 0) { continue; }
  9115. if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) {
  9116. text = currentToken.content;
  9117. links = state.md.linkify.match(text);
  9118. // Now split string to nodes
  9119. nodes = [];
  9120. level = currentToken.level;
  9121. lastPos = 0;
  9122. for (ln = 0; ln < links.length; ln++) {
  9123. url = links[ln].url;
  9124. fullUrl = state.md.normalizeLink(url);
  9125. if (!state.md.validateLink(fullUrl)) { continue; }
  9126. urlText = links[ln].text;
  9127. // Linkifier might send raw hostnames like "example.com", where url
  9128. // starts with domain name. So we prepend http:// in those cases,
  9129. // and remove it afterwards.
  9130. //
  9131. if (!links[ln].schema) {
  9132. urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, '');
  9133. } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) {
  9134. urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, '');
  9135. } else {
  9136. urlText = state.md.normalizeLinkText(urlText);
  9137. }
  9138. pos = links[ln].index;
  9139. if (pos > lastPos) {
  9140. token = new state.Token('text', '', 0);
  9141. token.content = text.slice(lastPos, pos);
  9142. token.level = level;
  9143. nodes.push(token);
  9144. }
  9145. token = new state.Token('link_open', 'a', 1);
  9146. token.attrs = [ [ 'href', fullUrl ] ];
  9147. token.level = level++;
  9148. token.markup = 'linkify';
  9149. token.info = 'auto';
  9150. nodes.push(token);
  9151. token = new state.Token('text', '', 0);
  9152. token.content = urlText;
  9153. token.level = level;
  9154. nodes.push(token);
  9155. token = new state.Token('link_close', 'a', -1);
  9156. token.level = --level;
  9157. token.markup = 'linkify';
  9158. token.info = 'auto';
  9159. nodes.push(token);
  9160. lastPos = links[ln].lastIndex;
  9161. }
  9162. if (lastPos < text.length) {
  9163. token = new state.Token('text', '', 0);
  9164. token.content = text.slice(lastPos);
  9165. token.level = level;
  9166. nodes.push(token);
  9167. }
  9168. // replace current node
  9169. blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
  9170. }
  9171. }
  9172. }
  9173. };
  9174. /***/ }),
  9175. /* 58 */
  9176. /***/ (function(module, exports, __webpack_require__) {
  9177. "use strict";
  9178. // Normalize input string
  9179. var NEWLINES_RE = /\r[\n\u0085]?|[\u2424\u2028\u0085]/g;
  9180. var NULL_RE = /\u0000/g;
  9181. module.exports = function inline(state) {
  9182. var str;
  9183. // Normalize newlines
  9184. str = state.src.replace(NEWLINES_RE, '\n');
  9185. // Replace NULL characters
  9186. str = str.replace(NULL_RE, '\uFFFD');
  9187. state.src = str;
  9188. };
  9189. /***/ }),
  9190. /* 59 */
  9191. /***/ (function(module, exports, __webpack_require__) {
  9192. "use strict";
  9193. // Simple typographyc replacements
  9194. //
  9195. // (c) (C) → ©
  9196. // (tm) (TM) → ™
  9197. // (r) (R) → ®
  9198. // +- → ±
  9199. // (p) (P) -> §
  9200. // ... → … (also ?.... → ?.., !.... → !..)
  9201. // ???????? → ???, !!!!! → !!!, `,,` → `,`
  9202. // -- → &ndash;, --- → &mdash;
  9203. //
  9204. // TODO:
  9205. // - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾
  9206. // - miltiplication 2 x 4 -> 2 × 4
  9207. var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
  9208. // Workaround for phantomjs - need regex without /g flag,
  9209. // or root check will fail every second time
  9210. var SCOPED_ABBR_TEST_RE = /\((c|tm|r|p)\)/i;
  9211. var SCOPED_ABBR_RE = /\((c|tm|r|p)\)/ig;
  9212. var SCOPED_ABBR = {
  9213. c: '©',
  9214. r: '®',
  9215. p: '§',
  9216. tm: '™'
  9217. };
  9218. function replaceFn(match, name) {
  9219. return SCOPED_ABBR[name.toLowerCase()];
  9220. }
  9221. function replace_scoped(inlineTokens) {
  9222. var i, token, inside_autolink = 0;
  9223. for (i = inlineTokens.length - 1; i >= 0; i--) {
  9224. token = inlineTokens[i];
  9225. if (token.type === 'text' && !inside_autolink) {
  9226. token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
  9227. }
  9228. if (token.type === 'link_open' && token.info === 'auto') {
  9229. inside_autolink--;
  9230. }
  9231. if (token.type === 'link_close' && token.info === 'auto') {
  9232. inside_autolink++;
  9233. }
  9234. }
  9235. }
  9236. function replace_rare(inlineTokens) {
  9237. var i, token, inside_autolink = 0;
  9238. for (i = inlineTokens.length - 1; i >= 0; i--) {
  9239. token = inlineTokens[i];
  9240. if (token.type === 'text' && !inside_autolink) {
  9241. if (RARE_RE.test(token.content)) {
  9242. token.content = token.content
  9243. .replace(/\+-/g, '±')
  9244. // .., ..., ....... -> …
  9245. // but ?..... & !..... -> ?.. & !..
  9246. .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..')
  9247. .replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')
  9248. // em-dash
  9249. .replace(/(^|[^-])---([^-]|$)/mg, '$1\u2014$2')
  9250. // en-dash
  9251. .replace(/(^|\s)--(\s|$)/mg, '$1\u2013$2')
  9252. .replace(/(^|[^-\s])--([^-\s]|$)/mg, '$1\u2013$2');
  9253. }
  9254. }
  9255. if (token.type === 'link_open' && token.info === 'auto') {
  9256. inside_autolink--;
  9257. }
  9258. if (token.type === 'link_close' && token.info === 'auto') {
  9259. inside_autolink++;
  9260. }
  9261. }
  9262. }
  9263. module.exports = function replace(state) {
  9264. var blkIdx;
  9265. if (!state.md.options.typographer) { return; }
  9266. for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
  9267. if (state.tokens[blkIdx].type !== 'inline') { continue; }
  9268. if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
  9269. replace_scoped(state.tokens[blkIdx].children);
  9270. }
  9271. if (RARE_RE.test(state.tokens[blkIdx].content)) {
  9272. replace_rare(state.tokens[blkIdx].children);
  9273. }
  9274. }
  9275. };
  9276. /***/ }),
  9277. /* 60 */
  9278. /***/ (function(module, exports, __webpack_require__) {
  9279. "use strict";
  9280. // Convert straight quotation marks to typographic ones
  9281. //
  9282. var isWhiteSpace = __webpack_require__(0).isWhiteSpace;
  9283. var isPunctChar = __webpack_require__(0).isPunctChar;
  9284. var isMdAsciiPunct = __webpack_require__(0).isMdAsciiPunct;
  9285. var QUOTE_TEST_RE = /['"]/;
  9286. var QUOTE_RE = /['"]/g;
  9287. var APOSTROPHE = '\u2019'; /* ’ */
  9288. function replaceAt(str, index, ch) {
  9289. return str.substr(0, index) + ch + str.substr(index + 1);
  9290. }
  9291. function process_inlines(tokens, state) {
  9292. var i, token, text, t, pos, max, thisLevel, item, lastChar, nextChar,
  9293. isLastPunctChar, isNextPunctChar, isLastWhiteSpace, isNextWhiteSpace,
  9294. canOpen, canClose, j, isSingle, stack, openQuote, closeQuote;
  9295. stack = [];
  9296. for (i = 0; i < tokens.length; i++) {
  9297. token = tokens[i];
  9298. thisLevel = tokens[i].level;
  9299. for (j = stack.length - 1; j >= 0; j--) {
  9300. if (stack[j].level <= thisLevel) { break; }
  9301. }
  9302. stack.length = j + 1;
  9303. if (token.type !== 'text') { continue; }
  9304. text = token.content;
  9305. pos = 0;
  9306. max = text.length;
  9307. /*eslint no-labels:0,block-scoped-var:0*/
  9308. OUTER:
  9309. while (pos < max) {
  9310. QUOTE_RE.lastIndex = pos;
  9311. t = QUOTE_RE.exec(text);
  9312. if (!t) { break; }
  9313. canOpen = canClose = true;
  9314. pos = t.index + 1;
  9315. isSingle = (t[0] === "'");
  9316. // Find previous character,
  9317. // default to space if it's the beginning of the line
  9318. //
  9319. lastChar = 0x20;
  9320. if (t.index - 1 >= 0) {
  9321. lastChar = text.charCodeAt(t.index - 1);
  9322. } else {
  9323. for (j = i - 1; j >= 0; j--) {
  9324. if (tokens[j].type !== 'text') { continue; }
  9325. lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
  9326. break;
  9327. }
  9328. }
  9329. // Find next character,
  9330. // default to space if it's the end of the line
  9331. //
  9332. nextChar = 0x20;
  9333. if (pos < max) {
  9334. nextChar = text.charCodeAt(pos);
  9335. } else {
  9336. for (j = i + 1; j < tokens.length; j++) {
  9337. if (tokens[j].type !== 'text') { continue; }
  9338. nextChar = tokens[j].content.charCodeAt(0);
  9339. break;
  9340. }
  9341. }
  9342. isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
  9343. isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
  9344. isLastWhiteSpace = isWhiteSpace(lastChar);
  9345. isNextWhiteSpace = isWhiteSpace(nextChar);
  9346. if (isNextWhiteSpace) {
  9347. canOpen = false;
  9348. } else if (isNextPunctChar) {
  9349. if (!(isLastWhiteSpace || isLastPunctChar)) {
  9350. canOpen = false;
  9351. }
  9352. }
  9353. if (isLastWhiteSpace) {
  9354. canClose = false;
  9355. } else if (isLastPunctChar) {
  9356. if (!(isNextWhiteSpace || isNextPunctChar)) {
  9357. canClose = false;
  9358. }
  9359. }
  9360. if (nextChar === 0x22 /* " */ && t[0] === '"') {
  9361. if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {
  9362. // special case: 1"" - count first quote as an inch
  9363. canClose = canOpen = false;
  9364. }
  9365. }
  9366. if (canOpen && canClose) {
  9367. // treat this as the middle of the word
  9368. canOpen = false;
  9369. canClose = isNextPunctChar;
  9370. }
  9371. if (!canOpen && !canClose) {
  9372. // middle of word
  9373. if (isSingle) {
  9374. token.content = replaceAt(token.content, t.index, APOSTROPHE);
  9375. }
  9376. continue;
  9377. }
  9378. if (canClose) {
  9379. // this could be a closing quote, rewind the stack to get a match
  9380. for (j = stack.length - 1; j >= 0; j--) {
  9381. item = stack[j];
  9382. if (stack[j].level < thisLevel) { break; }
  9383. if (item.single === isSingle && stack[j].level === thisLevel) {
  9384. item = stack[j];
  9385. if (isSingle) {
  9386. openQuote = state.md.options.quotes[2];
  9387. closeQuote = state.md.options.quotes[3];
  9388. } else {
  9389. openQuote = state.md.options.quotes[0];
  9390. closeQuote = state.md.options.quotes[1];
  9391. }
  9392. // replace token.content *before* tokens[item.token].content,
  9393. // because, if they are pointing at the same token, replaceAt
  9394. // could mess up indices when quote length != 1
  9395. token.content = replaceAt(token.content, t.index, closeQuote);
  9396. tokens[item.token].content = replaceAt(
  9397. tokens[item.token].content, item.pos, openQuote);
  9398. pos += closeQuote.length - 1;
  9399. if (item.token === i) { pos += openQuote.length - 1; }
  9400. text = token.content;
  9401. max = text.length;
  9402. stack.length = j;
  9403. continue OUTER;
  9404. }
  9405. }
  9406. }
  9407. if (canOpen) {
  9408. stack.push({
  9409. token: i,
  9410. pos: t.index,
  9411. single: isSingle,
  9412. level: thisLevel
  9413. });
  9414. } else if (canClose && isSingle) {
  9415. token.content = replaceAt(token.content, t.index, APOSTROPHE);
  9416. }
  9417. }
  9418. }
  9419. }
  9420. module.exports = function smartquotes(state) {
  9421. /*eslint max-depth:0*/
  9422. var blkIdx;
  9423. if (!state.md.options.typographer) { return; }
  9424. for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
  9425. if (state.tokens[blkIdx].type !== 'inline' ||
  9426. !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
  9427. continue;
  9428. }
  9429. process_inlines(state.tokens[blkIdx].children, state);
  9430. }
  9431. };
  9432. /***/ }),
  9433. /* 61 */
  9434. /***/ (function(module, exports, __webpack_require__) {
  9435. "use strict";
  9436. // Core state object
  9437. //
  9438. var Token = __webpack_require__(4);
  9439. function StateCore(src, md, env) {
  9440. this.src = src;
  9441. this.env = env;
  9442. this.tokens = [];
  9443. this.inlineMode = false;
  9444. this.md = md; // link to parser instance
  9445. }
  9446. // re-export Token class to use in core rules
  9447. StateCore.prototype.Token = Token;
  9448. module.exports = StateCore;
  9449. /***/ }),
  9450. /* 62 */
  9451. /***/ (function(module, exports, __webpack_require__) {
  9452. "use strict";
  9453. // Process autolinks '<protocol:...>'
  9454. /*eslint max-len:0*/
  9455. var EMAIL_RE = /^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/;
  9456. var AUTOLINK_RE = /^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;
  9457. module.exports = function autolink(state, silent) {
  9458. var tail, linkMatch, emailMatch, url, fullUrl, token,
  9459. pos = state.pos;
  9460. if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
  9461. tail = state.src.slice(pos);
  9462. if (tail.indexOf('>') < 0) { return false; }
  9463. if (AUTOLINK_RE.test(tail)) {
  9464. linkMatch = tail.match(AUTOLINK_RE);
  9465. url = linkMatch[0].slice(1, -1);
  9466. fullUrl = state.md.normalizeLink(url);
  9467. if (!state.md.validateLink(fullUrl)) { return false; }
  9468. if (!silent) {
  9469. token = state.push('link_open', 'a', 1);
  9470. token.attrs = [ [ 'href', fullUrl ] ];
  9471. token.markup = 'autolink';
  9472. token.info = 'auto';
  9473. token = state.push('text', '', 0);
  9474. token.content = state.md.normalizeLinkText(url);
  9475. token = state.push('link_close', 'a', -1);
  9476. token.markup = 'autolink';
  9477. token.info = 'auto';
  9478. }
  9479. state.pos += linkMatch[0].length;
  9480. return true;
  9481. }
  9482. if (EMAIL_RE.test(tail)) {
  9483. emailMatch = tail.match(EMAIL_RE);
  9484. url = emailMatch[0].slice(1, -1);
  9485. fullUrl = state.md.normalizeLink('mailto:' + url);
  9486. if (!state.md.validateLink(fullUrl)) { return false; }
  9487. if (!silent) {
  9488. token = state.push('link_open', 'a', 1);
  9489. token.attrs = [ [ 'href', fullUrl ] ];
  9490. token.markup = 'autolink';
  9491. token.info = 'auto';
  9492. token = state.push('text', '', 0);
  9493. token.content = state.md.normalizeLinkText(url);
  9494. token = state.push('link_close', 'a', -1);
  9495. token.markup = 'autolink';
  9496. token.info = 'auto';
  9497. }
  9498. state.pos += emailMatch[0].length;
  9499. return true;
  9500. }
  9501. return false;
  9502. };
  9503. /***/ }),
  9504. /* 63 */
  9505. /***/ (function(module, exports, __webpack_require__) {
  9506. "use strict";
  9507. // Parse backticks
  9508. module.exports = function backtick(state, silent) {
  9509. var start, max, marker, matchStart, matchEnd, token,
  9510. pos = state.pos,
  9511. ch = state.src.charCodeAt(pos);
  9512. if (ch !== 0x60/* ` */) { return false; }
  9513. start = pos;
  9514. pos++;
  9515. max = state.posMax;
  9516. while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++; }
  9517. marker = state.src.slice(start, pos);
  9518. matchStart = matchEnd = pos;
  9519. while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {
  9520. matchEnd = matchStart + 1;
  9521. while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++; }
  9522. if (matchEnd - matchStart === marker.length) {
  9523. if (!silent) {
  9524. token = state.push('code_inline', 'code', 0);
  9525. token.markup = marker;
  9526. token.content = state.src.slice(pos, matchStart)
  9527. .replace(/[ \n]+/g, ' ')
  9528. .trim();
  9529. }
  9530. state.pos = matchEnd;
  9531. return true;
  9532. }
  9533. }
  9534. if (!silent) { state.pending += marker; }
  9535. state.pos += marker.length;
  9536. return true;
  9537. };
  9538. /***/ }),
  9539. /* 64 */
  9540. /***/ (function(module, exports, __webpack_require__) {
  9541. "use strict";
  9542. // For each opening emphasis-like marker find a matching closing one
  9543. //
  9544. module.exports = function link_pairs(state) {
  9545. var i, j, lastDelim, currDelim,
  9546. delimiters = state.delimiters,
  9547. max = state.delimiters.length;
  9548. for (i = 0; i < max; i++) {
  9549. lastDelim = delimiters[i];
  9550. if (!lastDelim.close) { continue; }
  9551. j = i - lastDelim.jump - 1;
  9552. while (j >= 0) {
  9553. currDelim = delimiters[j];
  9554. if (currDelim.open &&
  9555. currDelim.marker === lastDelim.marker &&
  9556. currDelim.end < 0 &&
  9557. currDelim.level === lastDelim.level) {
  9558. // typeofs are for backward compatibility with plugins
  9559. var odd_match = (currDelim.close || lastDelim.open) &&
  9560. typeof currDelim.length !== 'undefined' &&
  9561. typeof lastDelim.length !== 'undefined' &&
  9562. (currDelim.length + lastDelim.length) % 3 === 0;
  9563. if (!odd_match) {
  9564. lastDelim.jump = i - j;
  9565. lastDelim.open = false;
  9566. currDelim.end = i;
  9567. currDelim.jump = 0;
  9568. break;
  9569. }
  9570. }
  9571. j -= currDelim.jump + 1;
  9572. }
  9573. }
  9574. };
  9575. /***/ }),
  9576. /* 65 */
  9577. /***/ (function(module, exports, __webpack_require__) {
  9578. "use strict";
  9579. // Process html entity - &#123;, &#xAF;, &quot;, ...
  9580. var entities = __webpack_require__(11);
  9581. var has = __webpack_require__(0).has;
  9582. var isValidEntityCode = __webpack_require__(0).isValidEntityCode;
  9583. var fromCodePoint = __webpack_require__(0).fromCodePoint;
  9584. var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i;
  9585. var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
  9586. module.exports = function entity(state, silent) {
  9587. var ch, code, match, pos = state.pos, max = state.posMax;
  9588. if (state.src.charCodeAt(pos) !== 0x26/* & */) { return false; }
  9589. if (pos + 1 < max) {
  9590. ch = state.src.charCodeAt(pos + 1);
  9591. if (ch === 0x23 /* # */) {
  9592. match = state.src.slice(pos).match(DIGITAL_RE);
  9593. if (match) {
  9594. if (!silent) {
  9595. code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
  9596. state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD);
  9597. }
  9598. state.pos += match[0].length;
  9599. return true;
  9600. }
  9601. } else {
  9602. match = state.src.slice(pos).match(NAMED_RE);
  9603. if (match) {
  9604. if (has(entities, match[1])) {
  9605. if (!silent) { state.pending += entities[match[1]]; }
  9606. state.pos += match[0].length;
  9607. return true;
  9608. }
  9609. }
  9610. }
  9611. }
  9612. if (!silent) { state.pending += '&'; }
  9613. state.pos++;
  9614. return true;
  9615. };
  9616. /***/ }),
  9617. /* 66 */
  9618. /***/ (function(module, exports, __webpack_require__) {
  9619. "use strict";
  9620. // Proceess escaped chars and hardbreaks
  9621. var isSpace = __webpack_require__(0).isSpace;
  9622. var ESCAPED = [];
  9623. for (var i = 0; i < 256; i++) { ESCAPED.push(0); }
  9624. '\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'
  9625. .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1; });
  9626. module.exports = function escape(state, silent) {
  9627. var ch, pos = state.pos, max = state.posMax;
  9628. if (state.src.charCodeAt(pos) !== 0x5C/* \ */) { return false; }
  9629. pos++;
  9630. if (pos < max) {
  9631. ch = state.src.charCodeAt(pos);
  9632. if (ch < 256 && ESCAPED[ch] !== 0) {
  9633. if (!silent) { state.pending += state.src[pos]; }
  9634. state.pos += 2;
  9635. return true;
  9636. }
  9637. if (ch === 0x0A) {
  9638. if (!silent) {
  9639. state.push('hardbreak', 'br', 0);
  9640. }
  9641. pos++;
  9642. // skip leading whitespaces from next line
  9643. while (pos < max) {
  9644. ch = state.src.charCodeAt(pos);
  9645. if (!isSpace(ch)) { break; }
  9646. pos++;
  9647. }
  9648. state.pos = pos;
  9649. return true;
  9650. }
  9651. }
  9652. if (!silent) { state.pending += '\\'; }
  9653. state.pos++;
  9654. return true;
  9655. };
  9656. /***/ }),
  9657. /* 67 */
  9658. /***/ (function(module, exports, __webpack_require__) {
  9659. "use strict";
  9660. // Process html tags
  9661. var HTML_TAG_RE = __webpack_require__(12).HTML_TAG_RE;
  9662. function isLetter(ch) {
  9663. /*eslint no-bitwise:0*/
  9664. var lc = ch | 0x20; // to lower case
  9665. return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */);
  9666. }
  9667. module.exports = function html_inline(state, silent) {
  9668. var ch, match, max, token,
  9669. pos = state.pos;
  9670. if (!state.md.options.html) { return false; }
  9671. // Check start
  9672. max = state.posMax;
  9673. if (state.src.charCodeAt(pos) !== 0x3C/* < */ ||
  9674. pos + 2 >= max) {
  9675. return false;
  9676. }
  9677. // Quick fail on second char
  9678. ch = state.src.charCodeAt(pos + 1);
  9679. if (ch !== 0x21/* ! */ &&
  9680. ch !== 0x3F/* ? */ &&
  9681. ch !== 0x2F/* / */ &&
  9682. !isLetter(ch)) {
  9683. return false;
  9684. }
  9685. match = state.src.slice(pos).match(HTML_TAG_RE);
  9686. if (!match) { return false; }
  9687. if (!silent) {
  9688. token = state.push('html_inline', '', 0);
  9689. token.content = state.src.slice(pos, pos + match[0].length);
  9690. }
  9691. state.pos += match[0].length;
  9692. return true;
  9693. };
  9694. /***/ }),
  9695. /* 68 */
  9696. /***/ (function(module, exports, __webpack_require__) {
  9697. "use strict";
  9698. // Process ![image](<src> "title")
  9699. var normalizeReference = __webpack_require__(0).normalizeReference;
  9700. var isSpace = __webpack_require__(0).isSpace;
  9701. module.exports = function image(state, silent) {
  9702. var attrs,
  9703. code,
  9704. content,
  9705. label,
  9706. labelEnd,
  9707. labelStart,
  9708. pos,
  9709. ref,
  9710. res,
  9711. title,
  9712. token,
  9713. tokens,
  9714. start,
  9715. href = '',
  9716. oldPos = state.pos,
  9717. max = state.posMax;
  9718. if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false; }
  9719. if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false; }
  9720. labelStart = state.pos + 2;
  9721. labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
  9722. // parser failed to find ']', so it's not a valid link
  9723. if (labelEnd < 0) { return false; }
  9724. pos = labelEnd + 1;
  9725. if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
  9726. //
  9727. // Inline link
  9728. //
  9729. // [link]( <href> "title" )
  9730. // ^^ skipping these spaces
  9731. pos++;
  9732. for (; pos < max; pos++) {
  9733. code = state.src.charCodeAt(pos);
  9734. if (!isSpace(code) && code !== 0x0A) { break; }
  9735. }
  9736. if (pos >= max) { return false; }
  9737. // [link]( <href> "title" )
  9738. // ^^^^^^ parsing link destination
  9739. start = pos;
  9740. res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
  9741. if (res.ok) {
  9742. href = state.md.normalizeLink(res.str);
  9743. if (state.md.validateLink(href)) {
  9744. pos = res.pos;
  9745. } else {
  9746. href = '';
  9747. }
  9748. }
  9749. // [link]( <href> "title" )
  9750. // ^^ skipping these spaces
  9751. start = pos;
  9752. for (; pos < max; pos++) {
  9753. code = state.src.charCodeAt(pos);
  9754. if (!isSpace(code) && code !== 0x0A) { break; }
  9755. }
  9756. // [link]( <href> "title" )
  9757. // ^^^^^^^ parsing link title
  9758. res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
  9759. if (pos < max && start !== pos && res.ok) {
  9760. title = res.str;
  9761. pos = res.pos;
  9762. // [link]( <href> "title" )
  9763. // ^^ skipping these spaces
  9764. for (; pos < max; pos++) {
  9765. code = state.src.charCodeAt(pos);
  9766. if (!isSpace(code) && code !== 0x0A) { break; }
  9767. }
  9768. } else {
  9769. title = '';
  9770. }
  9771. if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
  9772. state.pos = oldPos;
  9773. return false;
  9774. }
  9775. pos++;
  9776. } else {
  9777. //
  9778. // Link reference
  9779. //
  9780. if (typeof state.env.references === 'undefined') { return false; }
  9781. if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
  9782. start = pos + 1;
  9783. pos = state.md.helpers.parseLinkLabel(state, pos);
  9784. if (pos >= 0) {
  9785. label = state.src.slice(start, pos++);
  9786. } else {
  9787. pos = labelEnd + 1;
  9788. }
  9789. } else {
  9790. pos = labelEnd + 1;
  9791. }
  9792. // covers label === '' and label === undefined
  9793. // (collapsed reference link and shortcut reference link respectively)
  9794. if (!label) { label = state.src.slice(labelStart, labelEnd); }
  9795. ref = state.env.references[normalizeReference(label)];
  9796. if (!ref) {
  9797. state.pos = oldPos;
  9798. return false;
  9799. }
  9800. href = ref.href;
  9801. title = ref.title;
  9802. }
  9803. //
  9804. // We found the end of the link, and know for a fact it's a valid link;
  9805. // so all that's left to do is to call tokenizer.
  9806. //
  9807. if (!silent) {
  9808. content = state.src.slice(labelStart, labelEnd);
  9809. state.md.inline.parse(
  9810. content,
  9811. state.md,
  9812. state.env,
  9813. tokens = []
  9814. );
  9815. token = state.push('image', 'img', 0);
  9816. token.attrs = attrs = [ [ 'src', href ], [ 'alt', '' ] ];
  9817. token.children = tokens;
  9818. token.content = content;
  9819. if (title) {
  9820. attrs.push([ 'title', title ]);
  9821. }
  9822. }
  9823. state.pos = pos;
  9824. state.posMax = max;
  9825. return true;
  9826. };
  9827. /***/ }),
  9828. /* 69 */
  9829. /***/ (function(module, exports, __webpack_require__) {
  9830. "use strict";
  9831. // Process [link](<to> "stuff")
  9832. var normalizeReference = __webpack_require__(0).normalizeReference;
  9833. var isSpace = __webpack_require__(0).isSpace;
  9834. module.exports = function link(state, silent) {
  9835. var attrs,
  9836. code,
  9837. label,
  9838. labelEnd,
  9839. labelStart,
  9840. pos,
  9841. res,
  9842. ref,
  9843. title,
  9844. token,
  9845. href = '',
  9846. oldPos = state.pos,
  9847. max = state.posMax,
  9848. start = state.pos,
  9849. parseReference = true;
  9850. if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false; }
  9851. labelStart = state.pos + 1;
  9852. labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
  9853. // parser failed to find ']', so it's not a valid link
  9854. if (labelEnd < 0) { return false; }
  9855. pos = labelEnd + 1;
  9856. if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) {
  9857. //
  9858. // Inline link
  9859. //
  9860. // might have found a valid shortcut link, disable reference parsing
  9861. parseReference = false;
  9862. // [link]( <href> "title" )
  9863. // ^^ skipping these spaces
  9864. pos++;
  9865. for (; pos < max; pos++) {
  9866. code = state.src.charCodeAt(pos);
  9867. if (!isSpace(code) && code !== 0x0A) { break; }
  9868. }
  9869. if (pos >= max) { return false; }
  9870. // [link]( <href> "title" )
  9871. // ^^^^^^ parsing link destination
  9872. start = pos;
  9873. res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
  9874. if (res.ok) {
  9875. href = state.md.normalizeLink(res.str);
  9876. if (state.md.validateLink(href)) {
  9877. pos = res.pos;
  9878. } else {
  9879. href = '';
  9880. }
  9881. }
  9882. // [link]( <href> "title" )
  9883. // ^^ skipping these spaces
  9884. start = pos;
  9885. for (; pos < max; pos++) {
  9886. code = state.src.charCodeAt(pos);
  9887. if (!isSpace(code) && code !== 0x0A) { break; }
  9888. }
  9889. // [link]( <href> "title" )
  9890. // ^^^^^^^ parsing link title
  9891. res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
  9892. if (pos < max && start !== pos && res.ok) {
  9893. title = res.str;
  9894. pos = res.pos;
  9895. // [link]( <href> "title" )
  9896. // ^^ skipping these spaces
  9897. for (; pos < max; pos++) {
  9898. code = state.src.charCodeAt(pos);
  9899. if (!isSpace(code) && code !== 0x0A) { break; }
  9900. }
  9901. } else {
  9902. title = '';
  9903. }
  9904. if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) {
  9905. // parsing a valid shortcut link failed, fallback to reference
  9906. parseReference = true;
  9907. }
  9908. pos++;
  9909. }
  9910. if (parseReference) {
  9911. //
  9912. // Link reference
  9913. //
  9914. if (typeof state.env.references === 'undefined') { return false; }
  9915. if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) {
  9916. start = pos + 1;
  9917. pos = state.md.helpers.parseLinkLabel(state, pos);
  9918. if (pos >= 0) {
  9919. label = state.src.slice(start, pos++);
  9920. } else {
  9921. pos = labelEnd + 1;
  9922. }
  9923. } else {
  9924. pos = labelEnd + 1;
  9925. }
  9926. // covers label === '' and label === undefined
  9927. // (collapsed reference link and shortcut reference link respectively)
  9928. if (!label) { label = state.src.slice(labelStart, labelEnd); }
  9929. ref = state.env.references[normalizeReference(label)];
  9930. if (!ref) {
  9931. state.pos = oldPos;
  9932. return false;
  9933. }
  9934. href = ref.href;
  9935. title = ref.title;
  9936. }
  9937. //
  9938. // We found the end of the link, and know for a fact it's a valid link;
  9939. // so all that's left to do is to call tokenizer.
  9940. //
  9941. if (!silent) {
  9942. state.pos = labelStart;
  9943. state.posMax = labelEnd;
  9944. token = state.push('link_open', 'a', 1);
  9945. token.attrs = attrs = [ [ 'href', href ] ];
  9946. if (title) {
  9947. attrs.push([ 'title', title ]);
  9948. }
  9949. state.md.inline.tokenize(state);
  9950. token = state.push('link_close', 'a', -1);
  9951. }
  9952. state.pos = pos;
  9953. state.posMax = max;
  9954. return true;
  9955. };
  9956. /***/ }),
  9957. /* 70 */
  9958. /***/ (function(module, exports, __webpack_require__) {
  9959. "use strict";
  9960. // Proceess '\n'
  9961. var isSpace = __webpack_require__(0).isSpace;
  9962. module.exports = function newline(state, silent) {
  9963. var pmax, max, pos = state.pos;
  9964. if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false; }
  9965. pmax = state.pending.length - 1;
  9966. max = state.posMax;
  9967. // ' \n' -> hardbreak
  9968. // Lookup in pending chars is bad practice! Don't copy to other rules!
  9969. // Pending string is stored in concat mode, indexed lookups will cause
  9970. // convertion to flat mode.
  9971. if (!silent) {
  9972. if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) {
  9973. if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) {
  9974. state.pending = state.pending.replace(/ +$/, '');
  9975. state.push('hardbreak', 'br', 0);
  9976. } else {
  9977. state.pending = state.pending.slice(0, -1);
  9978. state.push('softbreak', 'br', 0);
  9979. }
  9980. } else {
  9981. state.push('softbreak', 'br', 0);
  9982. }
  9983. }
  9984. pos++;
  9985. // skip heading spaces for next line
  9986. while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; }
  9987. state.pos = pos;
  9988. return true;
  9989. };
  9990. /***/ }),
  9991. /* 71 */
  9992. /***/ (function(module, exports, __webpack_require__) {
  9993. "use strict";
  9994. // Inline parser state
  9995. var Token = __webpack_require__(4);
  9996. var isWhiteSpace = __webpack_require__(0).isWhiteSpace;
  9997. var isPunctChar = __webpack_require__(0).isPunctChar;
  9998. var isMdAsciiPunct = __webpack_require__(0).isMdAsciiPunct;
  9999. function StateInline(src, md, env, outTokens) {
  10000. this.src = src;
  10001. this.env = env;
  10002. this.md = md;
  10003. this.tokens = outTokens;
  10004. this.pos = 0;
  10005. this.posMax = this.src.length;
  10006. this.level = 0;
  10007. this.pending = '';
  10008. this.pendingLevel = 0;
  10009. this.cache = {}; // Stores { start: end } pairs. Useful for backtrack
  10010. // optimization of pairs parse (emphasis, strikes).
  10011. this.delimiters = []; // Emphasis-like delimiters
  10012. }
  10013. // Flush pending text
  10014. //
  10015. StateInline.prototype.pushPending = function () {
  10016. var token = new Token('text', '', 0);
  10017. token.content = this.pending;
  10018. token.level = this.pendingLevel;
  10019. this.tokens.push(token);
  10020. this.pending = '';
  10021. return token;
  10022. };
  10023. // Push new token to "stream".
  10024. // If pending text exists - flush it as text token
  10025. //
  10026. StateInline.prototype.push = function (type, tag, nesting) {
  10027. if (this.pending) {
  10028. this.pushPending();
  10029. }
  10030. var token = new Token(type, tag, nesting);
  10031. if (nesting < 0) { this.level--; }
  10032. token.level = this.level;
  10033. if (nesting > 0) { this.level++; }
  10034. this.pendingLevel = this.level;
  10035. this.tokens.push(token);
  10036. return token;
  10037. };
  10038. // Scan a sequence of emphasis-like markers, and determine whether
  10039. // it can start an emphasis sequence or end an emphasis sequence.
  10040. //
  10041. // - start - position to scan from (it should point at a valid marker);
  10042. // - canSplitWord - determine if these markers can be found inside a word
  10043. //
  10044. StateInline.prototype.scanDelims = function (start, canSplitWord) {
  10045. var pos = start, lastChar, nextChar, count, can_open, can_close,
  10046. isLastWhiteSpace, isLastPunctChar,
  10047. isNextWhiteSpace, isNextPunctChar,
  10048. left_flanking = true,
  10049. right_flanking = true,
  10050. max = this.posMax,
  10051. marker = this.src.charCodeAt(start);
  10052. // treat beginning of the line as a whitespace
  10053. lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20;
  10054. while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; }
  10055. count = pos - start;
  10056. // treat end of the line as a whitespace
  10057. nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20;
  10058. isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
  10059. isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
  10060. isLastWhiteSpace = isWhiteSpace(lastChar);
  10061. isNextWhiteSpace = isWhiteSpace(nextChar);
  10062. if (isNextWhiteSpace) {
  10063. left_flanking = false;
  10064. } else if (isNextPunctChar) {
  10065. if (!(isLastWhiteSpace || isLastPunctChar)) {
  10066. left_flanking = false;
  10067. }
  10068. }
  10069. if (isLastWhiteSpace) {
  10070. right_flanking = false;
  10071. } else if (isLastPunctChar) {
  10072. if (!(isNextWhiteSpace || isNextPunctChar)) {
  10073. right_flanking = false;
  10074. }
  10075. }
  10076. if (!canSplitWord) {
  10077. can_open = left_flanking && (!right_flanking || isLastPunctChar);
  10078. can_close = right_flanking && (!left_flanking || isNextPunctChar);
  10079. } else {
  10080. can_open = left_flanking;
  10081. can_close = right_flanking;
  10082. }
  10083. return {
  10084. can_open: can_open,
  10085. can_close: can_close,
  10086. length: count
  10087. };
  10088. };
  10089. // re-export Token class to use in block rules
  10090. StateInline.prototype.Token = Token;
  10091. module.exports = StateInline;
  10092. /***/ }),
  10093. /* 72 */
  10094. /***/ (function(module, exports, __webpack_require__) {
  10095. "use strict";
  10096. // Skip text characters for text token, place those to pending buffer
  10097. // and increment current pos
  10098. // Rule to skip pure text
  10099. // '{}$%@~+=:' reserved for extentions
  10100. // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~
  10101. // !!!! Don't confuse with "Markdown ASCII Punctuation" chars
  10102. // http://spec.commonmark.org/0.15/#ascii-punctuation-character
  10103. function isTerminatorChar(ch) {
  10104. switch (ch) {
  10105. case 0x0A/* \n */:
  10106. case 0x21/* ! */:
  10107. case 0x23/* # */:
  10108. case 0x24/* $ */:
  10109. case 0x25/* % */:
  10110. case 0x26/* & */:
  10111. case 0x2A/* * */:
  10112. case 0x2B/* + */:
  10113. case 0x2D/* - */:
  10114. case 0x3A/* : */:
  10115. case 0x3C/* < */:
  10116. case 0x3D/* = */:
  10117. case 0x3E/* > */:
  10118. case 0x40/* @ */:
  10119. case 0x5B/* [ */:
  10120. case 0x5C/* \ */:
  10121. case 0x5D/* ] */:
  10122. case 0x5E/* ^ */:
  10123. case 0x5F/* _ */:
  10124. case 0x60/* ` */:
  10125. case 0x7B/* { */:
  10126. case 0x7D/* } */:
  10127. case 0x7E/* ~ */:
  10128. return true;
  10129. default:
  10130. return false;
  10131. }
  10132. }
  10133. module.exports = function text(state, silent) {
  10134. var pos = state.pos;
  10135. while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {
  10136. pos++;
  10137. }
  10138. if (pos === state.pos) { return false; }
  10139. if (!silent) { state.pending += state.src.slice(state.pos, pos); }
  10140. state.pos = pos;
  10141. return true;
  10142. };
  10143. // Alternative implementation, for memory.
  10144. //
  10145. // It costs 10% of performance, but allows extend terminators list, if place it
  10146. // to `ParcerInline` property. Probably, will switch to it sometime, such
  10147. // flexibility required.
  10148. /*
  10149. var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/;
  10150. module.exports = function text(state, silent) {
  10151. var pos = state.pos,
  10152. idx = state.src.slice(pos).search(TERMINATOR_RE);
  10153. // first char is terminator -> empty text
  10154. if (idx === 0) { return false; }
  10155. // no terminator -> text till end of string
  10156. if (idx < 0) {
  10157. if (!silent) { state.pending += state.src.slice(pos); }
  10158. state.pos = state.src.length;
  10159. return true;
  10160. }
  10161. if (!silent) { state.pending += state.src.slice(pos, pos + idx); }
  10162. state.pos += idx;
  10163. return true;
  10164. };*/
  10165. /***/ }),
  10166. /* 73 */
  10167. /***/ (function(module, exports, __webpack_require__) {
  10168. "use strict";
  10169. // Merge adjacent text nodes into one, and re-calculate all token levels
  10170. //
  10171. module.exports = function text_collapse(state) {
  10172. var curr, last,
  10173. level = 0,
  10174. tokens = state.tokens,
  10175. max = state.tokens.length;
  10176. for (curr = last = 0; curr < max; curr++) {
  10177. // re-calculate levels
  10178. level += tokens[curr].nesting;
  10179. tokens[curr].level = level;
  10180. if (tokens[curr].type === 'text' &&
  10181. curr + 1 < max &&
  10182. tokens[curr + 1].type === 'text') {
  10183. // collapse two adjacent text nodes
  10184. tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
  10185. } else {
  10186. if (curr !== last) { tokens[last] = tokens[curr]; }
  10187. last++;
  10188. }
  10189. }
  10190. if (curr !== last) {
  10191. tokens.length = last;
  10192. }
  10193. };
  10194. /***/ }),
  10195. /* 74 */
  10196. /***/ (function(module, exports, __webpack_require__) {
  10197. "use strict";
  10198. /* eslint-disable no-bitwise */
  10199. var decodeCache = {};
  10200. function getDecodeCache(exclude) {
  10201. var i, ch, cache = decodeCache[exclude];
  10202. if (cache) { return cache; }
  10203. cache = decodeCache[exclude] = [];
  10204. for (i = 0; i < 128; i++) {
  10205. ch = String.fromCharCode(i);
  10206. cache.push(ch);
  10207. }
  10208. for (i = 0; i < exclude.length; i++) {
  10209. ch = exclude.charCodeAt(i);
  10210. cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2);
  10211. }
  10212. return cache;
  10213. }
  10214. // Decode percent-encoded string.
  10215. //
  10216. function decode(string, exclude) {
  10217. var cache;
  10218. if (typeof exclude !== 'string') {
  10219. exclude = decode.defaultChars;
  10220. }
  10221. cache = getDecodeCache(exclude);
  10222. return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {
  10223. var i, l, b1, b2, b3, b4, chr,
  10224. result = '';
  10225. for (i = 0, l = seq.length; i < l; i += 3) {
  10226. b1 = parseInt(seq.slice(i + 1, i + 3), 16);
  10227. if (b1 < 0x80) {
  10228. result += cache[b1];
  10229. continue;
  10230. }
  10231. if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) {
  10232. // 110xxxxx 10xxxxxx
  10233. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  10234. if ((b2 & 0xC0) === 0x80) {
  10235. chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F);
  10236. if (chr < 0x80) {
  10237. result += '\ufffd\ufffd';
  10238. } else {
  10239. result += String.fromCharCode(chr);
  10240. }
  10241. i += 3;
  10242. continue;
  10243. }
  10244. }
  10245. if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) {
  10246. // 1110xxxx 10xxxxxx 10xxxxxx
  10247. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  10248. b3 = parseInt(seq.slice(i + 7, i + 9), 16);
  10249. if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {
  10250. chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F);
  10251. if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) {
  10252. result += '\ufffd\ufffd\ufffd';
  10253. } else {
  10254. result += String.fromCharCode(chr);
  10255. }
  10256. i += 6;
  10257. continue;
  10258. }
  10259. }
  10260. if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) {
  10261. // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx
  10262. b2 = parseInt(seq.slice(i + 4, i + 6), 16);
  10263. b3 = parseInt(seq.slice(i + 7, i + 9), 16);
  10264. b4 = parseInt(seq.slice(i + 10, i + 12), 16);
  10265. if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) {
  10266. chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F);
  10267. if (chr < 0x10000 || chr > 0x10FFFF) {
  10268. result += '\ufffd\ufffd\ufffd\ufffd';
  10269. } else {
  10270. chr -= 0x10000;
  10271. result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF));
  10272. }
  10273. i += 9;
  10274. continue;
  10275. }
  10276. }
  10277. result += '\ufffd';
  10278. }
  10279. return result;
  10280. });
  10281. }
  10282. decode.defaultChars = ';/?:@&=+$,#';
  10283. decode.componentChars = '';
  10284. module.exports = decode;
  10285. /***/ }),
  10286. /* 75 */
  10287. /***/ (function(module, exports, __webpack_require__) {
  10288. "use strict";
  10289. var encodeCache = {};
  10290. // Create a lookup array where anything but characters in `chars` string
  10291. // and alphanumeric chars is percent-encoded.
  10292. //
  10293. function getEncodeCache(exclude) {
  10294. var i, ch, cache = encodeCache[exclude];
  10295. if (cache) { return cache; }
  10296. cache = encodeCache[exclude] = [];
  10297. for (i = 0; i < 128; i++) {
  10298. ch = String.fromCharCode(i);
  10299. if (/^[0-9a-z]$/i.test(ch)) {
  10300. // always allow unencoded alphanumeric characters
  10301. cache.push(ch);
  10302. } else {
  10303. cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2));
  10304. }
  10305. }
  10306. for (i = 0; i < exclude.length; i++) {
  10307. cache[exclude.charCodeAt(i)] = exclude[i];
  10308. }
  10309. return cache;
  10310. }
  10311. // Encode unsafe characters with percent-encoding, skipping already
  10312. // encoded sequences.
  10313. //
  10314. // - string - string to encode
  10315. // - exclude - list of characters to ignore (in addition to a-zA-Z0-9)
  10316. // - keepEscaped - don't encode '%' in a correct escape sequence (default: true)
  10317. //
  10318. function encode(string, exclude, keepEscaped) {
  10319. var i, l, code, nextCode, cache,
  10320. result = '';
  10321. if (typeof exclude !== 'string') {
  10322. // encode(string, keepEscaped)
  10323. keepEscaped = exclude;
  10324. exclude = encode.defaultChars;
  10325. }
  10326. if (typeof keepEscaped === 'undefined') {
  10327. keepEscaped = true;
  10328. }
  10329. cache = getEncodeCache(exclude);
  10330. for (i = 0, l = string.length; i < l; i++) {
  10331. code = string.charCodeAt(i);
  10332. if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) {
  10333. if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {
  10334. result += string.slice(i, i + 3);
  10335. i += 2;
  10336. continue;
  10337. }
  10338. }
  10339. if (code < 128) {
  10340. result += cache[code];
  10341. continue;
  10342. }
  10343. if (code >= 0xD800 && code <= 0xDFFF) {
  10344. if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) {
  10345. nextCode = string.charCodeAt(i + 1);
  10346. if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {
  10347. result += encodeURIComponent(string[i] + string[i + 1]);
  10348. i++;
  10349. continue;
  10350. }
  10351. }
  10352. result += '%EF%BF%BD';
  10353. continue;
  10354. }
  10355. result += encodeURIComponent(string[i]);
  10356. }
  10357. return result;
  10358. }
  10359. encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
  10360. encode.componentChars = "-_.!~*'()";
  10361. module.exports = encode;
  10362. /***/ }),
  10363. /* 76 */
  10364. /***/ (function(module, exports, __webpack_require__) {
  10365. "use strict";
  10366. module.exports = function format(url) {
  10367. var result = '';
  10368. result += url.protocol || '';
  10369. result += url.slashes ? '//' : '';
  10370. result += url.auth ? url.auth + '@' : '';
  10371. if (url.hostname && url.hostname.indexOf(':') !== -1) {
  10372. // ipv6 address
  10373. result += '[' + url.hostname + ']';
  10374. } else {
  10375. result += url.hostname || '';
  10376. }
  10377. result += url.port ? ':' + url.port : '';
  10378. result += url.pathname || '';
  10379. result += url.search || '';
  10380. result += url.hash || '';
  10381. return result;
  10382. };
  10383. /***/ }),
  10384. /* 77 */
  10385. /***/ (function(module, exports, __webpack_require__) {
  10386. "use strict";
  10387. // Copyright Joyent, Inc. and other Node contributors.
  10388. //
  10389. // Permission is hereby granted, free of charge, to any person obtaining a
  10390. // copy of this software and associated documentation files (the
  10391. // "Software"), to deal in the Software without restriction, including
  10392. // without limitation the rights to use, copy, modify, merge, publish,
  10393. // distribute, sublicense, and/or sell copies of the Software, and to permit
  10394. // persons to whom the Software is furnished to do so, subject to the
  10395. // following conditions:
  10396. //
  10397. // The above copyright notice and this permission notice shall be included
  10398. // in all copies or substantial portions of the Software.
  10399. //
  10400. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  10401. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  10402. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  10403. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  10404. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  10405. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  10406. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  10407. //
  10408. // Changes from joyent/node:
  10409. //
  10410. // 1. No leading slash in paths,
  10411. // e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`
  10412. //
  10413. // 2. Backslashes are not replaced with slashes,
  10414. // so `http:\\example.org\` is treated like a relative path
  10415. //
  10416. // 3. Trailing colon is treated like a part of the path,
  10417. // i.e. in `http://example.org:foo` pathname is `:foo`
  10418. //
  10419. // 4. Nothing is URL-encoded in the resulting object,
  10420. // (in joyent/node some chars in auth and paths are encoded)
  10421. //
  10422. // 5. `url.parse()` does not have `parseQueryString` argument
  10423. //
  10424. // 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,
  10425. // which can be constructed using other parts of the url.
  10426. //
  10427. function Url() {
  10428. this.protocol = null;
  10429. this.slashes = null;
  10430. this.auth = null;
  10431. this.port = null;
  10432. this.hostname = null;
  10433. this.hash = null;
  10434. this.search = null;
  10435. this.pathname = null;
  10436. }
  10437. // Reference: RFC 3986, RFC 1808, RFC 2396
  10438. // define these here so at least they only have to be
  10439. // compiled once on the first module load.
  10440. var protocolPattern = /^([a-z0-9.+-]+:)/i,
  10441. portPattern = /:[0-9]*$/,
  10442. // Special case for a simple path URL
  10443. simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  10444. // RFC 2396: characters reserved for delimiting URLs.
  10445. // We actually just auto-escape these.
  10446. delims = [ '<', '>', '"', '`', ' ', '\r', '\n', '\t' ],
  10447. // RFC 2396: characters not allowed for various reasons.
  10448. unwise = [ '{', '}', '|', '\\', '^', '`' ].concat(delims),
  10449. // Allowed by RFCs, but cause of XSS attacks. Always escape these.
  10450. autoEscape = [ '\'' ].concat(unwise),
  10451. // Characters that are never ever allowed in a hostname.
  10452. // Note that any invalid chars are also handled, but these
  10453. // are the ones that are *expected* to be seen, so we fast-path
  10454. // them.
  10455. nonHostChars = [ '%', '/', '?', ';', '#' ].concat(autoEscape),
  10456. hostEndingChars = [ '/', '?', '#' ],
  10457. hostnameMaxLen = 255,
  10458. hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
  10459. hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  10460. // protocols that can allow "unsafe" and "unwise" chars.
  10461. /* eslint-disable no-script-url */
  10462. // protocols that never have a hostname.
  10463. hostlessProtocol = {
  10464. 'javascript': true,
  10465. 'javascript:': true
  10466. },
  10467. // protocols that always contain a // bit.
  10468. slashedProtocol = {
  10469. 'http': true,
  10470. 'https': true,
  10471. 'ftp': true,
  10472. 'gopher': true,
  10473. 'file': true,
  10474. 'http:': true,
  10475. 'https:': true,
  10476. 'ftp:': true,
  10477. 'gopher:': true,
  10478. 'file:': true
  10479. };
  10480. /* eslint-enable no-script-url */
  10481. function urlParse(url, slashesDenoteHost) {
  10482. if (url && url instanceof Url) { return url; }
  10483. var u = new Url();
  10484. u.parse(url, slashesDenoteHost);
  10485. return u;
  10486. }
  10487. Url.prototype.parse = function(url, slashesDenoteHost) {
  10488. var i, l, lowerProto, hec, slashes,
  10489. rest = url;
  10490. // trim before proceeding.
  10491. // This is to support parse stuff like " http://foo.com \n"
  10492. rest = rest.trim();
  10493. if (!slashesDenoteHost && url.split('#').length === 1) {
  10494. // Try fast path regexp
  10495. var simplePath = simplePathPattern.exec(rest);
  10496. if (simplePath) {
  10497. this.pathname = simplePath[1];
  10498. if (simplePath[2]) {
  10499. this.search = simplePath[2];
  10500. }
  10501. return this;
  10502. }
  10503. }
  10504. var proto = protocolPattern.exec(rest);
  10505. if (proto) {
  10506. proto = proto[0];
  10507. lowerProto = proto.toLowerCase();
  10508. this.protocol = proto;
  10509. rest = rest.substr(proto.length);
  10510. }
  10511. // figure out if it's got a host
  10512. // user@server is *always* interpreted as a hostname, and url
  10513. // resolution will treat //foo/bar as host=foo,path=bar because that's
  10514. // how the browser resolves relative URLs.
  10515. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  10516. slashes = rest.substr(0, 2) === '//';
  10517. if (slashes && !(proto && hostlessProtocol[proto])) {
  10518. rest = rest.substr(2);
  10519. this.slashes = true;
  10520. }
  10521. }
  10522. if (!hostlessProtocol[proto] &&
  10523. (slashes || (proto && !slashedProtocol[proto]))) {
  10524. // there's a hostname.
  10525. // the first instance of /, ?, ;, or # ends the host.
  10526. //
  10527. // If there is an @ in the hostname, then non-host chars *are* allowed
  10528. // to the left of the last @ sign, unless some host-ending character
  10529. // comes *before* the @-sign.
  10530. // URLs are obnoxious.
  10531. //
  10532. // ex:
  10533. // http://a@b@c/ => user:a@b host:c
  10534. // http://a@b?@c => user:a host:c path:/?@c
  10535. // v0.12 TODO(isaacs): This is not quite how Chrome does things.
  10536. // Review our test case against browsers more comprehensively.
  10537. // find the first instance of any hostEndingChars
  10538. var hostEnd = -1;
  10539. for (i = 0; i < hostEndingChars.length; i++) {
  10540. hec = rest.indexOf(hostEndingChars[i]);
  10541. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
  10542. hostEnd = hec;
  10543. }
  10544. }
  10545. // at this point, either we have an explicit point where the
  10546. // auth portion cannot go past, or the last @ char is the decider.
  10547. var auth, atSign;
  10548. if (hostEnd === -1) {
  10549. // atSign can be anywhere.
  10550. atSign = rest.lastIndexOf('@');
  10551. } else {
  10552. // atSign must be in auth portion.
  10553. // http://a@b/c@d => host:b auth:a path:/c@d
  10554. atSign = rest.lastIndexOf('@', hostEnd);
  10555. }
  10556. // Now we have a portion which is definitely the auth.
  10557. // Pull that off.
  10558. if (atSign !== -1) {
  10559. auth = rest.slice(0, atSign);
  10560. rest = rest.slice(atSign + 1);
  10561. this.auth = auth;
  10562. }
  10563. // the host is the remaining to the left of the first non-host char
  10564. hostEnd = -1;
  10565. for (i = 0; i < nonHostChars.length; i++) {
  10566. hec = rest.indexOf(nonHostChars[i]);
  10567. if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
  10568. hostEnd = hec;
  10569. }
  10570. }
  10571. // if we still have not hit it, then the entire thing is a host.
  10572. if (hostEnd === -1) {
  10573. hostEnd = rest.length;
  10574. }
  10575. if (rest[hostEnd - 1] === ':') { hostEnd--; }
  10576. var host = rest.slice(0, hostEnd);
  10577. rest = rest.slice(hostEnd);
  10578. // pull out port.
  10579. this.parseHost(host);
  10580. // we've indicated that there is a hostname,
  10581. // so even if it's empty, it has to be present.
  10582. this.hostname = this.hostname || '';
  10583. // if hostname begins with [ and ends with ]
  10584. // assume that it's an IPv6 address.
  10585. var ipv6Hostname = this.hostname[0] === '[' &&
  10586. this.hostname[this.hostname.length - 1] === ']';
  10587. // validate a little.
  10588. if (!ipv6Hostname) {
  10589. var hostparts = this.hostname.split(/\./);
  10590. for (i = 0, l = hostparts.length; i < l; i++) {
  10591. var part = hostparts[i];
  10592. if (!part) { continue; }
  10593. if (!part.match(hostnamePartPattern)) {
  10594. var newpart = '';
  10595. for (var j = 0, k = part.length; j < k; j++) {
  10596. if (part.charCodeAt(j) > 127) {
  10597. // we replace non-ASCII char with a temporary placeholder
  10598. // we need this to make sure size of hostname is not
  10599. // broken by replacing non-ASCII by nothing
  10600. newpart += 'x';
  10601. } else {
  10602. newpart += part[j];
  10603. }
  10604. }
  10605. // we test again with ASCII char only
  10606. if (!newpart.match(hostnamePartPattern)) {
  10607. var validParts = hostparts.slice(0, i);
  10608. var notHost = hostparts.slice(i + 1);
  10609. var bit = part.match(hostnamePartStart);
  10610. if (bit) {
  10611. validParts.push(bit[1]);
  10612. notHost.unshift(bit[2]);
  10613. }
  10614. if (notHost.length) {
  10615. rest = notHost.join('.') + rest;
  10616. }
  10617. this.hostname = validParts.join('.');
  10618. break;
  10619. }
  10620. }
  10621. }
  10622. }
  10623. if (this.hostname.length > hostnameMaxLen) {
  10624. this.hostname = '';
  10625. }
  10626. // strip [ and ] from the hostname
  10627. // the host field still retains them, though
  10628. if (ipv6Hostname) {
  10629. this.hostname = this.hostname.substr(1, this.hostname.length - 2);
  10630. }
  10631. }
  10632. // chop off from the tail first.
  10633. var hash = rest.indexOf('#');
  10634. if (hash !== -1) {
  10635. // got a fragment string.
  10636. this.hash = rest.substr(hash);
  10637. rest = rest.slice(0, hash);
  10638. }
  10639. var qm = rest.indexOf('?');
  10640. if (qm !== -1) {
  10641. this.search = rest.substr(qm);
  10642. rest = rest.slice(0, qm);
  10643. }
  10644. if (rest) { this.pathname = rest; }
  10645. if (slashedProtocol[lowerProto] &&
  10646. this.hostname && !this.pathname) {
  10647. this.pathname = '';
  10648. }
  10649. return this;
  10650. };
  10651. Url.prototype.parseHost = function(host) {
  10652. var port = portPattern.exec(host);
  10653. if (port) {
  10654. port = port[0];
  10655. if (port !== ':') {
  10656. this.port = port.substr(1);
  10657. }
  10658. host = host.substr(0, host.length - port.length);
  10659. }
  10660. if (host) { this.hostname = host; }
  10661. };
  10662. module.exports = urlParse;
  10663. /***/ }),
  10664. /* 78 */
  10665. /***/ (function(module, exports) {
  10666. // shim for using process in browser
  10667. var process = module.exports = {};
  10668. // cached from whatever global is present so that test runners that stub it
  10669. // don't break things. But we need to wrap it in a try catch in case it is
  10670. // wrapped in strict mode code which doesn't define any globals. It's inside a
  10671. // function because try/catches deoptimize in certain engines.
  10672. var cachedSetTimeout;
  10673. var cachedClearTimeout;
  10674. function defaultSetTimout() {
  10675. throw new Error('setTimeout has not been defined');
  10676. }
  10677. function defaultClearTimeout () {
  10678. throw new Error('clearTimeout has not been defined');
  10679. }
  10680. (function () {
  10681. try {
  10682. if (typeof setTimeout === 'function') {
  10683. cachedSetTimeout = setTimeout;
  10684. } else {
  10685. cachedSetTimeout = defaultSetTimout;
  10686. }
  10687. } catch (e) {
  10688. cachedSetTimeout = defaultSetTimout;
  10689. }
  10690. try {
  10691. if (typeof clearTimeout === 'function') {
  10692. cachedClearTimeout = clearTimeout;
  10693. } else {
  10694. cachedClearTimeout = defaultClearTimeout;
  10695. }
  10696. } catch (e) {
  10697. cachedClearTimeout = defaultClearTimeout;
  10698. }
  10699. } ())
  10700. function runTimeout(fun) {
  10701. if (cachedSetTimeout === setTimeout) {
  10702. //normal enviroments in sane situations
  10703. return setTimeout(fun, 0);
  10704. }
  10705. // if setTimeout wasn't available but was latter defined
  10706. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  10707. cachedSetTimeout = setTimeout;
  10708. return setTimeout(fun, 0);
  10709. }
  10710. try {
  10711. // when when somebody has screwed with setTimeout but no I.E. maddness
  10712. return cachedSetTimeout(fun, 0);
  10713. } catch(e){
  10714. try {
  10715. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  10716. return cachedSetTimeout.call(null, fun, 0);
  10717. } catch(e){
  10718. // 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
  10719. return cachedSetTimeout.call(this, fun, 0);
  10720. }
  10721. }
  10722. }
  10723. function runClearTimeout(marker) {
  10724. if (cachedClearTimeout === clearTimeout) {
  10725. //normal enviroments in sane situations
  10726. return clearTimeout(marker);
  10727. }
  10728. // if clearTimeout wasn't available but was latter defined
  10729. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  10730. cachedClearTimeout = clearTimeout;
  10731. return clearTimeout(marker);
  10732. }
  10733. try {
  10734. // when when somebody has screwed with setTimeout but no I.E. maddness
  10735. return cachedClearTimeout(marker);
  10736. } catch (e){
  10737. try {
  10738. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  10739. return cachedClearTimeout.call(null, marker);
  10740. } catch (e){
  10741. // 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.
  10742. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  10743. return cachedClearTimeout.call(this, marker);
  10744. }
  10745. }
  10746. }
  10747. var queue = [];
  10748. var draining = false;
  10749. var currentQueue;
  10750. var queueIndex = -1;
  10751. function cleanUpNextTick() {
  10752. if (!draining || !currentQueue) {
  10753. return;
  10754. }
  10755. draining = false;
  10756. if (currentQueue.length) {
  10757. queue = currentQueue.concat(queue);
  10758. } else {
  10759. queueIndex = -1;
  10760. }
  10761. if (queue.length) {
  10762. drainQueue();
  10763. }
  10764. }
  10765. function drainQueue() {
  10766. if (draining) {
  10767. return;
  10768. }
  10769. var timeout = runTimeout(cleanUpNextTick);
  10770. draining = true;
  10771. var len = queue.length;
  10772. while(len) {
  10773. currentQueue = queue;
  10774. queue = [];
  10775. while (++queueIndex < len) {
  10776. if (currentQueue) {
  10777. currentQueue[queueIndex].run();
  10778. }
  10779. }
  10780. queueIndex = -1;
  10781. len = queue.length;
  10782. }
  10783. currentQueue = null;
  10784. draining = false;
  10785. runClearTimeout(timeout);
  10786. }
  10787. process.nextTick = function (fun) {
  10788. var args = new Array(arguments.length - 1);
  10789. if (arguments.length > 1) {
  10790. for (var i = 1; i < arguments.length; i++) {
  10791. args[i - 1] = arguments[i];
  10792. }
  10793. }
  10794. queue.push(new Item(fun, args));
  10795. if (queue.length === 1 && !draining) {
  10796. runTimeout(drainQueue);
  10797. }
  10798. };
  10799. // v8 likes predictible objects
  10800. function Item(fun, array) {
  10801. this.fun = fun;
  10802. this.array = array;
  10803. }
  10804. Item.prototype.run = function () {
  10805. this.fun.apply(null, this.array);
  10806. };
  10807. process.title = 'browser';
  10808. process.browser = true;
  10809. process.env = {};
  10810. process.argv = [];
  10811. process.version = ''; // empty string to avoid regexp issues
  10812. process.versions = {};
  10813. function noop() {}
  10814. process.on = noop;
  10815. process.addListener = noop;
  10816. process.once = noop;
  10817. process.off = noop;
  10818. process.removeListener = noop;
  10819. process.removeAllListeners = noop;
  10820. process.emit = noop;
  10821. process.binding = function (name) {
  10822. throw new Error('process.binding is not supported');
  10823. };
  10824. process.cwd = function () { return '/' };
  10825. process.chdir = function (dir) {
  10826. throw new Error('process.chdir is not supported');
  10827. };
  10828. process.umask = function() { return 0; };
  10829. /***/ }),
  10830. /* 79 */
  10831. /***/ (function(module, exports, __webpack_require__) {
  10832. /* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */
  10833. ;(function(root) {
  10834. /** Detect free variables */
  10835. var freeExports = typeof exports == 'object' && exports &&
  10836. !exports.nodeType && exports;
  10837. var freeModule = typeof module == 'object' && module &&
  10838. !module.nodeType && module;
  10839. var freeGlobal = typeof global == 'object' && global;
  10840. if (
  10841. freeGlobal.global === freeGlobal ||
  10842. freeGlobal.window === freeGlobal ||
  10843. freeGlobal.self === freeGlobal
  10844. ) {
  10845. root = freeGlobal;
  10846. }
  10847. /**
  10848. * The `punycode` object.
  10849. * @name punycode
  10850. * @type Object
  10851. */
  10852. var punycode,
  10853. /** Highest positive signed 32-bit float value */
  10854. maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
  10855. /** Bootstring parameters */
  10856. base = 36,
  10857. tMin = 1,
  10858. tMax = 26,
  10859. skew = 38,
  10860. damp = 700,
  10861. initialBias = 72,
  10862. initialN = 128, // 0x80
  10863. delimiter = '-', // '\x2D'
  10864. /** Regular expressions */
  10865. regexPunycode = /^xn--/,
  10866. regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
  10867. regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
  10868. /** Error messages */
  10869. errors = {
  10870. 'overflow': 'Overflow: input needs wider integers to process',
  10871. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  10872. 'invalid-input': 'Invalid input'
  10873. },
  10874. /** Convenience shortcuts */
  10875. baseMinusTMin = base - tMin,
  10876. floor = Math.floor,
  10877. stringFromCharCode = String.fromCharCode,
  10878. /** Temporary variable */
  10879. key;
  10880. /*--------------------------------------------------------------------------*/
  10881. /**
  10882. * A generic error utility function.
  10883. * @private
  10884. * @param {String} type The error type.
  10885. * @returns {Error} Throws a `RangeError` with the applicable error message.
  10886. */
  10887. function error(type) {
  10888. throw new RangeError(errors[type]);
  10889. }
  10890. /**
  10891. * A generic `Array#map` utility function.
  10892. * @private
  10893. * @param {Array} array The array to iterate over.
  10894. * @param {Function} callback The function that gets called for every array
  10895. * item.
  10896. * @returns {Array} A new array of values returned by the callback function.
  10897. */
  10898. function map(array, fn) {
  10899. var length = array.length;
  10900. var result = [];
  10901. while (length--) {
  10902. result[length] = fn(array[length]);
  10903. }
  10904. return result;
  10905. }
  10906. /**
  10907. * A simple `Array#map`-like wrapper to work with domain name strings or email
  10908. * addresses.
  10909. * @private
  10910. * @param {String} domain The domain name or email address.
  10911. * @param {Function} callback The function that gets called for every
  10912. * character.
  10913. * @returns {Array} A new string of characters returned by the callback
  10914. * function.
  10915. */
  10916. function mapDomain(string, fn) {
  10917. var parts = string.split('@');
  10918. var result = '';
  10919. if (parts.length > 1) {
  10920. // In email addresses, only the domain name should be punycoded. Leave
  10921. // the local part (i.e. everything up to `@`) intact.
  10922. result = parts[0] + '@';
  10923. string = parts[1];
  10924. }
  10925. // Avoid `split(regex)` for IE8 compatibility. See #17.
  10926. string = string.replace(regexSeparators, '\x2E');
  10927. var labels = string.split('.');
  10928. var encoded = map(labels, fn).join('.');
  10929. return result + encoded;
  10930. }
  10931. /**
  10932. * Creates an array containing the numeric code points of each Unicode
  10933. * character in the string. While JavaScript uses UCS-2 internally,
  10934. * this function will convert a pair of surrogate halves (each of which
  10935. * UCS-2 exposes as separate characters) into a single code point,
  10936. * matching UTF-16.
  10937. * @see `punycode.ucs2.encode`
  10938. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  10939. * @memberOf punycode.ucs2
  10940. * @name decode
  10941. * @param {String} string The Unicode input string (UCS-2).
  10942. * @returns {Array} The new array of code points.
  10943. */
  10944. function ucs2decode(string) {
  10945. var output = [],
  10946. counter = 0,
  10947. length = string.length,
  10948. value,
  10949. extra;
  10950. while (counter < length) {
  10951. value = string.charCodeAt(counter++);
  10952. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  10953. // high surrogate, and there is a next character
  10954. extra = string.charCodeAt(counter++);
  10955. if ((extra & 0xFC00) == 0xDC00) { // low surrogate
  10956. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  10957. } else {
  10958. // unmatched surrogate; only append this code unit, in case the next
  10959. // code unit is the high surrogate of a surrogate pair
  10960. output.push(value);
  10961. counter--;
  10962. }
  10963. } else {
  10964. output.push(value);
  10965. }
  10966. }
  10967. return output;
  10968. }
  10969. /**
  10970. * Creates a string based on an array of numeric code points.
  10971. * @see `punycode.ucs2.decode`
  10972. * @memberOf punycode.ucs2
  10973. * @name encode
  10974. * @param {Array} codePoints The array of numeric code points.
  10975. * @returns {String} The new Unicode string (UCS-2).
  10976. */
  10977. function ucs2encode(array) {
  10978. return map(array, function(value) {
  10979. var output = '';
  10980. if (value > 0xFFFF) {
  10981. value -= 0x10000;
  10982. output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
  10983. value = 0xDC00 | value & 0x3FF;
  10984. }
  10985. output += stringFromCharCode(value);
  10986. return output;
  10987. }).join('');
  10988. }
  10989. /**
  10990. * Converts a basic code point into a digit/integer.
  10991. * @see `digitToBasic()`
  10992. * @private
  10993. * @param {Number} codePoint The basic numeric code point value.
  10994. * @returns {Number} The numeric value of a basic code point (for use in
  10995. * representing integers) in the range `0` to `base - 1`, or `base` if
  10996. * the code point does not represent a value.
  10997. */
  10998. function basicToDigit(codePoint) {
  10999. if (codePoint - 48 < 10) {
  11000. return codePoint - 22;
  11001. }
  11002. if (codePoint - 65 < 26) {
  11003. return codePoint - 65;
  11004. }
  11005. if (codePoint - 97 < 26) {
  11006. return codePoint - 97;
  11007. }
  11008. return base;
  11009. }
  11010. /**
  11011. * Converts a digit/integer into a basic code point.
  11012. * @see `basicToDigit()`
  11013. * @private
  11014. * @param {Number} digit The numeric value of a basic code point.
  11015. * @returns {Number} The basic code point whose value (when used for
  11016. * representing integers) is `digit`, which needs to be in the range
  11017. * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
  11018. * used; else, the lowercase form is used. The behavior is undefined
  11019. * if `flag` is non-zero and `digit` has no uppercase form.
  11020. */
  11021. function digitToBasic(digit, flag) {
  11022. // 0..25 map to ASCII a..z or A..Z
  11023. // 26..35 map to ASCII 0..9
  11024. return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
  11025. }
  11026. /**
  11027. * Bias adaptation function as per section 3.4 of RFC 3492.
  11028. * https://tools.ietf.org/html/rfc3492#section-3.4
  11029. * @private
  11030. */
  11031. function adapt(delta, numPoints, firstTime) {
  11032. var k = 0;
  11033. delta = firstTime ? floor(delta / damp) : delta >> 1;
  11034. delta += floor(delta / numPoints);
  11035. for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
  11036. delta = floor(delta / baseMinusTMin);
  11037. }
  11038. return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
  11039. }
  11040. /**
  11041. * Converts a Punycode string of ASCII-only symbols to a string of Unicode
  11042. * symbols.
  11043. * @memberOf punycode
  11044. * @param {String} input The Punycode string of ASCII-only symbols.
  11045. * @returns {String} The resulting string of Unicode symbols.
  11046. */
  11047. function decode(input) {
  11048. // Don't use UCS-2
  11049. var output = [],
  11050. inputLength = input.length,
  11051. out,
  11052. i = 0,
  11053. n = initialN,
  11054. bias = initialBias,
  11055. basic,
  11056. j,
  11057. index,
  11058. oldi,
  11059. w,
  11060. k,
  11061. digit,
  11062. t,
  11063. /** Cached calculation results */
  11064. baseMinusT;
  11065. // Handle the basic code points: let `basic` be the number of input code
  11066. // points before the last delimiter, or `0` if there is none, then copy
  11067. // the first basic code points to the output.
  11068. basic = input.lastIndexOf(delimiter);
  11069. if (basic < 0) {
  11070. basic = 0;
  11071. }
  11072. for (j = 0; j < basic; ++j) {
  11073. // if it's not a basic code point
  11074. if (input.charCodeAt(j) >= 0x80) {
  11075. error('not-basic');
  11076. }
  11077. output.push(input.charCodeAt(j));
  11078. }
  11079. // Main decoding loop: start just after the last delimiter if any basic code
  11080. // points were copied; start at the beginning otherwise.
  11081. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
  11082. // `index` is the index of the next character to be consumed.
  11083. // Decode a generalized variable-length integer into `delta`,
  11084. // which gets added to `i`. The overflow checking is easier
  11085. // if we increase `i` as we go, then subtract off its starting
  11086. // value at the end to obtain `delta`.
  11087. for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
  11088. if (index >= inputLength) {
  11089. error('invalid-input');
  11090. }
  11091. digit = basicToDigit(input.charCodeAt(index++));
  11092. if (digit >= base || digit > floor((maxInt - i) / w)) {
  11093. error('overflow');
  11094. }
  11095. i += digit * w;
  11096. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  11097. if (digit < t) {
  11098. break;
  11099. }
  11100. baseMinusT = base - t;
  11101. if (w > floor(maxInt / baseMinusT)) {
  11102. error('overflow');
  11103. }
  11104. w *= baseMinusT;
  11105. }
  11106. out = output.length + 1;
  11107. bias = adapt(i - oldi, out, oldi == 0);
  11108. // `i` was supposed to wrap around from `out` to `0`,
  11109. // incrementing `n` each time, so we'll fix that now:
  11110. if (floor(i / out) > maxInt - n) {
  11111. error('overflow');
  11112. }
  11113. n += floor(i / out);
  11114. i %= out;
  11115. // Insert `n` at position `i` of the output
  11116. output.splice(i++, 0, n);
  11117. }
  11118. return ucs2encode(output);
  11119. }
  11120. /**
  11121. * Converts a string of Unicode symbols (e.g. a domain name label) to a
  11122. * Punycode string of ASCII-only symbols.
  11123. * @memberOf punycode
  11124. * @param {String} input The string of Unicode symbols.
  11125. * @returns {String} The resulting Punycode string of ASCII-only symbols.
  11126. */
  11127. function encode(input) {
  11128. var n,
  11129. delta,
  11130. handledCPCount,
  11131. basicLength,
  11132. bias,
  11133. j,
  11134. m,
  11135. q,
  11136. k,
  11137. t,
  11138. currentValue,
  11139. output = [],
  11140. /** `inputLength` will hold the number of code points in `input`. */
  11141. inputLength,
  11142. /** Cached calculation results */
  11143. handledCPCountPlusOne,
  11144. baseMinusT,
  11145. qMinusT;
  11146. // Convert the input in UCS-2 to Unicode
  11147. input = ucs2decode(input);
  11148. // Cache the length
  11149. inputLength = input.length;
  11150. // Initialize the state
  11151. n = initialN;
  11152. delta = 0;
  11153. bias = initialBias;
  11154. // Handle the basic code points
  11155. for (j = 0; j < inputLength; ++j) {
  11156. currentValue = input[j];
  11157. if (currentValue < 0x80) {
  11158. output.push(stringFromCharCode(currentValue));
  11159. }
  11160. }
  11161. handledCPCount = basicLength = output.length;
  11162. // `handledCPCount` is the number of code points that have been handled;
  11163. // `basicLength` is the number of basic code points.
  11164. // Finish the basic string - if it is not empty - with a delimiter
  11165. if (basicLength) {
  11166. output.push(delimiter);
  11167. }
  11168. // Main encoding loop:
  11169. while (handledCPCount < inputLength) {
  11170. // All non-basic code points < n have been handled already. Find the next
  11171. // larger one:
  11172. for (m = maxInt, j = 0; j < inputLength; ++j) {
  11173. currentValue = input[j];
  11174. if (currentValue >= n && currentValue < m) {
  11175. m = currentValue;
  11176. }
  11177. }
  11178. // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
  11179. // but guard against overflow
  11180. handledCPCountPlusOne = handledCPCount + 1;
  11181. if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  11182. error('overflow');
  11183. }
  11184. delta += (m - n) * handledCPCountPlusOne;
  11185. n = m;
  11186. for (j = 0; j < inputLength; ++j) {
  11187. currentValue = input[j];
  11188. if (currentValue < n && ++delta > maxInt) {
  11189. error('overflow');
  11190. }
  11191. if (currentValue == n) {
  11192. // Represent delta as a generalized variable-length integer
  11193. for (q = delta, k = base; /* no condition */; k += base) {
  11194. t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
  11195. if (q < t) {
  11196. break;
  11197. }
  11198. qMinusT = q - t;
  11199. baseMinusT = base - t;
  11200. output.push(
  11201. stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
  11202. );
  11203. q = floor(qMinusT / baseMinusT);
  11204. }
  11205. output.push(stringFromCharCode(digitToBasic(q, 0)));
  11206. bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  11207. delta = 0;
  11208. ++handledCPCount;
  11209. }
  11210. }
  11211. ++delta;
  11212. ++n;
  11213. }
  11214. return output.join('');
  11215. }
  11216. /**
  11217. * Converts a Punycode string representing a domain name or an email address
  11218. * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
  11219. * it doesn't matter if you call it on a string that has already been
  11220. * converted to Unicode.
  11221. * @memberOf punycode
  11222. * @param {String} input The Punycoded domain name or email address to
  11223. * convert to Unicode.
  11224. * @returns {String} The Unicode representation of the given Punycode
  11225. * string.
  11226. */
  11227. function toUnicode(input) {
  11228. return mapDomain(input, function(string) {
  11229. return regexPunycode.test(string)
  11230. ? decode(string.slice(4).toLowerCase())
  11231. : string;
  11232. });
  11233. }
  11234. /**
  11235. * Converts a Unicode string representing a domain name or an email address to
  11236. * Punycode. Only the non-ASCII parts of the domain name will be converted,
  11237. * i.e. it doesn't matter if you call it with a domain that's already in
  11238. * ASCII.
  11239. * @memberOf punycode
  11240. * @param {String} input The domain name or email address to convert, as a
  11241. * Unicode string.
  11242. * @returns {String} The Punycode representation of the given domain name or
  11243. * email address.
  11244. */
  11245. function toASCII(input) {
  11246. return mapDomain(input, function(string) {
  11247. return regexNonASCII.test(string)
  11248. ? 'xn--' + encode(string)
  11249. : string;
  11250. });
  11251. }
  11252. /*--------------------------------------------------------------------------*/
  11253. /** Define the public API */
  11254. punycode = {
  11255. /**
  11256. * A string representing the current Punycode.js version number.
  11257. * @memberOf punycode
  11258. * @type String
  11259. */
  11260. 'version': '1.4.1',
  11261. /**
  11262. * An object of methods to convert from JavaScript's internal character
  11263. * representation (UCS-2) to Unicode code points, and back.
  11264. * @see <https://mathiasbynens.be/notes/javascript-encoding>
  11265. * @memberOf punycode
  11266. * @type Object
  11267. */
  11268. 'ucs2': {
  11269. 'decode': ucs2decode,
  11270. 'encode': ucs2encode
  11271. },
  11272. 'decode': decode,
  11273. 'encode': encode,
  11274. 'toASCII': toASCII,
  11275. 'toUnicode': toUnicode
  11276. };
  11277. /** Expose `punycode` */
  11278. // Some AMD build optimizers, like r.js, check for specific condition patterns
  11279. // like the following:
  11280. if (
  11281. true
  11282. ) {
  11283. !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
  11284. return punycode;
  11285. }.call(exports, __webpack_require__, exports, module),
  11286. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  11287. } else if (freeExports && freeModule) {
  11288. if (module.exports == freeExports) {
  11289. // in Node.js, io.js, or RingoJS v0.8.0+
  11290. freeModule.exports = punycode;
  11291. } else {
  11292. // in Narwhal or RingoJS v0.7.0-
  11293. for (key in punycode) {
  11294. punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
  11295. }
  11296. }
  11297. } else {
  11298. // in Rhino or a web browser
  11299. root.punycode = punycode;
  11300. }
  11301. }(this));
  11302. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(84)(module), __webpack_require__(6)))
  11303. /***/ }),
  11304. /* 80 */
  11305. /***/ (function(module, exports, __webpack_require__) {
  11306. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  11307. "use strict";
  11308. if (global.setImmediate) {
  11309. return;
  11310. }
  11311. var nextHandle = 1; // Spec says greater than zero
  11312. var tasksByHandle = {};
  11313. var currentlyRunningATask = false;
  11314. var doc = global.document;
  11315. var registerImmediate;
  11316. function setImmediate(callback) {
  11317. // Callback can either be a function or a string
  11318. if (typeof callback !== "function") {
  11319. callback = new Function("" + callback);
  11320. }
  11321. // Copy function arguments
  11322. var args = new Array(arguments.length - 1);
  11323. for (var i = 0; i < args.length; i++) {
  11324. args[i] = arguments[i + 1];
  11325. }
  11326. // Store and register the task
  11327. var task = { callback: callback, args: args };
  11328. tasksByHandle[nextHandle] = task;
  11329. registerImmediate(nextHandle);
  11330. return nextHandle++;
  11331. }
  11332. function clearImmediate(handle) {
  11333. delete tasksByHandle[handle];
  11334. }
  11335. function run(task) {
  11336. var callback = task.callback;
  11337. var args = task.args;
  11338. switch (args.length) {
  11339. case 0:
  11340. callback();
  11341. break;
  11342. case 1:
  11343. callback(args[0]);
  11344. break;
  11345. case 2:
  11346. callback(args[0], args[1]);
  11347. break;
  11348. case 3:
  11349. callback(args[0], args[1], args[2]);
  11350. break;
  11351. default:
  11352. callback.apply(undefined, args);
  11353. break;
  11354. }
  11355. }
  11356. function runIfPresent(handle) {
  11357. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  11358. // So if we're currently running a task, we'll need to delay this invocation.
  11359. if (currentlyRunningATask) {
  11360. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  11361. // "too much recursion" error.
  11362. setTimeout(runIfPresent, 0, handle);
  11363. } else {
  11364. var task = tasksByHandle[handle];
  11365. if (task) {
  11366. currentlyRunningATask = true;
  11367. try {
  11368. run(task);
  11369. } finally {
  11370. clearImmediate(handle);
  11371. currentlyRunningATask = false;
  11372. }
  11373. }
  11374. }
  11375. }
  11376. function installNextTickImplementation() {
  11377. registerImmediate = function(handle) {
  11378. process.nextTick(function () { runIfPresent(handle); });
  11379. };
  11380. }
  11381. function canUsePostMessage() {
  11382. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  11383. // where `global.postMessage` means something completely different and can't be used for this purpose.
  11384. if (global.postMessage && !global.importScripts) {
  11385. var postMessageIsAsynchronous = true;
  11386. var oldOnMessage = global.onmessage;
  11387. global.onmessage = function() {
  11388. postMessageIsAsynchronous = false;
  11389. };
  11390. global.postMessage("", "*");
  11391. global.onmessage = oldOnMessage;
  11392. return postMessageIsAsynchronous;
  11393. }
  11394. }
  11395. function installPostMessageImplementation() {
  11396. // Installs an event handler on `global` for the `message` event: see
  11397. // * https://developer.mozilla.org/en/DOM/window.postMessage
  11398. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  11399. var messagePrefix = "setImmediate$" + Math.random() + "$";
  11400. var onGlobalMessage = function(event) {
  11401. if (event.source === global &&
  11402. typeof event.data === "string" &&
  11403. event.data.indexOf(messagePrefix) === 0) {
  11404. runIfPresent(+event.data.slice(messagePrefix.length));
  11405. }
  11406. };
  11407. if (global.addEventListener) {
  11408. global.addEventListener("message", onGlobalMessage, false);
  11409. } else {
  11410. global.attachEvent("onmessage", onGlobalMessage);
  11411. }
  11412. registerImmediate = function(handle) {
  11413. global.postMessage(messagePrefix + handle, "*");
  11414. };
  11415. }
  11416. function installMessageChannelImplementation() {
  11417. var channel = new MessageChannel();
  11418. channel.port1.onmessage = function(event) {
  11419. var handle = event.data;
  11420. runIfPresent(handle);
  11421. };
  11422. registerImmediate = function(handle) {
  11423. channel.port2.postMessage(handle);
  11424. };
  11425. }
  11426. function installReadyStateChangeImplementation() {
  11427. var html = doc.documentElement;
  11428. registerImmediate = function(handle) {
  11429. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  11430. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  11431. var script = doc.createElement("script");
  11432. script.onreadystatechange = function () {
  11433. runIfPresent(handle);
  11434. script.onreadystatechange = null;
  11435. html.removeChild(script);
  11436. script = null;
  11437. };
  11438. html.appendChild(script);
  11439. };
  11440. }
  11441. function installSetTimeoutImplementation() {
  11442. registerImmediate = function(handle) {
  11443. setTimeout(runIfPresent, 0, handle);
  11444. };
  11445. }
  11446. // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  11447. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  11448. attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  11449. // Don't get fooled by e.g. browserify environments.
  11450. if ({}.toString.call(global.process) === "[object process]") {
  11451. // For Node.js before 0.9
  11452. installNextTickImplementation();
  11453. } else if (canUsePostMessage()) {
  11454. // For non-IE10 modern browsers
  11455. installPostMessageImplementation();
  11456. } else if (global.MessageChannel) {
  11457. // For web workers, where supported
  11458. installMessageChannelImplementation();
  11459. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  11460. // For IE 6–8
  11461. installReadyStateChangeImplementation();
  11462. } else {
  11463. // For older browsers
  11464. installSetTimeoutImplementation();
  11465. }
  11466. attachTo.setImmediate = setImmediate;
  11467. attachTo.clearImmediate = clearImmediate;
  11468. }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  11469. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(78)))
  11470. /***/ }),
  11471. /* 81 */
  11472. /***/ (function(module, exports, __webpack_require__) {
  11473. var apply = Function.prototype.apply;
  11474. // DOM APIs, for completeness
  11475. exports.setTimeout = function() {
  11476. return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
  11477. };
  11478. exports.setInterval = function() {
  11479. return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
  11480. };
  11481. exports.clearTimeout =
  11482. exports.clearInterval = function(timeout) {
  11483. if (timeout) {
  11484. timeout.close();
  11485. }
  11486. };
  11487. function Timeout(id, clearFn) {
  11488. this._id = id;
  11489. this._clearFn = clearFn;
  11490. }
  11491. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  11492. Timeout.prototype.close = function() {
  11493. this._clearFn.call(window, this._id);
  11494. };
  11495. // Does not start the time, just sets up the members needed.
  11496. exports.enroll = function(item, msecs) {
  11497. clearTimeout(item._idleTimeoutId);
  11498. item._idleTimeout = msecs;
  11499. };
  11500. exports.unenroll = function(item) {
  11501. clearTimeout(item._idleTimeoutId);
  11502. item._idleTimeout = -1;
  11503. };
  11504. exports._unrefActive = exports.active = function(item) {
  11505. clearTimeout(item._idleTimeoutId);
  11506. var msecs = item._idleTimeout;
  11507. if (msecs >= 0) {
  11508. item._idleTimeoutId = setTimeout(function onTimeout() {
  11509. if (item._onTimeout)
  11510. item._onTimeout();
  11511. }, msecs);
  11512. }
  11513. };
  11514. // setimmediate attaches itself to the global object
  11515. __webpack_require__(80);
  11516. exports.setImmediate = setImmediate;
  11517. exports.clearImmediate = clearImmediate;
  11518. /***/ }),
  11519. /* 82 */
  11520. /***/ (function(module, exports) {
  11521. module.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/
  11522. /***/ }),
  11523. /* 83 */
  11524. /***/ (function(module, exports, __webpack_require__) {
  11525. "use strict";
  11526. exports.Any = __webpack_require__(18);
  11527. exports.Cc = __webpack_require__(16);
  11528. exports.Cf = __webpack_require__(82);
  11529. exports.P = __webpack_require__(5);
  11530. exports.Z = __webpack_require__(17);
  11531. /***/ }),
  11532. /* 84 */
  11533. /***/ (function(module, exports) {
  11534. module.exports = function(module) {
  11535. if(!module.webpackPolyfill) {
  11536. module.deprecate = function() {};
  11537. module.paths = [];
  11538. // module.parent = undefined by default
  11539. if(!module.children) module.children = [];
  11540. Object.defineProperty(module, "loaded", {
  11541. enumerable: true,
  11542. get: function() {
  11543. return module.l;
  11544. }
  11545. });
  11546. Object.defineProperty(module, "id", {
  11547. enumerable: true,
  11548. get: function() {
  11549. return module.i;
  11550. }
  11551. });
  11552. module.webpackPolyfill = 1;
  11553. }
  11554. return module;
  11555. };
  11556. /***/ }),
  11557. /* 85 */
  11558. /***/ (function(module, exports, __webpack_require__) {
  11559. __webpack_require__(19);
  11560. module.exports = __webpack_require__(20);
  11561. /***/ })
  11562. /******/ ]);
  11563. //# sourceMappingURL=main.js.map