wikiparser-node 0.10.0 → 0.11.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 (93) hide show
  1. package/README.md +44 -32
  2. package/bundle/bundle.min.js +38 -0
  3. package/config/.schema.json +1 -19
  4. package/config/default.json +1 -2
  5. package/config/llwiki.json +1 -36
  6. package/config/minimum.json +135 -0
  7. package/config/moegirl.json +1 -45
  8. package/config/zhwiki.json +1 -467
  9. package/extensions/base.js +154 -0
  10. package/extensions/editor.css +63 -0
  11. package/extensions/editor.js +183 -0
  12. package/extensions/highlight.js +40 -0
  13. package/extensions/ui.css +119 -0
  14. package/i18n/zh-hans.json +1 -1
  15. package/i18n/zh-hant.json +1 -1
  16. package/package.json +16 -11
  17. package/index.js +0 -333
  18. package/lib/element.js +0 -611
  19. package/lib/node.js +0 -770
  20. package/lib/ranges.js +0 -130
  21. package/lib/text.js +0 -263
  22. package/lib/title.js +0 -83
  23. package/mixin/attributeParent.js +0 -117
  24. package/mixin/fixedToken.js +0 -40
  25. package/mixin/hidden.js +0 -21
  26. package/mixin/singleLine.js +0 -31
  27. package/mixin/sol.js +0 -54
  28. package/parser/brackets.js +0 -126
  29. package/parser/commentAndExt.js +0 -59
  30. package/parser/converter.js +0 -46
  31. package/parser/externalLinks.js +0 -33
  32. package/parser/hrAndDoubleUnderscore.js +0 -49
  33. package/parser/html.js +0 -42
  34. package/parser/links.js +0 -94
  35. package/parser/list.js +0 -59
  36. package/parser/magicLinks.js +0 -41
  37. package/parser/quotes.js +0 -64
  38. package/parser/selector.js +0 -177
  39. package/parser/table.js +0 -114
  40. package/src/arg.js +0 -207
  41. package/src/atom/hidden.js +0 -13
  42. package/src/atom/index.js +0 -43
  43. package/src/attribute.js +0 -470
  44. package/src/attributes.js +0 -453
  45. package/src/charinsert.js +0 -97
  46. package/src/converter.js +0 -176
  47. package/src/converterFlags.js +0 -284
  48. package/src/converterRule.js +0 -256
  49. package/src/extLink.js +0 -180
  50. package/src/gallery.js +0 -149
  51. package/src/hasNowiki/index.js +0 -44
  52. package/src/hasNowiki/pre.js +0 -40
  53. package/src/heading.js +0 -134
  54. package/src/html.js +0 -254
  55. package/src/imageParameter.js +0 -303
  56. package/src/imagemap.js +0 -199
  57. package/src/imagemapLink.js +0 -41
  58. package/src/index.js +0 -932
  59. package/src/link/category.js +0 -44
  60. package/src/link/file.js +0 -287
  61. package/src/link/galleryImage.js +0 -120
  62. package/src/link/index.js +0 -388
  63. package/src/magicLink.js +0 -149
  64. package/src/nested/choose.js +0 -24
  65. package/src/nested/combobox.js +0 -23
  66. package/src/nested/index.js +0 -93
  67. package/src/nested/references.js +0 -23
  68. package/src/nowiki/comment.js +0 -71
  69. package/src/nowiki/dd.js +0 -59
  70. package/src/nowiki/doubleUnderscore.js +0 -56
  71. package/src/nowiki/hr.js +0 -41
  72. package/src/nowiki/index.js +0 -56
  73. package/src/nowiki/list.js +0 -16
  74. package/src/nowiki/noinclude.js +0 -28
  75. package/src/nowiki/quote.js +0 -69
  76. package/src/onlyinclude.js +0 -64
  77. package/src/paramTag/index.js +0 -89
  78. package/src/paramTag/inputbox.js +0 -35
  79. package/src/parameter.js +0 -239
  80. package/src/syntax.js +0 -91
  81. package/src/table/index.js +0 -983
  82. package/src/table/td.js +0 -338
  83. package/src/table/tr.js +0 -319
  84. package/src/tagPair/ext.js +0 -145
  85. package/src/tagPair/include.js +0 -50
  86. package/src/tagPair/index.js +0 -126
  87. package/src/transclude.js +0 -843
  88. package/tool/index.js +0 -1202
  89. package/util/base.js +0 -17
  90. package/util/debug.js +0 -73
  91. package/util/diff.js +0 -76
  92. package/util/lint.js +0 -55
  93. package/util/string.js +0 -126
package/README.md CHANGED
@@ -2,39 +2,51 @@
2
2
  [![CodeQL](https://github.com/bhsd-harry/wikiparser-node/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/bhsd-harry/wikiparser-node/actions/workflows/github-code-scanning/codeql)
3
3
 
4
4
  # 简介
5
- wikiparser-node 是一款由 Bhsd 开发的基于 [Node.js](https://nodejs.org/en/) 环境的离线[维基文本](https://www.mediawiki.org/wiki/Wikitext)语法解析器,可以解析绝大部分的维基语法并生成[语法树](https://en.wikipedia.org/wiki/Abstract_syntax_tree),还可以很方便地对语法树进行查询和修改,最后返回修改后的维基文本。语法树的每个节点对应一个仿照 [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) 类设计的类 [Token](https://github.com/bhsd-harry/wikiparser-node/wiki/01.-Token)。
6
5
 
7
- # 使用方法
6
+ wikiparser-node 是一款由 Bhsd 开发的基于 [Node.js](https://nodejs.org/en/) 环境的离线[维基文本](https://www.mediawiki.org/wiki/Wikitext)语法解析器,可以解析绝大部分的维基语法并生成[语法树](https://en.wikipedia.org/wiki/Abstract_syntax_tree),还可以很方便地对语法树进行查询和修改,最后返回修改后的维基文本。
7
+
8
+ # 其他版本
9
+
10
+ ## Mini
11
+
12
+ 仅保留了解析功能和[语法错误分析](https://github.com/bhsd-harry/wikiparser-node/wiki/AstElement#lint)功能的轻量版本,解析生成的语法树不能修改。这个版本被应用于 [eslint-plugin-wikitext](/bhsd-harry/eslint-plugin-wikitext) 插件。
13
+
14
+ ## Browser
15
+
16
+ 兼容浏览器的版本,可用于代码高亮或是搭配 [CodeMirror5](https://codemirror.net/5/) 编辑器作为语法分析插件。([使用实例展示](https://bhsd-harry.github.io/wikiparser-node))
17
+
18
+ # 安装方法
19
+
20
+ ## Node.js
21
+
22
+ 请根据需要需要安装对应的版本(`latest` 或 `mini`),如:
23
+
24
+ ```sh
25
+ npm i wikiparser-node # 默认为latest
26
+ ```
8
27
 
9
- ```js
10
- var Parser = require('wikiparser-node');
28
+
29
+
30
+ ```sh
31
+ npm i wikiparser-node@mini
32
+ ```
33
+
34
+ ## 浏览器
35
+
36
+ 可以通过 CDN 下载代码,如:
37
+
38
+ ```html
39
+ <script src="//cdn.jsdelivr.net/npm/wikiparser-node@browser/bundle/bundle.min.js"></script>
11
40
  ```
12
41
 
13
- 更多文档请查阅 [Wiki](https://github.com/bhsd-harry/wikiparser-node/wiki)。
14
-
15
- # 目录
16
-
17
- 1. [Parser](https://github.com/bhsd-harry/wikiparser-node/wiki/Home#parser)
18
- 2. [AstElement](https://github.com/bhsd-harry/wikiparser-node/wiki/01.-Token#astelement)
19
- 3. [Token](https://github.com/bhsd-harry/wikiparser-node/wiki/01.-Token#token)
20
- 4. [CommentToken](https://github.com/bhsd-harry/wikiparser-node/wiki/02.-CommentToken等#commenttoken)
21
- 5. [ExtToken](https://github.com/bhsd-harry/wikiparser-node/wiki/03.-ExtToken)
22
- 6. [AttributeToken](https://github.com/bhsd-harry/wikiparser-node/wiki/04.-AttributeToken)
23
- 7. [HeadingToken](https://github.com/bhsd-harry/wikiparser-node/wiki/05.-HeadingToken)
24
- 8. [ArgToken](https://github.com/bhsd-harry/wikiparser-node/wiki/06.-ArgToken)
25
- 9. [TranscludeToken](https://github.com/bhsd-harry/wikiparser-node/wiki/07.-TranscludeToken)
26
- 10. [ParameterToken](https://github.com/bhsd-harry/wikiparser-node/wiki/08.-ParameterToken)
27
- 11. [HtmlToken](https://github.com/bhsd-harry/wikiparser-node/wiki/09.-HtmlToken)
28
- 12. [TableToken](https://github.com/bhsd-harry/wikiparser-node/wiki/10.-TableToken)
29
- 13. [TdToken](https://github.com/bhsd-harry/wikiparser-node/wiki/11.-TdToken)
30
- 14. [DoubleUnderscoreToken](https://github.com/bhsd-harry/wikiparser-node/wiki/12.-DoubleUnderscoreToken)
31
- 15. [LinkToken](https://github.com/bhsd-harry/wikiparser-node/wiki/13.-LinkToken)
32
- 16. [CategoryToken](https://github.com/bhsd-harry/wikiparser-node/wiki/14.-CategoryToken)
33
- 17. [FileToken](https://github.com/bhsd-harry/wikiparser-node/wiki/15.-FileToken和GalleryImageToken#filetoken)
34
- 18. [ImageParameterToken](https://github.com/bhsd-harry/wikiparser-node/wiki/16.-ImageParameterToken)
35
- 19. [ExtLinkToken](https://github.com/bhsd-harry/wikiparser-node/wiki/17.-ExtLinkToken和MagicLinkToken#extlinktoken)
36
- 20. [MagicLinkToken](https://github.com/bhsd-harry/wikiparser-node/wiki/17.-ExtLinkToken和MagicLinkToken#magiclinktoken)
37
- 21. [ConverterToken](https://github.com/bhsd-harry/wikiparser-node/wiki/18.-ConverterToken)
38
- 22. [ConverterRuleToken](https://github.com/bhsd-harry/wikiparser-node/wiki/19.-ConverterRuleToken)
39
- 23. [选择器](https://github.com/bhsd-harry/wikiparser-node/wiki/20.-选择器)
40
- 24. [$ (TokenCollection)](https://github.com/bhsd-harry/wikiparser-node/wiki/21.-$-(TokenCollection))
42
+
43
+
44
+ ```html
45
+ <script src="//unpkg.com/wikiparser-node@browser/bundle/bundle.min.js"></script>
46
+ ```
47
+
48
+ 更多浏览器端可用的插件请查阅对应[文档](https://github.com/bhsd-harry/wikiparser-node/wiki/Browser)
49
+
50
+ # 使用方法
51
+
52
+ 请查阅 [Wiki](https://github.com/bhsd-harry/wikiparser-node/wiki/Parser)
@@ -0,0 +1,38 @@
1
+ (()=>{var yt=Object.defineProperty;var St=(W,D,X)=>D in W?yt(W,D,{enumerable:!0,configurable:!0,writable:!0,value:X}):W[D]=X;var P=(W,D,X)=>(St(W,typeof D!="symbol"?D+"":D,X),X),nt=(W,D,X)=>{if(!D.has(W))throw TypeError("Cannot "+X)};var m=(W,D,X)=>(nt(W,D,"read from private field"),X?X.call(W):D.get(W)),O=(W,D,X)=>{if(D.has(W))throw TypeError("Cannot add the same private member more than once");D instanceof WeakSet?D.add(W):D.set(W,X)},U=(W,D,X,tt)=>(nt(W,D,"write to private field"),tt?tt.call(W,X):D.set(W,X),X),it=(W,D,X,tt)=>({set _(y){U(W,D,y,X)},get _(){return m(W,D,tt)}}),K=(W,D,X)=>(nt(W,D,"access private method"),X);(()=>{"use strict";var W={6010:(y,N,t)=>{const f={config:void 0,minConfig:t(8166),i18n:void 0,MAX_STAGE:11,getConfig(){return{...this.minConfig,...this.config,excludes:[]}},msg(h,u){var r,n;return h=(n=(r=this.i18n)==null?void 0:r[h])!=null?n:h,h.replace("$1",u)},normalizeTitle(h,u=0,r=!1,n=f.getConfig(),s=!1,e=!1,i=!1){let o;if(!s){const d=t(8138);o=this.run(()=>{const g=new d(String(h),n),c=g.getAttribute("parseOnce");return c(0,r),c()}),h=o.firstChild}const l=t(6986);return new l(String(h),u,n,e,i)},parse(h,u,r=f.MAX_STAGE,n=f.getConfig()){if(typeof h!="string")throw new TypeError("\u5F85\u89E3\u6790\u7684\u5185\u5BB9\u5E94\u4E3A String\uFF01");const s=t(8138);let e;return this.run(()=>{e=new s(h,n);try{e.parse(r,u)}catch(i){}}),e},run(h){return h()}},$={},S=new Set(["MAX_STAGE","minConfig"]),T=new Set(["config","normalizeTitle","parse"]);for(const h in f)S.has(h)?$[h]={enumerable:!1,writable:!1}:T.has(h)||($[h]={enumerable:!1});Object.defineProperties(f,$),typeof self=="object"&&(self.Parser=f),y.exports=f},9205:(y,N,t)=>{const{print:f}=t(231),$=t(3853),S=t(7507),T=new Set(["nowiki","pre","charinsert","score","syntaxhighlight","source","math","chem","ce","graph","mapframe","maplink","quiz","templatedata","timeline"]);class h extends ${constructor(){super(...arguments);P(this,"name")}get length(){return this.childNodes.length}closest(n){const s=new Set(n.split(",").map(i=>i.trim()));let{parentNode:e}=this;for(;e;){if(s.has(e.type))return e;({parentNode:e}=e)}}append(...n){for(const s of n)this.insertAt(s)}replaceChildren(...n){this.childNodes.length=0,this.append(...n)}setText(n,s=0){const e=this.childNodes[s],{type:i,data:o}=e;if(i==="text")return e.replaceData(n),o}toString(n,s=""){return this.childNodes.map(e=>e.toString()).join(s)}lint(n=0){const s=t(8058);if(this instanceof s||this.constructor.hidden||this.type==="ext-inner"&&T.has(this.name))return[];const e=[];for(let i=0,o=n+this.getPadding();i<this.length;i++){const l=this.childNodes[i];e.push(...l.lint(o)),o+=String(l).length+this.getGaps(i)}return e}print(n={}){return String(this)?`<span class="wpb-${n.class||this.type}">${f(this.childNodes,n)}</span>`:""}}y.exports=h},3853:(y,N,t)=>{var S,T,rt;const{text:f}=t(231);class ${constructor(){O(this,T);P(this,"type");P(this,"childNodes",[]);O(this,S,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return m(this,S)}get nextSibling(){var n;const r=(n=m(this,S))==null?void 0:n.childNodes;return r&&r[r.indexOf(this)+1]}get previousSibling(){var n;const r=(n=m(this,S))==null?void 0:n.childNodes;return r&&r[r.indexOf(this)-1]}hasAttribute(r){const n=typeof r;return n==="string"||n==="number"||n==="symbol"?r in this:!1}getAttribute(r){return this.hasAttribute(r)?String(this[r]):void 0}setAttribute(r,n){return r==="parentNode"?U(this,S,n):this[r]=n,this}text(r=""){return f(this.childNodes,r)}removeAt(r){const{childNodes:n}=this,[s]=n.splice(r,1);return s}insertAt(r,n=this.childNodes.length){const{childNodes:s}=this;return-1===-1&&r.setAttribute("parentNode",this),s.splice(n,0,r),r}normalize(){var s;const r=t(7507),{childNodes:n}=this;for(let e=n.length-1;e>=0;e--){const{type:i,data:o}=n[e];this.getGaps(e-1)||(o===""?n.splice(e,1):i==="text"&&((s=n[e-1])==null?void 0:s.type)==="text"&&(n[e-1].setAttribute("data",n[e-1].data+o),n.splice(e,1)))}}getRootNode(){let{parentNode:r}=this;for(;r!=null&&r.parentNode;)({parentNode:r}=r);return r!=null?r:this}posFromIndex(r){const n=String(this);if(r>=-n.length&&r<=n.length){const s=n.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 n;const s=(e,i)=>n.slice(0,e).reduce((o,l,a)=>o+String(l).length+i.getGaps(a),0)+i.getPadding();if(r===void 0){const{parentNode:e}=this;return e?({childNodes:n}=e,s(n.indexOf(this),e)):0}return{childNodes:n}=this,s(r,this)}get offsetHeight(){return K(this,T,rt).call(this).height}get offsetWidth(){return K(this,T,rt).call(this).width}}S=new WeakMap,T=new WeakSet,rt=function(){const r=String(this).split(`
3
+ `);return{height:r.length,width:r[r.length-1].length}},y.exports=$},7507:(y,N,t)=>{var n,ot;const f=t(6010),$=t(3853),S=t(9205),T=/https?:\/\/|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+|<\s*\/?([a-z]\w*)/giu,h=/\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+|<\s*\/?([a-z]\w*)/giu,u=["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"];class r extends ${constructor(o=""){super();O(this,n);P(this,"type","text");P(this,"data");this.data=o}toString(){return this.data}text(){return this.data}lint(o){const{data:l,parentNode:a,nextSibling:d,previousSibling:g}=this,c=a==null?void 0:a.type,x=a==null?void 0:a.name,A=d==null?void 0:d.type,p=g==null?void 0:g.type,w=c==="free-ext-link"||c==="ext-link-url"||c==="image-parameter"&&x==="link"?h:T,k=[],{ext:C,html:F}=this.getRootNode().getAttribute("config");if(l.search(w)!==-1){w.lastIndex=0;const v=this.getRootNode(),{top:L,left:H}=v.posFromIndex(o),E=new Set([C,F,u].flat(2));for(let I=w.exec(l);I;I=w.exec(l)){const[,z,B]=I;let{0:j,index:M}=I;z&&z!=="]"&&(M+=z.length,j=j.slice(z.length));const V=o+M,Z=l.slice(0,M).split(`
4
+ `),Q=Z.length+L-1,_=Z[Z.length-1],Y=Z.length>1?_.length:H+_.length,{0:b,length:R}=j,G=V+R,J=String(v),q=J[G],st=J[V-1],Tt=R>1&&(b!=="<"||/[\s/>]/u.test(q))||b==="{"&&(q===b||st==="-")||b==="}"&&(st===b||q==="-")||b==="["&&(q===b||c==="ext-link-text"||!l.slice(M+1).trim()&&A==="free-ext-link")||b==="]"&&(st===b||!l.slice(0,M).trim()&&p==="free-ext-link")?"error":"warning";(b!=="h"||M>0)&&(b!=="<"||E.has(B.toLowerCase()))&&k.push({message:f.msg('lonely "$1"',b==="h"?j:b),severity:Tt,startIndex:V,endIndex:G,startLine:Q,endLine:Q,startCol:Y,endCol:Y+R})}}return k}replaceData(o=""){K(this,n,ot).call(this,o)}}n=new WeakSet,ot=function(o){o=String(o),this.setAttribute("data",o)},y.exports=r},6986:(y,N,t)=>{const{decodeHtml:f}=t(231),$=t(6010);class S{constructor(h,u=0,r=$.getConfig(),n=!1,s=!1){P(this,"valid",!0);P(this,"ns",0);P(this,"fragment");P(this,"encoded",!1);const{namespaces:e,nsid:i}=r;let o=e[u];if(h=f(h),n&&h.includes("%"))try{const g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(h);h=decodeURIComponent(h),this.encoded=g}catch(g){}h=h.replace(/_/gu," ").trim(),h[0]===":"&&(o="",h=h.slice(1).trim());const l=h.split(":");if(l.length>1){const g=e[i[l[0].trim().toLowerCase()]];g!==void 0&&(o=g,h=l.slice(1).join(":").trim())}this.ns=i[o.toLowerCase()];const a=h.indexOf("#");let d;a!==-1&&(d=h.slice(a+1).trim(),h=h.slice(0,a).trim()),this.valid=Boolean(h||s&&d!==void 0)&&!/\0\d+[eh!+-]\x7F|[<>[\]{}|]|%[\da-f]{2}/iu.test(h),this.fragment=d}}y.exports=S},2308:y=>{const N=t=>{var f;return f=class extends t{text(){return""}},P(f,"hidden",!0),f};y.exports=N},8275:(y,N,t)=>{const{removeComment:f}=t(231),$=t(6010),S=t(9450),T=t(1782),h=t(9544),u=(r,n=$.getConfig(),s=[])=>{var A,p,w,k,C;const e=`${n.excludes.includes("heading")?"":"^(\0\\d+c\x7F)*={1,6}|"}\\[\\[|\\{{2,}|-\\{(?!\\{)`,{parserFunction:[,,,i]}=n,o=[],l={"=":`
5
+ `,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},a={"!":"!","!!":"+","(!":"{","!)":"}","!-":"-","=":"~"};let d=new RegExp(e,"gmu"),g=d.exec(r),c=r.includes("}}"),x;for(;g||x<=r.length&&((p=(A=o[o.length-1])==null?void 0:A[0])==null?void 0:p[0])==="=";){if(g!=null&&g[1]){const[,{length:V}]=g;g[0]=g[0].slice(V),g.index+=V}const{0:F,index:v}=g!=null?g:{0:`
6
+ `,index:r.length},L=(w=o.pop())!=null?w:{},{0:H,index:E,parts:I,findEqual:z,pos:B}=L,j=F==="="&&z;if(F==="]]"||F==="}-")x=v+2;else if(F===`
7
+ `){x=v+1;const{pos:V,findEqual:Z}=(k=o[o.length-1])!=null?k:{};if(!V||Z||f(r.slice(V,E))!==""){const Q=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(r.slice(E,v));Q&&(r=`${r.slice(0,E)}\0${s.length}h\x7F${r.slice(v)}`,x=E+4+String(s.length).length,new S(Q[1].length,Q.slice(2),n,s))}}else if(F==="|"||j)x=v+1,I[I.length-1].push(r.slice(B,v)),F==="|"&&I.push([]),L.pos=x,L.findEqual=F==="|",o.push(L);else if(F.startsWith("}}")){const V=F.slice(0,Math.min(H.length,3)),Z=H.length-V.length,{length:Q}=s;x=v+V.length,I[I.length-1].push(r.slice(B,v));let _=!1,Y="t";if(V.length===3){const b=I.map(G=>G.join("=")),R=b.length>1&&f(b[1]).trim();new h(b,n,s),R&&R.endsWith(":")&&i.includes(R.slice(0,-1).toLowerCase())&&(Y="s")}else try{new T(I[0][0],I.slice(1),n,s);const b=f(I[0][0]).trim();b in a?Y=a[b]:/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(b)?Y="m":/^#vardefine:./iu.test(b)&&(Y="c")}catch(b){if(b instanceof Error&&b.message.startsWith("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0\uFF1A"))x=E+H.length,_=!0;else throw b}_||(r=`${r.slice(0,E+Z)}\0${Q}${Y}\x7F${r.slice(x)}`,x=E+Z+3+String(Q).length,Z>1?o.push({0:H.slice(0,Z),index:E,pos:E+Z,parts:[[]]}):Z===1&&r[E-1]==="-"&&o.push({0:"-{",index:E-1,pos:E+1,parts:[[]]}))}else x=v+F.length,F[0]==="{"&&(g.pos=x,g.parts=[[]]),o.push(..."0"in L?[L]:[],g);c&&(c=r.slice(x).includes("}}"));let M=o[o.length-1];!c&&((C=M==null?void 0:M[0])==null?void 0:C[0])==="{"&&(o.pop(),M=o[o.length-1]),d=new RegExp(e+(M?`|${l[M[0][0]]}${M.findEqual?"|=":""}`:""),"gmu"),d.lastIndex=x,g=d.exec(r)}return r};y.exports=u},4907:(y,N,t)=>{const f=t(6010),$=t(851),S=t(3423),T=t(8655),h=t(7267),u=t(5749),r=(n,s=f.getConfig(),e=[],i=!1)=>{const o=/<onlyinclude>(.*?)<\/onlyinclude>/gsu;if(i&&n.search(o)!==-1)return n.replace(o,(c,x)=>{const A=`\0${e.length}e\x7F`;return new $(x,s,e),A}).replace(/(^|\0\d+e\x7F)([^\0]+)(?=$|\0\d+e\x7F)/gu,(c,x,A)=>(new S(A,s,e),`${x}\0${e.length-1}c\x7F`));const l=s.ext.join("|"),a=i?"includeonly":"(?:no|only)include",d=i?"noinclude":"includeonly",g=new RegExp(`<!--.*?(?:-->|$)|<${a}(?:\\s[^>]*?)?>|</${a}\\s*>|<(${l})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|<(${d})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(\\5\\s*)>|$))`,"gisu");return n.replace(g,(c,x,A,p,w,k,C,F,v)=>{const L=`\0${e.length}${x?"e":"c"}\x7F`;if(x)new h(x,A,p,w,s,e);else if(c.startsWith("<!--")){const H=c.endsWith("-->");new u(c.slice(4,H?-3:void 0),H,s,e)}else k?new T(k,C,F,v,s,e):new S(c,s,e);return L})};y.exports=r},3765:(y,N,t)=>{const f=t(6010),$=t(9910),S=(T,h=f.getConfig(),u=[])=>{const r=/-\{/gu,n=/-\{|\}-/gu,s=[];let e=r,i=e.exec(T);for(;i;){const{0:o,index:l}=i;if(o==="}-"){const a=s.pop(),{length:d}=u,g=T.slice(a.index+2,l),c=g.indexOf("|"),[x,A]=c===-1?[[],g]:[g.slice(0,c).split(";"),g.slice(c+1)],p=A.replace(/(&[#a-z\d]+);/giu,"$1"),w=`(?:${h.variants.join("|")})`,k=p.split(new RegExp(`;(?=\\s*(?:${w}|[^;]*?=>\\s*${w})\\s*:)`,"u")).map(C=>C.replace(/\x01/gu,";"));new $(x,k,h,u),T=`${T.slice(0,a.index)}\0${d}v\x7F${T.slice(l+2)}`,s.length===0&&(e=r),e.lastIndex=a.index+3+String(d).length}else s.push(i),e=n,e.lastIndex=l+2;i=e.exec(T)}return T};y.exports=S},7513:(y,N,t)=>{const{extUrlChar:f,extUrlCharFirst:$}=t(231),S=t(6010),T=t(741),h=(u,r=S.getConfig(),n=[])=>{const s=new RegExp(`\\[((?:(?:${r.protocol}|//)${$}|\0\\d+m\x7F)${f})(\\p{Zs}*)([^\\]-\b
8
+ -\uFFFD]*)\\]`,"giu");return u.replace(s,(e,i,o,l)=>{const{length:a}=n,d=/&[lg]t;/u.exec(i);return d&&(i=i.slice(0,d.index),o="",l=`${i.slice(d.index)}${o}${l}`),new T(i,o,l,r,n),`\0${a}w\x7F`})};y.exports=h},2937:(y,N,t)=>{const f=t(6010),$=t(7507),S=t(8138),T=t(2582),h=t(7815),u=t(9450),r=({firstChild:{data:n},type:s,name:e},i=f.getConfig(),o=[])=>{const{doubleUnderscore:l}=i,a=new Set(l[0]),d=new Set(l[1]);return s!=="root"&&(s!=="ext-inner"||e!=="poem")&&(n=`\0${n}`),n=n.replace(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(g,c,x)=>(new T(x.length,i,o),`${c}\0${o.length-1}r\x7F`)).replace(new RegExp(`__(${l.flat().join("|")})__`,"giu"),(g,c)=>a.has(c.toLowerCase())||d.has(c)?(new h(c,i,o),`\0${o.length-1}u\x7F`):g).replace(/^((?:\0\d+c\x7F)*)(={1,6})(.+)\2((?:[^\S\n]|\0\d+c\x7F)*)$/gmu,(g,c,x,A,p)=>{const w=`${c}\0${o.length}h\x7F`;return new u(x.length,[A,p],i,o),w}),s==="root"||s==="ext-inner"&&e==="poem"?n:n.slice(1)};y.exports=r},5130:(y,N,t)=>{const f=t(6010),$=t(5649),S=t(2350),T=(h,u=f.getConfig(),r=[])=>{const n=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,s=new Set(u.html.flat()),e=h.split("<");let i=e.shift();for(const o of e){const l=n.exec(o),a=l==null?void 0:l[2],d=a==null?void 0:a.toLowerCase();if(!l||!s.has(d)){i+=`<${o}`;continue}const[,g,,c="",x,A]=l,p=new $(c,"html-attrs",d,u,r),w=p.getAttr("itemprop");if(d==="meta"&&(w===void 0||p.getAttr("content")===void 0)||d==="link"&&(w===void 0||p.getAttr("href")===void 0)){i+=`<${o}`,r.pop();continue}i+=`\0${r.length}x\x7F${A}`,new S(a,p,g==="/",x==="/>",u,r)}return i};y.exports=T},1452:(y,N,t)=>{const f=t(6010),$=t(3905),S=t(7625),T=t(337),h=(u,r=f.getConfig(),n=[])=>{const s=t(3360),e=r.inExt?/^((?:(?!\0\d+!\x7F)[^\n<>[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n<>[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,i=/^((?:(?!\0\d+!\x7F)[^\n<>[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,o=new RegExp(`^\\s*(?:${r.protocol})`,"iu"),l=u.split("[[");let a=l.shift();for(let d=0;d<l.length;d++){let g,c,x,A,p;const w=l[d],k=e.exec(w);if(k)[,c,x,A,p]=k,p[0]==="]"&&(A==null?void 0:A.includes("["))&&(A+="]",p=p.slice(1));else{const E=i.exec(w);E&&(g=!0,[,c,x,A]=E)}if(c===void 0||o.test(c)||/\0\d+[exhbru]\x7F/u.test(c)){a+=`[[${w}`;continue}const C=c.trim()[0]===":";if(C&&g){a+=`[[${w}`;continue}const F=f.normalizeTitle(c,0,!1,r,!0,!0,!0),{ns:v,valid:L}=F;if(L){if(g){if(v!==6){a+=`[[${w}`;continue}let E;for(d++;d<l.length;d++){const I=l[d],z=I.split("]]");if(z.length>2){E=!0,A+=`[[${z[0]}]]${z[1]}`,p=z.slice(2).join("]]");break}else if(z.length===2)A+=`[[${z[0]}]]${z[1]}`;else{A+=`[[${I}`;break}}if(A=h(A,r,n),!E){a+=`[[${c}${x}${A}`;continue}}}else{a+=`[[${w}`;continue}A&&(A=s(A,r,n)),a+=`\0${n.length}l\x7F${p}`;let H=$;C||(v===6?H=S:v===14&&(H=T)),A===void 0&&x&&(A=""),new H(c,A,r,n,x)}return a};y.exports=h},6622:(y,N,t)=>{const f=t(6010),$=t(962),S=t(3434),T=(h,u=f.getConfig(),r=[])=>{const n=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(h);if(!n)return h;const[s,e,i]=n;h=`${e}\0${r.length}d\x7F${h.slice(s.length)}`,new $(i,u,r);let o=i.split(";").length-1;if(!o)return h;let l=/:+|-\{/gu,a=l.exec(h),d=0;for(;a&&o;){const{0:g,index:c}=a;if(g[0]===":"){if(g.length>=o)return new S(":".repeat(o),u,r),`${h.slice(0,c)}\0${r.length-1}d\x7F${h.slice(c+o)}`;h=`${h.slice(0,c)}\0${r.length}d\x7F${h.slice(l.lastIndex)}`,o-=g.length,l.lastIndex=c+4+String(r.length).length,new S(g,u,r)}else if(g==="-{"){if(!d){const{lastIndex:x}=l;l=/-\{|\}-/gu,l.lastIndex=x}d++}else if(d--,!d){const{lastIndex:x}=l;l=/:+|-\{/gu,l.lastIndex=x}a=l.exec(h)}return h};y.exports=T},4737:(y,N,t)=>{const{extUrlChar:f,extUrlCharFirst:$}=t(231),S=t(6010),T=t(8962),h=(u,r=S.getConfig(),n=[])=>{const s=new RegExp(`(^|[^\\p{L}\\d_])(?:${r.protocol})(${$}${f})`,"giu");return u.replace(s,(e,i,o)=>{let l="",a=i?e.slice(1):e;const d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(a);d&&(l=a.slice(d.index),a=a.slice(0,d.index));const g=new RegExp(`[,;.:!?${a.includes("(")?"":")"}]+$`,"u"),c=g.exec(a);if(c){let x=0;c[0][0]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(a.slice(0,c.index))&&(x=1),l=`${a.slice(c.index+x)}${l}`,a=a.slice(0,c.index+x)}return l.length>=o.length?e:(new T(a,!1,r,n),`${i}\0${n.length-1}w\x7F${l}`)})};y.exports=h},3360:(y,N,t)=>{const f=t(6010),$=t(6714),S=(T,h=f.getConfig(),u=[])=>{var a;const r=T.split(/('{2,})/u),{length:n}=r;if(n===1)return T;let s=0,e=0,i,o,l;for(let d=1;d<n;d+=2){const{length:g}=r[d];switch(g){case 2:e++;break;case 4:r[d-1]+="'",r[d]="'''";case 3:if(s++,i)break;r[d-1].endsWith(" ")?!o&&!l&&(l=d):r[d-1].slice(-2,-1)===" "?i=d:o||(o=d);break;default:r[d-1]+="'".repeat(g-5),r[d]="'''''",e++,s++}}if(e%2===1&&s%2===1){const d=(a=i!=null?i:o)!=null?a:l;r[d]="''",r[d-1]+="'"}for(let d=1;d<n;d+=2)new $(r[d].length,h,u),r[d]=`\0${u.length-1}q\x7F`;return r.join("")};y.exports=S},4624:(y,N,t)=>{const f=t(6010),$=t(7507),S=t(8138),T=t(2840),h=t(3125),u=t(5567),r=t(3434),n=({firstChild:{data:s},type:e,name:i},o=f.getConfig(),l=[])=>{const a=[],d=s.split(`
9
+ `);let g=e==="root"||e==="parameter-value"||e==="ext-inner"&&i==="poem"?"":`
10
+ ${d.shift()}`;const c=(x,A)=>{if(!A){g+=x;return}const{lastChild:p}=A;if(p.constructor===S)p.setText(String(p)+x);else{const w=new S(x,o,!0,l);w.type="table-inter",A.insertAt(w.setAttribute("stage",3))}};for(const x of d){let A=a.pop();const[p]=/^(?:\s|\0\d+c\x7F)*/u.exec(x),w=x.slice(p.length),k=/^(:*)((?:\s|\0\d+c\x7F)*)(\{\||\{(?:\0\d+c\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(w);if(k){for(;A&&A.type!=="td";)A=a.pop();const[,E,I,z,B]=k;E&&new r(E,o,l),c(`
11
+ ${p}${E&&`\0${l.length-1}d\x7F`}${I}\0${l.length}b\x7F`,A);const j=new T(z,B,o,l);a.push(...A?[A]:[],j);continue}else if(!A){g+=`
12
+ ${x}`;continue}const C=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(w);if(!C){c(`
13
+ ${x}`,A),a.push(...A?[A]:[]);continue}const[,F,v,L,H]=C;if(F){for(;!(A instanceof T);)A=a.pop();A.close(`
14
+ ${p}${F}`,!0),c(H,a[a.length-1])}else if(v){A.type==="td"&&(A=a.pop()),A.type==="tr"&&(A=a.pop());const E=new h(`
15
+ ${p}${v}`,H,o,l);a.push(A,E),A.insertAt(E)}else{A.type==="td"&&(A=a.pop());const E=L==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let I=E.exec(H),z=0,B=`
16
+ ${p}${L}`;for(;I;){const M=new u(B,H.slice(z,I.index),o,l);A.insertAt(M),{lastIndex:z}=E,[B]=I,I=E.exec(H)}const j=new u(B,H.slice(z),o,l);a.push(A,j),A.insertAt(j)}}return g.slice(1)};y.exports=n},9544:(y,N,t)=>{const{text:f}=t(231),{generateForChild:$}=t(8277),S=t(6010),T=t(8138);class h extends T{constructor(n,s=S.getConfig(),e=[]){super(void 0,s,!0,e,{});P(this,"type","arg");for(let i=0;i<n.length;i++)if(i===0||i>1){const o=t(i===0?9237:9263),l=new o(n[i],i===0?"arg-name":void 0,s,e,{});super.insertAt(l)}else{const o=new T(n[i],s,!0,e);o.type="arg-default",super.insertAt(o.setAttribute("stage",2))}}get default(){var n,s;return(s=(n=this.childNodes[1])==null?void 0:n.text())!=null?s:!1}toString(n){return`{{{${super.toString(n,"|")}}}}`}text(){return`{{{${f(this.childNodes.slice(0,2),"|")}}}}`}getPadding(){return 3}getGaps(){return 1}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}lint(n){const{childNodes:[s,e,...i]}=this,o=s.lint(n+3);if(e&&o.push(...e.lint(n+4+String(s).length)),i.length>0){const l={start:n,...this.getRootNode().posFromIndex(n)};o.push(...i.map(a=>{const d=$(a,l,"invisible content inside triple brackets"),{startIndex:g,startCol:c}=d;return{...d,startIndex:g-1,startCol:c-1}}))}return o}}y.exports=h},9263:(y,N,t)=>{const f=t(2308),$=t(9237);class S extends f($){constructor(){super(...arguments);P(this,"type","hidden")}}y.exports=S},9237:(y,N,t)=>{const f=t(6010),$=t(8138);class S extends ${constructor(u,r,n=f.getConfig(),s=[],e=void 0){super(u,n,!0,s,e);P(this,"type","plain");r&&(this.type=r)}}y.exports=S},5037:(y,N,t)=>{var x,A,p;const{generateForChild:f}=t(8277),{removeComment:$}=t(231),S=t(6010),T=t(8138),h=t(9237),u=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"]),n=new Set(["cite"]),s=new Set(["cite","datetime"]),e=new Set(["width"]),i=new Set(["align","valign","abbr","axis","headers","scope","rowspan","colspan","width","height","bgcolor"]),o=new Set(["type"]),l={div:r,h1:r,h2:r,h3:r,h4:r,h5:r,h6:r,blockquote:n,q:n,p:r,br:new Set(["clear"]),pre:e,ins:s,del:s,ul:o,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:i,th:i,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:e,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","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline","align"])},a=new Set,d={nowiki:a,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:a,inputbox:a,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:a,poll:new Set(["id","show-results-before-voting"]),sm2:o,flashmp3:o,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"])},g=new RegExp("expression|(?:filter|accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u");class c extends T{constructor(C,F,v,L="",H="",E=[],I=S.getConfig(),z=[]){const B=new h(v,"attr-key",I,z,{});let j;if(v==="title")j=new T(H,I,!0,z,{}).setAttribute("type","attr-value").setAttribute("stage",S.MAX_STAGE-1);else if(F==="gallery"&&v==="caption"){const M={...I,excludes:[...I.excludes,"quote","extLink","magicLink","list"]};j=new T(H,M,!0,z,{}).setAttribute("type","attr-value").setAttribute("stage",5)}else if(F==="choose"&&(v==="before"||v==="after")){const M={...I,excludes:[...I.excludes,"heading","html","table","hr","list"]};j=new T(H,M,!0,z,{}).setAttribute("type","attr-value").setAttribute("stage",1)}else j=new h(H,"attr-value",I,z,{});super(void 0,I,!0,z);O(this,x,void 0);O(this,A,void 0);O(this,p,void 0);this.type=C,this.append(B,j),U(this,x,L),U(this,A,E),U(this,p,F),this.setAttribute("name",$(v).trim().toLowerCase())}get balanced(){return!m(this,x)||m(this,A)[0]===m(this,A)[1]}get value(){return this.getValue()}get tag(){return m(this,p)}afterBuild(){m(this,x).includes("\0")&&U(this,x,this.getAttribute("buildFromStr")(m(this,x),"string")),this.parentNode&&U(this,p,this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(C){const[F="",v=""]=m(this,A);return m(this,x)?`${super.toString(C,`${m(this,x)}${F}`)}${v}`:this.firstChild.toString(C)}text(){return m(this,x)?`${super.text(`${m(this,x).trim()}"`)}"`:this.firstChild.text()}getGaps(){var C,F;return m(this,x)?m(this,x).length+((F=(C=m(this,A)[0])==null?void 0:C.length)!=null?F:0):0}print(){const[C="",F=""]=m(this,A);return m(this,x)?super.print({sep:`${m(this,x)}${C}`,post:F}):super.print()}lint(C){var V;const F=super.lint(C),{balanced:v,firstChild:L,lastChild:H,type:E,name:I,parentNode:z,value:B}=this,j=z==null?void 0:z.name;let M;if(!v){const Z=this.getRootNode();M={start:C,...Z.posFromIndex(C)};const Q=f(H,M,"unclosed quotes","warning"),_=Q.startIndex-1,Y=Q.startCol-1;F.push({...Q,startIndex:_,startCol:Y})}return!/\{\{[^{]+\}\}/u.test(I)&&(E==="ext-attr"&&!(j in l)&&d[j]&&!d[j].has(I)||(E==="html-attr"||E==="table-attr"||j in l)&&!((V=l[j])!=null&&V.has(I))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(I)&&(j==="meta"||j==="link"||!u.has(I)))?(M||(M={start:C,...this.getRootNode().posFromIndex(C)}),F.push(f(L,M,"illegal attribute name"))):I==="style"&&typeof B=="string"&&g.test(B)&&(M||(M={start:C,...this.getRootNode().posFromIndex(C)}),F.push(f(H,M,"insecure style"))),F}getValue(){if(m(this,x)){const C=this.lastChild.text();return m(this,A)[1]?C:C.trim()}return!0}}x=new WeakMap,A=new WeakMap,p=new WeakMap,y.exports=c},5649:(y,N,t)=>{const{generateForSelf:f,generateForChild:$}=t(8277),{removeComment:S}=t(231),T=t(6010),h=t(8138),u=t(9237),r=t(5037);class n extends h{constructor(e,i,o,l=T.getConfig(),a=[]){if(super(void 0,l,!0,a,{}),this.type=i,this.setAttribute("name",o),e){const d=new RegExp(`([^\\s/](?:(?!\0\\d+~\x7F)[^\\s/=])*)(?:((?:\\s|\0\\d+c\x7F)*(?:=|\0\\d+~\x7F)(?:\\s|\0\\d+c\x7F)*)(?:(["'])(.*?)(\\3|$)|(\\S*)))?`,"gsu");let g="",c=d.exec(e),x=0;const A=()=>{g&&(super.insertAt(new u(g,`${i.slice(0,-1)}-dirty`,l,a,{})),g="")};for(;c;){const{index:p,0:w,1:k,2:C,3:F,4:v,5:L,6:H}=c;if(g+=e.slice(x,p),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(S(k).trim())){const E=v!=null?v:H,I=[F,L],z=new r(i.slice(0,-1),o,k,C,E,I,l,a);A(),super.insertAt(z)}else g+=w;({lastIndex:x}=d),c=d.exec(e)}g+=e.slice(x),A()}}afterBuild(){var i,o;const e=t(5567);this.type==="table-attrs"&&this.setAttribute("name",((i=this.parentNode)==null?void 0:i.subtype)==="caption"?"caption":(o=this.parentNode)==null?void 0:o.type)}getAttrTokens(e){return this.childNodes.filter(i=>i instanceof r&&i.name===e.toLowerCase().trim())}getAttrToken(e){const i=this.getAttrTokens(e);return i[i.length-1]}getAttr(e){var i;return(i=this.getAttrToken(e))==null?void 0:i.getValue()}lint(e){const i=t(2350),o=super.lint(e),{parentNode:{closing:l},length:a,childNodes:d}=this,g={},c=new Set;let x;l&&this.text().trim()&&(x={start:e,...this.getRootNode().posFromIndex(e)},o.push(f(this,x,"attributes of a closing tag")));for(let A=0;A<a;A++){const p=d[A];if(p instanceof u&&p.text().trim())x||(x={start:e,...this.getRootNode().posFromIndex(e)}),o.push($(p,x,"containing invalid attribute"));else if(p instanceof r){const{name:w}=p;w in g?(c.add(w),g[w].push(p)):w!=="class"&&(g[w]=[p])}}if(c.size>0){x||(x={start:e,...this.getRootNode().posFromIndex(e)});for(const A of c)o.push(...g[A].map(p=>$(p,x,T.msg("duplicated $1 attribute",A))))}return o}print(){const e=t(2350);return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(i=>i.print({class:i instanceof u&&i.text().trim()&&"hidden"})).join("")}</span>`:""}}y.exports=n},9910:(y,N,t)=>{const{text:f,print:$}=t(231),S=t(6010),T=t(8138),h=t(6719),u=t(8683);class r extends T{constructor(e,i,o=S.getConfig(),l=[]){super(void 0,o,!0,l);P(this,"type","converter");this.append(new h(e,o,l));const[a]=i,d=a.includes(":"),g=new u(a,d,o,l);d&&g.length===1?this.insertAt(new u(i.join(";"),!1,o,l)):this.append(g,...i.slice(1).map(c=>new u(c,!0,o,l)))}toString(e){const{childNodes:[i,...o]}=this;return`-{${i.toString()}${i.length>0?"|":""}${o.map(String).join(";")}}-`}text(){const{childNodes:[e,...i]}=this;return`-{${e.text()}|${f(i,";")}}-`}getPadding(){return 2}getGaps(e=0){return e=e<0?e+this.length:e,e||this.firstChild.length>0?1:0}print(){const{childNodes:[e,...i]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${$(i,{sep:";"})}}-</span>`}}y.exports=r},6719:(y,N,t)=>{var r;const{generateForChild:f}=t(8277),$=t(6010),S=t(8138),T=t(9237),h=new Set(["A","T","R","D","-","H","N"]);class u extends S{constructor(e,i=$.getConfig(),o=[]){super(void 0,i,!0,o,{});P(this,"type","converter-flags");O(this,r,void 0);this.append(...e.map(l=>new T(l,"converter-flag",i,o)))}afterBuild(){U(this,r,this.childNodes.map(e=>e.text().trim()))}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}print(){return super.print({sep:";"})}lint(e){const i=this.getVariantFlags(),o=this.getUnknownFlags(),l=new Set(m(this,r).filter(p=>h.has(p))),{length:a}=m(this,r).filter(p=>!p),d=m(this,r).length-o.size-a,g=super.lint(e);if(i.size===d||l.size===d)return g;const c={start:e,...this.getRootNode().posFromIndex(e)},{childNodes:x,length:A}=this;for(let p=0;p<A;p++){const w=x[p],k=w.text().trim();if(k&&!i.has(k)&&!o.has(k)&&(i.size>0||!l.has(k))){const C=f(w,c,"invalid conversion flag");g.push(C)}}return g}getUnknownFlags(){return new Set(m(this,r).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){const e=new Set(this.getAttribute("config").variants);return new Set(m(this,r).filter(i=>e.has(i)))}}r=new WeakMap,y.exports=u},8683:(y,N,t)=>{const f=t(6010),$=t(8138),S=t(9237);class T extends ${constructor(r,n=!0,s=f.getConfig(),e=[]){super(void 0,s,!0,e);P(this,"type","converter-rule");if(n){const i=r.indexOf(":"),o=r.slice(0,i).indexOf("=>"),l=o===-1?r.slice(0,i):r.slice(o+2,i);s.variants.includes(l.trim())?(super.insertAt(new S(l,"converter-rule-variant",s,e)),super.insertAt(new S(r.slice(i+1),"converter-rule-to",s,e)),o!==-1&&super.insertAt(new S(r.slice(0,o),"converter-rule-from",s,e),0)):super.insertAt(new S(r,"converter-rule-noconvert",s,e))}else super.insertAt(new S(r,"converter-rule-noconvert",s,e))}toString(r){if(this.length===3){const{childNodes:[n,s,e]}=this;return`${n.toString(r)}=>${s.toString(r)}:${e.toString(r)}`}return super.toString(r,":")}text(){if(this.length===3){const{childNodes:[r,n,s]}=this;return`${r.text()}=>${n.text()}:${s.text()}`}return super.text(":")}getGaps(r=0){const{length:n}=this;return r=r<0?r+n:r,r===0&&n===3?2:1}print(){if(this.length===3){const{childNodes:[r,n,s]}=this;return`<span class="wpb-converter-rule">${r.print()}=>${n.print()}:${s.print()}</span>`}return super.print({sep:":"})}}y.exports=T},741:(y,N,t)=>{var h;const f=t(6010),$=t(8138),S=t(8962);class T extends ${constructor(n,s="",e="",i=f.getConfig(),o=[]){super(void 0,i,!0,o,{});P(this,"type","ext-link");O(this,h,void 0);if(this.insertAt(new S(n,!0,i,o)),U(this,h,s),e){const l=new $(e,i,!0,o,{});l.type="ext-link-text",this.insertAt(l.setAttribute("stage",f.MAX_STAGE-1))}}toString(n){return this.length===1?`[${super.toString(n)}${m(this,h)}]`:`[${super.toString(n,m(this,h))}]`}text(){return`[${super.text(" ")}]`}getPadding(){return 1}getGaps(){return m(this,h).length}print(){const{length:n}=this;return super.print(n>1?{pre:"[",sep:m(this,h),post:"]"}:{pre:"[",post:`${m(this,h)}]`})}}h=new WeakMap,y.exports=T},1891:(y,N,t)=>{const f=t(6010),$=t(8138),S=t(1031),T=t(9263);class h extends ${constructor(n,s=f.getConfig(),e=[]){var i;super(void 0,s,!0,e,{});P(this,"type","ext-inner");P(this,"name","gallery");for(const o of(i=n==null?void 0:n.split(`
17
+ `))!=null?i:[]){const l=/^([^|]+)(?:\|(.*))?/u.exec(o);if(!l){super.insertAt(o.trim()?new T(o,void 0,s,[],{}):o);continue}const[,a,d]=l;this.normalizeTitle(a,6,!0,!0).valid?super.insertAt(new S(a,d,s,e)):super.insertAt(new T(o,void 0,s,[],{}))}}toString(n){return super.toString(n,`
18
+ `)}text(){return super.text(`
19
+ `).replace(/\n\s*\n/gu,`
20
+ `)}getGaps(){return 1}print(){return super.print({sep:`
21
+ `})}lint(n){const{top:s,left:e}=this.getRootNode().posFromIndex(n),i=[];for(let o=0,l=n;o<this.length;o++){const a=this.childNodes[o],d=String(a),{length:g}=d,c=d.trim(),x=s+o,A=o?0:e;a.type==="hidden"&&c&&!/^<!--.*-->$/u.test(c)?i.push({message:f.msg("invalid content in <$1>","gallery"),severity:"error",startIndex:l,endIndex:l+g,startLine:x,endLine:x,startCol:A,endCol:A+g}):a.type!=="hidden"&&a.type!=="text"&&i.push(...a.lint(l)),l+=g+1}return i}}y.exports=h},2158:(y,N,t)=>{const f=t(6010),$=t(8138),S=t(3423);class T extends ${constructor(u,r,n=f.getConfig(),s=[]){u=u.replace(/(<nowiki>)(.*?)(<\/nowiki>)/giu,(e,i,o,l)=>(new S(i,n,s),new S(l,n,s),`\0${s.length-1}c\x7F${o}\0${s.length}c\x7F`)),super(u,n,!0,s,{}),this.type=r}}y.exports=T},428:(y,N,t)=>{const f=t(6010),$=t(2158);class S extends ${constructor(u,r=f.getConfig(),n=[]){super(u,"ext-inner",r,n);P(this,"name","pre");this.setAttribute("stage",f.MAX_STAGE-1)}isPlain(){return!0}}y.exports=S},9450:(y,N,t)=>{const{generateForSelf:f}=t(8277),$=t(6010),S=t(8138),T=t(8058);class h extends S{constructor(n,s,e=$.getConfig(),i=[]){super(void 0,e,!0,i);P(this,"type","heading");this.setAttribute("name",String(n));const o=new S(s[0],e,!0,i);o.type="heading-title",o.setAttribute("stage",2);const l=new T(s[1],/^[^\S\n]*$/u,"heading-trail",e,i,{});this.append(o,l)}toString(n){const s="=".repeat(Number(this.name));return`${s}${this.firstChild.toString()}${s}${this.lastChild.toString()}`}text(){const n="=".repeat(Number(this.name));return`${n}${this.firstChild.text()}${n}`}getPadding(){return super.getPadding()+Number(this.name)}getGaps(){return Number(this.name)}print(){const n="=".repeat(Number(this.name));return super.print({pre:n,sep:n})}lint(n){const s=super.lint(n),e=String(this.firstChild);let i;return this.name==="1"&&(i=f(this,{start:n},"<h1>"),s.push(i)),(e[0]==="="||e.endsWith("="))&&(i||(i=f(this,{start:n},"")),s.push({...i,message:$.msg('unbalanced "=" in a section header')})),this.closest("html-attrs, table-attrs")&&(i||(i=f(this,{start:n},"")),s.push({...i,message:$.msg("section header in a HTML tag")})),s}}y.exports=h},2350:(y,N,t)=>{var u,r,n;const{generateForSelf:f}=t(8277),$=t(6010),S=t(8138),T=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]);class h extends S{constructor(i,o,l,a,d=$.getConfig(),g=[]){super(void 0,d,!0,g);P(this,"type","html");O(this,u,void 0);O(this,r,void 0);O(this,n,void 0);this.insertAt(o),this.setAttribute("name",i.toLowerCase()),U(this,u,l),U(this,r,a),U(this,n,i)}get closing(){return m(this,u)}toString(i){return`<${m(this,u)?"/":""}${m(this,n)}${super.toString()}${m(this,r)?"/":""}>`}text(){return`<${m(this,u)?"/":""}${m(this,n)}${m(this,u)?"":super.text()}${m(this,r)?"/":""}>`}getPadding(){return m(this,n).length+(m(this,u)?2:1)}print(){return super.print({pre:`&lt;${m(this,u)?"/":""}${m(this,n)}`,post:`${m(this,r)?"/":""}&gt;`})}lint(i){var a;const o=super.lint(i);let l;this.name==="h1"&&!m(this,u)&&(l=f(this,{start:i},"<h1>"),o.push(l)),this.closest("table-attrs")&&(l||(l=f(this,{start:i},"")),o.push({...l,message:$.msg("HTML tag in table attributes")}));try{this.findMatchingTag()}catch({message:d}){l||(l=f(this,{start:i},""));const[g]=d.split(":"),c={...l,message:$.msg(g)};(g==="unclosed tag"||g==="unmatched closing tag"&&T.has((a=this.closest("magic-word"))==null?void 0:a.name))&&(c.severity="warning"),o.push(c)}return o}findMatchingTag(){const{html:i}=this.getAttribute("config"),{name:o,parentNode:l}=this,a=String(this);if(m(this,u)&&(m(this,r)||i[2].includes(o)))throw new SyntaxError(`tag that is both closing and self-closing: ${a}`);if(i[2].includes(o)||m(this,r)&&i[1].includes(o))return this;if(m(this,r)&&i[0].includes(o))throw new SyntaxError(`invalid self-closing tag: ${a}`);if(!l)return;const{childNodes:d}=l,g=d.indexOf(this),c=m(this,u)?d.slice(0,g).reverse().filter(({type:A,name:p})=>A==="html"&&p===o):d.slice(g+1).filter(({type:A,name:p})=>A==="html"&&p===o);let x=m(this,u)?-1:1;for(const A of c)if(A.closing?x--:x++,x===0)return A;throw new SyntaxError(`${m(this,u)?"unmatched closing":"unclosed"} tag: ${a}`)}}u=new WeakMap,r=new WeakMap,n=new WeakMap,y.exports=h},1874:(y,N,t)=>{var i;const{print:f,extUrlChar:$,extUrlCharFirst:S}=t(231),{generateForSelf:T}=t(8277),h=t(6986),u=t(6010),r=t(8138),n=new Set(["alt","link","lang","page","caption"]),s=(l,a,d=u.getConfig(),g=!1)=>{a=a.trim();let c=a.replace(/\0\d+t\x7F/gu,"").trim();switch(l){case"width":return/^(?:\d+x?|\d*x\d+)$/u.test(c);case"link":{if(!c||new RegExp(`^(?:(?:${d.protocol}|//)${S}|\0\\d+m\x7F)${$}$`,"iu").test(c))return a;c.startsWith("[[")&&c.endsWith("]]")&&(c=c.slice(2,-2));const A=u.normalizeTitle(c,0,!1,d,g,!0,!0);return A.valid&&A}case"lang":return d.variants.includes(c);case"alt":case"class":case"manualthumb":return!0;default:return!isNaN(c)}};class e extends r{constructor(d,g=u.getConfig(),c=[]){var a=(...o)=>{super(...o);P(this,"type","image-parameter");O(this,i,"")};let x;const A=Object.entries(g.img).map(([w,k])=>[w,k,new RegExp(`^(\\s*)${w.replace("$1","(.*)")}(\\s*)$`,"u")]),p=A.find(([,w,k])=>(x=k.exec(d),x&&(x.length!==4||s(w,x[2],g,!0)!==!1)));if(p){x.length===3?(a(void 0,g,!0,c),U(this,i,d)):(a(x[2],g,!0,c,{}),U(this,i,`${x[1]}${p[0]}${x[3]}`)),this.setAttribute("name",p[1]);return}a(d,{...g,excludes:[...g.excludes,"list"]},!0,c),this.setAttribute("name","caption").setAttribute("stage",7)}get link(){return this.name==="link"?s("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){this.parentNode.type==="gallery-image"&&!n.has(this.name)&&this.setAttribute("name","invalid")}isPlain(){return this.name==="caption"}toString(d){return m(this,i)?m(this,i).replace("$1",super.toString(d)):super.toString(d)}text(){return m(this,i)?m(this,i).replace("$1",super.text()).trim():super.text().trim()}getPadding(){return Math.max(0,m(this,i).indexOf("$1"))}lint(d){var c;const g=super.lint(d);return this.name==="invalid"?g.push(T(this,{start:d},"invalid gallery image parameter")):(c=this.link)!=null&&c.encoded&&g.push(T(this,{start:d},"unnecessary URL encoding in an internal link")),g}print(){return m(this,i)?`<span class="wpb-image-parameter">${m(this,i).replace("$1",`<span class="wpb-image-caption">${f(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}}i=new WeakMap,y.exports=e},2641:(y,N,t)=>{const{generateForSelf:f,generateForChild:$}=t(8277),S=t(6010),T=t(8138),h=t(3423),u=t(1031),r=t(2571);class n extends T{constructor(i,o=S.getConfig(),l=[]){super(void 0,o,!0,l,{});P(this,"type","ext-inner");P(this,"name","imagemap");if(!i)return;const a=i.split(`
22
+ `),d=new Set(o.protocol.split("|")),g=h,c=p=>{super.insertAt(new g(p,o,l))};let x=!0,A=!1;for(const p of a){const w=p.trim();if(!(A||!w||w[0]==="#")){if(x){const[k,...C]=p.split("|"),F=this.normalizeTitle(k,0,!0);if(F.valid&&F.ns===6){const v=new u(k,C.length>0?C.join("|"):void 0,o,l);v.type="imagemap-image",super.insertAt(v),x=!1;continue}else A=!0}else if(p.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(p);continue}else if(p.includes("[")){const k=p.indexOf("["),C=p.slice(k),F=/^\[{2}([^|]+)(?:\|([^\]]+))?\]{2}[\w\s]*$/u.exec(C);if(F){if(this.normalizeTitle(F[1],0,!0,!1,!0).valid){super.insertAt(new r(p.slice(0,k),F.slice(1),C.slice(C.indexOf("]]")+2),o,l));continue}}else if(d.has(C.slice(1,C.indexOf(":")+1))||d.has(C.slice(1,C.indexOf("//")+2))){const v=/^\[([^\]\s]+)(?:(\s+)(\S[^\]]*)?)?\][\w\s]*$/u.exec(C);if(v){super.insertAt(new r(p.slice(0,k),v.slice(1),C.slice(C.indexOf("]")+1),o,l));continue}}}}c(p)}}get image(){return this.childNodes.find(({type:i})=>i==="imagemap-image")}toString(i){return super.toString(i,`
23
+ `)}text(){return super.text(`
24
+ `).replace(/\n{2,}/gu,`
25
+ `)}getGaps(){return 1}print(){return super.print({sep:`
26
+ `})}lint(i){const o=super.lint(i),l={start:i,...this.getRootNode().posFromIndex(i)};return this.image?o.push(...this.childNodes.filter(a=>{const d=String(a).trim();return a.type==="noinclude"&&d&&d[0]!=="#"}).map(a=>$(a,l,"invalid link in <imagemap>"))):o.push(f(this,l,"<imagemap> without an image")),o}}y.exports=n},2571:(y,N,t)=>{const f=t(6986),$=t(8138),S=t(3423),T=t(3905),h=t(741);class u extends ${constructor(s,e,i,o,l){const a=e.length===2?T:h;super(void 0,o,!0,l);P(this,"type","imagemap-link");this.append(s,new a(...e,o,l),new S(i,o,l))}}y.exports=u},8138:(y,N,t)=>{var r,n,s,e,i,o,l,a,lt,g,at,x,dt,p,ht,k,pt,F,ut,L,gt,E,ct,z,ft,j,xt,V,mt;const{text:f}=t(231),$=t(6010),S=t(9205),T=t(7507),{MAX_STAGE:h}=$,Q=class extends S{constructor(b,R=$.getConfig(),G=!1,J=[],q=void 0){super();O(this,a);O(this,g);O(this,x);O(this,p);O(this,k);O(this,F);O(this,L);O(this,E);O(this,z);O(this,j);O(this,V);P(this,"type","root");O(this,r,0);O(this,n,void 0);O(this,s,void 0);O(this,e,void 0);O(this,i,(b=m(this,r),R=!1)=>{if(b<m(this,r)||!this.isPlain()||this.length===0)return this;switch(b){case 0:this.type==="root"&&m(this,s).shift(),U(this,e,Boolean(R)),K(this,a,lt).call(this,R);break;case 1:K(this,g,at).call(this);break;case 2:K(this,x,dt).call(this);break;case 3:K(this,p,ht).call(this);break;case 4:K(this,k,pt).call(this);break;case 5:K(this,F,ut).call(this);break;case 6:K(this,L,gt).call(this);break;case 7:K(this,E,ct).call(this);break;case 8:K(this,z,ft).call(this);break;case 9:K(this,j,xt).call(this);break;case 10:K(this,V,mt).call(this)}if(this.type==="root")for(const G of m(this,s))G.getAttribute("parseOnce")(b,R);return it(this,r)._++,this});O(this,o,(b,R)=>{const G=b.split(/[\0\x7F]/u).map((J,q)=>{if(q%2===0)return new T(J);if(isNaN(J[J.length-1]))return m(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 R==="string"?G.map(String).join(""):R==="text"?f(G):G});O(this,l,()=>{U(this,r,h);const{length:b,firstChild:R}=this,G=String(R);if(b===1&&R.type==="text"&&G.includes("\0")&&(this.replaceChildren(...m(this,o).call(this,G)),this.normalize(),this.type==="root"))for(const J of m(this,s))J.getAttribute("build")()});typeof b=="string"&&this.insertAt(G?b:b.replace(/[\0\x7F]/gu,"")),U(this,n,R),U(this,s,J),J.push(this)}getAttribute(b){switch(b){case"config":return JSON.parse(JSON.stringify(m(this,n)));case"accum":return m(this,s);case"parseOnce":return m(this,i);case"buildFromStr":return m(this,o);case"build":return m(this,l);default:return super.getAttribute(b)}}setAttribute(b,R){switch(b){case"stage":return m(this,r)===0&&this.type==="root"&&m(this,s).shift(),U(this,r,R),this;default:return super.setAttribute(b,R)}}isPlain(){return this.constructor===Q}insertAt(b,R=this.length){return typeof b=="string"&&(b=new T(b)),super.insertAt(b,R),b.type==="root"&&(b.type="plain"),b}normalizeTitle(b,R=0,G=!1,J=!1,q=!1){return $.normalizeTitle(b,R,m(this,e),m(this,n),G,J,q)}afterBuild(){if(this.type==="root")for(const b of m(this,s))b.afterBuild()}parse(b=h,R=!1){for(;m(this,r)<b;)m(this,i).call(this,m(this,r),R);return b&&(m(this,l).call(this),this.afterBuild()),this}};let u=Q;r=new WeakMap,n=new WeakMap,s=new WeakMap,e=new WeakMap,i=new WeakMap,o=new WeakMap,l=new WeakMap,a=new WeakSet,lt=function(b){const R=t(4907);this.setText(R(String(this.firstChild),m(this,n),m(this,s),b))},g=new WeakSet,at=function(){const b=t(8275),R=this.type==="root"?String(this.firstChild):`\0${String(this.firstChild)}`,G=b(R,m(this,n),m(this,s));this.setText(this.type==="root"?G:G.slice(1))},x=new WeakSet,dt=function(){if(m(this,n).excludes.includes("html"))return;const b=t(5130);this.setText(b(String(this.firstChild),m(this,n),m(this,s)))},p=new WeakSet,ht=function(){if(m(this,n).excludes.includes("table"))return;const b=t(4624),R=t(2840);this.setText(b(this,m(this,n),m(this,s)));for(const G of m(this,s))if(G instanceof R&&G.type!=="td"){G.normalize();const{childNodes:[,J]}=G;if(typeof J=="string"&&J.includes("\0")){G.removeAt(1);const q=new Q(J,m(this,n),!0,m(this,s));G.insertAt(q,1),q.setAttribute("stage",4)}}},k=new WeakSet,pt=function(){if(m(this,n).excludes.includes("hr"))return;const b=t(2937);this.setText(b(this,m(this,n),m(this,s)))},F=new WeakSet,ut=function(){const b=t(1452);this.setText(b(String(this.firstChild),m(this,n),m(this,s)))},L=new WeakSet,gt=function(){if(m(this,n).excludes.includes("quote"))return;const b=t(3360),R=String(this.firstChild).split(`
27
+ `);for(let G=0;G<R.length;G++)R[G]=b(R[G],m(this,n),m(this,s));this.setText(R.join(`
28
+ `))},E=new WeakSet,ct=function(){if(m(this,n).excludes.includes("extLink"))return;const b=t(7513);this.setText(b(String(this.firstChild),m(this,n),m(this,s)))},z=new WeakSet,ft=function(){if(m(this,n).excludes.includes("magicLink"))return;const b=t(4737);this.setText(b(String(this.firstChild),m(this,n),m(this,s)))},j=new WeakSet,xt=function(){if(m(this,n).excludes.includes("list"))return;const b=t(6622),R=String(this.firstChild).split(`
29
+ `);let G=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;G<R.length;G++)R[G]=b(R[G],m(this,n),m(this,s));this.setText(R.join(`
30
+ `))},V=new WeakSet,mt=function(){var b;if(((b=m(this,n).variants)==null?void 0:b.length)>0){const R=t(3765);this.setText(R(String(this.firstChild),m(this,n),m(this,s)))}},y.exports=u},337:(y,N,t)=>{const f=t(3905);class $ extends f{constructor(){super(...arguments);P(this,"type","category")}}y.exports=$},7625:(y,N,t)=>{var e,et;const{explode:f}=t(231),{generateForChild:$}=t(8277),S=t(6010),T=t(3905),h=t(1874),u=new Set(["manualthumb","frameless","framed","thumbnail"]),r=new Set(["left","right","center","none"]),n=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]);class s extends T{constructor(a,d,g=S.getConfig(),c=[],x="|"){super(a,void 0,g,c,x);O(this,e);P(this,"type","file");this.append(...f("-{","}-","|",d).map(A=>new h(A,g,c)))}lint(a){const d=super.lint(a),g=this.getAllArgs().filter(({childNodes:k})=>{const C=k.filter(F=>F.text().trim());return C.length!==1||C[0].type!=="arg"}),c=[...new Set(g.map(({name:k})=>k))].filter(k=>k!=="invalid"),x=c.filter(k=>u.has(k)),A=c.filter(k=>r.has(k)),p=c.filter(k=>n.has(k));if(g.length===c.length&&x.length<2&&A.length<2&&p.length<2)return d;const w={start:a,...this.getRootNode().posFromIndex(a)};for(const k of c){let C=g.filter(({name:F})=>F===k);k==="caption"&&(C=[...C.slice(0,-1).filter(F=>F.text()),C[C.length-1]]),C.length>1&&d.push(...C.map(F=>$(F,w,S.msg("duplicated image $1 parameter",k))))}return x.size>1&&d.push(...g.filter(({name:k})=>u.has(k)).map(k=>$(k,w,"conflicting image $1 parameter","frame"))),A.size>1&&d.push(...g.filter(({name:k})=>r.has(k)).map(k=>$(k,w,"conflicting image $1 parameter","horizontal-alignment"))),p.size>1&&d.push(...g.filter(({name:k})=>n.has(k)).map(k=>$(k,w,"conflicting image $1 parameter","vertical-alignment"))),d}getAllArgs(){return this.childNodes.slice(1)}getArgs(a){return this.getAllArgs().filter(({name:d})=>a===d)}getFrameArgs(){return K(this,e,et).call(this,u,"\u6846\u67B6")}getHorizAlignArgs(){return K(this,e,et).call(this,r,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return K(this,e,et).call(this,n,"\u5782\u76F4\u5BF9\u9F50")}}e=new WeakSet,et=function(a,d){return this.getAllArgs().filter(({name:c})=>a.has(c))},y.exports=s},1031:(y,N,t)=>{var u;const{generateForSelf:f}=t(8277),$=t(6010),S=t(8138),T=t(7625);class h extends T{constructor(s,e,i=$.getConfig(),o=[]){let l;if(e!==void 0){l=new S(e,i,!0,o),l.type="temp";for(let a=1;a<$.MAX_STAGE;a++)l.getAttribute("parseOnce")();o.splice(o.indexOf(l),1)}super(s,l==null?void 0:l.toString(),i,o);P(this,"type","gallery-image");O(this,u,!1);this.setAttribute("bracket",!1)}afterBuild(){const s=this.type==="imagemap-image",e=this.normalizeTitle(String(this.firstChild),s?0:6,!0,!s);U(this,u,e.ns!==6)}getPadding(){return 0}lint(s){const e=super.lint(s);return m(this,u)&&e.push(f(this,{start:s},"invalid gallery image")),e}}u=new WeakMap,y.exports=h},3905:(y,N,t)=>{var r,n,s,e;const{generateForChild:f}=t(8277),$=t(6010),S=t(7507),T=t(8138),h=t(9237);class u extends T{constructor(l,a,d=$.getConfig(),g=[],c="|"){super(void 0,d,!0,g,{});P(this,"type","link");O(this,r,!0);O(this,n,void 0);O(this,s,void 0);O(this,e,!1);if(this.insertAt(new h(l,"link-target",d,g,{})),a!==void 0){const x=new T(a,d,!0,g,{});x.type="link-text",this.insertAt(x.setAttribute("stage",$.MAX_STAGE-1))}U(this,n,c)}afterBuild(){var a;const l=this.normalizeTitle(this.firstChild.text(),0,!1,!0,!0);U(this,s,l.fragment),U(this,e,l.encoded),(a=m(this,n))!=null&&a.includes("\0")&&U(this,n,this.getAttribute("buildFromStr")(m(this,n),"string"))}setAttribute(l,a){return l==="bracket"?(U(this,r,Boolean(a)),this):super.setAttribute(l,a)}toString(l){const a=super.toString(l,m(this,n));return m(this,r)?`[[${a}]]`:a}text(){const l=super.text("|");return m(this,r)?`[[${l}]]`:l}getPadding(){return 2}getGaps(){return m(this,n).length}print(){return super.print(m(this,r)?{pre:"[[",post:"]]",sep:m(this,n)}:{sep:m(this,n)})}lint(l){var A;const a=super.lint(l),{childNodes:[d,g],type:c}=this;let x;return c==="link"&&d.childNodes.some(({type:p})=>p==="template")&&(x={start:l,...this.getRootNode().posFromIndex(l)},a.push(f(d,x,"template in an internal link target","warning"))),m(this,e)&&(x||(x={start:l,...this.getRootNode().posFromIndex(l)}),a.push(f(d,x,"unnecessary URL encoding in an internal link"))),c==="link"&&((A=g==null?void 0:g.childNodes)==null?void 0:A.some(({type:p,data:w})=>p==="text"&&w.includes("|")))?(x||(x={start:l,...this.getRootNode().posFromIndex(l)}),a.push(f(g,x,'additional "|" in the link text',"warning"))):c!=="link"&&m(this,s)!==void 0&&(x||(x={start:l,...this.getRootNode().posFromIndex(l)}),a.push(f(d,x,"useless fragment"))),a}}r=new WeakMap,n=new WeakMap,s=new WeakMap,e=new WeakMap,y.exports=u},8962:(y,N,t)=>{const{generateForChild:f}=t(8277),$=t(6010),S=t(8138);class T extends S{constructor(r,n,s=$.getConfig(),e=[]){super(r,s,!0,e,{});P(this,"type","free-ext-link");n&&(this.type="ext-link-url")}lint(r){const n=super.lint(r),s=`[\uFF0C\uFF1B\u3002\uFF1A\uFF01\uFF1F\uFF08\uFF09]+${this.type==="ext-link-url"?"|\\|+":""}`,e=new RegExp(s,"u"),i=new RegExp(s,"gu");let o;for(const l of this.childNodes){const a=String(l);if(l.type!=="text"||!e.test(a))continue;o||(o={start:r,...this.getRootNode().posFromIndex(r)});const d=f(l,o,"","warning");i.lastIndex=0;for(let g=i.exec(a);g;g=i.exec(a)){const{index:c,0:{0:x,length:A}}=g,p=a.slice(0,c).split(`
31
+ `),{length:w}=p,{length:k}=p[w-1],C=r+c,F=d.startLine+w-1,v=(w>1?0:d.startCol)+k;n.push({...d,message:$.msg("$1 in URL",x==="|"?'"|"':$.msg("full-width punctuation")),startIndex:C,endIndex:C+A,startLine:F,endLine:F,startCol:v,endCol:v+A})}}return n}}y.exports=T},9389:(y,N,t)=>{const f=t(6010),$=t(8889);class S extends ${constructor(u,r=f.getConfig(),n=[]){super(u,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],r,n);P(this,"name","choose")}}y.exports=S},9269:(y,N,t)=>{const f=t(6010),$=t(8889);class S extends ${constructor(u,r=f.getConfig(),n=[]){super(u,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],r,n);P(this,"name","combobox")}}y.exports=S},8889:(y,N,t)=>{const{generateForChild:f}=t(8277),$=t(6010),S=t(8138),T=t(7267),h=t(3423),u=t(5749);class r extends S{constructor(e,i,o,l=$.getConfig(),a=[]){var g;const d=(g=e==null?void 0:e.replace(i,(c,x,A,p,w)=>{const k=`\0${a.length+1}${x?"e":"c"}\x7F`;if(x)new T(x,A,p,w,l,a);else{const C=c.endsWith("-->");new u(c.slice(4,C?-3:void 0),C,l,a)}return k}))==null?void 0:g.replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(c,x,A)=>(new h(A,l,a),`${x}\0${a.length}c\x7F`));super(d,l,!0,a,{});P(this,"type","ext-inner")}lint(e){let i;return[...super.lint(e),...this.childNodes.filter(o=>{if(o.type==="ext"||o.type==="comment")return!1;const l=String(o).trim();return l&&!/^<!--.*-->$/su.test(l)}).map(o=>(i||(i={start:e,...this.getRootNode().posFromIndex(e)}),f(o,i,$.msg("invalid content in <$1>",this.name))))]}}y.exports=r},5937:(y,N,t)=>{const f=t(6010),$=t(8889);class S extends ${constructor(u,r=f.getConfig(),n=[]){super(u,/<!--.*?(?:-->|$)|<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],r,n);P(this,"name","references")}}y.exports=S},5749:(y,N,t)=>{const f=t(2308),{generateForSelf:$}=t(8277),S=t(6010),T=t(6935);class h extends f(T){constructor(n,s=!0,e=S.getConfig(),i=[]){super(n,e,i);P(this,"type","comment");P(this,"closed");this.closed=s}getPadding(){return 4}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}lint(n){return this.closed?[]:[$(this,{start:n},"unclosed HTML comment")]}toString(n){return`<!--${String(this.firstChild)}${this.closed?"-->":""}`}}y.exports=h},3434:(y,N,t)=>{const f=t(6935);class $ extends f{constructor(){super(...arguments);P(this,"type","dd")}}y.exports=$},7815:(y,N,t)=>{const f=t(2308),$=t(6935);class S extends f($){constructor(){super(...arguments);P(this,"type","double-underscore")}getPadding(){return 2}print(){return super.print({pre:"__",post:"__"})}toString(u){return`__${String(this.firstChild)}__`}}y.exports=S},2582:(y,N,t)=>{const f=t(6010),$=t(6935);class S extends ${constructor(u,r=f.getConfig(),n=[]){super("-".repeat(u),r,n);P(this,"type","hr")}}y.exports=S},6935:(y,N,t)=>{const{generateForSelf:f}=t(8277),$=t(6010),S=t(8138);class T extends S{constructor(r,n=$.getConfig(),s=[]){super(r,n,!0,s);P(this,"type","ext-inner")}lint(r){const{type:n,name:s}=this;return n==="ext-inner"&&(s==="templatestyles"||s==="section")&&String(this)?[f(this,{start:r},$.msg("nothing should be in <$1>",s))]:super.lint(r)}}y.exports=T},962:(y,N,t)=>{const f=t(3434);class $ extends f{constructor(){super(...arguments);P(this,"type","list")}}y.exports=$},3423:(y,N,t)=>{const f=t(2308),$=t(6935);class S extends f($){constructor(){super(...arguments);P(this,"type","noinclude")}}y.exports=S},6714:(y,N,t)=>{const{generateForSelf:f}=t(8277),$=t(6010),S=t(7507),T=t(6935);class h extends T{constructor(n,s=$.getConfig(),e=[]){super("'".repeat(n),s,e);P(this,"type","quote")}lint(n){const{previousSibling:s,nextSibling:e}=this,i=$.msg('lonely "$1"',"'"),o=[];let l;if((s==null?void 0:s.type)==="text"&&s.data.endsWith("'")){l=f(this,{start:n},i);const{startIndex:a,startLine:d,startCol:g}=l,[,{length:c}]=s.data.match(/(?:^|[^'])('+)$/u),x=n-c;o.push({...l,startIndex:x,endIndex:a,startCol:g-c,endLine:d,endCol:g})}if((e==null?void 0:e.type)==="text"&&e.data[0]==="'"){l||(l=f(this,{start:n},i));const{endIndex:a,endLine:d,endCol:g}=l,[{length:c}]=e.data.match(/^'+/u),x=a+c;o.push({...l,startIndex:a,endIndex:x,startLine:d,startCol:g,endCol:g+c})}return o}}y.exports=h},851:(y,N,t)=>{const f=t(6010),$=t(8138);class S extends ${constructor(u,r=f.getConfig(),n=[]){super(u,r,!0,n);P(this,"type","onlyinclude")}toString(u){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}}y.exports=S},9380:(y,N,t)=>{const{generateForChild:f}=t(8277),$=t(6010),S=t(8138),T=t(9237);class h extends S{constructor(n,s=$.getConfig(),e=[]){super(void 0,s,!0,e,{});P(this,"type","ext-inner");if(n){const i=T;this.append(...n.split(`
32
+ `).map(o=>new i(o,"param-line",s,e,{})))}}toString(n){return super.toString(n,`
33
+ `)}text(){return super.text(`
34
+ `)}getGaps(){return 1}print(){return super.print({sep:`
35
+ `})}lint(n){let s;return this.childNodes.filter(e=>{const{childNodes:i}=e,o=i.findIndex(({type:a})=>a!=="text"),l=(o>=0?i.slice(0,o).map(String).join(""):String(e)).trim();return l&&!(o>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(l)}).map(e=>(s||(s={start:n,...this.getRootNode().posFromIndex(n)}),f(e,s,$.msg("invalid parameter of $1",this.name))))}}y.exports=h},6934:(y,N,t)=>{const f=t(8275),$=t(6010),S=t(9380),T=t(9237);class h extends S{constructor(n,s=$.getConfig(),e=[]){super(void 0,s,e);P(this,"name","inputbox");if(n=f(n,s,e),e.splice(e.indexOf(this),1),e.push(this),n){const i=T;this.append(...n.split(`
36
+ `).map(o=>new i(o,"param-line",s,e,{})))}}}y.exports=h},9799:(y,N,t)=>{const{extUrlChar:f,extUrlCharFirst:$}=t(231),{generateForChild:S}=t(8277),T=t(6010),h=t(8138);class u extends h{constructor(s,e,i=T.getConfig(),o=[]){super(void 0,i,!0,o);P(this,"type","parameter");const l=new h(typeof s=="number"?void 0:s,i,!0,o,{}),a=new h(e,i,!0,o);l.type="parameter-key",a.type="parameter-value",this.append(l,a.setAttribute("stage",2))}get anon(){return this.firstChild.length===0}afterBuild(){if(!this.anon){const s=t(1782),e=String(this.firstChild).replace(/<!--.*?-->/gsu,"").replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),{parentNode:i}=this;this.setAttribute("name",e),i instanceof s&&i.getArgs(e,!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){var l;const e=super.lint(s),{firstChild:i}=this,o=(l=new RegExp(`https?://${$}${f}$`,"iu").exec(String(i).replace(/<!--.*?-->/gsu,"")))==null?void 0:l[0];if(o&&new URL(o).search){const a=S(i,{start:s},"unescaped query string in an anonymous parameter");e.push({...a,startIndex:a.endIndex,endIndex:a.endIndex+1,startLine:a.endLine,startCol:a.endCol,endCol:a.endCol+1})}return e}}y.exports=u},8058:(y,N,t)=>{const f=t(6010),$=t(8138);class S extends ${constructor(h,u,r="plain",n=f.getConfig(),s=[],e=void 0){super(h,n,!0,s,e),this.type=r}}y.exports=S},2840:(y,N,t)=>{const{generateForChild:f}=t(8277),$=t(3125),S=t(8058);class T extends ${constructor(){super(...arguments);P(this,"type","table")}get closed(){return this.lastChild.type==="table-syntax"}lint(r){const n=super.lint(r);if(!this.closed){const{firstChild:s}=this,e=f(s,{start:r},"unclosed table");n.push(e)}return n}close(r=`
37
+ |}`,n=!1){const s=this.getAttribute("config"),e=this.getAttribute("accum");super.insertAt(new S(r,void 0,"table-syntax",s,e))}}y.exports=T},5567:(y,N,t)=>{var u;const{generateForChild:f}=t(8277),$=t(6010),S=t(8138),T=t(3125);class h extends T{constructor(s,e,i=$.getConfig(),o=[]){let l=e==null?void 0:e.match(/\||\0\d+!\x7F/u),a=l?e.slice(0,l.index):"";/\[\[|-\{/u.test(a)&&(l=void 0,a="");super(s,a,i,o);P(this,"type","td");O(this,u,"");l&&([it(this,u)._]=l);const d=new S(e==null?void 0:e.slice((l==null?void 0:l.index)+m(this,u).length),i,!0,o);d.type="td-inner",this.insertAt(d.setAttribute("stage",4))}get subtype(){return this.getSyntax().subtype}getSyntax(){const s=this.firstChild.text(),e=s[s.length-1];let i="td";return e==="!"?i="th":e==="+"&&(i="caption"),{subtype:i}}afterBuild(){m(this,u).includes("\0")&&U(this,u,this.getAttribute("buildFromStr")(m(this,u),"string"))}toString(s){const{childNodes:[e,i,o]}=this;return`${e.toString()}${i.toString()}${m(this,u)}${o.toString()}`}text(){const{childNodes:[s,e,i]}=this;return`${s.text()}${e.text()}${m(this,u)}${i.text()}`}getGaps(s=0){return s=s<0?s+this.length:s,s===1?m(this,u).length:0}lint(s){const e=super.lint(s);s+=this.getRelativeIndex(-1);for(const i of this.lastChild.childNodes)i.type==="text"&&i.data.includes("|")&&e.push(f(i,{start:s},'additional "|" in a table cell',"warning"));return e}print(){const{childNodes:[s,e,i]}=this;return`<span class="wpb-td">${s.print()}${e.print()}${m(this,u)}${i.print()}</span>`}}u=new WeakMap,y.exports=h},3125:(y,N,t)=>{const{generateForChild:f}=t(8277),$=t(6010),S=t(8138),T=t(8058),h=t(5649);class u extends S{constructor(s,e="",i=$.getConfig(),o=[],l=void 0){super(void 0,i,!0,o,{});P(this,"type","tr");this.append(new T(s,l,"table-syntax",i,o,{}),new h(e,"table-attrs",this.type,i,o))}lint(s){const e=t(1782),i=t(9544),o=super.lint(s),l=this.childNodes.find(({type:c})=>c==="table-inter");if(!l)return o;const a=l.childNodes.find(c=>c.text().trim()),d=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u;if(!a||d.test(String(a))||a.type==="arg"&&d.test(a.default||""))return o;if(a.type==="magic-word")try{if(a.getPossibleValues().every(x=>d.test(x.text())))return o}catch(c){}const g=f(l,{start:s},"content to be moved out from the table");return o.push({...g,startIndex:g.startIndex+1,startLine:g.startLine+1,startCol:0}),o}text(){const s=super.text();return this.type==="tr"&&!s.trim().includes(`
38
+ `)?"":s}}y.exports=u},7267:(y,N,t)=>{const{generateForSelf:f}=t(8277),$=t(6010),S=t(8138),T=t(1074),h=t(5649);class u extends T{constructor(s,e="",i="",o=void 0,l=$.getConfig(),a=[]){e=!e||/^\s/u.test(e)?e:` ${e}`;const d=s.toLowerCase(),g=new h(e,"ext-attrs",d,l,a),c={...l,excludes:[...l.excludes]},x=new Set(c.ext);let A;switch(x.delete(d),c.ext=[...x],c.inExt=!0,d){case"tab":x.delete("tabs"),c.ext=[...x];case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":d==="poem"&&c.excludes.push("heading"),A=new S(i,c,!0,a);break;case"gallery":{const p=t(1891);A=new p(i,c,a);break}case"pre":{const p=t(428);A=new p(i,c,a);break}case"references":{const p=t(5937);A=new p(i,c,a);break}case"choose":{const p=t(9389);A=new p(i,c,a);break}case"combobox":{const p=t(9269);A=new p(i,c,a);break}case"imagemap":{const p=t(2641);A=new p(i,l,a);break}case"dynamicpagelist":{const p=t(9380);A=new p(i,c,a);break}case"inputbox":{c.excludes.push("heading");const p=t(6934);A=new p(i,c,a);break}default:{const p=t(6935);A=new p(i,l)}}A.setAttribute("name",d).type="ext-inner";super(s,g,A,o,l,a);P(this,"type","ext");P(this,"closed",!0)}lint(s){const e=super.lint(s);if(this.name!=="nowiki"&&this.closest("html-attrs, table-attrs")){const i=this.getRootNode(),o={start:s,...i.posFromIndex(s)};e.push(f(this,o,"extension tag in HTML tag attributes"))}return e}}y.exports=u},8655:(y,N,t)=>{const f=t(2308),$=t(6010),S=t(1074);class T extends f(S){constructor(r,n="",s=void 0,e=void 0,i=$.getConfig(),o=[]){super(r,n,s!=null?s:"",s===void 0||e!=null?e:"",i,o);P(this,"type","include")}}y.exports=T},1074:(y,N,t)=>{var T,h,u;const f=t(6010),$=t(8138);class S extends ${constructor(s,e,i,o,l=f.getConfig(),a=[]){super(void 0,l,!0);O(this,T,void 0);O(this,h,void 0);O(this,u,void 0);this.setAttribute("name",s.toLowerCase()),U(this,u,[s,o||s]),U(this,T,o===void 0),U(this,h,o!==""),this.append(e,i);let d=a.indexOf(e);d===-1&&(d=a.indexOf(i)),d===-1&&(d=1/0),a.splice(d,0,this)}get closed(){return m(this,h)}toString(s){const{firstChild:e,lastChild:i}=this,[o,l]=m(this,u);return m(this,T)?`<${o}${String(e)}/>`:`<${o}${String(e)}>${String(i)}${m(this,h)?`</${l}>`:""}`}text(){const[s,e]=m(this,u);return m(this,T)?`<${s}${this.firstChild.text()}/>`:`<${s}${super.text(">")}${m(this,h)?`</${e}>`:""}`}getPadding(){return m(this,u)[0].length+1}getGaps(){return 1}print(){const[s,e]=m(this,u);return super.print(m(this,T)?{pre:`&lt;${s}`,post:"/&gt;"}:{pre:`&lt;${s}`,sep:"&gt;",post:m(this,h)?`&lt;/${e}&gt;`:""})}}T=new WeakMap,h=new WeakMap,u=new WeakMap,y.exports=S},1782:(y,N,t)=>{var o,l,a,d,g,$t;const{removeComment:f,print:$,text:S,decodeHtml:T}=t(231),{generateForChild:h}=t(8277),u=t(6010),r=t(8138),n=t(9799),s=t(9237),e=t(8058);class i extends r{constructor(p,w,k=u.getConfig(),C=[]){var I,z;super(void 0,k,!0,C,{});O(this,g);P(this,"type","template");P(this,"modifier","");O(this,o,{});O(this,l,void 0);O(this,a,!0);O(this,d,!1);const{parserFunction:[F,v]}=k,L=(I=/^(?:\s|\0\d+c\x7F)*\0\d+s\x7F/u.exec(p))==null?void 0:I[0];if(L)this.setAttribute("modifier",L),p=p.slice(L.length);else if(p.includes(":")){const[B,...j]=p.split(":"),[M]=/^(?:\s|\0\d+c\x7F)*/u.exec((z=j[0])!=null?z:"");this.setModifier(`${B}:${M}`)&&(p=j.join(":").slice(M.length))}if(p.includes(":")||w.length===0&&!m(this,d)){const[B,...j]=p.split(":"),M=f(B),V=M.trim(),Z=v.includes(V),Q=F[V.toLowerCase()];if(!(j.length>0&&/\s$/u.test(M))&&(Z||Q)){this.setAttribute("name",Q||V.toLowerCase()).type="magic-word";const _=new RegExp(`^\\s*${V}\\s*$`,Z?"u":"iu"),Y=new e(B,_,"magic-word-name",k,C,{});if(this.insertAt(Y),j.length>0&&w.unshift([j.join(":")]),this.name==="invoke")for(let b=0;b<2;b++){const R=w.shift();if(!R)break;const G=new s(R.join("="),`invoke-${b?"function":"module"}`,k,C,{});this.insertAt(G)}}}if(this.type==="template"){const B=f(T(p)).split("#")[0].trim();if(!B||/\0\d+[eh!+-]\x7F|[<>[\]{}\n]|%[\da-f]{2}/u.test(B))throw C.pop(),new SyntaxError(`\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0\uFF1A${B}`);const j=new s(p,"template-name",k,C,{});this.insertAt(j)}const H=this.isTemplate();let E=1;for(let B=0;B<w.length;B++){const j=w[B];!H&&!(this.name==="switch"&&B>0)&&(j[0]=j.join("="),j.length=1),j.length===1&&(j.unshift(E),E++),this.insertAt(new n(...j,k,C))}}setModifier(p=""){const{parserFunction:[,,w,k]}=this.getAttribute("config"),C=f(p).trim();if(p&&!C.endsWith(":"))return!1;const F=C.slice(0,-1).toLowerCase(),v=w.includes(F),L=k.includes(F);return v||L||p===""?(this.setAttribute("modifier",p),U(this,d,v),Boolean(p)):!1}afterBuild(){if(this.modifier.includes("\0")&&this.setAttribute("modifier",this.getAttribute("buildFromStr")(this.modifier,"string")),this.isTemplate()){const p=this.type==="template",w=this.normalizeTitle(this.childNodes[p?0:1].text(),p?10:828);U(this,l,w.fragment),U(this,a,w.valid)}}toString(p){const{childNodes:w,firstChild:k,modifier:C}=this;return`{{${C}${this.type==="magic-word"?`${String(k)}${w.length>1?":":""}${w.slice(1).map(String).join("|")}`:super.toString(p,"|")}}}`}text(){const{childNodes:p,firstChild:w,modifier:k,type:C,name:F}=this;return C==="magic-word"&&F==="vardefine"?"":`{{${k}${this.type==="magic-word"?`${w.text()}${p.length>1?":":""}${S(p.slice(1),"|")}`:super.text("|")}}}`}getPadding(){return this.modifier.length+2}getGaps(){return 1}print(){const{childNodes:p,firstChild:w,modifier:k}=this;return`<span class="wpb-${this.type}">{{${k}${this.type==="magic-word"?`${w.print()}${p.length>1?":":""}${$(p.slice(1),{sep:"|"})}`:$(p,{sep:"|"})}}}</span>`}lint(p){const w=super.lint(p),{type:k,childNodes:C}=this;let F;if(this.isTemplate())m(this,l)!==void 0&&(F={start:p,...this.getRootNode().posFromIndex(p)},w.push(h(C[k==="template"?0:1],F,"useless fragment")));else return w;m(this,a)||(F={start:p,...this.getRootNode().posFromIndex(p)},w.push(h(C[1],F,"illegal module name")));const v=this.getDuplicatedArgs();return v.length>0&&(F||(F={start:p,...this.getRootNode().posFromIndex(p)}),w.push(...v.flatMap(([,L])=>L).map(L=>h(L,F,"duplicated parameter")))),w}isTemplate(){return this.type==="template"||this.type==="magic-word"&&this.name==="invoke"}insertAt(p,w=this.length){return super.insertAt(p,w),p.anon?K(this,g,$t).call(this,p):p.name&&this.getArgs(p.name,!1,!1).add(p),p}getAllArgs(){return this.childNodes.filter(p=>p instanceof n)}getAnonArgs(){return this.getAllArgs().filter(({anon:p})=>p)}getArgs(p,w,k=!0){const C=String(p).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let F;return Object.prototype.hasOwnProperty.call(m(this,o),C)?F=m(this,o)[C]:(F=new Set(this.getAllArgs().filter(({name:v})=>C===v)),m(this,o)[C]=F),F}getDuplicatedArgs(){return this.isTemplate()?Object.entries(m(this,o)).filter(([,{size:p}])=>p>1).map(([p,w])=>[p,[...w]]):[]}getPossibleValues(){const{type:p,name:w,childNodes:k,constructor:{name:C}}=this;if(p==="template")throw new Error(`${C}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`);let F;switch(w){case"if":case"ifexist":case"ifexpr":case"iferror":F=2;break;case"ifeq":F=3;break;default:throw new Error(`${C}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}const v=k.slice(F,F+2).map(({childNodes:[,L]})=>L);for(let L=0;L<v.length;){const{length:H,0:E}=v[L].childNodes.filter(I=>I.text().trim());if(H===0)v.splice(L,1);else if(H>1||E.type!=="magic-word")L++;else try{const I=E.getPossibleValues();v.splice(L,1,...I),L+=I.length}catch(I){L++}}return v}}o=new WeakMap,l=new WeakMap,a=new WeakMap,d=new WeakMap,g=new WeakSet,$t=function(p){const w=this.getAnonArgs(),k=w.indexOf(p);for(let C=k;C<w.length;C++){const F=w[C],{name:v}=F,L=String(C+1);v!==L&&this.getArgs(L,!1,!1).add(F.setAttribute("name",L))}},y.exports=i},8277:(y,N,t)=>{const f=t(6010),$=t(8138),S=(h,u,r,n="error")=>{const s=h.getRelativeIndex(),{offsetHeight:e,offsetWidth:i,parentNode:o,length:l}=h,{top:a,left:d}=o.posFromIndex(s),{start:g}=u,{top:c,left:x}="top"in u?u:h.getRootNode().posFromIndex(g),A=g+s,p=A+l,w=c+a,k=w+e-1,C=a?d:x+d,F=e>1?i:C+i;return{message:f.msg(r),severity:n,startIndex:A,endIndex:p,startLine:w,endLine:k,startCol:C,endCol:F}},T=(h,u,r,n="error")=>{const{start:s}=u,{offsetHeight:e,offsetWidth:i,length:o}=h,{top:l,left:a}="top"in u?u:h.getRootNode().posFromIndex(s);return{message:f.msg(r),severity:n,startIndex:s,endIndex:s+o,startLine:l,endLine:l+e-1,startCol:a,endCol:e>1?i:a+i}};y.exports={generateForChild:S,generateForSelf:T}},231:(y,N,t)=>{const f='(?:\\[[\\da-f:.]+\\]|[^[\\]<>"\\0-\\x1F\\x7F\\p{Zs}\\uFFFD])',$='(?:[^[\\]<>"\\0-\\x1F\\x7F\\p{Zs}\\uFFFD]|\\0\\d+c\\x7F)*',S=s=>s.replace(/\0\d+c\x7F/gu,""),T=(s,e={})=>{const i=t(7507),o=t(9205),{pre:l="",post:a="",sep:d=""}=e,g={"&":"amp","<":"lt",">":"gt"};return`${l}${s.map(c=>c instanceof o?c.print():String(c).replace(/[&<>]/gu,x=>`&${g[x]};`)).join(d)}${a}`},h=s=>s.replace(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),u=(s,e,i,o)=>{if(o===void 0)return[];const l=new RegExp(`${[s,e,i].map(h).join("|")}`,"gu"),a=[];let d=l.exec(o),g=0,c=0;for(;d;){const{0:x,index:A}=d;x!==i?g+=x===s?1:-1:g===0&&(a.push(o.slice(c,A)),{lastIndex:c}=l),d=l.exec(o)}return a.push(o.slice(c)),a},r=(s,e="")=>{const i=t(3853);return s.map(o=>typeof o=="string"?o:o.text()).join(e)},n=s=>s==null?void 0:s.replace(/&#(\d+|x[\da-f]+);/giu,(e,i)=>String.fromCodePoint(`${i[0].toLowerCase()==="x"?"0":""}${i}`));y.exports={extUrlCharFirst:f,extUrlChar:$,removeComment:S,print:T,escapeRegExp:h,explode:u,text:r,decodeHtml:n}},8166:y=>{y.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":{"6":"File","10":"Template"},"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","#regex":"regex","#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:","img":{},"variants":[]}')}},D={};function X(y){var N=D[y];if(N!==void 0)return N.exports;var t=D[y]={exports:{}};return W[y](t,t.exports,X),t.exports}var tt=X(6010)})();})();
@@ -95,12 +95,6 @@
95
95
  "type": "string",
96
96
  "pattern": "^[a-z:/]+(?:\\|[a-z:/]+)*$"
97
97
  },
98
- "interwiki": {
99
- "type": "array",
100
- "items": {
101
- "type": "string"
102
- }
103
- },
104
98
  "img": {
105
99
  "description": "image-related magic words",
106
100
  "type": "object",
@@ -118,17 +112,5 @@
118
112
  }
119
113
  }
120
114
  },
121
- "required": [
122
- "ext",
123
- "html",
124
- "namespaces",
125
- "nsid",
126
- "parserFunction",
127
- "doubleUnderscore",
128
- "protocol",
129
- "interwiki",
130
- "img",
131
- "variants"
132
- ],
133
115
  "additionalProperties": false
134
- }
116
+ }
@@ -754,7 +754,6 @@
754
754
  ]
755
755
  ],
756
756
  "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:",
757
- "interwiki": [],
758
757
  "img": {
759
758
  "thumbnail": "thumbnail",
760
759
  "thumb": "thumbnail",
@@ -829,4 +828,4 @@
829
828
  "zh-my",
830
829
  "zh-mo"
831
830
  ]
832
- }
831
+ }
@@ -518,41 +518,6 @@
518
518
  ]
519
519
  ],
520
520
  "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:",
521
- "interwiki": [
522
- "arxiv",
523
- "aswiki",
524
- "cache",
525
- "cmoegirl",
526
- "commons",
527
- "doi",
528
- "google",
529
- "googlegroups",
530
- "gsnews",
531
- "imdb",
532
- "jawiki",
533
- "komica",
534
- "mediawikiwiki",
535
- "metawikimedia",
536
- "moegirl",
537
- "mw",
538
- "sifaswiki",
539
- "sifwiki",
540
- "wikia",
541
- "wikibooks",
542
- "wikidata",
543
- "wikimedia",
544
- "wikinews",
545
- "wikiinfo",
546
- "wikipedia",
547
- "wikiquote",
548
- "wikisource",
549
- "wikispecies",
550
- "wikiversity",
551
- "wikivoyage",
552
- "wikt",
553
- "wiktionary",
554
- "zhwiki"
555
- ],
556
521
  "img": {
557
522
  "thumbnail": "thumbnail",
558
523
  "thumb": "thumbnail",
@@ -627,4 +592,4 @@
627
592
  "zh-my",
628
593
  "zh-mo"
629
594
  ]
630
- }
595
+ }
@@ -0,0 +1,135 @@
1
+ {
2
+ "ext": [],
3
+ "html": [
4
+ [
5
+ "b",
6
+ "bdi",
7
+ "del",
8
+ "i",
9
+ "ins",
10
+ "u",
11
+ "font",
12
+ "big",
13
+ "small",
14
+ "sub",
15
+ "sup",
16
+ "h1",
17
+ "h2",
18
+ "h3",
19
+ "h4",
20
+ "h5",
21
+ "h6",
22
+ "cite",
23
+ "code",
24
+ "em",
25
+ "s",
26
+ "strike",
27
+ "strong",
28
+ "tt",
29
+ "var",
30
+ "div",
31
+ "center",
32
+ "blockquote",
33
+ "ol",
34
+ "ul",
35
+ "dl",
36
+ "table",
37
+ "caption",
38
+ "pre",
39
+ "ruby",
40
+ "rb",
41
+ "rp",
42
+ "rt",
43
+ "rtc",
44
+ "p",
45
+ "span",
46
+ "abbr",
47
+ "dfn",
48
+ "kbd",
49
+ "samp",
50
+ "data",
51
+ "time",
52
+ "mark",
53
+ "tr",
54
+ "td",
55
+ "th",
56
+ "q",
57
+ "bdo"
58
+ ],
59
+ [
60
+ "li",
61
+ "dt",
62
+ "dd"
63
+ ],
64
+ [
65
+ "br",
66
+ "wbr",
67
+ "hr",
68
+ "meta",
69
+ "link",
70
+ "img"
71
+ ]
72
+ ],
73
+ "namespaces": {
74
+ "6": "File",
75
+ "10": "Template"
76
+ },
77
+ "nsid": {},
78
+ "parserFunction": [
79
+ {
80
+ "#language": "language",
81
+ "#special": "special",
82
+ "#speciale": "speciale",
83
+ "#tag": "tag",
84
+ "#formatdate": "formatdate",
85
+ "#invoke": "invoke",
86
+ "#while": "while",
87
+ "#dowhile": "dowhile",
88
+ "#loop": "loop",
89
+ "#forargs": "forargs",
90
+ "#fornumargs": "fornumargs",
91
+ "#if": "if",
92
+ "#ifeq": "ifeq",
93
+ "#switch": "switch",
94
+ "#ifexist": "ifexist",
95
+ "#ifexpr": "ifexpr",
96
+ "#iferror": "iferror",
97
+ "#time": "time",
98
+ "#timel": "timel",
99
+ "#expr": "expr",
100
+ "#rel2abs": "rel2abs",
101
+ "#titleparts": "titleparts",
102
+ "#categorytree": "categorytree",
103
+ "#urldecode": "urldecode",
104
+ "#choose": "choose",
105
+ "#var": "var",
106
+ "#varexists": "varexists",
107
+ "#var_final": "var_final",
108
+ "#vardefine": "vardefine",
109
+ "#vardefineecho": "vardefineecho",
110
+ "#widget": "widget",
111
+ "#regex": "regex",
112
+ "#related": "related",
113
+ "#cscore": "cscore"
114
+ },
115
+ [],
116
+ [
117
+ "msg",
118
+ "原始",
119
+ "raw"
120
+ ],
121
+ [
122
+ "替代",
123
+ "subst",
124
+ "安全替代",
125
+ "safesubst"
126
+ ]
127
+ ],
128
+ "doubleUnderscore": [
129
+ [],
130
+ []
131
+ ],
132
+ "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:",
133
+ "img": {},
134
+ "variants": []
135
+ }
@@ -611,50 +611,6 @@
611
611
  ]
612
612
  ],
613
613
  "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:",
614
- "interwiki": [
615
- "commons",
616
- "mediawikiwiki",
617
- "metawikimedia",
618
- "mw",
619
- "wikibooks",
620
- "wikidata",
621
- "wikimedia",
622
- "wikinews",
623
- "wikipedia",
624
- "wikiquote",
625
- "wikisource",
626
- "wikispecies",
627
- "wikiversity",
628
- "wikivoyage",
629
- "wikt",
630
- "wiktionary",
631
- "cc",
632
- "cm",
633
- "en",
634
- "enmoe",
635
- "enwp",
636
- "fandom",
637
- "ghia",
638
- "huiji",
639
- "ja",
640
- "jamoe",
641
- "jawp",
642
- "library",
643
- "meta",
644
- "phab",
645
- "pmid",
646
- "shoutwiki",
647
- "translatewiki",
648
- "zh",
649
- "zhmoe",
650
- "zhmoegirl",
651
- "zhtest",
652
- "zhwp",
653
- "文库",
654
- "萌娘共享",
655
- "萌娘文库",
656
- "萌百"
657
- ],
658
614
  "img": {
659
615
  "thumbnail": "thumbnail",
660
616
  "thumb": "thumbnail",
@@ -726,4 +682,4 @@
726
682
  "zh-tw",
727
683
  "zh-hk"
728
684
  ]
729
- }
685
+ }