wikiparser-node 0.7.0 → 0.8.0-b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/bundle/bundle.min.js +38 -0
  2. package/extensions/editor.css +60 -0
  3. package/extensions/editor.js +317 -0
  4. package/extensions/ui.css +119 -0
  5. package/package.json +12 -11
  6. package/README.md +0 -39
  7. package/config/default.json +0 -832
  8. package/config/llwiki.json +0 -630
  9. package/config/moegirl.json +0 -728
  10. package/config/zhwiki.json +0 -1269
  11. package/index.js +0 -321
  12. package/lib/element.js +0 -611
  13. package/lib/node.js +0 -772
  14. package/lib/ranges.js +0 -130
  15. package/lib/text.js +0 -215
  16. package/lib/title.js +0 -80
  17. package/mixin/attributeParent.js +0 -117
  18. package/mixin/fixedToken.js +0 -40
  19. package/mixin/hidden.js +0 -21
  20. package/mixin/singleLine.js +0 -31
  21. package/mixin/sol.js +0 -65
  22. package/parser/brackets.js +0 -120
  23. package/parser/commentAndExt.js +0 -62
  24. package/parser/converter.js +0 -46
  25. package/parser/externalLinks.js +0 -33
  26. package/parser/hrAndDoubleUnderscore.js +0 -38
  27. package/parser/html.js +0 -42
  28. package/parser/links.js +0 -94
  29. package/parser/list.js +0 -59
  30. package/parser/magicLinks.js +0 -41
  31. package/parser/quotes.js +0 -64
  32. package/parser/selector.js +0 -177
  33. package/parser/table.js +0 -114
  34. package/src/arg.js +0 -203
  35. package/src/atom/hidden.js +0 -13
  36. package/src/atom/index.js +0 -43
  37. package/src/attribute.js +0 -420
  38. package/src/attributes.js +0 -452
  39. package/src/charinsert.js +0 -97
  40. package/src/converter.js +0 -176
  41. package/src/converterFlags.js +0 -284
  42. package/src/converterRule.js +0 -258
  43. package/src/extLink.js +0 -179
  44. package/src/gallery.js +0 -151
  45. package/src/hasNowiki/index.js +0 -44
  46. package/src/hasNowiki/pre.js +0 -40
  47. package/src/heading.js +0 -134
  48. package/src/html.js +0 -248
  49. package/src/imageParameter.js +0 -277
  50. package/src/imagemap.js +0 -199
  51. package/src/imagemapLink.js +0 -41
  52. package/src/index.js +0 -913
  53. package/src/link/category.js +0 -49
  54. package/src/link/file.js +0 -282
  55. package/src/link/galleryImage.js +0 -120
  56. package/src/link/index.js +0 -383
  57. package/src/magicLink.js +0 -149
  58. package/src/nested/choose.js +0 -24
  59. package/src/nested/combobox.js +0 -23
  60. package/src/nested/index.js +0 -96
  61. package/src/nested/references.js +0 -23
  62. package/src/nowiki/comment.js +0 -71
  63. package/src/nowiki/dd.js +0 -59
  64. package/src/nowiki/doubleUnderscore.js +0 -56
  65. package/src/nowiki/hr.js +0 -41
  66. package/src/nowiki/index.js +0 -56
  67. package/src/nowiki/list.js +0 -16
  68. package/src/nowiki/noinclude.js +0 -28
  69. package/src/nowiki/quote.js +0 -69
  70. package/src/onlyinclude.js +0 -64
  71. package/src/paramTag/index.js +0 -89
  72. package/src/paramTag/inputbox.js +0 -44
  73. package/src/parameter.js +0 -239
  74. package/src/syntax.js +0 -91
  75. package/src/table/index.js +0 -984
  76. package/src/table/td.js +0 -339
  77. package/src/table/tr.js +0 -319
  78. package/src/tagPair/ext.js +0 -138
  79. package/src/tagPair/include.js +0 -60
  80. package/src/tagPair/index.js +0 -126
  81. package/src/transclude.js +0 -824
  82. package/tool/index.js +0 -1202
  83. package/util/base.js +0 -17
  84. package/util/debug.js +0 -73
  85. package/util/diff.js +0 -76
  86. package/util/lint.js +0 -54
  87. package/util/string.js +0 -107
@@ -0,0 +1,38 @@
1
+ (()=>{var Tt=Object.defineProperty;var yt=(B,D,V)=>D in B?Tt(B,D,{enumerable:!0,configurable:!0,writable:!0,value:V}):B[D]=V;var P=(B,D,V)=>(yt(B,typeof D!="symbol"?D+"":D,V),V),st=(B,D,V)=>{if(!D.has(B))throw TypeError("Cannot "+V)};var x=(B,D,V)=>(st(B,D,"read from private field"),V?V.call(B):D.get(B)),L=(B,D,V)=>{if(D.has(B))throw TypeError("Cannot add the same private member more than once");D instanceof WeakSet?D.add(B):D.set(B,V)},G=(B,D,V,tt)=>(st(B,D,"write to private field"),tt?tt.call(B,V):D.set(B,V),V),nt=(B,D,V,tt)=>({set _(T){G(B,D,T,V)},get _(){return x(B,D,tt)}}),X=(B,D,V)=>(st(B,D,"access private method"),V);(()=>{var B={6010:(T,b,e)=>{"use strict";const f={config:void 0,minConfig:e(8166),MAX_STAGE:11,getConfig(){return{...this.minConfig,...this.config,excludes:[]}},normalizeTitle(u,g=0,r=!1,i=f.getConfig(),s=!1,t=!1,n=!1){let l;if(!s){const a=e(8138);l=this.run(()=>{const A=new a(String(u),i),m=A.getAttribute("parseOnce");return m(0,r),m()}),u=l.firstChild}const o=e(6986);return new o(String(u),g,i,t,n)},parse(u,g,r=f.MAX_STAGE,i=f.getConfig()){if(typeof u!="string")throw new TypeError("\u5F85\u89E3\u6790\u7684\u5185\u5BB9\u5E94\u4E3A String\uFF01");const s=e(8138);let t;return this.run(()=>{t=new s(u,i);try{t.parse(r,g)}catch(n){}}),t},run(u){return u()}},$={},S=new Set(["MAX_STAGE","minConfig"]),p=new Set(["config","normalizeTitle","parse"]);for(const u in f)S.has(u)?$[u]={enumerable:!1,writable:!1}:p.has(u)||($[u]={enumerable:!1});Object.defineProperties(f,$),typeof self=="object"&&(self.Parser=f),T.exports=f},9205:(T,b,e)=>{"use strict";const{print:f}=e(231),$=e(3853),S=e(7507),u=class extends ${constructor(){super(...arguments);P(this,"name")}get length(){return this.childNodes.length}closest(i){const s=new Set(i.split(",").map(n=>n.trim()));let{parentNode:t}=this;for(;t;){if(s.has(t.type))return t;({parentNode:t}=t)}}append(...i){for(const s of i)this.insertAt(s)}replaceChildren(...i){this.childNodes.length=0,this.append(...i)}setText(i,s=0){const t=this.childNodes[s],{type:n,data:l}=t;if(n==="text")return t.replaceData(i),l}toString(i,s=""){return this.childNodes.map(t=>t.toString()).join(s)}lint(i=0){const s=e(8058);if(this instanceof s||this.constructor.hidden||this.type==="ext-inner"&&u.lintIgnoredExt.has(this.name))return[];const t=[];for(let n=0,l=i+this.getPadding();n<this.length;n++){const o=this.childNodes[n];t.push(...o.lint(l)),l+=String(o).length+this.getGaps(n)}return t}print(i={}){return String(this)?`<span class="wpb-${i.class||this.type}">${f(this.childNodes,i)}</span>`:""}json(i){const{childNodes:s,...t}=this;return{...t,childNodes:s.map(l=>l.type==="text"?String(l):l.json())}}};let p=u;P(p,"lintIgnoredExt",new Set(["nowiki","pre","charinsert","score","syntaxhighlight","source","math","chem","ce","graph","mapframe","maplink","quiz","templatedata","timeline"])),T.exports=p},3853:(T,b,e)=>{var S,p,rt;"use strict";const{text:f}=e(231);class ${constructor(){L(this,p);P(this,"type");P(this,"childNodes",[]);L(this,S,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return x(this,S)}get nextSibling(){var i;const r=(i=x(this,S))==null?void 0:i.childNodes;return r&&r[r.indexOf(this)+1]}get previousSibling(){var i;const r=(i=x(this,S))==null?void 0:i.childNodes;return r&&r[r.indexOf(this)-1]}hasAttribute(r){const i=typeof r;return i==="string"||i==="number"||i==="symbol"?r in this:!1}getAttribute(r){return this.hasAttribute(r)?String(this[r]):void 0}setAttribute(r,i){return r==="parentNode"?G(this,S,i):this[r]=i,this}text(r=""){return f(this.childNodes,r)}removeAt(r){const{childNodes:i}=this,[s]=i.splice(r,1);return s}insertAt(r,i=this.childNodes.length){const{childNodes:s}=this;return-1===-1&&r.setAttribute("parentNode",this),s.splice(i,0,r),r}normalize(){var s;const r=e(7507),{childNodes:i}=this;for(let t=i.length-1;t>=0;t--){const{type:n,data:l}=i[t];this.getGaps(t-1)||(l===""?i.splice(t,1):n==="text"&&((s=i[t-1])==null?void 0:s.type)==="text"&&(i[t-1].setAttribute("data",i[t-1].data+l),i.splice(t,1)))}}getRootNode(){let{parentNode:r}=this;for(;r!=null&&r.parentNode;)({parentNode:r}=r);return r!=null?r:this}posFromIndex(r){const i=String(this);if(r>=-i.length&&r<=i.length){const s=i.slice(0,r).split(`
2
+ `);return{top:s.length-1,left:s[s.length-1].length}}}getPadding(){return 0}getGaps(){return 0}getRelativeIndex(r){let i;const s=(t,n)=>i.slice(0,t).reduce((l,o,h)=>l+String(o).length+n.getGaps(h),0)+n.getPadding();if(r===void 0){const{parentNode:t}=this;return t?({childNodes:i}=t,s(i.indexOf(this),t)):0}return{childNodes:i}=this,s(r,this)}get offsetHeight(){return X(this,p,rt).call(this).height}get offsetWidth(){return X(this,p,rt).call(this).width}}S=new WeakMap,p=new WeakSet,rt=function(){const r=String(this).split(`
3
+ `);return{height:r.length,width:r[r.length-1].length}},T.exports=$},7507:(T,b,e)=>{var r,i,it;"use strict";const f=e(6010),$=e(3853),S=e(9205),p=/https?:|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+|<\s*\/?([a-z]\w*)(?=[\s/>])/giu,u=/\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+|<\s*\/?([a-z]\w*)(?=[\s/>])/giu;class g extends ${constructor(l="",o=f.getConfig()){super();L(this,i);L(this,r,void 0);P(this,"type","text");P(this,"data");G(this,r,o),this.data=l}toString(){return this.data}text(){return this.data}lint(l=0){var C;const{data:o,parentNode:h}=this,a=h==null?void 0:h.type,A=h==null?void 0:h.name,m=h==null?void 0:h.parentNode,d=m==null?void 0:m.name,c=(C=m==null?void 0:m.parentNode)==null?void 0:C.name,y=a==="free-ext-link"||a==="ext-link-url"||a==="image-parameter"&&A==="link"?u:p,k=[];if(o.search(y)!==-1){y.lastIndex=0;const w=this.getRootNode(),{top:F,left:E}=w.posFromIndex(l),H=new Set([x(this,r).ext,x(this,r).html].flat(2));for(let N=y.exec(o);N;N=y.exec(o)){const[,I,z]=N;let{0:R,index:Q}=N;I&&(Q+=I.length,R=R.slice(I.length));const O=l+Q,U=o.slice(0,Q).split(`
4
+ `),W=U.length+F-1,Z=U[U.length-1],K=U.length>1?Z.length:E+Z.length,{0:Y,length:q}=R,v=O+q;let j=Y==="{"||Y==="}"||q>1?"error":"warning";if(Y==="h")switch(a){case"ext-link-text":j="warning";break;case"attr-value":if((d==="src"||d==="srcset")&&c==="img")continue;break;case"ext-inner":if(A==="sm2"||A==="flashmp3")continue}else if(Y==="<"&&!H.has(z.toLowerCase()))continue;k.push({message:`\u5B64\u7ACB\u7684"${Y==="h"?R:Y}"`,severity:j,startIndex:O,endIndex:v,startLine:W,endLine:W,startCol:K,endCol:K+q})}}return k}replaceData(l=""){X(this,i,it).call(this,l)}}r=new WeakMap,i=new WeakSet,it=function(l){l=String(l),this.setAttribute("data",l)},T.exports=g},6986:(T,b,e)=>{"use strict";const f=e(6010);class ${constructor(p,u=0,g=f.getConfig(),r=!1,i=!1){P(this,"valid",!0);P(this,"ns",0);P(this,"fragment","");P(this,"encoded",!1);const{namespaces:s,nsid:t}=g;let n=s[u];if(r&&p.includes("%"))try{const a=/%(?!5[bd]|7[b-d])[\da-f]{2}/iu.test(p);p=decodeURIComponent(p),this.encoded=a}catch(a){}p=p.replace(/_/gu," ").trim(),p[0]===":"&&(n="",p=p.slice(1).trim());const l=p.split(":");if(l.length>1){const a=s[t[l[0].trim().toLowerCase()]];a!==void 0&&(n=a,p=l.slice(1).join(":").trim())}this.ns=t[n.toLowerCase()];const o=p.indexOf("#");let h="";o!==-1&&(h=p.slice(o+1).trim(),p=p.slice(0,o).trim()),this.valid=Boolean(p||i&&h)&&!/\0\d+[eh!+-]\x7F|[<>[\]{}|]|%[\da-f]{2}/iu.test(p),this.fragment=h}}T.exports=$},2308:T=>{"use strict";const b=e=>{var f;return f=class extends e{text(){return""}},P(f,"hidden",!0),f};T.exports=b},8275:(T,b,e)=>{"use strict";const{removeComment:f}=e(231),$=e(6010),S=e(9450),p=e(1782),u=e(9544),g=(r,i=$.getConfig(),s=[])=>{var d,c,y,k,C;const t=`${i.excludes.includes("heading")?"":"^(\0\\d+c\x7F)*={1,6}|"}\\[\\[|\\{{2,}|-\\{(?!\\{)`,n=[],l={"=":`
5
+ `,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},o={"!":"!","!!":"+","(!":"{","!)":"}","!-":"-","=":"~"};let h=new RegExp(t,"gmu"),a=h.exec(r),A=r.includes("}}"),m;for(;a||m<=r.length&&((c=(d=n[n.length-1])==null?void 0:d[0])==null?void 0:c[0])==="=";){if(a!=null&&a[1]){const[,{length:U}]=a;a[0]=a[0].slice(U),a.index+=U}const{0:w,index:F}=a!=null?a:{0:`
6
+ `,index:r.length},E=(y=n.pop())!=null?y:{},{0:H,index:N,parts:I,findEqual:z,pos:R}=E,Q=w==="="&&z;if(w==="]]"||w==="}-")m=F+2;else if(w===`
7
+ `){m=F+1;const{pos:U,findEqual:W}=(k=n[n.length-1])!=null?k:{};if(!U||W||f(r.slice(U,N))!==""){const Z=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(r.slice(N,F));Z&&(r=`${r.slice(0,N)}\0${s.length}h\x7F${r.slice(F)}`,m=N+4+String(s.length).length,new S(Z[1].length,Z.slice(2),i,s))}}else if(w==="|"||Q)m=F+1,I[I.length-1].push(r.slice(R,F)),w==="|"&&I.push([]),E.pos=m,E.findEqual=w==="|",n.push(E);else if(w.startsWith("}}")){const U=w.slice(0,Math.min(H.length,3)),W=H.length-U.length,{length:Z}=s;m=F+U.length,I[I.length-1].push(r.slice(R,F));let K=!1,Y="t";if(U.length===3)new u(I.map(q=>q.join("=")),i,s);else{const q=f(I[0][0]).trim();q in o?Y=o[q]:/^(?:fullurl|canonicalurl|filepath):.|^server$/iu.test(q)?Y="m":/^#vardefine:./iu.test(q)&&(Y="c");try{new p(I[0][0],I.slice(1),i,s)}catch(v){if(v instanceof Error&&v.message.startsWith("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0\uFF1A"))m=N+H.length,K=!0;else throw v}}K||(r=`${r.slice(0,N+W)}\0${Z}${Y}\x7F${r.slice(m)}`,m=N+W+3+String(Z).length,W>1?n.push({0:H.slice(0,W),index:N,pos:N+W,parts:[[]]}):W===1&&r[N-1]==="-"&&n.push({0:"-{",index:N-1,pos:N+1,parts:[[]]}))}else m=F+w.length,w[0]==="{"&&(a.pos=m,a.parts=[[]]),n.push(..."0"in E?[E]:[],a);A&&(A=r.slice(m).includes("}}"));let O=n[n.length-1];!A&&((C=O==null?void 0:O[0])==null?void 0:C[0])==="{"&&(n.pop(),O=n[n.length-1]),h=new RegExp(t+(O?`|${l[O[0][0]]}${O.findEqual?"|=":""}`:""),"gmu"),h.lastIndex=m,a=h.exec(r)}return r};T.exports=g},4907:(T,b,e)=>{"use strict";const f=e(6010),$=e(851),S=e(3423),p=e(8655),u=e(7267),g=e(5749),r=(i,s=f.getConfig(),t=[],n=!1)=>{const l=/<onlyinclude>(.*?)<\/onlyinclude>/gsu;if(n&&i.search(l)!==-1)return i.replace(l,(m,d)=>{const c=`\0${t.length}e\x7F`;return new $(d,s,t),c}).replace(/(^|\0\d+e\x7F)(.*?)(?=$|\0\d+e\x7F)/gsu,(m,d,c)=>c===""?d:(new S(c,s,t),`${d}\0${t.length-1}c\x7F`));const o=s.ext.join("|"),h=n?"includeonly":"(?:no|only)include",a=n?"noinclude":"includeonly",A=new RegExp(`<!--.*?(?:-->|$)|<${h}(?:\\s[^>]*?)?>|</${h}\\s*>|<(${o})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|<(${a})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(\\5\\s*)>|$))`,"gisu");return i.replace(A,(m,d,c,y,k,C,w,F,E)=>{const H=`\0${t.length}${d?"e":"c"}\x7F`;if(d)new u(d,c,y,k,s,t);else if(m.startsWith("<!--")){const N=m.endsWith("-->");new g(m.slice(4,N?-3:void 0),N,s,t)}else C?new p(C,w,F,E,s,t):new S(m,s,t);return H})};T.exports=r},3765:(T,b,e)=>{"use strict";const f=e(6010),$=e(9910),S=(p,u=f.getConfig(),g=[])=>{const r=/-\{/gu,i=/-\{|\}-/gu,s=[];let t=r,n=t.exec(p);for(;n;){const{0:l,index:o}=n;if(l==="}-"){const h=s.pop(),{length:a}=g,A=p.slice(h.index+2,o),m=A.indexOf("|"),[d,c]=m===-1?[[],A]:[A.slice(0,m).split(";"),A.slice(m+1)],y=c.replace(/(&[#a-z\d]+);/giu,"$1"),k=`(?:${u.variants.join("|")})`,C=y.split(new RegExp(`;(?=\\s*(?:${k}|[^;]*?=>\\s*${k})\\s*:)`,"u")).map(w=>w.replace(/\x01/gu,";"));new $(d,C,u,g),p=`${p.slice(0,h.index)}\0${a}v\x7F${p.slice(o+2)}`,s.length===0&&(t=r),t.lastIndex=h.index+3+String(a).length}else s.push(n),t=i,t.lastIndex=o+2;n=t.exec(p)}return p};T.exports=S},7513:(T,b,e)=>{"use strict";const{extUrlChar:f,extUrlCharFirst:$}=e(231),S=e(6010),p=e(741),u=(g,r=S.getConfig(),i=[])=>{const s=new RegExp(`\\[((?:(?:${r.protocol}|//)${$}|\0\\d+m\x7F)${f})(\\p{Zs}*)([^\\]-\b
8
+ -\uFFFD]*)\\]`,"giu");return g.replace(s,(t,n,l,o)=>{const{length:h}=i,a=/&[lg]t;/u.exec(n);return a&&(n=n.slice(0,a.index),l="",o=`${n.slice(a.index)}${l}${o}`),new p(n,l,o,r,i),`\0${h}w\x7F`})};T.exports=u},2937:(T,b,e)=>{"use strict";const f=e(6010),$=e(7507),S=e(8138),p=e(2582),u=e(7815),g=({firstChild:{data:r},type:i,name:s},t=f.getConfig(),n=[])=>{const{doubleUnderscore:l}=t,o=new Set(l[0]),h=new Set(l[1]);return i!=="root"&&(i!=="ext-inner"||s!=="poem")&&(r=`\0${r}`),r=r.replace(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(a,A,m)=>(new p(m.length,t,n),`${A}\0${n.length-1}r\x7F`)).replace(new RegExp(`__(${l.flat().join("|")})__`,"giu"),(a,A)=>o.has(A.toLowerCase())||h.has(A)?(new u(A,t,n),`\0${n.length-1}u\x7F`):a),i==="root"||i==="ext-inner"&&s==="poem"?r:r.slice(1)};T.exports=g},5130:(T,b,e)=>{"use strict";const f=e(6010),$=e(5649),S=e(2350),p=(u,g=f.getConfig(),r=[])=>{const i=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,s=new Set(g.html.flat()),t=u.split("<");let n=t.shift();for(const l of t){const o=i.exec(l),h=o==null?void 0:o[2],a=h==null?void 0:h.toLowerCase();if(!o||!s.has(a)){n+=`<${l}`;continue}const[,A,,m="",d,c]=o,y=new $(m,"html-attrs",a,g,r),k=y.getAttr("itemprop");if(a==="meta"&&(k===void 0||y.getAttr("content")===void 0)||a==="link"&&(k===void 0||y.getAttr("href")===void 0)){n+=`<${l}`,r.pop();continue}n+=`\0${r.length}x\x7F${c}`,new S(h,y,A==="/",d==="/>",g,r)}return n};T.exports=p},1452:(T,b,e)=>{"use strict";const f=e(6010),$=e(3905),S=e(7625),p=e(337),u=(g,r=f.getConfig(),i=[])=>{const s=e(3360),t=r.inExt?/^((?:(?!\0\d+!\x7F)[^\n<>[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n<>[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,n=/^((?:(?!\0\d+!\x7F)[^\n<>[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,l=new RegExp(`^\\s*(?:${r.protocol})`,"iu"),o=g.split("[[");let h=o.shift();for(let a=0;a<o.length;a++){let A,m,d,c,y;const k=o[a],C=t.exec(k);if(C)[,m,d,c,y]=C,y[0]==="]"&&(c==null?void 0:c.includes("["))&&(c+="]",y=y.slice(1));else{const I=n.exec(k);I&&(A=!0,[,m,d,c]=I)}if(m===void 0||l.test(m)||/\0\d+[exhbru]\x7F/u.test(m)){h+=`[[${k}`;continue}const w=m.trim()[0]===":";if(w&&A){h+=`[[${k}`;continue}const F=f.normalizeTitle(m,0,!1,r,!0,!0,!0),{ns:E,valid:H}=F;if(H){if(A){if(E!==6){h+=`[[${k}`;continue}let I;for(a++;a<o.length;a++){const z=o[a],R=z.split("]]");if(R.length>2){I=!0,c+=`[[${R[0]}]]${R[1]}`,y=R.slice(2).join("]]");break}else if(R.length===2)c+=`[[${R[0]}]]${R[1]}`;else{c+=`[[${z}`;break}}if(c=u(c,r,i),!I){h+=`[[${m}${d}${c}`;continue}}}else{h+=`[[${k}`;continue}c&&(c=s(c,r,i)),h+=`\0${i.length}l\x7F${y}`;let N=$;w||(E===6?N=S:E===14&&(N=p)),c===void 0&&d&&(c=""),new N(m,c,F,r,i,d)}return h};T.exports=u},6622:(T,b,e)=>{"use strict";const f=e(6010),$=e(962),S=e(3434),p=(u,g=f.getConfig(),r=[])=>{const i=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(u);if(!i)return u;const[s,t,n]=i;u=`${t}\0${r.length}d\x7F${u.slice(s.length)}`,new $(n,g,r);let l=n.split(";").length-1;if(!l)return u;let o=/:+|-\{/gu,h=o.exec(u),a=0;for(;h&&l;){const{0:A,index:m}=h;if(A[0]===":"){if(A.length>=l)return new S(":".repeat(l),g,r),`${u.slice(0,m)}\0${r.length-1}d\x7F${u.slice(m+l)}`;u=`${u.slice(0,m)}\0${r.length}d\x7F${u.slice(o.lastIndex)}`,l-=A.length,o.lastIndex=m+4+String(r.length).length,new S(A,g,r)}else if(A==="-{"){if(!a){const{lastIndex:d}=o;o=/-\{|\}-/gu,o.lastIndex=d}a++}else if(a--,!a){const{lastIndex:d}=o;o=/:+|-\{/gu,o.lastIndex=d}h=o.exec(u)}return u};T.exports=p},4737:(T,b,e)=>{"use strict";const{extUrlChar:f,extUrlCharFirst:$}=e(231),S=e(6010),p=e(8962),u=(g,r=S.getConfig(),i=[])=>{const s=new RegExp(`(^|[^\\p{L}\\d_])(?:${r.protocol})(${$}${f})`,"giu");return g.replace(s,(t,n,l)=>{let o="",h=n?t.slice(1):t;const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(h);a&&(o=h.slice(a.index),h=h.slice(0,a.index));const A=new RegExp(`[,;.:!?${h.includes("(")?"":")"}]+$`,"u"),m=A.exec(h);if(m){let d=0;m[0][0]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(h.slice(0,m.index))&&(d=1),o=`${h.slice(m.index+d)}${o}`,h=h.slice(0,m.index+d)}return o.length>=l.length?t:(new p(h,!1,r,i),`${n}\0${i.length-1}w\x7F${o}`)})};T.exports=u},3360:(T,b,e)=>{"use strict";const f=e(6010),$=e(6714),S=(p,u=f.getConfig(),g=[])=>{var h;const r=p.split(/('{2,})/u),{length:i}=r;if(i===1)return p;let s=0,t=0,n,l,o;for(let a=1;a<i;a+=2){const{length:A}=r[a];switch(A){case 2:t++;break;case 4:r[a-1]+="'",r[a]="'''";case 3:if(s++,n)break;r[a-1].endsWith(" ")?!l&&!o&&(o=a):r[a-1].slice(-2,-1)===" "?n=a:l||(l=a);break;default:r[a-1]+="'".repeat(A-5),r[a]="'''''",t++,s++}}if(t%2===1&&s%2===1){const a=(h=n!=null?n:l)!=null?h:o;r[a]="''",r[a-1]+="'"}for(let a=1;a<i;a+=2)new $(r[a].length,u,g),r[a]=`\0${g.length-1}q\x7F`;return r.join("")};T.exports=S},4624:(T,b,e)=>{"use strict";const f=e(6010),$=e(7507),S=e(8138),p=e(2840),u=e(3125),g=e(5567),r=e(3434),i=({firstChild:{data:s},type:t,name:n},l=f.getConfig(),o=[])=>{const h=[],a=s.split(`
9
+ `);let A=t==="root"||t==="parameter-value"||t==="ext-inner"&&n==="poem"?"":`
10
+ ${a.shift()}`;const m=(d,c)=>{if(!c){A+=d;return}const{lastChild:y}=c;if(y.constructor===S)y.setText(String(y)+d);else{const k=new S(d,l,!0,o);k.type="table-inter",c.insertAt(k.setAttribute("stage",3))}};for(const d of a){let c=h.pop();const[y]=/^(?:\s|\0\d+c\x7F)*/u.exec(d),k=d.slice(y.length),C=/^(:*)((?:\s|\0\d+c\x7F)*)(\{\||\{(?:\0\d+c\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(k);if(C){for(;c&&c.type!=="td";)c=h.pop();const[,I,z,R,Q]=C;I&&new r(I,l,o),m(`
11
+ ${y}${I&&`\0${o.length-1}d\x7F`}${z}\0${o.length}b\x7F`,c);const O=new p(R,Q,l,o);h.push(...c?[c]:[],O);continue}else if(!c){A+=`
12
+ ${d}`;continue}const w=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(k);if(!w){m(`
13
+ ${d}`,c),h.push(...c?[c]:[]);continue}const[,F,E,H,N]=w;if(F){for(;!(c instanceof p);)c=h.pop();c.close(`
14
+ ${y}${F}`,!0),m(N,h[h.length-1])}else if(E){c.type==="td"&&(c=h.pop()),c.type==="tr"&&(c=h.pop());const I=new u(`
15
+ ${y}${E}`,N,l,o);h.push(c,I),c.insertAt(I)}else{c.type==="td"&&(c=h.pop());const I=H==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let z=I.exec(N),R=0,Q=`
16
+ ${y}${H}`;for(;z;){const U=new g(Q,N.slice(R,z.index),l,o);c.insertAt(U),{lastIndex:R}=I,[Q]=z,z=I.exec(N)}const O=new g(Q,N.slice(R),l,o);h.push(c,O),c.insertAt(O)}}return A.slice(1)};T.exports=i},9544:(T,b,e)=>{"use strict";const{text:f}=e(231),{generateForSelf:$,generateForChild:S}=e(8277),p=e(6010),u=e(8138);class g extends u{constructor(s,t=p.getConfig(),n=[]){super(void 0,t,!0,n,{});P(this,"type","arg");for(let l=0;l<s.length;l++)if(l===0||l>1){const o=e(l===0?9237:9263),h=new o(s[l],l===0?"arg-name":void 0,t,n,{});super.insertAt(h)}else{const o=new u(s[l],t,!0,n);o.type="arg-default",super.insertAt(o.setAttribute("stage",2))}}get default(){var s,t;return(t=(s=this.childNodes[1])==null?void 0:s.text())!=null?t:!1}toString(s){return`{{{${super.toString(s,"|")}}}}`}text(){return`{{{${f(this.childNodes.slice(0,2),"|")}}}}`}getPadding(){return 3}getGaps(){return 1}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}lint(s=0){if(!this.getAttribute("include"))return[$(this,{start:s},"\u672A\u9884\u671F\u7684\u6A21\u677F\u53C2\u6570")];const{childNodes:[t,n,...l]}=this,o=t.lint(s+3);if(n&&o.push(...n.lint(s+4+String(t).length)),l.length>0){const h={start:s,...this.getRootNode().posFromIndex(s)};o.push(...l.map(a=>S(a,h,"\u4E09\u91CD\u62EC\u53F7\u5185\u7684\u4E0D\u53EF\u89C1\u90E8\u5206")))}return o}}T.exports=g},9263:(T,b,e)=>{"use strict";const f=e(2308),$=e(9237);class S extends f($){constructor(){super(...arguments);P(this,"type","hidden")}}T.exports=S},9237:(T,b,e)=>{"use strict";const f=e(6010),$=e(8138);class S extends ${constructor(g,r,i=f.getConfig(),s=[],t=void 0){super(g,i,!0,s,t);P(this,"type","plain");r&&(this.type=r)}}T.exports=S},5037:(T,b,e)=>{var d,c,y;"use strict";const{generateForChild:f}=e(8277),{removeComment:$}=e(231),S=e(6010),p=e(8138),u=e(9237),g=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),r=new Set(["align"]),i=new Set(["cite"]),s=new Set(["cite","datetime"]),t=new Set(["width"]),n=new Set(["align","valign","abbr","axis","headers","scope","rowspan","colspan","width","height","bgcolor"]),l=new Set(["type"]),o={div:r,h1:r,h2:r,h3:r,h4:r,h5:r,h6:r,blockquote:i,q:i,p:r,br:new Set(["clear"]),pre:t,ins:s,del:s,ul:l,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set(["summary","width","border","frame","rules","cellspacing","cellpadding","align","bgcolor"]),caption:r,tr:new Set(["bgcolor","align","valign"]),td:n,th:n,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:t,rt:new Set(["rbspan"]),data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails","type"]),poem:new Set(["compact","align"]),categorytree:new Set(["align","hideroot","onlyroot","depth","mode","hideprefix"]),combooption:new Set(["name","for","inline","align"])},h=new Set,a={nowiki:h,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:h,inputbox:h,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:h,poll:new Set(["id","show-results-before-voting"]),sm2:l,flashmp3:l,tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"])},A=new RegExp("expression|(?:filter|accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u");class m extends p{constructor(w,F,E,H="",N="",I=[],z=S.getConfig(),R=[]){const Q=new u(E,"attr-key",z,R,{});let O;if(E==="title")O=new p(N,z,!0,R,{}).setAttribute("type","attr-value").setAttribute("stage",S.MAX_STAGE-1);else if(F==="gallery"&&E==="caption"){const U={...z,excludes:[...z.excludes,"quote","extLink","magicLink","list"]};O=new p(N,U,!0,R,{}).setAttribute("type","attr-value").setAttribute("stage",5)}else if(F==="choose"&&(E==="before"||E==="after")){const U={...z,excludes:[...z.excludes,"heading","html","table","hr","list"]};O=new p(N,U,!0,R,{}).setAttribute("type","attr-value").setAttribute("stage",1)}else O=new u(N,"attr-value",z,R,{});super(void 0,z,!0,R);L(this,d,void 0);L(this,c,void 0);L(this,y,void 0);this.type=w,this.append(Q,O),G(this,d,H),G(this,c,I),G(this,y,F),this.setAttribute("name",$(E).trim().toLowerCase())}get balanced(){return!x(this,d)||x(this,c)[0]===x(this,c)[1]}get value(){return this.getValue()}get tag(){return x(this,y)}afterBuild(){x(this,d).includes("\0")&&G(this,d,this.getAttribute("buildFromStr")(x(this,d),"string")),this.parentNode&&G(this,y,this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(w){const[F="",E=""]=x(this,c);return x(this,d)?`${super.toString(w,`${x(this,d)}${F}`)}${E}`:this.firstChild.toString(w)}text(){return x(this,d)?`${super.text(`${x(this,d).trim()}"`)}"`:this.firstChild.text()}getGaps(){var w,F;return x(this,d)?x(this,d).length+((F=(w=x(this,c)[0])==null?void 0:w.length)!=null?F:0):0}print(){const[w="",F=""]=x(this,c);return x(this,d)?super.print({sep:`${x(this,d)}${w}`,post:F}):super.print()}lint(w=0){var W;const F=super.lint(w),{balanced:E,firstChild:H,lastChild:N,type:I,name:z,parentNode:R,value:Q}=this,O=R==null?void 0:R.name;let U;if(!E){const Z=this.getRootNode();U={start:w,...Z.posFromIndex(w)};const K=f(N,U,"\u672A\u95ED\u5408\u7684\u5F15\u53F7","warning"),Y=K.startIndex-1,q=K.startCol-1;F.push({...K,startIndex:Y,startCol:q})}return!/\{\{[^{]+\}\}/u.test(z)&&(I==="ext-attr"&&!(O in o)&&a[O]&&!a[O].has(z)||(I==="html-attr"||I==="table-attr"||O in o)&&!((W=o[O])!=null&&W.has(z))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(z)&&(O==="meta"||O==="link"||!g.has(z)))?(U||(U={start:w,...this.getRootNode().posFromIndex(w)}),F.push(f(H,U,"\u975E\u6CD5\u7684\u5C5E\u6027\u540D"))):z==="style"&&typeof Q=="string"&&A.test(Q)&&(U||(U={start:w,...this.getRootNode().posFromIndex(w)}),F.push(f(N,U,"\u4E0D\u5B89\u5168\u7684\u6837\u5F0F"))),F}getValue(){return x(this,d)?this.lastChild.text():!0}}d=new WeakMap,c=new WeakMap,y=new WeakMap,T.exports=m},5649:(T,b,e)=>{"use strict";const{generateForSelf:f,generateForChild:$}=e(8277),{removeComment:S}=e(231),p=e(6010),u=e(8138),g=e(9237),r=e(5037);class i extends u{constructor(t,n,l,o=p.getConfig(),h=[]){if(super(void 0,o,!0,h,{}),this.type=n,this.setAttribute("name",l),t){const a=new RegExp(`([^\\s/](?:(?!\0\\d+~\x7F)[^\\s/=])*)(?:((?:\\s|\0\\d+c\x7F)*(?:=|\0\\d+~\x7F)(?:\\s|\0\\d+c\x7F)*)(?:(["'])(.*?)(\\3|$)|(\\S*)))?`,"gsu");let A="",m=a.exec(t),d=0;const c=()=>{A&&(super.insertAt(new g(A,`${n.slice(0,-1)}-dirty`,o,h,{})),A="")};for(;m;){const{index:y,0:k,1:C,2:w,3:F,4:E,5:H,6:N}=m;if(A+=t.slice(d,y),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(S(C).trim())){const I=E!=null?E:N,z=[F,H],R=new r(n.slice(0,-1),l,C,w,I,z,o,h);c(),super.insertAt(R)}else A+=k;({lastIndex:d}=a),m=a.exec(t)}A+=t.slice(d),c()}}afterBuild(){var n,l;const t=e(5567);this.type==="table-attrs"&&this.setAttribute("name",((n=this.parentNode)==null?void 0:n.subtype)==="caption"?"caption":(l=this.parentNode)==null?void 0:l.type)}getAttrTokens(t){return this.childNodes.filter(n=>n instanceof r&&n.name===t.toLowerCase().trim())}getAttrToken(t){const n=this.getAttrTokens(t);return n[n.length-1]}getAttr(t){var n;return(n=this.getAttrToken(t))==null?void 0:n.getValue()}lint(t=0){const n=e(2350),l=super.lint(t),{parentNode:{closing:o},length:h,childNodes:a}=this,A={},m=new Set;let d;o&&this.text().trim()&&(d={start:t,...this.getRootNode().posFromIndex(t)},l.push(f(this,d,"\u4F4D\u4E8E\u95ED\u5408\u6807\u7B7E\u7684\u5C5E\u6027")));for(let c=0;c<h;c++){const y=a[c];if(y instanceof g&&y.text().trim())d||(d={start:t,...this.getRootNode().posFromIndex(t)}),l.push($(y,d,"\u5305\u542B\u65E0\u6548\u5C5E\u6027"));else if(y instanceof r){const{name:k}=y;k in A?(m.add(k),A[k].push(y)):k!=="class"&&(A[k]=[y])}}if(m.size>0){d||(d={start:t,...this.getRootNode().posFromIndex(t)});for(const c of m)l.push(...A[c].map(y=>$(y,d,`\u91CD\u590D\u7684${c}\u5C5E\u6027`)))}return l}print(){const t=e(2350);return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(n=>n.print({class:n instanceof g&&n.text().trim()&&"hidden"})).join("")}</span>`:""}}T.exports=i},9910:(T,b,e)=>{"use strict";const{text:f,print:$}=e(231),S=e(6010),p=e(8138),u=e(6719),g=e(8683);class r extends p{constructor(t,n,l=S.getConfig(),o=[]){super(void 0,l,!0,o);P(this,"type","converter");this.append(new u(t,l,o));const[h]=n,a=h.includes(":"),A=new g(h,a,l,o);a&&A.length===1?this.insertAt(new g(n.join(";"),!1,l,o)):this.append(A,...n.slice(1).map(m=>new g(m,!0,l,o)))}toString(t){const{childNodes:[n,...l]}=this;return`-{${n.toString()}${n.length>0?"|":""}${l.map(String).join(";")}}-`}text(){const{childNodes:[t,...n]}=this;return`-{${t.text()}|${f(n,";")}}-`}getPadding(){return 2}getGaps(t=0){return t=t<0?t+this.length:t,t||this.firstChild.length>0?1:0}print(){const{childNodes:[t,...n]}=this;return`<span class="wpb-converter">-{${t.print()}${t.length>0?"|":""}${$(n,{sep:";"})}}-</span>`}}T.exports=r},6719:(T,b,e)=>{var r;"use strict";const{generateForChild:f}=e(8277),$=e(6010),S=e(8138),p=e(9237),u=new Set(["A","T","R","D","-","H","N"]);class g extends S{constructor(t,n=$.getConfig(),l=[]){super(void 0,n,!0,l,{});P(this,"type","converter-flags");L(this,r,void 0);this.append(...t.map(o=>new p(o,"converter-flag",n,l)))}afterBuild(){G(this,r,this.childNodes.map(t=>t.text().trim()))}toString(t){return super.toString(t,";")}text(){return super.text(";")}getGaps(){return 1}print(){return super.print({sep:";"})}lint(t=0){const n=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(x(this,r).filter(y=>u.has(y))),{length:h}=x(this,r).filter(y=>!y),a=x(this,r).length-l.size-h,A=super.lint(t);if(n.size===a||o.size===a)return A;const m={start:t,...this.getRootNode().posFromIndex(t)},{childNodes:d,length:c}=this;for(let y=0;y<c;y++){const k=d[y],C=k.text().trim();if(C&&!n.has(C)&&!l.has(C)&&(n.size>0||!o.has(C))){const w=f(k,m,"\u65E0\u6548\u7684\u8F6C\u6362\u6807\u8BB0");A.push(w)}}return A}getUnknownFlags(){return new Set(x(this,r).filter(t=>/\{\{[^{}]+\}\}/u.test(t)))}getVariantFlags(){const t=new Set(this.getAttribute("config").variants);return new Set(x(this,r).filter(n=>t.has(n)))}}r=new WeakMap,T.exports=g},8683:(T,b,e)=>{"use strict";const f=e(6010),$=e(8138),S=e(9237);class p extends ${constructor(r,i=!0,s=f.getConfig(),t=[]){super(void 0,s,!0,t);P(this,"type","converter-rule");if(i){const n=r.indexOf(":"),l=r.slice(0,n).indexOf("=>"),o=l===-1?r.slice(0,n):r.slice(l+2,n),{variants:h}=s;h.includes(o.trim())?(super.insertAt(new S(o,"converter-rule-variant",s,t)),super.insertAt(new S(r.slice(n+1),"converter-rule-to",s,t)),l!==-1&&super.insertAt(new S(r.slice(0,l),"converter-rule-from",s,t),0)):super.insertAt(new S(r,"converter-rule-noconvert",s,t))}else super.insertAt(new S(r,"converter-rule-noconvert",s,t))}toString(r){if(this.length===3){const{childNodes:[i,s,t]}=this;return`${i.toString(r)}=>${s.toString(r)}:${t.toString(r)}`}return super.toString(r,":")}text(){if(this.length===3){const{childNodes:[r,i,s]}=this;return`${r.text()}=>${i.text()}:${s.text()}`}return super.text(":")}getGaps(r=0){const{length:i}=this;return r=r<0?r+i:r,r===0&&i===3?2:1}print(){if(this.length===3){const{childNodes:[r,i,s]}=this;return`<span class="wpb-converter-rule">${r.print()}=>${i.print()}:${s.print()}</span>`}return super.print({sep:":"})}}T.exports=p},741:(T,b,e)=>{var u;"use strict";const f=e(6010),$=e(8138),S=e(8962);class p extends ${constructor(i,s,t,n=f.getConfig(),l=[]){super(void 0,n,!0,l,{});P(this,"type","ext-link");L(this,u,void 0);if(this.insertAt(new S(i,!0,n,l)),G(this,u,s),t){const o=new $(t,n,!0,l,{});o.type="ext-link-text",this.insertAt(o.setAttribute("stage",f.MAX_STAGE-1))}}toString(i){return this.length===1?`[${super.toString(i)}${x(this,u)}]`:`[${super.toString(i,x(this,u))}]`}text(){return`[${super.text(" ")}]`}getPadding(){return 1}getGaps(){return x(this,u).length}print(){const{length:i}=this;return super.print(i>1?{pre:"[",sep:x(this,u),post:"]"}:{pre:"[",post:`${x(this,u)}]`})}}u=new WeakMap,T.exports=p},1891:(T,b,e)=>{"use strict";const f=e(6010),$=e(8138),S=e(1031),p=e(9263);class u extends ${constructor(i,s=f.getConfig(),t=[]){var l;super(void 0,s,!0,t,{});P(this,"type","ext-inner");P(this,"name","gallery");const n={...s,img:{...s.img}};for(const[o,h]of Object.entries(s.img))h==="width"&&delete n.img[o];for(const o of(l=i==null?void 0:i.split(`
17
+ `))!=null?l:[]){const h=/^([^|]+)(?:\|(.*))?/u.exec(o);if(!h){super.insertAt(o.trim()?new p(o,void 0,n,[],{}):o);continue}const[,a,A]=h,m=this.normalizeTitle(a,6,!0,!0);m.valid?super.insertAt(new S(a,A,m,n,t)):super.insertAt(new p(o,void 0,n,[],{}))}}toString(i){return super.toString(i,`
18
+ `)}text(){return super.text(`
19
+ `).replace(/\n\s*\n/gu,`
20
+ `)}getGaps(){return 1}print(){return super.print({sep:`
21
+ `})}lint(i=0){const{top:s,left:t}=this.getRootNode().posFromIndex(i),n=[];for(let l=0,o=i;l<this.length;l++){const h=this.childNodes[l],a=String(h),{length:A}=a,m=a.trim(),d=s+l,c=l?0:t;h.type==="hidden"&&m&&!/^<!--.*-->$/u.test(m)?n.push({message:"\u56FE\u5E93\u4E2D\u7684\u65E0\u6548\u5185\u5BB9",severity:"error",startIndex:o,endIndex:o+A,startLine:d,endLine:d,startCol:c,endCol:c+A}):h.type!=="hidden"&&h.type!=="text"&&n.push(...h.lint(o)),o+=A+1}return n}}T.exports=u},2158:(T,b,e)=>{"use strict";const f=e(6010),$=e(8138),S=e(3423);class p extends ${constructor(g,r,i=f.getConfig(),s=[]){g=g.replace(/(<nowiki>)(.*?)(<\/nowiki>)/giu,(t,n,l,o)=>(new S(n,i,s),new S(o,i,s),`\0${s.length-1}c\x7F${l}\0${s.length}c\x7F`)),super(g,i,!0,s,{}),this.type=r}}T.exports=p},428:(T,b,e)=>{"use strict";const f=e(6010),$=e(2158);class S extends ${constructor(g,r=f.getConfig(),i=[]){super(g,"ext-inner",r,i);P(this,"name","pre");this.setAttribute("stage",f.MAX_STAGE-1)}isPlain(){return!0}}T.exports=S},9450:(T,b,e)=>{"use strict";const{generateForSelf:f}=e(8277),$=e(6010),S=e(8138),p=e(8058);class u extends S{constructor(i,s,t=$.getConfig(),n=[]){super(void 0,t,!0,n);P(this,"type","heading");this.setAttribute("name",String(i));const l=new S(s[0],t,!0,n);l.type="heading-title",l.setAttribute("stage",2);const o=new p(s[1],/^[^\S\n]*$/u,"heading-trail",t,n,{});this.append(l,o)}toString(i){const s="=".repeat(Number(this.name));return`${s}${this.firstChild.toString()}${s}${this.lastChild.toString()}`}text(){const i="=".repeat(Number(this.name));return`${i}${this.firstChild.text()}${i}`}getPadding(){return super.getPadding()+Number(this.name)}getGaps(){return Number(this.name)}print(){const i="=".repeat(Number(this.name));return super.print({pre:i,sep:i})}lint(i=0){const s=super.lint(i),t=String(this.firstChild);let n;return this.name==="1"&&(n=f(this,{start:i},"<h1>"),s.push(n)),(t[0]==="="||t.endsWith("="))&&(n||(n=f(this,{start:i},"")),s.push({...n,message:'\u6BB5\u843D\u6807\u9898\u4E2D\u4E0D\u5E73\u8861\u7684"="'})),this.closest("html-attrs, table-attrs")&&(n||(n=f(this,{start:i},"")),s.push({...n,message:"HTML\u6807\u7B7E\u5C5E\u6027\u4E2D\u7684\u6BB5\u843D\u6807\u9898"})),s}}T.exports=u},2350:(T,b,e)=>{var u,g,r;"use strict";const{generateForSelf:f}=e(8277),$=e(6010),S=e(8138);class p extends S{constructor(t,n,l,o,h=$.getConfig(),a=[]){super(void 0,h,!0,a);P(this,"type","html");L(this,u,void 0);L(this,g,void 0);L(this,r,void 0);this.insertAt(n),this.setAttribute("name",t.toLowerCase()),G(this,u,l),G(this,g,o),G(this,r,t)}get closing(){return x(this,u)}toString(t){return`<${x(this,u)?"/":""}${x(this,r)}${super.toString()}${x(this,g)?"/":""}>`}text(){return`<${x(this,u)?"/":""}${x(this,r)}${x(this,u)?"":super.text()}${x(this,g)?"/":""}>`}getPadding(){return x(this,r).length+(x(this,u)?2:1)}print(){return super.print({pre:`&lt;${x(this,u)?"/":""}${x(this,r)}`,post:`${x(this,g)?"/":""}&gt;`})}lint(t=0){const n=super.lint(t);let l;this.name==="h1"&&!x(this,u)&&(l=f(this,{start:t},"<h1>"),n.push(l)),this.closest("table-attrs")&&(l||(l=f(this,{start:t},"")),n.push({...l,message:"\u8868\u683C\u5C5E\u6027\u4E2D\u7684HTML\u6807\u7B7E"}));try{this.findMatchingTag()}catch({message:o}){l||(l=f(this,{start:t},""));const[h]=o.split("\uFF1A"),a={...l,message:h,severity:h==="\u672A\u95ED\u5408\u7684\u6807\u7B7E"?"warning":"error"};n.push(a)}return n}findMatchingTag(){const{html:t}=this.getAttribute("config"),{name:n,parentNode:l}=this,o=String(this);if(x(this,u)&&(x(this,g)||t[2].includes(n)))throw new SyntaxError(`\u540C\u65F6\u95ED\u5408\u548C\u81EA\u5C01\u95ED\u7684\u6807\u7B7E\uFF1A${o}`);if(t[2].includes(n)||x(this,g)&&t[1].includes(n))return this;if(x(this,g)&&t[0].includes(n))throw new SyntaxError(`\u65E0\u6548\u81EA\u5C01\u95ED\u6807\u7B7E\uFF1A${o}`);if(!l)return;const{childNodes:h}=l,a=h.indexOf(this),A=x(this,u)?h.slice(0,a).reverse().filter(({type:d,name:c})=>d==="html"&&c===n):h.slice(a+1).filter(({type:d,name:c})=>d==="html"&&c===n);let m=x(this,u)?-1:1;for(const d of A)if(d.closing?m--:m++,m===0)return d;throw new SyntaxError(`\u672A${x(this,u)?"\u5339\u914D\u7684\u95ED\u5408":"\u95ED\u5408\u7684"}\u6807\u7B7E\uFF1A${o}`)}}u=new WeakMap,g=new WeakMap,r=new WeakMap,T.exports=p},1874:(T,b,e)=>{var r,ot,s;"use strict";const{print:f,extUrlChar:$,extUrlCharFirst:S}=e(231),p=e(6010),u=e(8138),n=class extends u{constructor(h,a=p.getConfig(),A=[]){var o=(...t)=>{super(...t);P(this,"type","image-parameter");L(this,s,"")};var c;const m=Object.entries(a.img).map(([y,k])=>[y,k,new RegExp(`^(\\s*)${y.replace("$1","(.*)")}(\\s*)$`,"u")]),d=m.find(([,,y])=>y.test(h));if(d){const y=d[2].exec(h);if(y.length!==4||X(c=n,r,ot).call(c,d[1],y[2],a,!0)){y.length===3?(o(void 0,a,!0,A),G(this,s,h)):(o(y[2],a,!0,A,{}),G(this,s,`${y[1]}${d[0]}${y[3]}`)),this.setAttribute("name",d[1]);return}}o(h,{...a,excludes:[...a.excludes,"list"]},!0,A),this.setAttribute("name","caption").setAttribute("stage",7)}isPlain(){return this.name==="caption"}toString(h){return x(this,s)?x(this,s).replace("$1",super.toString(h)):super.toString(h)}text(){return x(this,s)?x(this,s).replace("$1",super.text()).trim():super.text().trim()}getPadding(){return Math.max(0,x(this,s).indexOf("$1"))}print(){return x(this,s)?`<span class="wpb-image-parameter">${x(this,s).replace("$1",`<span class="wpb-image-caption">${f(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};let g=n;r=new WeakSet,ot=function(h,a,A=p.getConfig(),m=!1){switch(a=a.replace(/\0\d+t\x7F/gu,"").trim(),h){case"width":return/^\d*(?:x\d*)?$/u.test(a);case"link":return!a||new RegExp(`(?:(?:${A.protocol}|//)${S}|\0\\d+m\x7F)${$}(?=\0\\d+t\x7F|$)`,"iu").test(a)?!0:(a.startsWith("[[")&&a.endsWith("]]")&&(a=a.slice(2,-2)),p.normalizeTitle(a,0,!1,A,m,!0,!0).valid);case"lang":return A.variants.includes(a);case"alt":case"class":case"manualthumb":return!0;default:return!isNaN(a)}},s=new WeakMap,L(g,r),T.exports=g},2641:(T,b,e)=>{"use strict";const{generateForSelf:f,generateForChild:$}=e(8277),S=e(6010),p=e(8138),u=e(3423),g=e(1031),r=e(2571);class i extends p{constructor(n,l=S.getConfig(),o=[]){super(void 0,l,!0,o,{});P(this,"type","ext-inner");P(this,"name","imagemap");if(!n)return;const h=n.split(`
22
+ `),a=new Set(l.protocol.split("|")),A=u,m=y=>{super.insertAt(new A(y,l,o))};let d=!0,c=!1;for(const y of h){const k=y.trim();if(!(c||!k||k[0]==="#")){if(d){const[C,...w]=y.split("|"),F=this.normalizeTitle(C,0,!0);if(F.valid&&!F.interwiki&&F.ns===6){const E=new g(C,w.length>0?w.join("|"):void 0,F,l,o);E.type="imagemap-image",super.insertAt(E),d=!1;continue}else c=!0}else if(y.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(y);continue}else if(y.includes("[")){const C=y.indexOf("["),w=y.slice(C),F=/^\[{2}([^|]+)(?:\|([^\]]+))?\]{2}[\w\s]*$/u.exec(w);if(F){const E=this.normalizeTitle(F[1],0,!0,!1,!0);if(E.valid){super.insertAt(new r(y.slice(0,C),[...F.slice(1),E],w.slice(w.indexOf("]]")+2),l,o));continue}}else if(a.has(w.slice(1,w.indexOf(":")+1))||a.has(w.slice(1,w.indexOf("//")+2))){const E=/^\[([^\]\s]+)(?:(\s+)(\S[^\]]*)?)?\][\w\s]*$/u.exec(w);if(E){super.insertAt(new r(y.slice(0,C),E.slice(1),w.slice(w.indexOf("]")+1),l,o));continue}}}}m(y)}}get image(){return this.childNodes.find(({type:n})=>n==="imagemap-image")}toString(n){return super.toString(n,`
23
+ `)}text(){return super.text(`
24
+ `).replace(/\n{2,}/gu,`
25
+ `)}getGaps(){return 1}print(){return super.print({sep:`
26
+ `})}lint(n=0){const l=super.lint(n),o={start:n,...this.getRootNode().posFromIndex(n)};return this.image?l.push(...this.childNodes.filter(h=>{const a=String(h).trim();return h.type==="noinclude"&&a&&a[0]!=="#"}).map(h=>$(h,o,"\u65E0\u6548\u7684<imagemap>\u94FE\u63A5"))):l.push(f(this,o,"\u7F3A\u5C11\u56FE\u7247\u7684<imagemap>")),l}}T.exports=i},2571:(T,b,e)=>{"use strict";const f=e(6986),$=e(8138),S=e(3423),p=e(3905),u=e(741);class g extends ${constructor(s,t,n,l,o){const h=t[2]instanceof f?p:u;super(void 0,l,!0,o);P(this,"type","imagemap-link");this.append(s,new h(...t,l,o),new S(n,l,o))}}T.exports=g},8138:(T,b,e)=>{var r,i,s,t,n,l,o,h,lt,A,ht,d,at,y,dt,C,ut,F,pt,H,ct,I,gt,R,ft,O,xt,W,mt;"use strict";const{text:f}=e(231),$=e(6010),S=e(9205),p=e(7507),{MAX_STAGE:u}=$,K=class extends S{constructor(v,j=$.getConfig(),M=!1,J=[],_=void 0){super();L(this,h);L(this,A);L(this,d);L(this,y);L(this,C);L(this,F);L(this,H);L(this,I);L(this,R);L(this,O);L(this,W);P(this,"type","root");L(this,r,0);L(this,i,void 0);L(this,s,void 0);L(this,t,void 0);L(this,n,(v=x(this,r),j=!1)=>{if(v<x(this,r)||!this.isPlain()||this.length===0)return this;switch(v){case 0:this.type==="root"&&x(this,s).shift(),G(this,t,Boolean(j)),X(this,h,lt).call(this,j);break;case 1:X(this,A,ht).call(this);break;case 2:X(this,d,at).call(this);break;case 3:X(this,y,dt).call(this);break;case 4:X(this,C,ut).call(this);break;case 5:X(this,F,pt).call(this);break;case 6:X(this,H,ct).call(this);break;case 7:X(this,I,gt).call(this);break;case 8:X(this,R,ft).call(this);break;case 9:X(this,O,xt).call(this);break;case 10:X(this,W,mt).call(this)}if(this.type==="root")for(const M of x(this,s))M.getAttribute("parseOnce")(v,j);return nt(this,r)._++,this});L(this,l,(v,j)=>{const M=v.split(/[\0\x7F]/u).map((J,_)=>{if(_%2===0)return new p(J,x(this,i));if(isNaN(J[J.length-1]))return x(this,s)[Number(J.slice(0,-1))];throw new Error(`\u89E3\u6790\u9519\u8BEF\uFF01\u672A\u6B63\u786E\u6807\u8BB0\u7684 Token\uFF1A${J}`)});return j==="string"?M.map(String).join(""):j==="text"?f(M):M});L(this,o,()=>{G(this,r,u);const{length:v,firstChild:j}=this,M=String(j);if(v===1&&j.type==="text"&&M.includes("\0")&&(this.replaceChildren(...x(this,l).call(this,M)),this.normalize(),this.type==="root"))for(const J of x(this,s))J.getAttribute("build")()});typeof v=="string"&&this.insertAt(M?v:v.replace(/[\0\x7F]/gu,"")),G(this,i,j),G(this,s,J),J.push(this)}getAttribute(v){switch(v){case"config":return JSON.parse(JSON.stringify(x(this,i)));case"accum":return x(this,s);case"parseOnce":return x(this,n);case"buildFromStr":return x(this,l);case"build":return x(this,o);case"include":{if(x(this,t)!==void 0)return x(this,t);const j=this.getRootNode();return j.type==="root"&&j!==this?j.getAttribute("include"):!1}default:return super.getAttribute(v)}}setAttribute(v,j){switch(v){case"stage":return x(this,r)===0&&this.type==="root"&&x(this,s).shift(),G(this,r,j),this;default:return super.setAttribute(v,j)}}isPlain(){return this.constructor===K}insertAt(v,j=this.length){return typeof v=="string"&&(v=new p(v,x(this,i))),super.insertAt(v,j),v.type==="root"&&(v.type="plain"),v}normalizeTitle(v,j=0,M=!1,J=!1,_=!1){return $.normalizeTitle(v,j,x(this,t),x(this,i),M,J,_)}afterBuild(){if(this.type==="root")for(const v of x(this,s))v.afterBuild()}parse(v=u,j=!1){for(;x(this,r)<v;)x(this,n).call(this,x(this,r),j);return v&&(x(this,o).call(this),this.afterBuild()),this}};let g=K;r=new WeakMap,i=new WeakMap,s=new WeakMap,t=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakMap,h=new WeakSet,lt=function(v){const j=e(4907);this.setText(j(String(this.firstChild),x(this,i),x(this,s),v))},A=new WeakSet,ht=function(){const v=e(8275),j=this.type==="root"?String(this.firstChild):`\0${String(this.firstChild)}`,M=v(j,x(this,i),x(this,s));this.setText(this.type==="root"?M:M.slice(1))},d=new WeakSet,at=function(){if(x(this,i).excludes.includes("html"))return;const v=e(5130);this.setText(v(String(this.firstChild),x(this,i),x(this,s)))},y=new WeakSet,dt=function(){if(x(this,i).excludes.includes("table"))return;const v=e(4624),j=e(2840);this.setText(v(this,x(this,i),x(this,s)));for(const M of x(this,s))if(M instanceof j&&M.type!=="td"){M.normalize();const{childNodes:[,J]}=M;if(typeof J=="string"&&J.includes("\0")){M.removeAt(1);const _=new K(J,x(this,i),!0,x(this,s));M.insertAt(_,1),_.setAttribute("stage",4)}}},C=new WeakSet,ut=function(){if(x(this,i).excludes.includes("hr"))return;const v=e(2937);this.setText(v(this,x(this,i),x(this,s)))},F=new WeakSet,pt=function(){const v=e(1452);this.setText(v(String(this.firstChild),x(this,i),x(this,s)))},H=new WeakSet,ct=function(){if(x(this,i).excludes.includes("quote"))return;const v=e(3360),j=String(this.firstChild).split(`
27
+ `);for(let M=0;M<j.length;M++)j[M]=v(j[M],x(this,i),x(this,s));this.setText(j.join(`
28
+ `))},I=new WeakSet,gt=function(){if(x(this,i).excludes.includes("extLink"))return;const v=e(7513);this.setText(v(String(this.firstChild),x(this,i),x(this,s)))},R=new WeakSet,ft=function(){if(x(this,i).excludes.includes("magicLink"))return;const v=e(4737);this.setText(v(String(this.firstChild),x(this,i),x(this,s)))},O=new WeakSet,xt=function(){if(x(this,i).excludes.includes("list"))return;const v=e(6622),j=String(this.firstChild).split(`
29
+ `);let M=this.type==="root"||this.type==="ext-inner"&&this.type==="poem"?0:1;for(;M<j.length;M++)j[M]=v(j[M],x(this,i),x(this,s));this.setText(j.join(`
30
+ `))},W=new WeakSet,mt=function(){const v=e(3765);this.setText(v(String(this.firstChild),x(this,i),x(this,s)))},T.exports=g},337:(T,b,e)=>{"use strict";const f=e(3905);class $ extends f{constructor(){super(...arguments);P(this,"type","category")}}T.exports=$},7625:(T,b,e)=>{var t,et;"use strict";const{explode:f}=e(231),{generateForChild:$}=e(8277),S=e(6010),p=e(3905),u=e(1874),g=new Set(["manualthumb","frameless","framed","thumbnail"]),r=new Set(["left","right","center","none"]),i=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]);class s extends p{constructor(h,a,A,m=S.getConfig(),d=[],c="|"){super(h,void 0,A,m,d,c);L(this,t);P(this,"type","file");this.append(...f("-{","}-","|",a).map(y=>new u(y,m,d)))}lint(h=0){const a=super.lint(h),A=this.getAllArgs(),m=[...new Set(A.map(({name:C})=>C))],d=m.filter(C=>g.has(C)),c=m.filter(C=>r.has(C)),y=m.filter(C=>i.has(C));if(A.length===m.length&&d.length<2&&c.length<2&&y.length<2)return a;const k={start:h,...this.getRootNode().posFromIndex(h)};for(const C of m){let w=A.filter(({name:F})=>F===C);C==="caption"&&(w=[...w.slice(0,-1).filter(F=>F.text()),w[w.length-1]]),w.length>1&&a.push(...w.map(F=>$(F,k,`\u91CD\u590D\u7684\u56FE\u7247${C}\u53C2\u6570`)))}return d.size>1&&a.push(...A.filter(({name:C})=>g.has(C)).map(C=>$(C,k,"\u51B2\u7A81\u7684\u56FE\u7247\u6846\u67B6\u53C2\u6570"))),c.size>1&&a.push(...A.filter(({name:C})=>r.has(C)).map(C=>$(C,k,"\u51B2\u7A81\u7684\u56FE\u7247\u6C34\u5E73\u5BF9\u9F50\u53C2\u6570"))),y.size>1&&a.push(...A.filter(({name:C})=>i.has(C)).map(C=>$(C,k,"\u51B2\u7A81\u7684\u56FE\u7247\u5782\u76F4\u5BF9\u9F50\u53C2\u6570"))),a}getAllArgs(){return this.childNodes.slice(1)}getArgs(h){return this.getAllArgs().filter(({name:a})=>h===a)}getFrameArgs(){return X(this,t,et).call(this,g,"\u6846\u67B6")}getHorizAlignArgs(){return X(this,t,et).call(this,r,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return X(this,t,et).call(this,i,"\u5782\u76F4\u5BF9\u9F50")}}t=new WeakSet,et=function(h,a){return this.getAllArgs().filter(({name:m})=>h.has(m))},T.exports=s},1031:(T,b,e)=>{var g;"use strict";const{generateForSelf:f}=e(8277),$=e(6010),S=e(8138),p=e(7625);class u extends p{constructor(s,t,n,l=$.getConfig(),o=[]){let h;if(t!==void 0){h=new S(t,l,!0,o),h.type="temp";for(let a=1;a<$.MAX_STAGE;a++)h.getAttribute("parseOnce")();o.splice(o.indexOf(h),1)}super(s,h==null?void 0:h.toString(),n,l,o);P(this,"type","gallery-image");L(this,g,!1);this.setAttribute("bracket",!1)}afterBuild(){const s=this.type==="imagemap-image",t=this.normalizeTitle(String(this.firstChild),s?0:6,!0,!s);G(this,g,t.interwiki||t.ns!==6)}getPadding(){return 0}lint(s=0){const t=super.lint(s);return x(this,g)&&t.push(f(this,{start:s},"\u65E0\u6548\u7684\u56FE\u5E93\u56FE\u7247")),t}}g=new WeakMap,T.exports=u},3905:(T,b,e)=>{var r,i,s,t;"use strict";const{generateForChild:f}=e(8277),$=e(6010),S=e(7507),p=e(8138),u=e(9237);class g extends p{constructor(o,h,a,A=$.getConfig(),m=[],d="|"){super(void 0,A,!0,m,{});P(this,"type","link");L(this,r,!0);L(this,i,void 0);L(this,s,"");L(this,t,!1);if(this.insertAt(new u(o,"link-target",A,m,{})),h!==void 0){const c=new p(h,A,!0,m,{});c.type="link-text",this.insertAt(c.setAttribute("stage",$.MAX_STAGE-1))}G(this,i,d)}afterBuild(){var h;const o=this.normalizeTitle(this.firstChild.text(),0,!1,!0,!0);G(this,s,o.fragment),G(this,t,o.encoded),(h=x(this,i))!=null&&h.includes("\0")&&G(this,i,this.getAttribute("buildFromStr")(x(this,i),"string"))}setAttribute(o,h){return o==="bracket"?(G(this,r,Boolean(h)),this):super.setAttribute(o,h)}toString(o){const h=super.toString(o,x(this,i));return x(this,r)?`[[${h}]]`:h}text(){const o=super.text("|");return x(this,r)?`[[${o}]]`:o}getPadding(){return 2}getGaps(){return x(this,i).length}print(){return super.print(x(this,r)?{pre:"[[",post:"]]",sep:x(this,i)}:{sep:x(this,i)})}lint(o=0){var c;const h=super.lint(o),{childNodes:[a,A],type:m}=this;let d;return x(this,t)&&!this.interwiki&&(d={start:o,...this.getRootNode().posFromIndex(o)},h.push(f(a,d,"\u5185\u94FE\u4E2D\u4E0D\u5FC5\u8981\u7684URL\u7F16\u7801"))),m==="link"&&((c=A==null?void 0:A.childNodes)==null?void 0:c.some(({type:y,data:k})=>y==="text"&&k.includes("|")))?(d||(d={start:o,...this.getRootNode().posFromIndex(o)}),h.push(f(A,d,'\u94FE\u63A5\u6587\u672C\u4E2D\u591A\u4F59\u7684"|"',"warning"))):m!=="link"&&x(this,s)&&(d||(d={start:o,...this.getRootNode().posFromIndex(o)}),h.push(f(a,d,"\u591A\u4F59\u7684fragment"))),h}}r=new WeakMap,i=new WeakMap,s=new WeakMap,t=new WeakMap,T.exports=g},8962:(T,b,e)=>{"use strict";const{generateForChild:f}=e(8277),$=e(6010),S=e(8138);class p extends S{constructor(r,i,s=$.getConfig(),t=[]){super(r,s,!0,t,{});P(this,"type","free-ext-link");i&&(this.type="ext-link-url")}lint(r=0){const i=super.lint(r),s=`[\uFF0C\uFF1B\u3002\uFF1A\uFF01\uFF1F\uFF08\uFF09]+${this.type==="ext-link-url"?"|\\|+":""}`;let t;for(const n of this.childNodes){const l=String(n);if(n.type!=="text"||!new RegExp(s,"u").test(l))continue;t||(t={start:r,...this.getRootNode().posFromIndex(r)});const o=f(n,t,"","warning"),h=new RegExp(s,"gu");for(let a=h.exec(l);a;a=h.exec(l)){const{index:A,0:{0:m,length:d}}=a,c=l.slice(0,A).split(`
31
+ `),{length:y}=c,{length:k}=c[y-1],C=r+A,w=o.startLine+y-1,F=(y>1?0:o.startCol)+k;i.push({...o,message:`URL\u4E2D\u7684${m==="|"?'"|"':"\u5168\u89D2\u6807\u70B9"}`,startIndex:C,endIndex:C+d,startLine:w,endLine:w,startCol:F,endCol:F+d})}}return i}}T.exports=p},9389:(T,b,e)=>{"use strict";const f=e(6010),$=e(8889);class S extends ${constructor(g,r=f.getConfig(),i=[]){super(g,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],r,i);P(this,"name","choose")}}T.exports=S},9269:(T,b,e)=>{"use strict";const f=e(6010),$=e(8889);class S extends ${constructor(g,r=f.getConfig(),i=[]){super(g,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],r,i);P(this,"name","combobox")}}T.exports=S},8889:(T,b,e)=>{"use strict";const{generateForChild:f}=e(8277),$=e(6010),S=e(8138),p=e(7267),u=e(3423),g=e(5749);class r extends S{constructor(t,n,l,o=$.getConfig(),h=[]){var A;const a=(A=t==null?void 0:t.replace(n,(m,d,c,y,k)=>{const C=`\0${h.length+1}${d?"e":"c"}\x7F`;if(d)new p(d,c,y,k,o,h);else{const w=m.endsWith("-->");new g(m.slice(4,w?-3:void 0),w,o,h)}return C}))==null?void 0:A.replace(/(^|\0\d+[ce]\x7F)(.*?)(?=$|\0\d+[ce]\x7F)/gsu,(m,d,c)=>c===""?d:(new u(c,o,h),`${d}\0${h.length}c\x7F`));super(a,o,!0,h,{});P(this,"type","ext-inner")}lint(t=0){let n;return[...super.lint(t),...this.childNodes.filter(l=>{if(l.type==="ext"||l.type==="comment")return!1;const o=String(l).trim();return o&&!/^<!--.*-->$/u.test(o)}).map(l=>(n||(n={start:t,...this.getRootNode().posFromIndex(t)}),f(l,n,`<${this.name}>\u5185\u7684\u65E0\u6548\u5185\u5BB9`)))]}}T.exports=r},5937:(T,b,e)=>{"use strict";const f=e(6010),$=e(8889);class S extends ${constructor(g,r=f.getConfig(),i=[]){super(g,/<!--.*?(?:-->|$)|<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],r,i);P(this,"name","references")}}T.exports=S},7033:(T,b,e)=>{var f={"./":8889,"./choose":9389,"./choose.js":9389,"./combobox":9269,"./combobox.js":9269,"./index":8889,"./index.js":8889,"./references":5937,"./references.js":5937};function $(p){var u=S(p);return e(u)}function S(p){if(!e.o(f,p)){var u=new Error("Cannot find module '"+p+"'");throw u.code="MODULE_NOT_FOUND",u}return f[p]}$.keys=function(){return Object.keys(f)},$.resolve=S,T.exports=$,$.id=7033},5749:(T,b,e)=>{"use strict";const f=e(2308),{generateForSelf:$}=e(8277),S=e(6010),p=e(6935);class u extends f(p){constructor(i,s=!0,t=S.getConfig(),n=[]){super(i,t,n);P(this,"type","comment");P(this,"closed");this.closed=s}getPadding(){return 4}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}lint(i=0){return this.closed?[]:[$(this,{start:i},"\u672A\u95ED\u5408\u7684HTML\u6CE8\u91CA")]}toString(i){return`<!--${String(this.firstChild)}${this.closed?"-->":""}`}}T.exports=u},3434:(T,b,e)=>{"use strict";const f=e(6935);class $ extends f{constructor(){super(...arguments);P(this,"type","dd")}}T.exports=$},7815:(T,b,e)=>{"use strict";const f=e(2308),$=e(6935);class S extends f($){constructor(){super(...arguments);P(this,"type","double-underscore")}getPadding(){return 2}print(){return super.print({pre:"__",post:"__"})}toString(g){return`__${String(this.firstChild)}__`}}T.exports=S},2582:(T,b,e)=>{"use strict";const f=e(6010),$=e(6935);class S extends ${constructor(g,r=f.getConfig(),i=[]){super("-".repeat(g),r,i);P(this,"type","hr")}}T.exports=S},6935:(T,b,e)=>{"use strict";const{generateForSelf:f}=e(8277),$=e(6010),S=e(8138);class p extends S{constructor(r,i=$.getConfig(),s=[]){super(r,i,!0,s);P(this,"type","ext-inner")}lint(r=0){const{type:i,name:s}=this;return i==="ext-inner"&&(s==="templatestyles"||s==="section")&&String(this)?[f(this,{start:r},`<${s}>\u6807\u7B7E\u5185\u4E0D\u5E94\u6709\u4EFB\u4F55\u5185\u5BB9`)]:super.lint(r)}}T.exports=p},962:(T,b,e)=>{"use strict";const f=e(3434);class $ extends f{constructor(){super(...arguments);P(this,"type","list")}}T.exports=$},3423:(T,b,e)=>{"use strict";const f=e(2308),$=e(6935);class S extends f($){constructor(){super(...arguments);P(this,"type","noinclude")}}T.exports=S},6714:(T,b,e)=>{"use strict";const{generateForSelf:f}=e(8277),$=e(6010),S=e(7507),p=e(6935);class u extends p{constructor(i,s=$.getConfig(),t=[]){super("'".repeat(i),s,t);P(this,"type","quote")}lint(i=0){const{previousSibling:s,nextSibling:t}=this,n=`\u5B64\u7ACB\u7684"'"`,l=[];let o;if((s==null?void 0:s.type)==="text"&&s.data.endsWith("'")){o=f(this,{start:i},n);const{startIndex:h,startLine:a,startCol:A}=o,[,{length:m}]=s.data.match(/(?:^|[^'])('+)$/u),d=i-m;l.push({...o,startIndex:d,endIndex:h,startCol:A-m,endLine:a,endCol:A})}if((t==null?void 0:t.type)==="text"&&t.data[0]==="'"){o||(o=f(this,{start:i},n));const{endIndex:h,endLine:a,endCol:A}=o,[{length:m}]=t.data.match(/^'+/u),d=h+m;l.push({...o,startIndex:h,endIndex:d,startLine:a,startCol:A,endCol:A+m})}return l}}T.exports=u},851:(T,b,e)=>{"use strict";const f=e(6010),$=e(8138);class S extends ${constructor(g,r=f.getConfig(),i=[]){super(g,r,!0,i);P(this,"type","onlyinclude")}toString(g){return`<onlyinclude>${super.toString()}</onlyinclude>`}getPadding(){return 13}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}isPlain(){return!0}}T.exports=S},9380:(T,b,e)=>{"use strict";const{generateForChild:f}=e(8277),$=e(6010),S=e(8138),p=e(9237);class u extends S{constructor(i,s=$.getConfig(),t=[]){super(void 0,s,!0,t,{});P(this,"type","ext-inner");if(i){const n=p;this.append(...i.split(`
32
+ `).map(l=>new n(l,"param-line",s,t,{})))}}toString(i){return super.toString(i,`
33
+ `)}text(){return super.text(`
34
+ `)}getGaps(){return 1}print(){return super.print({sep:`
35
+ `})}lint(i=0){let s;return this.childNodes.filter(t=>{const{childNodes:n}=t,l=n.findIndex(({type:h})=>h!=="text"),o=(l>=0?n.slice(0,l).map(String).join(""):String(t)).trim();return o&&!(l>=0?/^[a-z]+\s*(?:=|$)/iu:/^[a-z]+\s*=/iu).test(o)}).map(t=>(s||(s={start:i,...this.getRootNode().posFromIndex(i)}),f(t,s,`${this.name}\u7684\u65E0\u6548\u53C2\u6570`)))}}T.exports=u},6934:(T,b,e)=>{"use strict";const f=e(8275),$=e(6010),S=e(9380),p=e(9237);class u extends S{constructor(i,s=$.getConfig(),t=[]){super(void 0,s,t);P(this,"name","inputbox");if(i=f(i,s,t),t.splice(t.indexOf(this),1),t.push(this),i){const n=p;this.append(...i.split(`
36
+ `).map(l=>new n(l,"param-line",s,t,{})))}}}T.exports=u},9799:(T,b,e)=>{"use strict";const{extUrlChar:f,extUrlCharFirst:$}=e(231),{generateForChild:S}=e(8277),p=e(6010),u=e(8138);class g extends u{constructor(s,t,n=p.getConfig(),l=[]){super(void 0,n,!0,l);P(this,"type","parameter");const o=new u(typeof s=="number"?void 0:s,n,!0,l,{}),h=new u(t,n,!0,l);o.type="parameter-key",h.type="parameter-value",this.append(o,h.setAttribute("stage",2))}get anon(){return this.firstChild.length===0}afterBuild(){if(!this.anon){const s=e(1782),t=String(this.firstChild).replace(/<!--.*?-->/gu,"").replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),{parentNode:n}=this;this.setAttribute("name",t),n instanceof s&&n.getArgs(t,!1,!1).add(this)}}toString(s){return this.anon?this.lastChild.toString(s):super.toString(s,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}print(){return super.print({sep:this.anon?"":"="})}lint(s=0){var o;const t=super.lint(s),{firstChild:n}=this,l=(o=new RegExp(`https?://${$}${f}$`,"iu").exec(String(n).replace(/<!--.*?-->/gu,"")))==null?void 0:o[0];if(l&&new URL(l).search){const h=S(n,{start:s},"\u533F\u540D\u53C2\u6570\u4E2D\u672A\u8F6C\u4E49\u7684\u67E5\u8BE2\u53C2\u6570");t.push({...h,startIndex:h.endIndex,endIndex:h.endIndex+1,startLine:h.endLine,startCol:h.endCol,endCol:h.endCol+1})}return t}}T.exports=g},8058:(T,b,e)=>{"use strict";const f=e(6010),$=e(8138);class S extends ${constructor(u,g,r="plain",i=f.getConfig(),s=[],t=void 0){super(u,i,!0,s,t),this.type=r}}T.exports=S},2840:(T,b,e)=>{"use strict";const{generateForChild:f}=e(8277),$=e(3125),S=e(8058);class p extends ${constructor(){super(...arguments);P(this,"type","table")}get closed(){return this.lastChild.type==="table-syntax"}lint(r=0){const i=super.lint(r);if(!this.closed){const{firstChild:s}=this,t=f(s,{start:r},"\u672A\u95ED\u5408\u7684\u8868\u683C");i.push(t)}return i}close(r=`
37
+ |}`,i=!1){const s=this.getAttribute("config"),t=this.getAttribute("accum");super.insertAt(new S(r,void 0,"table-syntax",s,t))}}T.exports=p},5567:(T,b,e)=>{var g;"use strict";const{generateForChild:f}=e(8277),$=e(6010),S=e(8138),p=e(3125);class u extends p{constructor(s,t,n=$.getConfig(),l=[]){let o=t==null?void 0:t.match(/\||\0\d+!\x7F/u),h=o?t.slice(0,o.index):"";/\[\[|-\{/u.test(h)&&(o=void 0,h="");super(s,h,n,l);P(this,"type","td");L(this,g,"");o&&([nt(this,g)._]=o);const a=new S(t==null?void 0:t.slice((o==null?void 0:o.index)+x(this,g).length),n,!0,l);a.type="td-inner",this.insertAt(a.setAttribute("stage",4))}get subtype(){return this.getSyntax().subtype}getSyntax(){const s=this.firstChild.text(),t=s[s.length-1];let n="td";return t==="!"?n="th":t==="+"&&(n="caption"),{subtype:n}}afterBuild(){x(this,g).includes("\0")&&G(this,g,this.getAttribute("buildFromStr")(x(this,g),"string"))}toString(s){const{childNodes:[t,n,l]}=this;return`${t.toString()}${n.toString()}${x(this,g)}${l.toString()}`}text(){const{childNodes:[s,t,n]}=this;return`${s.text()}${t.text()}${x(this,g)}${n.text()}`}getGaps(s=0){return s=s<0?s+this.length:s,s===1?x(this,g).length:0}lint(s=0){const t=super.lint(s),{lastChild:n}=this;s+=this.getRelativeIndex(-1);for(const l of n.childNodes)l.type==="text"&&l.data.includes("|")&&t.push(f(l,{start:s},'\u8868\u683C\u5355\u5143\u683C\u4E2D\u591A\u4F59\u7684"|"',"warning"));return t}print(){const{childNodes:[s,t,n]}=this;return`<span class="wpb-td">${s.print()}${t.print()}${x(this,g)}${n.print()}</span>`}}g=new WeakMap,T.exports=u},3125:(T,b,e)=>{"use strict";const{generateForChild:f}=e(8277),$=e(6010),S=e(8138),p=e(8058),u=e(5649);class g extends S{constructor(s,t="",n=$.getConfig(),l=[],o=void 0){super(void 0,n,!0,l,{});P(this,"type","tr");this.append(new p(s,o,"table-syntax",n,l,{}),new u(t,"table-attrs",this.type,n,l))}lint(s=0){const t=e(1782),n=e(9544),l=super.lint(s),o=this.childNodes.find(({type:m})=>m==="table-inter");if(!o)return l;const h=o.childNodes.find(m=>m.text().trim()),a=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u;if(!h||a.test(String(h))||h.type==="arg"&&a.test(h.default||""))return l;if(h.type==="magic-word")try{if(h.getPossibleValues().every(d=>a.test(d.text())))return l}catch(m){}const A=f(o,{start:s},"\u5C06\u88AB\u79FB\u51FA\u8868\u683C\u7684\u5185\u5BB9");return l.push({...A,startIndex:A.startIndex+1,startLine:A.startLine+1,startCol:0}),l}text(){const s=super.text();return this.type==="tr"&&!s.trim().includes(`
38
+ `)?"":s}}T.exports=g},7267:(T,b,e)=>{"use strict";const{generateForSelf:f}=e(8277),$=e(6010),S=e(8138),p=e(1074),u=e(5649);class g extends p{constructor(s,t="",n="",l=void 0,o=$.getConfig(),h=[]){t=!t||/^\s/u.test(t)?t:` ${t}`;const a=s.toLowerCase(),A=new u(t,"ext-attrs",a,o,h),m={...o,excludes:[...o.excludes]},d=new Set(m.ext);let c;switch(d.delete(a),m.ext=[...d],m.inExt=!0,a){case"tab":d.delete("tabs"),m.ext=[...d];case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":a==="poem"&&m.excludes.push("heading"),c=new S(n,m,!0,h);break;case"gallery":{const y=e(1891);c=new y(n,m,h);break}case"pre":{const y=e(428);c=new y(n,m,h);break}case"references":case"choose":case"combobox":{const y=e(8889),k=e(7033)(`./${a}`);c=new k(n,m,h);break}case"imagemap":{const y=e(2641);c=new y(n,o,h);break}case"dynamicpagelist":{const y=e(9380);c=new y(n,m,h);break}case"inputbox":{m.excludes.push("heading");const y=e(6934);c=new y(n,m,h);break}default:{const y=e(6935);c=new y(n,o)}}c.setAttribute("name",a).type="ext-inner";super(s,A,c,l,o,h);P(this,"type","ext");P(this,"closed",!0)}lint(s=0){const t=super.lint(s);if(this.name!=="nowiki"&&this.closest("html-attrs, table-attrs")){const n=this.getRootNode(),l={start:s,...n.posFromIndex(s)};t.push(f(this,l,"HTML\u6807\u7B7E\u5C5E\u6027\u4E2D\u7684\u6269\u5C55\u6807\u7B7E"))}return t}}T.exports=g},8655:(T,b,e)=>{"use strict";const f=e(2308),$=e(6010),S=e(1074);class p extends f(S){constructor(r,i="",s=void 0,t=void 0,n=$.getConfig(),l=[]){super(r,i,s!=null?s:"",s===void 0||t!=null?t:"",n,l);P(this,"type","include")}}T.exports=p},1074:(T,b,e)=>{var p,u,g;"use strict";const f=e(6010),$=e(8138);class S extends ${constructor(s,t,n,l,o=f.getConfig(),h=[]){super(void 0,o,!0);L(this,p,void 0);L(this,u,void 0);L(this,g,void 0);this.setAttribute("name",s.toLowerCase()),G(this,g,[s,l||s]),G(this,p,l===void 0),G(this,u,l!==""),this.append(t,n);let a=h.indexOf(t);a===-1&&(a=h.indexOf(n)),a===-1&&(a=1/0),h.splice(a,0,this)}get closed(){return x(this,u)}toString(s){const{firstChild:t,lastChild:n}=this,[l,o]=x(this,g);return x(this,p)?`<${l}${String(t)}/>`:`<${l}${String(t)}>${String(n)}${x(this,u)?`</${o}>`:""}`}text(){const[s,t]=x(this,g);return x(this,p)?`<${s}${this.firstChild.text()}/>`:`<${s}${super.text(">")}${x(this,u)?`</${t}>`:""}`}getPadding(){return x(this,g)[0].length+1}getGaps(){return 1}print(){const[s,t]=x(this,g);return super.print(x(this,p)?{pre:`&lt;${s}`,post:"/&gt;"}:{pre:`&lt;${s}`,sep:"&gt;",post:x(this,u)?`&lt;/${t}&gt;`:""})}}p=new WeakMap,u=new WeakMap,g=new WeakMap,T.exports=S},1782:(T,b,e)=>{var n,l,o,h,$t;"use strict";const{removeComment:f,print:$,text:S}=e(231),{generateForChild:p}=e(8277),u=e(6010),g=e(8138),r=e(9799),i=e(9237),s=e(8058);class t extends g{constructor(d,c,y=u.getConfig(),k=[]){super(void 0,y,!0,k,{});L(this,h);P(this,"type","template");P(this,"modifier","");L(this,n,{});L(this,l,"");L(this,o,!0);const{parserFunction:[C,w,F]}=y;if(d.includes(":")){const[N,...I]=d.split(":");this.setModifier(N)&&(d=I.join(":"))}if(d.includes(":")||c.length===0&&!F.includes(this.modifier.toLowerCase())){const[N,...I]=d.split(":"),z=f(N),R=z.trim(),Q=w.includes(R),O=C[R.toLowerCase()];if(!(I.length>0&&/\s$/u.test(z))&&(Q||O)){this.setAttribute("name",O||R.toLowerCase()).type="magic-word";const U=new RegExp(`^\\s*${R}\\s*$`,Q?"u":"iu"),W=new s(N,U,"magic-word-name",y,k,{});if(this.insertAt(W),I.length>0&&c.unshift([I.join(":")]),this.name==="invoke")for(let Z=0;Z<2;Z++){const K=c.shift();if(!K)break;const Y=new i(K.join("="),`invoke-${Z?"function":"module"}`,y,k,{});this.insertAt(Y)}}}if(this.type==="template"){const N=f(d).split("#")[0].trim();if(!N||/\0\d+[eh!+-]\x7F|[<>[\]{}\n]|%[\da-f]{2}/u.test(N))throw k.pop(),new SyntaxError(`\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0\uFF1A${N}`);const I=new i(d,"template-name",y,k,{});this.insertAt(I)}const E=this.isTemplate();let H=1;for(let N=0;N<c.length;N++){const I=c[N];!E&&!(this.name==="switch"&&N>0)&&(I[0]=I.join("="),I.length=1),I.length===1&&(I.unshift(H),H++),this.insertAt(new r(...I,y,k))}}setModifier(d=""){if(/\s$/u.test(d))return!1;const{parserFunction:[,,c,y]}=this.getAttribute("config"),k=d.trim().toLowerCase(),C=c.includes(k),w=y.includes(k);return C||w||d===""?(this.setAttribute("modifier",d),Boolean(d)):!1}afterBuild(){if(this.isTemplate()){const d=this.type==="template",c=this.normalizeTitle(this.childNodes[d?0:1].text(),d?10:828);G(this,l,c.fragment),G(this,o,c.valid)}}toString(d){const{childNodes:c,firstChild:y,modifier:k}=this;return`{{${k}${k&&":"}${this.type==="magic-word"?`${String(y)}${c.length>1?":":""}${c.slice(1).map(String).join("|")}`:super.toString(d,"|")}}}`}text(){const{childNodes:d,firstChild:c,modifier:y}=this;return`{{${y}${y&&":"}${this.type==="magic-word"?`${c.text()}${d.length>1?":":""}${S(d.slice(1),"|")}`:super.text("|")}}}`}getPadding(){return this.modifier?this.modifier.length+3:2}getGaps(){return 1}print(){const{childNodes:d,firstChild:c,modifier:y}=this;return`<span class="wpb-${this.type}">{{${y}${y&&":"}${this.type==="magic-word"?`${c.print()}${d.length>1?":":""}${$(d.slice(1),{sep:"|"})}`:$(d,{sep:"|"})}}}</span>`}lint(d=0){const c=super.lint(d),{type:y,childNodes:k}=this;let C;if(this.isTemplate())x(this,l)&&(C={start:d,...this.getRootNode().posFromIndex(d)},c.push(p(k[y==="template"?0:1],C,"\u591A\u4F59\u7684fragment")));else return c;x(this,o)||(C={start:d,...this.getRootNode().posFromIndex(d)},c.push(p(k[1],C,"\u975E\u6CD5\u7684\u6A21\u5757\u540D\u79F0")));const w=this.getDuplicatedArgs();return w.length>0&&(C||(C={start:d,...this.getRootNode().posFromIndex(d)}),c.push(...w.flatMap(([,F])=>F).map(F=>p(F,C,"\u91CD\u590D\u53C2\u6570")))),c}isTemplate(){return this.type==="template"||this.type==="magic-word"&&this.name==="invoke"}insertAt(d,c=this.length){return super.insertAt(d,c),d.anon?X(this,h,$t).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(d=>d instanceof r)}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,c,y=!0){const k=String(d).trim();let C;return Object.prototype.hasOwnProperty.call(x(this,n),k)?C=x(this,n)[k]:(C=new Set(this.getAllArgs().filter(({name:w})=>k===w)),x(this,n)[k]=C),C}getDuplicatedArgs(){return this.isTemplate()?Object.entries(x(this,n)).filter(([,{size:d}])=>d>1).map(([d,c])=>[d,[...c]]):[]}getPossibleValues(){const{type:d,name:c,childNodes:y,constructor:{name:k}}=this;if(d==="template")throw new Error(`${k}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`);let C;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":C=2;break;case"ifeq":C=3;break;default:throw new Error(`${k}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}const w=y.slice(C,C+2).map(({childNodes:[,F]})=>F);for(let F=0;F<w.length;){const{length:E,0:H}=w[F].childNodes.filter(N=>N.text().trim());if(E===0)w.splice(F,1);else if(E>1||H.type!=="magic-word")F++;else try{const N=H.getPossibleValues();w.splice(F,1,...N),F+=N.length}catch(N){F++}}return w}}n=new WeakMap,l=new WeakMap,o=new WeakMap,h=new WeakSet,$t=function(d){const c=this.getAnonArgs(),y=c.indexOf(d);for(let k=y;k<c.length;k++){const C=c[k],{name:w}=C,F=String(k+1);w!==F&&this.getArgs(F,!1,!1).add(C.setAttribute("name",F))}},T.exports=t},8277:(T,b,e)=>{"use strict";const f=e(8138),$=(p,u,g,r="error")=>{const i=p.getRelativeIndex(),{offsetHeight:s,offsetWidth:t,parentNode:n,length:l}=p,{top:o,left:h}=n.posFromIndex(i),{start:a}=u,{top:A,left:m}="top"in u?u:p.getRootNode().posFromIndex(a),d=a+i,c=d+l,y=A+o,k=y+s-1,C=o?h:m+h,w=s>1?t:C+t;return{message:g,severity:r,startIndex:d,endIndex:c,startLine:y,endLine:k,startCol:C,endCol:w}},S=(p,u,g,r="error")=>{const{start:i}=u,{offsetHeight:s,offsetWidth:t,length:n}=p,{top:l,left:o}="top"in u?u:p.getRootNode().posFromIndex(i);return{message:g,severity:r,startIndex:i,endIndex:i+n,startLine:l,endLine:l+s-1,startCol:o,endCol:s>1?t:o+t}};T.exports={generateForChild:$,generateForSelf:S}},231:(T,b,e)=>{"use strict";const f='(?:\\[[\\da-f:.]+\\]|[^[\\]<>"\\0-\\x1F\\x7F\\p{Zs}\\uFFFD])',$='(?:[^[\\]<>"\\0-\\x1F\\x7F\\p{Zs}\\uFFFD]|\\0\\d+c\\x7F)*',S=i=>i.replace(/\0\d+c\x7F/gu,""),p=(i,s={})=>{const t=e(7507),n=e(9205),{pre:l="",post:o="",sep:h=""}=s,a={"&":"amp","<":"lt",">":"gt"};return`${l}${i.map(A=>A instanceof n?A.print():String(A).replace(/[&<>]/gu,m=>`&${a[m]};`)).join(h)}${o}`},u=i=>i.replace(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),g=(i,s,t,n)=>{if(n===void 0)return[];const l=new RegExp(`${[i,s,t].map(u).join("|")}`,"gu"),o=[];let h=l.exec(n),a=0,A=0;for(;h;){const{0:m,index:d}=h;m!==t?a+=m===i?1:-1:a===0&&(o.push(n.slice(A,d)),{lastIndex:A}=l),h=l.exec(n)}return o.push(n.slice(A)),o},r=(i,s="")=>{const t=e(3853);return i.map(n=>typeof n=="string"?n:n.text()).join(s)};T.exports={extUrlCharFirst:f,extUrlChar:$,removeComment:S,print:p,escapeRegExp:u,explode:g,text:r}},8166:T=>{"use strict";T.exports=JSON.parse('{"ext":[],"html":[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link","img"]],"namespaces":{},"nsid":{},"parserFunction":[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#cscore":"cscore"},[],["msg","\u539F\u59CB","raw"],["\u66FF\u4EE3","subst","\u5B89\u5168\u66FF\u4EE3","safesubst"]],"doubleUnderscore":[[],[]],"protocol":"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:","interwiki":[],"img":{},"variants":["zh","zh-hans","zh-hant","zh-cn","zh-tw","zh-hk","zh-sg","zh-my","zh-mo"]}')}},D={};function V(T){var b=D[T];if(b!==void 0)return b.exports;var e=D[T]={exports:{}};return B[T](e,e.exports,V),e.exports}V.o=(T,b)=>Object.prototype.hasOwnProperty.call(T,b);var tt=V(6010)})();})();
@@ -0,0 +1,60 @@
1
+ .wikiparse-container {
2
+ position: relative;
3
+ }
4
+ #wikiPretty + .wikiparsed, #wikiPretty {
5
+ outline: none;
6
+ border: 1.5px solid #dedede !important;
7
+ border-radius: 0;
8
+ padding: .4em;
9
+ line-height: 1.4 !important;
10
+ font-size: inherit;
11
+ tab-size: 4;
12
+ overflow-y: auto;
13
+ word-break: normal;
14
+ }
15
+ .wikiparsed {
16
+ position: relative;
17
+ display: block;
18
+ box-sizing: border-box;
19
+ width: 100%;
20
+ resize: vertical;
21
+ font-family: monospace;
22
+ background: none !important;
23
+ caret-color: #000;
24
+ }
25
+ #wikiPretty {
26
+ position: absolute;
27
+ inset: 0;
28
+ background-color: #fff;
29
+ user-select: none;
30
+ }
31
+ #wikiPretty.active span {
32
+ color: transparent;
33
+ background: none;
34
+ }
35
+
36
+ /* compromise for font-weight: bold */
37
+ #wikiPretty span {
38
+ font-weight: normal;
39
+ }
40
+ .wpb-ext, .wpb-html,
41
+ .wpb-arg,
42
+ .wpb-template,
43
+ .wpb-magic-word,
44
+ .wpb-heading-title,
45
+ .wpb-table, .wpb-tr, .wpb-td,
46
+ .wpb-double-underscore, .wpb-hr, .wpb-quote, .wpb-list, .wpb-dd
47
+ .wpb-converter {
48
+ -webkit-text-stroke-width: 0.1ex;
49
+ }
50
+ .wpb-hidden, .wpb-table-inter, .wpb-table-inter span,
51
+ .wpb-noinclude, .wpb-include, .wpb-comment,
52
+ .wpb-ext-attrs, .wpb-html-attrs,
53
+ .wpb-ext-inner,
54
+ .wpb-arg-default,
55
+ .wpb-invoke-module, .wpb-invoke-function,
56
+ .wpb-parameter,
57
+ .wpb-table-attrs, .wpb-td-inner,
58
+ .wpb-converter-rule {
59
+ -webkit-text-stroke-width: 0;
60
+ }
@@ -0,0 +1,317 @@
1
+ 'use strict';
2
+
3
+ (() => {
4
+ const MAX_STAGE = 11;
5
+
6
+ /** web worker */
7
+ const workerJS = () => {
8
+ self.importScripts('https://fastly.jsdelivr.net/gh/bhsd-harry/wikiparser-node@0.7.4-b/bundle/bundle.min.js');
9
+ const /** @type {{Parser: Parser}} */ {Parser} = self,
10
+ entities = {'&': 'amp', '<': 'lt', '>': 'gt'};
11
+
12
+ /**
13
+ * @param {{data: ['setConfig', ParserConfig]|['getConfig'|'print'|'lint', number, string, Boolean, number]}}
14
+ */
15
+ self.onmessage = ({data}) => {
16
+ const [command, qid, ...args] = data;
17
+ switch (command) {
18
+ case 'setConfig':
19
+ Parser.config = qid;
20
+ break;
21
+ case 'getConfig':
22
+ self.postMessage([qid, Parser.minConfig]);
23
+ break;
24
+ case 'lint':
25
+ self.postMessage([qid, Parser.parse(...args).lint(), args[0]]);
26
+ break;
27
+ default: {
28
+ const stage = args[2] === undefined ? MAX_STAGE : args[2];
29
+ self.postMessage([
30
+ qid,
31
+ Parser.parse(...args).childNodes.map(child => [
32
+ stage,
33
+ String(child),
34
+ child.type === 'text'
35
+ ? String(child).replace(/[&<>]/gu, p => `&${entities[p]};`)
36
+ : child.print(),
37
+ ]),
38
+ ]);
39
+ }
40
+ }
41
+ };
42
+ };
43
+
44
+ const blob = new Blob([`(${String(workerJS).replace(/MAX_STAGE/gu, MAX_STAGE)})()`], {type: 'text/javascript'}),
45
+ url = URL.createObjectURL(blob),
46
+ worker = new Worker(url);
47
+ URL.revokeObjectURL(url);
48
+
49
+ /**
50
+ * 生成事件监听函数
51
+ * @param {number} qid 输入id
52
+ * @param {(res: *) => void} resolve Promise对象的resolve函数
53
+ * @param {string} raw 原始文本
54
+ */
55
+ const getListener = (qid, resolve, raw) => {
56
+ const listener = /** @param {{data: [number, *, string]}} e 消息事件 */ ({data: [rid, res, resRaw]}) => {
57
+ if (rid === qid && (raw === undefined || raw === resRaw)) {
58
+ worker.removeEventListener('message', listener);
59
+ resolve(res);
60
+ }
61
+ };
62
+ return listener;
63
+ };
64
+
65
+ /**
66
+ * 更新解析设置
67
+ * @param {ParserConfig} config 设置
68
+ */
69
+ const setConfig = config => {
70
+ worker.postMessage(['setConfig', config]);
71
+ };
72
+
73
+ /**
74
+ * 获取Parser.minConfig
75
+ * @returns {Promise<ParserConfig>}
76
+ */
77
+ const getConfig = () => new Promise(resolve => {
78
+ worker.addEventListener('message', getListener(-3, resolve));
79
+ worker.postMessage(['getConfig', -3]);
80
+ });
81
+
82
+ /**
83
+ * 将解析改为异步执行
84
+ * @param {string} wikitext wikitext
85
+ * @param {boolean} include 是否嵌入
86
+ * @param {number} stage 解析层级
87
+ * @param {number} qid Printer编号
88
+ * @returns {Promise<[number, string, string][]>}
89
+ */
90
+ const print = (wikitext, include, stage, qid = -1) => new Promise(resolve => {
91
+ worker.addEventListener('message', getListener(qid, resolve));
92
+ worker.postMessage(['print', qid, wikitext, include, stage]);
93
+ });
94
+
95
+ /**
96
+ * 将语法分析改为异步执行
97
+ * @param {string} wikitext wikitext
98
+ * @param {boolean} include 是否嵌入
99
+ * @param {number} qid Linter编号,暂时固定为`-2`
100
+ * @returns {Promise<LintError[]>}
101
+ */
102
+ const lint = (wikitext, include, qid = -2) => new Promise(resolve => {
103
+ worker.addEventListener('message', getListener(qid, resolve, wikitext));
104
+ worker.postMessage(['lint', qid, wikitext, include]);
105
+ });
106
+
107
+ let id = 0;
108
+
109
+ /** 用于打印AST */
110
+ class Printer {
111
+ /**
112
+ * @param {HTMLDivElement} preview 置于下层的代码高亮
113
+ * @param {HTMLTextAreaElement} textbox 置于上层的文本框
114
+ * @param {boolean} include 是否嵌入
115
+ */
116
+ constructor(preview, textbox, include) {
117
+ this.id = id++;
118
+ this.preview = preview;
119
+ this.textbox = textbox;
120
+ this.include = Boolean(include);
121
+ /** @type {[number, string, string][]} */ this.root = [];
122
+ /** @type {Promise<void>} */ this.running = undefined;
123
+ this.viewportChanged = false;
124
+ /** @type {[number, string]} */ this.ticks = [0, undefined];
125
+ }
126
+
127
+ /** 倒计时 */
128
+ tick() {
129
+ setTimeout(() => {
130
+ const {ticks} = this;
131
+ if (ticks[0] > 0) {
132
+ ticks[0] -= 500;
133
+ this[ticks[0] <= 0 ? ticks[1] : 'tick']();
134
+ }
135
+ }, 500);
136
+ }
137
+
138
+ /**
139
+ * 用于debounce
140
+ * @param {number} delay 延迟
141
+ * @param {string} method 方法
142
+ */
143
+ queue(delay, method) {
144
+ const {ticks} = this,
145
+ [state] = ticks;
146
+ if (state <= 0 || method === 'coarsePrint' || ticks[1] !== 'coarsePrint') {
147
+ ticks[0] = delay;
148
+ ticks[1] = method;
149
+ if (state <= 0) {
150
+ this.tick();
151
+ }
152
+ }
153
+ }
154
+
155
+ /** 渲染 */
156
+ paint() {
157
+ this.preview.innerHTML = `<span class="wpb-root">${
158
+ this.root.map(([,, printed]) => printed).join('')
159
+ }</span> `;
160
+ this.preview.scrollTop = this.textbox.scrollTop;
161
+ this.preview.classList.remove('active');
162
+ this.textbox.style.color = 'transparent';
163
+ }
164
+
165
+ /** 初步解析 */
166
+ async coarsePrint() {
167
+ if (this.running) {
168
+ return undefined;
169
+ }
170
+ const {include, textbox: {value}} = this,
171
+ parsed = await print(value, include, 2, this.id);
172
+ if (this.include !== include || this.textbox.value !== value) {
173
+ this.running = undefined;
174
+ this.running = this.coarsePrint();
175
+ return this.running;
176
+ }
177
+ this.root = parsed;
178
+ this.paint();
179
+ this.running = undefined;
180
+ this.running = this.finePrint();
181
+ return this.running;
182
+ }
183
+
184
+ /** 根据可见范围精细解析 */
185
+ async finePrint() {
186
+ if (this.running) {
187
+ this.viewportChanged = true;
188
+ return undefined;
189
+ }
190
+ this.viewportChanged = false;
191
+ const {
192
+ root,
193
+ preview: {scrollHeight, offsetHeight: parentHeight, scrollTop, children: [rootNode]},
194
+ include,
195
+ textbox: {value},
196
+ } = this;
197
+ let text = value,
198
+ start = 0,
199
+ {length: end} = root;
200
+ if (scrollHeight > parentHeight) {
201
+ const /** @type {HTMLElement[]} */ childNodes = [...rootNode.childNodes],
202
+ headings = childNodes.filter(({className}) => className === 'wpb-heading'),
203
+ {length} = headings;
204
+ if (length > 0) {
205
+ let i = headings.findIndex(({offsetTop, offsetHeight}) => offsetTop + offsetHeight > scrollTop);
206
+ i = i === -1 ? length : i;
207
+ let j = headings.slice(i).findIndex(({offsetTop}) => offsetTop >= scrollTop + parentHeight);
208
+ j = j === -1 ? length : i + j;
209
+ start = i ? childNodes.indexOf(headings[i - 1]) : 0;
210
+ while (i <= j && root[start][0] === MAX_STAGE) {
211
+ start = childNodes.indexOf(headings[i++]);
212
+ }
213
+ end = j === length ? end : childNodes.indexOf(headings[j]);
214
+ while (i <= j && root[end - 1][0] === MAX_STAGE) {
215
+ end = childNodes.indexOf(headings[--j]);
216
+ }
217
+ text = root.slice(start, end).map(([, str]) => str).join('');
218
+ }
219
+ }
220
+ if (start === end) {
221
+ this.running = undefined;
222
+ return undefined;
223
+ }
224
+ const parsed = await print(text, include, MAX_STAGE, this.id);
225
+ if (this.include === include && this.textbox.value === value) {
226
+ this.root.splice(start, end - start, ...parsed);
227
+ this.paint();
228
+ this.running = undefined;
229
+ if (this.viewportChanged) {
230
+ this.running = this.finePrint();
231
+ }
232
+ } else {
233
+ this.running = undefined;
234
+ this.running = this.coarsePrint();
235
+ }
236
+ return this.running;
237
+ }
238
+ }
239
+
240
+ /** 用于语法分析 */
241
+ class Linter {
242
+ /** @param {boolean} include 是否嵌入 */
243
+ constructor(include) {
244
+ this.id = id++;
245
+ this.include = Boolean(include);
246
+ this.wikitext = undefined;
247
+ /** @type {Promise<LintError[]>} */ this.running = undefined;
248
+ }
249
+
250
+ /**
251
+ * 提交语法分析
252
+ * @param {string} wikitext 待分析的文本
253
+ */
254
+ queue(wikitext) {
255
+ this.wikitext = wikitext;
256
+ this.running = this.lint(wikitext);
257
+ return this.running;
258
+ }
259
+
260
+ /**
261
+ * 执行语法分析
262
+ * @param {string} wikitext 待分析的文本
263
+ */
264
+ async lint(wikitext) {
265
+ const {include} = this,
266
+ errors = await lint(wikitext, include, this.id);
267
+ return this.include === include && this.wikitext === wikitext ? errors : this.running;
268
+ }
269
+ }
270
+
271
+ /**
272
+ * 高亮textarea
273
+ * @param {HTMLTextAreaElement} textbox textarea元素
274
+ * @param {boolean} include 是否嵌入
275
+ * @throws `TypeError` 不是textarea
276
+ */
277
+ const wikiparse = (textbox, include) => {
278
+ if (!(textbox instanceof HTMLTextAreaElement)) {
279
+ throw new TypeError('wikiparse方法仅可用于textarea元素!');
280
+ }
281
+ const preview = document.createElement('div'),
282
+ container = document.createElement('div'),
283
+ printer = new Printer(preview, textbox, include);
284
+ preview.id = 'wikiPretty';
285
+ preview.classList.add('wikiparser', 'active');
286
+ container.classList.add('wikiparse-container');
287
+ textbox.replaceWith(container);
288
+ textbox.classList.add('wikiparsed');
289
+ container.append(preview, textbox);
290
+
291
+ textbox.addEventListener('input', ({isComposing}) => {
292
+ if (!isComposing) {
293
+ printer.queue(2000, 'coarsePrint');
294
+ }
295
+ textbox.style.color = '';
296
+ preview.classList.add('active');
297
+ });
298
+ textbox.addEventListener('scroll', () => {
299
+ if (preview.scrollHeight > preview.offsetHeight && !preview.classList.contains('active')) {
300
+ preview.scrollTop = textbox.scrollTop;
301
+ printer.queue(500, 'finePrint');
302
+ }
303
+ });
304
+ textbox.addEventListener('keydown', e => {
305
+ if ((e.ctrlKey || e.metaKey) && e.key === 'k') {
306
+ e.preventDefault();
307
+ printer.ticks[0] = 0;
308
+ printer.running = printer.coarsePrint();
309
+ }
310
+ });
311
+ printer.running = printer.coarsePrint();
312
+ return printer;
313
+ };
314
+
315
+ Object.assign(wikiparse, {print, lint, setConfig, getConfig, Printer, Linter});
316
+ window.wikiparse = wikiparse;
317
+ })();