wikiparser-node 1.6.1-b → 1.6.2-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.
@@ -1,39 +1,39 @@
1
- "use strict";(()=>{var vt=Object.defineProperty;var ts=Object.getOwnPropertyDescriptor;var rs=Object.getOwnPropertyNames;var ns=Object.prototype.hasOwnProperty;var is=(g,s,e)=>s in g?vt(g,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):g[s]=e;var y=(g,s)=>()=>(g&&(s=g(g=0)),s);var ss=(g,s)=>()=>(s||g((s={exports:{}}).exports,s),s.exports),U=(g,s)=>{for(var e in s)vt(g,e,{get:s[e],enumerable:!0})},os=(g,s,e,t)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of rs(s))!ns.call(g,r)&&r!==e&&vt(g,r,{get:()=>s[r],enumerable:!(t=ts(s,r))||t.enumerable});return g};var _=g=>os(vt({},"__esModule",{value:!0}),g);var T=(g,s,e)=>(is(g,typeof s!="symbol"?s+"":s,e),e),kr=(g,s,e)=>{if(!s.has(g))throw TypeError("Cannot "+e)};var h=(g,s,e)=>(kr(g,s,"read from private field"),e?e.call(g):s.get(g)),A=(g,s,e)=>{if(s.has(g))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(g):s.set(g,e)},$=(g,s,e,t)=>(kr(g,s,"write to private field"),t?t.call(g,e):s.set(g,e),e);var wt=(g,s,e,t)=>({set _(r){$(g,s,r,e)},get _(){return h(g,s,t)}}),R=(g,s,e)=>(kr(g,s,"access private method"),e);var gn,pn=y(()=>{"use strict";gn=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"]});var Fe,Le,yr,un,Re=y(()=>{"use strict";Fe={running:!1,run(g){return g()}},Le=g=>s=>s.type===g,yr=(g,s,e,t=[])=>{let r=[...g.childNodes],n=r.splice(s,e,...t);g.setAttribute("childNodes",r);for(let i of t)i.setAttribute("parentNode",g);return n},un=(g,s)=>new Array(g).fill(void 0).map((e,t)=>s(t))});var cn=ss((Ms,as)=>{as.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"]],namespaces:{},nsid:{file:6,category:14},parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"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","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},variants:[]}});var hn,ue=y(()=>{"use strict";hn=cn()});var mn,Ae,ve,gt,fn,re,xn,ce,St,Tn,fe,D=y(()=>{"use strict";mn='[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD]',Ae=`(?:\\[[\\da-f:.]+\\]|${mn})`,ve=`(?:${mn}|\0\\d+[c!~]\x7F)*`,gt=(g,s)=>e=>e.replace(g,s),fn=gt(/[\0\x7F]/gu,""),re=gt(/\0\d+c\x7F/gu,""),xn=gt(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),ce=(g,s="")=>g.map(e=>typeof e=="string"?e:e.text()).join(s),St=gt(/&#(\d+|x[\da-f]+);/giu,(g,s)=>String.fromCodePoint(+`${s.toLowerCase().startsWith("x")?"0":""}${s}`)),Tn=gt(/\n/gu,"\\n"),fe=(g,s={})=>{let{pre:e="",post:t="",sep:r=""}=s;return`${e}${g.map(n=>n.print()).join(r)}${t}`}});var bn={};U(bn,{Title:()=>Ar});var pt,Ar,kn=y(()=>{"use strict";D();w();Ar=class{constructor(s,e=0,t=m.getConfig(),r=!1,n=!1){T(this,"valid");T(this,"ns");T(this,"fragment");T(this,"encoded",!1);A(this,pt,void 0);if(s=St(s),r&&s.includes("%"))try{let d=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(s);s=decodeURIComponent(s),this.encoded=d}catch(d){}s=s.replace(/_/gu," ").trim();let i=e;s.startsWith(":")&&(i=0,s=s.slice(1).trim());let a=s.split(":");if(a.length>1){let d=t.nsid[a[0].trim().toLowerCase()];d&&(i=d,s=a.slice(1).join(":").trim())}this.ns=i;let o=s.indexOf("#");if(o!==-1){let d=s.slice(o+1).trimEnd();if(d.includes("%"))try{d=decodeURIComponent(d)}catch(p){}this.fragment=d,s=s.slice(0,o).trim()}this.valid=!!(s||this.interwiki||n&&this.fragment!==void 0)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|]|%[\da-f]{2}/iu.test(s),this.main=s}get main(){return h(this,pt)}set main(s){s=s.replace(/_/gu," ").trim(),$(this,pt,s&&`${s[0].toUpperCase()}${s.slice(1)}`)}get extension(){let{main:s}=this,e=s.lastIndexOf(".");return e===-1?void 0:s.slice(e+1).toLowerCase()}};pt=new WeakMap});var yn,C,N,j=y(()=>{"use strict";w();yn=g=>(s,e,t,r,n="error")=>{let{start:i}=e,{top:a,left:o}="top"in e?e:s.getRootNode().posFromIndex(i),{offsetHeight:d,offsetWidth:p}=s,{startIndex:l,startLine:c,startCol:u}=g(s,i,a,o);return{rule:t,message:m.msg(r),severity:n,startIndex:l,endIndex:l+String(s).length,startLine:c,endLine:c+d-1,startCol:u,endCol:d===1?u+p:p}},C=yn((g,s,e,t)=>{let r=g.getRelativeIndex(),{top:n,left:i}=g.parentNode.posFromIndex(r);return{startIndex:s+r,startLine:e+n,startCol:n?i:t+i}}),N=yn((g,s,e,t)=>({startIndex:s,startLine:e,startCol:t}))});var ut,ct,vr,Me,wr=y(()=>{"use strict";Me=class{constructor(){A(this,ct);T(this,"childNodes",[]);A(this,ut,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return h(this,ut)}get nextSibling(){var e;let s=(e=this.parentNode)==null?void 0:e.childNodes;return s&&s[s.indexOf(this)+1]}get previousSibling(){var e;let s=(e=this.parentNode)==null?void 0:e.childNodes;return s&&s[s.indexOf(this)-1]}get offsetHeight(){return R(this,ct,vr).call(this).height}get offsetWidth(){return R(this,ct,vr).call(this).width}getAttribute(s){return s==="padding"?0:this[s]}setAttribute(s,e){s==="parentNode"?$(this,ut,e):this[s]=e}getRootNode(){let{parentNode:s}=this;for(;s!=null&&s.parentNode;)({parentNode:s}=s);return s!=null?s:this}posFromIndex(s){let e=String(this);if(s>=-e.length&&s<=e.length){let t=e.slice(0,s).split(`
2
- `),r=t.length-1;return{top:r,left:t[r].length}}}getGaps(s){return 0}getRelativeIndex(s){let e,t=(r,n)=>e.slice(0,r).reduce((i,a,o)=>i+String(a).length+n.getGaps(o),0)+n.getAttribute("padding");if(s===void 0){let{parentNode:r}=this;return r?({childNodes:e}=r,t(e.indexOf(this),r)):0}return{childNodes:e}=this,t(s,this)}getAbsoluteIndex(){let{parentNode:s}=this;return s?s.getAbsoluteIndex()+this.getRelativeIndex():0}seal(s,e){Object.defineProperty(this,s,{enumerable:!e&&!!this[s],configurable:!0})}};ut=new WeakMap,ct=new WeakSet,vr=function(){let s=String(this).split(`
3
- `),e=s.length;return{height:e,width:s[e-1].length}}});var $t,An,Ct,vn=y(()=>{"use strict";D();Re();wr();Ct=class extends Me{constructor(){super(...arguments);A(this,$t)}get length(){return this.childNodes.length}text(e){return ce(this.childNodes,e)}normalize(){let e=[...this.childNodes];for(let t=e.length-1;t>=0;t--){let{type:r,data:n}=e[t];r!=="text"||this.getGaps(t-1)||n===""&&e.splice(t,1)}this.setAttribute("childNodes",e)}removeAt(e){return yr(this,e,1)[0]}insertAt(e,t=this.length){return yr(this,t,0,[e]),e}closest(e){let t=R(this,$t,An).call(this,e),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}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=""){return this.childNodes.map(String).join(e)}lint(e=this.getAbsoluteIndex(),t){let r=[];for(let n=0,i=e+this.getAttribute("padding");n<this.length;n++){let a=this.childNodes[n];r.push(...a.lint(i,t)),i+=String(a).length+this.getGaps(n)}return r}print(e={}){var t;return String(this)?`<span class="wpb-${(t=e.class)!=null?t:this.type}">${fe(this.childNodes,e)}</span>`:""}json(e,t=this.getAbsoluteIndex()){let r={...this,range:[t,t+String(this).length],childNodes:[]};for(let n=0,i=t+this.getAttribute("padding");n<this.length;n++){let a=this.childNodes[n],{length:o}=String(a);a.type==="text"?r.childNodes.push({data:a.data,range:[i,i+o]}):r.childNodes.push(a.json(void 0,i)),i+=o+this.getGaps(n)}return r}};$t=new WeakSet,An=function(e){let t=new Set(e.split(",").map(r=>r.trim()));return({type:r})=>t.has(r)}});var wn,ls,ds,gs,ps,us,Nt,Sn,ht,Cn=y(()=>{"use strict";w();wr();wn="<\\s*(?:\\/\\s*)?([a-z]\\w*)|\\{+|\\}+|\\[{2,}|\\[(?![^[]*?\\])|((?:^|\\])[^[]*?)\\]+",ls=new RegExp(`${wn}|https?[:/]\\/+`,"giu"),ds=new RegExp(wn,"giu"),gs={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ps={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http"},us=["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"],ht=class extends Me{constructor(e){super();A(this,Nt);T(this,"type","text");T(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},type:{enumerable:!1,writable:!1},data:{value:e}})}toString(){return this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var L,q,J;let{data:r,parentNode:n,nextSibling:i,previousSibling:a}=this;if(!n)return[];let{type:o,name:d,parentNode:p}=n,l=!1;if(o==="attr-value"){let{type:M,name:ae,tag:ke}=p;if(M!=="ext-attr")l=!0;else if(ke==="choose"&&(ae==="before"||ae==="after"))return[]}if(t!=null||(t=o==="free-ext-link"||o==="ext-link-url"||o==="image-parameter"&&d==="link"||l?ds:ls),r.search(t)===-1)return[];t.lastIndex=0;let c=[],u=i==null?void 0:i.type,f=i==null?void 0:i.name,x=a==null?void 0:a.type,k=this.getRootNode(),{ext:F,html:S}=k.getAttribute("config"),{top:v,left:I}=k.posFromIndex(e),P=new Set(["onlyinclude","noinclude","includeonly",F,S,us].flat(2));for(let M=t.exec(r);M;M=t.exec(r)){let[,ae,ke]=M,{0:te,index:W}=M;if(ke&&ke!=="]"){let{length:ee}=ke;W+=ee,te=te.slice(ee)}let{0:E,length:le}=te;if(E==="<"&&!P.has(ae.toLowerCase())||E==="["&&o==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(W+1))||u==="ext"&&f==="nowiki"&&((L=i.innerText)!=null&&L.includes("]"))))continue;E==="]"&&(W||le>1)&&t.lastIndex--;let ge=e+W,ye=ge+le,K=String(k),pe=K[ye],ze=K[ge-1],xr=le>1&&!(E==="<"&&!/[\s/>]/u.test(pe!=null?pe:"")||l&&(E==="["||E==="]"))||E==="{"&&(pe===E||ze==="-")||E==="}"&&(ze===E||pe==="-")||E==="["&&(pe===E||o==="ext-link-text"||u==="free-ext-link"&&!r.slice(W+1).trim())||E==="]"&&(ze===E||x==="free-ext-link"&&!r.slice(0,W).includes("]"))?"error":"warning",Tr=E==="{"||E==="[";if(xr==="warning"&&(Tr||(E==="]"||E==="}"))){let ee=gs[E],br=Tr?r.slice(W+1):r.slice(0,W);if(E==="{"&&((q=ee.exec(br))==null?void 0:q[0])==="}"||E==="}"&&((J=ee.exec(br))==null?void 0:J[0])==="{")continue;if(!br.includes(E)){let dn=Tr?"nextSibling":"previousSibling",Ee=this[dn];for(;Ee&&(Ee.type!=="text"||!ee.test(Ee.data));)Ee=Ee[dn];if(Ee&&ee.exec(Ee.data)[0]!==E)continue}}let At=r.slice(0,W).split(`
4
- `),on=At.length+v-1,an=At[At.length-1],ln=At.length===1?I+an.length:an.length,dt={rule:ps[E],message:m.msg('lonely "$1"',E==="h"?te:E),severity:xr,startIndex:ge,endIndex:ye,startLine:on,endLine:on,startCol:ln,endCol:ln+le};if(E==="<")dt.suggestions=[{desc:"escape",range:[ge,ge+1],text:"&lt;"}];else if(E==="h"&&!(o==="ext-link-text"||o==="link-text")&&/[\p{L}\d_]/u.test(ze||""))dt.suggestions=[{desc:"whitespace",range:[ge,ge],text:" "}];else if(E==="["&&o==="ext-link-text"){let ee=n.getAbsoluteIndex()+String(n).length;dt.suggestions=[{desc:"escape",range:[ee,ee+1],text:"&#93;"}]}else if(E==="]"&&x==="free-ext-link"&&xr==="error"){let ee=e-String(a).length;dt.fix={range:[ee,ee],text:"["}}c.push(dt)}return c}replaceData(e){R(this,Nt,Sn).call(this,e)}print(){let e={"&":"amp","<":"lt",">":"gt"};return this.data.replace(/[&<>]/gu,t=>`&${e[t]};`)}};Nt=new WeakSet,Sn=function(e){this.setAttribute("data",e)}});var It,$n=y(()=>{"use strict";G();It=class extends b{constructor(){super(...arguments);T(this,"type","onlyinclude")}toString(){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">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}}});var he,We=y(()=>{"use strict";he=g=>{class s extends g{text(){return""}lint(){return[]}}return s}});var Q,we=y(()=>{"use strict";w();G();Q=class extends b{get innerText(){return this.firstChild.data}constructor(s="",e=m.getConfig(),t=[]){super(s,e,t)}}});var V,Pe=y(()=>{"use strict";We();we();V=class extends he(Q){constructor(){super(...arguments);T(this,"type","noinclude")}}});var Se,Ue,Sr=y(()=>{"use strict";w();G();Ue=class extends b{constructor(e,t,r,n,i=m.getConfig(),a=[]){super(void 0,i);A(this,Se,void 0);T(this,"closed");T(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),$(this,Se,[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)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(){let{selfClosing:e,firstChild:t,lastChild:r}=this,[n,i]=h(this,Se);return e?`<${n}${String(t)}/>`:`<${n}${String(t)}>${String(r)}${this.closed?`</${i}>`:""}`}text(){let[e,t]=h(this,Se);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?h(this,Se)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=h(this,Se);return super.print(this.selfClosing?{pre:`&lt;${e}`,post:"/&gt;"}:{pre:`&lt;${e}`,sep:"&gt;",post:this.closed?`&lt;/${t}&gt;`:""})}};Se=new WeakMap});var Et,Nn=y(()=>{"use strict";j();We();w();Sr();Et=class extends he(Ue){constructor(e,t="",r,n,i=m.getConfig(),a=[]){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",i,a);T(this,"type","include")}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=N(this,{start:e},"unclosed-comment",m.msg("unclosed $1",`<${this.name}>`));return t.suggestions=[{desc:"close",range:[t.endIndex,t.endIndex],text:`</${this.name}>`}],[t]}}});var B,xe=y(()=>{"use strict";w();G();B=class extends b{constructor(s,e,t=m.getConfig(),r=[],n){super(s,t,r,n),this.type=e}}});var cs,H,In,En,Lt,Cr,Fn,mt,Rn,Pn,Gn,Ln,Ft,hs,ms,fs,He,Z,ne,De,jn=y(()=>{"use strict";j();D();ue();w();G();xe();cs=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),H=new Set(["align"]),In=new Set(["cite"]),En=new Set(["cite","datetime"]),Lt=new Set(["width"]),Cr=new Set(["axis","align","bgcolor","height","width","valign"]),Fn=new Set([...Cr,"abbr","headers","scope","rowspan","colspan"]),mt=new Set(["type"]),Rn=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Pn=new Set(["clear"]),Gn=new Set(["bgcolor","align","valign"]),Ln={div:H,h1:H,h2:H,h3:H,h4:H,h5:H,h6:H,blockquote:In,q:In,p:H,br:Pn,pre:Lt,ins:En,del:En,ul:mt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Rn,"border"]),caption:H,tr:Gn,td:Fn,th:Fn,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:Lt,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"])},Ft=new Set,hs={nowiki:Ft,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:Ft,inputbox:Ft,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Ft,poll:new Set(["id","show-results-before-voting"]),sm2:mt,flashmp3:mt,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),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"])},ms=new RegExp("expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u"),fs={table:Rn,td:new Set([...Cr,"scope"]),th:Cr,br:Pn,caption:H,div:H,hr:Lt,h1:H,h2:H,h3:H,h4:H,h5:H,h6:H,li:mt,p:H,pre:Lt,tr:Gn,ul:mt},De=class extends b{constructor(e,t,r,n="",i,a=[],o=m.getConfig(),d=[]){let p=new B(r,"attr-key",o,d,{}),l;if(r==="title"||t==="img"&&r==="alt")l=new b(i,o,d,{}),l.type="attr-value",l.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let c={...o,excludes:[...o.excludes,"quote","extLink","magicLink","list"]};l=new b(i,c,d,{}),l.type="attr-value",l.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let c={...o,excludes:[...o.excludes,"heading","html","table","hr","list"]};l=new b(i,c,d,{}),l.type="attr-value",l.setAttribute("stage",1)}else l=new B(i,"attr-value",o,d,{});super(void 0,o,d);A(this,He,void 0);A(this,Z,void 0);A(this,ne,void 0);this.type=e,this.append(p,l),$(this,Z,n),$(this,ne,[...a]),$(this,He,t),this.setAttribute("name",re(r).trim().toLowerCase())}get tag(){return h(this,He)}get balanced(){return!h(this,Z)||h(this,ne)[0]===h(this,ne)[1]}afterBuild(){h(this,Z).includes("\0")&&$(this,Z,this.buildFromStr(h(this,Z),0)),this.parentNode&&$(this,He,this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(){let[e="",t=""]=h(this,ne);return h(this,Z)?`${super.toString(`${h(this,Z)}${e}`)}${t}`:String(this.firstChild)}text(){return h(this,Z)?`${super.text(`${h(this,Z).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return h(this,Z)?h(this,Z).length+((t=(e=h(this,ne)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var f,x;let r=super.lint(e,t),{balanced:n,firstChild:i,lastChild:a,type:o,name:d,tag:p}=this,l=this.getValue(),c;if(!n){let k=this.getRootNode();c={start:e,...k.posFromIndex(e)};let F=C(a,c,"unclosed-quote",m.msg("unclosed $1","quotes"),"warning");F.startIndex--,F.startCol--;let S={range:[F.endIndex,F.endIndex],text:h(this,ne)[0]};a.childNodes.some(v=>v.type==="text"&&/\s/u.test(v.text()))?F.suggestions=[{desc:"close",...S}]:F.fix=S,r.push(F)}let u=hs[p];if(u&&!u.has(d)||(o==="ext-attr"?p in Ln:!/\{\{[^{]+\}\}/u.test(d))&&!((f=Ln[p])!=null&&f.has(d))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(d)&&(p==="meta"||p==="link"||!cs.has(d)))c!=null||(c={start:e,...this.getRootNode().posFromIndex(e)}),r.push(C(i,c,"illegal-attr","illegal attribute name"));else if((x=fs[p])!=null&&x.has(d))c!=null||(c={start:e,...this.getRootNode().posFromIndex(e)}),r.push(C(i,c,"obsolete-attr","obsolete attribute","warning"));else if(d==="style"&&typeof l=="string"&&ms.test(l))c!=null||(c={start:e,...this.getRootNode().posFromIndex(e)}),r.push(C(a,c,"insecure-style","insecure style"));else if(d==="tabindex"&&typeof l=="string"&&l.trim()!=="0"){c!=null||(c={start:e,...this.getRootNode().posFromIndex(e)});let k=C(a,c,"illegal-attr","nonzero tabindex");k.suggestions=[{desc:"remove",range:[e,k.endIndex],text:""},{desc:"0 tabindex",range:[k.startIndex,k.endIndex],text:"0"}],r.push(k)}return r}getValue(){if(h(this,Z)){let e=this.lastChild.text();return h(this,ne)[1]?e:e[h(this,ne)[0]?"trimEnd":"trim"]()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=h(this,ne);return h(this,Z)?super.print({sep:`${h(this,Z)}${e}`,post:t}):super.print()}};He=new WeakMap,Z=new WeakMap,ne=new WeakMap});var qn,xs,Ce,Pt=y(()=>{"use strict";j();D();w();G();xe();jn();qn=g=>g.slice(0,-1),xs=g=>`${qn(g)}-dirty`,Ce=class extends b{constructor(s,e,t,r=m.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),s){let i=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=i.exec(s),d=0,p=()=>{a&&(super.insertAt(new B(a,xs(e),r,n,{})),a="")};for(;o;){let{index:l,0:c,1:u,2:f,3:x,4:k,5:F,6:S}=o;if(a+=s.slice(d,l),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(re(u).trim())){let v=k!=null?k:S,I=[x,F],P=new De(qn(e),t,u,f,v,I,r,n);p(),super.insertAt(P)}else a+=c;({lastIndex:d}=i),o=i.exec(s)}a+=s.slice(d),p()}}afterBuild(){if(this.type==="table-attrs"){let{parentNode:s}=this;this.setAttribute("name",(s==null?void 0:s.type)==="td"&&s.subtype==="caption"?"caption":s==null?void 0:s.type)}}getAttrTokens(s){return this.childNodes.filter(e=>e instanceof De&&(!s||e.name===s.toLowerCase().trim()))}getAttrToken(s){let e=this.getAttrTokens(s);return e[e.length-1]}getAttr(s){var e;return(e=this.getAttrToken(s))==null?void 0:e.getValue()}lint(s=this.getAbsoluteIndex(),e){let t=super.lint(s,e),{parentNode:r,length:n,childNodes:i}=this,a=new Map,o=new Set,d;if((r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()){d={start:s,...this.getRootNode().posFromIndex(s)};let p=N(this,d,"no-ignored","attributes of a closing tag");p.fix={range:[s,p.endIndex],text:""},t.push(p)}for(let p=0;p<n;p++){let l=i[p];if(l instanceof B&&l.text().trim()){d!=null||(d={start:s,...this.getRootNode().posFromIndex(s)});let c=C(l,d,"no-ignored","containing invalid attribute");c.suggestions=[{desc:"remove",range:[c.startIndex,c.endIndex],text:" "}],t.push(c)}else if(l instanceof De){let{name:c}=l;a.has(c)?(o.add(c),a.get(c).push(l)):c!=="class"&&a.set(c,[l])}}if(o.size>0){d!=null||(d={start:s,...this.getRootNode().posFromIndex(s)});for(let p of o)t.push(...a.get(p).map(l=>C(l,d,"no-duplicate",m.msg("duplicated $1 attribute",p))))}return t}print(){return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(s=>s.print(s instanceof B?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var Bn={};U(Bn,{PreToken:()=>$r});var $r,On=y(()=>{"use strict";ue();w();G();Pe();$r=class extends b{constructor(e,t=m.getConfig(),r=[]){if(e){let n="<nowiki>",i="</nowiki>",{length:a}=n,o=e.indexOf(n),d=e.indexOf(i,o+a),p="";for(;o!==-1&&d!==-1;)new V(n,t,r),new V(i,t,r),p+=`${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(i,o+a);e=`${p}${e}`}super(e,t,r,{});T(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}});var _n={};U(_n,{ParamTagToken:()=>ft});var ft,Nr=y(()=>{"use strict";j();w();G();xe();ft=class extends b{constructor(e,t=m.getConfig(),r=[],n={}){super(void 0,t,r,{});T(this,"type","ext-inner");if(e){let i=B;this.append(...e.split(`
1
+ "use strict";(()=>{var Nt=Object.defineProperty;var ls=Object.getOwnPropertyDescriptor;var ds=Object.getOwnPropertyNames;var gs=Object.prototype.hasOwnProperty;var ps=(d,s,e)=>s in d?Nt(d,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[s]=e;var y=(d,s)=>()=>(d&&(s=d(d=0)),s);var us=(d,s)=>()=>(s||d((s={exports:{}}).exports,s),s.exports),W=(d,s)=>{for(var e in s)Nt(d,e,{get:s[e],enumerable:!0})},cs=(d,s,e,t)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of ds(s))!gs.call(d,r)&&r!==e&&Nt(d,r,{get:()=>s[r],enumerable:!(t=ls(s,r))||t.enumerable});return d};var _=d=>cs(Nt({},"__esModule",{value:!0}),d);var x=(d,s,e)=>(ps(d,typeof s!="symbol"?s+"":s,e),e),vr=(d,s,e)=>{if(!s.has(d))throw TypeError("Cannot "+e)};var h=(d,s,e)=>(vr(d,s,"read from private field"),e?e.call(d):s.get(d)),A=(d,s,e)=>{if(s.has(d))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(d):s.set(d,e)},$=(d,s,e,t)=>(vr(d,s,"write to private field"),t?t.call(d,e):s.set(d,e),e);var Et=(d,s,e,t)=>({set _(r){$(d,s,r,e)},get _(){return h(d,s,t)}}),F=(d,s,e)=>(vr(d,s,"access private method"),e);var fn,xn=y(()=>{"use strict";fn=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"]});var Ae,Re,wr,Tn,Pe=y(()=>{"use strict";Ae={running:!1,run(d){let{running:s}=this;this.running=!0;try{let e=d();return this.running=s,e}catch(e){throw this.running=s,e}}},Re=d=>s=>s.type===d,wr=(d,s,e,t=[])=>{let r=[...d.childNodes],n=r.splice(s,e,...t);d.setAttribute("childNodes",r);for(let i of t)i.setAttribute("parentNode",d);return n},Tn=(d,s)=>new Array(d).fill(void 0).map((e,t)=>s(t))});var bn=us((Qs,hs)=>{hs.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"]],namespaces:{},nsid:{file:6,category:14},parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"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","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},variants:[]}});var kn,ue=y(()=>{"use strict";kn=bn()});var yn,ve,we,We,An,re,vn,ce,ms,wn,Sn,fs,Ue,fe,H=y(()=>{"use strict";yn='[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD]',ve=`(?:\\[[\\da-f:.]+\\]|${yn})`,we=`(?:${yn}|\0\\d+[c!~]\x7F)*`,We=(d,s)=>e=>e.replace(d,s),An=We(/[\0\x7F]/gu,""),re=We(/\0\d+c\x7F/gu,""),vn=We(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),ce=(d,s="")=>d.map(e=>typeof e=="string"?e:e.text()).join(s),ms={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}"},wn=We(/&(?:#(\d+|x[\da-fA-F]+)|([lLgG][tT]|[lr]brac[ke]));/gu,(d,s,e)=>s?String.fromCodePoint(+`${/^x/iu.test(s)?"0":""}${s}`):ms[e.toLowerCase()]),Sn=We(/\n/gu,"\\n"),fs={"&":"amp","<":"lt",">":"gt"},Ue=We(/[&<>]/gu,d=>`&${fs[d]};`),fe=(d,s={})=>{let{pre:e="",post:t="",sep:r=""}=s;return`${e}${d.map(n=>n.print()).join(r)}${t}`}});var $n={};W($n,{Title:()=>Sr});var Cn,ut,ct,Sr,Nn=y(()=>{"use strict";H();Cn=d=>decodeURIComponent(d.replace(/%(?![\da-f]{2})/giu,"%25")),Sr=class{constructor(s,e,t,r,n){A(this,ut,void 0);A(this,ct,void 0);x(this,"ns");x(this,"fragment");x(this,"interwiki","");x(this,"valid");x(this,"encoded",!1);let i=s.trim().startsWith("../");if(s=wn(s),r&&s.includes("%"))try{let o=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(s);s=Cn(s),this.encoded=o}catch(o){}if(s=s.replace(/_/gu," ").trim(),i)this.ns=0;else{let o=e;s.startsWith(":")&&(o=0,s=s.slice(1).trim());let p=s.split(":");if(p.length>1){let g=t.nsid[p[0].trim().toLowerCase()];g&&(o=g,s=p.slice(1).join(":").trim())}this.ns=o}let a=s.indexOf("#");if(a!==-1){let o=s.slice(a+1).trimEnd();if(o.includes("%"))try{o=Cn(o)}catch(p){}this.fragment=o,s=s.slice(0,a).trim()}this.valid=!!(s||this.interwiki||n&&this.ns===0&&this.fragment!==void 0)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(i?/^(?:\.\.\/)+(.*)/u.exec(s)[1]:s),this.main=s,Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}}),$(this,ct,t.namespaces)}get main(){return h(this,ut)}set main(s){s=s.replace(/_/gu," ").trim(),$(this,ut,s&&`${s[0].toUpperCase()}${s.slice(1)}`)}get prefix(){let s=h(this,ct)[this.ns];return`${s}${s&&":"}`}get title(){return`${`${this.interwiki}${this.interwiki&&":"}${this.prefix}`}${this.main}`.replace(/ /gu,"_")}get extension(){let{main:s}=this,e=s.lastIndexOf(".");return e===-1?void 0:s.slice(e+1).toLowerCase()}toString(){return`${this.title}${this.fragment===void 0?"":`#${this.fragment}`}`}};ut=new WeakMap,ct=new WeakMap});var En,S,N,j=y(()=>{"use strict";E();En=d=>(s,e,t,r,n="error")=>{let{start:i}=e,{top:a,left:o}="top"in e?e:s.getRootNode().posFromIndex(i),{offsetHeight:p,offsetWidth:g}=s,{startIndex:l,startLine:u,startCol:c}=d(s,i,a,o);return{rule:t,message:m.msg(r),severity:n,startIndex:l,endIndex:l+String(s).length,startLine:u,endLine:u+p-1,startCol:c,endCol:p===1?c+g:g}},S=En((d,s,e,t)=>{let r=d.getRelativeIndex(),{top:n,left:i}=d.parentNode.posFromIndex(r);return{startIndex:s+r,startLine:e+n,startCol:n?i:t+i}}),N=En((d,s,e,t)=>({startIndex:s,startLine:e,startCol:t}))});var ht,mt,Cr,He,$r=y(()=>{"use strict";He=class{constructor(){A(this,mt);x(this,"childNodes",[]);A(this,ht,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return h(this,ht)}get nextSibling(){var e;let s=(e=this.parentNode)==null?void 0:e.childNodes;return s&&s[s.indexOf(this)+1]}get previousSibling(){var e;let s=(e=this.parentNode)==null?void 0:e.childNodes;return s&&s[s.indexOf(this)-1]}get offsetHeight(){return F(this,mt,Cr).call(this).height}get offsetWidth(){return F(this,mt,Cr).call(this).width}getAttribute(s){return s==="padding"?0:this[s]}setAttribute(s,e){s==="parentNode"?$(this,ht,e):this[s]=e}getRootNode(){let{parentNode:s}=this;for(;s!=null&&s.parentNode;)({parentNode:s}=s);return s!=null?s:this}posFromIndex(s){let e=String(this);if(s>=-e.length&&s<=e.length){let t=e.slice(0,s).split(`
2
+ `),r=t.length-1;return{top:r,left:t[r].length}}}getGaps(s){return 0}getRelativeIndex(s){let e,t=(r,n)=>e.slice(0,r).reduce((i,a,o)=>i+String(a).length+n.getGaps(o),0)+n.getAttribute("padding");if(s===void 0){let{parentNode:r}=this;return r?({childNodes:e}=r,t(e.indexOf(this),r)):0}return{childNodes:e}=this,t(s,this)}getAbsoluteIndex(){let{parentNode:s}=this;return s?s.getAbsoluteIndex()+this.getRelativeIndex():0}seal(s,e){Object.defineProperty(this,s,{enumerable:!e&&!!this[s],configurable:!0})}};ht=new WeakMap,mt=new WeakSet,Cr=function(){let s=String(this).split(`
3
+ `),e=s.length;return{height:e,width:s[e-1].length}}});var ft,Nr,xt,Er,It,In=y(()=>{"use strict";H();Pe();$r();It=class extends He{constructor(){super(...arguments);A(this,ft);A(this,xt)}get length(){return this.childNodes.length}text(e){return ce(this.childNodes,e)}normalize(){let e=[...this.childNodes];for(let t=e.length-1;t>=0;t--){let{type:r,data:n}=e[t];r!=="text"||this.getGaps(t-1)||n===""&&e.splice(t,1)}this.setAttribute("childNodes",e)}removeAt(e){return wr(this,e,1)[0]}insertAt(e,t=this.length){return wr(this,t,0,[e]),e}closest(e){let t=F(this,ft,Nr).call(this,e),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelectorAll(e){let t=F(this,ft,Nr).call(this,e);return F(this,xt,Er).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=""){return this.childNodes.map(String).join(e)}lint(e=this.getAbsoluteIndex(),t){let r=[];for(let n=0,i=e+this.getAttribute("padding");n<this.length;n++){let a=this.childNodes[n];r.push(...a.lint(i,t)),i+=String(a).length+this.getGaps(n)}return r}print(e={}){var t;return String(this)?`<span class="wpb-${(t=e.class)!=null?t:this.type}">${fe(this.childNodes,e)}</span>`:""}json(e,t=this.getAbsoluteIndex()){let r={...this,range:[t,t+String(this).length],childNodes:[]};for(let n=0,i=t+this.getAttribute("padding");n<this.length;n++){let a=this.childNodes[n],{length:o}=String(a);a.type==="text"?r.childNodes.push({data:a.data,range:[i,i+o]}):r.childNodes.push(a.json(void 0,i)),i+=o+this.getGaps(n)}return r}};ft=new WeakSet,Nr=function(e){let t=new Set(e.split(",").map(r=>r.trim()));return({type:r})=>t.has(r)},xt=new WeakSet,Er=function(e){var r;let t=[];for(let n of this.childNodes)n.type!=="text"&&(e(n)&&t.push(n),t.push(...F(r=n,xt,Er).call(r,e)));return t}});var Fn,xs,Ts,bs,ks,ys,Ft,Ln,Tt,Rn=y(()=>{"use strict";H();E();$r();Fn="<\\s*(?:\\/\\s*)?([a-z]\\w*)|\\{+|\\}+|\\[{2,}|\\[(?![^[]*?\\])|((?:^|\\])[^[]*?)\\]+",xs=new RegExp(`${Fn}|https?[:/]\\/+`,"giu"),Ts=new RegExp(Fn,"giu"),bs={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ks={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http"},ys=["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"],Tt=class extends He{constructor(e){super();A(this,Ft);x(this,"type","text");x(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},type:{enumerable:!1,writable:!1},data:{value:e}})}toString(){return this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var L,O,U;let{data:r,parentNode:n,nextSibling:i,previousSibling:a}=this;if(!n)return[];let{type:o,name:p,parentNode:g}=n,l=!1;if(o==="attr-value"){let{type:Y,name:ae,tag:ke}=g;if(Y!=="ext-attr")l=!0;else if(ke==="choose"&&(ae==="before"||ae==="after"))return[]}if(t!=null||(t=o==="free-ext-link"||o==="ext-link-url"||o==="image-parameter"&&p==="link"||l?Ts:xs),r.search(t)===-1)return[];t.lastIndex=0;let u=[],c=i==null?void 0:i.type,f=i==null?void 0:i.name,T=a==null?void 0:a.type,k=this.getRootNode(),{ext:I,html:w}=k.getAttribute("config"),{top:v,left:C}=k.posFromIndex(e),P=new Set(["onlyinclude","noinclude","includeonly",I,w,ys].flat(2));for(let Y=t.exec(r);Y;Y=t.exec(r)){let[,ae,ke]=Y,{0:te,index:M}=Y;if(ke&&ke!=="]"){let{length:ee}=ke;M+=ee,te=te.slice(ee)}let{0:R,length:le}=te;if(R==="<"&&!P.has(ae.toLowerCase())||R==="["&&o==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(M+1))||c==="ext"&&f==="nowiki"&&((L=i.innerText)!=null&&L.includes("]"))))continue;R==="]"&&(M||le>1)&&t.lastIndex--;let ge=e+M,ye=ge+le,K=String(k),pe=K[ye],Me=K[ge-1],kr=le>1&&!(R==="<"&&!/[\s/>]/u.test(pe!=null?pe:"")||l&&(R==="["||R==="]"))||R==="{"&&(pe===R||Me==="-")||R==="}"&&(Me===R||pe==="-")||R==="["&&(pe===R||o==="ext-link-text"||c==="free-ext-link"&&!r.slice(M+1).trim())||R==="]"&&(Me===R||T==="free-ext-link"&&!r.slice(0,M).includes("]"))?"error":"warning",yr=R==="{"||R==="[";if(kr==="warning"&&(yr||(R==="]"||R==="}"))){let ee=bs[R],Ar=yr?r.slice(M+1):r.slice(0,M);if(R==="{"&&((O=ee.exec(Ar))==null?void 0:O[0])==="}"||R==="}"&&((U=ee.exec(Ar))==null?void 0:U[0])==="{")continue;if(!Ar.includes(R)){let mn=yr?"nextSibling":"previousSibling",Le=this[mn];for(;Le&&(Le.type!=="text"||!ee.test(Le.data));)Le=Le[mn];if(Le&&ee.exec(Le.data)[0]!==R)continue}}let $t=r.slice(0,M).split(`
4
+ `),un=$t.length+v-1,cn=$t[$t.length-1],hn=$t.length===1?C+cn.length:cn.length,pt={rule:ks[R],message:m.msg('lonely "$1"',R==="h"?te:R),severity:kr,startIndex:ge,endIndex:ye,startLine:un,endLine:un,startCol:hn,endCol:hn+le};if(R==="<")pt.suggestions=[{desc:"escape",range:[ge,ge+1],text:"&lt;"}];else if(R==="h"&&!(o==="ext-link-text"||o==="link-text")&&/[\p{L}\d_]/u.test(Me||""))pt.suggestions=[{desc:"whitespace",range:[ge,ge],text:" "}];else if(R==="["&&o==="ext-link-text"){let ee=n.getAbsoluteIndex()+String(n).length;pt.suggestions=[{desc:"escape",range:[ee,ee+1],text:"&#93;"}]}else if(R==="]"&&T==="free-ext-link"&&kr==="error"){let ee=e-String(a).length;pt.fix={range:[ee,ee],text:"["}}u.push(pt)}return u}replaceData(e){F(this,Ft,Ln).call(this,e)}print(){return Ue(this.data)}};Ft=new WeakSet,Ln=function(e){this.setAttribute("data",e)}});var Lt,Pn=y(()=>{"use strict";G();Lt=class extends b{constructor(){super(...arguments);x(this,"type","onlyinclude")}toString(){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">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}}});var he,De=y(()=>{"use strict";he=d=>{class s extends d{text(){return""}lint(){return[]}}return s}});var Q,Se=y(()=>{"use strict";E();G();Q=class extends b{get innerText(){return this.firstChild.data}constructor(s="",e=m.getConfig(),t=[]){super(s,e,t)}}});var V,Ge=y(()=>{"use strict";De();Se();V=class extends he(Q){constructor(){super(...arguments);x(this,"type","noinclude")}}});var Ce,Ve,Ir=y(()=>{"use strict";E();G();Ve=class extends b{constructor(e,t,r,n,i=m.getConfig(),a=[]){super(void 0,i);A(this,Ce,void 0);x(this,"closed");x(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),$(this,Ce,[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)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(){let{selfClosing:e,firstChild:t,lastChild:r}=this,[n,i]=h(this,Ce);return e?`<${n}${String(t)}/>`:`<${n}${String(t)}>${String(r)}${this.closed?`</${i}>`:""}`}text(){let[e,t]=h(this,Ce);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?h(this,Ce)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=h(this,Ce);return super.print(this.selfClosing?{pre:`&lt;${e}`,post:"/&gt;"}:{pre:`&lt;${e}`,sep:"&gt;",post:this.closed?`&lt;/${t}&gt;`:""})}};Ce=new WeakMap});var Rt,Gn=y(()=>{"use strict";j();De();E();Ir();Rt=class extends he(Ve){constructor(e,t="",r,n,i=m.getConfig(),a=[]){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",i,a);x(this,"type","include")}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=N(this,{start:e},"unclosed-comment",m.msg("unclosed $1",`<${this.name}>`));return t.suggestions=[{desc:"close",range:[t.endIndex,t.endIndex],text:`</${this.name}>`}],[t]}}});var q,xe=y(()=>{"use strict";E();G();q=class extends b{constructor(s,e,t=m.getConfig(),r=[],n){super(s,t,r,n),this.type=e}}});var As,D,jn,qn,Gt,Fr,Bn,bt,On,zn,Mn,_n,Pt,vs,ws,Ss,Ze,Z,ne,Qe,Wn=y(()=>{"use strict";j();H();ue();E();G();xe();As=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),D=new Set(["align"]),jn=new Set(["cite"]),qn=new Set(["cite","datetime"]),Gt=new Set(["width"]),Fr=new Set(["axis","align","bgcolor","height","width","valign"]),Bn=new Set([...Fr,"abbr","headers","scope","rowspan","colspan"]),bt=new Set(["type"]),On=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),zn=new Set(["clear"]),Mn=new Set(["bgcolor","align","valign"]),_n={div:D,h1:D,h2:D,h3:D,h4:D,h5:D,h6:D,blockquote:jn,q:jn,p:D,br:zn,pre:Gt,ins:qn,del:qn,ul:bt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...On,"border"]),caption:D,tr:Mn,td:Bn,th:Bn,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:Gt,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"])},Pt=new Set,vs={nowiki:Pt,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:Pt,inputbox:Pt,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Pt,poll:new Set(["id","show-results-before-voting"]),sm2:bt,flashmp3:bt,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),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"])},ws=new RegExp("expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u"),Ss={table:On,td:new Set([...Fr,"scope"]),th:Fr,br:zn,caption:D,div:D,hr:Gt,h1:D,h2:D,h3:D,h4:D,h5:D,h6:D,li:bt,p:D,pre:Gt,tr:Mn,ul:bt},Qe=class extends b{constructor(e,t,r,n="",i,a=[],o=m.getConfig(),p=[]){let g=new q(r,"attr-key",o,p,{}),l;if(r==="title"||t==="img"&&r==="alt")l=new b(i,o,p,{}),l.type="attr-value",l.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let u={...o,excludes:[...o.excludes,"quote","extLink","magicLink","list"]};l=new b(i,u,p,{}),l.type="attr-value",l.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let u={...o,excludes:[...o.excludes,"heading","html","table","hr","list"]};l=new b(i,u,p,{}),l.type="attr-value",l.setAttribute("stage",1)}else l=new q(i,"attr-value",o,p,{});super(void 0,o,p);A(this,Ze,void 0);A(this,Z,void 0);A(this,ne,void 0);this.type=e,this.append(g,l),$(this,Z,n),$(this,ne,[...a]),$(this,Ze,t),this.setAttribute("name",re(r).trim().toLowerCase())}get tag(){return h(this,Ze)}get balanced(){return!h(this,Z)||h(this,ne)[0]===h(this,ne)[1]}afterBuild(){h(this,Z).includes("\0")&&$(this,Z,this.buildFromStr(h(this,Z),0)),this.parentNode&&$(this,Ze,this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(){let[e="",t=""]=h(this,ne);return h(this,Z)?`${super.toString(`${h(this,Z)}${e}`)}${t}`:String(this.firstChild)}text(){return h(this,Z)?`${super.text(`${h(this,Z).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return h(this,Z)?h(this,Z).length+((t=(e=h(this,ne)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var f,T;let r=super.lint(e,t),{balanced:n,firstChild:i,lastChild:a,type:o,name:p,tag:g}=this,l=this.getValue(),u;if(!n){let k=this.getRootNode();u={start:e,...k.posFromIndex(e)};let I=S(a,u,"unclosed-quote",m.msg("unclosed $1","quotes"),"warning");I.startIndex--,I.startCol--;let w={range:[I.endIndex,I.endIndex],text:h(this,ne)[0]};a.childNodes.some(v=>v.type==="text"&&/\s/u.test(v.text()))?I.suggestions=[{desc:"close",...w}]:I.fix=w,r.push(I)}let c=vs[g];if(c&&!c.has(p)||(o==="ext-attr"?g in _n:!/\{\{[^{]+\}\}/u.test(p))&&!((f=_n[g])!=null&&f.has(p))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(p)&&(g==="meta"||g==="link"||!As.has(p)))u!=null||(u={start:e,...this.getRootNode().posFromIndex(e)}),r.push(S(i,u,"illegal-attr","illegal attribute name"));else if((T=Ss[g])!=null&&T.has(p))u!=null||(u={start:e,...this.getRootNode().posFromIndex(e)}),r.push(S(i,u,"obsolete-attr","obsolete attribute","warning"));else if(p==="style"&&typeof l=="string"&&ws.test(l))u!=null||(u={start:e,...this.getRootNode().posFromIndex(e)}),r.push(S(a,u,"insecure-style","insecure style"));else if(p==="tabindex"&&typeof l=="string"&&l.trim()!=="0"){u!=null||(u={start:e,...this.getRootNode().posFromIndex(e)});let k=S(a,u,"illegal-attr","nonzero tabindex");k.suggestions=[{desc:"remove",range:[e,k.endIndex],text:""},{desc:"0 tabindex",range:[k.startIndex,k.endIndex],text:"0"}],r.push(k)}return r}getValue(){if(h(this,Z)){let e=this.lastChild.text();return h(this,ne)[1]?e:e[h(this,ne)[0]?"trimEnd":"trim"]()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=h(this,ne);return h(this,Z)?super.print({sep:`${Ue(h(this,Z))}${e}`,post:t}):super.print()}};Ze=new WeakMap,Z=new WeakMap,ne=new WeakMap});var Un,Cs,$e,jt=y(()=>{"use strict";j();H();E();G();xe();Wn();Un=d=>d.slice(0,-1),Cs=d=>`${Un(d)}-dirty`,$e=class extends b{constructor(s,e,t,r=m.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),s){let i=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=i.exec(s),p=0,g=()=>{a&&(super.insertAt(new q(a,Cs(e),r,n,{})),a="")};for(;o;){let{index:l,0:u,1:c,2:f,3:T,4:k,5:I,6:w}=o;if(a+=s.slice(p,l),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(re(c).trim())){let v=k!=null?k:w,C=[T,I],P=new Qe(Un(e),t,c,f,v,C,r,n);g(),super.insertAt(P)}else a+=u;({lastIndex:p}=i),o=i.exec(s)}a+=s.slice(p),g()}}afterBuild(){if(this.type==="table-attrs"){let{parentNode:s}=this;this.setAttribute("name",(s==null?void 0:s.type)==="td"&&s.subtype==="caption"?"caption":s==null?void 0:s.type)}}getAttrTokens(s){return this.childNodes.filter(e=>e instanceof Qe&&(!s||e.name===s.toLowerCase().trim()))}getAttrToken(s){let e=this.getAttrTokens(s);return e[e.length-1]}getAttr(s){var e;return(e=this.getAttrToken(s))==null?void 0:e.getValue()}lint(s=this.getAbsoluteIndex(),e){let t=super.lint(s,e),{parentNode:r,length:n,childNodes:i}=this,a=new Map,o=new Set,p;if((r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()){p={start:s,...this.getRootNode().posFromIndex(s)};let g=N(this,p,"no-ignored","attributes of a closing tag");g.fix={range:[s,g.endIndex],text:""},t.push(g)}for(let g=0;g<n;g++){let l=i[g];if(l instanceof q&&l.text().trim()){p!=null||(p={start:s,...this.getRootNode().posFromIndex(s)});let u=S(l,p,"no-ignored","containing invalid attribute");u.suggestions=[{desc:"remove",range:[u.startIndex,u.endIndex],text:" "}],t.push(u)}else if(l instanceof Qe){let{name:u}=l;a.has(u)?(o.add(u),a.get(u).push(l)):u!=="class"&&a.set(u,[l])}}if(o.size>0){p!=null||(p={start:s,...this.getRootNode().posFromIndex(s)});for(let g of o)t.push(...a.get(g).map(l=>S(l,p,"no-duplicate",m.msg("duplicated $1 attribute",g))))}return t}print(){return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(s=>s.print(s instanceof q?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var Hn={};W(Hn,{PreToken:()=>Lr});var Lr,Dn=y(()=>{"use strict";ue();E();G();Ge();Lr=class extends b{constructor(e,t=m.getConfig(),r=[]){if(e){let n="<nowiki>",i="</nowiki>",{length:a}=n,o=e.indexOf(n),p=e.indexOf(i,o+a),g="";for(;o!==-1&&p!==-1;)new V(n,t,r),new V(i,t,r),g+=`${e.slice(0,o)}\0${r.length-1}c\x7F${e.slice(o+a,p)}\0${r.length}c\x7F`,e=e.slice(p+a+1),o=e.indexOf(n),p=e.indexOf(i,o+a);e=`${g}${e}`}super(e,t,r,{});x(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}});var Vn={};W(Vn,{ParamTagToken:()=>yt});var yt,Rr=y(()=>{"use strict";j();E();G();xe();yt=class extends b{constructor(e,t=m.getConfig(),r=[],n={}){super(void 0,t,r,{});x(this,"type","ext-inner");if(e){let i=q;this.append(...e.split(`
5
5
  `).map(a=>new i(a,"param-line",t,r,{})))}}toString(){return super.toString(`
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,i=n.findIndex(({type:o})=>o!=="text"),a=(i>=0?n.slice(0,i).map(String).join(""):String(r)).trim();return a&&!(i>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(a)}).map(r=>{t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)});let n=C(r,t,"no-ignored",m.msg("invalid parameter of <$1>",this.name));return n.suggestions=[{desc:"remove",range:[n.startIndex,n.endIndex],text:""}],n})}print(){return super.print({sep:`
8
- `})}}});var me,xt=y(()=>{"use strict";w();G();me=class extends b{constructor(s,e,t="plain",r=m.getConfig(),n=[],i){super(s,r,n,i),this.type=t}lint(){return[]}}});var Tt,Ve,Gt,Ze,Ir=y(()=>{"use strict";j();w();G();xt();Ze=class extends b{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);A(this,Ve);T(this,"type","heading");A(this,Tt,void 0);$(this,Tt,e);let i=new b(t[0],r,n);i.type="heading-title",i.setAttribute("stage",2);let a=new me(t[1],/^[^\S\n]*$/u,"heading-trail",r,n,{});this.append(i,a)}get level(){return h(this,Tt)}toString(){let e=h(this,Ve,Gt);return`${e}${String(this.firstChild)}${e}${String(this.lastChild)}`}text(){let e=h(this,Ve,Gt);return`${e}${this.firstChild.text()}${e}`}getAttribute(e){return e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{firstChild:n,level:i}=this,a=String(n),o=n.childNodes.filter(c=>c.type==="quote"),d=o.filter(({bold:c})=>c),p=o.filter(({italic:c})=>c),l;return this.level===1&&(l={start:e,...this.getRootNode().posFromIndex(e)},r.push(C(n,l,"h1","<h1>"))),(a.startsWith("=")||a.endsWith("="))&&(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),r.push(C(n,l,"unbalanced-header",m.msg("unbalanced $1 in a section header",'"="')))),this.closest("html-attrs, table-attrs")&&(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),r.push(N(this,l,"parsing-order","section header in a HTML tag"))),d.length%2&&(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),r.push(C(d[d.length-1],{...l,start:e+i,left:l.left+i},"format-leakage",m.msg("unbalanced $1 in a section header","bold apostrophes")))),p.length%2&&(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),r.push(C(p[p.length-1],{start:e+i},"format-leakage",m.msg("unbalanced $1 in a section header","italic apostrophes")))),r}print(){let e=h(this,Ve,Gt);return super.print({pre:e,sep:e})}json(){let e=super.json();return e.level=this.level,e}};Tt=new WeakMap,Ve=new WeakSet,Gt=function(){return"=".repeat(this.level)}});var Ts,jt,zn=y(()=>{"use strict";D();j();w();G();Ts=g=>g.text().replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),jt=class extends b{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);T(this,"type","parameter");let i=new b(typeof e=="number"?void 0:e,r,n,{}),a=new b(t,r,n);i.type="parameter-key",a.type="parameter-value",a.setAttribute("stage",2),this.append(i,a)}get anon(){return this.firstChild.length===0}afterBuild(){if(!this.anon){let{parentNode:e,firstChild:t}=this,r=Ts(t);this.setAttribute("name",r),e&&e.getArgs(r,!1,!1).add(this)}}toString(){return this.anon?String(this.lastChild):super.toString("=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var a;let r=super.lint(e,t),{firstChild:n}=this,i=(a=new RegExp(`https?://${Ae}${ve}$`,"iu").exec(n.text()))==null?void 0:a[0];if(i&&new URL(i).search){let o=C(n,{start:e},"unescaped","unescaped query string in an anonymous parameter");o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,o.fix={range:[o.startIndex,o.endIndex],text:"{{=}}"},r.push(o)}return r}print(){return super.print({sep:this.anon?"":"="})}json(){let e=super.json();return e.anon=this.anon,e}}});var bs,Ge,je,Bt,Mn,Ot,Wn,qt,Un=y(()=>{"use strict";D();j();Re();ue();w();G();zn();xe();xt();bs=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),qt=class extends b{constructor(e,t,r=m.getConfig(),n=[]){var c,u;super(void 0,r,n,{});A(this,Bt);A(this,Ot);T(this,"type","template");T(this,"modifier","");A(this,Ge,!1);A(this,je,new Map);let{parserFunction:[i,a]}=r,o=(c=/^(?:\s|\0\d+c\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:c[0];if(o)this.setAttribute("modifier",o),e=e.slice(o.length);else if(e.includes(":")){let[f,...x]=e.split(":"),[k]=/^(?:\s|\0\d+c\x7F)*/u.exec((u=x[0])!=null?u:"");this.setModifier(`${f}:${k}`)&&(e=x.join(":").slice(k.length))}let d=e.includes(":");if(d||t.length===0&&!h(this,Ge)){let[f,...x]=e.split(":"),k=re(f),F=k[x.length>0?"trimStart":"trim"](),S=F.toLowerCase(),v=i[S],I=a.includes(F);if(I||bs.has(v)||d&&v){this.setAttribute("name",v!=null?v:S),this.type="magic-word";let L=new RegExp(`^\\s*${F}\\s*$`,I?"u":"iu"),q=new me(f,L,"magic-word-name",r,n,{});if(super.insertAt(q),x.length>0&&t.unshift([x.join(":")]),this.name==="invoke")for(let J=0;J<2;J++){let M=t.shift();if(!M)break;let ae=new B(M.join("="),`invoke-${J?"function":"module"}`,r,n);super.insertAt(ae)}}}if(this.type==="template"){let f=re(St(e)).split("#")[0].trim();if(!f||/^:[\s_]*:|\0\d+[eh!+-]\x7F|[<>[\]{}\n]|%[\da-f]{2}/iu.test(f))throw n.pop(),new SyntaxError("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0");let x=new B(e,"template-name",r,n,{});super.insertAt(x)}let p=this.isTemplate(),l=1;for(let f=0;f<t.length;f++){let x=t[f];!p&&!(this.name==="switch"&&f>0)&&(x[0]=x.join("="),x.length=1),x.length===1&&(x.unshift(l),l++),this.insertAt(new jt(...x,r,n))}this.seal("modifier")}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),n=re(e).trim();if(e&&!n.endsWith(":"))return!1;let i=n.slice(0,-1).toLowerCase(),a=t.includes(i),o=r.includes(i);return h(this,Ge)&&a||!h(this,Ge)&&(o||e==="")||(Fe.running||this.length>1)&&(a||o||e==="")?(this.setAttribute("modifier",e),$(this,Ge,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(){return`{{${this.modifier}${this.type==="magic-word"?`${String(this.firstChild)}${this.length===1?"":":"}${this.childNodes.slice(1).map(String).join("|")}`:super.toString("|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:i,name:a}=this;return i==="magic-word"&&a==="vardefine"?"":`{{${n}${i==="magic-word"?`${r.text()}${t===1?"":":"}${ce(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(),t){let r=super.lint(e,t),{type:n,childNodes:i,length:a}=this,o;if(!this.isTemplate())return r;let d=R(this,Bt,Mn).call(this);if(d.fragment!==void 0){o={start:e,...this.getRootNode().posFromIndex(e)};let l=i[n==="template"?0:1],c=C(l,o,"no-ignored","useless fragment"),u=l.childNodes.find(f=>f.type==="text"&&f.data.includes("#"));u&&(c.fix={range:[c.startIndex+u.getRelativeIndex()+u.data.indexOf("#"),c.endIndex],text:""}),r.push(c)}if(d.valid||(o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),r.push(C(i[1],o,"invalid-invoke","illegal module name"))),n==="magic-word"&&a===2)return o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),r.push(N(this,o,"invalid-invoke","missing module function")),r;let p=this.getDuplicatedArgs();return p.length>0&&(o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),r.push(...p.flatMap(([,l])=>l).map(l=>C(l,o,"no-duplicate","duplicated parameter")))),r}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?R(this,Ot,Wn).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(Le("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"),i;return h(this,je).has(n)?i=h(this,je).get(n):(i=new Set(this.getAllArgs().filter(({name:a})=>n===a)),h(this,je).set(n,i)),i}getDuplicatedArgs(){return[...h(this,je)].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 i;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;default:throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}let a=r.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;o<a.length;){let{length:d,0:p}=a[o].childNodes.filter(l=>l.text().trim());if(d===0)a.splice(o,1);else if(d>1||p.type!=="magic-word")o++;else try{let l=p.getPossibleValues();a.splice(o,1,...l),o+=l.length}catch(l){o++}}return a}print(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:i}=this;return`<span class="wpb-${i}">{{${n}${i==="magic-word"?`${r.print()}${t===1?"":":"}${fe(e.slice(1),{sep:"|"})}`:fe(e,{sep:"|"})}}}</span>`}};Ge=new WeakMap,je=new WeakMap,Bt=new WeakSet,Mn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.text(),e?10:828)},Ot=new WeakSet,Wn=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let n=r?t.indexOf(e):e-1;n<t.length;n++){let i=t[n],{name:a}=i,o=String(n+1);a!==o&&(i.setAttribute("name",o),this.getArgs(o,!1,!1).add(i))}}});var _t,Hn=y(()=>{"use strict";We();G();_t=class extends he(b){constructor(){super(...arguments);T(this,"type","hidden")}}});var zt,Dn=y(()=>{"use strict";D();j();w();G();xe();Hn();zt=class extends b{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});T(this,"type","arg");for(let n=0;n<e.length;n++)if(n===0){let i=new B(e[n],"arg-name",t,r,{});super.insertAt(i)}else if(n>1){let i=new _t(e[n],t,r,{});super.insertAt(i)}else{let i=new b(e[n],t,r);i.type="arg-default",i.setAttribute("stage",2),super.insertAt(i)}}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(){return`{{{${super.toString("|")}}}}`}text(){return`{{{${ce(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[r,n,...i]}=this;if(!this.getAttribute("include")){let o=N(this,{start:e},"no-arg","unexpected template argument");return n&&(o.fix={range:[e,o.endIndex],text:n.text()}),[o]}let a=r.lint(e+3,t);if(n&&a.push(...n.lint(e+4+String(r).length,t)),i.length>0){let o={start:e,...this.getRootNode().posFromIndex(e)};a.push(...i.map(d=>{let p=C(d,o,"no-ignored","invisible content inside triple braces");return p.startIndex--,p.startCol--,p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"escape",range:[p.startIndex,p.startIndex+1],text:"{{!}}"}],p}))}return a}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(){let e=super.json();return e.default=this.default,e}}});var Vn={};U(Vn,{parseBraces:()=>Er});var Er,Fr=y(()=>{"use strict";D();w();Ir();Un();Dn();Er=(g,s=m.getConfig(),e=[])=>{var c,u,f,x,k,F;let t=`${(c=s.excludes)!=null&&c.includes("heading")?"":"^(\0\\d+c\x7F)*={1,6}|"}\\[\\[|\\{{2,}|-\\{(?!\\{)`,{parserFunction:[,,,r]}=s,n=[],i={"=":`
9
- `,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},a=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"]]),o=new RegExp(t,"gmu"),d=o.exec(g),p=g.includes("}}"),l;for(;d||l!==void 0&&l<=g.length&&((f=(u=n[n.length-1])==null?void 0:u[0])!=null&&f.startsWith("="));){if(d!=null&&d[1]){let[,{length:W}]=d;d[0]=d[0].slice(W),d.index+=W}let{0:S,index:v}=d!=null?d:{0:`
10
- `,index:g.length},I=(x=n.pop())!=null?x:{},{0:P,index:L,parts:q,findEqual:J,pos:M}=I,ae=S==="="&&J,ke=W=>{q[q.length-1].push(W.slice(M,v))};if(S==="]]"||S==="}-")l=v+2;else if(S===`
11
- `){l=v+1;let{pos:W,findEqual:E}=(k=n[n.length-1])!=null?k:{};if(W===void 0||E||re(g.slice(W,L))!==""){let le=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(g.slice(L,v));le&&(g=`${g.slice(0,L)}\0${e.length}h\x7F${g.slice(v)}`,l=L+4+String(e.length).length,new Ze(le[1].length,le.slice(2),s,e))}}else if(S==="|"||ae)l=v+1,ke(g),S==="|"&&q.push([]),I.pos=l,I.findEqual=S==="|",n.push(I);else if(S.startsWith("}}")){let W=S.slice(0,Math.min(P.length,3)),E=P.length-W.length,{length:le}=e;l=v+W.length,ke(g);let ge=!1,ye="t";if(W.length===3){let K=q.map(ze=>ze.join("=")),pe=K.length>1&&re(K[1]).trim();new zt(K,s,e),pe&&pe.endsWith(":")&&r.includes(pe.slice(0,-1).toLowerCase())&&(ye="s")}else try{new qt(q[0][0],q.slice(1),s,e);let K=re(q[0][0]).trim();a.has(K)?ye=a.get(K):/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(K)?ye="m":/^#vardefine:./iu.test(K)&&(ye="c")}catch(K){if(K instanceof SyntaxError&&K.message==="\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0")ge=!0;else throw K}ge||(g=`${g.slice(0,L+E)}\0${le}${ye}\x7F${g.slice(l)}`,l=L+E+3+String(le).length,E>1?n.push({0:P.slice(0,E),index:L,pos:L+E,parts:[[]]}):E===1&&g[L-1]==="-"&&n.push({0:"-{",index:L-1,pos:L+1,parts:[[]]}))}else l=v+S.length,S.startsWith("{")&&(d.pos=l,d.parts=[[]]),n.push(..."0"in I?[I]:[],d);p&&(p=g.slice(l).includes("}}"));let te=n[n.length-1];!p&&((F=te==null?void 0:te[0])!=null&&F.startsWith("{"))&&(n.pop(),te=n[n.length-1]),o=new RegExp(t+(te?`|${i[te[0][0]]}${te.findEqual?"|=":""}`:""),"gmu"),o.lastIndex=l,d=o.exec(g)}return g}});var Zn={};U(Zn,{InputboxToken:()=>Lr});var Lr,Qn=y(()=>{"use strict";Fr();w();Nr();Lr=class extends ft{constructor(s,e=m.getConfig(),t=[]){let r=Symbol("InputboxToken");t.push(r),s&&(s=Er(s,e,t)),t.splice(t.indexOf(r),1),super(s,e,t,{})}}});var Qe,Rr=y(()=>{"use strict";j();We();w();we();Qe=class extends he(Q){constructor(e,t=!0,r=m.getConfig(),n=[]){super(e,r,n);T(this,"type","comment");T(this,"closed");this.closed=t}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=N(this,{start:e},"unclosed-comment",m.msg("unclosed $1","HTML comment"));return t.fix={range:[t.endIndex,t.endIndex],text:"-->"},[t]}toString(){return`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}}});var Mt={};U(Mt,{NestedToken:()=>Pr});var Pr,Wt=y(()=>{"use strict";j();w();G();Gr();Pe();Rr();Pr=class extends b{constructor(e,t,r,n=m.getConfig(),i=[]){e=e==null?void 0:e.replace(t,(a,o,d,p,l)=>{let c=`\0${i.length+1}${o?"e":"c"}\x7F`;if(o)new Xe(o,d,p,l,n,i);else{let u=a.endsWith("-->");new Qe(a.slice(4,u?-3:void 0),u,n,i)}return c}).replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(a,o,d)=>(new V(d,n,i),`${o}\0${i.length}c\x7F`));super(e,n,i,{});T(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex(),t){let r;return[...super.lint(e,t),...this.childNodes.filter(n=>{if(n.type==="ext"||n.type==="comment")return!1;let i=String(n).trim();return i&&!/^<!--.*-->$/su.test(i)}).map(n=>{r!=null||(r={start:e,...this.getRootNode().posFromIndex(e)});let i=C(n,r,"no-ignored",m.msg("invalid content in <$1>",this.name));return i.suggestions=[{desc:"remove",range:[i.startIndex,i.endIndex],text:""},{desc:"comment",range:[i.startIndex,i.startIndex],text:`<!--${String(n)}-->`}],i})]}}});var qe,de,$e,Ne,Ut=y(()=>{"use strict";j();ue();w();G();xe();Ne=class extends b{constructor(e,t,r=m.getConfig(),n=[],i="|"){super(void 0,r,n,{});A(this,qe,!0);A(this,de,void 0);A(this,$e,void 0);if(this.insertAt(new B(e,"link-target",r,n,{})),t!==void 0){let a=new b(t,r,n,{});a.type="link-text",a.setAttribute("stage",10),this.insertAt(a)}$(this,de,i)}afterBuild(){$(this,$e,this.getTitle()),h(this,de).includes("\0")&&$(this,de,this.buildFromStr(h(this,de),0)),this.setAttribute("name",h(this,$e).main)}setAttribute(e,t){e==="bracket"?$(this,qe,t):e==="title"?$(this,$e,t):super.setAttribute(e,t)}toString(){let e=super.toString(h(this,de));return h(this,qe)?`[[${e}]]`:e}text(){let e=super.text("|");return h(this,qe)?`[[${e}]]`:e}getAttribute(e){return e==="title"?h(this,$e):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?h(this,de).length:1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{childNodes:[n,i],type:a}=this,{encoded:o,fragment:d}=h(this,$e),p;if(n.childNodes.some(({type:l})=>l==="template")&&(p={start:e,...this.getRootNode().posFromIndex(e)},r.push(C(n,p,"unknown-page","template in an internal link target","warning"))),o&&(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),r.push(C(n,p,"url-encoding","unnecessary URL encoding in an internal link"))),a==="link"||a==="category"){let l=i==null?void 0:i.childNodes.find(c=>c.type==="text"&&c.data.includes("|"));if(l){p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)});let c=C(i,p,"pipe-like",'additional "|" in the link text',"warning");c.suggestions=[{desc:"escape",range:[c.startIndex+l.getRelativeIndex(),c.startIndex+l.getRelativeIndex()+l.data.length],text:l.data.replace(/\|/gu,"&#124;")}],r.push(c)}}if(a!=="link"&&d!==void 0){p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)});let l=C(n,p,"no-ignored","useless fragment"),c=n.childNodes.find(u=>u.type==="text"&&u.data.includes("#"));c&&(l.fix={range:[l.startIndex+c.getRelativeIndex()+c.data.indexOf("#"),l.endIndex],text:""}),r.push(l)}return r}getTitle(e=!1){return this.normalizeTitle(this.firstChild.text(),0,e,!0,!0)}print(){return super.print(h(this,qe)?{pre:"[[",post:"]]",sep:h(this,de)}:{sep:h(this,de)})}};qe=new WeakMap,de=new WeakMap,$e=new WeakMap});function Xn(g,s,e,t=!1,r){s=s.trim();let n=s.replace(/\0\d+t\x7F/gu,"").trim();switch(g){case"width":return!n||/^(?:\d+x?|\d*x\d+)$/u.test(n);case"link":{if(!n||new RegExp(`^(?:(?:${e.protocol}|//)${Ae}|\0\\d+m\x7F)${ve}$`,"iu").test(n))return s;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2));let a=m.normalizeTitle(n,0,!1,e,t,!0,!0);return a.valid&&a}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(n);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(n)>0;default:return!!n&&!isNaN(n)}}var ks,Y,Dt,Kn,Ht,Jn=y(()=>{"use strict";D();j();w();G();ks=new Set(["alt","link","lang","page","caption"]);Ht=class extends b{constructor(e,t,r=m.getConfig(),n=[]){var s=(...kl)=>(super(...kl),A(this,Dt),T(this,"type","image-parameter"),A(this,Y,""),this);var d;let i,a=Object.entries(r.img).map(([p,l])=>[p,l,new RegExp(`^(\\s*)${p.replace("$1","(.*)")}(\\s*)$`,"u")]),o=a.find(([,p,l])=>(i=l.exec(e),i&&(i.length!==4||Xn(p,i[2],r,!0,t)!==!1)));if(o&&i){i.length===3?(s(void 0,r,n),$(this,Y,e)):(s(i[2],r,n,{}),$(this,Y,`${i[1]}${o[0]}${i[3]}`)),this.setAttribute("name",o[1]);return}s(e,{...r,excludes:[...(d=r.excludes)!=null?d:[],"list"]},n),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get link(){return this.name==="link"?Xn("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!ks.has(this.name)&&this.setAttribute("name","invalid")}toString(){return h(this,Y)?h(this,Y).replace("$1",super.toString()):super.toString()}text(){return h(this,Y)?h(this,Y).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,h(this,Y).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{link:n,name:i}=this;if(i==="invalid"){let a=N(this,{start:e},"invalid-gallery","invalid gallery image parameter");a.fix={range:[e,e+a.endIndex],text:""},r.push(a)}else typeof n=="object"&&n.encoded&&r.push(N(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link"));return r}getValue(){return this.name==="invalid"?this.text():R(this,Dt,Kn).call(this)||super.text()}print(){return h(this,Y)?`<span class="wpb-image-parameter">${h(this,Y).replace("$1",`<span class="wpb-image-caption">${fe(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};Y=new WeakMap,Dt=new WeakSet,Kn=function(){return h(this,Y)&&!h(this,Y).includes("$1")}});var jr,qr,Br,ys,Ke,Vt,Je,Or=y(()=>{"use strict";D();j();w();Ut();Jn();jr=new Set(["manualthumb","frameless","framed","thumbnail"]),qr=new Set(["left","right","center","none"]),Br=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),ys=(g,s,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[g,s,e].map(xn).join("|")}`,"gu"),n=[],i=r.exec(t),a=0,o=0;for(;i;){let{0:d,index:p}=i;d!==e?a+=d===g?1:-1:a===0&&(n.push(t.slice(o,p)),{lastIndex:o}=r),i=r.exec(t)}return n.push(t.slice(o)),n},Je=class extends Ne{constructor(e,t,r=m.getConfig(),n=[],i="|"){super(e,void 0,r,n,i);A(this,Ke);T(this,"type","file");let{extension:a}=this.getTitle(!0);this.append(...ys("-{","}-","|",t).map(o=>new Ht(o,a,r,n)))}get extension(){return this.getTitle().extension}lint(e=this.getAbsoluteIndex(),t){var c;let r=super.lint(e,t),n=this.getAllArgs().filter(({childNodes:u})=>{let f=u.filter(x=>x.text().trim());return f.length!==1||f[0].type!=="arg"}),i=[...new Set(n.map(({name:u})=>u))].filter(u=>u!=="invalid"),a=i.filter(u=>jr.has(u)),o=i.filter(u=>qr.has(u)),d=i.filter(u=>Br.has(u));if(this.closest("ext-link-text")&&((c=this.getValue("link"))==null?void 0:c.trim())!==""&&r.push(N(this,{start:e},"nested-link","internal link in an external link")),n.length===i.length&&a.length<2&&o.length<2&&d.length<2)return r;let p={start:e,...this.getRootNode().posFromIndex(e)},l=(u,f)=>x=>C(x,p,"no-duplicate",m.msg(`${u} image $1 parameter`,f));for(let u of i){let f=n.filter(({name:x})=>x===u);u==="caption"&&(f=[...f.slice(0,-1).filter(x=>x.text()),...f.slice(-1)]),f.length>1&&r.push(...f.map(l("duplicated",u)))}return a.length>1&&r.push(...n.filter(({name:u})=>jr.has(u)).map(l("conflicting","frame"))),o.length>1&&r.push(...n.filter(({name:u})=>qr.has(u)).map(l("conflicting","horizontal-alignment"))),d.length>1&&r.push(...n.filter(({name:u})=>Br.has(u)).map(l("conflicting","vertical-alignment"))),r}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getFrameArgs(){return R(this,Ke,Vt).call(this,jr,"\u6846\u67B6")}getHorizAlignArgs(){return R(this,Ke,Vt).call(this,qr,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return R(this,Ke,Vt).call(this,Br,"\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()}};Ke=new WeakSet,Vt=function(e,t){return this.getAllArgs().filter(({name:n})=>e.has(n))}});var Zt,Yn,Ye,_r=y(()=>{"use strict";j();ue();w();G();Or();Ye=class extends Je{constructor(e,t,r,n=m.getConfig(),i=[]){let a;if(r!==void 0){a=new b(r,n,i),a.type="plain";for(let o=1;o<11;o++)a.parseOnce();i.splice(i.indexOf(a),1)}super(t,a==null?void 0:a.toString(),n,i);A(this,Zt);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(),t){let r=super.lint(e,t),{ns:n,interwiki:i}=this.getAttribute("title");return(i||n!==6)&&r.push(N(this,{start:e},"invalid-gallery","invalid gallery image")),r}afterBuild(){R(this,Zt,Yn).call(this,this.getTitle())}};Zt=new WeakSet,Yn=function(e){this.setAttribute("title",e)}});var ti={};U(ti,{GalleryToken:()=>zr});var Qt,ei,zr,ri=y(()=>{"use strict";w();G();_r();Pe();zr=class extends b{constructor(e,t=m.getConfig(),r=[]){var n;super(void 0,t,r,{});A(this,Qt);T(this,"type","ext-inner");for(let i of(n=e==null?void 0:e.split(`
12
- `))!=null?n:[]){let a=/^([^|]+)(?:\|(.*))?/u.exec(i);if(!a){super.insertAt(i.trim()?new V(i,t):i);continue}let[,o,d]=a;R(this,Qt,ei).call(this,o)?super.insertAt(new Ye("gallery",o,d,t,r)):super.insertAt(new V(i,t))}}toString(){return super.toString(`
7
+ `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t;return this.childNodes.filter(r=>{let{childNodes:n}=r,i=n.findIndex(({type:o})=>o!=="text"),a=(i>=0?n.slice(0,i).map(String).join(""):String(r)).trim();return a&&!(i>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(a)}).map(r=>{t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)});let n=S(r,t,"no-ignored",m.msg("invalid parameter of <$1>",this.name));return n.suggestions=[{desc:"remove",range:[n.startIndex,n.endIndex],text:""}],n})}print(){return super.print({sep:`
8
+ `})}}});var me,At=y(()=>{"use strict";E();G();me=class extends b{constructor(s,e,t="plain",r=m.getConfig(),n=[],i){super(s,r,n,i),this.type=t}lint(){return[]}}});var vt,Xe,qt,Ke,Pr=y(()=>{"use strict";j();E();G();At();Ke=class extends b{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);A(this,Xe);x(this,"type","heading");A(this,vt,void 0);$(this,vt,e);let i=new b(t[0],r,n);i.type="heading-title",i.setAttribute("stage",2);let a=new me(t[1],/^[^\S\n]*$/u,"heading-trail",r,n,{});this.append(i,a)}get level(){return h(this,vt)}toString(){let e=h(this,Xe,qt);return`${e}${String(this.firstChild)}${e}${String(this.lastChild)}`}text(){let e=h(this,Xe,qt);return`${e}${this.firstChild.text()}${e}`}getAttribute(e){return e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{firstChild:n,level:i}=this,a=String(n),o=n.childNodes.filter(u=>u.type==="quote"),p=o.filter(({bold:u})=>u),g=o.filter(({italic:u})=>u),l;return this.level===1&&(l={start:e,...this.getRootNode().posFromIndex(e)},r.push(S(n,l,"h1","<h1>"))),(a.startsWith("=")||a.endsWith("="))&&(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),r.push(S(n,l,"unbalanced-header",m.msg("unbalanced $1 in a section header",'"="')))),this.closest("html-attrs, table-attrs")&&(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),r.push(N(this,l,"parsing-order","section header in a HTML tag"))),p.length%2&&(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),r.push(S(p[p.length-1],{...l,start:e+i,left:l.left+i},"format-leakage",m.msg("unbalanced $1 in a section header","bold apostrophes")))),g.length%2&&(l!=null||(l={start:e,...this.getRootNode().posFromIndex(e)}),r.push(S(g[g.length-1],{start:e+i},"format-leakage",m.msg("unbalanced $1 in a section header","italic apostrophes")))),r}print(){let e=h(this,Xe,qt);return super.print({pre:e,sep:e})}json(){let e=super.json();return e.level=this.level,e}};vt=new WeakMap,Xe=new WeakSet,qt=function(){return"=".repeat(this.level)}});var $s,Bt,Zn=y(()=>{"use strict";H();j();E();G();$s=d=>d.text().replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),Bt=class extends b{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);x(this,"type","parameter");let i=new b(typeof e=="number"?void 0:e,r,n,{}),a=new b(t,r,n);i.type="parameter-key",a.type="parameter-value",a.setAttribute("stage",2),this.append(i,a)}get anon(){return this.firstChild.length===0}afterBuild(){if(!this.anon){let{parentNode:e,firstChild:t}=this,r=$s(t);this.setAttribute("name",r),e&&e.getArgs(r,!1,!1).add(this)}}toString(){return this.anon?String(this.lastChild):super.toString("=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var a;let r=super.lint(e,t),{firstChild:n}=this,i=(a=new RegExp(`https?://${ve}${we}$`,"iu").exec(n.text()))==null?void 0:a[0];if(i&&new URL(i).search){let o=S(n,{start:e},"unescaped","unescaped query string in an anonymous parameter");o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,o.fix={range:[o.startIndex,o.endIndex],text:"{{=}}"},r.push(o)}return r}print(){return super.print({sep:this.anon?"":"="})}json(){let e=super.json();return e.anon=this.anon,e}}});var Ns,je,qe,Ot,Qn,zt,Xn,_t,Kn=y(()=>{"use strict";H();j();Pe();ue();E();G();Zn();xe();At();Ns=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),_t=class extends b{constructor(e,t,r=m.getConfig(),n=[]){var u,c;super(void 0,r,n,{});A(this,Ot);A(this,zt);x(this,"type","template");x(this,"modifier","");A(this,je,!1);A(this,qe,new Map);let{parserFunction:[i,a]}=r,o=(u=/^(?:\s|\0\d+c\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:u[0];if(o)this.setAttribute("modifier",o),e=e.slice(o.length);else if(e.includes(":")){let[f,...T]=e.split(":"),[k]=/^(?:\s|\0\d+c\x7F)*/u.exec((c=T[0])!=null?c:"");this.setModifier(`${f}:${k}`)&&(e=T.join(":").slice(k.length))}let p=e.includes(":");if(p||t.length===0&&!h(this,je)){let[f,...T]=e.split(":"),k=re(f),I=k[T.length>0?"trimStart":"trim"](),w=I.toLowerCase(),v=i[w],C=a.includes(I);if(C||Ns.has(v)||p&&v){this.setAttribute("name",v!=null?v:w),this.type="magic-word";let L=new RegExp(`^\\s*${I}\\s*$`,C?"u":"iu"),O=new me(f,L,"magic-word-name",r,n,{});if(super.insertAt(O),T.length>0&&t.unshift([T.join(":")]),this.name==="invoke")for(let U=0;U<2;U++){let Y=t.shift();if(!Y)break;let ae=new q(Y.join("="),`invoke-${U?"function":"module"}`,r,n);super.insertAt(ae)}}}if(this.type==="template"){let f=re(e).trim();if(!this.normalizeTitle(f,10,!0).valid)throw n.pop(),new SyntaxError("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0");let T=new q(e,"template-name",r,n,{});super.insertAt(T)}let g=this.isTemplate(),l=1;for(let f=0;f<t.length;f++){let T=t[f];!g&&!(this.name==="switch"&&f>0)&&(T[0]=T.join("="),T.length=1),T.length===1&&(T.unshift(l),l++),this.insertAt(new Bt(...T,r,n))}this.seal("modifier")}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),n=re(e).trim();if(e&&!n.endsWith(":"))return!1;let i=n.slice(0,-1).toLowerCase(),a=t.includes(i),o=r.includes(i);return h(this,je)&&a||!h(this,je)&&(o||e==="")||(Ae.running||this.length>1)&&(a||o||e==="")?(this.setAttribute("modifier",e),$(this,je,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(){return`{{${this.modifier}${this.type==="magic-word"?`${String(this.firstChild)}${this.length===1?"":":"}${this.childNodes.slice(1).map(String).join("|")}`:super.toString("|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:i,name:a}=this;return i==="magic-word"&&a==="vardefine"?"":`{{${n}${i==="magic-word"?`${r.text()}${t===1?"":":"}${ce(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(),t){let r=super.lint(e,t),{type:n,childNodes:i,length:a}=this,o;if(!this.isTemplate())return r;let p=F(this,Ot,Qn).call(this);if(p.fragment!==void 0){o={start:e,...this.getRootNode().posFromIndex(e)};let l=i[n==="template"?0:1],u=S(l,o,"no-ignored","useless fragment"),c=l.childNodes.find(f=>f.type==="text"&&f.data.includes("#"));c&&(u.fix={range:[u.startIndex+c.getRelativeIndex()+c.data.indexOf("#"),u.endIndex],text:""}),r.push(u)}if(p.valid||(o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),r.push(S(i[1],o,"invalid-invoke","illegal module name"))),n==="magic-word"&&a===2)return o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),r.push(N(this,o,"invalid-invoke","missing module function")),r;let g=this.getDuplicatedArgs();return g.length>0&&(o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),r.push(...g.flatMap(([,l])=>l).map(l=>S(l,o,"no-duplicate","duplicated parameter")))),r}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?F(this,zt,Xn).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(Re("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,r=!0){let n=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),i;return h(this,qe).has(n)?i=h(this,qe).get(n):(i=new Set(this.getAllArgs().filter(({name:a})=>n===a)),h(this,qe).set(n,i)),i}getDuplicatedArgs(){return[...h(this,qe)].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 i;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;default:throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}let a=r.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;o<a.length;){let{length:p,0:g}=a[o].childNodes.filter(l=>l.text().trim());if(p===0)a.splice(o,1);else if(p>1||g.type!=="magic-word")o++;else try{let l=g.getPossibleValues();a.splice(o,1,...l),o+=l.length}catch(l){o++}}return a}print(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:i}=this;return`<span class="wpb-${i}">{{${Ue(n)}${i==="magic-word"?`${r.print()}${t===1?"":":"}${fe(e.slice(1),{sep:"|"})}`:fe(e,{sep:"|"})}}}</span>`}};je=new WeakMap,qe=new WeakMap,Ot=new WeakSet,Qn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.text(),e?10:828)},zt=new WeakSet,Xn=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let n=r?t.indexOf(e):e-1;n<t.length;n++){let i=t[n],{name:a}=i,o=String(n+1);a!==o&&(i.setAttribute("name",o),this.getArgs(o,!1,!1).add(i))}}});var Mt,Jn=y(()=>{"use strict";De();G();Mt=class extends he(b){constructor(){super(...arguments);x(this,"type","hidden")}}});var Wt,Yn=y(()=>{"use strict";H();j();E();G();xe();Jn();Wt=class extends b{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});x(this,"type","arg");for(let n=0;n<e.length;n++)if(n===0){let i=new q(e[n],"arg-name",t,r,{});super.insertAt(i)}else if(n>1){let i=new Mt(e[n],t,r,{});super.insertAt(i)}else{let i=new b(e[n],t,r);i.type="arg-default",i.setAttribute("stage",2),super.insertAt(i)}}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(){return`{{{${super.toString("|")}}}}`}text(){return`{{{${ce(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[r,n,...i]}=this;if(!this.getAttribute("include")){let o=N(this,{start:e},"no-arg","unexpected template argument");return n&&(o.fix={range:[e,o.endIndex],text:n.text()}),[o]}let a=r.lint(e+3,t);if(n&&a.push(...n.lint(e+4+String(r).length,t)),i.length>0){let o={start:e,...this.getRootNode().posFromIndex(e)};a.push(...i.map(p=>{let g=S(p,o,"no-ignored","invisible content inside triple braces");return g.startIndex--,g.startCol--,g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""},{desc:"escape",range:[g.startIndex,g.startIndex+1],text:"{{!}}"}],g}))}return a}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(){let e=super.json();return e.default=this.default,e}}});var ei={};W(ei,{parseBraces:()=>Gr});var Gr,jr=y(()=>{"use strict";H();Pr();Kn();Yn();Gr=(d,s,e)=>{var u,c,f,T,k,I;let t=`${(u=s.excludes)!=null&&u.includes("heading")?"":"^(\0\\d+c\x7F)*={1,6}|"}\\[\\[|\\{{2,}|-\\{(?!\\{)`,{parserFunction:[,,,r]}=s,n=[],i={"=":`
9
+ `,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},a=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"]]),o=new RegExp(t,"gmu"),p=o.exec(d),g=d.includes("}}"),l;for(;p||l!==void 0&&l<=d.length&&((f=(c=n[n.length-1])==null?void 0:c[0])!=null&&f.startsWith("="));){if(p!=null&&p[1]){let[,{length:M}]=p;p[0]=p[0].slice(M),p.index+=M}let{0:w,index:v}=p!=null?p:{0:`
10
+ `,index:d.length},C=(T=n.pop())!=null?T:{},{0:P,index:L,parts:O,findEqual:U,pos:Y}=C,ae=w==="="&&U,ke=M=>{O[O.length-1].push(M.slice(Y,v))};if(w==="]]"||w==="}-")l=v+2;else if(w===`
11
+ `){l=v+1;let{pos:M,findEqual:R}=(k=n[n.length-1])!=null?k:{};if(M===void 0||R||re(d.slice(M,L))!==""){let le=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(d.slice(L,v));le&&(d=`${d.slice(0,L)}\0${e.length}h\x7F${d.slice(v)}`,l=L+4+String(e.length).length,new Ke(le[1].length,le.slice(2),s,e))}}else if(w==="|"||ae)l=v+1,ke(d),w==="|"&&O.push([]),C.pos=l,C.findEqual=w==="|",n.push(C);else if(w.startsWith("}}")){let M=w.slice(0,Math.min(P.length,3)),R=P.length-M.length,{length:le}=e;l=v+M.length,ke(d);let ge=!1,ye="t";if(M.length===3){let K=O.map(Me=>Me.join("=")),pe=K.length>1&&re(K[1]).trim();new Wt(K,s,e),pe&&pe.endsWith(":")&&r.includes(pe.slice(0,-1).toLowerCase())&&(ye="s")}else try{new _t(O[0][0],O.slice(1),s,e);let K=re(O[0][0]).trim();a.has(K)?ye=a.get(K):/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(K)?ye="m":/^#vardefine:./iu.test(K)&&(ye="c")}catch(K){if(K instanceof SyntaxError&&K.message==="\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0")ge=!0;else throw K}ge||(d=`${d.slice(0,L+R)}\0${le}${ye}\x7F${d.slice(l)}`,l=L+R+3+String(le).length,R>1?n.push({0:P.slice(0,R),index:L,pos:L+R,parts:[[]]}):R===1&&d[L-1]==="-"&&n.push({0:"-{",index:L-1,pos:L+1,parts:[[]]}))}else l=v+w.length,w.startsWith("{")&&(p.pos=l,p.parts=[[]]),n.push(..."0"in C?[C]:[],p);g&&(g=d.slice(l).includes("}}"));let te=n[n.length-1];!g&&((I=te==null?void 0:te[0])!=null&&I.startsWith("{"))&&(n.pop(),te=n[n.length-1]),o=new RegExp(t+(te?`|${i[te[0][0]]}${te.findEqual?"|=":""}`:""),"gmu"),o.lastIndex=l,p=o.exec(d)}return d}});var ti={};W(ti,{InputboxToken:()=>qr});var qr,ri=y(()=>{"use strict";jr();E();Rr();qr=class extends yt{constructor(s,e=m.getConfig(),t=[]){let r=Symbol("InputboxToken"),{length:n}=t;t.push(r),s&&(s=Gr(s,e,t)),t.splice(n,1),super(s,e,t,{})}}});var Je,Br=y(()=>{"use strict";j();De();E();Se();Je=class extends he(Q){constructor(e,t=!0,r=m.getConfig(),n=[]){super(e,r,n);x(this,"type","comment");x(this,"closed");this.closed=t}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=N(this,{start:e},"unclosed-comment",m.msg("unclosed $1","HTML comment"));return t.fix={range:[t.endIndex,t.endIndex],text:"-->"},[t]}toString(){return`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}}});var Ut={};W(Ut,{NestedToken:()=>_r});var _r,Ht=y(()=>{"use strict";j();E();G();Or();Ge();Br();_r=class extends b{constructor(e,t,r,n=m.getConfig(),i=[]){e=e==null?void 0:e.replace(t,(a,o,p,g,l)=>{let u=`\0${i.length+1}${o?"e":"c"}\x7F`;if(o)new Ye(o,p,g,l,n,i);else{let c=a.endsWith("-->");new Je(a.slice(4,c?-3:void 0),c,n,i)}return u}).replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(a,o,p)=>(new V(p,n,i),`${o}\0${i.length}c\x7F`));super(e,n,i,{});x(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex(),t){let r;return[...super.lint(e,t),...this.childNodes.filter(n=>{if(n.type==="ext"||n.type==="comment")return!1;let i=String(n).trim();return i&&!/^<!--.*-->$/su.test(i)}).map(n=>{r!=null||(r={start:e,...this.getRootNode().posFromIndex(e)});let i=S(n,r,"no-ignored",m.msg("invalid content in <$1>",this.name));return i.suggestions=[{desc:"remove",range:[i.startIndex,i.endIndex],text:""},{desc:"comment",range:[i.startIndex,i.startIndex],text:`<!--${String(n)}-->`}],i})]}}});var Be,de,Ne,Ee,Dt=y(()=>{"use strict";j();ue();E();G();xe();Ee=class extends b{constructor(e,t,r=m.getConfig(),n=[],i="|"){super(void 0,r,n,{});A(this,Be,!0);A(this,de,void 0);A(this,Ne,void 0);if(this.insertAt(new q(e,"link-target",r,n,{})),t!==void 0){let a=new b(t,r,n,{});a.type="link-text",a.setAttribute("stage",10),this.insertAt(a)}$(this,de,i)}afterBuild(){$(this,Ne,this.getTitle()),h(this,de).includes("\0")&&$(this,de,this.buildFromStr(h(this,de),0)),this.setAttribute("name",h(this,Ne).title)}setAttribute(e,t){e==="bracket"?$(this,Be,t):e==="title"?$(this,Ne,t):super.setAttribute(e,t)}toString(){let e=super.toString(h(this,de));return h(this,Be)?`[[${e}]]`:e}text(){let e=super.text("|");return h(this,Be)?`[[${e}]]`:e}getAttribute(e){return e==="title"?h(this,Ne):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?h(this,de).length:1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{childNodes:[n,i],type:a}=this,{encoded:o,fragment:p}=h(this,Ne),g;if(n.childNodes.some(({type:l})=>l==="template")&&(g={start:e,...this.getRootNode().posFromIndex(e)},r.push(S(n,g,"unknown-page","template in an internal link target","warning"))),o&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),r.push(S(n,g,"url-encoding","unnecessary URL encoding in an internal link"))),a==="link"||a==="category"){let l=i==null?void 0:i.childNodes.find(u=>u.type==="text"&&u.data.includes("|"));if(l){g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)});let u=S(i,g,"pipe-like",'additional "|" in the link text',"warning");u.suggestions=[{desc:"escape",range:[u.startIndex+l.getRelativeIndex(),u.startIndex+l.getRelativeIndex()+l.data.length],text:l.data.replace(/\|/gu,"&#124;")}],r.push(u)}}if(a!=="link"&&p!==void 0){g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)});let l=S(n,g,"no-ignored","useless fragment"),u=n.childNodes.find(c=>c.type==="text"&&c.data.includes("#"));u&&(l.fix={range:[l.startIndex+u.getRelativeIndex()+u.data.indexOf("#"),l.endIndex],text:""}),r.push(l)}return r}getTitle(e){return this.normalizeTitle(this.firstChild.text(),0,e,!0,!0)}print(){return super.print(h(this,Be)?{pre:"[[",post:"]]",sep:h(this,de)}:{sep:h(this,de)})}};Be=new WeakMap,de=new WeakMap,Ne=new WeakMap});function ni(d,s,e,t,r){s=s.trim();let n=s.replace(/\0\d+t\x7F/gu,"").trim();switch(d){case"width":return!n||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{if(!n||new RegExp(`^(?:(?:${e.protocol}|//)${ve}|\0\\d+m\x7F)${we}$`,"iu").test(n))return s;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2));let a=m.normalizeTitle(n,0,!1,e,t,!0,!0);return a.valid&&a}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(n);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(n)>0;default:return!!n&&!isNaN(n)}}var Es,J,Zt,ii,Vt,si=y(()=>{"use strict";H();j();E();G();Es=new Set(["alt","link","lang","page","caption"]);Vt=class extends b{constructor(e,t,r=m.getConfig(),n=[]){var s=(...Cl)=>(super(...Cl),A(this,Zt),x(this,"type","image-parameter"),A(this,J,""),this);var p;let i,a=Object.entries(r.img).map(([g,l])=>[g,l,new RegExp(`^(\\s*)${g.replace("$1","(.*)")}(\\s*)$`,"u")]),o=a.find(([,g,l])=>(i=l.exec(e),i&&(i.length!==4||ni(g,i[2],r,!0,t)!==!1)));if(o&&i){i.length===3?(s(void 0,r,n),$(this,J,e)):(s(i[2],r,n,{}),$(this,J,`${i[1]}${o[0]}${i[3]}`)),this.setAttribute("name",o[1]);return}s(e,{...r,excludes:[...(p=r.excludes)!=null?p:[],"list"]},n),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get link(){return this.name==="link"?ni("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Es.has(this.name)&&this.setAttribute("name","invalid")}toString(){return h(this,J)?h(this,J).replace("$1",super.toString()):super.toString()}text(){return h(this,J)?h(this,J).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,h(this,J).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{link:n,name:i}=this;if(i==="invalid"){let a=N(this,{start:e},"invalid-gallery","invalid gallery image parameter");a.fix={range:[e,e+a.endIndex],text:""},r.push(a)}else typeof n=="object"&&n.encoded&&r.push(N(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link"));return r}getValue(){return this.name==="invalid"?this.text():F(this,Zt,ii).call(this)||super.text()}print(){return h(this,J)?`<span class="wpb-image-parameter">${h(this,J).replace("$1",`<span class="wpb-image-caption">${fe(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};J=new WeakMap,Zt=new WeakSet,ii=function(){return h(this,J)&&!h(this,J).includes("$1")}});var zr,Mr,Wr,Is,et,Qt,tt,Ur=y(()=>{"use strict";H();j();E();Dt();si();zr=new Set(["manualthumb","frameless","framed","thumbnail"]),Mr=new Set(["left","right","center","none"]),Wr=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Is=(d,s,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[d,s,e].map(vn).join("|")}`,"gu"),n=[],i=r.exec(t),a=0,o=0;for(;i;){let{0:p,index:g}=i;p!==e?a+=p===d?1:-1:a===0&&(n.push(t.slice(o,g)),{lastIndex:o}=r),i=r.exec(t)}return n.push(t.slice(o)),n},tt=class extends Ee{constructor(e,t,r=m.getConfig(),n=[],i="|"){super(e,void 0,r,n,i);A(this,et);x(this,"type","file");let{extension:a}=this.getTitle(!0);this.append(...Is("-{","}-","|",t).map(o=>new Vt(o,a,r,n)))}get extension(){return this.getTitle().extension}lint(e=this.getAbsoluteIndex(),t){var u;let r=super.lint(e,t),n=this.getAllArgs().filter(({childNodes:c})=>{let f=c.filter(T=>T.text().trim());return f.length!==1||f[0].type!=="arg"}),i=[...new Set(n.map(({name:c})=>c))].filter(c=>c!=="invalid"),a=i.filter(c=>zr.has(c)),o=i.filter(c=>Mr.has(c)),p=i.filter(c=>Wr.has(c));if(this.closest("ext-link-text")&&((u=this.getValue("link"))==null?void 0:u.trim())!==""&&r.push(N(this,{start:e},"nested-link","internal link in an external link")),n.length===i.length&&a.length<2&&o.length<2&&p.length<2)return r;let g={start:e,...this.getRootNode().posFromIndex(e)},l=(c,f)=>T=>S(T,g,"no-duplicate",m.msg(`${c} image $1 parameter`,f));for(let c of i){let f=n.filter(({name:T})=>T===c);c==="caption"&&(f=[...f.slice(0,-1).filter(T=>T.text()),...f.slice(-1)]),f.length>1&&r.push(...f.map(l("duplicated",c)))}return a.length>1&&r.push(...n.filter(({name:c})=>zr.has(c)).map(l("conflicting","frame"))),o.length>1&&r.push(...n.filter(({name:c})=>Mr.has(c)).map(l("conflicting","horizontal-alignment"))),p.length>1&&r.push(...n.filter(({name:c})=>Wr.has(c)).map(l("conflicting","vertical-alignment"))),r}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getFrameArgs(){return F(this,et,Qt).call(this,zr,"\u6846\u67B6")}getHorizAlignArgs(){return F(this,et,Qt).call(this,Mr,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return F(this,et,Qt).call(this,Wr,"\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()}};et=new WeakSet,Qt=function(e,t){return this.getAllArgs().filter(({name:n})=>e.has(n))}});var Xt,oi,rt,Hr=y(()=>{"use strict";j();ue();E();G();Ur();rt=class extends tt{constructor(e,t,r,n=m.getConfig(),i=[]){let a;if(r!==void 0){let{length:o}=i;a=new b(r,n,i),a.type="plain";for(let p=1;p<11;p++)a.parseOnce();i.splice(o,1)}super(t,a==null?void 0:a.toString(),n,i);A(this,Xt);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(),t){let r=super.lint(e,t),{ns:n,interwiki:i}=this.getAttribute("title");return(i||n!==6)&&r.push(N(this,{start:e},"invalid-gallery","invalid gallery image")),r}afterBuild(){F(this,Xt,oi).call(this,this.getTitle())}};Xt=new WeakSet,oi=function(e){this.setAttribute("title",e)}});var li={};W(li,{GalleryToken:()=>Dr});var Kt,ai,Dr,di=y(()=>{"use strict";E();G();Hr();Ge();Dr=class extends b{constructor(e,t=m.getConfig(),r=[]){var n;super(void 0,t,r,{});A(this,Kt);x(this,"type","ext-inner");for(let i of(n=e==null?void 0:e.split(`
12
+ `))!=null?n:[]){let a=/^([^|]+)(?:\|(.*))?/u.exec(i);if(!a){super.insertAt(i.trim()?new V(i,t):i);continue}let[,o,p]=a;F(this,Kt,ai).call(this,o)?super.insertAt(new rt("gallery",o,p,t,r)):super.insertAt(new V(i,t))}}toString(){return super.toString(`
13
13
  `)}text(){return super.text(`
14
14
  `).replace(/\n\s*\n/gu,`
15
- `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:r,left:n}=this.getRootNode().posFromIndex(e),i=[];for(let a=0;a<this.length;a++){let o=this.childNodes[a],d=String(o),{length:p}=d,l=d.trim(),c=r+a,u=a?0:n;o.type==="noinclude"&&l&&!/^<!--.*-->$/u.test(l)?i.push({rule:"no-ignored",message:m.msg("invalid content in <$1>","gallery"),severity:l.startsWith("|")?"warning":"error",startIndex:e,endIndex:e+p,startLine:c,endLine:c,startCol:u,endCol:u+p,suggestions:[{desc:"remove",range:[e,e+p],text:""},{desc:"comment",range:[e,e+p],text:`<!--${d}-->`}]}):o.type!=="noinclude"&&o.type!=="text"&&i.push(...o.lint(e,t)),e+=p+1}return i}print(){return super.print({sep:`
16
- `})}};Qt=new WeakSet,ei=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var et,Mr=y(()=>{"use strict";j();Ut();et=class extends Ne{constructor(){super(...arguments);T(this,"type","link")}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);return this.closest("ext-link-text")&&r.push(N(this,{start:e},"nested-link","internal link in an external link")),r}}});var tt,Wr=y(()=>{"use strict";j();w();G();tt=class extends b{constructor(s,e=!1,t=m.getConfig(),r=[]){super(s,t,r,{}),this.type=e?"ext-link-url":"free-ext-link"}lint(s=this.getAbsoluteIndex(),e){let t=super.lint(s,e),r=`[\uFF0C\uFF1B\u3002\uFF1A\uFF01\uFF1F\uFF08\uFF09]+${this.type==="ext-link-url"?"|\\|+":""}`,n=new RegExp(r,"u"),i=new RegExp(r,"gu"),a;for(let o of this.childNodes){let{type:d,data:p}=o;if(d!=="text"||!n.test(p))continue;a!=null||(a={start:s,...this.getRootNode().posFromIndex(s)});let l=C(o,a,"unterminated-url","","warning");i.lastIndex=0;for(let c=i.exec(p);c;c=i.exec(p)){let{index:u,0:f}=c,x=p.slice(0,u).split(`
17
- `),k=x.length,F=x[k-1].length,S=l.startIndex+u,v=l.startLine+k-1,I=k===1?l.startCol+F:F,P=f.startsWith("|"),L={...l,message:m.msg("$1 in URL",P?'"|"':"full-width punctuation"),startIndex:S,endIndex:S+f.length,startLine:v,endLine:v,startCol:I,endCol:I+f.length};P?f.length===1&&(L.suggestions=[{desc:"whitespace",range:[S,S+1],text:" "}]):L.suggestions=[{desc:"whitespace",range:[S,S],text:" "},{desc:"escape",range:[S,L.endIndex],text:encodeURI(f)}],t.push(L)}}return t}}});var Te,rt,Ur=y(()=>{"use strict";ue();j();w();G();Wr();rt=class extends b{constructor(e,t="",r="",n=m.getConfig(),i=[]){super(void 0,n,i,{});T(this,"type","ext-link");A(this,Te,void 0);if(this.insertAt(new tt(e,!0,n,i)),$(this,Te,t),r){let a=new b(r,n,i,{});a.type="ext-link-text",a.setAttribute("stage",10),this.insertAt(a)}}toString(){return this.length===1?`[${super.toString()}${h(this,Te)}]`:`[${super.toString(h(this,Te))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return h(this,Te).length}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&r.push(N(this,{start:e},"var-anchor","variable anchor in a section header")),r}print(){return super.print(this.length===1?{pre:"[",post:`${h(this,Te)}]`}:{pre:"[",sep:h(this,Te),post:"]"})}};Te=new WeakMap});var bt,ni=y(()=>{"use strict";w();G();Pe();Mr();Ur();bt=class extends b{constructor(e,t,r,n=m.getConfig(),i=[]){super(void 0,n,i);T(this,"type","imagemap-link");this.append(e,t.length===2?new et(...t,n,i):new rt(...t,n,i),new V(r,n,i))}}});var ii={};U(ii,{ImagemapToken:()=>Hr});var Hr,si=y(()=>{"use strict";j();Re();w();G();Pe();_r();ni();Hr=class extends b{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});T(this,"type","ext-inner");if(!e)return;let n=e.split(`
18
- `),i=new Set(t.protocol.split("|")),a=V,o=!0,d=!1;for(let p of n){let l=p.trim();if(!(d||!l||l.startsWith("#"))){if(o){let[c,...u]=p.split("|"),f=this.normalizeTitle(c,0,!0);if(f.valid&&!f.interwiki&&f.ns===6){let x=new Ye("imagemap",c,u.length>0?u.join("|"):void 0,t,r);super.insertAt(x),o=!1;continue}else d=!0}else if(p.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(p);continue}else if(p.includes("[")){let c=p.indexOf("["),u=p.slice(c),f=/^\[{2}([^|]+)(?:\|([^\]]+))?\]{2}[\w\s]*$/u.exec(u);if(f){if(this.normalizeTitle(f[1],0,!0,!1,!0).valid){super.insertAt(new bt(p.slice(0,c),f.slice(1),u.slice(u.indexOf("]]")+2),t,r));continue}}else if(i.has(u.slice(1,u.indexOf(":")+1))||i.has(u.slice(1,u.indexOf("//")+2))){let x=/^\[([^\]\s]+)(?:(\s+(?=\S))([^\]]*))?\][\w\s]*$/u.exec(u);if(x){super.insertAt(new bt(p.slice(0,c),x.slice(1),u.slice(u.indexOf("]")+1),t,r));continue}}}}super.insertAt(new a(p,t,r))}}get image(){return this.childNodes.find(Le("imagemap-image"))}toString(){return super.toString(`
15
+ `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:r,left:n}=this.getRootNode().posFromIndex(e),i=[];for(let a=0;a<this.length;a++){let o=this.childNodes[a],p=String(o),{length:g}=p,l=p.trim(),u=r+a,c=a?0:n;o.type==="noinclude"&&l&&!/^<!--.*-->$/u.test(l)?i.push({rule:"no-ignored",message:m.msg("invalid content in <$1>","gallery"),severity:l.startsWith("|")?"warning":"error",startIndex:e,endIndex:e+g,startLine:u,endLine:u,startCol:c,endCol:c+g,suggestions:[{desc:"remove",range:[e,e+g],text:""},{desc:"comment",range:[e,e+g],text:`<!--${p}-->`}]}):o.type!=="noinclude"&&o.type!=="text"&&i.push(...o.lint(e,t)),e+=g+1}return i}print(){return super.print({sep:`
16
+ `})}};Kt=new WeakSet,ai=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var nt,Vr=y(()=>{"use strict";j();Dt();nt=class extends Ee{constructor(){super(...arguments);x(this,"type","link")}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);return this.closest("ext-link-text")&&r.push(N(this,{start:e},"nested-link","internal link in an external link")),r}}});var Ie,Jt=y(()=>{"use strict";j();E();G();Ie=class extends b{constructor(s,e,t=m.getConfig(),r=[]){super(s,t,r,{}),this.type=e?"ext-link-url":"free-ext-link"}lint(s=this.getAbsoluteIndex(),e){let t=super.lint(s,e),r=`[\uFF0C\uFF1B\u3002\uFF1A\uFF01\uFF1F\uFF08\uFF09]+${this.type==="ext-link-url"?"|\\|+":""}`,n=new RegExp(r,"u"),i=new RegExp(r,"gu"),a;for(let o of this.childNodes){let{type:p,data:g}=o;if(p!=="text"||!n.test(g))continue;a!=null||(a={start:s,...this.getRootNode().posFromIndex(s)});let l=S(o,a,"unterminated-url","","warning");i.lastIndex=0;for(let u=i.exec(g);u;u=i.exec(g)){let{index:c,0:f}=u,T=g.slice(0,c).split(`
17
+ `),k=T.length,I=T[k-1].length,w=l.startIndex+c,v=l.startLine+k-1,C=k===1?l.startCol+I:I,P=f.startsWith("|"),L={...l,message:m.msg("$1 in URL",P?'"|"':"full-width punctuation"),startIndex:w,endIndex:w+f.length,startLine:v,endLine:v,startCol:C,endCol:C+f.length};P?f.length===1&&(L.suggestions=[{desc:"whitespace",range:[w,w+1],text:" "}]):L.suggestions=[{desc:"whitespace",range:[w,w],text:" "},{desc:"escape",range:[w,L.endIndex],text:encodeURI(f)}],t.push(L)}}return t}}});var Te,it,Zr=y(()=>{"use strict";ue();j();E();G();Jt();it=class extends b{constructor(e,t="",r="",n=m.getConfig(),i=[]){super(void 0,n,i,{});x(this,"type","ext-link");A(this,Te,void 0);let a=e&&/\0\d+f\x7F/u.test(e)?i[Number(e.slice(1,-2))]:new Ie(e,!0,n,i);if(this.insertAt(a),$(this,Te,t),r){let o=new b(r,n,i,{});o.type="ext-link-text",o.setAttribute("stage",10),this.insertAt(o)}}toString(){return this.length===1?`[${super.toString()}${h(this,Te)}]`:`[${super.toString(h(this,Te))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return h(this,Te).length}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&r.push(N(this,{start:e},"var-anchor","variable anchor in a section header")),r}print(){return super.print(this.length===1?{pre:"[",post:`${h(this,Te)}]`}:{pre:"[",sep:h(this,Te),post:"]"})}};Te=new WeakMap});var wt,gi=y(()=>{"use strict";E();G();Ge();Vr();Zr();wt=class extends b{constructor(e,t,r,n=m.getConfig(),i=[]){super(void 0,n,i);x(this,"type","imagemap-link");this.append(e,t.length===2?new nt(...t,n,i):new it(...t,n,i),new V(r,n,i))}}});var pi={};W(pi,{ImagemapToken:()=>Qr});var Qr,ui=y(()=>{"use strict";j();Pe();E();G();Ge();Hr();gi();Qr=class extends b{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});x(this,"type","ext-inner");if(!e)return;let n=e.split(`
18
+ `),i=new Set(t.protocol.split("|")),a=V,o=!0,p=!1;for(let g of n){let l=g.trim();if(!(p||!l||l.startsWith("#"))){if(o){let[u,...c]=g.split("|"),f=this.normalizeTitle(u,0,!0);if(f.valid&&!f.interwiki&&f.ns===6){let T=new rt("imagemap",u,c.length>0?c.join("|"):void 0,t,r);super.insertAt(T),o=!1;continue}else p=!0}else if(g.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let u=g.indexOf("["),c=g.slice(u),f=/^\[\[([^|]+)(?:\|([^\]]+))?\]\][\w\s]*$/u.exec(c);if(f){if(this.normalizeTitle(f[1],0,!0,!1,!0).valid){super.insertAt(new wt(g.slice(0,u),f.slice(1),c.slice(c.indexOf("]]")+2),t,r));continue}}else if(i.has(c.slice(1,c.indexOf(":")+1))||i.has(c.slice(1,c.indexOf("//")+2))){let T=/^\[([^\]\s]+)(?:(\s+(?=\S))([^\]]*))?\][\w\s]*$/u.exec(c);if(T){super.insertAt(new wt(g.slice(0,u),T.slice(1),c.slice(c.indexOf("]")+1),t,r));continue}}}}super.insertAt(new a(g,t,r))}}get image(){return this.childNodes.find(Re("imagemap-image"))}toString(){return super.toString(`
19
19
  `)}text(){return super.text(`
20
20
  `).replace(/\n{2,}/gu,`
21
- `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),n={start:e,...this.getRootNode().posFromIndex(e)};return this.image?r.push(...this.childNodes.filter(i=>{let a=String(i).trim();return i.type==="noinclude"&&a&&!a.startsWith("#")}).map(i=>C(i,n,"invalid-imagemap","invalid link in <imagemap>"))):r.push(N(this,n,"invalid-imagemap","<imagemap> without an image")),r}print(){return super.print({sep:`
22
- `})}}});var oi={};U(oi,{NowikiToken:()=>Dr});var Dr,ai=y(()=>{"use strict";j();w();we();Dr=class extends Q{constructor(){super(...arguments);T(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let{name:t,firstChild:{data:r}}=this;if((t==="templatestyles"||t==="section")&&r){let n=N(this,{start:e},"void-ext",m.msg("nothing should be in <$1>",t));return n.fix={range:[e-1,n.endIndex+t.length+3],text:"/>"},[n]}return super.lint(e,new RegExp(`<\\s*(?:\\/\\s*)${t==="nowiki"?"":"?"}(${t})\\b`,"giu"))}}});var li,Xe,Gr=y(()=>{"use strict";j();w();G();Sr();Pt();li=(g,s)=>{let e=new Set(g);return e.delete(s),[...e]},Xe=class extends Ue{constructor(e,t,r,n,i=m.getConfig(),a=[]){var c;let o=e.toLowerCase(),d=new Ce(!t||t.trimStart()!==t?t:` ${t}`,"ext-attrs",o,i,a),p={...i,ext:li(i.ext,o),excludes:[...(c=i.excludes)!=null?c:[]]},l;switch(p.inExt=!0,o){case"tab":p.ext=li(p.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":o==="poem"&&p.excludes.push("heading"),l=new b(r,p,a);break;case"pre":{let{PreToken:u}=(On(),_(Bn));l=new u(r,p,a);break}case"dynamicpagelist":{let{ParamTagToken:u}=(Nr(),_(_n));l=new u(r,p,a);break}case"inputbox":{p.excludes.push("heading");let{InputboxToken:u}=(Qn(),_(Zn));l=new u(r,p,a);break}case"references":{let{NestedToken:u}=(Wt(),_(Mt));l=new u(r,/<!--.*?(?:-->|$)|<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],p,a);break}case"choose":{let{NestedToken:u}=(Wt(),_(Mt));l=new u(r,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],p,a);break}case"combobox":{let{NestedToken:u}=(Wt(),_(Mt));l=new u(r,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],p,a);break}case"gallery":{let{GalleryToken:u}=(ri(),_(ti));l=new u(r,p,a);break}case"imagemap":{let{ImagemapToken:u}=(si(),_(ii));l=new u(r,p,a);break}default:{let{NowikiToken:u}=(ai(),_(oi));l=new u(r,p)}}l.setAttribute("name",o),l.type="ext-inner";super(e,d,l,n,i,a);T(this,"type","ext");this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),n;return this.name!=="nowiki"&&this.closest("html-attrs, table-attrs")&&(n={start:e,...this.getRootNode().posFromIndex(e)},r.push(N(this,n,"parsing-order","extension tag in HTML tag attributes"))),this.name==="ref"&&this.closest("heading-title")&&(n!=null||(n={start:e,...this.getRootNode().posFromIndex(e)}),r.push(N(this,n,"var-anchor","variable anchor in a section header"))),r}}});var di={};U(di,{parseCommentAndExt:()=>As});var As,gi=y(()=>{"use strict";w();$n();Pe();Nn();Gr();Rr();As=(g,s=m.getConfig(),e=[],t=!1)=>{let r="<onlyinclude>",n="</onlyinclude>",{length:i}=r,a=()=>{let c=g.indexOf(r);return{i:c,j:g.indexOf(n,c+i)}};if(t){let{i:c,j:u}=a();if(c!==-1&&u!==-1){let f="",x=k=>{new V(k,s,e),f+=`\0${e.length-1}c\x7F`};for(;c!==-1&&u!==-1;){let k=`\0${e.length}e\x7F`;new It(g.slice(c+i,u),s,e),c>0&&x(g.slice(0,c)),f+=k,g=g.slice(u+i+1),{i:c,j:u}=a()}return g&&x(g),f}}let o=s.ext.join("|"),d=t?"includeonly":"(?:no|only)include",p=t?"noinclude":"includeonly",l=new RegExp(`<!--.*?(?:-->|$)|<${d}(?:\\s[^>]*)?>|</${d}\\s*>|<(${o})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|<(${p})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(${p}\\s*)>|$))`,"gisu");return g.replace(l,(c,u,f,x,k,F,S,v,I)=>{let P=`\0${e.length}${u?"e":"c"}\x7F`;if(u)new Xe(u,f,x,k,s,e);else if(c.startsWith("<!--")){let L=c.endsWith("-->");new Qe(c.slice(4,L?-3:void 0),L,s,e)}else F?new Et(F,S,v,I,s,e):new V(c,s,e);return P})}});var vs,ws,Ss,nt,ie,Ie,Xt,pi=y(()=>{"use strict";j();D();w();G();vs=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),ws=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"]),Ss=new Set(["strike","big","center","font","tt"]),Xt=class extends b{constructor(e,t,r,n,i=m.getConfig(),a=[]){super(void 0,i,a);T(this,"type","html");A(this,nt,void 0);A(this,ie,void 0);A(this,Ie,void 0);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),$(this,nt,r),$(this,ie,n),$(this,Ie,e)}get selfClosing(){return h(this,ie)}get closing(){return h(this,nt)}toString(){return`<${this.closing?"/":""}${h(this,Ie)}${super.toString()}${h(this,ie)?"/":""}>`}text(){let{closing:e}=this,t=`${h(this,Ie)}${e?"":super.text()}`;return`<${e?"/":""}${t}${h(this,ie)?"/":""}>`}getAttribute(e){return e==="padding"?h(this,Ie).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){var i;let r=super.lint(e,t),n;this.name==="h1"&&!this.closing&&(n=N(this,{start:e},"h1","<h1>"),r.push(n)),this.closest("table-attrs")&&(n!=null||(n=N(this,{start:e},"h1","")),r.push({...n,rule:"parsing-order",message:m.msg("HTML tag in table attributes")}));try{this.findMatchingTag()}catch(a){if(a instanceof SyntaxError){let{message:o}=a;n!=null||(n=N(this,{start:e},"h1",""));let[d]=o.split(":"),p={...n,rule:"unmatched-tag",message:m.msg(d)};if(d==="unclosed tag"&&!this.closest("heading-title"))if(ws.has(this.name)){let l=(i=this.parentNode)==null?void 0:i.childNodes,c=l==null?void 0:l.indexOf(this);l!=null&&l.slice(0,c).some(({type:u,name:f})=>u==="html"&&f===this.name)||(p.severity="warning")}else p.severity="warning";else if(d==="unmatched closing tag"){let l=this.closest("magic-word");l&&vs.has(l.name)?p.severity="warning":p.suggestions=[{desc:"remove",range:[e,p.endIndex],text:""}]}else if(d==="tag that is both closing and self-closing"){let{html:[,,l]}=this.getAttribute("config");l.includes(this.name)&&(p.fix={range:[e+1,e+2],text:""})}r.push(p)}}return Ss.has(this.name)&&(n!=null||(n=N(this,{start:e},"h1","")),r.push({...n,rule:"obsolete-tag",message:m.msg("obsolete HTML tag"),severity:"warning"})),(this.name==="b"||this.name==="strong")&&this.closest("heading-title")&&(n!=null||(n=N(this,{start:e},"h1","")),r.push({...n,rule:"bold-header",message:m.msg("bold in section header"),severity:"warning"})),r}findMatchingTag(){let{html:[e,t,r]}=this.getAttribute("config"),{name:n,parentNode:i,closing:a}=this,o=Tn(String(this));if(a&&(h(this,ie)||r.includes(n)))throw new SyntaxError(`tag that is both closing and self-closing: ${o}`);if(r.includes(n)||h(this,ie)&&t.includes(n))return this;if(h(this,ie)&&e.includes(n))throw new SyntaxError(`invalid self-closing tag: ${o}`);if(!i)return;let{childNodes:d}=i,p=d.indexOf(this),l=(a?d.slice(0,p).reverse():d.slice(p+1)).filter(u=>u.type==="html"&&u.name===n),c=a?-1:1;for(let u of l)if(h(u,nt)?c--:c++,c===0)return u;throw new SyntaxError(`${a?"unmatched closing":"unclosed"} tag: ${o}`)}print(){return super.print({pre:`&lt;${this.closing?"/":""}${h(this,Ie)}`,post:`${h(this,ie)?"/":""}&gt;`})}json(){let e=super.json();return Object.assign(e,{closing:this.closing,selfClosing:h(this,ie)}),e}};nt=new WeakMap,ie=new WeakMap,Ie=new WeakMap});var ui={};U(ui,{parseHtml:()=>Cs});var Cs,ci=y(()=>{"use strict";w();Pt();pi();Cs=(g,s=m.getConfig(),e=[])=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,r=new Set(s.html.flat()),n=g.split("<"),i=n.shift();for(let a of n){let o=t.exec(a),d=o==null?void 0:o[2],p=d==null?void 0:d.toLowerCase();if(!o||!r.has(p)){i+=`<${a}`;continue}let[,l,,c="",u,f]=o,x=new Ce(c,"html-attrs",p,s,e),k=x.getAttr("itemprop");if(p==="meta"&&(k===void 0||x.getAttr("content")===void 0)||p==="link"&&(k===void 0||x.getAttr("href")===void 0)){i+=`<${a}`,e.pop();continue}i+=`\0${e.length}x\x7F${f}`,new Xt(d,x,l==="/",u==="/>",s,e)}return i}});var hi,fi=y(()=>{"use strict";hi=(g=0)=>(s,e)=>{var r,mi;class t extends s{constructor(){super(...arguments);A(this,r)}getAttr(o){return h(this,r,mi).getAttr(o)}}return r=new WeakSet,mi=function(){return this.childNodes[g]},Object.defineProperty(t,"name",{value:s.name}),t}});var it,Vr=y(()=>{"use strict";fi();w();G();xt();Pt();it=class extends hi(1)(b){constructor(s,e,t,r=m.getConfig(),n=[],i={}){super(void 0,r,n,i),this.append(new me(e,s,"table-syntax",r,n,{}),new Ce(t,"table-attrs",this.type,r,n))}}});var se,kt,Zr,Be,Qr=y(()=>{"use strict";j();ue();w();G();Vr();Be=class extends it{constructor(e,t,r=m.getConfig(),n=[]){var d;let i=/\||\0\d+!\x7F/u.exec(t!=null?t:""),a=i?t.slice(0,i.index):"";/\[\[|-\{/u.test(a)&&(i=null,a="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,a,r,n);A(this,kt);T(this,"type","td");A(this,se,"");i&&([wt(this,se)._]=i);let o=new b(t==null?void 0:t.slice(((d=i==null?void 0:i.index)!=null?d:NaN)+h(this,se).length),r,n);o.type="td-inner",o.setAttribute("stage",4),this.insertAt(o)}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return R(this,kt,Zr).call(this).subtype}afterBuild(){h(this,se).includes("\0")&&$(this,se,this.buildFromStr(h(this,se),0))}toString(){let{childNodes:[e,t,r]}=this;return`${String(e)}${String(t)}${h(this,se)}${String(r)}`}text(){let{childNodes:[e,t,r]}=this;return`${e.text()}${t.text()}${h(this,se)}${r.text()}`}getGaps(e){return e===1?h(this,se).length:0}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);e+=this.getRelativeIndex(this.length-1);for(let n of this.lastChild.childNodes)if(n.type==="text"){let{data:i}=n;if(i.includes("|")){let a=i.includes("||"),o=C(n,{start:e},"pipe-like",'additional "|" in a table cell',a?"error":"warning");if(a){let d={caption:"|+",td:"|",th:"!"}[this.subtype];o.fix={range:[o.startIndex,o.endIndex],text:i.replace(/\|\|/gu,`
23
- ${d}`)}}else o.suggestions=[{desc:"escape",range:[o.startIndex,o.endIndex],text:i.replace(/\|/gu,"&#124;")}];r.push(o)}}return r}isIndependent(){return this.firstChild.text().startsWith(`
24
- `)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${h(this,se)}${r.print()}</span>`}json(){let e=super.json();return e.subtype=this.subtype,e}};se=new WeakMap,kt=new WeakSet,Zr=function(){var a;let e=this.firstChild.text(),t=e.slice(-1),r="td";if(t==="!"?r="th":t==="+"&&(r="caption"),this.isIndependent())return{subtype:r};let{previousSibling:n}=this;return R(a=n,kt,Zr).call(a)}});var st,Xr=y(()=>{"use strict";j();Re();Vr();Qr();st=class extends it{lint(s=this.getAbsoluteIndex(),e){let t=super.lint(s,e),r=this.childNodes.find(({type:p})=>p==="table-inter");if(!r)return t;let n=r.childNodes.find(p=>p.text().trim()),i=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u,a=Le("arg"),o=Le("magic-word");if(!n||i.test(String(n))||a(n)&&i.test(n.default||""))return t;if(o(n))try{if(n.getPossibleValues().every(p=>i.test(p.text())))return t}catch(p){}let d=C(r,{start:s},"fostered-content","content to be moved out from the table");return d.severity=n.type==="template"?"warning":"error",d.startIndex++,d.startLine++,d.startCol=0,t.push(d),t}getRowCount(){return Number(this.childNodes.some(s=>s instanceof Be&&s.isIndependent()&&!s.firstChild.text().endsWith("+")))}getNthCol(s,e=!1){let t=0;for(let r of this.childNodes.slice(2))if(r instanceof Be&&(r.isIndependent()&&(t=+(r.subtype!=="caption")),s-=t,s<0))return r}}});var $s,Ns,Kr,Kt,xi=y(()=>{"use strict";j();Re();w();Xr();xt();$s=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,Ns=({type:g})=>g==="tr"||g==="table-syntax",Kr=class extends Array{},Kt=class extends st{constructor(e,t,r=m.getConfig(),n=[]){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,t,r,n,{});T(this,"type","table")}get closed(){return this.lastChild.type==="table-syntax"}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);this.closed||r.push(C(this.firstChild,{start:e},"unclosed-table",m.msg("unclosed $1","table")));let n=this.getLayout(),{length:i}=n;if(i>1){let a=1,o=1/0,d=0;for(;d<i;d++){let p=n[d],l=p.length;if(l<a)break;l<o&&(o=l);let{colspan:c}=this.getNthCell(p[p.length-1]),u=l-c+1;if(u>o)break;u>a&&(a=u)}if(d<i){let p=C(this.getNthRow(d),{start:e},"table-layout","inconsistent table layout","warning");p.startIndex++,p.startLine++,p.startCol=0,r.push(p)}}return r}close(e=`
25
- |}`,t=!1){let r=this.getAttribute("config"),n=this.getAttribute("accum"),i=t?[e]:m.parse(e,this.getAttribute("include"),2,r).childNodes,a=Fe.run(()=>super.insertAt(new me(void 0,$s,"table-syntax",r,n,{})));t||a.afterBuild(),this.lastChild.replaceChildren(...i)}getLayout(e){let t=this.getAllRows(),{length:r}=t,n=new Kr(...un(r,()=>[]));for(let i=0;i<r;i++){let a=n[i],o=0,d=0,p;for(let l of t[i].childNodes.slice(2))if(l.type==="td"){if(l.isIndependent()&&(p=l.subtype!=="caption"),p){let c={row:i,column:o},{rowspan:u,colspan:f}=l;for(o++;a[d];)d++;for(let x=i;x<Math.min(i+u,r);x++)for(let k=d;k<d+f;k++)n[x][k]=c;d+=f}}else if(Ns(l))break}return n}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.type==="tr"&&e.getRowCount()>0)]}getNthCell(e){var r;let t=e;return t&&((r=this.getNthRow(t.row,!1,!1))==null?void 0:r.getNthCol(t.column))}getNthRow(e,t=!1,r=!1){let n=super.getRowCount();if(e===0&&n)return this;n&&e--;for(let i of this.childNodes.slice(2))if(i.type==="tr"&&i.getRowCount()&&(e--,e<0))return i}json(){let e=super.json();return e.closed=this.closed,e}}});var Jt,Ti=y(()=>{"use strict";w();Xr();Jt=class extends st{constructor(e,t,r=m.getConfig(),n=[]){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,t,r,n,{});T(this,"type","tr")}}});var ot,Jr=y(()=>{"use strict";we();ot=class extends Q{}});var at,Yr=y(()=>{"use strict";Jr();at=class extends ot{constructor(){super(...arguments);T(this,"type","dd")}}});var bi={};U(bi,{parseTable:()=>Es});var Is,Es,ki=y(()=>{"use strict";w();G();xi();Ti();Qr();Yr();Is=g=>g.lastChild.constructor!==b,Es=({firstChild:{data:g},type:s,name:e},t=m.getConfig(),r=[])=>{let n=[],i=g.split(`
21
+ `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),n={start:e,...this.getRootNode().posFromIndex(e)};return this.image?r.push(...this.childNodes.filter(i=>{let a=String(i).trim();return i.type==="noinclude"&&a&&!a.startsWith("#")}).map(i=>S(i,n,"invalid-imagemap","invalid link in <imagemap>"))):r.push(N(this,n,"invalid-imagemap","<imagemap> without an image")),r}print(){return super.print({sep:`
22
+ `})}}});var ci={};W(ci,{NowikiToken:()=>Xr});var Xr,hi=y(()=>{"use strict";j();E();Se();Xr=class extends Q{constructor(){super(...arguments);x(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let{name:t,firstChild:{data:r}}=this;if((t==="templatestyles"||t==="section")&&r){let n=N(this,{start:e},"void-ext",m.msg("nothing should be in <$1>",t));return n.fix={range:[e-1,n.endIndex+t.length+3],text:"/>"},[n]}return super.lint(e,new RegExp(`<\\s*(?:\\/\\s*)${t==="nowiki"?"":"?"}(${t})\\b`,"giu"))}}});var mi,Ye,Or=y(()=>{"use strict";j();E();G();Ir();jt();mi=(d,s)=>{let e=new Set(d);return e.delete(s),[...e]},Ye=class extends Ve{constructor(e,t,r,n,i=m.getConfig(),a=[]){var u;let o=e.toLowerCase(),p=new $e(!t||t.trimStart()!==t?t:` ${t}`,"ext-attrs",o,i,a),g={...i,ext:mi(i.ext,o),excludes:[...(u=i.excludes)!=null?u:[]]},l;switch(g.inExt=!0,o){case"tab":g.ext=mi(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"),l=new b(r,g,a);break;case"pre":{let{PreToken:c}=(Dn(),_(Hn));l=new c(r,g,a);break}case"dynamicpagelist":{let{ParamTagToken:c}=(Rr(),_(Vn));l=new c(r,g,a);break}case"inputbox":{g.excludes.push("heading");let{InputboxToken:c}=(ri(),_(ti));l=new c(r,g,a);break}case"references":{let{NestedToken:c}=(Ht(),_(Ut));l=new c(r,/<!--.*?(?:-->|$)|<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],g,a);break}case"choose":{let{NestedToken:c}=(Ht(),_(Ut));l=new c(r,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],g,a);break}case"combobox":{let{NestedToken:c}=(Ht(),_(Ut));l=new c(r,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],g,a);break}case"gallery":{let{GalleryToken:c}=(di(),_(li));l=new c(r,g,a);break}case"imagemap":{let{ImagemapToken:c}=(ui(),_(pi));l=new c(r,g,a);break}default:{let{NowikiToken:c}=(hi(),_(ci));l=new c(r,g)}}l.setAttribute("name",o),l.type="ext-inner";super(e,p,l,n,i,a);x(this,"type","ext");this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),n;return this.name!=="nowiki"&&this.closest("html-attrs, table-attrs")&&(n={start:e,...this.getRootNode().posFromIndex(e)},r.push(N(this,n,"parsing-order","extension tag in HTML tag attributes"))),this.name==="ref"&&this.closest("heading-title")&&(n!=null||(n={start:e,...this.getRootNode().posFromIndex(e)}),r.push(N(this,n,"var-anchor","variable anchor in a section header"))),r}}});var fi={};W(fi,{parseCommentAndExt:()=>Fs});var Fs,xi=y(()=>{"use strict";Pn();Ge();Gn();Or();Br();Fs=(d,s,e,t)=>{let r="<onlyinclude>",n="</onlyinclude>",{length:i}=r,a=()=>{let u=d.indexOf(r);return{i:u,j:d.indexOf(n,u+i)}};if(t){let{i:u,j:c}=a();if(u!==-1&&c!==-1){let f="",T=k=>{new V(k,s,e),f+=`\0${e.length-1}c\x7F`};for(;u!==-1&&c!==-1;){let k=`\0${e.length}e\x7F`;new Lt(d.slice(u+i,c),s,e),u>0&&T(d.slice(0,u)),f+=k,d=d.slice(c+i+1),{i:u,j:c}=a()}return d&&T(d),f}}let o=s.ext.join("|"),p=t?"includeonly":"(?:no|only)include",g=t?"noinclude":"includeonly",l=new RegExp(`<!--.*?(?:-->|$)|<${p}(?:\\s[^>]*)?>|</${p}\\s*>|<(${o})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|<(${g})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(${g}\\s*)>|$))`,"gisu");return d.replace(l,(u,c,f,T,k,I,w,v,C)=>{let P=`\0${e.length}${c?"e":"c"}\x7F`;if(c)new Ye(c,f,T,k,s,e);else if(u.startsWith("<!--")){let L=u.endsWith("-->");new Je(u.slice(4,L?-3:void 0),L,s,e)}else I?new Rt(I,w,v,C,s,e):new V(u,s,e);return P})}});var Ls,Rs,Ps,st,ie,Fe,Yt,Ti=y(()=>{"use strict";j();H();E();G();Ls=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Rs=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"]),Yt=class extends b{constructor(e,t,r,n,i=m.getConfig(),a=[]){super(void 0,i,a);x(this,"type","html");A(this,st,void 0);A(this,ie,void 0);A(this,Fe,void 0);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),$(this,st,r),$(this,ie,n),$(this,Fe,e)}get selfClosing(){return h(this,ie)}get closing(){return h(this,st)}toString(){return`<${this.closing?"/":""}${h(this,Fe)}${super.toString()}${h(this,ie)?"/":""}>`}text(){let{closing:e}=this,t=`${h(this,Fe)}${e?"":super.text()}`;return`<${e?"/":""}${t}${h(this,ie)?"/":""}>`}getAttribute(e){return e==="padding"?h(this,Fe).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){var i;let r=super.lint(e,t),n;this.name==="h1"&&!this.closing&&(n=N(this,{start:e},"h1","<h1>"),r.push(n)),this.closest("table-attrs")&&(n!=null||(n=N(this,{start:e},"h1","")),r.push({...n,rule:"parsing-order",message:m.msg("HTML tag in table attributes")}));try{this.findMatchingTag()}catch(a){if(a instanceof SyntaxError){let{message:o}=a;n!=null||(n=N(this,{start:e},"h1",""));let[p]=o.split(":"),g={...n,rule:"unmatched-tag",message:m.msg(p)};if(p==="unclosed tag"&&!this.closest("heading-title"))if(Rs.has(this.name)){let l=(i=this.parentNode)==null?void 0:i.childNodes,u=l==null?void 0:l.indexOf(this);l!=null&&l.slice(0,u).some(({type:c,name:f})=>c==="html"&&f===this.name)||(g.severity="warning")}else g.severity="warning";else if(p==="unmatched closing tag"){let l=this.closest("magic-word");l&&Ls.has(l.name)?g.severity="warning":g.suggestions=[{desc:"remove",range:[e,g.endIndex],text:""}]}else if(p==="tag that is both closing and self-closing"){let{html:[,,l]}=this.getAttribute("config");l.includes(this.name)&&(g.fix={range:[e+1,e+2],text:""})}r.push(g)}}return Ps.has(this.name)&&(n!=null||(n=N(this,{start:e},"h1","")),r.push({...n,rule:"obsolete-tag",message:m.msg("obsolete HTML tag"),severity:"warning"})),(this.name==="b"||this.name==="strong")&&this.closest("heading-title")&&(n!=null||(n=N(this,{start:e},"h1","")),r.push({...n,rule:"bold-header",message:m.msg("bold in section header"),severity:"warning"})),r}findMatchingTag(){let{html:[e,t,r]}=this.getAttribute("config"),{name:n,parentNode:i,closing:a}=this,o=Sn(String(this));if(a&&(h(this,ie)||r.includes(n)))throw new SyntaxError(`tag that is both closing and self-closing: ${o}`);if(r.includes(n)||h(this,ie)&&t.includes(n))return this;if(h(this,ie)&&e.includes(n))throw new SyntaxError(`invalid self-closing tag: ${o}`);if(!i)return;let{childNodes:p}=i,g=p.indexOf(this),l=(a?p.slice(0,g).reverse():p.slice(g+1)).filter(c=>c.type==="html"&&c.name===n),u=a?-1:1;for(let c of l)if(h(c,st)?u--:u++,u===0)return c;throw new SyntaxError(`${a?"unmatched closing":"unclosed"} tag: ${o}`)}print(){return super.print({pre:`&lt;${this.closing?"/":""}${h(this,Fe)}`,post:`${h(this,ie)?"/":""}&gt;`})}json(){let e=super.json();return Object.assign(e,{closing:this.closing,selfClosing:h(this,ie)}),e}};st=new WeakMap,ie=new WeakMap,Fe=new WeakMap});var bi={};W(bi,{parseHtml:()=>Gs});var Gs,ki=y(()=>{"use strict";jt();Ti();Gs=(d,s,e)=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,r=new Set(s.html.flat()),n=d.split("<"),i=n.shift();for(let a of n){let o=t.exec(a),p=o==null?void 0:o[2],g=p==null?void 0:p.toLowerCase();if(!o||!r.has(g)){i+=`<${a}`;continue}let[,l,,u="",c,f]=o,{length:T}=e,k=new $e(u,"html-attrs",g,s,e),I=k.getAttr("itemprop");if(g==="meta"&&(I===void 0||k.getAttr("content")===void 0)||g==="link"&&(I===void 0||k.getAttr("href")===void 0)){i+=`<${a}`,e.length=T;continue}i+=`\0${e.length}x\x7F${f}`,new Yt(p,k,l==="/",c==="/>",s,e)}return i}});var yi,vi=y(()=>{"use strict";yi=(d=0)=>(s,e)=>{var r,Ai;class t extends s{constructor(){super(...arguments);A(this,r)}getAttr(o){return h(this,r,Ai).getAttr(o)}}return r=new WeakSet,Ai=function(){return this.childNodes[d]},Object.defineProperty(t,"name",{value:s.name}),t}});var ot,Kr=y(()=>{"use strict";vi();E();G();At();jt();ot=class extends yi(1)(b){constructor(s,e,t,r=m.getConfig(),n=[],i={}){super(void 0,r,n,i),this.append(new me(e,s,"table-syntax",r,n,{}),new $e(t,"table-attrs",this.type,r,n))}}});var se,St,Jr,_e,Yr=y(()=>{"use strict";j();ue();E();G();Kr();_e=class extends ot{constructor(e,t,r=m.getConfig(),n=[]){var p;let i=/\||\0\d+!\x7F/u.exec(t!=null?t:""),a=i?t.slice(0,i.index):"";/\[\[|-\{/u.test(a)&&(i=null,a="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,a,r,n);A(this,St);x(this,"type","td");A(this,se,"");i&&([Et(this,se)._]=i);let o=new b(t==null?void 0:t.slice(((p=i==null?void 0:i.index)!=null?p:NaN)+h(this,se).length),r,n);o.type="td-inner",o.setAttribute("stage",4),this.insertAt(o)}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return F(this,St,Jr).call(this).subtype}afterBuild(){h(this,se).includes("\0")&&$(this,se,this.buildFromStr(h(this,se),0))}toString(){let{childNodes:[e,t,r]}=this;return`${String(e)}${String(t)}${h(this,se)}${String(r)}`}text(){let{childNodes:[e,t,r]}=this;return`${e.text()}${t.text()}${h(this,se)}${r.text()}`}getGaps(e){return e===1?h(this,se).length:0}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);e+=this.getRelativeIndex(this.length-1);for(let n of this.lastChild.childNodes)if(n.type==="text"){let{data:i}=n;if(i.includes("|")){let a=i.includes("||"),o=S(n,{start:e},"pipe-like",'additional "|" in a table cell',a?"error":"warning");if(a){let p={caption:"|+",td:"|",th:"!"}[this.subtype];o.fix={range:[o.startIndex,o.endIndex],text:i.replace(/\|\|/gu,`
23
+ ${p}`)}}else o.suggestions=[{desc:"escape",range:[o.startIndex,o.endIndex],text:i.replace(/\|/gu,"&#124;")}];r.push(o)}}return r}isIndependent(){return this.firstChild.text().startsWith(`
24
+ `)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${h(this,se)}${r.print()}</span>`}json(){let e=super.json();return e.subtype=this.subtype,e}};se=new WeakMap,St=new WeakSet,Jr=function(){var a;let e=this.firstChild.text(),t=e.slice(-1),r="td";if(t==="!"?r="th":t==="+"&&(r="caption"),this.isIndependent())return{subtype:r};let{previousSibling:n}=this;return F(a=n,St,Jr).call(a)}});var at,en=y(()=>{"use strict";j();Pe();Kr();Yr();at=class extends ot{lint(s=this.getAbsoluteIndex(),e){let t=super.lint(s,e),r=this.childNodes.find(({type:g})=>g==="table-inter");if(!r)return t;let n=r.childNodes.find(g=>g.text().trim()),i=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u,a=Re("arg"),o=Re("magic-word");if(!n||i.test(String(n))||a(n)&&i.test(n.default||""))return t;if(o(n))try{if(n.getPossibleValues().every(g=>i.test(g.text())))return t}catch(g){}let p=S(r,{start:s},"fostered-content","content to be moved out from the table");return p.severity=n.type==="template"?"warning":"error",p.startIndex++,p.startLine++,p.startCol=0,t.push(p),t}getRowCount(){return Number(this.childNodes.some(s=>s instanceof _e&&s.isIndependent()&&!s.firstChild.text().endsWith("+")))}getNthCol(s,e){let t=0;for(let r of this.childNodes.slice(2))if(r instanceof _e&&(r.isIndependent()&&(t=+(r.subtype!=="caption")),s-=t,s<0))return r}}});var js,qs,tn,er,wi=y(()=>{"use strict";j();Pe();E();en();At();js=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,qs=({type:d})=>d==="tr"||d==="table-syntax",tn=class extends Array{},er=class extends at{constructor(e,t,r=m.getConfig(),n=[]){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,t,r,n,{});x(this,"type","table")}get closed(){return this.lastChild.type==="table-syntax"}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);this.closed||r.push(S(this.firstChild,{start:e},"unclosed-table",m.msg("unclosed $1","table")));let n=this.getLayout(),{length:i}=n;if(i>1){let a=1,o=1/0,p=0;for(;p<i;p++){let g=n[p],l=g.length;if(l<a)break;l<o&&(o=l);let{colspan:u}=this.getNthCell(g[g.length-1]),c=l-u+1;if(c>o)break;c>a&&(a=c)}if(p<i){let g=S(this.getNthRow(p),{start:e},"table-layout","inconsistent table layout","warning");g.startIndex++,g.startLine++,g.startCol=0,r.push(g)}}return r}close(e=`
25
+ |}`,t){let r=this.getAttribute("config"),n=this.getAttribute("accum"),i=t?[e]:m.parse(e,this.getAttribute("include"),2,r).childNodes,a=Ae.run(()=>super.insertAt(new me(void 0,js,"table-syntax",r,n,{})));t||a.afterBuild(),this.lastChild.replaceChildren(...i)}getLayout(e){let t=this.getAllRows(),{length:r}=t,n=new tn(...Tn(r,()=>[]));for(let i=0;i<r;i++){let a=n[i],o=0,p=0,g;for(let l of t[i].childNodes.slice(2))if(l.type==="td"){if(l.isIndependent()&&(g=l.subtype!=="caption"),g){let u={row:i,column:o},{rowspan:c,colspan:f}=l;for(o++;a[p];)p++;for(let T=i;T<Math.min(i+c,r);T++)for(let k=p;k<p+f;k++)n[T][k]=u;p+=f}}else if(qs(l))break}return n}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.type==="tr"&&e.getRowCount()>0)]}getNthCell(e){var r;let t=e.row===void 0?void 0:e;return t&&((r=this.getNthRow(t.row,!1,!1))==null?void 0:r.getNthCol(t.column))}getNthRow(e,t,r){let n=super.getRowCount();if(e===0&&n)return this;n&&e--;for(let i of this.childNodes.slice(2))if(i.type==="tr"&&i.getRowCount()&&(e--,e<0))return i}json(){let e=super.json();return e.closed=this.closed,e}}});var tr,Si=y(()=>{"use strict";E();en();tr=class extends at{constructor(e,t,r=m.getConfig(),n=[]){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,t,r,n,{});x(this,"type","tr")}}});var lt,rn=y(()=>{"use strict";Se();lt=class extends Q{}});var dt,nn=y(()=>{"use strict";rn();dt=class extends lt{constructor(){super(...arguments);x(this,"type","dd")}}});var Ci={};W(Ci,{parseTable:()=>_s});var Bs,_s,$i=y(()=>{"use strict";G();wi();Si();Yr();nn();Bs=d=>d.lastChild.constructor!==b,_s=({firstChild:{data:d},type:s,name:e},t,r)=>{let n=[],i=d.split(`
26
26
  `),a=s==="root"||s==="parameter-value"||s==="ext-inner"&&e==="poem"?"":`
27
- ${i.shift()}`,o,d=(l,c)=>{if(!c){a+=l;return}let{lastChild:u}=c;if(Is(c)){let f=new b(l,t,r);f.type="table-inter",f.setAttribute("stage",3),c.insertAt(f)}else u.setText(String(u)+l)},p=()=>o.type==="td"?n.pop():o;for(let l of i){o=n.pop();let[c]=/^(?:\s|\0\d+c\x7F)*/u.exec(l),u=l.slice(c.length),f=/^(:*)((?:\s|\0\d+c\x7F)*)(\{\||\{(?:\0\d+c\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(u);if(f){for(;o&&o.type!=="td";)o=n.pop();let[,I,P,L,q]=f;I&&new at(I,t,r),d(`
28
- ${c}${I&&`\0${r.length-1}d\x7F`}${P}\0${r.length}b\x7F`,o),n.push(...o?[o]:[],new Kt(L,q,t,r));continue}else if(!o){a+=`
29
- ${l}`;continue}let x=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(u);if(!x){d(`
30
- ${l}`,o),n.push(o);continue}let[,k,F,S,v]=x;if(k){for(;o.type!=="table";)o=n.pop();o.close(`
31
- ${c}${k}`,!0),d(v,n[n.length-1])}else if(F){o=p(),o.type==="tr"&&(o=n.pop());let I=new Jt(`
32
- ${c}${F}`,v,t,r);n.push(o,I),o.insertAt(I)}else{o=p();let I=S==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,P=I.exec(v),L=0,q=`
33
- ${c}${S}`,J=M=>{let ae=new Be(q,v.slice(L,P==null?void 0:P.index),t,r);return M.insertAt(ae),ae};for(;P;)J(o),{lastIndex:L}=I,[q]=P,P=I.exec(v);n.push(o,J(o))}}return a.slice(1)}});var Yt,yi=y(()=>{"use strict";we();Yt=class extends Q{constructor(){super(...arguments);T(this,"type","hr")}}});var er,Ai=y(()=>{"use strict";We();w();we();er=class extends he(Q){constructor(e,t,r=m.getConfig(),n=[]){super(e,r,n);T(this,"type","double-underscore")}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}}});var vi={};U(vi,{parseHrAndDoubleUnderscore:()=>Fs});var Fs,wi=y(()=>{"use strict";w();yi();Ai();Ir();Fs=({firstChild:{data:g},type:s,name:e},t=m.getConfig(),r=[])=>{let{doubleUnderscore:n}=t,i=new Set(n[0]),a=new Set(n[1]);return s!=="root"&&(s!=="ext-inner"||e!=="poem")&&(g=`\0${g}`),g=g.replace(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(o,d,p)=>(new Yt(p,t,r),`${d}\0${r.length-1}r\x7F`)).replace(new RegExp(`__(${n.flat().join("|")})__`,"giu"),(o,d)=>{let p=a.has(d);return p||i.has(d.toLowerCase())?(new er(d,p,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,p,l,c)=>{let u=`${d}\0${r.length}h\x7F`;return new Ze(p.length,[l,c],t,r),u}),s==="root"||s==="ext-inner"&&e==="poem"?g:g.slice(1)}});var tr,Si=y(()=>{"use strict";Ut();tr=class extends Ne{constructor(){super(...arguments);T(this,"type","category")}}});var rr,Ci=y(()=>{"use strict";j();w();we();rr=class extends Q{constructor(){super(...arguments);T(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,i=m.msg('lonely "$1"',"'"),a=[],o;if((t==null?void 0:t.type)==="text"&&t.data.endsWith("'")){o=N(this,{start:e},"lonely-apos",i);let{startIndex:d,startLine:p,startCol:l}=o,[,{length:c}]=/(?:^|[^'])('+)$/u.exec(t.data),u=e-c;a.push({...o,startIndex:u,endIndex:d,startCol:l-c,endLine:p,endCol:l,suggestions:[{desc:"escape",range:[u,d],text:"&apos;".repeat(c)}]})}if((r==null?void 0:r.type)==="text"&&r.data.startsWith("'")){o!=null||(o=N(this,{start:e},"lonely-apos",i));let{endIndex:d,endLine:p,endCol:l}=o,[{length:c}]=/^'+/u.exec(r.data),u=d+c;a.push({...o,startIndex:d,endIndex:u,startLine:p,startCol:l,endCol:l+c,suggestions:[{desc:"escape",range:[d,u],text:"&apos;".repeat(c)}]})}return n&&this.closest("heading-title")&&(o!=null||(o=N(this,{start:e},"lonely-apos",i)),a.push({...o,rule:"bold-header",message:m.msg("bold in section header"),severity:"warning"})),a}json(){let e=super.json();return Object.assign(e,{bold:this.bold,italic:this.italic}),e}}});var en={};U(en,{parseQuotes:()=>Ls});var Ls,tn=y(()=>{"use strict";w();Ci();Ls=(g,s=m.getConfig(),e=[])=>{var p;let t=g.split(/('{2,})/u),{length:r}=t;if(r===1)return g;let n=0,i=0,a,o,d;for(let l=1;l<r;l+=2){let c=t[l].length;switch(c){case 2:i++;break;case 4:t[l-1]+="'",t[l]="'''";case 3:if(n++,a!==void 0)break;t[l-1].endsWith(" ")?o===void 0&&d===void 0&&(d=l):t[l-1].slice(-2,-1)===" "?a=l:o!=null||(o=l);break;default:t[l-1]+="'".repeat(c-5),t[l]="'''''",i++,n++}}if(i%2===1&&n%2===1){let l=(p=a!=null?a:o)!=null?p:d;l!==void 0&&(t[l]="''",t[l-1]+="'")}for(let l=1;l<r;l+=2)new rr(t[l],s,e),t[l]=`\0${e.length-1}q\x7F`;return t.join("")}});var Ni={};U(Ni,{parseLinks:()=>$i});var $i,Ii=y(()=>{"use strict";w();Mr();Or();Si();$i=(g,s=m.getConfig(),e=[])=>{let{parseQuotes:t}=(tn(),_(en)),r=s.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,i=new RegExp(`^\\s*(?:${s.protocol}|//)`,"iu"),a=g.split("[["),o=a.shift();for(let d=0;d<a.length;d++){let p=!1,l,c,u,f,x=a[d],k=r.exec(x);if(k)[,l,c,u,f]=k,f.startsWith("]")&&(u!=null&&u.includes("["))&&(u+="]",f=f.slice(1));else{let q=n.exec(x);q&&(p=!0,[,l,c,u]=q)}if(l===void 0||i.test(l)||/\0\d+[exhbru]\x7F/u.test(l)){o+=`[[${x}`;continue}let F=l.trim().startsWith(":");if(F&&p){o+=`[[${x}`;continue}let S=m.normalizeTitle(l,0,!1,s,!0,!0,!0),{ns:v,valid:I,interwiki:P}=S;if(I){if(p){if(P||v!==6){o+=`[[${x}`;continue}let q=!1;for(d++;d<a.length;d++){let J=a[d],M=J.split("]]");if(M.length>2){q=!0,u+=`[[${M[0]}]]${M[1]}`,f=M.slice(2).join("]]");break}else if(M.length===2)u+=`[[${M[0]}]]${M[1]}`;else{u+=`[[${J}`;break}}if(u=$i(u,s,e),!q){o+=`[[${l}${c}${u}`;continue}}}else{o+=`[[${x}`;continue}u&&(u=t(u,s,e)),o+=`\0${e.length}l\x7F${f}`;let L=et;F||(!P&&v===6?L=Je:!P&&v===14&&(L=tr)),u===void 0&&c&&(u=""),new L(l,u,s,e,c)}return o}});var Ei={};U(Ei,{parseExternalLinks:()=>Rs});var Rs,Fi=y(()=>{"use strict";D();w();Ur();Rs=(g,s=m.getConfig(),e=[])=>{let t=new RegExp(`\\[((?:(?:${s.protocol}|//)${Ae}|\0\\d+m\x7F)${ve}(?=[[\\]<>"\\t\\p{Zs}]|\0\\d))(\\p{Zs}*(?=\\P{Zs}))([^\\]-\b
34
- -\uFFFD]*)\\]`,"giu");return g.replace(t,(r,n,i,a)=>{let{length:o}=e,d=/&[lg]t;/u.exec(n);return d&&(n=n.slice(0,d.index),i="",a=`${n.slice(d.index)}${i}${a}`),new rt(n,i,a,s,e),`\0${o}w\x7F`})}});var Li={};U(Li,{parseMagicLinks:()=>Ps});var Ps,Ri=y(()=>{"use strict";D();w();Wr();Ps=(g,s=m.getConfig(),e=[])=>{let t=new RegExp(`(^|[^\\p{L}\\d_])(?:${s.protocol})(${Ae}${ve})`,"giu");return g.replace(t,(r,n,i)=>{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 p=new RegExp(`[,;.:!?${o.includes("(")?"":")"}]+$`,"u"),l=p.exec(o);if(l){let c=0;l[0].startsWith(";")&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(o.slice(0,l.index))&&(c=1),a=`${o.slice(l.index+c)}${a}`,o=o.slice(0,l.index+c)}return a.length>=i.length?r:(new tt(o,!1,s,e),`${n}\0${e.length-1}w\x7F${a}`)})}});var nr,Pi=y(()=>{"use strict";Jr();nr=class extends ot{constructor(){super(...arguments);T(this,"type","list")}}});var Gi={};U(Gi,{parseList:()=>Gs});var Gs,ji=y(()=>{"use strict";w();Pi();Yr();Gs=(g,s=m.getConfig(),e=[])=>{let t=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(g);if(!t)return g;let[r,n,i]=t,a=`${n}\0${e.length}d\x7F${g.slice(r.length)}`,o=i.split(";").length-1;if(new nr(i,s,e),!o)return a;let{html:[d]}=s,p=/:+|-\{|\0\d+[xq]\x7F/gu,l=p,c=l.exec(a),u=0,f=!1,x=!1,k=0,F=(v,I)=>(new at(v,s,e),`${a.slice(0,I)}\0${e.length-1}d\x7F${a.slice(I+v.length)}`),S=v=>{v?u&&u--:u++};for(;c&&o;){let{0:v,index:I}=c;if(v==="-{"){if(!k){let{lastIndex:P}=l;l=/-\{|\}-/gu,l.lastIndex=P}k++}else if(v==="}-"){if(k--,!k){let{lastIndex:P}=l;l=p,l.lastIndex=P}}else if(v.endsWith("x\x7F")){let{name:P,closing:L,selfClosing:q}=e[Number(v.slice(1,-2))];(!q||d.includes(P))&&S(L)}else if(v.endsWith("q\x7F")){let{bold:P,italic:L}=e[Number(v.slice(1,-2))];P&&(S(f),f=!f),L&&(S(x),x=!x)}else if(u===0){if(v.length>=o)return F(v.slice(0,o),I);o-=v.length,l.lastIndex=I+4+String(e.length).length,a=F(v,I)}c=l.exec(a)}return a}});var qi,be,ir,Bi=y(()=>{"use strict";j();w();G();xe();qi=new Set(["A","T","R","D","-","H","N"]),ir=class extends b{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});T(this,"type","converter-flags");A(this,be,void 0);this.append(...e.map(n=>new B(n,"converter-flag",t,r)))}afterBuild(){$(this,be,this.childNodes.map(e=>e.text().trim()))}toString(){return super.toString(";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(h(this,be).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(h(this,be).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),n=this.getUnknownFlags(),i=new Set(h(this,be).filter(u=>qi.has(u))),a=h(this,be).filter(u=>!u).length,o=h(this,be).length-n.size-a,d=super.lint(e,t);if(r.size===o||i.size===o)return d;let p={start:e,...this.getRootNode().posFromIndex(e)},{childNodes:l,length:c}=this;for(let u=0;u<c;u++){let f=l[u],x=f.text().trim();if(x&&!r.has(x)&&!n.has(x)&&(r.size>0||!i.has(x))){let k=C(f,p,"no-ignored","invalid conversion flag");r.size===0&&qi.has(x.toUpperCase())?k.fix={range:[k.startIndex,k.endIndex],text:x.toUpperCase()}:k.suggestions=[{desc:"remove",range:[k.startIndex,k.endIndex],text:""}],d.push(k)}}return d}print(){return super.print({sep:";"})}};be=new WeakMap});var lt,Oi=y(()=>{"use strict";w();G();xe();lt=class extends b{constructor(e,t=!0,r=m.getConfig(),n=[]){super(void 0,r,n);T(this,"type","converter-rule");let i=e.indexOf(":"),a=e.slice(0,i).indexOf("=>"),o=a===-1?e.slice(0,i):e.slice(a+2,i);t&&r.variants.includes(o.trim())?(super.insertAt(new B(o,"converter-rule-variant",r,n)),super.insertAt(new B(e.slice(i+1),"converter-rule-to",r,n)),a!==-1&&super.insertAt(new B(e.slice(0,a),"converter-rule-from",r,n),0)):super.insertAt(new B(e,"converter-rule-to",r,n))}toString(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${String(t)}=>${String(r)}:${String(n)}`}return super.toString(":")}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 sr,_i=y(()=>{"use strict";D();w();G();Bi();Oi();sr=class extends b{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);T(this,"type","converter");this.append(new ir(e,r,n));let[i]=t,a=i.includes(":"),o=new lt(i,a,r,n);a&&o.length===1?this.insertAt(new lt(t.join(";"),!1,r,n)):this.append(o,...t.slice(1).map(d=>new lt(d,!0,r,n)))}toString(){let{childNodes:[e,...t]}=this;return`-{${String(e)}${e.length>0?"|":""}${t.map(String).join(";")}}-`}text(){let{childNodes:[e,...t]}=this;return`-{${e.text()}|${ce(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?"|":""}${fe(t,{sep:";"})}}-</span>`}}});var zi={};U(zi,{parseConverter:()=>js});var js,Mi=y(()=>{"use strict";w();_i();js=(g,s=m.getConfig(),e=[])=>{let t=/-\{/gu,r=/-\{|\}-/gu,n=[],i=t,a=i.exec(g);for(;a;){let{0:o,index:d}=a;if(o==="}-"){let p=n.pop(),{length:l}=e,c=g.slice(p.index+2,d),u=c.indexOf("|"),[f,x]=u===-1?[[],c]:[c.slice(0,u).split(";"),c.slice(u+1)],k=x.replace(/(&[#a-z\d]+);/giu,"$1"),F=`(?:${s.variants.join("|")})`,S=k.split(new RegExp(`;(?=(?:[^;]*?=>)?\\s*${F}\\s*:|(?:\\s|\0\\d+c\x7F)*$)`,"u")).map(v=>v.replace(/\x01/gu,";"));new sr(f,S,s,e),g=`${g.slice(0,p.index)}\0${l}v\x7F${g.slice(d+2)}`,n.length===0&&(i=t),i.lastIndex=p.index+3+String(l).length}else n.push(a),i=r,i.lastIndex=d+2;a=i.exec(g)}return g}});var nn={};U(nn,{Token:()=>b});var oe,O,z,Oe,yt,rn,or,Wi,ar,Ui,lr,Hi,dr,Di,gr,Vi,pr,Zi,ur,Qi,cr,Xi,hr,Ki,mr,Ji,fr,Yi,sn,b,G=y(()=>{"use strict";D();ue();j();w();vn();Cn();sn=class sn extends Ct{constructor(e,t=m.getConfig(),r=[],n){super();A(this,yt);A(this,or);A(this,ar);A(this,lr);A(this,dr);A(this,gr);A(this,pr);A(this,ur);A(this,cr);A(this,hr);A(this,mr);A(this,fr);T(this,"type","root");A(this,oe,0);A(this,O,void 0);A(this,z,void 0);A(this,Oe,void 0);typeof e=="string"&&this.insertAt(e),$(this,O,t),$(this,z,r),r.push(this)}parseOnce(e=h(this,oe),t=!1){if(e<h(this,oe)||!this.getAttribute("plain")||this.length===0)return this;if(h(this,oe)>=11)return this;switch(e){case 0:this.type==="root"&&h(this,z).shift(),$(this,Oe,t),R(this,or,Wi).call(this,t);break;case 1:R(this,ar,Ui).call(this);break;case 2:R(this,lr,Hi).call(this);break;case 3:R(this,dr,Di).call(this);break;case 4:R(this,gr,Vi).call(this);break;case 5:R(this,pr,Zi).call(this);break;case 6:R(this,ur,Qi).call(this);break;case 7:R(this,cr,Xi).call(this);break;case 8:R(this,hr,Ki).call(this);break;case 9:R(this,mr,Ji).call(this);break;case 10:R(this,fr,Yi).call(this)}if(this.type==="root")for(let r of h(this,z))r.parseOnce(e,t);return wt(this,oe)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((n,i)=>{if(i%2===0)return new ht(n);if(isNaN(n.slice(-1)))return h(this,z)[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?ce(r):r}afterBuild(){if(this.type==="root")for(let e of h(this,z))e.afterBuild()}parse(e=11,t=!1){for(e=Math.min(e,11);h(this,oe)<e;)this.parseOnce(h(this,oe),t);return e&&(R(this,yt,rn).call(this),this.afterBuild()),this}getAttribute(e){switch(e){case"plain":return this.constructor===sn;case"config":return JSON.parse(JSON.stringify(h(this,O)));case"include":{if(h(this,Oe)!==void 0)return h(this,Oe);let t=this.getRootNode();return t!==this&&t.getAttribute("include")}case"accum":return h(this,z);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":h(this,oe)===0&&this.type==="root"&&h(this,z).shift(),$(this,oe,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new ht(e):e;return super.insertAt(r,t),r.type==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r=!1,n=!1,i=!1){return m.normalizeTitle(e,t,h(this,Oe),h(this,O),r,n,i)}lint(e=this.getAbsoluteIndex(),t){var i;let r=super.lint(e,t),n={};for(let a of this.childNodes.filter(o=>o.type==="category")){let o=n[a.name];o?o.add(a):n[a.name]=new Set([a])}for(let a of Object.values(n))a.size>1&&r.push(...[...a].map(o=>{let d=N(o,{start:o.getAbsoluteIndex()},"no-duplicate","duplicated category");return d.suggestions=[{desc:"remove",range:[d.startIndex,d.endIndex],text:""}],d}));if(this.type==="root"){let a=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,o=String(this),d=[],p=a.exec(o),l=0,c=0;for(;p;){let{1:u,index:f}=p,x=(i=p[2])==null?void 0:i.trim();c+=o.slice(l,f).split(`
35
- `).length-1,l=f,d.push({line:c+(u==="disable-line"?0:1),from:u==="disable"?a.lastIndex:void 0,to:u==="enable"?a.lastIndex:void 0,rules:x?new Set(x.split(",").map(k=>k.trim())):void 0}),p=a.exec(o)}return r.filter(({rule:u,startLine:f,startIndex:x})=>{let k={pos:0};for(let{line:F,from:S,to:v,rules:I}of d){if(F>f+1)break;if(I&&!I.has(u))continue;if(F===f&&S===void 0&&v===void 0)return!1;S<=x&&S>k.pos?(k.pos=S,k.type="from"):v<=x&&v>k.pos&&(k.pos=v,k.type="to")}return k.type!=="from"})}return r}};oe=new WeakMap,O=new WeakMap,z=new WeakMap,Oe=new WeakMap,yt=new WeakSet,rn=function(){var n;$(this,oe,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 i of h(this,z))R(n=i,yt,rn).call(n)},or=new WeakSet,Wi=function(e){let{parseCommentAndExt:t}=(gi(),_(di));this.setText(t(String(this.firstChild),h(this,O),h(this,z),e))},ar=new WeakSet,Ui=function(){let{parseBraces:e}=(Fr(),_(Vn)),t=this.type==="root"?String(this.firstChild):`\0${String(this.firstChild)}`,r=e(t,h(this,O),h(this,z));this.setText(this.type==="root"?r:r.slice(1))},lr=new WeakSet,Hi=function(){var t;if((t=h(this,O).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(ci(),_(ui));this.setText(e(String(this.firstChild),h(this,O),h(this,z)))},dr=new WeakSet,Di=function(){var t;if((t=h(this,O).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(ki(),_(bi));this.setText(e(this,h(this,O),h(this,z)))},gr=new WeakSet,Vi=function(){var t;if((t=h(this,O).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(wi(),_(vi));this.setText(e(this,h(this,O),h(this,z)))},pr=new WeakSet,Zi=function(){let{parseLinks:e}=(Ii(),_(Ni));this.setText(e(String(this.firstChild),h(this,O),h(this,z)))},ur=new WeakSet,Qi=function(){var r;if((r=h(this,O).excludes)!=null&&r.includes("quote"))return;let{parseQuotes:e}=(tn(),_(en)),t=String(this.firstChild).split(`
36
- `);for(let n=0;n<t.length;n++)t[n]=e(t[n],h(this,O),h(this,z));this.setText(t.join(`
37
- `))},cr=new WeakSet,Xi=function(){var t;if((t=h(this,O).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(Fi(),_(Ei));this.setText(e(String(this.firstChild),h(this,O),h(this,z)))},hr=new WeakSet,Ki=function(){var t;if((t=h(this,O).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(Ri(),_(Li));this.setText(e(String(this.firstChild),h(this,O),h(this,z)))},mr=new WeakSet,Ji=function(){var n;if((n=h(this,O).excludes)!=null&&n.includes("list"))return;let{parseList:e}=(ji(),_(Gi)),t=String(this.firstChild).split(`
38
- `),r=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;r<t.length;r++)t[r]=e(t[r],h(this,O),h(this,z));this.setText(t.join(`
39
- `))},fr=new WeakSet,Yi=function(){if(h(this,O).variants.length>0){let{parseConverter:e}=(Mi(),_(zi));this.setText(e(String(this.firstChild),h(this,O),h(this,z)))}};b=sn});var _e,es,qs,m,w=y(()=>{pn();Re();ue();D();_e={i18n:void 0,rules:gn,getConfig(){return{...hn,...this.config,excludes:[]}},msg(g,s=""){var e,t;return g&&((t=(e=this.i18n)==null?void 0:e[g])!=null?t:g).replace("$1",this.msg(s))},normalizeTitle(g,s=0,e=!1,t=_e.getConfig(),r=!1,n=!1,i=!1){let{Title:a}=(kn(),_(bn));if(r)return new a(g,s,t,n,i);let{Token:o}=(G(),_(nn)),d=Fe.run(()=>new o(g,t).parseOnce(0,e).parseOnce());return new a(String(d),s,t,n,i)},parse(g,s,e=11,t=_e.getConfig()){g=fn(g);let{Token:r}=(G(),_(nn));return Fe.run(()=>new r(g,t).parse(e,s))}},es={},qs=new Set(["normalizeTitle","parse"]);for(let g in _e)qs.has(g)||(es[g]={enumerable:!1});Object.defineProperties(_e,es);typeof self=="object"?Object.assign(self,{Parser:_e}):typeof globalThis=="object"&&Object.assign(globalThis,{Parser:_e});m=_e});w();})();
27
+ ${i.shift()}`,o,p=(l,u)=>{if(!u){a+=l;return}let{lastChild:c}=u;if(Bs(u)){let f=new b(l,t,r);f.type="table-inter",f.setAttribute("stage",3),u.insertAt(f)}else c.setText(String(c)+l)},g=()=>o.type==="td"?n.pop():o;for(let l of i){o=n.pop();let[u]=/^(?:\s|\0\d+c\x7F)*/u.exec(l),c=l.slice(u.length),f=/^(:*)((?:\s|\0\d+c\x7F)*)(\{\||\{(?:\0\d+c\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(c);if(f){for(;o&&o.type!=="td";)o=n.pop();let[,C,P,L,O]=f;C&&new dt(C,t,r),p(`
28
+ ${u}${C&&`\0${r.length-1}d\x7F`}${P}\0${r.length}b\x7F`,o),n.push(...o?[o]:[],new er(L,O,t,r));continue}else if(!o){a+=`
29
+ ${l}`;continue}let T=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(c);if(!T){p(`
30
+ ${l}`,o),n.push(o);continue}let[,k,I,w,v]=T;if(k){for(;o.type!=="table";)o=n.pop();o.close(`
31
+ ${u}${k}`,!0),p(v,n[n.length-1])}else if(I){o=g(),o.type==="tr"&&(o=n.pop());let C=new tr(`
32
+ ${u}${I}`,v,t,r);n.push(o,C),o.insertAt(C)}else{o=g();let C=w==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,P=C.exec(v),L=0,O=`
33
+ ${u}${w}`,U=Y=>{let ae=new _e(O,v.slice(L,P==null?void 0:P.index),t,r);return Y.insertAt(ae),ae};for(;P;)U(o),{lastIndex:L}=C,[O]=P,P=C.exec(v);n.push(o,U(o))}}return a.slice(1)}});var rr,Ni=y(()=>{"use strict";Se();rr=class extends Q{constructor(){super(...arguments);x(this,"type","hr")}}});var nr,Ei=y(()=>{"use strict";De();E();Se();nr=class extends he(Q){constructor(e,t,r=m.getConfig(),n=[]){super(e,r,n);x(this,"type","double-underscore")}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}}});var Ii={};W(Ii,{parseHrAndDoubleUnderscore:()=>Os});var Os,Fi=y(()=>{"use strict";Ni();Ei();Pr();Os=({firstChild:{data:d},type:s,name:e},t,r)=>{let{doubleUnderscore:n}=t,i=new Set(n[0]),a=new Set(n[1]);return s!=="root"&&(s!=="ext-inner"||e!=="poem")&&(d=`\0${d}`),d=d.replace(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(o,p,g)=>(new rr(g,t,r),`${p}\0${r.length-1}r\x7F`)).replace(new RegExp(`__(${n.flat().join("|")})__`,"giu"),(o,p)=>{let g=a.has(p);return g||i.has(p.toLowerCase())?(new nr(p,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,p,g,l,u)=>{let c=`${p}\0${r.length}h\x7F`;return new Ke(g.length,[l,u],t,r),c}),s==="root"||s==="ext-inner"&&e==="poem"?d:d.slice(1)}});var ir,Li=y(()=>{"use strict";j();E();Se();ir=class extends Q{constructor(){super(...arguments);x(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,i=m.msg('lonely "$1"',"'"),a=[],o;if((t==null?void 0:t.type)==="text"&&t.data.endsWith("'")){o=N(this,{start:e},"lonely-apos",i);let{startIndex:p,startLine:g,startCol:l}=o,[,{length:u}]=/(?:^|[^'])('+)$/u.exec(t.data),c=e-u;a.push({...o,startIndex:c,endIndex:p,startCol:l-u,endLine:g,endCol:l,suggestions:[{desc:"escape",range:[c,p],text:"&apos;".repeat(u)}]})}if((r==null?void 0:r.type)==="text"&&r.data.startsWith("'")){o!=null||(o=N(this,{start:e},"lonely-apos",i));let{endIndex:p,endLine:g,endCol:l}=o,[{length:u}]=/^'+/u.exec(r.data),c=p+u;a.push({...o,startIndex:p,endIndex:c,startLine:g,startCol:l,endCol:l+u,suggestions:[{desc:"escape",range:[p,c],text:"&apos;".repeat(u)}]})}return n&&this.closest("heading-title")&&(o!=null||(o=N(this,{start:e},"lonely-apos",i)),a.push({...o,rule:"bold-header",message:m.msg("bold in section header"),severity:"warning"})),a}json(){let e=super.json();return Object.assign(e,{bold:this.bold,italic:this.italic}),e}}});var Ri={};W(Ri,{parseQuotes:()=>sn});var sn,on=y(()=>{"use strict";Li();sn=(d,s,e)=>{var g;let t=d.split(/('{2,})/u),{length:r}=t;if(r===1)return d;let n=0,i=0,a,o,p;for(let l=1;l<r;l+=2){let u=t[l].length;switch(u){case 2:i++;break;case 4:t[l-1]+="'",t[l]="'''";case 3:if(n++,a!==void 0)break;t[l-1].endsWith(" ")?o===void 0&&p===void 0&&(p=l):t[l-1].slice(-2,-1)===" "?a=l:o!=null||(o=l);break;default:t[l-1]+="'".repeat(u-5),t[l]="'''''",i++,n++}}if(i%2===1&&n%2===1){let l=(g=a!=null?a:o)!=null?g:p;l!==void 0&&(t[l]="''",t[l-1]+="'")}for(let l=1;l<r;l+=2)new ir(t[l],s,e),t[l]=`\0${e.length-1}q\x7F`;return t.join("")}});var Pi={};W(Pi,{parseExternalLinks:()=>an});var an,ln=y(()=>{"use strict";H();Zr();Jt();an=(d,s,e,t)=>{let r=new RegExp(`\\[(${`\0\\d+f\x7F|(?:(?:${s.protocol}|//)${ve}|\0\\d+m\x7F)${we}(?=[[\\]<>"\\t\\p{Zs}]|\0\\d)`})(\\p{Zs}*(?=\\P{Zs}))([^\\]-\b
34
+ -\uFFFD]*)\\]`,"giu");return d.replace(r,(n,i,a,o)=>{let{length:p}=e,g=/&[lg]t;/u.exec(i);return g&&(i=i.slice(0,g.index),a="",o=`${i.slice(g.index)}${a}${o}`),t?(new Ie(i,!0,s,e),`[\0${p}f\x7F${a}${o}]`):(new it(i,a,o,s,e),`\0${p}w\x7F`)})}});var sr,Gi=y(()=>{"use strict";Dt();sr=class extends Ee{constructor(){super(...arguments);x(this,"type","category")}}});var qi={};W(qi,{parseLinks:()=>ji});var ji,Bi=y(()=>{"use strict";E();on();ln();Vr();Ur();Gi();ji=(d,s,e)=>{let t=s.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,r=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,n=new RegExp(`^\\s*(?:${s.protocol}|//)`,"iu"),i=d.split("[["),a=i.shift();for(let o=0;o<i.length;o++){let p=!1,g,l,u,c,f=i[o],T=t.exec(f);if(T)[,g,l,u,c]=T,c.startsWith("]")&&(u!=null&&u.includes("["))&&(u+="]",c=c.slice(1));else{let L=r.exec(f);L&&(p=!0,[,g,l,u]=L)}if(g===void 0||n.test(g)||/\0\d+[exhbru]\x7F/u.test(g)){a+=`[[${f}`;continue}let k=g.trim().startsWith(":");if(k&&p){a+=`[[${f}`;continue}let I=m.normalizeTitle(g,0,!1,s,!0,!0,!0),{ns:w,valid:v,interwiki:C}=I;if(v){if(p){if(C||w!==6){a+=`[[${f}`;continue}let L=!1;for(o++;o<i.length;o++){let O=i[o],U=O.split("]]");if(U.length>2){L=!0,u+=`[[${U[0]}]]${U[1]}`,c=U.slice(2).join("]]");break}else if(U.length===2)u+=`[[${U[0]}]]${U[1]}`;else{u+=`[[${O}`;break}}if(u=ji(u,s,e),!L){a+=`[[${g}${l}${u}`;continue}}}else{a+=`[[${f}`;continue}u&&(u=sn(u,s,e));let P=nt;k||(!C&&w===6?(u&&(u=an(u,s,e,!0)),P=tt):!C&&w===14&&(P=sr)),u===void 0&&l&&(u=""),a+=`\0${e.length}l\x7F${c}`,new P(g,u,s,e,l)}return a}});var _i={};W(_i,{parseMagicLinks:()=>zs});var zs,Oi=y(()=>{"use strict";H();Jt();zs=(d,s,e)=>{let t=new RegExp(`(^|[^\\p{L}\\d_])(?:${s.protocol})(${ve}${we})`,"giu");return d.replace(t,(r,n,i)=>{let a="",o=n?r.slice(n.length):r,p=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(o);p&&(a=o.slice(p.index),o=o.slice(0,p.index));let g=new RegExp(`[,;\\\\.:!?${o.includes("(")?"":")"}]+$`,"u"),l=g.exec(o);if(l){let u=0;l[0].startsWith(";")&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(o.slice(0,l.index))&&(u=1),a=`${o.slice(l.index+u)}${a}`,o=o.slice(0,l.index+u)}return a.length>=i.length?r:(new Ie(o,!1,s,e),`${n}\0${e.length-1}w\x7F${a}`)})}});var or,zi=y(()=>{"use strict";rn();or=class extends lt{constructor(){super(...arguments);x(this,"type","list")}}});var Mi={};W(Mi,{parseList:()=>Ms});var Ms,Wi=y(()=>{"use strict";zi();nn();Ms=(d,s,e)=>{let t=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(d);if(!t)return d;let[r,n,i]=t,a=`${n}\0${e.length}d\x7F${d.slice(r.length)}`,o=i.split(";").length-1;if(new or(i,s,e),!o)return a;let{html:[p]}=s,g=/:+|-\{|\0\d+[xq]\x7F/gu,l=g,u=l.exec(a),c=0,f=!1,T=!1,k=0,I=(v,C)=>(new dt(v,s,e),`${a.slice(0,C)}\0${e.length-1}d\x7F${a.slice(C+v.length)}`),w=v=>{v?c&&c--:c++};for(;u&&o;){let{0:v,index:C}=u;if(v==="-{"){if(!k){let{lastIndex:P}=l;l=/-\{|\}-/gu,l.lastIndex=P}k++}else if(v==="}-"){if(k--,!k){let{lastIndex:P}=l;l=g,l.lastIndex=P}}else if(v.endsWith("x\x7F")){let{name:P,closing:L,selfClosing:O}=e[Number(v.slice(1,-2))];(!O||p.includes(P))&&w(L)}else if(v.endsWith("q\x7F")){let{bold:P,italic:L}=e[Number(v.slice(1,-2))];P&&(w(f),f=!f),L&&(w(T),T=!T)}else if(c===0){if(v.length>=o)return I(v.slice(0,o),C);o-=v.length,l.lastIndex=C+4+String(e.length).length,a=I(v,C)}u=l.exec(a)}return a}});var Ui,be,ar,Hi=y(()=>{"use strict";j();E();G();xe();Ui=new Set(["A","T","R","D","-","H","N"]),ar=class extends b{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});x(this,"type","converter-flags");A(this,be,void 0);this.append(...e.map(n=>new q(n,"converter-flag",t,r)))}afterBuild(){$(this,be,this.childNodes.map(e=>e.text().trim()))}toString(){return super.toString(";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(h(this,be).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(h(this,be).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),n=this.getUnknownFlags(),i=new Set(h(this,be).filter(c=>Ui.has(c))),a=h(this,be).filter(c=>!c).length,o=h(this,be).length-n.size-a,p=super.lint(e,t);if(r.size===o||i.size===o)return p;let g={start:e,...this.getRootNode().posFromIndex(e)},{childNodes:l,length:u}=this;for(let c=0;c<u;c++){let f=l[c],T=f.text().trim();if(T&&!r.has(T)&&!n.has(T)&&(r.size>0||!i.has(T))){let k=S(f,g,"no-ignored","invalid conversion flag");r.size===0&&Ui.has(T.toUpperCase())?k.fix={range:[k.startIndex,k.endIndex],text:T.toUpperCase()}:k.suggestions=[{desc:"remove",range:[k.startIndex,k.endIndex],text:""}],p.push(k)}}return p}print(){return super.print({sep:";"})}};be=new WeakMap});var gt,Di=y(()=>{"use strict";E();G();xe();gt=class extends b{constructor(e,t=!0,r=m.getConfig(),n=[]){super(void 0,r,n);x(this,"type","converter-rule");let i=e.indexOf(":"),a=e.slice(0,i).indexOf("=>"),o=a===-1?e.slice(0,i):e.slice(a+2,i);t&&r.variants.includes(o.trim())?(super.insertAt(new q(o,"converter-rule-variant",r,n)),super.insertAt(new q(e.slice(i+1),"converter-rule-to",r,n)),a!==-1&&super.insertAt(new q(e.slice(0,a),"converter-rule-from",r,n),0)):super.insertAt(new q(e,"converter-rule-to",r,n))}toString(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${String(t)}=>${String(r)}:${String(n)}`}return super.toString(":")}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 lr,Vi=y(()=>{"use strict";H();E();G();Hi();Di();lr=class extends b{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);x(this,"type","converter");this.append(new ar(e,r,n));let[i]=t,a=i.includes(":"),o=new gt(i,a,r,n);a&&o.length===1?this.insertAt(new gt(t.join(";"),!1,r,n)):this.append(o,...t.slice(1).map(p=>new gt(p,!0,r,n)))}toString(){let{childNodes:[e,...t]}=this;return`-{${String(e)}${e.length>0?"|":""}${t.map(String).join(";")}}-`}text(){let{childNodes:[e,...t]}=this;return`-{${e.text()}|${ce(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?"|":""}${fe(t,{sep:";"})}}-</span>`}}});var Zi={};W(Zi,{parseConverter:()=>Ws});var Ws,Qi=y(()=>{"use strict";Vi();Ws=(d,s,e)=>{let t=/-\{/gu,r=/-\{|\}-/gu,n=[],i=t,a=i.exec(d);for(;a;){let{0:o,index:p}=a;if(o==="}-"){let g=n.pop(),{length:l}=e,u=d.slice(g.index+2,p),c=u.indexOf("|"),[f,T]=c===-1?[[],u]:[u.slice(0,c).split(";"),u.slice(c+1)],k=T.replace(/(&[#a-z\d]+);/giu,"$1"),I=`(?:${s.variants.join("|")})`,w=k.split(new RegExp(`;(?=(?:[^;]*?=>)?\\s*${I}\\s*:|(?:\\s|\0\\d+c\x7F)*$)`,"u")).map(v=>v.replace(/\x01/gu,";"));new lr(f,w,s,e),d=`${d.slice(0,g.index)}\0${l}v\x7F${d.slice(p+2)}`,n.length===0&&(i=t),i.lastIndex=g.index+3+String(l).length}else n.push(a),i=r,i.lastIndex=p+2;a=i.exec(d)}return d}});var gn={};W(gn,{Token:()=>b});var oe,B,z,Oe,Ct,dn,dr,Xi,gr,Ki,pr,Ji,ur,Yi,cr,es,hr,ts,mr,rs,fr,ns,xr,is,Tr,ss,br,os,pn,b,G=y(()=>{"use strict";H();ue();j();E();In();Rn();pn=class pn extends It{constructor(e,t=m.getConfig(),r=[],n){super();A(this,Ct);A(this,dr);A(this,gr);A(this,pr);A(this,ur);A(this,cr);A(this,hr);A(this,mr);A(this,fr);A(this,xr);A(this,Tr);A(this,br);x(this,"type","root");A(this,oe,0);A(this,B,void 0);A(this,z,void 0);A(this,Oe,void 0);typeof e=="string"&&this.insertAt(e),$(this,B,t),$(this,z,r),r.push(this)}parseOnce(e=h(this,oe),t=!1){if(e<h(this,oe)||!this.getAttribute("plain")||this.length===0)return this;if(h(this,oe)>=11)return this;switch(e){case 0:this.type==="root"&&h(this,z).shift(),$(this,Oe,t),F(this,dr,Xi).call(this,t);break;case 1:F(this,gr,Ki).call(this);break;case 2:F(this,pr,Ji).call(this);break;case 3:F(this,ur,Yi).call(this);break;case 4:F(this,cr,es).call(this);break;case 5:F(this,hr,ts).call(this);break;case 6:F(this,mr,rs).call(this);break;case 7:F(this,fr,ns).call(this);break;case 8:F(this,xr,is).call(this);break;case 9:F(this,Tr,ss).call(this);break;case 10:F(this,br,os).call(this)}if(this.type==="root")for(let r of h(this,z))r.parseOnce(e,t);return Et(this,oe)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((n,i)=>{if(i%2===0)return new Tt(n);if(isNaN(n.slice(-1)))return h(this,z)[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?ce(r):r}afterBuild(){if(this.type==="root")for(let e of h(this,z))e.afterBuild()}parse(e=11,t){for(e=Math.min(e,11);h(this,oe)<e;)this.parseOnce(h(this,oe),t);return e&&(F(this,Ct,dn).call(this),this.afterBuild()),this}getAttribute(e){switch(e){case"plain":return this.constructor===pn;case"config":return JSON.parse(JSON.stringify(h(this,B)));case"include":{if(h(this,Oe)!==void 0)return h(this,Oe);let t=this.getRootNode();return t!==this&&t.getAttribute("include")}case"accum":return h(this,z);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":h(this,oe)===0&&this.type==="root"&&h(this,z).shift(),$(this,oe,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new Tt(e):e;return super.insertAt(r,t),r.type==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r,n,i){return m.normalizeTitle(e,t,h(this,Oe),h(this,B),r,n,i)}lint(e=this.getAbsoluteIndex(),t){var n;let r=super.lint(e,t);if(this.type==="root"){let i={};for(let c of this.querySelectorAll("category")){let f=i[c.name];f?f.add(c):i[c.name]=new Set([c])}for(let c of Object.values(i))c.size>1&&r.push(...[...c].map(f=>{let T=N(f,{start:f.getAbsoluteIndex()},"no-duplicate","duplicated category");return T.suggestions=[{desc:"remove",range:[T.startIndex,T.endIndex],text:""}],T}));let a=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,o=String(this),p=[],g=a.exec(o),l=0,u=0;for(;g;){let{1:c,index:f}=g,T=(n=g[2])==null?void 0:n.trim();u+=o.slice(l,f).split(`
35
+ `).length-1,l=f,p.push({line:u+(c==="disable-line"?0:1),from:c==="disable"?a.lastIndex:void 0,to:c==="enable"?a.lastIndex:void 0,rules:T?new Set(T.split(",").map(k=>k.trim())):void 0}),g=a.exec(o)}return r.filter(({rule:c,startLine:f,startIndex:T})=>{let k={pos:0};for(let{line:I,from:w,to:v,rules:C}of p){if(I>f+1)break;if(C&&!C.has(c))continue;if(I===f&&w===void 0&&v===void 0)return!1;w<=T&&w>k.pos?(k.pos=w,k.type="from"):v<=T&&v>k.pos&&(k.pos=v,k.type="to")}return k.type!=="from"})}return r}};oe=new WeakMap,B=new WeakMap,z=new WeakMap,Oe=new WeakMap,Ct=new WeakSet,dn=function(){var n;$(this,oe,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 i of h(this,z))F(n=i,Ct,dn).call(n)},dr=new WeakSet,Xi=function(e){let{parseCommentAndExt:t}=(xi(),_(fi));this.setText(t(String(this.firstChild),h(this,B),h(this,z),e))},gr=new WeakSet,Ki=function(){let{parseBraces:e}=(jr(),_(ei)),t=this.type==="root"?String(this.firstChild):`\0${String(this.firstChild)}`,r=e(t,h(this,B),h(this,z));this.setText(this.type==="root"?r:r.slice(1))},pr=new WeakSet,Ji=function(){var t;if((t=h(this,B).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(ki(),_(bi));this.setText(e(String(this.firstChild),h(this,B),h(this,z)))},ur=new WeakSet,Yi=function(){var t;if((t=h(this,B).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=($i(),_(Ci));this.setText(e(this,h(this,B),h(this,z)))},cr=new WeakSet,es=function(){var t;if((t=h(this,B).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(Fi(),_(Ii));this.setText(e(this,h(this,B),h(this,z)))},hr=new WeakSet,ts=function(){let{parseLinks:e}=(Bi(),_(qi));this.setText(e(String(this.firstChild),h(this,B),h(this,z)))},mr=new WeakSet,rs=function(){var r;if((r=h(this,B).excludes)!=null&&r.includes("quote"))return;let{parseQuotes:e}=(on(),_(Ri)),t=String(this.firstChild).split(`
36
+ `);for(let n=0;n<t.length;n++)t[n]=e(t[n],h(this,B),h(this,z));this.setText(t.join(`
37
+ `))},fr=new WeakSet,ns=function(){var t;if((t=h(this,B).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(ln(),_(Pi));this.setText(e(String(this.firstChild),h(this,B),h(this,z)))},xr=new WeakSet,is=function(){var t;if((t=h(this,B).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(Oi(),_(_i));this.setText(e(String(this.firstChild),h(this,B),h(this,z)))},Tr=new WeakSet,ss=function(){var n;if((n=h(this,B).excludes)!=null&&n.includes("list"))return;let{parseList:e}=(Wi(),_(Mi)),t=String(this.firstChild).split(`
38
+ `),r=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;r<t.length;r++)t[r]=e(t[r],h(this,B),h(this,z));this.setText(t.join(`
39
+ `))},br=new WeakSet,os=function(){if(h(this,B).variants.length>0){let{parseConverter:e}=(Qi(),_(Zi));this.setText(e(String(this.firstChild),h(this,B),h(this,z)))}};b=pn});var ze,as,Us,m,E=y(()=>{xn();Pe();ue();H();ze={i18n:void 0,rules:fn,getConfig(){return{...kn,...this.config,excludes:[]}},msg(d,s=""){var e,t;return d&&((t=(e=this.i18n)==null?void 0:e[d])!=null?t:d).replace("$1",this.msg(s))},normalizeTitle(d,s=0,e,t=ze.getConfig(),r,n=!1,i=!1){let{Title:a}=(Nn(),_($n));if(r)return new a(d,s,t,n,i);let{Token:o}=(G(),_(gn)),p=Ae.run(()=>new o(d,t).parseOnce(0,e).parseOnce()),g=new a(String(p),s,t,n,i);return Ae.run(()=>{for(let l of["main","fragment"]){let u=g[l];u!=null&&u.includes("\0")&&(g[l]=p.buildFromStr(u,1))}}),g},parse(d,s,e=11,t=ze.getConfig()){d=An(d);let{Token:r}=(G(),_(gn));return Ae.run(()=>new r(d,t).parse(e,s))}},as={},Us=new Set(["normalizeTitle","parse"]);for(let d in ze)Us.has(d)||(as[d]={enumerable:!1});Object.defineProperties(ze,as);typeof self=="object"?Object.assign(self,{Parser:ze}):typeof globalThis=="object"&&Object.assign(globalThis,{Parser:ze});m=ze});E();})();
@@ -1,6 +1,6 @@
1
1
  (() => {
2
2
  const workerJS = () => {
3
- importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.6.1-b/bundle/bundle.min.js');
3
+ importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.6.2-b/bundle/bundle.min.js');
4
4
  const entities = { '&': 'amp', '<': 'lt', '>': 'gt' };
5
5
  self.onmessage = ({ data }) => {
6
6
  const [command, qid, wikitext, include, stage] = data;
package/extensions/ui.css CHANGED
@@ -1,6 +1,7 @@
1
1
  .wikiparser {
2
2
  white-space: pre-wrap;
3
3
  overflow-wrap: break-word;
4
+ word-break: break-all;
4
5
  font-family: monospace;
5
6
  border: 1.5px solid #dedede;
6
7
  }
@@ -83,13 +84,15 @@
83
84
  font-weight: normal;
84
85
  }
85
86
  .wpb-parameter {
86
- color: initial;
87
87
  font-weight: normal;
88
88
  }
89
- .wpb-template > .wpb-parameter > .wpb-parameter-key,
90
- .wpb-invoke-function ~ .wpb-parameter > .wpb-parameter-key {
89
+ .wpb-template > .wpb-parameter,
90
+ .wpb-invoke-function ~ .wpb-parameter {
91
91
  color: #b0c;
92
92
  }
93
+ .wpb-parameter-value {
94
+ color: initial;
95
+ }
93
96
 
94
97
  .wpb-heading, .wpb-image-parameter {
95
98
  color: #0076dd;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikiparser-node",
3
- "version": "1.6.1-b",
3
+ "version": "1.6.2-b",
4
4
  "description": "A Node.js parser for MediaWiki markup with AST",
5
5
  "keywords": [
6
6
  "mediawiki",
@@ -19,6 +19,8 @@
19
19
  "/extensions/*.css",
20
20
  "!/extensions/dist/gh-page.js",
21
21
  "!/extensions/gh-page.css",
22
+ "!/extensions/dist/parserTests.js",
23
+ "!/extensions/test-page.css",
22
24
  "/config/",
23
25
  "/i18n/",
24
26
  "!/config/.schema.json"
@@ -34,6 +36,7 @@
34
36
  "prepublishOnly": "npm run build",
35
37
  "build:core": "esbuild index.ts --bundle --minify --target=es2018 --outfile=bundle/bundle.min.js && eslint --no-eslintrc -c .eslintrc.browser.json bundle/bundle.min.js",
36
38
  "build:ext": "bash build-ext.sh",
39
+ "build:test": "npm run build:core && tsc --project tsconfig.dist.json",
37
40
  "build": "npm run build:core && npm run build:ext",
38
41
  "diff": "bash diff.sh",
39
42
  "diff:stat": "f() { git diff --stat --ignore-all-space --color=always $1 $2 -- . ':!extensions/' ':!bin/' | grep '\\.ts'; }; f",
@@ -42,9 +45,11 @@
42
45
  "lint:css": "stylelint extensions/*.css",
43
46
  "lint": "npm run lint:ts && npm run lint:json && npm run lint:css",
44
47
  "server": "npm run test:end; http-server .. -c-1 --cors &",
45
- "test": "npm run build && gsed -i 's|importScripts.*|importScripts(\"http://127.0.0.1:8080/wikiparser-node/bundle/bundle.min.js\");|' extensions/dist/base.js; npm run server",
48
+ "test": " node dist/test/test.js",
49
+ "test:parser": "node dist/test/parserTests.js",
50
+ "test:server": "npm run build && gsed -i 's|importScripts.*|importScripts(\"http://127.0.0.1:8080/wikiparser-node/bundle/bundle.min.js\");|' extensions/dist/base.js; npm run server",
46
51
  "test:end": "pkill -x http-server",
47
- "test:real": "tsc --project tsconfig.dist.json && node dist/test/real.js"
52
+ "test:real": "node dist/test/real.js"
48
53
  },
49
54
  "devDependencies": {
50
55
  "@bhsd/codemirror-mediawiki": "^2.1.11",