wikiparser-node 1.26.0 → 1.27.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 _a=Object.defineProperty,$a=Object.defineProperties;var Ta=Object.getOwnPropertyDescriptors;var Jt=Object.getOwnPropertySymbols;var Fn=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable;var Pn=e=>{throw TypeError(e)};var js=(e,t,s)=>t in e?_a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,me=(e,t)=>{for(var s in t||(t={}))Fn.call(t,s)&&js(e,s,t[s]);if(Jt)for(var s of Jt(t))jn.call(t,s)&&js(e,s,t[s]);return e},Le=(e,t)=>$a(e,Ta(t));var Rn=(e,t)=>{var s={};for(var i in e)Fn.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&&jn.call(e,i)&&(s[i]=e[i]);return s};var Ca=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ee=(e,t,s)=>js(e,typeof t!="symbol"?t+"":t,s),Ps=(e,t,s)=>t.has(e)||Pn("Cannot "+s);var m=(e,t,s)=>(Ps(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?Pn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(Ps(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),R=(e,t,s)=>(Ps(e,t,"access private method"),s);var On=(e,t,s,i)=>({set _(n){L(e,t,n,s)},get _(){return m(e,t,i)}});var Lu=Ca((Fu,Aa)=>{var Ia=Object.create,mt=Object.defineProperty,El=Object.getOwnPropertyDescriptor,sn=Object.getOwnPropertyNames,Na=Object.prototype.hasOwnProperty,Fl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),xt=e=>{throw TypeError(e)},jl=(e,t,s)=>t in e?mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Bn=(e,t)=>mt(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)mt(e,s,{get:t[s],enumerable:!0})},La=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of sn(t))!Na.call(e,n)&&n!==s&&mt(e,n,{get:()=>t[n],enumerable:!(i=El(t,n))||i.enumerable});return e},V=e=>La(mt({},"__esModule",{value:!0}),e),K=e=>{var t;return[,,,Ia((t=e==null?void 0:e[Fl("metadata")])!=null?t:null)]},Rl=["class","method","getter","setter","accessor","field","value","get","set"],It=e=>e!==void 0&&typeof e!="function"?xt("Function expected"):e,Ea=(e,t,s,i,n)=>({kind:Rl[e],name:t,metadata:i,addInitializer:r=>s._?xt("Already initialized"):n.push(It(r||null))}),nn=(e,t)=>jl(t,Fl("metadata"),e[3]),J=(e,t,s,i)=>{for(var n=0,r=e[t>>1],l=r&&r.length;n<l;n++)t&1?r[n].call(s):i=r[n].call(s,i);return i},X=(e,t,s,i,n,r)=>{var l,o,u,d,a,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,v=Rl[h+5],b=h>3&&(e[p-1]=[]),S=e[p]||(e[p]=[]),A=h&&(!c&&!g&&(n=n.prototype),h<5&&(h>3||!c)&&El(h<4?n:{get[s](){return he(this,r)},set[s](f){return we(this,r,f)}},s));h?c&&h<4&&Bn(r,(h>2?"set ":h>1?"get ":"")+s):Bn(n,s);for(var w=i.length-1;w>=0;w--)d=Ea(h,s,u={},e[3],S),h&&(d.static=g,d.private=c,a=d.access={has:c?f=>ja(n,f):f=>s in f},h^3&&(a.get=c?f=>(h^1?he:Ui)(f,n,h^4?r:A.get):f=>f[s]),h>2&&(a.set=c?(f,y)=>we(f,n,y,h^4?r:A.set):(f,y)=>f[s]=y)),o=(0,i[w])(h?h<4?c?r:A[v]:h>4?void 0:{get:A.get,set:A.set}:n,d),u._=1,h^4||o===void 0?It(o)&&(h>4?b.unshift(o):h?c?r=o:A[v]=o:n=o):typeof o!="object"||o===null?xt("Object expected"):(It(l=o.get)&&(A.get=l),It(l=o.set)&&(A.set=l),It(l=o.init)&&b.unshift(l));return h||nn(e,n),A&&mt(n,s,A),c?h^4?r:A:n},Fa=(e,t,s)=>jl(e,typeof t!="symbol"?t+"":t,s),rn=(e,t,s)=>t.has(e)||xt("Cannot "+s),ja=(e,t)=>Object(t)!==t?xt('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)),Re=(e,t,s)=>t.has(e)?xt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),we=(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),Pa=(e,t,s,i)=>({set _(n){we(e,t,n,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","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,n)=>ye(String(t[n]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,n)=>String(t[n])):e.replace(/\0(\d+)\x7F/gu,(i,n)=>t[n])}var Be,Rs,ht,ct,gt,st,ql,be,Xe,qn,Wn,ms,Wl,zn,Mn,Ut,pt,ge=C({"util/string.ts"(){"use strict";Be=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Rs=String.raw`[^[\]<>"\0-\x1F\x7F${Be}\uFFFD]`,ht=String.raw`(?:\[[\da-f:.]+\]|${Rs})`,ct=String.raw`(?:${Rs}|\0\d+[cn!~]\x7F)*`,gt=e=>e.trim().toLowerCase(),st=(e,t)=>s=>s.replace(e,t),ql=st(/[\0\x7F]|\r$/gmu,""),be=st(/\0\d+[cn]\x7F/gu,""),Xe=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),qn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Wn=st(/&(?:#(\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()]),ms=e=>Wn(e),Wl=st(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),zn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Mn=e=>st(e,t=>`&${zn[t]};`),Ut=Mn(/[&<>]/gu),pt=(e,t={})=>{const{pre:s="",post:i="",sep:n=""}=t;return s+e.map(r=>r.print()).join(n)+i}}}),Ra=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 in 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 id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate 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-comment":"HTML comment","html-in-table":"HTML tag in table attributes","illegal-attribute-name":"illegal attribute name","illegal-attribute-value":"illegal attribute value","illegal-module":"illegal 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":"containing invalid attribute","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":"left bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-function":"missing module function",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',quotes:null,remove:null,table:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","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 URL 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}}}),Oa=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:[]}}}),Se,zl,Hi,Ke=C({"util/constants.ts"(){"use strict";Se=11,zl=Ra(),Hi=Oa()}});function dt(e){const t=new Map,s=new WeakMap;return i=>{const n=typeof i=="string"?t:s;if(n.has(i)){const l=n.get(i);return l.lastIndex=0,l}const r=e(i);return n.set(i,r),r}}var Ht,Ml,Ye=C({"../common/dist/index.mjs"(){"use strict";Ht=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ml=dt}}),le,de=C({"lib/rect.ts"(){"use strict";var e,t,s,i,Di,r;le=(r=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 R(this,i,Di).call(this).top}get left(){return R(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)},r)}}),Un,Hn,Mt,Gi,Os,B,Q,$e,bs,U,ln,qe,on,an,un,Dt,ft,dn,Je,Ul,z=C({"util/lint.ts"(){"use strict";Ye(),Ne(),de(),W(),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},Gi=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Os=e=>(t,s,i,n,r="error")=>{const{start:l}=s,{top:o,left:u}=s instanceof le?s:new le(t,l),{offsetHeight:d,offsetWidth:a}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,o,u),{line:p,character:v}=Gi(g,c,d,a);return{rule:i,message:I.msg(n),severity:r,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:v}},B=Os((e,t,s,i)=>{const n=e.getRelativeIndex(),{top:r,left:l}=e.parentNode.posFromIndex(n);return{startIndex:t+n,startLine:s+r,startCol:r?l:i+l}}),Q=Os((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}),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"))),qe=(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:" "}),ft=(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;")}),Je=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===ke.rev))return e[1];const n=t();return(i||I.viewOnly)&&s([ke.rev,n]),n},Ul=(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,hn,Hl=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},hn=(e,t,s)=>{const i=e.split(",");return({type:n,name:r})=>i.some(l=>Dn(l.trim(),n,r))}}}),ws,cn=C({"mixin/cached.ts"(){"use strict";z(),ws=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Je(s.get(this),()=>t.apply(this,i),n=>{s.set(this,n)},e)}}}}),Dl,Ba=C({"mixin/nodeLike.ts"(){"use strict";Dl=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,Xt,wt,yt,Kt,St,kt,At,Ve,Gl=C({"lib/node.ts"(){"use strict";z(),Ne(),cn(),Ba(),W(),Vn=[Dl],Gn=[ws(!1)],Ve=class{constructor(){J(At,5,this),Fa(this,"childNodes",[]),Re(this,Xt),Re(this,wt),Re(this,yt),Re(this,Kt),Re(this,St),Re(this,kt,{})}get parentNode(){return he(this,Xt)}get nextSibling(){return he(this,wt)}get previousSibling(){return he(this,yt)}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,Xt,t),t||(we(this,wt,void 0),we(this,yt,void 0));break;case"nextSibling":we(this,wt,t);break;case"previousSibling":we(this,yt,t);break;case"aIndex":I.viewOnly&&we(this,St,[ke.rev,t]);break;default:this[e]=t}}getRootNode(){return Je(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"&&we(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(([,,n])=>e<=n);return{top:i,left:e-s[i][1]}}}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 Je(he(this,kt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let n=0;n<s;n++)I.viewOnly&&(he(this,kt)[n]=[ke.rev,i]),i+=t[n].toString().length+this.getGaps(n);return i},t=>{he(this,kt)[e]=t})}getAbsoluteIndex(){return Je(he(this,St),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{we(this,St,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!`)}},At=K(null),Xt=new WeakMap,wt=new WeakMap,yt=new WeakMap,Kt=new WeakMap,St=new WeakMap,kt=new WeakMap,X(At,1,"getLines",Gn,Ve),Ve=X(At,0,"AstNode",Vn,Ve),J(At,1,Ve)}}),Vl,qa=C({"mixin/elementLike.ts"(){"use strict";Hl(),Vl=e=>{var s,Vi;class t extends e{constructor(){super(...arguments);N(this,s)}getElementBy(l){for(const o of this.childNodes){if(o.type==="text")continue;if(l(o))return o;const u=o.getElementBy(l);if(u)return u}}querySelector(l){return this.getElementBy(R(this,s,Vi).call(this,l))}getElementsBy(l,o=[]){for(const u of this.childNodes)u.type!=="text"&&(l(u)&&o.push(u),u.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(R(this,s,Vi).call(this,l))}escape(){}}return s=new WeakSet,Vi=function(l){return hn(l,this)},t}}}),Qn,Bs,Jn,Nt,Wa=C({"lib/element.ts"(){"use strict";ge(),Ne(),Hl(),Gl(),qa(),Qn=[Vl],Nt=class extends(Jn=Ve){get length(){return this.childNodes.length}text(e){return Xe(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,n;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(n=e[s])==null||n.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:n}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||n===""&&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=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,n=e+this.getAttribute("padding");i<this.length;i++){const r=this.childNodes[i];r.setAttribute("aIndex",n);const l=r.lint(n,t);l.length>0&&s.push(...l),n+=r.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":""}">`)+pt(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){this.lspError("AstElement.json")}},Bs=K(Jn),Nt=X(Bs,0,"AstElement",Qn,Nt),J(Bs,1,Nt)}}),Yt,qs,Ws,Xn,Kn,Yn,Zn,zs,er,Qi,za=C({"lib/text.ts"(){"use strict";var e,Ql,s;ge(),z(),W(),Gl(),Yt=String.raw`[${Be}\t]*`,qs=String.raw`[^\S\n]*`,Ws=String.raw`<${qs}(?:/${qs})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Yt}\d)|isbn(?=[-::]?${Yt}(?:\d(?:${Yt}|-)){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},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"]),er=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){return/\w/u}})(),Qi=(s=class extends Ve{constructor(n){super();N(this,e);Ee(this,"data","");this.data=n}get type(){return"text"}toString(n){var r;return n&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?be(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),r){var l,o,u;{if(r===!1)return[];const{data:d,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:v}=a;if(c==="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(r!=null||(r=c==="free-ext-link"||c==="ext-link-url"||c==="ext-link-text"||c==="image-parameter"&&p==="link"||c==="attr-value"?Kn:Xn),d.search(r)===-1)return[];r.lastIndex=0;const b=[],S=h==null?void 0:h.type,A=h==null?void 0:h.name,w=g==null?void 0:g.type,f=this.getRootNode(),y=f.toString(),{ext:_,html:x,variants:k}=f.getAttribute("config"),{top:T,left:$}=f.posFromIndex(n),{lintConfig:j}=I,E=j.rules["tag-like"],P=typeof E=="number"?new Set:new Set(Object.keys(E[1]).filter(O=>O!=="invalid"&&O!=="disallowed")),ne=new Set(["onlyinclude","noinclude","includeonly",..._,...x[0],...x[1],...x[2],...P,...j.getSeverity("tag-like","disallowed")?zs:[]]);for(let O=r.exec(d);O;O=r.exec(d)){const[,re,fe]=O;let{index:G,0:D}=O;if(fe&&fe!=="]"){const{length:pe}=fe;G+=pe,D=D.slice(pe)}D=D.toLowerCase();const[Y]=D,M=Y==="r"||Y==="p"||Y==="i",Z=Y==="{",H=Y==="}",ee=Y==="[",oe=Y==="]";let{length:ae}=D;if(Y==="<"&&!ne.has(re.toLowerCase())||ee&&c==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(G+1))||h!=null&&h.is("ext")&&A==="nowiki"&&((l=h.innerText)!=null&&l.includes("]")))||M&&(!a.isPlain()||Yn.has(c)))continue;oe&&(G||ae>1)&&r.lastIndex--;let te=n+G,Ue=te+ae,ue,ve;const Ce=y[Ue],Is=y[te-1],Ns=Z||ee,Ls=Z&&Is==="-"&&k.length>0,Es=H&&Ce==="-"&&k.length>0,Cn=ee&&S==="free-ext-link"&&!d.slice(G+1).trim()||oe&&w==="free-ext-link"&&!d.slice(0,G).includes("]");if(M)ue="lonely-http",D=D.toUpperCase(),ve=j.getSeverity(ue,D);else if(Y==="<"){ue="tag-like";let pe;/^<\/?\s/u.test(D)||!/[\s/>]/u.test(Ce!=null?Ce:"")?pe="invalid":P.has(re)?pe=re:zs.has(re)&&!_.includes(re)&&(pe="disallowed"),ve=j.getSeverity(ue,pe)}else if(Ls||Es)ue="lonely-bracket",ve=j.getSeverity(ue,"converter"),Ls&&G>0?(D="-{",G--,te--,ae=2):Es&&G<d.length-1&&(D="}-",Ue++,ae=2);else if(Cn)ue="lonely-bracket",ve=j.getSeverity(ue,"extLink");else if(Ns||H||oe)if(ue="lonely-bracket",ae>1||Z&&Ce===Y||H&&Is===Y)ve=j.getSeverity(ue,"double");else{if(!ee||c!=="ext-link-text"){const pe=Zn[Y],Fs=Ns?d.slice(G+1):d.slice(0,G);if(Z&&((o=pe.exec(Fs))==null?void 0:o[0])==="}"||H&&((u=pe.exec(Fs))==null?void 0:u[0])==="{")continue;if(!Fs.includes(Y)){const En=Ns?"nextSibling":"previousSibling";let De=this[En];for(;De&&(De.type!=="text"||!pe.test(De.data));)De=De[En];if(De&&pe.exec(De.data)[0]!==Y)continue}}ve=j.getSeverity(ue,"single")}else ue="lonely-http",ve=j.getSeverity(ue);if(!ve)continue;const In=this.posFromIndex(G),{line:Nn,character:Ln}=Gi(T,$,In.top+1,In.left),He={rule:ue,message:I.msg("lonely",M||Y==="h"||Ls||Es?D:Y),severity:ve,startIndex:te,endIndex:Ue,startLine:Nn,endLine:Nn,startCol:Ln,endCol:Ln+ae};if(j.computeEditInfo)if(Y==="<")He.suggestions=[ft(te,"&lt;")];else if(Y==="h"&&c!=="link-text"&&er.test(Is||""))He.suggestions=[Dt(te)];else if(ee&&c==="ext-link-text"){const pe=a.getAbsoluteIndex()+a.toString().length;He.suggestions=[ft(pe,"&#93;")]}else if(oe&&Cn){const pe=n-g.toString().length;He.suggestions=[bs(pe,"left-bracket","[")]}else M&&(He.suggestions=[...O[0]===D?[]:[un(He,D)],...Ce===":"||Ce===":"?[Dt(Ue,1)]:[]]);b.push(He)}return b}}replaceData(n){R(this,e,Ql).call(this,n)}splitText(n){this.lspError("AstText.splitText")}escape(){}print(){return Ut(this.data)}},e=new WeakSet,Ql=function(n){this.setAttribute("data",n)},s)}}),Ze,vt=C({"mixin/hidden.ts"(){"use strict";Ze=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(r){return e?[]:super.lint(r)}}return i}}}),Ie,Fe=C({"mixin/noEscape.ts"(){"use strict";Ie=e=>{}}}),et,bt=C({"src/syntax.ts"(){"use strict";var e,t;q(),et=(t=class extends F{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return m(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),je,We=C({"mixin/padded.ts"(){"use strict";je=({length:e})=>t=>{class s extends t{getAttribute(n){return n==="padding"?e:super.getAttribute(n)}}return s}}}),xe,ze=C({"src/atom.ts"(){"use strict";var e,t;q(),xe=(t=class extends F{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return m(this,e)}set type(i){L(this,e,i)}getAttribute(i){var n;return i==="invalid"?this.type==="converter-flag"&&!!((n=this.parentNode)!=null&&n.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),tr,sr,Ms,ir,Oe,ys=C({"src/link/base.ts"(){"use strict";var e,t,s,i;z(),Ke(),de(),We(),Fe(),W(),q(),ze(),tr=n=>n==="redirect-target"||n==="link",sr=[Ie,je("[[")],Oe=(i=class extends(ir=F){constructor(r,l,o,u=[],d="|"){super(void 0,o,u,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new xe(r,"link-target",o,u,{})),l!==void 0){const a=new F(l,o,u,{});a.type="link-text",a.setAttribute("stage",Se-1),this.insertAt(a)}L(this,t,d)}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(r,l){r==="bracket"?L(this,e,l):r==="title"?L(this,s,l):super.setAttribute(r,l)}toString(r){const l=super.toString(r,m(this,t));return m(this,e)?`[[${l}]]`:l}text(){const r=super.text("|");return m(this,e)?`[[${r}]]`:r}getAttribute(r){return r==="title"?m(this,s):super.getAttribute(r)}getGaps(r){return r===0?m(this,t).length:1}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{childNodes:[u,d],type:a}=this,{encoded:h,fragment:g}=m(this,s),{lintConfig:c}=I,{computeEditInfo:p,fix:v}=c,b=new le(this,r);let S="unknown-page",A=c.getSeverity(S);if(A&&u.childNodes.some(({type:w})=>w==="template")&&o.push(B(u,b,S,"template-in-link",A)),S="url-encoding",A=c.getSeverity(S),A&&h){const w=B(u,b,S,"unnecessary-encoding",A);(p||v)&&(w.fix=ln(w,u)),o.push(w)}if(S="pipe-like",A=c.getSeverity(S,"link"),A&&(a==="link"||a==="category")){const w=d==null?void 0:d.childNodes.findIndex(y=>y.type==="text"&&y.data.includes("|")),f=d==null?void 0:d.childNodes[w];if(f){const y=B(d,b,S,"pipe-in-link",A);if(p){const _=y.startIndex+d.getRelativeIndex(w);y.suggestions=[dn(_,f.data)]}o.push(y)}}if(S="no-ignored",A=c.getSeverity(S,"fragment"),A&&g!==void 0&&!tr(a)){const w=B(u,b,S,"useless-fragment",A);if(p||v){const f=u.childNodes.findIndex(_=>_.type==="text"&&_.data.includes("#")),y=u.childNodes[f];y&&(w.fix=U(w,u.getRelativeIndex(f)+y.data.indexOf("#")))}o.push(w)}return o}}getTitle(r,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:r,decode:!0,selfLink:!0})}print(){return super.print(m(this,e)?{pre:"[[",post:"]]",sep:m(this,t)}:{sep:m(this,t)})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),Ms=K(ir),Oe=X(Ms,0,"LinkBaseToken",sr,Oe),J(Ms,1,Oe)}}),nr,Us,rr,Te,tt=C({"src/nowiki/base.ts"(){"use strict";Fe(),q(),nr=[Ie],Te=class extends(rr=F){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Us=K(rr),Te=X(Us,0,"NowikiBaseToken",nr,Te),J(Us,1,Te)}}),lr,Hs,or,ce,Me=C({"src/nowiki/noinclude.ts"(){"use strict";vt(),tt(),lr=[Ze()],ce=class extends(or=Te){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Hs=K(or),ce=X(Hs,0,"NoincludeToken",lr,ce),J(Hs,1,ce)}}),Jl,Ma=C({"src/link/redirectTarget.ts"(){"use strict";z(),W(),ys(),Me(),Jl=class extends Oe{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new ce(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,n=i.getSeverity(s,"redirect");if(n&&this.length===2){const r=B(this.lastChild,{start:e},s,"useless-link-text",n);r.startIndex--,r.startCol--,(i.computeEditInfo||i.fix)&&(r.fix=U(r)),t.push(r)}return t}}}}}),ar,Ds,ur,Lt,Ua=C({"src/redirect.ts"(){"use strict";var e,t,s;vt(),Fe(),q(),bt(),Ma(),ar=[Ze(!1,!1),Ie],Lt=(s=class extends(ur=F){constructor(n,r,l,o,u,d,a=[]){super(void 0,d,a);N(this,e);N(this,t);L(this,e,n),L(this,t,u),this.append(new et(r,"redirect-syntax",d,a),new Jl(l,o==null?void 0:o.slice(1),d,a))}get type(){return"redirect"}getAttribute(n){return n==="padding"?m(this,e).length:super.getAttribute(n)}toString(n){return m(this,e)+super.toString(n)+m(this,t)}lint(n=this.getAbsoluteIndex()){{const r=n+m(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",r),this.lastChild.lint(r)}}print(){return super.print({pre:m(this,e),post:m(this,t)})}},e=new WeakMap,t=new WeakMap,s),Ds=K(ur),Lt=X(Ds,0,"RedirectToken",ar,Lt),J(Ds,1,Lt)}}),Xl={};se(Xl,{parseRedirect:()=>Kl});var Kl,Ha=C({"parser/redirect.ts"(){"use strict";W(),Ua(),Kl=(e,t,s)=>{var n;(n=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 Lt(...i.slice(1),t,s),e):!1}}}),dr,Gs,hr,Et,Da=C({"src/onlyinclude.ts"(){"use strict";We(),Fe(),q(),dr=[Ie,je("<onlyinclude>")],Et=class extends(hr=F){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=K(hr),Et=X(Gs,0,"OnlyincludeToken",dr,Et),J(Gs,1,Et)}}),Vt,Ss=C({"mixin/gapped.ts"(){"use strict";Vt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),cr,Vs,gr,Qe,gn=C({"src/tagPair/index.ts"(){"use strict";var e,t;Ss(),Fe(),q(),cr=[Vt(),Ie],Qe=(t=class extends(gr=F){constructor(i,n,r,l,o,u=[]){super(void 0,o);N(this,e);Ee(this,"closed");Ee(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),L(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(n,r);const d=typeof n=="string"?-1:u.indexOf(n);u.splice(d===-1?1/0:d,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:n,firstChild:r,lastChild:l}=this,[o,u]=m(this,e);return n?`<${o}${r.toString(i)}/>`:`<${o}${r.toString(i)}>${l.toString(i)}${this.closed?`</${u}>`:""}`}text(){const[i,n]=m(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${n}>`:""}`}getAttribute(i){return i==="padding"?m(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,n]=m(this,e);return super.print(this.selfClosing?{pre:`&lt;${i}`,post:"/&gt;"}:{pre:`&lt;${i}`,sep:"&gt;",post:this.closed?`&lt;/${n}&gt;`:""})}},e=new WeakMap,t),Vs=K(gr),Qe=X(Vs,0,"TagPairToken",cr,Qe),J(Vs,1,Qe)}}),Yl,Ga=C({"src/tagPair/translate.ts"(){"use strict";var e,Zl,s;q(),gn(),bt(),Me(),Yl=(s=class extends Qe{constructor(n,r,l,o=[]){const u=new et(n,"translate-attr",l,o);r=r==null?void 0:r.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(a,h,g,c)=>(new ce(h,l,o),new ce(c,l,o),`\0${o.length-1}n${g}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(a,h,g,c,p)=>(new ce(h,l,o),new ce(p,l,o),`\0${o.length-1}n${c}\0${o.length}n`));const d=new F(r,l,o);d.type="translate-inner";super("translate",u,d,"translate",l,o);N(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(n){return n?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext">&lt;translate${R(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)}}),pr,Qs,fr,Ft,Va=C({"src/tagPair/include.ts"(){"use strict";z(),de(),vt(),W(),gn(),pr=[Ze(!1)],Ft=class extends(fr=Qe){get type(){return"include"}constructor(e,t="",s,i,n,r){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",n,r)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:n}=this,r=new le(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=I,{computeEditInfo:u}=o,d=l.map(a=>o.getSeverity(a,"include"));if(d[0]&&s.data.trim()){const a=B(s,r,l[0],"useless-attribute",d[0]);u&&(a.suggestions=[U(a)]),t.push(a)}if(d[1]&&!i){const a=Q(this,r,l[1],I.msg("unclosed",`<${n}>`),d[1]);u&&(a.suggestions=[qe(a.endIndex,`</${n}>`)]),t.push(a)}return t}}},Qs=K(fr),Ft=X(Qs,0,"IncludeToken",pr,Ft),J(Qs,1,Ft)}}),ks,pn=C({"mixin/attributesParent.ts"(){"use strict";ks=(e=0)=>t=>{var i,eo;class s extends t{constructor(){super(...arguments);N(this,i)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return R(this,i,eo).call(this).getAttr(o)}}return i=new WeakSet,eo=function(){return this.childNodes[e]},s}}}),ie,Js,Xs,_t,Zt,Ks,Ge,Ys,Zs,ei,es,ti,Ae,to,so,io,no,Qa=C({"util/sharable.ts"(){"use strict";ie=new Set(["align"]),Js=new Set(["cite"]),Xs=new Set(["cite","datetime"]),_t=new Set(["width"]),Zt=new Set(["axis","align","bgcolor","height","width","valign"]),Ks=new Set([...Zt,"abbr","headers","scope","rowspan","colspan"]),Ge=new Set(["type"]),Ys=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Zs=new Set(["clear"]),ei=new Set(["bgcolor","align","valign"]),es=new Set(["qid","forcemathmode","type","display"]),ti=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:Js,q:Js,p:ie,br:Zs,pre:_t,ins:Xs,del:Xs,ul:Ge,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Ys,"border"]),caption:ie,tr:ei,td:Ks,th:Ks,font:new Set(["size","color","face"]),hr:_t,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ge,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:Ge,flashmp3:Ge,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:ti,syntaxhighlight:ti,templatedata:Ae,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Ae},no={table:Ys,td:new Set([...Zt,"scope"]),th:Zt,br:Zs,caption:ie,div:ie,hr:_t,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,li:Ge,p:ie,pre:_t,tr:ei,ul:Ge}}}),mr,xr,vr,br,as,Ja=C({"src/attribute.ts"(){"use strict";var e,t,s,i,n,Ji,l;z(),ge(),Ke(),Qa(),de(),W(),q(),ze(),mr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,xr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,vr=new Set(["ext","arg","magic-word","template"]),br=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),as=(l=class extends F{constructor(u,d,a,h="",g,c=[],p=I.getConfig(),v=[]){const b=new xe(a,"attr-key",p,v);let S;if(a==="title"||d==="img"&&a==="alt")S=new F(g,p,v,{}),S.type="attr-value",S.setAttribute("stage",Se-1);else if(d==="gallery"&&a==="caption"||d==="choose"&&(a==="before"||a==="after")){const A=Le(me({},p),{excludes:[...p.excludes,"heading","html","table","hr","list"]});S=new F(g,A,v,{}),S.type="attr-value",S.setAttribute("stage",1)}else S=new xe(g,"attr-value",p,v,{});super(void 0,p,v);N(this,n);N(this,e);N(this,t);N(this,s);N(this,i);L(this,e,u),this.append(b,S),L(this,s,h),L(this,i,[...c]),L(this,t,d),this.setAttribute("name",gt(be(a)))}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),this.setAttribute("name",gt(this.firstChild.text())),super.afterBuild()}toString(u){const[d="",a=""]=m(this,i);return m(this,s)?super.toString(u,m(this,s)+d)+a:this.firstChild.toString(u)}text(){return m(this,s)?`${super.text(`${m(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var u,d;return m(this,s)?m(this,s).length+((d=(u=m(this,i)[0])==null?void 0:u.length)!=null?d:0):0}lint(u=this.getAbsoluteIndex(),d){var a;{const h=super.lint(u,d),{balanced:g,firstChild:c,lastChild:p,name:v,tag:b}=this,S=new le(this,u),A=["unclosed-quote","obsolete-attr"],{lintConfig:w}=I,f=A.map(_=>w.getSeverity(_,v));if(f[0]&&!g){const _=B(p,S,A[0],I.msg("unclosed","quotes"),f[0]);_.startIndex--,_.startCol--,w.computeEditInfo&&(_.suggestions=[qe(_.endIndex,m(this,i)[0])]),h.push(_)}const y=R(this,n,Ji).call(this,u,S);return y&&h.push(y),f[1]&&((a=no[b])!=null&&a.has(v))&&h.push(B(c,S,A[1],"obsolete-attribute",f[1])),h}}getValue(){return m(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(u){return u==="invalid"?R(this,n,Ji).call(this):super.getAttribute(u)}print(){const[u="",d=""]=m(this,i);return m(this,s)?super.print({sep:Ut(m(this,s))+u,post:d}):super.print()}json(u,d=this.getAbsoluteIndex()){const a=super.json(void 0,d)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakSet,Ji=function(u,d){const{firstChild:a,lastChild:h,type:g,name:c,tag:p,parentNode:v}=this,b=!h.childNodes.some(({type:k})=>vr.has(k)),S=this.getValue(),A=io[p],w=so[p],{length:f}=this.toString();let y="illegal-attr",_,x;if({lintConfig:_}=I,{computeEditInfo:x}=_,!(A!=null&&A.has(c))&&!(w!=null&&w.has(c))&&(g==="ext-attr"?A||w:!/\{\{[^{]+\}\}/u.test(c))&&(g==="ext-attr"&&!w||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(c)&&(p==="meta"||p==="link"||!to.has(c)))||(c==="itemtype"||c==="itemid"||c==="itemref")&&!(v!=null&&v.hasAttr("itemscope"))){if(u===void 0)return!0;{const k=_.getSeverity(y,"unknown");if(k){const T=B(a,d,y,"illegal-attribute-name",k);return x&&(T.suggestions=[U(u,f)]),T}}}else if(c==="style"&&typeof S=="string"&&mr.test(S)){if(u===void 0)return!0;{y="insecure-style";const k=_.getSeverity(y);return k&&B(h,d,y,"insecure-style",k)}}else if(c==="tabindex"&&typeof S=="string"&&S!=="0"){if(u===void 0)return!0;{const k=_.getSeverity(y,"tabindex");if(k){const T=B(h,d,y,"nonzero-tabindex",k);return x&&(T.suggestions=[U(u,f),$e(T,"0 tabindex","0")]),T}}}else if(b&&g!=="ext-attr"){const k=Ul(p,c),T=String(S).toLowerCase();if(k.length>0&&k.every($=>$!==T)){if(u===void 0)return!0;{const $=_.getSeverity(y,"value");return $&&B(h,d,y,"illegal-attribute-value",$)}}}else if(typeof S=="string"&&((/^xmlns:[\w:.-]+$/u.test(c)||br.has(c))&&xr.test(S)||b&&(c==="href"||p==="img"&&c==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(S))){if(u===void 0)return!0;{const k=_.getSeverity(y,"value");return k&&B(h,d,y,"illegal-attribute-value",k)}}return!1},l)}}),si,wr,yr,As,fn=C({"src/attributes.ts"(){"use strict";var e,t,us,i;z(),ge(),de(),W(),q(),ze(),Ja(),si=n=>n.slice(0,-1),wr=n=>`${si(n)}-dirty`,yr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(n){return/[^\W_]/u}})(),As=(i=class extends F{constructor(r,l,o,u,d=[]){super(void 0,u,d,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",o),r){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(r),c=0;const p=()=>{h&&(super.insertAt(new xe(h,wr(l),u,d,{})),h="")};for(;g;){const{index:v,0:b,1:S,2:A,3:w,4:f,5:y,6:_}=g;if(h+=r.slice(c,v),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(be(S).trim())){const x=f!=null?f:_,k=[w,y],T=new as(si(l),o,S,A,x,k,u,d);p(),super.insertAt(T)}else h+=b;({lastIndex:c}=a),g=a.exec(r)}h+=r.slice(c),p()}}get type(){return m(this,e)}afterBuild(){const{parentNode:r}=this;r!=null&&r.is("td")&&this.setAttribute("name",r.subtype),super.afterBuild()}getAttrTokens(r){return this.childNodes.filter(l=>l instanceof as&&(!r||l.name===gt(r)))}hasAttr(r){return this.getAttrTokens(r).length>0}getAttrToken(r){const l=this.getAttrTokens(r);return l[l.length-1]}getAttr(r){var l;return(l=this.getAttrToken(r))==null?void 0:l.getValue()}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{parentNode:u,childNodes:d}=this,a=new Map,h=new Set,g=new le(this,r),c=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:v,fix:b}=p,S=["closingTag","invalidAttributes","nonWordAttributes"].map(w=>p.getSeverity(c[0],w));if(S[0]&&R(this,t,us).call(this)){const w=Q(this,g,c[0],"attributes-of-closing-tag",S[0]);if(v){const f=u.getAbsoluteIndex();w.suggestions=[U(w),on(f)]}o.push(w)}for(const w of d)if(w instanceof as){const{name:f}=w;a.has(f)?(h.add(f),a.get(f).push(w)):a.set(f,[w])}else{const f=w.text().trim(),y=S[yr.test(f)?1:2];if(f&&y){const _=B(w,g,c[0],"invalid-attribute",y);v&&(_.suggestions=[U(_,0," ")]),o.push(_)}}const A=p.getSeverity(c[1],"attribute");if(A&&h.size>0)for(const w of h){const f=a.get(w).map(y=>{const _=y.getValue();return[y,_===!0?"":_]});o.push(...f.map(([y,_],x)=>{const k=B(y,g,c[1],I.msg("duplicate-attribute",w),A);if(v||b){const T=U(k);!_||f.slice(0,x).some(([,$])=>$===_)?k.fix=T:v&&(k.suggestions=[T])}return k}))}return o}}getAttribute(r){return r==="invalid"?R(this,t,us).call(this):super.getAttribute(r)}print(){return this.toString()?`<span class="wpb-${this.type}${R(this,t,us).call(this)?" wpb-invalid":""}">${this.childNodes.map(r=>r.print(r instanceof xe?{class:r.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,us=function(){const{parentNode:r}=this;return(r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()!==""},i)}}),ro={};se(ro,{PreToken:()=>lo});var lo,Xa=C({"src/pre.ts"(){"use strict";Ke(),q(),Me(),lo=class extends F{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,n=/<\/nowiki>/giu,{length:r}=i.source;let l=i.exec(e);l&&(n.lastIndex=l.index+r);let o=n.exec(e),u=0,d="";for(;l&&o;)new ce(l[0],t,s),new ce(o[0],t,s),d+=`${e.slice(u,l.index)}\0${s.length-1}n${e.slice(l.index+r,o.index)}\0${s.length}n`,u=o.index+r+1,i.lastIndex=u,l=i.exec(e),l&&(n.lastIndex=l.index+r),o=n.exec(e);e=d+e.slice(u)}super(e,t,s,{}),this.setAttribute("stage",Se-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),_s,mn=C({"mixin/multiLine.ts"(){"use strict";_s=e=>{class t extends e{toString(i){return super.toString(i,`
1
+ "use strict";(()=>{var Aa=Object.defineProperty,_a=Object.defineProperties;var $a=Object.getOwnPropertyDescriptors;var Jt=Object.getOwnPropertySymbols;var Fn=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable;var Pn=e=>{throw TypeError(e)};var js=(e,t,s)=>t in e?Aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,me=(e,t)=>{for(var s in t||(t={}))Fn.call(t,s)&&js(e,s,t[s]);if(Jt)for(var s of Jt(t))jn.call(t,s)&&js(e,s,t[s]);return e},Le=(e,t)=>_a(e,$a(t));var Rn=(e,t)=>{var s={};for(var i in e)Fn.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&&jn.call(e,i)&&(s[i]=e[i]);return s};var Ta=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ee=(e,t,s)=>js(e,typeof t!="symbol"?t+"":t,s),Ps=(e,t,s)=>t.has(e)||Pn("Cannot "+s);var f=(e,t,s)=>(Ps(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?Pn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(Ps(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),R=(e,t,s)=>(Ps(e,t,"access private method"),s);var On=(e,t,s,i)=>({set _(n){L(e,t,n,s)},get _(){return f(e,t,i)}});var Nu=Ta((Eu,ka)=>{var Ca=Object.create,xt=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,sn=Object.getOwnPropertyNames,Ia=Object.prototype.hasOwnProperty,El=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),vt=e=>{throw TypeError(e)},Fl=(e,t,s)=>t in e?xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Bn=(e,t)=>xt(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[sn(e)[0]])(e=0)),t},jl=(e,t)=>function(){return t||(0,e[sn(e)[0]])((t={exports:{}}).exports,t),t.exports},se=(e,t)=>{for(var s in t)xt(e,s,{get:t[s],enumerable:!0})},Na=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of sn(t))!Ia.call(e,n)&&n!==s&&xt(e,n,{get:()=>t[n],enumerable:!(i=Ll(t,n))||i.enumerable});return e},Q=e=>Na(xt({},"__esModule",{value:!0}),e),K=e=>{var t;return[,,,Ca((t=e==null?void 0:e[El("metadata")])!=null?t:null)]},Pl=["class","method","getter","setter","accessor","field","value","get","set"],It=e=>e!==void 0&&typeof e!="function"?vt("Function expected"):e,La=(e,t,s,i,n)=>({kind:Pl[e],name:t,metadata:i,addInitializer:r=>s._?vt("Already initialized"):n.push(It(r||null))}),nn=(e,t)=>Fl(t,El("metadata"),e[3]),J=(e,t,s,i)=>{for(var n=0,r=e[t>>1],l=r&&r.length;n<l;n++)t&1?r[n].call(s):i=r[n].call(s,i);return i},X=(e,t,s,i,n,r)=>{var l,o,a,d,u,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,b=Pl[h+5],w=h>3&&(e[p-1]=[]),k=e[p]||(e[p]=[]),_=h&&(!c&&!g&&(n=n.prototype),h<5&&(h>3||!c)&&Ll(h<4?n:{get[s](){return he(this,r)},set[s](m){return ye(this,r,m)}},s));h?c&&h<4&&Bn(r,(h>2?"set ":h>1?"get ":"")+s):Bn(n,s);for(var v=i.length-1;v>=0;v--)d=La(h,s,a={},e[3],k),h&&(d.static=g,d.private=c,u=d.access={has:c?m=>Fa(n,m):m=>s in m},h^3&&(u.get=c?m=>(h^1?he:Ui)(m,n,h^4?r:_.get):m=>m[s]),h>2&&(u.set=c?(m,S)=>ye(m,n,S,h^4?r:_.set):(m,S)=>m[s]=S)),o=(0,i[v])(h?h<4?c?r:_[b]:h>4?void 0:{get:_.get,set:_.set}:n,d),a._=1,h^4||o===void 0?It(o)&&(h>4?w.unshift(o):h?c?r=o:_[b]=o:n=o):typeof o!="object"||o===null?vt("Object expected"):(It(l=o.get)&&(_.get=l),It(l=o.set)&&(_.set=l),It(l=o.init)&&w.unshift(l));return h||nn(e,n),_&&xt(n,s,_),c?h^4?r:_:n},Ea=(e,t,s)=>Fl(e,typeof t!="symbol"?t+"":t,s),rn=(e,t,s)=>t.has(e)||vt("Cannot "+s),Fa=(e,t)=>Object(t)!==t?vt('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)),Re=(e,t,s)=>t.has(e)?vt("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),ja=(e,t,s,i)=>({set _(n){ye(e,t,n,s)},get _(){return he(e,t,i)}}),Rl,fs,Ol=C({"base.ts"(){"use strict";Rl=(()=>{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","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,n)=>Se(String(t[n]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,n)=>String(t[n])):e.replace(/\0(\d+)\x7F/gu,(i,n)=>t[n])}var Be,Rs,ct,gt,pt,st,Bl,be,Ke,qn,Wn,ms,ql,Mn,zn,Ut,ft,ge=C({"util/string.ts"(){"use strict";Be=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Rs=String.raw`[^[\]<>"\0-\x1F\x7F${Be}\uFFFD]`,ct=String.raw`(?:\[[\da-f:.]+\]|${Rs})`,gt=String.raw`(?:${Rs}|\0\d+[cn!~]\x7F)*`,pt=e=>e.trim().toLowerCase(),st=(e,t)=>s=>s.replace(e,t),Bl=st(/[\0\x7F]|\r$/gmu,""),be=st(/\0\d+[cn]\x7F/gu,""),Ke=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),qn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Wn=st(/&(?:#(\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()]),ms=e=>Wn(e),ql=st(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Mn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},zn=e=>st(e,t=>`&${Mn[t]};`),Ut=zn(/[&<>]/gu),ft=(e,t={})=>{const{pre:s="",post:i="",sep:n=""}=t;return s+e.map(r=>r.print()).join(n)+i}}}),Pa=jl({"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}}}),Ra=jl({"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:[]}}}),we,Wl,Hi,We=C({"util/constants.ts"(){"use strict";we=11,Wl=Pa(),Hi=Ra()}});function ht(e){const t=new Map,s=new WeakMap;return i=>{const n=typeof i=="string"?t:s;if(n.has(i)){const l=n.get(i);return l.lastIndex=0,l}const r=e(i);return n.set(i,r),r}}var Ht,Ml,Ye=C({"../common/dist/index.mjs"(){"use strict";Ht=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ml=ht}}),le,de=C({"lib/rect.ts"(){"use strict";var e,t,s,i,Di,r;le=(r=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 f(this,t)}get top(){return R(this,i,Di).call(this).top}get left(){return R(this,i,Di).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Di=function(){var l;return(l=f(this,s))!=null||L(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},r)}}),Un,Hn,zt,Gi,Os,B,G,$e,bs,U,ln,qe,on,an,un,Dt,mt,dn,Xe,zl,M=C({"util/lint.ts"(){"use strict";Ye(),Ne(),de(),W(),Un=new Set(["tr","td","th","caption"]),Hn=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")&&Hn.has(t.name)||t.is("html")&&Un.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}),Os=e=>(t,s,i,n,r="error")=>{const{start:l}=s,{top:o,left:a}=s instanceof le?s:new le(t,l),{offsetHeight:d,offsetWidth:u}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,o,a),{line:p,character:b}=Gi(g,c,d,u);return{rule:i,message:I.msg(n),severity:r,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:b}},B=Os((e,t,s,i)=>{const n=e.getRelativeIndex(),{top:r,left:l}=e.parentNode.posFromIndex(n);return{startIndex:t+n,startLine:s+r,startCol:r?l:i+l}}),G=Os((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}),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"))),qe=(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:" "}),mt=(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;")}),Xe=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===ke.rev))return e[1];const n=t();return(i||I.viewOnly)&&s([ke.rev,n]),n},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"]:[]}}),Dn,hn,Ul=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},hn=(e,t,s)=>{const i=e.split(",");return(({type:n,name:r})=>i.some(l=>Dn(l.trim(),n,r)))}}}),ws,cn=C({"mixin/cached.ts"(){"use strict";M(),ws=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Xe(s.get(this),()=>t.apply(this,i),n=>{s.set(this,n)},e)}}}}),Hl,Oa=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}}}),Gn,Vn,Xt,yt,St,Kt,kt,At,_t,Qe,Dl=C({"lib/node.ts"(){"use strict";M(),Ne(),cn(),Oa(),W(),Vn=[Hl],Gn=[ws(!1)],Qe=class{constructor(){J(_t,5,this),Ea(this,"childNodes",[]),Re(this,Xt),Re(this,yt),Re(this,St),Re(this,Kt),Re(this,kt),Re(this,At,{})}get parentNode(){return he(this,Xt)}get nextSibling(){return he(this,yt)}get previousSibling(){return he(this,St)}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,yt,void 0),ye(this,St,void 0));break;case"nextSibling":ye(this,yt,t);break;case"previousSibling":ye(this,St,t);break;case"aIndex":I.viewOnly&&ye(this,kt,[ke.rev,t]);break;default:this[e]=t}}getRootNode(){return Xe(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(([,,n])=>e<=n);return{top:i,left:e-s[i][1]}}}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 Xe(he(this,At)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let n=0;n<s;n++)I.viewOnly&&(he(this,At)[n]=[ke.rev,i]),i+=t[n].toString().length+this.getGaps(n);return i},t=>{he(this,At)[e]=t})}getAbsoluteIndex(){return Xe(he(this,kt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ye(this,kt,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=K(null),Xt=new WeakMap,yt=new WeakMap,St=new WeakMap,Kt=new WeakMap,kt=new WeakMap,At=new WeakMap,X(_t,1,"getLines",Gn,Qe),Qe=X(_t,0,"AstNode",Vn,Qe),J(_t,1,Qe)}}),Gl,Ba=C({"mixin/elementLike.ts"(){"use strict";Ul(),Gl=e=>{var s,Vi;class t extends e{constructor(){super(...arguments);N(this,s)}getElementBy(l){for(const o of this.childNodes){if(o.type==="text")continue;if(l(o))return o;const a=o.getElementBy(l);if(a)return a}}querySelector(l){return this.getElementBy(R(this,s,Vi).call(this,l))}getElementsBy(l,o=[]){for(const a of this.childNodes)a.type!=="text"&&(l(a)&&o.push(a),a.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(R(this,s,Vi).call(this,l))}escape(){}}return s=new WeakSet,Vi=function(l){return hn(l,this)},t}}}),Qn,Bs,Jn,Nt,qa=C({"lib/element.ts"(){"use strict";ge(),Ne(),Ul(),Dl(),Ba(),Qn=[Gl],Nt=class extends(Jn=Qe){get length(){return this.childNodes.length}text(e){return Ke(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,n;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(n=e[s])==null||n.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:n}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||n===""&&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=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,n=e+this.getAttribute("padding");i<this.length;i++){const r=this.childNodes[i];r.setAttribute("aIndex",n);const l=r.lint(n,t);l.length>0&&s.push(...l),n+=r.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":""}">`)+ft(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){this.lspError("AstElement.json")}},Bs=K(Jn),Nt=X(Bs,0,"AstElement",Qn,Nt),J(Bs,1,Nt)}}),Yt,qs,Ws,Xn,Kn,Yn,Zn,Ms,er,Qi,Wa=C({"lib/text.ts"(){"use strict";var e,Vl,s;ge(),M(),W(),Dl(),Yt=String.raw`[${Be}\t]*`,qs=String.raw`[^\S\n]*`,Ws=String.raw`<${qs}(?:/${qs})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Yt}\d)|isbn(?=[-::]?${Yt}(?:\d(?:${Yt}|-)){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}})(),Qi=(s=class extends Qe{constructor(n){super();N(this,e);Ee(this,"data","");this.data=n}get type(){return"text"}toString(n){var r;return n&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?be(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),r){var l,o,a;{if(r===!1)return[];const{data:d,parentNode:u,nextSibling:h,previousSibling:g}=this;if(!u)throw new Error("An isolated text node cannot be linted!");const{type:c,name:p,parentNode:b}=u;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(r!=null||(r=c==="free-ext-link"||c==="ext-link-url"||c==="ext-link-text"||c==="image-parameter"&&p==="link"||c==="attr-value"?Kn:Xn),d.search(r)===-1)return[];r.lastIndex=0;const w=[],k=h==null?void 0:h.type,_=h==null?void 0:h.name,v=g==null?void 0:g.type,m=this.getRootNode(),S=m.toString(),{ext:A,html:x,variants:y}=m.getAttribute("config"),{top:T,left:$}=m.posFromIndex(n),{lintConfig:E}=I,F=E.rules["tag-like"],P=typeof F=="object"&&F[1]?new Set(Object.keys(F[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,ne=new Set(["onlyinclude","noinclude","includeonly",...A,...x[0],...x[1],...x[2],...P,...E.getSeverity("tag-like","disallowed")?Ms:[]]);for(let O=r.exec(d);O;O=r.exec(d)){const[,re,fe]=O;let{index:V,0:D}=O;if(fe&&fe!=="]"){const{length:pe}=fe;V+=pe,D=D.slice(pe)}D=D.toLowerCase();const[Y]=D,z=Y==="r"||Y==="p"||Y==="i",Z=Y==="{",H=Y==="}",ee=Y==="[",oe=Y==="]";let{length:ae}=D;if(Y==="<"&&!ne.has(re.toLowerCase())||ee&&c==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(V+1))||h!=null&&h.is("ext")&&_==="nowiki"&&((l=h.innerText)!=null&&l.includes("]")))||z&&(!u.isPlain()||Yn.has(c)))continue;oe&&(V||ae>1)&&r.lastIndex--;let te=n+V,He=te+ae,ue,ve;const Ce=S[He],Is=S[te-1],Ns=Z||ee,Ls=Z&&Is==="-"&&y.length>0,Es=H&&Ce==="-"&&y.length>0,Cn=ee&&k==="free-ext-link"&&!d.slice(V+1).trim()||oe&&v==="free-ext-link"&&!d.slice(0,V).includes("]");if(z)ue="lonely-http",D=D.toUpperCase(),ve=E.getSeverity(ue,D);else if(Y==="<"){ue="tag-like";let pe;/^<\/?\s/u.test(D)||!/[\s/>]/u.test(Ce!=null?Ce:"")?pe="invalid":P.has(re)?pe=re:Ms.has(re)&&!A.includes(re)&&(pe="disallowed"),ve=E.getSeverity(ue,pe)}else if(Ls||Es)ue="lonely-bracket",ve=E.getSeverity(ue,"converter"),Ls&&V>0?(D="-{",V--,te--,ae=2):Es&&V<d.length-1&&(D="}-",He++,ae=2);else if(Cn)ue="lonely-bracket",ve=E.getSeverity(ue,"extLink");else if(Ns||H||oe)if(ue="lonely-bracket",ae>1||Z&&Ce===Y||H&&Is===Y)ve=E.getSeverity(ue,"double");else{if(!ee||c!=="ext-link-text"){const pe=Zn[Y],Fs=Ns?d.slice(V+1):d.slice(0,V);if(Z&&((o=pe.exec(Fs))==null?void 0:o[0])==="}"||H&&((a=pe.exec(Fs))==null?void 0:a[0])==="{")continue;if(!Fs.includes(Y)){const En=Ns?"nextSibling":"previousSibling";let Ge=this[En];for(;Ge&&(Ge.type!=="text"||!pe.test(Ge.data));)Ge=Ge[En];if(Ge&&pe.exec(Ge.data)[0]!==Y)continue}}ve=E.getSeverity(ue,"single")}else ue="lonely-http",ve=E.getSeverity(ue);if(!ve)continue;const In=this.posFromIndex(V),{line:Nn,character:Ln}=Gi(T,$,In.top+1,In.left),De={rule:ue,message:I.msg("lonely",z||Y==="h"||Ls||Es?D:Y),severity:ve,startIndex:te,endIndex:He,startLine:Nn,endLine:Nn,startCol:Ln,endCol:Ln+ae};if(E.computeEditInfo)if(Y==="<")De.suggestions=[mt(te,"&lt;")];else if(Y==="h"&&c!=="link-text"&&er.test(Is||""))De.suggestions=[Dt(te)];else if(ee&&c==="ext-link-text"){const pe=u.getAbsoluteIndex()+u.toString().length;De.suggestions=[mt(pe,"&#93;")]}else if(oe&&Cn){const pe=n-g.toString().length;De.suggestions=[bs(pe,"left-bracket","[")]}else z&&(De.suggestions=[...O[0]===D?[]:[un(De,D)],...Ce===":"||Ce===":"?[Dt(He,1)]:[]]);w.push(De)}return w}}replaceData(n){R(this,e,Vl).call(this,n)}splitText(n){this.lspError("AstText.splitText")}escape(){}print(){return Ut(this.data)}},e=new WeakSet,Vl=function(n){this.setAttribute("data",n)},s)}}),Ze,bt=C({"mixin/hidden.ts"(){"use strict";Ze=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(r){return e?[]:super.lint(r)}}return i}}}),Ie,Fe=C({"mixin/noEscape.ts"(){"use strict";Ie=e=>{}}}),et,wt=C({"src/syntax.ts"(){"use strict";var e,t;q(),et=(t=class extends j{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return f(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),je,Me=C({"mixin/padded.ts"(){"use strict";je=({length:e})=>t=>{class s extends t{getAttribute(n){return n==="padding"?e:super.getAttribute(n)}}return s}}}),xe,ze=C({"src/atom.ts"(){"use strict";var e,t;q(),xe=(t=class extends j{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return f(this,e)}set type(i){L(this,e,i)}getAttribute(i){var n;return i==="invalid"?this.type==="converter-flag"&&!!((n=this.parentNode)!=null&&n.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),tr,sr,zs,ir,Oe,ys=C({"src/link/base.ts"(){"use strict";var e,t,s,i;M(),We(),de(),Me(),Fe(),W(),q(),ze(),tr=n=>n==="redirect-target"||n==="link",sr=[Ie,je("[[")],Oe=(i=class extends(ir=j){constructor(r,l,o,a=[],d="|"){super(void 0,o,a,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new xe(r,"link-target",o,a,{})),l!==void 0){const u=new j(l,o,a,{});u.type="link-text",u.setAttribute("stage",we-1),this.insertAt(u)}L(this,t,d)}get link(){}get fragment(){}afterBuild(){L(this,s,this.getTitle()),f(this,t).includes("\0")&&L(this,t,this.buildFromStr(f(this,t),0)),this.setAttribute("name",f(this,s).title),super.afterBuild()}setAttribute(r,l){r==="bracket"?L(this,e,l):r==="title"?L(this,s,l):super.setAttribute(r,l)}toString(r){const l=super.toString(r,f(this,t));return f(this,e)?`[[${l}]]`:l}text(){const r=super.text("|");return f(this,e)?`[[${r}]]`:r}getAttribute(r){return r==="title"?f(this,s):super.getAttribute(r)}getGaps(r){return r===0?f(this,t).length:1}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{childNodes:[a,d],type:u}=this,{encoded:h,fragment:g}=f(this,s),{lintConfig:c}=I,{computeEditInfo:p,fix:b}=c,w=new le(this,r);let k="unknown-page",_=c.getSeverity(k);if(_&&a.childNodes.some(({type:v})=>v==="template")&&o.push(B(a,w,k,"template-in-link",_)),k="url-encoding",_=c.getSeverity(k),_&&h){const v=B(a,w,k,"unnecessary-encoding",_);(p||b)&&(v.fix=ln(v,a)),o.push(v)}if(k="pipe-like",_=c.getSeverity(k,"link"),_&&(u==="link"||u==="category")){const v=d==null?void 0:d.childNodes.findIndex(S=>S.type==="text"&&S.data.includes("|")),m=d==null?void 0:d.childNodes[v];if(m){const S=B(d,w,k,"pipe-in-link",_);if(p){const A=S.startIndex+d.getRelativeIndex(v);S.suggestions=[dn(A,m.data)]}o.push(S)}}if(k="no-ignored",_=c.getSeverity(k,"fragment"),_&&g!==void 0&&!tr(u)){const v=B(a,w,k,"useless-fragment",_);if(p||b){const m=a.childNodes.findIndex(A=>A.type==="text"&&A.data.includes("#")),S=a.childNodes[m];S&&(v.fix=U(v,a.getRelativeIndex(m)+S.data.indexOf("#")))}o.push(v)}return o}}getTitle(r,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:r,decode:!0,selfLink:!0})}print(){return super.print(f(this,e)?{pre:"[[",post:"]]",sep:f(this,t)}:{sep:f(this,t)})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),zs=K(ir),Oe=X(zs,0,"LinkBaseToken",sr,Oe),J(zs,1,Oe)}}),nr,Us,rr,Te,tt=C({"src/nowiki/base.ts"(){"use strict";Fe(),q(),nr=[Ie],Te=class extends(rr=j){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Us=K(rr),Te=X(Us,0,"NowikiBaseToken",nr,Te),J(Us,1,Te)}}),lr,Hs,or,ce,Ue=C({"src/nowiki/noinclude.ts"(){"use strict";bt(),tt(),lr=[Ze()],ce=class extends(or=Te){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Hs=K(or),ce=X(Hs,0,"NoincludeToken",lr,ce),J(Hs,1,ce)}}),Ql,Ma=C({"src/link/redirectTarget.ts"(){"use strict";M(),W(),ys(),Ue(),Ql=class extends Oe{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new ce(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,n=i.getSeverity(s,"redirect");if(n&&this.length===2){const r=B(this.lastChild,{start:e},s,"useless-link-text",n);r.startIndex--,r.startCol--,(i.computeEditInfo||i.fix)&&(r.fix=U(r)),t.push(r)}return t}}}}}),ar,Ds,ur,Lt,za=C({"src/redirect.ts"(){"use strict";var e,t,s;bt(),Fe(),q(),wt(),Ma(),ar=[Ze(!1,!1),Ie],Lt=(s=class extends(ur=j){constructor(n,r,l,o,a,d,u=[]){super(void 0,d,u);N(this,e);N(this,t);L(this,e,n),L(this,t,a),this.append(new et(r,"redirect-syntax",d,u),new Ql(l,o==null?void 0:o.slice(1),d,u))}get type(){return"redirect"}getAttribute(n){return n==="padding"?f(this,e).length:super.getAttribute(n)}toString(n){return f(this,e)+super.toString(n)+f(this,t)}lint(n=this.getAbsoluteIndex()){{const r=n+f(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",r),this.lastChild.lint(r)}}print(){return super.print({pre:f(this,e),post:f(this,t)})}},e=new WeakMap,t=new WeakMap,s),Ds=K(ur),Lt=X(Ds,0,"RedirectToken",ar,Lt),J(Ds,1,Lt)}}),Jl={};se(Jl,{parseRedirect:()=>Xl});var Xl,Ua=C({"parser/redirect.ts"(){"use strict";W(),za(),Xl=(e,t,s)=>{var n;(n=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 Lt(...i.slice(1),t,s),e):!1}}}),dr,Gs,hr,Et,Ha=C({"src/onlyinclude.ts"(){"use strict";Me(),Fe(),q(),dr=[Ie,je("<onlyinclude>")],Et=class extends(hr=j){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=K(hr),Et=X(Gs,0,"OnlyincludeToken",dr,Et),J(Gs,1,Et)}}),Vt,Ss=C({"mixin/gapped.ts"(){"use strict";Vt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),cr,Vs,gr,Je,gn=C({"src/tagPair/index.ts"(){"use strict";var e,t;Ss(),Fe(),q(),cr=[Vt(),Ie],Je=(t=class extends(gr=j){constructor(i,n,r,l,o,a=[]){super(void 0,o);N(this,e);Ee(this,"closed");Ee(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),L(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(n,r);const d=typeof n=="string"?-1:a.indexOf(n);a.splice(d===-1?1/0:d,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:n,firstChild:r,lastChild:l}=this,[o,a]=f(this,e);return n?`<${o}${r.toString(i)}/>`:`<${o}${r.toString(i)}>${l.toString(i)}${this.closed?`</${a}>`:""}`}text(){const[i,n]=f(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${n}>`:""}`}getAttribute(i){return i==="padding"?f(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,n]=f(this,e);return super.print(this.selfClosing?{pre:`&lt;${i}`,post:"/&gt;"}:{pre:`&lt;${i}`,sep:"&gt;",post:this.closed?`&lt;/${n}&gt;`:""})}},e=new WeakMap,t),Vs=K(gr),Je=X(Vs,0,"TagPairToken",cr,Je),J(Vs,1,Je)}}),Kl,Da=C({"src/tagPair/translate.ts"(){"use strict";var e,Yl,s;q(),gn(),wt(),Ue(),Kl=(s=class extends Je{constructor(n,r,l,o=[]){const a=new et(n,"translate-attr",l,o);r=r==null?void 0:r.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(u,h,g,c)=>(new ce(h,l,o),new ce(c,l,o),`\0${o.length-1}n${g}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(u,h,g,c,p)=>(new ce(h,l,o),new ce(p,l,o),`\0${o.length-1}n${c}\0${o.length}n`));const d=new j(r,l,o);d.type="translate-inner";super("translate",a,d,"translate",l,o);N(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(n){return n?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext">&lt;translate${R(this,e,Yl).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,Yl=function(){return this.firstChild.toString()===" nowrap"},s)}}),pr,Qs,fr,Ft,Ga=C({"src/tagPair/include.ts"(){"use strict";M(),de(),bt(),W(),gn(),pr=[Ze(!1)],Ft=class extends(fr=Je){get type(){return"include"}constructor(e,t="",s,i,n,r){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",n,r)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:n}=this,r=new le(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=I,{computeEditInfo:a}=o,d=l.map(u=>o.getSeverity(u,"include"));if(d[0]&&s.data.trim()){const u=B(s,r,l[0],"useless-attribute",d[0]);a&&(u.suggestions=[U(u)]),t.push(u)}if(d[1]&&!i){const u=G(this,r,l[1],I.msg("unclosed",`<${n}>`),d[1]);a&&(u.suggestions=[qe(u.endIndex,`</${n}>`)]),t.push(u)}return t}}},Qs=K(fr),Ft=X(Qs,0,"IncludeToken",pr,Ft),J(Qs,1,Ft)}}),ks,pn=C({"mixin/attributesParent.ts"(){"use strict";ks=(e=0)=>t=>{var i,Zl;class s extends t{constructor(){super(...arguments);N(this,i)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return R(this,i,Zl).call(this).getAttr(o)}}return i=new WeakSet,Zl=function(){return this.childNodes[e]},s}}}),ie,Js,Xs,$t,Zt,Ks,Ve,Ys,Zs,ei,es,ti,Ae,eo,to,so,io,Va=C({"util/sharable.ts"(){"use strict";ie=new Set(["align"]),Js=new Set(["cite"]),Xs=new Set(["cite","datetime"]),$t=new Set(["width"]),Zt=new Set(["axis","align","bgcolor","height","width","valign"]),Ks=new Set([...Zt,"abbr","headers","scope","rowspan","colspan"]),Ve=new Set(["type"]),Ys=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Zs=new Set(["clear"]),ei=new Set(["bgcolor","align","valign"]),es=new Set(["qid","forcemathmode","type","display"]),ti=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Ae=new Set,eo=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"]),to={div:ie,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,blockquote:Js,q:Js,p:ie,br:Zs,pre:$t,ins:Xs,del:Xs,ul:Ve,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Ys,"border"]),caption:ie,tr:ei,td:Ks,th:Ks,font:new Set(["size","color","face"]),hr:$t,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ve,poem:ie,categorytree:ie,combooption:ie,math:Ae,chem:Ae,ce:Ae,img:new Set(["alt","src","width","height","loading","srcset"])},so={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:Ve,flashmp3:Ve,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:ti,syntaxhighlight:ti,templatedata:Ae,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Ae},io={table:Ys,td:new Set([...Zt,"scope"]),th:Zt,br:Zs,caption:ie,div:ie,hr:$t,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,li:Ve,p:ie,pre:$t,tr:ei,ul:Ve}}}),mr,xr,vr,br,as,Qa=C({"src/attribute.ts"(){"use strict";var e,t,s,i,n,Ji,l;M(),ge(),We(),Va(),de(),W(),q(),ze(),mr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,xr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,vr=new Set(["ext","arg","magic-word","template"]),br=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),as=(l=class extends j{constructor(a,d,u,h="",g,c=[],p=I.getConfig(),b=[]){const w=new xe(u,"attr-key",p,b);let k;if(u==="title"||d==="img"&&u==="alt")k=new j(g,p,b,{}),k.type="attr-value",k.setAttribute("stage",we-1);else if(d==="gallery"&&u==="caption"||d==="choose"&&(u==="before"||u==="after")){const _=Le(me({},p),{excludes:[...p.excludes,"heading","html","table","hr","list"]});k=new j(g,_,b,{}),k.type="attr-value",k.setAttribute("stage",1)}else k=new xe(g,"attr-value",p,b,{});super(void 0,p,b);N(this,n);N(this,e);N(this,t);N(this,s);N(this,i);L(this,e,a),this.append(w,k),L(this,s,h),L(this,i,[...c]),L(this,t,d),this.setAttribute("name",pt(be(u)))}get type(){return f(this,e)}get tag(){return f(this,t)}get balanced(){return!f(this,s)||f(this,i)[0]===f(this,i)[1]}afterBuild(){f(this,s).includes("\0")&&L(this,s,this.buildFromStr(f(this,s),0)),this.parentNode&&L(this,t,this.parentNode.name),this.setAttribute("name",pt(this.firstChild.text())),super.afterBuild()}toString(a){const[d="",u=""]=f(this,i);return f(this,s)?super.toString(a,f(this,s)+d)+u:this.firstChild.toString(a)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,d;return f(this,s)?f(this,s).length+((d=(a=f(this,i)[0])==null?void 0:a.length)!=null?d:0):0}lint(a=this.getAbsoluteIndex(),d){var u;{const h=super.lint(a,d),{balanced:g,firstChild:c,lastChild:p,name:b,tag:w}=this,k=new le(this,a),_=["unclosed-quote","obsolete-attr"],{lintConfig:v}=I,m=_.map(A=>v.getSeverity(A,b));if(m[0]&&!g){const A=B(p,k,_[0],"unclosed-quotes",m[0]);A.startIndex--,A.startCol--,v.computeEditInfo&&(A.suggestions=[qe(A.endIndex,f(this,i)[0])]),h.push(A)}const S=R(this,n,Ji).call(this,a,k);return S&&h.push(S),m[1]&&((u=io[w])!=null&&u.has(b))&&h.push(B(c,k,_[1],"obsolete-attribute",m[1])),h}}getValue(){return f(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(a){return a==="invalid"?R(this,n,Ji).call(this):super.getAttribute(a)}print(){const[a="",d=""]=f(this,i);return f(this,s)?super.print({sep:Ut(f(this,s))+a,post:d}):super.print()}json(a,d=this.getAbsoluteIndex()){const u=super.json(void 0,d)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakSet,Ji=function(a,d){const{firstChild:u,lastChild:h,type:g,name:c,tag:p,parentNode:b}=this,w=!h.childNodes.some(({type:y})=>vr.has(y)),k=this.getValue(),_=so[p],v=to[p],{length:m}=this.toString();let S="illegal-attr",A,x;if({lintConfig:A}=I,{computeEditInfo:x}=A,!(_!=null&&_.has(c))&&!(v!=null&&v.has(c))&&(g==="ext-attr"?_||v:!/\{\{[^{]+\}\}/u.test(c))&&(g==="ext-attr"&&!v||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(c)&&(p==="meta"||p==="link"||!eo.has(c)))||(c==="itemtype"||c==="itemid"||c==="itemref")&&!(b!=null&&b.hasAttr("itemscope"))){if(a===void 0)return!0;{const y=A.getSeverity(S,"unknown");if(y){const T=B(u,d,S,"illegal-attribute-name",y);return x&&(T.suggestions=[U(a,m)]),T}}}else if(c==="style"&&typeof k=="string"&&mr.test(k)){if(a===void 0)return!0;{S="insecure-style";const y=A.getSeverity(S);return y&&B(h,d,S,"insecure-style",y)}}else if(c==="tabindex"&&typeof k=="string"&&k!=="0"){if(a===void 0)return!0;{const y=A.getSeverity(S,"tabindex");if(y){const T=B(h,d,S,"nonzero-tabindex",y);return x&&(T.suggestions=[U(a,m),$e(T,"0 tabindex","0")]),T}}}else if(typeof k=="string"&&((/^xmlns:[\w:.-]+$/u.test(c)||br.has(c))&&xr.test(k)||w&&(c==="href"||p==="img"&&c==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(k))){if(a===void 0)return!0;{const y=A.getSeverity(S,"value");return y&&B(h,d,S,"illegal-attribute-value",y)}}else if(w&&g!=="ext-attr"){const y=zl(p,c),T=String(k).toLowerCase();if(y.length>0&&y.every($=>$!==T)){if(a===void 0)return!0;{const $=A.getSeverity(S,"value");return $&&B(h,d,S,"illegal-attribute-value",$)}}}return!1},l)}}),si,wr,yr,As,fn=C({"src/attributes.ts"(){"use strict";var e,t,us,i;M(),ge(),de(),W(),q(),ze(),Qa(),si=n=>n.slice(0,-1),wr=n=>`${si(n)}-dirty`,yr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(n){return/[^\W_]/u}})(),As=(i=class extends j{constructor(r,l,o,a,d=[]){super(void 0,a,d,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",o),r){const u=/([^\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=u.exec(r),c=0;const p=(()=>{h&&(super.insertAt(new xe(h,wr(l),a,d,{})),h="")});for(;g;){const{index:b,0:w,1:k,2:_,3:v,4:m,5:S,6:A}=g;if(h+=r.slice(c,b),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(be(k).trim())){const x=m!=null?m:A,y=[v,S],T=new as(si(l),o,k,_,x,y,a,d);p(),super.insertAt(T)}else h+=w;({lastIndex:c}=u),g=u.exec(r)}h+=r.slice(c),p()}}get type(){return f(this,e)}afterBuild(){const{parentNode:r}=this;r!=null&&r.is("td")&&this.setAttribute("name",r.subtype),super.afterBuild()}getAttrTokens(r){return this.childNodes.filter(l=>l instanceof as&&(!r||l.name===pt(r)))}hasAttr(r){return this.getAttrTokens(r).length>0}getAttrToken(r){const l=this.getAttrTokens(r);return l[l.length-1]}getAttr(r){var l;return(l=this.getAttrToken(r))==null?void 0:l.getValue()}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{parentNode:a,childNodes:d}=this,u=new Map,h=new Set,g=new le(this,r),c=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:b,fix:w}=p,k=["closingTag","invalidAttributes","nonWordAttributes"].map(v=>p.getSeverity(c[0],v));if(k[0]&&R(this,t,us).call(this)){const v=G(this,g,c[0],"attributes-of-closing-tag",k[0]);if(b){const m=a.getAbsoluteIndex();v.suggestions=[U(v),on(m)]}o.push(v)}for(const v of d)if(v instanceof as){const{name:m}=v;u.has(m)?(h.add(m),u.get(m).push(v)):u.set(m,[v])}else{const m=v.text().trim(),S=k[yr.test(m)?1:2];if(m&&S){const A=B(v,g,c[0],"invalid-attribute",S);b&&(A.suggestions=[U(A,0," ")]),o.push(A)}}const _=p.getSeverity(c[1],"attribute");if(_&&h.size>0)for(const v of h){const m=u.get(v).map(S=>{const A=S.getValue();return[S,A===!0?"":A]});o.push(...m.map(([S,A],x)=>{const y=B(S,g,c[1],I.msg("duplicate-attribute",v),_);if(b||w){const T=U(y);!A||m.slice(0,x).some(([,$])=>$===A)?y.fix=T:b&&(y.suggestions=[T])}return y}))}return o}}getAttribute(r){return r==="invalid"?R(this,t,us).call(this):super.getAttribute(r)}print(){return this.toString()?`<span class="wpb-${this.type}${R(this,t,us).call(this)?" wpb-invalid":""}">${this.childNodes.map(r=>r.print(r instanceof xe?{class:r.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,us=function(){const{parentNode:r}=this;return(r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()!==""},i)}}),no={};se(no,{PreToken:()=>ro});var ro,Ja=C({"src/pre.ts"(){"use strict";We(),q(),Ue(),ro=class extends j{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,n=/<\/nowiki>/giu,{length:r}=i.source;let l=i.exec(e);l&&(n.lastIndex=l.index+r);let o=n.exec(e),a=0,d="";for(;l&&o;)new ce(l[0],t,s),new ce(o[0],t,s),d+=`${e.slice(a,l.index)}\0${s.length-1}n${e.slice(l.index+r,o.index)}\0${s.length}n`,a=o.index+r+1,i.lastIndex=a,l=i.exec(e),l&&(n.lastIndex=l.index+r),o=n.exec(e);e=d+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",we-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),_s,mn=C({"mixin/multiLine.ts"(){"use strict";_s=e=>{class t extends e{toString(i){return super.toString(i,`
3
3
  `)}text(){return super.text(`
4
4
  `).replace(/\n\s*\n/gu,`
5
5
  `)}getGaps(){return 1}print(){return super.print({sep:`
6
- `})}}return t}}}),oo={};se(oo,{ParamTagToken:()=>it});var Sr,ii,kr,it,ao=C({"src/paramTag/index.ts"(){"use strict";z(),de(),Ts(),mn(),W(),q(),ze(),Sr=[_s],it=class extends(kr=F){get type(){return"ext-inner"}constructor(e,t,s=I.getConfig(),i=[],n){if(super(void 0,s,i,{}),t){const r=xe;this.append(...t.split(`
7
- `).map(l=>n?l:Qt(l,s,i,e)).map(l=>new r(l,"param-line",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 n=new le(this,e),r=I.msg("invalid-parameter",this.name),l=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const u=o.childNodes.filter(({type:d})=>d!=="comment"&&d!=="include"&&d!=="noinclude");if(u.some(({type:d})=>d==="ext"))l.push(B(o,n,t,r,i));else{const d=u.findIndex(({type:h})=>h!=="text"),a=u.slice(0,d===-1?void 0:d).map(String).join("");if(a&&!(d===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(a)){const h=B(o,n,t,r,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}}},ii=K(kr),it=X(ii,0,"ParamTagToken",Sr,it),J(ii,1,it)}}),Ar,ni,_r,nt,uo=C({"src/heading.ts"(){"use strict";var e,t,ds,i;z(),Ne(),de(),Fe(),W(),q(),bt(),Ar=[Ie],nt=(i=class extends(_r=F){constructor(r,l,o,u=[]){super(void 0,o,u);N(this,t);N(this,e);L(this,e,r);const d=new F(l[0],o,u);d.type="heading-title",d.setAttribute("stage",2);const a=new et(l[1],"heading-trail",o,u);this.append(d,a)}get type(){return"heading"}get level(){return m(this,e)}toString(r){const l=R(this,t,ds).call(this);return l+this.firstChild.toString(r)+l+this.lastChild.toString(r)}text(){const r=R(this,t,ds).call(this);return r+this.firstChild.text()+r}getAttribute(r){return r==="invalid"?this.inHtmlAttrs()===2:r==="padding"?this.level:super.getAttribute(r)}getGaps(){return this.level}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{firstChild:u,level:d}=this,a=u.toString(),h=a.startsWith("="),g=h||a.endsWith("="),c=new le(this,r),p=this.inHtmlAttrs(),v=["h1","unbalanced-header","format-leakage"],{lintConfig:b}=I,{computeEditInfo:S,fix:A}=b,w=v.map(f=>b.getSeverity(f,"apostrophe"));if(w[0]&&this.level===1){const f=B(u,c,v[0],"<h1>",w[0]);S&&!g&&(f.suggestions=[$e(f,"h2",`=${a}=`)]),o.push(f)}if(w[1]&&g){const f=I.msg("unbalanced-in-section-header",'"="'),y=B(u,c,v[1],f,w[1]);if(!(!S||a==="="))if(h){const[_]=/^=+/u.exec(a),x=d+_.length;y.suggestions=[{desc:`h${d}`,range:[y.startIndex,y.startIndex+_.length],text:""}],x<7&&y.suggestions.push({desc:`h${x}`,range:[y.endIndex,y.endIndex],text:_})}else{const _=/[^=](=+)$/u.exec(a)[1],x=d+_.length;y.suggestions=[{desc:`h${d}`,range:[y.endIndex-_.length,y.endIndex],text:""}],x<7&&y.suggestions.push({desc:`h${x}`,range:[y.startIndex,y.startIndex],text:_})}o.push(y)}if(p){const f="parsing-order",y=b.getSeverity(f,p===2?"heading":"templateInTable");y&&o.push(Q(this,c,f,"header-in-html",y))}if(w[2]){const f=this.getRootNode().toString(),y=u.childNodes.filter(Cs("quote")),_=y.filter(({bold:k})=>k),x=y.filter(({italic:k})=>k);if(_.length%2){const k=B(_[_.length-1],Le(me({},c),{start:r+d,left:c.left+d}),v[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),w[2]);if(S||A){const T=r+d+a.length,$=U(k);f.slice(k.endIndex,T).trim()?S&&(k.suggestions=[$,qe(T,"'''")]):_.length===1&&x.length===0?k.fix=$:S&&(k.suggestions=[$])}o.push(k)}if(x.length%2){const k=B(x[x.length-1],{start:r+d},v[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),w[2]);if(S||A){const T=r+d+a.length;f.slice(k.endIndex,T).trim()?S&&(k.suggestions=[qe(T,"''")]):x.length===1&&_.length===0?k.fix=U(k):S&&(k.suggestions=[U(k)])}o.push(k)}}return o}}print(){const r=R(this,t,ds).call(this);return super.print({pre:r,sep:r})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakMap,t=new WeakSet,ds=function(){return"=".repeat(this.level)},i),ni=K(_r),nt=X(ni,0,"HeadingToken",Ar,nt),J(ni,1,nt)}}),$r,ho,Ka=C({"src/parameter.ts"(){"use strict";ge(),z(),W(),q(),$r=new RegExp(`https?://${ht}${ct}$`,"iu"),ho=class extends F{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const n=new F(typeof e=="number"?void 0:e,s,i,{}),r=new F(t,s,i);n.type="parameter-key",n.setAttribute("stage",2),r.type="parameter-value",r.setAttribute("stage",2),this.append(n,r)}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),n="unescaped",{lintConfig:r}=I,l=r.getSeverity(n);if(l){const{firstChild:o}=this,u=(s=$r.exec(o.text()))==null?void 0:s[0];try{if(u&&new URL(u).search){const d=B(o,{start:e},n,"unescaped-query",l);d.startIndex=d.endIndex,d.startLine=d.endLine,d.startCol=d.endCol,d.endIndex++,d.endCol++,(r.computeEditInfo||r.fix)&&(d.fix=ft(d.startIndex,"{{=}}")),i.push(d)}}catch(d){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),Tr,ri,Cr,rt,Ya=C({"src/transclude.ts"(){"use strict";var e,t,s,i,n,r,hs,co,u;ge(),z(),Ne(),de(),Ss(),Fe(),W(),q(),Ka(),ze(),bt(),Tr=[Ie,Vt()],rt=(u=class extends(Cr=F){constructor(a,h,g,c=[]){var $,j;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`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,r);Ee(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,n);const{parserFunction:[b,S],variable:A,functionHook:w}=g,f=($=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(a))==null?void 0:$[0];if(f)this.setAttribute("modifier",f),a=a.slice(f.length);else if(a.includes(":")){const[E,...P]=a.split(":"),[ne]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((j=P[0])!=null?j:"");this.setModifier(`${E}:${ne}`)&&(a=P.join(":").slice(ne.length))}const y=a.search(/[::]/u),_=a[y]===":",x=y!==-1;if(x||h.length===0&&!m(this,s)){const E=x?a.slice(0,y):a,P=x&&a.slice(y+1),ne=be(E),O=x?ne.slice(ne.search(/\S/u))+(_?":":""):ne.trim(),re=O.toLowerCase(),fe=Array.isArray(S),G=fe?S.includes(O):Object.prototype.hasOwnProperty.call(S,O),D=!fe&&G?S[O]:Object.prototype.hasOwnProperty.call(b,re)&&b[re],Y=fe&&G||!("functionHook"in g)||w.includes(D),M=fe&&G||A.includes(D);if(x?D&&Y:M){this.setAttribute("name",D||re.replace(/^#|:$/u,"")),L(this,e,"magic-word"),_&&L(this,t,":");const Z=new et(E,"magic-word-name",g,c);if(super.insertAt(Z),P!==!1&&h.unshift([P]),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 E=be(a).trim();if(!this.normalizeTitle(E,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const P=new xe(a,"template-name",g,c,{});super.insertAt(P)}typeof p=="number"&&(c[p]=void 0);const k=this.isTemplate();let T=1;for(let E=0;E<h.length;E++){const P=h[E];k||this.name==="switch"&&E>0||this.name==="tag"&&E>1||(P[0]=P.join("="),P.length=1),P.length===1&&(P.unshift(T),T++),this.insertAt(new ho(...P,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=be(a).trim();if(a&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),v=h.includes(p),b=g.includes(p);return m(this,s)&&v||!m(this,s)&&(b||!a)||(ke.running||this.length>1)&&(v||b||!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,n,R(this,r,hs).call(this)),this.setAttribute("name",m(this,n).title))}toString(a){const{childNodes:h,length:g,firstChild:c,modifier:p,type:v}=this;return`{{${p}${v==="magic-word"?c.toString(a)+(g===1?"":m(this,t))+h.slice(1).map(b=>b.toString(a)).join("|"):super.toString(a,"|")}}}`}text(){const{childNodes:a,length:h,firstChild:g,modifier:c,type:p,name:v}=this;return p==="magic-word"&&v==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(h===1?"":m(this,t))+Xe(a.slice(1),"|"):super.text("|")}}}`}getAttribute(a){switch(a){case"padding":return this.modifier.length+2;case"title":return m(this,n);case"colon":return m(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!R(this,r,hs).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:v}=this,b=new le(this,a),{lintConfig:S}=I,{computeEditInfo:A}=S,w=c==="magic-word";let f="no-ignored",y=S.getSeverity(f,"fragment");if(w&&!R(this,r,hs).call(this).valid)f="invalid-invoke",y=S.getSeverity(f,"name"),y&&g.push(B(p[1],b,f,"illegal-module",y));else if(y){const _=p[w?1:0],x=_.childNodes.findIndex(T=>T.type==="text"&&ms(T.data).includes("#")),k=_.childNodes[x];if(k){const T=B(_,b,f,"useless-fragment",y);A&&(T.suggestions=[U(T,_.getRelativeIndex(x)+k.data.indexOf("#"))]),g.push(T)}}if(f="invalid-invoke",y=S.getSeverity(f,"function"),y&&w&&v===2)return g.push(Q(this,b,f,"missing-function",y)),g;if(f="no-duplicate",y=S.getSeverity(f,"parameter"),y){const _=this.getDuplicatedArgs().filter(([,k])=>!k[0].querySelector("ext")),x="duplicate-parameter";for(const[,k]of _)g.push(...k.map(T=>{const $=B(T,b,f,x,y);return A&&($.suggestions=[U($,-1)]),$}))}return g}}insertAt(a,h=this.length){return super.insertAt(a,h),a.anon?R(this,r,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:v})=>c===v)),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 v=g.slice(2),b=v[v.length-1];p=[...v.filter(({anon:S})=>!S),...b!=null&&b.anon?[b]:[]].map(({lastChild:S})=>S);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:v})=>v));for(let v=0;v<p.length;){const{length:b,0:S}=p[v].childNodes.filter(A=>A.text().trim());if(b===0)p.splice(v,1);else if(b>1||S.type!=="magic-word")v++;else try{const A=S.getPossibleValues();p.splice(v,1,...A),v+=A.length}catch(A){v++}}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"?Ut(c)+g.print()+(h===1?"":m(this,t))+pt(a.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Ut(c)}</span>`:"")+pt(a,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,hs=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:v}=p,b=String(c+1);(v!==b||p===a)&&(p.setAttribute("name",b),this.getArgs(b,!1,!1).add(p))}},u),ri=K(Cr),rt=X(ri,0,"TranscludeToken",Tr,rt),J(ri,1,rt)}}),Ir,li,Nr,jt,Za=C({"src/hidden.ts"(){"use strict";vt(),q(),Ir=[Ze()],jt=class extends(Nr=F){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},li=K(Nr),jt=X(li,0,"HiddenToken",Ir,jt),J(li,1,jt)}}),Lr,oi,Er,Pt,eu=C({"src/arg.ts"(){"use strict";var e,tu,s;ge(),z(),de(),We(),Ss(),Fe(),W(),q(),ze(),Za(),Lr=[Ie,je("{{{"),Vt()],Pt=(s=class extends(Er=F){constructor(n,r,l=[]){super(void 0,r,l,{});N(this,e);for(let o=0;o<n.length;o++){const u=n[o];if(o===0){const d=new xe(u,"arg-name",r,l,{});super.insertAt(d)}else if(o>1){const d=new jt(u,r,l);super.insertAt(d)}else{const d=new F(u,r,l);d.type="arg-default",d.setAttribute("stage",2),super.insertAt(d)}}}get type(){return"arg"}get default(){}toString(n){return`{{{${super.toString(n,"|")}}}}`}text(){return`{{{${Xe(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(n=this.getAbsoluteIndex(),r){{const{childNodes:[l,o,...u]}=this;l.setAttribute("aIndex",n+3);const d=l.lint(n+3,r);if(o){const p=n+4+l.toString().length;o.setAttribute("aIndex",p);const v=o.lint(p,r);v.length>0&&d.push(...v)}const a=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=a.map(p=>h.getSeverity(p,"arg"));if(c[0]&&u.length>0){const p=new le(this,n);d.push(...u.map(v=>{const b=B(v,p,a[0],"invisible-triple-braces",c[0]);return b.startIndex--,b.startCol--,g&&(b.suggestions=[U(b),ft(b.startIndex,"{{!}}")]),b}))}if(c[1]&&!this.getAttribute("include")){const p=Q(this,{start:n},a[1],"unexpected-argument",c[1]);g&&o&&(p.suggestions=[$e(p,"expand",o.text())]),d.push(p)}return d}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(n,r=this.getAbsoluteIndex()){const l=super.json(void 0,r)}},e=new WeakSet,tu=function(){},s),oi=K(Er),Pt=X(oi,0,"ArgToken",Lr,Pt),J(oi,1,Pt)}}),go={};se(go,{parseBraces:()=>$s});var Fr,ai,ts,ui,di,hi,jr,ci,$s,xn=C({"parser/braces.ts"(){"use strict";Ye(),ge(),uo(),Ya(),eu(),Fr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ai=String.raw`\[(?!\[)`,ts=String.raw`\n(?![=\0])`,ui=String.raw`|\{{2,}`,di=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),hi=dt(e=>new RegExp(e,"gmu")),jr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ai}|${ts})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ts})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ai}|${ts})*\}-`,"gu"),ci=e=>{const t=gt(be(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,v,b,S,A;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,n]}=t,r=[],l=[],o=(w,f,y,_)=>{f[f.length-1].push(ye(w.slice(y,_),l))};let u;do u!==void 0&&(e=u),u=e.replace(jr,(w,f,y)=>{if(f!==void 0||typeof y=="string")try{const{length:_}=s,x=(f!=null?f:y).split("|");return new rt(ye(x[0],l),x.slice(1).map(k=>{const T=k.indexOf("=");return(T===-1?[k]:[k.slice(0,T),k.slice(T+1)]).map($=>ye($,l))}),t,s),`\0${_}${ci(x[0])}`}catch(_){if(!(_ instanceof SyntaxError)||_.message!=="Invalid template name")throw _}return l.push(ye(w,l)),`\0${l.length-1}`});while(u!==e);e=u;const d=e.lastIndexOf("}}")-e.length;let a=d+e.length!==-1,h=hi(i+(a?ui:"")),g=h.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((v=(p=r[r.length-1])==null?void 0:p[0])!=null&&v.startsWith("="));){if(g!=null&&g[1]){const[,{length:P}]=g;g[0]=g[0].slice(P),g.index+=P}const{0:w,index:f}=g!=null?g:{0:`
8
- `,index:e.length},y=(b=r.pop())!=null?b:{},{0:_,index:x,parts:k,findEqual:T,pos:$}=y,j=w==="="&&T;if(w==="]]"||w==="}-")c=f+2;else if(w===`
9
- `){c=f+1;const{pos:P,findEqual:ne}=(S=r[r.length-1])!=null?S:{};if(P===void 0||ne||be(e.slice(P,x))!==""){const O=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(x,f));O&&(O[2]=ye(O[2],l),O[2].includes(`
10
- `)||(e=`${e.slice(0,x)}\0${s.length}h${e.slice(f)}`,c=x+4+String(s.length).length,new nt(O[1].length,O.slice(2),t,s)))}}else if(w==="|"||j)c=f+1,o(e,k,$,f),w==="|"&&k.push([]),y.pos=c,y.findEqual=w==="|",r.push(y);else if(w.startsWith("}}")){const P=w.slice(0,Math.min(_.length,3)),ne=_.length-P.length,{length:O}=s;c=f+P.length,o(e,k,$,f);let re=!1,fe="t";if(P.length===3){const G=k.map(Y=>Y.join("=")),D=G.length>1&&be(G[1]).trim();new Pt(G,t,s),D&&D.endsWith(":")&&n.includes(D.slice(0,-1).toLowerCase())&&(fe="s")}else try{new rt(k[0][0],k.slice(1),t,s),fe=ci(k[0][0])}catch(G){if(G instanceof SyntaxError&&G.message==="Invalid template name")re=!0;else throw G}re||(e=`${e.slice(0,x+ne)}\0${O}${fe}${e.slice(c)}`,c=x+ne+3+String(O).length,ne>1?r.push({0:_.slice(0,ne),index:x,pos:x+ne,parts:[[]]}):ne===1&&e[x-1]==="-"&&r.push({0:"-{",index:x-1,pos:x+1,parts:[[]]}))}else c=f+w.length,w.startsWith("{")&&(g.pos=c,g.parts=[[]]),r.push(..."0"in y?[y]:[],g);let E=r[r.length-1];if(a&&d+e.length<c)for(a=!1;(A=E==null?void 0:E[0])!=null&&A.startsWith("{");)r.pop(),E=r[r.length-1];h=hi(i+(a?ui:"")+(E?`|${Fr[E[0][0]]}${E.findEqual?"|=":""}`:"")),h.lastIndex=c,g=h.exec(e)}return ye(e,l)}}}),po={};se(po,{InputboxToken:()=>fo});var fo,su=C({"src/paramTag/inputbox.ts"(){"use strict";Ts(),xn(),W(),ao(),fo=class extends it{constructor(e,t,s=I.getConfig(),i=[]){const n=Symbol("InputboxToken"),r=s.excludes.includes("heading")?s:Le(me({},s),{excludes:[...s.excludes,"heading"]}),{length:l}=i;i.push(n),t&&(t=Qt(t,r,i,e)),t&&(t=$s(t,r,i)),i.splice(l,1),super(e,t,r,i,{})}}}}),cs={};se(cs,{NestedToken:()=>mo});var Pr,Rr,mo,gi=C({"src/nested.ts"(){"use strict";var e,t,s;z(),de(),Ts(),xn(),W(),q(),Fo(),Me(),Pr=new Set(["comment","include","arg","template","magic-word"]),Rr=[!1,!0].map(i=>{const n=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${n}(?:\s[^>]*)?/?>|</${n}\s*>)$`,"iu")}),mo=(s=class extends F{constructor(n,r,l,o,u=[]){if(typeof r=="boolean"){const d=Symbol("NestedToken"),{length:a}=u;u.push(d),n&&(n=Qt(n,o,u,r)),n&&(n=$s(n,o,u)),u.splice(a,1)}else n&&(n=n.replace(r,(d,a,h,g,c)=>{const p=`\0${u.length+1}e`;return new ut(a,h,g,c,o,!1,u),p}));n&&(n=n.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(d,a,h)=>(new ce(h,o,u),`${a}\0${u.length}n`)));super(n,o,u);N(this,e);N(this,t);L(this,e,[...l]),L(this,t,r)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex(),r){{const l=super.lint(n,r),o="no-ignored",{lintConfig:u}=I,d=u.getSeverity(o,this.name);if(!d)return l;const a=new le(this,n),h=typeof m(this,t)=="boolean"?Rr[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(Pr.has(c))return!1;const v=g.toString().trim();return v&&!h.test(v)}).map(g=>{const c=B(g,a,o,I.msg("invalid-content",this.name),d);return u.computeEditInfo&&(c.suggestions=[U(c),an(c,g.toString())]),c})]}}},e=new WeakMap,t=new WeakMap,s)}});function Or(e,t,s,i,n){t=be(t).trim();let r=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!r&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(r);case"link":{if(r){if(xo(s.protocol).test(r))return vo(s.protocol).test(r)&&t;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2))}else return t;const l=I.normalizeTitle(r,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0});return l.valid&&l}case"lang":return(n==="svg"||n==="svgz")&&!/[^a-z\d-]/u.test(r);case"alt":case"class":case"manualthumb":return!0;case"page":return(n==="djvu"||n==="djv"||n==="pdf")&&Number(r)>0;default:return!!r&&!isNaN(r)}}var xo,vo,Br,qr,bo,iu=C({"src/imageParameter.ts"(){"use strict";var e,t,wo,n;Ye(),ge(),z(),W(),q(),xo=dt(r=>new RegExp(String.raw`^(?:${r}|//|\0\d+m\x7F)`,"iu")),vo=dt(r=>new RegExp(String.raw`^(?:(?:${r}|//)${ht}|\0\d+m\x7F)${ct}$`,"iu")),Br=dt(r=>new RegExp(String.raw`^(\s*(?!\s))${r.replace("$1","(.*)")}${r.endsWith("$1")?`(?=$|
11
- )`:""}(\s*)$`,"u")),qr=new Set(["alt","link","lang","page","caption"]),bo=(n=class extends F{constructor(l,o,u,d){var r=(...i)=>(super(...i),N(this,t),N(this,e,""),this);let a;const h=Object.entries(u.img).map(([c,p])=>[c,p,Br(c)]),g=h.find(([,c,p])=>(a=p.exec(l),a&&(a.length!==4||Or(c,a[2],u,!0,o)!==!1)));if(g&&a){a.length===3?(r(void 0,u,d),L(this,e,l)):(r(a[2],u,d,{}),L(this,e,a[1]+g[0]+a[3])),this.setAttribute("name",g[1]);return}r(l,u.excludes.includes("list")?u:Le(me({},u),{excludes:[...u.excludes,"list"]}),d),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Or("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"}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 u=super.lint(l,o),{lintConfig:d}=I,{computeEditInfo:a,fix:h}=d,{link:g,name:c}=this;if(c==="invalid"){const p="invalid-gallery",v=d.getSeverity(p,"parameter");if(v){const b=Q(this,{start:l},p,"invalid-image-parameter",v);(a||h)&&(b.fix=U(b,-1)),u.push(b)}}else if(typeof g=="object"&&g.encoded){const p="url-encoding",v=d.getSeverity(p,"file");if(v){const b=Q(this,{start:l},p,"unnecessary-encoding",v);(a||h)&&(b.fix=ln(b,this)),u.push(b)}}return u}}getValue(){return this.name==="invalid"?this.text():R(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">${pt(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")},n)}}),pi,Wr,zr,fi,mi,xi,Mr,vi,vn,yo=C({"src/link/file.ts"(){"use strict";z(),de(),W(),ys(),iu(),pi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Wr=new Set(["arg"]),zr=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"]),Mr=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),n=0,r=0;for(;i;){const{0:l,index:o}=i;l!=="|"?n+=l==="-{"?1:-1:n===0&&(s.push(e.slice(r,o)),{lastIndex:r}=t),i=t.exec(e)}return s.push(e.slice(r)),s},vi=(e,t)=>e.filter(({childNodes:s})=>{const i=s.filter(n=>n.text().trim());return i.length!==1||!t.has(i[0].type)}),vn=class extends Oe{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,i=[],n="|"){super(e,void 0,s,i,n);const{extension:r}=this.getTitle(!0,!0);this.safeAppend(Mr(t).map(l=>new bo(l,r,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),n=vi(this.getAllArgs(),Wr),r=[...new Set(n.map(({name:f})=>f))],l=r.filter(f=>pi.has(f)),o=r.filter(f=>fi.has(f)),u=r.filter(f=>mi.has(f)),[d]=l,a=d==="framed"||d==="manualthumb",h=new le(this,e),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,{extension:v}=this;let b="nested-link",S=g.getSeverity(b,"file");if(S&&xi.has(v)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const f=Q(this,h,b,"link-in-extlink",S);if(c||p){const y=this.getArg("link");if(y){const _=e+y.getRelativeIndex();f.fix={desc:I.msg("delink"),range:[_,_+y.toString().length],text:"link="}}else f.fix=bs(f.endIndex-2,"delink","|link=")}i.push(f)}if(b="invalid-gallery",S=g.getSeverity(b,"parameter"),S&&a)for(const f of n.filter(({name:y})=>y==="width")){const y=B(f,h,b,"invalid-image-parameter",S);(c||p)&&(y.fix=U(y,-1)),i.push(y)}if(n.length===r.length&&l.length<2&&o.length<2&&u.length<2)return i;b="no-duplicate";const A=["unknownImageParameter","imageParameter"].map(f=>g.getSeverity(b,f)),w=(f,y,_,x=!0)=>f.map(k=>{if(S=A[Number(typeof x=="function"?x(k):x)],!S)return!1;const T=B(k,h,b,I.msg(`${y}-image-parameter`,_),S);return c&&(T.suggestions=[U(T,-1)]),T}).filter(k=>k!==!1);for(const f of r){if(f==="invalid"||f==="width"&&a)continue;const y=f==="caption";let _=n.filter(({name:x})=>x===f);if(y&&(_=[..._.slice(0,-1).filter(x=>x.text()),..._.slice(-1)]),_.length>1){let x=!y||!v||xi.has(v);if(y&&x){const k=vi(_,zr);x=k.length>1&&(T=>k.includes(T))}i.push(...w(_,"duplicate",f,x))}}return l.length>1&&i.push(...w(n.filter(({name:f})=>pi.has(f)),"conflicting","frame")),o.length>1&&i.push(...w(n.filter(({name:f})=>fi.has(f)),"conflicting","horizontal-alignment")),u.length>1&&i.push(...w(n.filter(({name:f})=>mi.has(f)),"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()){const s=super.json(void 0,t)}}}}),Ur,bi,Hr,lt,So=C({"src/link/galleryImage.ts"(){"use strict";var e,Xi,s;z(),Ke(),We(),W(),q(),yo(),Ur=[je("")],lt=(s=class extends(Hr=vn){constructor(n,r,l,o,u=[]){let d;if(l!==void 0){const{length:a}=u;d=new F(l,o,u);for(let h=0;h<Se-1;h++)d.parseOnce();u.splice(a,1)}super(r,d==null?void 0:d.toString(),o,u);N(this,e);Ee(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${n}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(n){const r=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),r?0:6,{halfParsed:!0,temporary:n,decode:!r})}lint(n=this.getAbsoluteIndex(),r){{const l=super.lint(n,r),o="invalid-gallery",{lintConfig:u}=I,d=u.getSeverity(o,"image");if(d&&R(this,e,Xi).call(this)){const a=Q(this,{start:n},o,"invalid-gallery",d);u.computeEditInfo&&(a.suggestions=[bs(n,"prefix","File:")]),l.push(a)}return l}}getAttribute(n){return n==="invalid"?R(this,e,Xi).call(this):super.getAttribute(n)}},e=new WeakSet,Xi=function(){const{ns:n}=this.getAttribute("title");return n!==6},s),bi=K(Hr),lt=X(bi,0,"GalleryImageToken",Ur,lt),J(bi,1,lt)}}),ko={};se(ko,{GalleryToken:()=>Rt});var Dr,wi,Gr,Rt,nu=C({"src/gallery.ts"(){"use strict";var e,Ao,ru,i;z(),mn(),W(),q(),So(),Me(),Dr=[_s],Rt=(i=class extends(Gr=F){constructor(r,l,o=[]){var u;super(void 0,l,o,{});N(this,e);for(const d of(u=r==null?void 0:r.split(`
12
- `))!=null?u:[]){const a=/^([^|]+)(?:\|(.*))?/u.exec(d);if(!a){super.insertAt(d.trim()?new ce(d,l,o):d);continue}const[,h,g]=a;R(this,e,Ao).call(this,h)?super.insertAt(new lt("gallery",h,g,l,o)):super.insertAt(new ce(d,l,o))}}get type(){return"ext-inner"}get widths(){}get heights(){}lint(r=this.getAbsoluteIndex(),l){{const{top:o,left:u}=this.getRootNode().posFromIndex(r),d=[],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],v=p.toString(),{length:b}=v,S=v.trim(),{type:A}=p,w=o+c,f=c?0:u;if(p.setAttribute("aIndex",r),A==="noinclude"&&S&&!/^<!--.*-->$/u.test(S)){let[y]=g;if(S.startsWith("|")?[,y]=g:(S.startsWith("<!--")||S.endsWith("-->"))&&([,,y]=g),y){const _=r+b,x={rule:a,message:I.msg("invalid-content","gallery"),severity:y,startIndex:r,endIndex:_,startLine:w,endLine:w,startCol:f,endCol:f+b};h.computeEditInfo&&(x.suggestions=[U(x),an(x,v)]),d.push(x)}}else if(A!=="noinclude"&&A!=="text"){const y=p.lint(r,l);y.length>0&&d.push(...y)}r+=b+1}return d}}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakSet,Ao=function(r){return this.normalizeTitle(r,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},ru=function(r){},i),wi=K(Gr),Rt=X(wi,0,"GalleryToken",Dr,Rt),J(wi,1,Rt)}}),bn,_o=C({"src/link/index.ts"(){"use strict";Ye(),z(),W(),ys(),bn=class extends Oe{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:n}=I,r=n.getSeverity(i);if(r&&this.closest("ext-link-text")){const l=Q(this,{start:e},i,"link-in-extlink",r);(n.computeEditInfo||n.fix)&&(l.fix=$e(l,"delink",this.innerText)),s.push(l)}return s}}}}}),Vr,Qr,Gt,wn=C({"src/magicLink.ts"(){"use strict";var e,t,Ki,i;z(),ge(),de(),W(),q(),Vr=String.raw`(?:[${Be}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,Qr=new RegExp(`${Vr}+`,"gu"),Gt=(i=class extends F{constructor(r,l="free-ext-link",o=I.getConfig(),u){super(r,o,u,{});N(this,t);N(this,e);L(this,e,l)}get type(){return m(this,e)}get innerText(){const r=new Map([["!","|"],["=","="]]);let l=Xe(this.childNodes.map(o=>{const{type:u}=o,d=String(o.name);return u==="magic-word"&&r.has(d)?r.get(d):o}));return this.type==="magic-link"&&(l=l.replace(Qr," ")),l}get link(){const{innerText:r}=this;return this.type==="magic-link"?r.startsWith("ISBN")?`ISBN ${r.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:r:Wl(r).replace(/\n/gu,"%0A")}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),u=new le(this,r),{lintConfig:d}=I,{type:a,childNodes:h}=this;if(a==="magic-link"){const v="invalid-isbn",b=d.getSeverity(v);return b&&R(this,t,Ki).call(this)&&o.push(Q(this,u,v,"invalid-isbn",b)),o}const g=a==="ext-link-url",c="unterminated-url",p=d.getSeverity(c,g?"pipe":"punctuation");if(p){const v=g?/\|/u:/[,;。:!?()]+/u,b=h.find(S=>S.type==="text"&&v.test(S.data));if(b){const{data:S}=b,A=B(b,u,c,I.msg("in-url",g?'"|"':"full-width-punctuation"),p);if(d.computeEditInfo){const{index:w,0:f}=v.exec(S),y=A.startIndex+w;A.suggestions=g?[Dt(y,1)]:[Dt(y),{desc:I.msg("encode"),range:[y,y+f.length],text:encodeURI(f)}]}o.push(A)}}return o}}getUrl(r){this.lspError("MagicLinkToken.getUrl")}getAttribute(r){return r==="invalid"?R(this,t,Ki).call(this):super.getAttribute(r)}},e=new WeakMap,t=new WeakSet,Ki=function(){if(this.type==="magic-link"){const{link:r}=this;if(r.startsWith("ISBN")){const l=[...r.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,u,d)=>o+u*(10-d),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,u,d)=>o+u*(d%2?3:1),0)%10!==0)}}return!1},i)}}),Jr,yi,Xr,ot,$o=C({"src/extLink.ts"(){"use strict";var e,t;Ke(),z(),We(),W(),q(),wn(),Jr=[je("[")],ot=(t=class extends(Xr=F){constructor(i,n="",r="",l,o=[]){super(void 0,l,o,{});N(this,e);const u=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(u),L(this,e,n),r){const d=new F(r,l,o,{});d.type="ext-link-text",d.setAttribute("stage",Se-1),this.insertAt(d)}}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(),n){{const r=super.lint(i,n),l="var-anchor",o=I.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.closest("heading-title")&&r.push(Q(this,{start:i},l,"variable-anchor",o)),r}}print(){return super.print(this.length===1?{pre:"[",post:`${m(this,e)}]`}:{pre:"[",sep:m(this,e),post:"]"})}},e=new WeakMap,t),yi=K(Xr),ot=X(yi,0,"ExtLinkToken",Jr,ot),J(yi,1,ot)}}),Yi,lu=C({"src/imagemapLink.ts"(){"use strict";q(),Me(),_o(),$o(),Yi=class extends F{get type(){return"imagemap-link"}constructor(e,t,s,i,n=[]){super(void 0,i,n),this.append(e,t.length===2?new bn(...t,i,n):new ot(...t,i,n),new ce(s,i,n))}}}}),To={};se(To,{ImagemapToken:()=>Ot});var Kr,Si,Yr,Ot,ou=C({"src/imagemap.ts"(){"use strict";z(),Ne(),de(),mn(),W(),q(),Me(),So(),lu(),Kr=[_s],Ot=class extends(Yr=F){get type(){return"ext-inner"}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
- `),n=new Set(t.protocol.split("|")),r=ce;let l=!0,o=!1;for(const u of i){const d=u.trim();if(!(o||!d||d.startsWith("#"))){if(l){const a=u.indexOf("|"),h=a===-1?u:u.slice(0,a),{valid:g,ns:c}=this.normalizeTitle(h,0,{halfParsed:!0,temporary:!0});if(g&&c===6){const p=new lt("imagemap",h,a===-1?void 0:u.slice(a+1),t,s);super.insertAt(p),l=!1;continue}else o=!0}else if(u.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(u);continue}else if(u.includes("[")){const a=u.indexOf("["),h=u.slice(a),g=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(h);if(g){if(this.normalizeTitle(g[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Yi(u.slice(0,a),g.slice(1),h.slice(h.indexOf("]]")+2),t,s));continue}}else if(h.startsWith("[//")||n.has(h.slice(1,h.indexOf(":")+1))||n.has(h.slice(1,h.indexOf("//")+2))){const c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(h);if(c){super.insertAt(new Yi(u.slice(0,a),c.slice(1),h.slice(h.indexOf("]")+1),t,s));continue}}}}super.insertAt(new r(u,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),{childNodes:n,image:r}=this,l="invalid-imagemap",{lintConfig:o}=I,u=o.getSeverity(l,r?"link":"image");return u&&(r?s.push(...n.filter(d=>{const a=d.toString().trim();return d.is("noinclude")&&a&&!a.startsWith("#")}).map(d=>{const a=B(d,i,l,"invalid-imagemap-link",u);return o.computeEditInfo&&(a.suggestions=[U(a,-1),$e(a,"comment","# ")]),a})):s.push(Q(this,i,l,"imagemap-without-image",u))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},Si=K(Yr),Ot=X(Si,0,"ImagemapToken",Kr,Ot),J(Si,1,Ot)}}),Zr,ki,el,at,Co=C({"src/nowiki/comment.ts"(){"use strict";z(),vt(),We(),W(),tt(),Zr=[Ze(!1),je("<!--")],at=class extends(el=Te){constructor(t,s,i,n){super(t,i,n);Ee(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=I,n=i.getSeverity(s);if(!n)return[];const r=Q(this,{start:t},s,I.msg("unclosed","html-comment"),n);return i.computeEditInfo&&(r.suggestions=[qe(r.endIndex,"-->")]),[r]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}},ki=K(el),at=X(ki,0,"CommentToken",Zr,at),J(ki,1,at)}}),Io={};se(Io,{CommentedToken:()=>No});var No,au=C({"src/commented.ts"(){"use strict";q(),Co(),No=class extends F{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),n=i!==-1&&e.indexOf("-->",i+4),r=0;for(;n!==!1&&n!==-1;)i>r&&this.insertAt(e.slice(r,i)),this.insertAt(new at(e.slice(i+4,n),!0,t,s)),r=n+3,i=e.indexOf("<!--",r),n=i!==-1&&e.indexOf("-->",i+4);r<e.length&&this.insertAt(e.slice(r))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Lo={};se(Lo,{NowikiToken:()=>Eo});var tl,sl,Eo,uu=C({"src/nowiki/index.ts"(){"use strict";var e,Zi,s;Ye(),z(),W(),tt(),tl=dt(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),sl=new Set(["languages","section","templatestyles"]),Eo=(s=class extends Te{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){{const{name:r}=this,l="void-ext",{lintConfig:o}=I,u=o.getSeverity(l,r);if(u&&R(this,e,Zi).call(this)){const d=Q(this,{start:n},l,I.msg("nothing-in",r),u);return o.computeEditInfo&&(d.suggestions=[U(d)]),[d]}return super.lint(n,tl(r))}}getAttribute(n){return n==="invalid"?R(this,e,Zi).call(this):super.getAttribute(n)}},e=new WeakSet,Zi=function(){const{name:n,firstChild:{data:r}}=this;return sl.has(n)&&!!r},s)}}),il,Ai,nl,ut,Fo=C({"src/tagPair/ext.ts"(){"use strict";z(),de(),W(),pn(),q(),gn(),fn(),il=[ks()],ut=class extends(nl=Qe){get type(){return"ext"}constructor(e,t,s,i,n=I.getConfig(),r=!1,l=[]){const o=e.toLowerCase(),u=new As(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,n,l),d=Le(me({},n),{ext:n.ext.filter(h=>h!==o),excludes:[...n.excludes],inExt:!0});let a;switch(o){case"tab":d.ext=d.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"&&d.excludes.push("heading"),a=new F(s,d,l);break;case"pre":{const{PreToken:h}=(Xa(),V(ro));a=new h(s,d,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(ao(),V(oo));a=new h(r,s,d,l);break}case"inputbox":{const{InputboxToken:h}=(su(),V(po));a=new h(r,s,d,l);break}case"references":{const{NestedToken:h}=(gi(),V(cs));d.excludes.push("heading"),a=new h(s,r,["ref"],d,l);break}case"choose":{const{NestedToken:h}=(gi(),V(cs));a=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,l);break}case"combobox":{const{NestedToken:h}=(gi(),V(cs));a=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,l);break}case"gallery":{const{GalleryToken:h}=(nu(),V(ko));a=new h(s,d,l);break}case"imagemap":{const{ImagemapToken:h}=(ou(),V(To));a=new h(s,d,l);break}case"hiero":{const{CommentedToken:h}=(au(),V(Io));a=new h(s,d,l);break}default:{const{NowikiToken:h}=(uu(),V(Lo));a=new h(s,d,l)}}a.setAttribute("name",o),a.type==="plain"&&(a.type="ext-inner"),super(e,u,a,i,n,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,n=new le(this,e);if(this.name!=="nowiki"){const o=this.inHtmlAttrs(),u="parsing-order",d=o&&i.getSeverity(u,o===2?"ext":"templateInTable");d&&s.push(Q(this,n,u,"ext-in-html",d))}const r="var-anchor",l=i.getSeverity(r,"ref");return l&&this.name==="ref"&&this.closest("heading-title")&&s.push(Q(this,n,r,"variable-anchor",l)),s}}},Ai=K(nl),ut=X(Ai,0,"ExtToken",il,ut),J(Ai,1,ut)}}),jo={};se(jo,{parseCommentAndExt:()=>Qt});var _i,rl,ss,ll,$i,Qt,Ts=C({"parser/commentAndExt.ts"(){"use strict";Ye(),ge(),Da(),Me(),Ga(),Va(),Fo(),Co(),_i="<onlyinclude>",rl="</onlyinclude>",{length:ss}=_i,ll=[!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(_i);return{i:t,j:e.indexOf(rl,t+ss)}},Qt=(e,t,s,i)=>{if(i){let{i:o,j:u}=$i(e);if(o!==-1&&u!==-1){let d="";const a=h=>{new ce(h,t,s),d+=`\0${s.length-1}n`};for(;o!==-1&&u!==-1;){const h=`\0${s.length}e`;new Et(e.slice(o+ss,u),t,s),o>0&&a(e.slice(0,o)),d+=h,e=e.slice(u+ss+1),{i:o,j:u}=$i(e)}return e&&a(e),d}}const{ext:n}=t,r=n.filter(o=>o!=="translate"&&o!=="tvar"),l=Le(me({},t),{ext:r});if(n.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,u=>(o.push(u),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(u,d,a)=>{const h=s.length;return new Yl(d,a&&ye(a,o),l,s),`\0${h}g`}),e=ye(e,o)}return e.replace(ll[i?1:0](r),(o,u,d,a,h,g,c,p,v)=>{const b=s.length;let S="n";if(u)S="e",new ut(u,d,a,h,l,g,s);else if(o.startsWith("<!--")){S="c";const A=o.endsWith("-->");new at(ye(o,s,1).slice(4,A?-3:void 0),A,t,s)}else g?new Ft(g,c&&ye(c,s,1),p&&ye(p,s,1),v,t,s):new ce(o,t,s);return`\0${b}${S}`})}}}),ol,al,ul,dl,Ti,hl,Bt,du=C({"src/html.ts"(){"use strict";var e,t,s,i,n;z(),Ne(),de(),pn(),W(),q(),ol=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),al=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"]),ul=new Set(["strike","big","center","font","tt"]),dl=[ks()],Bt=(n=class extends(hl=F){constructor(l,o,u,d,a,h){super(void 0,a,h);N(this,e);N(this,t);N(this,s);N(this,i);this.insertAt(o),this.setAttribute("name",l.toLowerCase()),L(this,e,u),L(this,t,d),L(this,s,l)}get type(){return"html"}get selfClosing(){return m(this,t)}get closing(){return m(this,e)}toString(l){return`<${this.closing?"/":""}${m(this,s)}${super.toString(l)}${m(this,t)?"/":""}>`}text(){const{closing:l}=this,o=m(this,s)+(l?"":super.text());return`<${l?"/":""}${o}${m(this,t)?"/":""}>`}getAttribute(l){return l==="invalid"?this.inTableAttrs()===2:l==="padding"?m(this,s).length+(this.closing?2:1):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){var u;{const d=super.lint(l,o),{name:a,parentNode:h,closing:g,selfClosing:c}=this,p=new le(this,l),{lintConfig:v}=I,{computeEditInfo:b,fix:S}=v,A=this.inTableAttrs();let w="h1",f=v.getSeverity(w,"html");if(f&&a==="h1"&&!g){const $=Q(this,p,w,"<h1>",f);b&&($.suggestions=[{desc:"h2",range:[l+2,l+3],text:"2"}]),d.push($)}if(w="parsing-order",f=A&&v.getSeverity(w,A===2?"html":"templateInTable"),f){const $=Q(this,p,w,"html-in-table",f);b&&A===2&&($.suggestions=[U($)]),d.push($)}if(w="obsolete-tag",f=v.getSeverity(w,a),f&&ul.has(a)&&d.push(Q(this,p,w,"obsolete-tag",f)),w="bold-header",f=v.getSeverity(w,a),f&&(a==="b"||a==="strong")&&((u=this.closest("heading-title,ext"))==null?void 0:u.type)==="heading-title"){const $=Q(this,p,w,"bold-in-header",f);b&&($.suggestions=[U($)]),d.push($)}const{html:[,y,_]}=this.getAttribute("config"),x=_.includes(a),k=y.includes(a),T=!x&&!k;if(w="unmatched-tag",g&&(c||x)||c&&T){if(f=v.getSeverity(w,g?"both":"selfClosing"),f){const $=Q(this,p,w,g?"closing-and-self-closing":"invalid-self-closing",f);if(b||S){const j=on(l),E={desc:I.msg("no-self-closing"),range:[$.endIndex-2,$.endIndex-1],text:""};k?b&&($.suggestions=[j,E]):g?$.fix=x?j:E:b&&($.suggestions=[E,qe($.endIndex,`></${a}>`,-2)])}d.push($)}}else if(!this.findMatchingTag()){const $=Q(this,p,w,g?"unmatched-closing":"unclosed-tag"),j=this.closest("magic-word");if(j&&ol.has(j.name))f=v.getSeverity(w,"conditional");else if(g)f=v.getSeverity(w,"closing"),$.suggestions=[U($)];else{f=v.getSeverity(w,"opening");const E=h==null?void 0:h.childNodes;al.has(a)&&(E!=null&&E.slice(0,E.indexOf(this)).some(P=>P.type==="html"&&P.name===a&&!P.findMatchingTag())&&($.suggestions=[qe(l+1,"/")]),this.closest("heading-title")&&($.rule="format-leakage",f=v.getSeverity("format-leakage",a)))}f&&($.severity=f,d.push($))}return d}}findMatchingTag(){return Je(m(this,i),()=>{const{name:l,parentNode:o,closing:u,selfClosing:d}=this,{html:[,a,h]}=this.getAttribute("config"),g=h.includes(l),c=a.includes(l);if(g||c&&d)return this;if(!o)return;const{childNodes:p}=o,v=p.indexOf(this),b=u?p.slice(0,v).reverse():p.slice(v+1),S=[this],{rev:A}=ke;for(const w of b)if(!(!w.is("html")||w.name!==l||c&&m(w,t)))if(m(w,e)===u)S.push(w);else{const f=S.pop();if(f===this)return w;I.viewOnly&&(L(f,i,[A,w]),L(w,i,[A,f]))}if(I.viewOnly)for(const w of S)L(w,i,[A,void 0])},l=>{L(this,i,l),l[1]&&l[1]!==this&&L(l[1],i,[ke.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${m(this,s)}`,post:`${m(this,t)?"/":""}&gt;`})}json(l,o=this.getAbsoluteIndex()){const u=super.json(void 0,o)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n),Ti=K(hl),Bt=X(Ti,0,"HtmlToken",dl,Bt),J(Ti,1,Bt)}}),Po={};se(Po,{parseHtml:()=>Ro});var cl,Ro,hu=C({"parser/html.ts"(){"use strict";fn(),du(),cl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Ro=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const n=e.split("<");let r=n.shift();for(const o of n){const u=cl.exec(o),d=u==null?void 0:u[2],a=d==null?void 0:d.toLowerCase();if(!u||!t.htmlElements.has(a)){r+=`<${o}`;continue}const[,h,,g="",c,p]=u,{length:v}=s,b=new As(g,"html-attrs",a,t,s),S=b.hasAttr("itemprop");if(a==="meta"&&!(S&&b.hasAttr("content"))||a==="link"&&!(S&&b.hasAttr("href"))){r+=`<${o}`,s.length=v;continue}r+=`\0${s.length}x${p}`,new Bt(d,b,h==="/",c==="/>",t,s)}return r}}}),yn,Oo=C({"src/table/base.ts"(){"use strict";pn(),q(),bt(),fn(),yn=class extends ks(1)(F){constructor(e,t,s,i,n,r=[],l){super(void 0,n,r,l),this.append(new et(t,"table-syntax",n,r),new As(i,"table-attrs",s,n,r))}escape(){}}}}),gl,Ci,_e,is,$t,Tt,xs,Bo=C({"src/table/td.ts"(){"use strict";z(),de(),cn(),W(),q(),Oo(),xs=class extends(Ci=yn,gl=[ws(!1)],Ci){constructor(e,t,s,i=[]){var o;let n=/\||\0\d+!\x7F/u.exec(t!=null?t:""),r=n?t.slice(0,n.index):"";/\[\[|-\{/u.test(r)&&(n=null,r=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",r,s,i),J(is,5,this),Re(this,$t),Re(this,_e,""),n&&([Pa(this,_e)._]=n);const l=new F(t==null?void 0:t.slice(((o=n==null?void 0:n.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,$t,Tt).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)),n="pipe-like",{lintConfig:r}=I,{computeEditInfo:l,fix:o}=r,u=["td","double"].map(d=>r.getSeverity(n,d));for(const d of this.lastChild.childNodes)if(d.type==="text"){const{data:a}=d;if(a.includes("|")){const h=a.includes("||"),g=u[h?1:0];if(g){const c=B(d,i,n,"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=[dn(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()){const s=super.json(void 0,t)}},is=K(Ci),_e=new WeakMap,$t=new WeakSet,Tt=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:n}=this;return me({},Ui(e=n,$t,Tt).call(e))},Tt=X(is,17,"#getSyntax",gl,$t,Tt),nn(is,xs)}}),Sn,qo=C({"src/table/trBase.ts"(){"use strict";z(),W(),Oo(),Bo(),Sn=class extends yn{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 n=Mt(i),r="fostered-content",l=n&&I.lintConfig.getSeverity(r,n===2?void 0:"transclusion");if(l){const o=B(i,{start:e},r,"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("+")))}}}}),pl,fl,ml,xl,Ii,ns,gs,cu=C({"src/table/index.ts"(){"use strict";z(),Ne(),de(),cn(),W(),qo(),bt(),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=Sn,xl=[ws(!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),n=["unclosed-table","table-layout"],r=n.map(l=>I.lintConfig.getSeverity(l));if(r[0]&&!this.closed&&s.push(B(this.firstChild,i,n[0],I.msg("unclosed","table"),r[0])),r[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let u=1,d=1/0,a=0;for(;a<o;a++){const h=l[a],g=h.length;if(g<u)break;g<d&&(d=g);const c=h.indexOf(h[g-1])+1;if(c>d)break;c>u&&(u=c)}if(a<o){const h=this.getNthRow(a),g=B(h,i,n[1],"inconsistent-table",r[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 n=new et(t?e:void 0,"table-syntax",s,i);super.insertAt(n)})}getLayout(e){const t=this.getAllRows(),{length:s}=t,i=ml.from(pl(s,()=>[]));for(let n=0;n<i.length;n++){const r=i[n];let l=0,o=0,u;for(const d of t[n].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(u=d.subtype!=="caption"),u){const a={row:n,column:l},{rowspan:h,colspan:g}=d;for(l++;r[o];)o++;for(let c=n;c<Math.min(n+h,s);c++)for(let p=o;p<o+g;p++)i[c][p]=a;o+=g}}else if(fl(d))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 n of this.childNodes.slice(2)){const{type:r}=n;if(r==="tr"&&n.getRowCount()&&(e--,e<0))return n}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}},ns=K(Ii),X(ns,1,"getLayout",xl,gs),nn(ns,gs)}}),Wo,gu=C({"src/table/tr.ts"(){"use strict";qo(),Wo=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,zo=C({"src/nowiki/listBase.ts"(){"use strict";tt(),kn=class extends Te{get indent(){}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),An,Mo=C({"src/nowiki/dd.ts"(){"use strict";zo(),An=class extends kn{get type(){return"dd"}}}}),Uo={};se(Uo,{parseTable:()=>Ho});var vl,Ni,Ho,pu=C({"parser/table.ts"(){"use strict";q(),cu(),gu(),Bo(),Mo(),vl=e=>e.lastChild.constructor!==F,Ni=(e,t)=>e.is("td")?t.pop():e,Ho=({firstChild:{data:e},type:t,name:s},i,n)=>{const r=[],l=e.split(`
6
+ `})}}return t}}}),lo={};se(lo,{ParamTagToken:()=>nt});var Sr,ii,kr,nt,oo=C({"src/paramTag/index.ts"(){"use strict";M(),de(),Ts(),mn(),W(),q(),ze(),Sr=[_s],nt=class extends(kr=j){get type(){return"ext-inner"}constructor(e,t,s=I.getConfig(),i=[],n){if(super(void 0,s,i,{}),t){const r=xe;this.append(...t.split(`
7
+ `).map(l=>n?l:Qt(l,s,i,e)).map(l=>new r(l,"param-line",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 n=new le(this,e),r=I.msg("invalid-parameter",this.name),l=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const a=o.childNodes.filter(({type:d})=>d!=="comment"&&d!=="include"&&d!=="noinclude");if(a.some(({type:d})=>d==="ext"))l.push(B(o,n,t,r,i));else{const d=a.findIndex(({type:h})=>h!=="text"),u=a.slice(0,d===-1?void 0:d).map(String).join("");if(u&&!(d===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(u)){const h=B(o,n,t,r,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}}},ii=K(kr),nt=X(ii,0,"ParamTagToken",Sr,nt),J(ii,1,nt)}}),Ar,ni,_r,rt,ao=C({"src/heading.ts"(){"use strict";var e,t,ds,i;M(),Ne(),de(),Fe(),W(),q(),wt(),Ar=[Ie],rt=(i=class extends(_r=j){constructor(r,l,o,a=[]){super(void 0,o,a);N(this,t);N(this,e);L(this,e,r);const d=new j(l[0],o,a);d.type="heading-title",d.setAttribute("stage",2);const u=new et(l[1],"heading-trail",o,a);this.append(d,u)}get type(){return"heading"}get level(){return f(this,e)}toString(r){const l=R(this,t,ds).call(this);return l+this.firstChild.toString(r)+l+this.lastChild.toString(r)}text(){const r=R(this,t,ds).call(this);return r+this.firstChild.text()+r}getAttribute(r){return r==="invalid"?this.inHtmlAttrs()===2:r==="padding"?this.level:super.getAttribute(r)}getGaps(){return this.level}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{firstChild:a,level:d}=this,u=a.toString(),h=u.startsWith("="),g=h||u.endsWith("="),c=new le(this,r),p=this.inHtmlAttrs(),b=["h1","unbalanced-header","format-leakage"],{lintConfig:w}=I,{computeEditInfo:k,fix:_}=w,v=b.map(m=>w.getSeverity(m,"apostrophe"));if(v[0]&&this.level===1){const m=B(a,c,b[0],"<h1>",v[0]);k&&!g&&(m.suggestions=[$e(m,"h2",`=${u}=`)]),o.push(m)}if(v[1]&&g){const m=I.msg("unbalanced-in-section-header",'"="'),S=B(a,c,b[1],m,v[1]);if(!(!k||u==="="))if(h){const[A]=/^=+/u.exec(u),x=d+A.length;S.suggestions=[{desc:`h${d}`,range:[S.startIndex,S.startIndex+A.length],text:""}],x<7&&S.suggestions.push({desc:`h${x}`,range:[S.endIndex,S.endIndex],text:A})}else{const A=/[^=](=+)$/u.exec(u)[1],x=d+A.length;S.suggestions=[{desc:`h${d}`,range:[S.endIndex-A.length,S.endIndex],text:""}],x<7&&S.suggestions.push({desc:`h${x}`,range:[S.startIndex,S.startIndex],text:A})}o.push(S)}if(p){const m="parsing-order",S=w.getSeverity(m,p===2?"heading":"templateInTable");S&&o.push(G(this,c,m,"header-in-html",S))}if(v[2]){const m=this.getRootNode().toString(),S=a.childNodes.filter(Cs("quote")),A=S.filter(({bold:y})=>y),x=S.filter(({italic:y})=>y);if(A.length%2){const y=B(A[A.length-1],Le(me({},c),{start:r+d,left:c.left+d}),b[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),v[2]);if(k||_){const T=r+d+u.length,$=U(y);m.slice(y.endIndex,T).trim()?k&&(y.suggestions=[$,qe(T,"'''")]):A.length===1&&x.length===0?y.fix=$:k&&(y.suggestions=[$])}o.push(y)}if(x.length%2){const y=B(x[x.length-1],{start:r+d},b[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),v[2]);if(k||_){const T=r+d+u.length;m.slice(y.endIndex,T).trim()?k&&(y.suggestions=[qe(T,"''")]):x.length===1&&A.length===0?y.fix=U(y):k&&(y.suggestions=[U(y)])}o.push(y)}}return o}}print(){const r=R(this,t,ds).call(this);return super.print({pre:r,sep:r})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakMap,t=new WeakSet,ds=function(){return"=".repeat(this.level)},i),ni=K(_r),rt=X(ni,0,"HeadingToken",Ar,rt),J(ni,1,rt)}}),$r,uo,Xa=C({"src/parameter.ts"(){"use strict";ge(),M(),W(),q(),$r=new RegExp(`https?://${ct}${gt}$`,"iu"),uo=class extends j{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const n=new j(typeof e=="number"?void 0:e,s,i,{}),r=new j(t,s,i);n.type="parameter-key",n.setAttribute("stage",2),r.type="parameter-value",r.setAttribute("stage",2),this.append(n,r)}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),n="unescaped",{lintConfig:r}=I,l=r.getSeverity(n);if(l){const{firstChild:o}=this,a=(s=$r.exec(o.text()))==null?void 0:s[0];try{if(a&&new URL(a).search){const d=B(o,{start:e},n,"unescaped-query",l);d.startIndex=d.endIndex,d.startLine=d.endLine,d.startCol=d.endCol,d.endIndex++,d.endCol++,(r.computeEditInfo||r.fix)&&(d.fix=mt(d.startIndex,"{{=}}")),i.push(d)}}catch(d){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),Tr,ri,Cr,lt,Ka=C({"src/transclude.ts"(){"use strict";var e,t,s,i,n,r,hs,ho,a;ge(),M(),Ne(),de(),Ss(),Fe(),W(),q(),Xa(),ze(),wt(),Tr=[Ie,Vt()],lt=(a=class extends(Cr=j){constructor(u,h,g,c=[]){var $,E;let p;const b=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(u);b&&(p=Number(b[1]),u=u.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,r);Ee(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,n);const{parserFunction:[w,k],variable:_,functionHook:v}=g,m=($=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(u))==null?void 0:$[0];if(m)this.setAttribute("modifier",m),u=u.slice(m.length);else if(u.includes(":")){const[F,...P]=u.split(":"),[ne]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((E=P[0])!=null?E:"");this.setModifier(`${F}:${ne}`)&&(u=P.join(":").slice(ne.length))}const S=u.search(/[::]/u),A=u[S]===":",x=S!==-1;if(x||h.length===0&&!f(this,s)){const F=x?u.slice(0,S):u,P=x&&u.slice(S+1),ne=be(F),O=x?ne.slice(ne.search(/\S/u))+(A?":":""):ne.trim(),re=O.toLowerCase(),fe=Array.isArray(k),V=fe?k.includes(O):Object.prototype.hasOwnProperty.call(k,O),D=!fe&&V?k[O]:Object.prototype.hasOwnProperty.call(w,re)&&w[re],Y=fe&&V||!("functionHook"in g)||v.includes(D),z=fe&&V||_.includes(D);if(x?D&&Y:z){this.setAttribute("name",D||re.replace(/^#|:$/u,"")),L(this,e,"magic-word"),A&&L(this,t,":");const Z=new et(F,"magic-word-name",g,c);if(super.insertAt(Z),P!==!1&&h.unshift([P]),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 F=be(u).trim();if(!this.normalizeTitle(F,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const P=new xe(u,"template-name",g,c,{});super.insertAt(P)}typeof p=="number"&&(c[p]=void 0);const y=this.isTemplate();let T=1;for(let F=0;F<h.length;F++){const P=h[F];y||this.name==="switch"&&F>0||this.name==="tag"&&F>1||(P[0]=P.join("="),P.length=1),P.length===1&&(P.unshift(T),T++),this.insertAt(new uo(...P,g,c))}this.seal("modifier")}get type(){return f(this,e)}get module(){}get function(){}setModifier(u){const{parserFunction:[,,h,g]}=this.getAttribute("config"),c=be(u).trim();if(u&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),b=h.includes(p),w=g.includes(p);return f(this,s)&&b||!f(this,s)&&(w||!u)||(ke.running||this.length>1)&&(b||w||!u)?(this.setAttribute("modifier",u),L(this,s,b),!!u):!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,n,R(this,r,hs).call(this)),this.setAttribute("name",f(this,n).title))}toString(u){const{childNodes:h,length:g,firstChild:c,modifier:p,type:b}=this;return`{{${p}${b==="magic-word"?c.toString(u)+(g===1?"":f(this,t))+h.slice(1).map(w=>w.toString(u)).join("|"):super.toString(u,"|")}}}`}text(){const{childNodes:u,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?"":f(this,t))+Ke(u.slice(1),"|"):super.text("|")}}}`}getAttribute(u){switch(u){case"padding":return this.modifier.length+2;case"title":return f(this,n);case"colon":return f(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!R(this,r,hs).call(this).valid);default:return super.getAttribute(u)}}lint(u=this.getAbsoluteIndex(),h){{const g=super.lint(u,h);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:b}=this,w=new le(this,u),{lintConfig:k}=I,{computeEditInfo:_}=k,v=c==="magic-word";let m="no-ignored",S=k.getSeverity(m,"fragment");if(v&&!R(this,r,hs).call(this).valid)m="invalid-invoke",S=k.getSeverity(m,"name"),S&&g.push(B(p[1],w,m,"illegal-module",S));else if(S){const A=p[v?1:0],x=A.childNodes.findIndex(T=>T.type==="text"&&ms(T.data).includes("#")),y=A.childNodes[x];if(y){const T=B(A,w,m,"useless-fragment",S);_&&(T.suggestions=[U(T,A.getRelativeIndex(x)+y.data.indexOf("#"))]),g.push(T)}}if(m="invalid-invoke",S=k.getSeverity(m,"function"),S&&v&&b===2)return g.push(G(this,w,m,"missing-function",S)),g;if(m="no-duplicate",S=k.getSeverity(m,"parameter"),S){const A=this.getDuplicatedArgs().filter(([,y])=>!y[0].querySelector("ext")),x="duplicate-parameter";for(const[,y]of A)g.push(...y.map(T=>{const $=B(T,w,m,x,S);return _&&($.suggestions=[U($,-1)]),$}))}return g}}insertAt(u,h=this.length){return super.insertAt(u,h),u.anon?R(this,r,ho).call(this,u):u.name&&this.getArgs(u.name,!1,!1).add(u),u}getAllArgs(){return this.childNodes.filter(Cs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:u})=>u)}getArgs(u,h,g=!0){const c=String(u).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return f(this,i).has(c)?p=f(this,i).get(c):(p=new Set(this.getAllArgs().filter(({name:b})=>c===b)),f(this,i).set(c,p)),p}getDuplicatedArgs(){return[...f(this,i)].filter(([,{size:u}])=>u>1).map(([u,h])=>[u,[...h]])}getPossibleValues(){const{type:u,name:h,childNodes:g}=this;if(u==="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),w=b[b.length-1];p=[...b.filter(({anon:k})=>!k),...w!=null&&w.anon?[w]:[]].map(({lastChild:k})=>k);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:w,0:k}=p[b].childNodes.filter(_=>_.text().trim());if(w===0)p.splice(b,1);else if(w>1||k.type!=="magic-word")b++;else try{const _=k.getPossibleValues();p.splice(b,1,..._),b+=_.length}catch(_){b++}}return p}print(){const{childNodes:u,length:h,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Ut(c)+g.print()+(h===1?"":f(this,t))+ft(u.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Ut(c)}</span>`:"")+ft(u,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,hs=function(){const u=this.type==="template";return this.normalizeTitle(this.childNodes[u?0:1].text(),u?10:828,{temporary:!0})},ho=function(u){const h=this.getAnonArgs(),g=typeof u!="number";for(let c=g?h.indexOf(u):u-1;c<h.length;c++){const p=h[c],{name:b}=p,w=String(c+1);(b!==w||p===u)&&(p.setAttribute("name",w),this.getArgs(w,!1,!1).add(p))}},a),ri=K(Cr),lt=X(ri,0,"TranscludeToken",Tr,lt),J(ri,1,lt)}}),Ir,li,Nr,jt,Ya=C({"src/hidden.ts"(){"use strict";bt(),q(),Ir=[Ze()],jt=class extends(Nr=j){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},li=K(Nr),jt=X(li,0,"HiddenToken",Ir,jt),J(li,1,jt)}}),Lr,oi,Er,Pt,Za=C({"src/arg.ts"(){"use strict";var e,eu,s;ge(),M(),de(),Me(),Ss(),Fe(),W(),q(),ze(),Ya(),Lr=[Ie,je("{{{"),Vt()],Pt=(s=class extends(Er=j){constructor(n,r,l=[]){super(void 0,r,l,{});N(this,e);for(let o=0;o<n.length;o++){const a=n[o];if(o===0){const d=new xe(a,"arg-name",r,l,{});super.insertAt(d)}else if(o>1){const d=new jt(a,r,l);super.insertAt(d)}else{const d=new j(a,r,l);d.type="arg-default",d.setAttribute("stage",2),super.insertAt(d)}}}get type(){return"arg"}get default(){}toString(n){return`{{{${super.toString(n,"|")}}}}`}text(){return`{{{${Ke(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(n=this.getAbsoluteIndex(),r){{const{childNodes:[l,o,...a]}=this;l.setAttribute("aIndex",n+3);const d=l.lint(n+3,r);if(o){const p=n+4+l.toString().length;o.setAttribute("aIndex",p);const b=o.lint(p,r);b.length>0&&d.push(...b)}const u=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=u.map(p=>h.getSeverity(p,"arg"));if(c[0]&&a.length>0){const p=new le(this,n);d.push(...a.map(b=>{const w=B(b,p,u[0],"invisible-triple-braces",c[0]);return w.startIndex--,w.startCol--,g&&(w.suggestions=[U(w),mt(w.startIndex,"{{!}}")]),w}))}if(c[1]&&!this.getAttribute("include")){const p=G(this,{start:n},u[1],"unexpected-argument",c[1]);g&&o&&(p.suggestions=[$e(p,"expand",o.text())]),d.push(p)}return d}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(n,r=this.getAbsoluteIndex()){const l=super.json(void 0,r)}},e=new WeakSet,eu=function(){},s),oi=K(Er),Pt=X(oi,0,"ArgToken",Lr,Pt),J(oi,1,Pt)}}),co={};se(co,{parseBraces:()=>$s});var Fr,ai,ts,ui,di,hi,jr,ci,$s,xn=C({"parser/braces.ts"(){"use strict";Ye(),ge(),ao(),Ka(),Za(),Fr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ai=String.raw`\[(?!\[)`,ts=String.raw`\n(?![=\0])`,ui=String.raw`|\{{2,}`,di=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),hi=ht(e=>new RegExp(e,"gmu")),jr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ai}|${ts})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ts})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ai}|${ts})*\}-`,"gu"),ci=e=>{const t=pt(be(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,w,k,_;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,n]}=t,r=[],l=[],o=(v,m,S,A)=>{m[m.length-1].push(Se(v.slice(S,A),l))};let a;do a!==void 0&&(e=a),a=e.replace(jr,(v,m,S)=>{if(m!==void 0||typeof S=="string")try{const{length:A}=s,x=(m!=null?m:S).split("|");return new lt(Se(x[0],l),x.slice(1).map(y=>{const T=y.indexOf("=");return(T===-1?[y]:[y.slice(0,T),y.slice(T+1)]).map($=>Se($,l))}),t,s),`\0${A}${ci(x[0])}`}catch(A){if(!(A instanceof SyntaxError)||A.message!=="Invalid template name")throw A}return l.push(Se(v,l)),`\0${l.length-1}`});while(a!==e);e=a;const d=e.lastIndexOf("}}")-e.length;let u=d+e.length!==-1,h=hi(i+(u?ui:"")),g=h.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((b=(p=r[r.length-1])==null?void 0:p[0])!=null&&b.startsWith("="));){if(g!=null&&g[1]){const[,{length:P}]=g;g[0]=g[0].slice(P),g.index+=P}const{0:v,index:m}=g!=null?g:{0:`
8
+ `,index:e.length},S=(w=r.pop())!=null?w:{},{0:A,index:x,parts:y,findEqual:T,pos:$}=S,E=v==="="&&T;if(v==="]]"||v==="}-")c=m+2;else if(v===`
9
+ `){c=m+1;const{pos:P,findEqual:ne}=(k=r[r.length-1])!=null?k:{};if(P===void 0||ne||be(e.slice(P,x))!==""){const O=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(x,m));O&&(O[2]=Se(O[2],l),O[2].includes(`
10
+ `)||(e=`${e.slice(0,x)}\0${s.length}h${e.slice(m)}`,c=x+4+String(s.length).length,new rt(O[1].length,O.slice(2),t,s)))}}else if(v==="|"||E)c=m+1,o(e,y,$,m),v==="|"&&y.push([]),S.pos=c,S.findEqual=v==="|",r.push(S);else if(v.startsWith("}}")){const P=v.slice(0,Math.min(A.length,3)),ne=A.length-P.length,{length:O}=s;c=m+P.length,o(e,y,$,m);let re=!1,fe="t";if(P.length===3){const V=y.map(Y=>Y.join("=")),D=V.length>1&&be(V[1]).trim();new Pt(V,t,s),D&&D.endsWith(":")&&n.includes(D.slice(0,-1).toLowerCase())&&(fe="s")}else try{new lt(y[0][0],y.slice(1),t,s),fe=ci(y[0][0])}catch(V){if(V instanceof SyntaxError&&V.message==="Invalid template name")re=!0;else throw V}re||(e=`${e.slice(0,x+ne)}\0${O}${fe}${e.slice(c)}`,c=x+ne+3+String(O).length,ne>1?r.push({0:A.slice(0,ne),index:x,pos:x+ne,parts:[[]]}):ne===1&&e[x-1]==="-"&&r.push({0:"-{",index:x-1,pos:x+1,parts:[[]]}))}else c=m+v.length,v.startsWith("{")&&(g.pos=c,g.parts=[[]]),r.push(..."0"in S?[S]:[],g);let F=r[r.length-1];if(u&&d+e.length<c)for(u=!1;(_=F==null?void 0:F[0])!=null&&_.startsWith("{");)r.pop(),F=r[r.length-1];h=hi(i+(u?ui:"")+(F?`|${Fr[F[0][0]]}${F.findEqual?"|=":""}`:"")),h.lastIndex=c,g=h.exec(e)}return Se(e,l)}}}),go={};se(go,{InputboxToken:()=>po});var po,tu=C({"src/paramTag/inputbox.ts"(){"use strict";Ts(),xn(),W(),oo(),po=class extends nt{constructor(e,t,s=I.getConfig(),i=[]){const n=Symbol("InputboxToken"),r=s.excludes.includes("heading")?s:Le(me({},s),{excludes:[...s.excludes,"heading"]}),{length:l}=i;i.push(n),t&&(t=Qt(t,r,i,e)),t&&(t=$s(t,r,i)),i.splice(l,1),super(e,t,r,i,{})}}}}),cs={};se(cs,{NestedToken:()=>fo});var Pr,Rr,fo,gi=C({"src/nested.ts"(){"use strict";var e,t,s;M(),de(),Ts(),xn(),W(),q(),Eo(),Ue(),Pr=new Set(["comment","include","arg","template","magic-word"]),Rr=[!1,!0].map(i=>{const n=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${n}(?:\s[^>]*)?/?>|</${n}\s*>)$`,"iu")}),fo=(s=class extends j{constructor(n,r,l,o,a=[]){if(typeof r=="boolean"){const d=Symbol("NestedToken"),{length:u}=a;a.push(d),n&&(n=Qt(n,o,a,r)),n&&(n=$s(n,o,a)),a.splice(u,1)}else n&&(n=n.replace(r,(d,u,h,g,c)=>{const p=`\0${a.length+1}e`;return new dt(u,h,g,c,o,!1,a),p}));n&&(n=n.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(d,u,h)=>(new ce(h,o,a),`${u}\0${a.length}n`)));super(n,o,a);N(this,e);N(this,t);L(this,e,[...l]),L(this,t,r)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex(),r){{const l=super.lint(n,r),o="no-ignored",{lintConfig:a}=I,d=a.getSeverity(o,this.name);if(!d)return l;const u=new le(this,n),h=typeof f(this,t)=="boolean"?Rr[f(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(g=>{const{type:c,name:p}=g;if(c==="ext")return!f(this,e).includes(p);if(Pr.has(c))return!1;const b=g.toString().trim();return b&&!h.test(b)}).map(g=>{const c=B(g,u,o,I.msg("invalid-content",this.name),d);return a.computeEditInfo&&(c.suggestions=[U(c),an(c,g.toString())]),c})]}}},e=new WeakMap,t=new WeakMap,s)}});function Or(e,t,s,i,n){t=be(t).trim();let r=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!r&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(r);case"link":{if(r){if(mo(s.protocol).test(r))return xo(s.protocol).test(r)&&t;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2))}else return t;const l=I.normalizeTitle(r,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0});return l.valid&&l}case"lang":return(n==="svg"||n==="svgz")&&!/[^a-z\d-]/u.test(r);case"alt":case"class":case"manualthumb":return!0;case"page":return(n==="djvu"||n==="djv"||n==="pdf")&&Number(r)>0;default:return!!r&&!isNaN(r)}}var mo,xo,Br,qr,vo,su=C({"src/imageParameter.ts"(){"use strict";var e,t,bo,n;Ye(),ge(),M(),We(),W(),q(),mo=ht(r=>new RegExp(String.raw`^(?:${r}|//|\0\d+m\x7F)`,"iu")),xo=ht(r=>new RegExp(String.raw`^(?:(?:${r}|//)${ct}|\0\d+m\x7F)${gt}$`,"iu")),Br=ht(r=>new RegExp(String.raw`^(\s*(?!\s))${r.replace("$1","(.*)")}${r.endsWith("$1")?`(?=$|
11
+ )`:""}(\s*)$`,"u")),qr=new Set(["alt","link","lang","page","caption"]),vo=(n=class extends j{constructor(l,o,a,d){var r=(...i)=>(super(...i),N(this,t),N(this,e,""),this);let u;const h=Object.entries(a.img).map(([c,p])=>[c,p,Br(c)]),g=h.find(([,c,p])=>(u=p.exec(l),u&&(u.length!==4||Or(c,u[2],a,!0,o)!==!1)));if(g&&u){u.length===3?(r(void 0,a,d),L(this,e,l)):(r(u[2],a,d,{}),L(this,e,u[1]+g[0]+u[3])),this.setAttribute("name",g[1]),g[1]==="alt"&&this.setAttribute("stage",we-1);return}r(l,a.excludes.includes("list")?a:Le(me({},a),{excludes:[...a.excludes,"list"]}),d),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Or("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 f(this,e)?f(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return f(this,e)?f(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,f(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){{const a=super.lint(l,o),{lintConfig:d}=I,{computeEditInfo:u,fix:h}=d,{link:g,name:c}=this;if(c==="invalid"){const p="invalid-gallery",b=d.getSeverity(p,"parameter");if(b){const w=G(this,{start:l},p,"invalid-image-parameter",b);(u||h)&&(w.fix=U(w,-1)),a.push(w)}}else if(typeof g=="object"&&g.encoded){const p="url-encoding",b=d.getSeverity(p,"file");if(b){const w=G(this,{start:l},p,"unnecessary-encoding",b);(u||h)&&(w.fix=ln(w,this)),a.push(w)}}return a}}getValue(){return this.name==="invalid"?this.text():R(this,t,bo).call(this)||super.text()}print(){return f(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${f(this,e).replace("$1",`<span class="wpb-image-caption">${ft(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,bo=function(){return f(this,e)&&!f(this,e).includes("$1")},n)}}),pi,Wr,Mr,fi,mi,xi,zr,vi,vn,wo=C({"src/link/file.ts"(){"use strict";M(),de(),W(),ys(),su(),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),n=0,r=0;for(;i;){const{0:l,index:o}=i;l!=="|"?n+=l==="-{"?1:-1:n===0&&(s.push(e.slice(r,o)),{lastIndex:r}=t),i=t.exec(e)}return s.push(e.slice(r)),s},vi=(e,t)=>e.filter(({childNodes:s})=>{const i=s.filter(n=>n.text().trim());return i.length!==1||!t.has(i[0].type)}),vn=class extends Oe{get type(){return"file"}get extension(){}constructor(e,t,s,i=[],n="|"){super(e,void 0,s,i,n);const{extension:r}=this.getTitle(!0,!0);this.safeAppend(zr(t).map(l=>new vo(l,r,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),n=vi(this.getAllArgs(),Wr),r=[...new Set(n.map(({name:A})=>A))],l=r.filter(A=>pi.has(A)),o=r.filter(A=>fi.has(A)),a=r.filter(A=>mi.has(A)),[d]=l,u=d==="framed"||d==="manualthumb",h=new le(this,e),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,{ns:b,extension:w}=this.getAttribute("title"),{firstChild:k}=this;let _="nested-link",v=g.getSeverity(_,"file");if(v&&xi.has(w)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const A=G(this,h,_,"link-in-extlink",v);if(c||p){const x=this.getArg("link");if(x){const y=e+x.getRelativeIndex();A.fix={desc:I.msg("delink"),range:[y,y+x.toString().length],text:"link="}}else A.fix=bs(A.endIndex-2,"delink","|link=")}i.push(A)}if(_="invalid-gallery",v=g.getSeverity(_,"extension"),v&&b===6&&!w&&!k.querySelector("arg,magic-word,template")&&i.push(G(this,h,_,"missing-extension",v)),v=g.getSeverity(_,"parameter"),v&&u)for(const A of n.filter(({name:x})=>x==="width")){const x=B(A,h,_,"invalid-image-parameter",v);(c||p)&&(x.fix=U(x,-1)),i.push(x)}if(n.length===r.length&&l.length<2&&o.length<2&&a.length<2)return i;_="no-duplicate";const m=["unknownImageParameter","imageParameter"].map(A=>g.getSeverity(_,A)),S=(A,x,y,T=!0)=>A.map($=>{if(v=m[Number(typeof T=="function"?T($):T)],!v)return!1;const E=B($,h,_,I.msg(`${x}-image-parameter`,y),v);return c&&(E.suggestions=[U(E,-1)]),E}).filter($=>$!==!1);for(const A of r){if(A==="invalid"||A==="width"&&u)continue;const x=A==="caption";let y=n.filter(({name:T})=>T===A);if(x&&(y=[...y.slice(0,-1).filter(T=>T.text()),...y.slice(-1)]),y.length>1){let T=!x||!w||xi.has(w);if(x&&T){const $=vi(y,Mr);T=$.length>1&&(E=>$.includes(E))}i.push(...S(y,"duplicate",A,T))}}return l.length>1&&i.push(...S(n.filter(({name:A})=>pi.has(A)),"conflicting","frame")),o.length>1&&i.push(...S(n.filter(({name:A})=>fi.has(A)),"conflicting","horizontal-alignment")),a.length>1&&i.push(...S(n.filter(({name:A})=>mi.has(A)),"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()){const s=super.json(void 0,t)}}}}),Ur,bi,Hr,ot,yo=C({"src/link/galleryImage.ts"(){"use strict";var e,Xi,s;M(),We(),Me(),W(),q(),wo(),Ur=[je("")],ot=(s=class extends(Hr=vn){constructor(n,r,l,o,a=[]){let d;if(l!==void 0){const{length:u}=a;d=new j(l,o,a);for(let h=0;h<we-1;h++)d.parseOnce();a.splice(u,1)}super(r,d==null?void 0:d.toString(),o,a);N(this,e);Ee(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${n}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(n){const r=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),r?0:6,{halfParsed:!0,temporary:n,decode:!r})}lint(n=this.getAbsoluteIndex(),r){{const l=super.lint(n,r),o="invalid-gallery",{lintConfig:a}=I,d=a.getSeverity(o,"image");if(d&&R(this,e,Xi).call(this)){const u=G(this,{start:n},o,"invalid-gallery",d);a.computeEditInfo&&(u.suggestions=[bs(n,"prefix","File:")]),l.push(u)}return l}}getAttribute(n){return n==="invalid"?R(this,e,Xi).call(this):super.getAttribute(n)}},e=new WeakSet,Xi=function(){const{ns:n}=this.getAttribute("title");return n!==6},s),bi=K(Hr),ot=X(bi,0,"GalleryImageToken",Ur,ot),J(bi,1,ot)}}),So={};se(So,{GalleryToken:()=>Rt});var Dr,wi,Gr,Rt,iu=C({"src/gallery.ts"(){"use strict";var e,ko,nu,i;M(),mn(),W(),q(),yo(),Ue(),Dr=[_s],Rt=(i=class extends(Gr=j){constructor(r,l,o=[]){var a;super(void 0,l,o,{});N(this,e);for(const d of(a=r==null?void 0:r.split(`
12
+ `))!=null?a:[]){const u=/^([^|]+)(?:\|(.*))?/u.exec(d);if(!u){super.insertAt(d.trim()?new ce(d,l,o):d);continue}const[,h,g]=u;R(this,e,ko).call(this,h)?super.insertAt(new ot("gallery",h,g,l,o)):super.insertAt(new ce(d,l,o))}}get type(){return"ext-inner"}get widths(){}get heights(){}lint(r=this.getAbsoluteIndex(),l){{const{top:o,left:a}=this.getRootNode().posFromIndex(r),d=[],u="no-ignored",{lintConfig:h}=I,g=["Image","NoImage","Comment"].map(c=>h.getSeverity(u,`gallery${c}`));for(let c=0;c<this.length;c++){const p=this.childNodes[c],b=p.toString(),{length:w}=b,k=b.trim(),{type:_}=p,v=o+c,m=c?0:a;if(p.setAttribute("aIndex",r),_==="noinclude"&&k&&!/^<!--.*-->$/u.test(k)){let[S]=g;if(k.startsWith("|")?[,S]=g:(k.startsWith("<!--")||k.endsWith("-->"))&&([,,S]=g),S){const A=r+w,x={rule:u,message:I.msg("invalid-content","gallery"),severity:S,startIndex:r,endIndex:A,startLine:v,endLine:v,startCol:m,endCol:m+w};h.computeEditInfo&&(x.suggestions=[U(x),an(x,b)]),d.push(x)}}else if(_!=="noinclude"&&_!=="text"){const S=p.lint(r,l);S.length>0&&d.push(...S)}r+=w+1}return d}}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakSet,ko=function(r){return this.normalizeTitle(r,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},nu=function(r){},i),wi=K(Gr),Rt=X(wi,0,"GalleryToken",Dr,Rt),J(wi,1,Rt)}}),bn,Ao=C({"src/link/index.ts"(){"use strict";Ye(),M(),W(),ys(),bn=class extends Oe{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:n}=I,r=n.getSeverity(i);if(r&&this.closest("ext-link-text")){const l=G(this,{start:e},i,"link-in-extlink",r);(n.computeEditInfo||n.fix)&&(l.fix=$e(l,"delink",this.innerText)),s.push(l)}return s}}}}}),Vr,Qr,Gt,wn=C({"src/magicLink.ts"(){"use strict";var e,t,Ki,i;M(),ge(),de(),W(),q(),Vr=String.raw`(?:[${Be}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,Qr=new RegExp(`${Vr}+`,"gu"),Gt=(i=class extends j{constructor(r,l="free-ext-link",o=I.getConfig(),a){super(r,o,a,{});N(this,t);N(this,e);L(this,e,l)}get type(){return f(this,e)}get innerText(){const r=new Map([["!","|"],["=","="]]);let l=Ke(this.childNodes.map(o=>{const{type:a}=o,d=String(o.name);return a==="magic-word"&&r.has(d)?r.get(d):o}));return this.type==="magic-link"&&(l=l.replace(Qr," ")),l}get link(){const{innerText:r}=this;return this.type==="magic-link"?r.startsWith("ISBN")?`ISBN ${r.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:r:ql(r).replace(/\n/gu,"%0A")}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),a=new le(this,r),{lintConfig:d}=I,{type:u,childNodes:h}=this;if(u==="magic-link"){const b="invalid-isbn",w=d.getSeverity(b);return w&&R(this,t,Ki).call(this)&&o.push(G(this,a,b,"invalid-isbn",w)),o}const g=u==="ext-link-url",c="unterminated-url",p=d.getSeverity(c,g?"pipe":"punctuation");if(p){const b=g?/\|/u:/[,;。:!?()]+/u,w=h.find(k=>k.type==="text"&&b.test(k.data));if(w){const{data:k}=w,_=B(w,a,c,I.msg("in-url",g?'"|"':"full-width-punctuation"),p);if(d.computeEditInfo){const{index:v,0:m}=b.exec(k),S=_.startIndex+v;_.suggestions=g?[Dt(S,1)]:[Dt(S),{desc:I.msg("encode"),range:[S,S+m.length],text:encodeURI(m)}]}o.push(_)}}return o}}getUrl(r){this.lspError("MagicLinkToken.getUrl")}getAttribute(r){return r==="invalid"?R(this,t,Ki).call(this):super.getAttribute(r)}},e=new WeakMap,t=new WeakSet,Ki=function(){if(this.type==="magic-link"){const{link:r}=this;if(r.startsWith("ISBN")){const l=[...r.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,a,d)=>o+a*(10-d),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,a,d)=>o+a*(d%2?3:1),0)%10!==0)}}return!1},i)}}),Jr,yi,Xr,at,_o=C({"src/extLink.ts"(){"use strict";var e,t;We(),M(),Me(),W(),q(),wn(),Jr=[je("[")],at=(t=class extends(Xr=j){constructor(i,n="",r="",l,o=[]){super(void 0,l,o,{});N(this,e);const a=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(a),L(this,e,n),r){const d=new j(r,l,o,{});d.type="ext-link-text",d.setAttribute("stage",we-1),this.insertAt(d)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${f(this,e)}]`:`[${super.toString(i,f(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return f(this,e).length}lint(i=this.getAbsoluteIndex(),n){{const r=super.lint(i,n),l="var-anchor",o=I.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.closest("heading-title")&&r.push(G(this,{start:i},l,"variable-anchor",o)),r}}print(){return super.print(this.length===1?{pre:"[",post:`${f(this,e)}]`}:{pre:"[",sep:f(this,e),post:"]"})}},e=new WeakMap,t),yi=K(Xr),at=X(yi,0,"ExtLinkToken",Jr,at),J(yi,1,at)}}),Yi,ru=C({"src/imagemapLink.ts"(){"use strict";q(),Ue(),Ao(),_o(),Yi=class extends j{get type(){return"imagemap-link"}constructor(e,t,s,i,n=[]){super(void 0,i,n),this.append(e,t.length===2?new bn(...t,i,n):new at(...t,i,n),new ce(s,i,n))}}}}),$o={};se($o,{ImagemapToken:()=>Ot});var Kr,Si,Yr,Ot,lu=C({"src/imagemap.ts"(){"use strict";M(),Ne(),de(),mn(),W(),q(),Ue(),yo(),ru(),Kr=[_s],Ot=class extends(Yr=j){get type(){return"ext-inner"}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
+ `),n=new Set(t.protocol.split("|")),r=ce;let l=!0,o=!1;for(const a of i){const d=a.trim();if(!(o||!d||d.startsWith("#"))){if(l){const u=a.indexOf("|"),h=u===-1?a:a.slice(0,u),{valid:g,ns:c}=this.normalizeTitle(h,0,{halfParsed:!0,temporary:!0});if(g&&c===6){const p=new ot("imagemap",h,u===-1?void 0:a.slice(u+1),t,s);super.insertAt(p),l=!1;continue}else o=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const u=a.indexOf("["),h=a.slice(u),g=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(h);if(g){if(this.normalizeTitle(g[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Yi(a.slice(0,u),g.slice(1),h.slice(h.indexOf("]]")+2),t,s));continue}}else if(h.startsWith("[//")||n.has(h.slice(1,h.indexOf(":")+1))||n.has(h.slice(1,h.indexOf("//")+2))){const c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(h);if(c){super.insertAt(new Yi(a.slice(0,u),c.slice(1),h.slice(h.indexOf("]")+1),t,s));continue}}}}super.insertAt(new r(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),{childNodes:n,image:r}=this,l="invalid-imagemap",{lintConfig:o}=I,a=o.getSeverity(l,r?"link":"image");return a&&(r?s.push(...n.filter(d=>{const u=d.toString().trim();return d.is("noinclude")&&u&&!u.startsWith("#")}).map(d=>{const u=B(d,i,l,"invalid-imagemap-link",a);return o.computeEditInfo&&(u.suggestions=[U(u,-1),$e(u,"comment","# ")]),u})):s.push(G(this,i,l,"imagemap-without-image",a))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},Si=K(Yr),Ot=X(Si,0,"ImagemapToken",Kr,Ot),J(Si,1,Ot)}}),Zr,ki,el,ut,To=C({"src/nowiki/comment.ts"(){"use strict";M(),bt(),Me(),W(),tt(),Zr=[Ze(!1),je("<!--")],ut=class extends(el=Te){constructor(t,s,i,n){super(t,i,n);Ee(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=I,n=i.getSeverity(s);if(!n)return[];const r=G(this,{start:t},s,"unclosed-comment",n);return i.computeEditInfo&&(r.suggestions=[qe(r.endIndex,"-->")]),[r]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}},ki=K(el),ut=X(ki,0,"CommentToken",Zr,ut),J(ki,1,ut)}}),Co={};se(Co,{CommentedToken:()=>Io});var Io,ou=C({"src/commented.ts"(){"use strict";q(),To(),Io=class extends j{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),n=i!==-1&&e.indexOf("-->",i+4),r=0;for(;n!==!1&&n!==-1;)i>r&&this.insertAt(e.slice(r,i)),this.insertAt(new ut(e.slice(i+4,n),!0,t,s)),r=n+3,i=e.indexOf("<!--",r),n=i!==-1&&e.indexOf("-->",i+4);r<e.length&&this.insertAt(e.slice(r))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),No={};se(No,{NowikiToken:()=>Lo});var tl,sl,Lo,au=C({"src/nowiki/index.ts"(){"use strict";var e,Zi,s;Ye(),M(),W(),tt(),tl=ht(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),sl=new Set(["languages","section","templatestyles"]),Lo=(s=class extends Te{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){{const{name:r}=this,l="void-ext",{lintConfig:o}=I,a=o.getSeverity(l,r);if(a&&R(this,e,Zi).call(this)){const d=G(this,{start:n},l,I.msg("nothing-in",r),a);return o.computeEditInfo&&(d.suggestions=[U(d)]),[d]}return super.lint(n,tl(r))}}getAttribute(n){return n==="invalid"?R(this,e,Zi).call(this):super.getAttribute(n)}},e=new WeakSet,Zi=function(){const{name:n,firstChild:{data:r}}=this;return sl.has(n)&&!!r},s)}}),il,Ai,nl,dt,Eo=C({"src/tagPair/ext.ts"(){"use strict";M(),de(),W(),pn(),q(),gn(),fn(),il=[ks()],dt=class extends(nl=Je){get type(){return"ext"}constructor(e,t,s,i,n=I.getConfig(),r=!1,l=[]){const o=e.toLowerCase(),a=new As(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,n,l),d=Le(me({},n),{ext:n.ext.filter(h=>h!==o),excludes:[...n.excludes],inExt:!0});let u;switch(o){case"tab":d.ext=d.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"&&d.excludes.push("heading"),u=new j(s,d,l);break;case"pre":{const{PreToken:h}=(Ja(),Q(no));u=new h(s,d,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(oo(),Q(lo));u=new h(r,s,d,l);break}case"inputbox":{const{InputboxToken:h}=(tu(),Q(go));u=new h(r,s,d,l);break}case"references":{const{NestedToken:h}=(gi(),Q(cs));d.excludes.push("heading"),u=new h(s,r,["ref"],d,l);break}case"choose":{const{NestedToken:h}=(gi(),Q(cs));u=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,l);break}case"combobox":{const{NestedToken:h}=(gi(),Q(cs));u=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,l);break}case"gallery":{const{GalleryToken:h}=(iu(),Q(So));u=new h(s,d,l);break}case"imagemap":{const{ImagemapToken:h}=(lu(),Q($o));u=new h(s,d,l);break}case"hiero":{const{CommentedToken:h}=(ou(),Q(Co));u=new h(s,d,l);break}default:{const{NowikiToken:h}=(au(),Q(No));u=new h(s,d,l)}}u.setAttribute("name",o),u.type==="plain"&&(u.type="ext-inner"),super(e,a,u,i,n,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,n=new le(this,e);if(this.name!=="nowiki"){const o=this.inHtmlAttrs(),a="parsing-order",d=o&&i.getSeverity(a,o===2?"ext":"templateInTable");d&&s.push(G(this,n,a,"ext-in-html",d))}const r="var-anchor",l=i.getSeverity(r,"ref");return l&&this.name==="ref"&&this.closest("heading-title")&&s.push(G(this,n,r,"variable-anchor",l)),s}}},Ai=K(nl),dt=X(Ai,0,"ExtToken",il,dt),J(Ai,1,dt)}}),Fo={};se(Fo,{parseCommentAndExt:()=>Qt});var _i,rl,ss,ll,$i,Qt,Ts=C({"parser/commentAndExt.ts"(){"use strict";Ye(),ge(),Ha(),Ue(),Da(),Ga(),Eo(),To(),_i="<onlyinclude>",rl="</onlyinclude>",{length:ss}=_i,ll=[!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(_i);return{i:t,j:e.indexOf(rl,t+ss)}},Qt=(e,t,s,i)=>{if(i){let{i:a,j:d}=$i(e);if(a!==-1&&d!==-1){let u="";const h=g=>{new ce(g,t,s),u+=`\0${s.length-1}n`};for(;a!==-1&&d!==-1;){const g=`\0${s.length}e`;new Et(e.slice(a+ss,d),t,s),a>0&&h(e.slice(0,a)),u+=g,e=e.slice(d+ss+1),{i:a,j:d}=$i(e)}return e&&h(e),u}}const{ext:n}=t,r=n.filter(a=>a!=="translate"&&a!=="tvar"),l=Le(me({},t),{ext:r});if(n.includes("translate")){const a=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,d=>(a.push(d),`\0${a.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(d,u,h)=>{const g=s.length;return new Kl(u,h&&Se(h,a),l,s),`\0${g}g`}),e=Se(e,a)}const o=ll[i?1:0](r);return o.lastIndex=0,o.test(e)?e.replace(o,(a,d,u,h,g,c,p,b,w)=>{const k=s.length;let _="n";if(d)_="e",new dt(d,u,h,g,l,c,s);else if(a.startsWith("<!--")){_="c";const v=a.endsWith("-->");new ut(Se(a,s,1).slice(4,v?-3:void 0),v,t,s)}else c?new Ft(c,p&&Se(p,s,1),b&&Se(b,s,1),w,t,s):new ce(a,t,s);return`\0${k}${_}`}):e}}}),ol,al,ul,dl,Ti,hl,Bt,uu=C({"src/html.ts"(){"use strict";var e,t,s,i,n;M(),Ne(),de(),pn(),W(),q(),ol=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),al=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"]),ul=new Set(["strike","big","center","font","tt"]),dl=[ks()],Bt=(n=class extends(hl=j){constructor(l,o,a,d,u,h){super(void 0,u,h);N(this,e);N(this,t);N(this,s);N(this,i);this.insertAt(o),this.setAttribute("name",l.toLowerCase()),L(this,e,a),L(this,t,d),L(this,s,l)}get type(){return"html"}get selfClosing(){return f(this,t)}get closing(){return f(this,e)}toString(l){return`<${this.closing?"/":""}${f(this,s)}${super.toString(l)}${f(this,t)?"/":""}>`}text(){const{closing:l}=this,o=f(this,s)+(l?"":super.text());return`<${l?"/":""}${o}${f(this,t)?"/":""}>`}getAttribute(l){return l==="invalid"?this.inTableAttrs()===2:l==="padding"?f(this,s).length+(this.closing?2:1):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){var a;{const d=super.lint(l,o),{name:u,parentNode:h,closing:g,selfClosing:c}=this,p=new le(this,l),{lintConfig:b}=I,{computeEditInfo:w,fix:k}=b,_=this.inTableAttrs();let v="h1",m=b.getSeverity(v,"html");if(m&&u==="h1"&&!g){const $=G(this,p,v,"<h1>",m);w&&($.suggestions=[{desc:"h2",range:[l+2,l+3],text:"2"}]),d.push($)}if(v="parsing-order",m=_&&b.getSeverity(v,_===2?"html":"templateInTable"),m){const $=G(this,p,v,"html-in-table",m);w&&_===2&&($.suggestions=[U($)]),d.push($)}if(v="obsolete-tag",m=b.getSeverity(v,u),m&&ul.has(u)&&d.push(G(this,p,v,"obsolete-tag",m)),v="bold-header",m=b.getSeverity(v,u),m&&(u==="b"||u==="strong")&&((a=this.closest("heading-title,ext"))==null?void 0:a.type)==="heading-title"){const $=G(this,p,v,"bold-in-header",m);w&&($.suggestions=[U($)]),d.push($)}const{html:[,S,A]}=this.getAttribute("config"),x=A.includes(u),y=S.includes(u),T=!x&&!y;if(v="unmatched-tag",g&&(c||x)||c&&T){if(m=b.getSeverity(v,g?"both":"selfClosing"),m){const $=G(this,p,v,g?"closing-and-self-closing":"invalid-self-closing",m);if(w||k){const E=on(l),F={desc:I.msg("no-self-closing"),range:[$.endIndex-2,$.endIndex-1],text:""};y?w&&($.suggestions=[E,F]):g?$.fix=x?E:F:w&&($.suggestions=[F,qe($.endIndex,`></${u}>`,-2)])}d.push($)}}else if(!this.findMatchingTag()){const $=G(this,p,v,g?"unmatched-closing":"unclosed-tag"),E=this.closest("magic-word");if(E&&ol.has(E.name))m=b.getSeverity(v,"conditional");else if(g)m=b.getSeverity(v,"closing"),$.suggestions=[U($)];else{m=b.getSeverity(v,"opening");const F=h==null?void 0:h.childNodes;al.has(u)&&(F!=null&&F.slice(0,F.indexOf(this)).some(P=>P.type==="html"&&P.name===u&&!P.findMatchingTag())&&($.suggestions=[qe(l+1,"/")]),this.closest("heading-title")&&($.rule="format-leakage",m=b.getSeverity("format-leakage",u)))}m&&($.severity=m,d.push($))}return d}}findMatchingTag(){return Xe(f(this,i),()=>{const{name:l,parentNode:o,closing:a,selfClosing:d}=this,{html:[,u,h]}=this.getAttribute("config"),g=h.includes(l),c=u.includes(l);if(g||c&&d)return this;if(!o)return;const{childNodes:p}=o,b=p.indexOf(this),w=a?p.slice(0,b).reverse():p.slice(b+1),k=[this],{rev:_}=ke;for(const v of w)if(!(!v.is("html")||v.name!==l||c&&f(v,t)))if(f(v,e)===a)k.push(v);else{const m=k.pop();if(m===this)return v;I.viewOnly&&(L(m,i,[_,v]),L(v,i,[_,m]))}if(I.viewOnly)for(const v of k)L(v,i,[_,void 0])},l=>{L(this,i,l),l[1]&&l[1]!==this&&L(l[1],i,[ke.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${f(this,s)}`,post:`${f(this,t)?"/":""}&gt;`})}json(l,o=this.getAbsoluteIndex()){const a=super.json(void 0,o)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n),Ti=K(hl),Bt=X(Ti,0,"HtmlToken",dl,Bt),J(Ti,1,Bt)}}),jo={};se(jo,{parseHtml:()=>Po});var cl,Po,du=C({"parser/html.ts"(){"use strict";fn(),uu(),cl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Po=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const n=e.split("<");let r=n.shift();for(const o of n){const a=cl.exec(o),d=a==null?void 0:a[2],u=d==null?void 0:d.toLowerCase();if(!a||!t.htmlElements.has(u)){r+=`<${o}`;continue}const[,h,,g="",c,p]=a,{length:b}=s,w=new As(g,"html-attrs",u,t,s),k=w.hasAttr("itemprop");if(u==="meta"&&!(k&&w.hasAttr("content"))||u==="link"&&!(k&&w.hasAttr("href"))){r+=`<${o}`,s.length=b;continue}r+=`\0${s.length}x${p}`,new Bt(d,w,h==="/",c==="/>",t,s)}return r}}}),yn,Ro=C({"src/table/base.ts"(){"use strict";pn(),q(),wt(),fn(),yn=class extends ks(1)(j){constructor(e,t,s,i,n,r=[],l){super(void 0,n,r,l),this.append(new et(t,"table-syntax",n,r),new As(i,"table-attrs",s,n,r))}escape(){}}}}),gl,Ci,_e,is,Tt,Ct,xs,Oo=C({"src/table/td.ts"(){"use strict";M(),de(),cn(),W(),q(),Ro(),xs=class extends(Ci=yn,gl=[ws(!1)],Ci){constructor(e,t,s,i=[]){var o;let n=/\||\0\d+!\x7F/u.exec(t!=null?t:""),r=n?t.slice(0,n.index):"";/\[\[|-\{/u.test(r)&&(n=null,r=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",r,s,i),J(is,5,this),Re(this,Tt),Re(this,_e,""),n&&([ja(this,_e)._]=n);const l=new j(t==null?void 0:t.slice(((o=n==null?void 0:n.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,Tt,Ct).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)),n="pipe-like",{lintConfig:r}=I,{computeEditInfo:l,fix:o}=r,a=["td","double"].map(d=>r.getSeverity(n,d));for(const d of this.lastChild.childNodes)if(d.type==="text"){const{data:u}=d;if(u.includes("|")){const h=u.includes("||"),g=a[h?1:0];if(g){const c=B(d,i,n,"pipe-in-table",g);if(l||o)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];c.fix=$e(c,"newline",u.replace(/\|\|/gu,`
14
+ ${p}`))}else l&&(c.suggestions=[dn(c.startIndex,u)]);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()){const s=super.json(void 0,t)}},is=K(Ci),_e=new WeakMap,Tt=new WeakSet,Ct=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:n}=this;return me({},Ui(e=n,Tt,Ct).call(e))},Ct=X(is,17,"#getSyntax",gl,Tt,Ct),nn(is,xs)}}),Sn,Bo=C({"src/table/trBase.ts"(){"use strict";M(),W(),Ro(),Oo(),Sn=class extends yn{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 n=zt(i),r="fostered-content",l=n&&I.lintConfig.getSeverity(r,n===2?void 0:"transclusion");if(l){const o=B(i,{start:e},r,"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("+")))}}}}),pl,fl,ml,xl,Ii,ns,gs,hu=C({"src/table/index.ts"(){"use strict";M(),Ne(),de(),cn(),W(),Bo(),wt(),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=Sn,xl=[ws(!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),n=["unclosed-table","table-layout"],r=n.map(l=>I.lintConfig.getSeverity(l));if(r[0]&&!this.closed&&s.push(B(this.firstChild,i,n[0],"unclosed-table",r[0])),r[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let a=1,d=1/0,u=0;for(;u<o;u++){const h=l[u],g=h.length;if(g<a)break;g<d&&(d=g);const c=h.indexOf(h[g-1])+1;if(c>d)break;c>a&&(a=c)}if(u<o){const h=this.getNthRow(u),g=B(h,i,n[1],"inconsistent-table",r[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 n=new et(t?e:void 0,"table-syntax",s,i);super.insertAt(n)})}getLayout(e){const t=this.getAllRows(),{length:s}=t,i=ml.from(pl(s,()=>[]));for(let n=0;n<i.length;n++){const r=i[n];let l=0,o=0,a;for(const d of t[n].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(a=d.subtype!=="caption"),a){const u={row:n,column:l},{rowspan:h,colspan:g}=d;for(l++;r[o];)o++;for(let c=n;c<Math.min(n+h,s);c++)for(let p=o;p<o+g;p++)i[c][p]=u;o+=g}}else if(fl(d))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 n of this.childNodes.slice(2)){const{type:r}=n;if(r==="tr"&&n.getRowCount()&&(e--,e<0))return n}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}},ns=K(Ii),X(ns,1,"getLayout",xl,gs),nn(ns,gs)}}),qo,cu=C({"src/table/tr.ts"(){"use strict";Bo(),qo=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,Wo=C({"src/nowiki/listBase.ts"(){"use strict";tt(),kn=class extends Te{get indent(){}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),An,Mo=C({"src/nowiki/dd.ts"(){"use strict";Wo(),An=class extends kn{get type(){return"dd"}}}}),zo={};se(zo,{parseTable:()=>Uo});var vl,Ni,Uo,gu=C({"parser/table.ts"(){"use strict";q(),hu(),cu(),Oo(),Mo(),vl=e=>e.lastChild.constructor!==j,Ni=(e,t)=>e.is("td")?t.pop():e,Uo=({firstChild:{data:e},type:t,name:s},i,n)=>{const r=[],l=e.split(`
17
17
  `);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
18
- ${l.shift()}`,u;const d=(a,h)=>{if(!h){o+=a;return}const{lastChild:g}=h;if(vl(h)){const c=new F(a,i,n);c.type="table-inter",c.setAttribute("stage",3),h.insertAt(c)}else g.setText(g.toString()+a)};for(const a of l){u=r.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(;u&&!u.is("td");)u=r.pop();const[,w,f,y,_]=c;w&&new An(w,i,n),d(`
19
- ${h}${w&&`\0${n.length-1}d`}${f}\0${n.length}b`,u),r.push(...u?[u]:[],new gs(y,_,i,n));continue}else if(!u){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){d(`
21
- ${a}`,u),r.push(u);continue}const[,v,b,S,A]=p;if(v){for(;!u.is("table");)u=r.pop();u.close(`
22
- ${h}${v}`,!0),d(A,r[r.length-1])}else if(b){u=Ni(u,r),u.is("tr")&&(u=r.pop());const w=new Wo(`
23
- ${h}${b}`,A,i,n);r.push(u,w),u.insertAt(w)}else{u=Ni(u,r);const w=S==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let f=w.exec(A),y=0,_=`
24
- ${h}${S}`;const x=k=>{const T=new xs(_,A.slice(y,f==null?void 0:f.index),i,n);return k.insertAt(T),T};for(;f;)x(u),{lastIndex:y}=w,[_]=f,f=w.exec(A);r.push(u,x(u))}}return o.slice(1)}}}),Do,fu=C({"src/nowiki/hr.ts"(){"use strict";tt(),Do=class extends Te{get type(){return"hr"}}}}),bl,Li,wl,qt,mu=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";vt(),We(),tt(),bl=[Ze(),je("__")],qt=class extends(wl=Te){get type(){return"double-underscore"}constructor(e,t,s,i){var o,u;super(e,s,i);const n=e.toLowerCase(),{doubleUnderscore:[,,r,l]}=s;this.setAttribute("name",(u=t?(o=l==null?void 0:l[e])==null?void 0:o.toLowerCase():r==null?void 0:r[n])!=null?u:n)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Li=K(wl),qt=X(Li,0,"DoubleUnderscoreToken",bl,qt),J(Li,1,qt)}}),Go={};se(Go,{parseHrAndDoubleUnderscore:()=>Vo});var Vo,xu=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";fu(),mu(),uo(),Vo=({firstChild:{data:e},type:t,name:s},i,n)=>{var u,d,a;const{doubleUnderscore:[r,l,o]}=i;return(u=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(r)),(d=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l)),(a=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${[...r,...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 Do(c,i,n),`${g}\0${n.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(h,g)=>{var b;const c=i.sensitiveDoubleUnderscore.has(g),p=g.toLowerCase(),v=i.insensitiveDoubleUnderscore.has(p);return c||v?(new qt(g,c,i,n),`\0${n.length-1}${v&&((b=o==null?void 0:o[p])!=null?b: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,v)=>{const b=`${g}\0${n.length}h`;return new nt(c.length,[p,v],i,n),b})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Qo,vu=C({"src/nowiki/quote.ts"(){"use strict";var e,t;z(),de(),W(),tt(),Qo=(t=class extends Te{constructor(i,n,r,l){super(i,r,l);N(this,e);L(this,e,n)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return me(me({},this.bold?{bold:m(this,e).bold}:void 0),this.italic?{italic:m(this,e).italic}:void 0)}text(){const{parentNode:i,innerText:n}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":n}lint(i=this.getAbsoluteIndex()){var n;{const{previousSibling:r,bold:l,closing:o}=this,u=(r==null?void 0:r.type)==="text"?r.data:void 0,d=[],a=new le(this,i),h=["lonely-apos","bold-header"],{lintConfig:g}=I,{computeEditInfo:c}=g,p=[void 0,"word"].map(b=>g.getSeverity(h[0],b)),v=g.getSeverity(h[1]);if(u!=null&&u.endsWith("'")){const b=p[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(u)?1:0];if(b){const S=Q(this,a,h[0],I.msg("lonely","'"),b),{startLine:A,startCol:w}=S,[,{length:f}]=/(?:^|[^'])('+)$/u.exec(u),y=i-f,_=Le(me({},S),{startIndex:y,endIndex:i,endLine:A,startCol:w-f,endCol:w});c&&(_.suggestions=[ft(y,"&apos;",f),U(_)]),d.push(_)}}if(v&&l&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const b=Q(this,a,h[1],"bold-in-header",v);c&&(b.suggestions=[U(b)]),d.push(b)}return d}}json(i,n=this.getAbsoluteIndex()){const r=super.json(void 0,n)}},e=new WeakMap,t)}}),Jo={};se(Jo,{parseQuotes:()=>_n});var _n,Xo=C({"parser/quotes.ts"(){"use strict";vu(),_n=(e,t,s,i)=>{var c;const n=e.split(/('{2,})/u),{length:r}=n;if(r===1)return e;let l=0,o=0,u,d,a;for(let p=1;p<r;p+=2){const v=n[p].length;switch(v){case 2:o++;break;case 4:n[p-1]+="'",n[p]="'''";case 3:if(l++,u!==void 0)break;n[p-1].endsWith(" ")?d===void 0&&a===void 0&&(a=p):n[p-1].slice(-2,-1)===" "?u=p:d!=null||(d=p);break;default:n[p-1]+="'".repeat(v-5),n[p]="'''''",o++,l++}}if(o%2===1&&l%2===1){const p=(c=u!=null?u:d)!=null?c:a;p!==void 0&&(n[p]="''",n[p-1]+="'")}let h=!0,g=!0;for(let p=1;p<r;p+=2){const v=n[p].length,b=v!==2,S=v!==3;b&&(h=!h),S&&(g=!g),new Qo(n[p],{bold:b&&h,italic:S&&g},t,s),n[p]=`\0${s.length-1}q`}return n.join("")}}}),Ko={};se(Ko,{parseExternalLinks:()=>$n});var $n,Yo=C({"parser/externalLinks.ts"(){"use strict";ge(),$o(),wn(),$n=(e,t,s,i)=>{var n;return(n=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${ht}|\0\d+m\x7F)${ct}(?=[[\]<>"\t${Be}]|\0\d)))([${Be}]*(?![${Be}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(r,l,o,u)=>{const{length:d}=s,a=/&[lg]t;/u.exec(l);return a&&(o="",u=l.slice(a.index)+o+u,l=l.slice(0,a.index)),i?(new Gt(l,"ext-link-url",t,s),`[\0${d}f${o}${u}]`):(new ot(l,o,u,t,s),`\0${d}w`)})}}}),Zo,bu=C({"src/link/category.ts"(){"use strict";ys(),Zo=class extends Oe{get type(){return"category"}get sortkey(){}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),ea={};se(ea,{parseLinks:()=>en});var yl,en,wu=C({"parser/links.ts"(){"use strict";ge(),W(),Xo(),Yo(),_o(),yo(),bu(),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 n=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,r=e.split("[[");let l=r.shift();for(let u=0;u<r.length;u++){let d=!1,a,h,g,c;const p=r[u],v=n.exec(p);if(v)[,a,h,g,c]=v,c.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",c=c.slice(1));else{const y=yl.exec(p);y&&(d=!0,[,a,h,g]=y)}if(a===void 0||t.regexLinks.test(a)||/\0\d+[exhbru]\x7F/u.test(a)){l+=`[[${p}`;continue}let b=be(a).trim();const S=b.startsWith(":");if(S&&d){l+=`[[${p}`;continue}else!b&&g&&!g.includes(`
25
- `)&&(b=be(g).trim());const{ns:A,valid:w}=I.normalizeTitle(b,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(w){if(d){if(A!==6){l+=`[[${p}`;continue}let y=!1;for(u++;u<r.length;u++){const _=r[u],x=_.split("]]");if(x.length>2){y=!0,g+=`[[${x[0]}]]${x[1]}`,c=x.slice(2).join("]]");break}else if(x.length===2)g+=`[[${x[0]}]]${x[1]}`;else{g+=`[[${_}`;break}}if(g=en(g,t,s,i),!y){l+=`[[${a}${h}${g}`;continue}}}else{l+=`[[${p}`;continue}g&&(g=_n(g,t,s,i));let f=bn;S||(A===6?(g&&(g=$n(g,t,s,!0)),f=vn):A===14&&(f=Zo)),g===void 0&&h&&(g=""),l+=`\0${s.length}l${c}`,new f(a,g,t,s,h)}return l}}}),ta={};se(ta,{parseMagicLinks:()=>sa});var Ei,Fi,ji,Pi,sa,yu=C({"parser/magicLinks.ts"(){"use strict";ge(),wn(),Ei=String.raw`[${Be}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Fi=`(?:${Ei})+`,ji=`(?:${Ei}|-)`,Pi=String.raw`(?:RFC|PMID)${Fi}\d+\b|ISBN${Fi}(?:97[89]${ji}?)?(?:\d${ji}?){9}[\dx]\b`,sa=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${ht}${ct})|${Pi})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${ht}${ct})|${Pi})`,"giu")}return e.replace(t.regexMagicLinks,(i,n,r)=>{let l=n?i.slice(n.length):i;if(r){let o="";const u=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);u&&(o=l.slice(u.index),l=l.slice(0,u.index));const d=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,a=d.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>=r.length?i:(new Gt(l,void 0,t,s),`${n}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Gt(l,"magic-link",t,s),`${n}\0${s.length-1}i`})}}}),ia,Su=C({"util/html.ts"(){"use strict";ia=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),na,ku=C({"src/nowiki/list.ts"(){"use strict";zo(),na=class extends kn{get type(){return"list"}}}}),ra={};se(ra,{parseList:()=>la});var la,Au=C({"parser/list.ts"(){"use strict";Su(),ku(),Mo(),la=(e,t,s,i)=>{const n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!n)return t.lastPrefix="",e;const[r,l,o,u]=n,d=o.replace(/;/gu,":"),a=ia(d,t.lastPrefix),h=((a>1?o.slice(a-1):o)+u).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(a>1){const $=o.slice(0,a-1);if(g){const j=$.split(/(?=;)/u);h.unshift(...j),c+=$.includes(";")?j.length:0}else h[0]=$+h[0]}t.lastPrefix=d;let p=l+h.map(($,j)=>`\0${i.length+j}d`).join("")+e.slice(r.length);for(const $ of h)new na($,s,i);if(!c)return p;const{html:[v,,b]}=s,S=/:+|-\{|\0\d+[xq]\x7F/gu;let A=S,w=A.exec(p),f=0,y=!1,_=!1,x=0;const k=($,j)=>(new An($,s,i),`${p.slice(0,j)}\0${i.length-1}d${p.slice(j+$.length)}`),T=$=>{$?f&&f--:f++};for(;w&&c;){const{0:$,index:j}=w;if($==="-{"){if(!x){const{lastIndex:E}=A;A=/-\{|\}-/gu,A.lastIndex=E}x++}else if($==="}-"){if(x--,!x){const{lastIndex:E}=A;A=S,A.lastIndex=E}}else if($.endsWith("x")){const{name:E,closing:P,selfClosing:ne}=i[Number($.slice(1,-2))];(v.includes(E)||!ne&&!b.includes(E))&&T(P)}else if($.endsWith("q")){const{bold:E,italic:P}=i[Number($.slice(1,-2))];E&&(T(y),y=!y),P&&(T(_),_=!_)}else if(f===0){if($.length>=c)return k($.slice(0,c),j);c-=$.length,A.lastIndex=j+4+String(i.length).length,p=k($,j)}w=A.exec(p)}return p}}}),rs,Sl,Ri,kl,Wt,_u=C({"src/converterFlags.ts"(){"use strict";var e,t;z(),de(),Ss(),W(),q(),ze(),rs=new Set(["A","T","R","D","-","H","N"]),Sl=[Vt()],Wt=(t=class extends(kl=F){constructor(i,n,r=[]){super(void 0,n,r,{});N(this,e);this.safeAppend(i.map(l=>new xe(l,"converter-flag",n,r)))}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(n=>i.has(n)))}isInvalidFlag(i,n,r,l){return typeof i=="object"&&(i=i.text().trim(),n=this.getVariantFlags(),r=this.getUnknownFlags(),l=new Set(m(this,e).filter(o=>rs.has(o)))),!!i&&!n.has(i)&&!r.has(i)&&(n.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),n){{const r=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(m(this,e).filter(b=>rs.has(b))),u=m(this,e).filter(b=>!b).length,d=m(this,e).length-l.size-u,{lintConfig:a}=I,{computeEditInfo:h,fix:g}=a,c=super.lint(i,n);if(r.size===d||o.size===d)return c;const p="no-ignored",v=a.getSeverity(p,"conversionFlag");if(v){const b=new le(this,i);for(let S=0;S<this.length;S++){const A=this.childNodes[S],w=A.text().trim();if(this.isInvalidFlag(w,r,l,o)){const f=B(A,b,p,"invalid-conversion-flag",v);(h||g)&&(r.size===0&&rs.has(w.toUpperCase())?f.fix=un(f,w):h&&(f.suggestions=[U(f,S&&-1)])),c.push(f)}}}return c}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Ri=K(kl),Wt=X(Ri,0,"ConverterFlagsToken",Sl,Wt),J(Ri,1,Wt)}}),ps,$u=C({"src/converterRule.ts"(){"use strict";W(),q(),ze(),ps=class extends F{get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i);const n=e.indexOf(":"),r=e.slice(0,n).indexOf("=>"),l=r===-1?e.slice(0,n):e.slice(r+2,n);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new xe(l,"converter-rule-variant",s,i)),super.insertAt(new xe(e.slice(n+1),"converter-rule-to",s,i)),r!==-1&&super.insertAt(new xe(e.slice(0,r),"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()){const s=super.json(void 0,t)}}}}),Al,Oi,_l,zt,Tu=C({"src/converter.ts"(){"use strict";ge(),We(),Fe(),q(),_u(),$u(),Al=[Ie,je("-{")],zt=class extends(_l=F){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Wt(e,s,i));const[n]=t,r=n.includes(":"),l=new ps(n,r,s,i);r&&l.length===1||!r&&t.length===2&&!be(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()}|${Xe(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?"|":""}${pt(t,{sep:";"})}}-</span>`}},Oi=K(_l),zt=X(Oi,0,"ConverterToken",Al,zt),J(Oi,1,zt)}}),oa={};se(oa,{parseConverter:()=>aa});var aa,Cu=C({"parser/converter.ts"(){"use strict";Tu(),aa=(e,t,s)=>{var u;(u=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,n=/-\{|\}-/gu,r=[];let l=i,o=l.exec(e);for(;o;){const{0:d,index:a}=o;if(d==="}-"){const h=r.pop(),{length:g}=s,c=e.slice(h.index+2,a),p=c.indexOf("|"),[v,b]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],S=b.replace(/(&[#a-z\d]+);/giu,"$1"),A=S.split(t.regexConverter).map(w=>w.replace(/\x01/gu,";"));new zt(v,A,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(a+2)}`,r.length===0&&(l=i),l.lastIndex=h.index+3+String(g).length}else r.push(o),l=n,l.lastIndex=a+2;o=l.exec(e)}return e}}}),vs={};se(vs,{Token:()=>F});var $l,F,q=C({"src/index.ts"(){"use strict";var e,t,s,i,n,r,l,o,ua,da,ha,ca,ga,pa,fa,ma,xa,va,ba,wa,f;ge(),Ke(),z(),Ne(),W(),Wa(),za(),$l=["category","html-attr#id,ext-attr#id,table-attr#id"],F=(f=class extends Nt{constructor(x,k=I.getConfig(),T=[],$){super();N(this,o);N(this,e,"plain");N(this,t,0);N(this,s);N(this,i);N(this,n);N(this,r,!1);N(this,l);typeof x=="string"&&this.insertAt(x),L(this,s,k),L(this,i,T),T.push(this)}get type(){return m(this,e)}set type(x){L(this,e,x)}parseOnce(x=m(this,t),k=!1,T){if(x<m(this,t)||this.length===0||!this.isPlain())return this;if(m(this,t)>=Se)return this;switch(x){case 0:if(this.type==="root"){m(this,i).pop();const $=R(this,o,ua).call(this);k&&(k=!$)}L(this,n,k),R(this,o,da).call(this,k);break;case 1:R(this,o,ha).call(this);break;case 2:R(this,o,ca).call(this);break;case 3:R(this,o,ga).call(this);break;case 4:R(this,o,pa).call(this);break;case 5:R(this,o,fa).call(this,T);break;case 6:R(this,o,ma).call(this,T);break;case 7:R(this,o,xa).call(this);break;case 8:R(this,o,va).call(this);break;case 9:R(this,o,ba).call(this);break;case 10:R(this,o,wa).call(this)}if(this.type==="root")for(const $ of m(this,i))$==null||$.parseOnce(x,k,T);return On(this,t)._++,this}buildFromStr(x,k){const T=x.split(/[\0\x7F]/u).map(($,j)=>{if(j%2===0)return new Qi($);if(isNaN($.slice(-1)))return m(this,i)[Number($.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${$}`)});return k===0?T.map(String).join(""):k===1?Xe(T):T}build(){L(this,t,Se);const{length:x,firstChild:k}=this,T=k==null?void 0:k.toString();if(x===1&&k.type==="text"&&T.includes("\0")&&(Tn(this,0,1,this.buildFromStr(T)),this.normalize(),this.type==="root"))for(const $ of m(this,i))$==null||$.build()}afterBuild(){if(this.type==="root")for(const x of m(this,i))x==null||x.afterBuild();L(this,r,!0)}parse(x=Se,k,T){for(x=Math.min(x,Se);m(this,t)<x;)this.parseOnce(m(this,t),k,T);return x&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===f}getAttribute(x){var k;switch(x){case"config":return m(this,s);case"include":return(k=m(this,n))!=null?k:!!m(this.getRootNode(),n);case"accum":return m(this,i);case"built":return m(this,r);case"stage":return m(this,t);case"invalid":return this.type==="table-inter"&&Mt(this)===2;default:return super.getAttribute(x)}}setAttribute(x,k){switch(x){case"stage":m(this,t)===0&&this.type==="root"&&m(this,i).shift(),L(this,t,k);break;default:super.setAttribute(x,k)}}insertAt(x,k=this.length){const T=typeof x=="string"?new Qi(x):x;super.insertAt(T,k);const{type:$}=T;return $==="root"&&(T.type="plain"),T}normalizeTitle(x,k=0,T){return I.normalizeTitle(x,k,m(this,n),m(this,s),T)}inTableAttrs(){var x,k;return((x=this.closest("table-attrs,ext"))==null?void 0:x.type)==="table-attrs"&&((k=this.closest("table-attrs,arg,magic-word,template"))!=null&&k.is("table-attrs")?2:1)}inHtmlAttrs(){var x;return(x=this.closest("html-attrs,ext"))!=null&&x.is("html-attrs")?2:this.inTableAttrs()}lint(x=this.getAbsoluteIndex(),k){var T;{const{lintConfig:$}=I,{computeEditInfo:j,fix:E,ignoreDisables:P,configurationComment:ne}=$;let O=super.lint(x,k);if(this.type==="root"){const re=new Map,fe="no-duplicate",G=["category","id"].map(M=>$.getSeverity(fe,M)),D=this.toString(),Y=$l.filter((M,Z)=>G[Z]).join();if(Y){for(const M of this.querySelectorAll(Y)){let Z;if(M.is("category"))Z=M.name;else{const H=M.getValue();H&&H!==!0&&(Z=`#${H}`)}if(Z){const H=re.get(Z);H?H.add(M):re.set(Z,new Set([M]))}}for(const[M,Z]of re)if(Z.size>1&&!M.startsWith("#mw-customcollapsible-")){const H=!M.startsWith("#"),ee=`duplicate-${H?"category":"id"}`,oe=G[H?0:1];O.push(...[...Z].map(ae=>{const te=Q(ae,{start:ae.getAbsoluteIndex()},fe,ee,oe);return j&&H&&(te.suggestions=[U(te)]),te}))}}if(!P){const M=new RegExp(String.raw`<!--\s*${ne}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Z=[];let H=M.exec(D);for(;H;){const{1:ee,index:oe}=H,ae=(T=H[2])==null?void 0:T.trim();Z.push({line:this.posFromIndex(oe).top+(ee==="disable-line"?0:1),from:ee==="disable"?M.lastIndex:void 0,to:ee==="enable"?M.lastIndex:void 0,rules:ae?new Set(ae.split(",").map(te=>te.trim())):void 0}),H=M.exec(D)}O=O.filter(({rule:ee,startLine:oe,startIndex:ae})=>{const te={pos:0};for(const{line:Ue,from:ue,to:ve,rules:Ce}of Z){if(Ue>oe+1)break;if(Ce&&!Ce.has(ee))continue;if(Ue===oe&&ue===void 0&&ve===void 0)return!1;ue<=ae&&ue>te.pos?(te.pos=ue,te.type="from"):ve<=ae&&ve>te.pos&&(te.pos=ve,te.type="to")}return te.type!=="from"})}if(E&&O.some(({fix:M})=>M)){const M=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 M)oe<=Z&&(H=H.slice(0,ee)+ae+H.slice(oe),Z=ee);Object.assign(O,{output:H})}if(!j)for(const M of O)delete M.fix,delete M.suggestions}return O}}toString(x,k){return x?super.toString(!0,k):Je(m(this,l),()=>super.toString(!1,k),T=>{const $=this.getRootNode();$.type==="root"&&m($,r)&&L(this,l,T)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap,o=new WeakSet,ua=function(){const{parseRedirect:x}=(Ha(),V(Xl)),k=this.firstChild.toString(),T=x(k,m(this,s),m(this,i));return T&&this.setText(T),!!T},da=function(x){const{parseCommentAndExt:k}=(Ts(),V(jo));this.setText(k(this.firstChild.toString(),m(this,s),m(this,i),x))},ha=function(){const{parseBraces:x}=(xn(),V(go)),k=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,T=x(k,m(this,s),m(this,i));this.setText(this.type==="root"?T:T.slice(1))},ca=function(){if(m(this,s).excludes.includes("html"))return;const{parseHtml:x}=(hu(),V(Po));this.setText(x(this.firstChild.toString(),m(this,s),m(this,i)))},ga=function(){if(m(this,s).excludes.includes("table"))return;const{parseTable:x}=(pu(),V(Uo));this.setText(x(this,m(this,s),m(this,i)))},pa=function(){if(m(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:x}=(xu(),V(Go));this.setText(x(this,m(this,s),m(this,i)))},fa=function(x){const{parseLinks:k}=(wu(),V(ea));this.setText(k(this.firstChild.toString(),m(this,s),m(this,i),x))},ma=function(x){if(m(this,s).excludes.includes("quote"))return;const{parseQuotes:k}=(Xo(),V(Jo)),T=this.firstChild.toString().split(`
26
- `);for(let $=0;$<T.length;$++)T[$]=k(T[$],m(this,s),m(this,i),x);this.setText(T.join(`
27
- `))},xa=function(){if(m(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:x}=(Yo(),V(Ko));this.setText(x(this.firstChild.toString(),m(this,s),m(this,i)))},va=function(){if(m(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:x}=(yu(),V(ta));this.setText(x(this.firstChild.toString(),m(this,s),m(this,i)))},ba=function(){if(m(this,s).excludes.includes("list"))return;const{parseList:x}=(Au(),V(ra)),{firstChild:k,type:T,name:$}=this,j=k.toString().split(`
28
- `),E={lastPrefix:""};let P=T==="root"||T==="ext-inner"&&$==="poem"?0:1;for(;P<j.length;P++)j[P]=x(j[P],E,m(this,s),m(this,i));this.setText(j.join(`
29
- `))},wa=function(){if(m(this,s).variants.length>0){const{parseConverter:x}=(Cu(),V(oa));this.setText(x(this.firstChild.toString(),m(this,s),m(this,i)))}},f)}}),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}=(q(),V(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 n=e.getChildNodes(),r;n.length===s?(r=n,n=i):r=n.splice(t,s,...i);for(let u=0;u<i.length;u++){const d=i[u];d.setAttribute("parentNode",e),d.setAttribute("nextSibling",n[t+u+1]),d.setAttribute("previousSibling",n[t+u-1])}return(l=n[t-1])==null||l.setAttribute("nextSibling",n[t]),(o=n[t+i.length])==null||o.setAttribute("previousSibling",n[t+i.length-1]),n===i&&e.setAttribute("childNodes",n),r}}}),Tl,Ct,Bi,ls,qi,Cl,Wi,Il,tn,Iu=C({"lib/lintConfig.ts"(){"use strict";var e,t;Bl(),Tl=new Set([0,1,2]),Ct=new Map([[0,!1],[1,"warning"],[2,"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,{}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Bi),ls={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(ls),qi=s=>typeof s=="number"&&Tl.has(s),Cl=s=>qi(s)||Array.isArray(s)&&s.length===2&&qi(s[0])&&s[1]&&typeof s[1]=="object",Wi=(s,i,n)=>{if(fs.includes(i)){if(n===void 0)return!1;if(Cl(n))return s[i]=n,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(n)}`)},Il=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(Bi))),!!s)for(const[i,n]of Object.entries(s))Wi(this,i,n)}getSeverity(s,i){var r;const n=this[s];return typeof n=="number"?Ct.get(n):i&&(r=Ct.get(n[1][i]))!=null?r:Ct.get(n[0])}},tn=(t=class{constructor(s){N(this,e);if(Object.assign(this,ls),s&&!("rules"in s)&&Object.keys(s).some(n=>fs.includes(n)))this.rules=s;else{const i=s!=null?s:{},{rules:n}=i,r=Rn(i,["rules"]);this.rules=n;for(const[l,o]of Object.entries(r))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 Il(s),{set:Wi,deleteProperty(){return!1}}))}getSeverity(s,i){return m(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),ya={};se(ya,{Title:()=>Sa});var Sa,Nu=C({"lib/title.ts"(){"use strict";var e,t,s,i,n,r;Ye(),ge(),Sa=(r=class{constructor(l,o,u,{temporary:d,decode:a,selfLink:h}={}){N(this,e);N(this,t);N(this,s);N(this,i);N(this,n);Ee(this,"valid");Ee(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=Ht(l),this.encoded=p}catch(p){}if(l=ms(l).replace(/[_ ]+/gu," ").trim(),g)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 b=gt(v[0]),S=Object.prototype.hasOwnProperty.call(u.nsid,b)&&u.nsid[b];S&&(p=S,l=v.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=Ht(p)}catch(v){}L(this,n,p.replace(/ /gu,"_")),l=l.slice(0,c).trim()}this.valid=!!(l||h&&this.ns===0&&m(this,n)!==void 0)&&ms(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,u.namespaces),L(this,s,u.articlePath||"/wiki/$1"),m(this,s).includes("$1")||L(this,s,m(this,s)+`${m(this,s).endsWith("/")?"":"/"}$1`),d||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return m(this,i)}get fragment(){return m(this,n)}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,n,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,n=new WeakMap,r)}}),ka={};se(ka,{default:()=>I});Aa.exports=V(ka);var os,zi,Nl,Pe,Mi,Ll,I,W=C({"index.ts"(){Bl(),Ne(),Ke(),ge(),Iu(),os=!0,zi=new tn,Pe={config:Hi,get rules(){return fs},get i18n(){return me(me({},zl),Nl)},set i18n(e){Nl=e},get lintConfig(){return zi},set lintConfig(e){zi=new tn(e)},get viewOnly(){return os},set viewOnly(e){os&&!e&&ke.rev++,os=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:n,variable:r}=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")&&!r.includes("translationlanguage")&&(r.push("translationlanguage"),Array.isArray(n[1])?n[1].push("TRANSLATIONLANGUAGE"):n[1].TRANSLATIONLANGUAGE="translationlanguage"),Le(me(me({},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=Pe.getConfig(),n){const{Title:r}=(Nu(),V(ya));let l;if(n!=null&&n.halfParsed)l=new r(e,t,i,n);else{const{Token:o}=(q(),V(vs));l=ke.run(()=>{const u=new o(e,i);u.type="root",u.parseOnce(0,s).parseOnce();const d=new r(u.toString(),t,i,n);u.build();for(const a of["main","fragment"]){const h=d[a];if(h!=null&&h.includes("\0")){const g=u.buildFromStr(h,1);a==="main"?d.main=g:d.setFragment(g)}}return d})}return l},parse(e,t,s=Se,i=Pe.getConfig()){e=ql(e);let n;typeof s!="number"&&(n=Array.isArray(s)?s:[s],s=Math.max(...n.map(o=>Ol[o]||Se)));const{Token:r}=(q(),V(vs));return ke.run(()=>{const o=new r(e,i);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,i=Pe.getConfig()){},createLanguageService(e={}){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},Mi={},Ll=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in Pe)Ll.has(e)||(Mi[e]={enumerable:!1});Object.defineProperties(Pe,Mi),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Pe}),I=Pe}});W()});Lu();})();
18
+ ${l.shift()}`,a;const d=(u,h)=>{if(!h){o+=u;return}const{lastChild:g}=h;if(vl(h)){const c=new j(u,i,n);c.type="table-inter",c.setAttribute("stage",3),h.insertAt(c)}else g.setText(g.toString()+u)};for(const u of l){a=r.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(u),g=u.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(;a&&!a.is("td");)a=r.pop();const[,v,m,S,A]=c;v&&new An(v,i,n),d(`
19
+ ${h}${v&&`\0${n.length-1}d`}${m}\0${n.length}b`,a),r.push(...a?[a]:[],new gs(S,A,i,n));continue}else if(!a){o+=`
20
+ ${u}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(g);if(!p){d(`
21
+ ${u}`,a),r.push(a);continue}const[,b,w,k,_]=p;if(b){for(;!a.is("table");)a=r.pop();a.close(`
22
+ ${h}${b}`,!0),d(_,r[r.length-1])}else if(w){a=Ni(a,r),a.is("tr")&&(a=r.pop());const v=new qo(`
23
+ ${h}${w}`,_,i,n);r.push(a,v),a.insertAt(v)}else{a=Ni(a,r);const v=k==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let m=v.exec(_),S=0,A=`
24
+ ${h}${k}`;const x=y=>{const T=new xs(A,_.slice(S,m==null?void 0:m.index),i,n);return y.insertAt(T),T};for(;m;)x(a),{lastIndex:S}=v,[A]=m,m=v.exec(_);r.push(a,x(a))}}return o.slice(1)}}}),Ho,pu=C({"src/nowiki/hr.ts"(){"use strict";tt(),Ho=class extends Te{get type(){return"hr"}}}}),bl,Li,wl,qt,fu=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";bt(),Me(),tt(),bl=[Ze(),je("__")],qt=class extends(wl=Te){get type(){return"double-underscore"}constructor(e,t,s,i){var o,a;super(e,s,i);const n=e.toLowerCase(),{doubleUnderscore:[,,r,l]}=s;this.setAttribute("name",(a=t?(o=l==null?void 0:l[e])==null?void 0:o.toLowerCase():r==null?void 0:r[n])!=null?a:n)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Li=K(wl),qt=X(Li,0,"DoubleUnderscoreToken",bl,qt),J(Li,1,qt)}}),Do={};se(Do,{parseHrAndDoubleUnderscore:()=>Go});var Go,mu=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";pu(),fu(),ao(),Go=({firstChild:{data:e},type:t,name:s},i,n)=>{var a,d,u;const{doubleUnderscore:[r,l,o]}=i;return(a=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(r)),(d=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l)),(u=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${[...r,...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 Ho(c,i,n),`${g}\0${n.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(h,g)=>{var w;const c=i.sensitiveDoubleUnderscore.has(g),p=g.toLowerCase(),b=i.insensitiveDoubleUnderscore.has(p);return c||b?(new qt(g,c,i,n),`\0${n.length-1}${b&&((w=o==null?void 0:o[p])!=null?w: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 w=`${g}\0${n.length}h`;return new rt(c.length,[p,b],i,n),w})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Vo,xu=C({"src/nowiki/quote.ts"(){"use strict";var e,t;M(),de(),W(),tt(),Vo=(t=class extends Te{constructor(i,n,r,l){super(i,r,l);N(this,e);L(this,e,n)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return me(me({},this.bold?{bold:f(this,e).bold}:void 0),this.italic?{italic:f(this,e).italic}:void 0)}text(){const{parentNode:i,innerText:n}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":n}lint(i=this.getAbsoluteIndex()){var n;{const{previousSibling:r,bold:l,closing:o}=this,a=(r==null?void 0:r.type)==="text"?r.data:void 0,d=[],u=new le(this,i),h=["lonely-apos","bold-header"],{lintConfig:g}=I,{computeEditInfo:c}=g,p=[void 0,"word"].map(w=>g.getSeverity(h[0],w)),b=g.getSeverity(h[1]);if(a!=null&&a.endsWith("'")){const w=p[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(a)?1:0];if(w){const k=G(this,u,h[0],I.msg("lonely","'"),w),{startLine:_,startCol:v}=k,[,{length:m}]=/(?:^|[^'])('+)$/u.exec(a),S=i-m,A=Le(me({},k),{startIndex:S,endIndex:i,endLine:_,startCol:v-m,endCol:v});c&&(A.suggestions=[mt(S,"&apos;",m),U(A)]),d.push(A)}}if(b&&l&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const w=G(this,u,h[1],"bold-in-header",b);c&&(w.suggestions=[U(w)]),d.push(w)}return d}}json(i,n=this.getAbsoluteIndex()){const r=super.json(void 0,n)}},e=new WeakMap,t)}}),Qo={};se(Qo,{parseQuotes:()=>_n});var _n,Jo=C({"parser/quotes.ts"(){"use strict";xu(),_n=(e,t,s,i)=>{var c;const n=e.split(/('{2,})/u),{length:r}=n;if(r===1)return e;let l=0,o=0,a,d,u;for(let p=1;p<r;p+=2){const b=n[p].length;switch(b){case 2:o++;break;case 4:n[p-1]+="'",n[p]="'''";case 3:if(l++,a!==void 0)break;n[p-1].endsWith(" ")?d===void 0&&u===void 0&&(u=p):n[p-1].slice(-2,-1)===" "?a=p:d!=null||(d=p);break;default:n[p-1]+="'".repeat(b-5),n[p]="'''''",o++,l++}}if(o%2===1&&l%2===1){const p=(c=a!=null?a:d)!=null?c:u;p!==void 0&&(n[p]="''",n[p-1]+="'")}let h=!0,g=!0;for(let p=1;p<r;p+=2){const b=n[p].length,w=b!==2,k=b!==3;w&&(h=!h),k&&(g=!g),new Vo(n[p],{bold:w&&h,italic:k&&g},t,s),n[p]=`\0${s.length-1}q`}return n.join("")}}}),Xo={};se(Xo,{parseExternalLinks:()=>$n});var $n,Ko=C({"parser/externalLinks.ts"(){"use strict";ge(),_o(),wn(),$n=(e,t,s,i)=>{var n;return(n=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${ct}|\0\d+m\x7F)${gt}(?=[[\]<>"\t${Be}]|\0\d)))([${Be}]*(?![${Be}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(r,l,o,a)=>{const{length:d}=s,u=/&[lg]t;/u.exec(l);return u&&(o="",a=l.slice(u.index)+o+a,l=l.slice(0,u.index)),i?(new Gt(l,"ext-link-url",t,s),`[\0${d}f${o}${a}]`):(new at(l,o,a,t,s),`\0${d}w`)})}}}),Yo,vu=C({"src/link/category.ts"(){"use strict";ys(),Yo=class extends Oe{get type(){return"category"}get sortkey(){}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),Zo={};se(Zo,{parseLinks:()=>en});var yl,en,bu=C({"parser/links.ts"(){"use strict";ge(),W(),Jo(),Ko(),Ao(),wo(),vu(),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 n=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,r=e.split("[[");let l=r.shift();for(let a=0;a<r.length;a++){let d=!1,u,h,g,c;const p=r[a],b=n.exec(p);if(b)[,u,h,g,c]=b,c.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",c=c.slice(1));else{const S=yl.exec(p);S&&(d=!0,[,u,h,g]=S)}if(u===void 0||t.regexLinks.test(u)||/\0\d+[exhbru]\x7F/u.test(u)){l+=`[[${p}`;continue}let w=be(u).trim();const k=w.startsWith(":");if(k&&d){l+=`[[${p}`;continue}else!w&&g&&!g.includes(`
25
+ `)&&(w=be(g).trim());const{ns:_,valid:v}=I.normalizeTitle(w,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(v){if(d){if(_!==6){l+=`[[${p}`;continue}let S=!1;for(a++;a<r.length;a++){const A=r[a],x=A.split("]]");if(x.length>2){S=!0,g+=`[[${x[0]}]]${x[1]}`,c=x.slice(2).join("]]");break}else if(x.length===2)g+=`[[${x[0]}]]${x[1]}`;else{g+=`[[${A}`;break}}if(g=en(g,t,s,i),!S){l+=`[[${u}${h}${g}`;continue}}}else{l+=`[[${p}`;continue}g&&(g=_n(g,t,s,i));let m=bn;k||(_===6?(g&&(g=$n(g,t,s,!0)),m=vn):_===14&&(m=Yo)),g===void 0&&h&&(g=""),l+=`\0${s.length}l${c}`,new m(u,g,t,s,h)}return l}}}),ea={};se(ea,{parseMagicLinks:()=>ta});var Ei,Fi,ji,Pi,ta,wu=C({"parser/magicLinks.ts"(){"use strict";ge(),wn(),Ei=String.raw`[${Be}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Fi=`(?:${Ei})+`,ji=`(?:${Ei}|-)`,Pi=String.raw`(?:RFC|PMID)${Fi}\d+\b|ISBN${Fi}(?:97[89]${ji}?)?(?:\d${ji}?){9}[\dx]\b`,ta=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${ct}${gt})|${Pi})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${ct}${gt})|${Pi})`,"giu")}return e.replace(t.regexMagicLinks,(i,n,r)=>{let l=n?i.slice(n.length):i;if(r){let o="";const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);a&&(o=l.slice(a.index),l=l.slice(0,a.index));const d=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=d.exec(l);if(u){let h=1;u[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,u.index))&&(h=2),o=l.slice(u.index+h)+o,l=l.slice(0,u.index+h)}return o.length>=r.length?i:(new Gt(l,void 0,t,s),`${n}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Gt(l,"magic-link",t,s),`${n}\0${s.length-1}i`})}}}),sa,yu=C({"util/html.ts"(){"use strict";sa=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),ia,Su=C({"src/nowiki/list.ts"(){"use strict";Wo(),ia=class extends kn{get type(){return"list"}}}}),na={};se(na,{parseList:()=>ra});var ra,ku=C({"parser/list.ts"(){"use strict";yu(),Su(),Mo(),ra=(e,t,s,i)=>{const n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!n)return t.lastPrefix="",e;const[r,l,o,a]=n,d=o.replace(/;/gu,":"),u=sa(d,t.lastPrefix),h=((u>1?o.slice(u-1):o)+a).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(u>1){const $=o.slice(0,u-1);if(g){const E=$.split(/(?=;)/u);h.unshift(...E),c+=$.includes(";")?E.length:0}else h[0]=$+h[0]}t.lastPrefix=d;let p=l+h.map(($,E)=>`\0${i.length+E}d`).join("")+e.slice(r.length);for(const $ of h)new ia($,s,i);if(!c)return p;const{html:[b,,w]}=s,k=/:+|-\{|\0\d+[xq]\x7F/gu;let _=k,v=_.exec(p),m=0,S=!1,A=!1,x=0;const y=($,E)=>(new An($,s,i),`${p.slice(0,E)}\0${i.length-1}d${p.slice(E+$.length)}`),T=$=>{$?m&&m--:m++};for(;v&&c;){const{0:$,index:E}=v;if($==="-{"){if(!x){const{lastIndex:F}=_;_=/-\{|\}-/gu,_.lastIndex=F}x++}else if($==="}-"){if(x--,!x){const{lastIndex:F}=_;_=k,_.lastIndex=F}}else if($.endsWith("x")){const{name:F,closing:P,selfClosing:ne}=i[Number($.slice(1,-2))];(b.includes(F)||!ne&&!w.includes(F))&&T(P)}else if($.endsWith("q")){const{bold:F,italic:P}=i[Number($.slice(1,-2))];F&&(T(S),S=!S),P&&(T(A),A=!A)}else if(m===0){if($.length>=c)return y($.slice(0,c),E);c-=$.length,_.lastIndex=E+4+String(i.length).length,p=y($,E)}v=_.exec(p)}return p}}}),rs,Sl,Ri,kl,Wt,Au=C({"src/converterFlags.ts"(){"use strict";var e,t;M(),de(),Ss(),W(),q(),ze(),rs=new Set(["A","T","R","D","-","H","N"]),Sl=[Vt()],Wt=(t=class extends(kl=j){constructor(i,n,r=[]){super(void 0,n,r,{});N(this,e);this.safeAppend(i.map(l=>new xe(l,"converter-flag",n,r)))}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(f(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(f(this,e).filter(n=>i.has(n)))}isInvalidFlag(i,n,r,l){return typeof i=="object"&&(i=i.text().trim(),n=this.getVariantFlags(),r=this.getUnknownFlags(),l=new Set(f(this,e).filter(o=>rs.has(o)))),!!i&&!n.has(i)&&!r.has(i)&&(n.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),n){{const r=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(f(this,e).filter(w=>rs.has(w))),a=f(this,e).filter(w=>!w).length,d=f(this,e).length-l.size-a,{lintConfig:u}=I,{computeEditInfo:h,fix:g}=u,c=super.lint(i,n);if(r.size===d||o.size===d)return c;const p="no-ignored",b=u.getSeverity(p,"conversionFlag");if(b){const w=new le(this,i);for(let k=0;k<this.length;k++){const _=this.childNodes[k],v=_.text().trim();if(this.isInvalidFlag(v,r,l,o)){const m=B(_,w,p,"invalid-conversion-flag",b);(h||g)&&(r.size===0&&rs.has(v.toUpperCase())?m.fix=un(m,v):h&&(m.suggestions=[U(m,k&&-1)])),c.push(m)}}}return c}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Ri=K(kl),Wt=X(Ri,0,"ConverterFlagsToken",Sl,Wt),J(Ri,1,Wt)}}),ps,_u=C({"src/converterRule.ts"(){"use strict";W(),q(),ze(),ps=class extends j{get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i);const n=e.indexOf(":"),r=e.slice(0,n).indexOf("=>"),l=r===-1?e.slice(0,n):e.slice(r+2,n);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new xe(l,"converter-rule-variant",s,i)),super.insertAt(new xe(e.slice(n+1),"converter-rule-to",s,i)),r!==-1&&super.insertAt(new xe(e.slice(0,r),"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()){const s=super.json(void 0,t)}}}}),Al,Oi,_l,Mt,$u=C({"src/converter.ts"(){"use strict";ge(),Me(),Fe(),q(),Au(),_u(),Al=[Ie,je("-{")],Mt=class extends(_l=j){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Wt(e,s,i));const[n]=t,r=n.includes(":"),l=new ps(n,r,s,i);r&&l.length===1||!r&&t.length===2&&!be(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()}|${Ke(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?"|":""}${ft(t,{sep:";"})}}-</span>`}},Oi=K(_l),Mt=X(Oi,0,"ConverterToken",Al,Mt),J(Oi,1,Mt)}}),la={};se(la,{parseConverter:()=>oa});var oa,Tu=C({"parser/converter.ts"(){"use strict";$u(),oa=(e,t,s)=>{var a;(a=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,n=/-\{|\}-/gu,r=[];let l=i,o=l.exec(e);for(;o;){const{0:d,index:u}=o;if(d==="}-"){const h=r.pop(),{length:g}=s,c=e.slice(h.index+2,u),p=c.indexOf("|"),[b,w]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],k=w.replace(/(&[#a-z\d]+);/giu,"$1"),_=k.split(t.regexConverter).map(v=>v.replace(/\x01/gu,";"));new Mt(b,_,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(u+2)}`,r.length===0&&(l=i),l.lastIndex=h.index+3+String(g).length}else r.push(o),l=n,l.lastIndex=u+2;o=l.exec(e)}return e}}}),vs={};se(vs,{Token:()=>j});var $l,j,q=C({"src/index.ts"(){"use strict";var e,t,s,i,n,r,l,o,aa,ua,da,ha,ca,ga,pa,fa,ma,xa,va,ba,m;ge(),We(),M(),Ne(),W(),qa(),Wa(),$l=["category","html-attr#id,ext-attr#id,table-attr#id"],j=(m=class extends Nt{constructor(x,y=I.getConfig(),T=[],$){super();N(this,o);N(this,e,"plain");N(this,t,0);N(this,s);N(this,i);N(this,n);N(this,r,!1);N(this,l);typeof x=="string"&&this.insertAt(x),L(this,s,y),L(this,i,T),T.push(this)}get type(){return f(this,e)}set type(x){L(this,e,x)}parseOnce(x=f(this,t),y=!1,T){if(x<f(this,t)||this.length===0||!this.isPlain())return this;if(f(this,t)>=we)return this;switch(x){case 0:if(this.type==="root"){f(this,i).pop();const $=R(this,o,aa).call(this);y&&(y=!$)}L(this,n,y),R(this,o,ua).call(this,y);break;case 1:R(this,o,da).call(this);break;case 2:R(this,o,ha).call(this);break;case 3:R(this,o,ca).call(this);break;case 4:R(this,o,ga).call(this);break;case 5:R(this,o,pa).call(this,T);break;case 6:R(this,o,fa).call(this,T);break;case 7:R(this,o,ma).call(this);break;case 8:R(this,o,xa).call(this);break;case 9:R(this,o,va).call(this);break;case 10:R(this,o,ba).call(this)}if(this.type==="root")for(const $ of f(this,i))$==null||$.parseOnce(x,y,T);return On(this,t)._++,this}buildFromStr(x,y){const T=x.split(/[\0\x7F]/u).map(($,E)=>{if(E%2===0)return new Qi($);if(isNaN($.slice(-1)))return f(this,i)[Number($.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${$}`)});return y===0?T.map(String).join(""):y===1?Ke(T):T}build(){L(this,t,we);const{length:x,firstChild:y}=this,T=y==null?void 0:y.toString();if(x===1&&y.type==="text"&&T.includes("\0")&&(Tn(this,0,1,this.buildFromStr(T)),this.normalize(),this.type==="root"))for(const $ of f(this,i))$==null||$.build()}afterBuild(){if(this.type==="root")for(const x of f(this,i))x==null||x.afterBuild();L(this,r,!0)}parse(x=we,y,T){for(x=Math.min(x,we);f(this,t)<x;)this.parseOnce(f(this,t),y,T);return x&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===m}getAttribute(x){var y;switch(x){case"config":return f(this,s);case"include":return(y=f(this,n))!=null?y:!!f(this.getRootNode(),n);case"accum":return f(this,i);case"built":return f(this,r);case"stage":return f(this,t);case"invalid":return this.type==="table-inter"&&zt(this)===2;default:return super.getAttribute(x)}}setAttribute(x,y){switch(x){case"stage":f(this,t)===0&&this.type==="root"&&f(this,i).shift(),L(this,t,y);break;default:super.setAttribute(x,y)}}insertAt(x,y=this.length){const T=typeof x=="string"?new Qi(x):x;super.insertAt(T,y);const{type:$}=T;return $==="root"&&(T.type="plain"),T}normalizeTitle(x,y=0,T){return I.normalizeTitle(x,y,f(this,n),f(this,s),T)}inTableAttrs(){var x,y;return((x=this.closest("table-attrs,ext"))==null?void 0:x.type)==="table-attrs"&&((y=this.closest("table-attrs,arg,magic-word,template"))!=null&&y.is("table-attrs")?2:1)}inHtmlAttrs(){var x;return(x=this.closest("html-attrs,ext"))!=null&&x.is("html-attrs")?2:this.inTableAttrs()}lint(x=this.getAbsoluteIndex(),y){var T;{const{lintConfig:$}=I,{computeEditInfo:E,fix:F,ignoreDisables:P,configurationComment:ne}=$;let O=super.lint(x,y);if(this.type==="root"){const re=new Map,fe="no-duplicate",V=["category","id"].map(z=>$.getSeverity(fe,z)),D=this.toString(),Y=$l.filter((z,Z)=>V[Z]).join();if(Y){for(const z of this.querySelectorAll(Y)){let Z;if(z.is("category"))Z=z.name;else{const H=z.getValue();H&&H!==!0&&(Z=`#${H}`)}if(Z){const H=re.get(Z);H?H.add(z):re.set(Z,new Set([z]))}}for(const[z,Z]of re)if(Z.size>1&&!z.startsWith("#mw-customcollapsible-")){const H=!z.startsWith("#"),ee=`duplicate-${H?"category":"id"}`,oe=V[H?0:1];O.push(...[...Z].map(ae=>{const te=G(ae,{start:ae.getAbsoluteIndex()},fe,ee,oe);return E&&H&&(te.suggestions=[U(te)]),te}))}}if(!P){const z=new RegExp(String.raw`<!--\s*${ne}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Z=[];let H=z.exec(D);for(;H;){const{1:ee,index:oe}=H,ae=(T=H[2])==null?void 0:T.trim();Z.push({line:this.posFromIndex(oe).top+(ee==="disable-line"?0:1),from:ee==="disable"?z.lastIndex:void 0,to:ee==="enable"?z.lastIndex:void 0,rules:ae?new Set(ae.split(",").map(te=>te.trim())):void 0}),H=z.exec(D)}O=O.filter(({rule:ee,startLine:oe,startIndex:ae})=>{const te={pos:0};for(const{line:He,from:ue,to:ve,rules:Ce}of Z){if(He>oe+1)break;if(Ce&&!Ce.has(ee))continue;if(He===oe&&ue===void 0&&ve===void 0)return!1;ue<=ae&&ue>te.pos?(te.pos=ue,te.type="from"):ve<=ae&&ve>te.pos&&(te.pos=ve,te.type="to")}return te.type!=="from"})}if(F&&O.some(({fix:z})=>z)){const z=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 z)oe<=Z&&(H=H.slice(0,ee)+ae+H.slice(oe),Z=ee);Object.assign(O,{output:H})}if(!E)for(const z of O)delete z.fix,delete z.suggestions}return O}}toString(x,y){return x?super.toString(!0,y):Xe(f(this,l),()=>super.toString(!1,y),T=>{const $=this.getRootNode();$.type==="root"&&f($,r)&&L(this,l,T)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap,o=new WeakSet,aa=function(){const{parseRedirect:x}=(Ua(),Q(Jl)),y=this.firstChild.toString(),T=x(y,f(this,s),f(this,i));return T&&this.setText(T),!!T},ua=function(x){const{parseCommentAndExt:y}=(Ts(),Q(Fo));this.setText(y(this.firstChild.toString(),f(this,s),f(this,i),x))},da=function(){const{parseBraces:x}=(xn(),Q(co)),y=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,T=x(y,f(this,s),f(this,i));this.setText(this.type==="root"?T:T.slice(1))},ha=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:x}=(du(),Q(jo));this.setText(x(this.firstChild.toString(),f(this,s),f(this,i)))},ca=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:x}=(gu(),Q(zo));this.setText(x(this,f(this,s),f(this,i)))},ga=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:x}=(mu(),Q(Do));this.setText(x(this,f(this,s),f(this,i)))},pa=function(x){const{parseLinks:y}=(bu(),Q(Zo));this.setText(y(this.firstChild.toString(),f(this,s),f(this,i),x))},fa=function(x){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:y}=(Jo(),Q(Qo)),T=this.firstChild.toString().split(`
26
+ `);for(let $=0;$<T.length;$++)T[$]=y(T[$],f(this,s),f(this,i),x);this.setText(T.join(`
27
+ `))},ma=function(){if(f(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:x}=(Ko(),Q(Xo));this.setText(x(this.firstChild.toString(),f(this,s),f(this,i)))},xa=function(){if(f(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:x}=(wu(),Q(ea));this.setText(x(this.firstChild.toString(),f(this,s),f(this,i)))},va=function(){if(f(this,s).excludes.includes("list"))return;const{parseList:x}=(ku(),Q(na)),{firstChild:y,type:T,name:$}=this,E=y.toString().split(`
28
+ `),F={lastPrefix:""};let P=T==="root"||T==="ext-inner"&&$==="poem"?0:1;for(;P<E.length;P++)E[P]=x(E[P],F,f(this,s),f(this,i));this.setText(E.join(`
29
+ `))},ba=function(){if(f(this,s).variants.length>0){const{parseConverter:x}=(Tu(),Q(la));this.setText(x(this.firstChild.toString(),f(this,s),f(this,i)))}},m)}}),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}=(q(),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 n=e.getChildNodes(),r;n.length===s?(r=n,n=i):r=n.splice(t,s,...i);for(let a=0;a<i.length;a++){const d=i[a];d.setAttribute("parentNode",e),d.setAttribute("nextSibling",n[t+a+1]),d.setAttribute("previousSibling",n[t+a-1])}return(l=n[t-1])==null||l.setAttribute("nextSibling",n[t]),(o=n[t+i.length])==null||o.setAttribute("previousSibling",n[t+i.length-1]),n===i&&e.setAttribute("childNodes",n),r}}}),it,Bi,ls,qi,Tl,Wi,Cl,tn,Cu=C({"lib/lintConfig.ts"(){"use strict";var e,t;Ol(),it=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,{}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Bi),ls={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(ls),qi=s=>it.has(s),Tl=s=>qi(s)||Array.isArray(s)&&qi(s[0])&&(s.length===1||typeof s[1]=="object"),Wi=(s,i,n)=>{if(fs.includes(i)){if(n===void 0)return!1;if(Tl(n))return s[i]=n,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(n)}`)},Cl=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(Bi))),!!s)for(const[i,n]of Object.entries(s))Wi(this,i,n)}getSeverity(s,i){var r,l;const n=this[s];return typeof n!="object"?it.get(n):i&&(l=it.get((r=n[1])==null?void 0:r[i]))!=null?l:it.get(n[0])}},tn=(t=class{constructor(s){N(this,e);if(Object.assign(this,ls),s&&!("rules"in s)&&Object.keys(s).some(n=>fs.includes(n)))this.rules=s;else{const i=s!=null?s:{},{rules:n}=i,r=Rn(i,["rules"]);this.rules=n;for(const[l,o]of Object.entries(r))o!==void 0&&Object.prototype.hasOwnProperty.call(ls,l)&&(this[l]=o)}}get rules(){return f(this,e)}set rules(s){L(this,e,new Proxy(new Cl(s),{set:Wi,deleteProperty(){return!1}}))}getSeverity(s,i){return f(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),wa={};se(wa,{Title:()=>ya});var ya,Iu=C({"lib/title.ts"(){"use strict";var e,t,s,i,n,r;Ye(),ge(),ya=(r=class{constructor(l,o,a,{temporary:d,decode:u,selfLink:h}={}){N(this,e);N(this,t);N(this,s);N(this,i);N(this,n);Ee(this,"valid");Ee(this,"encoded",!1);const g=l.trim().startsWith("../");if(u&&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(),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 w=pt(b[0]),k=Object.prototype.hasOwnProperty.call(a.nsid,w)&&a.nsid[w];k&&(p=k,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=Ht(p)}catch(b){}L(this,n,p.replace(/ /gu,"_")),l=l.slice(0,c).trim()}this.valid=!!(l||h&&this.ns===0&&f(this,n)!==void 0)&&ms(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,a.namespaces),L(this,s,a.articlePath||"/wiki/$1"),f(this,s).includes("$1")||L(this,s,f(this,s)+`${f(this,s).endsWith("/")?"":"/"}$1`),d||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return f(this,i)}get fragment(){return f(this,n)}get main(){return f(this,e)}set main(l){l=l.replace(/_/gu," ").trim(),L(this,e,l&&l[0].toUpperCase()+l.slice(1))}get prefix(){const l=f(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,n,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,n=new WeakMap,r)}}),Sa={};se(Sa,{default:()=>I});ka.exports=Q(Sa);var os,Mi,Il,Pe,zi,Nl,I,W=C({"index.ts"(){Ol(),Ne(),We(),ge(),Cu(),os=!0,Mi=new tn,Pe={config:Hi,get rules(){return fs},get i18n(){return me(me({},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&&ke.rev++,os=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:n,variable:r}=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")&&!r.includes("translationlanguage")&&(r.push("translationlanguage"),Array.isArray(n[1])?n[1].push("TRANSLATIONLANGUAGE"):n[1].TRANSLATIONLANGUAGE="translationlanguage"),Le(me(me({},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=Pe.getConfig(),n){const{Title:r}=(Iu(),Q(wa));let l;if(n!=null&&n.halfParsed)l=new r(e,t,i,n);else{const{Token:o}=(q(),Q(vs));l=ke.run(()=>{const a=new o(e,i);a.type="root",a.parseOnce(0,s).parseOnce();const d=new r(a.toString(),t,i,n);a.build();for(const u of["main","fragment"]){const h=d[u];if(h!=null&&h.includes("\0")){const g=a.buildFromStr(h,1);u==="main"?d.main=g:d.setFragment(g)}}return d})}return l},parse(e,t,s=we,i=Pe.getConfig()){e=Bl(e);let n;typeof s!="number"&&(n=Array.isArray(s)?s:[s],s=Math.max(...n.map(o=>Rl[o]||we)));const{Token:r}=(q(),Q(vs));return ke.run(()=>{const o=new r(e,i);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,i=Pe.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 Pe)Nl.has(e)||(zi[e]={enumerable:!1});Object.defineProperties(Pe,zi),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Pe}),I=Pe}});W()});Nu();})();