docsify.js 322 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235
  1. (function () {
  2. /**
  3. * Create a cached version of a pure function.
  4. * @param {*} fn The function call to be cached
  5. * @void
  6. */
  7. function cached(fn) {
  8. var cache = Object.create(null);
  9. return function (str) {
  10. var key = isPrimitive(str) ? str : JSON.stringify(str);
  11. var hit = cache[key];
  12. return hit || (cache[key] = fn(str));
  13. };
  14. }
  15. /**
  16. * Hyphenate a camelCase string.
  17. */
  18. var hyphenate = cached(function (str) {
  19. return str.replace(/([A-Z])/g, function (m) { return '-' + m.toLowerCase(); });
  20. });
  21. var hasOwn = Object.prototype.hasOwnProperty;
  22. /**
  23. * Simple Object.assign polyfill
  24. * @param {Object} to The object to be merged with
  25. * @returns {Object} The merged object
  26. */
  27. var merge =
  28. Object.assign ||
  29. function (to) {
  30. var arguments$1 = arguments;
  31. for (var i = 1; i < arguments.length; i++) {
  32. var from = Object(arguments$1[i]);
  33. for (var key in from) {
  34. if (hasOwn.call(from, key)) {
  35. to[key] = from[key];
  36. }
  37. }
  38. }
  39. return to;
  40. };
  41. /**
  42. * Check if value is primitive
  43. * @param {*} value Checks if a value is primitive
  44. * @returns {Boolean} Result of the check
  45. */
  46. function isPrimitive(value) {
  47. return typeof value === 'string' || typeof value === 'number';
  48. }
  49. /**
  50. * Performs no operation.
  51. * @void
  52. */
  53. function noop() {}
  54. /**
  55. * Check if value is function
  56. * @param {*} obj Any javascript object
  57. * @returns {Boolean} True if the passed-in value is a function
  58. */
  59. function isFn(obj) {
  60. return typeof obj === 'function';
  61. }
  62. /**
  63. * Check if url is external
  64. * @param {String} string url
  65. * @returns {Boolean} True if the passed-in url is external
  66. */
  67. function isExternal(url) {
  68. var match = url.match(
  69. /^([^:/?#]+:)?(?:\/{2,}([^/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/
  70. );
  71. if (
  72. typeof match[1] === 'string' &&
  73. match[1].length > 0 &&
  74. match[1].toLowerCase() !== location.protocol
  75. ) {
  76. return true;
  77. }
  78. if (
  79. typeof match[2] === 'string' &&
  80. match[2].length > 0 &&
  81. match[2].replace(
  82. new RegExp(
  83. ':(' + { 'http:': 80, 'https:': 443 }[location.protocol] + ')?$'
  84. ),
  85. ''
  86. ) !== location.host
  87. ) {
  88. return true;
  89. }
  90. if (/^\/\\/.test(url)) {
  91. return true;
  92. }
  93. return false;
  94. }
  95. var inBrowser = !false;
  96. var isMobile = document.body.clientWidth <= 600;
  97. /**
  98. * @see https://github.com/MoOx/pjax/blob/master/lib/is-supported.js
  99. */
  100. var supportsPushState =
  101. (function () {
  102. // Borrowed wholesale from https://github.com/defunkt/jquery-pjax
  103. return (
  104. window.history &&
  105. window.history.pushState &&
  106. window.history.replaceState &&
  107. // PushState isn’t reliable on iOS until 5.
  108. !navigator.userAgent.match(
  109. /((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/
  110. )
  111. );
  112. })();
  113. var cacheNode = {};
  114. /**
  115. * Get Node
  116. * @param {String|Element} el A DOM element
  117. * @param {Boolean} noCache Flag to use or not use the cache
  118. * @return {Element} The found node element
  119. */
  120. function getNode(el, noCache) {
  121. if ( noCache === void 0 ) noCache = false;
  122. if (typeof el === 'string') {
  123. if (typeof window.Vue !== 'undefined') {
  124. return find(el);
  125. }
  126. el = noCache ? find(el) : cacheNode[el] || (cacheNode[el] = find(el));
  127. }
  128. return el;
  129. }
  130. var $ = document;
  131. var body = $.body;
  132. var head = $.head;
  133. /**
  134. * Find elements
  135. * @param {String|Element} el The root element where to perform the search from
  136. * @param {Element} node The query
  137. * @returns {Element} The found DOM element
  138. * @example
  139. * find('nav') => document.querySelector('nav')
  140. * find(nav, 'a') => nav.querySelector('a')
  141. */
  142. function find(el, node) {
  143. return node ? el.querySelector(node) : $.querySelector(el);
  144. }
  145. /**
  146. * Find all elements
  147. * @param {String|Element} el The root element where to perform the search from
  148. * @param {Element} node The query
  149. * @returns {Array<Element>} An array of DOM elements
  150. * @example
  151. * findAll('a') => [].slice.call(document.querySelectorAll('a'))
  152. * findAll(nav, 'a') => [].slice.call(nav.querySelectorAll('a'))
  153. */
  154. function findAll(el, node) {
  155. return [].slice.call(
  156. node ? el.querySelectorAll(node) : $.querySelectorAll(el)
  157. );
  158. }
  159. function create(node, tpl) {
  160. node = $.createElement(node);
  161. if (tpl) {
  162. node.innerHTML = tpl;
  163. }
  164. return node;
  165. }
  166. function appendTo(target, el) {
  167. return target.appendChild(el);
  168. }
  169. function before(target, el) {
  170. return target.insertBefore(el, target.children[0]);
  171. }
  172. function on(el, type, handler) {
  173. isFn(type)
  174. ? window.addEventListener(el, type)
  175. : el.addEventListener(type, handler);
  176. }
  177. function off(el, type, handler) {
  178. isFn(type)
  179. ? window.removeEventListener(el, type)
  180. : el.removeEventListener(type, handler);
  181. }
  182. /**
  183. * Toggle class
  184. * @param {String|Element} el The element that needs the class to be toggled
  185. * @param {Element} type The type of action to be performed on the classList (toggle by default)
  186. * @param {String} val Name of the class to be toggled
  187. * @void
  188. * @example
  189. * toggleClass(el, 'active') => el.classList.toggle('active')
  190. * toggleClass(el, 'add', 'active') => el.classList.add('active')
  191. */
  192. function toggleClass(el, type, val) {
  193. el && el.classList[val ? type : 'toggle'](val || type);
  194. }
  195. function style(content) {
  196. appendTo(head, create('style', content));
  197. }
  198. /**
  199. * Fork https://github.com/bendrucker/document-ready/blob/master/index.js
  200. * @param {Function} callback The callbacack to be called when the page is loaded
  201. * @returns {Number|void} If the page is already laoded returns the result of the setTimeout callback,
  202. * otherwise it only attaches the callback to the DOMContentLoaded event
  203. */
  204. function documentReady(callback, doc) {
  205. if ( doc === void 0 ) doc = document;
  206. var state = doc.readyState;
  207. if (state === 'complete' || state === 'interactive') {
  208. return setTimeout(callback, 0);
  209. }
  210. doc.addEventListener('DOMContentLoaded', callback);
  211. }
  212. var dom = /*#__PURE__*/Object.freeze({
  213. __proto__: null,
  214. getNode: getNode,
  215. $: $,
  216. body: body,
  217. head: head,
  218. find: find,
  219. findAll: findAll,
  220. create: create,
  221. appendTo: appendTo,
  222. before: before,
  223. on: on,
  224. off: off,
  225. toggleClass: toggleClass,
  226. style: style,
  227. documentReady: documentReady
  228. });
  229. function startsWith(str, prefix) {
  230. return str.indexOf(prefix) === 0;
  231. }
  232. function endsWith(str, suffix) {
  233. return str.indexOf(suffix, str.length - suffix.length) !== -1;
  234. }
  235. var decode = decodeURIComponent;
  236. var encode = encodeURIComponent;
  237. function parseQuery(query) {
  238. var res = {};
  239. query = query.trim().replace(/^(\?|#|&)/, '');
  240. if (!query) {
  241. return res;
  242. }
  243. // Simple parse
  244. query.split('&').forEach(function (param) {
  245. var parts = param.replace(/\+/g, ' ').split('=');
  246. res[parts[0]] = parts[1] && decode(parts[1]);
  247. });
  248. return res;
  249. }
  250. function stringifyQuery(obj, ignores) {
  251. if ( ignores === void 0 ) ignores = [];
  252. var qs = [];
  253. for (var key in obj) {
  254. if (ignores.indexOf(key) > -1) {
  255. continue;
  256. }
  257. qs.push(
  258. obj[key]
  259. ? ((encode(key)) + "=" + (encode(obj[key]))).toLowerCase()
  260. : encode(key)
  261. );
  262. }
  263. return qs.length ? ("?" + (qs.join('&'))) : '';
  264. }
  265. var isAbsolutePath = cached(function (path) {
  266. return /(:|(\/{2}))/g.test(path);
  267. });
  268. var removeParams = cached(function (path) {
  269. return path.split(/[?#]/)[0];
  270. });
  271. var getParentPath = cached(function (path) {
  272. if (/\/$/g.test(path)) {
  273. return path;
  274. }
  275. var matchingParts = path.match(/(\S*\/)[^/]+$/);
  276. return matchingParts ? matchingParts[1] : '';
  277. });
  278. var cleanPath = cached(function (path) {
  279. return path.replace(/^\/+/, '/').replace(/([^:])\/{2,}/g, '$1/');
  280. });
  281. var resolvePath = cached(function (path) {
  282. var segments = path.replace(/^\//, '').split('/');
  283. var resolved = [];
  284. for (var i = 0, len = segments.length; i < len; i++) {
  285. var segment = segments[i];
  286. if (segment === '..') {
  287. resolved.pop();
  288. } else if (segment !== '.') {
  289. resolved.push(segment);
  290. }
  291. }
  292. return '/' + resolved.join('/');
  293. });
  294. /**
  295. * Normalises the URI path to handle the case where Docsify is
  296. * hosted off explicit files, i.e. /index.html. This function
  297. * eliminates any path segments that contain `#` fragments.
  298. *
  299. * This is used to map browser URIs to markdown file sources.
  300. *
  301. * For example:
  302. *
  303. * http://example.org/base/index.html#/blah
  304. *
  305. * would be mapped to:
  306. *
  307. * http://example.org/base/blah.md.
  308. *
  309. * See here for more information:
  310. *
  311. * https://github.com/docsifyjs/docsify/pull/1372
  312. *
  313. * @param {string} path The URI path to normalise
  314. * @return {string} { path, query }
  315. */
  316. function normaliseFragment(path) {
  317. return path
  318. .split('/')
  319. .filter(function (p) { return p.indexOf('#') === -1; })
  320. .join('/');
  321. }
  322. function getPath() {
  323. var args = [], len = arguments.length;
  324. while ( len-- ) args[ len ] = arguments[ len ];
  325. return cleanPath(args.map(normaliseFragment).join('/'));
  326. }
  327. var replaceSlug = cached(function (path) {
  328. return path.replace('#', '?id=');
  329. });
  330. var cached$1 = {};
  331. function getAlias(path, alias, last) {
  332. var match = Object.keys(alias).filter(function (key) {
  333. var re = cached$1[key] || (cached$1[key] = new RegExp(("^" + key + "$")));
  334. return re.test(path) && path !== last;
  335. })[0];
  336. return match
  337. ? getAlias(path.replace(cached$1[match], alias[match]), alias, path)
  338. : path;
  339. }
  340. function getFileName(path, ext) {
  341. return new RegExp(("\\.(" + (ext.replace(/^\./, '')) + "|html)$"), 'g').test(path)
  342. ? path
  343. : /\/$/g.test(path)
  344. ? (path + "README" + ext)
  345. : ("" + path + ext);
  346. }
  347. var History = function History(config) {
  348. this.config = config;
  349. };
  350. History.prototype.getBasePath = function getBasePath () {
  351. return this.config.basePath;
  352. };
  353. History.prototype.getFile = function getFile (path, isRelative) {
  354. if ( path === void 0 ) path = this.getCurrentPath();
  355. var ref = this;
  356. var config = ref.config;
  357. var base = this.getBasePath();
  358. var ext = typeof config.ext === 'string' ? config.ext : '.md';
  359. path = config.alias ? getAlias(path, config.alias) : path;
  360. path = getFileName(path, ext);
  361. path = path === ("/README" + ext) ? config.homepage || path : path;
  362. path = isAbsolutePath(path) ? path : getPath(base, path);
  363. if (isRelative) {
  364. path = path.replace(new RegExp(("^" + base)), '');
  365. }
  366. return path;
  367. };
  368. History.prototype.onchange = function onchange (cb) {
  369. if ( cb === void 0 ) cb = noop;
  370. cb();
  371. };
  372. History.prototype.getCurrentPath = function getCurrentPath () {};
  373. History.prototype.normalize = function normalize () {};
  374. History.prototype.parse = function parse () {};
  375. History.prototype.toURL = function toURL (path, params, currentRoute) {
  376. var local = currentRoute && path[0] === '#';
  377. var route = this.parse(replaceSlug(path));
  378. route.query = merge({}, route.query, params);
  379. path = route.path + stringifyQuery(route.query);
  380. path = path.replace(/\.md(\?)|\.md$/, '$1');
  381. if (local) {
  382. var idIndex = currentRoute.indexOf('?');
  383. path =
  384. (idIndex > 0 ? currentRoute.substring(0, idIndex) : currentRoute) +
  385. path;
  386. }
  387. if (this.config.relativePath && path.indexOf('/') !== 0) {
  388. var currentDir = currentRoute.substring(
  389. 0,
  390. currentRoute.lastIndexOf('/') + 1
  391. );
  392. return cleanPath(resolvePath(currentDir + path));
  393. }
  394. return cleanPath('/' + path);
  395. };
  396. function replaceHash(path) {
  397. var i = location.href.indexOf('#');
  398. location.replace(location.href.slice(0, i >= 0 ? i : 0) + '#' + path);
  399. }
  400. var HashHistory = /*@__PURE__*/(function (History) {
  401. function HashHistory(config) {
  402. History.call(this, config);
  403. this.mode = 'hash';
  404. }
  405. if ( History ) HashHistory.__proto__ = History;
  406. HashHistory.prototype = Object.create( History && History.prototype );
  407. HashHistory.prototype.constructor = HashHistory;
  408. HashHistory.prototype.getBasePath = function getBasePath () {
  409. var path = window.location.pathname || '';
  410. var base = this.config.basePath;
  411. // This handles the case where Docsify is served off an
  412. // explicit file path, i.e.`/base/index.html#/blah`. This
  413. // prevents the `/index.html` part of the URI from being
  414. // remove during routing.
  415. // See here: https://github.com/docsifyjs/docsify/pull/1372
  416. var basePath = endsWith(path, '.html')
  417. ? path + '#/' + base
  418. : path + '/' + base;
  419. return /^(\/|https?:)/g.test(base) ? base : cleanPath(basePath);
  420. };
  421. HashHistory.prototype.getCurrentPath = function getCurrentPath () {
  422. // We can't use location.hash here because it's not
  423. // consistent across browsers - Firefox will pre-decode it!
  424. var href = location.href;
  425. var index = href.indexOf('#');
  426. return index === -1 ? '' : href.slice(index + 1);
  427. };
  428. /** @param {((params: {source: TODO}) => void)} [cb] */
  429. HashHistory.prototype.onchange = function onchange (cb) {
  430. if ( cb === void 0 ) cb = noop;
  431. // The hashchange event does not tell us if it originated from
  432. // a clicked link or by moving back/forward in the history;
  433. // therefore we set a `navigating` flag when a link is clicked
  434. // to be able to tell these two scenarios apart
  435. var navigating = false;
  436. on('click', function (e) {
  437. var el = e.target.tagName === 'A' ? e.target : e.target.parentNode;
  438. if (el && el.tagName === 'A' && !isExternal(el.href)) {
  439. navigating = true;
  440. }
  441. });
  442. on('hashchange', function (e) {
  443. var source = navigating ? 'navigate' : 'history';
  444. navigating = false;
  445. cb({ event: e, source: source });
  446. });
  447. };
  448. HashHistory.prototype.normalize = function normalize () {
  449. var path = this.getCurrentPath();
  450. path = replaceSlug(path);
  451. if (path.charAt(0) === '/') {
  452. return replaceHash(path);
  453. }
  454. replaceHash('/' + path);
  455. };
  456. /**
  457. * Parse the url
  458. * @param {string} [path=location.herf] URL to be parsed
  459. * @return {object} { path, query }
  460. */
  461. HashHistory.prototype.parse = function parse (path) {
  462. if ( path === void 0 ) path = location.href;
  463. var query = '';
  464. var hashIndex = path.indexOf('#');
  465. if (hashIndex >= 0) {
  466. path = path.slice(hashIndex + 1);
  467. }
  468. var queryIndex = path.indexOf('?');
  469. if (queryIndex >= 0) {
  470. query = path.slice(queryIndex + 1);
  471. path = path.slice(0, queryIndex);
  472. }
  473. return {
  474. path: path,
  475. file: this.getFile(path, true),
  476. query: parseQuery(query),
  477. };
  478. };
  479. HashHistory.prototype.toURL = function toURL (path, params, currentRoute) {
  480. return '#' + History.prototype.toURL.call(this, path, params, currentRoute);
  481. };
  482. return HashHistory;
  483. }(History));
  484. /** @typedef {any} TODO */
  485. var HTML5History = /*@__PURE__*/(function (History) {
  486. function HTML5History(config) {
  487. History.call(this, config);
  488. this.mode = 'history';
  489. }
  490. if ( History ) HTML5History.__proto__ = History;
  491. HTML5History.prototype = Object.create( History && History.prototype );
  492. HTML5History.prototype.constructor = HTML5History;
  493. HTML5History.prototype.getCurrentPath = function getCurrentPath () {
  494. var base = this.getBasePath();
  495. var path = window.location.pathname;
  496. if (base && path.indexOf(base) === 0) {
  497. path = path.slice(base.length);
  498. }
  499. return (path || '/') + window.location.search + window.location.hash;
  500. };
  501. HTML5History.prototype.onchange = function onchange (cb) {
  502. if ( cb === void 0 ) cb = noop;
  503. on('click', function (e) {
  504. var el = e.target.tagName === 'A' ? e.target : e.target.parentNode;
  505. if (el && el.tagName === 'A' && !isExternal(el.href)) {
  506. e.preventDefault();
  507. var url = el.href;
  508. window.history.pushState({ key: url }, '', url);
  509. cb({ event: e, source: 'navigate' });
  510. }
  511. });
  512. on('popstate', function (e) {
  513. cb({ event: e, source: 'history' });
  514. });
  515. };
  516. /**
  517. * Parse the url
  518. * @param {string} [path=location.href] URL to be parsed
  519. * @return {object} { path, query }
  520. */
  521. HTML5History.prototype.parse = function parse (path) {
  522. if ( path === void 0 ) path = location.href;
  523. var query = '';
  524. var queryIndex = path.indexOf('?');
  525. if (queryIndex >= 0) {
  526. query = path.slice(queryIndex + 1);
  527. path = path.slice(0, queryIndex);
  528. }
  529. var base = getPath(location.origin);
  530. var baseIndex = path.indexOf(base);
  531. if (baseIndex > -1) {
  532. path = path.slice(baseIndex + base.length);
  533. }
  534. return {
  535. path: path,
  536. file: this.getFile(path),
  537. query: parseQuery(query),
  538. };
  539. };
  540. return HTML5History;
  541. }(History));
  542. /**
  543. * @typedef {{
  544. * path?: string
  545. * }} Route
  546. */
  547. /** @type {Route} */
  548. var lastRoute = {};
  549. /** @typedef {import('../Docsify').Constructor} Constructor */
  550. /**
  551. * @template {!Constructor} T
  552. * @param {T} Base - The class to extend
  553. */
  554. function Router(Base) {
  555. return /*@__PURE__*/(function (Base) {
  556. function Router() {
  557. var args = [], len = arguments.length;
  558. while ( len-- ) args[ len ] = arguments[ len ];
  559. Base.apply(this, args);
  560. this.route = {};
  561. }
  562. if ( Base ) Router.__proto__ = Base;
  563. Router.prototype = Object.create( Base && Base.prototype );
  564. Router.prototype.constructor = Router;
  565. Router.prototype.updateRender = function updateRender () {
  566. this.router.normalize();
  567. this.route = this.router.parse();
  568. body.setAttribute('data-page', this.route.file);
  569. };
  570. Router.prototype.initRouter = function initRouter () {
  571. var this$1 = this;
  572. var config = this.config;
  573. var mode = config.routerMode || 'hash';
  574. var router;
  575. if (mode === 'history' && supportsPushState) {
  576. router = new HTML5History(config);
  577. } else {
  578. router = new HashHistory(config);
  579. }
  580. this.router = router;
  581. this.updateRender();
  582. lastRoute = this.route;
  583. // eslint-disable-next-line no-unused-vars
  584. router.onchange(function (params) {
  585. this$1.updateRender();
  586. this$1._updateRender();
  587. if (lastRoute.path === this$1.route.path) {
  588. this$1.$resetEvents(params.source);
  589. return;
  590. }
  591. this$1.$fetch(noop, this$1.$resetEvents.bind(this$1, params.source));
  592. lastRoute = this$1.route;
  593. });
  594. };
  595. return Router;
  596. }(Base));
  597. }
  598. var RGX = /([^{]*?)\w(?=\})/g;
  599. var MAP = {
  600. YYYY: 'getFullYear',
  601. YY: 'getYear',
  602. MM: function (d) {
  603. return d.getMonth() + 1;
  604. },
  605. DD: 'getDate',
  606. HH: 'getHours',
  607. mm: 'getMinutes',
  608. ss: 'getSeconds',
  609. fff: 'getMilliseconds'
  610. };
  611. function tinydate (str, custom) {
  612. var parts=[], offset=0;
  613. str.replace(RGX, function (key, _, idx) {
  614. // save preceding string
  615. parts.push(str.substring(offset, idx - 1));
  616. offset = idx += key.length + 1;
  617. // save function
  618. parts.push(custom && custom[key] || function (d) {
  619. return ('00' + (typeof MAP[key] === 'string' ? d[MAP[key]]() : MAP[key](d))).slice(-key.length);
  620. });
  621. });
  622. if (offset !== str.length) {
  623. parts.push(str.substring(offset));
  624. }
  625. return function (arg) {
  626. var out='', i=0, d=arg||new Date();
  627. for (; i<parts.length; i++) {
  628. out += (typeof parts[i]==='string') ? parts[i] : parts[i](d);
  629. }
  630. return out;
  631. };
  632. }
  633. var barEl;
  634. var timeId;
  635. /**
  636. * Init progress component
  637. */
  638. function init() {
  639. var div = create('div');
  640. div.classList.add('progress');
  641. appendTo(body, div);
  642. barEl = div;
  643. }
  644. /**
  645. * Render progress bar
  646. */
  647. function progressbar (ref) {
  648. var loaded = ref.loaded;
  649. var total = ref.total;
  650. var step = ref.step;
  651. var num;
  652. !barEl && init();
  653. if (step) {
  654. num = parseInt(barEl.style.width || 0, 10) + step;
  655. num = num > 80 ? 80 : num;
  656. } else {
  657. num = Math.floor((loaded / total) * 100);
  658. }
  659. barEl.style.opacity = 1;
  660. barEl.style.width = num >= 95 ? '100%' : num + '%';
  661. if (num >= 95) {
  662. clearTimeout(timeId);
  663. // eslint-disable-next-line no-unused-vars
  664. timeId = setTimeout(function (_) {
  665. barEl.style.opacity = 0;
  666. barEl.style.width = '0%';
  667. }, 200);
  668. }
  669. }
  670. /* eslint-disable no-unused-vars */
  671. var cache = {};
  672. /**
  673. * Ajax GET implmentation
  674. * @param {string} url Resource URL
  675. * @param {boolean} [hasBar=false] Has progress bar
  676. * @param {String[]} headers Array of headers
  677. * @return {Promise} Promise response
  678. */
  679. function get(url, hasBar, headers) {
  680. if ( hasBar === void 0 ) hasBar = false;
  681. if ( headers === void 0 ) headers = {};
  682. var xhr = new XMLHttpRequest();
  683. var on = function () {
  684. xhr.addEventListener.apply(xhr, arguments);
  685. };
  686. var cached = cache[url];
  687. if (cached) {
  688. return { then: function (cb) { return cb(cached.content, cached.opt); }, abort: noop };
  689. }
  690. xhr.open('GET', url);
  691. for (var i in headers) {
  692. if (hasOwn.call(headers, i)) {
  693. xhr.setRequestHeader(i, headers[i]);
  694. }
  695. }
  696. xhr.send();
  697. return {
  698. then: function (success, error) {
  699. if ( error === void 0 ) error = noop;
  700. if (hasBar) {
  701. var id = setInterval(
  702. function (_) { return progressbar({
  703. step: Math.floor(Math.random() * 5 + 1),
  704. }); },
  705. 500
  706. );
  707. on('progress', progressbar);
  708. on('loadend', function (evt) {
  709. progressbar(evt);
  710. clearInterval(id);
  711. });
  712. }
  713. on('error', error);
  714. on('load', function (ref) {
  715. var target = ref.target;
  716. if (target.status >= 400) {
  717. error(target);
  718. } else {
  719. var result = (cache[url] = {
  720. content: target.response,
  721. opt: {
  722. updatedAt: xhr.getResponseHeader('last-modified'),
  723. },
  724. });
  725. success(result.content, result.opt);
  726. }
  727. });
  728. },
  729. abort: function (_) { return xhr.readyState !== 4 && xhr.abort(); },
  730. };
  731. }
  732. function replaceVar(block, color) {
  733. block.innerHTML = block.innerHTML.replace(
  734. /var\(\s*--theme-color.*?\)/g,
  735. color
  736. );
  737. }
  738. function cssVars (color) {
  739. // Variable support
  740. if (window.CSS && window.CSS.supports && window.CSS.supports('(--v:red)')) {
  741. return;
  742. }
  743. var styleBlocks = findAll('style:not(.inserted),link');
  744. [].forEach.call(styleBlocks, function (block) {
  745. if (block.nodeName === 'STYLE') {
  746. replaceVar(block, color);
  747. } else if (block.nodeName === 'LINK') {
  748. var href = block.getAttribute('href');
  749. if (!/\.css$/.test(href)) {
  750. return;
  751. }
  752. get(href).then(function (res) {
  753. var style = create('style', res);
  754. head.appendChild(style);
  755. replaceVar(style, color);
  756. });
  757. }
  758. });
  759. }
  760. /* eslint-disable no-unused-vars */
  761. var title = $.title;
  762. /**
  763. * Toggle button
  764. * @param {Element} el Button to be toggled
  765. * @void
  766. */
  767. function btn(el) {
  768. var toggle = function (_) { return body.classList.toggle('close'); };
  769. el = getNode(el);
  770. if (el === null || el === undefined) {
  771. return;
  772. }
  773. on(el, 'click', function (e) {
  774. e.stopPropagation();
  775. toggle();
  776. });
  777. isMobile &&
  778. on(
  779. body,
  780. 'click',
  781. function (_) { return body.classList.contains('close') && toggle(); }
  782. );
  783. }
  784. function collapse(el) {
  785. el = getNode(el);
  786. if (el === null || el === undefined) {
  787. return;
  788. }
  789. on(el, 'click', function (ref) {
  790. var target = ref.target;
  791. if (
  792. target.nodeName === 'A' &&
  793. target.nextSibling &&
  794. target.nextSibling.classList &&
  795. target.nextSibling.classList.contains('app-sub-sidebar')
  796. ) {
  797. toggleClass(target.parentNode, 'collapse');
  798. }
  799. });
  800. }
  801. function sticky() {
  802. var cover = getNode('section.cover');
  803. if (!cover) {
  804. return;
  805. }
  806. var coverHeight = cover.getBoundingClientRect().height;
  807. if (window.pageYOffset >= coverHeight || cover.classList.contains('hidden')) {
  808. toggleClass(body, 'add', 'sticky');
  809. } else {
  810. toggleClass(body, 'remove', 'sticky');
  811. }
  812. }
  813. /**
  814. * Get and active link
  815. * @param {Object} router Router
  816. * @param {String|Element} el Target element
  817. * @param {Boolean} isParent Active parent
  818. * @param {Boolean} autoTitle Automatically set title
  819. * @return {Element} Active element
  820. */
  821. function getAndActive(router, el, isParent, autoTitle) {
  822. el = getNode(el);
  823. var links = [];
  824. if (el !== null && el !== undefined) {
  825. links = findAll(el, 'a');
  826. }
  827. var hash = decodeURI(router.toURL(router.getCurrentPath()));
  828. var target;
  829. links
  830. .sort(function (a, b) { return b.href.length - a.href.length; })
  831. .forEach(function (a) {
  832. var href = decodeURI(a.getAttribute('href'));
  833. var node = isParent ? a.parentNode : a;
  834. a.title = a.title || a.innerText;
  835. if (hash.indexOf(href) === 0 && !target) {
  836. target = a;
  837. toggleClass(node, 'add', 'active');
  838. } else {
  839. toggleClass(node, 'remove', 'active');
  840. }
  841. });
  842. if (autoTitle) {
  843. $.title = target
  844. ? target.title || ((target.innerText) + " - " + title)
  845. : title;
  846. }
  847. return target;
  848. }
  849. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true; } Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps); } if (staticProps) { defineProperties(Constructor, staticProps); } return Constructor; }; }();
  850. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  851. var SingleTweener = function () {
  852. function SingleTweener() {
  853. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  854. _classCallCheck(this, SingleTweener);
  855. this.start = opts.start;
  856. this.end = opts.end;
  857. this.decimal = opts.decimal;
  858. }
  859. _createClass(SingleTweener, [{
  860. key: "getIntermediateValue",
  861. value: function getIntermediateValue(tick) {
  862. if (this.decimal) {
  863. return tick;
  864. } else {
  865. return Math.round(tick);
  866. }
  867. }
  868. }, {
  869. key: "getFinalValue",
  870. value: function getFinalValue() {
  871. return this.end;
  872. }
  873. }]);
  874. return SingleTweener;
  875. }();
  876. var _createClass$1 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true; } Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps); } if (staticProps) { defineProperties(Constructor, staticProps); } return Constructor; }; }();
  877. function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  878. var Tweezer = function () {
  879. function Tweezer() {
  880. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  881. _classCallCheck$1(this, Tweezer);
  882. this.duration = opts.duration || 1000;
  883. this.ease = opts.easing || this._defaultEase;
  884. this.tweener = opts.tweener || new SingleTweener(opts);
  885. this.start = this.tweener.start;
  886. this.end = this.tweener.end;
  887. this.frame = null;
  888. this.next = null;
  889. this.isRunning = false;
  890. this.events = {};
  891. this.direction = this.start < this.end ? 'up' : 'down';
  892. }
  893. _createClass$1(Tweezer, [{
  894. key: 'begin',
  895. value: function begin() {
  896. if (!this.isRunning && this.next !== this.end) {
  897. this.frame = window.requestAnimationFrame(this._tick.bind(this));
  898. }
  899. return this;
  900. }
  901. }, {
  902. key: 'stop',
  903. value: function stop() {
  904. window.cancelAnimationFrame(this.frame);
  905. this.isRunning = false;
  906. this.frame = null;
  907. this.timeStart = null;
  908. this.next = null;
  909. return this;
  910. }
  911. }, {
  912. key: 'on',
  913. value: function on(name, handler) {
  914. this.events[name] = this.events[name] || [];
  915. this.events[name].push(handler);
  916. return this;
  917. }
  918. }, {
  919. key: '_emit',
  920. value: function _emit(name, val) {
  921. var _this = this;
  922. var e = this.events[name];
  923. e && e.forEach(function (handler) {
  924. return handler.call(_this, val);
  925. });
  926. }
  927. }, {
  928. key: '_tick',
  929. value: function _tick(currentTime) {
  930. this.isRunning = true;
  931. var lastTick = this.next || this.start;
  932. if (!this.timeStart) { this.timeStart = currentTime; }
  933. this.timeElapsed = currentTime - this.timeStart;
  934. this.next = this.ease(this.timeElapsed, this.start, this.end - this.start, this.duration);
  935. if (this._shouldTick(lastTick)) {
  936. this._emit('tick', this.tweener.getIntermediateValue(this.next));
  937. this.frame = window.requestAnimationFrame(this._tick.bind(this));
  938. } else {
  939. this._emit('tick', this.tweener.getFinalValue());
  940. this._emit('done', null);
  941. }
  942. }
  943. }, {
  944. key: '_shouldTick',
  945. value: function _shouldTick(lastTick) {
  946. return {
  947. up: this.next < this.end && lastTick <= this.next,
  948. down: this.next > this.end && lastTick >= this.next
  949. }[this.direction];
  950. }
  951. }, {
  952. key: '_defaultEase',
  953. value: function _defaultEase(t, b, c, d) {
  954. if ((t /= d / 2) < 1) { return c / 2 * t * t + b; }
  955. return -c / 2 * (--t * (t - 2) - 1) + b;
  956. }
  957. }]);
  958. return Tweezer;
  959. }();
  960. var currentScript = document.currentScript;
  961. /** @param {import('./Docsify').Docsify} vm */
  962. function config (vm) {
  963. var config = merge(
  964. {
  965. auto2top: false,
  966. autoHeader: false,
  967. basePath: '',
  968. catchPluginErrors: true,
  969. cornerExternalLinkTarget: '_blank',
  970. coverpage: '',
  971. el: '#app',
  972. executeScript: null,
  973. ext: '.md',
  974. externalLinkRel: 'noopener',
  975. externalLinkTarget: '_blank',
  976. formatUpdated: '',
  977. ga: '',
  978. homepage: 'README.md',
  979. loadNavbar: null,
  980. loadSidebar: null,
  981. maxLevel: 6,
  982. mergeNavbar: false,
  983. name: '',
  984. nameLink: window.location.pathname,
  985. nativeEmoji: false,
  986. noCompileLinks: [],
  987. noEmoji: false,
  988. notFoundPage: true,
  989. relativePath: false,
  990. repo: '',
  991. routes: {},
  992. routerMode: 'hash',
  993. subMaxLevel: 0,
  994. themeColor: '',
  995. topMargin: 0,
  996. },
  997. typeof window.$docsify === 'function'
  998. ? window.$docsify(vm)
  999. : window.$docsify
  1000. );
  1001. var script =
  1002. currentScript ||
  1003. [].slice
  1004. .call(document.getElementsByTagName('script'))
  1005. .filter(function (n) { return /docsify\./.test(n.src); })[0];
  1006. if (script) {
  1007. for (var prop in config) {
  1008. if (hasOwn.call(config, prop)) {
  1009. var val = script.getAttribute('data-' + hyphenate(prop));
  1010. if (isPrimitive(val)) {
  1011. config[prop] = val === '' ? true : val;
  1012. }
  1013. }
  1014. }
  1015. }
  1016. if (config.loadSidebar === true) {
  1017. config.loadSidebar = '_sidebar' + config.ext;
  1018. }
  1019. if (config.loadNavbar === true) {
  1020. config.loadNavbar = '_navbar' + config.ext;
  1021. }
  1022. if (config.coverpage === true) {
  1023. config.coverpage = '_coverpage' + config.ext;
  1024. }
  1025. if (config.repo === true) {
  1026. config.repo = '';
  1027. }
  1028. if (config.name === true) {
  1029. config.name = '';
  1030. }
  1031. window.$docsify = config;
  1032. return config;
  1033. }
  1034. var nav = {};
  1035. var hoverOver = false;
  1036. var scroller = null;
  1037. var enableScrollEvent = true;
  1038. var coverHeight = 0;
  1039. function scrollTo(el, offset) {
  1040. if ( offset === void 0 ) offset = 0;
  1041. if (scroller) {
  1042. scroller.stop();
  1043. }
  1044. enableScrollEvent = false;
  1045. scroller = new Tweezer({
  1046. start: window.pageYOffset,
  1047. end:
  1048. Math.round(el.getBoundingClientRect().top) + window.pageYOffset - offset,
  1049. duration: 500,
  1050. })
  1051. .on('tick', function (v) { return window.scrollTo(0, v); })
  1052. .on('done', function () {
  1053. enableScrollEvent = true;
  1054. scroller = null;
  1055. })
  1056. .begin();
  1057. }
  1058. function highlight(path) {
  1059. if (!enableScrollEvent) {
  1060. return;
  1061. }
  1062. var sidebar = getNode('.sidebar');
  1063. var anchors = findAll('.anchor');
  1064. var wrap = find(sidebar, '.sidebar-nav');
  1065. var active = find(sidebar, 'li.active');
  1066. var doc = document.documentElement;
  1067. var top = ((doc && doc.scrollTop) || document.body.scrollTop) - coverHeight;
  1068. var last;
  1069. for (var i = 0, len = anchors.length; i < len; i += 1) {
  1070. var node = anchors[i];
  1071. if (node.offsetTop > top) {
  1072. if (!last) {
  1073. last = node;
  1074. }
  1075. break;
  1076. } else {
  1077. last = node;
  1078. }
  1079. }
  1080. if (!last) {
  1081. return;
  1082. }
  1083. var li = nav[getNavKey(path, last.getAttribute('data-id'))];
  1084. if (!li || li === active) {
  1085. return;
  1086. }
  1087. active && active.classList.remove('active');
  1088. li.classList.add('active');
  1089. active = li;
  1090. // Scroll into view
  1091. // https://github.com/vuejs/vuejs.org/blob/master/themes/vue/source/js/common.js#L282-L297
  1092. if (!hoverOver && body.classList.contains('sticky')) {
  1093. var height = sidebar.clientHeight;
  1094. var curOffset = 0;
  1095. var cur = active.offsetTop + active.clientHeight + 40;
  1096. var isInView =
  1097. active.offsetTop >= wrap.scrollTop && cur <= wrap.scrollTop + height;
  1098. var notThan = cur - curOffset < height;
  1099. sidebar.scrollTop = isInView
  1100. ? wrap.scrollTop
  1101. : notThan
  1102. ? curOffset
  1103. : cur - height;
  1104. }
  1105. }
  1106. function getNavKey(path, id) {
  1107. return ((decodeURIComponent(path)) + "?id=" + (decodeURIComponent(id)));
  1108. }
  1109. function scrollActiveSidebar(router) {
  1110. var cover = find('.cover.show');
  1111. coverHeight = cover ? cover.offsetHeight : 0;
  1112. var sidebar = getNode('.sidebar');
  1113. var lis = [];
  1114. if (sidebar !== null && sidebar !== undefined) {
  1115. lis = findAll(sidebar, 'li');
  1116. }
  1117. for (var i = 0, len = lis.length; i < len; i += 1) {
  1118. var li = lis[i];
  1119. var a = li.querySelector('a');
  1120. if (!a) {
  1121. continue;
  1122. }
  1123. var href = a.getAttribute('href');
  1124. if (href !== '/') {
  1125. var ref = router.parse(href);
  1126. var id = ref.query.id;
  1127. var path$1 = ref.path;
  1128. if (id) {
  1129. href = getNavKey(path$1, id);
  1130. }
  1131. }
  1132. if (href) {
  1133. nav[decodeURIComponent(href)] = li;
  1134. }
  1135. }
  1136. if (isMobile) {
  1137. return;
  1138. }
  1139. var path = removeParams(router.getCurrentPath());
  1140. off('scroll', function () { return highlight(path); });
  1141. on('scroll', function () { return highlight(path); });
  1142. on(sidebar, 'mouseover', function () {
  1143. hoverOver = true;
  1144. });
  1145. on(sidebar, 'mouseleave', function () {
  1146. hoverOver = false;
  1147. });
  1148. }
  1149. function scrollIntoView(path, id) {
  1150. if (!id) {
  1151. return;
  1152. }
  1153. var topMargin = config().topMargin;
  1154. var section = find('#' + id);
  1155. section && scrollTo(section, topMargin);
  1156. var li = nav[getNavKey(path, id)];
  1157. var sidebar = getNode('.sidebar');
  1158. var active = find(sidebar, 'li.active');
  1159. active && active.classList.remove('active');
  1160. li && li.classList.add('active');
  1161. }
  1162. var scrollEl = $.scrollingElement || $.documentElement;
  1163. function scroll2Top(offset) {
  1164. if ( offset === void 0 ) offset = 0;
  1165. scrollEl.scrollTop = offset === true ? 0 : Number(offset);
  1166. }
  1167. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  1168. function createCommonjsModule(fn, module) {
  1169. return module = { exports: {} }, fn(module, module.exports), module.exports;
  1170. }
  1171. var defaults = createCommonjsModule(function (module) {
  1172. function getDefaults() {
  1173. return {
  1174. baseUrl: null,
  1175. breaks: false,
  1176. gfm: true,
  1177. headerIds: true,
  1178. headerPrefix: '',
  1179. highlight: null,
  1180. langPrefix: 'language-',
  1181. mangle: true,
  1182. pedantic: false,
  1183. renderer: null,
  1184. sanitize: false,
  1185. sanitizer: null,
  1186. silent: false,
  1187. smartLists: false,
  1188. smartypants: false,
  1189. tokenizer: null,
  1190. walkTokens: null,
  1191. xhtml: false
  1192. };
  1193. }
  1194. function changeDefaults(newDefaults) {
  1195. module.exports.defaults = newDefaults;
  1196. }
  1197. module.exports = {
  1198. defaults: getDefaults(),
  1199. getDefaults: getDefaults,
  1200. changeDefaults: changeDefaults
  1201. };
  1202. });
  1203. var defaults_1 = defaults.defaults;
  1204. var defaults_2 = defaults.getDefaults;
  1205. var defaults_3 = defaults.changeDefaults;
  1206. /**
  1207. * Helpers
  1208. */
  1209. var escapeTest = /[&<>"']/;
  1210. var escapeReplace = /[&<>"']/g;
  1211. var escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/;
  1212. var escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g;
  1213. var escapeReplacements = {
  1214. '&': '&amp;',
  1215. '<': '&lt;',
  1216. '>': '&gt;',
  1217. '"': '&quot;',
  1218. "'": '&#39;'
  1219. };
  1220. var getEscapeReplacement = function (ch) { return escapeReplacements[ch]; };
  1221. function escape(html, encode) {
  1222. if (encode) {
  1223. if (escapeTest.test(html)) {
  1224. return html.replace(escapeReplace, getEscapeReplacement);
  1225. }
  1226. } else {
  1227. if (escapeTestNoEncode.test(html)) {
  1228. return html.replace(escapeReplaceNoEncode, getEscapeReplacement);
  1229. }
  1230. }
  1231. return html;
  1232. }
  1233. var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
  1234. function unescape(html) {
  1235. // explicitly match decimal, hex, and named HTML entities
  1236. return html.replace(unescapeTest, function (_, n) {
  1237. n = n.toLowerCase();
  1238. if (n === 'colon') { return ':'; }
  1239. if (n.charAt(0) === '#') {
  1240. return n.charAt(1) === 'x'
  1241. ? String.fromCharCode(parseInt(n.substring(2), 16))
  1242. : String.fromCharCode(+n.substring(1));
  1243. }
  1244. return '';
  1245. });
  1246. }
  1247. var caret = /(^|[^\[])\^/g;
  1248. function edit(regex, opt) {
  1249. regex = regex.source || regex;
  1250. opt = opt || '';
  1251. var obj = {
  1252. replace: function (name, val) {
  1253. val = val.source || val;
  1254. val = val.replace(caret, '$1');
  1255. regex = regex.replace(name, val);
  1256. return obj;
  1257. },
  1258. getRegex: function () {
  1259. return new RegExp(regex, opt);
  1260. }
  1261. };
  1262. return obj;
  1263. }
  1264. var nonWordAndColonTest = /[^\w:]/g;
  1265. var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
  1266. function cleanUrl(sanitize, base, href) {
  1267. if (sanitize) {
  1268. var prot;
  1269. try {
  1270. prot = decodeURIComponent(unescape(href))
  1271. .replace(nonWordAndColonTest, '')
  1272. .toLowerCase();
  1273. } catch (e) {
  1274. return null;
  1275. }
  1276. if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) {
  1277. return null;
  1278. }
  1279. }
  1280. if (base && !originIndependentUrl.test(href)) {
  1281. href = resolveUrl(base, href);
  1282. }
  1283. try {
  1284. href = encodeURI(href).replace(/%25/g, '%');
  1285. } catch (e) {
  1286. return null;
  1287. }
  1288. return href;
  1289. }
  1290. var baseUrls = {};
  1291. var justDomain = /^[^:]+:\/*[^/]*$/;
  1292. var protocol = /^([^:]+:)[\s\S]*$/;
  1293. var domain = /^([^:]+:\/*[^/]*)[\s\S]*$/;
  1294. function resolveUrl(base, href) {
  1295. if (!baseUrls[' ' + base]) {
  1296. // we can ignore everything in base after the last slash of its path component,
  1297. // but we might need to add _that_
  1298. // https://tools.ietf.org/html/rfc3986#section-3
  1299. if (justDomain.test(base)) {
  1300. baseUrls[' ' + base] = base + '/';
  1301. } else {
  1302. baseUrls[' ' + base] = rtrim(base, '/', true);
  1303. }
  1304. }
  1305. base = baseUrls[' ' + base];
  1306. var relativeBase = base.indexOf(':') === -1;
  1307. if (href.substring(0, 2) === '//') {
  1308. if (relativeBase) {
  1309. return href;
  1310. }
  1311. return base.replace(protocol, '$1') + href;
  1312. } else if (href.charAt(0) === '/') {
  1313. if (relativeBase) {
  1314. return href;
  1315. }
  1316. return base.replace(domain, '$1') + href;
  1317. } else {
  1318. return base + href;
  1319. }
  1320. }
  1321. var noopTest = { exec: function noopTest() {} };
  1322. function merge$1(obj) {
  1323. var arguments$1 = arguments;
  1324. var i = 1,
  1325. target,
  1326. key;
  1327. for (; i < arguments.length; i++) {
  1328. target = arguments$1[i];
  1329. for (key in target) {
  1330. if (Object.prototype.hasOwnProperty.call(target, key)) {
  1331. obj[key] = target[key];
  1332. }
  1333. }
  1334. }
  1335. return obj;
  1336. }
  1337. function splitCells(tableRow, count) {
  1338. // ensure that every cell-delimiting pipe has a space
  1339. // before it to distinguish it from an escaped pipe
  1340. var row = tableRow.replace(/\|/g, function (match, offset, str) {
  1341. var escaped = false,
  1342. curr = offset;
  1343. while (--curr >= 0 && str[curr] === '\\') { escaped = !escaped; }
  1344. if (escaped) {
  1345. // odd number of slashes means | is escaped
  1346. // so we leave it alone
  1347. return '|';
  1348. } else {
  1349. // add space before unescaped |
  1350. return ' |';
  1351. }
  1352. }),
  1353. cells = row.split(/ \|/);
  1354. var i = 0;
  1355. if (cells.length > count) {
  1356. cells.splice(count);
  1357. } else {
  1358. while (cells.length < count) { cells.push(''); }
  1359. }
  1360. for (; i < cells.length; i++) {
  1361. // leading or trailing whitespace is ignored per the gfm spec
  1362. cells[i] = cells[i].trim().replace(/\\\|/g, '|');
  1363. }
  1364. return cells;
  1365. }
  1366. // Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').
  1367. // /c*$/ is vulnerable to REDOS.
  1368. // invert: Remove suffix of non-c chars instead. Default falsey.
  1369. function rtrim(str, c, invert) {
  1370. var l = str.length;
  1371. if (l === 0) {
  1372. return '';
  1373. }
  1374. // Length of suffix matching the invert condition.
  1375. var suffLen = 0;
  1376. // Step left until we fail to match the invert condition.
  1377. while (suffLen < l) {
  1378. var currChar = str.charAt(l - suffLen - 1);
  1379. if (currChar === c && !invert) {
  1380. suffLen++;
  1381. } else if (currChar !== c && invert) {
  1382. suffLen++;
  1383. } else {
  1384. break;
  1385. }
  1386. }
  1387. return str.substr(0, l - suffLen);
  1388. }
  1389. function findClosingBracket(str, b) {
  1390. if (str.indexOf(b[1]) === -1) {
  1391. return -1;
  1392. }
  1393. var l = str.length;
  1394. var level = 0,
  1395. i = 0;
  1396. for (; i < l; i++) {
  1397. if (str[i] === '\\') {
  1398. i++;
  1399. } else if (str[i] === b[0]) {
  1400. level++;
  1401. } else if (str[i] === b[1]) {
  1402. level--;
  1403. if (level < 0) {
  1404. return i;
  1405. }
  1406. }
  1407. }
  1408. return -1;
  1409. }
  1410. function checkSanitizeDeprecation(opt) {
  1411. if (opt && opt.sanitize && !opt.silent) {
  1412. console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');
  1413. }
  1414. }
  1415. // copied from https://stackoverflow.com/a/5450113/806777
  1416. function repeatString(pattern, count) {
  1417. if (count < 1) {
  1418. return '';
  1419. }
  1420. var result = '';
  1421. while (count > 1) {
  1422. if (count & 1) {
  1423. result += pattern;
  1424. }
  1425. count >>= 1;
  1426. pattern += pattern;
  1427. }
  1428. return result + pattern;
  1429. }
  1430. var helpers = {
  1431. escape: escape,
  1432. unescape: unescape,
  1433. edit: edit,
  1434. cleanUrl: cleanUrl,
  1435. resolveUrl: resolveUrl,
  1436. noopTest: noopTest,
  1437. merge: merge$1,
  1438. splitCells: splitCells,
  1439. rtrim: rtrim,
  1440. findClosingBracket: findClosingBracket,
  1441. checkSanitizeDeprecation: checkSanitizeDeprecation,
  1442. repeatString: repeatString
  1443. };
  1444. var defaults$1 = defaults.defaults;
  1445. var rtrim$1 = helpers.rtrim;
  1446. var splitCells$1 = helpers.splitCells;
  1447. var escape$1 = helpers.escape;
  1448. var findClosingBracket$1 = helpers.findClosingBracket;
  1449. function outputLink(cap, link, raw) {
  1450. var href = link.href;
  1451. var title = link.title ? escape$1(link.title) : null;
  1452. var text = cap[1].replace(/\\([\[\]])/g, '$1');
  1453. if (cap[0].charAt(0) !== '!') {
  1454. return {
  1455. type: 'link',
  1456. raw: raw,
  1457. href: href,
  1458. title: title,
  1459. text: text
  1460. };
  1461. } else {
  1462. return {
  1463. type: 'image',
  1464. raw: raw,
  1465. href: href,
  1466. title: title,
  1467. text: escape$1(text)
  1468. };
  1469. }
  1470. }
  1471. function indentCodeCompensation(raw, text) {
  1472. var matchIndentToCode = raw.match(/^(\s+)(?:```)/);
  1473. if (matchIndentToCode === null) {
  1474. return text;
  1475. }
  1476. var indentToCode = matchIndentToCode[1];
  1477. return text
  1478. .split('\n')
  1479. .map(function (node) {
  1480. var matchIndentInNode = node.match(/^\s+/);
  1481. if (matchIndentInNode === null) {
  1482. return node;
  1483. }
  1484. var indentInNode = matchIndentInNode[0];
  1485. if (indentInNode.length >= indentToCode.length) {
  1486. return node.slice(indentToCode.length);
  1487. }
  1488. return node;
  1489. })
  1490. .join('\n');
  1491. }
  1492. /**
  1493. * Tokenizer
  1494. */
  1495. var Tokenizer = /*@__PURE__*/(function () {
  1496. function Tokenizer(options) {
  1497. this.options = options || defaults$1;
  1498. }
  1499. Tokenizer.prototype.space = function space (src) {
  1500. var cap = this.rules.block.newline.exec(src);
  1501. if (cap) {
  1502. if (cap[0].length > 1) {
  1503. return {
  1504. type: 'space',
  1505. raw: cap[0]
  1506. };
  1507. }
  1508. return { raw: '\n' };
  1509. }
  1510. };
  1511. Tokenizer.prototype.code = function code (src, tokens) {
  1512. var cap = this.rules.block.code.exec(src);
  1513. if (cap) {
  1514. var lastToken = tokens[tokens.length - 1];
  1515. // An indented code block cannot interrupt a paragraph.
  1516. if (lastToken && lastToken.type === 'paragraph') {
  1517. return {
  1518. raw: cap[0],
  1519. text: cap[0].trimRight()
  1520. };
  1521. }
  1522. var text = cap[0].replace(/^ {1,4}/gm, '');
  1523. return {
  1524. type: 'code',
  1525. raw: cap[0],
  1526. codeBlockStyle: 'indented',
  1527. text: !this.options.pedantic
  1528. ? rtrim$1(text, '\n')
  1529. : text
  1530. };
  1531. }
  1532. };
  1533. Tokenizer.prototype.fences = function fences (src) {
  1534. var cap = this.rules.block.fences.exec(src);
  1535. if (cap) {
  1536. var raw = cap[0];
  1537. var text = indentCodeCompensation(raw, cap[3] || '');
  1538. return {
  1539. type: 'code',
  1540. raw: raw,
  1541. lang: cap[2] ? cap[2].trim() : cap[2],
  1542. text: text
  1543. };
  1544. }
  1545. };
  1546. Tokenizer.prototype.heading = function heading (src) {
  1547. var cap = this.rules.block.heading.exec(src);
  1548. if (cap) {
  1549. var text = cap[2].trim();
  1550. // remove trailing #s
  1551. if (/#$/.test(text)) {
  1552. var trimmed = rtrim$1(text, '#');
  1553. if (this.options.pedantic) {
  1554. text = trimmed.trim();
  1555. } else if (!trimmed || / $/.test(trimmed)) {
  1556. // CommonMark requires space before trailing #s
  1557. text = trimmed.trim();
  1558. }
  1559. }
  1560. return {
  1561. type: 'heading',
  1562. raw: cap[0],
  1563. depth: cap[1].length,
  1564. text: text
  1565. };
  1566. }
  1567. };
  1568. Tokenizer.prototype.nptable = function nptable (src) {
  1569. var cap = this.rules.block.nptable.exec(src);
  1570. if (cap) {
  1571. var item = {
  1572. type: 'table',
  1573. header: splitCells$1(cap[1].replace(/^ *| *\| *$/g, '')),
  1574. align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
  1575. cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [],
  1576. raw: cap[0]
  1577. };
  1578. if (item.header.length === item.align.length) {
  1579. var l = item.align.length;
  1580. var i;
  1581. for (i = 0; i < l; i++) {
  1582. if (/^ *-+: *$/.test(item.align[i])) {
  1583. item.align[i] = 'right';
  1584. } else if (/^ *:-+: *$/.test(item.align[i])) {
  1585. item.align[i] = 'center';
  1586. } else if (/^ *:-+ *$/.test(item.align[i])) {
  1587. item.align[i] = 'left';
  1588. } else {
  1589. item.align[i] = null;
  1590. }
  1591. }
  1592. l = item.cells.length;
  1593. for (i = 0; i < l; i++) {
  1594. item.cells[i] = splitCells$1(item.cells[i], item.header.length);
  1595. }
  1596. return item;
  1597. }
  1598. }
  1599. };
  1600. Tokenizer.prototype.hr = function hr (src) {
  1601. var cap = this.rules.block.hr.exec(src);
  1602. if (cap) {
  1603. return {
  1604. type: 'hr',
  1605. raw: cap[0]
  1606. };
  1607. }
  1608. };
  1609. Tokenizer.prototype.blockquote = function blockquote (src) {
  1610. var cap = this.rules.block.blockquote.exec(src);
  1611. if (cap) {
  1612. var text = cap[0].replace(/^ *> ?/gm, '');
  1613. return {
  1614. type: 'blockquote',
  1615. raw: cap[0],
  1616. text: text
  1617. };
  1618. }
  1619. };
  1620. Tokenizer.prototype.list = function list (src) {
  1621. var cap = this.rules.block.list.exec(src);
  1622. if (cap) {
  1623. var raw = cap[0];
  1624. var bull = cap[2];
  1625. var isordered = bull.length > 1;
  1626. var list = {
  1627. type: 'list',
  1628. raw: raw,
  1629. ordered: isordered,
  1630. start: isordered ? +bull.slice(0, -1) : '',
  1631. loose: false,
  1632. items: []
  1633. };
  1634. // Get each top-level item.
  1635. var itemMatch = cap[0].match(this.rules.block.item);
  1636. var next = false,
  1637. item,
  1638. space,
  1639. bcurr,
  1640. bnext,
  1641. addBack,
  1642. loose,
  1643. istask,
  1644. ischecked;
  1645. var l = itemMatch.length;
  1646. bcurr = this.rules.block.listItemStart.exec(itemMatch[0]);
  1647. for (var i = 0; i < l; i++) {
  1648. item = itemMatch[i];
  1649. raw = item;
  1650. // Determine whether the next list item belongs here.
  1651. // Backpedal if it does not belong in this list.
  1652. if (i !== l - 1) {
  1653. bnext = this.rules.block.listItemStart.exec(itemMatch[i + 1]);
  1654. if (
  1655. !this.options.pedantic
  1656. ? bnext[1].length > bcurr[0].length || bnext[1].length > 3
  1657. : bnext[1].length > bcurr[1].length
  1658. ) {
  1659. // nested list
  1660. itemMatch.splice(i, 2, itemMatch[i] + '\n' + itemMatch[i + 1]);
  1661. i--;
  1662. l--;
  1663. continue;
  1664. } else {
  1665. if (
  1666. // different bullet style
  1667. !this.options.pedantic || this.options.smartLists
  1668. ? bnext[2][bnext[2].length - 1] !== bull[bull.length - 1]
  1669. : isordered === (bnext[2].length === 1)
  1670. ) {
  1671. addBack = itemMatch.slice(i + 1).join('\n');
  1672. list.raw = list.raw.substring(0, list.raw.length - addBack.length);
  1673. i = l - 1;
  1674. }
  1675. }
  1676. bcurr = bnext;
  1677. }
  1678. // Remove the list item's bullet
  1679. // so it is seen as the next token.
  1680. space = item.length;
  1681. item = item.replace(/^ *([*+-]|\d+[.)]) ?/, '');
  1682. // Outdent whatever the
  1683. // list item contains. Hacky.
  1684. if (~item.indexOf('\n ')) {
  1685. space -= item.length;
  1686. item = !this.options.pedantic
  1687. ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
  1688. : item.replace(/^ {1,4}/gm, '');
  1689. }
  1690. // Determine whether item is loose or not.
  1691. // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
  1692. // for discount behavior.
  1693. loose = next || /\n\n(?!\s*$)/.test(item);
  1694. if (i !== l - 1) {
  1695. next = item.charAt(item.length - 1) === '\n';
  1696. if (!loose) { loose = next; }
  1697. }
  1698. if (loose) {
  1699. list.loose = true;
  1700. }
  1701. // Check for task list items
  1702. if (this.options.gfm) {
  1703. istask = /^\[[ xX]\] /.test(item);
  1704. ischecked = undefined;
  1705. if (istask) {
  1706. ischecked = item[1] !== ' ';
  1707. item = item.replace(/^\[[ xX]\] +/, '');
  1708. }
  1709. }
  1710. list.items.push({
  1711. type: 'list_item',
  1712. raw: raw,
  1713. task: istask,
  1714. checked: ischecked,
  1715. loose: loose,
  1716. text: item
  1717. });
  1718. }
  1719. return list;
  1720. }
  1721. };
  1722. Tokenizer.prototype.html = function html (src) {
  1723. var cap = this.rules.block.html.exec(src);
  1724. if (cap) {
  1725. return {
  1726. type: this.options.sanitize
  1727. ? 'paragraph'
  1728. : 'html',
  1729. raw: cap[0],
  1730. pre: !this.options.sanitizer
  1731. && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
  1732. text: this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$1(cap[0])) : cap[0]
  1733. };
  1734. }
  1735. };
  1736. Tokenizer.prototype.def = function def (src) {
  1737. var cap = this.rules.block.def.exec(src);
  1738. if (cap) {
  1739. if (cap[3]) { cap[3] = cap[3].substring(1, cap[3].length - 1); }
  1740. var tag = cap[1].toLowerCase().replace(/\s+/g, ' ');
  1741. return {
  1742. tag: tag,
  1743. raw: cap[0],
  1744. href: cap[2],
  1745. title: cap[3]
  1746. };
  1747. }
  1748. };
  1749. Tokenizer.prototype.table = function table (src) {
  1750. var cap = this.rules.block.table.exec(src);
  1751. if (cap) {
  1752. var item = {
  1753. type: 'table',
  1754. header: splitCells$1(cap[1].replace(/^ *| *\| *$/g, '')),
  1755. align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
  1756. cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
  1757. };
  1758. if (item.header.length === item.align.length) {
  1759. item.raw = cap[0];
  1760. var l = item.align.length;
  1761. var i;
  1762. for (i = 0; i < l; i++) {
  1763. if (/^ *-+: *$/.test(item.align[i])) {
  1764. item.align[i] = 'right';
  1765. } else if (/^ *:-+: *$/.test(item.align[i])) {
  1766. item.align[i] = 'center';
  1767. } else if (/^ *:-+ *$/.test(item.align[i])) {
  1768. item.align[i] = 'left';
  1769. } else {
  1770. item.align[i] = null;
  1771. }
  1772. }
  1773. l = item.cells.length;
  1774. for (i = 0; i < l; i++) {
  1775. item.cells[i] = splitCells$1(
  1776. item.cells[i].replace(/^ *\| *| *\| *$/g, ''),
  1777. item.header.length);
  1778. }
  1779. return item;
  1780. }
  1781. }
  1782. };
  1783. Tokenizer.prototype.lheading = function lheading (src) {
  1784. var cap = this.rules.block.lheading.exec(src);
  1785. if (cap) {
  1786. return {
  1787. type: 'heading',
  1788. raw: cap[0],
  1789. depth: cap[2].charAt(0) === '=' ? 1 : 2,
  1790. text: cap[1]
  1791. };
  1792. }
  1793. };
  1794. Tokenizer.prototype.paragraph = function paragraph (src) {
  1795. var cap = this.rules.block.paragraph.exec(src);
  1796. if (cap) {
  1797. return {
  1798. type: 'paragraph',
  1799. raw: cap[0],
  1800. text: cap[1].charAt(cap[1].length - 1) === '\n'
  1801. ? cap[1].slice(0, -1)
  1802. : cap[1]
  1803. };
  1804. }
  1805. };
  1806. Tokenizer.prototype.text = function text (src, tokens) {
  1807. var cap = this.rules.block.text.exec(src);
  1808. if (cap) {
  1809. var lastToken = tokens[tokens.length - 1];
  1810. if (lastToken && lastToken.type === 'text') {
  1811. return {
  1812. raw: cap[0],
  1813. text: cap[0]
  1814. };
  1815. }
  1816. return {
  1817. type: 'text',
  1818. raw: cap[0],
  1819. text: cap[0]
  1820. };
  1821. }
  1822. };
  1823. Tokenizer.prototype.escape = function escape$1$1 (src) {
  1824. var cap = this.rules.inline.escape.exec(src);
  1825. if (cap) {
  1826. return {
  1827. type: 'escape',
  1828. raw: cap[0],
  1829. text: escape$1(cap[1])
  1830. };
  1831. }
  1832. };
  1833. Tokenizer.prototype.tag = function tag (src, inLink, inRawBlock) {
  1834. var cap = this.rules.inline.tag.exec(src);
  1835. if (cap) {
  1836. if (!inLink && /^<a /i.test(cap[0])) {
  1837. inLink = true;
  1838. } else if (inLink && /^<\/a>/i.test(cap[0])) {
  1839. inLink = false;
  1840. }
  1841. if (!inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
  1842. inRawBlock = true;
  1843. } else if (inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) {
  1844. inRawBlock = false;
  1845. }
  1846. return {
  1847. type: this.options.sanitize
  1848. ? 'text'
  1849. : 'html',
  1850. raw: cap[0],
  1851. inLink: inLink,
  1852. inRawBlock: inRawBlock,
  1853. text: this.options.sanitize
  1854. ? (this.options.sanitizer
  1855. ? this.options.sanitizer(cap[0])
  1856. : escape$1(cap[0]))
  1857. : cap[0]
  1858. };
  1859. }
  1860. };
  1861. Tokenizer.prototype.link = function link (src) {
  1862. var cap = this.rules.inline.link.exec(src);
  1863. if (cap) {
  1864. var trimmedUrl = cap[2].trim();
  1865. if (!this.options.pedantic && /^</.test(trimmedUrl)) {
  1866. // commonmark requires matching angle brackets
  1867. if (!(/>$/.test(trimmedUrl))) {
  1868. return;
  1869. }
  1870. // ending angle bracket cannot be escaped
  1871. var rtrimSlash = rtrim$1(trimmedUrl.slice(0, -1), '\\');
  1872. if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
  1873. return;
  1874. }
  1875. } else {
  1876. // find closing parenthesis
  1877. var lastParenIndex = findClosingBracket$1(cap[2], '()');
  1878. if (lastParenIndex > -1) {
  1879. var start = cap[0].indexOf('!') === 0 ? 5 : 4;
  1880. var linkLen = start + cap[1].length + lastParenIndex;
  1881. cap[2] = cap[2].substring(0, lastParenIndex);
  1882. cap[0] = cap[0].substring(0, linkLen).trim();
  1883. cap[3] = '';
  1884. }
  1885. }
  1886. var href = cap[2];
  1887. var title = '';
  1888. if (this.options.pedantic) {
  1889. // split pedantic href and title
  1890. var link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);
  1891. if (link) {
  1892. href = link[1];
  1893. title = link[3];
  1894. }
  1895. } else {
  1896. title = cap[3] ? cap[3].slice(1, -1) : '';
  1897. }
  1898. href = href.trim();
  1899. if (/^</.test(href)) {
  1900. if (this.options.pedantic && !(/>$/.test(trimmedUrl))) {
  1901. // pedantic allows starting angle bracket without ending angle bracket
  1902. href = href.slice(1);
  1903. } else {
  1904. href = href.slice(1, -1);
  1905. }
  1906. }
  1907. return outputLink(cap, {
  1908. href: href ? href.replace(this.rules.inline._escapes, '$1') : href,
  1909. title: title ? title.replace(this.rules.inline._escapes, '$1') : title
  1910. }, cap[0]);
  1911. }
  1912. };
  1913. Tokenizer.prototype.reflink = function reflink (src, links) {
  1914. var cap;
  1915. if ((cap = this.rules.inline.reflink.exec(src))
  1916. || (cap = this.rules.inline.nolink.exec(src))) {
  1917. var link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
  1918. link = links[link.toLowerCase()];
  1919. if (!link || !link.href) {
  1920. var text = cap[0].charAt(0);
  1921. return {
  1922. type: 'text',
  1923. raw: text,
  1924. text: text
  1925. };
  1926. }
  1927. return outputLink(cap, link, cap[0]);
  1928. }
  1929. };
  1930. Tokenizer.prototype.strong = function strong (src, maskedSrc, prevChar) {
  1931. if ( prevChar === void 0 ) prevChar = '';
  1932. var match = this.rules.inline.strong.start.exec(src);
  1933. if (match && (!match[1] || (match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))))) {
  1934. maskedSrc = maskedSrc.slice(-1 * src.length);
  1935. var endReg = match[0] === '**' ? this.rules.inline.strong.endAst : this.rules.inline.strong.endUnd;
  1936. endReg.lastIndex = 0;
  1937. var cap;
  1938. while ((match = endReg.exec(maskedSrc)) != null) {
  1939. cap = this.rules.inline.strong.middle.exec(maskedSrc.slice(0, match.index + 3));
  1940. if (cap) {
  1941. return {
  1942. type: 'strong',
  1943. raw: src.slice(0, cap[0].length),
  1944. text: src.slice(2, cap[0].length - 2)
  1945. };
  1946. }
  1947. }
  1948. }
  1949. };
  1950. Tokenizer.prototype.em = function em (src, maskedSrc, prevChar) {
  1951. if ( prevChar === void 0 ) prevChar = '';
  1952. var match = this.rules.inline.em.start.exec(src);
  1953. if (match && (!match[1] || (match[1] && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))))) {
  1954. maskedSrc = maskedSrc.slice(-1 * src.length);
  1955. var endReg = match[0] === '*' ? this.rules.inline.em.endAst : this.rules.inline.em.endUnd;
  1956. endReg.lastIndex = 0;
  1957. var cap;
  1958. while ((match = endReg.exec(maskedSrc)) != null) {
  1959. cap = this.rules.inline.em.middle.exec(maskedSrc.slice(0, match.index + 2));
  1960. if (cap) {
  1961. return {
  1962. type: 'em',
  1963. raw: src.slice(0, cap[0].length),
  1964. text: src.slice(1, cap[0].length - 1)
  1965. };
  1966. }
  1967. }
  1968. }
  1969. };
  1970. Tokenizer.prototype.codespan = function codespan (src) {
  1971. var cap = this.rules.inline.code.exec(src);
  1972. if (cap) {
  1973. var text = cap[2].replace(/\n/g, ' ');
  1974. var hasNonSpaceChars = /[^ ]/.test(text);
  1975. var hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text);
  1976. if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
  1977. text = text.substring(1, text.length - 1);
  1978. }
  1979. text = escape$1(text, true);
  1980. return {
  1981. type: 'codespan',
  1982. raw: cap[0],
  1983. text: text
  1984. };
  1985. }
  1986. };
  1987. Tokenizer.prototype.br = function br (src) {
  1988. var cap = this.rules.inline.br.exec(src);
  1989. if (cap) {
  1990. return {
  1991. type: 'br',
  1992. raw: cap[0]
  1993. };
  1994. }
  1995. };
  1996. Tokenizer.prototype.del = function del (src) {
  1997. var cap = this.rules.inline.del.exec(src);
  1998. if (cap) {
  1999. return {
  2000. type: 'del',
  2001. raw: cap[0],
  2002. text: cap[2]
  2003. };
  2004. }
  2005. };
  2006. Tokenizer.prototype.autolink = function autolink (src, mangle) {
  2007. var cap = this.rules.inline.autolink.exec(src);
  2008. if (cap) {
  2009. var text, href;
  2010. if (cap[2] === '@') {
  2011. text = escape$1(this.options.mangle ? mangle(cap[1]) : cap[1]);
  2012. href = 'mailto:' + text;
  2013. } else {
  2014. text = escape$1(cap[1]);
  2015. href = text;
  2016. }
  2017. return {
  2018. type: 'link',
  2019. raw: cap[0],
  2020. text: text,
  2021. href: href,
  2022. tokens: [
  2023. {
  2024. type: 'text',
  2025. raw: text,
  2026. text: text
  2027. }
  2028. ]
  2029. };
  2030. }
  2031. };
  2032. Tokenizer.prototype.url = function url (src, mangle) {
  2033. var cap;
  2034. if (cap = this.rules.inline.url.exec(src)) {
  2035. var text, href;
  2036. if (cap[2] === '@') {
  2037. text = escape$1(this.options.mangle ? mangle(cap[0]) : cap[0]);
  2038. href = 'mailto:' + text;
  2039. } else {
  2040. // do extended autolink path validation
  2041. var prevCapZero;
  2042. do {
  2043. prevCapZero = cap[0];
  2044. cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];
  2045. } while (prevCapZero !== cap[0]);
  2046. text = escape$1(cap[0]);
  2047. if (cap[1] === 'www.') {
  2048. href = 'http://' + text;
  2049. } else {
  2050. href = text;
  2051. }
  2052. }
  2053. return {
  2054. type: 'link',
  2055. raw: cap[0],
  2056. text: text,
  2057. href: href,
  2058. tokens: [
  2059. {
  2060. type: 'text',
  2061. raw: text,
  2062. text: text
  2063. }
  2064. ]
  2065. };
  2066. }
  2067. };
  2068. Tokenizer.prototype.inlineText = function inlineText (src, inRawBlock, smartypants) {
  2069. var cap = this.rules.inline.text.exec(src);
  2070. if (cap) {
  2071. var text;
  2072. if (inRawBlock) {
  2073. text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$1(cap[0])) : cap[0];
  2074. } else {
  2075. text = escape$1(this.options.smartypants ? smartypants(cap[0]) : cap[0]);
  2076. }
  2077. return {
  2078. type: 'text',
  2079. raw: cap[0],
  2080. text: text
  2081. };
  2082. }
  2083. };
  2084. return Tokenizer;
  2085. }());
  2086. var noopTest$1 = helpers.noopTest;
  2087. var edit$1 = helpers.edit;
  2088. var merge$2 = helpers.merge;
  2089. /**
  2090. * Block-Level Grammar
  2091. */
  2092. var block = {
  2093. newline: /^(?: *(?:\n|$))+/,
  2094. code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
  2095. fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,
  2096. hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,
  2097. heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,
  2098. blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,
  2099. list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,
  2100. html: '^ {0,3}(?:' // optional indentation
  2101. + '<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)' // (1)
  2102. + '|comment[^\\n]*(\\n+|$)' // (2)
  2103. + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3)
  2104. + '|<![A-Z][\\s\\S]*?(?:>\\n*|$)' // (4)
  2105. + '|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)' // (5)
  2106. + '|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)' // (6)
  2107. + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag
  2108. + '|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag
  2109. + ')',
  2110. def: /^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
  2111. nptable: noopTest$1,
  2112. table: noopTest$1,
  2113. lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
  2114. // regex template, placeholders will be replaced according to different paragraph
  2115. // interruption rules of commonmark and the original markdown spec:
  2116. _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,
  2117. text: /^[^\n]+/
  2118. };
  2119. block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
  2120. block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
  2121. block.def = edit$1(block.def)
  2122. .replace('label', block._label)
  2123. .replace('title', block._title)
  2124. .getRegex();
  2125. block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
  2126. block.item = /^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/;
  2127. block.item = edit$1(block.item, 'gm')
  2128. .replace(/bull/g, block.bullet)
  2129. .getRegex();
  2130. block.listItemStart = edit$1(/^( *)(bull)/)
  2131. .replace('bull', block.bullet)
  2132. .getRegex();
  2133. block.list = edit$1(block.list)
  2134. .replace(/bull/g, block.bullet)
  2135. .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))')
  2136. .replace('def', '\\n+(?=' + block.def.source + ')')
  2137. .getRegex();
  2138. block._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
  2139. + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
  2140. + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'
  2141. + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
  2142. + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'
  2143. + '|track|ul';
  2144. block._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
  2145. block.html = edit$1(block.html, 'i')
  2146. .replace('comment', block._comment)
  2147. .replace('tag', block._tag)
  2148. .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/)
  2149. .getRegex();
  2150. block.paragraph = edit$1(block._paragraph)
  2151. .replace('hr', block.hr)
  2152. .replace('heading', ' {0,3}#{1,6} ')
  2153. .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
  2154. .replace('blockquote', ' {0,3}>')
  2155. .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
  2156. .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
  2157. .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
  2158. .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
  2159. .getRegex();
  2160. block.blockquote = edit$1(block.blockquote)
  2161. .replace('paragraph', block.paragraph)
  2162. .getRegex();
  2163. /**
  2164. * Normal Block Grammar
  2165. */
  2166. block.normal = merge$2({}, block);
  2167. /**
  2168. * GFM Block Grammar
  2169. */
  2170. block.gfm = merge$2({}, block.normal, {
  2171. nptable: '^ *([^|\\n ].*\\|.*)\\n' // Header
  2172. + ' {0,3}([-:]+ *\\|[-| :]*)' // Align
  2173. + '(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)', // Cells
  2174. table: '^ *\\|(.+)\\n' // Header
  2175. + ' {0,3}\\|?( *[-:]+[-| :]*)' // Align
  2176. + '(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
  2177. });
  2178. block.gfm.nptable = edit$1(block.gfm.nptable)
  2179. .replace('hr', block.hr)
  2180. .replace('heading', ' {0,3}#{1,6} ')
  2181. .replace('blockquote', ' {0,3}>')
  2182. .replace('code', ' {4}[^\\n]')
  2183. .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
  2184. .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
  2185. .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
  2186. .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
  2187. .getRegex();
  2188. block.gfm.table = edit$1(block.gfm.table)
  2189. .replace('hr', block.hr)
  2190. .replace('heading', ' {0,3}#{1,6} ')
  2191. .replace('blockquote', ' {0,3}>')
  2192. .replace('code', ' {4}[^\\n]')
  2193. .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
  2194. .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
  2195. .replace('html', '</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
  2196. .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
  2197. .getRegex();
  2198. /**
  2199. * Pedantic grammar (original John Gruber's loose markdown specification)
  2200. */
  2201. block.pedantic = merge$2({}, block.normal, {
  2202. html: edit$1(
  2203. '^ *(?:comment *(?:\\n|\\s*$)'
  2204. + '|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)' // closed tag
  2205. + '|<tag(?:"[^"]*"|\'[^\']*\'|\\s[^\'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))')
  2206. .replace('comment', block._comment)
  2207. .replace(/tag/g, '(?!(?:'
  2208. + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'
  2209. + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'
  2210. + '\\b)\\w+(?!:|[^\\w\\s@]*@)\\b')
  2211. .getRegex(),
  2212. def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
  2213. heading: /^(#{1,6})(.*)(?:\n+|$)/,
  2214. fences: noopTest$1, // fences not supported
  2215. paragraph: edit$1(block.normal._paragraph)
  2216. .replace('hr', block.hr)
  2217. .replace('heading', ' *#{1,6} *[^\n]')
  2218. .replace('lheading', block.lheading)
  2219. .replace('blockquote', ' {0,3}>')
  2220. .replace('|fences', '')
  2221. .replace('|list', '')
  2222. .replace('|html', '')
  2223. .getRegex()
  2224. });
  2225. /**
  2226. * Inline-Level Grammar
  2227. */
  2228. var inline = {
  2229. escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
  2230. autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/,
  2231. url: noopTest$1,
  2232. tag: '^comment'
  2233. + '|^</[a-zA-Z][\\w:-]*\\s*>' // self-closing tag
  2234. + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag
  2235. + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. <?php ?>
  2236. + '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
  2237. + '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>', // CDATA section
  2238. link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
  2239. reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
  2240. nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
  2241. reflinkSearch: 'reflink|nolink(?!\\()',
  2242. strong: {
  2243. start: /^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/, // (1) returns if starts w/ punctuation
  2244. middle: /^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,
  2245. endAst: /[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation_\s]|$))/, // last char can't be punct, or final * must also be followed by punct (or endline)
  2246. endUnd: /[^\s]__(?!_)(?:(?=[punctuation*\s])|$)/ // last char can't be a space, and final _ must preceed punct or \s (or endline)
  2247. },
  2248. em: {
  2249. start: /^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/, // (1) returns if starts w/ punctuation
  2250. middle: /^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,
  2251. endAst: /[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation_\s]|$))/, // last char can't be punct, or final * must also be followed by punct (or endline)
  2252. endUnd: /[^\s]_(?!_)(?:(?=[punctuation*\s])|$)/ // last char can't be a space, and final _ must preceed punct or \s (or endline)
  2253. },
  2254. code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,
  2255. br: /^( {2,}|\\)\n(?!\s*$)/,
  2256. del: noopTest$1,
  2257. text: /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n)))/,
  2258. punctuation: /^([\s*punctuation])/
  2259. };
  2260. // list of punctuation marks from common mark spec
  2261. // without * and _ to workaround cases with double emphasis
  2262. inline._punctuation = '!"#$%&\'()+\\-.,/:;<=>?@\\[\\]`^{|}~';
  2263. inline.punctuation = edit$1(inline.punctuation).replace(/punctuation/g, inline._punctuation).getRegex();
  2264. // sequences em should skip over [title](link), `code`, <html>
  2265. inline._blockSkip = '\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>';
  2266. inline._overlapSkip = '__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*';
  2267. inline._comment = edit$1(block._comment).replace('(?:-->|$)', '-->').getRegex();
  2268. inline.em.start = edit$1(inline.em.start)
  2269. .replace(/punctuation/g, inline._punctuation)
  2270. .getRegex();
  2271. inline.em.middle = edit$1(inline.em.middle)
  2272. .replace(/punctuation/g, inline._punctuation)
  2273. .replace(/overlapSkip/g, inline._overlapSkip)
  2274. .getRegex();
  2275. inline.em.endAst = edit$1(inline.em.endAst, 'g')
  2276. .replace(/punctuation/g, inline._punctuation)
  2277. .getRegex();
  2278. inline.em.endUnd = edit$1(inline.em.endUnd, 'g')
  2279. .replace(/punctuation/g, inline._punctuation)
  2280. .getRegex();
  2281. inline.strong.start = edit$1(inline.strong.start)
  2282. .replace(/punctuation/g, inline._punctuation)
  2283. .getRegex();
  2284. inline.strong.middle = edit$1(inline.strong.middle)
  2285. .replace(/punctuation/g, inline._punctuation)
  2286. .replace(/overlapSkip/g, inline._overlapSkip)
  2287. .getRegex();
  2288. inline.strong.endAst = edit$1(inline.strong.endAst, 'g')
  2289. .replace(/punctuation/g, inline._punctuation)
  2290. .getRegex();
  2291. inline.strong.endUnd = edit$1(inline.strong.endUnd, 'g')
  2292. .replace(/punctuation/g, inline._punctuation)
  2293. .getRegex();
  2294. inline.blockSkip = edit$1(inline._blockSkip, 'g')
  2295. .getRegex();
  2296. inline.overlapSkip = edit$1(inline._overlapSkip, 'g')
  2297. .getRegex();
  2298. inline._escapes = /\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;
  2299. inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;
  2300. inline._email = /[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])?)+(?![-_])/;
  2301. inline.autolink = edit$1(inline.autolink)
  2302. .replace('scheme', inline._scheme)
  2303. .replace('email', inline._email)
  2304. .getRegex();
  2305. inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;
  2306. inline.tag = edit$1(inline.tag)
  2307. .replace('comment', inline._comment)
  2308. .replace('attribute', inline._attribute)
  2309. .getRegex();
  2310. inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
  2311. inline._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
  2312. inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
  2313. inline.link = edit$1(inline.link)
  2314. .replace('label', inline._label)
  2315. .replace('href', inline._href)
  2316. .replace('title', inline._title)
  2317. .getRegex();
  2318. inline.reflink = edit$1(inline.reflink)
  2319. .replace('label', inline._label)
  2320. .getRegex();
  2321. inline.reflinkSearch = edit$1(inline.reflinkSearch, 'g')
  2322. .replace('reflink', inline.reflink)
  2323. .replace('nolink', inline.nolink)
  2324. .getRegex();
  2325. /**
  2326. * Normal Inline Grammar
  2327. */
  2328. inline.normal = merge$2({}, inline);
  2329. /**
  2330. * Pedantic Inline Grammar
  2331. */
  2332. inline.pedantic = merge$2({}, inline.normal, {
  2333. strong: {
  2334. start: /^__|\*\*/,
  2335. middle: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
  2336. endAst: /\*\*(?!\*)/g,
  2337. endUnd: /__(?!_)/g
  2338. },
  2339. em: {
  2340. start: /^_|\*/,
  2341. middle: /^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,
  2342. endAst: /\*(?!\*)/g,
  2343. endUnd: /_(?!_)/g
  2344. },
  2345. link: edit$1(/^!?\[(label)\]\((.*?)\)/)
  2346. .replace('label', inline._label)
  2347. .getRegex(),
  2348. reflink: edit$1(/^!?\[(label)\]\s*\[([^\]]*)\]/)
  2349. .replace('label', inline._label)
  2350. .getRegex()
  2351. });
  2352. /**
  2353. * GFM Inline Grammar
  2354. */
  2355. inline.gfm = merge$2({}, inline.normal, {
  2356. escape: edit$1(inline.escape).replace('])', '~|])').getRegex(),
  2357. _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,
  2358. url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,
  2359. _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,
  2360. del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
  2361. text: /^([`~]+|[^`~])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/
  2362. });
  2363. inline.gfm.url = edit$1(inline.gfm.url, 'i')
  2364. .replace('email', inline.gfm._extended_email)
  2365. .getRegex();
  2366. /**
  2367. * GFM + Line Breaks Inline Grammar
  2368. */
  2369. inline.breaks = merge$2({}, inline.gfm, {
  2370. br: edit$1(inline.br).replace('{2,}', '*').getRegex(),
  2371. text: edit$1(inline.gfm.text)
  2372. .replace('\\b_', '\\b_| {2,}\\n')
  2373. .replace(/\{2,\}/g, '*')
  2374. .getRegex()
  2375. });
  2376. var rules = {
  2377. block: block,
  2378. inline: inline
  2379. };
  2380. var defaults$2 = defaults.defaults;
  2381. var block$1 = rules.block;
  2382. var inline$1 = rules.inline;
  2383. var repeatString$1 = helpers.repeatString;
  2384. /**
  2385. * smartypants text replacement
  2386. */
  2387. function smartypants(text) {
  2388. return text
  2389. // em-dashes
  2390. .replace(/---/g, '\u2014')
  2391. // en-dashes
  2392. .replace(/--/g, '\u2013')
  2393. // opening singles
  2394. .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
  2395. // closing singles & apostrophes
  2396. .replace(/'/g, '\u2019')
  2397. // opening doubles
  2398. .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
  2399. // closing doubles
  2400. .replace(/"/g, '\u201d')
  2401. // ellipses
  2402. .replace(/\.{3}/g, '\u2026');
  2403. }
  2404. /**
  2405. * mangle email addresses
  2406. */
  2407. function mangle(text) {
  2408. var out = '',
  2409. i,
  2410. ch;
  2411. var l = text.length;
  2412. for (i = 0; i < l; i++) {
  2413. ch = text.charCodeAt(i);
  2414. if (Math.random() > 0.5) {
  2415. ch = 'x' + ch.toString(16);
  2416. }
  2417. out += '&#' + ch + ';';
  2418. }
  2419. return out;
  2420. }
  2421. /**
  2422. * Block Lexer
  2423. */
  2424. var Lexer = /*@__PURE__*/(function () {
  2425. function Lexer(options) {
  2426. this.tokens = [];
  2427. this.tokens.links = Object.create(null);
  2428. this.options = options || defaults$2;
  2429. this.options.tokenizer = this.options.tokenizer || new Tokenizer();
  2430. this.tokenizer = this.options.tokenizer;
  2431. this.tokenizer.options = this.options;
  2432. var rules = {
  2433. block: block$1.normal,
  2434. inline: inline$1.normal
  2435. };
  2436. if (this.options.pedantic) {
  2437. rules.block = block$1.pedantic;
  2438. rules.inline = inline$1.pedantic;
  2439. } else if (this.options.gfm) {
  2440. rules.block = block$1.gfm;
  2441. if (this.options.breaks) {
  2442. rules.inline = inline$1.breaks;
  2443. } else {
  2444. rules.inline = inline$1.gfm;
  2445. }
  2446. }
  2447. this.tokenizer.rules = rules;
  2448. }
  2449. var staticAccessors = { rules: { configurable: true } };
  2450. /**
  2451. * Expose Rules
  2452. */
  2453. staticAccessors.rules.get = function () {
  2454. return {
  2455. block: block$1,
  2456. inline: inline$1
  2457. };
  2458. };
  2459. /**
  2460. * Static Lex Method
  2461. */
  2462. Lexer.lex = function lex (src, options) {
  2463. var lexer = new Lexer(options);
  2464. return lexer.lex(src);
  2465. };
  2466. /**
  2467. * Static Lex Inline Method
  2468. */
  2469. Lexer.lexInline = function lexInline (src, options) {
  2470. var lexer = new Lexer(options);
  2471. return lexer.inlineTokens(src);
  2472. };
  2473. /**
  2474. * Preprocessing
  2475. */
  2476. Lexer.prototype.lex = function lex (src) {
  2477. src = src
  2478. .replace(/\r\n|\r/g, '\n')
  2479. .replace(/\t/g, ' ');
  2480. this.blockTokens(src, this.tokens, true);
  2481. this.inline(this.tokens);
  2482. return this.tokens;
  2483. };
  2484. /**
  2485. * Lexing
  2486. */
  2487. Lexer.prototype.blockTokens = function blockTokens (src, tokens, top) {
  2488. if ( tokens === void 0 ) tokens = [];
  2489. if ( top === void 0 ) top = true;
  2490. if (this.options.pedantic) {
  2491. src = src.replace(/^ +$/gm, '');
  2492. }
  2493. var token, i, l, lastToken;
  2494. while (src) {
  2495. // newline
  2496. if (token = this.tokenizer.space(src)) {
  2497. src = src.substring(token.raw.length);
  2498. if (token.type) {
  2499. tokens.push(token);
  2500. }
  2501. continue;
  2502. }
  2503. // code
  2504. if (token = this.tokenizer.code(src, tokens)) {
  2505. src = src.substring(token.raw.length);
  2506. if (token.type) {
  2507. tokens.push(token);
  2508. } else {
  2509. lastToken = tokens[tokens.length - 1];
  2510. lastToken.raw += '\n' + token.raw;
  2511. lastToken.text += '\n' + token.text;
  2512. }
  2513. continue;
  2514. }
  2515. // fences
  2516. if (token = this.tokenizer.fences(src)) {
  2517. src = src.substring(token.raw.length);
  2518. tokens.push(token);
  2519. continue;
  2520. }
  2521. // heading
  2522. if (token = this.tokenizer.heading(src)) {
  2523. src = src.substring(token.raw.length);
  2524. tokens.push(token);
  2525. continue;
  2526. }
  2527. // table no leading pipe (gfm)
  2528. if (token = this.tokenizer.nptable(src)) {
  2529. src = src.substring(token.raw.length);
  2530. tokens.push(token);
  2531. continue;
  2532. }
  2533. // hr
  2534. if (token = this.tokenizer.hr(src)) {
  2535. src = src.substring(token.raw.length);
  2536. tokens.push(token);
  2537. continue;
  2538. }
  2539. // blockquote
  2540. if (token = this.tokenizer.blockquote(src)) {
  2541. src = src.substring(token.raw.length);
  2542. token.tokens = this.blockTokens(token.text, [], top);
  2543. tokens.push(token);
  2544. continue;
  2545. }
  2546. // list
  2547. if (token = this.tokenizer.list(src)) {
  2548. src = src.substring(token.raw.length);
  2549. l = token.items.length;
  2550. for (i = 0; i < l; i++) {
  2551. token.items[i].tokens = this.blockTokens(token.items[i].text, [], false);
  2552. }
  2553. tokens.push(token);
  2554. continue;
  2555. }
  2556. // html
  2557. if (token = this.tokenizer.html(src)) {
  2558. src = src.substring(token.raw.length);
  2559. tokens.push(token);
  2560. continue;
  2561. }
  2562. // def
  2563. if (top && (token = this.tokenizer.def(src))) {
  2564. src = src.substring(token.raw.length);
  2565. if (!this.tokens.links[token.tag]) {
  2566. this.tokens.links[token.tag] = {
  2567. href: token.href,
  2568. title: token.title
  2569. };
  2570. }
  2571. continue;
  2572. }
  2573. // table (gfm)
  2574. if (token = this.tokenizer.table(src)) {
  2575. src = src.substring(token.raw.length);
  2576. tokens.push(token);
  2577. continue;
  2578. }
  2579. // lheading
  2580. if (token = this.tokenizer.lheading(src)) {
  2581. src = src.substring(token.raw.length);
  2582. tokens.push(token);
  2583. continue;
  2584. }
  2585. // top-level paragraph
  2586. if (top && (token = this.tokenizer.paragraph(src))) {
  2587. src = src.substring(token.raw.length);
  2588. tokens.push(token);
  2589. continue;
  2590. }
  2591. // text
  2592. if (token = this.tokenizer.text(src, tokens)) {
  2593. src = src.substring(token.raw.length);
  2594. if (token.type) {
  2595. tokens.push(token);
  2596. } else {
  2597. lastToken = tokens[tokens.length - 1];
  2598. lastToken.raw += '\n' + token.raw;
  2599. lastToken.text += '\n' + token.text;
  2600. }
  2601. continue;
  2602. }
  2603. if (src) {
  2604. var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
  2605. if (this.options.silent) {
  2606. console.error(errMsg);
  2607. break;
  2608. } else {
  2609. throw new Error(errMsg);
  2610. }
  2611. }
  2612. }
  2613. return tokens;
  2614. };
  2615. Lexer.prototype.inline = function inline (tokens) {
  2616. var i,
  2617. j,
  2618. k,
  2619. l2,
  2620. row,
  2621. token;
  2622. var l = tokens.length;
  2623. for (i = 0; i < l; i++) {
  2624. token = tokens[i];
  2625. switch (token.type) {
  2626. case 'paragraph':
  2627. case 'text':
  2628. case 'heading': {
  2629. token.tokens = [];
  2630. this.inlineTokens(token.text, token.tokens);
  2631. break;
  2632. }
  2633. case 'table': {
  2634. token.tokens = {
  2635. header: [],
  2636. cells: []
  2637. };
  2638. // header
  2639. l2 = token.header.length;
  2640. for (j = 0; j < l2; j++) {
  2641. token.tokens.header[j] = [];
  2642. this.inlineTokens(token.header[j], token.tokens.header[j]);
  2643. }
  2644. // cells
  2645. l2 = token.cells.length;
  2646. for (j = 0; j < l2; j++) {
  2647. row = token.cells[j];
  2648. token.tokens.cells[j] = [];
  2649. for (k = 0; k < row.length; k++) {
  2650. token.tokens.cells[j][k] = [];
  2651. this.inlineTokens(row[k], token.tokens.cells[j][k]);
  2652. }
  2653. }
  2654. break;
  2655. }
  2656. case 'blockquote': {
  2657. this.inline(token.tokens);
  2658. break;
  2659. }
  2660. case 'list': {
  2661. l2 = token.items.length;
  2662. for (j = 0; j < l2; j++) {
  2663. this.inline(token.items[j].tokens);
  2664. }
  2665. break;
  2666. }
  2667. }
  2668. }
  2669. return tokens;
  2670. };
  2671. /**
  2672. * Lexing/Compiling
  2673. */
  2674. Lexer.prototype.inlineTokens = function inlineTokens (src, tokens, inLink, inRawBlock) {
  2675. if ( tokens === void 0 ) tokens = [];
  2676. if ( inLink === void 0 ) inLink = false;
  2677. if ( inRawBlock === void 0 ) inRawBlock = false;
  2678. var token;
  2679. // String with links masked to avoid interference with em and strong
  2680. var maskedSrc = src;
  2681. var match;
  2682. var keepPrevChar, prevChar;
  2683. // Mask out reflinks
  2684. if (this.tokens.links) {
  2685. var links = Object.keys(this.tokens.links);
  2686. if (links.length > 0) {
  2687. while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {
  2688. if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {
  2689. maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString$1('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);
  2690. }
  2691. }
  2692. }
  2693. }
  2694. // Mask out other blocks
  2695. while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {
  2696. maskedSrc = maskedSrc.slice(0, match.index) + '[' + repeatString$1('a', match[0].length - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
  2697. }
  2698. while (src) {
  2699. if (!keepPrevChar) {
  2700. prevChar = '';
  2701. }
  2702. keepPrevChar = false;
  2703. // escape
  2704. if (token = this.tokenizer.escape(src)) {
  2705. src = src.substring(token.raw.length);
  2706. tokens.push(token);
  2707. continue;
  2708. }
  2709. // tag
  2710. if (token = this.tokenizer.tag(src, inLink, inRawBlock)) {
  2711. src = src.substring(token.raw.length);
  2712. inLink = token.inLink;
  2713. inRawBlock = token.inRawBlock;
  2714. tokens.push(token);
  2715. continue;
  2716. }
  2717. // link
  2718. if (token = this.tokenizer.link(src)) {
  2719. src = src.substring(token.raw.length);
  2720. if (token.type === 'link') {
  2721. token.tokens = this.inlineTokens(token.text, [], true, inRawBlock);
  2722. }
  2723. tokens.push(token);
  2724. continue;
  2725. }
  2726. // reflink, nolink
  2727. if (token = this.tokenizer.reflink(src, this.tokens.links)) {
  2728. src = src.substring(token.raw.length);
  2729. if (token.type === 'link') {
  2730. token.tokens = this.inlineTokens(token.text, [], true, inRawBlock);
  2731. }
  2732. tokens.push(token);
  2733. continue;
  2734. }
  2735. // strong
  2736. if (token = this.tokenizer.strong(src, maskedSrc, prevChar)) {
  2737. src = src.substring(token.raw.length);
  2738. token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock);
  2739. tokens.push(token);
  2740. continue;
  2741. }
  2742. // em
  2743. if (token = this.tokenizer.em(src, maskedSrc, prevChar)) {
  2744. src = src.substring(token.raw.length);
  2745. token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock);
  2746. tokens.push(token);
  2747. continue;
  2748. }
  2749. // code
  2750. if (token = this.tokenizer.codespan(src)) {
  2751. src = src.substring(token.raw.length);
  2752. tokens.push(token);
  2753. continue;
  2754. }
  2755. // br
  2756. if (token = this.tokenizer.br(src)) {
  2757. src = src.substring(token.raw.length);
  2758. tokens.push(token);
  2759. continue;
  2760. }
  2761. // del (gfm)
  2762. if (token = this.tokenizer.del(src)) {
  2763. src = src.substring(token.raw.length);
  2764. token.tokens = this.inlineTokens(token.text, [], inLink, inRawBlock);
  2765. tokens.push(token);
  2766. continue;
  2767. }
  2768. // autolink
  2769. if (token = this.tokenizer.autolink(src, mangle)) {
  2770. src = src.substring(token.raw.length);
  2771. tokens.push(token);
  2772. continue;
  2773. }
  2774. // url (gfm)
  2775. if (!inLink && (token = this.tokenizer.url(src, mangle))) {
  2776. src = src.substring(token.raw.length);
  2777. tokens.push(token);
  2778. continue;
  2779. }
  2780. // text
  2781. if (token = this.tokenizer.inlineText(src, inRawBlock, smartypants)) {
  2782. src = src.substring(token.raw.length);
  2783. prevChar = token.raw.slice(-1);
  2784. keepPrevChar = true;
  2785. tokens.push(token);
  2786. continue;
  2787. }
  2788. if (src) {
  2789. var errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);
  2790. if (this.options.silent) {
  2791. console.error(errMsg);
  2792. break;
  2793. } else {
  2794. throw new Error(errMsg);
  2795. }
  2796. }
  2797. }
  2798. return tokens;
  2799. };
  2800. Object.defineProperties( Lexer, staticAccessors );
  2801. return Lexer;
  2802. }());
  2803. var defaults$3 = defaults.defaults;
  2804. var cleanUrl$1 = helpers.cleanUrl;
  2805. var escape$2 = helpers.escape;
  2806. /**
  2807. * Renderer
  2808. */
  2809. var Renderer = /*@__PURE__*/(function () {
  2810. function Renderer(options) {
  2811. this.options = options || defaults$3;
  2812. }
  2813. Renderer.prototype.code = function code (code$1, infostring, escaped) {
  2814. var lang = (infostring || '').match(/\S*/)[0];
  2815. if (this.options.highlight) {
  2816. var out = this.options.highlight(code$1, lang);
  2817. if (out != null && out !== code$1) {
  2818. escaped = true;
  2819. code$1 = out;
  2820. }
  2821. }
  2822. code$1 = code$1.replace(/\n$/, '') + '\n';
  2823. if (!lang) {
  2824. return '<pre><code>'
  2825. + (escaped ? code$1 : escape$2(code$1, true))
  2826. + '</code></pre>\n';
  2827. }
  2828. return '<pre><code class="'
  2829. + this.options.langPrefix
  2830. + escape$2(lang, true)
  2831. + '">'
  2832. + (escaped ? code$1 : escape$2(code$1, true))
  2833. + '</code></pre>\n';
  2834. };
  2835. Renderer.prototype.blockquote = function blockquote (quote) {
  2836. return '<blockquote>\n' + quote + '</blockquote>\n';
  2837. };
  2838. Renderer.prototype.html = function html (html$1) {
  2839. return html$1;
  2840. };
  2841. Renderer.prototype.heading = function heading (text, level, raw, slugger) {
  2842. if (this.options.headerIds) {
  2843. return '<h'
  2844. + level
  2845. + ' id="'
  2846. + this.options.headerPrefix
  2847. + slugger.slug(raw)
  2848. + '">'
  2849. + text
  2850. + '</h'
  2851. + level
  2852. + '>\n';
  2853. }
  2854. // ignore IDs
  2855. return '<h' + level + '>' + text + '</h' + level + '>\n';
  2856. };
  2857. Renderer.prototype.hr = function hr () {
  2858. return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
  2859. };
  2860. Renderer.prototype.list = function list (body, ordered, start) {
  2861. var type = ordered ? 'ol' : 'ul',
  2862. startatt = (ordered && start !== 1) ? (' start="' + start + '"') : '';
  2863. return '<' + type + startatt + '>\n' + body + '</' + type + '>\n';
  2864. };
  2865. Renderer.prototype.listitem = function listitem (text) {
  2866. return '<li>' + text + '</li>\n';
  2867. };
  2868. Renderer.prototype.checkbox = function checkbox (checked) {
  2869. return '<input '
  2870. + (checked ? 'checked="" ' : '')
  2871. + 'disabled="" type="checkbox"'
  2872. + (this.options.xhtml ? ' /' : '')
  2873. + '> ';
  2874. };
  2875. Renderer.prototype.paragraph = function paragraph (text) {
  2876. return '<p>' + text + '</p>\n';
  2877. };
  2878. Renderer.prototype.table = function table (header, body) {
  2879. if (body) { body = '<tbody>' + body + '</tbody>'; }
  2880. return '<table>\n'
  2881. + '<thead>\n'
  2882. + header
  2883. + '</thead>\n'
  2884. + body
  2885. + '</table>\n';
  2886. };
  2887. Renderer.prototype.tablerow = function tablerow (content) {
  2888. return '<tr>\n' + content + '</tr>\n';
  2889. };
  2890. Renderer.prototype.tablecell = function tablecell (content, flags) {
  2891. var type = flags.header ? 'th' : 'td';
  2892. var tag = flags.align
  2893. ? '<' + type + ' align="' + flags.align + '">'
  2894. : '<' + type + '>';
  2895. return tag + content + '</' + type + '>\n';
  2896. };
  2897. // span level renderer
  2898. Renderer.prototype.strong = function strong (text) {
  2899. return '<strong>' + text + '</strong>';
  2900. };
  2901. Renderer.prototype.em = function em (text) {
  2902. return '<em>' + text + '</em>';
  2903. };
  2904. Renderer.prototype.codespan = function codespan (text) {
  2905. return '<code>' + text + '</code>';
  2906. };
  2907. Renderer.prototype.br = function br () {
  2908. return this.options.xhtml ? '<br/>' : '<br>';
  2909. };
  2910. Renderer.prototype.del = function del (text) {
  2911. return '<del>' + text + '</del>';
  2912. };
  2913. Renderer.prototype.link = function link (href, title, text) {
  2914. href = cleanUrl$1(this.options.sanitize, this.options.baseUrl, href);
  2915. if (href === null) {
  2916. return text;
  2917. }
  2918. var out = '<a href="' + escape$2(href) + '"';
  2919. if (title) {
  2920. out += ' title="' + title + '"';
  2921. }
  2922. out += '>' + text + '</a>';
  2923. return out;
  2924. };
  2925. Renderer.prototype.image = function image (href, title, text) {
  2926. href = cleanUrl$1(this.options.sanitize, this.options.baseUrl, href);
  2927. if (href === null) {
  2928. return text;
  2929. }
  2930. var out = '<img src="' + href + '" alt="' + text + '"';
  2931. if (title) {
  2932. out += ' title="' + title + '"';
  2933. }
  2934. out += this.options.xhtml ? '/>' : '>';
  2935. return out;
  2936. };
  2937. Renderer.prototype.text = function text (text$1) {
  2938. return text$1;
  2939. };
  2940. return Renderer;
  2941. }());
  2942. /**
  2943. * TextRenderer
  2944. * returns only the textual part of the token
  2945. */
  2946. var TextRenderer = /*@__PURE__*/(function () {
  2947. function TextRenderer () {}
  2948. TextRenderer.prototype.strong = function strong (text) {
  2949. return text;
  2950. };
  2951. TextRenderer.prototype.em = function em (text) {
  2952. return text;
  2953. };
  2954. TextRenderer.prototype.codespan = function codespan (text) {
  2955. return text;
  2956. };
  2957. TextRenderer.prototype.del = function del (text) {
  2958. return text;
  2959. };
  2960. TextRenderer.prototype.html = function html (text) {
  2961. return text;
  2962. };
  2963. TextRenderer.prototype.text = function text (text$1) {
  2964. return text$1;
  2965. };
  2966. TextRenderer.prototype.link = function link (href, title, text) {
  2967. return '' + text;
  2968. };
  2969. TextRenderer.prototype.image = function image (href, title, text) {
  2970. return '' + text;
  2971. };
  2972. TextRenderer.prototype.br = function br () {
  2973. return '';
  2974. };
  2975. return TextRenderer;
  2976. }());
  2977. /**
  2978. * Slugger generates header id
  2979. */
  2980. var Slugger = /*@__PURE__*/(function () {
  2981. function Slugger() {
  2982. this.seen = {};
  2983. }
  2984. Slugger.prototype.serialize = function serialize (value) {
  2985. return value
  2986. .toLowerCase()
  2987. .trim()
  2988. // remove html tags
  2989. .replace(/<[!\/a-z].*?>/ig, '')
  2990. // remove unwanted chars
  2991. .replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, '')
  2992. .replace(/\s/g, '-');
  2993. };
  2994. /**
  2995. * Finds the next safe (unique) slug to use
  2996. */
  2997. Slugger.prototype.getNextSafeSlug = function getNextSafeSlug (originalSlug, isDryRun) {
  2998. var slug = originalSlug;
  2999. var occurenceAccumulator = 0;
  3000. if (this.seen.hasOwnProperty(slug)) {
  3001. occurenceAccumulator = this.seen[originalSlug];
  3002. do {
  3003. occurenceAccumulator++;
  3004. slug = originalSlug + '-' + occurenceAccumulator;
  3005. } while (this.seen.hasOwnProperty(slug));
  3006. }
  3007. if (!isDryRun) {
  3008. this.seen[originalSlug] = occurenceAccumulator;
  3009. this.seen[slug] = 0;
  3010. }
  3011. return slug;
  3012. };
  3013. /**
  3014. * Convert string to unique id
  3015. * @param {object} options
  3016. * @param {boolean} options.dryrun Generates the next unique slug without updating the internal accumulator.
  3017. */
  3018. Slugger.prototype.slug = function slug (value, options) {
  3019. if ( options === void 0 ) options = {};
  3020. var slug = this.serialize(value);
  3021. return this.getNextSafeSlug(slug, options.dryrun);
  3022. };
  3023. return Slugger;
  3024. }());
  3025. var defaults$4 = defaults.defaults;
  3026. var unescape$1 = helpers.unescape;
  3027. /**
  3028. * Parsing & Compiling
  3029. */
  3030. var Parser = /*@__PURE__*/(function () {
  3031. function Parser(options) {
  3032. this.options = options || defaults$4;
  3033. this.options.renderer = this.options.renderer || new Renderer();
  3034. this.renderer = this.options.renderer;
  3035. this.renderer.options = this.options;
  3036. this.textRenderer = new TextRenderer();
  3037. this.slugger = new Slugger();
  3038. }
  3039. /**
  3040. * Static Parse Method
  3041. */
  3042. Parser.parse = function parse (tokens, options) {
  3043. var parser = new Parser(options);
  3044. return parser.parse(tokens);
  3045. };
  3046. /**
  3047. * Static Parse Inline Method
  3048. */
  3049. Parser.parseInline = function parseInline (tokens, options) {
  3050. var parser = new Parser(options);
  3051. return parser.parseInline(tokens);
  3052. };
  3053. /**
  3054. * Parse Loop
  3055. */
  3056. Parser.prototype.parse = function parse (tokens, top) {
  3057. if ( top === void 0 ) top = true;
  3058. var out = '',
  3059. i,
  3060. j,
  3061. k,
  3062. l2,
  3063. l3,
  3064. row,
  3065. cell,
  3066. header,
  3067. body,
  3068. token,
  3069. ordered,
  3070. start,
  3071. loose,
  3072. itemBody,
  3073. item,
  3074. checked,
  3075. task,
  3076. checkbox;
  3077. var l = tokens.length;
  3078. for (i = 0; i < l; i++) {
  3079. token = tokens[i];
  3080. switch (token.type) {
  3081. case 'space': {
  3082. continue;
  3083. }
  3084. case 'hr': {
  3085. out += this.renderer.hr();
  3086. continue;
  3087. }
  3088. case 'heading': {
  3089. out += this.renderer.heading(
  3090. this.parseInline(token.tokens),
  3091. token.depth,
  3092. unescape$1(this.parseInline(token.tokens, this.textRenderer)),
  3093. this.slugger);
  3094. continue;
  3095. }
  3096. case 'code': {
  3097. out += this.renderer.code(token.text,
  3098. token.lang,
  3099. token.escaped);
  3100. continue;
  3101. }
  3102. case 'table': {
  3103. header = '';
  3104. // header
  3105. cell = '';
  3106. l2 = token.header.length;
  3107. for (j = 0; j < l2; j++) {
  3108. cell += this.renderer.tablecell(
  3109. this.parseInline(token.tokens.header[j]),
  3110. { header: true, align: token.align[j] }
  3111. );
  3112. }
  3113. header += this.renderer.tablerow(cell);
  3114. body = '';
  3115. l2 = token.cells.length;
  3116. for (j = 0; j < l2; j++) {
  3117. row = token.tokens.cells[j];
  3118. cell = '';
  3119. l3 = row.length;
  3120. for (k = 0; k < l3; k++) {
  3121. cell += this.renderer.tablecell(
  3122. this.parseInline(row[k]),
  3123. { header: false, align: token.align[k] }
  3124. );
  3125. }
  3126. body += this.renderer.tablerow(cell);
  3127. }
  3128. out += this.renderer.table(header, body);
  3129. continue;
  3130. }
  3131. case 'blockquote': {
  3132. body = this.parse(token.tokens);
  3133. out += this.renderer.blockquote(body);
  3134. continue;
  3135. }
  3136. case 'list': {
  3137. ordered = token.ordered;
  3138. start = token.start;
  3139. loose = token.loose;
  3140. l2 = token.items.length;
  3141. body = '';
  3142. for (j = 0; j < l2; j++) {
  3143. item = token.items[j];
  3144. checked = item.checked;
  3145. task = item.task;
  3146. itemBody = '';
  3147. if (item.task) {
  3148. checkbox = this.renderer.checkbox(checked);
  3149. if (loose) {
  3150. if (item.tokens.length > 0 && item.tokens[0].type === 'text') {
  3151. item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;
  3152. if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {
  3153. item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;
  3154. }
  3155. } else {
  3156. item.tokens.unshift({
  3157. type: 'text',
  3158. text: checkbox
  3159. });
  3160. }
  3161. } else {
  3162. itemBody += checkbox;
  3163. }
  3164. }
  3165. itemBody += this.parse(item.tokens, loose);
  3166. body += this.renderer.listitem(itemBody, task, checked);
  3167. }
  3168. out += this.renderer.list(body, ordered, start);
  3169. continue;
  3170. }
  3171. case 'html': {
  3172. // TODO parse inline content if parameter markdown=1
  3173. out += this.renderer.html(token.text);
  3174. continue;
  3175. }
  3176. case 'paragraph': {
  3177. out += this.renderer.paragraph(this.parseInline(token.tokens));
  3178. continue;
  3179. }
  3180. case 'text': {
  3181. body = token.tokens ? this.parseInline(token.tokens) : token.text;
  3182. while (i + 1 < l && tokens[i + 1].type === 'text') {
  3183. token = tokens[++i];
  3184. body += '\n' + (token.tokens ? this.parseInline(token.tokens) : token.text);
  3185. }
  3186. out += top ? this.renderer.paragraph(body) : body;
  3187. continue;
  3188. }
  3189. default: {
  3190. var errMsg = 'Token with "' + token.type + '" type was not found.';
  3191. if (this.options.silent) {
  3192. console.error(errMsg);
  3193. return;
  3194. } else {
  3195. throw new Error(errMsg);
  3196. }
  3197. }
  3198. }
  3199. }
  3200. return out;
  3201. };
  3202. /**
  3203. * Parse Inline Tokens
  3204. */
  3205. Parser.prototype.parseInline = function parseInline (tokens, renderer) {
  3206. renderer = renderer || this.renderer;
  3207. var out = '',
  3208. i,
  3209. token;
  3210. var l = tokens.length;
  3211. for (i = 0; i < l; i++) {
  3212. token = tokens[i];
  3213. switch (token.type) {
  3214. case 'escape': {
  3215. out += renderer.text(token.text);
  3216. break;
  3217. }
  3218. case 'html': {
  3219. out += renderer.html(token.text);
  3220. break;
  3221. }
  3222. case 'link': {
  3223. out += renderer.link(token.href, token.title, this.parseInline(token.tokens, renderer));
  3224. break;
  3225. }
  3226. case 'image': {
  3227. out += renderer.image(token.href, token.title, token.text);
  3228. break;
  3229. }
  3230. case 'strong': {
  3231. out += renderer.strong(this.parseInline(token.tokens, renderer));
  3232. break;
  3233. }
  3234. case 'em': {
  3235. out += renderer.em(this.parseInline(token.tokens, renderer));
  3236. break;
  3237. }
  3238. case 'codespan': {
  3239. out += renderer.codespan(token.text);
  3240. break;
  3241. }
  3242. case 'br': {
  3243. out += renderer.br();
  3244. break;
  3245. }
  3246. case 'del': {
  3247. out += renderer.del(this.parseInline(token.tokens, renderer));
  3248. break;
  3249. }
  3250. case 'text': {
  3251. out += renderer.text(token.text);
  3252. break;
  3253. }
  3254. default: {
  3255. var errMsg = 'Token with "' + token.type + '" type was not found.';
  3256. if (this.options.silent) {
  3257. console.error(errMsg);
  3258. return;
  3259. } else {
  3260. throw new Error(errMsg);
  3261. }
  3262. }
  3263. }
  3264. }
  3265. return out;
  3266. };
  3267. return Parser;
  3268. }());
  3269. var merge$3 = helpers.merge;
  3270. var checkSanitizeDeprecation$1 = helpers.checkSanitizeDeprecation;
  3271. var escape$3 = helpers.escape;
  3272. var getDefaults = defaults.getDefaults;
  3273. var changeDefaults = defaults.changeDefaults;
  3274. var defaults$5 = defaults.defaults;
  3275. /**
  3276. * Marked
  3277. */
  3278. function marked(src, opt, callback) {
  3279. // throw error in case of non string input
  3280. if (typeof src === 'undefined' || src === null) {
  3281. throw new Error('marked(): input parameter is undefined or null');
  3282. }
  3283. if (typeof src !== 'string') {
  3284. throw new Error('marked(): input parameter is of type '
  3285. + Object.prototype.toString.call(src) + ', string expected');
  3286. }
  3287. if (typeof opt === 'function') {
  3288. callback = opt;
  3289. opt = null;
  3290. }
  3291. opt = merge$3({}, marked.defaults, opt || {});
  3292. checkSanitizeDeprecation$1(opt);
  3293. if (callback) {
  3294. var highlight = opt.highlight;
  3295. var tokens;
  3296. try {
  3297. tokens = Lexer.lex(src, opt);
  3298. } catch (e) {
  3299. return callback(e);
  3300. }
  3301. var done = function(err) {
  3302. var out;
  3303. if (!err) {
  3304. try {
  3305. out = Parser.parse(tokens, opt);
  3306. } catch (e) {
  3307. err = e;
  3308. }
  3309. }
  3310. opt.highlight = highlight;
  3311. return err
  3312. ? callback(err)
  3313. : callback(null, out);
  3314. };
  3315. if (!highlight || highlight.length < 3) {
  3316. return done();
  3317. }
  3318. delete opt.highlight;
  3319. if (!tokens.length) { return done(); }
  3320. var pending = 0;
  3321. marked.walkTokens(tokens, function(token) {
  3322. if (token.type === 'code') {
  3323. pending++;
  3324. setTimeout(function () {
  3325. highlight(token.text, token.lang, function(err, code) {
  3326. if (err) {
  3327. return done(err);
  3328. }
  3329. if (code != null && code !== token.text) {
  3330. token.text = code;
  3331. token.escaped = true;
  3332. }
  3333. pending--;
  3334. if (pending === 0) {
  3335. done();
  3336. }
  3337. });
  3338. }, 0);
  3339. }
  3340. });
  3341. if (pending === 0) {
  3342. done();
  3343. }
  3344. return;
  3345. }
  3346. try {
  3347. var tokens$1 = Lexer.lex(src, opt);
  3348. if (opt.walkTokens) {
  3349. marked.walkTokens(tokens$1, opt.walkTokens);
  3350. }
  3351. return Parser.parse(tokens$1, opt);
  3352. } catch (e) {
  3353. e.message += '\nPlease report this to https://github.com/markedjs/marked.';
  3354. if (opt.silent) {
  3355. return '<p>An error occurred:</p><pre>'
  3356. + escape$3(e.message + '', true)
  3357. + '</pre>';
  3358. }
  3359. throw e;
  3360. }
  3361. }
  3362. /**
  3363. * Options
  3364. */
  3365. marked.options =
  3366. marked.setOptions = function(opt) {
  3367. merge$3(marked.defaults, opt);
  3368. changeDefaults(marked.defaults);
  3369. return marked;
  3370. };
  3371. marked.getDefaults = getDefaults;
  3372. marked.defaults = defaults$5;
  3373. /**
  3374. * Use Extension
  3375. */
  3376. marked.use = function(extension) {
  3377. var opts = merge$3({}, extension);
  3378. if (extension.renderer) {
  3379. var renderer = marked.defaults.renderer || new Renderer();
  3380. var loop = function ( prop ) {
  3381. var prevRenderer = renderer[prop];
  3382. renderer[prop] = function () {
  3383. var args = [], len = arguments.length;
  3384. while ( len-- ) args[ len ] = arguments[ len ];
  3385. var ret = extension.renderer[prop].apply(renderer, args);
  3386. if (ret === false) {
  3387. ret = prevRenderer.apply(renderer, args);
  3388. }
  3389. return ret;
  3390. };
  3391. };
  3392. for (var prop in extension.renderer) loop( prop );
  3393. opts.renderer = renderer;
  3394. }
  3395. if (extension.tokenizer) {
  3396. var tokenizer = marked.defaults.tokenizer || new Tokenizer();
  3397. var loop$1 = function ( prop ) {
  3398. var prevTokenizer = tokenizer[prop$1];
  3399. tokenizer[prop$1] = function () {
  3400. var args = [], len = arguments.length;
  3401. while ( len-- ) args[ len ] = arguments[ len ];
  3402. var ret = extension.tokenizer[prop$1].apply(tokenizer, args);
  3403. if (ret === false) {
  3404. ret = prevTokenizer.apply(tokenizer, args);
  3405. }
  3406. return ret;
  3407. };
  3408. };
  3409. for (var prop$1 in extension.tokenizer) loop$1( prop );
  3410. opts.tokenizer = tokenizer;
  3411. }
  3412. if (extension.walkTokens) {
  3413. var walkTokens = marked.defaults.walkTokens;
  3414. opts.walkTokens = function (token) {
  3415. extension.walkTokens(token);
  3416. if (walkTokens) {
  3417. walkTokens(token);
  3418. }
  3419. };
  3420. }
  3421. marked.setOptions(opts);
  3422. };
  3423. /**
  3424. * Run callback for every token
  3425. */
  3426. marked.walkTokens = function(tokens, callback) {
  3427. for (var i$3 = 0, list$3 = tokens; i$3 < list$3.length; i$3 += 1) {
  3428. var token = list$3[i$3];
  3429. callback(token);
  3430. switch (token.type) {
  3431. case 'table': {
  3432. for (var i = 0, list = token.tokens.header; i < list.length; i += 1) {
  3433. var cell = list[i];
  3434. marked.walkTokens(cell, callback);
  3435. }
  3436. for (var i$2 = 0, list$2 = token.tokens.cells; i$2 < list$2.length; i$2 += 1) {
  3437. var row = list$2[i$2];
  3438. for (var i$1 = 0, list$1 = row; i$1 < list$1.length; i$1 += 1) {
  3439. var cell$1 = list$1[i$1];
  3440. marked.walkTokens(cell$1, callback);
  3441. }
  3442. }
  3443. break;
  3444. }
  3445. case 'list': {
  3446. marked.walkTokens(token.items, callback);
  3447. break;
  3448. }
  3449. default: {
  3450. if (token.tokens) {
  3451. marked.walkTokens(token.tokens, callback);
  3452. }
  3453. }
  3454. }
  3455. }
  3456. };
  3457. /**
  3458. * Parse Inline
  3459. */
  3460. marked.parseInline = function(src, opt) {
  3461. // throw error in case of non string input
  3462. if (typeof src === 'undefined' || src === null) {
  3463. throw new Error('marked.parseInline(): input parameter is undefined or null');
  3464. }
  3465. if (typeof src !== 'string') {
  3466. throw new Error('marked.parseInline(): input parameter is of type '
  3467. + Object.prototype.toString.call(src) + ', string expected');
  3468. }
  3469. opt = merge$3({}, marked.defaults, opt || {});
  3470. checkSanitizeDeprecation$1(opt);
  3471. try {
  3472. var tokens = Lexer.lexInline(src, opt);
  3473. if (opt.walkTokens) {
  3474. marked.walkTokens(tokens, opt.walkTokens);
  3475. }
  3476. return Parser.parseInline(tokens, opt);
  3477. } catch (e) {
  3478. e.message += '\nPlease report this to https://github.com/markedjs/marked.';
  3479. if (opt.silent) {
  3480. return '<p>An error occurred:</p><pre>'
  3481. + escape$3(e.message + '', true)
  3482. + '</pre>';
  3483. }
  3484. throw e;
  3485. }
  3486. };
  3487. /**
  3488. * Expose
  3489. */
  3490. marked.Parser = Parser;
  3491. marked.parser = Parser.parse;
  3492. marked.Renderer = Renderer;
  3493. marked.TextRenderer = TextRenderer;
  3494. marked.Lexer = Lexer;
  3495. marked.lexer = Lexer.lex;
  3496. marked.Tokenizer = Tokenizer;
  3497. marked.Slugger = Slugger;
  3498. marked.parse = marked;
  3499. var marked_1 = marked;
  3500. /**
  3501. * Render github corner
  3502. * @param {Object} data URL for the View Source on Github link
  3503. * @param {String} cornerExternalLinkTarget value of the target attribute of the link
  3504. * @return {String} SVG element as string
  3505. */
  3506. function corner(data, cornerExternalLinkTarget) {
  3507. if (!data) {
  3508. return '';
  3509. }
  3510. if (!/\/\//.test(data)) {
  3511. data = 'https://github.com/' + data;
  3512. }
  3513. data = data.replace(/^git\+/, '');
  3514. // Double check
  3515. cornerExternalLinkTarget = cornerExternalLinkTarget || '_blank';
  3516. return (
  3517. "<a href=\"" + data + "\" target=\"" + cornerExternalLinkTarget + "\" class=\"github-corner\" aria-label=\"View source on Github\">" +
  3518. '<svg viewBox="0 0 250 250" aria-hidden="true">' +
  3519. '<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>' +
  3520. '<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>' +
  3521. '<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>' +
  3522. '</svg>' +
  3523. '</a>'
  3524. );
  3525. }
  3526. /**
  3527. * Renders main content
  3528. * @param {Object} config Configuration object
  3529. * @returns {String} HTML of the main content
  3530. */
  3531. function main(config) {
  3532. var name = config.name ? config.name : '';
  3533. var aside =
  3534. '<button class="sidebar-toggle" aria-label="Menu">' +
  3535. '<div class="sidebar-toggle-button">' +
  3536. '<span></span><span></span><span></span>' +
  3537. '</div>' +
  3538. '</button>' +
  3539. '<aside class="sidebar">' +
  3540. (config.name
  3541. ? ("<h1 class=\"app-name\"><a class=\"app-name-link\" data-nosearch>" + (config.logo ? ("<img alt=\"" + name + "\" src=" + (config.logo) + ">") : name) + "</a></h1>")
  3542. : '') +
  3543. '<div class="sidebar-nav"><!--sidebar--></div>' +
  3544. '</aside>';
  3545. return (
  3546. "<main>" + aside +
  3547. '<section class="content">' +
  3548. '<article class="markdown-section" id="main"><!--main--></article>' +
  3549. '</section>' +
  3550. '</main>'
  3551. );
  3552. }
  3553. /**
  3554. * Cover Page
  3555. * @returns {String} Cover page
  3556. */
  3557. function cover() {
  3558. var SL = ', 100%, 85%';
  3559. var bgc =
  3560. 'linear-gradient(to left bottom, ' +
  3561. "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 0%," +
  3562. "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 100%)";
  3563. return (
  3564. "<section class=\"cover show\" style=\"background: " + bgc + "\">" +
  3565. '<div class="mask"></div>' +
  3566. '<div class="cover-main"><!--cover--></div>' +
  3567. '</section>'
  3568. );
  3569. }
  3570. /**
  3571. * Render tree
  3572. * @param {Array} toc Array of TOC section links
  3573. * @param {String} tpl TPL list
  3574. * @return {String} Rendered tree
  3575. */
  3576. function tree(toc, tpl) {
  3577. if ( tpl === void 0 ) tpl = '<ul class="app-sub-sidebar">{inner}</ul>';
  3578. if (!toc || !toc.length) {
  3579. return '';
  3580. }
  3581. var innerHTML = '';
  3582. toc.forEach(function (node) {
  3583. var title = node.title.replace(/(<([^>]+)>)/g, '');
  3584. innerHTML += "<li><a class=\"section-link\" href=\"" + (node.slug) + "\" title=\"" + title + "\">" + (node.title) + "</a></li>";
  3585. if (node.children) {
  3586. innerHTML += tree(node.children, tpl);
  3587. }
  3588. });
  3589. return tpl.replace('{inner}', innerHTML);
  3590. }
  3591. function helper(className, content) {
  3592. return ("<p class=\"" + className + "\">" + (content.slice(5).trim()) + "</p>");
  3593. }
  3594. function theme(color) {
  3595. return ("<style>:root{--theme-color: " + color + ";}</style>");
  3596. }
  3597. /**
  3598. * Gen toc tree
  3599. * @link https://github.com/killercup/grock/blob/5280ae63e16c5739e9233d9009bc235ed7d79a50/styles/solarized/assets/js/behavior.coffee#L54-L81
  3600. * @param {Array} toc List of TOC elements
  3601. * @param {Number} maxLevel Deep level
  3602. * @return {Array} Headlines
  3603. */
  3604. function genTree(toc, maxLevel) {
  3605. var headlines = [];
  3606. var last = {};
  3607. toc.forEach(function (headline) {
  3608. var level = headline.level || 1;
  3609. var len = level - 1;
  3610. if (level > maxLevel) {
  3611. return;
  3612. }
  3613. if (last[len]) {
  3614. last[len].children = (last[len].children || []).concat(headline);
  3615. } else {
  3616. headlines.push(headline);
  3617. }
  3618. last[level] = headline;
  3619. });
  3620. return headlines;
  3621. }
  3622. var cache$1 = {};
  3623. var re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g;
  3624. function lower(string) {
  3625. return string.toLowerCase();
  3626. }
  3627. function slugify(str) {
  3628. if (typeof str !== 'string') {
  3629. return '';
  3630. }
  3631. var slug = str
  3632. .trim()
  3633. .replace(/[A-Z]+/g, lower)
  3634. .replace(/<[^>]+>/g, '')
  3635. .replace(re, '')
  3636. .replace(/\s/g, '-')
  3637. .replace(/-+/g, '-')
  3638. .replace(/^(\d)/, '_$1');
  3639. var count = cache$1[slug];
  3640. count = hasOwn.call(cache$1, slug) ? count + 1 : 0;
  3641. cache$1[slug] = count;
  3642. if (count) {
  3643. slug = slug + '-' + count;
  3644. }
  3645. return slug;
  3646. }
  3647. slugify.clear = function () {
  3648. cache$1 = {};
  3649. };
  3650. /* eslint-disable */
  3651. // =============================================================================
  3652. // DO NOT EDIT: This file is auto-generated by an /build/emoji.js
  3653. // =============================================================================
  3654. var emojiData = {
  3655. "baseURL": "https://github.githubassets.com/images/icons/emoji/",
  3656. "data": {
  3657. "100": "unicode/1f4af.png?v8",
  3658. "1234": "unicode/1f522.png?v8",
  3659. "+1": "unicode/1f44d.png?v8",
  3660. "-1": "unicode/1f44e.png?v8",
  3661. "1st_place_medal": "unicode/1f947.png?v8",
  3662. "2nd_place_medal": "unicode/1f948.png?v8",
  3663. "3rd_place_medal": "unicode/1f949.png?v8",
  3664. "8ball": "unicode/1f3b1.png?v8",
  3665. "a": "unicode/1f170.png?v8",
  3666. "ab": "unicode/1f18e.png?v8",
  3667. "abacus": "unicode/1f9ee.png?v8",
  3668. "abc": "unicode/1f524.png?v8",
  3669. "abcd": "unicode/1f521.png?v8",
  3670. "accept": "unicode/1f251.png?v8",
  3671. "accessibility": "accessibility.png?v8",
  3672. "accordion": "unicode/1fa97.png?v8",
  3673. "adhesive_bandage": "unicode/1fa79.png?v8",
  3674. "adult": "unicode/1f9d1.png?v8",
  3675. "aerial_tramway": "unicode/1f6a1.png?v8",
  3676. "afghanistan": "unicode/1f1e6-1f1eb.png?v8",
  3677. "airplane": "unicode/2708.png?v8",
  3678. "aland_islands": "unicode/1f1e6-1f1fd.png?v8",
  3679. "alarm_clock": "unicode/23f0.png?v8",
  3680. "albania": "unicode/1f1e6-1f1f1.png?v8",
  3681. "alembic": "unicode/2697.png?v8",
  3682. "algeria": "unicode/1f1e9-1f1ff.png?v8",
  3683. "alien": "unicode/1f47d.png?v8",
  3684. "ambulance": "unicode/1f691.png?v8",
  3685. "american_samoa": "unicode/1f1e6-1f1f8.png?v8",
  3686. "amphora": "unicode/1f3fa.png?v8",
  3687. "anatomical_heart": "unicode/1fac0.png?v8",
  3688. "anchor": "unicode/2693.png?v8",
  3689. "andorra": "unicode/1f1e6-1f1e9.png?v8",
  3690. "angel": "unicode/1f47c.png?v8",
  3691. "anger": "unicode/1f4a2.png?v8",
  3692. "angola": "unicode/1f1e6-1f1f4.png?v8",
  3693. "angry": "unicode/1f620.png?v8",
  3694. "anguilla": "unicode/1f1e6-1f1ee.png?v8",
  3695. "anguished": "unicode/1f627.png?v8",
  3696. "ant": "unicode/1f41c.png?v8",
  3697. "antarctica": "unicode/1f1e6-1f1f6.png?v8",
  3698. "antigua_barbuda": "unicode/1f1e6-1f1ec.png?v8",
  3699. "apple": "unicode/1f34e.png?v8",
  3700. "aquarius": "unicode/2652.png?v8",
  3701. "argentina": "unicode/1f1e6-1f1f7.png?v8",
  3702. "aries": "unicode/2648.png?v8",
  3703. "armenia": "unicode/1f1e6-1f1f2.png?v8",
  3704. "arrow_backward": "unicode/25c0.png?v8",
  3705. "arrow_double_down": "unicode/23ec.png?v8",
  3706. "arrow_double_up": "unicode/23eb.png?v8",
  3707. "arrow_down": "unicode/2b07.png?v8",
  3708. "arrow_down_small": "unicode/1f53d.png?v8",
  3709. "arrow_forward": "unicode/25b6.png?v8",
  3710. "arrow_heading_down": "unicode/2935.png?v8",
  3711. "arrow_heading_up": "unicode/2934.png?v8",
  3712. "arrow_left": "unicode/2b05.png?v8",
  3713. "arrow_lower_left": "unicode/2199.png?v8",
  3714. "arrow_lower_right": "unicode/2198.png?v8",
  3715. "arrow_right": "unicode/27a1.png?v8",
  3716. "arrow_right_hook": "unicode/21aa.png?v8",
  3717. "arrow_up": "unicode/2b06.png?v8",
  3718. "arrow_up_down": "unicode/2195.png?v8",
  3719. "arrow_up_small": "unicode/1f53c.png?v8",
  3720. "arrow_upper_left": "unicode/2196.png?v8",
  3721. "arrow_upper_right": "unicode/2197.png?v8",
  3722. "arrows_clockwise": "unicode/1f503.png?v8",
  3723. "arrows_counterclockwise": "unicode/1f504.png?v8",
  3724. "art": "unicode/1f3a8.png?v8",
  3725. "articulated_lorry": "unicode/1f69b.png?v8",
  3726. "artificial_satellite": "unicode/1f6f0.png?v8",
  3727. "artist": "unicode/1f9d1-1f3a8.png?v8",
  3728. "aruba": "unicode/1f1e6-1f1fc.png?v8",
  3729. "ascension_island": "unicode/1f1e6-1f1e8.png?v8",
  3730. "asterisk": "unicode/002a-20e3.png?v8",
  3731. "astonished": "unicode/1f632.png?v8",
  3732. "astronaut": "unicode/1f9d1-1f680.png?v8",
  3733. "athletic_shoe": "unicode/1f45f.png?v8",
  3734. "atm": "unicode/1f3e7.png?v8",
  3735. "atom": "atom.png?v8",
  3736. "atom_symbol": "unicode/269b.png?v8",
  3737. "australia": "unicode/1f1e6-1f1fa.png?v8",
  3738. "austria": "unicode/1f1e6-1f1f9.png?v8",
  3739. "auto_rickshaw": "unicode/1f6fa.png?v8",
  3740. "avocado": "unicode/1f951.png?v8",
  3741. "axe": "unicode/1fa93.png?v8",
  3742. "azerbaijan": "unicode/1f1e6-1f1ff.png?v8",
  3743. "b": "unicode/1f171.png?v8",
  3744. "baby": "unicode/1f476.png?v8",
  3745. "baby_bottle": "unicode/1f37c.png?v8",
  3746. "baby_chick": "unicode/1f424.png?v8",
  3747. "baby_symbol": "unicode/1f6bc.png?v8",
  3748. "back": "unicode/1f519.png?v8",
  3749. "bacon": "unicode/1f953.png?v8",
  3750. "badger": "unicode/1f9a1.png?v8",
  3751. "badminton": "unicode/1f3f8.png?v8",
  3752. "bagel": "unicode/1f96f.png?v8",
  3753. "baggage_claim": "unicode/1f6c4.png?v8",
  3754. "baguette_bread": "unicode/1f956.png?v8",
  3755. "bahamas": "unicode/1f1e7-1f1f8.png?v8",
  3756. "bahrain": "unicode/1f1e7-1f1ed.png?v8",
  3757. "balance_scale": "unicode/2696.png?v8",
  3758. "bald_man": "unicode/1f468-1f9b2.png?v8",
  3759. "bald_woman": "unicode/1f469-1f9b2.png?v8",
  3760. "ballet_shoes": "unicode/1fa70.png?v8",
  3761. "balloon": "unicode/1f388.png?v8",
  3762. "ballot_box": "unicode/1f5f3.png?v8",
  3763. "ballot_box_with_check": "unicode/2611.png?v8",
  3764. "bamboo": "unicode/1f38d.png?v8",
  3765. "banana": "unicode/1f34c.png?v8",
  3766. "bangbang": "unicode/203c.png?v8",
  3767. "bangladesh": "unicode/1f1e7-1f1e9.png?v8",
  3768. "banjo": "unicode/1fa95.png?v8",
  3769. "bank": "unicode/1f3e6.png?v8",
  3770. "bar_chart": "unicode/1f4ca.png?v8",
  3771. "barbados": "unicode/1f1e7-1f1e7.png?v8",
  3772. "barber": "unicode/1f488.png?v8",
  3773. "baseball": "unicode/26be.png?v8",
  3774. "basecamp": "basecamp.png?v8",
  3775. "basecampy": "basecampy.png?v8",
  3776. "basket": "unicode/1f9fa.png?v8",
  3777. "basketball": "unicode/1f3c0.png?v8",
  3778. "basketball_man": "unicode/26f9-2642.png?v8",
  3779. "basketball_woman": "unicode/26f9-2640.png?v8",
  3780. "bat": "unicode/1f987.png?v8",
  3781. "bath": "unicode/1f6c0.png?v8",
  3782. "bathtub": "unicode/1f6c1.png?v8",
  3783. "battery": "unicode/1f50b.png?v8",
  3784. "beach_umbrella": "unicode/1f3d6.png?v8",
  3785. "bear": "unicode/1f43b.png?v8",
  3786. "bearded_person": "unicode/1f9d4.png?v8",
  3787. "beaver": "unicode/1f9ab.png?v8",
  3788. "bed": "unicode/1f6cf.png?v8",
  3789. "bee": "unicode/1f41d.png?v8",
  3790. "beer": "unicode/1f37a.png?v8",
  3791. "beers": "unicode/1f37b.png?v8",
  3792. "beetle": "unicode/1fab2.png?v8",
  3793. "beginner": "unicode/1f530.png?v8",
  3794. "belarus": "unicode/1f1e7-1f1fe.png?v8",
  3795. "belgium": "unicode/1f1e7-1f1ea.png?v8",
  3796. "belize": "unicode/1f1e7-1f1ff.png?v8",
  3797. "bell": "unicode/1f514.png?v8",
  3798. "bell_pepper": "unicode/1fad1.png?v8",
  3799. "bellhop_bell": "unicode/1f6ce.png?v8",
  3800. "benin": "unicode/1f1e7-1f1ef.png?v8",
  3801. "bento": "unicode/1f371.png?v8",
  3802. "bermuda": "unicode/1f1e7-1f1f2.png?v8",
  3803. "beverage_box": "unicode/1f9c3.png?v8",
  3804. "bhutan": "unicode/1f1e7-1f1f9.png?v8",
  3805. "bicyclist": "unicode/1f6b4.png?v8",
  3806. "bike": "unicode/1f6b2.png?v8",
  3807. "biking_man": "unicode/1f6b4-2642.png?v8",
  3808. "biking_woman": "unicode/1f6b4-2640.png?v8",
  3809. "bikini": "unicode/1f459.png?v8",
  3810. "billed_cap": "unicode/1f9e2.png?v8",
  3811. "biohazard": "unicode/2623.png?v8",
  3812. "bird": "unicode/1f426.png?v8",
  3813. "birthday": "unicode/1f382.png?v8",
  3814. "bison": "unicode/1f9ac.png?v8",
  3815. "black_cat": "unicode/1f408-2b1b.png?v8",
  3816. "black_circle": "unicode/26ab.png?v8",
  3817. "black_flag": "unicode/1f3f4.png?v8",
  3818. "black_heart": "unicode/1f5a4.png?v8",
  3819. "black_joker": "unicode/1f0cf.png?v8",
  3820. "black_large_square": "unicode/2b1b.png?v8",
  3821. "black_medium_small_square": "unicode/25fe.png?v8",
  3822. "black_medium_square": "unicode/25fc.png?v8",
  3823. "black_nib": "unicode/2712.png?v8",
  3824. "black_small_square": "unicode/25aa.png?v8",
  3825. "black_square_button": "unicode/1f532.png?v8",
  3826. "blond_haired_man": "unicode/1f471-2642.png?v8",
  3827. "blond_haired_person": "unicode/1f471.png?v8",
  3828. "blond_haired_woman": "unicode/1f471-2640.png?v8",
  3829. "blonde_woman": "unicode/1f471-2640.png?v8",
  3830. "blossom": "unicode/1f33c.png?v8",
  3831. "blowfish": "unicode/1f421.png?v8",
  3832. "blue_book": "unicode/1f4d8.png?v8",
  3833. "blue_car": "unicode/1f699.png?v8",
  3834. "blue_heart": "unicode/1f499.png?v8",
  3835. "blue_square": "unicode/1f7e6.png?v8",
  3836. "blueberries": "unicode/1fad0.png?v8",
  3837. "blush": "unicode/1f60a.png?v8",
  3838. "boar": "unicode/1f417.png?v8",
  3839. "boat": "unicode/26f5.png?v8",
  3840. "bolivia": "unicode/1f1e7-1f1f4.png?v8",
  3841. "bomb": "unicode/1f4a3.png?v8",
  3842. "bone": "unicode/1f9b4.png?v8",
  3843. "book": "unicode/1f4d6.png?v8",
  3844. "bookmark": "unicode/1f516.png?v8",
  3845. "bookmark_tabs": "unicode/1f4d1.png?v8",
  3846. "books": "unicode/1f4da.png?v8",
  3847. "boom": "unicode/1f4a5.png?v8",
  3848. "boomerang": "unicode/1fa83.png?v8",
  3849. "boot": "unicode/1f462.png?v8",
  3850. "bosnia_herzegovina": "unicode/1f1e7-1f1e6.png?v8",
  3851. "botswana": "unicode/1f1e7-1f1fc.png?v8",
  3852. "bouncing_ball_man": "unicode/26f9-2642.png?v8",
  3853. "bouncing_ball_person": "unicode/26f9.png?v8",
  3854. "bouncing_ball_woman": "unicode/26f9-2640.png?v8",
  3855. "bouquet": "unicode/1f490.png?v8",
  3856. "bouvet_island": "unicode/1f1e7-1f1fb.png?v8",
  3857. "bow": "unicode/1f647.png?v8",
  3858. "bow_and_arrow": "unicode/1f3f9.png?v8",
  3859. "bowing_man": "unicode/1f647-2642.png?v8",
  3860. "bowing_woman": "unicode/1f647-2640.png?v8",
  3861. "bowl_with_spoon": "unicode/1f963.png?v8",
  3862. "bowling": "unicode/1f3b3.png?v8",
  3863. "bowtie": "bowtie.png?v8",
  3864. "boxing_glove": "unicode/1f94a.png?v8",
  3865. "boy": "unicode/1f466.png?v8",
  3866. "brain": "unicode/1f9e0.png?v8",
  3867. "brazil": "unicode/1f1e7-1f1f7.png?v8",
  3868. "bread": "unicode/1f35e.png?v8",
  3869. "breast_feeding": "unicode/1f931.png?v8",
  3870. "bricks": "unicode/1f9f1.png?v8",
  3871. "bride_with_veil": "unicode/1f470-2640.png?v8",
  3872. "bridge_at_night": "unicode/1f309.png?v8",
  3873. "briefcase": "unicode/1f4bc.png?v8",
  3874. "british_indian_ocean_territory": "unicode/1f1ee-1f1f4.png?v8",
  3875. "british_virgin_islands": "unicode/1f1fb-1f1ec.png?v8",
  3876. "broccoli": "unicode/1f966.png?v8",
  3877. "broken_heart": "unicode/1f494.png?v8",
  3878. "broom": "unicode/1f9f9.png?v8",
  3879. "brown_circle": "unicode/1f7e4.png?v8",
  3880. "brown_heart": "unicode/1f90e.png?v8",
  3881. "brown_square": "unicode/1f7eb.png?v8",
  3882. "brunei": "unicode/1f1e7-1f1f3.png?v8",
  3883. "bubble_tea": "unicode/1f9cb.png?v8",
  3884. "bucket": "unicode/1faa3.png?v8",
  3885. "bug": "unicode/1f41b.png?v8",
  3886. "building_construction": "unicode/1f3d7.png?v8",
  3887. "bulb": "unicode/1f4a1.png?v8",
  3888. "bulgaria": "unicode/1f1e7-1f1ec.png?v8",
  3889. "bullettrain_front": "unicode/1f685.png?v8",
  3890. "bullettrain_side": "unicode/1f684.png?v8",
  3891. "burkina_faso": "unicode/1f1e7-1f1eb.png?v8",
  3892. "burrito": "unicode/1f32f.png?v8",
  3893. "burundi": "unicode/1f1e7-1f1ee.png?v8",
  3894. "bus": "unicode/1f68c.png?v8",
  3895. "business_suit_levitating": "unicode/1f574.png?v8",
  3896. "busstop": "unicode/1f68f.png?v8",
  3897. "bust_in_silhouette": "unicode/1f464.png?v8",
  3898. "busts_in_silhouette": "unicode/1f465.png?v8",
  3899. "butter": "unicode/1f9c8.png?v8",
  3900. "butterfly": "unicode/1f98b.png?v8",
  3901. "cactus": "unicode/1f335.png?v8",
  3902. "cake": "unicode/1f370.png?v8",
  3903. "calendar": "unicode/1f4c6.png?v8",
  3904. "call_me_hand": "unicode/1f919.png?v8",
  3905. "calling": "unicode/1f4f2.png?v8",
  3906. "cambodia": "unicode/1f1f0-1f1ed.png?v8",
  3907. "camel": "unicode/1f42b.png?v8",
  3908. "camera": "unicode/1f4f7.png?v8",
  3909. "camera_flash": "unicode/1f4f8.png?v8",
  3910. "cameroon": "unicode/1f1e8-1f1f2.png?v8",
  3911. "camping": "unicode/1f3d5.png?v8",
  3912. "canada": "unicode/1f1e8-1f1e6.png?v8",
  3913. "canary_islands": "unicode/1f1ee-1f1e8.png?v8",
  3914. "cancer": "unicode/264b.png?v8",
  3915. "candle": "unicode/1f56f.png?v8",
  3916. "candy": "unicode/1f36c.png?v8",
  3917. "canned_food": "unicode/1f96b.png?v8",
  3918. "canoe": "unicode/1f6f6.png?v8",
  3919. "cape_verde": "unicode/1f1e8-1f1fb.png?v8",
  3920. "capital_abcd": "unicode/1f520.png?v8",
  3921. "capricorn": "unicode/2651.png?v8",
  3922. "car": "unicode/1f697.png?v8",
  3923. "card_file_box": "unicode/1f5c3.png?v8",
  3924. "card_index": "unicode/1f4c7.png?v8",
  3925. "card_index_dividers": "unicode/1f5c2.png?v8",
  3926. "caribbean_netherlands": "unicode/1f1e7-1f1f6.png?v8",
  3927. "carousel_horse": "unicode/1f3a0.png?v8",
  3928. "carpentry_saw": "unicode/1fa9a.png?v8",
  3929. "carrot": "unicode/1f955.png?v8",
  3930. "cartwheeling": "unicode/1f938.png?v8",
  3931. "cat": "unicode/1f431.png?v8",
  3932. "cat2": "unicode/1f408.png?v8",
  3933. "cayman_islands": "unicode/1f1f0-1f1fe.png?v8",
  3934. "cd": "unicode/1f4bf.png?v8",
  3935. "central_african_republic": "unicode/1f1e8-1f1eb.png?v8",
  3936. "ceuta_melilla": "unicode/1f1ea-1f1e6.png?v8",
  3937. "chad": "unicode/1f1f9-1f1e9.png?v8",
  3938. "chains": "unicode/26d3.png?v8",
  3939. "chair": "unicode/1fa91.png?v8",
  3940. "champagne": "unicode/1f37e.png?v8",
  3941. "chart": "unicode/1f4b9.png?v8",
  3942. "chart_with_downwards_trend": "unicode/1f4c9.png?v8",
  3943. "chart_with_upwards_trend": "unicode/1f4c8.png?v8",
  3944. "checkered_flag": "unicode/1f3c1.png?v8",
  3945. "cheese": "unicode/1f9c0.png?v8",
  3946. "cherries": "unicode/1f352.png?v8",
  3947. "cherry_blossom": "unicode/1f338.png?v8",
  3948. "chess_pawn": "unicode/265f.png?v8",
  3949. "chestnut": "unicode/1f330.png?v8",
  3950. "chicken": "unicode/1f414.png?v8",
  3951. "child": "unicode/1f9d2.png?v8",
  3952. "children_crossing": "unicode/1f6b8.png?v8",
  3953. "chile": "unicode/1f1e8-1f1f1.png?v8",
  3954. "chipmunk": "unicode/1f43f.png?v8",
  3955. "chocolate_bar": "unicode/1f36b.png?v8",
  3956. "chopsticks": "unicode/1f962.png?v8",
  3957. "christmas_island": "unicode/1f1e8-1f1fd.png?v8",
  3958. "christmas_tree": "unicode/1f384.png?v8",
  3959. "church": "unicode/26ea.png?v8",
  3960. "cinema": "unicode/1f3a6.png?v8",
  3961. "circus_tent": "unicode/1f3aa.png?v8",
  3962. "city_sunrise": "unicode/1f307.png?v8",
  3963. "city_sunset": "unicode/1f306.png?v8",
  3964. "cityscape": "unicode/1f3d9.png?v8",
  3965. "cl": "unicode/1f191.png?v8",
  3966. "clamp": "unicode/1f5dc.png?v8",
  3967. "clap": "unicode/1f44f.png?v8",
  3968. "clapper": "unicode/1f3ac.png?v8",
  3969. "classical_building": "unicode/1f3db.png?v8",
  3970. "climbing": "unicode/1f9d7.png?v8",
  3971. "climbing_man": "unicode/1f9d7-2642.png?v8",
  3972. "climbing_woman": "unicode/1f9d7-2640.png?v8",
  3973. "clinking_glasses": "unicode/1f942.png?v8",
  3974. "clipboard": "unicode/1f4cb.png?v8",
  3975. "clipperton_island": "unicode/1f1e8-1f1f5.png?v8",
  3976. "clock1": "unicode/1f550.png?v8",
  3977. "clock10": "unicode/1f559.png?v8",
  3978. "clock1030": "unicode/1f565.png?v8",
  3979. "clock11": "unicode/1f55a.png?v8",
  3980. "clock1130": "unicode/1f566.png?v8",
  3981. "clock12": "unicode/1f55b.png?v8",
  3982. "clock1230": "unicode/1f567.png?v8",
  3983. "clock130": "unicode/1f55c.png?v8",
  3984. "clock2": "unicode/1f551.png?v8",
  3985. "clock230": "unicode/1f55d.png?v8",
  3986. "clock3": "unicode/1f552.png?v8",
  3987. "clock330": "unicode/1f55e.png?v8",
  3988. "clock4": "unicode/1f553.png?v8",
  3989. "clock430": "unicode/1f55f.png?v8",
  3990. "clock5": "unicode/1f554.png?v8",
  3991. "clock530": "unicode/1f560.png?v8",
  3992. "clock6": "unicode/1f555.png?v8",
  3993. "clock630": "unicode/1f561.png?v8",
  3994. "clock7": "unicode/1f556.png?v8",
  3995. "clock730": "unicode/1f562.png?v8",
  3996. "clock8": "unicode/1f557.png?v8",
  3997. "clock830": "unicode/1f563.png?v8",
  3998. "clock9": "unicode/1f558.png?v8",
  3999. "clock930": "unicode/1f564.png?v8",
  4000. "closed_book": "unicode/1f4d5.png?v8",
  4001. "closed_lock_with_key": "unicode/1f510.png?v8",
  4002. "closed_umbrella": "unicode/1f302.png?v8",
  4003. "cloud": "unicode/2601.png?v8",
  4004. "cloud_with_lightning": "unicode/1f329.png?v8",
  4005. "cloud_with_lightning_and_rain": "unicode/26c8.png?v8",
  4006. "cloud_with_rain": "unicode/1f327.png?v8",
  4007. "cloud_with_snow": "unicode/1f328.png?v8",
  4008. "clown_face": "unicode/1f921.png?v8",
  4009. "clubs": "unicode/2663.png?v8",
  4010. "cn": "unicode/1f1e8-1f1f3.png?v8",
  4011. "coat": "unicode/1f9e5.png?v8",
  4012. "cockroach": "unicode/1fab3.png?v8",
  4013. "cocktail": "unicode/1f378.png?v8",
  4014. "coconut": "unicode/1f965.png?v8",
  4015. "cocos_islands": "unicode/1f1e8-1f1e8.png?v8",
  4016. "coffee": "unicode/2615.png?v8",
  4017. "coffin": "unicode/26b0.png?v8",
  4018. "coin": "unicode/1fa99.png?v8",
  4019. "cold_face": "unicode/1f976.png?v8",
  4020. "cold_sweat": "unicode/1f630.png?v8",
  4021. "collision": "unicode/1f4a5.png?v8",
  4022. "colombia": "unicode/1f1e8-1f1f4.png?v8",
  4023. "comet": "unicode/2604.png?v8",
  4024. "comoros": "unicode/1f1f0-1f1f2.png?v8",
  4025. "compass": "unicode/1f9ed.png?v8",
  4026. "computer": "unicode/1f4bb.png?v8",
  4027. "computer_mouse": "unicode/1f5b1.png?v8",
  4028. "confetti_ball": "unicode/1f38a.png?v8",
  4029. "confounded": "unicode/1f616.png?v8",
  4030. "confused": "unicode/1f615.png?v8",
  4031. "congo_brazzaville": "unicode/1f1e8-1f1ec.png?v8",
  4032. "congo_kinshasa": "unicode/1f1e8-1f1e9.png?v8",
  4033. "congratulations": "unicode/3297.png?v8",
  4034. "construction": "unicode/1f6a7.png?v8",
  4035. "construction_worker": "unicode/1f477.png?v8",
  4036. "construction_worker_man": "unicode/1f477-2642.png?v8",
  4037. "construction_worker_woman": "unicode/1f477-2640.png?v8",
  4038. "control_knobs": "unicode/1f39b.png?v8",
  4039. "convenience_store": "unicode/1f3ea.png?v8",
  4040. "cook": "unicode/1f9d1-1f373.png?v8",
  4041. "cook_islands": "unicode/1f1e8-1f1f0.png?v8",
  4042. "cookie": "unicode/1f36a.png?v8",
  4043. "cool": "unicode/1f192.png?v8",
  4044. "cop": "unicode/1f46e.png?v8",
  4045. "copyright": "unicode/00a9.png?v8",
  4046. "corn": "unicode/1f33d.png?v8",
  4047. "costa_rica": "unicode/1f1e8-1f1f7.png?v8",
  4048. "cote_divoire": "unicode/1f1e8-1f1ee.png?v8",
  4049. "couch_and_lamp": "unicode/1f6cb.png?v8",
  4050. "couple": "unicode/1f46b.png?v8",
  4051. "couple_with_heart": "unicode/1f491.png?v8",
  4052. "couple_with_heart_man_man": "unicode/1f468-2764-1f468.png?v8",
  4053. "couple_with_heart_woman_man": "unicode/1f469-2764-1f468.png?v8",
  4054. "couple_with_heart_woman_woman": "unicode/1f469-2764-1f469.png?v8",
  4055. "couplekiss": "unicode/1f48f.png?v8",
  4056. "couplekiss_man_man": "unicode/1f468-2764-1f48b-1f468.png?v8",
  4057. "couplekiss_man_woman": "unicode/1f469-2764-1f48b-1f468.png?v8",
  4058. "couplekiss_woman_woman": "unicode/1f469-2764-1f48b-1f469.png?v8",
  4059. "cow": "unicode/1f42e.png?v8",
  4060. "cow2": "unicode/1f404.png?v8",
  4061. "cowboy_hat_face": "unicode/1f920.png?v8",
  4062. "crab": "unicode/1f980.png?v8",
  4063. "crayon": "unicode/1f58d.png?v8",
  4064. "credit_card": "unicode/1f4b3.png?v8",
  4065. "crescent_moon": "unicode/1f319.png?v8",
  4066. "cricket": "unicode/1f997.png?v8",
  4067. "cricket_game": "unicode/1f3cf.png?v8",
  4068. "croatia": "unicode/1f1ed-1f1f7.png?v8",
  4069. "crocodile": "unicode/1f40a.png?v8",
  4070. "croissant": "unicode/1f950.png?v8",
  4071. "crossed_fingers": "unicode/1f91e.png?v8",
  4072. "crossed_flags": "unicode/1f38c.png?v8",
  4073. "crossed_swords": "unicode/2694.png?v8",
  4074. "crown": "unicode/1f451.png?v8",
  4075. "cry": "unicode/1f622.png?v8",
  4076. "crying_cat_face": "unicode/1f63f.png?v8",
  4077. "crystal_ball": "unicode/1f52e.png?v8",
  4078. "cuba": "unicode/1f1e8-1f1fa.png?v8",
  4079. "cucumber": "unicode/1f952.png?v8",
  4080. "cup_with_straw": "unicode/1f964.png?v8",
  4081. "cupcake": "unicode/1f9c1.png?v8",
  4082. "cupid": "unicode/1f498.png?v8",
  4083. "curacao": "unicode/1f1e8-1f1fc.png?v8",
  4084. "curling_stone": "unicode/1f94c.png?v8",
  4085. "curly_haired_man": "unicode/1f468-1f9b1.png?v8",
  4086. "curly_haired_woman": "unicode/1f469-1f9b1.png?v8",
  4087. "curly_loop": "unicode/27b0.png?v8",
  4088. "currency_exchange": "unicode/1f4b1.png?v8",
  4089. "curry": "unicode/1f35b.png?v8",
  4090. "cursing_face": "unicode/1f92c.png?v8",
  4091. "custard": "unicode/1f36e.png?v8",
  4092. "customs": "unicode/1f6c3.png?v8",
  4093. "cut_of_meat": "unicode/1f969.png?v8",
  4094. "cyclone": "unicode/1f300.png?v8",
  4095. "cyprus": "unicode/1f1e8-1f1fe.png?v8",
  4096. "czech_republic": "unicode/1f1e8-1f1ff.png?v8",
  4097. "dagger": "unicode/1f5e1.png?v8",
  4098. "dancer": "unicode/1f483.png?v8",
  4099. "dancers": "unicode/1f46f.png?v8",
  4100. "dancing_men": "unicode/1f46f-2642.png?v8",
  4101. "dancing_women": "unicode/1f46f-2640.png?v8",
  4102. "dango": "unicode/1f361.png?v8",
  4103. "dark_sunglasses": "unicode/1f576.png?v8",
  4104. "dart": "unicode/1f3af.png?v8",
  4105. "dash": "unicode/1f4a8.png?v8",
  4106. "date": "unicode/1f4c5.png?v8",
  4107. "de": "unicode/1f1e9-1f1ea.png?v8",
  4108. "deaf_man": "unicode/1f9cf-2642.png?v8",
  4109. "deaf_person": "unicode/1f9cf.png?v8",
  4110. "deaf_woman": "unicode/1f9cf-2640.png?v8",
  4111. "deciduous_tree": "unicode/1f333.png?v8",
  4112. "deer": "unicode/1f98c.png?v8",
  4113. "denmark": "unicode/1f1e9-1f1f0.png?v8",
  4114. "department_store": "unicode/1f3ec.png?v8",
  4115. "dependabot": "dependabot.png?v8",
  4116. "derelict_house": "unicode/1f3da.png?v8",
  4117. "desert": "unicode/1f3dc.png?v8",
  4118. "desert_island": "unicode/1f3dd.png?v8",
  4119. "desktop_computer": "unicode/1f5a5.png?v8",
  4120. "detective": "unicode/1f575.png?v8",
  4121. "diamond_shape_with_a_dot_inside": "unicode/1f4a0.png?v8",
  4122. "diamonds": "unicode/2666.png?v8",
  4123. "diego_garcia": "unicode/1f1e9-1f1ec.png?v8",
  4124. "disappointed": "unicode/1f61e.png?v8",
  4125. "disappointed_relieved": "unicode/1f625.png?v8",
  4126. "disguised_face": "unicode/1f978.png?v8",
  4127. "diving_mask": "unicode/1f93f.png?v8",
  4128. "diya_lamp": "unicode/1fa94.png?v8",
  4129. "dizzy": "unicode/1f4ab.png?v8",
  4130. "dizzy_face": "unicode/1f635.png?v8",
  4131. "djibouti": "unicode/1f1e9-1f1ef.png?v8",
  4132. "dna": "unicode/1f9ec.png?v8",
  4133. "do_not_litter": "unicode/1f6af.png?v8",
  4134. "dodo": "unicode/1f9a4.png?v8",
  4135. "dog": "unicode/1f436.png?v8",
  4136. "dog2": "unicode/1f415.png?v8",
  4137. "dollar": "unicode/1f4b5.png?v8",
  4138. "dolls": "unicode/1f38e.png?v8",
  4139. "dolphin": "unicode/1f42c.png?v8",
  4140. "dominica": "unicode/1f1e9-1f1f2.png?v8",
  4141. "dominican_republic": "unicode/1f1e9-1f1f4.png?v8",
  4142. "door": "unicode/1f6aa.png?v8",
  4143. "doughnut": "unicode/1f369.png?v8",
  4144. "dove": "unicode/1f54a.png?v8",
  4145. "dragon": "unicode/1f409.png?v8",
  4146. "dragon_face": "unicode/1f432.png?v8",
  4147. "dress": "unicode/1f457.png?v8",
  4148. "dromedary_camel": "unicode/1f42a.png?v8",
  4149. "drooling_face": "unicode/1f924.png?v8",
  4150. "drop_of_blood": "unicode/1fa78.png?v8",
  4151. "droplet": "unicode/1f4a7.png?v8",
  4152. "drum": "unicode/1f941.png?v8",
  4153. "duck": "unicode/1f986.png?v8",
  4154. "dumpling": "unicode/1f95f.png?v8",
  4155. "dvd": "unicode/1f4c0.png?v8",
  4156. "e-mail": "unicode/1f4e7.png?v8",
  4157. "eagle": "unicode/1f985.png?v8",
  4158. "ear": "unicode/1f442.png?v8",
  4159. "ear_of_rice": "unicode/1f33e.png?v8",
  4160. "ear_with_hearing_aid": "unicode/1f9bb.png?v8",
  4161. "earth_africa": "unicode/1f30d.png?v8",
  4162. "earth_americas": "unicode/1f30e.png?v8",
  4163. "earth_asia": "unicode/1f30f.png?v8",
  4164. "ecuador": "unicode/1f1ea-1f1e8.png?v8",
  4165. "egg": "unicode/1f95a.png?v8",
  4166. "eggplant": "unicode/1f346.png?v8",
  4167. "egypt": "unicode/1f1ea-1f1ec.png?v8",
  4168. "eight": "unicode/0038-20e3.png?v8",
  4169. "eight_pointed_black_star": "unicode/2734.png?v8",
  4170. "eight_spoked_asterisk": "unicode/2733.png?v8",
  4171. "eject_button": "unicode/23cf.png?v8",
  4172. "el_salvador": "unicode/1f1f8-1f1fb.png?v8",
  4173. "electric_plug": "unicode/1f50c.png?v8",
  4174. "electron": "electron.png?v8",
  4175. "elephant": "unicode/1f418.png?v8",
  4176. "elevator": "unicode/1f6d7.png?v8",
  4177. "elf": "unicode/1f9dd.png?v8",
  4178. "elf_man": "unicode/1f9dd-2642.png?v8",
  4179. "elf_woman": "unicode/1f9dd-2640.png?v8",
  4180. "email": "unicode/1f4e7.png?v8",
  4181. "end": "unicode/1f51a.png?v8",
  4182. "england": "unicode/1f3f4-e0067-e0062-e0065-e006e-e0067-e007f.png?v8",
  4183. "envelope": "unicode/2709.png?v8",
  4184. "envelope_with_arrow": "unicode/1f4e9.png?v8",
  4185. "equatorial_guinea": "unicode/1f1ec-1f1f6.png?v8",
  4186. "eritrea": "unicode/1f1ea-1f1f7.png?v8",
  4187. "es": "unicode/1f1ea-1f1f8.png?v8",
  4188. "estonia": "unicode/1f1ea-1f1ea.png?v8",
  4189. "ethiopia": "unicode/1f1ea-1f1f9.png?v8",
  4190. "eu": "unicode/1f1ea-1f1fa.png?v8",
  4191. "euro": "unicode/1f4b6.png?v8",
  4192. "european_castle": "unicode/1f3f0.png?v8",
  4193. "european_post_office": "unicode/1f3e4.png?v8",
  4194. "european_union": "unicode/1f1ea-1f1fa.png?v8",
  4195. "evergreen_tree": "unicode/1f332.png?v8",
  4196. "exclamation": "unicode/2757.png?v8",
  4197. "exploding_head": "unicode/1f92f.png?v8",
  4198. "expressionless": "unicode/1f611.png?v8",
  4199. "eye": "unicode/1f441.png?v8",
  4200. "eye_speech_bubble": "unicode/1f441-1f5e8.png?v8",
  4201. "eyeglasses": "unicode/1f453.png?v8",
  4202. "eyes": "unicode/1f440.png?v8",
  4203. "face_exhaling": "unicode/1f62e-1f4a8.png?v8",
  4204. "face_in_clouds": "unicode/1f636-1f32b.png?v8",
  4205. "face_with_head_bandage": "unicode/1f915.png?v8",
  4206. "face_with_spiral_eyes": "unicode/1f635-1f4ab.png?v8",
  4207. "face_with_thermometer": "unicode/1f912.png?v8",
  4208. "facepalm": "unicode/1f926.png?v8",
  4209. "facepunch": "unicode/1f44a.png?v8",
  4210. "factory": "unicode/1f3ed.png?v8",
  4211. "factory_worker": "unicode/1f9d1-1f3ed.png?v8",
  4212. "fairy": "unicode/1f9da.png?v8",
  4213. "fairy_man": "unicode/1f9da-2642.png?v8",
  4214. "fairy_woman": "unicode/1f9da-2640.png?v8",
  4215. "falafel": "unicode/1f9c6.png?v8",
  4216. "falkland_islands": "unicode/1f1eb-1f1f0.png?v8",
  4217. "fallen_leaf": "unicode/1f342.png?v8",
  4218. "family": "unicode/1f46a.png?v8",
  4219. "family_man_boy": "unicode/1f468-1f466.png?v8",
  4220. "family_man_boy_boy": "unicode/1f468-1f466-1f466.png?v8",
  4221. "family_man_girl": "unicode/1f468-1f467.png?v8",
  4222. "family_man_girl_boy": "unicode/1f468-1f467-1f466.png?v8",
  4223. "family_man_girl_girl": "unicode/1f468-1f467-1f467.png?v8",
  4224. "family_man_man_boy": "unicode/1f468-1f468-1f466.png?v8",
  4225. "family_man_man_boy_boy": "unicode/1f468-1f468-1f466-1f466.png?v8",
  4226. "family_man_man_girl": "unicode/1f468-1f468-1f467.png?v8",
  4227. "family_man_man_girl_boy": "unicode/1f468-1f468-1f467-1f466.png?v8",
  4228. "family_man_man_girl_girl": "unicode/1f468-1f468-1f467-1f467.png?v8",
  4229. "family_man_woman_boy": "unicode/1f468-1f469-1f466.png?v8",
  4230. "family_man_woman_boy_boy": "unicode/1f468-1f469-1f466-1f466.png?v8",
  4231. "family_man_woman_girl": "unicode/1f468-1f469-1f467.png?v8",
  4232. "family_man_woman_girl_boy": "unicode/1f468-1f469-1f467-1f466.png?v8",
  4233. "family_man_woman_girl_girl": "unicode/1f468-1f469-1f467-1f467.png?v8",
  4234. "family_woman_boy": "unicode/1f469-1f466.png?v8",
  4235. "family_woman_boy_boy": "unicode/1f469-1f466-1f466.png?v8",
  4236. "family_woman_girl": "unicode/1f469-1f467.png?v8",
  4237. "family_woman_girl_boy": "unicode/1f469-1f467-1f466.png?v8",
  4238. "family_woman_girl_girl": "unicode/1f469-1f467-1f467.png?v8",
  4239. "family_woman_woman_boy": "unicode/1f469-1f469-1f466.png?v8",
  4240. "family_woman_woman_boy_boy": "unicode/1f469-1f469-1f466-1f466.png?v8",
  4241. "family_woman_woman_girl": "unicode/1f469-1f469-1f467.png?v8",
  4242. "family_woman_woman_girl_boy": "unicode/1f469-1f469-1f467-1f466.png?v8",
  4243. "family_woman_woman_girl_girl": "unicode/1f469-1f469-1f467-1f467.png?v8",
  4244. "farmer": "unicode/1f9d1-1f33e.png?v8",
  4245. "faroe_islands": "unicode/1f1eb-1f1f4.png?v8",
  4246. "fast_forward": "unicode/23e9.png?v8",
  4247. "fax": "unicode/1f4e0.png?v8",
  4248. "fearful": "unicode/1f628.png?v8",
  4249. "feather": "unicode/1fab6.png?v8",
  4250. "feelsgood": "feelsgood.png?v8",
  4251. "feet": "unicode/1f43e.png?v8",
  4252. "female_detective": "unicode/1f575-2640.png?v8",
  4253. "female_sign": "unicode/2640.png?v8",
  4254. "ferris_wheel": "unicode/1f3a1.png?v8",
  4255. "ferry": "unicode/26f4.png?v8",
  4256. "field_hockey": "unicode/1f3d1.png?v8",
  4257. "fiji": "unicode/1f1eb-1f1ef.png?v8",
  4258. "file_cabinet": "unicode/1f5c4.png?v8",
  4259. "file_folder": "unicode/1f4c1.png?v8",
  4260. "film_projector": "unicode/1f4fd.png?v8",
  4261. "film_strip": "unicode/1f39e.png?v8",
  4262. "finland": "unicode/1f1eb-1f1ee.png?v8",
  4263. "finnadie": "finnadie.png?v8",
  4264. "fire": "unicode/1f525.png?v8",
  4265. "fire_engine": "unicode/1f692.png?v8",
  4266. "fire_extinguisher": "unicode/1f9ef.png?v8",
  4267. "firecracker": "unicode/1f9e8.png?v8",
  4268. "firefighter": "unicode/1f9d1-1f692.png?v8",
  4269. "fireworks": "unicode/1f386.png?v8",
  4270. "first_quarter_moon": "unicode/1f313.png?v8",
  4271. "first_quarter_moon_with_face": "unicode/1f31b.png?v8",
  4272. "fish": "unicode/1f41f.png?v8",
  4273. "fish_cake": "unicode/1f365.png?v8",
  4274. "fishing_pole_and_fish": "unicode/1f3a3.png?v8",
  4275. "fishsticks": "fishsticks.png?v8",
  4276. "fist": "unicode/270a.png?v8",
  4277. "fist_left": "unicode/1f91b.png?v8",
  4278. "fist_oncoming": "unicode/1f44a.png?v8",
  4279. "fist_raised": "unicode/270a.png?v8",
  4280. "fist_right": "unicode/1f91c.png?v8",
  4281. "five": "unicode/0035-20e3.png?v8",
  4282. "flags": "unicode/1f38f.png?v8",
  4283. "flamingo": "unicode/1f9a9.png?v8",
  4284. "flashlight": "unicode/1f526.png?v8",
  4285. "flat_shoe": "unicode/1f97f.png?v8",
  4286. "flatbread": "unicode/1fad3.png?v8",
  4287. "fleur_de_lis": "unicode/269c.png?v8",
  4288. "flight_arrival": "unicode/1f6ec.png?v8",
  4289. "flight_departure": "unicode/1f6eb.png?v8",
  4290. "flipper": "unicode/1f42c.png?v8",
  4291. "floppy_disk": "unicode/1f4be.png?v8",
  4292. "flower_playing_cards": "unicode/1f3b4.png?v8",
  4293. "flushed": "unicode/1f633.png?v8",
  4294. "fly": "unicode/1fab0.png?v8",
  4295. "flying_disc": "unicode/1f94f.png?v8",
  4296. "flying_saucer": "unicode/1f6f8.png?v8",
  4297. "fog": "unicode/1f32b.png?v8",
  4298. "foggy": "unicode/1f301.png?v8",
  4299. "fondue": "unicode/1fad5.png?v8",
  4300. "foot": "unicode/1f9b6.png?v8",
  4301. "football": "unicode/1f3c8.png?v8",
  4302. "footprints": "unicode/1f463.png?v8",
  4303. "fork_and_knife": "unicode/1f374.png?v8",
  4304. "fortune_cookie": "unicode/1f960.png?v8",
  4305. "fountain": "unicode/26f2.png?v8",
  4306. "fountain_pen": "unicode/1f58b.png?v8",
  4307. "four": "unicode/0034-20e3.png?v8",
  4308. "four_leaf_clover": "unicode/1f340.png?v8",
  4309. "fox_face": "unicode/1f98a.png?v8",
  4310. "fr": "unicode/1f1eb-1f1f7.png?v8",
  4311. "framed_picture": "unicode/1f5bc.png?v8",
  4312. "free": "unicode/1f193.png?v8",
  4313. "french_guiana": "unicode/1f1ec-1f1eb.png?v8",
  4314. "french_polynesia": "unicode/1f1f5-1f1eb.png?v8",
  4315. "french_southern_territories": "unicode/1f1f9-1f1eb.png?v8",
  4316. "fried_egg": "unicode/1f373.png?v8",
  4317. "fried_shrimp": "unicode/1f364.png?v8",
  4318. "fries": "unicode/1f35f.png?v8",
  4319. "frog": "unicode/1f438.png?v8",
  4320. "frowning": "unicode/1f626.png?v8",
  4321. "frowning_face": "unicode/2639.png?v8",
  4322. "frowning_man": "unicode/1f64d-2642.png?v8",
  4323. "frowning_person": "unicode/1f64d.png?v8",
  4324. "frowning_woman": "unicode/1f64d-2640.png?v8",
  4325. "fu": "unicode/1f595.png?v8",
  4326. "fuelpump": "unicode/26fd.png?v8",
  4327. "full_moon": "unicode/1f315.png?v8",
  4328. "full_moon_with_face": "unicode/1f31d.png?v8",
  4329. "funeral_urn": "unicode/26b1.png?v8",
  4330. "gabon": "unicode/1f1ec-1f1e6.png?v8",
  4331. "gambia": "unicode/1f1ec-1f1f2.png?v8",
  4332. "game_die": "unicode/1f3b2.png?v8",
  4333. "garlic": "unicode/1f9c4.png?v8",
  4334. "gb": "unicode/1f1ec-1f1e7.png?v8",
  4335. "gear": "unicode/2699.png?v8",
  4336. "gem": "unicode/1f48e.png?v8",
  4337. "gemini": "unicode/264a.png?v8",
  4338. "genie": "unicode/1f9de.png?v8",
  4339. "genie_man": "unicode/1f9de-2642.png?v8",
  4340. "genie_woman": "unicode/1f9de-2640.png?v8",
  4341. "georgia": "unicode/1f1ec-1f1ea.png?v8",
  4342. "ghana": "unicode/1f1ec-1f1ed.png?v8",
  4343. "ghost": "unicode/1f47b.png?v8",
  4344. "gibraltar": "unicode/1f1ec-1f1ee.png?v8",
  4345. "gift": "unicode/1f381.png?v8",
  4346. "gift_heart": "unicode/1f49d.png?v8",
  4347. "giraffe": "unicode/1f992.png?v8",
  4348. "girl": "unicode/1f467.png?v8",
  4349. "globe_with_meridians": "unicode/1f310.png?v8",
  4350. "gloves": "unicode/1f9e4.png?v8",
  4351. "goal_net": "unicode/1f945.png?v8",
  4352. "goat": "unicode/1f410.png?v8",
  4353. "goberserk": "goberserk.png?v8",
  4354. "godmode": "godmode.png?v8",
  4355. "goggles": "unicode/1f97d.png?v8",
  4356. "golf": "unicode/26f3.png?v8",
  4357. "golfing": "unicode/1f3cc.png?v8",
  4358. "golfing_man": "unicode/1f3cc-2642.png?v8",
  4359. "golfing_woman": "unicode/1f3cc-2640.png?v8",
  4360. "gorilla": "unicode/1f98d.png?v8",
  4361. "grapes": "unicode/1f347.png?v8",
  4362. "greece": "unicode/1f1ec-1f1f7.png?v8",
  4363. "green_apple": "unicode/1f34f.png?v8",
  4364. "green_book": "unicode/1f4d7.png?v8",
  4365. "green_circle": "unicode/1f7e2.png?v8",
  4366. "green_heart": "unicode/1f49a.png?v8",
  4367. "green_salad": "unicode/1f957.png?v8",
  4368. "green_square": "unicode/1f7e9.png?v8",
  4369. "greenland": "unicode/1f1ec-1f1f1.png?v8",
  4370. "grenada": "unicode/1f1ec-1f1e9.png?v8",
  4371. "grey_exclamation": "unicode/2755.png?v8",
  4372. "grey_question": "unicode/2754.png?v8",
  4373. "grimacing": "unicode/1f62c.png?v8",
  4374. "grin": "unicode/1f601.png?v8",
  4375. "grinning": "unicode/1f600.png?v8",
  4376. "guadeloupe": "unicode/1f1ec-1f1f5.png?v8",
  4377. "guam": "unicode/1f1ec-1f1fa.png?v8",
  4378. "guard": "unicode/1f482.png?v8",
  4379. "guardsman": "unicode/1f482-2642.png?v8",
  4380. "guardswoman": "unicode/1f482-2640.png?v8",
  4381. "guatemala": "unicode/1f1ec-1f1f9.png?v8",
  4382. "guernsey": "unicode/1f1ec-1f1ec.png?v8",
  4383. "guide_dog": "unicode/1f9ae.png?v8",
  4384. "guinea": "unicode/1f1ec-1f1f3.png?v8",
  4385. "guinea_bissau": "unicode/1f1ec-1f1fc.png?v8",
  4386. "guitar": "unicode/1f3b8.png?v8",
  4387. "gun": "unicode/1f52b.png?v8",
  4388. "guyana": "unicode/1f1ec-1f1fe.png?v8",
  4389. "haircut": "unicode/1f487.png?v8",
  4390. "haircut_man": "unicode/1f487-2642.png?v8",
  4391. "haircut_woman": "unicode/1f487-2640.png?v8",
  4392. "haiti": "unicode/1f1ed-1f1f9.png?v8",
  4393. "hamburger": "unicode/1f354.png?v8",
  4394. "hammer": "unicode/1f528.png?v8",
  4395. "hammer_and_pick": "unicode/2692.png?v8",
  4396. "hammer_and_wrench": "unicode/1f6e0.png?v8",
  4397. "hamster": "unicode/1f439.png?v8",
  4398. "hand": "unicode/270b.png?v8",
  4399. "hand_over_mouth": "unicode/1f92d.png?v8",
  4400. "handbag": "unicode/1f45c.png?v8",
  4401. "handball_person": "unicode/1f93e.png?v8",
  4402. "handshake": "unicode/1f91d.png?v8",
  4403. "hankey": "unicode/1f4a9.png?v8",
  4404. "hash": "unicode/0023-20e3.png?v8",
  4405. "hatched_chick": "unicode/1f425.png?v8",
  4406. "hatching_chick": "unicode/1f423.png?v8",
  4407. "headphones": "unicode/1f3a7.png?v8",
  4408. "headstone": "unicode/1faa6.png?v8",
  4409. "health_worker": "unicode/1f9d1-2695.png?v8",
  4410. "hear_no_evil": "unicode/1f649.png?v8",
  4411. "heard_mcdonald_islands": "unicode/1f1ed-1f1f2.png?v8",
  4412. "heart": "unicode/2764.png?v8",
  4413. "heart_decoration": "unicode/1f49f.png?v8",
  4414. "heart_eyes": "unicode/1f60d.png?v8",
  4415. "heart_eyes_cat": "unicode/1f63b.png?v8",
  4416. "heart_on_fire": "unicode/2764-1f525.png?v8",
  4417. "heartbeat": "unicode/1f493.png?v8",
  4418. "heartpulse": "unicode/1f497.png?v8",
  4419. "hearts": "unicode/2665.png?v8",
  4420. "heavy_check_mark": "unicode/2714.png?v8",
  4421. "heavy_division_sign": "unicode/2797.png?v8",
  4422. "heavy_dollar_sign": "unicode/1f4b2.png?v8",
  4423. "heavy_exclamation_mark": "unicode/2757.png?v8",
  4424. "heavy_heart_exclamation": "unicode/2763.png?v8",
  4425. "heavy_minus_sign": "unicode/2796.png?v8",
  4426. "heavy_multiplication_x": "unicode/2716.png?v8",
  4427. "heavy_plus_sign": "unicode/2795.png?v8",
  4428. "hedgehog": "unicode/1f994.png?v8",
  4429. "helicopter": "unicode/1f681.png?v8",
  4430. "herb": "unicode/1f33f.png?v8",
  4431. "hibiscus": "unicode/1f33a.png?v8",
  4432. "high_brightness": "unicode/1f506.png?v8",
  4433. "high_heel": "unicode/1f460.png?v8",
  4434. "hiking_boot": "unicode/1f97e.png?v8",
  4435. "hindu_temple": "unicode/1f6d5.png?v8",
  4436. "hippopotamus": "unicode/1f99b.png?v8",
  4437. "hocho": "unicode/1f52a.png?v8",
  4438. "hole": "unicode/1f573.png?v8",
  4439. "honduras": "unicode/1f1ed-1f1f3.png?v8",
  4440. "honey_pot": "unicode/1f36f.png?v8",
  4441. "honeybee": "unicode/1f41d.png?v8",
  4442. "hong_kong": "unicode/1f1ed-1f1f0.png?v8",
  4443. "hook": "unicode/1fa9d.png?v8",
  4444. "horse": "unicode/1f434.png?v8",
  4445. "horse_racing": "unicode/1f3c7.png?v8",
  4446. "hospital": "unicode/1f3e5.png?v8",
  4447. "hot_face": "unicode/1f975.png?v8",
  4448. "hot_pepper": "unicode/1f336.png?v8",
  4449. "hotdog": "unicode/1f32d.png?v8",
  4450. "hotel": "unicode/1f3e8.png?v8",
  4451. "hotsprings": "unicode/2668.png?v8",
  4452. "hourglass": "unicode/231b.png?v8",
  4453. "hourglass_flowing_sand": "unicode/23f3.png?v8",
  4454. "house": "unicode/1f3e0.png?v8",
  4455. "house_with_garden": "unicode/1f3e1.png?v8",
  4456. "houses": "unicode/1f3d8.png?v8",
  4457. "hugs": "unicode/1f917.png?v8",
  4458. "hungary": "unicode/1f1ed-1f1fa.png?v8",
  4459. "hurtrealbad": "hurtrealbad.png?v8",
  4460. "hushed": "unicode/1f62f.png?v8",
  4461. "hut": "unicode/1f6d6.png?v8",
  4462. "ice_cream": "unicode/1f368.png?v8",
  4463. "ice_cube": "unicode/1f9ca.png?v8",
  4464. "ice_hockey": "unicode/1f3d2.png?v8",
  4465. "ice_skate": "unicode/26f8.png?v8",
  4466. "icecream": "unicode/1f366.png?v8",
  4467. "iceland": "unicode/1f1ee-1f1f8.png?v8",
  4468. "id": "unicode/1f194.png?v8",
  4469. "ideograph_advantage": "unicode/1f250.png?v8",
  4470. "imp": "unicode/1f47f.png?v8",
  4471. "inbox_tray": "unicode/1f4e5.png?v8",
  4472. "incoming_envelope": "unicode/1f4e8.png?v8",
  4473. "india": "unicode/1f1ee-1f1f3.png?v8",
  4474. "indonesia": "unicode/1f1ee-1f1e9.png?v8",
  4475. "infinity": "unicode/267e.png?v8",
  4476. "information_desk_person": "unicode/1f481.png?v8",
  4477. "information_source": "unicode/2139.png?v8",
  4478. "innocent": "unicode/1f607.png?v8",
  4479. "interrobang": "unicode/2049.png?v8",
  4480. "iphone": "unicode/1f4f1.png?v8",
  4481. "iran": "unicode/1f1ee-1f1f7.png?v8",
  4482. "iraq": "unicode/1f1ee-1f1f6.png?v8",
  4483. "ireland": "unicode/1f1ee-1f1ea.png?v8",
  4484. "isle_of_man": "unicode/1f1ee-1f1f2.png?v8",
  4485. "israel": "unicode/1f1ee-1f1f1.png?v8",
  4486. "it": "unicode/1f1ee-1f1f9.png?v8",
  4487. "izakaya_lantern": "unicode/1f3ee.png?v8",
  4488. "jack_o_lantern": "unicode/1f383.png?v8",
  4489. "jamaica": "unicode/1f1ef-1f1f2.png?v8",
  4490. "japan": "unicode/1f5fe.png?v8",
  4491. "japanese_castle": "unicode/1f3ef.png?v8",
  4492. "japanese_goblin": "unicode/1f47a.png?v8",
  4493. "japanese_ogre": "unicode/1f479.png?v8",
  4494. "jeans": "unicode/1f456.png?v8",
  4495. "jersey": "unicode/1f1ef-1f1ea.png?v8",
  4496. "jigsaw": "unicode/1f9e9.png?v8",
  4497. "jordan": "unicode/1f1ef-1f1f4.png?v8",
  4498. "joy": "unicode/1f602.png?v8",
  4499. "joy_cat": "unicode/1f639.png?v8",
  4500. "joystick": "unicode/1f579.png?v8",
  4501. "jp": "unicode/1f1ef-1f1f5.png?v8",
  4502. "judge": "unicode/1f9d1-2696.png?v8",
  4503. "juggling_person": "unicode/1f939.png?v8",
  4504. "kaaba": "unicode/1f54b.png?v8",
  4505. "kangaroo": "unicode/1f998.png?v8",
  4506. "kazakhstan": "unicode/1f1f0-1f1ff.png?v8",
  4507. "kenya": "unicode/1f1f0-1f1ea.png?v8",
  4508. "key": "unicode/1f511.png?v8",
  4509. "keyboard": "unicode/2328.png?v8",
  4510. "keycap_ten": "unicode/1f51f.png?v8",
  4511. "kick_scooter": "unicode/1f6f4.png?v8",
  4512. "kimono": "unicode/1f458.png?v8",
  4513. "kiribati": "unicode/1f1f0-1f1ee.png?v8",
  4514. "kiss": "unicode/1f48b.png?v8",
  4515. "kissing": "unicode/1f617.png?v8",
  4516. "kissing_cat": "unicode/1f63d.png?v8",
  4517. "kissing_closed_eyes": "unicode/1f61a.png?v8",
  4518. "kissing_heart": "unicode/1f618.png?v8",
  4519. "kissing_smiling_eyes": "unicode/1f619.png?v8",
  4520. "kite": "unicode/1fa81.png?v8",
  4521. "kiwi_fruit": "unicode/1f95d.png?v8",
  4522. "kneeling_man": "unicode/1f9ce-2642.png?v8",
  4523. "kneeling_person": "unicode/1f9ce.png?v8",
  4524. "kneeling_woman": "unicode/1f9ce-2640.png?v8",
  4525. "knife": "unicode/1f52a.png?v8",
  4526. "knot": "unicode/1faa2.png?v8",
  4527. "koala": "unicode/1f428.png?v8",
  4528. "koko": "unicode/1f201.png?v8",
  4529. "kosovo": "unicode/1f1fd-1f1f0.png?v8",
  4530. "kr": "unicode/1f1f0-1f1f7.png?v8",
  4531. "kuwait": "unicode/1f1f0-1f1fc.png?v8",
  4532. "kyrgyzstan": "unicode/1f1f0-1f1ec.png?v8",
  4533. "lab_coat": "unicode/1f97c.png?v8",
  4534. "label": "unicode/1f3f7.png?v8",
  4535. "lacrosse": "unicode/1f94d.png?v8",
  4536. "ladder": "unicode/1fa9c.png?v8",
  4537. "lady_beetle": "unicode/1f41e.png?v8",
  4538. "lantern": "unicode/1f3ee.png?v8",
  4539. "laos": "unicode/1f1f1-1f1e6.png?v8",
  4540. "large_blue_circle": "unicode/1f535.png?v8",
  4541. "large_blue_diamond": "unicode/1f537.png?v8",
  4542. "large_orange_diamond": "unicode/1f536.png?v8",
  4543. "last_quarter_moon": "unicode/1f317.png?v8",
  4544. "last_quarter_moon_with_face": "unicode/1f31c.png?v8",
  4545. "latin_cross": "unicode/271d.png?v8",
  4546. "latvia": "unicode/1f1f1-1f1fb.png?v8",
  4547. "laughing": "unicode/1f606.png?v8",
  4548. "leafy_green": "unicode/1f96c.png?v8",
  4549. "leaves": "unicode/1f343.png?v8",
  4550. "lebanon": "unicode/1f1f1-1f1e7.png?v8",
  4551. "ledger": "unicode/1f4d2.png?v8",
  4552. "left_luggage": "unicode/1f6c5.png?v8",
  4553. "left_right_arrow": "unicode/2194.png?v8",
  4554. "left_speech_bubble": "unicode/1f5e8.png?v8",
  4555. "leftwards_arrow_with_hook": "unicode/21a9.png?v8",
  4556. "leg": "unicode/1f9b5.png?v8",
  4557. "lemon": "unicode/1f34b.png?v8",
  4558. "leo": "unicode/264c.png?v8",
  4559. "leopard": "unicode/1f406.png?v8",
  4560. "lesotho": "unicode/1f1f1-1f1f8.png?v8",
  4561. "level_slider": "unicode/1f39a.png?v8",
  4562. "liberia": "unicode/1f1f1-1f1f7.png?v8",
  4563. "libra": "unicode/264e.png?v8",
  4564. "libya": "unicode/1f1f1-1f1fe.png?v8",
  4565. "liechtenstein": "unicode/1f1f1-1f1ee.png?v8",
  4566. "light_rail": "unicode/1f688.png?v8",
  4567. "link": "unicode/1f517.png?v8",
  4568. "lion": "unicode/1f981.png?v8",
  4569. "lips": "unicode/1f444.png?v8",
  4570. "lipstick": "unicode/1f484.png?v8",
  4571. "lithuania": "unicode/1f1f1-1f1f9.png?v8",
  4572. "lizard": "unicode/1f98e.png?v8",
  4573. "llama": "unicode/1f999.png?v8",
  4574. "lobster": "unicode/1f99e.png?v8",
  4575. "lock": "unicode/1f512.png?v8",
  4576. "lock_with_ink_pen": "unicode/1f50f.png?v8",
  4577. "lollipop": "unicode/1f36d.png?v8",
  4578. "long_drum": "unicode/1fa98.png?v8",
  4579. "loop": "unicode/27bf.png?v8",
  4580. "lotion_bottle": "unicode/1f9f4.png?v8",
  4581. "lotus_position": "unicode/1f9d8.png?v8",
  4582. "lotus_position_man": "unicode/1f9d8-2642.png?v8",
  4583. "lotus_position_woman": "unicode/1f9d8-2640.png?v8",
  4584. "loud_sound": "unicode/1f50a.png?v8",
  4585. "loudspeaker": "unicode/1f4e2.png?v8",
  4586. "love_hotel": "unicode/1f3e9.png?v8",
  4587. "love_letter": "unicode/1f48c.png?v8",
  4588. "love_you_gesture": "unicode/1f91f.png?v8",
  4589. "low_brightness": "unicode/1f505.png?v8",
  4590. "luggage": "unicode/1f9f3.png?v8",
  4591. "lungs": "unicode/1fac1.png?v8",
  4592. "luxembourg": "unicode/1f1f1-1f1fa.png?v8",
  4593. "lying_face": "unicode/1f925.png?v8",
  4594. "m": "unicode/24c2.png?v8",
  4595. "macau": "unicode/1f1f2-1f1f4.png?v8",
  4596. "macedonia": "unicode/1f1f2-1f1f0.png?v8",
  4597. "madagascar": "unicode/1f1f2-1f1ec.png?v8",
  4598. "mag": "unicode/1f50d.png?v8",
  4599. "mag_right": "unicode/1f50e.png?v8",
  4600. "mage": "unicode/1f9d9.png?v8",
  4601. "mage_man": "unicode/1f9d9-2642.png?v8",
  4602. "mage_woman": "unicode/1f9d9-2640.png?v8",
  4603. "magic_wand": "unicode/1fa84.png?v8",
  4604. "magnet": "unicode/1f9f2.png?v8",
  4605. "mahjong": "unicode/1f004.png?v8",
  4606. "mailbox": "unicode/1f4eb.png?v8",
  4607. "mailbox_closed": "unicode/1f4ea.png?v8",
  4608. "mailbox_with_mail": "unicode/1f4ec.png?v8",
  4609. "mailbox_with_no_mail": "unicode/1f4ed.png?v8",
  4610. "malawi": "unicode/1f1f2-1f1fc.png?v8",
  4611. "malaysia": "unicode/1f1f2-1f1fe.png?v8",
  4612. "maldives": "unicode/1f1f2-1f1fb.png?v8",
  4613. "male_detective": "unicode/1f575-2642.png?v8",
  4614. "male_sign": "unicode/2642.png?v8",
  4615. "mali": "unicode/1f1f2-1f1f1.png?v8",
  4616. "malta": "unicode/1f1f2-1f1f9.png?v8",
  4617. "mammoth": "unicode/1f9a3.png?v8",
  4618. "man": "unicode/1f468.png?v8",
  4619. "man_artist": "unicode/1f468-1f3a8.png?v8",
  4620. "man_astronaut": "unicode/1f468-1f680.png?v8",
  4621. "man_beard": "unicode/1f9d4-2642.png?v8",
  4622. "man_cartwheeling": "unicode/1f938-2642.png?v8",
  4623. "man_cook": "unicode/1f468-1f373.png?v8",
  4624. "man_dancing": "unicode/1f57a.png?v8",
  4625. "man_facepalming": "unicode/1f926-2642.png?v8",
  4626. "man_factory_worker": "unicode/1f468-1f3ed.png?v8",
  4627. "man_farmer": "unicode/1f468-1f33e.png?v8",
  4628. "man_feeding_baby": "unicode/1f468-1f37c.png?v8",
  4629. "man_firefighter": "unicode/1f468-1f692.png?v8",
  4630. "man_health_worker": "unicode/1f468-2695.png?v8",
  4631. "man_in_manual_wheelchair": "unicode/1f468-1f9bd.png?v8",
  4632. "man_in_motorized_wheelchair": "unicode/1f468-1f9bc.png?v8",
  4633. "man_in_tuxedo": "unicode/1f935-2642.png?v8",
  4634. "man_judge": "unicode/1f468-2696.png?v8",
  4635. "man_juggling": "unicode/1f939-2642.png?v8",
  4636. "man_mechanic": "unicode/1f468-1f527.png?v8",
  4637. "man_office_worker": "unicode/1f468-1f4bc.png?v8",
  4638. "man_pilot": "unicode/1f468-2708.png?v8",
  4639. "man_playing_handball": "unicode/1f93e-2642.png?v8",
  4640. "man_playing_water_polo": "unicode/1f93d-2642.png?v8",
  4641. "man_scientist": "unicode/1f468-1f52c.png?v8",
  4642. "man_shrugging": "unicode/1f937-2642.png?v8",
  4643. "man_singer": "unicode/1f468-1f3a4.png?v8",
  4644. "man_student": "unicode/1f468-1f393.png?v8",
  4645. "man_teacher": "unicode/1f468-1f3eb.png?v8",
  4646. "man_technologist": "unicode/1f468-1f4bb.png?v8",
  4647. "man_with_gua_pi_mao": "unicode/1f472.png?v8",
  4648. "man_with_probing_cane": "unicode/1f468-1f9af.png?v8",
  4649. "man_with_turban": "unicode/1f473-2642.png?v8",
  4650. "man_with_veil": "unicode/1f470-2642.png?v8",
  4651. "mandarin": "unicode/1f34a.png?v8",
  4652. "mango": "unicode/1f96d.png?v8",
  4653. "mans_shoe": "unicode/1f45e.png?v8",
  4654. "mantelpiece_clock": "unicode/1f570.png?v8",
  4655. "manual_wheelchair": "unicode/1f9bd.png?v8",
  4656. "maple_leaf": "unicode/1f341.png?v8",
  4657. "marshall_islands": "unicode/1f1f2-1f1ed.png?v8",
  4658. "martial_arts_uniform": "unicode/1f94b.png?v8",
  4659. "martinique": "unicode/1f1f2-1f1f6.png?v8",
  4660. "mask": "unicode/1f637.png?v8",
  4661. "massage": "unicode/1f486.png?v8",
  4662. "massage_man": "unicode/1f486-2642.png?v8",
  4663. "massage_woman": "unicode/1f486-2640.png?v8",
  4664. "mate": "unicode/1f9c9.png?v8",
  4665. "mauritania": "unicode/1f1f2-1f1f7.png?v8",
  4666. "mauritius": "unicode/1f1f2-1f1fa.png?v8",
  4667. "mayotte": "unicode/1f1fe-1f1f9.png?v8",
  4668. "meat_on_bone": "unicode/1f356.png?v8",
  4669. "mechanic": "unicode/1f9d1-1f527.png?v8",
  4670. "mechanical_arm": "unicode/1f9be.png?v8",
  4671. "mechanical_leg": "unicode/1f9bf.png?v8",
  4672. "medal_military": "unicode/1f396.png?v8",
  4673. "medal_sports": "unicode/1f3c5.png?v8",
  4674. "medical_symbol": "unicode/2695.png?v8",
  4675. "mega": "unicode/1f4e3.png?v8",
  4676. "melon": "unicode/1f348.png?v8",
  4677. "memo": "unicode/1f4dd.png?v8",
  4678. "men_wrestling": "unicode/1f93c-2642.png?v8",
  4679. "mending_heart": "unicode/2764-1fa79.png?v8",
  4680. "menorah": "unicode/1f54e.png?v8",
  4681. "mens": "unicode/1f6b9.png?v8",
  4682. "mermaid": "unicode/1f9dc-2640.png?v8",
  4683. "merman": "unicode/1f9dc-2642.png?v8",
  4684. "merperson": "unicode/1f9dc.png?v8",
  4685. "metal": "unicode/1f918.png?v8",
  4686. "metro": "unicode/1f687.png?v8",
  4687. "mexico": "unicode/1f1f2-1f1fd.png?v8",
  4688. "microbe": "unicode/1f9a0.png?v8",
  4689. "micronesia": "unicode/1f1eb-1f1f2.png?v8",
  4690. "microphone": "unicode/1f3a4.png?v8",
  4691. "microscope": "unicode/1f52c.png?v8",
  4692. "middle_finger": "unicode/1f595.png?v8",
  4693. "military_helmet": "unicode/1fa96.png?v8",
  4694. "milk_glass": "unicode/1f95b.png?v8",
  4695. "milky_way": "unicode/1f30c.png?v8",
  4696. "minibus": "unicode/1f690.png?v8",
  4697. "minidisc": "unicode/1f4bd.png?v8",
  4698. "mirror": "unicode/1fa9e.png?v8",
  4699. "mobile_phone_off": "unicode/1f4f4.png?v8",
  4700. "moldova": "unicode/1f1f2-1f1e9.png?v8",
  4701. "monaco": "unicode/1f1f2-1f1e8.png?v8",
  4702. "money_mouth_face": "unicode/1f911.png?v8",
  4703. "money_with_wings": "unicode/1f4b8.png?v8",
  4704. "moneybag": "unicode/1f4b0.png?v8",
  4705. "mongolia": "unicode/1f1f2-1f1f3.png?v8",
  4706. "monkey": "unicode/1f412.png?v8",
  4707. "monkey_face": "unicode/1f435.png?v8",
  4708. "monocle_face": "unicode/1f9d0.png?v8",
  4709. "monorail": "unicode/1f69d.png?v8",
  4710. "montenegro": "unicode/1f1f2-1f1ea.png?v8",
  4711. "montserrat": "unicode/1f1f2-1f1f8.png?v8",
  4712. "moon": "unicode/1f314.png?v8",
  4713. "moon_cake": "unicode/1f96e.png?v8",
  4714. "morocco": "unicode/1f1f2-1f1e6.png?v8",
  4715. "mortar_board": "unicode/1f393.png?v8",
  4716. "mosque": "unicode/1f54c.png?v8",
  4717. "mosquito": "unicode/1f99f.png?v8",
  4718. "motor_boat": "unicode/1f6e5.png?v8",
  4719. "motor_scooter": "unicode/1f6f5.png?v8",
  4720. "motorcycle": "unicode/1f3cd.png?v8",
  4721. "motorized_wheelchair": "unicode/1f9bc.png?v8",
  4722. "motorway": "unicode/1f6e3.png?v8",
  4723. "mount_fuji": "unicode/1f5fb.png?v8",
  4724. "mountain": "unicode/26f0.png?v8",
  4725. "mountain_bicyclist": "unicode/1f6b5.png?v8",
  4726. "mountain_biking_man": "unicode/1f6b5-2642.png?v8",
  4727. "mountain_biking_woman": "unicode/1f6b5-2640.png?v8",
  4728. "mountain_cableway": "unicode/1f6a0.png?v8",
  4729. "mountain_railway": "unicode/1f69e.png?v8",
  4730. "mountain_snow": "unicode/1f3d4.png?v8",
  4731. "mouse": "unicode/1f42d.png?v8",
  4732. "mouse2": "unicode/1f401.png?v8",
  4733. "mouse_trap": "unicode/1faa4.png?v8",
  4734. "movie_camera": "unicode/1f3a5.png?v8",
  4735. "moyai": "unicode/1f5ff.png?v8",
  4736. "mozambique": "unicode/1f1f2-1f1ff.png?v8",
  4737. "mrs_claus": "unicode/1f936.png?v8",
  4738. "muscle": "unicode/1f4aa.png?v8",
  4739. "mushroom": "unicode/1f344.png?v8",
  4740. "musical_keyboard": "unicode/1f3b9.png?v8",
  4741. "musical_note": "unicode/1f3b5.png?v8",
  4742. "musical_score": "unicode/1f3bc.png?v8",
  4743. "mute": "unicode/1f507.png?v8",
  4744. "mx_claus": "unicode/1f9d1-1f384.png?v8",
  4745. "myanmar": "unicode/1f1f2-1f1f2.png?v8",
  4746. "nail_care": "unicode/1f485.png?v8",
  4747. "name_badge": "unicode/1f4db.png?v8",
  4748. "namibia": "unicode/1f1f3-1f1e6.png?v8",
  4749. "national_park": "unicode/1f3de.png?v8",
  4750. "nauru": "unicode/1f1f3-1f1f7.png?v8",
  4751. "nauseated_face": "unicode/1f922.png?v8",
  4752. "nazar_amulet": "unicode/1f9ff.png?v8",
  4753. "neckbeard": "neckbeard.png?v8",
  4754. "necktie": "unicode/1f454.png?v8",
  4755. "negative_squared_cross_mark": "unicode/274e.png?v8",
  4756. "nepal": "unicode/1f1f3-1f1f5.png?v8",
  4757. "nerd_face": "unicode/1f913.png?v8",
  4758. "nesting_dolls": "unicode/1fa86.png?v8",
  4759. "netherlands": "unicode/1f1f3-1f1f1.png?v8",
  4760. "neutral_face": "unicode/1f610.png?v8",
  4761. "new": "unicode/1f195.png?v8",
  4762. "new_caledonia": "unicode/1f1f3-1f1e8.png?v8",
  4763. "new_moon": "unicode/1f311.png?v8",
  4764. "new_moon_with_face": "unicode/1f31a.png?v8",
  4765. "new_zealand": "unicode/1f1f3-1f1ff.png?v8",
  4766. "newspaper": "unicode/1f4f0.png?v8",
  4767. "newspaper_roll": "unicode/1f5de.png?v8",
  4768. "next_track_button": "unicode/23ed.png?v8",
  4769. "ng": "unicode/1f196.png?v8",
  4770. "ng_man": "unicode/1f645-2642.png?v8",
  4771. "ng_woman": "unicode/1f645-2640.png?v8",
  4772. "nicaragua": "unicode/1f1f3-1f1ee.png?v8",
  4773. "niger": "unicode/1f1f3-1f1ea.png?v8",
  4774. "nigeria": "unicode/1f1f3-1f1ec.png?v8",
  4775. "night_with_stars": "unicode/1f303.png?v8",
  4776. "nine": "unicode/0039-20e3.png?v8",
  4777. "ninja": "unicode/1f977.png?v8",
  4778. "niue": "unicode/1f1f3-1f1fa.png?v8",
  4779. "no_bell": "unicode/1f515.png?v8",
  4780. "no_bicycles": "unicode/1f6b3.png?v8",
  4781. "no_entry": "unicode/26d4.png?v8",
  4782. "no_entry_sign": "unicode/1f6ab.png?v8",
  4783. "no_good": "unicode/1f645.png?v8",
  4784. "no_good_man": "unicode/1f645-2642.png?v8",
  4785. "no_good_woman": "unicode/1f645-2640.png?v8",
  4786. "no_mobile_phones": "unicode/1f4f5.png?v8",
  4787. "no_mouth": "unicode/1f636.png?v8",
  4788. "no_pedestrians": "unicode/1f6b7.png?v8",
  4789. "no_smoking": "unicode/1f6ad.png?v8",
  4790. "non-potable_water": "unicode/1f6b1.png?v8",
  4791. "norfolk_island": "unicode/1f1f3-1f1eb.png?v8",
  4792. "north_korea": "unicode/1f1f0-1f1f5.png?v8",
  4793. "northern_mariana_islands": "unicode/1f1f2-1f1f5.png?v8",
  4794. "norway": "unicode/1f1f3-1f1f4.png?v8",
  4795. "nose": "unicode/1f443.png?v8",
  4796. "notebook": "unicode/1f4d3.png?v8",
  4797. "notebook_with_decorative_cover": "unicode/1f4d4.png?v8",
  4798. "notes": "unicode/1f3b6.png?v8",
  4799. "nut_and_bolt": "unicode/1f529.png?v8",
  4800. "o": "unicode/2b55.png?v8",
  4801. "o2": "unicode/1f17e.png?v8",
  4802. "ocean": "unicode/1f30a.png?v8",
  4803. "octocat": "octocat.png?v8",
  4804. "octopus": "unicode/1f419.png?v8",
  4805. "oden": "unicode/1f362.png?v8",
  4806. "office": "unicode/1f3e2.png?v8",
  4807. "office_worker": "unicode/1f9d1-1f4bc.png?v8",
  4808. "oil_drum": "unicode/1f6e2.png?v8",
  4809. "ok": "unicode/1f197.png?v8",
  4810. "ok_hand": "unicode/1f44c.png?v8",
  4811. "ok_man": "unicode/1f646-2642.png?v8",
  4812. "ok_person": "unicode/1f646.png?v8",
  4813. "ok_woman": "unicode/1f646-2640.png?v8",
  4814. "old_key": "unicode/1f5dd.png?v8",
  4815. "older_adult": "unicode/1f9d3.png?v8",
  4816. "older_man": "unicode/1f474.png?v8",
  4817. "older_woman": "unicode/1f475.png?v8",
  4818. "olive": "unicode/1fad2.png?v8",
  4819. "om": "unicode/1f549.png?v8",
  4820. "oman": "unicode/1f1f4-1f1f2.png?v8",
  4821. "on": "unicode/1f51b.png?v8",
  4822. "oncoming_automobile": "unicode/1f698.png?v8",
  4823. "oncoming_bus": "unicode/1f68d.png?v8",
  4824. "oncoming_police_car": "unicode/1f694.png?v8",
  4825. "oncoming_taxi": "unicode/1f696.png?v8",
  4826. "one": "unicode/0031-20e3.png?v8",
  4827. "one_piece_swimsuit": "unicode/1fa71.png?v8",
  4828. "onion": "unicode/1f9c5.png?v8",
  4829. "open_book": "unicode/1f4d6.png?v8",
  4830. "open_file_folder": "unicode/1f4c2.png?v8",
  4831. "open_hands": "unicode/1f450.png?v8",
  4832. "open_mouth": "unicode/1f62e.png?v8",
  4833. "open_umbrella": "unicode/2602.png?v8",
  4834. "ophiuchus": "unicode/26ce.png?v8",
  4835. "orange": "unicode/1f34a.png?v8",
  4836. "orange_book": "unicode/1f4d9.png?v8",
  4837. "orange_circle": "unicode/1f7e0.png?v8",
  4838. "orange_heart": "unicode/1f9e1.png?v8",
  4839. "orange_square": "unicode/1f7e7.png?v8",
  4840. "orangutan": "unicode/1f9a7.png?v8",
  4841. "orthodox_cross": "unicode/2626.png?v8",
  4842. "otter": "unicode/1f9a6.png?v8",
  4843. "outbox_tray": "unicode/1f4e4.png?v8",
  4844. "owl": "unicode/1f989.png?v8",
  4845. "ox": "unicode/1f402.png?v8",
  4846. "oyster": "unicode/1f9aa.png?v8",
  4847. "package": "unicode/1f4e6.png?v8",
  4848. "page_facing_up": "unicode/1f4c4.png?v8",
  4849. "page_with_curl": "unicode/1f4c3.png?v8",
  4850. "pager": "unicode/1f4df.png?v8",
  4851. "paintbrush": "unicode/1f58c.png?v8",
  4852. "pakistan": "unicode/1f1f5-1f1f0.png?v8",
  4853. "palau": "unicode/1f1f5-1f1fc.png?v8",
  4854. "palestinian_territories": "unicode/1f1f5-1f1f8.png?v8",
  4855. "palm_tree": "unicode/1f334.png?v8",
  4856. "palms_up_together": "unicode/1f932.png?v8",
  4857. "panama": "unicode/1f1f5-1f1e6.png?v8",
  4858. "pancakes": "unicode/1f95e.png?v8",
  4859. "panda_face": "unicode/1f43c.png?v8",
  4860. "paperclip": "unicode/1f4ce.png?v8",
  4861. "paperclips": "unicode/1f587.png?v8",
  4862. "papua_new_guinea": "unicode/1f1f5-1f1ec.png?v8",
  4863. "parachute": "unicode/1fa82.png?v8",
  4864. "paraguay": "unicode/1f1f5-1f1fe.png?v8",
  4865. "parasol_on_ground": "unicode/26f1.png?v8",
  4866. "parking": "unicode/1f17f.png?v8",
  4867. "parrot": "unicode/1f99c.png?v8",
  4868. "part_alternation_mark": "unicode/303d.png?v8",
  4869. "partly_sunny": "unicode/26c5.png?v8",
  4870. "partying_face": "unicode/1f973.png?v8",
  4871. "passenger_ship": "unicode/1f6f3.png?v8",
  4872. "passport_control": "unicode/1f6c2.png?v8",
  4873. "pause_button": "unicode/23f8.png?v8",
  4874. "paw_prints": "unicode/1f43e.png?v8",
  4875. "peace_symbol": "unicode/262e.png?v8",
  4876. "peach": "unicode/1f351.png?v8",
  4877. "peacock": "unicode/1f99a.png?v8",
  4878. "peanuts": "unicode/1f95c.png?v8",
  4879. "pear": "unicode/1f350.png?v8",
  4880. "pen": "unicode/1f58a.png?v8",
  4881. "pencil": "unicode/1f4dd.png?v8",
  4882. "pencil2": "unicode/270f.png?v8",
  4883. "penguin": "unicode/1f427.png?v8",
  4884. "pensive": "unicode/1f614.png?v8",
  4885. "people_holding_hands": "unicode/1f9d1-1f91d-1f9d1.png?v8",
  4886. "people_hugging": "unicode/1fac2.png?v8",
  4887. "performing_arts": "unicode/1f3ad.png?v8",
  4888. "persevere": "unicode/1f623.png?v8",
  4889. "person_bald": "unicode/1f9d1-1f9b2.png?v8",
  4890. "person_curly_hair": "unicode/1f9d1-1f9b1.png?v8",
  4891. "person_feeding_baby": "unicode/1f9d1-1f37c.png?v8",
  4892. "person_fencing": "unicode/1f93a.png?v8",
  4893. "person_in_manual_wheelchair": "unicode/1f9d1-1f9bd.png?v8",
  4894. "person_in_motorized_wheelchair": "unicode/1f9d1-1f9bc.png?v8",
  4895. "person_in_tuxedo": "unicode/1f935.png?v8",
  4896. "person_red_hair": "unicode/1f9d1-1f9b0.png?v8",
  4897. "person_white_hair": "unicode/1f9d1-1f9b3.png?v8",
  4898. "person_with_probing_cane": "unicode/1f9d1-1f9af.png?v8",
  4899. "person_with_turban": "unicode/1f473.png?v8",
  4900. "person_with_veil": "unicode/1f470.png?v8",
  4901. "peru": "unicode/1f1f5-1f1ea.png?v8",
  4902. "petri_dish": "unicode/1f9eb.png?v8",
  4903. "philippines": "unicode/1f1f5-1f1ed.png?v8",
  4904. "phone": "unicode/260e.png?v8",
  4905. "pick": "unicode/26cf.png?v8",
  4906. "pickup_truck": "unicode/1f6fb.png?v8",
  4907. "pie": "unicode/1f967.png?v8",
  4908. "pig": "unicode/1f437.png?v8",
  4909. "pig2": "unicode/1f416.png?v8",
  4910. "pig_nose": "unicode/1f43d.png?v8",
  4911. "pill": "unicode/1f48a.png?v8",
  4912. "pilot": "unicode/1f9d1-2708.png?v8",
  4913. "pinata": "unicode/1fa85.png?v8",
  4914. "pinched_fingers": "unicode/1f90c.png?v8",
  4915. "pinching_hand": "unicode/1f90f.png?v8",
  4916. "pineapple": "unicode/1f34d.png?v8",
  4917. "ping_pong": "unicode/1f3d3.png?v8",
  4918. "pirate_flag": "unicode/1f3f4-2620.png?v8",
  4919. "pisces": "unicode/2653.png?v8",
  4920. "pitcairn_islands": "unicode/1f1f5-1f1f3.png?v8",
  4921. "pizza": "unicode/1f355.png?v8",
  4922. "placard": "unicode/1faa7.png?v8",
  4923. "place_of_worship": "unicode/1f6d0.png?v8",
  4924. "plate_with_cutlery": "unicode/1f37d.png?v8",
  4925. "play_or_pause_button": "unicode/23ef.png?v8",
  4926. "pleading_face": "unicode/1f97a.png?v8",
  4927. "plunger": "unicode/1faa0.png?v8",
  4928. "point_down": "unicode/1f447.png?v8",
  4929. "point_left": "unicode/1f448.png?v8",
  4930. "point_right": "unicode/1f449.png?v8",
  4931. "point_up": "unicode/261d.png?v8",
  4932. "point_up_2": "unicode/1f446.png?v8",
  4933. "poland": "unicode/1f1f5-1f1f1.png?v8",
  4934. "polar_bear": "unicode/1f43b-2744.png?v8",
  4935. "police_car": "unicode/1f693.png?v8",
  4936. "police_officer": "unicode/1f46e.png?v8",
  4937. "policeman": "unicode/1f46e-2642.png?v8",
  4938. "policewoman": "unicode/1f46e-2640.png?v8",
  4939. "poodle": "unicode/1f429.png?v8",
  4940. "poop": "unicode/1f4a9.png?v8",
  4941. "popcorn": "unicode/1f37f.png?v8",
  4942. "portugal": "unicode/1f1f5-1f1f9.png?v8",
  4943. "post_office": "unicode/1f3e3.png?v8",
  4944. "postal_horn": "unicode/1f4ef.png?v8",
  4945. "postbox": "unicode/1f4ee.png?v8",
  4946. "potable_water": "unicode/1f6b0.png?v8",
  4947. "potato": "unicode/1f954.png?v8",
  4948. "potted_plant": "unicode/1fab4.png?v8",
  4949. "pouch": "unicode/1f45d.png?v8",
  4950. "poultry_leg": "unicode/1f357.png?v8",
  4951. "pound": "unicode/1f4b7.png?v8",
  4952. "pout": "unicode/1f621.png?v8",
  4953. "pouting_cat": "unicode/1f63e.png?v8",
  4954. "pouting_face": "unicode/1f64e.png?v8",
  4955. "pouting_man": "unicode/1f64e-2642.png?v8",
  4956. "pouting_woman": "unicode/1f64e-2640.png?v8",
  4957. "pray": "unicode/1f64f.png?v8",
  4958. "prayer_beads": "unicode/1f4ff.png?v8",
  4959. "pregnant_woman": "unicode/1f930.png?v8",
  4960. "pretzel": "unicode/1f968.png?v8",
  4961. "previous_track_button": "unicode/23ee.png?v8",
  4962. "prince": "unicode/1f934.png?v8",
  4963. "princess": "unicode/1f478.png?v8",
  4964. "printer": "unicode/1f5a8.png?v8",
  4965. "probing_cane": "unicode/1f9af.png?v8",
  4966. "puerto_rico": "unicode/1f1f5-1f1f7.png?v8",
  4967. "punch": "unicode/1f44a.png?v8",
  4968. "purple_circle": "unicode/1f7e3.png?v8",
  4969. "purple_heart": "unicode/1f49c.png?v8",
  4970. "purple_square": "unicode/1f7ea.png?v8",
  4971. "purse": "unicode/1f45b.png?v8",
  4972. "pushpin": "unicode/1f4cc.png?v8",
  4973. "put_litter_in_its_place": "unicode/1f6ae.png?v8",
  4974. "qatar": "unicode/1f1f6-1f1e6.png?v8",
  4975. "question": "unicode/2753.png?v8",
  4976. "rabbit": "unicode/1f430.png?v8",
  4977. "rabbit2": "unicode/1f407.png?v8",
  4978. "raccoon": "unicode/1f99d.png?v8",
  4979. "racehorse": "unicode/1f40e.png?v8",
  4980. "racing_car": "unicode/1f3ce.png?v8",
  4981. "radio": "unicode/1f4fb.png?v8",
  4982. "radio_button": "unicode/1f518.png?v8",
  4983. "radioactive": "unicode/2622.png?v8",
  4984. "rage": "unicode/1f621.png?v8",
  4985. "rage1": "rage1.png?v8",
  4986. "rage2": "rage2.png?v8",
  4987. "rage3": "rage3.png?v8",
  4988. "rage4": "rage4.png?v8",
  4989. "railway_car": "unicode/1f683.png?v8",
  4990. "railway_track": "unicode/1f6e4.png?v8",
  4991. "rainbow": "unicode/1f308.png?v8",
  4992. "rainbow_flag": "unicode/1f3f3-1f308.png?v8",
  4993. "raised_back_of_hand": "unicode/1f91a.png?v8",
  4994. "raised_eyebrow": "unicode/1f928.png?v8",
  4995. "raised_hand": "unicode/270b.png?v8",
  4996. "raised_hand_with_fingers_splayed": "unicode/1f590.png?v8",
  4997. "raised_hands": "unicode/1f64c.png?v8",
  4998. "raising_hand": "unicode/1f64b.png?v8",
  4999. "raising_hand_man": "unicode/1f64b-2642.png?v8",
  5000. "raising_hand_woman": "unicode/1f64b-2640.png?v8",
  5001. "ram": "unicode/1f40f.png?v8",
  5002. "ramen": "unicode/1f35c.png?v8",
  5003. "rat": "unicode/1f400.png?v8",
  5004. "razor": "unicode/1fa92.png?v8",
  5005. "receipt": "unicode/1f9fe.png?v8",
  5006. "record_button": "unicode/23fa.png?v8",
  5007. "recycle": "unicode/267b.png?v8",
  5008. "red_car": "unicode/1f697.png?v8",
  5009. "red_circle": "unicode/1f534.png?v8",
  5010. "red_envelope": "unicode/1f9e7.png?v8",
  5011. "red_haired_man": "unicode/1f468-1f9b0.png?v8",
  5012. "red_haired_woman": "unicode/1f469-1f9b0.png?v8",
  5013. "red_square": "unicode/1f7e5.png?v8",
  5014. "registered": "unicode/00ae.png?v8",
  5015. "relaxed": "unicode/263a.png?v8",
  5016. "relieved": "unicode/1f60c.png?v8",
  5017. "reminder_ribbon": "unicode/1f397.png?v8",
  5018. "repeat": "unicode/1f501.png?v8",
  5019. "repeat_one": "unicode/1f502.png?v8",
  5020. "rescue_worker_helmet": "unicode/26d1.png?v8",
  5021. "restroom": "unicode/1f6bb.png?v8",
  5022. "reunion": "unicode/1f1f7-1f1ea.png?v8",
  5023. "revolving_hearts": "unicode/1f49e.png?v8",
  5024. "rewind": "unicode/23ea.png?v8",
  5025. "rhinoceros": "unicode/1f98f.png?v8",
  5026. "ribbon": "unicode/1f380.png?v8",
  5027. "rice": "unicode/1f35a.png?v8",
  5028. "rice_ball": "unicode/1f359.png?v8",
  5029. "rice_cracker": "unicode/1f358.png?v8",
  5030. "rice_scene": "unicode/1f391.png?v8",
  5031. "right_anger_bubble": "unicode/1f5ef.png?v8",
  5032. "ring": "unicode/1f48d.png?v8",
  5033. "ringed_planet": "unicode/1fa90.png?v8",
  5034. "robot": "unicode/1f916.png?v8",
  5035. "rock": "unicode/1faa8.png?v8",
  5036. "rocket": "unicode/1f680.png?v8",
  5037. "rofl": "unicode/1f923.png?v8",
  5038. "roll_eyes": "unicode/1f644.png?v8",
  5039. "roll_of_paper": "unicode/1f9fb.png?v8",
  5040. "roller_coaster": "unicode/1f3a2.png?v8",
  5041. "roller_skate": "unicode/1f6fc.png?v8",
  5042. "romania": "unicode/1f1f7-1f1f4.png?v8",
  5043. "rooster": "unicode/1f413.png?v8",
  5044. "rose": "unicode/1f339.png?v8",
  5045. "rosette": "unicode/1f3f5.png?v8",
  5046. "rotating_light": "unicode/1f6a8.png?v8",
  5047. "round_pushpin": "unicode/1f4cd.png?v8",
  5048. "rowboat": "unicode/1f6a3.png?v8",
  5049. "rowing_man": "unicode/1f6a3-2642.png?v8",
  5050. "rowing_woman": "unicode/1f6a3-2640.png?v8",
  5051. "ru": "unicode/1f1f7-1f1fa.png?v8",
  5052. "rugby_football": "unicode/1f3c9.png?v8",
  5053. "runner": "unicode/1f3c3.png?v8",
  5054. "running": "unicode/1f3c3.png?v8",
  5055. "running_man": "unicode/1f3c3-2642.png?v8",
  5056. "running_shirt_with_sash": "unicode/1f3bd.png?v8",
  5057. "running_woman": "unicode/1f3c3-2640.png?v8",
  5058. "rwanda": "unicode/1f1f7-1f1fc.png?v8",
  5059. "sa": "unicode/1f202.png?v8",
  5060. "safety_pin": "unicode/1f9f7.png?v8",
  5061. "safety_vest": "unicode/1f9ba.png?v8",
  5062. "sagittarius": "unicode/2650.png?v8",
  5063. "sailboat": "unicode/26f5.png?v8",
  5064. "sake": "unicode/1f376.png?v8",
  5065. "salt": "unicode/1f9c2.png?v8",
  5066. "samoa": "unicode/1f1fc-1f1f8.png?v8",
  5067. "san_marino": "unicode/1f1f8-1f1f2.png?v8",
  5068. "sandal": "unicode/1f461.png?v8",
  5069. "sandwich": "unicode/1f96a.png?v8",
  5070. "santa": "unicode/1f385.png?v8",
  5071. "sao_tome_principe": "unicode/1f1f8-1f1f9.png?v8",
  5072. "sari": "unicode/1f97b.png?v8",
  5073. "sassy_man": "unicode/1f481-2642.png?v8",
  5074. "sassy_woman": "unicode/1f481-2640.png?v8",
  5075. "satellite": "unicode/1f4e1.png?v8",
  5076. "satisfied": "unicode/1f606.png?v8",
  5077. "saudi_arabia": "unicode/1f1f8-1f1e6.png?v8",
  5078. "sauna_man": "unicode/1f9d6-2642.png?v8",
  5079. "sauna_person": "unicode/1f9d6.png?v8",
  5080. "sauna_woman": "unicode/1f9d6-2640.png?v8",
  5081. "sauropod": "unicode/1f995.png?v8",
  5082. "saxophone": "unicode/1f3b7.png?v8",
  5083. "scarf": "unicode/1f9e3.png?v8",
  5084. "school": "unicode/1f3eb.png?v8",
  5085. "school_satchel": "unicode/1f392.png?v8",
  5086. "scientist": "unicode/1f9d1-1f52c.png?v8",
  5087. "scissors": "unicode/2702.png?v8",
  5088. "scorpion": "unicode/1f982.png?v8",
  5089. "scorpius": "unicode/264f.png?v8",
  5090. "scotland": "unicode/1f3f4-e0067-e0062-e0073-e0063-e0074-e007f.png?v8",
  5091. "scream": "unicode/1f631.png?v8",
  5092. "scream_cat": "unicode/1f640.png?v8",
  5093. "screwdriver": "unicode/1fa9b.png?v8",
  5094. "scroll": "unicode/1f4dc.png?v8",
  5095. "seal": "unicode/1f9ad.png?v8",
  5096. "seat": "unicode/1f4ba.png?v8",
  5097. "secret": "unicode/3299.png?v8",
  5098. "see_no_evil": "unicode/1f648.png?v8",
  5099. "seedling": "unicode/1f331.png?v8",
  5100. "selfie": "unicode/1f933.png?v8",
  5101. "senegal": "unicode/1f1f8-1f1f3.png?v8",
  5102. "serbia": "unicode/1f1f7-1f1f8.png?v8",
  5103. "service_dog": "unicode/1f415-1f9ba.png?v8",
  5104. "seven": "unicode/0037-20e3.png?v8",
  5105. "sewing_needle": "unicode/1faa1.png?v8",
  5106. "seychelles": "unicode/1f1f8-1f1e8.png?v8",
  5107. "shallow_pan_of_food": "unicode/1f958.png?v8",
  5108. "shamrock": "unicode/2618.png?v8",
  5109. "shark": "unicode/1f988.png?v8",
  5110. "shaved_ice": "unicode/1f367.png?v8",
  5111. "sheep": "unicode/1f411.png?v8",
  5112. "shell": "unicode/1f41a.png?v8",
  5113. "shield": "unicode/1f6e1.png?v8",
  5114. "shinto_shrine": "unicode/26e9.png?v8",
  5115. "ship": "unicode/1f6a2.png?v8",
  5116. "shipit": "shipit.png?v8",
  5117. "shirt": "unicode/1f455.png?v8",
  5118. "shit": "unicode/1f4a9.png?v8",
  5119. "shoe": "unicode/1f45e.png?v8",
  5120. "shopping": "unicode/1f6cd.png?v8",
  5121. "shopping_cart": "unicode/1f6d2.png?v8",
  5122. "shorts": "unicode/1fa73.png?v8",
  5123. "shower": "unicode/1f6bf.png?v8",
  5124. "shrimp": "unicode/1f990.png?v8",
  5125. "shrug": "unicode/1f937.png?v8",
  5126. "shushing_face": "unicode/1f92b.png?v8",
  5127. "sierra_leone": "unicode/1f1f8-1f1f1.png?v8",
  5128. "signal_strength": "unicode/1f4f6.png?v8",
  5129. "singapore": "unicode/1f1f8-1f1ec.png?v8",
  5130. "singer": "unicode/1f9d1-1f3a4.png?v8",
  5131. "sint_maarten": "unicode/1f1f8-1f1fd.png?v8",
  5132. "six": "unicode/0036-20e3.png?v8",
  5133. "six_pointed_star": "unicode/1f52f.png?v8",
  5134. "skateboard": "unicode/1f6f9.png?v8",
  5135. "ski": "unicode/1f3bf.png?v8",
  5136. "skier": "unicode/26f7.png?v8",
  5137. "skull": "unicode/1f480.png?v8",
  5138. "skull_and_crossbones": "unicode/2620.png?v8",
  5139. "skunk": "unicode/1f9a8.png?v8",
  5140. "sled": "unicode/1f6f7.png?v8",
  5141. "sleeping": "unicode/1f634.png?v8",
  5142. "sleeping_bed": "unicode/1f6cc.png?v8",
  5143. "sleepy": "unicode/1f62a.png?v8",
  5144. "slightly_frowning_face": "unicode/1f641.png?v8",
  5145. "slightly_smiling_face": "unicode/1f642.png?v8",
  5146. "slot_machine": "unicode/1f3b0.png?v8",
  5147. "sloth": "unicode/1f9a5.png?v8",
  5148. "slovakia": "unicode/1f1f8-1f1f0.png?v8",
  5149. "slovenia": "unicode/1f1f8-1f1ee.png?v8",
  5150. "small_airplane": "unicode/1f6e9.png?v8",
  5151. "small_blue_diamond": "unicode/1f539.png?v8",
  5152. "small_orange_diamond": "unicode/1f538.png?v8",
  5153. "small_red_triangle": "unicode/1f53a.png?v8",
  5154. "small_red_triangle_down": "unicode/1f53b.png?v8",
  5155. "smile": "unicode/1f604.png?v8",
  5156. "smile_cat": "unicode/1f638.png?v8",
  5157. "smiley": "unicode/1f603.png?v8",
  5158. "smiley_cat": "unicode/1f63a.png?v8",
  5159. "smiling_face_with_tear": "unicode/1f972.png?v8",
  5160. "smiling_face_with_three_hearts": "unicode/1f970.png?v8",
  5161. "smiling_imp": "unicode/1f608.png?v8",
  5162. "smirk": "unicode/1f60f.png?v8",
  5163. "smirk_cat": "unicode/1f63c.png?v8",
  5164. "smoking": "unicode/1f6ac.png?v8",
  5165. "snail": "unicode/1f40c.png?v8",
  5166. "snake": "unicode/1f40d.png?v8",
  5167. "sneezing_face": "unicode/1f927.png?v8",
  5168. "snowboarder": "unicode/1f3c2.png?v8",
  5169. "snowflake": "unicode/2744.png?v8",
  5170. "snowman": "unicode/26c4.png?v8",
  5171. "snowman_with_snow": "unicode/2603.png?v8",
  5172. "soap": "unicode/1f9fc.png?v8",
  5173. "sob": "unicode/1f62d.png?v8",
  5174. "soccer": "unicode/26bd.png?v8",
  5175. "socks": "unicode/1f9e6.png?v8",
  5176. "softball": "unicode/1f94e.png?v8",
  5177. "solomon_islands": "unicode/1f1f8-1f1e7.png?v8",
  5178. "somalia": "unicode/1f1f8-1f1f4.png?v8",
  5179. "soon": "unicode/1f51c.png?v8",
  5180. "sos": "unicode/1f198.png?v8",
  5181. "sound": "unicode/1f509.png?v8",
  5182. "south_africa": "unicode/1f1ff-1f1e6.png?v8",
  5183. "south_georgia_south_sandwich_islands": "unicode/1f1ec-1f1f8.png?v8",
  5184. "south_sudan": "unicode/1f1f8-1f1f8.png?v8",
  5185. "space_invader": "unicode/1f47e.png?v8",
  5186. "spades": "unicode/2660.png?v8",
  5187. "spaghetti": "unicode/1f35d.png?v8",
  5188. "sparkle": "unicode/2747.png?v8",
  5189. "sparkler": "unicode/1f387.png?v8",
  5190. "sparkles": "unicode/2728.png?v8",
  5191. "sparkling_heart": "unicode/1f496.png?v8",
  5192. "speak_no_evil": "unicode/1f64a.png?v8",
  5193. "speaker": "unicode/1f508.png?v8",
  5194. "speaking_head": "unicode/1f5e3.png?v8",
  5195. "speech_balloon": "unicode/1f4ac.png?v8",
  5196. "speedboat": "unicode/1f6a4.png?v8",
  5197. "spider": "unicode/1f577.png?v8",
  5198. "spider_web": "unicode/1f578.png?v8",
  5199. "spiral_calendar": "unicode/1f5d3.png?v8",
  5200. "spiral_notepad": "unicode/1f5d2.png?v8",
  5201. "sponge": "unicode/1f9fd.png?v8",
  5202. "spoon": "unicode/1f944.png?v8",
  5203. "squid": "unicode/1f991.png?v8",
  5204. "sri_lanka": "unicode/1f1f1-1f1f0.png?v8",
  5205. "st_barthelemy": "unicode/1f1e7-1f1f1.png?v8",
  5206. "st_helena": "unicode/1f1f8-1f1ed.png?v8",
  5207. "st_kitts_nevis": "unicode/1f1f0-1f1f3.png?v8",
  5208. "st_lucia": "unicode/1f1f1-1f1e8.png?v8",
  5209. "st_martin": "unicode/1f1f2-1f1eb.png?v8",
  5210. "st_pierre_miquelon": "unicode/1f1f5-1f1f2.png?v8",
  5211. "st_vincent_grenadines": "unicode/1f1fb-1f1e8.png?v8",
  5212. "stadium": "unicode/1f3df.png?v8",
  5213. "standing_man": "unicode/1f9cd-2642.png?v8",
  5214. "standing_person": "unicode/1f9cd.png?v8",
  5215. "standing_woman": "unicode/1f9cd-2640.png?v8",
  5216. "star": "unicode/2b50.png?v8",
  5217. "star2": "unicode/1f31f.png?v8",
  5218. "star_and_crescent": "unicode/262a.png?v8",
  5219. "star_of_david": "unicode/2721.png?v8",
  5220. "star_struck": "unicode/1f929.png?v8",
  5221. "stars": "unicode/1f320.png?v8",
  5222. "station": "unicode/1f689.png?v8",
  5223. "statue_of_liberty": "unicode/1f5fd.png?v8",
  5224. "steam_locomotive": "unicode/1f682.png?v8",
  5225. "stethoscope": "unicode/1fa7a.png?v8",
  5226. "stew": "unicode/1f372.png?v8",
  5227. "stop_button": "unicode/23f9.png?v8",
  5228. "stop_sign": "unicode/1f6d1.png?v8",
  5229. "stopwatch": "unicode/23f1.png?v8",
  5230. "straight_ruler": "unicode/1f4cf.png?v8",
  5231. "strawberry": "unicode/1f353.png?v8",
  5232. "stuck_out_tongue": "unicode/1f61b.png?v8",
  5233. "stuck_out_tongue_closed_eyes": "unicode/1f61d.png?v8",
  5234. "stuck_out_tongue_winking_eye": "unicode/1f61c.png?v8",
  5235. "student": "unicode/1f9d1-1f393.png?v8",
  5236. "studio_microphone": "unicode/1f399.png?v8",
  5237. "stuffed_flatbread": "unicode/1f959.png?v8",
  5238. "sudan": "unicode/1f1f8-1f1e9.png?v8",
  5239. "sun_behind_large_cloud": "unicode/1f325.png?v8",
  5240. "sun_behind_rain_cloud": "unicode/1f326.png?v8",
  5241. "sun_behind_small_cloud": "unicode/1f324.png?v8",
  5242. "sun_with_face": "unicode/1f31e.png?v8",
  5243. "sunflower": "unicode/1f33b.png?v8",
  5244. "sunglasses": "unicode/1f60e.png?v8",
  5245. "sunny": "unicode/2600.png?v8",
  5246. "sunrise": "unicode/1f305.png?v8",
  5247. "sunrise_over_mountains": "unicode/1f304.png?v8",
  5248. "superhero": "unicode/1f9b8.png?v8",
  5249. "superhero_man": "unicode/1f9b8-2642.png?v8",
  5250. "superhero_woman": "unicode/1f9b8-2640.png?v8",
  5251. "supervillain": "unicode/1f9b9.png?v8",
  5252. "supervillain_man": "unicode/1f9b9-2642.png?v8",
  5253. "supervillain_woman": "unicode/1f9b9-2640.png?v8",
  5254. "surfer": "unicode/1f3c4.png?v8",
  5255. "surfing_man": "unicode/1f3c4-2642.png?v8",
  5256. "surfing_woman": "unicode/1f3c4-2640.png?v8",
  5257. "suriname": "unicode/1f1f8-1f1f7.png?v8",
  5258. "sushi": "unicode/1f363.png?v8",
  5259. "suspect": "suspect.png?v8",
  5260. "suspension_railway": "unicode/1f69f.png?v8",
  5261. "svalbard_jan_mayen": "unicode/1f1f8-1f1ef.png?v8",
  5262. "swan": "unicode/1f9a2.png?v8",
  5263. "swaziland": "unicode/1f1f8-1f1ff.png?v8",
  5264. "sweat": "unicode/1f613.png?v8",
  5265. "sweat_drops": "unicode/1f4a6.png?v8",
  5266. "sweat_smile": "unicode/1f605.png?v8",
  5267. "sweden": "unicode/1f1f8-1f1ea.png?v8",
  5268. "sweet_potato": "unicode/1f360.png?v8",
  5269. "swim_brief": "unicode/1fa72.png?v8",
  5270. "swimmer": "unicode/1f3ca.png?v8",
  5271. "swimming_man": "unicode/1f3ca-2642.png?v8",
  5272. "swimming_woman": "unicode/1f3ca-2640.png?v8",
  5273. "switzerland": "unicode/1f1e8-1f1ed.png?v8",
  5274. "symbols": "unicode/1f523.png?v8",
  5275. "synagogue": "unicode/1f54d.png?v8",
  5276. "syria": "unicode/1f1f8-1f1fe.png?v8",
  5277. "syringe": "unicode/1f489.png?v8",
  5278. "t-rex": "unicode/1f996.png?v8",
  5279. "taco": "unicode/1f32e.png?v8",
  5280. "tada": "unicode/1f389.png?v8",
  5281. "taiwan": "unicode/1f1f9-1f1fc.png?v8",
  5282. "tajikistan": "unicode/1f1f9-1f1ef.png?v8",
  5283. "takeout_box": "unicode/1f961.png?v8",
  5284. "tamale": "unicode/1fad4.png?v8",
  5285. "tanabata_tree": "unicode/1f38b.png?v8",
  5286. "tangerine": "unicode/1f34a.png?v8",
  5287. "tanzania": "unicode/1f1f9-1f1ff.png?v8",
  5288. "taurus": "unicode/2649.png?v8",
  5289. "taxi": "unicode/1f695.png?v8",
  5290. "tea": "unicode/1f375.png?v8",
  5291. "teacher": "unicode/1f9d1-1f3eb.png?v8",
  5292. "teapot": "unicode/1fad6.png?v8",
  5293. "technologist": "unicode/1f9d1-1f4bb.png?v8",
  5294. "teddy_bear": "unicode/1f9f8.png?v8",
  5295. "telephone": "unicode/260e.png?v8",
  5296. "telephone_receiver": "unicode/1f4de.png?v8",
  5297. "telescope": "unicode/1f52d.png?v8",
  5298. "tennis": "unicode/1f3be.png?v8",
  5299. "tent": "unicode/26fa.png?v8",
  5300. "test_tube": "unicode/1f9ea.png?v8",
  5301. "thailand": "unicode/1f1f9-1f1ed.png?v8",
  5302. "thermometer": "unicode/1f321.png?v8",
  5303. "thinking": "unicode/1f914.png?v8",
  5304. "thong_sandal": "unicode/1fa74.png?v8",
  5305. "thought_balloon": "unicode/1f4ad.png?v8",
  5306. "thread": "unicode/1f9f5.png?v8",
  5307. "three": "unicode/0033-20e3.png?v8",
  5308. "thumbsdown": "unicode/1f44e.png?v8",
  5309. "thumbsup": "unicode/1f44d.png?v8",
  5310. "ticket": "unicode/1f3ab.png?v8",
  5311. "tickets": "unicode/1f39f.png?v8",
  5312. "tiger": "unicode/1f42f.png?v8",
  5313. "tiger2": "unicode/1f405.png?v8",
  5314. "timer_clock": "unicode/23f2.png?v8",
  5315. "timor_leste": "unicode/1f1f9-1f1f1.png?v8",
  5316. "tipping_hand_man": "unicode/1f481-2642.png?v8",
  5317. "tipping_hand_person": "unicode/1f481.png?v8",
  5318. "tipping_hand_woman": "unicode/1f481-2640.png?v8",
  5319. "tired_face": "unicode/1f62b.png?v8",
  5320. "tm": "unicode/2122.png?v8",
  5321. "togo": "unicode/1f1f9-1f1ec.png?v8",
  5322. "toilet": "unicode/1f6bd.png?v8",
  5323. "tokelau": "unicode/1f1f9-1f1f0.png?v8",
  5324. "tokyo_tower": "unicode/1f5fc.png?v8",
  5325. "tomato": "unicode/1f345.png?v8",
  5326. "tonga": "unicode/1f1f9-1f1f4.png?v8",
  5327. "tongue": "unicode/1f445.png?v8",
  5328. "toolbox": "unicode/1f9f0.png?v8",
  5329. "tooth": "unicode/1f9b7.png?v8",
  5330. "toothbrush": "unicode/1faa5.png?v8",
  5331. "top": "unicode/1f51d.png?v8",
  5332. "tophat": "unicode/1f3a9.png?v8",
  5333. "tornado": "unicode/1f32a.png?v8",
  5334. "tr": "unicode/1f1f9-1f1f7.png?v8",
  5335. "trackball": "unicode/1f5b2.png?v8",
  5336. "tractor": "unicode/1f69c.png?v8",
  5337. "traffic_light": "unicode/1f6a5.png?v8",
  5338. "train": "unicode/1f68b.png?v8",
  5339. "train2": "unicode/1f686.png?v8",
  5340. "tram": "unicode/1f68a.png?v8",
  5341. "transgender_flag": "unicode/1f3f3-26a7.png?v8",
  5342. "transgender_symbol": "unicode/26a7.png?v8",
  5343. "triangular_flag_on_post": "unicode/1f6a9.png?v8",
  5344. "triangular_ruler": "unicode/1f4d0.png?v8",
  5345. "trident": "unicode/1f531.png?v8",
  5346. "trinidad_tobago": "unicode/1f1f9-1f1f9.png?v8",
  5347. "tristan_da_cunha": "unicode/1f1f9-1f1e6.png?v8",
  5348. "triumph": "unicode/1f624.png?v8",
  5349. "trolleybus": "unicode/1f68e.png?v8",
  5350. "trollface": "trollface.png?v8",
  5351. "trophy": "unicode/1f3c6.png?v8",
  5352. "tropical_drink": "unicode/1f379.png?v8",
  5353. "tropical_fish": "unicode/1f420.png?v8",
  5354. "truck": "unicode/1f69a.png?v8",
  5355. "trumpet": "unicode/1f3ba.png?v8",
  5356. "tshirt": "unicode/1f455.png?v8",
  5357. "tulip": "unicode/1f337.png?v8",
  5358. "tumbler_glass": "unicode/1f943.png?v8",
  5359. "tunisia": "unicode/1f1f9-1f1f3.png?v8",
  5360. "turkey": "unicode/1f983.png?v8",
  5361. "turkmenistan": "unicode/1f1f9-1f1f2.png?v8",
  5362. "turks_caicos_islands": "unicode/1f1f9-1f1e8.png?v8",
  5363. "turtle": "unicode/1f422.png?v8",
  5364. "tuvalu": "unicode/1f1f9-1f1fb.png?v8",
  5365. "tv": "unicode/1f4fa.png?v8",
  5366. "twisted_rightwards_arrows": "unicode/1f500.png?v8",
  5367. "two": "unicode/0032-20e3.png?v8",
  5368. "two_hearts": "unicode/1f495.png?v8",
  5369. "two_men_holding_hands": "unicode/1f46c.png?v8",
  5370. "two_women_holding_hands": "unicode/1f46d.png?v8",
  5371. "u5272": "unicode/1f239.png?v8",
  5372. "u5408": "unicode/1f234.png?v8",
  5373. "u55b6": "unicode/1f23a.png?v8",
  5374. "u6307": "unicode/1f22f.png?v8",
  5375. "u6708": "unicode/1f237.png?v8",
  5376. "u6709": "unicode/1f236.png?v8",
  5377. "u6e80": "unicode/1f235.png?v8",
  5378. "u7121": "unicode/1f21a.png?v8",
  5379. "u7533": "unicode/1f238.png?v8",
  5380. "u7981": "unicode/1f232.png?v8",
  5381. "u7a7a": "unicode/1f233.png?v8",
  5382. "uganda": "unicode/1f1fa-1f1ec.png?v8",
  5383. "uk": "unicode/1f1ec-1f1e7.png?v8",
  5384. "ukraine": "unicode/1f1fa-1f1e6.png?v8",
  5385. "umbrella": "unicode/2614.png?v8",
  5386. "unamused": "unicode/1f612.png?v8",
  5387. "underage": "unicode/1f51e.png?v8",
  5388. "unicorn": "unicode/1f984.png?v8",
  5389. "united_arab_emirates": "unicode/1f1e6-1f1ea.png?v8",
  5390. "united_nations": "unicode/1f1fa-1f1f3.png?v8",
  5391. "unlock": "unicode/1f513.png?v8",
  5392. "up": "unicode/1f199.png?v8",
  5393. "upside_down_face": "unicode/1f643.png?v8",
  5394. "uruguay": "unicode/1f1fa-1f1fe.png?v8",
  5395. "us": "unicode/1f1fa-1f1f8.png?v8",
  5396. "us_outlying_islands": "unicode/1f1fa-1f1f2.png?v8",
  5397. "us_virgin_islands": "unicode/1f1fb-1f1ee.png?v8",
  5398. "uzbekistan": "unicode/1f1fa-1f1ff.png?v8",
  5399. "v": "unicode/270c.png?v8",
  5400. "vampire": "unicode/1f9db.png?v8",
  5401. "vampire_man": "unicode/1f9db-2642.png?v8",
  5402. "vampire_woman": "unicode/1f9db-2640.png?v8",
  5403. "vanuatu": "unicode/1f1fb-1f1fa.png?v8",
  5404. "vatican_city": "unicode/1f1fb-1f1e6.png?v8",
  5405. "venezuela": "unicode/1f1fb-1f1ea.png?v8",
  5406. "vertical_traffic_light": "unicode/1f6a6.png?v8",
  5407. "vhs": "unicode/1f4fc.png?v8",
  5408. "vibration_mode": "unicode/1f4f3.png?v8",
  5409. "video_camera": "unicode/1f4f9.png?v8",
  5410. "video_game": "unicode/1f3ae.png?v8",
  5411. "vietnam": "unicode/1f1fb-1f1f3.png?v8",
  5412. "violin": "unicode/1f3bb.png?v8",
  5413. "virgo": "unicode/264d.png?v8",
  5414. "volcano": "unicode/1f30b.png?v8",
  5415. "volleyball": "unicode/1f3d0.png?v8",
  5416. "vomiting_face": "unicode/1f92e.png?v8",
  5417. "vs": "unicode/1f19a.png?v8",
  5418. "vulcan_salute": "unicode/1f596.png?v8",
  5419. "waffle": "unicode/1f9c7.png?v8",
  5420. "wales": "unicode/1f3f4-e0067-e0062-e0077-e006c-e0073-e007f.png?v8",
  5421. "walking": "unicode/1f6b6.png?v8",
  5422. "walking_man": "unicode/1f6b6-2642.png?v8",
  5423. "walking_woman": "unicode/1f6b6-2640.png?v8",
  5424. "wallis_futuna": "unicode/1f1fc-1f1eb.png?v8",
  5425. "waning_crescent_moon": "unicode/1f318.png?v8",
  5426. "waning_gibbous_moon": "unicode/1f316.png?v8",
  5427. "warning": "unicode/26a0.png?v8",
  5428. "wastebasket": "unicode/1f5d1.png?v8",
  5429. "watch": "unicode/231a.png?v8",
  5430. "water_buffalo": "unicode/1f403.png?v8",
  5431. "water_polo": "unicode/1f93d.png?v8",
  5432. "watermelon": "unicode/1f349.png?v8",
  5433. "wave": "unicode/1f44b.png?v8",
  5434. "wavy_dash": "unicode/3030.png?v8",
  5435. "waxing_crescent_moon": "unicode/1f312.png?v8",
  5436. "waxing_gibbous_moon": "unicode/1f314.png?v8",
  5437. "wc": "unicode/1f6be.png?v8",
  5438. "weary": "unicode/1f629.png?v8",
  5439. "wedding": "unicode/1f492.png?v8",
  5440. "weight_lifting": "unicode/1f3cb.png?v8",
  5441. "weight_lifting_man": "unicode/1f3cb-2642.png?v8",
  5442. "weight_lifting_woman": "unicode/1f3cb-2640.png?v8",
  5443. "western_sahara": "unicode/1f1ea-1f1ed.png?v8",
  5444. "whale": "unicode/1f433.png?v8",
  5445. "whale2": "unicode/1f40b.png?v8",
  5446. "wheel_of_dharma": "unicode/2638.png?v8",
  5447. "wheelchair": "unicode/267f.png?v8",
  5448. "white_check_mark": "unicode/2705.png?v8",
  5449. "white_circle": "unicode/26aa.png?v8",
  5450. "white_flag": "unicode/1f3f3.png?v8",
  5451. "white_flower": "unicode/1f4ae.png?v8",
  5452. "white_haired_man": "unicode/1f468-1f9b3.png?v8",
  5453. "white_haired_woman": "unicode/1f469-1f9b3.png?v8",
  5454. "white_heart": "unicode/1f90d.png?v8",
  5455. "white_large_square": "unicode/2b1c.png?v8",
  5456. "white_medium_small_square": "unicode/25fd.png?v8",
  5457. "white_medium_square": "unicode/25fb.png?v8",
  5458. "white_small_square": "unicode/25ab.png?v8",
  5459. "white_square_button": "unicode/1f533.png?v8",
  5460. "wilted_flower": "unicode/1f940.png?v8",
  5461. "wind_chime": "unicode/1f390.png?v8",
  5462. "wind_face": "unicode/1f32c.png?v8",
  5463. "window": "unicode/1fa9f.png?v8",
  5464. "wine_glass": "unicode/1f377.png?v8",
  5465. "wink": "unicode/1f609.png?v8",
  5466. "wolf": "unicode/1f43a.png?v8",
  5467. "woman": "unicode/1f469.png?v8",
  5468. "woman_artist": "unicode/1f469-1f3a8.png?v8",
  5469. "woman_astronaut": "unicode/1f469-1f680.png?v8",
  5470. "woman_beard": "unicode/1f9d4-2640.png?v8",
  5471. "woman_cartwheeling": "unicode/1f938-2640.png?v8",
  5472. "woman_cook": "unicode/1f469-1f373.png?v8",
  5473. "woman_dancing": "unicode/1f483.png?v8",
  5474. "woman_facepalming": "unicode/1f926-2640.png?v8",
  5475. "woman_factory_worker": "unicode/1f469-1f3ed.png?v8",
  5476. "woman_farmer": "unicode/1f469-1f33e.png?v8",
  5477. "woman_feeding_baby": "unicode/1f469-1f37c.png?v8",
  5478. "woman_firefighter": "unicode/1f469-1f692.png?v8",
  5479. "woman_health_worker": "unicode/1f469-2695.png?v8",
  5480. "woman_in_manual_wheelchair": "unicode/1f469-1f9bd.png?v8",
  5481. "woman_in_motorized_wheelchair": "unicode/1f469-1f9bc.png?v8",
  5482. "woman_in_tuxedo": "unicode/1f935-2640.png?v8",
  5483. "woman_judge": "unicode/1f469-2696.png?v8",
  5484. "woman_juggling": "unicode/1f939-2640.png?v8",
  5485. "woman_mechanic": "unicode/1f469-1f527.png?v8",
  5486. "woman_office_worker": "unicode/1f469-1f4bc.png?v8",
  5487. "woman_pilot": "unicode/1f469-2708.png?v8",
  5488. "woman_playing_handball": "unicode/1f93e-2640.png?v8",
  5489. "woman_playing_water_polo": "unicode/1f93d-2640.png?v8",
  5490. "woman_scientist": "unicode/1f469-1f52c.png?v8",
  5491. "woman_shrugging": "unicode/1f937-2640.png?v8",
  5492. "woman_singer": "unicode/1f469-1f3a4.png?v8",
  5493. "woman_student": "unicode/1f469-1f393.png?v8",
  5494. "woman_teacher": "unicode/1f469-1f3eb.png?v8",
  5495. "woman_technologist": "unicode/1f469-1f4bb.png?v8",
  5496. "woman_with_headscarf": "unicode/1f9d5.png?v8",
  5497. "woman_with_probing_cane": "unicode/1f469-1f9af.png?v8",
  5498. "woman_with_turban": "unicode/1f473-2640.png?v8",
  5499. "woman_with_veil": "unicode/1f470-2640.png?v8",
  5500. "womans_clothes": "unicode/1f45a.png?v8",
  5501. "womans_hat": "unicode/1f452.png?v8",
  5502. "women_wrestling": "unicode/1f93c-2640.png?v8",
  5503. "womens": "unicode/1f6ba.png?v8",
  5504. "wood": "unicode/1fab5.png?v8",
  5505. "woozy_face": "unicode/1f974.png?v8",
  5506. "world_map": "unicode/1f5fa.png?v8",
  5507. "worm": "unicode/1fab1.png?v8",
  5508. "worried": "unicode/1f61f.png?v8",
  5509. "wrench": "unicode/1f527.png?v8",
  5510. "wrestling": "unicode/1f93c.png?v8",
  5511. "writing_hand": "unicode/270d.png?v8",
  5512. "x": "unicode/274c.png?v8",
  5513. "yarn": "unicode/1f9f6.png?v8",
  5514. "yawning_face": "unicode/1f971.png?v8",
  5515. "yellow_circle": "unicode/1f7e1.png?v8",
  5516. "yellow_heart": "unicode/1f49b.png?v8",
  5517. "yellow_square": "unicode/1f7e8.png?v8",
  5518. "yemen": "unicode/1f1fe-1f1ea.png?v8",
  5519. "yen": "unicode/1f4b4.png?v8",
  5520. "yin_yang": "unicode/262f.png?v8",
  5521. "yo_yo": "unicode/1fa80.png?v8",
  5522. "yum": "unicode/1f60b.png?v8",
  5523. "zambia": "unicode/1f1ff-1f1f2.png?v8",
  5524. "zany_face": "unicode/1f92a.png?v8",
  5525. "zap": "unicode/26a1.png?v8",
  5526. "zebra": "unicode/1f993.png?v8",
  5527. "zero": "unicode/0030-20e3.png?v8",
  5528. "zimbabwe": "unicode/1f1ff-1f1fc.png?v8",
  5529. "zipper_mouth_face": "unicode/1f910.png?v8",
  5530. "zombie": "unicode/1f9df.png?v8",
  5531. "zombie_man": "unicode/1f9df-2642.png?v8",
  5532. "zombie_woman": "unicode/1f9df-2640.png?v8",
  5533. "zzz": "unicode/1f4a4.png?v8"
  5534. }
  5535. };
  5536. function replaceEmojiShorthand(m, $1, useNativeEmoji) {
  5537. var emojiMatch = emojiData.data[$1];
  5538. var result = m;
  5539. if (emojiMatch) {
  5540. if (useNativeEmoji && /unicode/.test(emojiMatch)) {
  5541. var emojiUnicode = emojiMatch
  5542. .replace('unicode/', '')
  5543. .replace(/\.png.*/, '')
  5544. .split('-')
  5545. .map(function (u) { return ("&#x" + u + ";"); })
  5546. // Separate multi-character emoji with zero width joiner sequence (ZWJ)
  5547. // Hat tip: https://about.gitlab.com/blog/2018/05/30/journey-in-native-unicode-emoji/#emoji-made-up-of-multiple-characters
  5548. .join('&zwj;')
  5549. .concat('&#xFE0E;');
  5550. result = "<span class=\"emoji\">" + emojiUnicode + "</span>";
  5551. } else {
  5552. result = "<img src=\"" + (emojiData.baseURL) + emojiMatch + ".png\" alt=\"" + $1 + "\" class=\"emoji\" loading=\"lazy\">";
  5553. }
  5554. }
  5555. return result;
  5556. }
  5557. function emojify(text, useNativeEmoji) {
  5558. return (
  5559. text
  5560. // Mark colons in tags
  5561. .replace(
  5562. /<(code|pre|script|template)[^>]*?>[\s\S]+?<\/(code|pre|script|template)>/g,
  5563. function (m) { return m.replace(/:/g, '__colon__'); }
  5564. )
  5565. // Mark colons in comments
  5566. .replace(/<!--[\s\S]+?-->/g, function (m) { return m.replace(/:/g, '__colon__'); })
  5567. // Mark colons in URIs
  5568. .replace(/([a-z]{2,}:)?\/\/[^\s'">)]+/gi, function (m) { return m.replace(/:/g, '__colon__'); }
  5569. )
  5570. // Replace emoji shorthand codes
  5571. .replace(/:([a-z0-9_\-+]+?):/g, function (m, $1) { return replaceEmojiShorthand(m, $1, useNativeEmoji); }
  5572. )
  5573. // Restore colons in tags and comments
  5574. .replace(/__colon__/g, ':')
  5575. );
  5576. }
  5577. /**
  5578. * Converts a colon formatted string to a object with properties.
  5579. *
  5580. * This is process a provided string and look for any tokens in the format
  5581. * of `:name[=value]` and then convert it to a object and return.
  5582. * An example of this is ':include :type=code :fragment=demo' is taken and
  5583. * then converted to:
  5584. *
  5585. * ```
  5586. * {
  5587. * include: '',
  5588. * type: 'code',
  5589. * fragment: 'demo'
  5590. * }
  5591. * ```
  5592. *
  5593. * @param {string} str The string to parse.
  5594. *
  5595. * @return {object} The original string and parsed object, { str, config }.
  5596. */
  5597. function getAndRemoveConfig(str) {
  5598. if ( str === void 0 ) str = '';
  5599. var config = {};
  5600. if (str) {
  5601. str = str
  5602. .replace(/^('|")/, '')
  5603. .replace(/('|")$/, '')
  5604. .replace(/(?:^|\s):([\w-]+:?)=?([\w-%]+)?/g, function (m, key, value) {
  5605. if (key.indexOf(':') === -1) {
  5606. config[key] = (value && value.replace(/&quot;/g, '')) || true;
  5607. return '';
  5608. }
  5609. return m;
  5610. })
  5611. .trim();
  5612. }
  5613. return { str: str, config: config };
  5614. }
  5615. /**
  5616. * Remove the <a> tag from sidebar when the header with link, details see issue 1069
  5617. * @param {string} str The string to deal with.
  5618. *
  5619. * @return {string} str The string after delete the <a> element.
  5620. */
  5621. function removeAtag(str) {
  5622. if ( str === void 0 ) str = '';
  5623. return str.replace(/(<\/?a.*?>)/gi, '');
  5624. }
  5625. var imageCompiler = function (ref) {
  5626. var renderer = ref.renderer;
  5627. var contentBase = ref.contentBase;
  5628. var router = ref.router;
  5629. return (renderer.image = function (href, title, text) {
  5630. var url = href;
  5631. var attrs = [];
  5632. var ref = getAndRemoveConfig(title);
  5633. var str = ref.str;
  5634. var config = ref.config;
  5635. title = str;
  5636. if (config['no-zoom']) {
  5637. attrs.push('data-no-zoom');
  5638. }
  5639. if (title) {
  5640. attrs.push(("title=\"" + title + "\""));
  5641. }
  5642. if (config.size) {
  5643. var ref$1 = config.size.split('x');
  5644. var width = ref$1[0];
  5645. var height = ref$1[1];
  5646. if (height) {
  5647. attrs.push(("width=\"" + width + "\" height=\"" + height + "\""));
  5648. } else {
  5649. attrs.push(("width=\"" + width + "\""));
  5650. }
  5651. }
  5652. if (config.class) {
  5653. attrs.push(("class=\"" + (config.class) + "\""));
  5654. }
  5655. if (config.id) {
  5656. attrs.push(("id=\"" + (config.id) + "\""));
  5657. }
  5658. if (!isAbsolutePath(href)) {
  5659. url = getPath(contentBase, getParentPath(router.getCurrentPath()), href);
  5660. }
  5661. if (attrs.length > 0) {
  5662. return ("<img src=\"" + url + "\" data-origin=\"" + href + "\" alt=\"" + text + "\" " + (attrs.join(
  5663. ' '
  5664. )) + " />");
  5665. }
  5666. return ("<img src=\"" + url + "\" data-origin=\"" + href + "\" alt=\"" + text + "\"" + attrs + ">");
  5667. });
  5668. };
  5669. var prism = createCommonjsModule(function (module) {
  5670. /* **********************************************
  5671. Begin prism-core.js
  5672. ********************************************** */
  5673. /// <reference lib="WebWorker"/>
  5674. var _self = (typeof window !== 'undefined')
  5675. ? window // if in browser
  5676. : (
  5677. (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
  5678. ? self // if in worker
  5679. : {} // if in node js
  5680. );
  5681. /**
  5682. * Prism: Lightweight, robust, elegant syntax highlighting
  5683. *
  5684. * @license MIT <https://opensource.org/licenses/MIT>
  5685. * @author Lea Verou <https://lea.verou.me>
  5686. * @namespace
  5687. * @public
  5688. */
  5689. var Prism = (function (_self) {
  5690. // Private helper vars
  5691. var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
  5692. var uniqueId = 0;
  5693. // The grammar object for plaintext
  5694. var plainTextGrammar = {};
  5695. var _ = {
  5696. /**
  5697. * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
  5698. * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
  5699. * additional languages or plugins yourself.
  5700. *
  5701. * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
  5702. *
  5703. * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
  5704. * empty Prism object into the global scope before loading the Prism script like this:
  5705. *
  5706. * ```js
  5707. * window.Prism = window.Prism || {};
  5708. * Prism.manual = true;
  5709. * // add a new <script> to load Prism's script
  5710. * ```
  5711. *
  5712. * @default false
  5713. * @type {boolean}
  5714. * @memberof Prism
  5715. * @public
  5716. */
  5717. manual: _self.Prism && _self.Prism.manual,
  5718. /**
  5719. * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
  5720. * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
  5721. * own worker, you don't want it to do this.
  5722. *
  5723. * By setting this value to `true`, Prism will not add its own listeners to the worker.
  5724. *
  5725. * You obviously have to change this value before Prism executes. To do this, you can add an
  5726. * empty Prism object into the global scope before loading the Prism script like this:
  5727. *
  5728. * ```js
  5729. * window.Prism = window.Prism || {};
  5730. * Prism.disableWorkerMessageHandler = true;
  5731. * // Load Prism's script
  5732. * ```
  5733. *
  5734. * @default false
  5735. * @type {boolean}
  5736. * @memberof Prism
  5737. * @public
  5738. */
  5739. disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
  5740. /**
  5741. * A namespace for utility methods.
  5742. *
  5743. * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
  5744. * change or disappear at any time.
  5745. *
  5746. * @namespace
  5747. * @memberof Prism
  5748. */
  5749. util: {
  5750. encode: function encode(tokens) {
  5751. if (tokens instanceof Token) {
  5752. return new Token(tokens.type, encode(tokens.content), tokens.alias);
  5753. } else if (Array.isArray(tokens)) {
  5754. return tokens.map(encode);
  5755. } else {
  5756. return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
  5757. }
  5758. },
  5759. /**
  5760. * Returns the name of the type of the given value.
  5761. *
  5762. * @param {any} o
  5763. * @returns {string}
  5764. * @example
  5765. * type(null) === 'Null'
  5766. * type(undefined) === 'Undefined'
  5767. * type(123) === 'Number'
  5768. * type('foo') === 'String'
  5769. * type(true) === 'Boolean'
  5770. * type([1, 2]) === 'Array'
  5771. * type({}) === 'Object'
  5772. * type(String) === 'Function'
  5773. * type(/abc+/) === 'RegExp'
  5774. */
  5775. type: function (o) {
  5776. return Object.prototype.toString.call(o).slice(8, -1);
  5777. },
  5778. /**
  5779. * Returns a unique number for the given object. Later calls will still return the same number.
  5780. *
  5781. * @param {Object} obj
  5782. * @returns {number}
  5783. */
  5784. objId: function (obj) {
  5785. if (!obj['__id']) {
  5786. Object.defineProperty(obj, '__id', { value: ++uniqueId });
  5787. }
  5788. return obj['__id'];
  5789. },
  5790. /**
  5791. * Creates a deep clone of the given object.
  5792. *
  5793. * The main intended use of this function is to clone language definitions.
  5794. *
  5795. * @param {T} o
  5796. * @param {Record<number, any>} [visited]
  5797. * @returns {T}
  5798. * @template T
  5799. */
  5800. clone: function deepClone(o, visited) {
  5801. visited = visited || {};
  5802. var clone; var id;
  5803. switch (_.util.type(o)) {
  5804. case 'Object':
  5805. id = _.util.objId(o);
  5806. if (visited[id]) {
  5807. return visited[id];
  5808. }
  5809. clone = /** @type {Record<string, any>} */ ({});
  5810. visited[id] = clone;
  5811. for (var key in o) {
  5812. if (o.hasOwnProperty(key)) {
  5813. clone[key] = deepClone(o[key], visited);
  5814. }
  5815. }
  5816. return /** @type {any} */ (clone);
  5817. case 'Array':
  5818. id = _.util.objId(o);
  5819. if (visited[id]) {
  5820. return visited[id];
  5821. }
  5822. clone = [];
  5823. visited[id] = clone;
  5824. (/** @type {Array} */(/** @type {any} */(o))).forEach(function (v, i) {
  5825. clone[i] = deepClone(v, visited);
  5826. });
  5827. return /** @type {any} */ (clone);
  5828. default:
  5829. return o;
  5830. }
  5831. },
  5832. /**
  5833. * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
  5834. *
  5835. * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
  5836. *
  5837. * @param {Element} element
  5838. * @returns {string}
  5839. */
  5840. getLanguage: function (element) {
  5841. while (element) {
  5842. var m = lang.exec(element.className);
  5843. if (m) {
  5844. return m[1].toLowerCase();
  5845. }
  5846. element = element.parentElement;
  5847. }
  5848. return 'none';
  5849. },
  5850. /**
  5851. * Sets the Prism `language-xxxx` class of the given element.
  5852. *
  5853. * @param {Element} element
  5854. * @param {string} language
  5855. * @returns {void}
  5856. */
  5857. setLanguage: function (element, language) {
  5858. // remove all `language-xxxx` classes
  5859. // (this might leave behind a leading space)
  5860. element.className = element.className.replace(RegExp(lang, 'gi'), '');
  5861. // add the new `language-xxxx` class
  5862. // (using `classList` will automatically clean up spaces for us)
  5863. element.classList.add('language-' + language);
  5864. },
  5865. /**
  5866. * Returns the script element that is currently executing.
  5867. *
  5868. * This does __not__ work for line script element.
  5869. *
  5870. * @returns {HTMLScriptElement | null}
  5871. */
  5872. currentScript: function () {
  5873. if (typeof document === 'undefined') {
  5874. return null;
  5875. }
  5876. if ('currentScript' in document && 1 < 2 /* hack to trip TS' flow analysis */) {
  5877. return /** @type {any} */ (document.currentScript);
  5878. }
  5879. // IE11 workaround
  5880. // we'll get the src of the current script by parsing IE11's error stack trace
  5881. // this will not work for inline scripts
  5882. try {
  5883. throw new Error();
  5884. } catch (err) {
  5885. // Get file src url from stack. Specifically works with the format of stack traces in IE.
  5886. // A stack will look like this:
  5887. //
  5888. // Error
  5889. // at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
  5890. // at Global code (http://localhost/components/prism-core.js:606:1)
  5891. var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
  5892. if (src) {
  5893. var scripts = document.getElementsByTagName('script');
  5894. for (var i in scripts) {
  5895. if (scripts[i].src == src) {
  5896. return scripts[i];
  5897. }
  5898. }
  5899. }
  5900. return null;
  5901. }
  5902. },
  5903. /**
  5904. * Returns whether a given class is active for `element`.
  5905. *
  5906. * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
  5907. * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
  5908. * given class is just the given class with a `no-` prefix.
  5909. *
  5910. * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
  5911. * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
  5912. * ancestors have the given class or the negated version of it, then the default activation will be returned.
  5913. *
  5914. * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
  5915. * version of it, the class is considered active.
  5916. *
  5917. * @param {Element} element
  5918. * @param {string} className
  5919. * @param {boolean} [defaultActivation=false]
  5920. * @returns {boolean}
  5921. */
  5922. isActive: function (element, className, defaultActivation) {
  5923. var no = 'no-' + className;
  5924. while (element) {
  5925. var classList = element.classList;
  5926. if (classList.contains(className)) {
  5927. return true;
  5928. }
  5929. if (classList.contains(no)) {
  5930. return false;
  5931. }
  5932. element = element.parentElement;
  5933. }
  5934. return !!defaultActivation;
  5935. }
  5936. },
  5937. /**
  5938. * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
  5939. *
  5940. * @namespace
  5941. * @memberof Prism
  5942. * @public
  5943. */
  5944. languages: {
  5945. /**
  5946. * The grammar for plain, unformatted text.
  5947. */
  5948. plain: plainTextGrammar,
  5949. plaintext: plainTextGrammar,
  5950. text: plainTextGrammar,
  5951. txt: plainTextGrammar,
  5952. /**
  5953. * Creates a deep copy of the language with the given id and appends the given tokens.
  5954. *
  5955. * If a token in `redef` also appears in the copied language, then the existing token in the copied language
  5956. * will be overwritten at its original position.
  5957. *
  5958. * ## Best practices
  5959. *
  5960. * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
  5961. * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
  5962. * understand the language definition because, normally, the order of tokens matters in Prism grammars.
  5963. *
  5964. * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
  5965. * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
  5966. *
  5967. * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
  5968. * @param {Grammar} redef The new tokens to append.
  5969. * @returns {Grammar} The new language created.
  5970. * @public
  5971. * @example
  5972. * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
  5973. * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
  5974. * // at its original position
  5975. * 'comment': { ... },
  5976. * // CSS doesn't have a 'color' token, so this token will be appended
  5977. * 'color': /\b(?:red|green|blue)\b/
  5978. * });
  5979. */
  5980. extend: function (id, redef) {
  5981. var lang = _.util.clone(_.languages[id]);
  5982. for (var key in redef) {
  5983. lang[key] = redef[key];
  5984. }
  5985. return lang;
  5986. },
  5987. /**
  5988. * Inserts tokens _before_ another token in a language definition or any other grammar.
  5989. *
  5990. * ## Usage
  5991. *
  5992. * This helper method makes it easy to modify existing languages. For example, the CSS language definition
  5993. * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
  5994. * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
  5995. * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
  5996. * this:
  5997. *
  5998. * ```js
  5999. * Prism.languages.markup.style = {
  6000. * // token
  6001. * };
  6002. * ```
  6003. *
  6004. * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
  6005. * before existing tokens. For the CSS example above, you would use it like this:
  6006. *
  6007. * ```js
  6008. * Prism.languages.insertBefore('markup', 'cdata', {
  6009. * 'style': {
  6010. * // token
  6011. * }
  6012. * });
  6013. * ```
  6014. *
  6015. * ## Special cases
  6016. *
  6017. * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
  6018. * will be ignored.
  6019. *
  6020. * This behavior can be used to insert tokens after `before`:
  6021. *
  6022. * ```js
  6023. * Prism.languages.insertBefore('markup', 'comment', {
  6024. * 'comment': Prism.languages.markup.comment,
  6025. * // tokens after 'comment'
  6026. * });
  6027. * ```
  6028. *
  6029. * ## Limitations
  6030. *
  6031. * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
  6032. * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
  6033. * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
  6034. * deleting properties which is necessary to insert at arbitrary positions.
  6035. *
  6036. * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
  6037. * Instead, it will create a new object and replace all references to the target object with the new one. This
  6038. * can be done without temporarily deleting properties, so the iteration order is well-defined.
  6039. *
  6040. * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
  6041. * you hold the target object in a variable, then the value of the variable will not change.
  6042. *
  6043. * ```js
  6044. * var oldMarkup = Prism.languages.markup;
  6045. * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
  6046. *
  6047. * assert(oldMarkup !== Prism.languages.markup);
  6048. * assert(newMarkup === Prism.languages.markup);
  6049. * ```
  6050. *
  6051. * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
  6052. * object to be modified.
  6053. * @param {string} before The key to insert before.
  6054. * @param {Grammar} insert An object containing the key-value pairs to be inserted.
  6055. * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
  6056. * object to be modified.
  6057. *
  6058. * Defaults to `Prism.languages`.
  6059. * @returns {Grammar} The new grammar object.
  6060. * @public
  6061. */
  6062. insertBefore: function (inside, before, insert, root) {
  6063. root = root || /** @type {any} */ (_.languages);
  6064. var grammar = root[inside];
  6065. /** @type {Grammar} */
  6066. var ret = {};
  6067. for (var token in grammar) {
  6068. if (grammar.hasOwnProperty(token)) {
  6069. if (token == before) {
  6070. for (var newToken in insert) {
  6071. if (insert.hasOwnProperty(newToken)) {
  6072. ret[newToken] = insert[newToken];
  6073. }
  6074. }
  6075. }
  6076. // Do not insert token which also occur in insert. See #1525
  6077. if (!insert.hasOwnProperty(token)) {
  6078. ret[token] = grammar[token];
  6079. }
  6080. }
  6081. }
  6082. var old = root[inside];
  6083. root[inside] = ret;
  6084. // Update references in other language definitions
  6085. _.languages.DFS(_.languages, function (key, value) {
  6086. if (value === old && key != inside) {
  6087. this[key] = ret;
  6088. }
  6089. });
  6090. return ret;
  6091. },
  6092. // Traverse a language definition with Depth First Search
  6093. DFS: function DFS(o, callback, type, visited) {
  6094. visited = visited || {};
  6095. var objId = _.util.objId;
  6096. for (var i in o) {
  6097. if (o.hasOwnProperty(i)) {
  6098. callback.call(o, i, o[i], type || i);
  6099. var property = o[i];
  6100. var propertyType = _.util.type(property);
  6101. if (propertyType === 'Object' && !visited[objId(property)]) {
  6102. visited[objId(property)] = true;
  6103. DFS(property, callback, null, visited);
  6104. } else if (propertyType === 'Array' && !visited[objId(property)]) {
  6105. visited[objId(property)] = true;
  6106. DFS(property, callback, i, visited);
  6107. }
  6108. }
  6109. }
  6110. }
  6111. },
  6112. plugins: {},
  6113. /**
  6114. * This is the most high-level function in Prism’s API.
  6115. * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
  6116. * each one of them.
  6117. *
  6118. * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
  6119. *
  6120. * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
  6121. * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
  6122. * @memberof Prism
  6123. * @public
  6124. */
  6125. highlightAll: function (async, callback) {
  6126. _.highlightAllUnder(document, async, callback);
  6127. },
  6128. /**
  6129. * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
  6130. * {@link Prism.highlightElement} on each one of them.
  6131. *
  6132. * The following hooks will be run:
  6133. * 1. `before-highlightall`
  6134. * 2. `before-all-elements-highlight`
  6135. * 3. All hooks of {@link Prism.highlightElement} for each element.
  6136. *
  6137. * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
  6138. * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
  6139. * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
  6140. * @memberof Prism
  6141. * @public
  6142. */
  6143. highlightAllUnder: function (container, async, callback) {
  6144. var env = {
  6145. callback: callback,
  6146. container: container,
  6147. selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
  6148. };
  6149. _.hooks.run('before-highlightall', env);
  6150. env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
  6151. _.hooks.run('before-all-elements-highlight', env);
  6152. for (var i = 0, element; (element = env.elements[i++]);) {
  6153. _.highlightElement(element, async === true, env.callback);
  6154. }
  6155. },
  6156. /**
  6157. * Highlights the code inside a single element.
  6158. *
  6159. * The following hooks will be run:
  6160. * 1. `before-sanity-check`
  6161. * 2. `before-highlight`
  6162. * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
  6163. * 4. `before-insert`
  6164. * 5. `after-highlight`
  6165. * 6. `complete`
  6166. *
  6167. * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
  6168. * the element's language.
  6169. *
  6170. * @param {Element} element The element containing the code.
  6171. * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
  6172. * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
  6173. * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
  6174. * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
  6175. *
  6176. * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
  6177. * asynchronous highlighting to work. You can build your own bundle on the
  6178. * [Download page](https://prismjs.com/download.html).
  6179. * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
  6180. * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
  6181. * @memberof Prism
  6182. * @public
  6183. */
  6184. highlightElement: function (element, async, callback) {
  6185. // Find language
  6186. var language = _.util.getLanguage(element);
  6187. var grammar = _.languages[language];
  6188. // Set language on the element, if not present
  6189. _.util.setLanguage(element, language);
  6190. // Set language on the parent, for styling
  6191. var parent = element.parentElement;
  6192. if (parent && parent.nodeName.toLowerCase() === 'pre') {
  6193. _.util.setLanguage(parent, language);
  6194. }
  6195. var code = element.textContent;
  6196. var env = {
  6197. element: element,
  6198. language: language,
  6199. grammar: grammar,
  6200. code: code
  6201. };
  6202. function insertHighlightedCode(highlightedCode) {
  6203. env.highlightedCode = highlightedCode;
  6204. _.hooks.run('before-insert', env);
  6205. env.element.innerHTML = env.highlightedCode;
  6206. _.hooks.run('after-highlight', env);
  6207. _.hooks.run('complete', env);
  6208. callback && callback.call(env.element);
  6209. }
  6210. _.hooks.run('before-sanity-check', env);
  6211. // plugins may change/add the parent/element
  6212. parent = env.element.parentElement;
  6213. if (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {
  6214. parent.setAttribute('tabindex', '0');
  6215. }
  6216. if (!env.code) {
  6217. _.hooks.run('complete', env);
  6218. callback && callback.call(env.element);
  6219. return;
  6220. }
  6221. _.hooks.run('before-highlight', env);
  6222. if (!env.grammar) {
  6223. insertHighlightedCode(_.util.encode(env.code));
  6224. return;
  6225. }
  6226. if (async && _self.Worker) {
  6227. var worker = new Worker(_.filename);
  6228. worker.onmessage = function (evt) {
  6229. insertHighlightedCode(evt.data);
  6230. };
  6231. worker.postMessage(JSON.stringify({
  6232. language: env.language,
  6233. code: env.code,
  6234. immediateClose: true
  6235. }));
  6236. } else {
  6237. insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
  6238. }
  6239. },
  6240. /**
  6241. * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
  6242. * and the language definitions to use, and returns a string with the HTML produced.
  6243. *
  6244. * The following hooks will be run:
  6245. * 1. `before-tokenize`
  6246. * 2. `after-tokenize`
  6247. * 3. `wrap`: On each {@link Token}.
  6248. *
  6249. * @param {string} text A string with the code to be highlighted.
  6250. * @param {Grammar} grammar An object containing the tokens to use.
  6251. *
  6252. * Usually a language definition like `Prism.languages.markup`.
  6253. * @param {string} language The name of the language definition passed to `grammar`.
  6254. * @returns {string} The highlighted HTML.
  6255. * @memberof Prism
  6256. * @public
  6257. * @example
  6258. * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
  6259. */
  6260. highlight: function (text, grammar, language) {
  6261. var env = {
  6262. code: text,
  6263. grammar: grammar,
  6264. language: language
  6265. };
  6266. _.hooks.run('before-tokenize', env);
  6267. if (!env.grammar) {
  6268. throw new Error('The language "' + env.language + '" has no grammar.');
  6269. }
  6270. env.tokens = _.tokenize(env.code, env.grammar);
  6271. _.hooks.run('after-tokenize', env);
  6272. return Token.stringify(_.util.encode(env.tokens), env.language);
  6273. },
  6274. /**
  6275. * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
  6276. * and the language definitions to use, and returns an array with the tokenized code.
  6277. *
  6278. * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
  6279. *
  6280. * This method could be useful in other contexts as well, as a very crude parser.
  6281. *
  6282. * @param {string} text A string with the code to be highlighted.
  6283. * @param {Grammar} grammar An object containing the tokens to use.
  6284. *
  6285. * Usually a language definition like `Prism.languages.markup`.
  6286. * @returns {TokenStream} An array of strings and tokens, a token stream.
  6287. * @memberof Prism
  6288. * @public
  6289. * @example
  6290. * let code = `var foo = 0;`;
  6291. * let tokens = Prism.tokenize(code, Prism.languages.javascript);
  6292. * tokens.forEach(token => {
  6293. * if (token instanceof Prism.Token && token.type === 'number') {
  6294. * console.log(`Found numeric literal: ${token.content}`);
  6295. * }
  6296. * });
  6297. */
  6298. tokenize: function (text, grammar) {
  6299. var rest = grammar.rest;
  6300. if (rest) {
  6301. for (var token in rest) {
  6302. grammar[token] = rest[token];
  6303. }
  6304. delete grammar.rest;
  6305. }
  6306. var tokenList = new LinkedList();
  6307. addAfter(tokenList, tokenList.head, text);
  6308. matchGrammar(text, tokenList, grammar, tokenList.head, 0);
  6309. return toArray(tokenList);
  6310. },
  6311. /**
  6312. * @namespace
  6313. * @memberof Prism
  6314. * @public
  6315. */
  6316. hooks: {
  6317. all: {},
  6318. /**
  6319. * Adds the given callback to the list of callbacks for the given hook.
  6320. *
  6321. * The callback will be invoked when the hook it is registered for is run.
  6322. * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
  6323. *
  6324. * One callback function can be registered to multiple hooks and the same hook multiple times.
  6325. *
  6326. * @param {string} name The name of the hook.
  6327. * @param {HookCallback} callback The callback function which is given environment variables.
  6328. * @public
  6329. */
  6330. add: function (name, callback) {
  6331. var hooks = _.hooks.all;
  6332. hooks[name] = hooks[name] || [];
  6333. hooks[name].push(callback);
  6334. },
  6335. /**
  6336. * Runs a hook invoking all registered callbacks with the given environment variables.
  6337. *
  6338. * Callbacks will be invoked synchronously and in the order in which they were registered.
  6339. *
  6340. * @param {string} name The name of the hook.
  6341. * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
  6342. * @public
  6343. */
  6344. run: function (name, env) {
  6345. var callbacks = _.hooks.all[name];
  6346. if (!callbacks || !callbacks.length) {
  6347. return;
  6348. }
  6349. for (var i = 0, callback; (callback = callbacks[i++]);) {
  6350. callback(env);
  6351. }
  6352. }
  6353. },
  6354. Token: Token
  6355. };
  6356. _self.Prism = _;
  6357. // Typescript note:
  6358. // The following can be used to import the Token type in JSDoc:
  6359. //
  6360. // @typedef {InstanceType<import("./prism-core")["Token"]>} Token
  6361. /**
  6362. * Creates a new token.
  6363. *
  6364. * @param {string} type See {@link Token#type type}
  6365. * @param {string | TokenStream} content See {@link Token#content content}
  6366. * @param {string|string[]} [alias] The alias(es) of the token.
  6367. * @param {string} [matchedStr=""] A copy of the full string this token was created from.
  6368. * @class
  6369. * @global
  6370. * @public
  6371. */
  6372. function Token(type, content, alias, matchedStr) {
  6373. /**
  6374. * The type of the token.
  6375. *
  6376. * This is usually the key of a pattern in a {@link Grammar}.
  6377. *
  6378. * @type {string}
  6379. * @see GrammarToken
  6380. * @public
  6381. */
  6382. this.type = type;
  6383. /**
  6384. * The strings or tokens contained by this token.
  6385. *
  6386. * This will be a token stream if the pattern matched also defined an `inside` grammar.
  6387. *
  6388. * @type {string | TokenStream}
  6389. * @public
  6390. */
  6391. this.content = content;
  6392. /**
  6393. * The alias(es) of the token.
  6394. *
  6395. * @type {string|string[]}
  6396. * @see GrammarToken
  6397. * @public
  6398. */
  6399. this.alias = alias;
  6400. // Copy of the full string this token was created from
  6401. this.length = (matchedStr || '').length | 0;
  6402. }
  6403. /**
  6404. * A token stream is an array of strings and {@link Token Token} objects.
  6405. *
  6406. * Token streams have to fulfill a few properties that are assumed by most functions (mostly internal ones) that process
  6407. * them.
  6408. *
  6409. * 1. No adjacent strings.
  6410. * 2. No empty strings.
  6411. *
  6412. * The only exception here is the token stream that only contains the empty string and nothing else.
  6413. *
  6414. * @typedef {Array<string | Token>} TokenStream
  6415. * @global
  6416. * @public
  6417. */
  6418. /**
  6419. * Converts the given token or token stream to an HTML representation.
  6420. *
  6421. * The following hooks will be run:
  6422. * 1. `wrap`: On each {@link Token}.
  6423. *
  6424. * @param {string | Token | TokenStream} o The token or token stream to be converted.
  6425. * @param {string} language The name of current language.
  6426. * @returns {string} The HTML representation of the token or token stream.
  6427. * @memberof Token
  6428. * @static
  6429. */
  6430. Token.stringify = function stringify(o, language) {
  6431. if (typeof o == 'string') {
  6432. return o;
  6433. }
  6434. if (Array.isArray(o)) {
  6435. var s = '';
  6436. o.forEach(function (e) {
  6437. s += stringify(e, language);
  6438. });
  6439. return s;
  6440. }
  6441. var env = {
  6442. type: o.type,
  6443. content: stringify(o.content, language),
  6444. tag: 'span',
  6445. classes: ['token', o.type],
  6446. attributes: {},
  6447. language: language
  6448. };
  6449. var aliases = o.alias;
  6450. if (aliases) {
  6451. if (Array.isArray(aliases)) {
  6452. Array.prototype.push.apply(env.classes, aliases);
  6453. } else {
  6454. env.classes.push(aliases);
  6455. }
  6456. }
  6457. _.hooks.run('wrap', env);
  6458. var attributes = '';
  6459. for (var name in env.attributes) {
  6460. attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
  6461. }
  6462. return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
  6463. };
  6464. /**
  6465. * @param {RegExp} pattern
  6466. * @param {number} pos
  6467. * @param {string} text
  6468. * @param {boolean} lookbehind
  6469. * @returns {RegExpExecArray | null}
  6470. */
  6471. function matchPattern(pattern, pos, text, lookbehind) {
  6472. pattern.lastIndex = pos;
  6473. var match = pattern.exec(text);
  6474. if (match && lookbehind && match[1]) {
  6475. // change the match to remove the text matched by the Prism lookbehind group
  6476. var lookbehindLength = match[1].length;
  6477. match.index += lookbehindLength;
  6478. match[0] = match[0].slice(lookbehindLength);
  6479. }
  6480. return match;
  6481. }
  6482. /**
  6483. * @param {string} text
  6484. * @param {LinkedList<string | Token>} tokenList
  6485. * @param {any} grammar
  6486. * @param {LinkedListNode<string | Token>} startNode
  6487. * @param {number} startPos
  6488. * @param {RematchOptions} [rematch]
  6489. * @returns {void}
  6490. * @private
  6491. *
  6492. * @typedef RematchOptions
  6493. * @property {string} cause
  6494. * @property {number} reach
  6495. */
  6496. function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
  6497. for (var token in grammar) {
  6498. if (!grammar.hasOwnProperty(token) || !grammar[token]) {
  6499. continue;
  6500. }
  6501. var patterns = grammar[token];
  6502. patterns = Array.isArray(patterns) ? patterns : [patterns];
  6503. for (var j = 0; j < patterns.length; ++j) {
  6504. if (rematch && rematch.cause == token + ',' + j) {
  6505. return;
  6506. }
  6507. var patternObj = patterns[j];
  6508. var inside = patternObj.inside;
  6509. var lookbehind = !!patternObj.lookbehind;
  6510. var greedy = !!patternObj.greedy;
  6511. var alias = patternObj.alias;
  6512. if (greedy && !patternObj.pattern.global) {
  6513. // Without the global flag, lastIndex won't work
  6514. var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
  6515. patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');
  6516. }
  6517. /** @type {RegExp} */
  6518. var pattern = patternObj.pattern || patternObj;
  6519. for ( // iterate the token list and keep track of the current token/string position
  6520. var currentNode = startNode.next, pos = startPos;
  6521. currentNode !== tokenList.tail;
  6522. pos += currentNode.value.length, currentNode = currentNode.next
  6523. ) {
  6524. if (rematch && pos >= rematch.reach) {
  6525. break;
  6526. }
  6527. var str = currentNode.value;
  6528. if (tokenList.length > text.length) {
  6529. // Something went terribly wrong, ABORT, ABORT!
  6530. return;
  6531. }
  6532. if (str instanceof Token) {
  6533. continue;
  6534. }
  6535. var removeCount = 1; // this is the to parameter of removeBetween
  6536. var match;
  6537. if (greedy) {
  6538. match = matchPattern(pattern, pos, text, lookbehind);
  6539. if (!match || match.index >= text.length) {
  6540. break;
  6541. }
  6542. var from = match.index;
  6543. var to = match.index + match[0].length;
  6544. var p = pos;
  6545. // find the node that contains the match
  6546. p += currentNode.value.length;
  6547. while (from >= p) {
  6548. currentNode = currentNode.next;
  6549. p += currentNode.value.length;
  6550. }
  6551. // adjust pos (and p)
  6552. p -= currentNode.value.length;
  6553. pos = p;
  6554. // the current node is a Token, then the match starts inside another Token, which is invalid
  6555. if (currentNode.value instanceof Token) {
  6556. continue;
  6557. }
  6558. // find the last node which is affected by this match
  6559. for (
  6560. var k = currentNode;
  6561. k !== tokenList.tail && (p < to || typeof k.value === 'string');
  6562. k = k.next
  6563. ) {
  6564. removeCount++;
  6565. p += k.value.length;
  6566. }
  6567. removeCount--;
  6568. // replace with the new match
  6569. str = text.slice(pos, p);
  6570. match.index -= pos;
  6571. } else {
  6572. match = matchPattern(pattern, 0, str, lookbehind);
  6573. if (!match) {
  6574. continue;
  6575. }
  6576. }
  6577. // eslint-disable-next-line no-redeclare
  6578. var from = match.index;
  6579. var matchStr = match[0];
  6580. var before = str.slice(0, from);
  6581. var after = str.slice(from + matchStr.length);
  6582. var reach = pos + str.length;
  6583. if (rematch && reach > rematch.reach) {
  6584. rematch.reach = reach;
  6585. }
  6586. var removeFrom = currentNode.prev;
  6587. if (before) {
  6588. removeFrom = addAfter(tokenList, removeFrom, before);
  6589. pos += before.length;
  6590. }
  6591. removeRange(tokenList, removeFrom, removeCount);
  6592. var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
  6593. currentNode = addAfter(tokenList, removeFrom, wrapped);
  6594. if (after) {
  6595. addAfter(tokenList, currentNode, after);
  6596. }
  6597. if (removeCount > 1) {
  6598. // at least one Token object was removed, so we have to do some rematching
  6599. // this can only happen if the current pattern is greedy
  6600. /** @type {RematchOptions} */
  6601. var nestedRematch = {
  6602. cause: token + ',' + j,
  6603. reach: reach
  6604. };
  6605. matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
  6606. // the reach might have been extended because of the rematching
  6607. if (rematch && nestedRematch.reach > rematch.reach) {
  6608. rematch.reach = nestedRematch.reach;
  6609. }
  6610. }
  6611. }
  6612. }
  6613. }
  6614. }
  6615. /**
  6616. * @typedef LinkedListNode
  6617. * @property {T} value
  6618. * @property {LinkedListNode<T> | null} prev The previous node.
  6619. * @property {LinkedListNode<T> | null} next The next node.
  6620. * @template T
  6621. * @private
  6622. */
  6623. /**
  6624. * @template T
  6625. * @private
  6626. */
  6627. function LinkedList() {
  6628. /** @type {LinkedListNode<T>} */
  6629. var head = { value: null, prev: null, next: null };
  6630. /** @type {LinkedListNode<T>} */
  6631. var tail = { value: null, prev: head, next: null };
  6632. head.next = tail;
  6633. /** @type {LinkedListNode<T>} */
  6634. this.head = head;
  6635. /** @type {LinkedListNode<T>} */
  6636. this.tail = tail;
  6637. this.length = 0;
  6638. }
  6639. /**
  6640. * Adds a new node with the given value to the list.
  6641. *
  6642. * @param {LinkedList<T>} list
  6643. * @param {LinkedListNode<T>} node
  6644. * @param {T} value
  6645. * @returns {LinkedListNode<T>} The added node.
  6646. * @template T
  6647. */
  6648. function addAfter(list, node, value) {
  6649. // assumes that node != list.tail && values.length >= 0
  6650. var next = node.next;
  6651. var newNode = { value: value, prev: node, next: next };
  6652. node.next = newNode;
  6653. next.prev = newNode;
  6654. list.length++;
  6655. return newNode;
  6656. }
  6657. /**
  6658. * Removes `count` nodes after the given node. The given node will not be removed.
  6659. *
  6660. * @param {LinkedList<T>} list
  6661. * @param {LinkedListNode<T>} node
  6662. * @param {number} count
  6663. * @template T
  6664. */
  6665. function removeRange(list, node, count) {
  6666. var next = node.next;
  6667. for (var i = 0; i < count && next !== list.tail; i++) {
  6668. next = next.next;
  6669. }
  6670. node.next = next;
  6671. next.prev = node;
  6672. list.length -= i;
  6673. }
  6674. /**
  6675. * @param {LinkedList<T>} list
  6676. * @returns {T[]}
  6677. * @template T
  6678. */
  6679. function toArray(list) {
  6680. var array = [];
  6681. var node = list.head.next;
  6682. while (node !== list.tail) {
  6683. array.push(node.value);
  6684. node = node.next;
  6685. }
  6686. return array;
  6687. }
  6688. if (!_self.document) {
  6689. if (!_self.addEventListener) {
  6690. // in Node.js
  6691. return _;
  6692. }
  6693. if (!_.disableWorkerMessageHandler) {
  6694. // In worker
  6695. _self.addEventListener('message', function (evt) {
  6696. var message = JSON.parse(evt.data);
  6697. var lang = message.language;
  6698. var code = message.code;
  6699. var immediateClose = message.immediateClose;
  6700. _self.postMessage(_.highlight(code, _.languages[lang], lang));
  6701. if (immediateClose) {
  6702. _self.close();
  6703. }
  6704. }, false);
  6705. }
  6706. return _;
  6707. }
  6708. // Get current script and highlight
  6709. var script = _.util.currentScript();
  6710. if (script) {
  6711. _.filename = script.src;
  6712. if (script.hasAttribute('data-manual')) {
  6713. _.manual = true;
  6714. }
  6715. }
  6716. function highlightAutomaticallyCallback() {
  6717. if (!_.manual) {
  6718. _.highlightAll();
  6719. }
  6720. }
  6721. if (!_.manual) {
  6722. // If the document state is "loading", then we'll use DOMContentLoaded.
  6723. // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
  6724. // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
  6725. // might take longer one animation frame to execute which can create a race condition where only some plugins have
  6726. // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
  6727. // See https://github.com/PrismJS/prism/issues/2102
  6728. var readyState = document.readyState;
  6729. if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
  6730. document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
  6731. } else {
  6732. if (window.requestAnimationFrame) {
  6733. window.requestAnimationFrame(highlightAutomaticallyCallback);
  6734. } else {
  6735. window.setTimeout(highlightAutomaticallyCallback, 16);
  6736. }
  6737. }
  6738. }
  6739. return _;
  6740. }(_self));
  6741. if ( module.exports) {
  6742. module.exports = Prism;
  6743. }
  6744. // hack for components to work correctly in node.js
  6745. if (typeof commonjsGlobal !== 'undefined') {
  6746. commonjsGlobal.Prism = Prism;
  6747. }
  6748. // some additional documentation/types
  6749. /**
  6750. * The expansion of a simple `RegExp` literal to support additional properties.
  6751. *
  6752. * @typedef GrammarToken
  6753. * @property {RegExp} pattern The regular expression of the token.
  6754. * @property {boolean} [lookbehind=false] If `true`, then the first capturing group of `pattern` will (effectively)
  6755. * behave as a lookbehind group meaning that the captured text will not be part of the matched text of the new token.
  6756. * @property {boolean} [greedy=false] Whether the token is greedy.
  6757. * @property {string|string[]} [alias] An optional alias or list of aliases.
  6758. * @property {Grammar} [inside] The nested grammar of this token.
  6759. *
  6760. * The `inside` grammar will be used to tokenize the text value of each token of this kind.
  6761. *
  6762. * This can be used to make nested and even recursive language definitions.
  6763. *
  6764. * Note: This can cause infinite recursion. Be careful when you embed different languages or even the same language into
  6765. * each another.
  6766. * @global
  6767. * @public
  6768. */
  6769. /**
  6770. * @typedef Grammar
  6771. * @type {Object<string, RegExp | GrammarToken | Array<RegExp | GrammarToken>>}
  6772. * @property {Grammar} [rest] An optional grammar object that will be appended to this grammar.
  6773. * @global
  6774. * @public
  6775. */
  6776. /**
  6777. * A function which will invoked after an element was successfully highlighted.
  6778. *
  6779. * @callback HighlightCallback
  6780. * @param {Element} element The element successfully highlighted.
  6781. * @returns {void}
  6782. * @global
  6783. * @public
  6784. */
  6785. /**
  6786. * @callback HookCallback
  6787. * @param {Object<string, any>} env The environment variables of the hook.
  6788. * @returns {void}
  6789. * @global
  6790. * @public
  6791. */
  6792. /* **********************************************
  6793. Begin prism-markup.js
  6794. ********************************************** */
  6795. Prism.languages.markup = {
  6796. 'comment': {
  6797. pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
  6798. greedy: true
  6799. },
  6800. 'prolog': {
  6801. pattern: /<\?[\s\S]+?\?>/,
  6802. greedy: true
  6803. },
  6804. 'doctype': {
  6805. // https://www.w3.org/TR/xml/#NT-doctypedecl
  6806. pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
  6807. greedy: true,
  6808. inside: {
  6809. 'internal-subset': {
  6810. pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
  6811. lookbehind: true,
  6812. greedy: true,
  6813. inside: null // see below
  6814. },
  6815. 'string': {
  6816. pattern: /"[^"]*"|'[^']*'/,
  6817. greedy: true
  6818. },
  6819. 'punctuation': /^<!|>$|[[\]]/,
  6820. 'doctype-tag': /^DOCTYPE/i,
  6821. 'name': /[^\s<>'"]+/
  6822. }
  6823. },
  6824. 'cdata': {
  6825. pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
  6826. greedy: true
  6827. },
  6828. 'tag': {
  6829. pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
  6830. greedy: true,
  6831. inside: {
  6832. 'tag': {
  6833. pattern: /^<\/?[^\s>\/]+/,
  6834. inside: {
  6835. 'punctuation': /^<\/?/,
  6836. 'namespace': /^[^\s>\/:]+:/
  6837. }
  6838. },
  6839. 'special-attr': [],
  6840. 'attr-value': {
  6841. pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
  6842. inside: {
  6843. 'punctuation': [
  6844. {
  6845. pattern: /^=/,
  6846. alias: 'attr-equals'
  6847. },
  6848. {
  6849. pattern: /^(\s*)["']|["']$/,
  6850. lookbehind: true
  6851. }
  6852. ]
  6853. }
  6854. },
  6855. 'punctuation': /\/?>/,
  6856. 'attr-name': {
  6857. pattern: /[^\s>\/]+/,
  6858. inside: {
  6859. 'namespace': /^[^\s>\/:]+:/
  6860. }
  6861. }
  6862. }
  6863. },
  6864. 'entity': [
  6865. {
  6866. pattern: /&[\da-z]{1,8};/i,
  6867. alias: 'named-entity'
  6868. },
  6869. /&#x?[\da-f]{1,8};/i
  6870. ]
  6871. };
  6872. Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
  6873. Prism.languages.markup['entity'];
  6874. Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
  6875. // Plugin to make entity title show the real entity, idea by Roman Komarov
  6876. Prism.hooks.add('wrap', function (env) {
  6877. if (env.type === 'entity') {
  6878. env.attributes['title'] = env.content.replace(/&amp;/, '&');
  6879. }
  6880. });
  6881. Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
  6882. /**
  6883. * Adds an inlined language to markup.
  6884. *
  6885. * An example of an inlined language is CSS with `<style>` tags.
  6886. *
  6887. * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
  6888. * case insensitive.
  6889. * @param {string} lang The language key.
  6890. * @example
  6891. * addInlined('style', 'css');
  6892. */
  6893. value: function addInlined(tagName, lang) {
  6894. var includedCdataInside = {};
  6895. includedCdataInside['language-' + lang] = {
  6896. pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
  6897. lookbehind: true,
  6898. inside: Prism.languages[lang]
  6899. };
  6900. includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
  6901. var inside = {
  6902. 'included-cdata': {
  6903. pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
  6904. inside: includedCdataInside
  6905. }
  6906. };
  6907. inside['language-' + lang] = {
  6908. pattern: /[\s\S]+/,
  6909. inside: Prism.languages[lang]
  6910. };
  6911. var def = {};
  6912. def[tagName] = {
  6913. pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),
  6914. lookbehind: true,
  6915. greedy: true,
  6916. inside: inside
  6917. };
  6918. Prism.languages.insertBefore('markup', 'cdata', def);
  6919. }
  6920. });
  6921. Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
  6922. /**
  6923. * Adds an pattern to highlight languages embedded in HTML attributes.
  6924. *
  6925. * An example of an inlined language is CSS with `style` attributes.
  6926. *
  6927. * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
  6928. * case insensitive.
  6929. * @param {string} lang The language key.
  6930. * @example
  6931. * addAttribute('style', 'css');
  6932. */
  6933. value: function (attrName, lang) {
  6934. Prism.languages.markup.tag.inside['special-attr'].push({
  6935. pattern: RegExp(
  6936. /(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
  6937. 'i'
  6938. ),
  6939. lookbehind: true,
  6940. inside: {
  6941. 'attr-name': /^[^\s=]+/,
  6942. 'attr-value': {
  6943. pattern: /=[\s\S]+/,
  6944. inside: {
  6945. 'value': {
  6946. pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
  6947. lookbehind: true,
  6948. alias: [lang, 'language-' + lang],
  6949. inside: Prism.languages[lang]
  6950. },
  6951. 'punctuation': [
  6952. {
  6953. pattern: /^=/,
  6954. alias: 'attr-equals'
  6955. },
  6956. /"|'/
  6957. ]
  6958. }
  6959. }
  6960. }
  6961. });
  6962. }
  6963. });
  6964. Prism.languages.html = Prism.languages.markup;
  6965. Prism.languages.mathml = Prism.languages.markup;
  6966. Prism.languages.svg = Prism.languages.markup;
  6967. Prism.languages.xml = Prism.languages.extend('markup', {});
  6968. Prism.languages.ssml = Prism.languages.xml;
  6969. Prism.languages.atom = Prism.languages.xml;
  6970. Prism.languages.rss = Prism.languages.xml;
  6971. /* **********************************************
  6972. Begin prism-css.js
  6973. ********************************************** */
  6974. (function (Prism) {
  6975. var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
  6976. Prism.languages.css = {
  6977. 'comment': /\/\*[\s\S]*?\*\//,
  6978. 'atrule': {
  6979. pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
  6980. inside: {
  6981. 'rule': /^@[\w-]+/,
  6982. 'selector-function-argument': {
  6983. pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
  6984. lookbehind: true,
  6985. alias: 'selector'
  6986. },
  6987. 'keyword': {
  6988. pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
  6989. lookbehind: true
  6990. }
  6991. // See rest below
  6992. }
  6993. },
  6994. 'url': {
  6995. // https://drafts.csswg.org/css-values-3/#urls
  6996. pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
  6997. greedy: true,
  6998. inside: {
  6999. 'function': /^url/i,
  7000. 'punctuation': /^\(|\)$/,
  7001. 'string': {
  7002. pattern: RegExp('^' + string.source + '$'),
  7003. alias: 'url'
  7004. }
  7005. }
  7006. },
  7007. 'selector': {
  7008. pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
  7009. lookbehind: true
  7010. },
  7011. 'string': {
  7012. pattern: string,
  7013. greedy: true
  7014. },
  7015. 'property': {
  7016. pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
  7017. lookbehind: true
  7018. },
  7019. 'important': /!important\b/i,
  7020. 'function': {
  7021. pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
  7022. lookbehind: true
  7023. },
  7024. 'punctuation': /[(){};:,]/
  7025. };
  7026. Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
  7027. var markup = Prism.languages.markup;
  7028. if (markup) {
  7029. markup.tag.addInlined('style', 'css');
  7030. markup.tag.addAttribute('style', 'css');
  7031. }
  7032. }(Prism));
  7033. /* **********************************************
  7034. Begin prism-clike.js
  7035. ********************************************** */
  7036. Prism.languages.clike = {
  7037. 'comment': [
  7038. {
  7039. pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
  7040. lookbehind: true,
  7041. greedy: true
  7042. },
  7043. {
  7044. pattern: /(^|[^\\:])\/\/.*/,
  7045. lookbehind: true,
  7046. greedy: true
  7047. }
  7048. ],
  7049. 'string': {
  7050. pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
  7051. greedy: true
  7052. },
  7053. 'class-name': {
  7054. pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
  7055. lookbehind: true,
  7056. inside: {
  7057. 'punctuation': /[.\\]/
  7058. }
  7059. },
  7060. 'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
  7061. 'boolean': /\b(?:false|true)\b/,
  7062. 'function': /\b\w+(?=\()/,
  7063. 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
  7064. 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
  7065. 'punctuation': /[{}[\];(),.:]/
  7066. };
  7067. /* **********************************************
  7068. Begin prism-javascript.js
  7069. ********************************************** */
  7070. Prism.languages.javascript = Prism.languages.extend('clike', {
  7071. 'class-name': [
  7072. Prism.languages.clike['class-name'],
  7073. {
  7074. pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
  7075. lookbehind: true
  7076. }
  7077. ],
  7078. 'keyword': [
  7079. {
  7080. pattern: /((?:^|\})\s*)catch\b/,
  7081. lookbehind: true
  7082. },
  7083. {
  7084. pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
  7085. lookbehind: true
  7086. } ],
  7087. // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
  7088. 'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
  7089. 'number': {
  7090. pattern: RegExp(
  7091. /(^|[^\w$])/.source +
  7092. '(?:' +
  7093. (
  7094. // constant
  7095. /NaN|Infinity/.source +
  7096. '|' +
  7097. // binary integer
  7098. /0[bB][01]+(?:_[01]+)*n?/.source +
  7099. '|' +
  7100. // octal integer
  7101. /0[oO][0-7]+(?:_[0-7]+)*n?/.source +
  7102. '|' +
  7103. // hexadecimal integer
  7104. /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source +
  7105. '|' +
  7106. // decimal bigint
  7107. /\d+(?:_\d+)*n/.source +
  7108. '|' +
  7109. // decimal number (integer or float) but no bigint
  7110. /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source
  7111. ) +
  7112. ')' +
  7113. /(?![\w$])/.source
  7114. ),
  7115. lookbehind: true
  7116. },
  7117. 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
  7118. });
  7119. Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
  7120. Prism.languages.insertBefore('javascript', 'keyword', {
  7121. 'regex': {
  7122. pattern: RegExp(
  7123. // lookbehind
  7124. // eslint-disable-next-line regexp/no-dupe-characters-character-class
  7125. /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source +
  7126. // Regex pattern:
  7127. // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
  7128. // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
  7129. // with the only syntax, so we have to define 2 different regex patterns.
  7130. /\//.source +
  7131. '(?:' +
  7132. /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source +
  7133. '|' +
  7134. // `v` flag syntax. This supports 3 levels of nested character classes.
  7135. /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source +
  7136. ')' +
  7137. // lookahead
  7138. /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
  7139. ),
  7140. lookbehind: true,
  7141. greedy: true,
  7142. inside: {
  7143. 'regex-source': {
  7144. pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
  7145. lookbehind: true,
  7146. alias: 'language-regex',
  7147. inside: Prism.languages.regex
  7148. },
  7149. 'regex-delimiter': /^\/|\/$/,
  7150. 'regex-flags': /^[a-z]+$/,
  7151. }
  7152. },
  7153. // This must be declared before keyword because we use "function" inside the look-forward
  7154. 'function-variable': {
  7155. pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
  7156. alias: 'function'
  7157. },
  7158. 'parameter': [
  7159. {
  7160. pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
  7161. lookbehind: true,
  7162. inside: Prism.languages.javascript
  7163. },
  7164. {
  7165. pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
  7166. lookbehind: true,
  7167. inside: Prism.languages.javascript
  7168. },
  7169. {
  7170. pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
  7171. lookbehind: true,
  7172. inside: Prism.languages.javascript
  7173. },
  7174. {
  7175. pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
  7176. lookbehind: true,
  7177. inside: Prism.languages.javascript
  7178. }
  7179. ],
  7180. 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
  7181. });
  7182. Prism.languages.insertBefore('javascript', 'string', {
  7183. 'hashbang': {
  7184. pattern: /^#!.*/,
  7185. greedy: true,
  7186. alias: 'comment'
  7187. },
  7188. 'template-string': {
  7189. pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
  7190. greedy: true,
  7191. inside: {
  7192. 'template-punctuation': {
  7193. pattern: /^`|`$/,
  7194. alias: 'string'
  7195. },
  7196. 'interpolation': {
  7197. pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
  7198. lookbehind: true,
  7199. inside: {
  7200. 'interpolation-punctuation': {
  7201. pattern: /^\$\{|\}$/,
  7202. alias: 'punctuation'
  7203. },
  7204. rest: Prism.languages.javascript
  7205. }
  7206. },
  7207. 'string': /[\s\S]+/
  7208. }
  7209. },
  7210. 'string-property': {
  7211. pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
  7212. lookbehind: true,
  7213. greedy: true,
  7214. alias: 'property'
  7215. }
  7216. });
  7217. Prism.languages.insertBefore('javascript', 'operator', {
  7218. 'literal-property': {
  7219. pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
  7220. lookbehind: true,
  7221. alias: 'property'
  7222. },
  7223. });
  7224. if (Prism.languages.markup) {
  7225. Prism.languages.markup.tag.addInlined('script', 'javascript');
  7226. // add attribute support for all DOM events.
  7227. // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
  7228. Prism.languages.markup.tag.addAttribute(
  7229. /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
  7230. 'javascript'
  7231. );
  7232. }
  7233. Prism.languages.js = Prism.languages.javascript;
  7234. /* **********************************************
  7235. Begin prism-file-highlight.js
  7236. ********************************************** */
  7237. (function () {
  7238. if (typeof Prism === 'undefined' || typeof document === 'undefined') {
  7239. return;
  7240. }
  7241. // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
  7242. if (!Element.prototype.matches) {
  7243. Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  7244. }
  7245. var LOADING_MESSAGE = 'Loading…';
  7246. var FAILURE_MESSAGE = function (status, message) {
  7247. return '✖ Error ' + status + ' while fetching file: ' + message;
  7248. };
  7249. var FAILURE_EMPTY_MESSAGE = '✖ Error: File does not exist or is empty';
  7250. var EXTENSIONS = {
  7251. 'js': 'javascript',
  7252. 'py': 'python',
  7253. 'rb': 'ruby',
  7254. 'ps1': 'powershell',
  7255. 'psm1': 'powershell',
  7256. 'sh': 'bash',
  7257. 'bat': 'batch',
  7258. 'h': 'c',
  7259. 'tex': 'latex'
  7260. };
  7261. var STATUS_ATTR = 'data-src-status';
  7262. var STATUS_LOADING = 'loading';
  7263. var STATUS_LOADED = 'loaded';
  7264. var STATUS_FAILED = 'failed';
  7265. var SELECTOR = 'pre[data-src]:not([' + STATUS_ATTR + '="' + STATUS_LOADED + '"])'
  7266. + ':not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';
  7267. /**
  7268. * Loads the given file.
  7269. *
  7270. * @param {string} src The URL or path of the source file to load.
  7271. * @param {(result: string) => void} success
  7272. * @param {(reason: string) => void} error
  7273. */
  7274. function loadFile(src, success, error) {
  7275. var xhr = new XMLHttpRequest();
  7276. xhr.open('GET', src, true);
  7277. xhr.onreadystatechange = function () {
  7278. if (xhr.readyState == 4) {
  7279. if (xhr.status < 400 && xhr.responseText) {
  7280. success(xhr.responseText);
  7281. } else {
  7282. if (xhr.status >= 400) {
  7283. error(FAILURE_MESSAGE(xhr.status, xhr.statusText));
  7284. } else {
  7285. error(FAILURE_EMPTY_MESSAGE);
  7286. }
  7287. }
  7288. }
  7289. };
  7290. xhr.send(null);
  7291. }
  7292. /**
  7293. * Parses the given range.
  7294. *
  7295. * This returns a range with inclusive ends.
  7296. *
  7297. * @param {string | null | undefined} range
  7298. * @returns {[number, number | undefined] | undefined}
  7299. */
  7300. function parseRange(range) {
  7301. var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || '');
  7302. if (m) {
  7303. var start = Number(m[1]);
  7304. var comma = m[2];
  7305. var end = m[3];
  7306. if (!comma) {
  7307. return [start, start];
  7308. }
  7309. if (!end) {
  7310. return [start, undefined];
  7311. }
  7312. return [start, Number(end)];
  7313. }
  7314. return undefined;
  7315. }
  7316. Prism.hooks.add('before-highlightall', function (env) {
  7317. env.selector += ', ' + SELECTOR;
  7318. });
  7319. Prism.hooks.add('before-sanity-check', function (env) {
  7320. var pre = /** @type {HTMLPreElement} */ (env.element);
  7321. if (pre.matches(SELECTOR)) {
  7322. env.code = ''; // fast-path the whole thing and go to complete
  7323. pre.setAttribute(STATUS_ATTR, STATUS_LOADING); // mark as loading
  7324. // add code element with loading message
  7325. var code = pre.appendChild(document.createElement('CODE'));
  7326. code.textContent = LOADING_MESSAGE;
  7327. var src = pre.getAttribute('data-src');
  7328. var language = env.language;
  7329. if (language === 'none') {
  7330. // the language might be 'none' because there is no language set;
  7331. // in this case, we want to use the extension as the language
  7332. var extension = (/\.(\w+)$/.exec(src) || [, 'none'])[1];
  7333. language = EXTENSIONS[extension] || extension;
  7334. }
  7335. // set language classes
  7336. Prism.util.setLanguage(code, language);
  7337. Prism.util.setLanguage(pre, language);
  7338. // preload the language
  7339. var autoloader = Prism.plugins.autoloader;
  7340. if (autoloader) {
  7341. autoloader.loadLanguages(language);
  7342. }
  7343. // load file
  7344. loadFile(
  7345. src,
  7346. function (text) {
  7347. // mark as loaded
  7348. pre.setAttribute(STATUS_ATTR, STATUS_LOADED);
  7349. // handle data-range
  7350. var range = parseRange(pre.getAttribute('data-range'));
  7351. if (range) {
  7352. var lines = text.split(/\r\n?|\n/g);
  7353. // the range is one-based and inclusive on both ends
  7354. var start = range[0];
  7355. var end = range[1] == null ? lines.length : range[1];
  7356. if (start < 0) { start += lines.length; }
  7357. start = Math.max(0, Math.min(start - 1, lines.length));
  7358. if (end < 0) { end += lines.length; }
  7359. end = Math.max(0, Math.min(end, lines.length));
  7360. text = lines.slice(start, end).join('\n');
  7361. // add data-start for line numbers
  7362. if (!pre.hasAttribute('data-start')) {
  7363. pre.setAttribute('data-start', String(start + 1));
  7364. }
  7365. }
  7366. // highlight code
  7367. code.textContent = text;
  7368. Prism.highlightElement(code);
  7369. },
  7370. function (error) {
  7371. // mark as failed
  7372. pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
  7373. code.textContent = error;
  7374. }
  7375. );
  7376. }
  7377. });
  7378. Prism.plugins.fileHighlight = {
  7379. /**
  7380. * Executes the File Highlight plugin for all matching `pre` elements under the given container.
  7381. *
  7382. * Note: Elements which are already loaded or currently loading will not be touched by this method.
  7383. *
  7384. * @param {ParentNode} [container=document]
  7385. */
  7386. highlight: function highlight(container) {
  7387. var elements = (container || document).querySelectorAll(SELECTOR);
  7388. for (var i = 0, element; (element = elements[i++]);) {
  7389. Prism.highlightElement(element);
  7390. }
  7391. }
  7392. };
  7393. var logged = false;
  7394. /** @deprecated Use `Prism.plugins.fileHighlight.highlight` instead. */
  7395. Prism.fileHighlight = function () {
  7396. if (!logged) {
  7397. console.warn('Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead.');
  7398. logged = true;
  7399. }
  7400. Prism.plugins.fileHighlight.highlight.apply(this, arguments);
  7401. };
  7402. }());
  7403. });
  7404. (function (Prism) {
  7405. /**
  7406. * Returns the placeholder for the given language id and index.
  7407. *
  7408. * @param {string} language
  7409. * @param {string|number} index
  7410. * @returns {string}
  7411. */
  7412. function getPlaceholder(language, index) {
  7413. return '___' + language.toUpperCase() + index + '___';
  7414. }
  7415. Object.defineProperties(Prism.languages['markup-templating'] = {}, {
  7416. buildPlaceholders: {
  7417. /**
  7418. * Tokenize all inline templating expressions matching `placeholderPattern`.
  7419. *
  7420. * If `replaceFilter` is provided, only matches of `placeholderPattern` for which `replaceFilter` returns
  7421. * `true` will be replaced.
  7422. *
  7423. * @param {object} env The environment of the `before-tokenize` hook.
  7424. * @param {string} language The language id.
  7425. * @param {RegExp} placeholderPattern The matches of this pattern will be replaced by placeholders.
  7426. * @param {(match: string) => boolean} [replaceFilter]
  7427. */
  7428. value: function (env, language, placeholderPattern, replaceFilter) {
  7429. if (env.language !== language) {
  7430. return;
  7431. }
  7432. var tokenStack = env.tokenStack = [];
  7433. env.code = env.code.replace(placeholderPattern, function (match) {
  7434. if (typeof replaceFilter === 'function' && !replaceFilter(match)) {
  7435. return match;
  7436. }
  7437. var i = tokenStack.length;
  7438. var placeholder;
  7439. // Check for existing strings
  7440. while (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) {
  7441. ++i;
  7442. }
  7443. // Create a sparse array
  7444. tokenStack[i] = match;
  7445. return placeholder;
  7446. });
  7447. // Switch the grammar to markup
  7448. env.grammar = Prism.languages.markup;
  7449. }
  7450. },
  7451. tokenizePlaceholders: {
  7452. /**
  7453. * Replace placeholders with proper tokens after tokenizing.
  7454. *
  7455. * @param {object} env The environment of the `after-tokenize` hook.
  7456. * @param {string} language The language id.
  7457. */
  7458. value: function (env, language) {
  7459. if (env.language !== language || !env.tokenStack) {
  7460. return;
  7461. }
  7462. // Switch the grammar back
  7463. env.grammar = Prism.languages[language];
  7464. var j = 0;
  7465. var keys = Object.keys(env.tokenStack);
  7466. function walkTokens(tokens) {
  7467. for (var i = 0; i < tokens.length; i++) {
  7468. // all placeholders are replaced already
  7469. if (j >= keys.length) {
  7470. break;
  7471. }
  7472. var token = tokens[i];
  7473. if (typeof token === 'string' || (token.content && typeof token.content === 'string')) {
  7474. var k = keys[j];
  7475. var t = env.tokenStack[k];
  7476. var s = typeof token === 'string' ? token : token.content;
  7477. var placeholder = getPlaceholder(language, k);
  7478. var index = s.indexOf(placeholder);
  7479. if (index > -1) {
  7480. ++j;
  7481. var before = s.substring(0, index);
  7482. var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar), 'language-' + language, t);
  7483. var after = s.substring(index + placeholder.length);
  7484. var replacement = [];
  7485. if (before) {
  7486. replacement.push.apply(replacement, walkTokens([before]));
  7487. }
  7488. replacement.push(middle);
  7489. if (after) {
  7490. replacement.push.apply(replacement, walkTokens([after]));
  7491. }
  7492. if (typeof token === 'string') {
  7493. tokens.splice.apply(tokens, [i, 1].concat(replacement));
  7494. } else {
  7495. token.content = replacement;
  7496. }
  7497. }
  7498. } else if (token.content /* && typeof token.content !== 'string' */) {
  7499. walkTokens(token.content);
  7500. }
  7501. }
  7502. return tokens;
  7503. }
  7504. walkTokens(env.tokens);
  7505. }
  7506. }
  7507. });
  7508. }(Prism));
  7509. var highlightCodeCompiler = function (ref) {
  7510. var renderer = ref.renderer;
  7511. return (renderer.code = function (code, lang) {
  7512. if ( lang === void 0 ) lang = 'markup';
  7513. var langOrMarkup = prism.languages[lang] || prism.languages.markup;
  7514. var text = prism.highlight(
  7515. code.replace(/@DOCSIFY_QM@/g, '`'),
  7516. langOrMarkup,
  7517. lang
  7518. );
  7519. return ("<pre v-pre data-lang=\"" + lang + "\"><code class=\"lang-" + lang + "\">" + text + "</code></pre>");
  7520. });
  7521. };
  7522. var paragraphCompiler = function (ref) {
  7523. var renderer = ref.renderer;
  7524. return (renderer.paragraph = function (text) {
  7525. var result;
  7526. if (/^!&gt;/.test(text)) {
  7527. result = helper('tip', text);
  7528. } else if (/^\?&gt;/.test(text)) {
  7529. result = helper('warn', text);
  7530. } else {
  7531. result = "<p>" + text + "</p>";
  7532. }
  7533. return result;
  7534. });
  7535. };
  7536. var taskListCompiler = function (ref) {
  7537. var renderer = ref.renderer;
  7538. return (renderer.list = function (body, ordered, start) {
  7539. var isTaskList = /<li class="task-list-item">/.test(
  7540. body.split('class="task-list"')[0]
  7541. );
  7542. var isStartReq = start && start > 1;
  7543. var tag = ordered ? 'ol' : 'ul';
  7544. var tagAttrs = [
  7545. isTaskList ? 'class="task-list"' : '',
  7546. isStartReq ? ("start=\"" + start + "\"") : '' ]
  7547. .join(' ')
  7548. .trim();
  7549. return ("<" + tag + " " + tagAttrs + ">" + body + "</" + tag + ">");
  7550. });
  7551. };
  7552. var taskListItemCompiler = function (ref) {
  7553. var renderer = ref.renderer;
  7554. return (renderer.listitem = function (text) {
  7555. var isTaskItem = /^(<input.*type="checkbox"[^>]*>)/.test(text);
  7556. var html = isTaskItem
  7557. ? ("<li class=\"task-list-item\"><label>" + text + "</label></li>")
  7558. : ("<li>" + text + "</li>");
  7559. return html;
  7560. });
  7561. };
  7562. var linkCompiler = function (ref) {
  7563. var renderer = ref.renderer;
  7564. var router = ref.router;
  7565. var linkTarget = ref.linkTarget;
  7566. var linkRel = ref.linkRel;
  7567. var compilerClass = ref.compilerClass;
  7568. return (renderer.link = function (href, title, text) {
  7569. if ( title === void 0 ) title = '';
  7570. var attrs = [];
  7571. var ref = getAndRemoveConfig(title);
  7572. var str = ref.str;
  7573. var config = ref.config;
  7574. linkTarget = config.target || linkTarget;
  7575. linkRel =
  7576. linkTarget === '_blank'
  7577. ? compilerClass.config.externalLinkRel || 'noopener'
  7578. : '';
  7579. title = str;
  7580. if (
  7581. !isAbsolutePath(href) &&
  7582. !compilerClass._matchNotCompileLink(href) &&
  7583. !config.ignore
  7584. ) {
  7585. if (href === compilerClass.config.homepage) {
  7586. href = 'README';
  7587. }
  7588. href = router.toURL(href, null, router.getCurrentPath());
  7589. } else {
  7590. if (!isAbsolutePath(href) && href.slice(0, 2) === './') {
  7591. href =
  7592. document.URL.replace(/\/(?!.*\/).*/, '/').replace('#/./', '') + href;
  7593. }
  7594. attrs.push(href.indexOf('mailto:') === 0 ? '' : ("target=\"" + linkTarget + "\""));
  7595. attrs.push(
  7596. href.indexOf('mailto:') === 0
  7597. ? ''
  7598. : linkRel !== ''
  7599. ? (" rel=\"" + linkRel + "\"")
  7600. : ''
  7601. );
  7602. }
  7603. if (config.disabled) {
  7604. attrs.push('disabled');
  7605. href = 'javascript:void(0)';
  7606. }
  7607. if (config.class) {
  7608. attrs.push(("class=\"" + (config.class) + "\""));
  7609. }
  7610. if (config.id) {
  7611. attrs.push(("id=\"" + (config.id) + "\""));
  7612. }
  7613. if (title) {
  7614. attrs.push(("title=\"" + title + "\""));
  7615. }
  7616. return ("<a href=\"" + href + "\" " + (attrs.join(' ')) + ">" + text + "</a>");
  7617. });
  7618. };
  7619. var cachedLinks = {};
  7620. var compileMedia = {
  7621. markdown: function markdown(url) {
  7622. return {
  7623. url: url,
  7624. };
  7625. },
  7626. mermaid: function mermaid(url) {
  7627. return {
  7628. url: url,
  7629. };
  7630. },
  7631. iframe: function iframe(url, title) {
  7632. return {
  7633. html: ("<iframe src=\"" + url + "\" " + (title || 'width=100% height=400') + "></iframe>"),
  7634. };
  7635. },
  7636. video: function video(url, title) {
  7637. return {
  7638. html: ("<video src=\"" + url + "\" " + (title || 'controls') + ">Not Support</video>"),
  7639. };
  7640. },
  7641. audio: function audio(url, title) {
  7642. return {
  7643. html: ("<audio src=\"" + url + "\" " + (title || 'controls') + ">Not Support</audio>"),
  7644. };
  7645. },
  7646. code: function code(url, title) {
  7647. var lang = url.match(/\.(\w+)$/);
  7648. lang = title || (lang && lang[1]);
  7649. if (lang === 'md') {
  7650. lang = 'markdown';
  7651. }
  7652. return {
  7653. url: url,
  7654. lang: lang,
  7655. };
  7656. },
  7657. };
  7658. var Compiler = function Compiler(config, router) {
  7659. var this$1 = this;
  7660. this.config = config;
  7661. this.router = router;
  7662. this.cacheTree = {};
  7663. this.toc = [];
  7664. this.cacheTOC = {};
  7665. this.linkTarget = config.externalLinkTarget || '_blank';
  7666. this.linkRel =
  7667. this.linkTarget === '_blank' ? config.externalLinkRel || 'noopener' : '';
  7668. this.contentBase = router.getBasePath();
  7669. var renderer = this._initRenderer();
  7670. this.heading = renderer.heading;
  7671. var compile;
  7672. var mdConf = config.markdown || {};
  7673. if (isFn(mdConf)) {
  7674. compile = mdConf(marked_1, renderer);
  7675. } else {
  7676. marked_1.setOptions(
  7677. merge(mdConf, {
  7678. renderer: merge(renderer, mdConf.renderer),
  7679. })
  7680. );
  7681. compile = marked_1;
  7682. }
  7683. this._marked = compile;
  7684. this.compile = function (text) {
  7685. var isCached = true;
  7686. // eslint-disable-next-line no-unused-vars
  7687. var result = cached(function (_) {
  7688. isCached = false;
  7689. var html = '';
  7690. if (!text) {
  7691. return text;
  7692. }
  7693. if (isPrimitive(text)) {
  7694. html = compile(text);
  7695. } else {
  7696. html = compile.parser(text);
  7697. }
  7698. html = config.noEmoji ? html : emojify(html, config.nativeEmoji);
  7699. slugify.clear();
  7700. return html;
  7701. })(text);
  7702. var curFileName = this$1.router.parse().file;
  7703. if (isCached) {
  7704. this$1.toc = this$1.cacheTOC[curFileName];
  7705. } else {
  7706. this$1.cacheTOC[curFileName] = [].concat( this$1.toc );
  7707. }
  7708. return result;
  7709. };
  7710. };
  7711. /**
  7712. * Pulls content from file and renders inline on the page as a embedded item.
  7713. *
  7714. * This allows you to embed different file types on the returned
  7715. * page.
  7716. * The basic format is:
  7717. * ```
  7718. * [filename](_media/example.md ':include')
  7719. * ```
  7720. *
  7721. * @param {string} href The href to the file to embed in the page.
  7722. * @param {string} titleTitle of the link used to make the embed.
  7723. *
  7724. * @return {type} Return value description.
  7725. */
  7726. Compiler.prototype.compileEmbed = function compileEmbed (href, title) {
  7727. var ref = getAndRemoveConfig(title);
  7728. var str = ref.str;
  7729. var config = ref.config;
  7730. var embed;
  7731. title = str;
  7732. if (config.include) {
  7733. if (!isAbsolutePath(href)) {
  7734. href = getPath(
  7735. this.contentBase,
  7736. getParentPath(this.router.getCurrentPath()),
  7737. href
  7738. );
  7739. }
  7740. var media;
  7741. if (config.type && (media = compileMedia[config.type])) {
  7742. embed = media.call(this, href, title);
  7743. embed.type = config.type;
  7744. } else {
  7745. var type = 'code';
  7746. if (/\.(md|markdown)/.test(href)) {
  7747. type = 'markdown';
  7748. } else if (/\.mmd/.test(href)) {
  7749. type = 'mermaid';
  7750. } else if (/\.html?/.test(href)) {
  7751. type = 'iframe';
  7752. } else if (/\.(mp4|ogg)/.test(href)) {
  7753. type = 'video';
  7754. } else if (/\.mp3/.test(href)) {
  7755. type = 'audio';
  7756. }
  7757. embed = compileMedia[type].call(this, href, title);
  7758. embed.type = type;
  7759. }
  7760. embed.fragment = config.fragment;
  7761. return embed;
  7762. }
  7763. };
  7764. Compiler.prototype._matchNotCompileLink = function _matchNotCompileLink (link) {
  7765. var links = this.config.noCompileLinks || [];
  7766. for (var i = 0; i < links.length; i++) {
  7767. var n = links[i];
  7768. var re = cachedLinks[n] || (cachedLinks[n] = new RegExp(("^" + n + "$")));
  7769. if (re.test(link)) {
  7770. return link;
  7771. }
  7772. }
  7773. };
  7774. Compiler.prototype._initRenderer = function _initRenderer () {
  7775. var renderer = new marked_1.Renderer();
  7776. var ref = this;
  7777. var linkTarget = ref.linkTarget;
  7778. var linkRel = ref.linkRel;
  7779. var router = ref.router;
  7780. var contentBase = ref.contentBase;
  7781. var _self = this;
  7782. var origin = {};
  7783. /**
  7784. * Render anchor tag
  7785. * @link https://github.com/markedjs/marked#overriding-renderer-methods
  7786. * @param {String} text Text content
  7787. * @param {Number} level Type of heading (h<level> tag)
  7788. * @returns {String} Heading element
  7789. */
  7790. origin.heading = renderer.heading = function (text, level) {
  7791. var ref = getAndRemoveConfig(text);
  7792. var str = ref.str;
  7793. var config = ref.config;
  7794. var nextToc = { level: level, title: removeAtag(str) };
  7795. if (/<!-- {docsify-ignore} -->/g.test(str)) {
  7796. str = str.replace('<!-- {docsify-ignore} -->', '');
  7797. nextToc.title = removeAtag(str);
  7798. nextToc.ignoreSubHeading = true;
  7799. }
  7800. if (/{docsify-ignore}/g.test(str)) {
  7801. str = str.replace('{docsify-ignore}', '');
  7802. nextToc.title = removeAtag(str);
  7803. nextToc.ignoreSubHeading = true;
  7804. }
  7805. if (/<!-- {docsify-ignore-all} -->/g.test(str)) {
  7806. str = str.replace('<!-- {docsify-ignore-all} -->', '');
  7807. nextToc.title = removeAtag(str);
  7808. nextToc.ignoreAllSubs = true;
  7809. }
  7810. if (/{docsify-ignore-all}/g.test(str)) {
  7811. str = str.replace('{docsify-ignore-all}', '');
  7812. nextToc.title = removeAtag(str);
  7813. nextToc.ignoreAllSubs = true;
  7814. }
  7815. var slug = slugify(config.id || str);
  7816. var url = router.toURL(router.getCurrentPath(), { id: slug });
  7817. nextToc.slug = url;
  7818. _self.toc.push(nextToc);
  7819. return ("<h" + level + " id=\"" + slug + "\"><a href=\"" + url + "\" data-id=\"" + slug + "\" class=\"anchor\"><span>" + str + "</span></a></h" + level + ">");
  7820. };
  7821. origin.code = highlightCodeCompiler({ renderer: renderer });
  7822. origin.link = linkCompiler({
  7823. renderer: renderer,
  7824. router: router,
  7825. linkTarget: linkTarget,
  7826. linkRel: linkRel,
  7827. compilerClass: _self,
  7828. });
  7829. origin.paragraph = paragraphCompiler({ renderer: renderer });
  7830. origin.image = imageCompiler({ renderer: renderer, contentBase: contentBase, router: router });
  7831. origin.list = taskListCompiler({ renderer: renderer });
  7832. origin.listitem = taskListItemCompiler({ renderer: renderer });
  7833. renderer.origin = origin;
  7834. return renderer;
  7835. };
  7836. /**
  7837. * Compile sidebar
  7838. * @param {String} text Text content
  7839. * @param {Number} level Type of heading (h<level> tag)
  7840. * @returns {String} Sidebar element
  7841. */
  7842. Compiler.prototype.sidebar = function sidebar (text, level) {
  7843. var ref = this;
  7844. var toc = ref.toc;
  7845. var currentPath = this.router.getCurrentPath();
  7846. var html = '';
  7847. if (text) {
  7848. html = this.compile(text);
  7849. } else {
  7850. for (var i = 0; i < toc.length; i++) {
  7851. if (toc[i].ignoreSubHeading) {
  7852. var deletedHeaderLevel = toc[i].level;
  7853. toc.splice(i, 1);
  7854. // Remove headers who are under current header
  7855. for (
  7856. var j = i;
  7857. j < toc.length && deletedHeaderLevel < toc[j].level;
  7858. j++
  7859. ) {
  7860. toc.splice(j, 1) && j-- && i++;
  7861. }
  7862. i--;
  7863. }
  7864. }
  7865. var tree$1 = this.cacheTree[currentPath] || genTree(toc, level);
  7866. html = tree(tree$1, '<ul>{inner}</ul>');
  7867. this.cacheTree[currentPath] = tree$1;
  7868. }
  7869. return html;
  7870. };
  7871. /**
  7872. * Compile sub sidebar
  7873. * @param {Number} level Type of heading (h<level> tag)
  7874. * @returns {String} Sub-sidebar element
  7875. */
  7876. Compiler.prototype.subSidebar = function subSidebar(level) {
  7877. console.log('执行了渲染')
  7878. if (!level) {
  7879. this.toc = [];
  7880. return;
  7881. }
  7882. var currentPath = this.router.getCurrentPath();
  7883. var ref = this;
  7884. var cacheTree = ref.cacheTree;
  7885. var toc = ref.toc;
  7886. toc[0] && toc[0].ignoreAllSubs && toc.splice(0);
  7887. toc[0] && toc[0].level === 1 && toc.shift();
  7888. for (var i = 0; i < toc.length; i++) {
  7889. toc[i].ignoreSubHeading && toc.splice(i, 1) && i--;
  7890. }
  7891. var tree$1 = cacheTree[currentPath] || genTree(toc, level);
  7892. cacheTree[currentPath] = tree$1;
  7893. this.toc = [];
  7894. return tree(tree$1);
  7895. };
  7896. Compiler.prototype.header = function header (text, level) {
  7897. return this.heading(text, level);
  7898. };
  7899. Compiler.prototype.article = function article (text) {
  7900. return this.compile(text);
  7901. };
  7902. /**
  7903. * Compile cover page
  7904. * @param {Text} text Text content
  7905. * @returns {String} Cover page
  7906. */
  7907. Compiler.prototype.cover = function cover (text) {
  7908. var cacheToc = this.toc.slice();
  7909. var html = this.compile(text);
  7910. this.toc = cacheToc.slice();
  7911. return html;
  7912. };
  7913. var minIndent = function (string) {
  7914. var match = string.match(/^[ \t]*(?=\S)/gm);
  7915. if (!match) {
  7916. return 0;
  7917. }
  7918. return match.reduce(function (r, a) { return Math.min(r, a.length); }, Infinity);
  7919. };
  7920. var stripIndent = function (string) {
  7921. var indent = minIndent(string);
  7922. if (indent === 0) {
  7923. return string;
  7924. }
  7925. var regex = new RegExp(("^[ \\t]{" + indent + "}"), 'gm');
  7926. return string.replace(regex, '');
  7927. };
  7928. var cached$2 = {};
  7929. function walkFetchEmbed(ref, cb) {
  7930. var embedTokens = ref.embedTokens;
  7931. var compile = ref.compile;
  7932. var fetch = ref.fetch;
  7933. var token;
  7934. var step = 0;
  7935. var count = 1;
  7936. if (!embedTokens.length) {
  7937. return cb({});
  7938. }
  7939. while ((token = embedTokens[step++])) {
  7940. // eslint-disable-next-line no-shadow
  7941. var next = (function (token) {
  7942. return function (text) {
  7943. var embedToken;
  7944. if (text) {
  7945. if (token.embed.type === 'markdown') {
  7946. var path = token.embed.url.split('/');
  7947. path.pop();
  7948. path = path.join('/');
  7949. // Resolves relative links to absolute
  7950. text = text.replace(/\[([^[\]]+)\]\(([^)]+)\)/g, function (x) {
  7951. var linkBeginIndex = x.indexOf('(');
  7952. if (x.slice(linkBeginIndex, linkBeginIndex + 2) === '(.') {
  7953. return (
  7954. x.substring(0, linkBeginIndex) +
  7955. "(" + (window.location.protocol) + "//" + (window.location.host) + path + "/" +
  7956. x.substring(linkBeginIndex + 1, x.length - 1) +
  7957. ')'
  7958. );
  7959. }
  7960. return x;
  7961. });
  7962. // This may contain YAML front matter and will need to be stripped.
  7963. var frontMatterInstalled =
  7964. ($docsify.frontMatter || {}).installed || false;
  7965. if (frontMatterInstalled === true) {
  7966. text = $docsify.frontMatter.parseMarkdown(text);
  7967. }
  7968. embedToken = compile.lexer(text);
  7969. } else if (token.embed.type === 'code') {
  7970. if (token.embed.fragment) {
  7971. var fragment = token.embed.fragment;
  7972. var pattern = new RegExp(
  7973. ("(?:###|\\/\\/\\/)\\s*\\[" + fragment + "\\]([\\s\\S]*)(?:###|\\/\\/\\/)\\s*\\[" + fragment + "\\]")
  7974. );
  7975. text = stripIndent((text.match(pattern) || [])[1] || '').trim();
  7976. }
  7977. embedToken = compile.lexer(
  7978. '```' +
  7979. token.embed.lang +
  7980. '\n' +
  7981. text.replace(/`/g, '@DOCSIFY_QM@') +
  7982. '\n```\n'
  7983. );
  7984. } else if (token.embed.type === 'mermaid') {
  7985. embedToken = [
  7986. { type: 'html', text: ("<div class=\"mermaid\">\n" + text + "\n</div>") } ];
  7987. embedToken.links = {};
  7988. } else {
  7989. embedToken = [{ type: 'html', text: text }];
  7990. embedToken.links = {};
  7991. }
  7992. }
  7993. cb({ token: token, embedToken: embedToken });
  7994. if (++count >= step) {
  7995. cb({});
  7996. }
  7997. };
  7998. })(token);
  7999. if (token.embed.url) {
  8000. {
  8001. get(token.embed.url).then(next);
  8002. }
  8003. } else {
  8004. next(token.embed.html);
  8005. }
  8006. }
  8007. }
  8008. function prerenderEmbed(ref, done) {
  8009. var compiler = ref.compiler;
  8010. var raw = ref.raw; if ( raw === void 0 ) raw = '';
  8011. var fetch = ref.fetch;
  8012. var hit = cached$2[raw];
  8013. if (hit) {
  8014. var copy = hit.slice();
  8015. copy.links = hit.links;
  8016. return done(copy);
  8017. }
  8018. var compile = compiler._marked;
  8019. var tokens = compile.lexer(raw);
  8020. var embedTokens = [];
  8021. var linkRE = compile.Lexer.rules.inline.link;
  8022. var links = tokens.links;
  8023. tokens.forEach(function (token, index) {
  8024. if (token.type === 'paragraph') {
  8025. token.text = token.text.replace(
  8026. new RegExp(linkRE.source, 'g'),
  8027. function (src, filename, href, title) {
  8028. var embed = compiler.compileEmbed(href, title);
  8029. if (embed) {
  8030. embedTokens.push({
  8031. index: index,
  8032. embed: embed,
  8033. });
  8034. }
  8035. return src;
  8036. }
  8037. );
  8038. }
  8039. });
  8040. // keep track of which tokens have been embedded so far
  8041. // so that we know where to insert the embedded tokens as they
  8042. // are returned
  8043. var moves = [];
  8044. walkFetchEmbed({ compile: compile, embedTokens: embedTokens, fetch: fetch }, function (ref) {
  8045. var embedToken = ref.embedToken;
  8046. var token = ref.token;
  8047. if (token) {
  8048. // iterate through the array of previously inserted tokens
  8049. // to determine where the current embedded tokens should be inserted
  8050. var index = token.index;
  8051. moves.forEach(function (pos) {
  8052. if (index > pos.start) {
  8053. index += pos.length;
  8054. }
  8055. });
  8056. merge(links, embedToken.links);
  8057. tokens = tokens
  8058. .slice(0, index)
  8059. .concat(embedToken, tokens.slice(index + 1));
  8060. moves.push({ start: index, length: embedToken.length - 1 });
  8061. } else {
  8062. cached$2[raw] = tokens.concat();
  8063. tokens.links = cached$2[raw].links = links;
  8064. done(tokens);
  8065. }
  8066. });
  8067. }
  8068. /* eslint-disable no-unused-vars */
  8069. var vueGlobalData;
  8070. function executeScript() {
  8071. var script = findAll('.markdown-section>script')
  8072. .filter(function (s) { return !/template/.test(s.type); })[0];
  8073. if (!script) {
  8074. return false;
  8075. }
  8076. var code = script.innerText.trim();
  8077. if (!code) {
  8078. return false;
  8079. }
  8080. new Function(code)();
  8081. }
  8082. function formatUpdated(html, updated, fn) {
  8083. updated =
  8084. typeof fn === 'function'
  8085. ? fn(updated)
  8086. : typeof fn === 'string'
  8087. ? tinydate(fn)(new Date(updated))
  8088. : updated;
  8089. return html.replace(/{docsify-updated}/g, updated);
  8090. }
  8091. function renderMain(html) {
  8092. var docsifyConfig = this.config;
  8093. var markdownElm = find('.markdown-section');
  8094. var vueVersion =
  8095. 'Vue' in window &&
  8096. window.Vue.version &&
  8097. Number(window.Vue.version.charAt(0));
  8098. var isMountedVue = function (elm) {
  8099. var isVue2 = Boolean(elm.__vue__ && elm.__vue__._isVue);
  8100. var isVue3 = Boolean(elm._vnode && elm._vnode.__v_skip);
  8101. return isVue2 || isVue3;
  8102. };
  8103. if (!html) {
  8104. html = '<h1>404 - Not found</h1>';
  8105. }
  8106. if ('Vue' in window) {
  8107. var mountedElms = findAll('.markdown-section > *')
  8108. .filter(function (elm) { return isMountedVue(elm); });
  8109. // Destroy/unmount existing Vue instances
  8110. for (var i = 0, list = mountedElms; i < list.length; i += 1) {
  8111. var mountedElm = list[i];
  8112. if (vueVersion === 2) {
  8113. mountedElm.__vue__.$destroy();
  8114. } else if (vueVersion === 3) {
  8115. mountedElm.__vue_app__.unmount();
  8116. }
  8117. }
  8118. }
  8119. this._renderTo(markdownElm, html);
  8120. // Render sidebar with the TOC
  8121. !docsifyConfig.loadSidebar && this._renderSidebar();
  8122. // Execute markdown <script>
  8123. if (
  8124. docsifyConfig.executeScript ||
  8125. ('Vue' in window && docsifyConfig.executeScript !== false)
  8126. ) {
  8127. executeScript();
  8128. }
  8129. // Handle Vue content not mounted by markdown <script>
  8130. if ('Vue' in window) {
  8131. var vueMountData = [];
  8132. var vueComponentNames = Object.keys(docsifyConfig.vueComponents || {});
  8133. // Register global vueComponents
  8134. if (vueVersion === 2 && vueComponentNames.length) {
  8135. vueComponentNames.forEach(function (name) {
  8136. var isNotRegistered = !window.Vue.options.components[name];
  8137. if (isNotRegistered) {
  8138. window.Vue.component(name, docsifyConfig.vueComponents[name]);
  8139. }
  8140. });
  8141. }
  8142. // Store global data() return value as shared data object
  8143. if (
  8144. !vueGlobalData &&
  8145. docsifyConfig.vueGlobalOptions &&
  8146. typeof docsifyConfig.vueGlobalOptions.data === 'function'
  8147. ) {
  8148. vueGlobalData = docsifyConfig.vueGlobalOptions.data();
  8149. }
  8150. // vueMounts
  8151. vueMountData.push.apply(
  8152. vueMountData, Object.keys(docsifyConfig.vueMounts || {})
  8153. .map(function (cssSelector) { return [
  8154. find(markdownElm, cssSelector),
  8155. docsifyConfig.vueMounts[cssSelector] ]; })
  8156. .filter(function (ref) {
  8157. var elm = ref[0];
  8158. var vueConfig = ref[1];
  8159. return elm;
  8160. })
  8161. );
  8162. // Template syntax, vueComponents, vueGlobalOptions
  8163. if (docsifyConfig.vueGlobalOptions || vueComponentNames.length) {
  8164. var reHasBraces = /{{2}[^{}]*}{2}/;
  8165. // Matches Vue full and shorthand syntax as attributes in HTML tags.
  8166. //
  8167. // Full syntax examples:
  8168. // v-foo, v-foo[bar], v-foo-bar, v-foo:bar-baz.prop
  8169. //
  8170. // Shorthand syntax examples:
  8171. // @foo, @foo.bar, @foo.bar.baz, @[foo], :foo, :[foo]
  8172. //
  8173. // Markup examples:
  8174. // <div v-html>{{ html }}</div>
  8175. // <div v-text="msg"></div>
  8176. // <div v-bind:text-content.prop="text">
  8177. // <button v-on:click="doThis"></button>
  8178. // <button v-on:click.once="doThis"></button>
  8179. // <button v-on:[event]="doThis"></button>
  8180. // <button @click.stop.prevent="doThis">
  8181. // <a :href="url">
  8182. // <a :[key]="url">
  8183. var reHasDirective = /<[^>/]+\s([@:]|v-)[\w-:.[\]]+[=>\s]/;
  8184. vueMountData.push.apply(
  8185. vueMountData, findAll('.markdown-section > *')
  8186. // Remove duplicates
  8187. .filter(function (elm) { return !vueMountData.some(function (ref) {
  8188. var e = ref[0];
  8189. var c = ref[1];
  8190. return e === elm;
  8191. }); })
  8192. // Detect Vue content
  8193. .filter(function (elm) {
  8194. var isVueMount =
  8195. // is a component
  8196. elm.tagName.toLowerCase() in
  8197. (docsifyConfig.vueComponents || {}) ||
  8198. // has a component(s)
  8199. elm.querySelector(vueComponentNames.join(',') || null) ||
  8200. // has curly braces
  8201. reHasBraces.test(elm.outerHTML) ||
  8202. // has content directive
  8203. reHasDirective.test(elm.outerHTML);
  8204. return isVueMount;
  8205. })
  8206. .map(function (elm) {
  8207. // Clone global configuration
  8208. var vueConfig = merge({}, docsifyConfig.vueGlobalOptions || {});
  8209. // Replace vueGlobalOptions data() return value with shared data object.
  8210. // This provides a global store for all Vue instances that receive
  8211. // vueGlobalOptions as their configuration.
  8212. if (vueGlobalData) {
  8213. vueConfig.data = function () {
  8214. return vueGlobalData;
  8215. };
  8216. }
  8217. return [elm, vueConfig];
  8218. })
  8219. );
  8220. }
  8221. // Mount
  8222. for (var i$1 = 0, list$1 = vueMountData; i$1 < list$1.length; i$1 += 1) {
  8223. var ref = list$1[i$1];
  8224. var mountElm = ref[0];
  8225. var vueConfig = ref[1];
  8226. var isVueAttr = 'data-isvue';
  8227. var isSkipElm =
  8228. // Is an invalid tag
  8229. mountElm.matches('pre, script') ||
  8230. // Is a mounted instance
  8231. isMountedVue(mountElm) ||
  8232. // Has mounted instance(s)
  8233. mountElm.querySelector(("[" + isVueAttr + "]"));
  8234. if (!isSkipElm) {
  8235. mountElm.setAttribute(isVueAttr, '');
  8236. if (vueVersion === 2) {
  8237. vueConfig.el = undefined;
  8238. new window.Vue(vueConfig).$mount(mountElm);
  8239. } else if (vueVersion === 3) {
  8240. var app = window.Vue.createApp(vueConfig);
  8241. // Register global vueComponents
  8242. vueComponentNames.forEach(function (name) {
  8243. var config = docsifyConfig.vueComponents[name];
  8244. app.component(name, config);
  8245. });
  8246. app.mount(mountElm);
  8247. }
  8248. }
  8249. }
  8250. }
  8251. }
  8252. function renderNameLink(vm) {
  8253. var el = getNode('.app-name-link');
  8254. var nameLink = vm.config.nameLink;
  8255. var path = vm.route.path;
  8256. if (!el) {
  8257. return;
  8258. }
  8259. if (isPrimitive(vm.config.nameLink)) {
  8260. el.setAttribute('href', nameLink);
  8261. } else if (typeof nameLink === 'object') {
  8262. var match = Object.keys(nameLink).filter(
  8263. function (key) { return path.indexOf(key) > -1; }
  8264. )[0];
  8265. el.setAttribute('href', nameLink[match]);
  8266. }
  8267. }
  8268. /** @typedef {import('../Docsify').Constructor} Constructor */
  8269. /**
  8270. * @template {!Constructor} T
  8271. * @param {T} Base - The class to extend
  8272. */
  8273. function Render(Base) {
  8274. return /*@__PURE__*/(function (Base) {
  8275. function Render () {
  8276. Base.apply(this, arguments);
  8277. }
  8278. if ( Base ) Render.__proto__ = Base;
  8279. Render.prototype = Object.create( Base && Base.prototype );
  8280. Render.prototype.constructor = Render;
  8281. Render.prototype._renderTo = function _renderTo (el, content, replace) {
  8282. var node = getNode(el);
  8283. if (node) {
  8284. node[replace ? 'outerHTML' : 'innerHTML'] = content;
  8285. }
  8286. };
  8287. Render.prototype._renderSidebar = function _renderSidebar(text) {
  8288. console.log('text', text);
  8289. var ref = this.config;
  8290. var maxLevel = ref.maxLevel;
  8291. var subMaxLevel = ref.subMaxLevel;
  8292. var loadSidebar = ref.loadSidebar;
  8293. var hideSidebar = ref.hideSidebar;
  8294. if (hideSidebar) {
  8295. // FIXME : better styling solution
  8296. [
  8297. document.querySelector('aside.sidebar'),
  8298. document.querySelector('button.sidebar-toggle') ]
  8299. .filter(function (e) { return !!e; })
  8300. .forEach(function (node) { return node.parentNode.removeChild(node); });
  8301. document.querySelector('section.content').style.right = 'unset';
  8302. document.querySelector('section.content').style.left = 'unset';
  8303. document.querySelector('section.content').style.position = 'relative';
  8304. document.querySelector('section.content').style.width = '100%';
  8305. return null;
  8306. }
  8307. this._renderTo('.sidebar-nav', this.compiler.sidebar(text, maxLevel));
  8308. var activeEl = getAndActive(this.router, '.sidebar-nav', true, true);
  8309. if (loadSidebar && activeEl) {
  8310. this.compiler.subSidebar(subMaxLevel);
  8311. } else {
  8312. // Reset toc
  8313. this.compiler.subSidebar();
  8314. }
  8315. // Bind event
  8316. this._bindEventOnRendered(activeEl);
  8317. };
  8318. Render.prototype._bindEventOnRendered = function _bindEventOnRendered (activeEl) {
  8319. var ref = this.config;
  8320. var autoHeader = ref.autoHeader;
  8321. scrollActiveSidebar(this.router);
  8322. if (autoHeader && activeEl) {
  8323. var main = getNode('#main');
  8324. var firstNode = main.children[0];
  8325. if (firstNode && firstNode.tagName !== 'H1') {
  8326. var h1 = this.compiler.header(activeEl.innerText, 1);
  8327. var wrapper = create('div', h1);
  8328. before(main, wrapper.children[0]);
  8329. }
  8330. }
  8331. };
  8332. Render.prototype._renderNav = function _renderNav (text) {
  8333. text && this._renderTo('nav', this.compiler.compile(text));
  8334. if (this.config.loadNavbar) {
  8335. getAndActive(this.router, 'nav');
  8336. }
  8337. };
  8338. Render.prototype._renderMain = function _renderMain (text, opt, next) {
  8339. var this$1 = this;
  8340. if ( opt === void 0 ) opt = {};
  8341. if (!text) {
  8342. return renderMain.call(this, text);
  8343. }
  8344. this.callHook('beforeEach', text, function (result) {
  8345. var html;
  8346. var callback = function () {
  8347. if (opt.updatedAt) {
  8348. html = formatUpdated(
  8349. html,
  8350. opt.updatedAt,
  8351. this$1.config.formatUpdated
  8352. );
  8353. }
  8354. this$1.callHook('afterEach', html, function (hookData) {
  8355. renderMain.call(this$1, hookData);
  8356. next();
  8357. });
  8358. };
  8359. if (this$1.isHTML) {
  8360. html = this$1.result = text;
  8361. callback();
  8362. } else {
  8363. prerenderEmbed(
  8364. {
  8365. compiler: this$1.compiler,
  8366. raw: result,
  8367. },
  8368. function (tokens) {
  8369. html = this$1.compiler.compile(tokens);
  8370. callback();
  8371. }
  8372. );
  8373. }
  8374. });
  8375. };
  8376. Render.prototype._renderCover = function _renderCover (text, coverOnly) {
  8377. var el = getNode('.cover');
  8378. toggleClass(
  8379. getNode('main'),
  8380. coverOnly ? 'add' : 'remove',
  8381. 'hidden'
  8382. );
  8383. if (!text) {
  8384. toggleClass(el, 'remove', 'show');
  8385. return;
  8386. }
  8387. toggleClass(el, 'add', 'show');
  8388. var html = this.coverIsHTML ? text : this.compiler.cover(text);
  8389. var m = html
  8390. .trim()
  8391. .match('<p><img.*?data-origin="(.*?)"[^a]+alt="(.*?)">([^<]*?)</p>$');
  8392. if (m) {
  8393. if (m[2] === 'color') {
  8394. el.style.background = m[1] + (m[3] || '');
  8395. } else {
  8396. var path = m[1];
  8397. toggleClass(el, 'add', 'has-mask');
  8398. if (!isAbsolutePath(m[1])) {
  8399. path = getPath(this.router.getBasePath(), m[1]);
  8400. }
  8401. el.style.backgroundImage = "url(" + path + ")";
  8402. el.style.backgroundSize = 'cover';
  8403. el.style.backgroundPosition = 'center center';
  8404. }
  8405. html = html.replace(m[0], '');
  8406. }
  8407. this._renderTo('.cover-main', html);
  8408. sticky();
  8409. };
  8410. Render.prototype._updateRender = function _updateRender () {
  8411. // Render name link
  8412. renderNameLink(this);
  8413. };
  8414. Render.prototype.initRender = function initRender () {
  8415. var config = this.config;
  8416. // Init markdown compiler
  8417. this.compiler = new Compiler(config, this.router);
  8418. {
  8419. /* eslint-disable-next-line camelcase */
  8420. window.__current_docsify_compiler__ = this.compiler;
  8421. }
  8422. var id = config.el || '#app';
  8423. var navEl = find('nav') || create('nav');
  8424. var el = find(id);
  8425. var html = '';
  8426. var navAppendToTarget = body;
  8427. if (el) {
  8428. if (config.repo) {
  8429. html += corner(config.repo, config.cornerExternalLinkTarget);
  8430. }
  8431. if (config.coverpage) {
  8432. html += cover();
  8433. }
  8434. if (config.logo) {
  8435. var isBase64 = /^data:image/.test(config.logo);
  8436. var isExternal = /(?:http[s]?:)?\/\//.test(config.logo);
  8437. var isRelative = /^\./.test(config.logo);
  8438. if (!isBase64 && !isExternal && !isRelative) {
  8439. config.logo = getPath(this.router.getBasePath(), config.logo);
  8440. }
  8441. }
  8442. html += main(config);
  8443. // Render main app
  8444. this._renderTo(el, html, true);
  8445. } else {
  8446. this.rendered = true;
  8447. }
  8448. if (config.mergeNavbar && isMobile) {
  8449. navAppendToTarget = find('.sidebar');
  8450. } else {
  8451. navEl.classList.add('app-nav');
  8452. if (!config.repo) {
  8453. navEl.classList.add('no-badge');
  8454. }
  8455. }
  8456. // Add nav
  8457. if (config.loadNavbar) {
  8458. before(navAppendToTarget, navEl);
  8459. }
  8460. if (config.themeColor) {
  8461. $.head.appendChild(
  8462. create('div', theme(config.themeColor)).firstElementChild
  8463. );
  8464. // Polyfll
  8465. cssVars(config.themeColor);
  8466. }
  8467. this._updateRender();
  8468. toggleClass(body, 'ready');
  8469. };
  8470. return Render;
  8471. }(Base));
  8472. }
  8473. /* eslint-disable no-unused-vars */
  8474. function loadNested(path, qs, file, next, vm, first) {
  8475. path = first ? path : path.replace(/\/$/, '');
  8476. path = getParentPath(path);
  8477. if (!path) {
  8478. return;
  8479. }
  8480. get(
  8481. vm.router.getFile(path + file) + qs,
  8482. false,
  8483. vm.config.requestHeaders
  8484. ).then(next, function (_) { return loadNested(path, qs, file, next, vm); });
  8485. }
  8486. /** @typedef {import('../Docsify').Constructor} Constructor */
  8487. /**
  8488. * @template {!Constructor} T
  8489. * @param {T} Base - The class to extend
  8490. */
  8491. function Fetch(Base) {
  8492. var last;
  8493. var abort = function () { return last && last.abort && last.abort(); };
  8494. var request = function (url, hasbar, requestHeaders) {
  8495. abort();
  8496. last = get(url, true, requestHeaders);
  8497. return last;
  8498. };
  8499. var get404Path = function (path, config) {
  8500. var notFoundPage = config.notFoundPage;
  8501. var ext = config.ext;
  8502. var defaultPath = '_404' + (ext || '.md');
  8503. var key;
  8504. var path404;
  8505. switch (typeof notFoundPage) {
  8506. case 'boolean':
  8507. path404 = defaultPath;
  8508. break;
  8509. case 'string':
  8510. path404 = notFoundPage;
  8511. break;
  8512. case 'object':
  8513. key = Object.keys(notFoundPage)
  8514. .sort(function (a, b) { return b.length - a.length; })
  8515. .filter(function (k) { return path.match(new RegExp('^' + k)); })[0];
  8516. path404 = (key && notFoundPage[key]) || defaultPath;
  8517. break;
  8518. }
  8519. return path404;
  8520. };
  8521. return /*@__PURE__*/(function (Base) {
  8522. function Fetch () {
  8523. Base.apply(this, arguments);
  8524. }
  8525. if ( Base ) Fetch.__proto__ = Base;
  8526. Fetch.prototype = Object.create( Base && Base.prototype );
  8527. Fetch.prototype.constructor = Fetch;
  8528. Fetch.prototype._loadSideAndNav = function _loadSideAndNav (path, qs, loadSidebar, cb) {
  8529. var this$1 = this;
  8530. return function () {
  8531. if (!loadSidebar) {
  8532. return cb();
  8533. }
  8534. var fn = function (result) {
  8535. console.log('loadSidebar', result);
  8536. this$1._renderSidebar(result);
  8537. cb();
  8538. };
  8539. // Load sidebar
  8540. loadNested(path, qs, loadSidebar, fn, this$1, true);
  8541. };
  8542. };
  8543. Fetch.prototype._fetch = function _fetch (cb) {
  8544. var this$1 = this;
  8545. if ( cb === void 0 ) cb = noop;
  8546. var ref = this.route;
  8547. var query = ref.query;
  8548. var ref$1 = this.route;
  8549. var path = ref$1.path;
  8550. // Prevent loading remote content via URL hash
  8551. // Ex: https://foo.com/#//bar.com/file.md
  8552. if (isExternal(path)) {
  8553. history.replaceState(null, '', '#');
  8554. this.router.normalize();
  8555. } else {
  8556. var qs = stringifyQuery(query, ['id']);
  8557. var ref$2 = this.config;
  8558. var loadNavbar = ref$2.loadNavbar;
  8559. var requestHeaders = ref$2.requestHeaders;
  8560. var loadSidebar = ref$2.loadSidebar;
  8561. // Abort last request
  8562. var file = this.router.getFile(path);
  8563. this.isRemoteUrl = isExternal(file);
  8564. // Current page is html
  8565. this.isHTML = /\.html$/g.test(file);
  8566. // create a handler that should be called if content was fetched successfully
  8567. var contentFetched = function (text, opt) {
  8568. this$1._renderMain(
  8569. text,
  8570. opt,
  8571. this$1._loadSideAndNav(path, qs, loadSidebar, cb)
  8572. );
  8573. };
  8574. // and a handler that is called if content failed to fetch
  8575. var contentFailedToFetch = function (_) {
  8576. this$1._fetchFallbackPage(path, qs, cb) || this$1._fetch404(file, qs, cb);
  8577. };
  8578. // attempt to fetch content from a virtual route, and fallback to fetching the actual file
  8579. if (!this.isRemoteUrl) {
  8580. this.matchVirtualRoute(path).then(function (contents) {
  8581. if (typeof contents === 'string') {
  8582. contentFetched(contents);
  8583. } else {
  8584. request(file + qs, true, requestHeaders).then(
  8585. contentFetched,
  8586. contentFailedToFetch
  8587. );
  8588. }
  8589. });
  8590. } else {
  8591. // if the requested url is not local, just fetch the file
  8592. request(file + qs, true, requestHeaders).then(
  8593. contentFetched,
  8594. contentFailedToFetch
  8595. );
  8596. }
  8597. // Load nav
  8598. loadNavbar &&
  8599. loadNested(
  8600. path,
  8601. qs,
  8602. loadNavbar,
  8603. function (text) { return this$1._renderNav(text); },
  8604. this,
  8605. true
  8606. );
  8607. }
  8608. };
  8609. Fetch.prototype._fetchCover = function _fetchCover () {
  8610. var this$1 = this;
  8611. var ref = this.config;
  8612. var coverpage = ref.coverpage;
  8613. var requestHeaders = ref.requestHeaders;
  8614. var query = this.route.query;
  8615. var root = getParentPath(this.route.path);
  8616. if (coverpage) {
  8617. var path = null;
  8618. var routePath = this.route.path;
  8619. if (typeof coverpage === 'string') {
  8620. if (routePath === '/') {
  8621. path = coverpage;
  8622. }
  8623. } else if (Array.isArray(coverpage)) {
  8624. path = coverpage.indexOf(routePath) > -1 && '_coverpage';
  8625. } else {
  8626. var cover = coverpage[routePath];
  8627. path = cover === true ? '_coverpage' : cover;
  8628. }
  8629. var coverOnly = Boolean(path) && this.config.onlyCover;
  8630. if (path) {
  8631. path = this.router.getFile(root + path);
  8632. this.coverIsHTML = /\.html$/g.test(path);
  8633. get(path + stringifyQuery(query, ['id']), false, requestHeaders).then(
  8634. function (text) { return this$1._renderCover(text, coverOnly); }
  8635. );
  8636. } else {
  8637. this._renderCover(null, coverOnly);
  8638. }
  8639. return coverOnly;
  8640. }
  8641. };
  8642. Fetch.prototype.$fetch = function $fetch (cb, $resetEvents) {
  8643. var this$1 = this;
  8644. if ( cb === void 0 ) cb = noop;
  8645. if ( $resetEvents === void 0 ) $resetEvents = this.$resetEvents.bind(this);
  8646. var done = function () {
  8647. this$1.callHook('doneEach');
  8648. cb();
  8649. };
  8650. var onlyCover = this._fetchCover();
  8651. if (onlyCover) {
  8652. done();
  8653. } else {
  8654. this._fetch(function () {
  8655. $resetEvents();
  8656. done();
  8657. });
  8658. }
  8659. };
  8660. Fetch.prototype._fetchFallbackPage = function _fetchFallbackPage (path, qs, cb) {
  8661. var this$1 = this;
  8662. if ( cb === void 0 ) cb = noop;
  8663. var ref = this.config;
  8664. var requestHeaders = ref.requestHeaders;
  8665. var fallbackLanguages = ref.fallbackLanguages;
  8666. var loadSidebar = ref.loadSidebar;
  8667. if (!fallbackLanguages) {
  8668. return false;
  8669. }
  8670. var local = path.split('/')[1];
  8671. if (fallbackLanguages.indexOf(local) === -1) {
  8672. return false;
  8673. }
  8674. var newPath = this.router.getFile(
  8675. path.replace(new RegExp(("^/" + local)), '')
  8676. );
  8677. var req = request(newPath + qs, true, requestHeaders);
  8678. req.then(
  8679. function (text, opt) { return this$1._renderMain(
  8680. text,
  8681. opt,
  8682. this$1._loadSideAndNav(path, qs, loadSidebar, cb)
  8683. ); },
  8684. function () { return this$1._fetch404(path, qs, cb); }
  8685. );
  8686. return true;
  8687. };
  8688. /**
  8689. * Load the 404 page
  8690. * @param {String} path URL to be loaded
  8691. * @param {*} qs TODO: define
  8692. * @param {Function} cb Callback
  8693. * @returns {Boolean} True if the requested page is not found
  8694. * @private
  8695. */
  8696. Fetch.prototype._fetch404 = function _fetch404 (path, qs, cb) {
  8697. var this$1 = this;
  8698. if ( cb === void 0 ) cb = noop;
  8699. var ref = this.config;
  8700. var loadSidebar = ref.loadSidebar;
  8701. var requestHeaders = ref.requestHeaders;
  8702. var notFoundPage = ref.notFoundPage;
  8703. var fnLoadSideAndNav = this._loadSideAndNav(path, qs, loadSidebar, cb);
  8704. if (notFoundPage) {
  8705. var path404 = get404Path(path, this.config);
  8706. request(this.router.getFile(path404), true, requestHeaders).then(
  8707. function (text, opt) { return this$1._renderMain(text, opt, fnLoadSideAndNav); },
  8708. function () { return this$1._renderMain(null, {}, fnLoadSideAndNav); }
  8709. );
  8710. return true;
  8711. }
  8712. this._renderMain(null, {}, fnLoadSideAndNav);
  8713. return false;
  8714. };
  8715. Fetch.prototype.initFetch = function initFetch () {
  8716. var this$1 = this;
  8717. var ref = this.config;
  8718. var loadSidebar = ref.loadSidebar;
  8719. // Server-Side Rendering
  8720. if (this.rendered) {
  8721. var activeEl = getAndActive(this.router, '.sidebar-nav', true, true);
  8722. if (loadSidebar && activeEl) {
  8723. activeEl.parentNode.innerHTML += window.__SUB_SIDEBAR__;
  8724. }
  8725. this._bindEventOnRendered(activeEl);
  8726. this.$resetEvents();
  8727. this.callHook('doneEach');
  8728. this.callHook('ready');
  8729. } else {
  8730. this.$fetch(function (_) { return this$1.callHook('ready'); });
  8731. }
  8732. };
  8733. return Fetch;
  8734. }(Base));
  8735. }
  8736. /** @typedef {import('../Docsify').Constructor} Constructor */
  8737. /**
  8738. * @template {!Constructor} T
  8739. * @param {T} Base - The class to extend
  8740. */
  8741. function Events(Base) {
  8742. return /*@__PURE__*/(function (Base) {
  8743. function Events () {
  8744. Base.apply(this, arguments);
  8745. }
  8746. if ( Base ) Events.__proto__ = Base;
  8747. Events.prototype = Object.create( Base && Base.prototype );
  8748. Events.prototype.constructor = Events;
  8749. Events.prototype.$resetEvents = function $resetEvents (source) {
  8750. var this$1 = this;
  8751. var ref = this.config;
  8752. var auto2top = ref.auto2top;
  8753. (function () {
  8754. // Rely on the browser's scroll auto-restoration when going back or forward
  8755. if (source === 'history') {
  8756. return;
  8757. }
  8758. // Scroll to ID if specified
  8759. if (this$1.route.query.id) {
  8760. scrollIntoView(this$1.route.path, this$1.route.query.id);
  8761. }
  8762. // Scroll to top if a link was clicked and auto2top is enabled
  8763. if (source === 'navigate') {
  8764. auto2top && scroll2Top(auto2top);
  8765. }
  8766. })();
  8767. if (this.config.loadNavbar) {
  8768. getAndActive(this.router, 'nav');
  8769. }
  8770. };
  8771. Events.prototype.initEvent = function initEvent () {
  8772. // Bind toggle button
  8773. btn('button.sidebar-toggle', this.router);
  8774. collapse('.sidebar', this.router);
  8775. // Bind sticky effect
  8776. if (this.config.coverpage) {
  8777. !isMobile && on('scroll', sticky);
  8778. } else {
  8779. body.classList.add('sticky');
  8780. }
  8781. };
  8782. return Events;
  8783. }(Base));
  8784. }
  8785. /**
  8786. * Adds beginning of input (^) and end of input ($) assertions if needed into a regex string
  8787. * @param {string} matcher the string to match
  8788. * @returns {string}
  8789. */
  8790. function makeExactMatcher(matcher) {
  8791. var matcherWithBeginningOfInput = startsWith(matcher, '^')
  8792. ? matcher
  8793. : ("^" + matcher);
  8794. var matcherWithBeginningAndEndOfInput = endsWith(
  8795. matcherWithBeginningOfInput,
  8796. '$'
  8797. )
  8798. ? matcherWithBeginningOfInput
  8799. : (matcherWithBeginningOfInput + "$");
  8800. return matcherWithBeginningAndEndOfInput;
  8801. }
  8802. /** @typedef {((value: any) => void) => void} OnNext */
  8803. /** @typedef {(value: any) => void} NextFunction */
  8804. /**
  8805. * Creates a pair of a function and an event emitter.
  8806. * When the function is called, the event emitter calls the given callback with the value that was passed to the function.
  8807. * @returns {[NextFunction, OnNext]}
  8808. */
  8809. function createNextFunction() {
  8810. var storedCb = function () { return null; };
  8811. function next(value) {
  8812. storedCb(value);
  8813. }
  8814. function onNext(cb) {
  8815. storedCb = cb;
  8816. }
  8817. return [next, onNext];
  8818. }
  8819. /** @typedef {import('../Docsify').Constructor} Constructor */
  8820. /** @typedef {Record<string, string | VirtualRouteHandler>} VirtualRoutesMap */
  8821. /** @typedef {(route: string, match: RegExpMatchArray | null) => string | void | Promise<string | void> } VirtualRouteHandler */
  8822. /**
  8823. * @template {!Constructor} T
  8824. * @param {T} Base - The class to extend
  8825. */
  8826. function VirtualRoutes(Base) {
  8827. return /*@__PURE__*/(function (Base) {
  8828. function VirtualRoutes () {
  8829. Base.apply(this, arguments);
  8830. }
  8831. if ( Base ) VirtualRoutes.__proto__ = Base;
  8832. VirtualRoutes.prototype = Object.create( Base && Base.prototype );
  8833. VirtualRoutes.prototype.constructor = VirtualRoutes;
  8834. VirtualRoutes.prototype.routes = function routes () {
  8835. return this.config.routes || {};
  8836. };
  8837. /**
  8838. * Attempts to match the given path with a virtual route.
  8839. * @param {string} path the path of the route to match
  8840. * @returns {Promise<string | null>} resolves to string if route was matched, otherwise null
  8841. */
  8842. VirtualRoutes.prototype.matchVirtualRoute = function matchVirtualRoute (path) {
  8843. var virtualRoutes = this.routes();
  8844. var virtualRoutePaths = Object.keys(virtualRoutes);
  8845. var done = function () { return null; };
  8846. /**
  8847. * This is a tail recursion that iterates over all the available routes.
  8848. * It can result in one of two ways:
  8849. * 1. Call itself (essentially reviewing the next route)
  8850. * 2. Call the "done" callback with the result (either the contents, or "null" if no match was found)
  8851. */
  8852. function asyncMatchNextRoute() {
  8853. var virtualRoutePath = virtualRoutePaths.shift();
  8854. if (!virtualRoutePath) {
  8855. return done(null);
  8856. }
  8857. var matcher = makeExactMatcher(virtualRoutePath);
  8858. var matched = path.match(matcher);
  8859. if (!matched) {
  8860. return asyncMatchNextRoute();
  8861. }
  8862. var virtualRouteContentOrFn = virtualRoutes[virtualRoutePath];
  8863. if (typeof virtualRouteContentOrFn === 'string') {
  8864. var contents = virtualRouteContentOrFn;
  8865. return done(contents);
  8866. }
  8867. if (typeof virtualRouteContentOrFn === 'function') {
  8868. var fn = virtualRouteContentOrFn;
  8869. var ref = createNextFunction();
  8870. var next = ref[0];
  8871. var onNext = ref[1];
  8872. onNext(function (contents) {
  8873. if (typeof contents === 'string') {
  8874. return done(contents);
  8875. } else if (contents === false) {
  8876. return done(null);
  8877. } else {
  8878. return asyncMatchNextRoute();
  8879. }
  8880. });
  8881. if (fn.length <= 2) {
  8882. var returnedValue = fn(path, matched);
  8883. return next(returnedValue);
  8884. } else {
  8885. return fn(path, matched, next);
  8886. }
  8887. }
  8888. return asyncMatchNextRoute();
  8889. }
  8890. return {
  8891. then: function (cb) {
  8892. done = cb;
  8893. asyncMatchNextRoute();
  8894. },
  8895. };
  8896. };
  8897. return VirtualRoutes;
  8898. }(Base));
  8899. }
  8900. var util = /*#__PURE__*/Object.freeze({
  8901. __proto__: null,
  8902. cached: cached,
  8903. hyphenate: hyphenate,
  8904. hasOwn: hasOwn,
  8905. merge: merge,
  8906. isPrimitive: isPrimitive,
  8907. noop: noop,
  8908. isFn: isFn,
  8909. isExternal: isExternal,
  8910. inBrowser: inBrowser,
  8911. isMobile: isMobile,
  8912. supportsPushState: supportsPushState,
  8913. parseQuery: parseQuery,
  8914. stringifyQuery: stringifyQuery,
  8915. isAbsolutePath: isAbsolutePath,
  8916. removeParams: removeParams,
  8917. getParentPath: getParentPath,
  8918. cleanPath: cleanPath,
  8919. resolvePath: resolvePath,
  8920. getPath: getPath,
  8921. replaceSlug: replaceSlug
  8922. });
  8923. // TODO This is deprecated, kept for backwards compatibility. Remove in next
  8924. // major release. We'll tell people to get everything from the DOCSIFY global
  8925. // when using the global build, but we'll highly recommend for them to import
  8926. // from the ESM build (f.e. lib/docsify.esm.js and lib/docsify.min.esm.js).
  8927. function initGlobalAPI () {
  8928. window.Docsify = {
  8929. util: util,
  8930. dom: dom,
  8931. get: get,
  8932. slugify: slugify,
  8933. version: '4.13.1',
  8934. };
  8935. window.DocsifyCompiler = Compiler;
  8936. window.marked = marked_1;
  8937. window.Prism = prism;
  8938. }
  8939. /** @typedef {import('../Docsify').Constructor} Constructor */
  8940. /**
  8941. * @template {!Constructor} T
  8942. * @param {T} Base - The class to extend
  8943. */
  8944. function Lifecycle(Base) {
  8945. return /*@__PURE__*/(function (Base) {
  8946. function Lifecycle () {
  8947. Base.apply(this, arguments);
  8948. }
  8949. if ( Base ) Lifecycle.__proto__ = Base;
  8950. Lifecycle.prototype = Object.create( Base && Base.prototype );
  8951. Lifecycle.prototype.constructor = Lifecycle;
  8952. Lifecycle.prototype.initLifecycle = function initLifecycle () {
  8953. var this$1 = this;
  8954. var hooks = [
  8955. 'init',
  8956. 'mounted',
  8957. 'beforeEach',
  8958. 'afterEach',
  8959. 'doneEach',
  8960. 'ready' ];
  8961. this._hooks = {};
  8962. this._lifecycle = {};
  8963. hooks.forEach(function (hook) {
  8964. var arr = (this$1._hooks[hook] = []);
  8965. this$1._lifecycle[hook] = function (fn) { return arr.push(fn); };
  8966. });
  8967. };
  8968. Lifecycle.prototype.callHook = function callHook (hookName, data, next) {
  8969. if ( next === void 0 ) next = noop;
  8970. var queue = this._hooks[hookName];
  8971. var catchPluginErrors = this.config.catchPluginErrors;
  8972. var step = function (index) {
  8973. var hookFn = queue[index];
  8974. if (index >= queue.length) {
  8975. next(data);
  8976. } else if (typeof hookFn === 'function') {
  8977. var errTitle = 'Docsify plugin error';
  8978. if (hookFn.length === 2) {
  8979. try {
  8980. hookFn(data, function (result) {
  8981. data = result;
  8982. step(index + 1);
  8983. });
  8984. } catch (err) {
  8985. if (catchPluginErrors) {
  8986. console.error(errTitle, err);
  8987. } else {
  8988. throw err;
  8989. }
  8990. step(index + 1);
  8991. }
  8992. } else {
  8993. try {
  8994. var result = hookFn(data);
  8995. data = result === undefined ? data : result;
  8996. step(index + 1);
  8997. } catch (err) {
  8998. if (catchPluginErrors) {
  8999. console.error(errTitle, err);
  9000. } else {
  9001. throw err;
  9002. }
  9003. step(index + 1);
  9004. }
  9005. }
  9006. } else {
  9007. step(index + 1);
  9008. }
  9009. };
  9010. step(0);
  9011. };
  9012. return Lifecycle;
  9013. }(Base));
  9014. }
  9015. /** @typedef {new (...args: any[]) => any} Constructor */
  9016. // eslint-disable-next-line new-cap
  9017. var Docsify = /*@__PURE__*/(function (superclass) {
  9018. function Docsify() {
  9019. superclass.call(this);
  9020. this.config = config(this);
  9021. this.initLifecycle(); // Init hooks
  9022. this.initPlugin(); // Install plugins
  9023. this.callHook('init');
  9024. this.initRouter(); // Add router
  9025. this.initRender(); // Render base DOM
  9026. this.initEvent(); // Bind events
  9027. this.initFetch(); // Fetch data
  9028. this.callHook('mounted');
  9029. }
  9030. if ( superclass ) Docsify.__proto__ = superclass;
  9031. Docsify.prototype = Object.create( superclass && superclass.prototype );
  9032. Docsify.prototype.constructor = Docsify;
  9033. Docsify.prototype.initPlugin = function initPlugin () {
  9034. var this$1 = this;
  9035. [].concat(this.config.plugins).forEach(function (fn) {
  9036. try {
  9037. isFn(fn) && fn(this$1._lifecycle, this$1);
  9038. } catch (err) {
  9039. if (this$1.config.catchPluginErrors) {
  9040. var errTitle = 'Docsify plugin error';
  9041. console.error(errTitle, err);
  9042. } else {
  9043. throw err;
  9044. }
  9045. }
  9046. });
  9047. };
  9048. return Docsify;
  9049. }(Fetch(
  9050. // eslint-disable-next-line new-cap
  9051. Events(Render(VirtualRoutes(Router(Lifecycle(Object)))))
  9052. )));
  9053. /**
  9054. * Global API
  9055. */
  9056. initGlobalAPI();
  9057. /**
  9058. * Run Docsify
  9059. */
  9060. // eslint-disable-next-line no-unused-vars
  9061. documentReady(function (_) { return new Docsify(); });
  9062. }());