wikiparser-node 1.4.0-b → 1.4.1-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.
- package/bundle/bundle.min.js +27 -27
- package/config/default.json +18 -3
- package/config/enwiki.json +411 -0
- package/extensions/dist/base.js +3 -3
- package/extensions/dist/editor.js +1 -1
- package/extensions/dist/highlight.js +38 -9
- package/extensions/ui.css +27 -0
- package/i18n/zh-hans.json +4 -3
- package/i18n/zh-hant.json +5 -4
- package/package.json +13 -13
package/bundle/bundle.min.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`),r=t.length-1;return{top:r,left:t[r].length}}}getGaps(i){return 0}getRelativeIndex(i){let e,t=(r,n)=>e.slice(0,r).reduce((s,a,o)=>s+String(a).length+n.getGaps(o),0)+n.getAttribute("padding");if(i===void 0){let{parentNode:r}=this;return r?({childNodes:e}=r,t(e.indexOf(this),r)):0}return{childNodes:e}=this,t(i,this)}getAbsoluteIndex(){let{parentNode:i}=this;return i?i.getAbsoluteIndex()+this.getRelativeIndex():0}};
|
|
3
|
-
`),e=i.length;return{height:e,width:i[e-1].length}}});var
|
|
4
|
-
`),tt=re.length+q-1,ae=re[re.length-1],J=re.length===1?I+ae.length:ae.length,{0:W,length:le}=O,rt=oe+le,Te=String(N),H=Te[rt],$e=Te[oe-1],pr=le>1&&(W!=="<"||/[\s/>]/u.test(H!=null?H:""))||W==="{"&&(H===W||$e==="-")||W==="}"&&($e===W||H==="-")||W==="["&&(H===W||o==="ext-link-text"||!t.slice(M+1).trim()&&g==="free-ext-link")||W==="]"&&($e===W||!t.slice(0,M).trim()&&p==="free-ext-link")?"error":"warning";(W!=="<"||C.has(B.toLowerCase()))&&c.push({message:m.msg('lonely "$1"',W==="h"?O:W),severity:pr,startIndex:oe,endIndex:rt,startLine:tt,endLine:tt,startCol:J,endCol:J+le})}return c}return[]}replaceData(e){w(this,bt,on).call(this,e)}print(){let e={"&":"amp","<":"lt",">":"gt"};return this.data.replace(/[&<>]/gu,t=>`&${e[t]};`)}};bt=new WeakSet,on=function(e){this.setAttribute("data",e)}});var kt,ln=b(()=>{"use strict";F();kt=class extends x{constructor(){super(...arguments);f(this,"type","onlyinclude")}toString(e){return`<onlyinclude>${super.toString()}</onlyinclude>`}getAttribute(e){return e==="padding"?13:e==="plain"||super.getAttribute(e)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var ue,je=b(()=>{"use strict";ue=l=>{class i extends l{text(){return""}lint(){return[]}}return i}});var D,Ne=b(()=>{"use strict";je();ke();D=class extends ue(Q){constructor(){super(...arguments);f(this,"type","noinclude")}}});var ye,qe,br=b(()=>{"use strict";A();F();qe=class extends x{constructor(e,t,r,n,s=m.getConfig(),a=[]){super(void 0,s);k(this,ye,void 0);f(this,"closed");f(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),S(this,ye,[e,n||e]),this.closed=n!=="",this.selfClosing=n===void 0,this.append(t,r);let o=typeof t=="string"?-1:a.indexOf(t);a.splice(o===-1?1/0:o,0,this),Object.defineProperty(this,"closed",{enumerable:!1})}toString(e){let{selfClosing:t,firstChild:r,lastChild:n}=this,[s,a]=u(this,ye);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${n.toString(e)}${this.closed?`</${a}>`:""}`}text(){let[e,t]=u(this,ye);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?u(this,ye)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,ye);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};ye=new WeakMap});var yt,dn=b(()=>{"use strict";P();je();A();br();yt=class extends ue(qe){constructor(e,t="",r,n,s=m.getConfig(),a=[]){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",s,a);f(this,"type","include")}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[$(this,{start:e},m.msg("unclosed $1",`<${this.name}>`))]}json(){return{...super.json(),closed:this.closed}}}});var G,me=b(()=>{"use strict";A();F();G=class extends x{constructor(i,e,t=m.getConfig(),r=[],n){super(i,t,r,n),this.type=e}}});var Vi,U,pn,gn,vt,kr,un,at,cn,fn,Tn,hn,At,mn,Zi,Qi,V,ne,Be,xn=b(()=>{"use strict";P();Z();de();A();F();me();Vi=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"]),U=new Set(["align"]),pn=new Set(["cite"]),gn=new Set(["cite","datetime"]),vt=new Set(["width"]),kr=new Set(["axis","align","bgcolor","height","width","valign"]),un=new Set([...kr,"abbr","headers","scope","rowspan","colspan"]),at=new Set(["type"]),cn=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),fn=new Set(["clear"]),Tn=new Set(["bgcolor","align","valign"]),hn={div:U,h1:U,h2:U,h3:U,h4:U,h5:U,h6:U,blockquote:pn,q:pn,p:U,br:fn,pre:vt,ins:gn,del:gn,ul:at,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...cn,"border"]),caption:U,tr:Tn,td:un,th:un,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:vt,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"])},At=new Set,mn={nowiki:At,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:At,inputbox:At,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:At,poll:new Set(["id","show-results-before-voting"]),sm2:at,flashmp3:at,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"])},Zi=new RegExp("expression|(?:filter|accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u"),Qi={table:cn,td:new Set([...kr,"scope"]),th:kr,br:fn,caption:U,div:U,hr:vt,h1:U,h2:U,h3:U,h4:U,h5:U,h6:U,li:at,p:U,pre:vt,tr:Tn,ul:at},Be=class extends x{constructor(e,t,r,n="",s,a=[],o=m.getConfig(),d=[]){let g=new G(r,"attr-key",o,d,{}),p;if(r==="title"||t==="img"&&r==="alt")p=new x(s,o,d,{}),p.type="attr-value",p.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let h={...o,excludes:[...o.excludes,"quote","extLink","magicLink","list"]};p=new x(s,h,d,{}),p.type="attr-value",p.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let h={...o,excludes:[...o.excludes,"heading","html","table","hr","list"]};p=new x(s,h,d,{}),p.type="attr-value",p.setAttribute("stage",1)}else p=new G(s,"attr-value",o,d,{});super(void 0,o,d);f(this,"tag");k(this,V,void 0);k(this,ne,void 0);this.type=e,this.append(g,p),S(this,V,n),S(this,ne,[...a]),this.tag=t,this.setAttribute("name",Y(r).trim().toLowerCase())}get balanced(){return!u(this,V)||u(this,ne)[0]===u(this,ne)[1]}afterBuild(){u(this,V).includes("\0")&&S(this,V,this.buildFromStr(u(this,V),0)),this.parentNode&&this.setAttribute("tag",this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(e){let[t="",r=""]=u(this,ne);return u(this,V)?`${super.toString(e,`${u(this,V)}${t}`)}${r}`:this.firstChild.toString(e)}text(){return u(this,V)?`${super.text(`${u(this,V).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,V)?u(this,V).length+((t=(e=u(this,ne)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex()){var h,c;let t=super.lint(e),{balanced:r,firstChild:n,lastChild:s,type:a,name:o,tag:d}=this,g=this.getValue(),p;if(!r){let T=this.getRootNode();p={start:e,...T.posFromIndex(e)};let y=v(s,p,m.msg("unclosed $1","quotes"),"warning");t.push({...y,startIndex:y.startIndex-1,startCol:y.startCol-1})}return mn[d]&&!mn[d].has(o)||(a==="ext-attr"?d in hn:!/\{\{[^{]+\}\}/u.test(o))&&!((h=hn[d])!=null&&h.has(o))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(o)&&(d==="meta"||d==="link"||!Vi.has(o))?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"illegal attribute name"))):(c=Qi[d])!=null&&c.has(o)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"obsolete attribute","warning"))):o==="style"&&typeof g=="string"&&Zi.test(g)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"insecure style"))):o==="tabindex"&&typeof g=="string"&&g.trim()!=="0"&&(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"nonzero tabindex"))),t}getValue(){if(u(this,V)){let e=this.lastChild.text();return u(this,ne)[1]?e:e[u(this,ne)[0]?"trimEnd":"trim"]()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,ne);return u(this,V)?super.print({sep:`${u(this,V)}${e}`,post:t}):super.print()}};V=new WeakMap,ne=new WeakMap});var bn,Xi,Ae,$t=b(()=>{"use strict";P();Z();A();F();me();xn();bn=l=>l.slice(0,-1),Xi=l=>`${bn(l)}-dirty`,Ae=class extends x{constructor(i,e,t,r=m.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),i){let s=new RegExp(`([^\\s/](?:(?!\0\\d+~\x7F)[^\\s/=])*)(?:((?:\\s|\0\\d+c\x7F)*(?:=|\0\\d+~\x7F)(?:\\s|\0\\d+c\x7F)*)(?:(["'])(.*?)(\\3|$)|(\\S*)))?`,"gsu"),a="",o=s.exec(i),d=0,g=()=>{a&&(super.insertAt(new G(a,Xi(e),r,n,{})),a="")};for(;o;){let{index:p,0:h,1:c,2:T,3:y,4:N,5:q,6:I}=o;if(a+=i.slice(d,p),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(Y(c).trim())){let C=N!=null?N:I,E=[y,q],B=new Be(bn(e),t,c,T,C,E,r,n);g(),super.insertAt(B)}else a+=h;({lastIndex:d}=s),o=s.exec(i)}a+=i.slice(d),g()}}afterBuild(){if(this.type==="table-attrs"){let{parentNode:i}=this;this.setAttribute("name",(i==null?void 0:i.type)==="td"&&i.subtype==="caption"?"caption":i==null?void 0:i.type)}}getAttrTokens(i){return this.childNodes.filter(e=>e instanceof Be&&(!i||e.name===i.toLowerCase().trim()))}getAttrToken(i){let e=this.getAttrTokens(i);return e[e.length-1]}getAttr(i){var e;return(e=this.getAttrToken(i))==null?void 0:e.getValue()}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),{parentNode:t,length:r,childNodes:n}=this,s=new Map,a=new Set,o;(t==null?void 0:t.type)==="html"&&t.closing&&this.text().trim()&&(o={start:i,...this.getRootNode().posFromIndex(i)},e.push($(this,o,"attributes of a closing tag")));for(let d=0;d<r;d++){let g=n[d];if(g instanceof G&&g.text().trim())o!=null||(o={start:i,...this.getRootNode().posFromIndex(i)}),e.push(v(g,o,"containing invalid attribute"));else if(g instanceof Be){let{name:p}=g;s.has(p)?(a.add(p),s.get(p).push(g)):p!=="class"&&s.set(p,[g])}}if(a.size>0){o!=null||(o={start:i,...this.getRootNode().posFromIndex(i)});for(let d of a)e.push(...s.get(d).map(g=>v(g,o,m.msg("duplicated $1 attribute",d))))}return e}print(){return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(i=>i.print(i instanceof G&&i.text().trim()?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var kn={};_(kn,{PreToken:()=>yr});var yr,yn=b(()=>{"use strict";de();A();F();Ne();yr=class extends x{constructor(e,t=m.getConfig(),r=[]){if(e){let n="<nowiki>",s="</nowiki>",{length:a}=n,o=e.indexOf(n),d=e.indexOf(s,o+a),g="";for(;o!==-1&&d!==-1;)new D(n,t,r),new D(s,t,r),g+=`${e.slice(0,o)}\0${r.length-1}c\x7F${e.slice(o+a,d)}\0${r.length}c\x7F`,e=e.slice(d+a+1),o=e.indexOf(n),d=e.indexOf(s,o+a);e=`${g}${e}`}super(e,t,r,{});f(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}}});var An={};_(An,{ParamTagToken:()=>lt});var lt,Ar=b(()=>{"use strict";P();A();F();me();lt=class extends x{constructor(e,t=m.getConfig(),r=[],n={}){super(void 0,t,r,{});f(this,"type","ext-inner");if(e){let s=G;this.append(...e.split(`
|
|
1
|
+
"use strict";(()=>{var xt=Object.defineProperty;var _i=Object.getOwnPropertyDescriptor;var Di=Object.getOwnPropertyNames;var Hi=Object.prototype.hasOwnProperty;var Ui=(l,i,e)=>i in l?xt(l,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[i]=e;var b=(l,i)=>()=>(l&&(i=l(l=0)),i);var Vi=(l,i)=>()=>(i||l((i={exports:{}}).exports,i),i.exports),W=(l,i)=>{for(var e in i)xt(l,e,{get:i[e],enumerable:!0})},Zi=(l,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Di(i))!Hi.call(l,r)&&r!==e&&xt(l,r,{get:()=>i[r],enumerable:!(t=_i(i,r))||t.enumerable});return l};var R=l=>Zi(xt({},"__esModule",{value:!0}),l);var f=(l,i,e)=>(Ui(l,typeof i!="symbol"?i+"":i,e),e),mr=(l,i,e)=>{if(!i.has(l))throw TypeError("Cannot "+e)};var u=(l,i,e)=>(mr(l,i,"read from private field"),e?e.call(l):i.get(l)),k=(l,i,e)=>{if(i.has(l))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(l):i.set(l,e)},w=(l,i,e,t)=>(mr(l,i,"write to private field"),t?t.call(l,e):i.set(l,e),e);var bt=(l,i,e,t)=>({set _(r){w(l,i,r,e)},get _(){return u(l,i,t)}}),$=(l,i,e)=>(mr(l,i,"access private method"),e);var it,we,cr,Ce=b(()=>{"use strict";it={run(l){return l()}},we=l=>i=>i.type===l,cr=(l,i,e,t=[])=>{let r=[...l.childNodes],n=r.splice(i,e,...t);l.setAttribute("childNodes",r);for(let s of t)s.setAttribute("parentNode",l);return n}});var tn=Vi(($s,Qi)=>{Qi.exports={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:{file:6,category:14},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:",interwiki:[],img:{},variants:[]}});var rn,de=b(()=>{"use strict";rn=tn()});var be,ke,st,nn,ee,sn,pe,kt,on,ge,H=b(()=>{"use strict";be='(?:\\[[\\da-f:.]+\\]|[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD])',ke='(?:[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD]|\0\\d+[c!~]\x7F)*',st=(l,i)=>e=>e.replace(l,i),nn=st(/[\0\x7F]/gu,""),ee=st(/\0\d+c\x7F/gu,""),sn=st(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),pe=(l,i="")=>l.map(e=>typeof e=="string"?e:e.text()).join(i),kt=st(/&#(\d+|x[\da-f]+);/giu,(l,i)=>String.fromCodePoint(+`${i.toLowerCase().startsWith("x")?"0":""}${i}`)),on=st(/\n/gu,"\\n"),ge=(l,i={})=>{let{pre:e="",post:t="",sep:r=""}=i;return`${e}${l.map(n=>n.print()).join(r)}${t}`}});var an={};W(an,{Title:()=>fr});var fr,ln=b(()=>{"use strict";H();A();fr=class{constructor(i,e=0,t=m.getConfig(),r=!1,n=!1){f(this,"valid");f(this,"ns");f(this,"fragment");f(this,"encoded",!1);let{nsid:s}=t;if(i=kt(i),r&&i.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(i);i=decodeURIComponent(i),this.encoded=g}catch(g){}i=i.replace(/_/gu," ").trim();let a=e;i.startsWith(":")&&(a=0,i=i.slice(1).trim());let o=i.split(":");if(o.length>1){let g=s[o[0].trim().toLowerCase()];g&&(a=g,i=o.slice(1).join(":").trim())}this.ns=a;let d=i.indexOf("#");if(d!==-1){let g=i.slice(d+1).trimEnd();this.fragment=g,i=i.slice(0,d).trim()}this.valid=!!(i||n&&this.fragment!==void 0)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|]|%[\da-f]{2}/iu.test(i)}}});var ot,at,Tr,qe,xr=b(()=>{"use strict";qe=class{constructor(){k(this,at);f(this,"childNodes",[]);k(this,ot,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return u(this,ot)}get nextSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)+1]}get previousSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)-1]}get offsetHeight(){return $(this,at,Tr).call(this).height}get offsetWidth(){return $(this,at,Tr).call(this).width}getAttribute(i){return i==="padding"?0:i in this?String(this[i]):void 0}setAttribute(i,e){i==="parentNode"?w(this,ot,e):this[i]=e}getRootNode(){let{parentNode:i}=this;for(;i!=null&&i.parentNode;)({parentNode:i}=i);return i!=null?i:this}posFromIndex(i){let e=String(this);if(i>=-e.length&&i<=e.length){let t=e.slice(0,i).split(`
|
|
2
|
+
`),r=t.length-1;return{top:r,left:t[r].length}}}getGaps(i){return 0}getRelativeIndex(i){let e,t=(r,n)=>e.slice(0,r).reduce((s,a,o)=>s+String(a).length+n.getGaps(o),0)+n.getAttribute("padding");if(i===void 0){let{parentNode:r}=this;return r?({childNodes:e}=r,t(e.indexOf(this),r)):0}return{childNodes:e}=this,t(i,this)}getAbsoluteIndex(){let{parentNode:i}=this;return i?i.getAbsoluteIndex()+this.getRelativeIndex():0}};ot=new WeakMap,at=new WeakSet,Tr=function(){let i=String(this).split(`
|
|
3
|
+
`),e=i.length;return{height:e,width:i[e-1].length}}});var lt,br,dt,kr,yt,dn=b(()=>{"use strict";H();Ce();xr();yt=class extends qe{constructor(){super(...arguments);k(this,lt);k(this,dt)}get length(){return this.childNodes.length}text(e){return pe(this.childNodes,e)}normalize(){let e=[...this.childNodes];for(let t=e.length-1;t>=0;t--){let{type:r,data:n}=e[t],s=e[t-1];r!=="text"||this.getGaps(t-1)||(n===""?e.splice(t,1):(s==null?void 0:s.type)==="text"&&(s.setAttribute("data",s.data+n),e.splice(t,1)))}this.setAttribute("childNodes",e)}removeAt(e){return cr(this,e,1)[0]}insertAt(e,t=this.length){return cr(this,t,0,[e]),e}closest(e){let t=$(this,lt,br).call(this,e),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelectorAll(e){let t=$(this,lt,br).call(this,e);return $(this,dt,kr).call(this,t)}append(...e){for(let t of e)this.insertAt(t)}replaceChildren(...e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.append(...e)}setText(e,t=0){t+=t<0?this.length:0;let r=this.childNodes[t],{data:n}=r;return r.replaceData(e),n}toString(e,t=""){return this.childNodes.map(r=>r.toString()).join(t)}lint(e=this.getAbsoluteIndex()){let t=[];for(let r=0,n=e+this.getAttribute("padding");r<this.length;r++){let s=this.childNodes[r];t.push(...s.lint(n)),n+=String(s).length+this.getGaps(r)}return t}print(e={}){var t;return String(this)?`<span class="wpb-${(t=e.class)!=null?t:this.type}">${ge(this.childNodes,e)}</span>`:""}json(e){return{...this,childNodes:this.childNodes.map(r=>r.type==="text"?{data:r.data}:r.json())}}};lt=new WeakSet,br=function(e){let t,r=new Set(e.split(",").map(n=>n.trim()));return t=n=>r.has(n.type),t},dt=new WeakSet,kr=function(e){var r;let t=[];for(let n of this.childNodes)n.type!=="text"&&(e(n)&&t.push(n),t.push(...$(r=n,dt,kr).call(r,e)));return t}});var pn,v,S,P=b(()=>{"use strict";A();pn=l=>(i,e,t,r="error")=>{let{start:n}=e,{top:s,left:a}="top"in e?e:i.getRootNode().posFromIndex(n),{offsetHeight:o,offsetWidth:d}=i,{startIndex:g,startLine:p,startCol:h}=l(i,n,s,a);return{message:m.msg(t),severity:r,startIndex:g,endIndex:g+String(i).length,startLine:p,endLine:p+o-1,startCol:h,endCol:o===1?h+d:d}},v=pn((l,i,e,t)=>{let r=l.getRelativeIndex(),{top:n,left:s}=l.parentNode.posFromIndex(r);return{startIndex:i+r,startLine:e+n,startCol:n?s:t+s}}),S=pn((l,i,e,t)=>({startIndex:i,startLine:e,startCol:t}))});var Z,ye=b(()=>{"use strict";A();N();Z=class extends x{get innerText(){return this.firstChild.data}constructor(i="",e=m.getConfig(),t=[]){super(i,e,t)}}});var Ar={};W(Ar,{NowikiToken:()=>yr});var yr,vr=b(()=>{"use strict";P();A();ye();yr=class extends Z{constructor(){super(...arguments);f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let{name:t,firstChild:{data:r}}=this;return(t==="templatestyles"||t==="section")&&r?[S(this,{start:e},m.msg("nothing should be in <$1>",t))]:super.lint(e)}}});var Xi,Ki,Ji,At,gn,pt,un=b(()=>{"use strict";A();xr();Xi=/<\s*(?:\/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+|https?[:/]\/+/giu,Ki=/<\s*(?:\/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+/giu,Ji=["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"],pt=class extends qe{constructor(e){super();k(this,At);f(this,"type","text");f(this,"data","");Object.defineProperties(this,{data:{value:e}})}toString(){return this.data}text(){return this.data}lint(e=this.getAbsoluteIndex()){var L;let{data:t,parentNode:r,nextSibling:n,previousSibling:s}=this,{NowikiToken:a}=(vr(),R(Ar)),{type:o,name:d}=r,g=d==="nowiki"||d==="pre",p=n==null?void 0:n.type,h=n==null?void 0:n.name,c=s==null?void 0:s.type,T;o==="ext-inner"&&(d==="pre"||r instanceof a)?T=new RegExp(`<\\s*(?:\\/\\s*)${g?"":"?"}(${d})\\b`,"giu"):o==="free-ext-link"||o==="ext-link-url"||o==="image-parameter"&&d==="link"||o==="attr-value"?T=Ki:T=Xi;let y=[],{ext:F,html:q}=this.getRootNode().getAttribute("config");if(t.search(T)!==-1){T.lastIndex=0;let C=this.getRootNode(),{top:I,left:B}=C.posFromIndex(e),E=new Set(["onlyinclude","noinclude","includeonly",F,q,Ji].flat(2));for(let O=T.exec(t);O;O=T.exec(t)){let[,_,le]=O,{0:ne,index:me}=O;if(le&&le!=="]"){let{length:en}=le;me+=en,ne=ne.slice(en)}let{0:z,length:X}=ne;if(z==="["&&o==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(t.slice(me+1))||p==="ext"&&h==="nowiki"&&((L=n.innerText)!=null&&L.includes("]"))))continue;let Y=e+me,ie=t.slice(0,me).split(`
|
|
4
|
+
`),nt=ie.length+I-1,xe=ie[ie.length-1],K=ie.length===1?B+xe.length:xe.length,Ge=Y+X,Tt=String(C),je=Tt[Ge],hr=Tt[Y-1],Wi=X>1&&(z!=="<"||!g&&/[\s/>]/u.test(je!=null?je:""))||z==="{"&&(je===z||hr==="-")||z==="}"&&(hr===z||je==="-")||z==="["&&(je===z||o==="ext-link-text"||!t.slice(me+1).trim()&&p==="free-ext-link")||z==="]"&&(hr===z||!t.slice(0,me).trim()&&c==="free-ext-link")?"error":"warning";(z!=="<"||E.has(_.toLowerCase()))&&y.push({message:m.msg('lonely "$1"',z==="h"?ne:z),severity:Wi,startIndex:Y,endIndex:Ge,startLine:nt,endLine:nt,startCol:K,endCol:K+X})}return y}return[]}replaceData(e){$(this,At,gn).call(this,e)}print(){let e={"&":"amp","<":"lt",">":"gt"};return this.data.replace(/[&<>]/gu,t=>`&${e[t]};`)}};At=new WeakSet,gn=function(e){this.setAttribute("data",e)}});var vt,hn=b(()=>{"use strict";N();vt=class extends x{constructor(){super(...arguments);f(this,"type","onlyinclude")}toString(e){return`<onlyinclude>${super.toString()}</onlyinclude>`}getAttribute(e){return e==="padding"?13:e==="plain"||super.getAttribute(e)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var ue,Be=b(()=>{"use strict";ue=l=>{class i extends l{text(){return""}lint(){return[]}}return i}});var U,Ne=b(()=>{"use strict";Be();ye();U=class extends ue(Z){constructor(){super(...arguments);f(this,"type","noinclude")}}});var Ae,Oe,Sr=b(()=>{"use strict";A();N();Oe=class extends x{constructor(e,t,r,n,s=m.getConfig(),a=[]){super(void 0,s);k(this,Ae,void 0);f(this,"closed");f(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),w(this,Ae,[e,n||e]),this.closed=n!=="",this.selfClosing=n===void 0,this.append(t,r);let o=typeof t=="string"?-1:a.indexOf(t);a.splice(o===-1?1/0:o,0,this),Object.defineProperty(this,"closed",{enumerable:!1})}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(e){let{selfClosing:t,firstChild:r,lastChild:n}=this,[s,a]=u(this,Ae);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${n.toString(e)}${this.closed?`</${a}>`:""}`}text(){let[e,t]=u(this,Ae);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?u(this,Ae)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,Ae);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Ae=new WeakMap});var St,mn=b(()=>{"use strict";P();Be();A();Sr();St=class extends ue(Oe){constructor(e,t="",r,n,s=m.getConfig(),a=[]){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",s,a);f(this,"type","include")}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[S(this,{start:e},m.msg("unclosed $1",`<${this.name}>`))]}json(){return{...super.json(),closed:this.closed}}}});var G,ce=b(()=>{"use strict";A();N();G=class extends x{constructor(i,e,t=m.getConfig(),r=[],n){super(i,t,r,n),this.type=e}}});var Yi,D,cn,fn,wt,$r,Tn,gt,kn,yn,An,xn,$t,bn,es,ts,V,se,Me,vn=b(()=>{"use strict";P();H();de();A();N();ce();Yi=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"]),D=new Set(["align"]),cn=new Set(["cite"]),fn=new Set(["cite","datetime"]),wt=new Set(["width"]),$r=new Set(["axis","align","bgcolor","height","width","valign"]),Tn=new Set([...$r,"abbr","headers","scope","rowspan","colspan"]),gt=new Set(["type"]),kn=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),yn=new Set(["clear"]),An=new Set(["bgcolor","align","valign"]),xn={div:D,h1:D,h2:D,h3:D,h4:D,h5:D,h6:D,blockquote:cn,q:cn,p:D,br:yn,pre:wt,ins:fn,del:fn,ul:gt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...kn,"border"]),caption:D,tr:An,td:Tn,th:Tn,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:wt,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"])},$t=new Set,bn={nowiki:$t,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:$t,inputbox:$t,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:$t,poll:new Set(["id","show-results-before-voting"]),sm2:gt,flashmp3:gt,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"])},es=new RegExp("expression|(?:filter|accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u"),ts={table:kn,td:new Set([...$r,"scope"]),th:$r,br:yn,caption:D,div:D,hr:wt,h1:D,h2:D,h3:D,h4:D,h5:D,h6:D,li:gt,p:D,pre:wt,tr:An,ul:gt},Me=class extends x{constructor(e,t,r,n="",s,a=[],o=m.getConfig(),d=[]){let g=new G(r,"attr-key",o,d,{}),p;if(r==="title"||t==="img"&&r==="alt")p=new x(s,o,d,{}),p.type="attr-value",p.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let h={...o,excludes:[...o.excludes,"quote","extLink","magicLink","list"]};p=new x(s,h,d,{}),p.type="attr-value",p.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let h={...o,excludes:[...o.excludes,"heading","html","table","hr","list"]};p=new x(s,h,d,{}),p.type="attr-value",p.setAttribute("stage",1)}else p=new G(s,"attr-value",o,d,{});super(void 0,o,d);f(this,"tag");k(this,V,void 0);k(this,se,void 0);this.type=e,this.append(g,p),w(this,V,n),w(this,se,[...a]),this.tag=t,this.setAttribute("name",ee(r).trim().toLowerCase())}get balanced(){return!u(this,V)||u(this,se)[0]===u(this,se)[1]}afterBuild(){u(this,V).includes("\0")&&w(this,V,this.buildFromStr(u(this,V),0)),this.parentNode&&this.setAttribute("tag",this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(e){let[t="",r=""]=u(this,se);return u(this,V)?`${super.toString(e,`${u(this,V)}${t}`)}${r}`:this.firstChild.toString(e)}text(){return u(this,V)?`${super.text(`${u(this,V).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,V)?u(this,V).length+((t=(e=u(this,se)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex()){var h,c;let t=super.lint(e),{balanced:r,firstChild:n,lastChild:s,type:a,name:o,tag:d}=this,g=this.getValue(),p;if(!r){let T=this.getRootNode();p={start:e,...T.posFromIndex(e)};let y=v(s,p,m.msg("unclosed $1","quotes"),"warning");t.push({...y,startIndex:y.startIndex-1,startCol:y.startCol-1})}return bn[d]&&!bn[d].has(o)||(a==="ext-attr"?d in xn:!/\{\{[^{]+\}\}/u.test(o))&&!((h=xn[d])!=null&&h.has(o))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(o)&&(d==="meta"||d==="link"||!Yi.has(o))?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"illegal attribute name"))):(c=ts[d])!=null&&c.has(o)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"obsolete attribute","warning"))):o==="style"&&typeof g=="string"&&es.test(g)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"insecure style"))):o==="tabindex"&&typeof g=="string"&&g.trim()!=="0"&&(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"nonzero tabindex"))),t}getValue(){if(u(this,V)){let e=this.lastChild.text();return u(this,se)[1]?e:e[u(this,se)[0]?"trimEnd":"trim"]()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,se);return u(this,V)?super.print({sep:`${u(this,V)}${e}`,post:t}):super.print()}};V=new WeakMap,se=new WeakMap});var Sn,rs,ve,Nt=b(()=>{"use strict";P();H();A();N();ce();vn();Sn=l=>l.slice(0,-1),rs=l=>`${Sn(l)}-dirty`,ve=class extends x{constructor(i,e,t,r=m.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),i){let s=new RegExp(`([^\\s/](?:(?!\0\\d+~\x7F)[^\\s/=])*)(?:((?:\\s|\0\\d+c\x7F)*(?:=|\0\\d+~\x7F)(?:\\s|\0\\d+c\x7F)*)(?:(["'])(.*?)(\\3|$)|(\\S*)))?`,"gsu"),a="",o=s.exec(i),d=0,g=()=>{a&&(super.insertAt(new G(a,rs(e),r,n,{})),a="")};for(;o;){let{index:p,0:h,1:c,2:T,3:y,4:F,5:q,6:L}=o;if(a+=i.slice(d,p),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(ee(c).trim())){let C=F!=null?F:L,I=[y,q],B=new Me(Sn(e),t,c,T,C,I,r,n);g(),super.insertAt(B)}else a+=h;({lastIndex:d}=s),o=s.exec(i)}a+=i.slice(d),g()}}afterBuild(){if(this.type==="table-attrs"){let{parentNode:i}=this;this.setAttribute("name",(i==null?void 0:i.type)==="td"&&i.subtype==="caption"?"caption":i==null?void 0:i.type)}}getAttrTokens(i){return this.childNodes.filter(e=>e instanceof Me&&(!i||e.name===i.toLowerCase().trim()))}getAttrToken(i){let e=this.getAttrTokens(i);return e[e.length-1]}getAttr(i){var e;return(e=this.getAttrToken(i))==null?void 0:e.getValue()}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),{parentNode:t,length:r,childNodes:n}=this,s=new Map,a=new Set,o;(t==null?void 0:t.type)==="html"&&t.closing&&this.text().trim()&&(o={start:i,...this.getRootNode().posFromIndex(i)},e.push(S(this,o,"attributes of a closing tag")));for(let d=0;d<r;d++){let g=n[d];if(g instanceof G&&g.text().trim())o!=null||(o={start:i,...this.getRootNode().posFromIndex(i)}),e.push(v(g,o,"containing invalid attribute"));else if(g instanceof Me){let{name:p}=g;s.has(p)?(a.add(p),s.get(p).push(g)):p!=="class"&&s.set(p,[g])}}if(a.size>0){o!=null||(o={start:i,...this.getRootNode().posFromIndex(i)});for(let d of a)e.push(...s.get(d).map(g=>v(g,o,m.msg("duplicated $1 attribute",d))))}return e}print(){return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(i=>i.print(i instanceof G&&i.text().trim()?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var $n={};W($n,{PreToken:()=>wr});var wr,wn=b(()=>{"use strict";de();A();N();Ne();wr=class extends x{constructor(e,t=m.getConfig(),r=[]){if(e){let n="<nowiki>",s="</nowiki>",{length:a}=n,o=e.indexOf(n),d=e.indexOf(s,o+a),g="";for(;o!==-1&&d!==-1;)new U(n,t,r),new U(s,t,r),g+=`${e.slice(0,o)}\0${r.length-1}c\x7F${e.slice(o+a,d)}\0${r.length}c\x7F`,e=e.slice(d+a+1),o=e.indexOf(n),d=e.indexOf(s,o+a);e=`${g}${e}`}super(e,t,r,{});f(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}}});var Cn={};W(Cn,{ParamTagToken:()=>ut});var ut,Cr=b(()=>{"use strict";P();A();N();ce();ut=class extends x{constructor(e,t=m.getConfig(),r=[],n={}){super(void 0,t,r,{});f(this,"type","ext-inner");if(e){let s=G;this.append(...e.split(`
|
|
5
5
|
`).map(a=>new s(a,"param-line",t,r,{})))}}toString(e){return super.toString(e,`
|
|
6
6
|
`)}text(){return super.text(`
|
|
7
|
-
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t;return this.childNodes.filter(r=>{let{childNodes:n}=r,s=n.findIndex(({type:o})=>o!=="text"),a=(s>=0?n.slice(0,s).map(String).join(""):String(r)).trim();return a&&!(s>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(a)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,m.msg("invalid parameter of
|
|
8
|
-
`})}}});var he,dt=b(()=>{"use strict";A();F();he=class extends x{constructor(i,e,t="plain",r=m.getConfig(),n=[],s){super(i,r,n,s),this.type=t}lint(){return[]}}});var pt,Oe,wt,Me,vr=b(()=>{"use strict";P();A();F();dt();Me=class extends x{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);k(this,Oe);f(this,"type","heading");k(this,pt,void 0);S(this,pt,e);let s=new x(t[0],r,n);s.type="heading-title",s.setAttribute("stage",2);let a=new he(t[1],/^[^\S\n]*$/u,"heading-trail",r,n,{});this.append(s,a)}get level(){return u(this,pt)}toString(e){let t=u(this,Oe,wt);return`${t}${this.firstChild.toString()}${t}${this.lastChild.toString()}`}text(){let e=u(this,Oe,wt);return`${e}${this.firstChild.text()}${e}`}getAttribute(e){return e==="padding"?super.getAttribute("padding")+this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{firstChild:r,level:n}=this,s=String(r),a=r.childNodes.filter(p=>p.type==="quote"),o=a.filter(({bold:p})=>p),d=a.filter(({italic:p})=>p),g;return this.level===1&&(g={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,g,"<h1>"))),(s.startsWith("=")||s.endsWith("="))&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,g,m.msg("unbalanced $1 in a section header",'"="')))),this.closest("html-attrs, table-attrs")&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push($(this,g,"section header in a HTML tag"))),o.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(o[o.length-1],{...g,start:e+n,left:g.left+n},m.msg("unbalanced $1 in a section header","bold apostrophes")))),d.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(d[d.length-1],{start:e+n},m.msg("unbalanced $1 in a section header","italic apostrophes")))),t}print(){let e=u(this,Oe,wt);return super.print({pre:e,sep:e})}json(){return{...super.json(),level:this.level}}};pt=new WeakMap,Oe=new WeakSet,wt=function(){return"=".repeat(this.level)}});var Ki,Ct,vn=b(()=>{"use strict";Z();P();A();F();Ki=l=>l.toString(new Set(["comment","noinclude","include"])).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),Ct=class extends x{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);f(this,"type","parameter");let s=new x(typeof e=="number"?void 0:e,r,n,{}),a=new x(t,r,n);s.type="parameter-key",a.type="parameter-value",a.setAttribute("stage",2),this.append(s,a)}get anon(){return this.firstChild.length===0}afterBuild(){if(!this.anon){let{parentNode:e,firstChild:t}=this,r=Ki(t);this.setAttribute("name",r),e&&e.getArgs(r,!1,!1).add(this)}}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex()){var s;let t=super.lint(e),{firstChild:r}=this,n=(s=new RegExp(`https?://${xe}${be}$`,"iu").exec(r.toString(new Set(["comment","noinclude","include"]))))==null?void 0:s[0];if(n&&new URL(n).search){let a=v(r,{start:e},"unescaped query string in an anonymous parameter");t.push({...a,startIndex:a.endIndex,endIndex:a.endIndex+1,startLine:a.endLine,startCol:a.endCol,endCol:a.endCol+1})}return t}print(){return super.print({sep:this.anon?"":"="})}json(){return{...super.json(),anon:this.anon}}}});var Ji,Fe,Ee,Ft,Sn,Et,$n,Nt,wn=b(()=>{"use strict";Z();P();Ce();de();A();F();vn();me();dt();Ji=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),Nt=class extends x{constructor(e,t,r=m.getConfig(),n=[]){var h,c;super(void 0,r,n,{});k(this,Ft);k(this,Et);f(this,"type","template");f(this,"modifier","");k(this,Fe,!1);k(this,Ee,new Map);let{parserFunction:[s,a]}=r,o=(h=/^(?:\s|\0\d+c\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:h[0];if(o)this.setAttribute("modifier",o),e=e.slice(o.length);else if(e.includes(":")){let[T,...y]=e.split(":"),[N]=/^(?:\s|\0\d+c\x7F)*/u.exec((c=y[0])!=null?c:"");this.setModifier(`${T}:${N}`)&&(e=y.join(":").slice(N.length))}let d=e.includes(":");if(d||t.length===0&&!u(this,Fe)){let[T,...y]=e.split(":"),N=Y(T),q=N[y.length>0?"trimStart":"trim"](),I=q.toLowerCase(),C=s[I],E=a.includes(q);if(E||Ji.has(C)||d&&C){this.setAttribute("name",C!=null?C:I),this.type="magic-word";let L=new RegExp(`^\\s*${q}\\s*$`,E?"u":"iu"),O=new he(T,L,"magic-word-name",r,n,{});if(super.insertAt(O),y.length>0&&t.unshift([y.join(":")]),this.name==="invoke")for(let M=0;M<2;M++){let oe=t.shift();if(!oe)break;let re=new G(oe.join("="),`invoke-${M?"function":"module"}`,r,n);super.insertAt(re)}}}if(this.type==="template"){let T=Y(ft(e)).split("#")[0].trim();if(!T||/^:[\s_]*:|\0\d+[eh!+-]\x7F|[<>[\]{}\n]|%[\da-f]{2}/iu.test(T))throw n.pop(),new SyntaxError("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0");let y=new G(e,"template-name",r,n,{});super.insertAt(y)}let g=this.isTemplate(),p=1;for(let T=0;T<t.length;T++){let y=t[T];!g&&!(this.name==="switch"&&T>0)&&(y[0]=y.join("="),y.length=1),y.length===1&&(y.unshift(p),p++),this.insertAt(new Ct(...y,r,n))}}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),n=Y(e).trim();if(e&&!n.endsWith(":"))return!1;let s=n.slice(0,-1).toLowerCase(),a=t.includes(s),o=r.includes(s);return u(this,Fe)&&a||!u(this,Fe)&&(o||e==="")||this.length>1&&(a||o||e==="")?(this.setAttribute("modifier",e),S(this,Fe,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?`${this.firstChild.toString(e)}${this.length===1?"":":"}${this.childNodes.slice(1).map(t=>t.toString(e)).join("|")}`:super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s,name:a}=this;return s==="magic-word"&&a==="vardefine"?"":`{{${n}${s==="magic-word"?`${r.text()}${t===1?"":":"}${pe(e.slice(1),"|")}`:super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{type:r,childNodes:n,length:s}=this,a;if(!this.isTemplate())return t;let o=w(this,Ft,Sn).call(this);if(o.fragment!==void 0&&(a={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(n[r==="template"?0:1],a,"useless fragment"))),o.valid||(a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n[1],a,"illegal module name"))),r==="magic-word"&&s===2)return a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push($(this,a,"missing module function")),t;let d=this.getDuplicatedArgs();return d.length>0&&(a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push(...d.flatMap(([,g])=>g).map(g=>v(g,a,"duplicated parameter")))),t}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?w(this,Et,$n).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(we("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t=!1,r=!0){let n=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return u(this,Ee).has(n)?s=u(this,Ee).get(n):(s=new Set(this.getAllArgs().filter(({name:a})=>n===a)),u(this,Ee).set(n,s)),s}getDuplicatedArgs(){return this.isTemplate()?[...u(this,Ee)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]]):[]}getPossibleValues(){let{type:e,name:t,childNodes:r,constructor:{name:n}}=this;if(e==="template")throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`);let s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":s=2;break;case"ifeq":s=3;break;default:throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}let a=r.slice(s,s+2).map(({childNodes:[,o]})=>o);for(let o=0;o<a.length;){let{length:d,0:g}=a[o].childNodes.filter(p=>p.text().trim());if(d===0)a.splice(o,1);else if(d>1||g.type!=="magic-word")o++;else try{let p=g.getPossibleValues();a.splice(o,1,...p),o+=p.length}catch(p){o++}}return a}print(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s}=this;return`<span class="wpb-${s}">{{${n}${s==="magic-word"?`${r.print()}${t===1?"":":"}${ge(e.slice(1),{sep:"|"})}`:ge(e,{sep:"|"})}}}</span>`}json(){return{...super.json(),modifier:this.modifier||void 0}}};Fe=new WeakMap,Ee=new WeakMap,Ft=new WeakSet,Sn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.text(),e?10:828)},Et=new WeakSet,$n=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let n=r?t.indexOf(e):e-1;n<t.length;n++){let s=t[n],{name:a}=s,o=String(n+1);a!==o&&(s.setAttribute("name",o),this.getArgs(o,!1,!1).add(s))}}});var Lt,Cn=b(()=>{"use strict";je();F();Lt=class extends ue(x){constructor(){super(...arguments);f(this,"type","hidden")}}});var It,Nn=b(()=>{"use strict";Z();P();A();F();me();Cn();It=class extends x{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","arg");for(let n=0;n<e.length;n++)if(n===0){let s=new G(e[n],"arg-name",t,r,{});super.insertAt(s)}else if(n>1){let s=new Lt(e[n],t,r,{});super.insertAt(s)}else{let s=new x(e[n],t,r);s.type="arg-default",s.setAttribute("stage",2),super.insertAt(s)}}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${pe(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){if(!this.getAttribute("include"))return[$(this,{start:e},"unexpected template argument")];let{childNodes:[t,r,...n]}=this,s=t.lint(e+3);if(r&&s.push(...r.lint(e+4+String(t).length)),n.length>0){let a={start:e,...this.getRootNode().posFromIndex(e)};s.push(...n.map(o=>{let d=v(o,a,"invisible content inside triple braces");return{...d,startIndex:d.startIndex-1,startCol:d.startCol-1}}))}return s}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(){return{...super.json(),default:this.default}}}});var Fn={};_(Fn,{parseBraces:()=>Sr});var Sr,$r=b(()=>{"use strict";Z();A();vr();wn();Nn();Sr=(l,i=m.getConfig(),e=[])=>{var h,c,T,y,N,q;let t=`${(h=i.excludes)!=null&&h.includes("heading")?"":"^(\0\\d+c\x7F)*={1,6}|"}\\[\\[|\\{{2,}|-\\{(?!\\{)`,{parserFunction:[,,,r]}=i,n=[],s={"=":`
|
|
9
|
-
`,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},a=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"]]),o=new RegExp(t,"gmu"),d=o.exec(l),g=l.includes("}}"),p;for(;d||p!==void 0&&p<=l.length&&((T=(c=n[n.length-1])==null?void 0:c[0])!=null&&T.startsWith("="));){if(d!=null&&d[1]){let[,{length:
|
|
10
|
-
`,index:l.length},
|
|
11
|
-
`){p=C+1;let{pos:J,findEqual:W}=(N=n[n.length-1])!=null?N:{};if(J===void 0||W||Y(l.slice(J,L))!==""){let le=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(l.slice(L,C));le&&(l=`${l.slice(0,L)}\0${e.length}h\x7F${l.slice(C)}`,p=L+4+String(e.length).length,new Me(le[1].length,le.slice(2),i,e))}}else if(I==="|"||re)p=C+1,tt(l),I==="|"&&O.push([]),E.pos=p,E.findEqual=I==="|",n.push(E);else if(I.startsWith("}}")){let J=I.slice(0,Math.min(B.length,3)),W=B.length-J.length,{length:le}=e;p=C+J.length,tt(l);let rt=!1,Te="t";if(J.length===3){let H=O.map(pr=>pr.join("=")),$e=H.length>1&&Y(H[1]).trim();new It(H,i,e),$e&&$e.endsWith(":")&&r.includes($e.slice(0,-1).toLowerCase())&&(Te="s")}else try{new Nt(O[0][0],O.slice(1),i,e);let H=Y(O[0][0]).trim();a.has(H)?Te=a.get(H):/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(H)?Te="m":/^#vardefine:./iu.test(H)&&(Te="c")}catch(H){if(H instanceof SyntaxError&&H.message==="\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0")rt=!0;else throw H}rt||(l=`${l.slice(0,L+W)}\0${le}${Te}\x7F${l.slice(p)}`,p=L+W+3+String(le).length,W>1?n.push({0:B.slice(0,W),index:L,pos:L+W,parts:[[]]}):W===1&&l[L-1]==="-"&&n.push({0:"-{",index:L-1,pos:L+1,parts:[[]]}))}else p=C+I.length,I.startsWith("{")&&(d.pos=p,d.parts=[[]]),n.push(..."0"in E?[E]:[],d);g&&(g=l.slice(p).includes("}}"));let ae=n[n.length-1];!g&&((q=ae==null?void 0:ae[0])!=null&&q.startsWith("{"))&&(n.pop(),ae=n[n.length-1]),o=new RegExp(t+(ae?`|${s[ae[0][0]]}${ae.findEqual?"|=":""}`:""),"gmu"),o.lastIndex=p,d=o.exec(l)}return l}});var En={};_(En,{InputboxToken:()=>wr});var wr,Ln=b(()=>{"use strict";$r();A();Ar();wr=class extends lt{constructor(i,e=m.getConfig(),t=[]){let r=Symbol("InputboxToken");t.push(r),i&&(i=Sr(i,e,t)),t.splice(t.indexOf(r),1),super(i,e,t,{})}}});var ze,Cr=b(()=>{"use strict";P();je();A();ke();ze=class extends ue(Q){constructor(e,t=!0,r=m.getConfig(),n=[]){super(e,r,n);f(this,"type","comment");f(this,"closed");this.closed=t}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[$(this,{start:e},m.msg("unclosed $1","HTML comment"))]}toString(e){return`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}}});var Pt={};_(Pt,{NestedToken:()=>Nr});var Nr,Rt=b(()=>{"use strict";P();A();F();Fr();Ne();Cr();Nr=class extends x{constructor(e,t,r,n=m.getConfig(),s=[]){var a;e=(a=e==null?void 0:e.replace(t,(o,d,g,p,h)=>{let c=`\0${s.length+1}${d?"e":"c"}\x7F`;if(d)new We(d,g,p,h,n,s);else{let T=o.endsWith("-->");new ze(o.slice(4,T?-3:void 0),T,n,s)}return c}))==null?void 0:a.replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(o,d,g)=>(new D(g,n,s),`${d}\0${s.length}c\x7F`));super(e,n,s,{});f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let t;return[...super.lint(e),...this.childNodes.filter(r=>{if(r.type==="ext"||r.type==="comment")return!1;let n=String(r).trim();return n&&!/^<!--.*-->$/su.test(n)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,m.msg("invalid content in <$1>",this.name))))]}}});var Le,ie,Ie,ve,Gt=b(()=>{"use strict";P();de();A();F();me();ve=class extends x{constructor(e,t,r=m.getConfig(),n=[],s="|"){super(void 0,r,n,{});k(this,Le,!0);k(this,ie,void 0);k(this,Ie,void 0);if(this.insertAt(new G(e,"link-target",r,n,{})),t!==void 0){let a=new x(t,r,n,{});a.type="link-text",a.setAttribute("stage",10),this.insertAt(a)}S(this,ie,s)}afterBuild(){S(this,Ie,this.getTitle()),u(this,ie).includes("\0")&&S(this,ie,this.buildFromStr(u(this,ie),0))}setAttribute(e,t){e==="bracket"?S(this,Le,!!t):e==="title"?S(this,Ie,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,u(this,ie));return u(this,Le)?`[[${t}]]`:t}text(){let e=super.text("|");return u(this,Le)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,Ie):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,ie).length:1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{childNodes:[r,n],type:s}=this,{encoded:a,fragment:o}=u(this,Ie),d;return r.childNodes.some(({type:g})=>g==="template")&&(d={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,d,"template in an internal link target","warning"))),a&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"unnecessary URL encoding in an internal link"))),(s==="link"||s==="category")&&(n!=null&&n.childNodes.some(({type:g,data:p})=>g==="text"&&p.includes("|")))?(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,d,'additional "|" in the link text',"warning"))):s!=="link"&&o!==void 0&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"useless fragment"))),t}getTitle(){return this.normalizeTitle(this.firstChild.text(),0,!1,!0,!0)}print(){return super.print(u(this,Le)?{pre:"[[",post:"]]",sep:u(this,ie)}:{sep:u(this,ie)})}};Le=new WeakMap,ie=new WeakMap,Ie=new WeakMap});function In(l,i,e=m.getConfig(),t=!1){i=i.trim();let r=i.replace(/\0\d+t\x7F/gu,"").trim();switch(l){case"width":return!r||/^(?:\d+x?|\d*x\d+)$/u.test(r);case"link":{if(!r||new RegExp(`^(?:(?:${e.protocol}|//)${xe}|\0\\d+m\x7F)${be}$`,"iu").test(r))return i;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2));let s=m.normalizeTitle(r,0,!1,e,t,!0,!0);return s.valid&&s}case"lang":return!r||e.variants.includes(r);case"alt":case"class":case"manualthumb":return!0;default:return!Number.isNaN(Number(r))}}var Yi,K,qt,Pn,jt,Rn=b(()=>{"use strict";Z();P();A();F();Yi=new Set(["alt","link","lang","page","caption"]);jt=class extends x{constructor(e,t=m.getConfig(),r=[]){var i=(...args)=>{super(...args);k(this,qt);f(this,"type","image-parameter");k(this,K,"")};var o;let n,s=Object.entries(t.img).map(([d,g])=>[d,g,new RegExp(`^(\\s*)${d.replace("$1","(.*)")}(\\s*)$`,"u")]),a=s.find(([,d,g])=>(n=g.exec(e),n&&(n.length!==4||In(d,n[2],t,!0)!==!1)));if(a&&n){n.length===3?(i(void 0,t,r),S(this,K,e)):(i(n[2],t,r,{}),S(this,K,`${n[1]}${a[0]}${n[3]}`)),this.setAttribute("name",a[1]);return}i(e,{...t,excludes:[...(o=t.excludes)!=null?o:[],"list"]},r),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get link(){return this.name==="link"?In("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Yi.has(this.name)&&this.setAttribute("name","invalid")}toString(e){return u(this,K)?u(this,K).replace("$1",super.toString(e)):super.toString(e)}text(){return u(this,K)?u(this,K).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,u(this,K).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{link:r,name:n}=this;return n==="invalid"?t.push($(this,{start:e},"invalid gallery image parameter")):typeof r=="object"&&r.encoded&&t.push($(this,{start:e},"unnecessary URL encoding in an internal link")),t}getValue(){return this.name==="invalid"?this.text():w(this,qt,Pn).call(this)||super.text()}print(){return u(this,K)?this.name==="invalid"?`<span class="wpb-image-invalid">${u(this,K).replace("$1",ge(this.childNodes))}</span>`:`<span class="wpb-image-parameter">${u(this,K).replace("$1",`<span class="wpb-image-caption">${ge(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};K=new WeakMap,qt=new WeakSet,Pn=function(){return u(this,K)&&!u(this,K).includes("$1")}});var Er,Lr,Ir,es,_e,Bt,He,Pr=b(()=>{"use strict";Z();P();A();Gt();Rn();Er=new Set(["manualthumb","frameless","framed","thumbnail"]),Lr=new Set(["left","right","center","none"]),Ir=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),es=(l,i,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[l,i,e].map(Jr).join("|")}`,"gu"),n=[],s=r.exec(t),a=0,o=0;for(;s;){let{0:d,index:g}=s;d!==e?a+=d===l?1:-1:a===0&&(n.push(t.slice(o,g)),{lastIndex:o}=r),s=r.exec(t)}return n.push(t.slice(o)),n},He=class extends ve{constructor(e,t,r=m.getConfig(),n=[],s="|"){super(e,void 0,r,n,s);k(this,_e);f(this,"type","file");this.append(...es("-{","}-","|",t).map(a=>new jt(a,r,n)))}lint(e=this.getAbsoluteIndex()){var p;let t=super.lint(e),r=this.getAllArgs().filter(({childNodes:h})=>{let c=h.filter(T=>T.text().trim());return c.length!==1||c[0].type!=="arg"}),n=[...new Set(r.map(({name:h})=>h))].filter(h=>h!=="invalid"),s=n.filter(h=>Er.has(h)),a=n.filter(h=>Lr.has(h)),o=n.filter(h=>Ir.has(h));if(this.closest("ext-link-text")&&((p=this.getValue("link"))==null?void 0:p.trim())!==""&&t.push($(this,{start:e},"internal link in an external link")),r.length===n.length&&s.length<2&&a.length<2&&o.length<2)return t;let d={start:e,...this.getRootNode().posFromIndex(e)},g=(h,c)=>T=>v(T,d,m.msg(`${h} image $1 parameter`,c));for(let h of n){let c=r.filter(({name:T})=>T===h);h==="caption"&&(c=[...c.slice(0,-1).filter(T=>T.text()),...c.slice(-1)]),c.length>1&&t.push(...c.map(g("duplicated",h)))}return s.length>1&&t.push(...r.filter(({name:h})=>Er.has(h)).map(g("conflicting","frame"))),a.length>1&&t.push(...r.filter(({name:h})=>Lr.has(h)).map(g("conflicting","horizontal-alignment"))),o.length>1&&t.push(...r.filter(({name:h})=>Ir.has(h)).map(g("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getFrameArgs(){return w(this,_e,Bt).call(this,Er,"\u6846\u67B6")}getHorizAlignArgs(){return w(this,_e,Bt).call(this,Lr,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return w(this,_e,Bt).call(this,Ir,"\u5782\u76F4\u5BF9\u9F50")}getArg(e){let t=this.getArgs(e);return t[t.length-1]}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}};_e=new WeakSet,Bt=function(e,t){return this.getAllArgs().filter(({name:n})=>e.has(n))}});var Ot,Gn,Ue,Rr=b(()=>{"use strict";P();de();A();F();Pr();Ue=class extends He{constructor(e,t,r,n=m.getConfig(),s=[]){let a;if(r!==void 0){a=new x(r,n,s),a.type="plain";for(let o=1;o<11;o++)a.parseOnce();s.splice(s.indexOf(a),1)}super(t,a==null?void 0:a.toString(),n,s);k(this,Ot);this.setAttribute("bracket",!1),this.type=`${e}-image`}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(String(this.firstChild),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{ns:r}=this.getAttribute("title");return r!==6&&t.push($(this,{start:e},"invalid gallery image")),t}afterBuild(){w(this,Ot,Gn).call(this,this.getTitle())}};Ot=new WeakSet,Gn=function(e){this.setAttribute("title",e)}});var qn={};_(qn,{GalleryToken:()=>Gr});var Mt,jn,Gr,Bn=b(()=>{"use strict";A();F();Rr();Ne();Gr=class extends x{constructor(e,t=m.getConfig(),r=[]){var n;super(void 0,t,r,{});k(this,Mt);f(this,"type","ext-inner");for(let s of(n=e==null?void 0:e.split(`
|
|
12
|
-
`))!=null?n:[]){let a=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!a){super.insertAt(s.trim()?new
|
|
7
|
+
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t;return this.childNodes.filter(r=>{let{childNodes:n}=r,s=n.findIndex(({type:o})=>o!=="text"),a=(s>=0?n.slice(0,s).map(String).join(""):String(r)).trim();return a&&!(s>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(a)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,m.msg("invalid parameter of <$1>",this.name))))}print(){return super.print({sep:`
|
|
8
|
+
`})}}});var he,ht=b(()=>{"use strict";A();N();he=class extends x{constructor(i,e,t="plain",r=m.getConfig(),n=[],s){super(i,r,n,s),this.type=t}lint(){return[]}}});var mt,ze,Ft,We,Nr=b(()=>{"use strict";P();A();N();ht();We=class extends x{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);k(this,ze);f(this,"type","heading");k(this,mt,void 0);w(this,mt,e);let s=new x(t[0],r,n);s.type="heading-title",s.setAttribute("stage",2);let a=new he(t[1],/^[^\S\n]*$/u,"heading-trail",r,n,{});this.append(s,a)}get level(){return u(this,mt)}toString(e){let t=u(this,ze,Ft);return`${t}${this.firstChild.toString()}${t}${this.lastChild.toString()}`}text(){let e=u(this,ze,Ft);return`${e}${this.firstChild.text()}${e}`}getAttribute(e){return e==="padding"?super.getAttribute("padding")+this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{firstChild:r,level:n}=this,s=String(r),a=r.childNodes.filter(p=>p.type==="quote"),o=a.filter(({bold:p})=>p),d=a.filter(({italic:p})=>p),g;return this.level===1&&(g={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,g,"<h1>"))),(s.startsWith("=")||s.endsWith("="))&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,g,m.msg("unbalanced $1 in a section header",'"="')))),this.closest("html-attrs, table-attrs")&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(S(this,g,"section header in a HTML tag"))),o.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(o[o.length-1],{...g,start:e+n,left:g.left+n},m.msg("unbalanced $1 in a section header","bold apostrophes")))),d.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(d[d.length-1],{start:e+n},m.msg("unbalanced $1 in a section header","italic apostrophes")))),t}print(){let e=u(this,ze,Ft);return super.print({pre:e,sep:e})}json(){return{...super.json(),level:this.level}}};mt=new WeakMap,ze=new WeakSet,Ft=function(){return"=".repeat(this.level)}});var ns,Lt,Nn=b(()=>{"use strict";H();P();A();N();ns=l=>l.toString(new Set(["comment","noinclude","include"])).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),Lt=class extends x{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);f(this,"type","parameter");let s=new x(typeof e=="number"?void 0:e,r,n,{}),a=new x(t,r,n);s.type="parameter-key",a.type="parameter-value",a.setAttribute("stage",2),this.append(s,a)}get anon(){return this.firstChild.length===0}afterBuild(){if(!this.anon){let{parentNode:e,firstChild:t}=this,r=ns(t);this.setAttribute("name",r),e&&e.getArgs(r,!1,!1).add(this)}}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex()){var s;let t=super.lint(e),{firstChild:r}=this,n=(s=new RegExp(`https?://${be}${ke}$`,"iu").exec(r.toString(new Set(["comment","noinclude","include"]))))==null?void 0:s[0];if(n&&new URL(n).search){let a=v(r,{start:e},"unescaped query string in an anonymous parameter");t.push({...a,startIndex:a.endIndex,endIndex:a.endIndex+1,startLine:a.endLine,startCol:a.endCol,endCol:a.endCol+1})}return t}print(){return super.print({sep:this.anon?"":"="})}json(){return{...super.json(),anon:this.anon}}}});var is,Fe,Le,It,Fn,Pt,Ln,Et,En=b(()=>{"use strict";H();P();Ce();de();A();N();Nn();ce();ht();is=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),Et=class extends x{constructor(e,t,r=m.getConfig(),n=[]){var h,c;super(void 0,r,n,{});k(this,It);k(this,Pt);f(this,"type","template");f(this,"modifier","");k(this,Fe,!1);k(this,Le,new Map);let{parserFunction:[s,a]}=r,o=(h=/^(?:\s|\0\d+c\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:h[0];if(o)this.setAttribute("modifier",o),e=e.slice(o.length);else if(e.includes(":")){let[T,...y]=e.split(":"),[F]=/^(?:\s|\0\d+c\x7F)*/u.exec((c=y[0])!=null?c:"");this.setModifier(`${T}:${F}`)&&(e=y.join(":").slice(F.length))}let d=e.includes(":");if(d||t.length===0&&!u(this,Fe)){let[T,...y]=e.split(":"),F=ee(T),q=F[y.length>0?"trimStart":"trim"](),L=q.toLowerCase(),C=s[L],I=a.includes(q);if(I||is.has(C)||d&&C){this.setAttribute("name",C!=null?C:L),this.type="magic-word";let E=new RegExp(`^\\s*${q}\\s*$`,I?"u":"iu"),O=new he(T,E,"magic-word-name",r,n,{});if(super.insertAt(O),y.length>0&&t.unshift([y.join(":")]),this.name==="invoke")for(let _=0;_<2;_++){let le=t.shift();if(!le)break;let ne=new G(le.join("="),`invoke-${_?"function":"module"}`,r,n);super.insertAt(ne)}}}if(this.type==="template"){let T=ee(kt(e)).split("#")[0].trim();if(!T||/^:[\s_]*:|\0\d+[eh!+-]\x7F|[<>[\]{}\n]|%[\da-f]{2}/iu.test(T))throw n.pop(),new SyntaxError("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0");let y=new G(e,"template-name",r,n,{});super.insertAt(y)}let g=this.isTemplate(),p=1;for(let T=0;T<t.length;T++){let y=t[T];!g&&!(this.name==="switch"&&T>0)&&(y[0]=y.join("="),y.length=1),y.length===1&&(y.unshift(p),p++),this.insertAt(new Lt(...y,r,n))}}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),n=ee(e).trim();if(e&&!n.endsWith(":"))return!1;let s=n.slice(0,-1).toLowerCase(),a=t.includes(s),o=r.includes(s);return u(this,Fe)&&a||!u(this,Fe)&&(o||e==="")||this.length>1&&(a||o||e==="")?(this.setAttribute("modifier",e),w(this,Fe,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?`${this.firstChild.toString(e)}${this.length===1?"":":"}${this.childNodes.slice(1).map(t=>t.toString(e)).join("|")}`:super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s,name:a}=this;return s==="magic-word"&&a==="vardefine"?"":`{{${n}${s==="magic-word"?`${r.text()}${t===1?"":":"}${pe(e.slice(1),"|")}`:super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{type:r,childNodes:n,length:s}=this,a;if(!this.isTemplate())return t;let o=$(this,It,Fn).call(this);if(o.fragment!==void 0&&(a={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(n[r==="template"?0:1],a,"useless fragment"))),o.valid||(a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n[1],a,"illegal module name"))),r==="magic-word"&&s===2)return a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push(S(this,a,"missing module function")),t;let d=this.getDuplicatedArgs();return d.length>0&&(a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push(...d.flatMap(([,g])=>g).map(g=>v(g,a,"duplicated parameter")))),t}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?$(this,Pt,Ln).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(we("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t=!1,r=!0){let n=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return u(this,Le).has(n)?s=u(this,Le).get(n):(s=new Set(this.getAllArgs().filter(({name:a})=>n===a)),u(this,Le).set(n,s)),s}getDuplicatedArgs(){return this.isTemplate()?[...u(this,Le)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]]):[]}getPossibleValues(){let{type:e,name:t,childNodes:r,constructor:{name:n}}=this;if(e==="template")throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`);let s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":s=2;break;case"ifeq":s=3;break;default:throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}let a=r.slice(s,s+2).map(({childNodes:[,o]})=>o);for(let o=0;o<a.length;){let{length:d,0:g}=a[o].childNodes.filter(p=>p.text().trim());if(d===0)a.splice(o,1);else if(d>1||g.type!=="magic-word")o++;else try{let p=g.getPossibleValues();a.splice(o,1,...p),o+=p.length}catch(p){o++}}return a}print(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s}=this;return`<span class="wpb-${s}">{{${n}${s==="magic-word"?`${r.print()}${t===1?"":":"}${ge(e.slice(1),{sep:"|"})}`:ge(e,{sep:"|"})}}}</span>`}json(){return{...super.json(),modifier:this.modifier||void 0}}};Fe=new WeakMap,Le=new WeakMap,It=new WeakSet,Fn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.text(),e?10:828)},Pt=new WeakSet,Ln=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let n=r?t.indexOf(e):e-1;n<t.length;n++){let s=t[n],{name:a}=s,o=String(n+1);a!==o&&(s.setAttribute("name",o),this.getArgs(o,!1,!1).add(s))}}});var Rt,In=b(()=>{"use strict";Be();N();Rt=class extends ue(x){constructor(){super(...arguments);f(this,"type","hidden")}}});var Gt,Pn=b(()=>{"use strict";H();P();A();N();ce();In();Gt=class extends x{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","arg");for(let n=0;n<e.length;n++)if(n===0){let s=new G(e[n],"arg-name",t,r,{});super.insertAt(s)}else if(n>1){let s=new Rt(e[n],t,r,{});super.insertAt(s)}else{let s=new x(e[n],t,r);s.type="arg-default",s.setAttribute("stage",2),super.insertAt(s)}}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${pe(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){if(!this.getAttribute("include"))return[S(this,{start:e},"unexpected template argument")];let{childNodes:[t,r,...n]}=this,s=t.lint(e+3);if(r&&s.push(...r.lint(e+4+String(t).length)),n.length>0){let a={start:e,...this.getRootNode().posFromIndex(e)};s.push(...n.map(o=>{let d=v(o,a,"invisible content inside triple braces");return{...d,startIndex:d.startIndex-1,startCol:d.startCol-1}}))}return s}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(){return{...super.json(),default:this.default}}}});var Rn={};W(Rn,{parseBraces:()=>Fr});var Fr,Lr=b(()=>{"use strict";H();A();Nr();En();Pn();Fr=(l,i=m.getConfig(),e=[])=>{var h,c,T,y,F,q;let t=`${(h=i.excludes)!=null&&h.includes("heading")?"":"^(\0\\d+c\x7F)*={1,6}|"}\\[\\[|\\{{2,}|-\\{(?!\\{)`,{parserFunction:[,,,r]}=i,n=[],s={"=":`
|
|
9
|
+
`,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},a=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"]]),o=new RegExp(t,"gmu"),d=o.exec(l),g=l.includes("}}"),p;for(;d||p!==void 0&&p<=l.length&&((T=(c=n[n.length-1])==null?void 0:c[0])!=null&&T.startsWith("="));){if(d!=null&&d[1]){let[,{length:X}]=d;d[0]=d[0].slice(X),d.index+=X}let{0:L,index:C}=d!=null?d:{0:`
|
|
10
|
+
`,index:l.length},I=(y=n.pop())!=null?y:{},{0:B,index:E,parts:O,findEqual:_,pos:le}=I,ne=L==="="&&_,me=X=>{O[O.length-1].push(X.slice(le,C))};if(L==="]]"||L==="}-")p=C+2;else if(L===`
|
|
11
|
+
`){p=C+1;let{pos:X,findEqual:Y}=(F=n[n.length-1])!=null?F:{};if(X===void 0||Y||ee(l.slice(X,E))!==""){let ie=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(l.slice(E,C));ie&&(l=`${l.slice(0,E)}\0${e.length}h\x7F${l.slice(C)}`,p=E+4+String(e.length).length,new We(ie[1].length,ie.slice(2),i,e))}}else if(L==="|"||ne)p=C+1,me(l),L==="|"&&O.push([]),I.pos=p,I.findEqual=L==="|",n.push(I);else if(L.startsWith("}}")){let X=L.slice(0,Math.min(B.length,3)),Y=B.length-X.length,{length:ie}=e;p=C+X.length,me(l);let nt=!1,xe="t";if(X.length===3){let K=O.map(Tt=>Tt.join("=")),Ge=K.length>1&&ee(K[1]).trim();new Gt(K,i,e),Ge&&Ge.endsWith(":")&&r.includes(Ge.slice(0,-1).toLowerCase())&&(xe="s")}else try{new Et(O[0][0],O.slice(1),i,e);let K=ee(O[0][0]).trim();a.has(K)?xe=a.get(K):/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(K)?xe="m":/^#vardefine:./iu.test(K)&&(xe="c")}catch(K){if(K instanceof SyntaxError&&K.message==="\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0")nt=!0;else throw K}nt||(l=`${l.slice(0,E+Y)}\0${ie}${xe}\x7F${l.slice(p)}`,p=E+Y+3+String(ie).length,Y>1?n.push({0:B.slice(0,Y),index:E,pos:E+Y,parts:[[]]}):Y===1&&l[E-1]==="-"&&n.push({0:"-{",index:E-1,pos:E+1,parts:[[]]}))}else p=C+L.length,L.startsWith("{")&&(d.pos=p,d.parts=[[]]),n.push(..."0"in I?[I]:[],d);g&&(g=l.slice(p).includes("}}"));let z=n[n.length-1];!g&&((q=z==null?void 0:z[0])!=null&&q.startsWith("{"))&&(n.pop(),z=n[n.length-1]),o=new RegExp(t+(z?`|${s[z[0][0]]}${z.findEqual?"|=":""}`:""),"gmu"),o.lastIndex=p,d=o.exec(l)}return l}});var Gn={};W(Gn,{InputboxToken:()=>Er});var Er,jn=b(()=>{"use strict";Lr();A();Cr();Er=class extends ut{constructor(i,e=m.getConfig(),t=[]){let r=Symbol("InputboxToken");t.push(r),i&&(i=Fr(i,e,t)),t.splice(t.indexOf(r),1),super(i,e,t,{})}}});var _e,Ir=b(()=>{"use strict";P();Be();A();ye();_e=class extends ue(Z){constructor(e,t=!0,r=m.getConfig(),n=[]){super(e,r,n);f(this,"type","comment");f(this,"closed");this.closed=t}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[S(this,{start:e},m.msg("unclosed $1","HTML comment"))]}toString(e){return`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}}});var jt={};W(jt,{NestedToken:()=>Pr});var Pr,qt=b(()=>{"use strict";P();A();N();Rr();Ne();Ir();Pr=class extends x{constructor(e,t,r,n=m.getConfig(),s=[]){e=e==null?void 0:e.replace(t,(a,o,d,g,p)=>{let h=`\0${s.length+1}${o?"e":"c"}\x7F`;if(o)new De(o,d,g,p,n,s);else{let c=a.endsWith("-->");new _e(a.slice(4,c?-3:void 0),c,n,s)}return h}).replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(a,o,d)=>(new U(d,n,s),`${o}\0${s.length}c\x7F`));super(e,n,s,{});f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let t;return[...super.lint(e),...this.childNodes.filter(r=>{if(r.type==="ext"||r.type==="comment")return!1;let n=String(r).trim();return n&&!/^<!--.*-->$/su.test(n)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,m.msg("invalid content in <$1>",this.name))))]}}});var Ee,oe,Ie,Se,Bt=b(()=>{"use strict";P();de();A();N();ce();Se=class extends x{constructor(e,t,r=m.getConfig(),n=[],s="|"){super(void 0,r,n,{});k(this,Ee,!0);k(this,oe,void 0);k(this,Ie,void 0);if(this.insertAt(new G(e,"link-target",r,n,{})),t!==void 0){let a=new x(t,r,n,{});a.type="link-text",a.setAttribute("stage",10),this.insertAt(a)}w(this,oe,s)}afterBuild(){w(this,Ie,this.getTitle()),u(this,oe).includes("\0")&&w(this,oe,this.buildFromStr(u(this,oe),0))}setAttribute(e,t){e==="bracket"?w(this,Ee,!!t):e==="title"?w(this,Ie,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,u(this,oe));return u(this,Ee)?`[[${t}]]`:t}text(){let e=super.text("|");return u(this,Ee)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,Ie):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,oe).length:1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{childNodes:[r,n],type:s}=this,{encoded:a,fragment:o}=u(this,Ie),d;return r.childNodes.some(({type:g})=>g==="template")&&(d={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,d,"template in an internal link target","warning"))),a&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"unnecessary URL encoding in an internal link"))),(s==="link"||s==="category")&&(n!=null&&n.childNodes.some(({type:g,data:p})=>g==="text"&&p.includes("|")))?(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,d,'additional "|" in the link text',"warning"))):s!=="link"&&o!==void 0&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"useless fragment"))),t}getTitle(){return this.normalizeTitle(this.firstChild.text(),0,!1,!0,!0)}print(){return super.print(u(this,Ee)?{pre:"[[",post:"]]",sep:u(this,oe)}:{sep:u(this,oe)})}};Ee=new WeakMap,oe=new WeakMap,Ie=new WeakMap});function qn(l,i,e=m.getConfig(),t=!1){i=i.trim();let r=i.replace(/\0\d+t\x7F/gu,"").trim();switch(l){case"width":return!r||/^(?:\d+x?|\d*x\d+)$/u.test(r);case"link":{if(!r||new RegExp(`^(?:(?:${e.protocol}|//)${be}|\0\\d+m\x7F)${ke}$`,"iu").test(r))return i;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2));let s=m.normalizeTitle(r,0,!1,e,t,!0,!0);return s.valid&&s}case"lang":return!r||e.variants.includes(r);case"alt":case"class":case"manualthumb":return!0;default:return!Number.isNaN(Number(r))}}var ss,J,Mt,Bn,Ot,On=b(()=>{"use strict";H();P();A();N();ss=new Set(["alt","link","lang","page","caption"]);Ot=class extends x{constructor(e,t=m.getConfig(),r=[]){var i=(...al)=>(super(...al),k(this,Mt),f(this,"type","image-parameter"),k(this,J,""),this);var o;let n,s=Object.entries(t.img).map(([d,g])=>[d,g,new RegExp(`^(\\s*)${d.replace("$1","(.*)")}(\\s*)$`,"u")]),a=s.find(([,d,g])=>(n=g.exec(e),n&&(n.length!==4||qn(d,n[2],t,!0)!==!1)));if(a&&n){n.length===3?(i(void 0,t,r),w(this,J,e)):(i(n[2],t,r,{}),w(this,J,`${n[1]}${a[0]}${n[3]}`)),this.setAttribute("name",a[1]);return}i(e,{...t,excludes:[...(o=t.excludes)!=null?o:[],"list"]},r),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get link(){return this.name==="link"?qn("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!ss.has(this.name)&&this.setAttribute("name","invalid")}toString(e){return u(this,J)?u(this,J).replace("$1",super.toString(e)):super.toString(e)}text(){return u(this,J)?u(this,J).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,u(this,J).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{link:r,name:n}=this;return n==="invalid"?t.push(S(this,{start:e},"invalid gallery image parameter")):typeof r=="object"&&r.encoded&&t.push(S(this,{start:e},"unnecessary URL encoding in an internal link")),t}getValue(){return this.name==="invalid"?this.text():$(this,Mt,Bn).call(this)||super.text()}print(){return u(this,J)?this.name==="invalid"?`<span class="wpb-image-invalid">${u(this,J).replace("$1",ge(this.childNodes))}</span>`:`<span class="wpb-image-parameter">${u(this,J).replace("$1",`<span class="wpb-image-caption">${ge(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};J=new WeakMap,Mt=new WeakSet,Bn=function(){return u(this,J)&&!u(this,J).includes("$1")}});var Gr,jr,qr,os,He,zt,Ue,Br=b(()=>{"use strict";H();P();A();Bt();On();Gr=new Set(["manualthumb","frameless","framed","thumbnail"]),jr=new Set(["left","right","center","none"]),qr=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),os=(l,i,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[l,i,e].map(sn).join("|")}`,"gu"),n=[],s=r.exec(t),a=0,o=0;for(;s;){let{0:d,index:g}=s;d!==e?a+=d===l?1:-1:a===0&&(n.push(t.slice(o,g)),{lastIndex:o}=r),s=r.exec(t)}return n.push(t.slice(o)),n},Ue=class extends Se{constructor(e,t,r=m.getConfig(),n=[],s="|"){super(e,void 0,r,n,s);k(this,He);f(this,"type","file");this.append(...os("-{","}-","|",t).map(a=>new Ot(a,r,n)))}lint(e=this.getAbsoluteIndex()){var p;let t=super.lint(e),r=this.getAllArgs().filter(({childNodes:h})=>{let c=h.filter(T=>T.text().trim());return c.length!==1||c[0].type!=="arg"}),n=[...new Set(r.map(({name:h})=>h))].filter(h=>h!=="invalid"),s=n.filter(h=>Gr.has(h)),a=n.filter(h=>jr.has(h)),o=n.filter(h=>qr.has(h));if(this.closest("ext-link-text")&&((p=this.getValue("link"))==null?void 0:p.trim())!==""&&t.push(S(this,{start:e},"internal link in an external link")),r.length===n.length&&s.length<2&&a.length<2&&o.length<2)return t;let d={start:e,...this.getRootNode().posFromIndex(e)},g=(h,c)=>T=>v(T,d,m.msg(`${h} image $1 parameter`,c));for(let h of n){let c=r.filter(({name:T})=>T===h);h==="caption"&&(c=[...c.slice(0,-1).filter(T=>T.text()),...c.slice(-1)]),c.length>1&&t.push(...c.map(g("duplicated",h)))}return s.length>1&&t.push(...r.filter(({name:h})=>Gr.has(h)).map(g("conflicting","frame"))),a.length>1&&t.push(...r.filter(({name:h})=>jr.has(h)).map(g("conflicting","horizontal-alignment"))),o.length>1&&t.push(...r.filter(({name:h})=>qr.has(h)).map(g("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getFrameArgs(){return $(this,He,zt).call(this,Gr,"\u6846\u67B6")}getHorizAlignArgs(){return $(this,He,zt).call(this,jr,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return $(this,He,zt).call(this,qr,"\u5782\u76F4\u5BF9\u9F50")}getArg(e){let t=this.getArgs(e);return t[t.length-1]}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}};He=new WeakSet,zt=function(e,t){return this.getAllArgs().filter(({name:n})=>e.has(n))}});var Wt,Mn,Ve,Or=b(()=>{"use strict";P();de();A();N();Br();Ve=class extends Ue{constructor(e,t,r,n=m.getConfig(),s=[]){let a;if(r!==void 0){a=new x(r,n,s),a.type="plain";for(let o=1;o<11;o++)a.parseOnce();s.splice(s.indexOf(a),1)}super(t,a==null?void 0:a.toString(),n,s);k(this,Wt);this.setAttribute("bracket",!1),this.type=`${e}-image`}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(String(this.firstChild),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{ns:r}=this.getAttribute("title");return r!==6&&t.push(S(this,{start:e},"invalid gallery image")),t}afterBuild(){$(this,Wt,Mn).call(this,this.getTitle())}};Wt=new WeakSet,Mn=function(e){this.setAttribute("title",e)}});var Wn={};W(Wn,{GalleryToken:()=>Mr});var _t,zn,Mr,_n=b(()=>{"use strict";A();N();Or();Ne();Mr=class extends x{constructor(e,t=m.getConfig(),r=[]){var n;super(void 0,t,r,{});k(this,_t);f(this,"type","ext-inner");for(let s of(n=e==null?void 0:e.split(`
|
|
12
|
+
`))!=null?n:[]){let a=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!a){super.insertAt(s.trim()?new U(s,t):s);continue}let[,o,d]=a;$(this,_t,zn).call(this,o)?super.insertAt(new Ve("gallery",o,d,t,r)):super.insertAt(new U(s,t))}}toString(e){return super.toString(e,`
|
|
13
13
|
`)}text(){return super.text(`
|
|
14
14
|
`).replace(/\n\s*\n/gu,`
|
|
15
15
|
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let{top:t,left:r}=this.getRootNode().posFromIndex(e),n=[];for(let s=0;s<this.length;s++){let a=this.childNodes[s],o=String(a),{length:d}=o,g=o.trim(),p=t+s,h=s?0:r;a.type==="noinclude"&&g&&!/^<!--.*-->$/u.test(g)?n.push({message:m.msg("invalid content in <$1>","gallery"),severity:"error",startIndex:e,endIndex:e+d,startLine:p,endLine:p,startCol:h,endCol:h+d}):a.type!=="noinclude"&&a.type!=="text"&&n.push(...a.lint(e)),e+=d+1}return n}print(){return super.print({sep:`
|
|
16
|
-
`})}};
|
|
17
|
-
`),{length:y}=T,{length:
|
|
18
|
-
`),s=new Set(t.protocol.split("|")),a=
|
|
16
|
+
`})}};_t=new WeakSet,zn=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var Ze,zr=b(()=>{"use strict";P();Bt();Ze=class extends Se{constructor(){super(...arguments);f(this,"type","link")}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);return this.closest("ext-link-text")&&t.push(S(this,{start:e},"internal link in an external link")),t}}});var Dn,Hn=b(()=>{"use strict";Dn=l=>{class i extends l{}return i}});var Qe,Wr=b(()=>{"use strict";P();A();N();Qe=class extends x{constructor(i,e=!1,t=m.getConfig(),r=[]){super(i,t,r,{}),this.type=e?"ext-link-url":"free-ext-link"}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),t=`[\uFF0C\uFF1B\u3002\uFF1A\uFF01\uFF1F\uFF08\uFF09]+${this.type==="ext-link-url"?"|\\|+":""}`,r=new RegExp(t,"u"),n=new RegExp(t,"gu"),s;for(let a of this.childNodes){let{type:o,data:d}=a;if(o!=="text"||!r.test(d))continue;s!=null||(s={start:i,...this.getRootNode().posFromIndex(i)});let g=v(a,s,"","warning");n.lastIndex=0;for(let p=n.exec(d);p;p=n.exec(d)){let{index:h,0:c}=p,T=d.slice(0,h).split(`
|
|
17
|
+
`),{length:y}=T,{length:F}=T[T.length-1],q=g.startIndex+h,L=g.startLine+y-1,C=y===1?g.startCol+F:F;e.push({...g,message:m.msg("$1 in URL",c.startsWith("|")?'"|"':"full-width punctuation"),startIndex:q,endIndex:q+c.length,startLine:L,endLine:L,startCol:C,endCol:C+c.length})}}return e}}});var fe,Xe,_r=b(()=>{"use strict";de();P();Hn();A();N();Wr();Xe=class extends Dn(x){constructor(e,t="",r="",n=m.getConfig(),s=[]){super(void 0,n,s,{});f(this,"type","ext-link");k(this,fe,void 0);if(this.insertAt(new Qe(e,!0,n,s)),w(this,fe,t),r){let a=new x(r,n,s,{});a.type="ext-link-text",a.setAttribute("stage",10),this.insertAt(a)}}toString(e){return this.length===1?`[${super.toString(e)}${u(this,fe)}]`:`[${super.toString(e,u(this,fe))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return u(this,fe).length}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);return this.length===1&&this.closest("heading-title")&&t.push(S(this,{start:e},"variable anchor in a section header")),t}print(){return super.print(this.length===1?{pre:"[",post:`${u(this,fe)}]`}:{pre:"[",sep:u(this,fe),post:"]"})}};fe=new WeakMap});var ct,Un=b(()=>{"use strict";A();N();Ne();zr();_r();ct=class extends x{constructor(e,t,r,n=m.getConfig(),s=[]){super(void 0,n,s);f(this,"type","imagemap-link");this.append(e,t.length===2?new Ze(...t,n,s):new Xe(...t,n,s),new U(r,n,s))}}});var Vn={};W(Vn,{ImagemapToken:()=>Dr});var Dr,Zn=b(()=>{"use strict";P();Ce();A();N();Ne();Or();Un();Dr=class extends x{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","ext-inner");if(!e)return;let n=e.split(`
|
|
18
|
+
`),s=new Set(t.protocol.split("|")),a=U,o=!0,d=!1;for(let g of n){let p=g.trim();if(!(d||!p||p.startsWith("#"))){if(o){let[h,...c]=g.split("|"),T=this.normalizeTitle(h,0,!0);if(T.valid&&T.ns===6){let y=new Ve("imagemap",h,c.length>0?c.join("|"):void 0,t,r);super.insertAt(y),o=!1;continue}else d=!0}else if(g.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let h=g.indexOf("["),c=g.slice(h),T=/^\[{2}([^|]+)(?:\|([^\]]+))?\]{2}[\w\s]*$/u.exec(c);if(T){if(this.normalizeTitle(T[1],0,!0,!1,!0).valid){super.insertAt(new ct(g.slice(0,h),T.slice(1),c.slice(c.indexOf("]]")+2),t,r));continue}}else if(s.has(c.slice(1,c.indexOf(":")+1))||s.has(c.slice(1,c.indexOf("//")+2))){let y=/^\[([^\]\s]+)(?:(\s+(?=\S))([^\]]*))?\][\w\s]*$/u.exec(c);if(y){super.insertAt(new ct(g.slice(0,h),y.slice(1),c.slice(c.indexOf("]")+1),t,r));continue}}}}super.insertAt(new a(g,t,r))}}get image(){return this.childNodes.find(we("imagemap-image"))}toString(e){return super.toString(e,`
|
|
19
19
|
`)}text(){return super.text(`
|
|
20
20
|
`).replace(/\n{2,}/gu,`
|
|
21
|
-
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r={start:e,...this.getRootNode().posFromIndex(e)};return this.image?t.push(...this.childNodes.filter(n=>{let s=String(n).trim();return n.type==="noinclude"&&s&&!s.startsWith("#")}).map(n=>v(n,r,"invalid link in <imagemap>"))):t.push(
|
|
22
|
-
`})}}});var
|
|
23
|
-
|}`,t=!1){let r=this.getAttribute("config"),n=this.getAttribute("accum"),s=[e],a=
|
|
21
|
+
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r={start:e,...this.getRootNode().posFromIndex(e)};return this.image?t.push(...this.childNodes.filter(n=>{let s=String(n).trim();return n.type==="noinclude"&&s&&!s.startsWith("#")}).map(n=>v(n,r,"invalid link in <imagemap>"))):t.push(S(this,r,"<imagemap> without an image")),t}print(){return super.print({sep:`
|
|
22
|
+
`})}}});var Qn,De,Rr=b(()=>{"use strict";P();A();N();Sr();Nt();Qn=(l,i)=>{let e=new Set(l);return e.delete(i),[...e]},De=class extends Oe{constructor(e,t,r,n,s=m.getConfig(),a=[]){var h;let o=e.toLowerCase(),d=new ve(!t||t.trimStart()!==t?t:` ${t}`,"ext-attrs",o,s,a),g={...s,ext:Qn(s.ext,o),excludes:[...(h=s.excludes)!=null?h:[]]},p;switch(g.inExt=!0,o){case"tab":g.ext=Qn(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":o==="poem"&&g.excludes.push("heading"),p=new x(r,g,a);break;case"pre":{let{PreToken:c}=(wn(),R($n));p=new c(r,g,a);break}case"dynamicpagelist":{let{ParamTagToken:c}=(Cr(),R(Cn));p=new c(r,g,a);break}case"inputbox":{g.excludes.push("heading");let{InputboxToken:c}=(jn(),R(Gn));p=new c(r,g,a);break}case"references":{let{NestedToken:c}=(qt(),R(jt));p=new c(r,/<!--.*?(?:-->|$)|<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],g,a);break}case"choose":{let{NestedToken:c}=(qt(),R(jt));p=new c(r,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],g,a);break}case"combobox":{let{NestedToken:c}=(qt(),R(jt));p=new c(r,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],g,a);break}case"gallery":{let{GalleryToken:c}=(_n(),R(Wn));p=new c(r,g,a);break}case"imagemap":{let{ImagemapToken:c}=(Zn(),R(Vn));p=new c(r,g,a);break}default:{let{NowikiToken:c}=(vr(),R(Ar));p=new c(r,g)}}p.setAttribute("name",o),p.type="ext-inner";super(e,d,p,n,s,a);f(this,"type","ext")}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r;return this.name!=="nowiki"&&this.closest("html-attrs, table-attrs")&&(r={start:e,...this.getRootNode().posFromIndex(e)},t.push(S(this,r,"extension tag in HTML tag attributes"))),this.name==="ref"&&this.closest("heading-title")&&(r!=null||(r={start:e,...this.getRootNode().posFromIndex(e)}),t.push(S(this,r,"variable anchor in a section header"))),t}}});var Xn={};W(Xn,{parseCommentAndExt:()=>as});var as,Kn=b(()=>{"use strict";A();hn();Ne();mn();Rr();Ir();as=(l,i=m.getConfig(),e=[],t=!1)=>{let r="<onlyinclude>",n="</onlyinclude>",{length:s}=r,a=()=>{let h=l.indexOf(r);return{i:h,j:l.indexOf(n,h+s)}};if(t){let{i:h,j:c}=a();if(h!==-1&&c!==-1){let T="",y=F=>{new U(F,i,e),T+=`\0${e.length-1}c\x7F`};for(;h!==-1&&c!==-1;){let F=`\0${e.length}e\x7F`;new vt(l.slice(h+s,c),i,e),h>0&&y(l.slice(0,h)),T+=F,l=l.slice(c+s+1),{i:h,j:c}=a()}return l&&y(l),T}}let o=i.ext.join("|"),d=t?"includeonly":"(?:no|only)include",g=t?"noinclude":"includeonly",p=new RegExp(`<!--.*?(?:-->|$)|<${d}(?:\\s[^>]*)?>|</${d}\\s*>|<(${o})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|<(${g})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(${g}\\s*)>|$))`,"gisu");return l.replace(p,(h,c,T,y,F,q,L,C,I)=>{let B=`\0${e.length}${c?"e":"c"}\x7F`;if(c)new De(c,T,y,F,i,e);else if(h.startsWith("<!--")){let E=h.endsWith("-->");new _e(h.slice(4,E?-3:void 0),E,i,e)}else q?new St(q,L,C,I,i,e):new U(h,i,e);return B})}});var ls,ds,ps,Ke,ae,$e,Dt,Jn=b(()=>{"use strict";P();H();A();N();ls=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),ds=new Set(["b","big","center","cite","code","del","dfn","em","font","i","ins","kbd","mark","pre","q","s","samp","small","strike","strong","sub","sup","tt","u","var"]),ps=new Set(["strike","big","center","font","tt"]),Dt=class extends x{constructor(e,t,r,n,s=m.getConfig(),a=[]){super(void 0,s,a);f(this,"type","html");k(this,Ke,void 0);k(this,ae,void 0);k(this,$e,void 0);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),w(this,Ke,r),w(this,ae,n),w(this,$e,e)}get closing(){return u(this,Ke)}toString(e){return`<${this.closing?"/":""}${u(this,$e)}${super.toString()}${u(this,ae)?"/":""}>`}text(){let{closing:e,name:t}=this,r=`${u(this,$e)}${e?"":super.text()}`,{html:n}=this.getAttribute("config");return n[2].includes(t)?e&&t!=="br"?"":`<${r}>`:`<${e?"/":""}${r}${u(this,ae)&&n[1].includes(t)?"/":""}>`}getAttribute(e){return e==="padding"?u(this,$e).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){var n;let t=super.lint(e),r;this.name==="h1"&&!this.closing&&(r=S(this,{start:e},"<h1>"),t.push(r)),this.closest("table-attrs")&&(r!=null||(r=S(this,{start:e},"")),t.push({...r,message:m.msg("HTML tag in table attributes")}));try{this.findMatchingTag()}catch(s){if(s instanceof SyntaxError){let{message:a}=s;r!=null||(r=S(this,{start:e},""));let[o]=a.split(":"),d={...r,message:m.msg(o)};if(o==="unclosed tag"&&!this.closest("heading-title"))if(ds.has(this.name)){let g=(n=this.parentNode)==null?void 0:n.childNodes,p=g==null?void 0:g.indexOf(this);g!=null&&g.slice(0,p).some(({type:h,name:c})=>h==="html"&&c===this.name)||(d.severity="warning")}else d.severity="warning";else if(o==="unmatched closing tag"){let g=this.closest("magic-word");g&&ls.has(g.name)&&(d.severity="warning")}t.push(d)}}return ps.has(this.name)&&(r!=null||(r=S(this,{start:e},"")),t.push({...r,message:m.msg("obsolete HTML tag"),severity:"warning"})),(this.name==="b"||this.name==="strong")&&this.closest("heading-title")&&(r!=null||(r=S(this,{start:e},"")),t.push({...r,message:m.msg("bold in section header"),severity:"warning"})),t}findMatchingTag(){let{html:e}=this.getAttribute("config"),{name:t,parentNode:r,closing:n}=this,s=on(String(this));if(n&&(u(this,ae)||e[2].includes(t)))throw new SyntaxError(`tag that is both closing and self-closing: ${s}`);if(e[2].includes(t)||u(this,ae)&&e[1].includes(t))return this;if(u(this,ae)&&e[0].includes(t))throw new SyntaxError(`invalid self-closing tag: ${s}`);if(!r)return;let{childNodes:a}=r,o=a.indexOf(this),d=(n?a.slice(0,o).reverse():a.slice(o+1)).filter(p=>p.type==="html"&&p.name===t),g=n?-1:1;for(let p of d)if(u(p,Ke)?g--:g++,g===0)return p;throw new SyntaxError(`${n?"unmatched closing":"unclosed"} tag: ${s}`)}print(){let{closing:e,name:t}=this,{html:r}=this.getAttribute("config");return super.print({pre:`<${this.closing?"/":""}${u(this,$e)}`,post:`${u(this,ae)?"/":""}>`,class:e&&r[2].includes(t)&&t!=="br"?"html-invalid":"html"})}json(){return{...super.json(),closing:this.closing,selfClosing:u(this,ae)}}};Ke=new WeakMap,ae=new WeakMap,$e=new WeakMap});var Yn={};W(Yn,{parseHtml:()=>gs});var gs,ei=b(()=>{"use strict";A();Nt();Jn();gs=(l,i=m.getConfig(),e=[])=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,r=new Set(i.html.flat()),n=l.split("<"),s=n.shift();for(let a of n){let o=t.exec(a),d=o==null?void 0:o[2],g=d==null?void 0:d.toLowerCase();if(!o||!r.has(g)){s+=`<${a}`;continue}let[,p,,h="",c,T]=o,y=new ve(h,"html-attrs",g,i,e),F=y.getAttr("itemprop");if(g==="meta"&&(F===void 0||y.getAttr("content")===void 0)||g==="link"&&(F===void 0||y.getAttr("href")===void 0)){s+=`<${a}`,e.pop();continue}s+=`\0${e.length}x\x7F${T}`,new Dt(d,y,p==="/",c==="/>",i,e)}return s}});var Je,Hr=b(()=>{"use strict";A();N();ht();Nt();Je=class extends x{constructor(i,e,t,r=m.getConfig(),n=[],s={}){super(void 0,r,n,s),this.append(new he(e,i,"table-syntax",r,n,{}),new ve(t,"table-attrs",this.type,r,n))}}});var Ye,Ur=b(()=>{"use strict";P();Ce();Hr();Ye=class extends Je{lint(i=this.getAbsoluteIndex()){let e=super.lint(i),t=this.childNodes.find(({type:d})=>d==="table-inter");if(!t)return e;let r=t.childNodes.find(d=>d.text().trim()),n=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u,s=we("arg"),a=we("magic-word");if(!r||n.test(String(r))||s(r)&&n.test(r.default||""))return e;if(a(r))try{if(r.getPossibleValues().every(d=>n.test(d.text())))return e}catch(d){}let o=v(t,{start:i},"content to be moved out from the table");return e.push({...o,severity:r.type==="template"?"warning":"error",startIndex:o.startIndex+1,startLine:o.startLine+1,startCol:0}),e}}});var us,Ht,ti=b(()=>{"use strict";P();Ce();A();Ur();ht();us=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,Ht=class extends Ye{constructor(e,t,r=m.getConfig(),n=[]){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,t,r,n,{});f(this,"type","table")}get closed(){return this.lastChild.type==="table-syntax"}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);return this.closed||t.push(v(this.firstChild,{start:e},m.msg("unclosed $1","table"))),t}close(e=`
|
|
23
|
+
|}`,t=!1){let r=this.getAttribute("config"),n=this.getAttribute("accum"),s=[e],a=it.run(()=>super.insertAt(new he(void 0,us,"table-syntax",r,n,{})));this.lastChild.replaceChildren(...s)}json(){return{...super.json(),closed:this.closed}}}});var Ut,ri=b(()=>{"use strict";A();Ur();Ut=class extends Ye{constructor(e,t,r=m.getConfig(),n=[]){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,t,r,n,{});f(this,"type","tr")}}});var te,Zt,ni,Vt,ii=b(()=>{"use strict";P();de();A();N();Hr();Vt=class extends Je{constructor(e,t,r=m.getConfig(),n=[]){var d;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),a=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(a)&&(s=null,a="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,a,r,n);k(this,Zt);f(this,"type","td");k(this,te,"");s&&([bt(this,te)._]=s);let o=new x(t==null?void 0:t.slice(((d=s==null?void 0:s.index)!=null?d:NaN)+u(this,te).length),r,n);o.type="td-inner",o.setAttribute("stage",4),this.insertAt(o)}get subtype(){return $(this,Zt,ni).call(this).subtype}afterBuild(){u(this,te).includes("\0")&&w(this,te,this.buildFromStr(u(this,te),0))}toString(e){let{childNodes:[t,r,n]}=this;return`${t.toString()}${r.toString()}${u(this,te)}${n.toString()}`}text(){let{childNodes:[e,t,r]}=this;return`${e.text()}${t.text()}${u(this,te)}${r.text()}`}getGaps(e){return e===1?u(this,te).length:0}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);e+=this.getRelativeIndex(this.length-1);for(let r of this.lastChild.childNodes)if(r.type==="text"){let{data:n}=r;n.includes("|")&&t.push(v(r,{start:e},'additional "|" in a table cell',n.includes("||")?"error":"warning"))}return t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${u(this,te)}${r.print()}</span>`}json(){return{...super.json(),subtype:this.subtype}}};te=new WeakMap,Zt=new WeakSet,ni=function(){let e=this.firstChild.text(),t=e.slice(-1),r="td";return t==="!"?r="th":t==="+"&&(r="caption"),{subtype:r}}});var et,Vr=b(()=>{"use strict";ye();et=class extends Z{}});var tt,Zr=b(()=>{"use strict";Vr();tt=class extends et{constructor(){super(...arguments);f(this,"type","dd")}}});var si={};W(si,{parseTable:()=>ms});var hs,ms,oi=b(()=>{"use strict";A();N();ti();ri();ii();Zr();hs=l=>l.lastChild.constructor!==x,ms=({firstChild:{data:l},type:i,name:e},t=m.getConfig(),r=[])=>{let n=[],s=l.split(`
|
|
24
24
|
`),a=i==="root"||i==="parameter-value"||i==="ext-inner"&&e==="poem"?"":`
|
|
25
|
-
${s.shift()}`,o,d=(p,h)=>{if(!h){a+=p;return}let{lastChild:c}=h;if(
|
|
26
|
-
${h}${
|
|
25
|
+
${s.shift()}`,o,d=(p,h)=>{if(!h){a+=p;return}let{lastChild:c}=h;if(hs(h)){let T=new x(p,t,r);T.type="table-inter",T.setAttribute("stage",3),h.insertAt(T)}else c.setText(String(c)+p)},g=()=>o.type==="td"?n.pop():o;for(let p of s){o=n.pop();let[h]=/^(?:\s|\0\d+c\x7F)*/u.exec(p),c=p.slice(h.length),T=/^(:*)((?:\s|\0\d+c\x7F)*)(\{\||\{(?:\0\d+c\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(c);if(T){for(;o&&o.type!=="td";)o=n.pop();let[,I,B,E,O]=T;I&&new tt(I,t,r),d(`
|
|
26
|
+
${h}${I&&`\0${r.length-1}d\x7F`}${B}\0${r.length}b\x7F`,o),n.push(...o?[o]:[],new Ht(E,O,t,r));continue}else if(!o){a+=`
|
|
27
27
|
${p}`;continue}let y=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(c);if(!y){d(`
|
|
28
|
-
${p}`,o),n.push(o);continue}let[,
|
|
29
|
-
${h}${
|
|
30
|
-
${h}${q}`,C,t,r);n.push(o,
|
|
31
|
-
${h}${
|
|
32
|
-
-\uFFFD]*)\\]`,"giu");return l.replace(t,(r,n,s,a)=>{let{length:o}=e,d=/&[lg]t;/u.exec(n);return d&&(n=n.slice(0,d.index),s="",a=`${n.slice(d.index)}${s}${a}`),new
|
|
33
|
-
`);for(let n=0;n<t.length;n++)t[n]=e(t[n],u(this,j),u(this,
|
|
34
|
-
`))},
|
|
35
|
-
`),r=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;r<t.length;r++)t[r]=e(t[r],u(this,j),u(this,
|
|
36
|
-
`))},
|
|
28
|
+
${p}`,o),n.push(o);continue}let[,F,q,L,C]=y;if(F){for(;o.type!=="table";)o=n.pop();o.close(`
|
|
29
|
+
${h}${F}`,!0),d(C,n[n.length-1])}else if(q){o=g(),o.type==="tr"&&(o=n.pop());let I=new Ut(`
|
|
30
|
+
${h}${q}`,C,t,r);n.push(o,I),o.insertAt(I)}else{o=g();let I=L==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,B=I.exec(C),E=0,O=`
|
|
31
|
+
${h}${L}`,_=le=>{let ne=new Vt(O,C.slice(E,B==null?void 0:B.index),t,r);return le.insertAt(ne),ne};for(;B;)_(o),{lastIndex:E}=I,[O]=B,B=I.exec(C);n.push(o,_(o))}}return a.slice(1)}});var Qt,ai=b(()=>{"use strict";ye();Qt=class extends Z{constructor(){super(...arguments);f(this,"type","hr")}}});var Xt,li=b(()=>{"use strict";Be();A();ye();Xt=class extends ue(Z){constructor(e,t,r=m.getConfig(),n=[]){super(e,r,n);f(this,"type","double-underscore")}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}toString(e){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}}});var di={};W(di,{parseHrAndDoubleUnderscore:()=>cs});var cs,pi=b(()=>{"use strict";A();ai();li();Nr();cs=({firstChild:{data:l},type:i,name:e},t=m.getConfig(),r=[])=>{let{doubleUnderscore:n}=t,s=new Set(n[0]),a=new Set(n[1]);return i!=="root"&&(i!=="ext-inner"||e!=="poem")&&(l=`\0${l}`),l=l.replace(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(o,d,g)=>(new Qt(g,t,r),`${d}\0${r.length-1}r\x7F`)).replace(new RegExp(`__(${n.flat().join("|")})__`,"giu"),(o,d)=>{let g=a.has(d);return g||s.has(d.toLowerCase())?(new Xt(d,g,t,r),`\0${r.length-1}u\x7F`):o}).replace(/^((?:\0\d+c\x7F)*)(={1,6})(.+)\2((?:[^\S\n]|\0\d+c\x7F)*)$/gmu,(o,d,g,p,h)=>{let c=`${d}\0${r.length}h\x7F`;return new We(g.length,[p,h],t,r),c}),i==="root"||i==="ext-inner"&&e==="poem"?l:l.slice(1)}});var Kt,gi=b(()=>{"use strict";Bt();Kt=class extends Se{constructor(){super(...arguments);f(this,"type","category")}}});var Jt,ui=b(()=>{"use strict";P();A();ye();Jt=class extends Z{constructor(){super(...arguments);f(this,"type","quote")}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}lint(e=this.getAbsoluteIndex()){let{previousSibling:t,nextSibling:r,bold:n}=this,s=m.msg('lonely "$1"',"'"),a=[],o;if((t==null?void 0:t.type)==="text"&&t.data.endsWith("'")){o=S(this,{start:e},s);let{startIndex:d,startLine:g,startCol:p}=o,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(t.data),c=e-h;a.push({...o,startIndex:c,endIndex:d,startCol:p-h,endLine:g,endCol:p})}if((r==null?void 0:r.type)==="text"&&r.data.startsWith("'")){o!=null||(o=S(this,{start:e},s));let{endIndex:d,endLine:g,endCol:p}=o,[{length:h}]=/^'+/u.exec(r.data),c=d+h;a.push({...o,startIndex:d,endIndex:c,startLine:g,startCol:p,endCol:p+h})}return n&&this.closest("heading-title")&&(o!=null||(o=S(this,{start:e},s)),a.push({...o,message:m.msg("bold in section header"),severity:"warning"})),a}json(){return{...super.json(),bold:this.bold,italic:this.italic}}}});var Qr={};W(Qr,{parseQuotes:()=>fs});var fs,Xr=b(()=>{"use strict";A();ui();fs=(l,i=m.getConfig(),e=[])=>{var g;let t=l.split(/('{2,})/u),{length:r}=t;if(r===1)return l;let n=0,s=0,a,o,d;for(let p=1;p<r;p+=2){let{length:h}=t[p];switch(h){case 2:s++;break;case 4:t[p-1]+="'",t[p]="'''";case 3:if(n++,a!==void 0)break;t[p-1].endsWith(" ")?o===void 0&&d===void 0&&(d=p):t[p-1].slice(-2,-1)===" "?a=p:o!=null||(o=p);break;default:t[p-1]+="'".repeat(h-5),t[p]="'''''",s++,n++}}if(s%2===1&&n%2===1){let p=(g=a!=null?a:o)!=null?g:d;p!==void 0&&(t[p]="''",t[p-1]+="'")}for(let p=1;p<r;p+=2)new Jt(t[p],i,e),t[p]=`\0${e.length-1}q\x7F`;return t.join("")}});var mi={};W(mi,{parseLinks:()=>hi});var hi,ci=b(()=>{"use strict";A();zr();Br();gi();hi=(l,i=m.getConfig(),e=[])=>{let{parseQuotes:t}=(Xr(),R(Qr)),r=i.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,s=new RegExp(`^\\s*(?:${i.protocol}|//)`,"iu"),a=l.split("[["),o=a.shift();for(let d=0;d<a.length;d++){let g=!1,p,h,c,T,y=a[d],F=r.exec(y);if(F)[,p,h,c,T]=F,T.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",T=T.slice(1));else{let E=n.exec(y);E&&(g=!0,[,p,h,c]=E)}if(p===void 0||s.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){o+=`[[${y}`;continue}let q=p.trim().startsWith(":");if(q&&g){o+=`[[${y}`;continue}let L=m.normalizeTitle(p,0,!1,i,!0,!0,!0),{ns:C,valid:I}=L;if(I){if(g){if(C!==6){o+=`[[${y}`;continue}let E=!1;for(d++;d<a.length;d++){let O=a[d],_=O.split("]]");if(_.length>2){E=!0,c+=`[[${_[0]}]]${_[1]}`,T=_.slice(2).join("]]");break}else if(_.length===2)c+=`[[${_[0]}]]${_[1]}`;else{c+=`[[${O}`;break}}if(c=hi(c,i,e),!E){o+=`[[${p}${h}${c}`;continue}}}else{o+=`[[${y}`;continue}c&&(c=t(c,i,e)),o+=`\0${e.length}l\x7F${T}`;let B=Ze;q||(C===6?B=Ue:C===14&&(B=Kt)),c===void 0&&h&&(c=""),new B(p,c,i,e,h)}return o}});var fi={};W(fi,{parseExternalLinks:()=>Ts});var Ts,Ti=b(()=>{"use strict";H();A();_r();Ts=(l,i=m.getConfig(),e=[])=>{let t=new RegExp(`\\[((?:(?:${i.protocol}|//)${be}|\0\\d+m\x7F)${ke}(?=[[\\]<>"\\t\\p{Zs}]|\0\\d))(\\p{Zs}*(?=\\P{Zs}))([^\\]-\b
|
|
32
|
+
-\uFFFD]*)\\]`,"giu");return l.replace(t,(r,n,s,a)=>{let{length:o}=e,d=/&[lg]t;/u.exec(n);return d&&(n=n.slice(0,d.index),s="",a=`${n.slice(d.index)}${s}${a}`),new Xe(n,s,a,i,e),`\0${o}w\x7F`})}});var xi={};W(xi,{parseMagicLinks:()=>xs});var xs,bi=b(()=>{"use strict";H();A();Wr();xs=(l,i=m.getConfig(),e=[])=>{let t=new RegExp(`(^|[^\\p{L}\\d_])(?:${i.protocol})(${be}${ke})`,"giu");return l.replace(t,(r,n,s)=>{let a="",o=n?r.slice(1):r,d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(o);d&&(a=o.slice(d.index),o=o.slice(0,d.index));let g=new RegExp(`[,;.:!?${o.includes("(")?"":")"}]+$`,"u"),p=g.exec(o);if(p){let h=0;p[0].startsWith(";")&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(o.slice(0,p.index))&&(h=1),a=`${o.slice(p.index+h)}${a}`,o=o.slice(0,p.index+h)}return a.length>=s.length?r:(new Qe(o,!1,i,e),`${n}\0${e.length-1}w\x7F${a}`)})}});var Yt,ki=b(()=>{"use strict";Vr();Yt=class extends et{constructor(){super(...arguments);f(this,"type","list")}}});var yi={};W(yi,{parseList:()=>bs});var bs,Ai=b(()=>{"use strict";A();ki();Zr();bs=(l,i=m.getConfig(),e=[])=>{let t=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(l);if(!t)return l;let[r,n,s]=t,a=`${n}\0${e.length}d\x7F${l.slice(r.length)}`,o=s.split(";").length-1;if(new Yt(s,i,e),!o)return a;let d=/:+|-\{/gu,g=d.exec(a),p=0,h=(c,T)=>(new tt(c,i,e),`${a.slice(0,T)}\0${e.length-1}d\x7F${a.slice(T+c.length)}`);for(;g&&o;){let{0:c,index:T}=g;if(c.startsWith(":")){if(c.length>=o)return h(c.slice(0,o),T);o-=c.length,d.lastIndex=T+4+String(e.length).length,a=h(c,T)}else if(c==="-{"){if(!p){let{lastIndex:y}=d;d=/-\{|\}-/gu,d.lastIndex=y}p++}else if(p--,!p){let{lastIndex:y}=d;d=/:+|-\{/gu,d.lastIndex=y}g=d.exec(a)}return a}});var vi,Si=b(()=>{"use strict";vi=l=>{class i extends l{}return i}});var ks,Te,er,$i=b(()=>{"use strict";P();A();N();ce();ks=new Set(["A","T","R","D","-","H","N"]),er=class extends x{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","converter-flags");k(this,Te,void 0);this.append(...e.map(n=>new G(n,"converter-flag",t,r)))}afterBuild(){w(this,Te,this.childNodes.map(e=>e.text().trim()))}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(u(this,Te).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,Te).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex()){let t=this.getVariantFlags(),r=this.getUnknownFlags(),n=new Set(u(this,Te).filter(h=>ks.has(h))),{length:s}=u(this,Te).filter(h=>!h),a=u(this,Te).length-r.size-s,o=super.lint(e);if(t.size===a||n.size===a)return o;let d={start:e,...this.getRootNode().posFromIndex(e)},{childNodes:g,length:p}=this;for(let h=0;h<p;h++){let c=g[h],T=c.text().trim();T&&!t.has(T)&&!r.has(T)&&(t.size>0||!n.has(T))&&o.push(v(c,d,"invalid conversion flag"))}return o}print(){return super.print({sep:";"})}};Te=new WeakMap});var rt,wi=b(()=>{"use strict";A();N();ce();rt=class extends x{constructor(e,t=!0,r=m.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter-rule");let s=e.indexOf(":"),a=e.slice(0,s).indexOf("=>"),o=a===-1?e.slice(0,s):e.slice(a+2,s);t&&r.variants.includes(o.trim())?(super.insertAt(new G(o,"converter-rule-variant",r,n)),super.insertAt(new G(e.slice(s+1),"converter-rule-to",r,n)),a!==-1&&super.insertAt(new G(e.slice(0,a),"converter-rule-from",r,n),0)):super.insertAt(new G(e,"converter-rule-to",r,n))}toString(e){let{childNodes:t}=this;if(t.length===3){let[r,n,s]=t;return`${r.toString(e)}=>${n.toString(e)}:${s.toString(e)}`}return super.toString(e,":")}text(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${t.text()}=>${r.text()}:${n.text()}`}return super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${r.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var tr,Ci=b(()=>{"use strict";H();Si();A();N();$i();wi();tr=class extends vi(x){constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter");this.append(new er(e,r,n));let[s]=t,a=s.includes(":"),o=new rt(s,a,r,n);a&&o.length===1?this.insertAt(new rt(t.join(";"),!1,r,n)):this.append(o,...t.slice(1).map(d=>new rt(d,!0,r,n)))}toString(e){let{childNodes:[t,...r]}=this;return`-{${t.toString()}${t.length>0?"|":""}${r.map(n=>n.toString()).join(";")}}-`}text(){let{childNodes:[e,...t]}=this;return`-{${e.text()}|${pe(t,";")}}-`}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}getGaps(e){return e||this.firstChild.length>0?1:0}print(){let{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${ge(t,{sep:";"})}}-</span>`}}});var Ni={};W(Ni,{parseConverter:()=>ys});var ys,Fi=b(()=>{"use strict";A();Ci();ys=(l,i=m.getConfig(),e=[])=>{let t=/-\{/gu,r=/-\{|\}-/gu,n=[],s=t,a=s.exec(l);for(;a;){let{0:o,index:d}=a;if(o==="}-"){let g=n.pop(),{length:p}=e,h=l.slice(g.index+2,d),c=h.indexOf("|"),[T,y]=c===-1?[[],h]:[h.slice(0,c).split(";"),h.slice(c+1)],F=y.replace(/(&[#a-z\d]+);/giu,"$1"),q=`(?:${i.variants.join("|")})`,L=F.split(new RegExp(`;(?=(?:[^;]*?=>)?\\s*${q}\\s*:|(?:\\s|\0\\d+c\x7F)*$)`,"u")).map(C=>C.replace(/\x01/gu,";"));new tr(T,L,i,e),l=`${l.slice(0,g.index)}\0${p}v\x7F${l.slice(d+2)}`,n.length===0&&(s=t),s.lastIndex=g.index+3+String(p).length}else n.push(a),s=r,s.lastIndex=d+2;a=s.exec(l)}return l}});var Jr={};W(Jr,{Token:()=>x});var re,j,M,Pe,ft,Kr,rr,Li,nr,Ei,ir,Ii,sr,Pi,or,Ri,ar,Gi,lr,ji,dr,qi,pr,Bi,gr,Oi,ur,Mi,Yr,x,N=b(()=>{"use strict";H();de();A();dn();un();Yr=class Yr extends yt{constructor(e,t=m.getConfig(),r=[],n){super();k(this,ft);k(this,rr);k(this,nr);k(this,ir);k(this,sr);k(this,or);k(this,ar);k(this,lr);k(this,dr);k(this,pr);k(this,gr);k(this,ur);f(this,"type","root");k(this,re,0);k(this,j,void 0);k(this,M,void 0);k(this,Pe,void 0);typeof e=="string"&&this.insertAt(e),w(this,j,t),w(this,M,r),r.push(this)}parseOnce(e=u(this,re),t=!1){if(e<u(this,re)||!this.getAttribute("plain")||this.length===0)return this;if(u(this,re)>=11)return this;switch(e){case 0:this.type==="root"&&u(this,M).shift(),w(this,Pe,t),$(this,rr,Li).call(this,t);break;case 1:$(this,nr,Ei).call(this);break;case 2:$(this,ir,Ii).call(this);break;case 3:$(this,sr,Pi).call(this);break;case 4:$(this,or,Ri).call(this);break;case 5:$(this,ar,Gi).call(this);break;case 6:$(this,lr,ji).call(this);break;case 7:$(this,dr,qi).call(this);break;case 8:$(this,pr,Bi).call(this);break;case 9:$(this,gr,Oi).call(this);break;case 10:$(this,ur,Mi).call(this)}if(this.type==="root")for(let r of u(this,M))r.parseOnce(e,t);return bt(this,re)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((n,s)=>{if(s%2===0)return new pt(n);if(Number.isNaN(Number(n.slice(-1))))return u(this,M)[Number(n.slice(0,-1))];throw new Error(`\u89E3\u6790\u9519\u8BEF\uFF01\u672A\u6B63\u786E\u6807\u8BB0\u7684 Token\uFF1A${n}`)});return t===0?r.map(String).join(""):t===1?pe(r):r}afterBuild(){if(this.type==="root")for(let e of u(this,M))e.afterBuild()}parse(e=11,t=!1){for(e=Math.min(e,11);u(this,re)<e;)this.parseOnce(u(this,re),t);return e&&($(this,ft,Kr).call(this),this.afterBuild()),this}getAttribute(e){switch(e){case"plain":return this.constructor===Yr;case"config":return JSON.parse(JSON.stringify(u(this,j)));case"accum":return u(this,M);case"include":{if(u(this,Pe)!==void 0)return u(this,Pe);let t=this.getRootNode();return t!==this&&t.getAttribute("include")}default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":u(this,re)===0&&this.type==="root"&&u(this,M).shift(),w(this,re,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new pt(e):e;return super.insertAt(r,t),r.type==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r=!1,n=!1,s=!1){return m.normalizeTitle(e,t,u(this,Pe),u(this,j),r,n,s)}};re=new WeakMap,j=new WeakMap,M=new WeakMap,Pe=new WeakMap,ft=new WeakSet,Kr=function(){var n;w(this,re,11);let{length:e,firstChild:t}=this,r=String(t);if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let s of u(this,M))$(n=s,ft,Kr).call(n)},rr=new WeakSet,Li=function(e){let{parseCommentAndExt:t}=(Kn(),R(Xn));this.setText(t(String(this.firstChild),u(this,j),u(this,M),e))},nr=new WeakSet,Ei=function(){let{parseBraces:e}=(Lr(),R(Rn)),t=this.type==="root"?String(this.firstChild):`\0${String(this.firstChild)}`,r=e(t,u(this,j),u(this,M));this.setText(this.type==="root"?r:r.slice(1))},ir=new WeakSet,Ii=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(ei(),R(Yn));this.setText(e(String(this.firstChild),u(this,j),u(this,M)))},sr=new WeakSet,Pi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(oi(),R(si));this.setText(e(this,u(this,j),u(this,M)))},or=new WeakSet,Ri=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(pi(),R(di));this.setText(e(this,u(this,j),u(this,M)))},ar=new WeakSet,Gi=function(){let{parseLinks:e}=(ci(),R(mi));this.setText(e(String(this.firstChild),u(this,j),u(this,M)))},lr=new WeakSet,ji=function(){var r;if((r=u(this,j).excludes)!=null&&r.includes("quote"))return;let{parseQuotes:e}=(Xr(),R(Qr)),t=String(this.firstChild).split(`
|
|
33
|
+
`);for(let n=0;n<t.length;n++)t[n]=e(t[n],u(this,j),u(this,M));this.setText(t.join(`
|
|
34
|
+
`))},dr=new WeakSet,qi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(Ti(),R(fi));this.setText(e(String(this.firstChild),u(this,j),u(this,M)))},pr=new WeakSet,Bi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(bi(),R(xi));this.setText(e(String(this.firstChild),u(this,j),u(this,M)))},gr=new WeakSet,Oi=function(){var n;if((n=u(this,j).excludes)!=null&&n.includes("list"))return;let{parseList:e}=(Ai(),R(yi)),t=String(this.firstChild).split(`
|
|
35
|
+
`),r=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;r<t.length;r++)t[r]=e(t[r],u(this,j),u(this,M));this.setText(t.join(`
|
|
36
|
+
`))},ur=new WeakSet,Mi=function(){if(u(this,j).variants.length>0){let{parseConverter:e}=(Fi(),R(Ni));this.setText(e(String(this.firstChild),u(this,j),u(this,M)))}};x=Yr});var Re,zi,As,m,A=b(()=>{Ce();de();H();Re={i18n:void 0,getConfig(){return{...rn,...this.config,excludes:[]}},msg(l,i=""){var e,t;return l&&((t=(e=this.i18n)==null?void 0:e[l])!=null?t:l).replace("$1",this.msg(i))},normalizeTitle(l,i=0,e=!1,t=Re.getConfig(),r=!1,n=!1,s=!1){let{Title:a}=(ln(),R(an));if(r)return new a(l,i,t,n,s);let{Token:o}=(N(),R(Jr)),d=it.run(()=>new o(l,t).parseOnce(0,e).parseOnce());return new a(String(d),i,t,n,s)},parse(l,i,e=11,t=Re.getConfig()){l=nn(l);let{Token:r}=(N(),R(Jr));return it.run(()=>new r(l,t).parse(e,i))}},zi={},As=new Set(["normalizeTitle","parse"]);for(let l in Re)As.has(l)||(zi[l]={enumerable:!1});Object.defineProperties(Re,zi);typeof self=="object"?Object.assign(self,{Parser:Re}):typeof globalThis=="object"&&Object.assign(globalThis,{Parser:Re});m=Re});A();})();
|
package/config/default.json
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"mapframe",
|
|
32
32
|
"maplink",
|
|
33
33
|
"math",
|
|
34
|
+
"phonos",
|
|
34
35
|
"quiz",
|
|
35
36
|
"section",
|
|
36
37
|
"source",
|
|
@@ -139,6 +140,10 @@
|
|
|
139
140
|
"711": "TimedText talk",
|
|
140
141
|
"828": "Module",
|
|
141
142
|
"829": "Module talk",
|
|
143
|
+
"2300": "Gadget",
|
|
144
|
+
"2301": "Gadget talk",
|
|
145
|
+
"2302": "Gadget definition",
|
|
146
|
+
"2303": "Gadget definition talk",
|
|
142
147
|
"2600": "Topic"
|
|
143
148
|
},
|
|
144
149
|
"nsid": {
|
|
@@ -295,7 +300,11 @@
|
|
|
295
300
|
"模組討論": 829,
|
|
296
301
|
"模组对话": 829,
|
|
297
302
|
"模组讨论": 829,
|
|
298
|
-
"モジュール・トーク": 829
|
|
303
|
+
"モジュール・トーク": 829,
|
|
304
|
+
"gadget": 2300,
|
|
305
|
+
"gadget talk": 2301,
|
|
306
|
+
"gadget definition": 2302,
|
|
307
|
+
"gadget definition talk": 2303
|
|
299
308
|
},
|
|
300
309
|
"parserFunction": [
|
|
301
310
|
{
|
|
@@ -414,6 +423,7 @@
|
|
|
414
423
|
"#rel2abs": "rel2abs",
|
|
415
424
|
"#标题组成部分": "titleparts",
|
|
416
425
|
"#titleparts": "titleparts",
|
|
426
|
+
"pendingchangelevel": "pendingchangelevel",
|
|
417
427
|
"#categorytree": "categorytree",
|
|
418
428
|
"#分類樹": "categorytree",
|
|
419
429
|
"#分类树": "categorytree",
|
|
@@ -463,6 +473,7 @@
|
|
|
463
473
|
"#lst": "lst",
|
|
464
474
|
"#lsth": "lsth",
|
|
465
475
|
"#lstx": "lstx",
|
|
476
|
+
"#assessment": "assessment",
|
|
466
477
|
"#mentor": "mentor",
|
|
467
478
|
"#property": "property",
|
|
468
479
|
"#屬性": "property",
|
|
@@ -606,6 +617,7 @@
|
|
|
606
617
|
"显示标题",
|
|
607
618
|
"顯示標題",
|
|
608
619
|
"DISPLAYTITLE",
|
|
620
|
+
"SHORTDESC",
|
|
609
621
|
"!",
|
|
610
622
|
"本月",
|
|
611
623
|
"本月2",
|
|
@@ -729,7 +741,9 @@
|
|
|
729
741
|
"無目錄",
|
|
730
742
|
"toc",
|
|
731
743
|
"目录",
|
|
732
|
-
"目錄"
|
|
744
|
+
"目錄",
|
|
745
|
+
"archivedtalk",
|
|
746
|
+
"notalk"
|
|
733
747
|
],
|
|
734
748
|
[
|
|
735
749
|
"EXPECTUNUSEDCATEGORY",
|
|
@@ -816,7 +830,8 @@
|
|
|
816
830
|
"page=$1": "page",
|
|
817
831
|
"page $1": "page",
|
|
818
832
|
"页数=$1": "page",
|
|
819
|
-
"$1页": "page"
|
|
833
|
+
"$1页": "page",
|
|
834
|
+
"lossy=$1": "lossy"
|
|
820
835
|
},
|
|
821
836
|
"variants": [
|
|
822
837
|
"zh",
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ext": [
|
|
3
|
+
"nowiki",
|
|
4
|
+
"pre",
|
|
5
|
+
"gallery",
|
|
6
|
+
"indicator",
|
|
7
|
+
"poem",
|
|
8
|
+
"ref",
|
|
9
|
+
"references",
|
|
10
|
+
"categorytree",
|
|
11
|
+
"charinsert",
|
|
12
|
+
"imagemap",
|
|
13
|
+
"inputbox",
|
|
14
|
+
"templatestyles",
|
|
15
|
+
"score",
|
|
16
|
+
"ce",
|
|
17
|
+
"chem",
|
|
18
|
+
"graph",
|
|
19
|
+
"hiero",
|
|
20
|
+
"langconvert",
|
|
21
|
+
"mapframe",
|
|
22
|
+
"maplink",
|
|
23
|
+
"math",
|
|
24
|
+
"phonos",
|
|
25
|
+
"section",
|
|
26
|
+
"source",
|
|
27
|
+
"syntaxhighlight",
|
|
28
|
+
"templatedata",
|
|
29
|
+
"timeline"
|
|
30
|
+
],
|
|
31
|
+
"html": [
|
|
32
|
+
[
|
|
33
|
+
"b",
|
|
34
|
+
"bdi",
|
|
35
|
+
"del",
|
|
36
|
+
"i",
|
|
37
|
+
"ins",
|
|
38
|
+
"u",
|
|
39
|
+
"font",
|
|
40
|
+
"big",
|
|
41
|
+
"small",
|
|
42
|
+
"sub",
|
|
43
|
+
"sup",
|
|
44
|
+
"h1",
|
|
45
|
+
"h2",
|
|
46
|
+
"h3",
|
|
47
|
+
"h4",
|
|
48
|
+
"h5",
|
|
49
|
+
"h6",
|
|
50
|
+
"cite",
|
|
51
|
+
"code",
|
|
52
|
+
"em",
|
|
53
|
+
"s",
|
|
54
|
+
"strike",
|
|
55
|
+
"strong",
|
|
56
|
+
"tt",
|
|
57
|
+
"var",
|
|
58
|
+
"div",
|
|
59
|
+
"center",
|
|
60
|
+
"blockquote",
|
|
61
|
+
"ol",
|
|
62
|
+
"ul",
|
|
63
|
+
"dl",
|
|
64
|
+
"table",
|
|
65
|
+
"caption",
|
|
66
|
+
"pre",
|
|
67
|
+
"ruby",
|
|
68
|
+
"rb",
|
|
69
|
+
"rp",
|
|
70
|
+
"rt",
|
|
71
|
+
"rtc",
|
|
72
|
+
"p",
|
|
73
|
+
"span",
|
|
74
|
+
"abbr",
|
|
75
|
+
"dfn",
|
|
76
|
+
"kbd",
|
|
77
|
+
"samp",
|
|
78
|
+
"data",
|
|
79
|
+
"time",
|
|
80
|
+
"mark",
|
|
81
|
+
"tr",
|
|
82
|
+
"td",
|
|
83
|
+
"th",
|
|
84
|
+
"q",
|
|
85
|
+
"bdo"
|
|
86
|
+
],
|
|
87
|
+
[
|
|
88
|
+
"li",
|
|
89
|
+
"dt",
|
|
90
|
+
"dd"
|
|
91
|
+
],
|
|
92
|
+
[
|
|
93
|
+
"br",
|
|
94
|
+
"wbr",
|
|
95
|
+
"hr",
|
|
96
|
+
"meta",
|
|
97
|
+
"link"
|
|
98
|
+
]
|
|
99
|
+
],
|
|
100
|
+
"namespaces": {
|
|
101
|
+
"-2": "Media",
|
|
102
|
+
"-1": "Special",
|
|
103
|
+
"0": "",
|
|
104
|
+
"1": "Talk",
|
|
105
|
+
"2": "User",
|
|
106
|
+
"3": "User talk",
|
|
107
|
+
"4": "Project",
|
|
108
|
+
"5": "Project talk",
|
|
109
|
+
"6": "File",
|
|
110
|
+
"7": "File talk",
|
|
111
|
+
"8": "MediaWiki",
|
|
112
|
+
"9": "MediaWiki talk",
|
|
113
|
+
"10": "Template",
|
|
114
|
+
"11": "Template talk",
|
|
115
|
+
"12": "Help",
|
|
116
|
+
"13": "Help talk",
|
|
117
|
+
"14": "Category",
|
|
118
|
+
"15": "Category talk",
|
|
119
|
+
"100": "Portal",
|
|
120
|
+
"101": "Portal talk",
|
|
121
|
+
"118": "Draft",
|
|
122
|
+
"119": "Draft talk",
|
|
123
|
+
"710": "TimedText",
|
|
124
|
+
"711": "TimedText talk",
|
|
125
|
+
"828": "Module",
|
|
126
|
+
"829": "Module talk",
|
|
127
|
+
"2300": "Gadget",
|
|
128
|
+
"2301": "Gadget talk",
|
|
129
|
+
"2302": "Gadget definition",
|
|
130
|
+
"2303": "Gadget definition talk"
|
|
131
|
+
},
|
|
132
|
+
"nsid": {
|
|
133
|
+
"": 0,
|
|
134
|
+
"media": -2,
|
|
135
|
+
"special": -1,
|
|
136
|
+
"talk": 1,
|
|
137
|
+
"user": 2,
|
|
138
|
+
"user talk": 3,
|
|
139
|
+
"wp": 4,
|
|
140
|
+
"wikipedia": 4,
|
|
141
|
+
"project": 4,
|
|
142
|
+
"wt": 5,
|
|
143
|
+
"wikipedia talk": 5,
|
|
144
|
+
"project talk": 5,
|
|
145
|
+
"file": 6,
|
|
146
|
+
"image": 6,
|
|
147
|
+
"file talk": 7,
|
|
148
|
+
"image talk": 7,
|
|
149
|
+
"mediawiki": 8,
|
|
150
|
+
"mediawiki talk": 9,
|
|
151
|
+
"template": 10,
|
|
152
|
+
"template talk": 11,
|
|
153
|
+
"help": 12,
|
|
154
|
+
"help talk": 13,
|
|
155
|
+
"category": 14,
|
|
156
|
+
"category talk": 15,
|
|
157
|
+
"portal": 100,
|
|
158
|
+
"portal talk": 101,
|
|
159
|
+
"draft": 118,
|
|
160
|
+
"draft talk": 119,
|
|
161
|
+
"timedtext": 710,
|
|
162
|
+
"timedtext talk": 711,
|
|
163
|
+
"module": 828,
|
|
164
|
+
"module talk": 829,
|
|
165
|
+
"gadget": 2300,
|
|
166
|
+
"gadget talk": 2301,
|
|
167
|
+
"gadget definition": 2302,
|
|
168
|
+
"gadget definition talk": 2303
|
|
169
|
+
},
|
|
170
|
+
"parserFunction": [
|
|
171
|
+
{
|
|
172
|
+
"ns": "ns",
|
|
173
|
+
"nse": "nse",
|
|
174
|
+
"urlencode": "urlencode",
|
|
175
|
+
"lcfirst": "lcfirst",
|
|
176
|
+
"ucfirst": "ucfirst",
|
|
177
|
+
"lc": "lc",
|
|
178
|
+
"uc": "uc",
|
|
179
|
+
"localurl": "localurl",
|
|
180
|
+
"localurle": "localurle",
|
|
181
|
+
"fullurl": "fullurl",
|
|
182
|
+
"fullurle": "fullurle",
|
|
183
|
+
"canonicalurl": "canonicalurl",
|
|
184
|
+
"canonicalurle": "canonicalurle",
|
|
185
|
+
"formatnum": "formatnum",
|
|
186
|
+
"grammar": "grammar",
|
|
187
|
+
"gender": "gender",
|
|
188
|
+
"plural": "plural",
|
|
189
|
+
"bidi": "bidi",
|
|
190
|
+
"#language": "language",
|
|
191
|
+
"padleft": "padleft",
|
|
192
|
+
"padright": "padright",
|
|
193
|
+
"anchorencode": "anchorencode",
|
|
194
|
+
"filepath": "filepath",
|
|
195
|
+
"pageid": "pageid",
|
|
196
|
+
"int": "int",
|
|
197
|
+
"#special": "special",
|
|
198
|
+
"#speciale": "speciale",
|
|
199
|
+
"#tag": "tag",
|
|
200
|
+
"#formatdate": "formatdate",
|
|
201
|
+
"#dateformat": "formatdate",
|
|
202
|
+
"#invoke": "invoke",
|
|
203
|
+
"#if": "if",
|
|
204
|
+
"#ifeq": "ifeq",
|
|
205
|
+
"#switch": "switch",
|
|
206
|
+
"#ifexist": "ifexist",
|
|
207
|
+
"#ifexpr": "ifexpr",
|
|
208
|
+
"#iferror": "iferror",
|
|
209
|
+
"#time": "time",
|
|
210
|
+
"#timel": "timel",
|
|
211
|
+
"#expr": "expr",
|
|
212
|
+
"#rel2abs": "rel2abs",
|
|
213
|
+
"#titleparts": "titleparts",
|
|
214
|
+
"pendingchangelevel": "pendingchangelevel",
|
|
215
|
+
"#categorytree": "categorytree",
|
|
216
|
+
"articlepath": "articlepath",
|
|
217
|
+
"server": "server",
|
|
218
|
+
"servername": "servername",
|
|
219
|
+
"scriptpath": "scriptpath",
|
|
220
|
+
"stylepath": "stylepath",
|
|
221
|
+
"msgnw": "msgnw",
|
|
222
|
+
"#related": "related",
|
|
223
|
+
"#babel": "babel",
|
|
224
|
+
"#commaseparatedlist": "commaseparatedlist",
|
|
225
|
+
"#coordinates": "coordinates",
|
|
226
|
+
"#lst": "lst",
|
|
227
|
+
"#lsth": "lsth",
|
|
228
|
+
"#lstx": "lstx",
|
|
229
|
+
"#assessment": "assessment",
|
|
230
|
+
"#mentor": "mentor",
|
|
231
|
+
"#property": "property",
|
|
232
|
+
"#target": "target",
|
|
233
|
+
"#section": "section",
|
|
234
|
+
"#section-x": "section-x",
|
|
235
|
+
"#section-h": "section-h",
|
|
236
|
+
"noexternallanglinks": "noexternallanglinks",
|
|
237
|
+
"#statements": "statements",
|
|
238
|
+
"numberofwikis": "numberofwikis",
|
|
239
|
+
"wbreponame": "wbreponame"
|
|
240
|
+
},
|
|
241
|
+
[
|
|
242
|
+
"NUMBEROFPAGES",
|
|
243
|
+
"NUMBEROFUSERS",
|
|
244
|
+
"NUMBEROFACTIVEUSERS",
|
|
245
|
+
"NUMBEROFARTICLES",
|
|
246
|
+
"NUMBEROFFILES",
|
|
247
|
+
"NUMBEROFADMINS",
|
|
248
|
+
"NUMBERINGROUP",
|
|
249
|
+
"NUMINGROUP",
|
|
250
|
+
"NUMBEROFEDITS",
|
|
251
|
+
"DEFAULTSORT",
|
|
252
|
+
"DEFAULTSORTKEY",
|
|
253
|
+
"DEFAULTCATEGORYSORT",
|
|
254
|
+
"PAGESINCATEGORY",
|
|
255
|
+
"PAGESINCAT",
|
|
256
|
+
"PAGESIZE",
|
|
257
|
+
"PROTECTIONLEVEL",
|
|
258
|
+
"PROTECTIONEXPIRY",
|
|
259
|
+
"NAMESPACEE",
|
|
260
|
+
"NAMESPACENUMBER",
|
|
261
|
+
"TALKSPACE",
|
|
262
|
+
"TALKSPACEE",
|
|
263
|
+
"SUBJECTSPACE",
|
|
264
|
+
"ARTICLESPACE",
|
|
265
|
+
"SUBJECTSPACEE",
|
|
266
|
+
"ARTICLESPACEE",
|
|
267
|
+
"PAGENAME",
|
|
268
|
+
"PAGENAMEE",
|
|
269
|
+
"FULLPAGENAME",
|
|
270
|
+
"FULLPAGENAMEE",
|
|
271
|
+
"ROOTPAGENAME",
|
|
272
|
+
"ROOTPAGENAMEE",
|
|
273
|
+
"BASEPAGENAME",
|
|
274
|
+
"BASEPAGENAMEE",
|
|
275
|
+
"SUBPAGENAME",
|
|
276
|
+
"SUBPAGENAMEE",
|
|
277
|
+
"TALKPAGENAME",
|
|
278
|
+
"TALKPAGENAMEE",
|
|
279
|
+
"SUBJECTPAGENAME",
|
|
280
|
+
"ARTICLEPAGENAME",
|
|
281
|
+
"SUBJECTPAGENAMEE",
|
|
282
|
+
"ARTICLEPAGENAMEE",
|
|
283
|
+
"REVISIONID",
|
|
284
|
+
"REVISIONDAY",
|
|
285
|
+
"REVISIONDAY2",
|
|
286
|
+
"REVISIONMONTH",
|
|
287
|
+
"REVISIONMONTH1",
|
|
288
|
+
"REVISIONYEAR",
|
|
289
|
+
"REVISIONTIMESTAMP",
|
|
290
|
+
"REVISIONUSER",
|
|
291
|
+
"CASCADINGSOURCES",
|
|
292
|
+
"NAMESPACE",
|
|
293
|
+
"DISPLAYTITLE",
|
|
294
|
+
"SHORTDESC",
|
|
295
|
+
"!",
|
|
296
|
+
"CURRENTMONTH",
|
|
297
|
+
"CURRENTMONTH2",
|
|
298
|
+
"CURRENTMONTH1",
|
|
299
|
+
"CURRENTMONTHNAME",
|
|
300
|
+
"CURRENTMONTHNAMEGEN",
|
|
301
|
+
"CURRENTMONTHABBREV",
|
|
302
|
+
"CURRENTDAY",
|
|
303
|
+
"CURRENTDAY2",
|
|
304
|
+
"CURRENTDAYNAME",
|
|
305
|
+
"CURRENTYEAR",
|
|
306
|
+
"CURRENTTIME",
|
|
307
|
+
"CURRENTHOUR",
|
|
308
|
+
"LOCALMONTH",
|
|
309
|
+
"LOCALMONTH2",
|
|
310
|
+
"LOCALMONTH1",
|
|
311
|
+
"LOCALMONTHNAME",
|
|
312
|
+
"LOCALMONTHNAMEGEN",
|
|
313
|
+
"LOCALMONTHABBREV",
|
|
314
|
+
"LOCALDAY",
|
|
315
|
+
"LOCALDAY2",
|
|
316
|
+
"LOCALDAYNAME",
|
|
317
|
+
"LOCALYEAR",
|
|
318
|
+
"LOCALTIME",
|
|
319
|
+
"LOCALHOUR",
|
|
320
|
+
"SITENAME",
|
|
321
|
+
"CURRENTWEEK",
|
|
322
|
+
"CURRENTDOW",
|
|
323
|
+
"LOCALWEEK",
|
|
324
|
+
"LOCALDOW",
|
|
325
|
+
"REVISIONSIZE",
|
|
326
|
+
"CURRENTVERSION",
|
|
327
|
+
"CURRENTTIMESTAMP",
|
|
328
|
+
"LOCALTIMESTAMP",
|
|
329
|
+
"DIRECTIONMARK",
|
|
330
|
+
"DIRMARK",
|
|
331
|
+
"CONTENTLANGUAGE",
|
|
332
|
+
"CONTENTLANG",
|
|
333
|
+
"PAGELANGUAGE",
|
|
334
|
+
"="
|
|
335
|
+
],
|
|
336
|
+
[
|
|
337
|
+
"msg",
|
|
338
|
+
"raw"
|
|
339
|
+
],
|
|
340
|
+
[
|
|
341
|
+
"subst",
|
|
342
|
+
"safesubst"
|
|
343
|
+
]
|
|
344
|
+
],
|
|
345
|
+
"doubleUnderscore": [
|
|
346
|
+
[
|
|
347
|
+
"forcetoc",
|
|
348
|
+
"nocc",
|
|
349
|
+
"nocontentconvert",
|
|
350
|
+
"noeditsection",
|
|
351
|
+
"nogallery",
|
|
352
|
+
"notc",
|
|
353
|
+
"notitleconvert",
|
|
354
|
+
"notoc",
|
|
355
|
+
"toc",
|
|
356
|
+
"archivedtalk",
|
|
357
|
+
"notalk"
|
|
358
|
+
],
|
|
359
|
+
[
|
|
360
|
+
"EXPECTUNUSEDCATEGORY",
|
|
361
|
+
"DISAMBIG",
|
|
362
|
+
"HIDDENCAT",
|
|
363
|
+
"INDEX",
|
|
364
|
+
"NEWSECTIONLINK",
|
|
365
|
+
"NOINDEX",
|
|
366
|
+
"NONEWSECTIONLINK",
|
|
367
|
+
"STATICREDIRECT",
|
|
368
|
+
"NOGLOBAL",
|
|
369
|
+
"EXPECTED_UNCONNECTED_PAGE"
|
|
370
|
+
]
|
|
371
|
+
],
|
|
372
|
+
"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:",
|
|
373
|
+
"interwiki": [],
|
|
374
|
+
"img": {
|
|
375
|
+
"thumbnail": "thumbnail",
|
|
376
|
+
"thumb": "thumbnail",
|
|
377
|
+
"thumbnail=$1": "manualthumb",
|
|
378
|
+
"thumb=$1": "manualthumb",
|
|
379
|
+
"left": "left",
|
|
380
|
+
"right": "right",
|
|
381
|
+
"none": "none",
|
|
382
|
+
"$1px": "width",
|
|
383
|
+
"center": "center",
|
|
384
|
+
"centre": "center",
|
|
385
|
+
"framed": "framed",
|
|
386
|
+
"enframed": "framed",
|
|
387
|
+
"frame": "framed",
|
|
388
|
+
"frameless": "frameless",
|
|
389
|
+
"upright": "upright",
|
|
390
|
+
"upright=$1": "manual-upright",
|
|
391
|
+
"upright $1": "manual-upright",
|
|
392
|
+
"border": "border",
|
|
393
|
+
"alt=$1": "alt",
|
|
394
|
+
"class=$1": "class",
|
|
395
|
+
"link=$1": "link",
|
|
396
|
+
"baseline": "baseline",
|
|
397
|
+
"sub": "sub",
|
|
398
|
+
"super": "super",
|
|
399
|
+
"sup": "super",
|
|
400
|
+
"top": "top",
|
|
401
|
+
"text-top": "text-top",
|
|
402
|
+
"middle": "middle",
|
|
403
|
+
"bottom": "bottom",
|
|
404
|
+
"text-bottom": "text-bottom",
|
|
405
|
+
"lang=$1": "lang",
|
|
406
|
+
"page=$1": "page",
|
|
407
|
+
"page $1": "page",
|
|
408
|
+
"lossy=$1": "lossy"
|
|
409
|
+
},
|
|
410
|
+
"variants": []
|
|
411
|
+
}
|
package/extensions/dist/base.js
CHANGED
|
@@ -15,12 +15,12 @@ const workerJS = () => {
|
|
|
15
15
|
postMessage([qid, Parser.getConfig()]);
|
|
16
16
|
break;
|
|
17
17
|
case 'json':
|
|
18
|
-
postMessage([qid, Parser.parse(wikitext, include).json()]);
|
|
18
|
+
postMessage([qid, JSON.stringify(Parser.parse(wikitext, include).json())]);
|
|
19
19
|
break;
|
|
20
20
|
case 'lint':
|
|
21
21
|
postMessage([qid, Parser.parse(wikitext, include).lint(), wikitext]);
|
|
22
22
|
break;
|
|
23
|
-
|
|
23
|
+
case 'print':
|
|
24
24
|
postMessage([
|
|
25
25
|
qid,
|
|
26
26
|
Parser.parse(wikitext, include, stage).childNodes.map(child => [
|
|
@@ -56,7 +56,7 @@ const getFeedback = (command, qid, strict, raw, ...args) => new Promise(resolve
|
|
|
56
56
|
worker.postMessage([command, qid, raw, ...args]);
|
|
57
57
|
});
|
|
58
58
|
const getConfig = () => getFeedback('getConfig', -3);
|
|
59
|
-
const json = (wikitext, include, qid) => getFeedback('json', qid, false, wikitext, include);
|
|
59
|
+
const json = async (wikitext, include, qid) => JSON.parse(await getFeedback('json', qid, false, wikitext, include));
|
|
60
60
|
const print = (wikitext, include, stage, qid = -1) => getFeedback('print', qid, false, wikitext, include, stage);
|
|
61
61
|
const lint = (wikitext, include, qid = -2) => getFeedback('lint', qid, true, wikitext, include);
|
|
62
62
|
const wikiparse = { id: 0, setI18N, setConfig, getConfig, print, lint, json };
|
|
@@ -134,7 +134,7 @@ const edit = (textbox, include) => {
|
|
|
134
134
|
const preview = document.createElement('div'), container = document.createElement('div'), printer = new Printer(preview, textbox, include);
|
|
135
135
|
preview.id = 'wikiPretty';
|
|
136
136
|
preview.classList.add('wikiparser', 'active');
|
|
137
|
-
container.
|
|
137
|
+
container.className = 'wikiparse-container';
|
|
138
138
|
textbox.replaceWith(container);
|
|
139
139
|
textbox.classList.add('wikiparsed');
|
|
140
140
|
container.append(preview, textbox);
|
|
@@ -1,25 +1,54 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
"use strict";
|
|
3
|
+
const append = (parent, text) => {
|
|
4
|
+
if (text) {
|
|
5
|
+
parent.append(text);
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
const splitNewLine = (html) => {
|
|
9
|
+
let cur = html.cloneNode();
|
|
10
|
+
const result = [cur];
|
|
11
|
+
for (const child of html.childNodes) {
|
|
12
|
+
const { textContent } = child;
|
|
13
|
+
if (!(textContent === null || textContent === void 0 ? void 0 : textContent.includes('\n'))) {
|
|
14
|
+
cur.append(child.cloneNode(true));
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
const lines = child.nodeType === Node.TEXT_NODE
|
|
18
|
+
? textContent.split('\n')
|
|
19
|
+
: splitNewLine(child);
|
|
20
|
+
append(cur, lines[0]);
|
|
21
|
+
for (const text of lines.slice(1)) {
|
|
22
|
+
cur = html.cloneNode();
|
|
23
|
+
result.push(cur);
|
|
24
|
+
append(cur, text);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
3
29
|
const highlight = async (ele, include, linenums = false, start = 1) => {
|
|
4
|
-
if (ele.classList.contains('
|
|
30
|
+
if (ele.classList.contains('wikiparser')) {
|
|
5
31
|
return;
|
|
6
32
|
}
|
|
7
33
|
const html = (await wikiparse.print(ele.innerText, include)).map(([, , printed]) => printed).join('');
|
|
8
|
-
ele.classList.add('
|
|
34
|
+
ele.classList.add('wikiparser');
|
|
9
35
|
if (linenums) {
|
|
10
|
-
const
|
|
36
|
+
const root = document.createElement('span');
|
|
37
|
+
root.className = 'wpb-root';
|
|
38
|
+
root.innerHTML = html;
|
|
39
|
+
const lines = splitNewLine(root).map((line, i) => {
|
|
11
40
|
const li = document.createElement('li');
|
|
12
41
|
li.id = `L${i + start}`;
|
|
13
|
-
li.
|
|
42
|
+
li.append(line);
|
|
14
43
|
return li;
|
|
15
|
-
});
|
|
16
|
-
if (!lines[
|
|
44
|
+
}), { length } = lines;
|
|
45
|
+
if (length > 1 && !lines[length - 1].textContent) {
|
|
17
46
|
lines.pop();
|
|
18
47
|
}
|
|
19
48
|
const ol = document.createElement('ol');
|
|
20
|
-
ol.
|
|
21
|
-
ol.style.paddingLeft = `${String(lines.length + start - 1).length +
|
|
22
|
-
ol.
|
|
49
|
+
ol.style.counterReset = `wikiparser ${start - 1}`;
|
|
50
|
+
ol.style.paddingLeft = `${String(lines.length + start - 1).length + 1.5}ch`;
|
|
51
|
+
ol.replaceChildren(...lines);
|
|
23
52
|
ele.replaceChildren(ol);
|
|
24
53
|
}
|
|
25
54
|
else {
|
package/extensions/ui.css
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
white-space: pre-wrap;
|
|
3
3
|
overflow-wrap: break-word;
|
|
4
4
|
font-family: monospace;
|
|
5
|
+
border: 1.5px solid #dedede;
|
|
6
|
+
}
|
|
7
|
+
.wikiparser > ol {
|
|
8
|
+
background-color: #f5f5f5;
|
|
9
|
+
list-style: none;
|
|
10
|
+
}
|
|
11
|
+
.wikiparser > ol > li {
|
|
12
|
+
background-color: #fff;
|
|
13
|
+
padding: 0 6px;
|
|
14
|
+
border-left: 1px solid #ddd;
|
|
15
|
+
counter-increment: wikiparser;
|
|
16
|
+
}
|
|
17
|
+
.wikiparser > ol > li:first-child {
|
|
18
|
+
padding-top: 4px;
|
|
19
|
+
}
|
|
20
|
+
.wikiparser > ol > li:last-child {
|
|
21
|
+
padding-bottom: 4px;
|
|
22
|
+
}
|
|
23
|
+
.wikiparser > ol > li::before {
|
|
24
|
+
content: counter(wikiparser);
|
|
25
|
+
position: absolute;
|
|
26
|
+
transform: translateX(calc(-100% - 10px));
|
|
27
|
+
color: #6c6c6c;
|
|
28
|
+
}
|
|
29
|
+
.wikiparser > ol > li::after {
|
|
30
|
+
content: "";
|
|
31
|
+
display: inline-block;
|
|
5
32
|
}
|
|
6
33
|
|
|
7
34
|
.wpb-html-invalid, .wpb-image-invalid, .wpb-table-inter {
|
package/i18n/zh-hans.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"containing invalid attribute": "包含无效属性",
|
|
11
11
|
"content to be moved out from the table": "将被移出表格的内容",
|
|
12
12
|
"duplicated $1 attribute": "重复的$1属性",
|
|
13
|
+
"duplicated category": "重复的分类",
|
|
13
14
|
"duplicated image $1 parameter": "重复的图片$1参数",
|
|
14
15
|
"duplicated parameter": "重复参数",
|
|
15
16
|
"extension tag in HTML tag attributes": "HTML标签属性中的扩展标签",
|
|
@@ -27,13 +28,12 @@
|
|
|
27
28
|
"invalid gallery image": "无效的图库图片",
|
|
28
29
|
"invalid gallery image parameter": "无效的图库图片参数",
|
|
29
30
|
"invalid link in <imagemap>": "无效的<imagemap>链接",
|
|
30
|
-
"invalid parameter of
|
|
31
|
+
"invalid parameter of <$1>": "<$1>的无效参数",
|
|
31
32
|
"invalid self-closing tag": "无效自封闭标签",
|
|
32
|
-
"invisible content inside triple
|
|
33
|
+
"invisible content inside triple braces": "三重括号内的不可见部分",
|
|
33
34
|
"italic": "斜体单引号",
|
|
34
35
|
"lonely \"$1\"": "孤立的\"$1\"",
|
|
35
36
|
"missing module function": "缺少模块函数",
|
|
36
|
-
"missing module name": "缺少模块名称",
|
|
37
37
|
"nonzero tabindex": "不为0的tabindex",
|
|
38
38
|
"nothing should be in <$1>": "<$1>标签内不应有任何内容",
|
|
39
39
|
"obsolete attribute": "过时的属性",
|
|
@@ -51,5 +51,6 @@
|
|
|
51
51
|
"unmatched closing tag": "未匹配的闭合标签",
|
|
52
52
|
"unnecessary URL encoding in an internal link": "内链中不必要的URL编码",
|
|
53
53
|
"useless fragment": "多余的fragment",
|
|
54
|
+
"variable anchor in a section header": "段落标题中可变的锚点",
|
|
54
55
|
"vertical-alignment": "垂直对齐"
|
|
55
56
|
}
|
package/i18n/zh-hant.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"<imagemap> without an image": "缺少圖片的<imagemap>",
|
|
3
3
|
"$1 in URL": "URL中的$1",
|
|
4
|
-
"additional \"|\" in a table cell": "
|
|
4
|
+
"additional \"|\" in a table cell": "表格單元格中多餘的\"|\"",
|
|
5
5
|
"additional \"|\" in the link text": "連結文本中多餘的\"|\"",
|
|
6
6
|
"attributes of a closing tag": "位於閉合標籤的屬性",
|
|
7
7
|
"bold apostrophes": "粗體撇號",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"containing invalid attribute": "包含無效屬性",
|
|
11
11
|
"content to be moved out from the table": "將被移出表格的內容",
|
|
12
12
|
"duplicated $1 attribute": "重複的$1屬性",
|
|
13
|
+
"duplicated category": "重複的分類",
|
|
13
14
|
"duplicated image $1 parameter": "重複的圖片$1參數",
|
|
14
15
|
"duplicated parameter": "重複參數",
|
|
15
16
|
"extension tag in HTML tag attributes": "HTML標籤屬性中的擴展標籤",
|
|
@@ -27,13 +28,12 @@
|
|
|
27
28
|
"invalid gallery image": "無效的圖庫圖片",
|
|
28
29
|
"invalid gallery image parameter": "無效的圖庫圖片參數",
|
|
29
30
|
"invalid link in <imagemap>": "無效的<imagemap>連結",
|
|
30
|
-
"invalid parameter of
|
|
31
|
+
"invalid parameter of <$1>": "<$1>的無效參數",
|
|
31
32
|
"invalid self-closing tag": "無效自封閉標籤",
|
|
32
|
-
"invisible content inside triple
|
|
33
|
+
"invisible content inside triple braces": "三重括號內的不可見部分",
|
|
33
34
|
"italic apostrophes": "斜體撇號",
|
|
34
35
|
"lonely \"$1\"": "孤立的\"$1\"",
|
|
35
36
|
"missing module function": "缺少模組函式",
|
|
36
|
-
"missing module name": "缺少模組名稱",
|
|
37
37
|
"nonzero tabindex": "不為0的tabindex",
|
|
38
38
|
"nothing should be in <$1>": "<$1>標籤內不應有任何內容",
|
|
39
39
|
"obsolete attribute": "過時的屬性",
|
|
@@ -51,5 +51,6 @@
|
|
|
51
51
|
"unmatched closing tag": "未匹配的閉合標籤",
|
|
52
52
|
"unnecessary URL encoding in an internal link": "內部連結中不必要的URL編碼",
|
|
53
53
|
"useless fragment": "多餘的fragment",
|
|
54
|
+
"variable anchor in a section header": "段落標題中可變的錨點",
|
|
54
55
|
"vertical-alignment": "垂直對齊"
|
|
55
56
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikiparser-node",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1-b",
|
|
4
4
|
"description": "A Node.js parser for MediaWiki markup with AST",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -43,37 +43,37 @@
|
|
|
43
43
|
"lint:json": "ajv -s config/.schema.json -d 'config/*.json' --strict=true --strict-required=false",
|
|
44
44
|
"lint:css": "stylelint extensions/*.css",
|
|
45
45
|
"lint": "npm run lint:ts && npm run lint:json && npm run lint:css",
|
|
46
|
-
"server": "http-server .. -c-1 --cors &",
|
|
46
|
+
"server": "npm run test:end; http-server .. -c-1 --cors &",
|
|
47
47
|
"test": "npm run build:prod && npm run build:ext && npm run server",
|
|
48
48
|
"test:end": "pkill -x http-server",
|
|
49
49
|
"test:real": "node dist/test/real.js",
|
|
50
50
|
"test:single": "node dist/test/single.js"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@bhsd/codemirror-mediawiki": "^2.
|
|
53
|
+
"@bhsd/codemirror-mediawiki": "^2.1.11",
|
|
54
54
|
"@codemirror/lint": "^6.4.2",
|
|
55
55
|
"@cypress/request": "^3.0.1",
|
|
56
|
-
"@stylistic/eslint-plugin": "^1.5.
|
|
56
|
+
"@stylistic/eslint-plugin": "^1.5.4",
|
|
57
57
|
"@stylistic/stylelint-plugin": "^2.0.0",
|
|
58
|
-
"@types/node": "^20.
|
|
58
|
+
"@types/node": "^20.11.6",
|
|
59
59
|
"@types/request": "^2.48.12",
|
|
60
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
61
|
-
"@typescript-eslint/parser": "^6.
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^6.19.1",
|
|
61
|
+
"@typescript-eslint/parser": "^6.19.1",
|
|
62
62
|
"ajv-cli": "^5.0.0",
|
|
63
|
-
"esbuild": "^0.19.
|
|
63
|
+
"esbuild": "^0.19.12",
|
|
64
64
|
"eslint": "^8.56.0",
|
|
65
|
-
"eslint-plugin-es-x": "^7.
|
|
65
|
+
"eslint-plugin-es-x": "^7.5.0",
|
|
66
66
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
67
|
-
"eslint-plugin-jsdoc": "^
|
|
67
|
+
"eslint-plugin-jsdoc": "^48.0.2",
|
|
68
68
|
"eslint-plugin-json-es": "^1.5.7",
|
|
69
|
-
"eslint-plugin-n": "^16.
|
|
69
|
+
"eslint-plugin-n": "^16.6.2",
|
|
70
70
|
"eslint-plugin-promise": "^6.1.1",
|
|
71
|
-
"eslint-plugin-regexp": "^2.
|
|
71
|
+
"eslint-plugin-regexp": "^2.2.0",
|
|
72
72
|
"eslint-plugin-unicorn": "^50.0.1",
|
|
73
73
|
"http-server": "^14.1.0",
|
|
74
74
|
"stylelint": "^16.1.0",
|
|
75
75
|
"stylelint-config-recommended": "^14.0.0",
|
|
76
|
-
"typescript": "^5.
|
|
76
|
+
"typescript": "^5.3.3"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|
|
79
79
|
"node": "^20.9.0"
|