wikiparser-node 1.28.0 → 1.28.1

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,29 +1,29 @@
1
- "use strict";(()=>{var Ca=Object.defineProperty,Ia=Object.defineProperties;var Na=Object.getOwnPropertyDescriptors;var Qt=Object.getOwnPropertySymbols;var En=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable;var Rn=e=>{throw TypeError(e)};var Ps=(e,t,s)=>t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,fe=(e,t)=>{for(var s in t||(t={}))En.call(t,s)&&Ps(e,s,t[s]);if(Qt)for(var s of Qt(t))Pn.call(t,s)&&Ps(e,s,t[s]);return e},Le=(e,t)=>Ia(e,Na(t));var On=(e,t)=>{var s={};for(var i in e)En.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&Qt)for(var i of Qt(e))t.indexOf(i)<0&&Pn.call(e,i)&&(s[i]=e[i]);return s};var La=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fe=(e,t,s)=>Ps(e,typeof t!="symbol"?t+"":t,s),Rs=(e,t,s)=>t.has(e)||Rn("Cannot "+s);var m=(e,t,s)=>(Rs(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?Rn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(Rs(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),P=(e,t,s)=>(Rs(e,t,"access private method"),s);var Bn=(e,t,s,i)=>({set _(r){L(e,t,r,s)},get _(){return m(e,t,i)}});var Ou=La((ju,Ta)=>{var Fa=Object.create,bt=Object.defineProperty,Il=Object.getOwnPropertyDescriptor,tn=Object.getOwnPropertyNames,Ea=Object.prototype.hasOwnProperty,Nl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),wt=e=>{throw TypeError(e)},Ll=(e,t,s)=>t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,jn=(e,t)=>bt(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[tn(e)[0]])(e=0)),t},Fl=(e,t)=>function(){return t||(0,e[tn(e)[0]])((t={exports:{}}).exports,t),t.exports},se=(e,t)=>{for(var s in t)bt(e,s,{get:t[s],enumerable:!0})},Pa=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of tn(t))!Ea.call(e,r)&&r!==s&&bt(e,r,{get:()=>t[r],enumerable:!(i=Il(t,r))||i.enumerable});return e},Q=e=>Pa(bt({},"__esModule",{value:!0}),e),Y=e=>{var t;return[,,,Fa((t=e==null?void 0:e[Nl("metadata")])!=null?t:null)]},El=["class","method","getter","setter","accessor","field","value","get","set"],Nt=e=>e!==void 0&&typeof e!="function"?wt("Function expected"):e,Ra=(e,t,s,i,r)=>({kind:El[e],name:t,metadata:i,addInitializer:n=>s._?wt("Already initialized"):r.push(Nt(n||null))}),sn=(e,t)=>Ll(t,Nl("metadata"),e[3]),J=(e,t,s,i)=>{for(var r=0,n=e[t>>1],l=n&&n.length;r<l;r++)t&1?n[r].call(s):i=n[r].call(s,i);return i},X=(e,t,s,i,r,n)=>{var l,o,d,u,a,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,b=El[h+5],x=h>3&&(e[p-1]=[]),v=e[p]||(e[p]=[]),y=h&&(!c&&!g&&(r=r.prototype),h<5&&(h>3||!c)&&Il(h<4?r:{get[s](){return he(this,n)},set[s](w){return we(this,n,w)}},s));h?c&&h<4&&jn(n,(h>2?"set ":h>1?"get ":"")+s):jn(r,s);for(var k=i.length-1;k>=0;k--)u=Ra(h,s,d={},e[3],v),h&&(u.static=g,u.private=c,a=u.access={has:c?w=>Ba(r,w):w=>s in w},h^3&&(a.get=c?w=>(h^1?he:zi)(w,r,h^4?n:y.get):w=>w[s]),h>2&&(a.set=c?(w,A)=>we(w,r,A,h^4?n:y.set):(w,A)=>w[s]=A)),o=(0,i[k])(h?h<4?c?n:y[b]:h>4?void 0:{get:y.get,set:y.set}:r,u),d._=1,h^4||o===void 0?Nt(o)&&(h>4?x.unshift(o):h?c?n=o:y[b]=o:r=o):typeof o!="object"||o===null?wt("Object expected"):(Nt(l=o.get)&&(y.get=l),Nt(l=o.set)&&(y.set=l),Nt(l=o.init)&&x.unshift(l));return h||sn(e,r),y&&bt(r,s,y),c?h^4?n:y:r},Oa=(e,t,s)=>Ll(e,typeof t!="symbol"?t+"":t,s),nn=(e,t,s)=>t.has(e)||wt("Cannot "+s),Ba=(e,t)=>Object(t)!==t?wt('Cannot use the "in" operator on this value'):e.has(t),he=(e,t,s)=>(nn(e,t,"read from private field"),s?s.call(e):t.get(e)),Oe=(e,t,s)=>t.has(e)?wt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),we=(e,t,s,i)=>(nn(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),zi=(e,t,s)=>(nn(e,t,"access private method"),s),ja=(e,t,s,i)=>({set _(r){we(e,t,r,s)},get _(){return he(e,t,i)}}),Pl,ps,Rl=C({"base.ts"(){"use strict";Pl=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11,"list-range":11};return Object.setPrototypeOf(e,null),e})(),ps=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","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"];return Object.freeze(e),e})()}});function ye(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,r)=>ye(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(i,r)=>t[r])}var qe,Os,pt,ft,mt,nt,Ol,ve,Ye,qn,Wn,fs,Bl,Mn,zn,zt,xt,ce=C({"util/string.ts"(){"use strict";qe=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Os=String.raw`[^[\]<>"\0-\x1F\x7F${qe}\uFFFD]`,pt=String.raw`(?:\[[\da-f:.]+\]|${Os})`,ft=String.raw`(?:${Os}|\0\d+[cn!~]\x7F)*`,mt=e=>e.trim().toLowerCase(),nt=(e,t)=>s=>s.replace(e,t),Ol=nt(/[\0\x7F]|\r$/gmu,""),ve=nt(/\0\d+[cn]\x7F/gu,""),Ye=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),qn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Wn=nt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):qn[s.toLowerCase()]),fs=e=>Wn(e),Bl=nt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Mn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},zn=e=>nt(e,t=>`&${Mn[t]};`),zt=zn(/[&<>]/gu),xt=(e,t={})=>{const{pre:s="",post:i="",sep:r=""}=t;return s+e.map(n=>n.print()).join(r)+i}}}),qa=Fl({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),Wa=Fl({"config/minimum.json"(e,t){t.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:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#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","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#timef":"timef","#timefl":"timefl"},["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:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),be,jl,Ui,Me=C({"util/constants.ts"(){"use strict";be=11,jl=qa(),Ui=Wa()}});function gt(e){const t=new Map,s=new WeakMap;return i=>{const r=typeof i=="string"?t:s;if(r.has(i)){const l=r.get(i);return l.lastIndex=0,l}const n=e(i);return r.set(i,n),n}}var Ut,ql,Ze=C({"../common/dist/index.mjs"(){"use strict";Ut=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),ql=gt}}),le,de=C({"lib/rect.ts"(){"use strict";var e,t,s,i,Hi,n;le=(n=class{constructor(l,o){N(this,i);N(this,e);N(this,t);N(this,s);L(this,e,l),L(this,t,o)}get start(){return m(this,t)}get top(){return P(this,i,Hi).call(this).top}get left(){return P(this,i,Hi).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Hi=function(){var l;return(l=m(this,s))!=null||L(this,s,m(this,e).getRootNode().posFromIndex(m(this,t))),m(this,s)},n)}}),Un,Hn,Mt,Di,Bs,q,G,$e,bs,z,rn,We,ln,on,an,Ht,vt,un,Ke,Wl,M=C({"util/lint.ts"(){"use strict";Ze(),Ne(),de(),B(),Un=new Set(["tr","td","th","caption"]),Hn=new Set(["Template:!!","Template:!-"]),Mt=e=>{const t=e.childNodes.find(s=>s.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&Hn.has(t.name)||t.is("html")&&Un.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Mt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Mt);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Di=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Bs=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:o,left:d}=s instanceof le?s:new le(t,l),{offsetHeight:u,offsetWidth:a}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,o,d),{line:p,character:b}=Di(g,c,u,a);return{rule:i,message:I.msg(r),severity:n,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:b}},q=Bs((e,t,s,i)=>{const r=e.getRelativeIndex(),{top:n,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+n,startCol:n?l:i+l}}),G=Bs((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),$e=(e,t,s,i=0)=>({desc:I.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),bs=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),z=(e,t=0,s="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:s}:$e(e,"remove",s,t),rn=(e,t)=>$e(e,"decode",Ut(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),We=(e,t,s=0)=>({desc:I.msg("close"),range:[e+s,e],text:t}),ln=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),on=(e,t)=>$e(e,"comment",`<!--${t}-->`),an=(e,t)=>$e(e,"uppercase",t.toUpperCase()),Ht=(e,t=0)=>({desc:I.msg("whitespace"),range:[e,e+t],text:" "}),vt=(e,t,s=1)=>({desc:I.msg("escape"),range:[e,e+s],text:t.repeat(s)}),un=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"&#124;")}),Ke=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===ke.rev))return e[1];const r=t();return(i||I.viewOnly)&&s([ke.rev,r]),r},Wl=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),Dn,dn,Ml=C({"parser/selector.ts"(){"use strict";Dn=(e,t,s)=>{if(e.includes("#")){const i=e.indexOf("#");return(i===0||e.slice(0,i)===t)&&e.slice(i+1)===s}return!e||e===t},dn=(e,t,s)=>{const i=e.split(",");return(({type:r,name:n})=>i.some(l=>Dn(l.trim(),r,n)))}}}),ws,hn=C({"mixin/cached.ts"(){"use strict";M(),ws=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Ke(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),zl,Ma=C({"mixin/nodeLike.ts"(){"use strict";zl=e=>{class t extends e{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return t}}}),Gn,Vn,Jt,St,kt,Xt,At,_t,$t,Je,Ul=C({"lib/node.ts"(){"use strict";M(),Ne(),hn(),Ma(),B(),Vn=[zl],Gn=[ws(!1)],Je=class{constructor(){J($t,5,this),Oa(this,"childNodes",[]),Oe(this,Jt),Oe(this,St),Oe(this,kt),Oe(this,Xt),Oe(this,At),Oe(this,_t,{})}get parentNode(){return he(this,Jt)}get nextSibling(){return he(this,St)}get previousSibling(){return he(this,kt)}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":we(this,Jt,t),t||(we(this,St,void 0),we(this,kt,void 0));break;case"nextSibling":we(this,St,t);break;case"previousSibling":we(this,kt,t);break;case"aIndex":I.viewOnly&&we(this,At,[ke.rev,t]);break;default:this[e]=t}}getRootNode(){return Ke(he(this,Xt),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&we(this,Xt,e)})}indexFromPos(e,t){this.lspError("AstNode.indexFromPos")}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=s.findIndex(([,,r])=>e<=r);return{top:i,left:e-s[i][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return Ke(he(this,_t)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)I.viewOnly&&(he(this,_t)[r]=[ke.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{he(this,_t)[e]=t})}getAbsoluteIndex(){return Ke(he(this,At),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{we(this,At,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){{const e=[];let t=0;for(const s of String(this).split(`
2
- `)){const i=t+s.length;e.push([s,t,i]),t=i+1}return e}}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},$t=Y(null),Jt=new WeakMap,St=new WeakMap,kt=new WeakMap,Xt=new WeakMap,At=new WeakMap,_t=new WeakMap,X($t,1,"getLines",Gn,Je),Je=X($t,0,"AstNode",Vn,Je),J($t,1,Je)}}),Hl,za=C({"mixin/elementLike.ts"(){"use strict";Ml(),Hl=e=>{var t,Gi;{class i extends e{constructor(){super(...arguments);N(this,t)}getElementBy(l){for(const o of this.childNodes){if(o.type==="text")continue;if(l(o))return o;const d=o.getElementBy(l);if(d)return d}}querySelector(l){return this.getElementBy(P(this,t,Gi).call(this,l))}getElementsBy(l,o=[]){for(const d of this.childNodes)d.type!=="text"&&(l(d)&&o.push(d),d.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(P(this,t,Gi).call(this,l))}escape(){}}return t=new WeakSet,Gi=function(l){return dn(l,this)},i}}}}),Qn,js,Jn,Lt,Ua=C({"lib/element.ts"(){"use strict";ce(),Ne(),Ml(),Ul(),za(),Qn=[Hl],Lt=class extends(Jn=Je){get length(){return this.childNodes.length}text(e){return Ye(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,r;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(r=e[s])==null||r.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:r}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||r===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){this.lspError("AstElement.removeAt")}insertAt(e,t=this.length){return Tn(this,t,0,[e]),e}closest(e){const t=dn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,r=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",r);const l=n.lint(r,t);l.length>0&&s.push(...l),r+=n.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+xt(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){}},js=Y(Jn),Lt=X(js,0,"AstElement",Qn,Lt),J(js,1,Lt)}}),Kt,qs,Ws,Xn,Kn,Yn,Zn,Ms,er,Vi,Ha=C({"lib/text.ts"(){"use strict";var e,Dl,s;ce(),M(),B(),Ul(),Kt=String.raw`[${qe}\t]*`,qs=String.raw`[^\S\n]*`,Ws=String.raw`<${qs}(?:/${qs})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Kt}\d)|isbn(?=[-::]?${Kt}(?:\d(?:${Kt}|-)){6})`,Xn=new RegExp(String.raw`${Ws}|https?[:/]/+`,"giu"),Kn=new RegExp(Ws,"giu"),Yn=new Set(["attr-value","ext-link-text","link-text"]),Zn={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ms=new Set(["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"]),er=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){return/\w/u}})(),Vi=(s=class extends Je{constructor(r){super();N(this,e);Fe(this,"data","");this.data=r}get type(){return"text"}toString(r){var n;return r&&!((n=this.parentNode)!=null&&n.getAttribute("built"))?ve(this.data):this.data}text(){return this.data}lint(r=this.getAbsoluteIndex(),n){var l,o,d;{if(n===!1)return[];const{data:u,parentNode:a,nextSibling:h,previousSibling:g}=this;if(!a)throw new Error("An isolated text node cannot be linted!");const{type:c,name:p,parentNode:b}=a;if(c==="attr-value"){const{name:O,tag:re}=b;if(re==="ref"&&(O==="name"||O==="follow")||O==="group"&&(re==="ref"||re==="references")||re==="choose"&&(O==="before"||O==="after"))return[]}if(n!=null||(n=c==="free-ext-link"||c==="ext-link-url"||c==="ext-link-text"||c==="image-parameter"&&p==="link"||c==="attr-value"?Kn:Xn),u.search(n)===-1)return[];n.lastIndex=0;const x=[],v=h==null?void 0:h.type,y=h==null?void 0:h.name,k=g==null?void 0:g.type,w=this.getRootNode(),A=w.toString(),{ext:_,html:f,variants:S}=w.getAttribute("config"),{top:$,left:T}=w.posFromIndex(r),{lintConfig:F}=I,j=F.rules["tag-like"],R=typeof j=="object"&&j[1]?new Set(Object.keys(j[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,ne=new Set(["onlyinclude","noinclude","includeonly",..._,...f[0],...f[1],...f[2],...R,...F.getSeverity("tag-like","disallowed")?Ms:[]]);for(let O=n.exec(u);O;O=n.exec(u)){const[,re,pe]=O;let{index:V,0:D}=O;if(pe&&pe!=="]"){const{length:ge}=pe;V+=ge,D=D.slice(ge)}D=D.toLowerCase();const[K]=D,U=K==="r"||K==="p"||K==="i",Z=K==="{",H=K==="}",ee=K==="[",oe=K==="]";let{length:ae}=D;if(K==="<"&&!ne.has(re.toLowerCase())||ee&&c==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(u.slice(V+1))||h!=null&&h.is("ext")&&y==="nowiki"&&((l=h.innerText)!=null&&l.includes("]")))||U&&(!a.isPlain()||Yn.has(c)))continue;oe&&(V||ae>1)&&n.lastIndex--;let te=r+V,De=te+ae,ue,me;const Ce=A[De],Is=A[te-1],Ns=Z||ee,Ls=Z&&Is==="-"&&S.length>0,Fs=H&&Ce==="-"&&S.length>0,Cn=ee&&v==="free-ext-link"&&!u.slice(V+1).trim()||oe&&k==="free-ext-link"&&!u.slice(0,V).includes("]");if(U)ue="lonely-http",D=D.toUpperCase(),me=F.getSeverity(ue,D);else if(K==="<"){ue="tag-like";let ge;/^<\/?\s/u.test(D)||!/[\s/>]/u.test(Ce!=null?Ce:"")?ge="invalid":R.has(re)?ge=re:Ms.has(re)&&!_.includes(re)&&(ge="disallowed"),me=F.getSeverity(ue,ge)}else if(Ls||Fs)ue="lonely-bracket",me=F.getSeverity(ue,"converter"),Ls&&V>0?(D="-{",V--,te--,ae=2):Fs&&V<u.length-1&&(D="}-",De++,ae=2);else if(Cn)ue="lonely-bracket",me=F.getSeverity(ue,"extLink");else if(Ns||H||oe)if(ue="lonely-bracket",ae>1||Z&&Ce===K||H&&Is===K)me=F.getSeverity(ue,"double");else{if(!ee||c!=="ext-link-text"){const ge=Zn[K],Es=Ns?u.slice(V+1):u.slice(0,V);if(Z&&((o=ge.exec(Es))==null?void 0:o[0])==="}"||H&&((d=ge.exec(Es))==null?void 0:d[0])==="{")continue;if(!Es.includes(K)){const Fn=Ns?"nextSibling":"previousSibling";let Ve=this[Fn];for(;Ve&&(Ve.type!=="text"||!ge.test(Ve.data));)Ve=Ve[Fn];if(Ve&&ge.exec(Ve.data)[0]!==K)continue}}me=F.getSeverity(ue,"single")}else ue="lonely-http",me=F.getSeverity(ue);if(!me)continue;const In=this.posFromIndex(V),{line:Nn,character:Ln}=Di($,T,In.top+1,In.left),Ge={rule:ue,message:I.msg("lonely",U||K==="h"||Ls||Fs?D:K),severity:me,startIndex:te,endIndex:De,startLine:Nn,endLine:Nn,startCol:Ln,endCol:Ln+ae};if(F.computeEditInfo)if(K==="<")Ge.suggestions=[vt(te,"&lt;")];else if(K==="h"&&c!=="link-text"&&er.test(Is||""))Ge.suggestions=[Ht(te)];else if(ee&&c==="ext-link-text"){const ge=a.getAbsoluteIndex()+a.toString().length;Ge.suggestions=[vt(ge,"&#93;")]}else if(oe&&Cn){const ge=r-g.toString().length;Ge.suggestions=[bs(ge,"left-bracket","[")]}else U&&(Ge.suggestions=[...O[0]===D?[]:[an(Ge,D)],...Ce===":"||Ce===":"?[Ht(De,1)]:[]]);x.push(Ge)}return x}}replaceData(r){P(this,e,Dl).call(this,r)}splitText(r){this.lspError("AstText.splitText")}escape(){}print(){return zt(this.data)}},e=new WeakSet,Dl=function(r){this.setAttribute("data",r)},s)}}),ze,et=C({"mixin/hidden.ts"(){"use strict";ze=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),Ie,Ee=C({"mixin/noEscape.ts"(){"use strict";Ie=e=>{}}}),Ue,tt=C({"src/syntax.ts"(){"use strict";var e,t;W(),Ue=(t=class extends E{constructor(i,r,n,l,o){super(i,n,l,o);N(this,e);L(this,e,r)}get type(){return m(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Pe,He=C({"mixin/padded.ts"(){"use strict";Pe=({length:e})=>t=>{{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}}),xe,st=C({"src/atom.ts"(){"use strict";var e,t;W(),xe=(t=class extends E{constructor(i,r,n,l,o){super(i,n,l,o);N(this,e);L(this,e,r)}get type(){return m(this,e)}set type(i){L(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),tr,sr,zs,ir,Be,ys=C({"src/link/base.ts"(){"use strict";var e,t,s,i;M(),Me(),de(),He(),Ee(),B(),W(),st(),tr=r=>r==="redirect-target"||r==="link",sr=[Ie,Pe("[[")],Be=(i=class extends(ir=E){constructor(n,l,o,d=[],u="|"){super(void 0,o,d,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new xe(n,"link-target",o,d,{})),l!==void 0){const a=new E(l,o,d,{});a.type="link-text",a.setAttribute("stage",be-1),this.insertAt(a)}L(this,t,u)}get link(){}get fragment(){}afterBuild(){L(this,s,this.getTitle()),m(this,t).includes("\0")&&L(this,t,this.buildFromStr(m(this,t),0)),this.setAttribute("name",m(this,s).title),super.afterBuild()}setAttribute(n,l){n==="bracket"?L(this,e,l):n==="title"?L(this,s,l):super.setAttribute(n,l)}toString(n){const l=super.toString(n,m(this,t));return m(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return m(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?m(this,s):super.getAttribute(n)}getGaps(n){return n===0?m(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{childNodes:[d,u],type:a}=this,{encoded:h,fragment:g}=m(this,s),{lintConfig:c}=I,{computeEditInfo:p,fix:b}=c,x=new le(this,n);let v="unknown-page",y=c.getSeverity(v);if(y&&d.childNodes.some(({type:k})=>k==="template")&&o.push(q(d,x,v,"template-in-link",y)),v="url-encoding",y=c.getSeverity(v),y&&h){const k=q(d,x,v,"unnecessary-encoding",y);(p||b)&&(k.fix=rn(k,d)),o.push(k)}if(v="pipe-like",y=c.getSeverity(v,"link"),y&&(a==="link"||a==="category")){const k=u==null?void 0:u.childNodes.findIndex(A=>A.type==="text"&&A.data.includes("|")),w=u==null?void 0:u.childNodes[k];if(w){const A=q(u,x,v,"pipe-in-link",y);if(p){const _=A.startIndex+u.getRelativeIndex(k);A.suggestions=[un(_,w.data)]}o.push(A)}}if(v="no-ignored",y=c.getSeverity(v,"fragment"),y&&g!==void 0&&!tr(a)){const k=q(d,x,v,"useless-fragment",y);if(p||b){const w=d.childNodes.findIndex(_=>_.type==="text"&&_.data.includes("#")),A=d.childNodes[w];A&&(k.fix=z(k,d.getRelativeIndex(w)+A.data.indexOf("#")))}o.push(k)}return o}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(m(this,e)?{pre:"[[",post:"]]",sep:m(this,t)}:{sep:m(this,t)})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),zs=Y(ir),Be=X(zs,0,"LinkBaseToken",sr,Be),J(zs,1,Be)}}),nr,Us,rr,Te,it=C({"src/nowiki/base.ts"(){"use strict";Ee(),W(),nr=[Ie],Te=class extends(rr=E){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Us=Y(rr),Te=X(Us,0,"NowikiBaseToken",nr,Te),J(Us,1,Te)}}),lr,Hs,or,Se,yt=C({"src/nowiki/noinclude.ts"(){"use strict";et(),it(),lr=[ze()],Se=class extends(or=Te){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Hs=Y(or),Se=X(Hs,0,"NoincludeToken",lr,Se),J(Hs,1,Se)}}),Gl,Da=C({"src/link/redirectTarget.ts"(){"use strict";M(),B(),ys(),yt(),Gl=class extends Be{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new Se(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:i}=I,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=q(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=z(n)),t.push(n)}return t}}}}}),ar,Ds,ur,Ft,Ga=C({"src/redirect.ts"(){"use strict";var e,t,s;et(),Ee(),W(),tt(),Da(),ar=[ze(!1,!1),Ie],Ft=(s=class extends(ur=E){constructor(r,n,l,o,d,u,a=[]){super(void 0,u,a);N(this,e);N(this,t);L(this,e,r),L(this,t,d),this.append(new Ue(n,"redirect-syntax",u,a),new Gl(l,o==null?void 0:o.slice(1),u,a))}get type(){return"redirect"}getAttribute(r){return r==="padding"?m(this,e).length:super.getAttribute(r)}toString(r){return m(this,e)+super.toString(r)+m(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+m(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:m(this,e),post:m(this,t)})}},e=new WeakMap,t=new WeakMap,s),Ds=Y(ur),Ft=X(Ds,0,"RedirectToken",ar,Ft),J(Ds,1,Ft)}}),Vl={};se(Vl,{parseRedirect:()=>Ql});var Ql,Va=C({"parser/redirect.ts"(){"use strict";B(),Ga(),Ql=(e,t,s)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&I.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Ft(...i.slice(1),t,s),e):!1}}}),dr,Gs,hr,Et,Qa=C({"src/onlyinclude.ts"(){"use strict";He(),Ee(),W(),dr=[Ie,Pe("<onlyinclude>")],Et=class extends(hr=E){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}},Gs=Y(hr),Et=X(Gs,0,"OnlyincludeToken",dr,Et),J(Gs,1,Et)}}),Gt,Ss=C({"mixin/gapped.ts"(){"use strict";Gt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),cr,Vs,gr,Xe,cn=C({"src/tagPair/index.ts"(){"use strict";var e,t;Ss(),Ee(),W(),cr=[Gt(),Ie],Xe=(t=class extends(gr=E){constructor(i,r,n,l,o,d=[]){super(void 0,o);N(this,e);Fe(this,"closed");Fe(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),L(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,n);const u=typeof r=="string"?-1:d.indexOf(r);d.splice(u===-1?1/0:u,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[o,d]=m(this,e);return r?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${l.toString(i)}${this.closed?`</${d}>`:""}`}text(){const[i,r]=m(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?m(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=m(this,e);return super.print(this.selfClosing?{pre:`&lt;${i}`,post:"/&gt;"}:{pre:`&lt;${i}`,sep:"&gt;",post:this.closed?`&lt;/${r}&gt;`:""})}},e=new WeakMap,t),Vs=Y(gr),Xe=X(Vs,0,"TagPairToken",cr,Xe),J(Vs,1,Xe)}}),gn,Jl=C({"src/tag/index.ts"(){"use strict";var e,t,s,i;M(),Ne(),B(),W(),gn=(i=class extends E{constructor(n,l,o,d,u){super(void 0,d,u);N(this,e);N(this,t);N(this,s);this.insertAt(l),L(this,e,o),L(this,t,n)}get closing(){return m(this,e)}toString(n){return`<${m(this,e)?"/":""}${m(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${m(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?m(this,t).length+(m(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return Ke(m(this,s),()=>{const{type:n,name:l,parentNode:o,closing:d,selfClosing:u}=this;let a=!1,h=!1;if(n==="html"){const{html:[,v,y]}=this.getAttribute("config");a=y.includes(l),h=v.includes(l)}if(a||h&&u)return this;if(!o)return;const{childNodes:g}=o,c=g.indexOf(this),p=d?g.slice(0,c).reverse():g.slice(c+1),b=[this],{rev:x}=ke;for(const v of p)if(!(!v.is(n)||n==="html"&&(v.name!==l||h&&v.selfClosing)))if(m(v,e)===d){if(n==="tvar")return;b.push(v)}else{const y=b.pop();if(y===this)return v;I.viewOnly&&(L(y,s,[x,v]),L(v,s,[x,y]))}if(I.viewOnly)for(const v of b)L(v,s,[x,void 0])},n=>{L(this,s,n),n[1]&&n[1]!==this&&L(n[1],s,[ke.rev,this])})}print(){return super.print({pre:`&lt;${m(this,e)?"/":""}${m(this,t)}`,post:`${this.selfClosing?"/":""}&gt;`})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),pr,Qs,fr,je,Ja=C({"src/tag/tvar.ts"(){"use strict";et(),Jl(),tt(),pr=[ze()],je=class extends(fr=gn){get type(){return"tvar"}constructor(e,t,s,i,r){const n=new Ue(t,"tvar-name",i,r);super(e,n,s,i,r)}},Qs=Y(fr),je=X(Qs,0,"TvarToken",pr,je),J(Qs,1,je)}}),Xl,Xa=C({"src/tagPair/translate.ts"(){"use strict";var e,Kl,s;W(),cn(),tt(),Ja(),Xl=(s=class extends Xe{constructor(r,n,l,o=[]){const d=new Ue(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(a,h,g)=>(new je("tvar",h,!1,l,o),new je("","",!0,l,o),`\0${o.length-2}n${g}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(a,h,g,c,p,b,x)=>(new je(h,g,!1,l,o),new je(b,x,!0,l,o),`\0${o.length-2}n${p}\0${o.length}n`));const u=new E(n,l,o);u.type="translate-inner";super("translate",d,u,"translate",l,o);N(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext">&lt;translate${P(this,e,Kl).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}&gt;${this.lastChild.print({class:"ext-inner"})}&lt;/translate&gt;</span>`}},e=new WeakSet,Kl=function(){return this.firstChild.toString()===" nowrap"},s)}}),mr,Js,xr,Pt,Ka=C({"src/tagPair/include.ts"(){"use strict";M(),de(),et(),B(),cn(),mr=[ze(!1)],Pt=class extends(xr=Xe){get type(){return"include"}constructor(e,t="",s,i,r,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",r,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:r}=this,n=new le(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=I,{computeEditInfo:d}=o,u=l.map(a=>o.getSeverity(a,"include"));if(u[0]&&s.data.trim()){const a=q(s,n,l[0],"useless-attribute",u[0]);d&&(a.suggestions=[z(a)]),t.push(a)}if(u[1]&&!i){const a=G(this,n,l[1],I.msg("unclosed",`<${r}>`),u[1]);d&&(a.suggestions=[We(a.endIndex,`</${r}>`)]),t.push(a)}return t}}},Js=Y(xr),Pt=X(Js,0,"IncludeToken",mr,Pt),J(Js,1,Pt)}}),ks,pn=C({"mixin/attributesParent.ts"(){"use strict";ks=(e=0)=>t=>{var s,Yl;{class r extends t{constructor(){super(...arguments);N(this,s)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return P(this,s,Yl).call(this).getAttr(o)}}return s=new WeakSet,Yl=function(){return this.childNodes[e]},r}}}}),ie,Xs,Ks,Tt,Yt,Ys,Qe,Zs,ei,ti,Zt,si,Ae,Zl,eo,to,so,Ya=C({"util/sharable.ts"(){"use strict";ie=new Set(["align"]),Xs=new Set(["cite"]),Ks=new Set(["cite","datetime"]),Tt=new Set(["width"]),Yt=new Set(["axis","align","bgcolor","height","width","valign"]),Ys=new Set([...Yt,"abbr","headers","scope","rowspan","colspan"]),Qe=new Set(["type"]),Zs=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ei=new Set(["clear"]),ti=new Set(["bgcolor","align","valign"]),Zt=new Set(["qid","forcemathmode","type","display"]),si=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Ae=new Set,Zl=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"]),eo={div:ie,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,blockquote:Xs,q:Xs,p:ie,br:ei,pre:Tt,ins:Ks,del:Ks,ul:Qe,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Zs,"border"]),caption:ie,tr:ti,td:Ys,th:Ys,font:new Set(["size","color","face"]),hr:Tt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Qe,poem:ie,categorytree:ie,combooption:ie,math:Ae,chem:Ae,ce:Ae,img:new Set(["alt","src","width","height","loading","srcset"])},to={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:Ae,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Ae,inputbox:Ae,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Ae,poll:new Set(["id","show-results-before-voting"]),sm2:Qe,flashmp3:Qe,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"]),math:new Set([...Zt,"chem"]),chem:Zt,ce:Zt,hiero:Ae,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:si,syntaxhighlight:si,templatedata:Ae,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Ae},so={table:Zs,td:new Set([...Yt,"scope"]),th:Yt,br:ei,caption:ie,div:ie,hr:Tt,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,li:Qe,p:ie,pre:Tt,tr:ti,ul:Qe}}}),vr,br,wr,yr,os,Za=C({"src/attribute.ts"(){"use strict";var e,t,s,i,r,io,Qi,o;M(),ce(),Me(),Ya(),de(),B(),W(),st(),vr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,br=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,wr=new Set(["ext","arg","magic-word","template"]),yr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),os=(o=class extends E{constructor(u,a,h,g="",c,p=[],b=I.getConfig(),x=[]){const v=new xe(h,"attr-key",b,x);let y;if(h==="title"||a==="img"&&h==="alt")y=new E(c,b,x,{}),y.type="attr-value",y.setAttribute("stage",be-1);else if(a==="gallery"&&h==="caption"||a==="choose"&&(h==="before"||h==="after")){const k=Le(fe({},b),{excludes:[...b.excludes,"heading","html","table","hr","list"]});y=new E(c,k,x,{}),y.type="attr-value",y.setAttribute("stage",1)}else y=new xe(c,"attr-value",b,x,{});super(void 0,b,x);N(this,r);N(this,e);N(this,t);N(this,s);N(this,i);L(this,e,u),this.append(v,y),L(this,s,g),L(this,i,[...p]),L(this,t,a),this.setAttribute("name",mt(ve(h)))}get type(){return m(this,e)}get tag(){return m(this,t)}get balanced(){return!m(this,s)||m(this,i)[0]===m(this,i)[1]}afterBuild(){m(this,s).includes("\0")&&L(this,s,this.buildFromStr(m(this,s),0)),this.parentNode&&L(this,t,this.parentNode.name),P(this,r,io).call(this),super.afterBuild()}toString(u){const[a="",h=""]=m(this,i);return m(this,s)?super.toString(u,m(this,s)+a)+h:this.firstChild.toString(u)}text(){return m(this,s)?`${super.text(`${m(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var u,a;return m(this,s)?m(this,s).length+((a=(u=m(this,i)[0])==null?void 0:u.length)!=null?a:0):0}lint(u=this.getAbsoluteIndex(),a){var h;{const g=super.lint(u,a),{balanced:c,firstChild:p,lastChild:b,name:x,tag:v}=this,y=new le(this,u),k=["unclosed-quote","obsolete-attr"],{lintConfig:w}=I,A=k.map(f=>w.getSeverity(f,x));if(A[0]&&!c){const f=q(b,y,k[0],"unclosed-quotes",A[0]);f.startIndex--,f.startCol--,w.computeEditInfo&&(f.suggestions=[We(f.endIndex,m(this,i)[0])]),g.push(f)}const _=P(this,r,Qi).call(this,u,y);return _&&g.push(_),A[1]&&((h=so[v])!=null&&h.has(x))&&g.push(q(p,y,k[1],"obsolete-attribute",A[1])),g}}getValue(){return m(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(u){return u==="invalid"?P(this,r,Qi).call(this):super.getAttribute(u)}print(){const[u="",a=""]=m(this,i);return m(this,s)?super.print({sep:zt(m(this,s))+u,post:a}):super.print()}json(u,a=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,io=function(){this.setAttribute("name",mt(this.firstChild.text()))},Qi=function(u,a){const{firstChild:h,lastChild:g,type:c,name:p,tag:b,parentNode:x}=this,v=!g.childNodes.some(({type:$})=>wr.has($)),y=this.getValue(),k=to[b],w=eo[b],{length:A}=this.toString();let _="illegal-attr",f,S;if({lintConfig:f}=I,{computeEditInfo:S}=f,!(k!=null&&k.has(p))&&!(w!=null&&w.has(p))&&(c==="ext-attr"?k||w:!/\{\{[^{]+\}\}/u.test(p))&&(c==="ext-attr"&&!w||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(b==="meta"||b==="link"||!Zl.has(p)))||(p==="itemtype"||p==="itemid"||p==="itemref")&&!(x!=null&&x.hasAttr("itemscope"))){if(u===void 0)return!0;{const $=f.getSeverity(_,"unknown");if($){const T=q(h,a,_,"illegal-attribute-name",$);return S&&(T.suggestions=[z(u,A)]),T}}}else if(p==="style"&&typeof y=="string"&&vr.test(y)){if(u===void 0)return!0;{_="insecure-style";const $=f.getSeverity(_);return $&&q(g,a,_,"insecure-style",$)}}else if(p==="tabindex"&&typeof y=="string"&&y!=="0"){if(u===void 0)return!0;{const $=f.getSeverity(_,"tabindex");if($){const T=q(g,a,_,"nonzero-tabindex",$);return S&&(T.suggestions=[z(u,A),$e(T,"0 tabindex","0")]),T}}}else if(typeof y=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||yr.has(p))&&br.test(y)||v&&(p==="href"||b==="img"&&p==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(y))){if(u===void 0)return!0;{const $=f.getSeverity(_,"value");return $&&q(g,a,_,"illegal-attribute-value",$)}}else if(v&&c!=="ext-attr"){const $=Wl(b,p),T=String(y).toLowerCase();if($.length>0&&$.every(F=>F!==T)){if(u===void 0)return!0;{const F=f.getSeverity(_,"value");return F&&q(g,a,_,"illegal-attribute-value",F)}}}return!1},o)}}),ii,Sr,kr,As,fn=C({"src/attributes.ts"(){"use strict";var e,t,as,i;M(),ce(),de(),B(),W(),st(),Za(),ii=r=>r.slice(0,-1),Sr=r=>`${ii(r)}-dirty`,kr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(r){return/[^\W_]/u}})(),As=(i=class extends E{constructor(n,l,o,d,u=[]){super(void 0,d,u,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",o),n){const a=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let h="",g=a.exec(n),c=0;const p=(()=>{h&&(super.insertAt(new xe(h,Sr(l),d,u,{})),h="")});for(;g;){const{index:b,0:x,1:v,2:y,3:k,4:w,5:A,6:_}=g;if(h+=n.slice(c,b),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(ve(v).trim())){const f=w!=null?w:_,S=[k,A],$=new os(ii(l),o,v,y,f,S,d,u);p(),super.insertAt($)}else h+=x;({lastIndex:c}=a),g=a.exec(n)}h+=n.slice(c),p()}}get type(){return m(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof os&&(!n||l.name===mt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{parentNode:d,childNodes:u}=this,a=new Map,h=new Set,g=new le(this,n),c=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:b,fix:x}=p,v=["closingTag","invalidAttributes","nonWordAttributes"].map(k=>p.getSeverity(c[0],k));if(v[0]&&P(this,t,as).call(this)){const k=G(this,g,c[0],"attributes-of-closing-tag",v[0]);if(b){const w=d.getAbsoluteIndex();k.suggestions=[z(k),ln(w)]}o.push(k)}for(const k of u)if(k instanceof os){const{name:w}=k;a.has(w)?(h.add(w),a.get(w).push(k)):a.set(w,[k])}else{const w=k.text().trim(),A=v[kr.test(w)?1:2];if(w&&A){const _=q(k,g,c[0],"invalid-attribute",A);b&&(_.suggestions=[z(_,0," ")]),o.push(_)}}const y=p.getSeverity(c[1],"attribute");if(y&&h.size>0)for(const k of h){const w=a.get(k).map(A=>{const _=A.getValue();return[A,_===!0?"":_]});o.push(...w.map(([A,_],f)=>{const S=q(A,g,c[1],I.msg("duplicate-attribute",k),y);if(b||x){const $=z(S);!_||w.slice(0,f).some(([,T])=>T===_)?S.fix=$:b&&(S.suggestions=[$])}return S}))}return o}}getAttribute(n){return n==="invalid"?P(this,t,as).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,as).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof xe?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,as=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),no={};se(no,{PreToken:()=>ro});var ro,eu=C({"src/pre.ts"(){"use strict";Me(),W(),yt(),ro=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),d=0,u="";for(;l&&o;)new Se(l[0],t,s,!0),new Se(o[0],t,s,!0),u+=`${e.slice(d,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,d=o.index+n+1,i.lastIndex=d,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=u+e.slice(d)}super(e,t,s,{}),this.setAttribute("stage",be-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),_s,mn=C({"src/multiLine/index.ts"(){"use strict";W(),_s=class extends E{get type(){return"ext-inner"}toString(e){return super.toString(e,`
1
+ "use strict";(()=>{var Na=Object.defineProperty,La=Object.defineProperties;var Fa=Object.getOwnPropertyDescriptors;var Jt=Object.getOwnPropertySymbols;var Pn=Object.prototype.hasOwnProperty,Rn=Object.prototype.propertyIsEnumerable;var On=e=>{throw TypeError(e)};var Rs=(e,t,s)=>t in e?Na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,fe=(e,t)=>{for(var s in t||(t={}))Pn.call(t,s)&&Rs(e,s,t[s]);if(Jt)for(var s of Jt(t))Rn.call(t,s)&&Rs(e,s,t[s]);return e},Le=(e,t)=>La(e,Fa(t));var Bn=(e,t)=>{var s={};for(var i in e)Pn.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&Jt)for(var i of Jt(e))t.indexOf(i)<0&&Rn.call(e,i)&&(s[i]=e[i]);return s};var Ea=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fe=(e,t,s)=>Rs(e,typeof t!="symbol"?t+"":t,s),Os=(e,t,s)=>t.has(e)||On("Cannot "+s);var m=(e,t,s)=>(Os(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?On("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(Os(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),P=(e,t,s)=>(Os(e,t,"access private method"),s);var jn=(e,t,s,i)=>({set _(r){L(e,t,r,s)},get _(){return m(e,t,i)}});var qu=Ea((Mu,Ia)=>{var Pa=Object.create,bt=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,sn=Object.getOwnPropertyNames,Ra=Object.prototype.hasOwnProperty,Fl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),wt=e=>{throw TypeError(e)},El=(e,t,s)=>t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,qn=(e,t)=>bt(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[sn(e)[0]])(e=0)),t},Pl=(e,t)=>function(){return t||(0,e[sn(e)[0]])((t={exports:{}}).exports,t),t.exports},se=(e,t)=>{for(var s in t)bt(e,s,{get:t[s],enumerable:!0})},Oa=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of sn(t))!Ra.call(e,r)&&r!==s&&bt(e,r,{get:()=>t[r],enumerable:!(i=Ll(t,r))||i.enumerable});return e},Q=e=>Oa(bt({},"__esModule",{value:!0}),e),Y=e=>{var t;return[,,,Pa((t=e==null?void 0:e[Fl("metadata")])!=null?t:null)]},Rl=["class","method","getter","setter","accessor","field","value","get","set"],Nt=e=>e!==void 0&&typeof e!="function"?wt("Function expected"):e,Ba=(e,t,s,i,r)=>({kind:Rl[e],name:t,metadata:i,addInitializer:n=>s._?wt("Already initialized"):r.push(Nt(n||null))}),nn=(e,t)=>El(t,Fl("metadata"),e[3]),J=(e,t,s,i)=>{for(var r=0,n=e[t>>1],l=n&&n.length;r<l;r++)t&1?n[r].call(s):i=n[r].call(s,i);return i},X=(e,t,s,i,r,n)=>{var l,o,d,u,a,h=t&7,c=!!(t&8),g=!!(t&16),p=h>3?e.length+1:h?c?1:2:0,v=Rl[h+5],x=h>3&&(e[p-1]=[]),b=e[p]||(e[p]=[]),y=h&&(!g&&!c&&(r=r.prototype),h<5&&(h>3||!g)&&Ll(h<4?r:{get[s](){return he(this,n)},set[s](w){return ye(this,n,w)}},s));h?g&&h<4&&qn(n,(h>2?"set ":h>1?"get ":"")+s):qn(r,s);for(var S=i.length-1;S>=0;S--)u=Ba(h,s,d={},e[3],b),h&&(u.static=c,u.private=g,a=u.access={has:g?w=>qa(r,w):w=>s in w},h^3&&(a.get=g?w=>(h^1?he:Ui)(w,r,h^4?n:y.get):w=>w[s]),h>2&&(a.set=g?(w,A)=>ye(w,r,A,h^4?n:y.set):(w,A)=>w[s]=A)),o=(0,i[S])(h?h<4?g?n:y[v]:h>4?void 0:{get:y.get,set:y.set}:r,u),d._=1,h^4||o===void 0?Nt(o)&&(h>4?x.unshift(o):h?g?n=o:y[v]=o:r=o):typeof o!="object"||o===null?wt("Object expected"):(Nt(l=o.get)&&(y.get=l),Nt(l=o.set)&&(y.set=l),Nt(l=o.init)&&x.unshift(l));return h||nn(e,r),y&&bt(r,s,y),g?h^4?n:y:r},ja=(e,t,s)=>El(e,typeof t!="symbol"?t+"":t,s),rn=(e,t,s)=>t.has(e)||wt("Cannot "+s),qa=(e,t)=>Object(t)!==t?wt('Cannot use the "in" operator on this value'):e.has(t),he=(e,t,s)=>(rn(e,t,"read from private field"),s?s.call(e):t.get(e)),Oe=(e,t,s)=>t.has(e)?wt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ye=(e,t,s,i)=>(rn(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Ui=(e,t,s)=>(rn(e,t,"access private method"),s),Wa=(e,t,s,i)=>({set _(r){ye(e,t,r,s)},get _(){return he(e,t,i)}}),Ol,fs,Bl=C({"base.ts"(){"use strict";Ol=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11,"list-range":11};return Object.setPrototypeOf(e,null),e})(),fs=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-url","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"];return Object.freeze(e),e})()}});function Se(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,r)=>Se(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(i,r)=>t[r])}var qe,Bs,pt,ft,mt,nt,jl,ve,Ye,Wn,Mn,ms,ql,zn,Un,Ut,xt,ce=C({"util/string.ts"(){"use strict";qe=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Bs=String.raw`[^[\]<>"\0-\x1F\x7F${qe}\uFFFD]`,pt=String.raw`(?:\[[\da-f:.]+\]|${Bs})`,ft=String.raw`(?:${Bs}|\0\d+[cn!~]\x7F)*`,mt=e=>e.trim().toLowerCase(),nt=(e,t)=>s=>s.replace(e,t),jl=nt(/[\0\x7F]|\r$/gmu,""),ve=nt(/\0\d+[cn]\x7F/gu,""),Ye=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),Wn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Mn=nt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):Wn[s.toLowerCase()]),ms=e=>Mn(e),ql=nt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),zn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Un=e=>nt(e,t=>`&${zn[t]};`),Ut=Un(/[&<>]/gu),xt=(e,t={})=>{const{pre:s="",post:i="",sep:r=""}=t;return s+e.map(n=>n.print()).join(r)+i}}}),Ma=Pl({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invalid-url":"invalid URL","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',"ref-in-link":"<ref> in an internal or external link",remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),za=Pl({"config/minimum.json"(e,t){t.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:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#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","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#timef":"timef","#timefl":"timefl"},["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:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),be,Wl,Hi,Me=C({"util/constants.ts"(){"use strict";be=11,Wl=Ma(),Hi=za()}});function gt(e){const t=new Map,s=new WeakMap;return i=>{const r=typeof i=="string"?t:s;if(r.has(i)){const l=r.get(i);return l.lastIndex=0,l}const n=e(i);return r.set(i,n),n}}var Ht,Ml,Ze=C({"../common/dist/index.mjs"(){"use strict";Ht=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ml=gt}}),le,de=C({"lib/rect.ts"(){"use strict";var e,t,s,i,Di,n;le=(n=class{constructor(l,o){N(this,i);N(this,e);N(this,t);N(this,s);L(this,e,l),L(this,t,o)}get start(){return m(this,t)}get top(){return P(this,i,Di).call(this).top}get left(){return P(this,i,Di).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Di=function(){var l;return(l=m(this,s))!=null||L(this,s,m(this,e).getRootNode().posFromIndex(m(this,t))),m(this,s)},n)}}),Hn,Dn,zt,Gi,js,q,z,$e,ws,U,ln,We,on,an,un,Dt,vt,dn,Ke,zl,M=C({"util/lint.ts"(){"use strict";Ze(),Ce(),de(),B(),Hn=new Set(["tr","td","th","caption"]),Dn=new Set(["Template:!!","Template:!-"]),zt=e=>{const t=e.childNodes.find(s=>s.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&Dn.has(t.name)||t.is("html")&&Hn.has(t.name))return!1;if(t.is("arg"))return t.length>1&&zt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(zt);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Gi=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),js=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:o,left:d}=s instanceof le?s:new le(t,l),{offsetHeight:u,offsetWidth:a}=t,{startIndex:h,startLine:c,startCol:g}=e(t,l,o,d),{line:p,character:v}=Gi(c,g,u,a);return{rule:i,message:I.msg(r),severity:n,startIndex:h,endIndex:h+t.toString().length,startLine:c,endLine:p,startCol:g,endCol:v}},q=js((e,t,s,i)=>{const r=e.getRelativeIndex(),{top:n,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+n,startCol:n?l:i+l}}),z=js((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),$e=(e,t,s,i=0)=>({desc:I.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),ws=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),U=(e,t=0,s="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:s}:$e(e,"remove",s,t),ln=(e,t)=>$e(e,"decode",Ht(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),We=(e,t,s=0)=>({desc:I.msg("close"),range:[e+s,e],text:t}),on=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),an=(e,t)=>$e(e,"comment",`<!--${t}-->`),un=(e,t)=>$e(e,"uppercase",t.toUpperCase()),Dt=(e,t=0)=>({desc:I.msg("whitespace"),range:[e,e+t],text:" "}),vt=(e,t,s=1)=>({desc:I.msg("escape"),range:[e,e+s],text:t.repeat(s)}),dn=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"&#124;")}),Ke=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===we.rev))return e[1];const r=t();return(i||I.viewOnly)&&s([we.rev,r]),r},zl=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),Gn,hn,Ul=C({"parser/selector.ts"(){"use strict";Gn=(e,t,s)=>{if(e.includes("#")){const i=e.indexOf("#");return(i===0||e.slice(0,i)===t)&&e.slice(i+1)===s}return!e||e===t},hn=(e,t,s)=>{const i=e.split(",");return(({type:r,name:n})=>i.some(l=>Gn(l.trim(),r,n)))}}}),ys,cn=C({"mixin/cached.ts"(){"use strict";M(),ys=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Ke(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),Hl,Ua=C({"mixin/nodeLike.ts"(){"use strict";Hl=e=>{class t extends e{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return t}}}),Vn,Qn,Xt,St,kt,Kt,At,_t,$t,Je,Dl=C({"lib/node.ts"(){"use strict";M(),Ce(),cn(),Ua(),B(),Qn=[Hl],Vn=[ys(!1)],Je=class{constructor(){J($t,5,this),ja(this,"childNodes",[]),Oe(this,Xt),Oe(this,St),Oe(this,kt),Oe(this,Kt),Oe(this,At),Oe(this,_t,{})}get parentNode(){return he(this,Xt)}get nextSibling(){return he(this,St)}get previousSibling(){return he(this,kt)}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":ye(this,Xt,t),t||(ye(this,St,void 0),ye(this,kt,void 0));break;case"nextSibling":ye(this,St,t);break;case"previousSibling":ye(this,kt,t);break;case"aIndex":I.viewOnly&&ye(this,At,[we.rev,t]);break;default:this[e]=t}}getRootNode(){return Ke(he(this,Kt),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&ye(this,Kt,e)})}indexFromPos(e,t){this.lspError("AstNode.indexFromPos")}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=s.findIndex(([,,r])=>e<=r);return{top:i,left:e-s[i][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return Ke(he(this,_t)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)I.viewOnly&&(he(this,_t)[r]=[we.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{he(this,_t)[e]=t})}getAbsoluteIndex(){return Ke(he(this,At),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ye(this,At,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){{const e=[];let t=0;for(const s of String(this).split(`
2
+ `)){const i=t+s.length;e.push([s,t,i]),t=i+1}return e}}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},$t=Y(null),Xt=new WeakMap,St=new WeakMap,kt=new WeakMap,Kt=new WeakMap,At=new WeakMap,_t=new WeakMap,X($t,1,"getLines",Vn,Je),Je=X($t,0,"AstNode",Qn,Je),J($t,1,Je)}}),Gl,Ha=C({"mixin/elementLike.ts"(){"use strict";Ul(),Gl=e=>{var t,Vi;{class i extends e{constructor(){super(...arguments);N(this,t)}getElementBy(l){for(const o of this.childNodes){if(o.type==="text")continue;if(l(o))return o;const d=o.getElementBy(l);if(d)return d}}querySelector(l){return this.getElementBy(P(this,t,Vi).call(this,l))}getElementsBy(l,o=[]){for(const d of this.childNodes)d.type!=="text"&&(l(d)&&o.push(d),d.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(P(this,t,Vi).call(this,l))}escape(){}}return t=new WeakSet,Vi=function(l){return hn(l,this)},i}}}}),Jn,qs,Xn,Lt,Da=C({"lib/element.ts"(){"use strict";ce(),Ce(),Ul(),Dl(),Ha(),Jn=[Gl],Lt=class extends(Xn=Je){get length(){return this.childNodes.length}text(e){return Ye(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,r;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(r=e[s])==null||r.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:r}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||r===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){this.lspError("AstElement.removeAt")}insertAt(e,t=this.length){return Cn(this,t,0,[e]),e}closest(e){const t=hn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,r=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",r);const l=n.lint(r,t);l.length>0&&s.push(...l),r+=n.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+xt(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){}},qs=Y(Xn),Lt=X(qs,0,"AstElement",Jn,Lt),J(qs,1,Lt)}}),Yt,Ws,Ms,Kn,Yn,Zn,er,zs,tr,Qi,Ga=C({"lib/text.ts"(){"use strict";var e,Vl,s;ce(),M(),B(),Dl(),Yt=String.raw`[${qe}\t]*`,Ws=String.raw`[^\S\n]*`,Ms=String.raw`<${Ws}(?:/${Ws})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Yt}\d)|isbn(?=[-::]?${Yt}(?:\d(?:${Yt}|-)){6})`,Kn=new RegExp(String.raw`${Ms}|https?[:/]/+`,"giu"),Yn=new RegExp(Ms,"giu"),Zn=new Set(["attr-value","ext-link-text","link-text"]),er={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},zs=new Set(["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"]),tr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){return/\w/u}})(),Qi=(s=class extends Je{constructor(r){super();N(this,e);Fe(this,"data","");this.data=r}get type(){return"text"}toString(r){var n;return r&&!((n=this.parentNode)!=null&&n.getAttribute("built"))?ve(this.data):this.data}text(){return this.data}lint(r=this.getAbsoluteIndex(),n){var l,o,d;{if(n===!1)return[];const{data:u,parentNode:a,nextSibling:h,previousSibling:c}=this;if(!a)throw new Error("An isolated text node cannot be linted!");const{type:g,name:p,parentNode:v}=a;if(g==="attr-value"){const{name:O,tag:re}=v;if(re==="ref"&&(O==="name"||O==="follow")||O==="group"&&(re==="ref"||re==="references")||re==="choose"&&(O==="before"||O==="after"))return[]}if(n!=null||(n=g==="free-ext-link"||g==="ext-link-url"||g==="ext-link-text"||g==="image-parameter"&&p==="link"||g==="attr-value"?Yn:Kn),u.search(n)===-1)return[];n.lastIndex=0;const x=[],b=h==null?void 0:h.type,y=h==null?void 0:h.name,S=c==null?void 0:c.type,w=this.getRootNode(),A=w.toString(),{ext:_,html:f,variants:k}=w.getAttribute("config"),{top:$,left:T}=w.posFromIndex(r),{lintConfig:F}=I,j=F.rules["tag-like"],R=typeof j=="object"&&j[1]?new Set(Object.keys(j[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,ne=new Set(["onlyinclude","noinclude","includeonly",..._,...f[0],...f[1],...f[2],...R,...F.getSeverity("tag-like","disallowed")?zs:[]]);for(let O=n.exec(u);O;O=n.exec(u)){const[,re,pe]=O;let{index:V,0:G}=O;if(pe&&pe!=="]"){const{length:ge}=pe;V+=ge,G=G.slice(ge)}G=G.toLowerCase();const[K]=G,H=K==="r"||K==="p"||K==="i",Z=K==="{",D=K==="}",ee=K==="[",oe=K==="]";let{length:ae}=G;if(K==="<"&&!ne.has(re.toLowerCase())||ee&&g==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(u.slice(V+1))||h!=null&&h.is("ext")&&y==="nowiki"&&((l=h.innerText)!=null&&l.includes("]")))||H&&(!a.isPlain()||Zn.has(g)))continue;oe&&(V||ae>1)&&n.lastIndex--;let te=r+V,De=te+ae,ue,me;const Ie=A[De],Ns=A[te-1],Ls=Z||ee,Fs=Z&&Ns==="-"&&k.length>0,Es=D&&Ie==="-"&&k.length>0,In=ee&&b==="free-ext-link"&&!u.slice(V+1).trim()||oe&&S==="free-ext-link"&&!u.slice(0,V).includes("]");if(H)ue="lonely-http",G=G.toUpperCase(),me=F.getSeverity(ue,G);else if(K==="<"){ue="tag-like";let ge;/^<\/?\s/u.test(G)||!/[\s/>]/u.test(Ie!=null?Ie:"")?ge="invalid":R.has(re)?ge=re:zs.has(re)&&!_.includes(re)&&(ge="disallowed"),me=F.getSeverity(ue,ge)}else if(Fs||Es)ue="lonely-bracket",me=F.getSeverity(ue,"converter"),Fs&&V>0?(G="-{",V--,te--,ae=2):Es&&V<u.length-1&&(G="}-",De++,ae=2);else if(In)ue="lonely-bracket",me=F.getSeverity(ue,"extLink");else if(Ls||D||oe)if(ue="lonely-bracket",ae>1||Z&&Ie===K||D&&Ns===K)me=F.getSeverity(ue,"double");else{if(!ee||g!=="ext-link-text"){const ge=er[K],Ps=Ls?u.slice(V+1):u.slice(0,V);if(Z&&((o=ge.exec(Ps))==null?void 0:o[0])==="}"||D&&((d=ge.exec(Ps))==null?void 0:d[0])==="{")continue;if(!Ps.includes(K)){const En=Ls?"nextSibling":"previousSibling";let Ve=this[En];for(;Ve&&(Ve.type!=="text"||!ge.test(Ve.data));)Ve=Ve[En];if(Ve&&ge.exec(Ve.data)[0]!==K)continue}}me=F.getSeverity(ue,"single")}else ue="lonely-http",me=F.getSeverity(ue);if(!me)continue;const Nn=this.posFromIndex(V),{line:Ln,character:Fn}=Gi($,T,Nn.top+1,Nn.left),Ge={rule:ue,message:I.msg("lonely",H||K==="h"||Fs||Es?G:K),severity:me,startIndex:te,endIndex:De,startLine:Ln,endLine:Ln,startCol:Fn,endCol:Fn+ae};if(F.computeEditInfo)if(K==="<")Ge.suggestions=[vt(te,"&lt;")];else if(K==="h"&&g!=="link-text"&&tr.test(Ns||""))Ge.suggestions=[Dt(te)];else if(ee&&g==="ext-link-text"){const ge=a.getAbsoluteIndex()+a.toString().length;Ge.suggestions=[vt(ge,"&#93;")]}else if(oe&&In){const ge=r-c.toString().length;Ge.suggestions=[ws(ge,"left-bracket","[")]}else H&&(Ge.suggestions=[...O[0]===G?[]:[un(Ge,G)],...Ie===":"||Ie===":"?[Dt(De,1)]:[]]);x.push(Ge)}return x}}replaceData(r){P(this,e,Vl).call(this,r)}splitText(r){this.lspError("AstText.splitText")}escape(){}print(){return Ut(this.data)}},e=new WeakSet,Vl=function(r){this.setAttribute("data",r)},s)}}),ze,et=C({"mixin/hidden.ts"(){"use strict";ze=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),Ne,Ee=C({"mixin/noEscape.ts"(){"use strict";Ne=e=>{}}}),Ue,tt=C({"src/syntax.ts"(){"use strict";var e,t;W(),Ue=(t=class extends E{constructor(i,r,n,l,o){super(i,n,l,o);N(this,e);L(this,e,r)}get type(){return m(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Pe,He=C({"mixin/padded.ts"(){"use strict";Pe=({length:e})=>t=>{{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}}),xe,st=C({"src/atom.ts"(){"use strict";var e,t;W(),xe=(t=class extends E{constructor(i,r,n,l,o){super(i,n,l,o);N(this,e);L(this,e,r)}get type(){return m(this,e)}set type(i){L(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),sr,ir,Us,nr,Be,Ss=C({"src/link/base.ts"(){"use strict";var e,t,s,i;M(),Me(),de(),He(),Ee(),B(),W(),st(),sr=r=>r==="redirect-target"||r==="link",ir=[Ne,Pe("[[")],Be=(i=class extends(nr=E){constructor(n,l,o,d=[],u="|"){super(void 0,o,d,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new xe(n,"link-target",o,d,{})),l!==void 0){const a=new E(l,o,d,{});a.type="link-text",a.setAttribute("stage",be-1),this.insertAt(a)}L(this,t,u)}get link(){}get fragment(){}afterBuild(){L(this,s,this.getTitle()),m(this,t).includes("\0")&&L(this,t,this.buildFromStr(m(this,t),0)),this.setAttribute("name",m(this,s).title),super.afterBuild()}setAttribute(n,l){n==="bracket"?L(this,e,l):n==="title"?L(this,s,l):super.setAttribute(n,l)}toString(n){const l=super.toString(n,m(this,t));return m(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return m(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?m(this,s):super.getAttribute(n)}getGaps(n){return n===0?m(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{childNodes:[d,u],type:a}=this,{encoded:h,fragment:c}=m(this,s),{lintConfig:g}=I,{computeEditInfo:p,fix:v}=g,x=new le(this,n);let b="unknown-page",y=g.getSeverity(b);if(y&&d.childNodes.some(({type:S})=>S==="template")&&o.push(q(d,x,b,"template-in-link",y)),b="url-encoding",y=g.getSeverity(b),y&&h){const S=q(d,x,b,"unnecessary-encoding",y);(p||v)&&(S.fix=ln(S,d)),o.push(S)}if(b="pipe-like",y=g.getSeverity(b,"link"),y&&(a==="link"||a==="category")){const S=u==null?void 0:u.childNodes.findIndex(A=>A.type==="text"&&A.data.includes("|")),w=u==null?void 0:u.childNodes[S];if(w){const A=q(u,x,b,"pipe-in-link",y);if(p){const _=A.startIndex+u.getRelativeIndex(S);A.suggestions=[dn(_,w.data)]}o.push(A)}}if(b="no-ignored",y=g.getSeverity(b,"fragment"),y&&c!==void 0&&!sr(a)){const S=q(d,x,b,"useless-fragment",y);if(p||v){const w=d.childNodes.findIndex(_=>_.type==="text"&&_.data.includes("#")),A=d.childNodes[w];A&&(S.fix=U(S,d.getRelativeIndex(w)+A.data.indexOf("#")))}o.push(S)}return o}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(m(this,e)?{pre:"[[",post:"]]",sep:m(this,t)}:{sep:m(this,t)})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),Us=Y(nr),Be=X(Us,0,"LinkBaseToken",ir,Be),J(Us,1,Be)}}),rr,Hs,lr,Te,it=C({"src/nowiki/base.ts"(){"use strict";Ee(),W(),rr=[Ne],Te=class extends(lr=E){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Hs=Y(lr),Te=X(Hs,0,"NowikiBaseToken",rr,Te),J(Hs,1,Te)}}),or,Ds,ar,ke,yt=C({"src/nowiki/noinclude.ts"(){"use strict";et(),it(),or=[ze()],ke=class extends(ar=Te){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Ds=Y(ar),ke=X(Ds,0,"NoincludeToken",or,ke),J(Ds,1,ke)}}),Ql,Va=C({"src/link/redirectTarget.ts"(){"use strict";M(),B(),Ss(),yt(),Ql=class extends Be{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new ke(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:i}=I,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=q(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=U(n)),t.push(n)}return t}}}}}),ur,Gs,dr,Ft,Qa=C({"src/redirect.ts"(){"use strict";var e,t,s;et(),Ee(),W(),tt(),Va(),ur=[ze(!1,!1),Ne],Ft=(s=class extends(dr=E){constructor(r,n,l,o,d,u,a=[]){super(void 0,u,a);N(this,e);N(this,t);L(this,e,r),L(this,t,d),this.append(new Ue(n,"redirect-syntax",u,a),new Ql(l,o==null?void 0:o.slice(1),u,a))}get type(){return"redirect"}getAttribute(r){return r==="padding"?m(this,e).length:super.getAttribute(r)}toString(r){return m(this,e)+super.toString(r)+m(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+m(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:m(this,e),post:m(this,t)})}},e=new WeakMap,t=new WeakMap,s),Gs=Y(dr),Ft=X(Gs,0,"RedirectToken",ur,Ft),J(Gs,1,Ft)}}),Jl={};se(Jl,{parseRedirect:()=>Xl});var Xl,Ja=C({"parser/redirect.ts"(){"use strict";B(),Qa(),Xl=(e,t,s)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&I.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Ft(...i.slice(1),t,s),e):!1}}}),hr,Vs,cr,Et,Xa=C({"src/onlyinclude.ts"(){"use strict";He(),Ee(),W(),hr=[Ne,Pe("<onlyinclude>")],Et=class extends(cr=E){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}},Vs=Y(cr),Et=X(Vs,0,"OnlyincludeToken",hr,Et),J(Vs,1,Et)}}),Vt,ks=C({"mixin/gapped.ts"(){"use strict";Vt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),gr,Qs,pr,Xe,gn=C({"src/tagPair/index.ts"(){"use strict";var e,t;ks(),Ee(),W(),gr=[Vt(),Ne],Xe=(t=class extends(pr=E){constructor(i,r,n,l,o,d=[]){super(void 0,o);N(this,e);Fe(this,"closed");Fe(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),L(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,n);const u=typeof r=="string"?-1:d.indexOf(r);d.splice(u===-1?1/0:u,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[o,d]=m(this,e);return r?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${l.toString(i)}${this.closed?`</${d}>`:""}`}text(){const[i,r]=m(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?m(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=m(this,e);return super.print(this.selfClosing?{pre:`&lt;${i}`,post:"/&gt;"}:{pre:`&lt;${i}`,sep:"&gt;",post:this.closed?`&lt;/${r}&gt;`:""})}},e=new WeakMap,t),Qs=Y(pr),Xe=X(Qs,0,"TagPairToken",gr,Xe),J(Qs,1,Xe)}}),pn,Kl=C({"src/tag/index.ts"(){"use strict";var e,t,s,i;M(),Ce(),B(),W(),pn=(i=class extends E{constructor(n,l,o,d,u){super(void 0,d,u);N(this,e);N(this,t);N(this,s);this.insertAt(l),L(this,e,o),L(this,t,n)}get closing(){return m(this,e)}toString(n){return`<${m(this,e)?"/":""}${m(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${m(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?m(this,t).length+(m(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return Ke(m(this,s),()=>{const{type:n,name:l,parentNode:o,closing:d,selfClosing:u}=this;let a=!1,h=!1;if(n==="html"){const{html:[,b,y]}=this.getAttribute("config");a=y.includes(l),h=b.includes(l)}if(a||h&&u)return this;if(!o)return;const{childNodes:c}=o,g=c.indexOf(this),p=d?c.slice(0,g).reverse():c.slice(g+1),v=[this],{rev:x}=we;for(const b of p)if(!(!b.is(n)||n==="html"&&(b.name!==l||h&&b.selfClosing)))if(m(b,e)===d){if(n==="tvar")return;v.push(b)}else{const y=v.pop();if(y===this)return b;I.viewOnly&&(L(y,s,[x,b]),L(b,s,[x,y]))}if(I.viewOnly)for(const b of v)L(b,s,[x,void 0])},n=>{L(this,s,n),n[1]&&n[1]!==this&&L(n[1],s,[we.rev,this])})}print(){return super.print({pre:`&lt;${m(this,e)?"/":""}${m(this,t)}`,post:`${this.selfClosing?"/":""}&gt;`})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),fr,Js,mr,je,Ka=C({"src/tag/tvar.ts"(){"use strict";et(),Kl(),tt(),fr=[ze()],je=class extends(mr=pn){get type(){return"tvar"}constructor(e,t,s,i,r){const n=new Ue(t,"tvar-name",i,r);super(e,n,s,i,r)}},Js=Y(mr),je=X(Js,0,"TvarToken",fr,je),J(Js,1,je)}}),Yl,Ya=C({"src/tagPair/translate.ts"(){"use strict";var e,Zl,s;W(),gn(),tt(),Ka(),Yl=(s=class extends Xe{constructor(r,n,l,o=[]){const d=new Ue(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(a,h,c)=>(new je("tvar",h,!1,l,o),new je("","",!0,l,o),`\0${o.length-2}n${c}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(a,h,c,g,p,v,x)=>(new je(h,c,!1,l,o),new je(v,x,!0,l,o),`\0${o.length-2}n${p}\0${o.length}n`));const u=new E(n,l,o);u.type="translate-inner";super("translate",d,u,"translate",l,o);N(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext">&lt;translate${P(this,e,Zl).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}&gt;${this.lastChild.print({class:"ext-inner"})}&lt;/translate&gt;</span>`}},e=new WeakSet,Zl=function(){return this.firstChild.toString()===" nowrap"},s)}}),xr,Xs,vr,Pt,Za=C({"src/tagPair/include.ts"(){"use strict";M(),de(),et(),B(),gn(),xr=[ze(!1)],Pt=class extends(vr=Xe){get type(){return"include"}constructor(e,t="",s,i,r,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",r,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:r}=this,n=new le(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=I,{computeEditInfo:d}=o,u=l.map(a=>o.getSeverity(a,"include"));if(u[0]&&s.data.trim()){const a=q(s,n,l[0],"useless-attribute",u[0]);d&&(a.suggestions=[U(a)]),t.push(a)}if(u[1]&&!i){const a=z(this,n,l[1],I.msg("unclosed",`<${r}>`),u[1]);d&&(a.suggestions=[We(a.endIndex,`</${r}>`)]),t.push(a)}return t}}},Xs=Y(vr),Pt=X(Xs,0,"IncludeToken",xr,Pt),J(Xs,1,Pt)}}),As,fn=C({"mixin/attributesParent.ts"(){"use strict";As=(e=0)=>t=>{var s,eo;{class r extends t{constructor(){super(...arguments);N(this,s)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return P(this,s,eo).call(this).getAttr(o)}}return s=new WeakSet,eo=function(){return this.childNodes[e]},r}}}}),ie,Ks,Ys,Tt,Zt,Zs,Qe,ei,ti,si,es,ii,Ae,to,so,io,no,eu=C({"util/sharable.ts"(){"use strict";ie=new Set(["align"]),Ks=new Set(["cite"]),Ys=new Set(["cite","datetime"]),Tt=new Set(["width"]),Zt=new Set(["axis","align","bgcolor","height","width","valign"]),Zs=new Set([...Zt,"abbr","headers","scope","rowspan","colspan"]),Qe=new Set(["type"]),ei=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ti=new Set(["clear"]),si=new Set(["bgcolor","align","valign"]),es=new Set(["qid","forcemathmode","type","display"]),ii=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Ae=new Set,to=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"]),so={div:ie,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,blockquote:Ks,q:Ks,p:ie,br:ti,pre:Tt,ins:Ys,del:Ys,ul:Qe,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ei,"border"]),caption:ie,tr:si,td:Zs,th:Zs,font:new Set(["size","color","face"]),hr:Tt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Qe,poem:ie,categorytree:ie,combooption:ie,math:Ae,chem:Ae,ce:Ae,img:new Set(["alt","src","width","height","loading","srcset"])},io={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:Ae,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Ae,inputbox:Ae,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Ae,poll:new Set(["id","show-results-before-voting"]),sm2:Qe,flashmp3:Qe,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"]),math:new Set([...es,"chem"]),chem:es,ce:es,hiero:Ae,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:ii,syntaxhighlight:ii,templatedata:Ae,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Ae},no={table:ei,td:new Set([...Zt,"scope"]),th:Zt,br:ti,caption:ie,div:ie,hr:Tt,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,li:Qe,p:ie,pre:Tt,tr:si,ul:Qe}}}),br,wr,yr,Sr,as,tu=C({"src/attribute.ts"(){"use strict";var e,t,s,i,r,ro,Ji,o;M(),ce(),Me(),eu(),de(),B(),W(),st(),br=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,wr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,yr=new Set(["ext","arg","magic-word","template"]),Sr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),as=(o=class extends E{constructor(u,a,h,c="",g,p=[],v=I.getConfig(),x=[]){const b=new xe(h,"attr-key",v,x);let y;if(h==="title"||a==="img"&&h==="alt")y=new E(g,v,x,{}),y.type="attr-value",y.setAttribute("stage",be-1);else if(a==="gallery"&&h==="caption"||a==="ref"&&h==="details"||a==="choose"&&(h==="before"||h==="after")){const S=Le(fe({},v),{excludes:[...v.excludes,"heading","html","table","hr","list"]});y=new E(g,S,x,{}),y.type="attr-value",y.setAttribute("stage",1)}else y=new xe(g,"attr-value",v,x,{});super(void 0,v,x);N(this,r);N(this,e);N(this,t);N(this,s);N(this,i);L(this,e,u),this.append(b,y),L(this,s,c),L(this,i,[...p]),L(this,t,a),this.setAttribute("name",mt(ve(h)))}get type(){return m(this,e)}get tag(){return m(this,t)}get balanced(){return!m(this,s)||m(this,i)[0]===m(this,i)[1]}afterBuild(){m(this,s).includes("\0")&&L(this,s,this.buildFromStr(m(this,s),0)),this.parentNode&&L(this,t,this.parentNode.name),P(this,r,ro).call(this),super.afterBuild()}toString(u){const[a="",h=""]=m(this,i);return m(this,s)?super.toString(u,m(this,s)+a)+h:this.firstChild.toString(u)}text(){return m(this,s)?`${super.text(`${m(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var u,a;return m(this,s)?m(this,s).length+((a=(u=m(this,i)[0])==null?void 0:u.length)!=null?a:0):0}lint(u=this.getAbsoluteIndex(),a){var h;{const c=super.lint(u,a),{balanced:g,firstChild:p,lastChild:v,name:x,tag:b}=this,y=new le(this,u),S=["unclosed-quote","obsolete-attr"],{lintConfig:w}=I,A=S.map(f=>w.getSeverity(f,x));if(A[0]&&!g){const f=q(v,y,S[0],"unclosed-quotes",A[0]);f.startIndex--,f.startCol--,w.computeEditInfo&&(f.suggestions=[We(f.endIndex,m(this,i)[0])]),c.push(f)}const _=P(this,r,Ji).call(this,u,y);return _&&c.push(_),A[1]&&((h=no[b])!=null&&h.has(x))&&c.push(q(p,y,S[1],"obsolete-attribute",A[1])),c}}getValue(){return m(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(u){return u==="invalid"?P(this,r,Ji).call(this):super.getAttribute(u)}print(){const[u="",a=""]=m(this,i);return m(this,s)?super.print({sep:Ut(m(this,s))+u,post:a}):super.print()}json(u,a=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,ro=function(){this.setAttribute("name",mt(this.firstChild.text()))},Ji=function(u,a){const{firstChild:h,lastChild:c,type:g,name:p,tag:v,parentNode:x}=this,b=!c.childNodes.some(({type:$})=>yr.has($)),y=this.getValue(),S=io[v],w=so[v],{length:A}=this.toString();let _="illegal-attr",f,k;if({lintConfig:f}=I,{computeEditInfo:k}=f,!(S!=null&&S.has(p))&&!(w!=null&&w.has(p))&&(g==="ext-attr"?S||w:!/\{\{[^{]+\}\}/u.test(p))&&(g==="ext-attr"&&!w||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(v==="meta"||v==="link"||!to.has(p)))||(p==="itemtype"||p==="itemid"||p==="itemref")&&!(x!=null&&x.hasAttr("itemscope"))){if(u===void 0)return!0;{const $=f.getSeverity(_,"unknown");if($){const T=q(h,a,_,"illegal-attribute-name",$);return k&&(T.suggestions=[U(u,A)]),T}}}else if(p==="style"&&typeof y=="string"&&br.test(y)){if(u===void 0)return!0;{_="insecure-style";const $=f.getSeverity(_);return $&&q(c,a,_,"insecure-style",$)}}else if(p==="tabindex"&&typeof y=="string"&&y!=="0"){if(u===void 0)return!0;{const $=f.getSeverity(_,"tabindex");if($){const T=q(c,a,_,"nonzero-tabindex",$);return k&&(T.suggestions=[U(u,A),$e(T,"0 tabindex","0")]),T}}}else if(typeof y=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||Sr.has(p))&&wr.test(y)||b&&(p==="href"||v==="img"&&p==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(y))){if(u===void 0)return!0;{const $=f.getSeverity(_,"value");return $&&q(c,a,_,"illegal-attribute-value",$)}}else if(b&&g!=="ext-attr"){const $=zl(v,p),T=String(y).toLowerCase();if($.length>0&&$.every(F=>F!==T)){if(u===void 0)return!0;{const F=f.getSeverity(_,"value");return F&&q(c,a,_,"illegal-attribute-value",F)}}}return!1},o)}}),ni,kr,Ar,_s,mn=C({"src/attributes.ts"(){"use strict";var e,t,us,i;M(),ce(),de(),B(),W(),st(),tu(),ni=r=>r.slice(0,-1),kr=r=>`${ni(r)}-dirty`,Ar=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(r){return/[^\W_]/u}})(),_s=(i=class extends E{constructor(n,l,o,d,u=[]){super(void 0,d,u,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",o),n){const a=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let h="",c=a.exec(n),g=0;const p=(()=>{h&&(super.insertAt(new xe(h,kr(l),d,u,{})),h="")});for(;c;){const{index:v,0:x,1:b,2:y,3:S,4:w,5:A,6:_}=c;if(h+=n.slice(g,v),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(ve(b).trim())){const f=w!=null?w:_,k=[S,A],$=new as(ni(l),o,b,y,f,k,d,u);p(),super.insertAt($)}else h+=x;({lastIndex:g}=a),c=a.exec(n)}h+=n.slice(g),p()}}get type(){return m(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof as&&(!n||l.name===mt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{parentNode:d,childNodes:u}=this,a=new Map,h=new Set,c=new le(this,n),g=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:v,fix:x}=p,b=["closingTag","invalidAttributes","nonWordAttributes"].map(S=>p.getSeverity(g[0],S));if(b[0]&&P(this,t,us).call(this)){const S=z(this,c,g[0],"attributes-of-closing-tag",b[0]);if(v){const w=d.getAbsoluteIndex();S.suggestions=[U(S),on(w)]}o.push(S)}for(const S of u)if(S instanceof as){const{name:w}=S;a.has(w)?(h.add(w),a.get(w).push(S)):a.set(w,[S])}else{const w=S.text().trim(),A=b[Ar.test(w)?1:2];if(w&&A){const _=q(S,c,g[0],"invalid-attribute",A);v&&(_.suggestions=[U(_,0," ")]),o.push(_)}}const y=p.getSeverity(g[1],"attribute");if(y&&h.size>0)for(const S of h){const w=a.get(S).map(A=>{const _=A.getValue();return[A,_===!0?"":_]});o.push(...w.map(([A,_],f)=>{const k=q(A,c,g[1],I.msg("duplicate-attribute",S),y);if(v||x){const $=U(k);!_||w.slice(0,f).some(([,T])=>T===_)?k.fix=$:v&&(k.suggestions=[$])}return k}))}return o}}getAttribute(n){return n==="invalid"?P(this,t,us).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,us).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof xe?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,us=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),lo={};se(lo,{PreToken:()=>oo});var oo,su=C({"src/pre.ts"(){"use strict";Me(),W(),yt(),oo=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),d=0,u="";for(;l&&o;)new ke(l[0],t,s,!0),new ke(o[0],t,s,!0),u+=`${e.slice(d,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,d=o.index+n+1,i.lastIndex=d,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=u+e.slice(d)}super(e,t,s,{}),this.setAttribute("stage",be-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),$s,xn=C({"src/multiLine/index.ts"(){"use strict";W(),$s=class extends E{get type(){return"ext-inner"}toString(e){return super.toString(e,`
3
3
  `)}text(){return super.text(`
4
4
  `).replace(/\n\s*\n/gu,`
5
5
  `)}getGaps(){return 1}print(){return super.print({sep:`
6
- `})}}}}),lo,tu=C({"src/paramLine.ts"(){"use strict";W(),lo=class extends E{get type(){return"param-line"}}}}),oo={};se(oo,{ParamTagToken:()=>xn});var xn,ao=C({"src/multiLine/paramTag.ts"(){"use strict";M(),de(),Ts(),B(),mn(),tu(),xn=class extends _s{constructor(e,t,s=I.getConfig(),i=[],r){super(void 0,s,i,{}),t&&this.append(...t.split(`
7
- `).map(n=>r?n:Vt(n,s,i,e)).map(n=>new lo(n,s,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=I,i=s.getSeverity(t,this.name);if(!i)return[];const r=new le(this,e),n=I.msg("invalid-parameter",this.name),l=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const d=o.childNodes.filter(({type:u})=>u!=="comment"&&u!=="include"&&u!=="noinclude");if(d.some(({type:u})=>u==="ext"))l.push(q(o,r,t,n,i));else{const u=d.findIndex(({type:h})=>h!=="text"),a=d.slice(0,u===-1?void 0:u).map(String).join("");if(a&&!(u===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(a)){const h=q(o,r,t,n,i);s.computeEditInfo&&(h.suggestions=[z(h)]),l.push(h)}else{const h=o.lint(e,!1);h.length>0&&l.push(...h)}}e+=o.toString().length+1}return l}}}}}),Ar,ni,_r,lt,uo=C({"src/heading.ts"(){"use strict";var e,t,us,i;M(),Ne(),de(),Ee(),B(),W(),tt(),Ar=[Ie],lt=(i=class extends(_r=E){constructor(n,l,o,d=[]){super(void 0,o,d);N(this,t);N(this,e);L(this,e,n);const u=new E(l[0],o,d);u.type="heading-title",u.setAttribute("stage",2);const a=new Ue(l[1],"heading-trail",o,d);this.append(u,a)}get type(){return"heading"}get level(){return m(this,e)}toString(n){const l=P(this,t,us).call(this);return l+this.firstChild.toString(n)+l+this.lastChild.toString(n)}text(){const n=P(this,t,us).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()===2:n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{firstChild:d,level:u}=this,a=d.toString(),h=a.startsWith("="),g=h||a.endsWith("="),c=new le(this,n),p=this.inHtmlAttrs(),b=["h1","unbalanced-header","format-leakage"],{lintConfig:x}=I,{computeEditInfo:v,fix:y}=x,k=b.map(w=>x.getSeverity(w,"apostrophe"));if(k[0]&&this.level===1){const w=q(d,c,b[0],"<h1>",k[0]);v&&!g&&(w.suggestions=[$e(w,"h2",`=${a}=`)]),o.push(w)}if(k[1]&&g){const w=I.msg("unbalanced-in-section-header",'"="'),A=q(d,c,b[1],w,k[1]);if(!(!v||a==="="))if(h){const[_]=/^=+/u.exec(a),f=u+_.length;A.suggestions=[{desc:`h${u}`,range:[A.startIndex,A.startIndex+_.length],text:""}],f<7&&A.suggestions.push({desc:`h${f}`,range:[A.endIndex,A.endIndex],text:_})}else{const _=/[^=](=+)$/u.exec(a)[1],f=u+_.length;A.suggestions=[{desc:`h${u}`,range:[A.endIndex-_.length,A.endIndex],text:""}],f<7&&A.suggestions.push({desc:`h${f}`,range:[A.startIndex,A.startIndex],text:_})}o.push(A)}if(p){const w="parsing-order",A=x.getSeverity(w,p===2?"heading":"templateInTable");A&&o.push(G(this,c,w,"header-in-html",A))}if(k[2]){const w=this.getRootNode().toString(),A=d.childNodes.filter(Cs("quote")),_=A.filter(({bold:S})=>S),f=A.filter(({italic:S})=>S);if(_.length%2){const S=q(_[_.length-1],Le(fe({},c),{start:n+u,left:c.left+u}),b[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),k[2]);if(v||y){const $=n+u+a.length,T=z(S);w.slice(S.endIndex,$).trim()?v&&(S.suggestions=[T,We($,"'''")]):_.length===1&&f.length===0?S.fix=T:v&&(S.suggestions=[T])}o.push(S)}if(f.length%2){const S=q(f[f.length-1],{start:n+u},b[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),k[2]);if(v||y){const $=n+u+a.length;w.slice(S.endIndex,$).trim()?v&&(S.suggestions=[We($,"''")]):f.length===1&&_.length===0?S.fix=z(S):v&&(S.suggestions=[z(S)])}o.push(S)}}return o}}print(){const n=P(this,t,us).call(this);return super.print({pre:n,sep:n})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakSet,us=function(){return"=".repeat(this.level)},i),ni=Y(_r),lt=X(ni,0,"HeadingToken",Ar,lt),J(ni,1,lt)}}),$r,ho,su=C({"src/parameter.ts"(){"use strict";ce(),M(),B(),W(),$r=new RegExp(`https?://${pt}${ft}$`,"iu"),ho=class extends E{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new E(typeof e=="number"?void 0:e,s,i,{}),n=new E(t,s,i);r.type="parameter-key",r.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(r,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r="unescaped",{lintConfig:n}=I,l=n.getSeverity(r);if(l){const{firstChild:o}=this,d=(s=$r.exec(o.text()))==null?void 0:s[0];try{if(d&&new URL(d).search){const u=q(o,{start:e},r,"unescaped-query",l);u.startIndex=u.endIndex,u.startLine=u.endLine,u.startCol=u.endCol,u.endIndex++,u.endCol++,(n.computeEditInfo||n.fix)&&(u.fix=vt(u.startIndex,"{{=}}")),i.push(u)}}catch(u){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){}}}}),Tr,ri,Cr,ot,iu=C({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,ds,co,d;ce(),M(),Ne(),de(),Ss(),Ee(),B(),W(),su(),st(),tt(),Tr=[Ie,Gt()],ot=(d=class extends(Cr=E){constructor(a,h,g,c=[]){var T,F;let p;const b=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(a);b&&(p=Number(b[1]),a=a.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,n);Fe(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,r);const{parserFunction:[x,v],variable:y,functionHook:k}=g,w=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(a))==null?void 0:T[0];if(w)this.setAttribute("modifier",w),a=a.slice(w.length);else if(a.includes(":")){const[j,...R]=a.split(":"),[ne]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((F=R[0])!=null?F:"");this.setModifier(`${j}:${ne}`)&&(a=R.join(":").slice(ne.length))}const A=a.search(/[::]/u),_=a[A]===":",f=A!==-1;if(f||h.length===0&&!m(this,s)){const j=f?a.slice(0,A):a,R=f&&a.slice(A+1),ne=ve(j),O=f?ne.slice(ne.search(/\S/u))+(_?":":""):ne.trim(),re=O.toLowerCase(),pe=Array.isArray(v),V=pe?v.includes(O):Object.prototype.hasOwnProperty.call(v,O),D=!pe&&V?v[O]:Object.prototype.hasOwnProperty.call(x,re)&&x[re],K=pe&&V||!("functionHook"in g)||k.includes(D),U=pe&&V||y.includes(D);if(f?D&&K:U){this.setAttribute("name",D||re.replace(/^#|:$/u,"")),L(this,e,"magic-word"),_&&L(this,t,":");const Z=new Ue(j,"magic-word-name",g,c);if(super.insertAt(Z),R!==!1&&h.unshift([R]),this.name==="invoke")for(let H=0;H<2;H++){const ee=h.shift();if(!ee)break;const oe=new xe(ee.join("="),`invoke-${H?"function":"module"}`,g,c);super.insertAt(oe)}}}if(this.type==="template"){const j=ve(a).trim();if(!this.normalizeTitle(j,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const R=new xe(a,"template-name",g,c,{});super.insertAt(R)}typeof p=="number"&&(c[p]=void 0);const S=this.isTemplate();let $=1;for(let j=0;j<h.length;j++){const R=h[j];S||this.name==="switch"&&j>0||this.name==="tag"&&j>1||(R[0]=R.join("="),R.length=1),R.length===1&&(R.unshift($),$++),this.insertAt(new ho(...R,g,c))}this.seal("modifier")}get type(){return m(this,e)}get module(){}get function(){}setModifier(a){const{parserFunction:[,,h,g]}=this.getAttribute("config"),c=ve(a).trim();if(a&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),b=h.includes(p),x=g.includes(p);return m(this,s)&&b||!m(this,s)&&(x||!a)||(ke.running||this.length>1)&&(b||x||!a)?(this.setAttribute("modifier",a),L(this,s,b),!!a):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(L(this,r,P(this,n,ds).call(this)),this.setAttribute("name",m(this,r).title))}toString(a){const{childNodes:h,length:g,firstChild:c,modifier:p,type:b}=this;return`{{${p}${b==="magic-word"?c.toString(a)+(g===1?"":m(this,t))+h.slice(1).map(x=>x.toString(a)).join("|"):super.toString(a,"|")}}}`}text(){const{childNodes:a,length:h,firstChild:g,modifier:c,type:p,name:b}=this;return p==="magic-word"&&b==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(h===1?"":m(this,t))+Ye(a.slice(1),"|"):super.text("|")}}}`}getAttribute(a){switch(a){case"padding":return this.modifier.length+2;case"title":return m(this,r);case"colon":return m(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,n,ds).call(this).valid);default:return super.getAttribute(a)}}lint(a=this.getAbsoluteIndex(),h){{const g=super.lint(a,h);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:b}=this,x=new le(this,a),{lintConfig:v}=I,{computeEditInfo:y}=v,k=c==="magic-word";let w="no-ignored",A=v.getSeverity(w,"fragment");if(k&&!P(this,n,ds).call(this).valid)w="invalid-invoke",A=v.getSeverity(w,"name"),A&&g.push(q(p[1],x,w,"illegal-module",A));else if(A){const _=p[k?1:0],f=_.childNodes.findIndex($=>$.type==="text"&&fs($.data).includes("#")),S=_.childNodes[f];if(S){const $=q(_,x,w,"useless-fragment",A);y&&($.suggestions=[z($,_.getRelativeIndex(f)+S.data.indexOf("#"))]),g.push($)}}if(w="invalid-invoke",A=v.getSeverity(w,"function"),A&&k&&b===2)return g.push(G(this,x,w,"missing-function",A)),g;if(w="no-duplicate",A=v.getSeverity(w,"parameter"),A){const _=this.getDuplicatedArgs().filter(([,S])=>!S[0].querySelector("ext")),f="duplicate-parameter";for(const[,S]of _)g.push(...S.map($=>{const T=q($,x,w,f,A);return y&&(T.suggestions=[z(T,-1)]),T}))}return g}}insertAt(a,h=this.length){return super.insertAt(a,h),a.anon?P(this,n,co).call(this,a):a.name&&this.getArgs(a.name,!1,!1).add(a),a}getAllArgs(){return this.childNodes.filter(Cs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:a})=>a)}getArgs(a,h,g=!0){const c=String(a).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return m(this,i).has(c)?p=m(this,i).get(c):(p=new Set(this.getAllArgs().filter(({name:b})=>c===b)),m(this,i).set(c,p)),p}getDuplicatedArgs(){return[...m(this,i)].filter(([,{size:a}])=>a>1).map(([a,h])=>[a,[...h]])}getPossibleValues(){const{type:a,name:h,childNodes:g}=this;if(a==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(h){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const b=g.slice(2),x=b[b.length-1];p=[...b.filter(({anon:v})=>!v),...x!=null&&x.anon?[x]:[]].map(({lastChild:v})=>v);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:b})=>b));for(let b=0;b<p.length;){const{length:x,0:v}=p[b].childNodes.filter(y=>y.text().trim());if(x===0)p.splice(b,1);else if(x>1||v.type!=="magic-word")b++;else try{const y=v.getPossibleValues();p.splice(b,1,...y),b+=y.length}catch(y){b++}}return p}print(){const{childNodes:a,length:h,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?zt(c)+g.print()+(h===1?"":m(this,t))+xt(a.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${zt(c)}</span>`:"")+xt(a,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,ds=function(){const a=this.type==="template";return this.normalizeTitle(this.childNodes[a?0:1].text(),a?10:828,{temporary:!0})},co=function(a){const h=this.getAnonArgs(),g=typeof a!="number";for(let c=g?h.indexOf(a):a-1;c<h.length;c++){const p=h[c],{name:b}=p,x=String(c+1);(b!==x||p===a)&&(p.setAttribute("name",x),this.getArgs(x,!1,!1).add(p))}},d),ri=Y(Cr),ot=X(ri,0,"TranscludeToken",Tr,ot),J(ri,1,ot)}}),Ir,li,Nr,Rt,nu=C({"src/hidden.ts"(){"use strict";et(),W(),Ir=[ze()],Rt=class extends(Nr=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},li=Y(Nr),Rt=X(li,0,"HiddenToken",Ir,Rt),J(li,1,Rt)}}),Lr,oi,Fr,Ot,ru=C({"src/arg.ts"(){"use strict";var e,lu,s;ce(),M(),de(),He(),Ss(),Ee(),B(),W(),st(),nu(),Lr=[Ie,Pe("{{{"),Gt()],Ot=(s=class extends(Fr=E){constructor(r,n,l=[]){super(void 0,n,l,{});N(this,e);for(let o=0;o<r.length;o++){const d=r[o];if(o===0){const u=new xe(d,"arg-name",n,l,{});super.insertAt(u)}else if(o>1){const u=new Rt(d,n,l);super.insertAt(u)}else{const u=new E(d,n,l);u.type="arg-default",u.setAttribute("stage",2),super.insertAt(u)}}}get type(){return"arg"}get default(){}toString(r){return`{{{${super.toString(r,"|")}}}}`}text(){return`{{{${Ye(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(r=this.getAbsoluteIndex(),n){{const{childNodes:[l,o,...d]}=this;l.setAttribute("aIndex",r+3);const u=l.lint(r+3,n);if(o){const p=r+4+l.toString().length;o.setAttribute("aIndex",p);const b=o.lint(p,n);b.length>0&&u.push(...b)}const a=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=a.map(p=>h.getSeverity(p,"arg"));if(c[0]&&d.length>0){const p=new le(this,r);u.push(...d.map(b=>{const x=q(b,p,a[0],"invisible-triple-braces",c[0]);return x.startIndex--,x.startCol--,g&&(x.suggestions=[z(x),vt(x.startIndex,"{{!}}")]),x}))}if(c[1]&&!this.getAttribute("include")){const p=G(this,{start:r},a[1],"unexpected-argument",c[1]);g&&o&&(p.suggestions=[$e(p,"expand",o.text())]),u.push(p)}return u}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(r,n=this.getAbsoluteIndex()){}},e=new WeakSet,lu=function(){},s),oi=Y(Fr),Ot=X(oi,0,"ArgToken",Lr,Ot),J(oi,1,Ot)}}),go={};se(go,{parseBraces:()=>$s});var Er,ai,es,ui,di,hi,Pr,ci,$s,vn=C({"parser/braces.ts"(){"use strict";Ze(),ce(),uo(),iu(),ru(),Er={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ai=String.raw`\[(?!\[)`,es=String.raw`\n(?![=\0])`,ui=String.raw`|\{{2,}`,di=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),hi=gt(e=>new RegExp(e,"gmu")),Pr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ai}|${es})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${es})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ai}|${es})*\}-`,"gu"),ci=e=>{const t=mt(ve(e));return di.has(t)?di.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},$s=(e,t,s)=>{var p,b,x,v,y;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,n=[],l=[],o=(k,w,A,_)=>{w[w.length-1].push(ye(k.slice(A,_),l))};let d;do d!==void 0&&(e=d),d=e.replace(Pr,(k,w,A)=>{if(w!==void 0||typeof A=="string")try{const{length:_}=s,f=(w!=null?w:A).split("|");return new ot(ye(f[0],l),f.slice(1).map(S=>{const $=S.indexOf("=");return($===-1?[S]:[S.slice(0,$),S.slice($+1)]).map(T=>ye(T,l))}),t,s),`\0${_}${ci(f[0])}`}catch(_){if(!(_ instanceof SyntaxError)||_.message!=="Invalid template name")throw _}return l.push(ye(k,l)),`\0${l.length-1}`});while(d!==e);e=d;const u=e.lastIndexOf("}}")-e.length;let a=u+e.length!==-1,h=hi(i+(a?ui:"")),g=h.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((b=(p=n[n.length-1])==null?void 0:p[0])!=null&&b.startsWith("="));){if(g!=null&&g[1]){const[,{length:R}]=g;g[0]=g[0].slice(R),g.index+=R}const{0:k,index:w}=g!=null?g:{0:`
8
- `,index:e.length},A=(x=n.pop())!=null?x:{},{0:_,index:f,parts:S,findEqual:$,pos:T}=A,F=k==="="&&$;if(k==="]]"||k==="}-")c=w+2;else if(k===`
9
- `){c=w+1;const{pos:R,findEqual:ne}=(v=n[n.length-1])!=null?v:{};if(R===void 0||ne||ve(e.slice(R,f))!==""){const O=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(f,w));O&&(O[2]=ye(O[2],l),O[2].includes(`
10
- `)||(e=`${e.slice(0,f)}\0${s.length}h${e.slice(w)}`,c=f+4+String(s.length).length,new lt(O[1].length,O.slice(2),t,s)))}}else if(k==="|"||F)c=w+1,o(e,S,T,w),k==="|"&&S.push([]),A.pos=c,A.findEqual=k==="|",n.push(A);else if(k.startsWith("}}")){const R=k.slice(0,Math.min(_.length,3)),ne=_.length-R.length,{length:O}=s;c=w+R.length,o(e,S,T,w);let re=!1,pe="t";if(R.length===3){const V=S.map(K=>K.join("=")),D=V.length>1&&ve(V[1]).trim();new Ot(V,t,s),D&&D.endsWith(":")&&r.includes(D.slice(0,-1).toLowerCase())&&(pe="s")}else try{new ot(S[0][0],S.slice(1),t,s),pe=ci(S[0][0])}catch(V){if(V instanceof SyntaxError&&V.message==="Invalid template name")re=!0;else throw V}re||(e=`${e.slice(0,f+ne)}\0${O}${pe}${e.slice(c)}`,c=f+ne+3+String(O).length,ne>1?n.push({0:_.slice(0,ne),index:f,pos:f+ne,parts:[[]]}):ne===1&&e[f-1]==="-"&&n.push({0:"-{",index:f-1,pos:f+1,parts:[[]]}))}else c=w+k.length,k.startsWith("{")&&(g.pos=c,g.parts=[[]]),n.push(..."0"in A?[A]:[],g);let j=n[n.length-1];if(a&&u+e.length<c)for(a=!1;(y=j==null?void 0:j[0])!=null&&y.startsWith("{");)n.pop(),j=n[n.length-1];h=hi(i+(a?ui:"")+(j?`|${Er[j[0][0]]}${j.findEqual?"|=":""}`:"")),h.lastIndex=c,g=h.exec(e)}return ye(e,l)}}}),po={};se(po,{InputboxToken:()=>fo});var fo,ou=C({"src/multiLine/inputbox.ts"(){"use strict";Ts(),vn(),B(),ao(),fo=class extends xn{constructor(e,t,s=I.getConfig(),i=[]){const r=Symbol("InputboxToken"),n=s.excludes.includes("heading")?s:Le(fe({},s),{excludes:[...s.excludes,"heading"]}),{length:l}=i;i.push(r),t&&(t=Vt(t,n,i,e)),t&&(t=$s(t,n,i)),i.splice(l,1),super(e,t,n,i,{})}}}}),hs={};se(hs,{NestedToken:()=>mo});var Rr,Or,mo,gi=C({"src/nested.ts"(){"use strict";var e,t,s;M(),de(),Ts(),vn(),B(),W(),Oo(),yt(),Rr=new Set(["comment","include","arg","template","magic-word"]),Or=[!1,!0].map(i=>{const r=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),mo=(s=class extends E{constructor(r,n,l,o,d=[]){if(typeof n=="boolean"){const u=Symbol("NestedToken"),{length:a}=d;d.push(u),r&&(r=Vt(r,o,d,n)),r&&(r=$s(r,o,d)),d.splice(a,1)}else r&&(r=r.replace(n,(u,a,h,g,c)=>{const p=`\0${d.length+1}e`;return new ht(a,h,g,c,o,!1,d),p}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(u,a,h)=>(new Se(h,o,d),`${a}\0${d.length}n`)));super(r,o,d);N(this,e);N(this,t);L(this,e,[...l]),L(this,t,n)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="no-ignored",{lintConfig:d}=I,u=d.getSeverity(o,this.name);if(!u)return l;const a=new le(this,r),h=typeof m(this,t)=="boolean"?Or[m(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(g=>{const{type:c,name:p}=g;if(c==="ext")return!m(this,e).includes(p);if(Rr.has(c))return!1;const b=g.toString().trim();return b&&!h.test(b)}).map(g=>{const c=q(g,a,o,I.msg("invalid-content",this.name),u);return d.computeEditInfo&&(c.suggestions=[z(c),on(c,g.toString())]),c})]}}},e=new WeakMap,t=new WeakMap,s)}});function Br(e,t,s,i,r){t=ve(t).trim();let n=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!n&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{if(n){if(xo(s.protocol).test(n))return vo(s.protocol).test(n)&&t;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const l=I.normalizeTitle(n,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0});return l.valid&&l}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 xo,vo,jr,qr,bo,au=C({"src/imageParameter.ts"(){"use strict";var e,t,wo,r;Ze(),ce(),M(),Me(),B(),W(),xo=gt(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),vo=gt(n=>new RegExp(String.raw`^(?:(?:${n}|//)${pt}|\0\d+m\x7F)${ft}$`,"iu")),jr=gt(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
11
- )`:""}(\s*)$`,"u")),qr=new Set(["alt","link","lang","page","caption"]),bo=(r=class extends E{constructor(l,o,d,u){var n=(...i)=>(super(...i),N(this,t),N(this,e,""),this);let a;const h=Object.entries(d.img).map(([c,p])=>[c,p,jr(c)]),g=h.find(([,c,p])=>(a=p.exec(l),a&&(a.length!==4||Br(c,a[2],d,!0,o)!==!1)));if(g&&a){a.length===3?(n(void 0,d,u),L(this,e,l)):(n(a[2],d,u,{}),L(this,e,a[1]+g[0]+a[3])),this.setAttribute("name",g[1]),g[1]==="alt"&&this.setAttribute("stage",be-1);return}n(l,d.excludes.includes("list")?d:Le(fe({},d),{excludes:[...d.excludes,"list"]}),u),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Br("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!qr.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return m(this,e)?m(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return m(this,e)?m(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,m(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){{const d=super.lint(l,o),{lintConfig:u}=I,{computeEditInfo:a,fix:h}=u,{link:g,name:c}=this,p=c==="width"&&this.getValue();if(c==="invalid"||p&&p.endsWith("px")){const b="invalid-gallery",x=u.getSeverity(b,"parameter");if(x){const v=G(this,{start:l},b,"invalid-image-parameter",x);(a||h)&&(v.fix=p?z(v,0,p):z(v,-1)),d.push(v)}}else if(typeof g=="object"&&g.encoded){const b="url-encoding",x=u.getSeverity(b,"file");if(x){const v=G(this,{start:l},b,"unnecessary-encoding",x);(a||h)&&(v.fix=rn(v,this)),d.push(v)}}return d}}getValue(){return this.name==="invalid"?this.text():P(this,t,wo).call(this)||super.text()}print(){return m(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${m(this,e).replace("$1",`<span class="wpb-image-caption">${xt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,wo=function(){return m(this,e)&&!m(this,e).includes("$1")},r)}}),pi,Wr,Mr,fi,mi,xi,zr,vi,bn,yo=C({"src/link/file.ts"(){"use strict";M(),de(),B(),ys(),au(),pi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Wr=new Set(["arg"]),Mr=new Set(["template","magic-word"]),fi=new Set(["left","right","center","none"]),mi=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),xi=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),zr=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),r=0,n=0;for(;i;){const{0:l,index:o}=i;l!=="|"?r+=l==="-{"?1:-1:r===0&&(s.push(e.slice(n,o)),{lastIndex:n}=t),i=t.exec(e)}return s.push(e.slice(n)),s},vi=(e,t)=>e.filter(({childNodes:s})=>{const i=s.filter(r=>r.text().trim());return i.length!==1||!t.has(i[0].type)}),bn=class extends Be{get type(){return"file"}get extension(){}constructor(e,t,s,i=[],r="|"){super(e,void 0,s,i,r);const{extension:n}=this.getTitle(!0,!0);this.safeAppend(zr(t).map(l=>new bo(l,n,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r=vi(this.getAllArgs(),Wr),n=[...new Set(r.map(({name:_})=>_))],l=n.filter(_=>pi.has(_)),o=n.filter(_=>fi.has(_)),d=n.filter(_=>mi.has(_)),[u]=l,a=u==="framed"||u==="manualthumb",h=new le(this,e),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,{ns:b,extension:x}=this.getAttribute("title"),{firstChild:v}=this;let y="nested-link",k=g.getSeverity(y,"file");if(k&&xi.has(x)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const _=G(this,h,y,"link-in-extlink",k);if(c||p){const f=this.getArg("link");if(f){const S=e+f.getRelativeIndex();_.fix={desc:I.msg("delink"),range:[S,S+f.toString().length],text:"link="}}else _.fix=bs(_.endIndex-2,"delink","|link=")}i.push(_)}if(y="invalid-gallery",k=g.getSeverity(y,"extension"),k&&b===6&&!x&&!v.querySelector("arg,magic-word,template")&&i.push(G(this,h,y,"missing-extension",k)),k=g.getSeverity(y,"parameter"),k&&a)for(const _ of r.filter(({name:f})=>f==="width")){const f=q(_,h,y,"invalid-image-parameter",k);(c||p)&&(f.fix=z(f,-1)),i.push(f)}if(r.length===n.length&&l.length<2&&o.length<2&&d.length<2)return i;y="no-duplicate";const w=["unknownImageParameter","imageParameter"].map(_=>g.getSeverity(y,_)),A=(_,f,S,$=!0)=>_.map(T=>{if(k=w[Number(typeof $=="function"?$(T):$)],!k)return!1;const F=q(T,h,y,I.msg(`${f}-image-parameter`,S),k);return c&&(F.suggestions=[z(F,-1)]),F}).filter(T=>T!==!1);for(const _ of n){if(_==="invalid"||_==="width"&&a)continue;const f=_==="caption";let S=r.filter(({name:$})=>$===_);if(f&&(S=[...S.slice(0,-1).filter($=>$.text()),...S.slice(-1)]),S.length>1){let $=!f||!x||xi.has(x);if(f&&$){const T=vi(S,Mr);$=T.length>1&&(F=>T.includes(F))}i.push(...A(S,"duplicate",_,$))}}return l.length>1&&i.push(...A(r.filter(({name:_})=>pi.has(_)),"conflicting","frame")),o.length>1&&i.push(...A(r.filter(({name:_})=>fi.has(_)),"conflicting","horizontal-alignment")),d.length>1&&i.push(...A(r.filter(({name:_})=>mi.has(_)),"conflicting","vertical-alignment")),i}}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){{const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){}}}}),Ur,bi,Hr,at,So=C({"src/link/galleryImage.ts"(){"use strict";var e,Ji,s;M(),Me(),He(),B(),W(),yo(),Ur=[Pe("")],at=(s=class extends(Hr=bn){constructor(r,n,l,o,d=[]){let u;if(l!==void 0){const{length:a}=d;u=new E(l,o,d);for(let h=0;h<be-1;h++)u.parseOnce();d.splice(a,1)}super(n,u==null?void 0:u.toString(),o,d);N(this,e);Fe(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${r}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(r){const n=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),n?0:6,{halfParsed:!0,temporary:r,decode:!n})}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="invalid-gallery",{lintConfig:d}=I,u=d.getSeverity(o,"image");if(u&&P(this,e,Ji).call(this)){const a=G(this,{start:r},o,"invalid-gallery",u);d.computeEditInfo&&(a.suggestions=[bs(r,"prefix","File:")]),l.push(a)}return l}}getAttribute(r){return r==="invalid"?P(this,e,Ji).call(this):super.getAttribute(r)}},e=new WeakSet,Ji=function(){const{ns:r}=this.getAttribute("title");return r!==6},s),bi=Y(Hr),at=X(bi,0,"GalleryImageToken",Ur,at),J(bi,1,at)}}),ms,ko=C({"src/nowiki/commentLine.ts"(){"use strict";yt(),ms=class extends Se{}}}),Ao={};se(Ao,{GalleryToken:()=>_o});var _o,uu=C({"src/multiLine/gallery.ts"(){"use strict";var e,$o,du,i;M(),B(),mn(),So(),ko(),_o=(i=class extends _s{constructor(n,l,o=[]){var d;super(void 0,l,o,{});N(this,e);for(const u of(d=n==null?void 0:n.split(`
12
- `))!=null?d:[]){const a=/^([^|]+)(?:\|(.*))?/u.exec(u);if(!a){super.insertAt(u.trim()?new ms(u,l,o):u);continue}const[,h,g]=a;P(this,e,$o).call(this,h)?super.insertAt(new at("gallery",h,g,l,o)):super.insertAt(new ms(u,l,o))}}get widths(){}get heights(){}lint(n=this.getAbsoluteIndex(),l){{const{top:o,left:d}=this.getRootNode().posFromIndex(n),u=[],a="no-ignored",{lintConfig:h}=I,g=["Image","NoImage","Comment"].map(c=>h.getSeverity(a,`gallery${c}`));for(let c=0;c<this.length;c++){const p=this.childNodes[c],b=p.toString(),{length:x}=b,v=b.trim(),{type:y}=p,k=o+c,w=c?0:d;if(p.setAttribute("aIndex",n),y==="noinclude"&&v&&!/^<!--.*-->$/u.test(v)){let[A]=g;if(v.startsWith("|")?[,A]=g:(v.startsWith("<!--")||v.endsWith("-->"))&&([,,A]=g),A){const _=n+x,f={rule:a,message:I.msg("invalid-content","gallery"),severity:A,startIndex:n,endIndex:_,startLine:k,endLine:k,startCol:w,endCol:w+x};h.computeEditInfo&&(f.suggestions=[z(f),on(f,b)]),u.push(f)}}else if(y!=="noinclude"&&y!=="text"){const A=p.lint(n,l);A.length>0&&u.push(...A)}n+=x+1}return u}}json(n,l=this.getAbsoluteIndex()){}},e=new WeakSet,$o=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},du=function(n){},i)}}),wn,To=C({"src/link/index.ts"(){"use strict";Ze(),M(),B(),ys(),wn=class extends Be{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():Ut(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",{lintConfig:r}=I,n=r.getSeverity(i);if(n&&this.closest("ext-link-text")){const l=G(this,{start:e},i,"link-in-extlink",n);(r.computeEditInfo||r.fix)&&(l.fix=$e(l,"delink",this.innerText)),s.push(l)}return s}}}}}),Dr,Gr,Dt,yn=C({"src/magicLink.ts"(){"use strict";var e,t,Xi,i;M(),ce(),de(),B(),W(),Dr=String.raw`(?:[${qe}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,Gr=new RegExp(`${Dr}+`,"gu"),Dt=(i=class extends E{constructor(n,l="free-ext-link",o=I.getConfig(),d){super(n,o,d,{});N(this,t);N(this,e);L(this,e,l)}get type(){return m(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let l=Ye(this.childNodes.map(o=>{const{type:d}=o,u=String(o.name);return d==="magic-word"&&n.has(u)?n.get(u):o}));return this.type==="magic-link"&&(l=l.replace(Gr," ")),l}get link(){const{innerText:n}=this;return this.type==="magic-link"?n.startsWith("ISBN")?`ISBN ${n.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:n:Bl(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),d=new le(this,n),{lintConfig:u}=I,{type:a,childNodes:h}=this;if(a==="magic-link"){const b="invalid-isbn",x=u.getSeverity(b);return x&&P(this,t,Xi).call(this)&&o.push(G(this,d,b,"invalid-isbn",x)),o}const g=a==="ext-link-url",c="unterminated-url",p=u.getSeverity(c,g?"pipe":"punctuation");if(p){const b=g?/\|/u:/[,;。:!?()]+/u,x=h.find(v=>v.type==="text"&&b.test(v.data));if(x){const{data:v}=x,y=q(x,d,c,I.msg("in-url",g?'"|"':"full-width-punctuation"),p);if(u.computeEditInfo){const{index:k,0:w}=b.exec(v),A=y.startIndex+k;y.suggestions=g?[Ht(A,1)]:[Ht(A),{desc:I.msg("encode"),range:[A,A+w.length],text:encodeURI(w)}]}o.push(y)}}return o}}getUrl(n){this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?P(this,t,Xi).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,Xi=function(){if(this.type==="magic-link"){const{link:n}=this;if(n.startsWith("ISBN")){const l=[...n.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,d,u)=>o+d*(10-u),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,d,u)=>o+d*(u%2?3:1),0)%10!==0)}}return!1},i)}}),Vr,wi,Qr,ut,Co=C({"src/extLink.ts"(){"use strict";var e,t;Me(),M(),He(),B(),W(),yn(),Vr=[Pe("[")],ut=(t=class extends(Qr=E){constructor(i,r="",n="",l,o=[]){super(void 0,l,o,{});N(this,e);const d=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new Dt(i,"ext-link-url",l,o);if(this.insertAt(d),L(this,e,r),n){const u=new E(n,l,o,{});u.type="ext-link-text",u.setAttribute("stage",be-1),this.insertAt(u)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${m(this,e)}]`:`[${super.toString(i,m(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return m(this,e).length}lint(i=this.getAbsoluteIndex(),r){{const n=super.lint(i,r),l="var-anchor",o=I.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.closest("heading-title")&&n.push(G(this,{start:i},l,"variable-anchor",o)),n}}print(){return super.print(this.length===1?{pre:"[",post:`${m(this,e)}]`}:{pre:"[",sep:m(this,e),post:"]"})}},e=new WeakMap,t),wi=Y(Qr),ut=X(wi,0,"ExtLinkToken",Vr,ut),J(wi,1,ut)}}),Ki,hu=C({"src/imagemapLink.ts"(){"use strict";W(),yt(),To(),Co(),Ki=class extends E{get type(){return"imagemap-link"}constructor(e,t,s,i,r=[]){super(void 0,i,r),this.append(e,t.length===2?new wn(...t,i,r):new ut(...t,i,r),new Se(s,i,r))}}}}),Io={};se(Io,{ImagemapToken:()=>No});var No,cu=C({"src/multiLine/imagemap.ts"(){"use strict";M(),Ne(),de(),B(),mn(),ko(),So(),hu(),No=class extends _s{get image(){return this.childNodes.find(Cs("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
13
- `),r=new Set(t.protocol.split("|"));let n=!0,l=!1;for(const o of i){const d=o.trim();if(!(l||!d||d.startsWith("#"))){if(n){const u=o.indexOf("|"),a=u===-1?o:o.slice(0,u),{valid:h,ns:g}=this.normalizeTitle(a,0,{halfParsed:!0,temporary:!0});if(h&&g===6){const c=new at("imagemap",a,u===-1?void 0:o.slice(u+1),t,s);super.insertAt(c),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const u=o.indexOf("["),a=o.slice(u),h=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(a);if(h){if(this.normalizeTitle(h[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Ki(o.slice(0,u),h.slice(1),a.slice(a.indexOf("]]")+2),t,s));continue}}else if(a.startsWith("[//")||r.has(a.slice(1,a.indexOf(":")+1))||r.has(a.slice(1,a.indexOf("//")+2))){const g=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(a);if(g){super.insertAt(new Ki(o.slice(0,u),g.slice(1),a.slice(a.indexOf("]")+1),t,s));continue}}}}super.insertAt(new ms(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=I,d=o.getSeverity(l,n?"link":"image");return d&&(n?s.push(...r.filter(u=>{const a=u.toString().trim();return u.is("noinclude")&&a&&!a.startsWith("#")}).map(u=>{const a=q(u,i,l,"invalid-imagemap-link",d);return o.computeEditInfo&&(a.suggestions=[z(a,-1),$e(a,"comment","# ")]),a})):s.push(G(this,i,l,"imagemap-without-image",d))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Jr,yi,Xr,dt,Lo=C({"src/nowiki/comment.ts"(){"use strict";M(),et(),He(),B(),it(),Jr=[ze(!1),Pe("<!--")],dt=class extends(Xr=Te){constructor(t,s,i,r){super(t,i,r);Fe(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=I,r=i.getSeverity(s);if(!r)return[];const n=G(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[We(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}},yi=Y(Xr),dt=X(yi,0,"CommentToken",Jr,dt),J(yi,1,dt)}}),Fo={};se(Fo,{CommentedToken:()=>Eo});var Eo,gu=C({"src/commented.ts"(){"use strict";W(),Lo(),Eo=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),r=i!==-1&&e.indexOf("-->",i+4),n=0;for(;r!==!1&&r!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new dt(e.slice(i+4,r),!0,t,s)),n=r+3,i=e.indexOf("<!--",n),r=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Po={};se(Po,{NowikiToken:()=>Ro});var Kr,Yr,Ro,pu=C({"src/nowiki/index.ts"(){"use strict";var e,Yi,s;Ze(),M(),B(),it(),Kr=gt(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),Yr=new Set(["languages","section","templatestyles"]),Ro=(s=class extends Te{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,l="void-ext",{lintConfig:o}=I,d=o.getSeverity(l,n);if(d&&P(this,e,Yi).call(this)){const u=G(this,{start:r},l,I.msg("nothing-in",n),d);return o.computeEditInfo&&(u.suggestions=[z(u)]),[u]}return super.lint(r,Kr(n))}}getAttribute(r){return r==="invalid"?P(this,e,Yi).call(this):super.getAttribute(r)}},e=new WeakSet,Yi=function(){const{name:r,firstChild:{data:n}}=this;return Yr.has(r)&&!!n},s)}}),Zr,Si,el,ht,Oo=C({"src/tagPair/ext.ts"(){"use strict";M(),de(),B(),pn(),W(),cn(),fn(),Zr=[ks()],ht=class extends(el=Xe){get type(){return"ext"}constructor(e,t,s,i,r=I.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),d=new As(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),u=Le(fe({},r),{ext:r.ext.filter(h=>h!==o),excludes:[...r.excludes],inExt:!0});let a;switch(o){case"tab":u.ext=u.ext.filter(h=>h!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&u.excludes.push("heading"),a=new E(s,u,l);break;case"pre":{const{PreToken:h}=(eu(),Q(no));a=new h(s,u,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(ao(),Q(oo));a=new h(n,s,u,l);break}case"inputbox":{const{InputboxToken:h}=(ou(),Q(po));a=new h(n,s,u,l);break}case"references":{const{NestedToken:h}=(gi(),Q(hs));u.excludes.push("heading"),a=new h(s,n,["ref"],u,l);break}case"choose":{const{NestedToken:h}=(gi(),Q(hs));a=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,l);break}case"combobox":{const{NestedToken:h}=(gi(),Q(hs));a=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,l);break}case"gallery":{const{GalleryToken:h}=(uu(),Q(Ao));a=new h(s,u,l);break}case"imagemap":{const{ImagemapToken:h}=(cu(),Q(Io));a=new h(s,u,l);break}case"hiero":{const{CommentedToken:h}=(gu(),Q(Fo));a=new h(s,u,l);break}default:{const{NowikiToken:h}=(pu(),Q(Po));a=new h(s,u,l)}}a.setAttribute("name",o),a.type==="plain"&&(a.type="ext-inner"),super(e,d,a,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,r=new le(this,e);if(this.name!=="nowiki"){const o=this.inHtmlAttrs(),d="parsing-order",u=o&&i.getSeverity(d,o===2?"ext":"templateInTable");u&&s.push(G(this,r,d,"ext-in-html",u))}const n="var-anchor",l=i.getSeverity(n,"ref");return l&&this.name==="ref"&&this.closest("heading-title")&&s.push(G(this,r,n,"variable-anchor",l)),s}}},Si=Y(el),ht=X(Si,0,"ExtToken",Zr,ht),J(Si,1,ht)}}),Bo={};se(Bo,{parseCommentAndExt:()=>Vt});var ki,tl,ts,sl,Ai,Vt,Ts=C({"parser/commentAndExt.ts"(){"use strict";Ze(),ce(),Qa(),yt(),Xa(),Ka(),Oo(),Lo(),ki="<onlyinclude>",tl="</onlyinclude>",{length:ts}=ki,sl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return ql(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Ai=e=>{const t=e.indexOf(ki);return{i:t,j:e.indexOf(tl,t+ts)}},Vt=(e,t,s,i)=>{if(i){let{i:o,j:d}=Ai(e);if(o!==-1&&d!==-1){let u="";const a=h=>{new Se(h,t,s),u+=`\0${s.length-1}n`};for(;o!==-1&&d!==-1;){const h=`\0${s.length}e`;new Et(e.slice(o+ts,d),t,s),o>0&&a(e.slice(0,o)),u+=h,e=e.slice(d+ts+1),{i:o,j:d}=Ai(e)}return e&&a(e),u}}const{ext:r}=t,n=r.filter(o=>o!=="translate"&&o!=="tvar"),l=Le(fe({},t),{ext:n});if(r.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,d=>(o.push(d),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(d,u,a)=>{const h=s.length;return new Xl(u,a&&ye(a,o),l,s),`\0${h}g`}),e=ye(e,o)}return e.replace(sl[i?1:0](n),(o,d,u,a,h,g,c,p,b)=>{const x=s.length;let v="n";if(d)v="e",new ht(d,u,a,h,l,g,s);else if(o.startsWith("<!--")){v="c";const y=o.endsWith("-->");new dt(ye(o,s,1).slice(4,y?-3:void 0),y,t,s)}else g?new Pt(g,c&&ye(c,s,1),p&&ye(p,s,1),b,t,s):new Se(o,t,s,!0);return`\0${x}${v}`})}}}),il,nl,rl,ll,_i,ol,Bt,fu=C({"src/tag/html.ts"(){"use strict";var e,t;M(),de(),pn(),B(),Jl(),il=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),nl=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"]),rl=new Set(["strike","big","center","font","tt"]),ll=[ks()],Bt=(t=class extends(ol=gn){constructor(i,r,n,l,o,d){super(i,r,n,o,d);N(this,e);this.setAttribute("name",i.toLowerCase()),L(this,e,l)}get type(){return"html"}get selfClosing(){return m(this,e)}text(){const{closing:i,selfClosing:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){var n;{const l=super.lint(i,r),{name:o,parentNode:d,closing:u,selfClosing:a}=this,h=new le(this,i),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,b=this.inTableAttrs();let x="h1",v=g.getSeverity(x,"html");if(v&&o==="h1"&&!u){const f=G(this,h,x,"<h1>",v);c&&(f.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),l.push(f)}if(x="parsing-order",v=b&&g.getSeverity(x,b===2?"html":"templateInTable"),v){const f=G(this,h,x,"html-in-table",v);c&&b===2&&(f.suggestions=[z(f)]),l.push(f)}if(x="obsolete-tag",v=g.getSeverity(x,o),v&&rl.has(o)&&l.push(G(this,h,x,"obsolete-tag",v)),x="bold-header",v=g.getSeverity(x,o),v&&(o==="b"||o==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const f=G(this,h,x,"bold-in-header",v);c&&(f.suggestions=[z(f)]),l.push(f)}const{html:[,y,k]}=this.getAttribute("config"),w=k.includes(o),A=y.includes(o),_=!w&&!A;if(x="unmatched-tag",u&&(a||w)||a&&_){if(v=g.getSeverity(x,u?"both":"selfClosing"),v){const f=G(this,h,x,u?"closing-and-self-closing":"invalid-self-closing",v);if(c||p){const S=ln(i),$={desc:I.msg("no-self-closing"),range:[f.endIndex-2,f.endIndex-1],text:""};A?c&&(f.suggestions=[S,$]):u?f.fix=w?S:$:c&&(f.suggestions=[$,We(f.endIndex,`></${o}>`,-2)])}l.push(f)}}else if(!this.findMatchingTag()){const f=G(this,h,x,u?"unmatched-closing":"unclosed-tag"),S=this.closest("magic-word");if(S&&il.has(S.name))v=g.getSeverity(x,"conditional");else if(u)v=g.getSeverity(x,"closing"),f.suggestions=[z(f)];else{v=g.getSeverity(x,"opening");const $=d==null?void 0:d.childNodes;nl.has(o)&&($!=null&&$.slice(0,$.indexOf(this)).some(T=>T.type==="html"&&T.name===o&&!T.findMatchingTag())&&(f.suggestions=[We(i+1,"/")]),this.closest("heading-title")&&(f.rule="format-leakage",v=g.getSeverity("format-leakage",o)))}v&&(f.severity=v,l.push(f))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){}},e=new WeakMap,t),_i=Y(ol),Bt=X(_i,0,"HtmlToken",ll,Bt),J(_i,1,Bt)}}),jo={};se(jo,{parseHtml:()=>qo});var al,qo,mu=C({"parser/html.ts"(){"use strict";fn(),fu(),al=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,qo=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const o of r){const d=al.exec(o),u=d==null?void 0:d[2],a=u==null?void 0:u.toLowerCase();if(!d||!t.htmlElements.has(a)){n+=`<${o}`;continue}const[,h,,g="",c,p]=d,{length:b}=s,x=new As(g,"html-attrs",a,t,s),v=x.hasAttr("itemprop");if(a==="meta"&&!(v&&x.hasAttr("content"))||a==="link"&&!(v&&x.hasAttr("href"))){n+=`<${o}`,s.length=b;continue}n+=`\0${s.length}x${p}`,new Bt(u,x,h==="/",c==="/>",t,s)}return n}}}),ul,$i,dl,ct,Wo=C({"src/table/base.ts"(){"use strict";pn(),W(),tt(),fn(),ul=[ks(1)],ct=class extends(dl=E){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new Ue(t,"table-syntax",r,n),new As(i,"table-attrs",s,r,n))}escape(){}},$i=Y(dl),ct=X($i,0,"TableBaseToken",ul,ct),J($i,1,ct)}}),hl,Ti,_e,ss,Ct,It,xs,Mo=C({"src/table/td.ts"(){"use strict";M(),de(),hn(),B(),W(),Wo(),xs=class extends(Ti=ct,hl=[ws(!1)],Ti){constructor(e,t,s,i=[]){var o;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(n)&&(r=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),J(ss,5,this),Oe(this,Ct),Oe(this,_e,""),r&&([ja(this,_e)._]=r);const l=new E(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+he(this,_e).length),s,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return zi(this,Ct,It).call(this).subtype}afterBuild(){he(this,_e).includes("\0")&&we(this,_e,this.buildFromStr(he(this,_e),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+he(this,_e)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+he(this,_e)+s.text()}getGaps(e){return e===1?he(this,_e).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=I,{computeEditInfo:l,fix:o}=n,d=["td","double"].map(u=>n.getSeverity(r,u));for(const u of this.lastChild.childNodes)if(u.type==="text"){const{data:a}=u;if(a.includes("|")){const h=a.includes("||"),g=d[h?1:0];if(g){const c=q(u,i,r,"pipe-in-table",g);if(l||o)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];c.fix=$e(c,"newline",a.replace(/\|\|/gu,`
14
- ${p}`))}else l&&(c.suggestions=[un(c.startIndex,a)]);s.push(c)}}}return s}}isIndependent(){return this.firstChild.text().startsWith(`
15
- `)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${he(this,_e)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){}},ss=Y(Ti),_e=new WeakMap,Ct=new WeakSet,It=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let i="td";if(s==="!"?i="th":s==="+"&&(i="caption"),this.isIndependent())return{subtype:i};const{previousSibling:r}=this;return fe({},zi(e=r,Ct,It).call(e))},It=X(ss,17,"#getSyntax",hl,Ct,It),sn(ss,xs)}}),Sn,zo=C({"src/table/trBase.ts"(){"use strict";M(),B(),Wo(),Mo(),Sn=class extends ct{lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=this.childNodes.find(({type:o})=>o==="table-inter");if(!i)return s;const r=Mt(i),n="fostered-content",l=r&&I.lintConfig.getSeverity(n,r===2?void 0:"transclusion");if(l){const o=q(i,{start:e},n,"content-outside-table",l);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof xs&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),cl,gl,pl,fl,Ci,is,cs,xu=C({"src/table/index.ts"(){"use strict";M(),Ne(),de(),hn(),B(),zo(),tt(),cl=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),gl=({type:e})=>e==="tr"||e==="table-syntax",pl=class extends Array{},cs=class extends(Ci=Sn,fl=[ws(!1)],Ci){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),J(is,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),r=["unclosed-table","table-layout"],n=r.map(l=>I.lintConfig.getSeverity(l));if(n[0]&&!this.closed&&s.push(q(this.firstChild,i,r[0],"unclosed-table",n[0])),n[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let d=1,u=1/0,a=0;for(;a<o;a++){const h=l[a],g=h.length;if(g<d)break;g<u&&(u=g);const c=h.indexOf(h[g-1])+1;if(c>u)break;c>d&&(d=c)}if(a<o){const h=this.getNthRow(a),g=q(h,i,r[1],"inconsistent-table",n[1]);g.startIndex++,g.startLine++,g.startCol=0,s.push(g)}}}return s}}close(e=`
16
- |}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");ke.run(()=>{const r=new Ue(t?e:void 0,"table-syntax",s,i);super.insertAt(r)})}getLayout(e){{const t=this.getAllRows(),{length:s}=t,i=pl.from(cl(s,()=>[]));for(let r=0;r<i.length;r++){const n=i[r];let l=0,o=0,d;for(const u of t[r].childNodes.slice(2))if(u.is("td")){if(u.isIndependent()&&(d=u.subtype!=="caption"),d){const a={row:r,column:l},{rowspan:h,colspan:g}=u;for(l++;n[o];)o++;for(let c=r;c<Math.min(r+h,s);c++)for(let p=o;p<o+g;p++)i[c][p]=a;o+=g}}else if(gl(u))break}return i}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){{const i=super.getRowCount();if(e===0&&i)return this;i&&e--;for(const r of this.childNodes.slice(2)){const{type:n}=r;if(n==="tr"&&r.getRowCount()&&(e--,e<0))return r}return}}json(e,t=this.getAbsoluteIndex()){}},is=Y(Ci),X(is,1,"getLayout",fl,cs),sn(is,cs)}}),Uo,vu=C({"src/table/tr.ts"(){"use strict";zo(),Uo=class extends Sn{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),kn,Ho=C({"src/nowiki/listBase.ts"(){"use strict";it(),kn=class extends Te{get indent(){}json(e,t=this.getAbsoluteIndex()){}}}}),An,Do=C({"src/nowiki/dd.ts"(){"use strict";Ho(),An=class extends kn{get type(){return"dd"}}}}),Go={};se(Go,{parseTable:()=>Vo});var ml,Ii,Vo,bu=C({"parser/table.ts"(){"use strict";W(),xu(),vu(),Mo(),Do(),ml=e=>e.lastChild.constructor!==E,Ii=(e,t)=>e.is("td")?t.pop():e,Vo=({firstChild:{data:e},type:t,name:s},i,r)=>{const n=[],l=e.split(`
6
+ `})}}}}),ao,iu=C({"src/paramLine.ts"(){"use strict";W(),ao=class extends E{get type(){return"param-line"}}}}),uo={};se(uo,{ParamTagToken:()=>vn});var vn,ho=C({"src/multiLine/paramTag.ts"(){"use strict";M(),de(),Cs(),B(),xn(),iu(),vn=class extends $s{constructor(e,t,s=I.getConfig(),i=[],r){super(void 0,s,i,{}),t&&this.append(...t.split(`
7
+ `).map(n=>r?n:Qt(n,s,i,e)).map(n=>new ao(n,s,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=I,i=s.getSeverity(t,this.name);if(!i)return[];const r=new le(this,e),n=I.msg("invalid-parameter",this.name),l=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const d=o.childNodes.filter(({type:u})=>u!=="comment"&&u!=="include"&&u!=="noinclude");if(d.some(({type:u})=>u==="ext"))l.push(q(o,r,t,n,i));else{const u=d.findIndex(({type:h})=>h!=="text"),a=d.slice(0,u===-1?void 0:u).map(String).join("");if(a&&!(u===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(a)){const h=q(o,r,t,n,i);s.computeEditInfo&&(h.suggestions=[U(h)]),l.push(h)}else{const h=o.lint(e,!1);h.length>0&&l.push(...h)}}e+=o.toString().length+1}return l}}}}}),_r,ri,$r,lt,co=C({"src/heading.ts"(){"use strict";var e,t,ds,i;M(),Ce(),de(),Ee(),B(),W(),tt(),_r=[Ne],lt=(i=class extends($r=E){constructor(n,l,o,d=[]){super(void 0,o,d);N(this,t);N(this,e);L(this,e,n);const u=new E(l[0],o,d);u.type="heading-title",u.setAttribute("stage",2);const a=new Ue(l[1],"heading-trail",o,d);this.append(u,a)}get type(){return"heading"}get level(){return m(this,e)}toString(n){const l=P(this,t,ds).call(this);return l+this.firstChild.toString(n)+l+this.lastChild.toString(n)}text(){const n=P(this,t,ds).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()===2:n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{firstChild:d,level:u}=this,a=d.toString(),h=a.startsWith("="),c=h||a.endsWith("="),g=new le(this,n),p=this.inHtmlAttrs(),v=["h1","unbalanced-header","format-leakage"],{lintConfig:x}=I,{computeEditInfo:b,fix:y}=x,S=v.map(w=>x.getSeverity(w,"apostrophe"));if(S[0]&&this.level===1){const w=q(d,g,v[0],"<h1>",S[0]);b&&!c&&(w.suggestions=[$e(w,"h2",`=${a}=`)]),o.push(w)}if(S[1]&&c){const w=I.msg("unbalanced-in-section-header",'"="'),A=q(d,g,v[1],w,S[1]);if(!(!b||a==="="))if(h){const[_]=/^=+/u.exec(a),f=u+_.length;A.suggestions=[{desc:`h${u}`,range:[A.startIndex,A.startIndex+_.length],text:""}],f<7&&A.suggestions.push({desc:`h${f}`,range:[A.endIndex,A.endIndex],text:_})}else{const _=/[^=](=+)$/u.exec(a)[1],f=u+_.length;A.suggestions=[{desc:`h${u}`,range:[A.endIndex-_.length,A.endIndex],text:""}],f<7&&A.suggestions.push({desc:`h${f}`,range:[A.startIndex,A.startIndex],text:_})}o.push(A)}if(p){const w="parsing-order",A=x.getSeverity(w,p===2?"heading":"templateInTable");A&&o.push(z(this,g,w,"header-in-html",A))}if(S[2]){const w=this.getRootNode().toString(),A=d.childNodes.filter(Is("quote")),_=A.filter(({bold:k})=>k),f=A.filter(({italic:k})=>k);if(_.length%2){const k=q(_[_.length-1],Le(fe({},g),{start:n+u,left:g.left+u}),v[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),S[2]);if(b||y){const $=n+u+a.length,T=U(k);w.slice(k.endIndex,$).trim()?b&&(k.suggestions=[T,We($,"'''")]):_.length===1&&f.length===0?k.fix=T:b&&(k.suggestions=[T])}o.push(k)}if(f.length%2){const k=q(f[f.length-1],{start:n+u},v[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),S[2]);if(b||y){const $=n+u+a.length;w.slice(k.endIndex,$).trim()?b&&(k.suggestions=[We($,"''")]):f.length===1&&_.length===0?k.fix=U(k):b&&(k.suggestions=[U(k)])}o.push(k)}}return o}}print(){const n=P(this,t,ds).call(this);return super.print({pre:n,sep:n})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakSet,ds=function(){return"=".repeat(this.level)},i),ri=Y($r),lt=X(ri,0,"HeadingToken",_r,lt),J(ri,1,lt)}}),Tr,go,nu=C({"src/parameter.ts"(){"use strict";ce(),M(),B(),W(),Tr=new RegExp(`https?://${pt}${ft}$`,"iu"),go=class extends E{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new E(typeof e=="number"?void 0:e,s,i,{}),n=new E(t,s,i);r.type="parameter-key",r.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(r,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r="unescaped",{lintConfig:n}=I,l=n.getSeverity(r);if(l){const{firstChild:o}=this,d=(s=Tr.exec(o.text()))==null?void 0:s[0];try{if(d&&new URL(d).search){const u=q(o,{start:e},r,"unescaped-query",l);u.startIndex=u.endIndex,u.startLine=u.endLine,u.startCol=u.endCol,u.endIndex++,u.endCol++,(n.computeEditInfo||n.fix)&&(u.fix=vt(u.startIndex,"{{=}}")),i.push(u)}}catch(u){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){}}}}),Cr,li,Ir,ot,ru=C({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,hs,po,d;ce(),M(),Ce(),de(),ks(),Ee(),B(),W(),nu(),st(),tt(),Cr=[Ne,Vt()],ot=(d=class extends(Ir=E){constructor(a,h,c,g=[]){var T,F;let p;const v=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(a);v&&(p=Number(v[1]),a=a.replace(`\0${p}h`,g[p].toString().replace(/^\n/u,"")));super(void 0,c,g,{});N(this,n);Fe(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,r);const{parserFunction:[x,b],variable:y,functionHook:S}=c,w=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(a))==null?void 0:T[0];if(w)this.setAttribute("modifier",w),a=a.slice(w.length);else if(a.includes(":")){const[j,...R]=a.split(":"),[ne]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((F=R[0])!=null?F:"");this.setModifier(`${j}:${ne}`)&&(a=R.join(":").slice(ne.length))}const A=a.search(/[::]/u),_=a[A]===":",f=A!==-1;if(f||h.length===0&&!m(this,s)){const j=f?a.slice(0,A):a,R=f&&a.slice(A+1),ne=ve(j),O=f?ne.slice(ne.search(/\S/u))+(_?":":""):ne.trim(),re=O.toLowerCase(),pe=Array.isArray(b),V=pe?b.includes(O):Object.prototype.hasOwnProperty.call(b,O),G=!pe&&V?b[O]:Object.prototype.hasOwnProperty.call(x,re)&&x[re],K=pe&&V||!("functionHook"in c)||S.includes(G),H=pe&&V||y.includes(G);if(f?G&&K:H){this.setAttribute("name",G||re.replace(/^#|:$/u,"")),L(this,e,"magic-word"),_&&L(this,t,":");const Z=new Ue(j,"magic-word-name",c,g);if(super.insertAt(Z),R!==!1&&h.unshift([R]),this.name==="invoke")for(let D=0;D<2;D++){const ee=h.shift();if(!ee)break;const oe=new xe(ee.join("="),`invoke-${D?"function":"module"}`,c,g);super.insertAt(oe)}}}if(this.type==="template"){const j=ve(a).trim();if(!this.normalizeTitle(j,10,{halfParsed:!0,temporary:!0}).valid)throw g.pop(),new SyntaxError("Invalid template name");const R=new xe(a,"template-name",c,g,{});super.insertAt(R)}typeof p=="number"&&(g[p]=void 0);const k=this.isTemplate();let $=1;for(let j=0;j<h.length;j++){const R=h[j];k||this.name==="switch"&&j>0||this.name==="tag"&&j>1||(R[0]=R.join("="),R.length=1),R.length===1&&(R.unshift($),$++),this.insertAt(new go(...R,c,g))}this.seal("modifier")}get type(){return m(this,e)}get module(){}get function(){}setModifier(a){const{parserFunction:[,,h,c]}=this.getAttribute("config"),g=ve(a).trim();if(a&&!g.endsWith(":"))return!1;const p=g.slice(0,-1).toLowerCase(),v=h.includes(p),x=c.includes(p);return m(this,s)&&v||!m(this,s)&&(x||!a)||(we.running||this.length>1)&&(v||x||!a)?(this.setAttribute("modifier",a),L(this,s,v),!!a):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(L(this,r,P(this,n,hs).call(this)),this.setAttribute("name",m(this,r).title))}toString(a){const{childNodes:h,length:c,firstChild:g,modifier:p,type:v}=this;return`{{${p}${v==="magic-word"?g.toString(a)+(c===1?"":m(this,t))+h.slice(1).map(x=>x.toString(a)).join("|"):super.toString(a,"|")}}}`}text(){const{childNodes:a,length:h,firstChild:c,modifier:g,type:p,name:v}=this;return p==="magic-word"&&v==="vardefine"?"":`{{${g}${p==="magic-word"?c.text()+(h===1?"":m(this,t))+Ye(a.slice(1),"|"):super.text("|")}}}`}getAttribute(a){switch(a){case"padding":return this.modifier.length+2;case"title":return m(this,r);case"colon":return m(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,n,hs).call(this).valid);default:return super.getAttribute(a)}}lint(a=this.getAbsoluteIndex(),h){{const c=super.lint(a,h);if(!this.isTemplate())return c;const{type:g,childNodes:p,length:v}=this,x=new le(this,a),{lintConfig:b}=I,{computeEditInfo:y}=b,S=g==="magic-word";let w="no-ignored",A=b.getSeverity(w,"fragment");if(S&&!P(this,n,hs).call(this).valid)w="invalid-invoke",A=b.getSeverity(w,"name"),A&&c.push(q(p[1],x,w,"illegal-module",A));else if(A){const _=p[S?1:0],f=_.childNodes.findIndex($=>$.type==="text"&&ms($.data).includes("#")),k=_.childNodes[f];if(k){const $=q(_,x,w,"useless-fragment",A);y&&($.suggestions=[U($,_.getRelativeIndex(f)+k.data.indexOf("#"))]),c.push($)}}if(w="invalid-invoke",A=b.getSeverity(w,"function"),A&&S&&v===2)return c.push(z(this,x,w,"missing-function",A)),c;if(w="no-duplicate",A=b.getSeverity(w,"parameter"),A){const _=this.getDuplicatedArgs().filter(([,k])=>!k[0].querySelector("ext")),f="duplicate-parameter";for(const[,k]of _)c.push(...k.map($=>{const T=q($,x,w,f,A);return y&&(T.suggestions=[U(T,-1)]),T}))}return c}}insertAt(a,h=this.length){return super.insertAt(a,h),a.anon?P(this,n,po).call(this,a):a.name&&this.getArgs(a.name,!1,!1).add(a),a}getAllArgs(){return this.childNodes.filter(Is("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:a})=>a)}getArgs(a,h,c=!0){const g=String(a).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return m(this,i).has(g)?p=m(this,i).get(g):(p=new Set(this.getAllArgs().filter(({name:v})=>g===v)),m(this,i).set(g,p)),p}getDuplicatedArgs(){return[...m(this,i)].filter(([,{size:a}])=>a>1).map(([a,h])=>[a,[...h]])}getPossibleValues(){const{type:a,name:h,childNodes:c}=this;if(a==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let g,p;switch(h){case"if":case"ifexist":case"ifexpr":case"iferror":g=2;break;case"ifeq":g=3;break;case"switch":{const v=c.slice(2),x=v[v.length-1];p=[...v.filter(({anon:b})=>!b),...x!=null&&x.anon?[x]:[]].map(({lastChild:b})=>b);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=c.slice(g,g+2).map(({lastChild:v})=>v));for(let v=0;v<p.length;){const{length:x,0:b}=p[v].childNodes.filter(y=>y.text().trim());if(x===0)p.splice(v,1);else if(x>1||b.type!=="magic-word")v++;else try{const y=b.getPossibleValues();p.splice(v,1,...y),v+=y.length}catch(y){v++}}return p}print(){const{childNodes:a,length:h,firstChild:c,modifier:g,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Ut(g)+c.print()+(h===1?"":m(this,t))+xt(a.slice(1),{sep:"|"}):(g?`<span class="wpb-magic-word">${Ut(g)}</span>`:"")+xt(a,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,hs=function(){const a=this.type==="template";return this.normalizeTitle(this.childNodes[a?0:1].text(),a?10:828,{temporary:!0})},po=function(a){const h=this.getAnonArgs(),c=typeof a!="number";for(let g=c?h.indexOf(a):a-1;g<h.length;g++){const p=h[g],{name:v}=p,x=String(g+1);(v!==x||p===a)&&(p.setAttribute("name",x),this.getArgs(x,!1,!1).add(p))}},d),li=Y(Ir),ot=X(li,0,"TranscludeToken",Cr,ot),J(li,1,ot)}}),Nr,oi,Lr,Rt,lu=C({"src/hidden.ts"(){"use strict";et(),W(),Nr=[ze()],Rt=class extends(Lr=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},oi=Y(Lr),Rt=X(oi,0,"HiddenToken",Nr,Rt),J(oi,1,Rt)}}),Fr,ai,Er,Ot,ou=C({"src/arg.ts"(){"use strict";var e,au,s;ce(),M(),de(),He(),ks(),Ee(),B(),W(),st(),lu(),Fr=[Ne,Pe("{{{"),Vt()],Ot=(s=class extends(Er=E){constructor(r,n,l=[]){super(void 0,n,l,{});N(this,e);for(let o=0;o<r.length;o++){const d=r[o];if(o===0){const u=new xe(d,"arg-name",n,l,{});super.insertAt(u)}else if(o>1){const u=new Rt(d,n,l);super.insertAt(u)}else{const u=new E(d,n,l);u.type="arg-default",u.setAttribute("stage",2),super.insertAt(u)}}}get type(){return"arg"}get default(){}toString(r){return`{{{${super.toString(r,"|")}}}}`}text(){return`{{{${Ye(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(r=this.getAbsoluteIndex(),n){{const{childNodes:[l,o,...d]}=this;l.setAttribute("aIndex",r+3);const u=l.lint(r+3,n);if(o){const v=r+4+l.toString().length;o.setAttribute("aIndex",v);const x=o.lint(v,n);x.length>0&&u.push(...x)}const a=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:c}=h,g=new le(this,r),p=a.map(v=>h.getSeverity(v,"arg"));if(p[0]&&d.length>0&&u.push(...d.map(v=>{const x=q(v,g,a[0],"invisible-triple-braces",p[0]);return x.startIndex--,x.startCol--,c&&(x.suggestions=[U(x),vt(x.startIndex,"{{!}}")]),x})),p[1]&&!this.getAttribute("include")){const v=z(this,g,a[1],"unexpected-argument",p[1]);c&&o&&(v.suggestions=[$e(v,"expand",o.text())]),u.push(v)}return u}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(r,n=this.getAbsoluteIndex()){}},e=new WeakSet,au=function(){},s),ai=Y(Er),Ot=X(ai,0,"ArgToken",Fr,Ot),J(ai,1,Ot)}}),fo={};se(fo,{parseBraces:()=>Ts});var Pr,ui,ts,di,hi,ci,Rr,gi,Ts,bn=C({"parser/braces.ts"(){"use strict";Ze(),ce(),co(),ru(),ou(),Pr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ui=String.raw`\[(?!\[)`,ts=String.raw`\n(?![=\0])`,di=String.raw`|\{{2,}`,hi=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),ci=gt(e=>new RegExp(e,"gmu")),Rr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ui}|${ts})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ts})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ui}|${ts})*\}-`,"gu"),gi=e=>{const t=mt(ve(e));return hi.has(t)?hi.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Ts=(e,t,s)=>{var p,v,x,b,y;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,n=[],l=[],o=(S,w,A,_)=>{w[w.length-1].push(Se(S.slice(A,_),l))};let d;do d!==void 0&&(e=d),d=e.replace(Rr,(S,w,A)=>{if(w!==void 0||typeof A=="string")try{const{length:_}=s,f=(w!=null?w:A).split("|");return new ot(Se(f[0],l),f.slice(1).map(k=>{const $=k.indexOf("=");return($===-1?[k]:[k.slice(0,$),k.slice($+1)]).map(T=>Se(T,l))}),t,s),`\0${_}${gi(f[0])}`}catch(_){if(!(_ instanceof SyntaxError)||_.message!=="Invalid template name")throw _}return l.push(Se(S,l)),`\0${l.length-1}`});while(d!==e);e=d;const u=e.lastIndexOf("}}")-e.length;let a=u+e.length!==-1,h=ci(i+(a?di:"")),c=h.exec(e),g;for(;c||g!==void 0&&g<=e.length&&((v=(p=n[n.length-1])==null?void 0:p[0])!=null&&v.startsWith("="));){if(c!=null&&c[1]){const[,{length:R}]=c;c[0]=c[0].slice(R),c.index+=R}const{0:S,index:w}=c!=null?c:{0:`
8
+ `,index:e.length},A=(x=n.pop())!=null?x:{},{0:_,index:f,parts:k,findEqual:$,pos:T}=A,F=S==="="&&$;if(S==="]]"||S==="}-")g=w+2;else if(S===`
9
+ `){g=w+1;const{pos:R,findEqual:ne}=(b=n[n.length-1])!=null?b:{};if(R===void 0||ne||ve(e.slice(R,f))!==""){const O=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(f,w));O&&(O[2]=Se(O[2],l),O[2].includes(`
10
+ `)||(e=`${e.slice(0,f)}\0${s.length}h${e.slice(w)}`,g=f+4+String(s.length).length,new lt(O[1].length,O.slice(2),t,s)))}}else if(S==="|"||F)g=w+1,o(e,k,T,w),S==="|"&&k.push([]),A.pos=g,A.findEqual=S==="|",n.push(A);else if(S.startsWith("}}")){const R=S.slice(0,Math.min(_.length,3)),ne=_.length-R.length,{length:O}=s;g=w+R.length,o(e,k,T,w);let re=!1,pe="t";if(R.length===3){const V=k.map(K=>K.join("=")),G=V.length>1&&ve(V[1]).trim();new Ot(V,t,s),G&&G.endsWith(":")&&r.includes(G.slice(0,-1).toLowerCase())&&(pe="s")}else try{new ot(k[0][0],k.slice(1),t,s),pe=gi(k[0][0])}catch(V){if(V instanceof SyntaxError&&V.message==="Invalid template name")re=!0;else throw V}re||(e=`${e.slice(0,f+ne)}\0${O}${pe}${e.slice(g)}`,g=f+ne+3+String(O).length,ne>1?n.push({0:_.slice(0,ne),index:f,pos:f+ne,parts:[[]]}):ne===1&&e[f-1]==="-"&&n.push({0:"-{",index:f-1,pos:f+1,parts:[[]]}))}else g=w+S.length,S.startsWith("{")&&(c.pos=g,c.parts=[[]]),n.push(..."0"in A?[A]:[],c);let j=n[n.length-1];if(a&&u+e.length<g)for(a=!1;(y=j==null?void 0:j[0])!=null&&y.startsWith("{");)n.pop(),j=n[n.length-1];h=ci(i+(a?di:"")+(j?`|${Pr[j[0][0]]}${j.findEqual?"|=":""}`:"")),h.lastIndex=g,c=h.exec(e)}return Se(e,l)}}}),mo={};se(mo,{InputboxToken:()=>xo});var xo,uu=C({"src/multiLine/inputbox.ts"(){"use strict";Cs(),bn(),B(),ho(),xo=class extends vn{constructor(e,t,s=I.getConfig(),i=[]){const r=Symbol("InputboxToken"),n=s.excludes.includes("heading")?s:Le(fe({},s),{excludes:[...s.excludes,"heading"]}),{length:l}=i;i.push(r),t&&(t=Qt(t,n,i,e)),t&&(t=Ts(t,n,i)),i.splice(l,1),super(e,t,n,i,{})}}}}),cs={};se(cs,{NestedToken:()=>vo});var Or,Br,vo,pi=C({"src/nested.ts"(){"use strict";var e,t,s;M(),de(),Cs(),bn(),B(),W(),jo(),yt(),Or=new Set(["comment","include","arg","template","magic-word"]),Br=[!1,!0].map(i=>{const r=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),vo=(s=class extends E{constructor(r,n,l,o,d=[]){if(typeof n=="boolean"){const u=Symbol("NestedToken"),{length:a}=d;d.push(u),r&&(r=Qt(r,o,d,n)),r&&(r=Ts(r,o,d)),d.splice(a,1)}else r&&(r=r.replace(n,(u,a,h,c,g)=>{const p=`\0${d.length+1}e`;return new ht(a,h,c,g,o,!1,d),p}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(u,a,h)=>(new ke(h,o,d),`${a}\0${d.length}n`)));super(r,o,d);N(this,e);N(this,t);L(this,e,[...l]),L(this,t,n)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="no-ignored",{lintConfig:d}=I,u=d.getSeverity(o,this.name);if(!u)return l;const a=new le(this,r),h=typeof m(this,t)=="boolean"?Br[m(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(c=>{const{type:g,name:p}=c;if(g==="ext")return!m(this,e).includes(p);if(Or.has(g))return!1;const v=c.toString().trim();return v&&!h.test(v)}).map(c=>{const g=q(c,a,o,I.msg("invalid-content",this.name),u);return d.computeEditInfo&&(g.suggestions=[U(g),an(g,c.toString())]),g})]}}},e=new WeakMap,t=new WeakMap,s)}});function jr(e,t,s,i,r){t=ve(t).trim();let n=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!n&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{if(n){if(bo(s.protocol).test(n))return wo(s.protocol).test(n)&&t;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const l=I.normalizeTitle(n,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0});return l.valid&&l}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 bo,wo,qr,Wr,Mr,yo,du=C({"src/imageParameter.ts"(){"use strict";var e,t,So,r;Ze(),ce(),M(),Me(),Ce(),B(),W(),bo=gt(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),wo=gt(n=>new RegExp(String.raw`^(?:(?:${n}|//)${pt}|\0\d+m\x7F)${ft}$`,"iu")),qr=gt(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
11
+ )`:""}(\s*)$`,"u")),Wr=new Set(["alt","link","lang","page","caption"]),Mr=n=>{if(n)n.startsWith("//")&&(n=`https:${n}`);else return n;return new URL(n).href},yo=(r=class extends E{constructor(l,o,d,u){var n=(...i)=>(super(...i),N(this,t),N(this,e,""),this);let a;const h=Object.entries(d.img).map(([g,p])=>[g,p,qr(g)]),c=h.find(([,g,p])=>(a=p.exec(l),a&&(a.length!==4||jr(g,a[2],d,!0,o)!==!1)));if(c&&a){a.length===3?(n(void 0,d,u),L(this,e,l)):(n(a[2],d,u,{}),L(this,e,a[1]+c[0]+a[3])),this.setAttribute("name",c[1]),c[1]==="alt"&&this.setAttribute("stage",be-1);return}n(l,d.excludes.includes("list")?d:Le(fe({},d),{excludes:[...d.excludes,"list"]}),u),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){{if(this.name!=="link")return;const l=super.text().trim();return we.run(()=>{const o=new E(l,this.getAttribute("config"));return o.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(o.toString())?l:jr("link",l,this.getAttribute("config"))})}}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!Wr.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return m(this,e)?m(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return m(this,e)?m(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,m(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){{const d=super.lint(l,o),{lintConfig:u}=I,{computeEditInfo:a,fix:h}=u,{link:c,name:g}=this,p=g==="width"&&this.getValue();if(g==="invalid"||p&&p.endsWith("px")){const v="invalid-gallery",x=u.getSeverity(v,"parameter");if(x){const b=z(this,{start:l},v,"invalid-image-parameter",x);(a||h)&&(b.fix=p?U(b,0,p):U(b,-1)),d.push(b)}}else if(g==="link"){if(typeof c=="string"){const v="invalid-url",x=u.getSeverity(v);if(x&&!this.querySelector("magic-word"))try{Mr(c)}catch(b){d.push(z(this,{start:l},v,"invalid-url",x))}}else if(c.encoded){const v="url-encoding",x=u.getSeverity(v,"file");if(x){const b=z(this,{start:l},v,"unnecessary-encoding",x);(a||h)&&(b.fix=ln(b,this)),d.push(b)}}}return d}}getValue(){return this.name==="invalid"?this.text():P(this,t,So).call(this)||super.text()}print(){return m(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${m(this,e).replace("$1",`<span class="wpb-image-caption">${xt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,So=function(){return m(this,e)&&!m(this,e).includes("$1")},r)}}),fi,zr,Ur,mi,xi,vi,Hr,bi,wn,ko=C({"src/link/file.ts"(){"use strict";M(),de(),B(),Ss(),du(),fi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),zr=new Set(["arg"]),Ur=new Set(["template","magic-word"]),mi=new Set(["left","right","center","none"]),xi=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),vi=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Hr=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),r=0,n=0;for(;i;){const{0:l,index:o}=i;l!=="|"?r+=l==="-{"?1:-1:r===0&&(s.push(e.slice(n,o)),{lastIndex:n}=t),i=t.exec(e)}return s.push(e.slice(n)),s},bi=(e,t)=>e.filter(({childNodes:s})=>!s.some(i=>i.text().trim()&&t.has(i.type))),wn=class extends Be{get type(){return"file"}get extension(){}constructor(e,t,s,i=[],r="|"){super(e,void 0,s,i,r);const{extension:n}=this.getTitle(!0,!0);this.safeAppend(Hr(t).map(l=>new yo(l,n,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r=bi(this.getAllArgs(),zr),n=[...new Set(r.map(({name:_})=>_))],l=n.filter(_=>fi.has(_)),o=n.filter(_=>mi.has(_)),d=n.filter(_=>xi.has(_)),[u]=l,a=u==="framed"||u==="manualthumb",h=new le(this,e),{lintConfig:c}=I,{computeEditInfo:g,fix:p}=c,{ns:v,extension:x}=this.getAttribute("title"),{firstChild:b}=this;let y="nested-link",S=c.getSeverity(y,"file");if(S&&vi.has(x)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const _=z(this,h,y,"link-in-extlink",S);if(g||p){const f=this.getArg("link");if(f){const k=e+f.getRelativeIndex();_.fix={desc:I.msg("delink"),range:[k,k+f.toString().length],text:"link="}}else _.fix=ws(_.endIndex-2,"delink","|link=")}i.push(_)}if(y="invalid-gallery",S=c.getSeverity(y,"extension"),S&&v===6&&!x&&!b.querySelector("arg,magic-word,template")&&i.push(z(this,h,y,"missing-extension",S)),S=c.getSeverity(y,"parameter"),S&&a)for(const _ of r.filter(({name:f})=>f==="width")){const f=q(_,h,y,"invalid-image-parameter",S);(g||p)&&(f.fix=U(f,-1)),i.push(f)}if(r.length===n.length&&l.length<2&&o.length<2&&d.length<2)return i;y="no-duplicate";const w=["unknownImageParameter","imageParameter"].map(_=>c.getSeverity(y,_)),A=(_,f,k,$=!0)=>_.map(T=>{if(S=w[Number(typeof $=="function"?$(T):$)],!S)return!1;const F=q(T,h,y,I.msg(`${f}-image-parameter`,k),S);return g&&(F.suggestions=[U(F,-1)]),F}).filter(T=>T!==!1);for(const _ of n){if(_==="invalid"||_==="width"&&a)continue;const f=_==="caption";let k=r.filter(({name:$})=>$===_);if(f&&(k=[...k.slice(0,-1).filter($=>$.text()),...k.slice(-1)]),k.length>1){let $=!f||!x||vi.has(x);if(f&&$){const T=bi(k,Ur);$=T.length>1&&(F=>T.includes(F))}i.push(...A(k,"duplicate",_,$))}}return l.length>1&&i.push(...A(r.filter(({name:_})=>fi.has(_)),"conflicting","frame")),o.length>1&&i.push(...A(r.filter(({name:_})=>mi.has(_)),"conflicting","horizontal-alignment")),d.length>1&&i.push(...A(r.filter(({name:_})=>xi.has(_)),"conflicting","vertical-alignment")),i}}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){{const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){}}}}),Dr,wi,Gr,at,Ao=C({"src/link/galleryImage.ts"(){"use strict";var e,Xi,s;M(),Me(),He(),B(),W(),ko(),Dr=[Pe("")],at=(s=class extends(Gr=wn){constructor(r,n,l,o,d=[]){let u;if(l!==void 0){const{length:a}=d;u=new E(l,o,d);for(let h=0;h<be-1;h++)u.parseOnce();d.splice(a,1)}super(n,u==null?void 0:u.toString(),o,d);N(this,e);Fe(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${r}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(r){const n=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),n?0:6,{halfParsed:!0,temporary:r,decode:!n})}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="invalid-gallery",{lintConfig:d}=I,u=d.getSeverity(o,"image");if(u&&P(this,e,Xi).call(this)){const a=z(this,{start:r},o,"invalid-gallery",u);d.computeEditInfo&&(a.suggestions=[ws(r,"prefix","File:")]),l.push(a)}return l}}getAttribute(r){return r==="invalid"?P(this,e,Xi).call(this):super.getAttribute(r)}},e=new WeakSet,Xi=function(){const{ns:r}=this.getAttribute("title");return r!==6},s),wi=Y(Gr),at=X(wi,0,"GalleryImageToken",Dr,at),J(wi,1,at)}}),xs,_o=C({"src/nowiki/commentLine.ts"(){"use strict";yt(),xs=class extends ke{}}}),$o={};se($o,{GalleryToken:()=>To});var To,hu=C({"src/multiLine/gallery.ts"(){"use strict";var e,Co,cu,i;M(),B(),xn(),Ao(),_o(),To=(i=class extends $s{constructor(n,l,o=[]){var d;super(void 0,l,o,{});N(this,e);for(const u of(d=n==null?void 0:n.split(`
12
+ `))!=null?d:[]){const a=/^([^|]+)(?:\|(.*))?/u.exec(u);if(!a){super.insertAt(u.trim()?new xs(u,l,o):u);continue}const[,h,c]=a;P(this,e,Co).call(this,h)?super.insertAt(new at("gallery",h,c,l,o)):super.insertAt(new xs(u,l,o))}}get widths(){}get heights(){}lint(n=this.getAbsoluteIndex(),l){{const{top:o,left:d}=this.getRootNode().posFromIndex(n),u=[],a="no-ignored",{lintConfig:h}=I,c=["Image","NoImage","Comment"].map(g=>h.getSeverity(a,`gallery${g}`));for(let g=0;g<this.length;g++){const p=this.childNodes[g],v=p.toString(),{length:x}=v,b=v.trim(),{type:y}=p,S=o+g,w=g?0:d;if(p.setAttribute("aIndex",n),y==="noinclude"&&b&&!/^<!--.*-->$/u.test(b)){let[A]=c;if(b.startsWith("|")?[,A]=c:(b.startsWith("<!--")||b.endsWith("-->"))&&([,,A]=c),A){const _=n+x,f={rule:a,message:I.msg("invalid-content","gallery"),severity:A,startIndex:n,endIndex:_,startLine:S,endLine:S,startCol:w,endCol:w+x};h.computeEditInfo&&(f.suggestions=[U(f),an(f,v)]),u.push(f)}}else if(y!=="noinclude"&&y!=="text"){const A=p.lint(n,l);A.length>0&&u.push(...A)}n+=x+1}return u}}json(n,l=this.getAbsoluteIndex()){}},e=new WeakSet,Co=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},cu=function(n){},i)}}),yn,Io=C({"src/link/index.ts"(){"use strict";Ze(),M(),B(),Ss(),yn=class extends Be{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():Ht(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",{lintConfig:r}=I,n=r.getSeverity(i);if(n&&this.closest("ext-link-text")){const l=z(this,{start:e},i,"link-in-extlink",n);(r.computeEditInfo||r.fix)&&(l.fix=$e(l,"delink",this.innerText)),s.push(l)}return s}}}}}),Vr,Qr,Gt,Sn=C({"src/magicLink.ts"(){"use strict";var e,t,Ki,i;M(),ce(),de(),B(),W(),Vr=String.raw`(?:[${qe}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,Qr=new RegExp(`${Vr}+`,"gu"),Gt=(i=class extends E{constructor(n,l="free-ext-link",o=I.getConfig(),d){super(n,o,d,{});N(this,t);N(this,e);L(this,e,l)}get type(){return m(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let l=Ye(this.childNodes.map(o=>{const{type:d}=o,u=String(o.name);return d==="magic-word"&&n.has(u)?n.get(u):o}));return this.type==="magic-link"&&(l=l.replace(Qr," ")),l}get link(){const{innerText:n}=this;return this.type==="magic-link"?n.startsWith("ISBN")?`ISBN ${n.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:n:ql(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),d=new le(this,n),{lintConfig:u}=I,{type:a,childNodes:h}=this;if(a==="magic-link"){const v="invalid-isbn",x=u.getSeverity(v);return x&&P(this,t,Ki).call(this)&&o.push(z(this,d,v,"invalid-isbn",x)),o}let c="invalid-url",g=u.getSeverity(c);if(g&&!this.querySelector("magic-word"))try{this.getUrl()}catch(v){o.push(z(this,d,c,"invalid-url",g))}const p=a==="ext-link-url";if(c="unterminated-url",g=u.getSeverity(c,p?"pipe":"punctuation"),g){const v=p?/\|/u:/[,;。:!?()]+/u,x=h.find(b=>b.type==="text"&&v.test(b.data));if(x){const{data:b}=x,y=q(x,d,c,I.msg("in-url",p?'"|"':"full-width-punctuation"),g);if(u.computeEditInfo){const{index:S,0:w}=v.exec(b),A=y.startIndex+S;y.suggestions=p?[Dt(A,1)]:[Dt(A),{desc:I.msg("encode"),range:[A,A+w.length],text:encodeURI(w)}]}o.push(y)}}return o}}getUrl(n){this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?P(this,t,Ki).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,Ki=function(){if(this.type==="magic-link"){const{link:n}=this;if(n.startsWith("ISBN")){const l=[...n.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,d,u)=>o+d*(10-u),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,d,u)=>o+d*(u%2?3:1),0)%10!==0)}}return!1},i)}}),Jr,yi,Xr,ut,No=C({"src/extLink.ts"(){"use strict";var e,t;Me(),M(),He(),B(),W(),Sn(),Jr=[Pe("[")],ut=(t=class extends(Xr=E){constructor(i,r="",n="",l,o=[]){super(void 0,l,o,{});N(this,e);const d=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new Gt(i,"ext-link-url",l,o);if(this.insertAt(d),L(this,e,r),n){const u=new E(n,l,o,{});u.type="ext-link-text",u.setAttribute("stage",be-1),this.insertAt(u)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${m(this,e)}]`:`[${super.toString(i,m(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return m(this,e).length}lint(i=this.getAbsoluteIndex(),r){{const n=super.lint(i,r),l="var-anchor",o=I.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.closest("heading-title")&&n.push(z(this,{start:i},l,"variable-anchor",o)),n}}print(){return super.print(this.length===1?{pre:"[",post:`${m(this,e)}]`}:{pre:"[",sep:m(this,e),post:"]"})}},e=new WeakMap,t),yi=Y(Xr),ut=X(yi,0,"ExtLinkToken",Jr,ut),J(yi,1,ut)}}),Yi,gu=C({"src/imagemapLink.ts"(){"use strict";W(),yt(),Io(),No(),Yi=class extends E{get type(){return"imagemap-link"}constructor(e,t,s,i,r=[]){super(void 0,i,r),this.append(e,t.length===2?new yn(...t,i,r):new ut(...t,i,r),new ke(s,i,r))}}}}),Lo={};se(Lo,{ImagemapToken:()=>Fo});var Fo,pu=C({"src/multiLine/imagemap.ts"(){"use strict";M(),Ce(),de(),B(),xn(),_o(),Ao(),gu(),Fo=class extends $s{get image(){return this.childNodes.find(Is("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
13
+ `),r=new Set(t.protocol.split("|"));let n=!0,l=!1;for(const o of i){const d=o.trim();if(!(l||!d||d.startsWith("#"))){if(n){const u=o.indexOf("|"),a=u===-1?o:o.slice(0,u),{valid:h,ns:c}=this.normalizeTitle(a,0,{halfParsed:!0,temporary:!0});if(h&&c===6){const g=new at("imagemap",a,u===-1?void 0:o.slice(u+1),t,s);super.insertAt(g),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const u=o.indexOf("["),a=o.slice(u),h=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(a);if(h){if(this.normalizeTitle(h[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Yi(o.slice(0,u),h.slice(1),a.slice(a.indexOf("]]")+2),t,s));continue}}else if(a.startsWith("[//")||r.has(a.slice(1,a.indexOf(":")+1))||r.has(a.slice(1,a.indexOf("//")+2))){const c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(a);if(c){super.insertAt(new Yi(o.slice(0,u),c.slice(1),a.slice(a.indexOf("]")+1),t,s));continue}}}}super.insertAt(new xs(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=I,d=o.getSeverity(l,n?"link":"image");return d&&(n?s.push(...r.filter(u=>{const a=u.toString().trim();return u.is("noinclude")&&a&&!a.startsWith("#")}).map(u=>{const a=q(u,i,l,"invalid-imagemap-link",d);return o.computeEditInfo&&(a.suggestions=[U(a,-1),$e(a,"comment","# ")]),a})):s.push(z(this,i,l,"imagemap-without-image",d))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Kr,Si,Yr,dt,Eo=C({"src/nowiki/comment.ts"(){"use strict";M(),et(),He(),B(),it(),Kr=[ze(!1),Pe("<!--")],dt=class extends(Yr=Te){constructor(t,s,i,r){super(t,i,r);Fe(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=I,r=i.getSeverity(s);if(!r)return[];const n=z(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[We(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}},Si=Y(Yr),dt=X(Si,0,"CommentToken",Kr,dt),J(Si,1,dt)}}),Po={};se(Po,{CommentedToken:()=>Ro});var Ro,fu=C({"src/commented.ts"(){"use strict";W(),Eo(),Ro=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),r=i!==-1&&e.indexOf("-->",i+4),n=0;for(;r!==!1&&r!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new dt(e.slice(i+4,r),!0,t,s)),n=r+3,i=e.indexOf("<!--",n),r=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Oo={};se(Oo,{NowikiToken:()=>Bo});var Zr,el,Bo,mu=C({"src/nowiki/index.ts"(){"use strict";var e,Zi,s;Ze(),M(),B(),it(),Zr=gt(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),el=new Set(["languages","section","templatestyles"]),Bo=(s=class extends Te{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,l="void-ext",{lintConfig:o}=I,d=o.getSeverity(l,n);if(d&&P(this,e,Zi).call(this)){const u=z(this,{start:r},l,I.msg("nothing-in",n),d);return o.computeEditInfo&&(u.suggestions=[U(u)]),[u]}return super.lint(r,Zr(n))}}getAttribute(r){return r==="invalid"?P(this,e,Zi).call(this):super.getAttribute(r)}},e=new WeakSet,Zi=function(){const{name:r,firstChild:{data:n}}=this;return el.has(r)&&!!n},s)}}),tl,ki,sl,ht,jo=C({"src/tagPair/ext.ts"(){"use strict";M(),de(),B(),fn(),W(),gn(),mn(),tl=[As()],ht=class extends(sl=Xe){get type(){return"ext"}constructor(e,t,s,i,r=I.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),d=new _s(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),u=Le(fe({},r),{ext:r.ext.filter(h=>h!==o),excludes:[...r.excludes],inExt:!0});let a;switch(o){case"tab":u.ext=u.ext.filter(h=>h!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&u.excludes.push("heading"),a=new E(s,u,l);break;case"pre":{const{PreToken:h}=(su(),Q(lo));a=new h(s,u,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(ho(),Q(uo));a=new h(n,s,u,l);break}case"inputbox":{const{InputboxToken:h}=(uu(),Q(mo));a=new h(n,s,u,l);break}case"references":{const{NestedToken:h}=(pi(),Q(cs));u.excludes.push("heading"),a=new h(s,n,["ref"],u,l);break}case"choose":{const{NestedToken:h}=(pi(),Q(cs));a=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,l);break}case"combobox":{const{NestedToken:h}=(pi(),Q(cs));a=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,l);break}case"gallery":{const{GalleryToken:h}=(hu(),Q($o));a=new h(s,u,l);break}case"imagemap":{const{ImagemapToken:h}=(pu(),Q(Lo));a=new h(s,u,l);break}case"hiero":{const{CommentedToken:h}=(fu(),Q(Po));a=new h(s,u,l);break}default:{const{NowikiToken:h}=(mu(),Q(Oo));a=new h(s,u,l)}}a.setAttribute("name",o),a.type==="plain"&&(a.type="ext-inner"),super(e,d,a,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,r=new le(this,e);if(this.name!=="nowiki"){const n=this.inHtmlAttrs(),l="parsing-order",o=n&&i.getSeverity(l,n===2?"ext":"templateInTable");o&&s.push(z(this,r,l,"ext-in-html",o))}if(this.name==="ref"){let n="var-anchor",l=i.getSeverity(n,"ref");l&&this.closest("heading-title")&&s.push(z(this,r,n,"variable-anchor",l)),n="nested-link",l=i.getSeverity(n,"ref"),l&&this.closest("link,ext-link-text")&&s.push(z(this,r,n,"ref-in-link",l))}return s}}},ki=Y(sl),ht=X(ki,0,"ExtToken",tl,ht),J(ki,1,ht)}}),qo={};se(qo,{parseCommentAndExt:()=>Qt});var Ai,il,ss,nl,_i,Qt,Cs=C({"parser/commentAndExt.ts"(){"use strict";Ze(),ce(),Xa(),yt(),Ya(),Za(),jo(),Eo(),Ai="<onlyinclude>",il="</onlyinclude>",{length:ss}=Ai,nl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return Ml(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),_i=e=>{const t=e.indexOf(Ai);return{i:t,j:e.indexOf(il,t+ss)}},Qt=(e,t,s,i)=>{if(i){let{i:o,j:d}=_i(e);if(o!==-1&&d!==-1){let u="";const a=h=>{new ke(h,t,s),u+=`\0${s.length-1}n`};for(;o!==-1&&d!==-1;){const h=`\0${s.length}e`;new Et(e.slice(o+ss,d),t,s),o>0&&a(e.slice(0,o)),u+=h,e=e.slice(d+ss+1),{i:o,j:d}=_i(e)}return e&&a(e),u}}const{ext:r}=t;let n=r,l=t;if(r.includes("translate")){n=r.filter(d=>d!=="translate"&&d!=="tvar"),l=Le(fe({},t),{ext:n});const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,d=>(o.push(d),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(d,u,a)=>{const h=s.length;return new Yl(u,a&&Se(a,o),l,s),`\0${h}g`}),e=Se(e,o)}return e.replace(nl[i?1:0](n),(o,d,u,a,h,c,g,p,v)=>{const x=s.length;let b="n";if(d)b="e",new ht(d,u,a,h,l,c,s);else if(o.startsWith("<!--")){b="c";const y=o.endsWith("-->");new dt(Se(o,s,1).slice(4,y?-3:void 0),y,t,s)}else c?new Pt(c,g&&Se(g,s,1),p&&Se(p,s,1),v,t,s):new ke(o,t,s,!0);return`\0${x}${b}`})}}}),rl,ll,ol,al,$i,ul,Bt,xu=C({"src/tag/html.ts"(){"use strict";var e,t;M(),de(),fn(),B(),Kl(),rl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),ll=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"]),ol=new Set(["strike","big","center","font","tt"]),al=[As()],Bt=(t=class extends(ul=pn){constructor(i,r,n,l,o,d){super(i,r,n,o,d);N(this,e);this.setAttribute("name",i.toLowerCase()),L(this,e,l)}get type(){return"html"}get selfClosing(){return m(this,e)}text(){const{closing:i,selfClosing:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){var n;{const l=super.lint(i,r),{name:o,parentNode:d,closing:u,selfClosing:a}=this,h=new le(this,i),{lintConfig:c}=I,{computeEditInfo:g,fix:p}=c,v=this.inTableAttrs();let x="h1",b=c.getSeverity(x,"html");if(b&&o==="h1"&&!u){const f=z(this,h,x,"<h1>",b);g&&(f.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),l.push(f)}if(x="parsing-order",b=v&&c.getSeverity(x,v===2?"html":"templateInTable"),b){const f=z(this,h,x,"html-in-table",b);g&&v===2&&(f.suggestions=[U(f)]),l.push(f)}if(x="obsolete-tag",b=c.getSeverity(x,o),b&&ol.has(o)&&l.push(z(this,h,x,"obsolete-tag",b)),x="bold-header",b=c.getSeverity(x,o),b&&(o==="b"||o==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const f=z(this,h,x,"bold-in-header",b);g&&(f.suggestions=[U(f)]),l.push(f)}const{html:[,y,S]}=this.getAttribute("config"),w=S.includes(o),A=y.includes(o),_=!w&&!A;if(x="unmatched-tag",u&&(a||w)||a&&_){if(b=c.getSeverity(x,u?"both":"selfClosing"),b){const f=z(this,h,x,u?"closing-and-self-closing":"invalid-self-closing",b);if(g||p){const k=on(i),$={desc:I.msg("no-self-closing"),range:[f.endIndex-2,f.endIndex-1],text:""};A?g&&(f.suggestions=[k,$]):u?f.fix=w?k:$:g&&(f.suggestions=[$,We(f.endIndex,`></${o}>`,-2)])}l.push(f)}}else if(!this.findMatchingTag()){const f=z(this,h,x,u?"unmatched-closing":"unclosed-tag"),k=this.closest("magic-word");if(k&&rl.has(k.name))b=c.getSeverity(x,"conditional");else if(u)b=c.getSeverity(x,"closing"),f.suggestions=[U(f)];else{b=c.getSeverity(x,"opening");const $=d==null?void 0:d.childNodes;ll.has(o)&&($!=null&&$.slice(0,$.indexOf(this)).some(T=>T.type==="html"&&T.name===o&&!T.findMatchingTag())&&(f.suggestions=[We(i+1,"/")]),this.closest("heading-title")&&(f.rule="format-leakage",b=c.getSeverity("format-leakage",o)))}b&&(f.severity=b,l.push(f))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){}},e=new WeakMap,t),$i=Y(ul),Bt=X($i,0,"HtmlToken",al,Bt),J($i,1,Bt)}}),Wo={};se(Wo,{parseHtml:()=>Mo});var dl,Mo,vu=C({"parser/html.ts"(){"use strict";mn(),xu(),dl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Mo=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const o of r){const d=dl.exec(o),u=d==null?void 0:d[2],a=u==null?void 0:u.toLowerCase();if(!d||!t.htmlElements.has(a)){n+=`<${o}`;continue}const[,h,,c="",g,p]=d,{length:v}=s,x=new _s(c,"html-attrs",a,t,s),b=x.hasAttr("itemprop");if(a==="meta"&&!(b&&x.hasAttr("content"))||a==="link"&&!(b&&x.hasAttr("href"))){n+=`<${o}`,s.length=v;continue}n+=`\0${s.length}x${p}`,new Bt(u,x,h==="/",g==="/>",t,s)}return n}}}),hl,Ti,cl,ct,zo=C({"src/table/base.ts"(){"use strict";fn(),W(),tt(),mn(),hl=[As(1)],ct=class extends(cl=E){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new Ue(t,"table-syntax",r,n),new _s(i,"table-attrs",s,r,n))}escape(){}},Ti=Y(cl),ct=X(Ti,0,"TableBaseToken",hl,ct),J(Ti,1,ct)}}),gl,Ci,_e,is,Ct,It,vs,Uo=C({"src/table/td.ts"(){"use strict";M(),de(),cn(),B(),W(),zo(),vs=class extends(Ci=ct,gl=[ys(!1)],Ci){constructor(e,t,s,i=[]){var o;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(n)&&(r=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),J(is,5,this),Oe(this,Ct),Oe(this,_e,""),r&&([Wa(this,_e)._]=r);const l=new E(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+he(this,_e).length),s,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return Ui(this,Ct,It).call(this).subtype}afterBuild(){he(this,_e).includes("\0")&&ye(this,_e,this.buildFromStr(he(this,_e),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+he(this,_e)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+he(this,_e)+s.text()}getGaps(e){return e===1?he(this,_e).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=I,{computeEditInfo:l,fix:o}=n,d=["td","double"].map(u=>n.getSeverity(r,u));for(const u of this.lastChild.childNodes)if(u.type==="text"){const{data:a}=u;if(a.includes("|")){const h=a.includes("||"),c=d[h?1:0];if(c){const g=q(u,i,r,"pipe-in-table",c);if(l||o)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix=$e(g,"newline",a.replace(/\|\|/gu,`
14
+ ${p}`))}else l&&(g.suggestions=[dn(g.startIndex,a)]);s.push(g)}}}return s}}isIndependent(){return this.firstChild.text().startsWith(`
15
+ `)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${he(this,_e)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){}},is=Y(Ci),_e=new WeakMap,Ct=new WeakSet,It=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let i="td";if(s==="!"?i="th":s==="+"&&(i="caption"),this.isIndependent())return{subtype:i};const{previousSibling:r}=this;return fe({},Ui(e=r,Ct,It).call(e))},It=X(is,17,"#getSyntax",gl,Ct,It),nn(is,vs)}}),kn,Ho=C({"src/table/trBase.ts"(){"use strict";M(),B(),zo(),Uo(),kn=class extends ct{lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=this.childNodes.find(({type:o})=>o==="table-inter");if(!i)return s;const r=zt(i),n="fostered-content",l=r&&I.lintConfig.getSeverity(n,r===2?void 0:"transclusion");if(l){const o=q(i,{start:e},n,"content-outside-table",l);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof vs&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),pl,fl,ml,xl,Ii,ns,gs,bu=C({"src/table/index.ts"(){"use strict";M(),Ce(),de(),cn(),B(),Ho(),tt(),pl=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),fl=({type:e})=>e==="tr"||e==="table-syntax",ml=class extends Array{},gs=class extends(Ii=kn,xl=[ys(!1)],Ii){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),J(ns,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),r=["unclosed-table","table-layout"],n=r.map(l=>I.lintConfig.getSeverity(l));if(n[0]&&!this.closed&&s.push(q(this.firstChild,i,r[0],"unclosed-table",n[0])),n[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let d=1,u=1/0,a=0;for(;a<o;a++){const h=l[a],c=h.length;if(c<d)break;c<u&&(u=c);const g=h.indexOf(h[c-1])+1;if(g>u)break;g>d&&(d=g)}if(a<o){const h=this.getNthRow(a),c=q(h,i,r[1],"inconsistent-table",n[1]);c.startIndex++,c.startLine++,c.startCol=0,s.push(c)}}}return s}}close(e=`
16
+ |}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");we.run(()=>{const r=new Ue(t?e:void 0,"table-syntax",s,i);super.insertAt(r)})}getLayout(e){{const t=this.getAllRows(),{length:s}=t,i=ml.from(pl(s,()=>[]));for(let r=0;r<i.length;r++){const n=i[r];let l=0,o=0,d;for(const u of t[r].childNodes.slice(2))if(u.is("td")){if(u.isIndependent()&&(d=u.subtype!=="caption"),d){const a={row:r,column:l},{rowspan:h,colspan:c}=u;for(l++;n[o];)o++;for(let g=r;g<Math.min(r+h,s);g++)for(let p=o;p<o+c;p++)i[g][p]=a;o+=c}}else if(fl(u))break}return i}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){{const i=super.getRowCount();if(e===0&&i)return this;i&&e--;for(const r of this.childNodes.slice(2)){const{type:n}=r;if(n==="tr"&&r.getRowCount()&&(e--,e<0))return r}return}}json(e,t=this.getAbsoluteIndex()){}},ns=Y(Ii),X(ns,1,"getLayout",xl,gs),nn(ns,gs)}}),Do,wu=C({"src/table/tr.ts"(){"use strict";Ho(),Do=class extends kn{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),An,Go=C({"src/nowiki/listBase.ts"(){"use strict";it(),An=class extends Te{get indent(){}json(e,t=this.getAbsoluteIndex()){}}}}),_n,Vo=C({"src/nowiki/dd.ts"(){"use strict";Go(),_n=class extends An{get type(){return"dd"}}}}),Qo={};se(Qo,{parseTable:()=>Jo});var vl,Ni,Jo,yu=C({"parser/table.ts"(){"use strict";W(),bu(),wu(),Uo(),Vo(),vl=e=>e.lastChild.constructor!==E,Ni=(e,t)=>e.is("td")?t.pop():e,Jo=({firstChild:{data:e},type:t,name:s},i,r)=>{const n=[],l=e.split(`
17
17
  `);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
18
- ${l.shift()}`,d;const u=(a,h)=>{if(!h){o+=a;return}const{lastChild:g}=h;if(ml(h)){const c=new E(a,i,r);c.type="table-inter",c.setAttribute("stage",3),h.insertAt(c)}else g.setText(g.toString()+a)};for(const a of l){d=n.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(a),g=a.slice(h.length),c=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(g);if(c){for(;d&&!d.is("td");)d=n.pop();const[,k,w,A,_]=c;k&&new An(k,i,r),u(`
19
- ${h}${k&&`\0${r.length-1}d`}${w}\0${r.length}b`,d),n.push(...d?[d]:[],new cs(A,_,i,r));continue}else if(!d){o+=`
20
- ${a}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(g);if(!p){u(`
21
- ${a}`,d),n.push(d);continue}const[,b,x,v,y]=p;if(b){for(;!d.is("table");)d=n.pop();d.close(`
22
- ${h}${b}`,!0),u(y,n[n.length-1])}else if(x){d=Ii(d,n),d.is("tr")&&(d=n.pop());const k=new Uo(`
23
- ${h}${x}`,y,i,r);n.push(d,k),d.insertAt(k)}else{d=Ii(d,n);const k=v==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let w=k.exec(y),A=0,_=`
24
- ${h}${v}`;const f=S=>{const $=new xs(_,y.slice(A,w==null?void 0:w.index),i,r);return S.insertAt($),$};for(;w;)f(d),{lastIndex:A}=k,[_]=w,w=k.exec(y);n.push(d,f(d))}}return o.slice(1)}}}),Qo,wu=C({"src/nowiki/hr.ts"(){"use strict";it(),Qo=class extends Te{get type(){return"hr"}}}}),xl,Ni,vl,jt,yu=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";et(),He(),it(),xl=[ze(),Pe("__")],jt=class extends(vl=Te){get type(){return"double-underscore"}constructor(e,t,s,i){var o,d;super(e,s,i);const r=e.toLowerCase(),{doubleUnderscore:[,,n,l]}=s;this.setAttribute("name",(d=t?(o=l==null?void 0:l[e])==null?void 0:o.toLowerCase():n==null?void 0:n[r])!=null?d:r)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Ni=Y(vl),jt=X(Ni,0,"DoubleUnderscoreToken",xl,jt),J(Ni,1,jt)}}),Jo={};se(Jo,{parseHrAndDoubleUnderscore:()=>Xo});var Xo,Su=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";wu(),yu(),uo(),Xo=({firstChild:{data:e},type:t,name:s},i,r)=>{var d,u,a;const{doubleUnderscore:[n,l,o]}=i;return(d=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(n)),(u=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l)),(a=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${[...n,...l].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(h,g,c)=>(new Qo(c,i,r),`${g}\0${r.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(h,g)=>{var x;const c=i.sensitiveDoubleUnderscore.has(g),p=g.toLowerCase(),b=i.insensitiveDoubleUnderscore.has(p);return c||b?(new jt(g,c,i,r),`\0${r.length-1}${b&&((x=o==null?void 0:o[p])!=null?x:p)==="toc"?"u":"n"}`):h}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(h,g,c,p,b)=>{const x=`${g}\0${r.length}h`;return new lt(c.length,[p,b],i,r),x})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Ko,ku=C({"src/nowiki/quote.ts"(){"use strict";var e,t;M(),de(),B(),it(),Ko=(t=class extends Te{constructor(i,r,n,l){super(i,n,l);N(this,e);L(this,e,r)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return fe(fe({},this.bold?{bold:m(this,e).bold}:void 0),this.italic?{italic:m(this,e).italic}:void 0)}text(){const{parentNode:i,innerText:r}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":r}lint(i=this.getAbsoluteIndex()){var r;{const{previousSibling:n,bold:l,closing:o}=this,d=(n==null?void 0:n.type)==="text"?n.data:void 0,u=[],a=new le(this,i),h=["lonely-apos","bold-header"],{lintConfig:g}=I,{computeEditInfo:c}=g,p=[void 0,"word"].map(x=>g.getSeverity(h[0],x)),b=g.getSeverity(h[1]);if(d!=null&&d.endsWith("'")){const x=p[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(d)?1:0];if(x){const v=G(this,a,h[0],I.msg("lonely","'"),x),{startLine:y,startCol:k}=v,[,{length:w}]=/(?:^|[^'])('+)$/u.exec(d),A=i-w,_=Le(fe({},v),{startIndex:A,endIndex:i,endLine:y,startCol:k-w,endCol:k});c&&(_.suggestions=[vt(A,"&apos;",w),z(_)]),u.push(_)}}if(b&&l&&((r=this.closest("heading-title,ext"))==null?void 0:r.type)==="heading-title"){const x=G(this,a,h[1],"bold-in-header",b);c&&(x.suggestions=[z(x)]),u.push(x)}return u}}json(i,r=this.getAbsoluteIndex()){}},e=new WeakMap,t)}}),Yo={};se(Yo,{parseQuotes:()=>_n});var _n,Zo=C({"parser/quotes.ts"(){"use strict";ku(),_n=(e,t,s,i)=>{var c;const r=e.split(/('{2,})/u),{length:n}=r;if(n===1)return e;let l=0,o=0,d,u,a;for(let p=1;p<n;p+=2){const b=r[p].length;switch(b){case 2:o++;break;case 4:r[p-1]+="'",r[p]="'''";case 3:if(l++,d!==void 0)break;r[p-1].endsWith(" ")?u===void 0&&a===void 0&&(a=p):r[p-1].slice(-2,-1)===" "?d=p:u!=null||(u=p);break;default:r[p-1]+="'".repeat(b-5),r[p]="'''''",o++,l++}}if(o%2===1&&l%2===1){const p=(c=d!=null?d:u)!=null?c:a;p!==void 0&&(r[p]="''",r[p-1]+="'")}let h=!0,g=!0;for(let p=1;p<n;p+=2){const b=r[p].length,x=b!==2,v=b!==3;x&&(h=!h),v&&(g=!g),new Ko(r[p],{bold:x&&h,italic:v&&g},t,s),r[p]=`\0${s.length-1}q`}return r.join("")}}}),ea={};se(ea,{parseExternalLinks:()=>$n});var $n,ta=C({"parser/externalLinks.ts"(){"use strict";ce(),Co(),yn(),$n=(e,t,s,i)=>{var r;return(r=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${pt}|\0\d+m\x7F)${ft}(?=[[\]<>"\t${qe}]|\0\d)))([${qe}]*(?![${qe}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,l,o,d)=>{const{length:u}=s,a=/&[lg]t;/u.exec(l);return a&&(o="",d=l.slice(a.index)+o+d,l=l.slice(0,a.index)),i?(new Dt(l,"ext-link-url",t,s),`[\0${u}f${o}${d}]`):(new ut(l,o,d,t,s),`\0${u}w`)})}}}),sa,Au=C({"src/link/category.ts"(){"use strict";ys(),sa=class extends Be{get type(){return"category"}get sortkey(){}json(e,t=this.getAbsoluteIndex()){}}}}),ia={};se(ia,{parseLinks:()=>Zi});var bl,Zi,_u=C({"parser/links.ts"(){"use strict";ce(),B(),Zo(),ta(),To(),yo(),Au(),bl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,Zi=(e,t,s,i)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const r=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])*)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,n=e.split("[[");let l=n.shift();for(let d=0;d<n.length;d++){let u=!1,a,h,g,c;const p=n[d],b=r.exec(p);if(b)[,a,h,g,c]=b,c.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",c=c.slice(1));else{const A=bl.exec(p);A&&(u=!0,[,a,h,g]=A)}if(a===void 0||t.regexLinks.test(a)||/\0\d+[exhbru]\x7F/u.test(a)){l+=`[[${p}`;continue}let x=ve(a).trim();const v=x.startsWith(":");if(v&&u){l+=`[[${p}`;continue}else!x&&g&&!g.includes(`
25
- `)&&(x=ve(g).trim());const{ns:y,valid:k}=I.normalizeTitle(x,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(k){if(u){if(y!==6){l+=`[[${p}`;continue}let A=!1;for(d++;d<n.length;d++){const _=n[d],f=_.split("]]");if(f.length>2){A=!0,g+=`[[${f[0]}]]${f[1]}`,c=f.slice(2).join("]]");break}else if(f.length===2)g+=`[[${f[0]}]]${f[1]}`;else{g+=`[[${_}`;break}}if(g=Zi(g,t,s,i),!A){l+=`[[${a}${h}${g}`;continue}}}else{l+=`[[${p}`;continue}g&&(g=_n(g,t,s,i));let w=wn;v||(y===6?(g&&(g=$n(g,t,s,!0)),w=bn):y===14&&(w=sa)),g===void 0&&h&&(g=""),l+=`\0${s.length}l${c}`,new w(a,g,t,s,h)}return l}}}),na={};se(na,{parseMagicLinks:()=>ra});var Li,Fi,Ei,Pi,ra,$u=C({"parser/magicLinks.ts"(){"use strict";ce(),yn(),Li=String.raw`[${qe}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Fi=`(?:${Li})+`,Ei=`(?:${Li}|-)`,Pi=String.raw`(?:RFC|PMID)${Fi}\d+\b|ISBN${Fi}(?:97[89]${Ei}?)?(?:\d${Ei}?){9}[\dx]\b`,ra=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${pt}${ft})|${Pi})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${pt}${ft})|${Pi})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){let o="";const d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);d&&(o=l.slice(d.index),l=l.slice(0,d.index));const u=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,a=u.exec(l);if(a){let h=1;a[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,a.index))&&(h=2),o=l.slice(a.index+h)+o,l=l.slice(0,a.index+h)}return o.length>=n.length?i:(new Dt(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Dt(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),la,Tu=C({"util/html.ts"(){"use strict";la=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),oa,Cu=C({"src/nowiki/list.ts"(){"use strict";Ho(),oa=class extends kn{get type(){return"list"}}}}),aa={};se(aa,{parseList:()=>ua});var ua,Iu=C({"parser/list.ts"(){"use strict";Tu(),Cu(),Do(),ua=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,d]=r,u=o.replace(/;/gu,":"),a=la(u,t.lastPrefix),h=((a>1?o.slice(a-1):o)+d).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(a>1){const T=o.slice(0,a-1);if(g){const F=T.split(/(?=;)/u);h.unshift(...F),c+=T.includes(";")?F.length:0}else h[0]=T+h[0]}t.lastPrefix=u;let p=l+h.map((T,F)=>`\0${i.length+F}d`).join("")+e.slice(n.length);for(const T of h)new oa(T,s,i);if(!c)return p;const{html:[b,,x]}=s,v=/:+|-\{|\0\d+[xq]\x7F/gu;let y=v,k=y.exec(p),w=0,A=!1,_=!1,f=0;const S=(T,F)=>(new An(T,s,i),`${p.slice(0,F)}\0${i.length-1}d${p.slice(F+T.length)}`),$=T=>{T?w&&w--:w++};for(;k&&c;){const{0:T,index:F}=k;if(T==="-{"){if(!f){const{lastIndex:j}=y;y=/-\{|\}-/gu,y.lastIndex=j}f++}else if(T==="}-"){if(f--,!f){const{lastIndex:j}=y;y=v,y.lastIndex=j}}else if(T.endsWith("x")){const{name:j,closing:R,selfClosing:ne}=i[Number(T.slice(1,-2))];(b.includes(j)||!ne&&!x.includes(j))&&$(R)}else if(T.endsWith("q")){const{bold:j,italic:R}=i[Number(T.slice(1,-2))];j&&($(A),A=!A),R&&($(_),_=!_)}else if(w===0){if(T.length>=c)return S(T.slice(0,c),F);c-=T.length,y.lastIndex=F+4+String(i.length).length,p=S(T,F)}k=y.exec(p)}return p}}}),ns,wl,Ri,yl,qt,Nu=C({"src/converterFlags.ts"(){"use strict";var e,t;M(),de(),Ss(),B(),W(),st(),ns=new Set(["A","T","R","D","-","H","N"]),wl=[Gt()],qt=(t=class extends(yl=E){constructor(i,r,n=[]){super(void 0,r,n,{});N(this,e);this.safeAppend(i.map(l=>new xe(l,"converter-flag",r,n)))}get type(){return"converter-flags"}afterBuild(){L(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(m(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(m(this,e).filter(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return typeof i=="object"&&(i=i.text().trim(),r=this.getVariantFlags(),n=this.getUnknownFlags(),l=new Set(m(this,e).filter(o=>ns.has(o)))),!!i&&!r.has(i)&&!n.has(i)&&(r.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),r){{const n=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(m(this,e).filter(x=>ns.has(x))),d=m(this,e).filter(x=>!x).length,u=m(this,e).length-l.size-d,{lintConfig:a}=I,{computeEditInfo:h,fix:g}=a,c=super.lint(i,r);if(n.size===u||o.size===u)return c;const p="no-ignored",b=a.getSeverity(p,"conversionFlag");if(b){const x=new le(this,i);for(let v=0;v<this.length;v++){const y=this.childNodes[v],k=y.text().trim();if(this.isInvalidFlag(k,n,l,o)){const w=q(y,x,p,"invalid-conversion-flag",b);(h||g)&&(n.size===0&&ns.has(k.toUpperCase())?w.fix=an(w,k):h&&(w.suggestions=[z(w,v&&-1)])),c.push(w)}}}return c}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Ri=Y(yl),qt=X(Ri,0,"ConverterFlagsToken",wl,qt),J(Ri,1,qt)}}),gs,Lu=C({"src/converterRule.ts"(){"use strict";B(),W(),st(),gs=class extends E{get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i);const r=e.indexOf(":"),n=e.slice(0,r).indexOf("=>"),l=n===-1?e.slice(0,r):e.slice(n+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new xe(l,"converter-rule-variant",s,i)),super.insertAt(new xe(e.slice(r+1),"converter-rule-to",s,i)),n!==-1&&super.insertAt(new xe(e.slice(0,n),"converter-rule-from",s,i),0)):super.insertAt(new xe(e,"converter-rule-to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,i]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${i.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){}}}}),Sl,Oi,kl,Wt,Fu=C({"src/converter.ts"(){"use strict";ce(),He(),Ee(),W(),Nu(),Lu(),Sl=[Ie,Pe("-{")],Wt=class extends(kl=E){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new qt(e,s,i));const[r]=t,n=r.includes(":"),l=new gs(r,n,s,i);n&&l.length===1||!n&&t.length===2&&!ve(t[1]).trim()?this.insertAt(new gs(t.join(";"),!1,s,i)):this.append(l,...t.slice(1).map(o=>new gs(o,!0,s,i)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${Ye(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){const{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${xt(t,{sep:";"})}}-</span>`}},Oi=Y(kl),Wt=X(Oi,0,"ConverterToken",Sl,Wt),J(Oi,1,Wt)}}),da={};se(da,{parseConverter:()=>ha});var ha,Eu=C({"parser/converter.ts"(){"use strict";Fu(),ha=(e,t,s)=>{var d;(d=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:u,index:a}=o;if(u==="}-"){const h=n.pop(),{length:g}=s,c=e.slice(h.index+2,a),p=c.indexOf("|"),[b,x]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],v=x.replace(/(&[#a-z\d]+);/giu,"$1"),y=v.split(t.regexConverter).map(k=>k.replace(/\x01/gu,";"));new Wt(b,y,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(a+2)}`,n.length===0&&(l=i),l.lastIndex=h.index+3+String(g).length}else n.push(o),l=r,l.lastIndex=a+2;o=l.exec(e)}return e}}}),vs={};se(vs,{Token:()=>E});var Al,E,W=C({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,ca,ga,pa,fa,ma,xa,va,ba,wa,ya,Sa,ka,w;ce(),Me(),M(),Ne(),B(),Ua(),Ha(),Al=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(w=class extends Lt{constructor(f,S=I.getConfig(),$=[],T){super();N(this,o);N(this,e,"plain");N(this,t,0);N(this,s);N(this,i);N(this,r);N(this,n,!1);N(this,l);typeof f=="string"&&this.insertAt(f),L(this,s,S),L(this,i,$),$.push(this)}get type(){return m(this,e)}set type(f){L(this,e,f)}parseOnce(f=m(this,t),S=!1,$){if(f<m(this,t)||this.length===0||!this.isPlain())return this;if(m(this,t)>=be)return this;switch(f){case 0:if(this.type==="root"){m(this,i).pop();const T=P(this,o,ca).call(this);S&&(S=!T)}L(this,r,S),P(this,o,ga).call(this,S);break;case 1:P(this,o,pa).call(this);break;case 2:P(this,o,fa).call(this);break;case 3:P(this,o,ma).call(this);break;case 4:P(this,o,xa).call(this);break;case 5:P(this,o,va).call(this,$);break;case 6:P(this,o,ba).call(this,$);break;case 7:P(this,o,wa).call(this);break;case 8:P(this,o,ya).call(this);break;case 9:P(this,o,Sa).call(this);break;case 10:P(this,o,ka).call(this)}if(this.type==="root")for(const T of m(this,i))T==null||T.parseOnce(f,S,$);return Bn(this,t)._++,this}buildFromStr(f,S){const $=f.split(/[\0\x7F]/u).map((T,F)=>{if(F%2===0)return new Vi(T);if(isNaN(T.slice(-1)))return m(this,i)[Number(T.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${T}`)});return S===0?$.map(String).join(""):S===1?Ye($):$}build(){L(this,t,be);const{length:f,firstChild:S}=this,$=S==null?void 0:S.toString();if(f===1&&S.type==="text"&&$.includes("\0")&&(Tn(this,0,1,this.buildFromStr($)),this.normalize(),this.type==="root"))for(const T of m(this,i))T==null||T.build()}afterBuild(){if(this.type==="root")for(const f of m(this,i))f==null||f.afterBuild();L(this,n,!0)}parse(f=be,S,$){for(f=Math.min(f,be);m(this,t)<f;)this.parseOnce(m(this,t),S,$);return f&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===w}getAttribute(f){var S;switch(f){case"config":return m(this,s);case"include":return(S=m(this,r))!=null?S:!!m(this.getRootNode(),r);case"accum":return m(this,i);case"built":return m(this,n);case"stage":return m(this,t);case"invalid":return this.type==="table-inter"&&Mt(this)===2;default:return super.getAttribute(f)}}setAttribute(f,S){switch(f){case"stage":m(this,t)===0&&this.type==="root"&&m(this,i).shift(),L(this,t,S);break;default:super.setAttribute(f,S)}}insertAt(f,S=this.length){const $=typeof f=="string"?new Vi(f):f;super.insertAt($,S);const{type:T}=$;return T==="root"&&($.type="plain"),$}normalizeTitle(f,S=0,$){return I.normalizeTitle(f,S,m(this,r),m(this,s),$)}inTableAttrs(){var f,S;return((f=this.closest("table-attrs,ext"))==null?void 0:f.type)==="table-attrs"&&((S=this.closest("table-attrs,arg,magic-word,template"))!=null&&S.is("table-attrs")?2:1)}inHtmlAttrs(){var f;return(f=this.closest("html-attrs,ext"))!=null&&f.is("html-attrs")?2:this.inTableAttrs()}lint(f=this.getAbsoluteIndex(),S){var $;{const{lintConfig:T}=I,{computeEditInfo:F,fix:j,ignoreDisables:R,configurationComment:ne}=T;let O=super.lint(f,S);if(this.type==="root"){const re=new Map,pe="no-duplicate",V=["category","id"].map(U=>T.getSeverity(pe,U)),D=this.toString(),K=Al.filter((U,Z)=>V[Z]).join();if(K){for(const U of this.querySelectorAll(K)){let Z;if(U.is("category"))Z=U.name;else{const H=U.getValue();H&&H!==!0&&(Z=`#${H}`)}if(Z){const H=re.get(Z);H?H.add(U):re.set(Z,new Set([U]))}}for(const[U,Z]of re)if(Z.size>1&&!U.startsWith("#mw-customcollapsible-")){const H=!U.startsWith("#"),ee=`duplicate-${H?"category":"id"}`,oe=V[H?0:1];O.push(...[...Z].map(ae=>{const te=G(ae,{start:ae.getAbsoluteIndex()},pe,ee,oe);return F&&H&&(te.suggestions=[z(te)]),te}))}}if(!R){const U=new RegExp(String.raw`<!--\s*${ne}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Z=[];let H=U.exec(D);for(;H;){const{1:ee,index:oe}=H,ae=($=H[2])==null?void 0:$.trim();Z.push({line:this.posFromIndex(oe).top+(ee==="disable-line"?0:1),from:ee==="disable"?U.lastIndex:void 0,to:ee==="enable"?U.lastIndex:void 0,rules:ae?new Set(ae.split(",").map(te=>te.trim())):void 0}),H=U.exec(D)}O=O.filter(({rule:ee,startLine:oe,startIndex:ae})=>{const te={pos:0};for(const{line:De,from:ue,to:me,rules:Ce}of Z){if(De>oe+1)break;if(Ce&&!Ce.has(ee))continue;if(De===oe&&ue===void 0&&me===void 0)return!1;ue<=ae&&ue>te.pos?(te.pos=ue,te.type="from"):me<=ae&&me>te.pos&&(te.pos=me,te.type="to")}return te.type!=="from"})}if(j&&O.some(({fix:U})=>U)){const U=O.map(({fix:ee})=>ee).filter(Boolean).sort(({range:[ee,oe]},{range:[ae,te]})=>oe===te?ae-ee:te-oe);let Z=1/0,H=D;for(const{range:[ee,oe],text:ae}of U)oe<=Z&&(H=H.slice(0,ee)+ae+H.slice(oe),Z=ee);Object.assign(O,{output:H})}if(!F)for(const U of O)delete U.fix,delete U.suggestions}return O}}toString(f,S){return f?super.toString(!0,S):Ke(m(this,l),()=>super.toString(!1,S),$=>{const T=this.getRootNode();T.type==="root"&&m(T,n)&&L(this,l,$)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakSet,ca=function(){const{parseRedirect:f}=(Va(),Q(Vl)),S=this.firstChild.toString(),$=f(S,m(this,s),m(this,i));return $&&this.setText($),!!$},ga=function(f){const{parseCommentAndExt:S}=(Ts(),Q(Bo));this.setText(S(this.firstChild.toString(),m(this,s),m(this,i),f))},pa=function(){const{parseBraces:f}=(vn(),Q(go)),S=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,$=f(S,m(this,s),m(this,i));this.setText(this.type==="root"?$:$.slice(1))},fa=function(){if(m(this,s).excludes.includes("html"))return;const{parseHtml:f}=(mu(),Q(jo));this.setText(f(this.firstChild.toString(),m(this,s),m(this,i)))},ma=function(){if(m(this,s).excludes.includes("table"))return;const{parseTable:f}=(bu(),Q(Go));this.setText(f(this,m(this,s),m(this,i)))},xa=function(){if(m(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:f}=(Su(),Q(Jo));this.setText(f(this,m(this,s),m(this,i)))},va=function(f){const{parseLinks:S}=(_u(),Q(ia));this.setText(S(this.firstChild.toString(),m(this,s),m(this,i),f))},ba=function(f){if(m(this,s).excludes.includes("quote"))return;const{parseQuotes:S}=(Zo(),Q(Yo)),$=this.firstChild.toString().split(`
26
- `);for(let T=0;T<$.length;T++)$[T]=S($[T],m(this,s),m(this,i),f);this.setText($.join(`
27
- `))},wa=function(){if(m(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:f}=(ta(),Q(ea));this.setText(f(this.firstChild.toString(),m(this,s),m(this,i)))},ya=function(){if(m(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:f}=($u(),Q(na));this.setText(f(this.firstChild.toString(),m(this,s),m(this,i)))},Sa=function(){if(m(this,s).excludes.includes("list"))return;const{parseList:f}=(Iu(),Q(aa)),{firstChild:S,type:$,name:T}=this,F=S.toString().split(`
18
+ ${l.shift()}`,d;const u=(a,h)=>{if(!h){o+=a;return}const{lastChild:c}=h;if(vl(h)){const g=new E(a,i,r);g.type="table-inter",g.setAttribute("stage",3),h.insertAt(g)}else c.setText(c.toString()+a)};for(const a of l){d=n.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(a),c=a.slice(h.length),g=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(c);if(g){for(;d&&!d.is("td");)d=n.pop();const[,S,w,A,_]=g;S&&new _n(S,i,r),u(`
19
+ ${h}${S&&`\0${r.length-1}d`}${w}\0${r.length}b`,d),n.push(...d?[d]:[],new gs(A,_,i,r));continue}else if(!d){o+=`
20
+ ${a}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(c);if(!p){u(`
21
+ ${a}`,d),n.push(d);continue}const[,v,x,b,y]=p;if(v){for(;!d.is("table");)d=n.pop();d.close(`
22
+ ${h}${v}`,!0),u(y,n[n.length-1])}else if(x){d=Ni(d,n),d.is("tr")&&(d=n.pop());const S=new Do(`
23
+ ${h}${x}`,y,i,r);n.push(d,S),d.insertAt(S)}else{d=Ni(d,n);const S=b==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let w=S.exec(y),A=0,_=`
24
+ ${h}${b}`;const f=k=>{const $=new vs(_,y.slice(A,w==null?void 0:w.index),i,r);return k.insertAt($),$};for(;w;)f(d),{lastIndex:A}=S,[_]=w,w=S.exec(y);n.push(d,f(d))}}return o.slice(1)}}}),jt,Su=C({"../cm-util/dist/index.mjs"(){"use strict";jt=e=>!/^_{2}.+_{2}$/u.test(e)}}),Xo,ku=C({"src/nowiki/hr.ts"(){"use strict";it(),Xo=class extends Te{get type(){return"hr"}}}}),bl,Li,wl,qt,Au=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;et(),He(),it(),bl=[ze(),Pe("__")],qt=(t=class extends(wl=Te){constructor(i,r,n,l,o){var h,c;super(i,l,o);N(this,e);const d=i.toLowerCase(),{doubleUnderscore:[,,u,a]}=l;this.setAttribute("name",(c=r?(h=a==null?void 0:a[i])==null?void 0:h.toLowerCase():u==null?void 0:u[d])!=null?c:d),L(this,e,n)}get type(){return"double-underscore"}toString(){const i=m(this,e)?"__":"__";return i+this.innerText+i}print(){const i=m(this,e)?"__":"__";return super.print({pre:i,post:i})}},e=new WeakMap,t),Li=Y(wl),qt=X(Li,0,"DoubleUnderscoreToken",bl,qt),J(Li,1,qt)}}),Ko={};se(Ko,{parseHrAndDoubleUnderscore:()=>Yo});var Yo,_u=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Su(),ku(),Au(),co(),Yo=({firstChild:{data:e},type:t,name:s},i,r)=>{var u,a,h;const{doubleUnderscore:[n,l,o]}=i,d=[...n,...l];return(u=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(n.filter(jt))),(a=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l.filter(jt))),(h=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${d.filter(jt).join("|")})__|_{2}(${d.filter(c=>!jt(c)).map(c=>c.slice(2,-2)).join("|")})_{2}`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(c,g,p)=>(new Xo(p,i,r),`${g}\0${r.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(c,g,p)=>{var S;const v=g!=null?g:p,x=i.sensitiveDoubleUnderscore.has(v),b=v.toLowerCase(),y=i.insensitiveDoubleUnderscore.has(b);return x||y?(new qt(v,x,!!p,i,r),`\0${r.length-1}${y&&((S=o==null?void 0:o[b])!=null?S:b)==="toc"?"u":"n"}`):c}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(c,g,p,v,x)=>{const b=`${g}\0${r.length}h`;return new lt(p.length,[v,x],i,r),b})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Zo,$u=C({"src/nowiki/quote.ts"(){"use strict";var e,t;M(),de(),B(),it(),Zo=(t=class extends Te{constructor(i,r,n,l){super(i,n,l);N(this,e);L(this,e,r)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return fe(fe({},this.bold?{bold:m(this,e).bold}:void 0),this.italic?{italic:m(this,e).italic}:void 0)}text(){const{parentNode:i,innerText:r}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":r}lint(i=this.getAbsoluteIndex()){var r;{const{previousSibling:n,bold:l,closing:o}=this,d=(n==null?void 0:n.type)==="text"?n.data:void 0,u=[],a=new le(this,i),h=["lonely-apos","bold-header"],{lintConfig:c}=I,{computeEditInfo:g}=c,p=[void 0,"word"].map(x=>c.getSeverity(h[0],x)),v=c.getSeverity(h[1]);if(d!=null&&d.endsWith("'")){const x=p[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(d)?1:0];if(x){const b=z(this,a,h[0],I.msg("lonely","'"),x),{startLine:y,startCol:S}=b,[,{length:w}]=/(?:^|[^'])('+)$/u.exec(d),A=i-w,_=Le(fe({},b),{startIndex:A,endIndex:i,endLine:y,startCol:S-w,endCol:S});g&&(_.suggestions=[vt(A,"&apos;",w),U(_)]),u.push(_)}}if(v&&l&&((r=this.closest("heading-title,ext"))==null?void 0:r.type)==="heading-title"){const x=z(this,a,h[1],"bold-in-header",v);g&&(x.suggestions=[U(x)]),u.push(x)}return u}}json(i,r=this.getAbsoluteIndex()){}},e=new WeakMap,t)}}),ea={};se(ea,{parseQuotes:()=>$n});var $n,ta=C({"parser/quotes.ts"(){"use strict";$u(),$n=(e,t,s,i)=>{var g;const r=e.split(/('{2,})/u),{length:n}=r;if(n===1)return e;let l=0,o=0,d,u,a;for(let p=1;p<n;p+=2){const v=r[p].length;switch(v){case 2:o++;break;case 4:r[p-1]+="'",r[p]="'''";case 3:if(l++,d!==void 0)break;r[p-1].endsWith(" ")?u===void 0&&a===void 0&&(a=p):r[p-1].slice(-2,-1)===" "?d=p:u!=null||(u=p);break;default:r[p-1]+="'".repeat(v-5),r[p]="'''''",o++,l++}}if(o%2===1&&l%2===1){const p=(g=d!=null?d:u)!=null?g:a;p!==void 0&&(r[p]="''",r[p-1]+="'")}let h=!0,c=!0;for(let p=1;p<n;p+=2){const v=r[p].length,x=v!==2,b=v!==3;x&&(h=!h),b&&(c=!c),new Zo(r[p],{bold:x&&h,italic:b&&c},t,s),r[p]=`\0${s.length-1}q`}return r.join("")}}}),sa={};se(sa,{parseExternalLinks:()=>Tn});var Tn,ia=C({"parser/externalLinks.ts"(){"use strict";ce(),No(),Sn(),Tn=(e,t,s,i)=>{var r;return(r=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${pt}|\0\d+m\x7F)${ft}(?=[[\]<>"\t${qe}]|\0\d)))([${qe}]*(?![${qe}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,l,o,d)=>{const{length:u}=s,a=/&[lg]t;/u.exec(l);return a&&(o="",d=l.slice(a.index)+o+d,l=l.slice(0,a.index)),i?(new Gt(l,"ext-link-url",t,s),`[\0${u}f${o}${d}]`):(new ut(l,o,d,t,s),`\0${u}w`)})}}}),na,Tu=C({"src/link/category.ts"(){"use strict";Ss(),na=class extends Be{get type(){return"category"}get sortkey(){}json(e,t=this.getAbsoluteIndex()){}}}}),ra={};se(ra,{parseLinks:()=>en});var yl,en,Cu=C({"parser/links.ts"(){"use strict";ce(),B(),ta(),ia(),Io(),ko(),Tu(),yl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,en=(e,t,s,i)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const r=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])*)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,n=e.split("[[");let l=n.shift();for(let d=0;d<n.length;d++){let u=!1,a,h,c,g;const p=n[d],v=r.exec(p);if(v)[,a,h,c,g]=v,g.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",g=g.slice(1));else{const A=yl.exec(p);A&&(u=!0,[,a,h,c]=A)}if(a===void 0||t.regexLinks.test(a)||/\0\d+[exhbru]\x7F/u.test(a)){l+=`[[${p}`;continue}let x=ve(a).trim();const b=x.startsWith(":");if(b&&u){l+=`[[${p}`;continue}else!x&&c&&!c.includes(`
25
+ `)&&(x=ve(c).trim());const{ns:y,valid:S}=I.normalizeTitle(x,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(S){if(u){if(y!==6){l+=`[[${p}`;continue}let A=!1;for(d++;d<n.length;d++){const _=n[d],f=_.split("]]");if(f.length>2){A=!0,c+=`[[${f[0]}]]${f[1]}`,g=f.slice(2).join("]]");break}else if(f.length===2)c+=`[[${f[0]}]]${f[1]}`;else{c+=`[[${_}`;break}}if(c=en(c,t,s,i),!A){l+=`[[${a}${h}${c}`;continue}}}else{l+=`[[${p}`;continue}c&&(c=$n(c,t,s,i));let w=yn;b||(y===6?(c&&(c=Tn(c,t,s,!0)),w=wn):y===14&&(w=na)),c===void 0&&h&&(c=""),l+=`\0${s.length}l${g}`,new w(a,c,t,s,h)}return l}}}),la={};se(la,{parseMagicLinks:()=>oa});var Fi,Ei,Pi,Ri,oa,Iu=C({"parser/magicLinks.ts"(){"use strict";ce(),Sn(),Fi=String.raw`[${qe}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Ei=`(?:${Fi})+`,Pi=`(?:${Fi}|-)`,Ri=String.raw`(?:RFC|PMID)${Ei}\d+\b|ISBN${Ei}(?:97[89]${Pi}?)?(?:\d${Pi}?){9}[\dx]\b`,oa=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${pt}${ft})|${Ri})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${pt}${ft})|${Ri})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){let o="";const d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);d&&(o=l.slice(d.index),l=l.slice(0,d.index));const u=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,a=u.exec(l);if(a){let h=1;a[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,a.index))&&(h=2),o=l.slice(a.index+h)+o,l=l.slice(0,a.index+h)}return o.length>=n.length?i:(new Gt(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Gt(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),aa,Nu=C({"util/html.ts"(){"use strict";aa=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),ua,Lu=C({"src/nowiki/list.ts"(){"use strict";Go(),ua=class extends An{get type(){return"list"}}}}),da={};se(da,{parseList:()=>ha});var ha,Fu=C({"parser/list.ts"(){"use strict";Nu(),Lu(),Vo(),ha=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,d]=r,u=o.replace(/;/gu,":"),a=aa(u,t.lastPrefix),h=((a>1?o.slice(a-1):o)+d).split(/(?=;)/u),c=h[0].startsWith(";");let g=h.length-(c?0:1);if(a>1){const T=o.slice(0,a-1);if(c){const F=T.split(/(?=;)/u);h.unshift(...F),g+=T.includes(";")?F.length:0}else h[0]=T+h[0]}t.lastPrefix=u;let p=l+h.map((T,F)=>`\0${i.length+F}d`).join("")+e.slice(n.length);for(const T of h)new ua(T,s,i);if(!g)return p;const{html:[v,,x]}=s,b=/:+|-\{|\0\d+[xq]\x7F/gu;let y=b,S=y.exec(p),w=0,A=!1,_=!1,f=0;const k=(T,F)=>(new _n(T,s,i),`${p.slice(0,F)}\0${i.length-1}d${p.slice(F+T.length)}`),$=T=>{T?w&&w--:w++};for(;S&&g;){const{0:T,index:F}=S;if(T==="-{"){if(!f){const{lastIndex:j}=y;y=/-\{|\}-/gu,y.lastIndex=j}f++}else if(T==="}-"){if(f--,!f){const{lastIndex:j}=y;y=b,y.lastIndex=j}}else if(T.endsWith("x")){const{name:j,closing:R,selfClosing:ne}=i[Number(T.slice(1,-2))];(v.includes(j)||!ne&&!x.includes(j))&&$(R)}else if(T.endsWith("q")){const{bold:j,italic:R}=i[Number(T.slice(1,-2))];j&&($(A),A=!A),R&&($(_),_=!_)}else if(w===0){if(T.length>=g)return k(T.slice(0,g),F);g-=T.length,y.lastIndex=F+4+String(i.length).length,p=k(T,F)}S=y.exec(p)}return p}}}),rs,Sl,Oi,kl,Wt,Eu=C({"src/converterFlags.ts"(){"use strict";var e,t;M(),de(),ks(),B(),W(),st(),rs=new Set(["A","T","R","D","-","H","N"]),Sl=[Vt()],Wt=(t=class extends(kl=E){constructor(i,r,n=[]){super(void 0,r,n,{});N(this,e);this.safeAppend(i.map(l=>new xe(l,"converter-flag",r,n)))}get type(){return"converter-flags"}afterBuild(){L(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(m(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(m(this,e).filter(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return typeof i=="object"&&(i=i.text().trim(),r=this.getVariantFlags(),n=this.getUnknownFlags(),l=new Set(m(this,e).filter(o=>rs.has(o)))),!!i&&!r.has(i)&&!n.has(i)&&(r.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),r){{const n=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(m(this,e).filter(x=>rs.has(x))),d=m(this,e).filter(x=>!x).length,u=m(this,e).length-l.size-d,{lintConfig:a}=I,{computeEditInfo:h,fix:c}=a,g=super.lint(i,r);if(n.size===u||o.size===u)return g;const p="no-ignored",v=a.getSeverity(p,"conversionFlag");if(v){const x=new le(this,i);for(let b=0;b<this.length;b++){const y=this.childNodes[b],S=y.text().trim();if(this.isInvalidFlag(S,n,l,o)){const w=q(y,x,p,"invalid-conversion-flag",v);(h||c)&&(n.size===0&&rs.has(S.toUpperCase())?w.fix=un(w,S):h&&(w.suggestions=[U(w,b&&-1)])),g.push(w)}}}return g}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Oi=Y(kl),Wt=X(Oi,0,"ConverterFlagsToken",Sl,Wt),J(Oi,1,Wt)}}),ps,Pu=C({"src/converterRule.ts"(){"use strict";B(),W(),st(),ps=class extends E{get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i);const r=e.indexOf(":"),n=e.slice(0,r).indexOf("=>"),l=n===-1?e.slice(0,r):e.slice(n+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new xe(l,"converter-rule-variant",s,i)),super.insertAt(new xe(e.slice(r+1),"converter-rule-to",s,i)),n!==-1&&super.insertAt(new xe(e.slice(0,n),"converter-rule-from",s,i),0)):super.insertAt(new xe(e,"converter-rule-to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,i]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${i.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){}}}}),Al,Bi,_l,Mt,Ru=C({"src/converter.ts"(){"use strict";ce(),He(),Ee(),W(),Eu(),Pu(),Al=[Ne,Pe("-{")],Mt=class extends(_l=E){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Wt(e,s,i));const[r]=t,n=r.includes(":"),l=new ps(r,n,s,i);n&&l.length===1||!n&&t.length===2&&!ve(t[1]).trim()?this.insertAt(new ps(t.join(";"),!1,s,i)):this.append(l,...t.slice(1).map(o=>new ps(o,!0,s,i)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${Ye(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){const{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${xt(t,{sep:";"})}}-</span>`}},Bi=Y(_l),Mt=X(Bi,0,"ConverterToken",Al,Mt),J(Bi,1,Mt)}}),ca={};se(ca,{parseConverter:()=>ga});var ga,Ou=C({"parser/converter.ts"(){"use strict";Ru(),ga=(e,t,s)=>{var d;(d=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:u,index:a}=o;if(u==="}-"){const h=n.pop(),{length:c}=s,g=e.slice(h.index+2,a),p=g.indexOf("|"),[v,x]=p===-1?[[],g]:[g.slice(0,p).split(";"),g.slice(p+1)],b=x.replace(/(&[#a-z\d]+);/giu,"$1"),y=b.split(t.regexConverter).map(S=>S.replace(/\x01/gu,";"));new Mt(v,y,t,s),e=`${e.slice(0,h.index)}\0${c}v${e.slice(a+2)}`,n.length===0&&(l=i),l.lastIndex=h.index+3+String(c).length}else n.push(o),l=r,l.lastIndex=a+2;o=l.exec(e)}return e}}}),bs={};se(bs,{Token:()=>E});var $l,E,W=C({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,pa,fa,ma,xa,va,ba,wa,ya,Sa,ka,Aa,_a,w;ce(),Me(),M(),Ce(),B(),Da(),Ga(),$l=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(w=class extends Lt{constructor(f,k=I.getConfig(),$=[],T){super();N(this,o);N(this,e,"plain");N(this,t,0);N(this,s);N(this,i);N(this,r);N(this,n,!1);N(this,l);typeof f=="string"&&this.insertAt(f),L(this,s,k),L(this,i,$),$.push(this)}get type(){return m(this,e)}set type(f){L(this,e,f)}parseOnce(f=m(this,t),k=!1,$){if(f<m(this,t)||this.length===0||!this.isPlain())return this;if(m(this,t)>=be)return this;switch(f){case 0:if(this.type==="root"){m(this,i).pop();const T=P(this,o,pa).call(this);k&&(k=!T)}L(this,r,k),P(this,o,fa).call(this,k);break;case 1:P(this,o,ma).call(this);break;case 2:P(this,o,xa).call(this);break;case 3:P(this,o,va).call(this);break;case 4:P(this,o,ba).call(this);break;case 5:P(this,o,wa).call(this,$);break;case 6:P(this,o,ya).call(this,$);break;case 7:P(this,o,Sa).call(this);break;case 8:P(this,o,ka).call(this);break;case 9:P(this,o,Aa).call(this);break;case 10:P(this,o,_a).call(this)}if(this.type==="root")for(const T of m(this,i))T==null||T.parseOnce(f,k,$);return jn(this,t)._++,this}buildFromStr(f,k){const $=f.split(/[\0\x7F]/u).map((T,F)=>{if(F%2===0)return new Qi(T);if(isNaN(T.slice(-1)))return m(this,i)[Number(T.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${T}`)});return k===0?$.map(String).join(""):k===1?Ye($):$}build(){L(this,t,be);const{length:f,firstChild:k}=this,$=k==null?void 0:k.toString();if(f===1&&k.type==="text"&&$.includes("\0")&&(Cn(this,0,1,this.buildFromStr($)),this.normalize(),this.type==="root"))for(const T of m(this,i))T==null||T.build()}afterBuild(){if(this.type==="root")for(const f of m(this,i))f==null||f.afterBuild();L(this,n,!0)}parse(f=be,k,$){for(f=Math.min(f,be);m(this,t)<f;)this.parseOnce(m(this,t),k,$);return f&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===w}getAttribute(f){var k;switch(f){case"config":return m(this,s);case"include":return(k=m(this,r))!=null?k:!!m(this.getRootNode(),r);case"accum":return m(this,i);case"built":return m(this,n);case"stage":return m(this,t);case"invalid":return this.type==="table-inter"&&zt(this)===2;default:return super.getAttribute(f)}}setAttribute(f,k){switch(f){case"stage":m(this,t)===0&&this.type==="root"&&m(this,i).shift(),L(this,t,k);break;default:super.setAttribute(f,k)}}insertAt(f,k=this.length){const $=typeof f=="string"?new Qi(f):f;super.insertAt($,k);const{type:T}=$;return T==="root"&&($.type="plain"),$}normalizeTitle(f,k=0,$){return I.normalizeTitle(f,k,m(this,r),m(this,s),$)}inTableAttrs(){var f,k;return((f=this.closest("table-attrs,ext"))==null?void 0:f.type)==="table-attrs"&&((k=this.closest("table-attrs,arg,magic-word,template"))!=null&&k.is("table-attrs")?2:1)}inHtmlAttrs(){var f;return(f=this.closest("html-attrs,ext"))!=null&&f.is("html-attrs")?2:this.inTableAttrs()}lint(f=this.getAbsoluteIndex(),k){var $;{const{lintConfig:T}=I,{computeEditInfo:F,fix:j,ignoreDisables:R,configurationComment:ne}=T;let O=super.lint(f,k);if(this.type==="root"){const re=new Map,pe="no-duplicate",V=["category","id"].map(H=>T.getSeverity(pe,H)),G=this.toString(),K=$l.filter((H,Z)=>V[Z]).join();if(K){for(const H of this.querySelectorAll(K)){let Z;if(H.is("category"))Z=H.name;else{const D=H.getValue();D&&D!==!0&&(Z=`#${D}`)}if(Z){const D=re.get(Z);D?D.add(H):re.set(Z,new Set([H]))}}for(const[H,Z]of re)if(Z.size>1&&!H.startsWith("#mw-customcollapsible-")){const D=!H.startsWith("#"),ee=`duplicate-${D?"category":"id"}`,oe=V[D?0:1];O.push(...[...Z].map(ae=>{const te=z(ae,{start:ae.getAbsoluteIndex()},pe,ee,oe);return F&&D&&(te.suggestions=[U(te)]),te}))}}if(!R){const H=new RegExp(String.raw`<!--\s*${ne}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Z=[];let D=H.exec(G);for(;D;){const{1:ee,index:oe}=D,ae=($=D[2])==null?void 0:$.trim();Z.push({line:this.posFromIndex(oe).top+(ee==="disable-line"?0:1),from:ee==="disable"?H.lastIndex:void 0,to:ee==="enable"?H.lastIndex:void 0,rules:ae?new Set(ae.split(",").map(te=>te.trim())):void 0}),D=H.exec(G)}O=O.filter(({rule:ee,startLine:oe,startIndex:ae})=>{const te={pos:0};for(const{line:De,from:ue,to:me,rules:Ie}of Z){if(De>oe+1)break;if(Ie&&!Ie.has(ee))continue;if(De===oe&&ue===void 0&&me===void 0)return!1;ue<=ae&&ue>te.pos?(te.pos=ue,te.type="from"):me<=ae&&me>te.pos&&(te.pos=me,te.type="to")}return te.type!=="from"})}if(j&&O.some(({fix:H})=>H)){const H=O.map(({fix:ee})=>ee).filter(Boolean).sort(({range:[ee,oe]},{range:[ae,te]})=>oe===te?ae-ee:te-oe);let Z=1/0,D=G;for(const{range:[ee,oe],text:ae}of H)oe<=Z&&(D=D.slice(0,ee)+ae+D.slice(oe),Z=ee);Object.assign(O,{output:D})}if(!F)for(const H of O)delete H.fix,delete H.suggestions}return O}}toString(f,k){return f?super.toString(!0,k):Ke(m(this,l),()=>super.toString(!1,k),$=>{const T=this.getRootNode();T.type==="root"&&m(T,n)&&L(this,l,$)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakSet,pa=function(){const{parseRedirect:f}=(Ja(),Q(Jl)),k=this.firstChild.toString(),$=f(k,m(this,s),m(this,i));return $&&this.setText($),!!$},fa=function(f){const{parseCommentAndExt:k}=(Cs(),Q(qo));this.setText(k(this.firstChild.toString(),m(this,s),m(this,i),f))},ma=function(){const{parseBraces:f}=(bn(),Q(fo)),k=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,$=f(k,m(this,s),m(this,i));this.setText(this.type==="root"?$:$.slice(1))},xa=function(){if(m(this,s).excludes.includes("html"))return;const{parseHtml:f}=(vu(),Q(Wo));this.setText(f(this.firstChild.toString(),m(this,s),m(this,i)))},va=function(){if(m(this,s).excludes.includes("table"))return;const{parseTable:f}=(yu(),Q(Qo));this.setText(f(this,m(this,s),m(this,i)))},ba=function(){if(m(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:f}=(_u(),Q(Ko));this.setText(f(this,m(this,s),m(this,i)))},wa=function(f){const{parseLinks:k}=(Cu(),Q(ra));this.setText(k(this.firstChild.toString(),m(this,s),m(this,i),f))},ya=function(f){if(m(this,s).excludes.includes("quote"))return;const{parseQuotes:k}=(ta(),Q(ea)),$=this.firstChild.toString().split(`
26
+ `);for(let T=0;T<$.length;T++)$[T]=k($[T],m(this,s),m(this,i),f);this.setText($.join(`
27
+ `))},Sa=function(){if(m(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:f}=(ia(),Q(sa));this.setText(f(this.firstChild.toString(),m(this,s),m(this,i)))},ka=function(){if(m(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:f}=(Iu(),Q(la));this.setText(f(this.firstChild.toString(),m(this,s),m(this,i)))},Aa=function(){if(m(this,s).excludes.includes("list"))return;const{parseList:f}=(Fu(),Q(da)),{firstChild:k,type:$,name:T}=this,F=k.toString().split(`
28
28
  `),j={lastPrefix:""};let R=$==="root"||$==="ext-inner"&&T==="poem"?0:1;for(;R<F.length;R++)F[R]=f(F[R],j,m(this,s),m(this,i));this.setText(F.join(`
29
- `))},ka=function(){if(m(this,s).variants.length>0){const{parseConverter:f}=(Eu(),Q(da));this.setText(f(this.firstChild.toString(),m(this,s),m(this,i)))}},w)}}),ke,Cs,Tn,Ne=C({"util/debug.ts"(){"use strict";ke={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(W(),Q(vs)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Cs=e=>t=>t.type===e,Tn=(e,t,s,i=[])=>{var l,o;let r=e.getChildNodes(),n;r.length===s?(n=r,r=i):n=r.splice(t,s,...i);for(let d=0;d<i.length;d++){const u=i[d];u.setAttribute("parentNode",e),u.setAttribute("nextSibling",r[t+d+1]),u.setAttribute("previousSibling",r[t+d-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(o=r[t+i.length])==null||o.setAttribute("previousSibling",r[t+i.length-1]),r===i&&e.setAttribute("childNodes",r),n}}}),rt,Bi,rs,ji,_l,qi,$l,en,Pu=C({"lib/lintConfig.ts"(){"use strict";var e,t;Rl(),rt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),Bi={"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Bi),rs={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(rs),ji=s=>rt.has(s),_l=s=>ji(s)||Array.isArray(s)&&ji(s[0])&&(s.length===1||typeof s[1]=="object"),qi=(s,i,r)=>{if(ps.includes(i)){if(r===void 0)return!1;if(_l(r))return s[i]=r,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(r)}`)},$l=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(Bi))),!!s)for(const[i,r]of Object.entries(s))qi(this,i,r)}getSeverity(s,i){var n,l;const r=this[s];return typeof r!="object"?rt.get(r):i&&(l=rt.get((n=r[1])==null?void 0:n[i]))!=null?l:rt.get(r[0])}},en=(t=class{constructor(s){N(this,e);if(Object.assign(this,rs),s&&!("rules"in s)&&Object.keys(s).some(r=>ps.includes(r)))this.rules=s;else{const i=s!=null?s:{},{rules:r}=i,n=On(i,["rules"]);this.rules=r;for(const[l,o]of Object.entries(n))o!==void 0&&Object.prototype.hasOwnProperty.call(rs,l)&&(this[l]=o)}}get rules(){return m(this,e)}set rules(s){L(this,e,new Proxy(new $l(s),{set:qi,deleteProperty(){return!1}}))}getSeverity(s,i){return m(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),Aa={};se(Aa,{Title:()=>_a});var _a,Ru=C({"lib/title.ts"(){"use strict";var e,t,s,i,r,n;Ze(),ce(),_a=(n=class{constructor(l,o,d,{temporary:u,decode:a,selfLink:h}={}){N(this,e);N(this,t);N(this,s);N(this,i);N(this,r);Fe(this,"valid");Fe(this,"encoded",!1);const g=l.trim().startsWith("../");if(a&&l.includes("%"))try{const p=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(l);l=Ut(l),this.encoded=p}catch(p){}if(l=fs(l).replace(/[_ ]+/gu," ").trim(),g)L(this,i,0);else{let p=o;l.startsWith(":")&&(p=0,l=l.slice(1).trim());const b=l.split(":");if(b.length>1){const x=mt(b[0]),v=Object.prototype.hasOwnProperty.call(d.nsid,x)&&d.nsid[x];v&&(p=v,l=b.slice(1).join(":").trim())}L(this,i,p)}const c=l.indexOf("#");if(c!==-1){let p=l.slice(c).trim().slice(1);if(p.includes("%"))try{p=Ut(p)}catch(b){}L(this,r,p.replace(/ /gu,"_")),l=l.slice(0,c).trim()}this.valid=!!(l||h&&this.ns===0&&m(this,r)!==void 0)&&fs(l)===l&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(g?/^(?:\.\.\/)+(.*)/u.exec(l)[1]:l),this.main=l,L(this,t,d.namespaces),L(this,s,d.articlePath||"/wiki/$1"),m(this,s).includes("$1")||L(this,s,m(this,s)+`${m(this,s).endsWith("/")?"":"/"}$1`),u||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return m(this,i)}get fragment(){return m(this,r)}get main(){return m(this,e)}set main(l){l=l.replace(/_/gu," ").trim(),L(this,e,l&&l[0].toUpperCase()+l.slice(1))}get prefix(){const l=m(this,t)[this.ns];return l+(l&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:l}=this,o=l.lastIndexOf(".");return o===-1?void 0:l.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(l){L(this,r,l)}getUrl(l){throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n)}}),$a={};se($a,{default:()=>I});Ta.exports=Q($a);var ls,Wi,Tl,Re,Mi,Cl,I,B=C({"index.ts"(){Rl(),Ne(),Me(),ce(),Pu(),ls=!0,Wi=new en,Re={config:Ui,get rules(){return ps},get i18n(){return fe(fe({},jl),Tl)},set i18n(e){Tl=e},get lintConfig(){return Wi},set lintConfig(e){Wi=new en(e)},get viewOnly(){return ls},set viewOnly(e){ls&&!e&&ke.rev++,ls=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:r,variable:n}=t;for(let l=0;l<2;l++)s.length>l+2&&s[l].length===0&&(s[l]=Object.keys(s[l+2]));return i.includes("translate")&&!n.includes("translationlanguage")&&(n.push("translationlanguage"),Array.isArray(r[1])?r[1].push("TRANSLATIONLANGUAGE"):r[1].TRANSLATIONLANGUAGE="translationlanguage"),Le(fe(fe({},Ui),t),{excludes:[]})},msg(e,t=""){var s;return e&&((s=this.i18n[e])!=null?s:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,i=Re.getConfig(),r){const{Title:n}=(Ru(),Q(Aa));let l;if(r!=null&&r.halfParsed)l=new n(e,t,i,r);else{const{Token:o}=(W(),Q(vs));l=ke.run(()=>{const d=new o(e,i);d.type="root",d.parseOnce(0,s).parseOnce();const u=new n(d.toString(),t,i,r);d.build();for(const a of["main","fragment"]){const h=u[a];if(h!=null&&h.includes("\0")){const g=d.buildFromStr(h,1);a==="main"?u.main=g:u.setFragment(g)}}return u})}return l},parse(e,t,s=be,i=Re.getConfig()){e=Ol(e);let r;typeof s!="number"&&(r=Array.isArray(s)?s:[s],s=Math.max(...r.map(o=>Pl[o]||be)));const{Token:n}=(W(),Q(vs));return ke.run(()=>{const o=new n(e,i);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,i=Re.getConfig()){},createLanguageService(e={}){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},Mi={},Cl=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in Re)Cl.has(e)||(Mi[e]={enumerable:!1});Object.defineProperties(Re,Mi),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Re}),I=Re}});B()});Ou();})();
29
+ `))},_a=function(){if(m(this,s).variants.length>0){const{parseConverter:f}=(Ou(),Q(ca));this.setText(f(this.firstChild.toString(),m(this,s),m(this,i)))}},w)}}),we,Is,Cn,Ce=C({"util/debug.ts"(){"use strict";we={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(W(),Q(bs)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Is=e=>t=>t.type===e,Cn=(e,t,s,i=[])=>{var l,o;let r=e.getChildNodes(),n;r.length===s?(n=r,r=i):n=r.splice(t,s,...i);for(let d=0;d<i.length;d++){const u=i[d];u.setAttribute("parentNode",e),u.setAttribute("nextSibling",r[t+d+1]),u.setAttribute("previousSibling",r[t+d-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(o=r[t+i.length])==null||o.setAttribute("previousSibling",r[t+i.length-1]),r===i&&e.setAttribute("childNodes",r),n}}}),rt,ji,ls,qi,Tl,Wi,Cl,tn,Bu=C({"lib/lintConfig.ts"(){"use strict";var e,t;Bl(),rt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),ji={"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"invalid-url":1,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(ji),ls={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(ls),qi=s=>rt.has(s),Tl=s=>qi(s)||Array.isArray(s)&&qi(s[0])&&(s.length===1||typeof s[1]=="object"),Wi=(s,i,r)=>{if(fs.includes(i)){if(r===void 0)return!1;if(Tl(r))return s[i]=r,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(r)}`)},Cl=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(ji))),!!s)for(const[i,r]of Object.entries(s))Wi(this,i,r)}getSeverity(s,i){var n,l;const r=this[s];return typeof r!="object"?rt.get(r):i&&(l=rt.get((n=r[1])==null?void 0:n[i]))!=null?l:rt.get(r[0])}},tn=(t=class{constructor(s){N(this,e);if(Object.assign(this,ls),s&&!("rules"in s)&&Object.keys(s).some(r=>fs.includes(r)))this.rules=s;else{const i=s!=null?s:{},{rules:r}=i,n=Bn(i,["rules"]);this.rules=r;for(const[l,o]of Object.entries(n))o!==void 0&&Object.prototype.hasOwnProperty.call(ls,l)&&(this[l]=o)}}get rules(){return m(this,e)}set rules(s){L(this,e,new Proxy(new Cl(s),{set:Wi,deleteProperty(){return!1}}))}getSeverity(s,i){return m(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),$a={};se($a,{Title:()=>Ta});var Ta,ju=C({"lib/title.ts"(){"use strict";var e,t,s,i,r,n;Ze(),ce(),Ta=(n=class{constructor(l,o,d,{temporary:u,decode:a,selfLink:h}={}){N(this,e);N(this,t);N(this,s);N(this,i);N(this,r);Fe(this,"valid");Fe(this,"encoded",!1);const c=l.trim().startsWith("../");if(a&&l.includes("%"))try{const p=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(l);l=Ht(l),this.encoded=p}catch(p){}if(l=ms(l).replace(/[_ ]+/gu," ").trim(),c)L(this,i,0);else{let p=o;l.startsWith(":")&&(p=0,l=l.slice(1).trim());const v=l.split(":");if(v.length>1){const x=mt(v[0]),b=Object.prototype.hasOwnProperty.call(d.nsid,x)&&d.nsid[x];b&&(p=b,l=v.slice(1).join(":").trim())}L(this,i,p)}const g=l.indexOf("#");if(g!==-1){let p=l.slice(g).trim().slice(1);if(p.includes("%"))try{p=Ht(p)}catch(v){}L(this,r,p.replace(/ /gu,"_")),l=l.slice(0,g).trim()}this.valid=!!(l||h&&this.ns===0&&m(this,r)!==void 0)&&ms(l)===l&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(c?/^(?:\.\.\/)+(.*)/u.exec(l)[1]:l),this.main=l,L(this,t,d.namespaces),L(this,s,d.articlePath||"/wiki/$1"),m(this,s).includes("$1")||L(this,s,m(this,s)+`${m(this,s).endsWith("/")?"":"/"}$1`),u||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return m(this,i)}get fragment(){return m(this,r)}get main(){return m(this,e)}set main(l){l=l.replace(/_/gu," ").trim(),L(this,e,l&&l[0].toUpperCase()+l.slice(1))}get prefix(){const l=m(this,t)[this.ns];return l+(l&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:l}=this,o=l.lastIndexOf(".");return o===-1?void 0:l.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(l){L(this,r,l)}getUrl(l){throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n)}}),Ca={};se(Ca,{default:()=>I});Ia.exports=Q(Ca);var os,Mi,Il,Re,zi,Nl,I,B=C({"index.ts"(){Bl(),Ce(),Me(),ce(),Bu(),os=!0,Mi=new tn,Re={config:Hi,get rules(){return fs},get i18n(){return fe(fe({},Wl),Il)},set i18n(e){Il=e},get lintConfig(){return Mi},set lintConfig(e){Mi=new tn(e)},get viewOnly(){return os},set viewOnly(e){os&&!e&&we.rev++,os=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:r,variable:n}=t;for(let l=0;l<2;l++)s.length>l+2&&s[l].length===0&&(s[l]=Object.keys(s[l+2]));return i.includes("translate")&&!n.includes("translationlanguage")&&(n.push("translationlanguage"),Array.isArray(r[1])?r[1].push("TRANSLATIONLANGUAGE"):r[1].TRANSLATIONLANGUAGE="translationlanguage"),Le(fe(fe({},Hi),t),{excludes:[]})},msg(e,t=""){var s;return e&&((s=this.i18n[e])!=null?s:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,i=Re.getConfig(),r){const{Title:n}=(ju(),Q($a));let l;if(r!=null&&r.halfParsed)l=new n(e,t,i,r);else{const{Token:o}=(W(),Q(bs));l=we.run(()=>{const d=new o(e,i);d.type="root",d.parseOnce(0,s).parseOnce();const u=new n(d.toString(),t,i,r);d.build();for(const a of["main","fragment"]){const h=u[a];if(h!=null&&h.includes("\0")){const c=d.buildFromStr(h,1);a==="main"?u.main=c:u.setFragment(c)}}return u})}return l},parse(e,t,s=be,i=Re.getConfig()){e=jl(e);let r;typeof s!="number"&&(r=Array.isArray(s)?s:[s],s=Math.max(...r.map(o=>Ol[o]||be)));const{Token:n}=(W(),Q(bs));return we.run(()=>{const o=new n(e,i);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,i=Re.getConfig()){},createLanguageService(e={}){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},zi={},Nl=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in Re)Nl.has(e)||(zi[e]={enumerable:!1});Object.defineProperties(Re,zi),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Re}),I=Re}});B()});qu();})();