550 lines
193 KiB
JavaScript
Raw Normal View History

2025-06-06 15:17:30 +08:00
module.exports = (function() {
var __MODS__ = {};
var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; };
var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; };
var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } };
var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; };
__DEFINE__(1743575529696, function(require, module, exports) {
const md = require('./parse/markdown/index'),
parse = require('./parse/index')
module.exports = (str,type,option)=>{
option = option || {};
let result;
switch (type) {
case 'markdown':
result = parse(md(str),option);
break;
case 'html':
result = parse(str,option);
break;
default:
throw new Error('Invalid type, only markdown and html are supported');
break;
};
return result;
};
}, function(modId) {var map = {"./parse/markdown/index":1743575529697,"./parse/index":1743575529702}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529697, function(require, module, exports) {
let hljs;
hljs = require('../highlight/index');
const config = require('../../config'),
mdOption = (()=>{
let result = {
html: true,
xhtmlOut: true,
typographer: true,
breaks: true,
};
if(config.highlight.length && hljs){
result.highlight = (code,lang,callback)=>{
let lineLen = code.split(/\r|\n/ig).length,
result = hljs.highlightAuto(code).value;
result = result.replace(/\r|\n/g,'<br/>').replace(/ /g,'&nbsp;').replace(/\t/g,'&nbsp;&nbsp;&nbsp;&nbsp;');
if(config.showLineNumber){
let lineStr = (()=>{
let str = `<ul class="h2w__lineNum">`;
for(let i=0;i<lineLen-1;i++){
str += `<li class="h2w__lineNumLine">${i+1}</li>`
};
str += `</ul>`;
return str;
})();
return lineStr + result;
};
return result;
}
};
return result;
})(),
md = require('./markdown')(mdOption);
// 应用Markdown解析扩展,包括自定义组件(['sub','sup','ins','mark','emoji','todo','latex','yuml','echarts'])
[...config.markdown,...config.components].forEach(item => {
if(!/^audio-player|table|todogroup|img$/.test(item)){
md.use(require(`./plugins/${item}`));
};
});
// 定义emoji渲染规则
md.renderer.rules.emoji = (token,index)=>{
let item = token[index];
return `<g-emoji class="h2w__emoji h2w__emoji--${item.markup}">${item.content}</g-emoji>`;
};
// 导出模块
module.exports = str => {
return md.render(str);
};
}, function(modId) { var map = {"../highlight/index":1743575529698,"../../config":1743575529699,"./markdown":1743575529701}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529698, function(require, module, exports) {
const config = require('../../config'),
hljs = require('./highlight');
config.highlight.forEach(item => {
hljs.registerLanguage(item, require(`./languages/${item}`).default);
});
module.exports = hljs;
}, function(modId) { var map = {"../../config":1743575529699,"./highlight":1743575529700}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529699, function(require, module, exports) {
module.exports = {
// LaTex公式、yuml解析服务架设参见 https://github.com/sbfkcel/markdown-server
// 数学公式解析API
latex:{
api:'http://towxml.vvadd.com/?tex'
},
// yuml图解析APPI
yuml:{
api:'http://towxml.vvadd.com/?yuml'
},
// markdown解析配置,保留需要的选项即可
markdown:[
'sub', // 下标支持
'sup', // 上标支持
'ins', // 文本删除线支持
'mark', // 文本高亮支持
'emoji', // emoji表情支持
'todo' // todo支持
],
// 代码高亮配置,保留需要的选项即可(尽量越少越好,不要随意调整顺序。部分高亮有顺序依赖)
highlight:[
'c-like',
'c',
'bash',
'css',
'dart',
'go',
'java',
'javascript',
'json',
'less',
'scss',
'shell',
'xml',
'htmlbars',
'nginx',
'php',
'python',
'python-repl',
'typescript',
// 'csharp',
// 'http',
// 'swift',
// 'yaml',
// 'markdown',
// 'powershell',
// 'ruby',
// 'makefile',
// 'lua',
// 'stylus',
// 'basic',
// '1c',
// 'abnf',
// 'accesslog',
// 'actionscript',
// 'ada',
// 'angelscript',
// 'apache',
// 'applescript',
// 'arcade',
// 'cpp',
// 'arduino',
// 'armasm',
// 'asciidoc',
// 'aspectj',
// 'autohotkey',
// 'autoit',
// 'avrasm',
// 'awk',
// 'axapta',
// 'bnf',
// 'brainfuck',
// 'cal',
// 'capnproto',
// 'ceylon',
// 'clean',
// 'clojure-repl',
// 'clojure',
// 'cmake',
// 'coffeescript',
// 'coq',
// 'cos',
// 'crmsh',
// 'crystal',
// 'csp',
// 'd',
// 'delphi',
// 'diff',
// 'django',
// 'dns',
// 'dockerfile',
// 'dos',
// 'dsconfig',
// 'dts',
// 'dust',
// 'ebnf',
// 'elixir',
// 'elm',
// 'erb',
// 'erlang-repl',
// 'erlang',
// 'excel',
// 'fix',
// 'flix',
// 'fortran',
// 'fsharp',
// 'gams',
// 'gauss',
// 'gcode',
// 'gherkin',
// 'glsl',
// 'gml',
// 'golo',
// 'gradle',
// 'groovy',
// 'haml',
// 'handlebars',
// 'haskell',
// 'haxe',
// 'hsp',
// 'hy',
// 'inform7',
// 'ini',
// 'irpf90',
// 'isbl',
// 'jboss-cli',
// 'julia-repl',
// 'julia',
// 'kotlin',
// 'lasso',
// 'latex',
// 'ldif',
// 'leaf',
// 'lisp',
// 'livecodeserver',
// 'livescript',
// 'llvm',
// 'lsl',
// 'mathematica',
// 'matlab',
// 'maxima',
// 'mel',
// 'mercury',
// 'mipsasm',
// 'mizar',
// 'mojolicious',
// 'monkey',
// 'moonscript',
// 'n1ql',
// 'nim',
// 'nix',
// 'nsis',
// 'objectivec',
// 'ocaml',
// 'openscad',
// 'oxygene',
// 'parser3',
// 'perl',
// 'pf',
// 'pgsql',
// 'php-template',
// 'plaintext',
// 'pony',
// 'processing',
// 'profile',
// 'prolog',
// 'properties',
// 'protobuf',
// 'puppet',
// 'purebasic',
// 'q',
// 'qml',
// 'r',
// 'reasonml',
// 'rib',
// 'roboconf',
// 'routeros',
// 'rsl',
// 'ruleslanguage',
// 'rust',
// 'sas',
// 'scala',
// 'scheme',
// 'scilab',
// 'smali',
// 'smalltalk',
// 'sml',
// 'sqf',
// 'sql',
// 'stan',
// 'stata',
// 'step21',
// 'subunit',
// 'taggerscript',
// 'tap',
// 'tcl',
// 'thrift',
// 'tp',
// 'twig',
// 'vala',
// 'vbnet',
// 'vbscript-html',
// 'vbscript',
// 'verilog',
// 'vhdl',
// 'vim',
// 'x86asm',
// 'xl',
// 'xquery',
// 'zephir'
],
// wxml原生标签,该系列标签将不会被转换
wxml:[
'view',
'video',
'text',
'image',
'navigator',
'swiper',
'swiper-item',
'block',
'form',
'input',
'textarea',
'button',
'checkbox-group',
'checkbox',
'radio-group',
'radio',
// 可以解析的标签(html或markdown中会很少使用)
// 'canvas',
// 'map',
// 'slider',
// 'scroll-view',
// 'movable-area',
// 'movable-view',
// 'progress',
// 'label',
// 'switch',
// 'picker',
// 'picker-view',
// 'switch',
// 'contact-button'
],
// 自定义组件
components:[
'audio-player', // 音频组件,建议保留,由于小程序原生audio存在诸多问题,towxml解决了原生音频播放器的相关问题
// 'echarts', // echarts图表支持
'latex', // 数学公式支持
'table', // 表格支持
'todogroup', // todo支持
'yuml', // yuml图表支持
'img' // 图片解析组件
],
// 保留原本的元素属性(建议不要变动)
attrs:[
'class',
'data',
'id',
'style'
],
// 事件绑定方式(catch或bind),catch 会阻止事件向上冒泡。更多请参考:https://developers.weixin.qq.com/miniprogram/dev/framework/view/wxml/event.html
bindType:'catch',
// 需要激活的事件
events:[
// 'touchstart',
// 'touchmove',
// 'touchcancel',
// 'touchend',
'tap', // 用于元素的点击事件
'change', // 用于todoList的change事件
],
// 图片倍数
dpr:1,
// 代码块显示行号
showLineNumber:true
}
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529700, function(require, module, exports) {
function deepFreeze(e){Object.freeze(e);var n="function"==typeof e;return Object.getOwnPropertyNames(e).forEach(function(t){!e.hasOwnProperty(t)||null===e[t]||"object"!=typeof e[t]&&"function"!=typeof e[t]||n&&("caller"===t||"callee"===t||"arguments"===t)||Object.isFrozen(e[t])||deepFreeze(e[t])}),e}function escapeHTML(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function inherit(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function tag(e){return e.nodeName.toLowerCase()}function nodeStream(e){var n=[];return function e(t,r){for(var a=t.firstChild;a;a=a.nextSibling)3===a.nodeType?r+=a.nodeValue.length:1===a.nodeType&&(n.push({event:"start",offset:r,node:a}),r=e(a,r),tag(a).match(/br|hr|img|input/)||n.push({event:"stop",offset:r,node:a}));return r}(e,0),n}function mergeStreams(e,n,t){var r=0,a="",i=[];function s(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset<n[0].offset?e:n:"start"===n[0].event?e:n:e.length?e:n}function o(e){a+="<"+tag(e)+[].map.call(e.attributes,function(e){return" "+e.nodeName+'="'+escapeHTML(e.value).replace(/"/g,"&quot;")+'"'}).join("")+">"}function l(e){a+="</"+tag(e)+">"}function c(e){("start"===e.event?o:l)(e.node)}for(;e.length||n.length;){var u=s();if(a+=escapeHTML(t.substring(r,u[0].offset)),r=u[0].offset,u===e){i.reverse().forEach(l);do{c(u.splice(0,1)[0]),u=s()}while(u===e&&u.length&&u[0].offset===r);i.reverse().forEach(o)}else"start"===u[0].event?i.push(u[0].node):i.pop(),c(u.splice(0,1)[0])}return a+escapeHTML(t.substr(r))}var utils=Object.freeze({__proto__:null,escapeHTML:escapeHTML,inherit:inherit,nodeStream:nodeStream,mergeStreams:mergeStreams});const SPAN_CLOSE="</span>",emitsWrappingTags=e=>!!e.kind;class HTMLRenderer{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=escapeHTML(e)}openNode(e){if(!emitsWrappingTags(e))return;let n=e.kind;e.sublanguage||(n=`${this.classPrefix}${n}`),this.span(n)}closeNode(e){emitsWrappingTags(e)&&(this.buffer+=SPAN_CLOSE)}span(e){this.buffer+=`<span class="${e}">`}value(){return this.buffer}}class TokenTree{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(n=>this._walk(e,n)),e.closeNode(n)),e}static _collapse(e){e.children&&(e.children.every(e=>"string"==typeof e)?(e.text=e.children.join(""),delete e.children):e.children.forEach(e=>{"string"!=typeof e&&TokenTree._collapse(e)}))}}class TokenTreeEmitter extends TokenTree{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){let t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new HTMLRenderer(this,this.options).value()}finalize(){}}function escape(e){return new RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function source(e){return e&&e.source||e}function countMatchGroups(e){return new RegExp(e.toString()+"|").exec("").length-1}function startsWith(e,n){var t=e&&e.exec(n);return t&&0===t.index}function join(e,n){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i<e.length;i++){var s=r+=1,o=source(e[i]);for(i>0&&(a+=n),a+="(";o.length>0;){var l=t.exec(o);if(null==l){a+=o;break}a+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),"\\"==l[0][0]&&l[1]?a+="\\"+String(Number(l[1])+s):(a+=l[0],"("==l[0]&&r++)}a+=")"}return a}const IDENT_RE="[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",NUMBER_RE="\\b\\d+(\\.\\d+)?",C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529701, function(require, module, exports) {
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.markdownit=e()}}(function(){var e;return function e(r,t,n){function s(i,a){if(!t[i]){if(!r[i]){var c="function"==typeof require&&require;if(!a&&c)return c(i,!0);if(o)return o(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var u=t[i]={exports:{}};r[i][0].call(u.exports,function(e){var t=r[i][1][e];return s(t?t:e)},u,u.exports,e,r,t,n)}return t[i].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)s(n[i]);return s}({1:[function(e,r,t){r.exports=e("entities/maps/entities.json")},{"entities/maps/entities.json":52}],2:[function(e,r,t){r.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","meta","nav","noframes","ol","optgroup","option","p","param","pre","section","source","title","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},{}],3:[function(e,r,t){var n="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",s="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",o=new RegExp("^(?:"+n+"|"+s+"|<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->|<[?].*?[?]>|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),i=new RegExp("^(?:"+n+"|"+s+")");r.exports.HTML_TAG_RE=o,r.exports.HTML_OPEN_CLOSE_TAG_RE=i},{}],4:[function(e,r,t){function n(e){return Object.prototype.toString.call(e)}function s(e){return"[object String]"===n(e)}function o(e,r){return y.call(e,r)}function i(e){return Array.prototype.slice.call(arguments,1).forEach(function(r){if(r){if("object"!=typeof r)throw new TypeError(r+"must be object");Object.keys(r).forEach(function(t){e[t]=r[t]})}}),e}function a(e,r,t){return[].concat(e.slice(0,r),t,e.slice(r+1))}function c(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function l(e){if(e>65535){e-=65536;var r=55296+(e>>10),t=56320+(1023&e);return String.fromCharCode(r,t)}return String.fromCharCode(e)}function u(e,r){var t=0;return o(w,r)?w[r]:35===r.charCodeAt(0)&&A.test(r)&&(t="x"===r[1].toLowerCase()?parseInt(r.slice(2),16):parseInt(r.slice(1),10),c(t))?l(t):e}function p(e){return e.indexOf("\\")<0?e:e.replace(x,"$1")}function h(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(C,function(e,r,t){return r?r:u(e,t)})}function f(e){return q[e]}function d(e){return D.test(e)?e.replace(/[&<>"]/g,f):e}function m(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function _(e){switch(e){case 9:case 32:return!0}return!1}function g(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function b(e){return E.test(e)}function k(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function v(e){return e.trim().replace(/\s+/g," ").toUpperCase()}var y=Object.prototype.hasOwnProperty,x=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,C=new RegExp(x.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),A=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,w=e("./entities"),D=/[&<>"]/,q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},E=e("uc.micro/categories/P/regex");t.lib={},t.lib.mdurl=e("mdurl"),t.lib.ucmicro=e("uc.micro"),t.assign=i,t.isString=s,t.has=o,t.unescapeMd=p,t.unescapeAll=h,t.isValidEntityCod
l=h+1<r||n?this.eMarks[h]+1:this.eMarks[h];c<l&&i<t;){if(a=this.src.charCodeAt(c),o(a))9===a?i+=4-(i+this.bsCount[h])%4:i++;else{if(!(c-p<this.tShift[h]))break;i++}c++}u[s]=i>t?new Array(i-t+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return u.join("")},n.prototype.Token=s,r.exports=n},{"../common/utils":4,"../token":51}],29:[function(e,r,t){function n(e,r){var t=e.bMarks[r]+e.blkIndent,n=e.eMarks[r];return e.src.substr(t,n-t)}function s(e){var r,t=[],n=0,s=e.length,o=0,i=0,a=!1,c=0;for(r=e.charCodeAt(n);n<s;)96===r?a?(a=!1,c=n):o%2==0&&(a=!0,c=n):124!==r||o%2!=0||a||(t.push(e.substring(i,n)),i=n+1),92===r?o++:o=0,n++,n===s&&a&&(a=!1,n=c+1),r=e.charCodeAt(n);return t.push(e.substring(i)),t}var o=e("../common/utils").isSpace;r.exports=function(e,r,t,i){var a,c,l,u,p,h,f,d,m,_,g,b;if(r+2>t)return!1;if(p=r+1,e.sCount[p]<e.blkIndent)return!1;if(e.sCount[p]-e.blkIndent>=4)return!1;if((l=e.bMarks[p]+e.tShift[p])>=e.eMarks[p])return!1;if(124!==(a=e.src.charCodeAt(l++))&&45!==a&&58!==a)return!1;for(;l<e.eMarks[p];){if(124!==(a=e.src.charCodeAt(l))&&45!==a&&58!==a&&!o(a))return!1;l++}for(c=n(e,r+1),h=c.split("|"),m=[],u=0;u<h.length;u++){if(!(_=h[u].trim())){if(0===u||u===h.length-1)continue;return!1}if(!/^:?-+:?$/.test(_))return!1;58===_.charCodeAt(_.length-1)?m.push(58===_.charCodeAt(0)?"center":"right"):58===_.charCodeAt(0)?m.push("left"):m.push("")}if(c=n(e,r).trim(),c.indexOf("|")===-1)return!1;if(e.sCount[r]-e.blkIndent>=4)return!1;if(h=s(c.replace(/^\||\|$/g,"")),(f=h.length)>m.length)return!1;if(i)return!0;for(d=e.push("table_open","table",1),d.map=g=[r,0],d=e.push("thead_open","thead",1),d.map=[r,r+1],d=e.push("tr_open","tr",1),d.map=[r,r+1],u=0;u<h.length;u++)d=e.push("th_open","th",1),d.map=[r,r+1],m[u]&&(d.attrs=[["style","text-align:"+m[u]]]),d=e.push("inline","",0),d.content=h[u].trim(),d.map=[r,r+1],d.children=[],d=e.push("th_close","th",-1);for(d=e.push("tr_close","tr",-1),d=e.push("thead_close","thead",-1),d=e.push("tbody_open","tbody",1),d.map=b=[r+2,0],p=r+2;p<t&&!(e.sCount[p]<e.blkIndent)&&(c=n(e,p).trim(),c.indexOf("|")!==-1)&&!(e.sCount[p]-e.blkIndent>=4);p++){for(h=s(c.replace(/^\||\|$/g,"")),d=e.push("tr_open","tr",1),u=0;u<f;u++)d=e.push("td_open","td",1),m[u]&&(d.attrs=[["style","text-align:"+m[u]]]),d=e.push("inline","",0),d.content=h[u]?h[u].trim():"",d.children=[],d=e.push("td_close","td",-1);d=e.push("tr_close","tr",-1)}return d=e.push("tbody_close","tbody",-1),d=e.push("table_close","table",-1),g[1]=b[1]=p,e.line=p,!0}},{"../common/utils":4}],30:[function(e,r,t){r.exports=function(e){var r;e.inlineMode?(r=new e.Token("inline","",0),r.content=e.src,r.map=[0,1],r.children=[],e.tokens.push(r)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}},{}],31:[function(e,r,t){r.exports=function(e){var r,t,n,s=e.tokens;for(t=0,n=s.length;t<n;t++)r=s[t],"inline"===r.type&&e.md.inline.parse(r.content,e.md,e.env,r.children)}},{}],32:[function(e,r,t){function n(e){return/^<a[>\s]/i.test(e)}function s(e){return/^<\/a\s*>/i.test(e)}var o=e("../common/utils").arrayReplaceAt;r.exports=function(e){var r,t,i,a,c,l,u,p,h,f,d,m,_,g,b,k,v,y=e.tokens;if(e.md.options.linkify)for(t=0,i=y.length;t<i;t++)if("inline"===y[t].type&&e.md.linkify.pretest(y[t].content))for(a=y[t].children,_=0,r=a.length-1;r>=0;r--)if(l=a[r],"link_close"!==l.type){if("html_inline"===l.type&&(n(l.content)&&_>0&&_--,s(l.content)&&_++),!(_>0)&&"text"===l.type&&e.md.linkify.test(l.content)){for(h=l.content,v=e.md.linkify.match(h),u=[],m=l.level,d=0,p=0;p<v.length;p++)g=v[p].url,b=e.md.normalizeLink(g),e.md.validateLink(b)&&(k=v[p].text,k=v[p].schema?"mailto:"!==v[p].schema||/^mailto:/i.test(k)?e.md.normalizeLinkText(k):e.md.normalizeLinkText("mailto:"+k).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+k).replace(/^http:\/\//,""),f=v[p].index,f>d&&(c=new e.Token("text","",0),c.content=h.slice(d,f),c.level=m,u.push(c)),c=new e.Token("link_open","a",1),c.attrs=[["href",b]],c.level=m++,c.markup="linkify",c.info="auto",u.push(c),c=new e.Token("text","",0),c.content=k,c.level=m,u.push(c),c=new e.Token("link_close","a",-1),c.level=--m,c.markup="linkif
jopf:"\ud835\udd5b",Jscr:"\ud835\udca5",jscr:"\ud835\udcbf",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\ud835\udd0e",kfr:"\ud835\udd28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\ud835\udd42",kopf:"\ud835\udd5c",Kscr:"\ud835\udca6",kscr:"\ud835\udcc0",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",lang:"\u27e8",Lang:"\u27ea",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\xab",larrb:"\u21e4",larrbfs:"\u291f",larr:"\u2190",Larr:"\u219e",lArr:"\u21d0",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",latail:"\u2919",lAtail:"\u291b",lat:"\u2aab",late:"\u2aad",lates:"\u2aad\ufe00",lbarr:"\u290c",lBarr:"\u290e",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27e8",LeftArrowBar:"\u21e4",leftarrow:"\u2190",LeftArrow:"\u2190",Leftarrow:"\u21d0",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVectorBar:"\u2959",LeftDownVector:"\u21c3",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",leftrightarrow:"\u2194",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTeeArrow:"\u21a4",LeftTee:"\u22a3",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangleBar:"\u29cf",LeftTriangle:"\u22b2",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVectorBar:"\u2958",LeftUpVector:"\u21bf",LeftVectorBar:"\u2952",LeftVector:"\u21bc",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",lescc:"\u2aa8",les:"\u2a7d",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\ud835\udd0f",lfr:"\ud835\udd29",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",llarr:"\u21c7",ll:"\u226a",Ll:"\u22d8",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoustache:"\u23b0",lmoust:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lne:"\u2a87",lnE:"\u2268",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",longleftarrow:"\u27f5",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftrightarrow:"\u27f7",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longmapsto:"\u27fc",longrightarrow:"\u27f6",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\ud835\udd43",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",lscr:"\ud835\udcc1",Lscr:"\u2112",lsh:"\u21b0",Lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",ltcc:"\u2aa6",ltcir:"\u2a79",lt:"<",LT:"<",Lt:"\u226a",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe0
"uc.micro/categories/Cc/regex":61,"uc.micro/categories/P/regex":63,"uc.micro/categories/Z/regex":64,"uc.micro/properties/Any/regex":66}],55:[function(e,r,t){function n(e){var r,t,n=o[e];if(n)return n;for(n=o[e]=[],r=0;r<128;r++)t=String.fromCharCode(r),n.push(t);for(r=0;r<e.length;r++)t=e.charCodeAt(r),n[t]="%"+("0"+t.toString(16).toUpperCase()).slice(-2);return n}function s(e,r){var t;return"string"!=typeof r&&(r=s.defaultChars),t=n(r),e.replace(/(%[a-f0-9]{2})+/gi,function(e){var r,n,s,o,i,a,c,l="";for(r=0,n=e.length;r<n;r+=3)s=parseInt(e.slice(r+1,r+3),16),s<128?l+=t[s]:192==(224&s)&&r+3<n&&128==(192&(o=parseInt(e.slice(r+4,r+6),16)))?(c=s<<6&1984|63&o,l+=c<128?"\ufffd\ufffd":String.fromCharCode(c),r+=3):224==(240&s)&&r+6<n&&(o=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),128==(192&o)&&128==(192&i))?(c=s<<12&61440|o<<6&4032|63&i,l+=c<2048||c>=55296&&c<=57343?"\ufffd\ufffd\ufffd":String.fromCharCode(c),r+=6):240==(248&s)&&r+9<n&&(o=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),a=parseInt(e.slice(r+10,r+12),16),128==(192&o)&&128==(192&i)&&128==(192&a))?(c=s<<18&1835008|o<<12&258048|i<<6&4032|63&a,c<65536||c>1114111?l+="\ufffd\ufffd\ufffd\ufffd":(c-=65536,l+=String.fromCharCode(55296+(c>>10),56320+(1023&c))),r+=9):l+="\ufffd";return l})}var o={};s.defaultChars=";/?:@&=+$,#",s.componentChars="",r.exports=s},{}],56:[function(e,r,t){function n(e){var r,t,n=o[e];if(n)return n;for(n=o[e]=[],r=0;r<128;r++)t=String.fromCharCode(r),/^[0-9a-z]$/i.test(t)?n.push(t):n.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2));for(r=0;r<e.length;r++)n[e.charCodeAt(r)]=e[r];return n}function s(e,r,t){var o,i,a,c,l,u="";for("string"!=typeof r&&(t=r,r=s.defaultChars),void 0===t&&(t=!0),l=n(r),o=0,i=e.length;o<i;o++)if(a=e.charCodeAt(o),t&&37===a&&o+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3)))u+=e.slice(o,o+3),o+=2;else if(a<128)u+=l[a];else if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&o+1<i&&(c=e.charCodeAt(o+1))>=56320&&c<=57343){u+=encodeURIComponent(e[o]+e[o+1]),o++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(e[o]);return u}var o={};s.defaultChars=";/?:@&=+$,-_.!~*'()#",s.componentChars="-_.!~*'()",r.exports=s},{}],57:[function(e,r,t){r.exports=function(e){var r="";return r+=e.protocol||"",r+=e.slashes?"//":"",r+=e.auth?e.auth+"@":"",r+=e.hostname&&e.hostname.indexOf(":")!==-1?"["+e.hostname+"]":e.hostname||"",r+=e.port?":"+e.port:"",r+=e.pathname||"",r+=e.search||"",r+=e.hash||""}},{}],58:[function(e,r,t){r.exports.encode=e("./encode"),r.exports.decode=e("./decode"),r.exports.format=e("./format"),r.exports.parse=e("./parse")},{"./decode":55,"./encode":56,"./format":57,"./parse":59}],59:[function(e,r,t){function n(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}function s(e,r){if(e&&e instanceof n)return e;var t=new n;return t.parse(e,r),t}var o=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["<",">",'"',"`"," ","\r","\n","\t"],l=["{","}","|","\\","^","`"].concat(c),u=["'"].concat(l),p=["%","/","?",";","#"].concat(u),h=["/","?","#"],f={javascript:!0,"javascript:":!0},d={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};n.prototype.parse=function(e,r){var t,n,s,i,c,l=e;if(l=l.trim(),!r&&1===e.split("#").length){var u=a.exec(l);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}var m=o.exec(l);if(m&&(m=m[0],s=m.toLowerCase(),this.protocol=m,l=l.substr(m.length)),(r||m||l.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(c="//"===l.substr(0,2))||m&&f[m]||(l=l.substr(2),this.slashes=!0)),!f[m]&&(c||m&&!d[m])){var _=-1;for(t=0;t<h.length;t++)(i=l.indexOf(h[t]))!==-1&&(_===-1||i<_)&&(_=i);var g,b;for(b=_===-1?l.lastIndexOf("@"):l.lastIndexOf("@",_),b!==-1&&(g=l.slice(0,b),l=l.slice(b+1),this.auth=g),_=-1,t=0;t<p.length;t++)(i=l.indexOf(p[t]))!==-1&&(_===-1||i<_)&&(_=i);_===-1&&(_=l.length),":"===l[_-1]&&_--;var k=l.slice(0,_);l=l.slice(_),this.parseHost(k),this.hostname=this.hostname||"";var v="["===this.hostname[0]&&"]"===this.hostname[thi
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529702, function(require, module, exports) {
const parse2 = require('./parse2/index'),
// parse5 = require('./parse5/index').parse,
config = require('../config'),
// html与wxml转换关系
correspondTag = (()=>{
let result = {
a:'navigator',
todogroup:'checkbox-group',
audio:'audio-player'
};
// // 该系列的标签都转换为text
// ['span','b','strong','i','em','code','sub','sup','g-emoji','mark','ins'].forEach(item => {
// result[item] = 'text';
// });
// 该系列小程序原生tag,不需转换
[...config.wxml,...config.components].forEach(item => {
result[item] = item;
});
return result;
})(),
// 元素与html对应的wxml标签名
getWxmlTag = tagStr => !tagStr ? undefined : correspondTag[tagStr] || 'view',
// 精简数据,并初始化相关事件等
initObj = (obj,option)=>{
const result = {
theme:option.theme || 'light',
_e:{}
},
events = global._events = {},
base = option.base;
// 主题保存到全局
global._theme = result.theme;
// 事件添加到全局中,各个组件在触发事件时会从全局调用
if(option.events){
for(let key in option.events){
events[key] = option.events[key];
};
};
// 遍历原始数据,处理成能解析的数据
let eachFn;
(eachFn = (arr,obj,_e) => {
obj.child = obj.child || [];
_e.child = _e.child || [];
arr.forEach(item => {
if(item.type === 'comment'){
return;
};
let o = {},
e = {};
o.type = e.type = item.type;
o._e = e;
if(item.type === 'text'){
o.text = e.text = item.data;
}else{
o.tag = getWxmlTag(item.name); // 转换之后的标签
// o.tag = o.tag === 'text' ? 'view' : o.tag;
e.tag = item.name; // 原始
o.attr = item.attribs;
e.attr = JSON.parse(JSON.stringify(item.attribs));
o.attr.class = o.attr.class ? `h2w__${item.name} ${o.attr.class}` : `h2w__${item.name}`;
// 处理资源相对路径
if(base && o.attr.src){
let src = o.attr.src;
switch (src.indexOf('//')) {
case 0:
o.attr.src = `https:${src}`;
break;
case -1:
o.attr.src = `${base}${src}`;
break;
};
};
if(item.children){
eachFn(item.children,o,e);
};
};
_e.child.push(e);
obj.child.push(o);
});
})(obj,result,result._e);
return result;
};
module.exports = (str,option) => {
str = (()=>{
let re = /<body[^>]*>([\s\S]*)<\/body>/i;
if(re.test(str)){
let result = re.exec(str);
return result[1] || str;
}else{
return str;
};
})();
return initObj(parse2(str,{decodeEntities:true}),option);
};
}, function(modId) { var map = {"./parse2/index":1743575529703,"../config":1743575529699}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529703, function(require, module, exports) {
/*! Project:无, Create:FWS 2020.01.08 21:48, Update:FWS 2020.01.08 21:48 */
function parseDOM(r,e){var a=new domhandler_1.DomHandler(void 0,e);return new Parser_1.Parser(a,e).end(r),a.dom}var domhandler_1=require("./domhandler/index"),Parser_1=require("./Parser");module.exports=parseDOM;
}, function(modId) { var map = {"./domhandler/index":1743575529704,"./Parser":1743575529706}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529704, function(require, module, exports) {
/*! Project:无, Create:FWS 2020.01.08 21:48, Update:FWS 2020.01.08 21:48 */
Object.defineProperty(exports,"__esModule",{value:!0});var node_1=require("./node");exports.Node=node_1.Node,exports.Element=node_1.Element,exports.DataNode=node_1.DataNode,exports.NodeWithChildren=node_1.NodeWithChildren;var reWhitespace=/\s+/g,defaultOpts={normalizeWhitespace:!1,withStartIndices:!1,withEndIndices:!1},DomHandler=function(){function t(t,e,o){this.dom=[],this._done=!1,this._tagStack=[],this._lastNode=null,this._parser=null,"function"==typeof e&&(o=e,e=defaultOpts),"object"==typeof t&&(e=t,t=undefined),this._callback=t||null,this._options=e||defaultOpts,this._elementCB=o||null}return t.prototype.onparserinit=function(t){this._parser=t},t.prototype.onreset=function(){this.dom=[],this._done=!1,this._tagStack=[],this._lastNode=null,this._parser=this._parser||null},t.prototype.onend=function(){this._done||(this._done=!0,this._parser=null,this.handleCallback(null))},t.prototype.onerror=function(t){this.handleCallback(t)},t.prototype.onclosetag=function(){this._lastNode=null;var t=this._tagStack.pop();t&&this._parser&&(this._options.withEndIndices&&(t.endIndex=this._parser.endIndex),this._elementCB&&this._elementCB(t))},t.prototype.onopentag=function(t,e){var o=new node_1.Element(t,e);this.addNode(o),this._tagStack.push(o)},t.prototype.ontext=function(t){var e=this._options.normalizeWhitespace,o=this._lastNode;if(o&&"text"===o.type)e?o.data=(o.data+t).replace(reWhitespace," "):o.data+=t;else{e&&(t=t.replace(reWhitespace," "));var n=new node_1.DataNode("text",t);this.addNode(n),this._lastNode=n}},t.prototype.oncomment=function(t){if(this._lastNode&&"comment"===this._lastNode.type)return void(this._lastNode.data+=t);var e=new node_1.DataNode("comment",t);this.addNode(e),this._lastNode=e},t.prototype.oncommentend=function(){this._lastNode=null},t.prototype.oncdatastart=function(){var t=new node_1.DataNode("text",""),e=new node_1.NodeWithChildren("cdata",[t]);this.addNode(e),t.parent=e,this._lastNode=t},t.prototype.oncdataend=function(){this._lastNode=null},t.prototype.onprocessinginstruction=function(t,e){var o=new node_1.ProcessingInstruction(t,e);this.addNode(o)},t.prototype.handleCallback=function(t){if("function"==typeof this._callback)this._callback(t,this.dom);else if(t)throw t},t.prototype.addNode=function(t){var e=this._tagStack[this._tagStack.length-1],o=e?e.children:this.dom,n=o[o.length-1];this._parser&&(this._options.withStartIndices&&(t.startIndex=this._parser.startIndex),this._options.withEndIndices&&(t.endIndex=this._parser.endIndex)),o.push(t),n&&(t.prev=n,n.next=t),e&&(t.parent=e),this._lastNode=null},t.prototype.addDataNode=function(t){this.addNode(t),this._lastNode=t},t}();exports.DomHandler=DomHandler,exports["default"]=DomHandler;
}, function(modId) { var map = {"./node":1743575529705}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529705, function(require, module, exports) {
/*! Project:无, Create:FWS 2020.01.08 21:48, Update:FWS 2020.01.08 21:48 */
var __extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(exports,"__esModule",{value:!0});var nodeTypes=new Map([["tag",1],["script",1],["style",1],["directive",1],["text",3],["cdata",4],["comment",8]]),Node=function(){function e(e){this.type=e,this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return nodeTypes.get(this.type)||1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent||null},set:function(e){this.parent=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev||null},set:function(e){this.prev=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next||null},set:function(e){this.next=e},enumerable:!0,configurable:!0}),e}();exports.Node=Node;var DataNode=function(e){function t(t,n){var r=e.call(this,t)||this;return r.data=n,r}return __extends(t,e),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!0,configurable:!0}),t}(Node);exports.DataNode=DataNode;var ProcessingInstruction=function(e){function t(t,n){var r=e.call(this,"directive",n)||this;return r.name=t,r}return __extends(t,e),t}(DataNode);exports.ProcessingInstruction=ProcessingInstruction;var NodeWithChildren=function(e){function t(t,n){var r=e.call(this,t)||this;return r.children=n,r}return __extends(t,e),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this.children[0]||null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!0,configurable:!0}),t}(Node);exports.NodeWithChildren=NodeWithChildren;var Element=function(e){function t(t,n){var r=e.call(this,"script"===t?"script":"style"===t?"style":"tag",[])||this;return r.name=t,r.attribs=n,r.attribs=n,r}return __extends(t,e),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!0,configurable:!0}),t}(NodeWithChildren);exports.Element=Element;
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529706, function(require, module, exports) {
/*! Project:无, Create:FWS 2020.01.08 21:48, Update:FWS 2020.01.08 21:48 */
function Parser(t,e){var s=this;return s._tagname="",s._attribname="",s._attribvalue="",s._attribs=null,s._stack=[],s._foreignContext=[],s.startIndex=0,s.endIndex=null,s.parseChunk=Parser.prototype.write,s.done=Parser.prototype.end,s._options=e||{},s._cbs=t||{},s._tagname="",s._attribname="",s._attribvalue="",s._attribs=null,s._stack=[],s._foreignContext=[],s.startIndex=0,s.endIndex=null,s._lowerCaseTagNames="lowerCaseTags"in s._options?!!s._options.lowerCaseTags:!s._options.xmlMode,s._lowerCaseAttributeNames="lowerCaseAttributeNames"in s._options?!!s._options.lowerCaseAttributeNames:!s._options.xmlMode,s._tokenizer=new(s._options.Tokenizer||Tokenizer_1["default"])(s._options,s),s._cbs.onparserinit&&s._cbs.onparserinit(s),s}var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var Tokenizer_1=__importDefault(require("./Tokenizer")),formTags=new Set(["input","option","optgroup","select","button","datalist","textarea"]),pTag=new Set(["p"]),openImpliesClose={tr:new Set(["tr","th","td"]),th:new Set(["th"]),td:new Set(["thead","th","td"]),body:new Set(["head","link","script"]),li:new Set(["li"]),p:pTag,h1:pTag,h2:pTag,h3:pTag,h4:pTag,h5:pTag,h6:pTag,select:formTags,input:formTags,output:formTags,button:formTags,datalist:formTags,textarea:formTags,option:new Set(["option"]),optgroup:new Set(["optgroup","option"]),dd:new Set(["dt","dd"]),dt:new Set(["dt","dd"]),address:pTag,article:pTag,aside:pTag,blockquote:pTag,details:pTag,div:pTag,dl:pTag,fieldset:pTag,figcaption:pTag,figure:pTag,footer:pTag,form:pTag,header:pTag,hr:pTag,main:pTag,nav:pTag,ol:pTag,pre:pTag,section:pTag,table:pTag,ul:pTag,rt:new Set(["rt","rp"]),rp:new Set(["rt","rp"]),tbody:new Set(["thead","tbody"]),tfoot:new Set(["thead","tbody"])},voidElements=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),foreignContextElements=new Set(["math","svg"]),htmlIntegrationElements=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),reNameEnd=/\s|\//;Parser.prototype._updatePosition=function(t){null===this.endIndex?this._tokenizer._sectionStart<=t?this.startIndex=0:this.startIndex=this._tokenizer._sectionStart-t:this.startIndex=this.endIndex+1,this.endIndex=this._tokenizer.getAbsoluteIndex()},Parser.prototype.ontext=function(t){this._updatePosition(1),this.endIndex--,this._cbs.ontext&&this._cbs.ontext(t)},Parser.prototype.onopentagname=function(t){if(this._lowerCaseTagNames&&(t=t.toLowerCase()),this._tagname=t,!this._options.xmlMode&&t in openImpliesClose)for(var e=void 0;openImpliesClose[t].has(e=this._stack[this._stack.length-1]);this.onclosetag(e));!this._options.xmlMode&&voidElements.has(t)||(this._stack.push(t),foreignContextElements.has(t)?this._foreignContext.push(!0):htmlIntegrationElements.has(t)&&this._foreignContext.push(!1)),this._cbs.onopentagname&&this._cbs.onopentagname(t),this._cbs.onopentag&&(this._attribs={})},Parser.prototype.onopentagend=function(){this._updatePosition(1),this._attribs&&(this._cbs.onopentag&&this._cbs.onopentag(this._tagname,this._attribs),this._attribs=null),!this._options.xmlMode&&this._cbs.onclosetag&&voidElements.has(this._tagname)&&this._cbs.onclosetag(this._tagname),this._tagname=""},Parser.prototype.onclosetag=function(t){if(this._updatePosition(1),this._lowerCaseTagNames&&(t=t.toLowerCase()),(foreignContextElements.has(t)||htmlIntegrationElements.has(t))&&this._foreignContext.pop(),!this._stack.length||!this._options.xmlMode&&voidElements.has(t))this._options.xmlMode||"br"!==t&&"p"!==t||(this.onopentagname(t),this._closeCurrentTag());else{var e=this._stack.lastIndexOf(t);if(-1!==e)if(this._cbs.onclosetag)for(e=this._stack.length-e;e--;)this._cbs.onclosetag(this._stack.pop());else this._stack.length=e;else"p"!==t||this._options.xmlMode||(this.onopentagname(t),this._closeCurrentTag())}},Parser.prototype.onselfclosingtag=function(){this._options.xmlMode||this._options.recognizeSelfClosing||this._
}, function(modId) { var map = {"./Tokenizer":1743575529707}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529707, function(require, module, exports) {
/*! Project:无, Create:FWS 2020.01.08 21:48, Update:FWS 2020.01.08 21:48 */
function whitespace(t){return" "===t||"\n"===t||"\t"===t||"\f"===t||"\r"===t}function ifElseState(t,e,s){var i=t.toLowerCase();return t===i?function(t,a){a===i?t._state=e:(t._state=s,t._index--)}:function(a,_){_===i||_===t?a._state=e:(a._state=s,a._index--)}}function consumeSpecialNameChar(t,e){var s=t.toLowerCase();return function(i,a){a===s||a===t?i._state=e:(i._state=3,i._index--)}}var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var decode_codepoint_1=__importDefault(require("./entities/decode_codepoint")),entities_json_1=__importDefault(require("./entities/maps/entities")),legacy_json_1=__importDefault(require("./entities/maps/legacy")),xml_json_1=__importDefault(require("./entities/maps/xml")),stateBeforeCdata1=ifElseState("C",23,16),stateBeforeCdata2=ifElseState("D",24,16),stateBeforeCdata3=ifElseState("A",25,16),stateBeforeCdata4=ifElseState("T",26,16),stateBeforeCdata5=ifElseState("A",27,16),stateBeforeScript1=consumeSpecialNameChar("R",34),stateBeforeScript2=consumeSpecialNameChar("I",35),stateBeforeScript3=consumeSpecialNameChar("P",36),stateBeforeScript4=consumeSpecialNameChar("T",37),stateAfterScript1=ifElseState("R",39,1),stateAfterScript2=ifElseState("I",40,1),stateAfterScript3=ifElseState("P",41,1),stateAfterScript4=ifElseState("T",42,1),stateBeforeStyle1=consumeSpecialNameChar("Y",44),stateBeforeStyle2=consumeSpecialNameChar("L",45),stateBeforeStyle3=consumeSpecialNameChar("E",46),stateAfterStyle1=ifElseState("Y",48,1),stateAfterStyle2=ifElseState("L",49,1),stateAfterStyle3=ifElseState("E",50,1),stateBeforeEntity=ifElseState("#",52,53),stateBeforeNumericEntity=ifElseState("X",55,54),Tokenizer=function(){function t(t,e){this._state=1,this._buffer="",this._sectionStart=0,this._index=0,this._bufferOffset=0,this._baseState=1,this._special=1,this._running=!0,this._ended=!1,this._cbs=e,this._xmlMode=!(!t||!t.xmlMode),this._decodeEntities=!(!t||!t.decodeEntities)}return t.prototype.reset=function(){this._state=1,this._buffer="",this._sectionStart=0,this._index=0,this._bufferOffset=0,this._baseState=1,this._special=1,this._running=!0,this._ended=!1},t.prototype._stateText=function(t){"<"===t?(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._state=2,this._sectionStart=this._index):this._decodeEntities&&1===this._special&&"&"===t&&(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._baseState=1,this._state=51,this._sectionStart=this._index)},t.prototype._stateBeforeTagName=function(t){"/"===t?this._state=5:"<"===t?(this._cbs.ontext(this._getSection()),this._sectionStart=this._index):">"===t||1!==this._special||whitespace(t)?this._state=1:"!"===t?(this._state=15,this._sectionStart=this._index+1):"?"===t?(this._state=17,this._sectionStart=this._index+1):(this._state=this._xmlMode||"s"!==t&&"S"!==t?3:31,this._sectionStart=this._index)},t.prototype._stateInTagName=function(t){("/"===t||">"===t||whitespace(t))&&(this._emitToken("onopentagname"),this._state=8,this._index--)},t.prototype._stateBeforeCloseingTagName=function(t){whitespace(t)||(">"===t?this._state=1:1!==this._special?"s"===t||"S"===t?this._state=32:(this._state=1,this._index--):(this._state=6,this._sectionStart=this._index))},t.prototype._stateInCloseingTagName=function(t){(">"===t||whitespace(t))&&(this._emitToken("onclosetag"),this._state=7,this._index--)},t.prototype._stateAfterCloseingTagName=function(t){">"===t&&(this._state=1,this._sectionStart=this._index+1)},t.prototype._stateBeforeAttributeName=function(t){">"===t?(this._cbs.onopentagend(),this._state=1,this._sectionStart=this._index+1):"/"===t?this._state=4:whitespace(t)||(this._state=9,this._sectionStart=this._index)},t.prototype._stateInSelfClosingTag=function(t){">"===t?(this._cbs.onselfclosingtag(),this._state=1,this._sectionStart=this._index+1):whitespace(t)||(this._state=8,this._index--)},t.prototype._stateInAttributeName=function(t){("="===t||"/"===t||">"===t||whitespace(t))&&(this._cbs.onattribname(this._getSection()),this._sectionStart=
}, function(modId) { var map = {"./entities/decode_codepoint":1743575529708,"./entities/maps/entities":1743575529710,"./entities/maps/legacy":1743575529711,"./entities/maps/xml":1743575529712}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529708, function(require, module, exports) {
/*! Project:无, Create:FWS 2020.01.08 21:48, Update:FWS 2020.01.08 21:48 */
function decodeCodePoint(e){if(e>=55296&&e<=57343||e>1114111)return"<22>";e in decode_json_1["default"]&&(e=decode_json_1["default"][e]);var o="";return e>65535&&(e-=65536,o+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),o+=String.fromCharCode(e)}var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var decode_json_1=__importDefault(require("./maps/decode"));exports["default"]=decodeCodePoint;
}, function(modId) { var map = {"./maps/decode":1743575529709}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529709, function(require, module, exports) {
/*! Project:无, Create:FWS 2020.01.08 21:48, Update:FWS 2020.01.08 21:48 */
module.exports={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376};
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529710, function(require, module, exports) {
/*! Project:无, Create:FWS 2020.01.08 21:48, Update:FWS 2020.01.08 21:48 */
module.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",Cup
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529711, function(require, module, exports) {
/*! Project:无, Create:FWS 2020.01.08 21:48, Update:FWS 2020.01.08 21:48 */
module.exports={Aacute:"Á",aacute:"á",Acirc:"Â",acirc:"â",acute:"´",AElig:"Æ",aelig:"æ",Agrave:"À",agrave:"à",amp:"&",AMP:"&",Aring:"Å",aring:"å",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",brvbar:"¦",Ccedil:"Ç",ccedil:"ç",cedil:"¸",cent:"¢",copy:"©",COPY:"©",curren:"¤",deg:"°",divide:"÷",Eacute:"É",eacute:"é",Ecirc:"Ê",ecirc:"ê",Egrave:"È",egrave:"è",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",frac12:"½",frac14:"¼",frac34:"¾",gt:">",GT:">",Iacute:"Í",iacute:"í",Icirc:"Î",icirc:"î",iexcl:"¡",Igrave:"Ì",igrave:"ì",iquest:"¿",Iuml:"Ï",iuml:"ï",laquo:"«",lt:"<",LT:"<",macr:"¯",micro:"µ",middot:"·",nbsp:" ",not:"¬",Ntilde:"Ñ",ntilde:"ñ",Oacute:"Ó",oacute:"ó",Ocirc:"Ô",ocirc:"ô",Ograve:"Ò",ograve:"ò",ordf:"ª",ordm:"º",Oslash:"Ø",oslash:"ø",Otilde:"Õ",otilde:"õ",Ouml:"Ö",ouml:"ö",para:"¶",plusmn:"±",pound:"£",quot:'"',QUOT:'"',raquo:"»",reg:"®",REG:"®",sect:"§",shy:"­",sup1:"¹",sup2:"²",sup3:"³",szlig:"ß",THORN:"Þ",thorn:"þ",times:"×",Uacute:"Ú",uacute:"ú",Ucirc:"Û",ucirc:"û",Ugrave:"Ù",ugrave:"ù",uml:"¨",Uuml:"Ü",uuml:"ü",Yacute:"Ý",yacute:"ý",yen:"¥",yuml:"ÿ"};
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
__DEFINE__(1743575529712, function(require, module, exports) {
/*! Project:无, Create:FWS 2020.01.08 21:48, Update:FWS 2020.01.08 21:48 */
module.exports={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};
}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); })
return __REQUIRE__(1743575529696);
})()
//miniprogram-npm-outsideDeps=[]
//# sourceMappingURL=index.js.map