wikiparser-node 1.28.1 → 1.29.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.
- package/README.md +0 -2
- package/bundle/bundle-es8.min.js +26 -26
- package/bundle/bundle-lsp.min.js +30 -30
- package/bundle/bundle.min.js +24 -24
- package/data/ext/ThirdPartyNotices.txt +33 -0
- package/data/ext/mapframe.json +489 -2
- package/dist/addon/magicWords.js +132 -0
- package/dist/addon/table.js +4 -4
- package/dist/addon/token.js +37 -126
- package/dist/addon/transclude.js +24 -30
- package/dist/base.d.mts +4 -2
- package/dist/base.d.ts +4 -2
- package/dist/base.js +1 -0
- package/dist/base.mjs +2 -1
- package/dist/bin/config.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +27 -5
- package/dist/lib/document.d.ts +23 -7
- package/dist/lib/document.js +22 -38
- package/dist/lib/element.js +1 -1
- package/dist/lib/lintConfig.js +2 -0
- package/dist/lib/lsp.d.ts +1 -12
- package/dist/lib/lsp.js +120 -155
- package/dist/lib/node.js +25 -25
- package/dist/lib/range.js +2 -2
- package/dist/lib/text.js +7 -14
- package/dist/lib/title.d.ts +3 -1
- package/dist/lib/title.js +54 -33
- package/dist/mixin/elementLike.d.ts +1 -1
- package/dist/mixin/elementLike.js +14 -9
- package/dist/parser/commentAndExt.js +30 -26
- package/dist/parser/links.js +4 -3
- package/dist/parser/redirect.js +1 -1
- package/dist/parser/selector.js +7 -9
- package/dist/src/arg.js +4 -6
- package/dist/src/atom.d.ts +1 -1
- package/dist/src/atom.js +0 -2
- package/dist/src/attribute.js +40 -10
- package/dist/src/attributes.d.ts +1 -0
- package/dist/src/attributes.js +9 -2
- package/dist/src/converter.js +6 -3
- package/dist/src/converterFlags.js +2 -1
- package/dist/src/converterRule.d.ts +8 -8
- package/dist/src/converterRule.js +37 -14
- package/dist/src/extLink.js +3 -4
- package/dist/src/heading.js +1 -2
- package/dist/src/hidden.js +2 -1
- package/dist/src/imageParameter.d.ts +9 -1
- package/dist/src/imageParameter.js +312 -233
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.js +31 -37
- package/dist/src/link/base.js +7 -9
- package/dist/src/link/file.js +9 -10
- package/dist/src/link/galleryImage.js +1 -1
- package/dist/src/link/redirectTarget.js +1 -1
- package/dist/src/magicLink.js +1 -2
- package/dist/src/multiLine/gallery.js +2 -2
- package/dist/src/multiLine/imagemap.js +3 -4
- package/dist/src/multiLine/paramTag.js +2 -2
- package/dist/src/nowiki/doubleUnderscore.js +1 -3
- package/dist/src/nowiki/index.js +60 -4
- package/dist/src/onlyinclude.js +2 -1
- package/dist/src/parameter.js +4 -6
- package/dist/src/redirect.js +2 -2
- package/dist/src/table/base.js +1 -2
- package/dist/src/table/index.js +4 -7
- package/dist/src/table/td.d.ts +2 -3
- package/dist/src/table/td.js +6 -6
- package/dist/src/table/trBase.js +1 -1
- package/dist/src/tag/html.js +4 -5
- package/dist/src/tag/tvar.js +3 -3
- package/dist/src/tagPair/ext.js +2 -2
- package/dist/src/tagPair/include.js +2 -2
- package/dist/src/tagPair/translate.js +2 -2
- package/dist/src/transclude.js +5 -5
- package/dist/util/constants.js +4 -1
- package/dist/util/debug.js +1 -1
- package/dist/util/html.js +15 -14
- package/dist/util/search.js +16 -0
- package/dist/util/sharable.js +27 -3
- package/dist/util/sharable.mjs +28 -4
- package/extensions/dist/base.js +1 -1
- package/i18n/en.json +2 -0
- package/i18n/zh-hans.json +2 -0
- package/i18n/zh-hant.json +2 -0
- package/package.json +7 -5
- package/data/ext/maplink.json +0 -4
package/bundle/bundle-lsp.min.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";(()=>{var fu=Object.defineProperty;var ar=e=>{throw TypeError(e)};var mu=(e,t,s)=>t in e?fu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var xu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,s)=>mu(e,typeof t!="symbol"?t+"":t,s),Ks=(e,t,s)=>t.has(e)||ar("Cannot "+s);var w=(e,t,s)=>(Ks(e,t,"read from private field"),s?s.call(e):t.get(e)),P=(e,t,s)=>t.has(e)?ar("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),F=(e,t,s,i)=>(Ks(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),R=(e,t,s)=>(Ks(e,t,"access private method"),s);var ur=(e,t,s,i)=>({set _(r){F(e,t,r,s)},get _(){return w(e,t,i)}});var bd=xu((yd,pu)=>{var vu=Object.create,jt=Object.defineProperty,fo=Object.getOwnPropertyDescriptor,Ln=Object.getOwnPropertyNames,bu=Object.prototype.hasOwnProperty,mo=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Rt=e=>{throw TypeError(e)},xo=(e,t,s)=>t in e?jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,dr=(e,t)=>jt(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[Ln(e)[0]])(e=0)),t},vo=(e,t)=>function(){return t||(0,e[Ln(e)[0]])((t={exports:{}}).exports,t),t.exports},oe=(e,t)=>{for(var s in t)jt(e,s,{get:t[s],enumerable:!0})},wu=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ln(t))!bu.call(e,r)&&r!==s&&jt(e,r,{get:()=>t[r],enumerable:!(i=fo(t,r))||i.enumerable});return e},se=e=>wu(jt({},"__esModule",{value:!0}),e),ae=e=>{var t;return[,,,vu((t=e==null?void 0:e[mo("metadata")])!=null?t:null)]},bo=["class","method","getter","setter","accessor","field","value","get","set"],Vt=e=>e!==void 0&&typeof e!="function"?Rt("Function expected"):e,yu=(e,t,s,i,r)=>({kind:bo[e],name:t,metadata:i,addInitializer:n=>s._?Rt("Already initialized"):r.push(Vt(n||null))}),Fn=(e,t)=>xo(t,mo("metadata"),e[3]),re=(e,t,s,i)=>{for(var r=0,n=e[t>>1],l=n&&n.length;r<l;r++)t&1?n[r].call(s):i=n[r].call(s,i);return i},le=(e,t,s,i,r,n)=>{var l,o,d,a,u,c=t&7,p=!!(t&8),m=!!(t&16),b=c>3?e.length+1:c?p?1:2:0,_=bo[c+5],A=c>3&&(e[b-1]=[]),k=e[b]||(e[b]=[]),T=c&&(!m&&!p&&(r=r.prototype),c<5&&(c>3||!m)&&fo(c<4?r:{get[s](){return pe(this,n)},set[s](g){return ke(this,n,g)}},s));c?m&&c<4&&dr(n,(c>2?"set ":c>1?"get ":"")+s):dr(r,s);for(var f=i.length-1;f>=0;f--)a=yu(c,s,d={},e[3],k),c&&(a.static=p,a.private=m,u=a.access={has:m?g=>Au(r,g):g=>s in g},c^3&&(u.get=m?g=>(c^1?pe:cn)(g,r,c^4?n:T.get):g=>g[s]),c>2&&(u.set=m?(g,x)=>ke(g,r,x,c^4?n:T.set):(g,x)=>g[s]=x)),o=(0,i[f])(c?c<4?m?n:T[_]:c>4?void 0:{get:T.get,set:T.set}:r,a),d._=1,c^4||o===void 0?Vt(o)&&(c>4?A.unshift(o):c?m?n=o:T[_]=o:r=o):typeof o!="object"||o===null?Rt("Object expected"):(Vt(l=o.get)&&(T.get=l),Vt(l=o.set)&&(T.set=l),Vt(l=o.init)&&A.unshift(l));return c||Fn(e,r),T&&jt(r,s,T),m?c^4?n:T:r},Su=(e,t,s)=>xo(e,typeof t!="symbol"?t+"":t,s),En=(e,t,s)=>t.has(e)||Rt("Cannot "+s),Au=(e,t)=>Object(t)!==t?Rt('Cannot use the "in" operator on this value'):e.has(t),pe=(e,t,s)=>(En(e,t,"read from private field"),s?s.call(e):t.get(e)),De=(e,t,s)=>t.has(e)?Rt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ke=(e,t,s,i)=>(En(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),cn=(e,t,s)=>(En(e,t,"access private method"),s),ku=(e,t,s,i)=>({set _(r){ke(e,t,r,s)},get _(){return pe(e,t,i)}}),wo,as,jn=C({"base.ts"(){"use strict";wo=(()=>{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})(),as=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-url","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Fe(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,r)=>Fe(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(i,r)=>t[r])}var Qe,Ys,It,Nt,Lt,mt,us,_e,dt,cr,hr,ds,yo,gr,pr,cs,Ft,fe=C({"util/string.ts"(){"use strict";Qe=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ys=String.raw`[^[\]<>"\0-\x1F\x7F${Qe}\uFFFD]`,It=String.raw`(?:\[[\da-f:.]+\]|${Ys})`,Nt=String.raw`(?:${Ys}|\0\d+[cn!~]\x7F)*`,Lt=e=>e.trim().toLowerCase(),mt=(e,t)=>s=>s.replace(e,t),us=mt(/[\0\x7F]|\r$/gmu,""),_e=mt(/\0\d+[cn]\x7F/gu,""),dt=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),cr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},hr=mt(/&(?:#(\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)):cr[s.toLowerCase()]),ds=e=>hr(e),yo=mt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),gr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},pr=e=>mt(e,t=>`&${gr[t]};`),cs=pr(/[&<>]/gu),Ft=(e,t={})=>{const{pre:s="",post:i="",sep:r=""}=t;return s+e.map(n=>n.print()).join(r)+i}}}),$u=vo({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invalid-url":"invalid URL","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',"ref-in-link":"<ref> in an internal or external link",remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),_u=vo({"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:[]}}}),Ae,So,hn,Xe=C({"util/constants.ts"(){"use strict";Ae=11,So=$u(),hn=_u()}});function at(e){const t=new Map,s=new WeakMap;return i=>{const r=typeof i=="string"?t:s;if(r.has(i)){const l=r.get(i);return l.lastIndex=0,l}const n=e(i);return r.set(i,n),n}}var hs,Ao,fr,ko,$o,Ke=C({"../common/dist/index.mjs"(){"use strict";hs=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ao=e=>Math.round(e*255).toString(16).padStart(2,"0"),fr=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,s=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,i=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${s}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${s}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i})`,"giu")}})(),ko=(e,t=!0)=>{const s=[],i=fr[t?"full":"rgb"];i.lastIndex=0;let r=i.exec(e),n=0;for(;r;){const l=r.index+r[1].length;l>n&&s.push([e.slice(n,l),n,l,!1]),{lastIndex:n}=i,s.push([r[2],l,n,e[l-1]!=="&"||!/^#\d+$/u.test(r[2])]),r=i.exec(e)}return e.length>n&&s.push([e.slice(n),n,e.length,!1]),s},$o=at}}),ce,me=C({"lib/rect.ts"(){"use strict";var e,t,s,i,gn,n;ce=(n=class{constructor(l,o){P(this,i);P(this,e);P(this,t);P(this,s);F(this,e,l),F(this,t,o)}get start(){return w(this,t)}get top(){return R(this,i,gn).call(this).top}get left(){return R(this,i,gn).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,gn=function(){var l;return(l=w(this,s))!=null||F(this,s,w(this,e).getRootNode().posFromIndex(w(this,t))),w(this,s)},n)}}),mr,xr,ls,gs,Zs,J,Y,Pe,Ws,Z,Rn,Je,Pn,On,Bn,ps,Et,qn,ut,Wn,K=C({"util/lint.ts"(){"use strict";Ke(),je(),me(),G(),mr=new Set(["tr","td","th","caption"]),xr=new Set(["Template:!!","Template:!-"]),ls=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")&&xr.has(t.name)||t.is("html")&&mr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&ls(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(ls);return s.includes(2)?2:s.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},gs=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Zs=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:o,left:d}=s instanceof ce?s:new ce(t,l),{offsetHeight:a,offsetWidth:u}=t,{startIndex:c,startLine:p,startCol:m}=e(t,l,o,d),{line:b,character:_}=gs(p,m,a,u);return{rule:i,message:N.msg(r),severity:n,startIndex:c,endIndex:c+t.toString().length,startLine:p,endLine:b,startCol:m,endCol:_}},J=Zs((e,t,s,i)=>{const r=e.getRelativeIndex(),{top:n,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+n,startCol:n?l:i+l}}),Y=Zs((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),Pe=(e,t,s,i=0)=>({desc:N.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),Ws=(e,t,s)=>({desc:N.msg(t),range:[e,e],text:s}),Z=(e,t=0,s="")=>typeof e=="number"?{desc:N.msg("remove"),range:[e,e+t],text:s}:Pe(e,"remove",s,t),Rn=(e,t)=>Pe(e,"decode",hs(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Je=(e,t,s=0)=>({desc:N.msg("close"),range:[e+s,e],text:t}),Pn=e=>({desc:N.msg("open"),range:[e+1,e+2],text:""}),On=(e,t)=>Pe(e,"comment",`<!--${t}-->`),Bn=(e,t)=>Pe(e,"uppercase",t.toUpperCase()),ps=(e,t=0)=>({desc:N.msg("whitespace"),range:[e,e+t],text:" "}),Et=(e,t,s=1)=>({desc:N.msg("escape"),range:[e,e+s],text:t.repeat(s)}),qn=(e,t)=>({desc:N.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),ut=(e,t,s,i)=>{if(e&&(i||N.viewOnly&&e[0]===xe.rev))return e[1];const r=t();return(i||N.viewOnly)&&s([xe.rev,r]),r},Wn=(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"]:[]}}),vr,Un,_o=C({"parser/selector.ts"(){"use strict";vr=(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},Un=(e,t,s)=>{const i=e.split(",");return(({type:r,name:n})=>i.some(l=>vr(l.trim(),r,n)))}}}),Us,Mn=C({"mixin/cached.ts"(){"use strict";K(),Us=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return ut(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),To,Tu=C({"mixin/nodeLike.ts"(){"use strict";To=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}}}),br,wr,bs,Bt,qt,ws,Wt,Ut,Mt,rt,Co=C({"lib/node.ts"(){"use strict";K(),je(),Mn(),Tu(),G(),wr=[To],br=[Us(!1)],rt=class{constructor(){re(Mt,5,this),Su(this,"childNodes",[]),De(this,bs),De(this,Bt),De(this,qt),De(this,ws),De(this,Wt),De(this,Ut,{})}get parentNode(){return pe(this,bs)}get nextSibling(){return pe(this,Bt)}get previousSibling(){return pe(this,qt)}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":ke(this,bs,t),t||(ke(this,Bt,void 0),ke(this,qt,void 0));break;case"nextSibling":ke(this,Bt,t);break;case"previousSibling":ke(this,qt,t);break;case"aIndex":N.viewOnly&&ke(this,Wt,[xe.rev,t]);break;default:this[e]=t}}getRootNode(){return ut(pe(this,ws),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&ke(this,ws,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,i,r]=s[e],n=i+t;return n>r?void 0:n}this.lspError("AstNode.indexFromPos")}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=s.findIndex(([,,r])=>e<=r);return{top:i,left:e-s[i][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return ut(pe(this,Ut)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)N.viewOnly&&(pe(this,Ut)[r]=[xe.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{pe(this,Ut)[e]=t})}getAbsoluteIndex(){return ut(pe(this,Wt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ke(this,Wt,e)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}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!`)}},Mt=ae(null),bs=new WeakMap,Bt=new WeakMap,qt=new WeakMap,ws=new WeakMap,Wt=new WeakMap,Ut=new WeakMap,le(Mt,1,"getLines",br,rt),rt=le(Mt,0,"AstNode",wr,rt),re(Mt,1,rt)}}),Io,Cu=C({"mixin/elementLike.ts"(){"use strict";_o(),Io=e=>{var t,pn;{class i extends e{constructor(){super(...arguments);P(this,t)}getElementBy(l){for(const o of this.childNodes){if(o.type==="text")continue;if(l(o))return o;const d=o.getElementBy(l);if(d)return d}}querySelector(l){return this.getElementBy(R(this,t,pn).call(this,l))}getElementsBy(l,o=[]){for(const d of this.childNodes)d.type!=="text"&&(l(d)&&o.push(d),d.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(R(this,t,pn).call(this,l))}escape(){for(const l of this.childNodes)l.escape()}}return t=new WeakSet,pn=function(l){return Un(l,this)},i}}}}),yr,ei,Sr,Qt,Iu=C({"lib/element.ts"(){"use strict";fe(),je(),_o(),Co(),Cu(),yr=[Io],Qt=class extends(Sr=rt){get length(){return this.childNodes.length}text(e){return dt(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,r;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(r=e[s])==null||r.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:r}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||r===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){return ms(this,e,1)[0]}insertAt(e,t=this.length){return ms(this,t,0,[e]),e}closest(e){const t=Un(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){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(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){{if(e===void 0)return;const{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let s=this,i=0,r=0;for(;s.type!=="text";){const{childNodes:n}=s;i+=s.getAttribute("padding");for(let l=0;i<=e&&l<n.length;l++){const o=n[l],{nextSibling:d}=o,a=o.toString(),u=a.length;if(o.setAttribute("aIndex",i),i+=u,i>e||i===e&&u>0&&(!d||d.type==="text"||o.type!=="text"&&(a.trim()||!d.toString().trim()))){s=o,i-=u,r=i;break}i+=s.getGaps(l)}if(s.childNodes===n)return{offsetNode:s,offset:e-r}}return{offsetNode:s,offset:e-r}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const s=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(s==null?void 0:s.type)==="text"?s.parentNode:s}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,r=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",r);const l=n.lint(r,t);l.length>0&&s.push(...l),r+=n.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+Ft(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){{const s={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,r=t+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i],{length:l}=n.toString();n.setAttribute("aIndex",r),s.childNodes.push(n.type==="text"?{data:n.data,range:[r,r+l]}:n.json(void 0,r)),r+=l+this.getGaps(i)}return s}}},ei=ae(Sr),Qt=le(ei,0,"AstElement",yr,Qt),re(ei,1,Qt)}}),xs,Ms=C({"mixin/gapped.ts"(){"use strict";xs=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),Be,We=C({"mixin/noEscape.ts"(){"use strict";Be=e=>{{class t extends e{escape(){}}return t}}}}),Ar,No,Nu=C({"src/parameter.ts"(){"use strict";fe(),K(),G(),X(),Ar=new RegExp(`https?://${It}${Nt}$`,"iu"),No=class extends H{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch{return!1}}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new H(typeof e=="number"?void 0:e,s,i,{}),n=new H(t,s,i);r.type="parameter-key",r.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(r,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r="unescaped",{lintConfig:n}=N,l=n.getSeverity(r);if(l){const{firstChild:o}=this,d=(s=Ar.exec(o.text()))==null?void 0:s[0];try{if(d&&new URL(d).search){const a=J(o,{start:e},r,"unescaped-query",l);a.startIndex=a.endIndex,a.startLine=a.endLine,a.startCol=a.endCol,a.endIndex++,a.endCol++,(n.computeEditInfo||n.fix)&&(a.fix=Et(a.startIndex,"{{=}}")),i.push(a)}}catch{}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}}),$e,ct=C({"src/atom.ts"(){"use strict";var e,t;X(),$e=(t=class extends H{constructor(i,r,n,l,o){super(i,n,l,o);P(this,e);F(this,e,r)}get type(){return w(this,e)}set type(i){F(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),qe,ht=C({"src/syntax.ts"(){"use strict";var e,t;X(),qe=(t=class extends H{constructor(i,r,n,l,o){super(i,n,l,o);P(this,e);F(this,e,r)}get type(){return w(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Lo={};oe(Lo,{TranscludeToken:()=>lt});var kr,ti,$r,lt,Fo=C({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,Jt,Eo,d;fe(),K(),je(),me(),Ms(),We(),G(),X(),Nu(),ct(),ht(),kr=[Be,xs()],lt=(d=class extends($r=H){constructor(u,c,p,m=[]){var $,L;let b;const _=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(u);_&&(b=Number(_[1]),u=u.replace(`\0${b}h`,m[b].toString().replace(/^\n/u,"")));super(void 0,p,m,{});P(this,n);Ne(this,"modifier","");P(this,e,"template");P(this,t,":");P(this,s,!1);P(this,i,new Map);P(this,r);const{parserFunction:[A,k],variable:T,functionHook:f}=p,g=($=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(u))==null?void 0:$[0];if(g)this.setAttribute("modifier",g),u=u.slice(g.length);else if(u.includes(":")){const[I,...j]=u.split(":"),[B]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((L=j[0])!=null?L:"");this.setModifier(`${I}:${B}`)&&(u=j.join(":").slice(B.length))}const x=u.search(/[::]/u),v=u[x]===":",h=x!==-1;if(h||c.length===0&&!w(this,s)){const I=h?u.slice(0,x):u,j=h&&u.slice(x+1),B=_e(I),O=h?B.slice(B.search(/\S/u))+(v?":":""):B.trim(),E=O.toLowerCase(),D=Array.isArray(k),W=D?k.includes(O):Object.prototype.hasOwnProperty.call(k,O),q=!D&&W?k[O]:Object.prototype.hasOwnProperty.call(A,E)&&A[E],z=D&&W||!("functionHook"in p)||f.includes(q),U=D&&W||T.includes(q);if(h?q&&z:U){this.setAttribute("name",q||E.replace(/^#|:$/u,"")),F(this,e,"magic-word"),v&&F(this,t,":");const V=new qe(I,"magic-word-name",p,m);if(super.insertAt(V),j!==!1&&c.unshift([j]),this.name==="invoke")for(let Q=0;Q<2;Q++){const ie=c.shift();if(!ie)break;const ue=new $e(ie.join("="),`invoke-${Q?"function":"module"}`,p,m);super.insertAt(ue)}}}if(this.type==="template"){const I=_e(u).trim();if(!this.normalizeTitle(I,10,{halfParsed:!0,temporary:!0}).valid)throw m.pop(),new SyntaxError("Invalid template name");const j=new $e(u,"template-name",p,m,{});super.insertAt(j)}typeof b=="number"&&(m[b]=void 0);const S=this.isTemplate();let y=1;for(let I=0;I<c.length;I++){const j=c[I];S||this.name==="switch"&&I>0||this.name==="tag"&&I>1||(j[0]=j.join("="),j.length=1),j.length===1&&(j.unshift(y),y++),this.insertAt(new No(...j,p,m))}this.seal("modifier")}get type(){return w(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?R(this,n,Jt).call(this).title:void 0}get function(){var u;return this.type==="magic-word"&&this.name==="invoke"?(u=this.childNodes[2])==null?void 0:u.text().trim():void 0}setModifier(u){const{parserFunction:[,,c,p]}=this.getAttribute("config"),m=_e(u).trim();if(u&&!m.endsWith(":"))return!1;const b=m.slice(0,-1).toLowerCase(),_=c.includes(b),A=p.includes(b);return w(this,s)&&_||!w(this,s)&&(A||!u)||(xe.running||this.length>1)&&(_||A||!u)?(this.setAttribute("modifier",u),F(this,s,_),!!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"&&(F(this,r,R(this,n,Jt).call(this)),this.setAttribute("name",w(this,r).title))}toString(u){const{childNodes:c,length:p,firstChild:m,modifier:b,type:_}=this;return`{{${b}${_==="magic-word"?m.toString(u)+(p===1?"":w(this,t))+c.slice(1).map(A=>A.toString(u)).join("|"):super.toString(u,"|")}}}`}text(){const{childNodes:u,length:c,firstChild:p,modifier:m,type:b,name:_}=this;return b==="magic-word"&&_==="vardefine"?"":`{{${m}${b==="magic-word"?p.text()+(c===1?"":w(this,t))+dt(u.slice(1),"|"):super.text("|")}}}`}getAttribute(u){switch(u){case"padding":return this.modifier.length+2;case"title":return w(this,r);case"colon":return w(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!R(this,n,Jt).call(this).valid);default:return super.getAttribute(u)}}lint(u=this.getAbsoluteIndex(),c){{const p=super.lint(u,c);if(!this.isTemplate())return p;const{type:m,childNodes:b,length:_}=this,A=new ce(this,u),{lintConfig:k}=N,{computeEditInfo:T}=k,f=m==="magic-word";let g="no-ignored",x=k.getSeverity(g,"fragment");if(f&&!R(this,n,Jt).call(this).valid)g="invalid-invoke",x=k.getSeverity(g,"name"),x&&p.push(J(b[1],A,g,"illegal-module",x));else if(x){const v=b[f?1:0],h=v.childNodes.findIndex(y=>y.type==="text"&&ds(y.data).includes("#")),S=v.childNodes[h];if(S){const y=J(v,A,g,"useless-fragment",x);T&&(y.suggestions=[Z(y,v.getRelativeIndex(h)+S.data.indexOf("#"))]),p.push(y)}}if(g="invalid-invoke",x=k.getSeverity(g,"function"),x&&f&&_===2)return p.push(Y(this,A,g,"missing-function",x)),p;if(g="no-duplicate",x=k.getSeverity(g,"parameter"),x){const v=this.getDuplicatedArgs().filter(([,S])=>!S[0].querySelector("ext")),h="duplicate-parameter";for(const[,S]of v)p.push(...S.map(y=>{const $=J(y,A,g,h,x);return T&&($.suggestions=[Z($,-1)]),$}))}return p}}insertAt(u,c=this.length){return super.insertAt(u,c),u.anon?R(this,n,Eo).call(this,u):u.name&&this.getArgs(u.name,!1,!1).add(u),u}getAllArgs(){return this.childNodes.filter(Js("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:u})=>u)}getArgs(u,c,p=!0){const m=String(u).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let b;return w(this,i).has(m)?b=w(this,i).get(m):(b=new Set(this.getAllArgs().filter(({name:_})=>m===_)),w(this,i).set(m,b)),b}getDuplicatedArgs(){return[...w(this,i)].filter(([,{size:u}])=>u>1).map(([u,c])=>[u,[...c]])}getPossibleValues(){const{type:u,name:c,childNodes:p}=this;if(u==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let m,b;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":m=2;break;case"ifeq":m=3;break;case"switch":{const _=p.slice(2),A=_[_.length-1];b=[..._.filter(({anon:k})=>!k),...A!=null&&A.anon?[A]:[]].map(({lastChild:k})=>k);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}b!=null||(b=p.slice(m,m+2).map(({lastChild:_})=>_));for(let _=0;_<b.length;){const{length:A,0:k}=b[_].childNodes.filter(T=>T.text().trim());if(A===0)b.splice(_,1);else if(A>1||k.type!=="magic-word")_++;else try{const T=k.getPossibleValues();b.splice(_,1,...T),_+=T.length}catch{_++}}return b}print(){const{childNodes:u,length:c,firstChild:p,modifier:m,type:b}=this;return`<span class="wpb-${b}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${b==="magic-word"?cs(m)+p.print()+(c===1?"":w(this,t))+Ft(u.slice(1),{sep:"|"}):(m?`<span class="wpb-magic-word">${cs(m)}</span>`:"")+Ft(u,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,Jt=function(){const u=this.type==="template";return this.normalizeTitle(this.childNodes[u?0:1].text(),u?10:828,{temporary:!0})},Eo=function(u){const c=this.getAnonArgs(),p=typeof u!="number";for(let m=p?c.indexOf(u):u-1;m<c.length;m++){const b=c[m],{name:_}=b,A=String(m+1);(_!==A||b===u)&&(b.setAttribute("name",A),this.getArgs(A,!1,!1).add(b))}},d),ti=ae($r),lt=le(ti,0,"TranscludeToken",kr,lt),re(ti,1,lt)}}),ys,si,ii,_r,Tr,Cr,Ir,ni,Nr,fn,Lu=C({"lib/text.ts"(){"use strict";var e,mn,s;fe(),K(),je(),G(),Co(),ys=String.raw`[${Qe}\t]*`,si=String.raw`[^\S\n]*`,ii=String.raw`<${si}(?:/${si})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${ys}\d)|isbn(?=[-::]?${ys}(?:\d(?:${ys}|-)){6})`,_r=new RegExp(String.raw`${ii}|https?[:/]/+`,"giu"),Tr=new RegExp(ii,"giu"),Cr=new Set(["attr-value","ext-link-text","link-text"]),Ir={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ni=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"]),Nr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),fn=(s=class extends rt{constructor(n){super();P(this,e);Ne(this,"data","");this.data=n}get type(){return"text"}toString(n){var l;return n&&!((l=this.parentNode)!=null&&l.getAttribute("built"))?_e(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),l){var o,d,a;{if(l===!1)return[];const{data:u,parentNode:c,nextSibling:p,previousSibling:m}=this;if(!c)throw new Error("An isolated text node cannot be linted!");const{type:b,name:_,parentNode:A}=c;if(b==="attr-value"){const{name:E,tag:D}=A;if(D==="ref"&&(E==="name"||E==="follow")||E==="group"&&(D==="ref"||D==="references")||D==="choose"&&(E==="before"||E==="after"))return[]}if(l!=null||(l=b==="free-ext-link"||b==="ext-link-url"||b==="ext-link-text"||b==="image-parameter"&&_==="link"||b==="attr-value"?Tr:_r),u.search(l)===-1)return[];l.lastIndex=0;const k=[],T=p==null?void 0:p.type,f=p==null?void 0:p.name,g=m==null?void 0:m.type,x=this.getRootNode(),v=x.toString(),{ext:h,html:S,variants:y}=x.getAttribute("config"),{top:$,left:L}=x.posFromIndex(n),{lintConfig:I}=N,j=I.rules["tag-like"],B=typeof j=="object"&&j[1]?new Set(Object.keys(j[1]).filter(E=>E!=="invalid"&&E!=="disallowed")):new Set,O=new Set(["onlyinclude","noinclude","includeonly",...h,...S[0],...S[1],...S[2],...B,...I.getSeverity("tag-like","disallowed")?ni:[]]);for(let E=l.exec(u);E;E=l.exec(u)){const[,D,W]=E;let{index:q,0:z}=E;if(W&&W!=="]"){const{length:we}=W;q+=we,z=z.slice(we)}z=z.toLowerCase();const[U]=z,V=U==="r"||U==="p"||U==="i",Q=U==="{",ie=U==="}",ue=U==="[",he=U==="]";let{length:ne}=z;if(U==="<"&&!O.has(D.toLowerCase())||ue&&b==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(u.slice(q+1))||p!=null&&p.is("ext")&&f==="nowiki"&&((o=p.innerText)!=null&&o.includes("]")))||V&&(!c.isPlain()||Cr.has(b)))continue;he&&(q||ne>1)&&l.lastIndex--;let Ce=n+q,Ie=Ce+ne,M,ee;const ge=v[Ie],ve=v[Ce-1],Te=Q||ue,Me=Q&&ve==="-"&&y.length>0,ye=ie&&ge==="-"&&y.length>0,ft=ue&&T==="free-ext-link"&&!u.slice(q+1).trim()||he&&g==="free-ext-link"&&!u.slice(0,q).includes("]");if(V)M="lonely-http",z=z.toUpperCase(),ee=I.getSeverity(M,z);else if(U==="<"){M="tag-like";let we;/^<\/?\s/u.test(z)||!/[\s/>]/u.test(ge!=null?ge:"")?we="invalid":B.has(D)?we=D:ni.has(D)&&!h.includes(D)&&(we="disallowed"),ee=I.getSeverity(M,we)}else if(Me||ye)M="lonely-bracket",ee=I.getSeverity(M,"converter"),Me&&q>0?(z="-{",q--,Ce--,ne=2):ye&&q<u.length-1&&(z="}-",Ie++,ne=2);else if(ft)M="lonely-bracket",ee=I.getSeverity(M,"extLink");else if(Te||ie||he)if(M="lonely-bracket",ne>1||Q&&ge===U||ie&&ve===U)ee=I.getSeverity(M,"double");else{if(!ue||b!=="ext-link-text"){const we=Ir[U],Xs=Te?u.slice(q+1):u.slice(0,q);if(Q&&((d=we.exec(Xs))==null?void 0:d[0])==="}"||ie&&((a=we.exec(Xs))==null?void 0:a[0])==="{")continue;if(!Xs.includes(U)){const or=Te?"nextSibling":"previousSibling";let st=this[or];for(;st&&(st.type!=="text"||!we.test(st.data));)st=st[or];if(st&&we.exec(st.data)[0]!==U)continue}}ee=I.getSeverity(M,"single")}else M="lonely-http",ee=I.getSeverity(M);if(!ee)continue;const te=this.posFromIndex(q),{line:et,character:Ot}=gs($,L,te.top+1,te.left),tt={rule:M,message:N.msg("lonely",V||U==="h"||Me||ye?z:U),severity:ee,startIndex:Ce,endIndex:Ie,startLine:et,endLine:et,startCol:Ot,endCol:Ot+ne};if(I.computeEditInfo)if(U==="<")tt.suggestions=[Et(Ce,"<")];else if(U==="h"&&b!=="link-text"&&Nr.test(ve||""))tt.suggestions=[ps(Ce)];else if(ue&&b==="ext-link-text"){const we=c.getAbsoluteIndex()+c.toString().length;tt.suggestions=[Et(we,"]")]}else if(he&&ft){const we=n-m.toString().length;tt.suggestions=[Ws(we,"left-bracket","[")]}else V&&(tt.suggestions=[...E[0]===z?[]:[Bn(tt,z)],...ge===":"||ge===":"?[ps(Ie,1)]:[]]);k.push(tt)}return k}}replaceData(n){R(this,e,mn).call(this,n)}splitText(n){{const{parentNode:l,data:o}=this;if(!l)throw new Error("The text node to be split has no parent node!");const d=new s(o.slice(n));return ms(l,l.childNodes.indexOf(this)+1,0,[d]),this.setAttribute("data",o.slice(0,n)),d}this.lspError("AstText.splitText")}escape(){{const{parentNode:n}=this;if(!n)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:l}=(Fo(),se(Lo)),o=n.getAttribute("config"),d=n.childNodes.indexOf(this)+1,a=p=>Math.max(this.data.lastIndexOf("=",p),this.data.lastIndexOf("|",p));let u=a();const c=(()=>new l(this.data[u]==="="?"=":"!",[],o));for(;u>=0;u=a(u-1))u<this.data.length-1&&this.splitText(u+1),n.insertAt(xe.run(c),d),R(this,e,mn).call(this,this.data.slice(0,u))}}print(){return cs(this.data)}},e=new WeakSet,mn=function(n){this.setAttribute("data",n)},s)}}),Ye,gt=C({"mixin/hidden.ts"(){"use strict";Ye=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),Ue,Ze=C({"mixin/padded.ts"(){"use strict";Ue=({length:e})=>t=>{{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}}),Lr,Fr,ri,Er,Ge,zs=C({"src/link/base.ts"(){"use strict";var e,t,s,i;K(),Xe(),me(),Ze(),We(),G(),X(),ct(),Lr=r=>r==="redirect-target"||r==="link",Fr=[Be,Ue("[[")],Ge=(i=class extends(Er=H){constructor(n,l,o,d=[],a="|"){super(void 0,o,d,{});P(this,e,!0);P(this,t);P(this,s);if(this.insertAt(new $e(n,"link-target",o,d,{})),l!==void 0){const u=new H(l,o,d,{});u.type="link-text",u.setAttribute("stage",Ae-1),this.insertAt(u)}F(this,t,a)}get link(){return w(this,s)}get fragment(){return w(this,s).fragment}afterBuild(){F(this,s,this.getTitle()),w(this,t).includes("\0")&&F(this,t,this.buildFromStr(w(this,t),0)),this.setAttribute("name",w(this,s).title),super.afterBuild()}setAttribute(n,l){n==="bracket"?F(this,e,l):n==="title"?F(this,s,l):super.setAttribute(n,l)}toString(n){const l=super.toString(n,w(this,t));return w(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return w(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?w(this,s):super.getAttribute(n)}getGaps(n){return n===0?w(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{childNodes:[d,a],type:u}=this,{encoded:c,fragment:p}=w(this,s),{lintConfig:m}=N,{computeEditInfo:b,fix:_}=m,A=new ce(this,n);let k="unknown-page",T=m.getSeverity(k);if(T&&d.childNodes.some(({type:f})=>f==="template")&&o.push(J(d,A,k,"template-in-link",T)),k="url-encoding",T=m.getSeverity(k),T&&c){const f=J(d,A,k,"unnecessary-encoding",T);(b||_)&&(f.fix=Rn(f,d)),o.push(f)}if(k="pipe-like",T=m.getSeverity(k,"link"),T&&(u==="link"||u==="category")){const f=a==null?void 0:a.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("|")),g=a==null?void 0:a.childNodes[f];if(g){const x=J(a,A,k,"pipe-in-link",T);if(b){const v=x.startIndex+a.getRelativeIndex(f);x.suggestions=[qn(v,g.data)]}o.push(x)}}if(k="no-ignored",T=m.getSeverity(k,"fragment"),T&&p!==void 0&&!Lr(u)){const f=J(d,A,k,"useless-fragment",T);if(b||_){const g=d.childNodes.findIndex(v=>v.type==="text"&&v.data.includes("#")),x=d.childNodes[g];x&&(f.fix=Z(f,d.getRelativeIndex(g)+x.data.indexOf("#")))}o.push(f)}return o}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(w(this,e)?{pre:"[[",post:"]]",sep:w(this,t)}:{sep:w(this,t)})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l),{type:d,fragment:a}=this;return a!==void 0&&(d==="link"||d==="redirect-target")&&(o.fragment=a),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),ri=ae(Er),Ge=le(ri,0,"LinkBaseToken",Fr,Ge),re(ri,1,Ge)}}),jr,li,Rr,Oe,pt=C({"src/nowiki/base.ts"(){"use strict";We(),X(),jr=[Be],Oe=class extends(Rr=H){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},li=ae(Rr),Oe=le(li,0,"NowikiBaseToken",jr,Oe),re(li,1,Oe)}}),Pr,oi,Or,Ee,Pt=C({"src/nowiki/noinclude.ts"(){"use strict";gt(),pt(),Pr=[Ye()],Ee=class extends(Or=Oe){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},oi=ae(Or),Ee=le(oi,0,"NoincludeToken",Pr,Ee),re(oi,1,Ee)}}),jo,Fu=C({"src/link/redirectTarget.ts"(){"use strict";K(),G(),zs(),Pt(),jo=class extends Ge{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new Ee(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}=N,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=J(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=Z(n)),t.push(n)}return t}}}}}),Br,ai,qr,Xt,Eu=C({"src/redirect.ts"(){"use strict";var e,t,s;gt(),We(),X(),ht(),Fu(),Br=[Ye(!1,!1),Be],Xt=(s=class extends(qr=H){constructor(r,n,l,o,d,a,u=[]){super(void 0,a,u);P(this,e);P(this,t);F(this,e,r),F(this,t,d),this.append(new qe(n,"redirect-syntax",a,u),new jo(l,o==null?void 0:o.slice(1),a,u))}get type(){return"redirect"}getAttribute(r){return r==="padding"?w(this,e).length:super.getAttribute(r)}toString(r){return w(this,e)+super.toString(r)+w(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+w(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:w(this,e),post:w(this,t)})}},e=new WeakMap,t=new WeakMap,s),ai=ae(qr),Xt=le(ai,0,"RedirectToken",Br,Xt),re(ai,1,Xt)}}),Ro={};oe(Ro,{parseRedirect:()=>Po});var Po,ju=C({"parser/redirect.ts"(){"use strict";G(),Eu(),Po=(e,t,s)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&N.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Xt(...i.slice(1),t,s),e):!1}}}),Wr,ui,Ur,Kt,Ru=C({"src/onlyinclude.ts"(){"use strict";Ze(),We(),X(),Wr=[Be,Ue("<onlyinclude>")],Kt=class extends(Ur=H){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}},ui=ae(Ur),Kt=le(ui,0,"OnlyincludeToken",Wr,Kt),re(ui,1,Kt)}}),Mr,di,zr,ot,zn=C({"src/tagPair/index.ts"(){"use strict";var e,t;Ms(),We(),X(),Mr=[xs(),Be],ot=(t=class extends(zr=H){constructor(i,r,n,l,o,d=[]){super(void 0,o);P(this,e);Ne(this,"closed");Ne(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),F(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,n);const a=typeof r=="string"?-1:d.indexOf(r);d.splice(a===-1?1/0:a,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[o,d]=w(this,e);return r?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${l.toString(i)}${this.closed?`</${d}>`:""}`}text(){const[i,r]=w(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?w(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=w(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${r}>`:""})}},e=new WeakMap,t),di=ae(zr),ot=le(di,0,"TagPairToken",Mr,ot),re(di,1,ot)}}),Hn,Oo=C({"src/tag/index.ts"(){"use strict";var e,t,s,i;K(),je(),G(),X(),Hn=(i=class extends H{constructor(n,l,o,d,a){super(void 0,d,a);P(this,e);P(this,t);P(this,s);this.insertAt(l),F(this,e,o),F(this,t,n)}get closing(){return w(this,e)}toString(n){return`<${w(this,e)?"/":""}${w(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${w(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?w(this,t).length+(w(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return ut(w(this,s),()=>{const{type:n,name:l,parentNode:o,closing:d,selfClosing:a}=this;let u=!1,c=!1;if(n==="html"){const{html:[,k,T]}=this.getAttribute("config");u=T.includes(l),c=k.includes(l)}if(u||c&&a)return this;if(!o)return;const{childNodes:p}=o,m=p.indexOf(this),b=d?p.slice(0,m).reverse():p.slice(m+1),_=[this],{rev:A}=xe;for(const k of b)if(!(!k.is(n)||n==="html"&&(k.name!==l||c&&k.selfClosing)))if(w(k,e)===d){if(n==="tvar")return;_.push(k)}else{const T=_.pop();if(T===this)return k;N.viewOnly&&(F(T,s,[A,k]),F(k,s,[A,T]))}if(N.viewOnly)for(const k of _)F(k,s,[A,void 0])},n=>{F(this,s,n),n[1]&&n[1]!==this&&F(n[1],s,[xe.rev,this])})}print(){return super.print({pre:`<${w(this,e)?"/":""}${w(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return o.closing=w(this,e),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),Hr,ci,Dr,Ve,Pu=C({"src/tag/tvar.ts"(){"use strict";gt(),Oo(),ht(),Hr=[Ye()],Ve=class extends(Dr=Hn){get type(){return"tvar"}constructor(e,t,s,i,r){const n=new qe(t,"tvar-name",i,r);super(e,n,s,i,r)}},ci=ae(Dr),Ve=le(ci,0,"TvarToken",Hr,Ve),re(ci,1,Ve)}}),Bo,Ou=C({"src/tagPair/translate.ts"(){"use strict";var e,qo,s;X(),zn(),ht(),Pu(),Bo=(s=class extends ot{constructor(r,n,l,o=[]){const d=new qe(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(u,c,p)=>(new Ve("tvar",c,!1,l,o),new Ve("","",!0,l,o),`\0${o.length-2}n${p}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(u,c,p,m,b,_,A)=>(new Ve(c,p,!1,l,o),new Ve(_,A,!0,l,o),`\0${o.length-2}n${b}\0${o.length}n`));const a=new H(n,l,o);a.type="translate-inner";super("translate",d,a,"translate",l,o);P(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${R(this,e,qo).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}>${this.lastChild.print({class:"ext-inner"})}</translate></span>`}},e=new WeakSet,qo=function(){return this.firstChild.toString()===" nowrap"},s)}}),Gr,hi,Vr,Yt,Bu=C({"src/tagPair/include.ts"(){"use strict";K(),me(),gt(),G(),zn(),Gr=[Ye(!1)],Yt=class extends(Vr=ot){get type(){return"include"}constructor(e,t="",s,i,r,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",r,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:r}=this,n=new ce(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=N,{computeEditInfo:d}=o,a=l.map(u=>o.getSeverity(u,"include"));if(a[0]&&s.data.trim()){const u=J(s,n,l[0],"useless-attribute",a[0]);d&&(u.suggestions=[Z(u)]),t.push(u)}if(a[1]&&!i){const u=Y(this,n,l[1],N.msg("unclosed",`<${r}>`),a[1]);d&&(u.suggestions=[Je(u.endIndex,`</${r}>`)]),t.push(u)}return t}}},hi=ae(Vr),Yt=le(hi,0,"IncludeToken",Gr,Yt),re(hi,1,Yt)}}),Hs,Dn=C({"mixin/attributesParent.ts"(){"use strict";Hs=(e=0)=>t=>{var s,xn;{class r extends t{constructor(){super(...arguments);P(this,s)}hasAttr(o){return R(this,s,xn).call(this).hasAttr(o)}getAttr(o){return R(this,s,xn).call(this).getAttr(o)}}return s=new WeakSet,xn=function(){return this.childNodes[e]},r}}}}),de,gi,pi,zt,Ss,fi,it,mi,xi,vi,As,bi,Re,Gn,Vn,Qn,Wo,Uo=C({"util/sharable.ts"(){"use strict";de=new Set(["align"]),gi=new Set(["cite"]),pi=new Set(["cite","datetime"]),zt=new Set(["width"]),Ss=new Set(["axis","align","bgcolor","height","width","valign"]),fi=new Set([...Ss,"abbr","headers","scope","rowspan","colspan"]),it=new Set(["type"]),mi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),xi=new Set(["clear"]),vi=new Set(["bgcolor","align","valign"]),As=new Set(["qid","forcemathmode","type","display"]),bi=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Re=new Set,Gn=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"]),Vn={div:de,h1:de,h2:de,h3:de,h4:de,h5:de,h6:de,blockquote:gi,q:gi,p:de,br:xi,pre:zt,ins:pi,del:pi,ul:it,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...mi,"border"]),caption:de,tr:vi,td:fi,th:fi,font:new Set(["size","color","face"]),hr:zt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:it,poem:de,categorytree:de,combooption:de,math:Re,chem:Re,ce:Re,img:new Set(["alt","src","width","height","loading","srcset"])},Qn={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:Re,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:Re,inputbox:Re,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Re,poll:new Set(["id","show-results-before-voting"]),sm2:it,flashmp3:it,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([...As,"chem"]),chem:As,ce:As,hiero:Re,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:bi,syntaxhighlight:bi,templatedata:Re,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Re},Wo={table:mi,td:new Set([...Ss,"scope"]),th:Ss,br:xi,caption:de,div:de,hr:zt,h1:de,h2:de,h3:de,h4:de,h5:de,h6:de,li:it,p:de,pre:zt,tr:vi,ul:it}}}),Qr,Jr,Xr,Kr,Ls,qu=C({"src/attribute.ts"(){"use strict";var e,t,s,i,r,Mo,vn,o;K(),fe(),Xe(),Uo(),me(),G(),X(),ct(),Qr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Jr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,Xr=new Set(["ext","arg","magic-word","template"]),Kr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Ls=(o=class extends H{constructor(a,u,c,p="",m,b=[],_=N.getConfig(),A=[]){const k=new $e(c,"attr-key",_,A);let T;if(c==="title"||u==="img"&&c==="alt")T=new H(m,_,A,{}),T.type="attr-value",T.setAttribute("stage",Ae-1);else if(u==="gallery"&&c==="caption"||u==="ref"&&c==="details"||u==="choose"&&(c==="before"||c==="after")){const f={..._,excludes:[..._.excludes,"heading","html","table","hr","list"]};T=new H(m,f,A,{}),T.type="attr-value",T.setAttribute("stage",1)}else T=new $e(m,"attr-value",_,A,{});super(void 0,_,A);P(this,r);P(this,e);P(this,t);P(this,s);P(this,i);F(this,e,a),this.append(k,T),F(this,s,p),F(this,i,[...b]),F(this,t,u),this.setAttribute("name",Lt(_e(c)))}get type(){return w(this,e)}get tag(){return w(this,t)}get balanced(){return!w(this,s)||w(this,i)[0]===w(this,i)[1]}afterBuild(){w(this,s).includes("\0")&&F(this,s,this.buildFromStr(w(this,s),0)),this.parentNode&&F(this,t,this.parentNode.name),R(this,r,Mo).call(this),super.afterBuild()}toString(a){const[u="",c=""]=w(this,i);return w(this,s)?super.toString(a,w(this,s)+u)+c:this.firstChild.toString(a)}text(){return w(this,s)?`${super.text(`${w(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,u;return w(this,s)?w(this,s).length+((u=(a=w(this,i)[0])==null?void 0:a.length)!=null?u:0):0}lint(a=this.getAbsoluteIndex(),u){var c;{const p=super.lint(a,u),{balanced:m,firstChild:b,lastChild:_,name:A,tag:k}=this,T=new ce(this,a),f=["unclosed-quote","obsolete-attr"],{lintConfig:g}=N,x=f.map(h=>g.getSeverity(h,A));if(x[0]&&!m){const h=J(_,T,f[0],"unclosed-quotes",x[0]);h.startIndex--,h.startCol--,g.computeEditInfo&&(h.suggestions=[Je(h.endIndex,w(this,i)[0])]),p.push(h)}const v=R(this,r,vn).call(this,a,T);return v&&p.push(v),x[1]&&((c=Wo[k])!=null&&c.has(A))&&p.push(J(b,T,f[1],"obsolete-attribute",x[1])),p}}getValue(){return w(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){F(this,s,"{{=}}"),this.lastChild.escape()}getAttribute(a){return a==="invalid"?R(this,r,vn).call(this):super.getAttribute(a)}print(){const[a="",u=""]=w(this,i);return w(this,s)?super.print({sep:cs(w(this,s))+a,post:u}):super.print()}json(a,u=this.getAbsoluteIndex()){{const c=super.json(void 0,u);return c.tag=this.tag,c}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,Mo=function(){this.setAttribute("name",Lt(this.firstChild.text()))},vn=function(a,u){const{firstChild:c,lastChild:p,type:m,name:b,tag:_,parentNode:A}=this,k=!p.childNodes.some(({type:y})=>Xr.has(y)),T=this.getValue(),f=Qn[_],g=Vn[_],{length:x}=this.toString();let v="illegal-attr",h,S;if({lintConfig:h}=N,{computeEditInfo:S}=h,!(f!=null&&f.has(b))&&!(g!=null&&g.has(b))&&(m==="ext-attr"?f||g:!/\{\{[^{]+\}\}/u.test(b))&&(m==="ext-attr"&&!g||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(b)&&(_==="meta"||_==="link"||!Gn.has(b)))||(b==="itemtype"||b==="itemid"||b==="itemref")&&!(A!=null&&A.hasAttr("itemscope"))){if(a===void 0)return!0;{const y=h.getSeverity(v,"unknown");if(y){const $=J(c,u,v,"illegal-attribute-name",y);return S&&($.suggestions=[Z(a,x)]),$}}}else if(b==="style"&&typeof T=="string"&&Qr.test(T)){if(a===void 0)return!0;{v="insecure-style";const y=h.getSeverity(v);return y&&J(p,u,v,"insecure-style",y)}}else if(b==="tabindex"&&typeof T=="string"&&T!=="0"){if(a===void 0)return!0;{const y=h.getSeverity(v,"tabindex");if(y){const $=J(p,u,v,"nonzero-tabindex",y);return S&&($.suggestions=[Z(a,x),Pe($,"0 tabindex","0")]),$}}}else if(typeof T=="string"&&((/^xmlns:[\w:.-]+$/u.test(b)||Kr.has(b))&&Jr.test(T)||k&&(b==="href"||_==="img"&&b==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(T))){if(a===void 0)return!0;{const y=h.getSeverity(v,"value");return y&&J(p,u,v,"illegal-attribute-value",y)}}else if(k&&m!=="ext-attr"){const y=Wn(_,b),$=String(T).toLowerCase();if(y.length>0&&y.every(L=>L!==$)){if(a===void 0)return!0;{const L=h.getSeverity(v,"value");return L&&J(p,u,v,"illegal-attribute-value",L)}}}return!1},o)}}),wi,Yr,Zr,Ds,Jn=C({"src/attributes.ts"(){"use strict";var e,t,Fs,i;K(),fe(),me(),G(),X(),ct(),qu(),wi=r=>r.slice(0,-1),Yr=r=>`${wi(r)}-dirty`,Zr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Ds=(i=class extends H{constructor(n,l,o,d,a=[]){super(void 0,d,a,{});P(this,t);P(this,e);if(F(this,e,l),this.setAttribute("name",o),n){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 c="",p=u.exec(n),m=0;const b=(()=>{c&&(super.insertAt(new $e(c,Yr(l),d,a,{})),c="")});for(;p;){const{index:_,0:A,1:k,2:T,3:f,4:g,5:x,6:v}=p;if(c+=n.slice(m,_),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(_e(k).trim())){const h=g!=null?g:v,S=[f,x],y=new Ls(wi(l),o,k,T,h,S,d,a);b(),super.insertAt(y)}else c+=A;({lastIndex:m}=u),p=u.exec(n)}c+=n.slice(m),b()}}get type(){return w(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof Ls&&(!n||l.name===Lt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{parentNode:d,childNodes:a}=this,u=new Map,c=new Set,p=new ce(this,n),m=["no-ignored","no-duplicate"],{lintConfig:b}=N,{computeEditInfo:_,fix:A}=b,k=["closingTag","invalidAttributes","nonWordAttributes"].map(f=>b.getSeverity(m[0],f));if(k[0]&&R(this,t,Fs).call(this)){const f=Y(this,p,m[0],"attributes-of-closing-tag",k[0]);if(_){const g=d.getAbsoluteIndex();f.suggestions=[Z(f),Pn(g)]}o.push(f)}for(const f of a)if(f instanceof Ls){const{name:g}=f;u.has(g)?(c.add(g),u.get(g).push(f)):u.set(g,[f])}else{const g=f.text().trim(),x=k[Zr.test(g)?1:2];if(g&&x){const v=J(f,p,m[0],"invalid-attribute",x);_&&(v.suggestions=[Z(v,0," ")]),o.push(v)}}const T=b.getSeverity(m[1],"attribute");if(T&&c.size>0)for(const f of c){const g=u.get(f).map(x=>{const v=x.getValue();return[x,v===!0?"":v]});o.push(...g.map(([x,v],h)=>{const S=J(x,p,m[1],N.msg("duplicate-attribute",f),T);if(_||A){const y=Z(S);!v||g.slice(0,h).some(([,$])=>$===v)?S.fix=y:_&&(S.suggestions=[y])}return S}))}return o}}getAttribute(n){return n==="invalid"?R(this,t,Fs).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${R(this,t,Fs).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof $e?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Fs=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),zo={};oe(zo,{PreToken:()=>Ho});var Ho,Wu=C({"src/pre.ts"(){"use strict";Xe(),X(),Pt(),Ho=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),d=0,a="";for(;l&&o;)new Ee(l[0],t,s,!0),new Ee(o[0],t,s,!0),a+=`${e.slice(d,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,d=o.index+n+1,i.lastIndex=d,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=a+e.slice(d)}super(e,t,s,{}),this.setAttribute("stage",Ae-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Gs,Xn=C({"src/multiLine/index.ts"(){"use strict";X(),Gs=class extends H{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
1
|
+
"use strict";(()=>{var Su=Object.defineProperty;var hr=e=>{throw TypeError(e)};var Au=(e,t,s)=>t in e?Su(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ku=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,s)=>Au(e,typeof t!="symbol"?t+"":t,s),Ks=(e,t,s)=>t.has(e)||hr("Cannot "+s);var b=(e,t,s)=>(Ks(e,t,"read from private field"),s?s.call(e):t.get(e)),R=(e,t,s)=>t.has(e)?hr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),E=(e,t,s,i)=>(Ks(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),j=(e,t,s)=>(Ks(e,t,"access private method"),s);var gr=(e,t,s,i)=>({set _(r){E(e,t,r,s)},get _(){return b(e,t,i)}});var Cd=ku((Nd,wu)=>{var ba=Object.create,dt=Object.defineProperty,ya=Object.getOwnPropertyDescriptor,jn=Object.getOwnPropertyNames,$u=Object.getPrototypeOf,_u=Object.prototype.hasOwnProperty,wa=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),jt=e=>{throw TypeError(e)},Sa=(e,t,s)=>t in e?dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,pr=(e,t)=>dt(e,"name",{value:t,configurable:!0}),I=(e,t)=>function(){return e&&(t=(0,e[jn(e)[0]])(e=0)),t},Rn=(e,t)=>function(){return t||(0,e[jn(e)[0]])((t={exports:{}}).exports,t),t.exports},le=(e,t)=>{for(var s in t)dt(e,s,{get:t[s],enumerable:!0})},Aa=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of jn(t))!_u.call(e,r)&&r!==s&&dt(e,r,{get:()=>t[r],enumerable:!(i=ya(t,r))||i.enumerable});return e},Tu=(e,t,s)=>(s=e!=null?ba($u(e)):{},Aa(t||!e||!e.__esModule?dt(s,"default",{value:e,enumerable:!0}):s,e)),se=e=>Aa(dt({},"__esModule",{value:!0}),e),ae=e=>{var t;return[,,,ba((t=e==null?void 0:e[wa("metadata")])!=null?t:null)]},ka=["class","method","getter","setter","accessor","field","value","get","set"],Gt=e=>e!==void 0&&typeof e!="function"?jt("Function expected"):e,Cu=(e,t,s,i,r)=>({kind:ka[e],name:t,metadata:i,addInitializer:n=>s._?jt("Already initialized"):r.push(Gt(n||null))}),Pn=(e,t)=>Sa(t,wa("metadata"),e[3]),ne=(e,t,s,i)=>{for(var r=0,n=e[t>>1],l=n&&n.length;r<l;r++)t&1?n[r].call(s):i=n[r].call(s,i);return i},re=(e,t,s,i,r,n)=>{var l,o,u,a,d,c=t&7,f=!!(t&8),g=!!(t&16),y=c>3?e.length+1:c?f?1:2:0,$=ka[c+5],k=c>3&&(e[y-1]=[]),_=e[y]||(e[y]=[]),T=c&&(!g&&!f&&(r=r.prototype),c<5&&(c>3||!g)&&ya(c<4?r:{get[s](){return fe(this,n)},set[s](h){return Te(this,n,h)}},s));c?g&&c<4&&pr(n,(c>2?"set ":c>1?"get ":"")+s):pr(r,s);for(var p=i.length-1;p>=0;p--)a=Cu(c,s,u={},e[3],_),c&&(a.static=f,a.private=g,d=a.access={has:g?h=>Nu(r,h):h=>s in h},c^3&&(d.get=g?h=>(c^1?fe:pn)(h,r,c^4?n:T.get):h=>h[s]),c>2&&(d.set=g?(h,m)=>Te(h,r,m,c^4?n:T.set):(h,m)=>h[s]=m)),o=(0,i[p])(c?c<4?g?n:T[$]:c>4?void 0:{get:T.get,set:T.set}:r,a),u._=1,c^4||o===void 0?Gt(o)&&(c>4?k.unshift(o):c?g?n=o:T[$]=o:r=o):typeof o!="object"||o===null?jt("Object expected"):(Gt(l=o.get)&&(T.get=l),Gt(l=o.set)&&(T.set=l),Gt(l=o.init)&&k.unshift(l));return c||Pn(e,r),T&&dt(r,s,T),g?c^4?n:T:r},Iu=(e,t,s)=>Sa(e,typeof t!="symbol"?t+"":t,s),On=(e,t,s)=>t.has(e)||jt("Cannot "+s),Nu=(e,t)=>Object(t)!==t?jt('Cannot use the "in" operator on this value'):e.has(t),fe=(e,t,s)=>(On(e,t,"read from private field"),s?s.call(e):t.get(e)),Ge=(e,t,s)=>t.has(e)?jt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Te=(e,t,s,i)=>(On(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),pn=(e,t,s)=>(On(e,t,"access private method"),s),Lu=(e,t,s,i)=>({set _(r){Te(e,t,r,s)},get _(){return fe(e,t,i)}}),$a,as,Bn=I({"base.ts"(){"use strict";$a=(()=>{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})(),as=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-url","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Ee(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,r)=>Ee(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(i,r)=>t[r])}var Je,Ys,It,Nt,Lt,xt,os,Ce,ct,fr,mr,us,_a,xr,vr,ds,Ft,me=I({"util/string.ts"(){"use strict";Je=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ys=String.raw`[^[\]<>"\0-\x1F\x7F${Je}\uFFFD]`,It=String.raw`(?:\[[\da-f:.]+\]|${Ys})`,Nt=String.raw`(?:${Ys}|\0\d+[cn!~]\x7F)*`,Lt=e=>e.trim().toLowerCase(),xt=(e,t)=>s=>s.replace(e,t),os=xt(/[\0\x7F]|\r$/gmu,""),Ce=xt(/\0\d+[cn]\x7F/gu,""),ct=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),fr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},mr=xt(/&(?:#(\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)):fr[s.toLowerCase()]),us=e=>mr(e),_a=xt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),xr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},vr=e=>xt(e,t=>`&${xr[t]};`),ds=vr(/[&<>]/gu),Ft=(e,t={})=>{const{pre:s="",post:i="",sep:r=""}=t;return s+e.map(n=>n.print()).join(r)+i}}}),Fu=Rn({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invalid-thumb":"invalid thumbnail filename","invalid-url":"invalid URL","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',"ref-in-link":"<ref> in an internal or external link",remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),Eu=Rn({"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:[]}}}),ke,Ta,fn,Me=I({"util/constants.ts"(){"use strict";ke=11,Ta=Fu(),fn=Eu()}});function ot(e){const t=new Map,s=new WeakMap;return i=>{const r=typeof i=="string"?t:s;if(r.has(i)){const l=r.get(i);return l.lastIndex=0,l}const n=e(i);return r.set(i,n),n}}var cs,Ca,br,Ia,Ke=I({"../common/dist/index.mjs"(){"use strict";cs=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ca=e=>Math.round(e*255).toString(16).padStart(2,"0"),br=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,s=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,i=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${s}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${s}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i})`,"giu")}})(),Ia=(e,t=!0)=>{const s=[],i=br[t?"full":"rgb"];i.lastIndex=0;let r=i.exec(e),n=0;for(;r;){const l=r.index+r[1].length;l>n&&s.push([e.slice(n,l),n,l,!1]),{lastIndex:n}=i,s.push([r[2],l,n,e[l-1]!=="&"||!/^#\d+$/u.test(r[2])]),r=i.exec(e)}return e.length>n&&s.push([e.slice(n),n,e.length,!1]),s}}}),ge,ve=I({"lib/rect.ts"(){"use strict";var e,t,s,i,mn,n;ge=(n=class{constructor(l,o){R(this,i);R(this,e);R(this,t);R(this,s);E(this,e,l),E(this,t,o)}get start(){return b(this,t)}get top(){return j(this,i,mn).call(this).top}get left(){return j(this,i,mn).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,mn=function(){var l;return(l=b(this,s))!=null||E(this,s,b(this,e).getRootNode().posFromIndex(b(this,t))),b(this,s)},n)}}),yr,wr,rs,hs,Zs,Q,Z,Oe,Ws,ee,qn,Xe,Wn,Un,Mn,gs,Et,zn,ut,Hn,Y=I({"util/lint.ts"(){"use strict";Ke(),Re(),ve(),G(),yr=new Set(["tr","td","th","caption"]),wr=new Set(["Template:!!","Template:!-"]),rs=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")&&wr.has(t.name)||t.is("html")&&yr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&rs(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(rs);return s.includes(2)?2:s.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},hs=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Zs=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:o,left:u}=s instanceof ge?s:new ge(t,l),{offsetHeight:a,offsetWidth:d}=t,{startIndex:c,startLine:f,startCol:g}=e(t,l,o,u),{line:y,character:$}=hs(f,g,a,d);return{rule:i,message:N.msg(r),severity:n,startIndex:c,endIndex:c+t.toString().length,startLine:f,endLine:y,startCol:g,endCol:$}},Q=Zs((e,t,s,i)=>{const r=e.getRelativeIndex(),{top:n,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+n,startCol:n?l:i+l}}),Z=Zs((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),Oe=(e,t,s,i=0)=>({desc:N.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),Ws=(e,t,s)=>({desc:N.msg(t),range:[e,e],text:s}),ee=(e,t=0,s="")=>typeof e=="number"?{desc:N.msg("remove"),range:[e,e+t],text:s}:Oe(e,"remove",s,t),qn=(e,t)=>Oe(e,"decode",cs(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Xe=(e,t,s=0)=>({desc:N.msg("close"),range:[e+s,e],text:t}),Wn=e=>({desc:N.msg("open"),range:[e+1,e+2],text:""}),Un=(e,t)=>Oe(e,"comment",`<!--${t}-->`),Mn=(e,t)=>Oe(e,"uppercase",t.toUpperCase()),gs=(e,t=0)=>({desc:N.msg("whitespace"),range:[e,e+t],text:" "}),Et=(e,t,s=1)=>({desc:N.msg("escape"),range:[e,e+s],text:t.repeat(s)}),zn=(e,t)=>({desc:N.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),ut=(e,t,s,i)=>{if(e&&(i||N.viewOnly&&e[0]===be.rev))return e[1];const r=t();return(i||N.viewOnly)&&s([be.rev,r]),r},Hn=(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"]:[]}}),Sr,Dn,Na=I({"parser/selector.ts"(){"use strict";Sr=e=>{if(e.includes("#")){const t=e.indexOf("#"),s=e.slice(0,t),i=e.slice(t+1);return(r,n)=>(t===0||r===s)&&n===i}return e?t=>t===e:()=>!0},Dn=(e,t,s)=>{const i=e.split(",").map(r=>Sr(r.trim()));return(({type:r,name:n})=>i.some(l=>l(r,n)))}}}),ju=Rn({"../node_modules/binary-search/index.js"(e,t){t.exports=function(s,i,r,n,l){var o,u;if(n===void 0)n=0;else if(n=n|0,n<0||n>=s.length)throw new RangeError("invalid lower bound");if(l===void 0)l=s.length-1;else if(l=l|0,l<n||l>=s.length)throw new RangeError("invalid upper bound");for(;n<=l;)if(o=n+(l-n>>>1),u=+r(s[o],i,o,s),u<0)n=o+1;else if(u>0)l=o-1;else return o;return~n}}}),Ar,La,Ru=I({"util/search.ts"(){"use strict";Ar=Tu(ju()),La=(e,t,s)=>{const i=(0,Ar.default)(e,t,s);return i<0?~i:i}}}),Us,Gn=I({"mixin/cached.ts"(){"use strict";Y(),Us=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return ut(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),Fa,Pu=I({"mixin/nodeLike.ts"(){"use strict";Fa=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}}}),kr,$r,vs,Pt,Ot,bs,Bt,qt,Wt,nt,Ea=I({"lib/node.ts"(){"use strict";Ru(),Y(),Re(),Gn(),Pu(),G(),$r=[Fa],kr=[Us(!1)],nt=class{constructor(){ne(Wt,5,this),Iu(this,"childNodes",[]),Ge(this,vs),Ge(this,Pt),Ge(this,Ot),Ge(this,bs),Ge(this,Bt),Ge(this,qt,{})}get parentNode(){return fe(this,vs)}get nextSibling(){return fe(this,Pt)}get previousSibling(){return fe(this,Ot)}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":Te(this,vs,t),t||(Te(this,Pt,void 0),Te(this,Ot,void 0));break;case"nextSibling":Te(this,Pt,t);break;case"previousSibling":Te(this,Ot,t);break;case"aIndex":N.viewOnly&&Te(this,Bt,[be.rev,t]);break;default:this[e]=t}}getRootNode(){return ut(fe(this,bs),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&Te(this,bs,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,i,r]=s[e],n=i+t;return n>r?void 0:n}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=La(s,e,([,,r],n)=>r-n);return{top:i,left:e-s[i][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return ut(fe(this,qt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)N.viewOnly&&(fe(this,qt)[r]=[be.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{fe(this,qt)[e]=t})}getAbsoluteIndex(){return ut(fe(this,Bt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{Te(this,Bt,e)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}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!`)}},Wt=ae(null),vs=new WeakMap,Pt=new WeakMap,Ot=new WeakMap,bs=new WeakMap,Bt=new WeakMap,qt=new WeakMap,re(Wt,1,"getLines",kr,nt),nt=re(Wt,0,"AstNode",$r,nt),ne(Wt,1,nt)}}),ja,Ou=I({"mixin/elementLike.ts"(){"use strict";Na(),ja=e=>{var t,xn;{class i extends e{constructor(){super(...arguments);R(this,t)}getElementBy(l){const o=[...this.childNodes].reverse();for(;o.length>0;){const u=o.pop(),{type:a,childNodes:d}=u;if(a!=="text"){if(l(u))return u;for(let c=d.length-1;c>=0;c--)o.push(d[c])}}}querySelector(l){return this.getElementBy(j(this,t,xn).call(this,l))}getElementsBy(l){const o=[...this.childNodes].reverse(),u=[];for(;o.length>0;){const a=o.pop(),{type:d,childNodes:c}=a;if(d!=="text"){l(a)&&u.push(a);for(let f=c.length-1;f>=0;f--)o.push(c[f])}}return u}querySelectorAll(l){return this.getElementsBy(j(this,t,xn).call(this,l))}escape(){for(const l of this.childNodes)l.escape()}}return t=new WeakSet,xn=function(l){return Dn(l,this)},i}}}}),_r,ei,Tr,Vt,Bu=I({"lib/element.ts"(){"use strict";me(),Re(),Na(),Ea(),Ou(),_r=[ja],Vt=class extends(Tr=nt){get length(){return this.childNodes.length}text(e){return ct(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,r;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(r=e[s])==null||r.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:r}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||r===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){return fs(this,e,1)[0]}insertAt(e,t=this.length){return fs(this,t,0,[e]),e}closest(e){const t=Dn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(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){{if(e===void 0)return;const{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let s=this,i=0,r=0;for(;s.type!=="text";){const{childNodes:n}=s;i+=s.getAttribute("padding");for(let l=0;i<=e&&l<n.length;l++){const o=n[l],{nextSibling:u}=o,a=o.toString(),d=a.length;if(o.setAttribute("aIndex",i),i+=d,i>e||i===e&&d>0&&(!u||u.type==="text"||o.type!=="text"&&(a.trim()||!u.toString().trim()))){s=o,i-=d,r=i;break}i+=s.getGaps(l)}if(s.childNodes===n)return{offsetNode:s,offset:e-r}}return{offsetNode:s,offset:e-r}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const s=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(s==null?void 0:s.type)==="text"?s.parentNode:s}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,r=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",r);const l=n.lint(r,t);l.length>0&&Array.prototype.push.apply(s,l),r+=n.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+Ft(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){{const s={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,r=t+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i],{length:l}=n.toString();n.setAttribute("aIndex",r),s.childNodes.push(n.type==="text"?{data:n.data,range:[r,r+l]}:n.json(void 0,r)),r+=l+this.getGaps(i)}return s}}},ei=ae(Tr),Vt=re(ei,0,"AstElement",_r,Vt),ne(ei,1,Vt)}}),ms,Ms=I({"mixin/gapped.ts"(){"use strict";ms=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),We,ze=I({"mixin/noEscape.ts"(){"use strict";We=e=>{{class t extends e{escape(){}}return t}}}}),Cr,Ra,qu=I({"src/parameter.ts"(){"use strict";me(),Y(),G(),J(),Cr=new RegExp(`https?://${It}${Nt}$`,"iu"),Ra=class extends z{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch{return!1}}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new z(typeof e=="number"?void 0:e,s,i,{}),n=new z(t,s,i);r.type="parameter-key",r.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(r,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r="unescaped",{lintConfig:n}=N,l=n.getSeverity(r);if(l){const{firstChild:o}=this,u=(s=Cr.exec(o.text()))==null?void 0:s[0];try{if(u&&new URL(u).search){const a=Q(o,{start:e},r,"unescaped-query",l);a.startIndex=a.endIndex,a.startLine=a.endLine,a.startCol=a.endCol,a.endIndex++,a.endCol++,(n.computeEditInfo||n.fix)&&(a.fix=Et(a.startIndex,"{{=}}")),i.push(a)}}catch{}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}}),qe,ht=I({"src/atom.ts"(){"use strict";var e,t;J(),qe=(t=class extends z{constructor(i,r,n,l,o){super(i,n,l,o);R(this,e);E(this,e,r)}get type(){return b(this,e)}set type(i){E(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),Ue,gt=I({"src/syntax.ts"(){"use strict";var e,t;J(),Ue=(t=class extends z{constructor(i,r,n,l,o){super(i,n,l,o);R(this,e);E(this,e,r)}get type(){return b(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Pa={};le(Pa,{TranscludeToken:()=>rt});var Ir,ti,Nr,rt,Oa=I({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,Qt,Ba,u;me(),Y(),Re(),ve(),Ms(),ze(),G(),J(),qu(),ht(),gt(),Ir=[We,ms()],rt=(u=class extends(Nr=z){constructor(d,c,f,g=[]){var A,C;let y;const $=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);$&&(y=Number($[1]),d=d.replace(`\0${y}h`,g[y].toString().replace(/^\n/u,"")));super(void 0,f,g,{});R(this,n);Ne(this,"modifier","");R(this,e,"template");R(this,t,":");R(this,s,!1);R(this,i,new Map);R(this,r);const{parserFunction:[k,_],variable:T,functionHook:p}=f,h=(A=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:A[0];if(h)this.setAttribute("modifier",h),d=d.slice(h.length);else if(d.includes(":")){const[L,...B]=d.split(":"),[q]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((C=B[0])!=null?C:"");this.setModifier(`${L}:${q}`)&&(d=B.join(":").slice(q.length))}const m=d.search(/[::]/u),x=d[m]===":",S=m!==-1;if(S||c.length===0&&!b(this,s)){const L=S?d.slice(0,m):d,B=S&&d.slice(m+1),q=Ce(L),O=S?q.slice(q.search(/\S/u))+(x?":":""):q.trim(),W=O.toLowerCase(),F=Array.isArray(_),P=F?_.includes(O):Object.prototype.hasOwnProperty.call(_,O),U=!F&&P?_[O]:Object.prototype.hasOwnProperty.call(k,W)&&k[W],M=F&&P||!("functionHook"in f)||p.includes(U),ie=F&&P||T.includes(U);if(S?U&&M:ie){this.setAttribute("name",U||W.replace(/^#|:$/u,"")),E(this,e,"magic-word"),x&&E(this,t,":");const H=new Ue(L,"magic-word-name",f,g);if(super.insertAt(H),B!==!1&&c.unshift([B]),this.name==="invoke")for(let V=0;V<2;V++){const X=c.shift();if(!X)break;const oe=new qe(X.join("="),`invoke-${V?"function":"module"}`,f,g);super.insertAt(oe)}}}if(this.type==="template"){const L=Ce(d).trim();if(!this.normalizeTitle(L,10,{halfParsed:!0,temporary:!0}).valid)throw g.pop(),new SyntaxError("Invalid template name");const B=new qe(d,"template-name",f,g,{});super.insertAt(B)}typeof y=="number"&&(g[y]=void 0);const v=this.isTemplate();let w=1;for(let L=0;L<c.length;L++){const B=c[L];v||this.name==="switch"&&L>0||this.name==="tag"&&L>1||(B[0]=B.join("="),B.length=1),B.length===1&&(B.unshift(w),w++),this.insertAt(new Ra(...B,f,g))}this.seal("modifier")}get type(){return b(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?j(this,n,Qt).call(this).title:void 0}get function(){var d;return this.type==="magic-word"&&this.name==="invoke"?(d=this.childNodes[2])==null?void 0:d.text().trim():void 0}setModifier(d){const{parserFunction:[,,c,f]}=this.getAttribute("config"),g=Ce(d).trim();if(d&&!g.endsWith(":"))return!1;const y=g.slice(0,-1).toLowerCase(),$=c.includes(y),k=f.includes(y);return b(this,s)&&$||!b(this,s)&&(k||!d)||(be.running||this.length>1)&&($||k||!d)?(this.setAttribute("modifier",d),E(this,s,$),!!d):!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"&&(E(this,r,j(this,n,Qt).call(this)),this.setAttribute("name",b(this,r).title))}toString(d){const{childNodes:c,length:f,firstChild:g,modifier:y,type:$}=this;return`{{${y}${$==="magic-word"?g.toString(d)+(f===1?"":b(this,t))+c.slice(1).map(k=>k.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:c,firstChild:f,modifier:g,type:y,name:$}=this;return y==="magic-word"&&$==="vardefine"?"":`{{${g}${y==="magic-word"?f.text()+(c===1?"":b(this,t))+ct(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return b(this,r);case"colon":return b(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!j(this,n,Qt).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),c){{const f=super.lint(d,c);if(!this.isTemplate())return f;const{type:g,childNodes:y,length:$}=this,k=new ge(this,d),{lintConfig:_}=N,{computeEditInfo:T}=_,p=g==="magic-word";let h="no-ignored",m=_.getSeverity(h,"fragment");if(p&&!j(this,n,Qt).call(this).valid)h="invalid-invoke",m=_.getSeverity(h,"name"),m&&f.push(Q(y[1],k,h,"illegal-module",m));else if(m){const x=y[p?1:0],S=x.childNodes.findIndex(w=>w.type==="text"&&us(w.data).includes("#")),v=x.childNodes[S];if(v){const w=Q(x,k,h,"useless-fragment",m);T&&(w.suggestions=[ee(w,x.getRelativeIndex(S)+v.data.indexOf("#"))]),f.push(w)}}if(h="invalid-invoke",m=_.getSeverity(h,"function"),m&&p&&$===2)return f.push(Z(this,k,h,"missing-function",m)),f;if(h="no-duplicate",m=_.getSeverity(h,"parameter"),m){const x=this.getDuplicatedArgs().filter(([,v])=>!v[0].querySelector("ext")),S="duplicate-parameter";for(const[,v]of x)Array.prototype.push.apply(f,v.map(w=>{const A=Q(w,k,h,S,m);return T&&(A.suggestions=[ee(A,-1)]),A}))}return f}}insertAt(d,c=this.length){return super.insertAt(d,c),d.anon?j(this,n,Ba).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(Js("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,c,f=!0){const g=String(d).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let y;return b(this,i).has(g)?y=b(this,i).get(g):(y=new Set(this.getAllArgs().filter(({name:$})=>g===$)),b(this,i).set(g,y)),y}getDuplicatedArgs(){return[...b(this,i)].filter(([,{size:d}])=>d>1).map(([d,c])=>[d,[...c]])}getPossibleValues(){const{type:d,name:c,childNodes:f}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let g,y;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":g=2;break;case"ifeq":g=3;break;case"switch":{const $=f.slice(2),k=$[$.length-1];y=[...$.filter(({anon:_})=>!_),...k!=null&&k.anon?[k]:[]].map(({lastChild:_})=>_);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}y!=null||(y=f.slice(g,g+2).map(({lastChild:$})=>$));for(let $=0;$<y.length;){const{length:k,0:_}=y[$].childNodes.filter(T=>T.text().trim());if(k===0)y.splice($,1);else if(k>1||_.type!=="magic-word")$++;else try{const T=_.getPossibleValues();Array.prototype.splice.apply(y,[$,1,...T]),$+=T.length}catch{$++}}return y}print(){const{childNodes:d,length:c,firstChild:f,modifier:g,type:y}=this;return`<span class="wpb-${y}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${y==="magic-word"?ds(g)+f.print()+(c===1?"":b(this,t))+Ft(d.slice(1),{sep:"|"}):(g?`<span class="wpb-magic-word">${ds(g)}</span>`:"")+Ft(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,Qt=function(){const d=this.type==="template";return this.normalizeTitle((d?"":"Module:")+this.childNodes[d?0:1].text(),10,{temporary:!0,...!d&&{page:""}})},Ba=function(d){const c=this.getAnonArgs(),f=typeof d!="number";for(let g=f?c.indexOf(d):d-1;g<c.length;g++){const y=c[g],{name:$}=y,k=String(g+1);($!==k||y===d)&&(y.setAttribute("name",k),this.getArgs(k,!1,!1).add(y))}},u),ti=ae(Nr),rt=re(ti,0,"TranscludeToken",Ir,rt),ne(ti,1,rt)}}),ys,si,ii,Lr,Fr,Er,jr,ni,Rr,vn,Wu=I({"lib/text.ts"(){"use strict";var e,bn,s;me(),Y(),Re(),G(),Ea(),ys=String.raw`[${Je}\t]*`,si=String.raw`[^\S\n]*`,ii=String.raw`<${si}(?:/${si})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+`,Lr=new RegExp(String.raw`${ii}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${ys}\d)|isbn(?=[-::]?${ys}(?:\d(?:${ys}|-)){6})`,"giu"),Fr=new RegExp(ii,"giu"),Er=new Set(["attr-value","ext-link-text","link-text"]),jr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ni=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"]),Rr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),vn=(s=class extends nt{constructor(n){super();R(this,e);Ne(this,"data","");this.data=n}get type(){return"text"}toString(n){var l;return n&&!((l=this.parentNode)!=null&&l.getAttribute("built"))?Ce(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),l){var o,u,a;{if(l===!1)return[];const{data:d,parentNode:c,nextSibling:f,previousSibling:g}=this;if(!c)throw new Error("An isolated text node cannot be linted!");const{type:y,parentNode:$}=c;if(y==="attr-value"){const{name:O,tag:W}=$;if(W==="ref"&&(O==="name"||O==="follow")||O==="group"&&(W==="ref"||W==="references")||W==="choose"&&(O==="before"||O==="after"))return[]}if(l!=null||(l=c.isPlain()&&!Er.has(y)?Lr:Fr),d.search(l)===-1)return[];l.lastIndex=0;const k=[],_=f==null?void 0:f.type,T=f==null?void 0:f.name,p=g==null?void 0:g.type,h=this.getRootNode(),m=h.toString(),{ext:x,html:S,variants:v}=h.getAttribute("config"),{top:w,left:A}=h.posFromIndex(n),{lintConfig:C}=N,L=C.rules["tag-like"],B=typeof L=="object"&&L[1]?new Set(Object.keys(L[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,q=new Set(["onlyinclude","noinclude","includeonly",...x,...S[0],...S[1],...S[2],...B,...C.getSeverity("tag-like","disallowed")?ni:[]]);for(let O=l.exec(d);O;O=l.exec(d)){const[,W,F]=O;let{index:P,0:U}=O;if(F&&F!=="]"){const{length:xe}=F;P+=xe,U=U.slice(xe)}U=U.toLowerCase();const[M]=U,ie=M==="r"||M==="p"||M==="i",H=M==="{",V=M==="}",X=M==="[",oe=M==="]";let{length:de}=U;if(M==="<"&&!q.has(W.toLowerCase())||X&&y==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(P+1))||f!=null&&f.is("ext")&&T==="nowiki"&&((o=f.innerText)!=null&&o.includes("]"))))continue;oe&&(P||de>1)&&l.lastIndex--;let ce=n+P,ue=ce+de,pe,ye;const D=m[ue],K=m[ce-1],Ae=H||X,we=H&&K==="-"&&v.length>0,Ie=V&&D==="-"&&v.length>0,et=X&&_==="free-ext-link"&&!d.slice(P+1).trim()||oe&&p==="free-ext-link"&&!d.slice(0,P).includes("]");if(ie)pe="lonely-http",U=U.toUpperCase(),ye=C.getSeverity(pe,U);else if(M==="<"){pe="tag-like";let xe;/^<\/?\s/u.test(U)||!/[\s/>]/u.test(D!=null?D:"")?xe="invalid":B.has(W)?xe=W:ni.has(W)&&!x.includes(W)&&(xe="disallowed"),ye=C.getSeverity(pe,xe)}else if(we||Ie)pe="lonely-bracket",ye=C.getSeverity(pe,"converter"),we&&P>0?(U="-{",P--,ce--,de=2):Ie&&P<d.length-1&&(U="}-",ue++,de=2);else if(et)pe="lonely-bracket",ye=C.getSeverity(pe,"extLink");else if(Ae||V||oe)if(pe="lonely-bracket",de>1||H&&D===M||V&&K===M)ye=C.getSeverity(pe,"double");else{if(!X||y!=="ext-link-text"){const xe=jr[M],Xs=Ae?d.slice(P+1):d.slice(0,P);if(H&&((u=xe.exec(Xs))==null?void 0:u[0])==="}"||V&&((a=xe.exec(Xs))==null?void 0:a[0])==="{")continue;if(!Xs.includes(M)){const cr=Ae?"nextSibling":"previousSibling";let tt=this[cr];for(;tt&&(tt.type!=="text"||!xe.test(tt.data));)tt=tt[cr];if(tt&&xe.exec(tt.data)[0]!==M)continue}}ye=C.getSeverity(pe,"single")}else pe="lonely-http",ye=C.getSeverity(pe);if(!ye)continue;const _e=this.posFromIndex(P),{line:mt,character:te}=hs(w,A,_e.top+1,_e.left),Le={rule:pe,message:N.msg("lonely",ie||M==="h"||we||Ie?U:M),severity:ye,startIndex:ce,endIndex:ue,startLine:mt,endLine:mt,startCol:te,endCol:te+de};if(C.computeEditInfo)if(M==="<")Le.suggestions=[Et(ce,"<")];else if(M==="h"&&y!=="link-text"&&Rr.test(K||""))Le.suggestions=[gs(ce)];else if(X&&y==="ext-link-text"){const xe=c.getAbsoluteIndex()+c.toString().length;Le.suggestions=[Et(xe,"]")]}else if(oe&&et){const xe=n-g.toString().length;Le.suggestions=[Ws(xe,"left-bracket","[")]}else ie&&(Le.suggestions=[...O[0]===U?[]:[Mn(Le,U)],...D===":"||D===":"?[gs(ue,1)]:[]]);k.push(Le)}return k}}replaceData(n){j(this,e,bn).call(this,n)}splitText(n){{const{parentNode:l,data:o}=this;if(!l)throw new Error("The text node to be split has no parent node!");const u=new s(o.slice(n));return fs(l,l.childNodes.indexOf(this)+1,0,[u]),this.setAttribute("data",o.slice(0,n)),u}this.lspError("AstText.splitText")}escape(){{const{parentNode:n}=this;if(!n)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:l}=(Oa(),se(Pa)),o=n.getAttribute("config"),u=n.childNodes.indexOf(this)+1,a=f=>Math.max(this.data.lastIndexOf("=",f),this.data.lastIndexOf("|",f));let d=a();const c=(()=>new l(this.data[d]==="="?"=":"!",[],o));for(;d>=0;d=a(d-1))d<this.data.length-1&&this.splitText(d+1),n.insertAt(be.run(c),u),j(this,e,bn).call(this,this.data.slice(0,d))}}print(){return ds(this.data)}},e=new WeakSet,bn=function(n){this.setAttribute("data",n)},s)}}),Ye,pt=I({"mixin/hidden.ts"(){"use strict";Ye=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),He,Ze=I({"mixin/padded.ts"(){"use strict";He=({length:e})=>t=>{{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}}),Pr,Or,ri,Br,Ve,zs=I({"src/link/base.ts"(){"use strict";var e,t,s,i;Y(),Me(),ve(),Ze(),ze(),G(),J(),ht(),Pr=r=>r==="redirect-target"||r==="link",Or=[We,He("[[")],Ve=(i=class extends(Br=z){constructor(n,l,o,u=[],a="|"){super(void 0,o,u,{});R(this,e,!0);R(this,t);R(this,s);if(this.insertAt(new qe(n,"link-target",o,u,{})),l!==void 0){const d=new z(l,o,u,{});d.type="link-text",d.setAttribute("stage",ke-1),this.insertAt(d)}E(this,t,a)}get link(){return b(this,s)}get fragment(){return b(this,s).fragment}afterBuild(){E(this,s,this.getTitle()),b(this,t).includes("\0")&&E(this,t,this.buildFromStr(b(this,t),0)),this.setAttribute("name",b(this,s).title),super.afterBuild()}setAttribute(n,l){n==="bracket"?E(this,e,l):n==="title"?E(this,s,l):super.setAttribute(n,l)}toString(n){const l=super.toString(n,b(this,t));return b(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return b(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?b(this,s):super.getAttribute(n)}getGaps(n){return n===0?b(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{childNodes:[u,a],type:d}=this,{encoded:c,fragment:f}=b(this,s),{lintConfig:g}=N,{computeEditInfo:y,fix:$}=g,k=new ge(this,n);let _="unknown-page",T=g.getSeverity(_);if(T&&u.childNodes.some(({type:p})=>p==="template")&&o.push(Q(u,k,_,"template-in-link",T)),_="url-encoding",T=g.getSeverity(_),T&&c){const p=Q(u,k,_,"unnecessary-encoding",T);(y||$)&&(p.fix=qn(p,u)),o.push(p)}if(_="pipe-like",T=g.getSeverity(_,"link"),T&&(d==="link"||d==="category")){const p=a==null?void 0:a.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("|")),h=a==null?void 0:a.childNodes[p];if(h){const m=Q(a,k,_,"pipe-in-link",T);if(y){const x=m.startIndex+a.getRelativeIndex(p);m.suggestions=[zn(x,h.data)]}o.push(m)}}if(_="no-ignored",T=g.getSeverity(_,"fragment"),T&&f!==void 0&&!Pr(d)){const p=Q(u,k,_,"useless-fragment",T);if(y||$){const h=u.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("#")),m=u.childNodes[h];m&&(p.fix=ee(p,u.getRelativeIndex(h)+m.data.indexOf("#")))}o.push(p)}return o}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(b(this,e)?{pre:"[[",post:"]]",sep:b(this,t)}:{sep:b(this,t)})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l),{type:u,fragment:a}=this;return a!==void 0&&(u==="link"||u==="redirect-target")&&(o.fragment=a),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),ri=ae(Br),Ve=re(ri,0,"LinkBaseToken",Or,Ve),ne(ri,1,Ve)}}),qr,li,Wr,Be,ft=I({"src/nowiki/base.ts"(){"use strict";ze(),J(),qr=[We],Be=class extends(Wr=z){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},li=ae(Wr),Be=re(li,0,"NowikiBaseToken",qr,Be),ne(li,1,Be)}}),Ur,ai,Mr,je,Rt=I({"src/nowiki/noinclude.ts"(){"use strict";pt(),ft(),Ur=[Ye()],je=class extends(Mr=Be){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},ai=ae(Mr),je=re(ai,0,"NoincludeToken",Ur,je),ne(ai,1,je)}}),qa,Uu=I({"src/link/redirectTarget.ts"(){"use strict";Y(),G(),zs(),Rt(),qa=class extends Ve{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new je(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:i}=N,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=Q(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=ee(n)),t.push(n)}return t}}}}}),zr,oi,Hr,Jt,Mu=I({"src/redirect.ts"(){"use strict";var e,t,s;pt(),ze(),J(),gt(),Uu(),zr=[Ye(!1,!1),We],Jt=(s=class extends(Hr=z){constructor(r,n,l,o,u,a,d=[]){super(void 0,a,d);R(this,e);R(this,t);E(this,e,r),E(this,t,u),this.append(new Ue(n,"redirect-syntax",a,d),new qa(l,o==null?void 0:o.slice(1),a,d))}get type(){return"redirect"}getAttribute(r){return r==="padding"?b(this,e).length:super.getAttribute(r)}toString(r){return b(this,e)+super.toString(r)+b(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+b(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:b(this,e),post:b(this,t)})}},e=new WeakMap,t=new WeakMap,s),oi=ae(Hr),Jt=re(oi,0,"RedirectToken",zr,Jt),ne(oi,1,Jt)}}),Wa={};le(Wa,{parseRedirect:()=>Ua});var Ua,zu=I({"parser/redirect.ts"(){"use strict";G(),Mu(),Ua=(e,t,s)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&N.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Jt(...i.slice(1),t,s),e):!1}}}),Dr,ui,Gr,Xt,Hu=I({"src/onlyinclude.ts"(){"use strict";Ze(),ze(),J(),Dr=[We,He("<onlyinclude>")],Xt=class extends(Gr=z){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}},ui=ae(Gr),Xt=re(ui,0,"OnlyincludeToken",Dr,Xt),ne(ui,1,Xt)}}),Vr,di,Qr,lt,Vn=I({"src/tagPair/index.ts"(){"use strict";var e,t;Ms(),ze(),J(),Vr=[ms(),We],lt=(t=class extends(Qr=z){constructor(i,r,n,l,o,u=[]){super(void 0,o);R(this,e);Ne(this,"closed");Ne(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),E(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,n);const a=typeof r=="string"?-1:u.indexOf(r);u.splice(a===-1?1/0:a,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[o,u]=b(this,e);return r?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${l.toString(i)}${this.closed?`</${u}>`:""}`}text(){const[i,r]=b(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?b(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=b(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${r}>`:""})}},e=new WeakMap,t),di=ae(Qr),lt=re(di,0,"TagPairToken",Vr,lt),ne(di,1,lt)}}),Qn,Ma=I({"src/tag/index.ts"(){"use strict";var e,t,s,i;Y(),Re(),G(),J(),Qn=(i=class extends z{constructor(n,l,o,u,a){super(void 0,u,a);R(this,e);R(this,t);R(this,s);this.insertAt(l),E(this,e,o),E(this,t,n)}get closing(){return b(this,e)}toString(n){return`<${b(this,e)?"/":""}${b(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${b(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?b(this,t).length+(b(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return ut(b(this,s),()=>{const{type:n,name:l,parentNode:o,closing:u,selfClosing:a}=this;let d=!1,c=!1;if(n==="html"){const{html:[,_,T]}=this.getAttribute("config");d=T.includes(l),c=_.includes(l)}if(d||c&&a)return this;if(!o)return;const{childNodes:f}=o,g=f.indexOf(this),y=u?f.slice(0,g).reverse():f.slice(g+1),$=[this],{rev:k}=be;for(const _ of y)if(!(!_.is(n)||n==="html"&&(_.name!==l||c&&_.selfClosing)))if(b(_,e)===u){if(n==="tvar")return;$.push(_)}else{const T=$.pop();if(T===this)return _;N.viewOnly&&(E(T,s,[k,_]),E(_,s,[k,T]))}if(N.viewOnly)for(const _ of $)E(_,s,[k,void 0])},n=>{E(this,s,n),n[1]&&n[1]!==this&&E(n[1],s,[be.rev,this])})}print(){return super.print({pre:`<${b(this,e)?"/":""}${b(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return o.closing=b(this,e),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),Jr,ci,Xr,Qe,Du=I({"src/tag/tvar.ts"(){"use strict";pt(),Ma(),gt(),Jr=[Ye()],Qe=class extends(Xr=Qn){get type(){return"tvar"}constructor(e,t,s,i,r){const n=new Ue(t,"tvar-name",i,r);super(e,n,s,i,r)}},ci=ae(Xr),Qe=re(ci,0,"TvarToken",Jr,Qe),ne(ci,1,Qe)}}),za,Gu=I({"src/tagPair/translate.ts"(){"use strict";var e,Ha,s;J(),Vn(),gt(),Du(),za=(s=class extends lt{constructor(r,n,l,o=[]){const u=new Ue(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(d,c,f)=>(new Qe("tvar",c,!1,l,o),new Qe("","",!0,l,o),`\0${o.length-2}n${f}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(d,c,f,g,y,$,k)=>(new Qe(c,f,!1,l,o),new Qe($,k,!0,l,o),`\0${o.length-2}n${y}\0${o.length}n`));const a=new z(n,l,o);a.type="translate-inner";super("translate",u,a,"translate",l,o);R(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${j(this,e,Ha).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}>${this.lastChild.print({class:"ext-inner"})}</translate></span>`}},e=new WeakSet,Ha=function(){return this.firstChild.toString()===" nowrap"},s)}}),Kr,hi,Yr,Kt,Vu=I({"src/tagPair/include.ts"(){"use strict";Y(),ve(),pt(),G(),Vn(),Kr=[Ye(!1)],Kt=class extends(Yr=lt){get type(){return"include"}constructor(e,t="",s,i,r,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",r,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:r}=this,n=new ge(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=N,{computeEditInfo:u}=o,a=l.map(d=>o.getSeverity(d,"include"));if(a[0]&&s.data.trim()){const d=Q(s,n,l[0],"useless-attribute",a[0]);u&&(d.suggestions=[ee(d)]),t.push(d)}if(a[1]&&!i){const d=Z(this,n,l[1],N.msg("unclosed",`<${r}>`),a[1]);u&&(d.suggestions=[Xe(d.endIndex,`</${r}>`)]),t.push(d)}return t}}},hi=ae(Yr),Kt=re(hi,0,"IncludeToken",Kr,Kt),ne(hi,1,Kt)}}),Hs,Jn=I({"mixin/attributesParent.ts"(){"use strict";Hs=(e=0)=>t=>{var s,yn;{class r extends t{constructor(){super(...arguments);R(this,s)}hasAttr(o){return j(this,s,yn).call(this).hasAttr(o)}getAttr(o){return j(this,s,yn).call(this).getAttr(o)}}return s=new WeakSet,yn=function(){return this.childNodes[e]},r}}}}),he,gi,pi,Ut,ws,fi,Mt,mi,xi,vi,Ss,bi,yi,wi,Pe,Xn,Kn,Yn,Da,Ga=I({"util/sharable.ts"(){"use strict";he=new Set(["align"]),gi=new Set(["cite"]),pi=new Set(["cite","datetime"]),Ut=new Set(["width"]),ws=new Set(["axis","align","bgcolor","height","width","valign"]),fi=new Set([...ws,"abbr","headers","scope","rowspan","colspan"]),Mt=new Set(["type"]),mi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),xi=new Set(["clear"]),vi=new Set(["bgcolor","align","valign"]),Ss=new Set(["qid","forcemathmode","type","display"]),bi=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),yi=new Set(["weight"]),wi=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),Pe=new Set,Xn=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"]),Kn={div:he,h1:he,h2:he,h3:he,h4:he,h5:he,h6:he,blockquote:gi,q:gi,p:he,br:xi,pre:Ut,ins:pi,del:pi,ul:Mt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...mi,"border"]),caption:he,tr:vi,td:fi,th:fi,font:new Set(["size","color","face"]),hr:Ut,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Mt,poem:he,categorytree:he,combooption:he,math:Pe,chem:Pe,ce:Pe,img:new Set(["alt","src","width","height","loading","srcset"])},Yn={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:Pe,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:yi,choicetemplate:yi,imagemap:Pe,inputbox:Pe,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Pe,poll:new Set(["id","show-results-before-voting"]),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([...Ss,"chem"]),chem:Ss,ce:Ss,hiero:Pe,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:bi,syntaxhighlight:bi,templatedata:Pe,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Pe,mapframe:new Set([...wi,"frameless"]),maplink:new Set([...wi,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},Da={table:mi,td:new Set([...ws,"scope"]),th:ws,br:xi,caption:he,div:he,hr:Ut,h1:he,h2:he,h3:he,h4:he,h5:he,h6:he,li:Mt,p:he,pre:Ut,tr:vi,ul:Mt}}}),Zr,el,tl,sl,Ls,Qu=I({"src/attribute.ts"(){"use strict";var e,t,s,i,r,Va,wn,o;Y(),me(),Me(),Ga(),ve(),G(),J(),ht(),Zr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,el=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,tl=new Set(["ext","arg","magic-word","template"]),sl=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Ls=(o=class extends z{constructor(a,d,c,f="",g,y=[],$=N.getConfig(),k=[]){const _=new qe(c,"attr-key",$,k);let T;if(c==="title"||d==="img"&&c==="alt")T=new z(g,$,k,{}),T.type="attr-value",T.setAttribute("stage",ke-1);else if(d==="gallery"&&c==="caption"||d==="ref"&&c==="details"||(d==="mapframe"||d==="maplink")&&c==="text"||d==="choose"&&(c==="before"||c==="after")){const p={...$,excludes:[...$.excludes,"heading","html","table","hr","list"]};T=new z(g,p,k,{}),T.type="attr-value",T.setAttribute("stage",1)}else T=new qe(g,"attr-value",$,k,{});super(void 0,$,k);R(this,r);R(this,e);R(this,t);R(this,s);R(this,i);E(this,e,a),this.append(_,T),E(this,s,f),E(this,i,[...y]),E(this,t,d),this.setAttribute("name",Lt(Ce(c)))}get type(){return b(this,e)}get tag(){return b(this,t)}get balanced(){return!b(this,s)||b(this,i)[0]===b(this,i)[1]}afterBuild(){b(this,s).includes("\0")&&E(this,s,this.buildFromStr(b(this,s),0)),this.parentNode&&E(this,t,this.parentNode.name),j(this,r,Va).call(this),super.afterBuild()}toString(a){const[d="",c=""]=b(this,i);return b(this,s)?super.toString(a,b(this,s)+d)+c:this.firstChild.toString(a)}text(){return b(this,s)?`${super.text(`${b(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,d;return b(this,s)?b(this,s).length+((d=(a=b(this,i)[0])==null?void 0:a.length)!=null?d:0):0}lint(a=this.getAbsoluteIndex(),d){var c;{const f=super.lint(a,d),{balanced:g,firstChild:y,lastChild:$,name:k,tag:_}=this,T=new ge(this,a),p=["unclosed-quote","obsolete-attr"],{lintConfig:h}=N,m=p.map(S=>h.getSeverity(S,k));if(m[0]&&!g){const S=Q($,T,p[0],"unclosed-quotes",m[0]);S.startIndex--,S.startCol--,h.computeEditInfo&&(S.suggestions=[Xe(S.endIndex,b(this,i)[0])]),f.push(S)}const x=j(this,r,wn).call(this,a,T);return x&&f.push(x),m[1]&&((c=Da[_])!=null&&c.has(k))&&f.push(Q(y,T,p[1],"obsolete-attribute",m[1])),f}}getValue(){return b(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){this.type!=="ext-attr"&&(E(this,s,"{{=}}"),this.lastChild.escape())}getAttribute(a){return a==="invalid"?j(this,r,wn).call(this):super.getAttribute(a)}print(){const[a="",d=""]=b(this,i);return b(this,s)?super.print({sep:ds(b(this,s))+a,post:d}):super.print()}json(a,d=this.getAbsoluteIndex()){{const c=super.json(void 0,d);return c.tag=this.tag,c}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,Va=function(){this.setAttribute("name",Lt(this.firstChild.text()))},wn=function(a,d){const{firstChild:c,lastChild:f,type:g,name:y,tag:$,parentNode:k}=this,_=!f.childNodes.some(({type:w})=>tl.has(w)),T=this.getValue(),p=Yn[$],h=Kn[$],{length:m}=this.toString();let x="illegal-attr",S,v;if({lintConfig:S}=N,{computeEditInfo:v}=S,!(p!=null&&p.has(y))&&!(h!=null&&h.has(y))&&(g==="ext-attr"?p||h:!/\{\{[^{]+\}\}/u.test(y))&&(g==="ext-attr"&&!h||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(y)&&($==="meta"||$==="link"||!Xn.has(y)))||(y==="itemtype"||y==="itemid"||y==="itemref")&&!(k!=null&&k.hasAttr("itemscope"))){if(a===void 0)return!0;{const w=S.getSeverity(x,"unknown");if(w){const A=Q(c,d,x,"illegal-attribute-name",w);return v&&(A.suggestions=[ee(a,m)]),A}}}else if(y==="style"&&typeof T=="string"&&Zr.test(T)){if(a===void 0)return!0;{x="insecure-style";const w=S.getSeverity(x);return w&&Q(f,d,x,"insecure-style",w)}}else if(y==="tabindex"&&typeof T=="string"&&T!=="0"){if(a===void 0)return!0;{const w=S.getSeverity(x,"tabindex");if(w){const A=Q(f,d,x,"nonzero-tabindex",w);return v&&(A.suggestions=[ee(a,m),Oe(A,"0 tabindex","0")]),A}}}else if(typeof T=="string"&&((/^xmlns:[\w:.-]+$/u.test(y)||sl.has(y))&&el.test(T)||_&&(y==="href"||$==="img"&&y==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(T))){if(a===void 0)return!0;{const w=S.getSeverity(x,"value");return w&&Q(f,d,x,"illegal-attribute-value",w)}}else if(_&&g!=="ext-attr"){const w=Hn($,y),A=String(T).toLowerCase();if(w.length>0&&w.every(C=>C!==A)){if(a===void 0)return!0;{const C=S.getSeverity(x,"value");return C&&Q(f,d,x,"illegal-attribute-value",C)}}}return!1},o)}}),Si,il,nl,Ds,Zn=I({"src/attributes.ts"(){"use strict";var e,t,Fs,i;Y(),me(),ve(),G(),J(),ht(),Qu(),Si=r=>r.slice(0,-1),il=r=>`${Si(r)}-dirty`,nl=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Ds=(i=class extends z{constructor(n,l,o,u,a=[]){super(void 0,u,a,{});R(this,t);R(this,e);if(E(this,e,l),this.setAttribute("name",o),n){const d=/([^\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 c="",f=d.exec(n),g=0;const y=(()=>{c&&(super.insertAt(new qe(c,il(l),u,a,{})),c="")});for(;f;){const{index:$,0:k,1:_,2:T,3:p,4:h,5:m,6:x}=f;if(c+=n.slice(g,$),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(Ce(_).trim())){const S=h!=null?h:x,v=[p,m],w=new Ls(Si(l),o,_,T,S,v,u,a);y(),super.insertAt(w)}else c+=k;({lastIndex:g}=d),f=d.exec(n)}c+=n.slice(g),y()}}get type(){return b(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof Ls&&(!n||l.name===Lt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{parentNode:u,childNodes:a}=this,d=new Map,c=new Set,f=new ge(this,n),g=["no-ignored","no-duplicate"],{lintConfig:y}=N,{computeEditInfo:$,fix:k}=y,_=["closingTag","invalidAttributes","nonWordAttributes"].map(p=>y.getSeverity(g[0],p));if(_[0]&&j(this,t,Fs).call(this)){const p=Z(this,f,g[0],"attributes-of-closing-tag",_[0]);if($){const h=u.getAbsoluteIndex();p.suggestions=[ee(p),Wn(h)]}o.push(p)}for(const p of a)if(p instanceof Ls){const{name:h}=p;d.has(h)?(c.add(h),d.get(h).push(p)):d.set(h,[p])}else{const h=p.text().trim(),m=_[nl.test(h)?1:2];if(h&&m){const x=Q(p,f,g[0],"invalid-attribute",m);$&&(x.suggestions=[ee(x,0," ")]),o.push(x)}}const T=y.getSeverity(g[1],"attribute");if(T&&c.size>0)for(const p of c){const h=d.get(p).map(m=>{const x=m.getValue();return[m,x===!0?"":x]});Array.prototype.push.apply(o,h.map(([m,x],S)=>{const v=Q(m,f,g[1],N.msg("duplicate-attribute",p),T);if($||k){const w=ee(v);!x||h.slice(0,S).some(([,A])=>A===x)?v.fix=w:$&&(v.suggestions=[w])}return v}))}return o}}getAttribute(n){return n==="invalid"?j(this,t,Fs).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${j(this,t,Fs).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof qe?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Fs=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),Qa={};le(Qa,{PreToken:()=>Ja});var Ja,Ju=I({"src/pre.ts"(){"use strict";Me(),J(),Rt(),Ja=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),u=0,a="";for(;l&&o;)new je(l[0],t,s,!0),new je(o[0],t,s,!0),a+=`${e.slice(u,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,u=o.index+n+1,i.lastIndex=u,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=a+e.slice(u)}super(e,t,s,{}),this.setAttribute("stage",ke-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Gs,er=I({"src/multiLine/index.ts"(){"use strict";J(),Gs=class extends z{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
3
3
|
`)}text(){return super.text(`
|
|
4
4
|
`).replace(/\n\s*\n/gu,`
|
|
5
5
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
6
|
-
`})}}}}),
|
|
7
|
-
`).map(n=>r?n:
|
|
8
|
-
`,index:e.length},
|
|
9
|
-
`){
|
|
10
|
-
`)||(e=`${e.slice(0,
|
|
11
|
-
)`:""}(\s*)$`,"u")),
|
|
12
|
-
`))!=null?
|
|
13
|
-
`),r=new Set(t.protocol.split("|"));let n=!0,l=!1;for(const o of i){const d=o.trim();if(!(l||!d||d.startsWith("#"))){if(n){const a=o.indexOf("|"),u=a===-1?o:o.slice(0,a),{valid:c,ns:p}=this.normalizeTitle(u,0,{halfParsed:!0,temporary:!0});if(c&&p===6){const m=new At("imagemap",u,a===-1?void 0:o.slice(a+1),t,s);super.insertAt(m),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const a=o.indexOf("["),u=o.slice(a),c=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(u);if(c){if(this.normalizeTitle(c[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Sn(o.slice(0,a),c.slice(1),u.slice(u.indexOf("]]")+2),t,s));continue}}else if(u.startsWith("[//")||r.has(u.slice(1,u.indexOf(":")+1))||r.has(u.slice(1,u.indexOf("//")+2))){const p=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(p){super.insertAt(new Sn(o.slice(0,a),p.slice(1),u.slice(u.indexOf("]")+1),t,s));continue}}}}super.insertAt(new Bs(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ce(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=N,d=o.getSeverity(l,n?"link":"image");return d&&(n?s.push(...r.filter(a=>{const u=a.toString().trim();return a.is("noinclude")&&u&&!u.startsWith("#")}).map(a=>{const u=J(a,i,l,"invalid-imagemap-link",d);return o.computeEditInfo&&(u.suggestions=[Z(u,-1),Pe(u,"comment","# ")]),u})):s.push(Y(this,i,l,"imagemap-without-image",d))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Al,Oi,kl,$t,pa=C({"src/nowiki/comment.ts"(){"use strict";K(),gt(),Ze(),G(),pt(),Al=[Ye(!1),Ue("<!--")],$t=class extends(kl=Oe){constructor(t,s,i,r){super(t,i,r);Ne(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=N,r=i.getSeverity(s);if(!r)return[];const n=Y(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[Je(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},Oi=ae(kl),$t=le(Oi,0,"CommentToken",Al,$t),re(Oi,1,$t)}}),fa={};oe(fa,{CommentedToken:()=>ma});var ma,Ju=C({"src/commented.ts"(){"use strict";X(),pa(),ma=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),r=i!==-1&&e.indexOf("-->",i+4),n=0;for(;r!==!1&&r!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new $t(e.slice(i+4,r),!0,t,s)),n=r+3,i=e.indexOf("<!--",n),r=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),xa={};oe(xa,{NowikiToken:()=>va});var $l,_l,va,Xu=C({"src/nowiki/index.ts"(){"use strict";var e,An,s;Ke(),K(),G(),pt(),$l=at(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),_l=new Set(["languages","section","templatestyles"]),va=(s=class extends Oe{constructor(){super(...arguments);P(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,l="void-ext",{lintConfig:o}=N,d=o.getSeverity(l,n);if(d&&R(this,e,An).call(this)){const a=Y(this,{start:r},l,N.msg("nothing-in",n),d);return o.computeEditInfo&&(a.suggestions=[Z(a)]),[a]}return super.lint(r,$l(n))}}getAttribute(r){return r==="invalid"?R(this,e,An).call(this):super.getAttribute(r)}},e=new WeakSet,An=function(){const{name:r,firstChild:{data:n}}=this;return _l.has(r)&&!!n},s)}}),Tl,Bi,Cl,_t,ba=C({"src/tagPair/ext.ts"(){"use strict";K(),me(),G(),Dn(),X(),zn(),Jn(),Tl=[Hs()],_t=class extends(Cl=ot){get type(){return"ext"}constructor(e,t,s,i,r=N.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),d=new Ds(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),a={...r,ext:r.ext.filter(c=>c!==o),excludes:[...r.excludes],inExt:!0};let u;switch(o){case"tab":a.ext=a.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&a.excludes.push("heading"),u=new H(s,a,l);break;case"pre":{const{PreToken:c}=(Wu(),se(zo));u=new c(s,a,l);break}case"dynamicpagelist":{const{ParamTagToken:c}=(Vo(),se(Go));u=new c(n,s,a,l);break}case"inputbox":{const{InputboxToken:c}=(Hu(),se(Ko));u=new c(n,s,a,l);break}case"references":{const{NestedToken:c}=(Ii(),se(js));a.excludes.push("heading"),u=new c(s,n,["ref"],a,l);break}case"choose":{const{NestedToken:c}=(Ii(),se(js));u=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],a,l);break}case"combobox":{const{NestedToken:c}=(Ii(),se(js));u=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],a,l);break}case"gallery":{const{GalleryToken:c}=(Gu(),se(oa));u=new c(s,a,l);break}case"imagemap":{const{ImagemapToken:c}=(Qu(),se(ha));u=new c(s,a,l);break}case"hiero":{const{CommentedToken:c}=(Ju(),se(fa));u=new c(s,a,l);break}default:{const{NowikiToken:c}=(Xu(),se(xa));u=new c(s,a,l)}}u.setAttribute("name",o),u.type==="plain"&&(u.type="ext-inner"),super(e,d,u,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=N,r=new ce(this,e);if(this.name!=="nowiki"){const n=this.inHtmlAttrs(),l="parsing-order",o=n&&i.getSeverity(l,n===2?"ext":"templateInTable");o&&s.push(Y(this,r,l,"ext-in-html",o))}if(this.name==="ref"){let n="var-anchor",l=i.getSeverity(n,"ref");l&&this.closest("heading-title")&&s.push(Y(this,r,n,"variable-anchor",l)),n="nested-link",l=i.getSeverity(n,"ref"),l&&this.closest("link,ext-link-text")&&s.push(Y(this,r,n,"ref-in-link",l))}return s}}},Bi=ae(Cl),_t=le(Bi,0,"ExtToken",Tl,_t),re(Bi,1,_t)}}),wa={};oe(wa,{parseCommentAndExt:()=>vs});var qi,Il,$s,Nl,Wi,vs,Qs=C({"parser/commentAndExt.ts"(){"use strict";Ke(),fe(),Ru(),Pt(),Ou(),Bu(),ba(),pa(),qi="<onlyinclude>",Il="</onlyinclude>",{length:$s}=qi,Nl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return $o(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"))}),Wi=e=>{const t=e.indexOf(qi);return{i:t,j:e.indexOf(Il,t+$s)}},vs=(e,t,s,i)=>{if(i){let{i:o,j:d}=Wi(e);if(o!==-1&&d!==-1){let a="";const u=c=>{new Ee(c,t,s),a+=`\0${s.length-1}n`};for(;o!==-1&&d!==-1;){const c=`\0${s.length}e`;new Kt(e.slice(o+$s,d),t,s),o>0&&u(e.slice(0,o)),a+=c,e=e.slice(d+$s+1),{i:o,j:d}=Wi(e)}return e&&u(e),a}}const{ext:r}=t;let n=r,l=t;if(r.includes("translate")){n=r.filter(d=>d!=="translate"&&d!=="tvar"),l={...t,ext:n};const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,d=>(o.push(d),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(d,a,u)=>{const c=s.length;return new Bo(a,u&&Fe(u,o),l,s),`\0${c}g`}),e=Fe(e,o)}return e.replace(Nl[i?1:0](n),(o,d,a,u,c,p,m,b,_)=>{const A=s.length;let k="n";if(d)k="e",new _t(d,a,u,c,l,p,s);else if(o.startsWith("<!--")){k="c";const T=o.endsWith("-->");new $t(Fe(o,s,1).slice(4,T?-3:void 0),T,t,s)}else p?new Yt(p,m&&Fe(m,s,1),b&&Fe(b,s,1),_,t,s):new Ee(o,t,s,!0);return`\0${A}${k}`})}}}),Ll,Fl,El,jl,Ui,Rl,ts,Ku=C({"src/tag/html.ts"(){"use strict";var e,t;K(),me(),Dn(),G(),Oo(),Ll=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Fl=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"]),El=new Set(["strike","big","center","font","tt"]),jl=[Hs()],ts=(t=class extends(Rl=Hn){constructor(i,r,n,l,o,d){super(i,r,n,o,d);P(this,e);this.setAttribute("name",i.toLowerCase()),F(this,e,l)}get type(){return"html"}get selfClosing(){return w(this,e)}text(){const{closing:i,selfClosing:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){var n;{const l=super.lint(i,r),{name:o,parentNode:d,closing:a,selfClosing:u}=this,c=new ce(this,i),{lintConfig:p}=N,{computeEditInfo:m,fix:b}=p,_=this.inTableAttrs();let A="h1",k=p.getSeverity(A,"html");if(k&&o==="h1"&&!a){const h=Y(this,c,A,"<h1>",k);m&&(h.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),l.push(h)}if(A="parsing-order",k=_&&p.getSeverity(A,_===2?"html":"templateInTable"),k){const h=Y(this,c,A,"html-in-table",k);m&&_===2&&(h.suggestions=[Z(h)]),l.push(h)}if(A="obsolete-tag",k=p.getSeverity(A,o),k&&El.has(o)&&l.push(Y(this,c,A,"obsolete-tag",k)),A="bold-header",k=p.getSeverity(A,o),k&&(o==="b"||o==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const h=Y(this,c,A,"bold-in-header",k);m&&(h.suggestions=[Z(h)]),l.push(h)}const{html:[,T,f]}=this.getAttribute("config"),g=f.includes(o),x=T.includes(o),v=!g&&!x;if(A="unmatched-tag",a&&(u||g)||u&&v){if(k=p.getSeverity(A,a?"both":"selfClosing"),k){const h=Y(this,c,A,a?"closing-and-self-closing":"invalid-self-closing",k);if(m||b){const S=Pn(i),y={desc:N.msg("no-self-closing"),range:[h.endIndex-2,h.endIndex-1],text:""};x?m&&(h.suggestions=[S,y]):a?h.fix=g?S:y:m&&(h.suggestions=[y,Je(h.endIndex,`></${o}>`,-2)])}l.push(h)}}else if(!this.findMatchingTag()){const h=Y(this,c,A,a?"unmatched-closing":"unclosed-tag"),S=this.closest("magic-word");if(S&&Ll.has(S.name))k=p.getSeverity(A,"conditional");else if(a)k=p.getSeverity(A,"closing"),h.suggestions=[Z(h)];else{k=p.getSeverity(A,"opening");const y=d==null?void 0:d.childNodes;Fl.has(o)&&(y!=null&&y.slice(0,y.indexOf(this)).some($=>$.type==="html"&&$.name===o&&!$.findMatchingTag())&&(h.suggestions=[Je(i+1,"/")]),this.closest("heading-title")&&(h.rule="format-leakage",k=p.getSeverity("format-leakage",o)))}k&&(h.severity=k,l.push(h))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){{const n=super.json(void 0,r);return n.selfClosing=w(this,e),n}}},e=new WeakMap,t),Ui=ae(Rl),ts=le(Ui,0,"HtmlToken",jl,ts),re(Ui,1,ts)}}),ya={};oe(ya,{parseHtml:()=>Sa});var Pl,Sa,Yu=C({"parser/html.ts"(){"use strict";Jn(),Ku(),Pl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Sa=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const o of r){const d=Pl.exec(o),a=d==null?void 0:d[2],u=a==null?void 0:a.toLowerCase();if(!d||!t.htmlElements.has(u)){n+=`<${o}`;continue}const[,c,,p="",m,b]=d,{length:_}=s,A=new Ds(p,"html-attrs",u,t,s),k=A.hasAttr("itemprop");if(u==="meta"&&!(k&&A.hasAttr("content"))||u==="link"&&!(k&&A.hasAttr("href"))){n+=`<${o}`,s.length=_;continue}n+=`\0${s.length}x${b}`,new ts(a,A,c==="/",m==="/>",t,s)}return n}}}),Ol,Bl,Mi,ql,Tt,Aa=C({"src/table/base.ts"(){"use strict";Dn(),G(),X(),ht(),Jn(),Ol=e=>{const t=e.childNodes.map(i=>i.type==="text"?i.data.replace(/\|\|/gu,"{{!!}}").replace(/\|/gu,"{{!}}"):i.toString()).join(""),{childNodes:s}=N.parse(t,e.getAttribute("include"),2,e.getAttribute("config"));e.safeReplaceChildren(s)},Bl=[Hs(1)],Tt=class extends(ql=H){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new qe(t,"table-syntax",r,n),new Ds(i,"table-attrs",s,r,n))}escape(){for(const e of this.childNodes)e instanceof qe?Ol(e):e.escape()}},Mi=ae(ql),Tt=le(Mi,0,"TableBaseToken",Bl,Tt),re(Mi,1,Tt)}}),Wl,zi,Se,_s,Ht,Dt,qs,ka=C({"src/table/td.ts"(){"use strict";K(),me(),Mn(),G(),X(),Aa(),qs=class extends(zi=Tt,Wl=[Us(!1)],zi){constructor(e,t,s,i=[]){var o;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(n)&&(r=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),re(_s,5,this),De(this,Ht),De(this,Se,""),r&&([ku(this,Se)._]=r);const l=new H(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+pe(this,Se).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 cn(this,Ht,Dt).call(this).subtype}afterBuild(){pe(this,Se).includes("\0")&&ke(this,Se,this.buildFromStr(pe(this,Se),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+pe(this,Se)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+pe(this,Se)+s.text()}getGaps(e){return e===1?pe(this,Se).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ce(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=N,{computeEditInfo:l,fix:o}=n,d=["td","double"].map(a=>n.getSeverity(r,a));for(const a of this.lastChild.childNodes)if(a.type==="text"){const{data:u}=a;if(u.includes("|")){const c=u.includes("||"),p=d[c?1:0];if(p){const m=J(a,i,r,"pipe-in-table",p);if(l||o)if(c){const b={caption:"|+",td:"|",th:"!"}[this.subtype];m.fix=Pe(m,"newline",u.replace(/\|\|/gu,`
|
|
14
|
-
${
|
|
15
|
-
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){super.escape(),this.childNodes[1].toString()&&(
|
|
16
|
-
|}`,t){
|
|
6
|
+
`})}}}}),Xa,Xu=I({"src/paramLine.ts"(){"use strict";J(),Xa=class extends z{get type(){return"param-line"}}}}),Ka={};le(Ka,{ParamTagToken:()=>tr});var tr,Ya=I({"src/multiLine/paramTag.ts"(){"use strict";Y(),ve(),Qs(),G(),er(),Xu(),tr=class extends Gs{constructor(e,t,s=N.getConfig(),i=[],r){super(void 0,s,i,{}),t&&this.safeAppend(t.split(`
|
|
7
|
+
`).map(n=>r?n:xs(n,s,i,e)).map(n=>new Xa(n,s,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=N,i=s.getSeverity(t,this.name);if(!i)return[];const r=new ge(this,e),n=N.msg("invalid-parameter",this.name),l=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const u=o.childNodes.filter(({type:a})=>a!=="comment"&&a!=="include"&&a!=="noinclude");if(u.some(({type:a})=>a==="ext"))l.push(Q(o,r,t,n,i));else{const a=u.findIndex(({type:c})=>c!=="text"),d=u.slice(0,a===-1?void 0:a).map(String).join("");if(d&&!(a===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(d)){const c=Q(o,r,t,n,i);s.computeEditInfo&&(c.suggestions=[ee(c)]),l.push(c)}else{const c=o.lint(e,!1);c.length>0&&Array.prototype.push.apply(l,c)}}e+=o.toString().length+1}return l}}}}}),rl,Ai,ll,At,Za=I({"src/heading.ts"(){"use strict";var e,t,Es,i;Y(),Re(),ve(),ze(),G(),J(),gt(),rl=[We],At=(i=class extends(ll=z){constructor(n,l,o,u=[]){super(void 0,o,u);R(this,t);R(this,e);E(this,e,n);const a=new z(l[0],o,u);a.type="heading-title",a.setAttribute("stage",2);const d=new Ue(l[1],"heading-trail",o,u);this.append(a,d)}get type(){return"heading"}get level(){return b(this,e)}toString(n){const l=j(this,t,Es).call(this);return l+this.firstChild.toString(n)+l+this.lastChild.toString(n)}text(){const n=j(this,t,Es).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()===2:n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{firstChild:u,level:a}=this,d=u.toString(),c=d.startsWith("="),f=c||d.endsWith("="),g=new ge(this,n),y=this.inHtmlAttrs(),$=["h1","unbalanced-header","format-leakage"],{lintConfig:k}=N,{computeEditInfo:_,fix:T}=k,p=$.map(h=>k.getSeverity(h,"apostrophe"));if(p[0]&&this.level===1){const h=Q(u,g,$[0],"<h1>",p[0]);_&&!f&&(h.suggestions=[Oe(h,"h2",`=${d}=`)]),o.push(h)}if(p[1]&&f){const h=N.msg("unbalanced-in-section-header",'"="'),m=Q(u,g,$[1],h,p[1]);if(!(!_||d==="="))if(c){const[x]=/^=+/u.exec(d),S=a+x.length;m.suggestions=[{desc:`h${a}`,range:[m.startIndex,m.startIndex+x.length],text:""}],S<7&&m.suggestions.push({desc:`h${S}`,range:[m.endIndex,m.endIndex],text:x})}else{const x=/[^=](=+)$/u.exec(d)[1],S=a+x.length;m.suggestions=[{desc:`h${a}`,range:[m.endIndex-x.length,m.endIndex],text:""}],S<7&&m.suggestions.push({desc:`h${S}`,range:[m.startIndex,m.startIndex],text:x})}o.push(m)}if(y){const h="parsing-order",m=k.getSeverity(h,y===2?"heading":"templateInTable");m&&o.push(Z(this,g,h,"header-in-html",m))}if(p[2]){const h=this.getRootNode().toString(),m=u.childNodes.filter(Js("quote")),x=m.filter(({bold:v})=>v),S=m.filter(({italic:v})=>v);if(x.length%2){const v=Q(x[x.length-1],{...g,start:n+a,left:g.left+a},$[2],N.msg("unbalanced-in-section-header","bold-apostrophes"),p[2]);if(_||T){const w=n+a+d.length,A=ee(v);h.slice(v.endIndex,w).trim()?_&&(v.suggestions=[A,Xe(w,"'''")]):x.length===1&&S.length===0?v.fix=A:_&&(v.suggestions=[A])}o.push(v)}if(S.length%2){const v=Q(S[S.length-1],{start:n+a},$[2],N.msg("unbalanced-in-section-header","italic-apostrophes"),p[2]);if(_||T){const w=n+a+d.length;h.slice(v.endIndex,w).trim()?_&&(v.suggestions=[Xe(w,"''")]):S.length===1&&x.length===0?v.fix=ee(v):_&&(v.suggestions=[ee(v)])}o.push(v)}}return o}}print(){const n=j(this,t,Es).call(this);return super.print({pre:n,sep:n})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return o.level=this.level,o}}},e=new WeakMap,t=new WeakSet,Es=function(){return"=".repeat(this.level)},i),Ai=ae(ll),At=re(Ai,0,"HeadingToken",rl,At),ne(Ai,1,At)}}),al,ki,ol,Yt,Ku=I({"src/hidden.ts"(){"use strict";pt(),J(),al=[Ye()],Yt=class extends(ol=z){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},ki=ae(ol),Yt=re(ki,0,"HiddenToken",al,Yt),ne(ki,1,Yt)}}),ul,$i,dl,Zt,Yu=I({"src/arg.ts"(){"use strict";var e,eo,s;me(),Y(),ve(),Ze(),Ms(),ze(),G(),J(),ht(),Ku(),ul=[We,He("{{{"),ms()],Zt=(s=class extends(dl=z){constructor(r,n,l=[]){super(void 0,n,l,{});R(this,e);for(let o=0;o<r.length;o++){const u=r[o];if(o===0){const a=new qe(u,"arg-name",n,l,{});super.insertAt(a)}else if(o>1){const a=new Yt(u,n,l);super.insertAt(a)}else{const a=new z(u,n,l);a.type="arg-default",a.setAttribute("stage",2),super.insertAt(a)}}}get type(){return"arg"}get default(){var r,n;return(n=(r=this.childNodes[1])==null?void 0:r.text())!=null?n:!1}toString(r){return`{{{${super.toString(r,"|")}}}}`}text(){return`{{{${ct(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){j(this,e,eo).call(this),super.afterBuild()}lint(r=this.getAbsoluteIndex(),n){{const{childNodes:[l,o,...u]}=this;l.setAttribute("aIndex",r+3);const a=l.lint(r+3,n);if(o){const $=r+4+l.toString().length;o.setAttribute("aIndex",$);const k=o.lint($,n);k.length>0&&Array.prototype.push.apply(a,k)}const d=["no-ignored","no-arg"],{lintConfig:c}=N,{computeEditInfo:f}=c,g=new ge(this,r),y=d.map($=>c.getSeverity($,"arg"));if(y[0]&&u.length>0&&Array.prototype.push.apply(a,u.map($=>{const k=Q($,g,d[0],"invisible-triple-braces",y[0]);return k.startIndex--,k.startCol--,f&&(k.suggestions=[ee(k),Et(k.startIndex,"{{!}}")]),k})),y[1]&&!this.getAttribute("include")){const $=Z(this,g,d[1],"unexpected-argument",y[1]);f&&o&&($.suggestions=[Oe($,"expand",o.text())]),a.push($)}return a}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(r,n=this.getAbsoluteIndex()){{const l=super.json(void 0,n);return l.default=this.default,l}}},e=new WeakSet,eo=function(){this.setAttribute("name",this.firstChild.text().trim())},s),$i=ae(dl),Zt=re($i,0,"ArgToken",ul,Zt),ne($i,1,Zt)}}),to={};le(to,{parseBraces:()=>Vs});var cl,_i,As,Ti,Ci,Ii,hl,Ni,Vs,sr=I({"parser/braces.ts"(){"use strict";Ke(),me(),Za(),Oa(),Yu(),cl={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},_i=String.raw`\[(?!\[)`,As=String.raw`\n(?![=\0])`,Ti=String.raw`|\{{2,}`,Ci=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Ii=ot(e=>new RegExp(e,"gmu")),hl=new RegExp(String.raw`\{\{((?:[^\n{}[]|${_i}|${As})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${As})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${_i}|${As})*\}-`,"gu"),Ni=e=>{const t=Lt(Ce(e));return Ci.has(t)?Ci.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Vs=(e,t,s)=>{var y,$,k,_,T;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,n=[],l=[],o=(p,h,m,x)=>{h[h.length-1].push(Ee(p.slice(m,x),l))};let u;do u!==void 0&&(e=u),u=e.replace(hl,(p,h,m)=>{if(h!==void 0||typeof m=="string")try{const{length:x}=s,S=(h!=null?h:m).split("|");return new rt(Ee(S[0],l),S.slice(1).map(v=>{const w=v.indexOf("=");return(w===-1?[v]:[v.slice(0,w),v.slice(w+1)]).map(A=>Ee(A,l))}),t,s),`\0${x}${Ni(S[0])}`}catch(x){if(!(x instanceof SyntaxError)||x.message!=="Invalid template name")throw x}return l.push(Ee(p,l)),`\0${l.length-1}`});while(u!==e);e=u;const a=e.lastIndexOf("}}")-e.length;let d=a+e.length!==-1,c=Ii(i+(d?Ti:"")),f=c.exec(e),g;for(;f||g!==void 0&&g<=e.length&&(($=(y=n[n.length-1])==null?void 0:y[0])!=null&&$.startsWith("="));){if(f!=null&&f[1]){const[,{length:B}]=f;f[0]=f[0].slice(B),f.index+=B}const{0:p,index:h}=f!=null?f:{0:`
|
|
8
|
+
`,index:e.length},m=(k=n.pop())!=null?k:{},{0:x,index:S,parts:v,findEqual:w,pos:A}=m,C=p==="="&&w;if(p==="]]"||p==="}-")g=h+2;else if(p===`
|
|
9
|
+
`){g=h+1;const{pos:B,findEqual:q}=(_=n[n.length-1])!=null?_:{};if(B===void 0||q||Ce(e.slice(B,S))!==""){const O=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(S,h));O&&(O[2]=Ee(O[2],l),O[2].includes(`
|
|
10
|
+
`)||(e=`${e.slice(0,S)}\0${s.length}h${e.slice(h)}`,g=S+4+String(s.length).length,new At(O[1].length,O.slice(2),t,s)))}}else if(p==="|"||C)g=h+1,o(e,v,A,h),p==="|"&&v.push([]),m.pos=g,m.findEqual=p==="|",n.push(m);else if(p.startsWith("}}")){const B=p.slice(0,Math.min(x.length,3)),q=x.length-B.length,{length:O}=s;g=h+B.length,o(e,v,A,h);let W=!1,F="t";if(B.length===3){const P=v.map(M=>M.join("=")),U=P.length>1&&Ce(P[1]).trim();new Zt(P,t,s),U&&U.endsWith(":")&&r.includes(U.slice(0,-1).toLowerCase())&&(F="s")}else try{new rt(v[0][0],v.slice(1),t,s),F=Ni(v[0][0])}catch(P){if(P instanceof SyntaxError&&P.message==="Invalid template name")W=!0;else throw P}W||(e=`${e.slice(0,S+q)}\0${O}${F}${e.slice(g)}`,g=S+q+3+String(O).length,q>1?n.push({0:x.slice(0,q),index:S,pos:S+q,parts:[[]]}):q===1&&e[S-1]==="-"&&n.push({0:"-{",index:S-1,pos:S+1,parts:[[]]}))}else g=h+p.length,p.startsWith("{")&&(f.pos=g,f.parts=[[]]),n.push(..."0"in m?[m]:[],f);let L=n[n.length-1];if(d&&a+e.length<g)for(d=!1;(T=L==null?void 0:L[0])!=null&&T.startsWith("{");)n.pop(),L=n[n.length-1];c=Ii(i+(d?Ti:"")+(L?`|${cl[L[0][0]]}${L.findEqual?"|=":""}`:"")),c.lastIndex=g,f=c.exec(e)}return Ee(e,l)}}}),so={};le(so,{InputboxToken:()=>io});var io,Zu=I({"src/multiLine/inputbox.ts"(){"use strict";Qs(),sr(),G(),Ya(),io=class extends tr{constructor(e,t,s=N.getConfig(),i=[]){const r=Symbol("InputboxToken"),n=s.excludes.includes("heading")?s:{...s,excludes:[...s.excludes,"heading"]},{length:l}=i;i.push(r),t&&(t=xs(t,n,i,e)),t&&(t=Vs(t,n,i)),i.splice(l,1),super(e,t,n,i,{})}}}}),js={};le(js,{NestedToken:()=>no});var gl,pl,no,Li=I({"src/nested.ts"(){"use strict";var e,t,s;Y(),ve(),Qs(),sr(),G(),J(),$o(),Rt(),gl=new Set(["comment","include","arg","template","magic-word"]),pl=[!1,!0].map(i=>{const r=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),no=(s=class extends z{constructor(r,n,l,o,u=[]){if(typeof n=="boolean"){const a=Symbol("NestedToken"),{length:d}=u;u.push(a),r&&(r=xs(r,o,u,n)),r&&(r=Vs(r,o,u)),u.splice(d,1)}else r&&(r=r.replace(n,(a,d,c,f,g)=>{const y=`\0${u.length+1}e`;return new Tt(d,c,f,g,o,!1,u),y}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(a,d,c)=>(new je(c,o,u),`${d}\0${u.length}n`)));super(r,o,u);R(this,e);R(this,t);E(this,e,[...l]),E(this,t,n)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="no-ignored",{lintConfig:u}=N,a=u.getSeverity(o,this.name);if(!a)return l;const d=new ge(this,r),c=typeof b(this,t)=="boolean"?pl[b(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(f=>{const{type:g,name:y}=f;if(g==="ext")return!b(this,e).includes(y);if(gl.has(g))return!1;const $=f.toString().trim();return $&&!c.test($)}).map(f=>{const g=Q(f,d,o,N.msg("invalid-content",this.name),a);return u.computeEditInfo&&(g.suggestions=[ee(g),Un(g,f.toString())]),g})]}}},e=new WeakMap,t=new WeakMap,s)}});function fl(e,t,s,i,r){t=Ce(t).trim();let n=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!n&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{if(n){if(ro(s.protocol).test(n))return lo(s.protocol).test(n)&&t;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const l=N.normalizeTitle(n,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0,page:""});return l.valid&&l}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(n);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(n)>0;default:return!!n&&!isNaN(n)}}var ro,lo,ml,xl,Os,vl,ao,ed=I({"src/imageParameter.ts"(){"use strict";var e,t,oo,r;Ke(),me(),Y(),Me(),Re(),G(),J(),ro=ot(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),lo=ot(n=>new RegExp(String.raw`^(?:(?:${n}|//)${It}|\0\d+m\x7F)${Nt}$`,"iu")),ml=ot(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")),xl=new Set(["alt","link","lang","page","caption"]),Os=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),vl=n=>{if(n)n.startsWith("//")&&(n=`https:${n}`);else return n;return new URL(n).href},ao=(r=class extends z{constructor(l,o,u,a){var n=(...i)=>(super(...i),R(this,t),R(this,e,""),this);let d;const c=Object.entries(u.img).map(([g,y])=>[g,y,ml(g)]),f=c.find(([,g,y])=>(d=y.exec(l),d&&(d.length!==4||fl(g,d[2],u,!0,o)!==!1)));if(f&&d){d.length===3?(n(void 0,u,a),E(this,e,l)):(n(d[2],u,a,{}),E(this,e,d[1]+f[0]+d[3])),this.setAttribute("name",f[1]),f[1]==="alt"&&this.setAttribute("stage",ke-1);return}n(l,u.excludes.includes("list")?u:{...u,excludes:[...u.excludes,"list"]},a),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get thumb(){return this.name==="manualthumb"?this.normalizeTitle(`File:${super.text().trim()}`,6,{page:""}):void 0}get link(){{if(this.name!=="link")return;const l=super.text().trim();return be.run(()=>{const o=new z(l,this.getAttribute("config"));return o.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(o.toString())?l:fl("link",l,this.getAttribute("config"))})}}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!xl.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return b(this,e)?b(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return b(this,e)?b(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,b(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){{const u=super.lint(l,o),{lintConfig:a}=N,{computeEditInfo:d,fix:c}=a,{link:f,name:g}=this,y=g==="width"&&this.getValue();if(g==="invalid"||y&&y.endsWith("px")){const $="invalid-gallery",k=a.getSeverity($,"parameter");if(k){const _=Z(this,{start:l},$,"invalid-image-parameter",k);(d||c)&&(_.fix=y?ee(_,0,y):ee(_,-1)),u.push(_)}}else if(g==="link"){if(typeof f=="string"){const $="invalid-url",k=a.getSeverity($);if(k&&!this.querySelector("magic-word"))try{vl(f)}catch{u.push(Z(this,{start:l},$,"invalid-url",k))}}else if(f.encoded){const $="url-encoding",k=a.getSeverity($,"file");if(k){const _=Z(this,{start:l},$,"unnecessary-encoding",k);(d||c)&&(_.fix=qn(_,this)),u.push(_)}}}else if(g==="manualthumb"){const $="invalid-gallery",k=a.getSeverity($,"thumb");if(k&&!this.querySelector("arg,magic-word,template")){const{valid:_,ns:T,extension:p}=this.thumb;(!_||T!==6||!Os.has(p))&&u.push(Z(this,{start:l},$,"invalid-thumb",k))}}return u}}getValue(){return this.name==="invalid"?this.text():j(this,t,oo).call(this)||super.text()}print(){return b(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${b(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,oo=function(){return b(this,e)&&!b(this,e).includes("$1")},r)}}),Fi,bl,yl,Ei,ji,wl,Ri,ir,uo=I({"src/link/file.ts"(){"use strict";Y(),ve(),G(),zs(),ed(),Fi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),bl=new Set(["arg"]),yl=new Set(["template","magic-word"]),Ei=new Set(["left","right","center","none"]),ji=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),wl=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),r=0,n=0;for(;i;){const{0:l,index:o}=i;l!=="|"?r+=l==="-{"?1:-1:r===0&&(s.push(e.slice(n,o)),{lastIndex:n}=t),i=t.exec(e)}return s.push(e.slice(n)),s},Ri=(e,t)=>e.filter(({childNodes:s})=>!s.some(i=>i.text().trim()&&t.has(i.type))),ir=class extends Ve{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,i=[],r="|"){super(e,void 0,s,i,r);const{extension:n}=this.getTitle(!0,!0);this.safeAppend(wl(t).map(l=>new ao(l,n,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r=Ri(this.getAllArgs(),bl),n=[...new Set(r.map(({name:x})=>x))],l=n.filter(x=>Fi.has(x)),o=n.filter(x=>Ei.has(x)),u=n.filter(x=>ji.has(x)),[a]=l,d=a==="framed"||a==="manualthumb",c=new ge(this,e),{lintConfig:f}=N,{computeEditInfo:g,fix:y}=f,{ns:$,extension:k}=this.getAttribute("title"),{firstChild:_}=this;let T="nested-link",p=f.getSeverity(T,"file");if(p&&Os.has(k)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const x=Z(this,c,T,"link-in-extlink",p);if(g||y){const S=this.getArg("link");if(S){const v=e+S.getRelativeIndex();x.fix={desc:N.msg("delink"),range:[v,v+S.toString().length],text:"link="}}else x.fix=Ws(x.endIndex-2,"delink","|link=")}i.push(x)}if(T="invalid-gallery",p=f.getSeverity(T,"extension"),p&&$===6&&!k&&!_.querySelector("arg,magic-word,template")&&i.push(Z(this,c,T,"missing-extension",p)),p=f.getSeverity(T,"parameter"),p&&d)for(const x of r.filter(({name:S})=>S==="width")){const S=Q(x,c,T,"invalid-image-parameter",p);(g||y)&&(S.fix=ee(S,-1)),i.push(S)}if(r.length===n.length&&l.length<2&&o.length<2&&u.length<2)return i;T="no-duplicate";const h=["unknownImageParameter","imageParameter"].map(x=>f.getSeverity(T,x)),m=(x,S,v,w=!0)=>x.map(A=>{if(p=h[Number(typeof w=="function"?w(A):w)],!p)return!1;const C=Q(A,c,T,N.msg(`${S}-image-parameter`,v),p);return g&&(C.suggestions=[ee(C,-1)]),C}).filter(A=>A!==!1);for(const x of n){if(x==="invalid"||x==="width"&&d)continue;const S=x==="caption";let v=r.filter(({name:w})=>w===x);if(S&&(v=[...v.slice(0,-1).filter(w=>w.text()),...v.slice(-1)]),v.length>1){let w=!S||!k||Os.has(k);if(S&&w){const A=Ri(v,yl);w=A.length>1&&(C=>A.includes(C))}Array.prototype.push.apply(i,m(v,"duplicate",x,w))}}return l.length>1&&Array.prototype.push.apply(i,m(r.filter(({name:x})=>Fi.has(x)),"conflicting","frame")),o.length>1&&Array.prototype.push.apply(i,m(r.filter(({name:x})=>Ei.has(x)),"conflicting","horizontal-alignment")),u.length>1&&Array.prototype.push.apply(i,m(r.filter(({name:x})=>ji.has(x)),"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),{extension:i}=this;return i&&(s.extension=i),s}}}}}),Sl,Pi,Al,kt,co=I({"src/link/galleryImage.ts"(){"use strict";var e,Sn,s;Y(),Me(),Ze(),G(),J(),uo(),Sl=[He("")],kt=(s=class extends(Al=ir){constructor(r,n,l,o,u=[]){let a;if(l!==void 0){const{length:d}=u;a=new z(l,o,u);for(let c=0;c<ke-1;c++)a.parseOnce();u.splice(d,1)}super(n,a==null?void 0:a.toString(),o,u);R(this,e);Ne(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${r}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(r){const n=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),n?0:6,{halfParsed:!0,temporary:r,decode:!n,page:""})}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="invalid-gallery",{lintConfig:u}=N,a=u.getSeverity(o,"image");if(a&&j(this,e,Sn).call(this)){const d=Z(this,{start:r},o,"invalid-gallery",a);u.computeEditInfo&&(d.suggestions=[Ws(r,"prefix","File:")]),l.push(d)}return l}}getAttribute(r){return r==="invalid"?j(this,e,Sn).call(this):super.getAttribute(r)}},e=new WeakSet,Sn=function(){const{ns:r}=this.getAttribute("title");return r!==6},s),Pi=ae(Al),kt=re(Pi,0,"GalleryImageToken",Sl,kt),ne(Pi,1,kt)}}),Bs,ho=I({"src/nowiki/commentLine.ts"(){"use strict";Rt(),Bs=class extends je{}}}),go={};le(go,{GalleryToken:()=>po});var po,td=I({"src/multiLine/gallery.ts"(){"use strict";var e,fo,An,i;Y(),G(),er(),co(),ho(),po=(i=class extends Gs{constructor(n,l,o=[]){var u;super(void 0,l,o,{});R(this,e);for(const a of(u=n==null?void 0:n.split(`
|
|
12
|
+
`))!=null?u:[]){const d=/^([^|]+)(?:\|(.*))?/u.exec(a);if(!d){super.insertAt(a.trim()?new Bs(a,l,o):a);continue}const[,c,f]=d;j(this,e,fo).call(this,c)?super.insertAt(new kt("gallery",c,f,l,o)):super.insertAt(new Bs(a,l,o))}}get widths(){return j(this,e,An).call(this,"widths")}get heights(){return j(this,e,An).call(this,"heights")}lint(n=this.getAbsoluteIndex(),l){{const{top:o,left:u}=this.getRootNode().posFromIndex(n),a=[],d="no-ignored",{lintConfig:c}=N,f=["Image","NoImage","Comment"].map(g=>c.getSeverity(d,`gallery${g}`));for(let g=0;g<this.length;g++){const y=this.childNodes[g],$=y.toString(),{length:k}=$,_=$.trim(),{type:T}=y,p=o+g,h=g?0:u;if(y.setAttribute("aIndex",n),T==="noinclude"&&_&&!/^<!--.*-->$/u.test(_)){let[m]=f;if(_.startsWith("|")?[,m]=f:(_.startsWith("<!--")||_.endsWith("-->"))&&([,,m]=f),m){const x=n+k,S={rule:d,message:N.msg("invalid-content","gallery"),severity:m,startIndex:n,endIndex:x,startLine:p,endLine:p,startCol:h,endCol:h+k};c.computeEditInfo&&(S.suggestions=[ee(S),Un(S,$)]),a.push(S)}}else if(T!=="noinclude"&&T!=="text"){const m=y.lint(n,l);m.length>0&&Array.prototype.push.apply(a,m)}n+=k+1}return a}}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return Object.assign(o,{widths:this.widths,heights:this.heights}),o}}},e=new WeakSet,fo=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},An=function(n){var l,o;{const u=(l=this.parentNode)==null?void 0:l.getAttr(n),a=typeof u=="string"&&((o=/^(\d+)\s*(?:px)?$/u.exec(u))==null?void 0:o[1]);return a&&Number(a)||120}},i)}}),nr,mo=I({"src/link/index.ts"(){"use strict";Ke(),Y(),G(),zs(),nr=class extends Ve{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():cs(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",{lintConfig:r}=N,n=r.getSeverity(i);if(n&&this.closest("ext-link-text")){const l=Z(this,{start:e},i,"link-in-extlink",n);(r.computeEditInfo||r.fix)&&(l.fix=Oe(l,"delink",this.innerText)),s.push(l)}return s}}}}}),kl,$l,ps,rr=I({"src/magicLink.ts"(){"use strict";var e,t,kn,i;Y(),me(),ve(),G(),J(),kl=String.raw`(?:[${Je}\t]| |�*160;|&#[xX]0*[aA]0;)`,$l=new RegExp(`${kl}+`,"gu"),ps=(i=class extends z{constructor(n,l="free-ext-link",o=N.getConfig(),u){super(n,o,u,{});R(this,t);R(this,e);E(this,e,l)}get type(){return b(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let l=ct(this.childNodes.map(o=>{const{type:u}=o,a=String(o.name);return u==="magic-word"&&n.has(a)?n.get(a):o}));return this.type==="magic-link"&&(l=l.replace($l," ")),l}get link(){const{innerText:n}=this;return this.type==="magic-link"?n.startsWith("ISBN")?`ISBN ${n.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:n:_a(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),u=new ge(this,n),{lintConfig:a}=N,{type:d,childNodes:c}=this;if(d==="magic-link"){const $="invalid-isbn",k=a.getSeverity($);return k&&j(this,t,kn).call(this)&&o.push(Z(this,u,$,"invalid-isbn",k)),o}let f="invalid-url",g=a.getSeverity(f);if(g&&!this.querySelector("magic-word"))try{this.getUrl()}catch{o.push(Z(this,u,f,"invalid-url",g))}const y=d==="ext-link-url";if(f="unterminated-url",g=a.getSeverity(f,y?"pipe":"punctuation"),g){const $=y?/\|/u:/[,;。:!?()]+/u,k=c.find(_=>_.type==="text"&&$.test(_.data));if(k){const{data:_}=k,T=Q(k,u,f,N.msg("in-url",y?'"|"':"full-width-punctuation"),g);if(a.computeEditInfo){const{index:p,0:h}=$.exec(_),m=T.startIndex+p;T.suggestions=y?[gs(m,1)]:[gs(m),{desc:N.msg("encode"),range:[m,m+h.length],text:encodeURI(h)}]}o.push(T)}}return o}}getUrl(n){{const{type:l}=this;let{link:o}=this;if(l==="magic-link"){if(o.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${o.slice(5)}`,-1,{temporary:!0}).getUrl(n);o=o.startsWith("RFC")?`https://datatracker.ietf.org/doc/html/rfc${o.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${o.slice(5)}`}else o.startsWith("//")&&(o=`https:${o}`);return new URL(o)}this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?j(this,t,kn).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,kn=function(){if(this.type==="magic-link"){const{link:n}=this;if(n.startsWith("ISBN")){const l=[...n.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,u,a)=>o+u*(10-a),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,u,a)=>o+u*(a%2?3:1),0)%10!==0)}}return!1},i)}}),_l,Oi,Tl,$t,xo=I({"src/extLink.ts"(){"use strict";var e,t;Me(),Y(),Ze(),G(),J(),rr(),_l=[He("[")],$t=(t=class extends(Tl=z){constructor(i,r="",n="",l,o=[]){super(void 0,l,o,{});R(this,e);const u=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new ps(i,"ext-link-url",l,o);if(this.insertAt(u),E(this,e,r),n){const a=new z(n,l,o,{});a.type="ext-link-text",a.setAttribute("stage",ke-1),this.insertAt(a)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${b(this,e)}]`:`[${super.toString(i,b(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return b(this,e).length}lint(i=this.getAbsoluteIndex(),r){{const n=super.lint(i,r),l="var-anchor",o=N.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.closest("heading-title")&&n.push(Z(this,{start:i},l,"variable-anchor",o)),n}}print(){return super.print(this.length===1?{pre:"[",post:`${b(this,e)}]`}:{pre:"[",sep:b(this,e),post:"]"})}},e=new WeakMap,t),Oi=ae(Tl),$t=re(Oi,0,"ExtLinkToken",_l,$t),ne(Oi,1,$t)}}),$n,sd=I({"src/imagemapLink.ts"(){"use strict";J(),Rt(),mo(),xo(),$n=class extends z{get type(){return"imagemap-link"}constructor(e,t,s,i,r=[]){super(void 0,i,r),this.append(e,t.length===2?new nr(...t,i,r):new $t(...t,i,r),new je(s,i,r))}}}}),vo={};le(vo,{ImagemapToken:()=>bo});var bo,id=I({"src/multiLine/imagemap.ts"(){"use strict";Y(),Re(),ve(),G(),er(),ho(),co(),sd(),bo=class extends Gs{get image(){return this.childNodes.find(Js("imagemap-image"))}constructor(e,t=N.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
|
|
13
|
+
`),r=new Set(t.protocol.split("|"));let n=!0,l=!1;for(const o of i){const u=o.trim();if(!(l||!u||u.startsWith("#"))){if(n){const a=o.indexOf("|"),d=a===-1?o:o.slice(0,a),{valid:c,ns:f}=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0,page:""});if(c&&f===6){const g=new kt("imagemap",d,a===-1?void 0:o.slice(a+1),t,s);super.insertAt(g),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const a=o.indexOf("["),d=o.slice(a),c=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(d);if(c){if(this.normalizeTitle(c[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new $n(o.slice(0,a),c.slice(1),d.slice(d.indexOf("]]")+2),t,s));continue}}else if(d.startsWith("[//")||r.has(d.slice(1,d.indexOf(":")+1))||r.has(d.slice(1,d.indexOf("//")+2))){const f=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(d);if(f){super.insertAt(new $n(o.slice(0,a),f.slice(1),d.slice(d.indexOf("]")+1),t,s));continue}}}}super.insertAt(new Bs(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ge(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=N,u=o.getSeverity(l,n?"link":"image");return u&&(n?Array.prototype.push.apply(s,r.filter(a=>{const d=a.toString().trim();return a.is("noinclude")&&d&&!d.startsWith("#")}).map(a=>{const d=Q(a,i,l,"invalid-imagemap-link",u);return o.computeEditInfo&&(d.suggestions=[ee(d,-1),Oe(d,"comment","# ")]),d})):s.push(Z(this,i,l,"imagemap-without-image",u))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Cl,Bi,Il,_t,yo=I({"src/nowiki/comment.ts"(){"use strict";Y(),pt(),Ze(),G(),ft(),Cl=[Ye(!1),He("<!--")],_t=class extends(Il=Be){constructor(t,s,i,r){super(t,i,r);Ne(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=N,r=i.getSeverity(s);if(!r)return[];const n=Z(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[Xe(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},Bi=ae(Il),_t=re(Bi,0,"CommentToken",Cl,_t),ne(Bi,1,_t)}}),wo={};le(wo,{CommentedToken:()=>So});var So,nd=I({"src/commented.ts"(){"use strict";J(),yo(),So=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),r=i!==-1&&e.indexOf("-->",i+4),n=0;for(;r!==!1&&r!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new _t(e.slice(i+4,r),!0,t,s)),n=r+3,i=e.indexOf("<!--",n),r=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Ao={};le(Ao,{NowikiToken:()=>ko});var Nl,Ll,ko,rd=I({"src/nowiki/index.ts"(){"use strict";var e,_n,s;Ke(),Y(),G(),ft(),Nl=ot(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),Ll=new Set(["languages","section","templatestyles"]),ko=(s=class extends Be{constructor(){super(...arguments);R(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,{lintConfig:l}=N;let o="void-ext",u=l.getSeverity(o,n);if(u&&j(this,e,_n).call(this)){const d=Z(this,{start:r},o,N.msg("nothing-in",n),u);return l.computeEditInfo&&(d.suggestions=[ee(d)]),[d]}return super.lint(r,Nl(n))}}getAttribute(r){return r==="invalid"?j(this,e,_n).call(this):super.getAttribute(r)}},e=new WeakSet,_n=function(){const{name:r,firstChild:{data:n}}=this;return Ll.has(r)&&!!n},s)}}),Fl,qi,El,Tt,$o=I({"src/tagPair/ext.ts"(){"use strict";Y(),ve(),G(),Jn(),J(),Vn(),Zn(),Fl=[Hs()],Tt=class extends(El=lt){get type(){return"ext"}constructor(e,t,s,i,r=N.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),u=new Ds(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),a={...r,ext:r.ext.filter(c=>c!==o),excludes:[...r.excludes],inExt:!0};let d;switch(o){case"tab":a.ext=a.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&a.excludes.push("heading"),d=new z(s,a,l);break;case"pre":{const{PreToken:c}=(Ju(),se(Qa));d=new c(s,a,l);break}case"dynamicpagelist":{const{ParamTagToken:c}=(Ya(),se(Ka));d=new c(n,s,a,l);break}case"inputbox":{const{InputboxToken:c}=(Zu(),se(so));d=new c(n,s,a,l);break}case"references":{const{NestedToken:c}=(Li(),se(js));a.excludes.push("heading"),d=new c(s,n,["ref"],a,l);break}case"choose":{const{NestedToken:c}=(Li(),se(js));d=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],a,l);break}case"combobox":{const{NestedToken:c}=(Li(),se(js));d=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],a,l);break}case"gallery":{const{GalleryToken:c}=(td(),se(go));d=new c(s,a,l);break}case"imagemap":{const{ImagemapToken:c}=(id(),se(vo));d=new c(s,a,l);break}case"hiero":{const{CommentedToken:c}=(nd(),se(wo));d=new c(s,a,l);break}default:{const{NowikiToken:c}=(rd(),se(Ao));d=new c(s,a,l)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,u,d,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=N,r=new ge(this,e);if(this.name!=="nowiki"){const n=this.inHtmlAttrs(),l="parsing-order",o=n&&i.getSeverity(l,n===2?"ext":"templateInTable");o&&s.push(Z(this,r,l,"ext-in-html",o))}if(this.name==="ref"){let n="var-anchor",l=i.getSeverity(n,"ref");l&&this.closest("heading-title")&&s.push(Z(this,r,n,"variable-anchor",l)),n="nested-link",l=i.getSeverity(n,"ref"),l&&this.closest("link,ext-link-text")&&s.push(Z(this,r,n,"ref-in-link",l))}return s}}},qi=ae(El),Tt=re(qi,0,"ExtToken",Fl,Tt),ne(qi,1,Tt)}}),_o={};le(_o,{parseCommentAndExt:()=>xs});var Wi,jl,ks,Rl,Ui,xs,Qs=I({"parser/commentAndExt.ts"(){"use strict";Ke(),me(),Hu(),Rt(),Gu(),Vu(),$o(),yo(),Wi="<onlyinclude>",jl="</onlyinclude>",{length:ks}=Wi,Rl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return ot(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Ui=e=>{const t=e.indexOf(Wi);return{i:t,j:e.indexOf(jl,t+ks)}},xs=(e,t,s,i)=>{if(i){let{i:u,j:a}=Ui(e);if(u!==-1&&a!==-1){let d="";const c=f=>{new je(f,t,s),d+=`\0${s.length-1}n`};for(;u!==-1&&a!==-1;){const f=`\0${s.length}e`;new Xt(e.slice(u+ks,a),t,s),u>0&&c(e.slice(0,u)),d+=f,e=e.slice(a+ks+1),{i:u,j:a}=Ui(e)}return e&&c(e),d}}const{ext:r}=t;let n=r,l=t;if(r.includes("translate")){n=r.filter(a=>a!=="translate"&&a!=="tvar"),l={...t,ext:n};const u=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,a=>(u.push(a),`\0${u.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(a,d,c)=>{const f=s.length;return new za(d,c&&Ee(c,u),l,s),`\0${f}g`}),e=Ee(e,u)}const o=Rl[i?1:0](n.join("|"));return o.lastIndex=0,o.test(e)?e.replace(o,(u,a,d,c,f,g,y,$,k)=>{const _=s.length;let T="n";if(a)T="e",new Tt(a,d,c,f,l,g,s);else if(u.startsWith("<!--")){T="c";const p=u.endsWith("-->");new _t(Ee(u,s,1).slice(4,p?-3:void 0),p,t,s)}else g?new Kt(g,y&&Ee(y,s,1),$&&Ee($,s,1),k,t,s):new je(u,t,s,!0);return`\0${_}${T}`}):e}}}),Pl,Ol,Bl,ql,Mi,Wl,es,ld=I({"src/tag/html.ts"(){"use strict";var e,t;Y(),ve(),Jn(),G(),Ma(),Pl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Ol=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"]),Bl=new Set(["strike","big","center","font","tt"]),ql=[Hs()],es=(t=class extends(Wl=Qn){constructor(i,r,n,l,o,u){super(i,r,n,o,u);R(this,e);this.setAttribute("name",i.toLowerCase()),E(this,e,l)}get type(){return"html"}get selfClosing(){return b(this,e)}text(){const{closing:i,selfClosing:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){var n;{const l=super.lint(i,r),{name:o,parentNode:u,closing:a,selfClosing:d}=this,c=new ge(this,i),{lintConfig:f}=N,{computeEditInfo:g,fix:y}=f,$=this.inTableAttrs();let k="h1",_=f.getSeverity(k,"html");if(_&&o==="h1"&&!a){const S=Z(this,c,k,"<h1>",_);g&&(S.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),l.push(S)}if(k="parsing-order",_=$&&f.getSeverity(k,$===2?"html":"templateInTable"),_){const S=Z(this,c,k,"html-in-table",_);g&&$===2&&(S.suggestions=[ee(S)]),l.push(S)}if(k="obsolete-tag",_=f.getSeverity(k,o),_&&Bl.has(o)&&l.push(Z(this,c,k,"obsolete-tag",_)),k="bold-header",_=f.getSeverity(k,o),_&&(o==="b"||o==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const S=Z(this,c,k,"bold-in-header",_);g&&(S.suggestions=[ee(S)]),l.push(S)}const{html:[,T,p]}=this.getAttribute("config"),h=p.includes(o),m=T.includes(o),x=!h&&!m;if(k="unmatched-tag",a&&(d||h)||d&&x){if(_=f.getSeverity(k,a?"both":"selfClosing"),_){const S=Z(this,c,k,a?"closing-and-self-closing":"invalid-self-closing",_);if(g||y){const v=Wn(i),w={desc:N.msg("no-self-closing"),range:[S.endIndex-2,S.endIndex-1],text:""};m?g&&(S.suggestions=[v,w]):a?S.fix=h?v:w:g&&(S.suggestions=[w,Xe(S.endIndex,`></${o}>`,-2)])}l.push(S)}}else if(!this.findMatchingTag()){const S=Z(this,c,k,a?"unmatched-closing":"unclosed-tag"),v=this.closest("magic-word");if(v&&Pl.has(v.name))_=f.getSeverity(k,"conditional");else if(a)_=f.getSeverity(k,"closing"),S.suggestions=[ee(S)];else{_=f.getSeverity(k,"opening");const w=u==null?void 0:u.childNodes;Ol.has(o)&&(w!=null&&w.slice(0,w.indexOf(this)).some(A=>A.is("html")&&A.name===o&&!A.findMatchingTag())&&(S.suggestions=[Xe(i+1,"/")]),this.closest("heading-title")&&(S.rule="format-leakage",_=f.getSeverity("format-leakage",o)))}_&&(S.severity=_,l.push(S))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){{const n=super.json(void 0,r);return n.selfClosing=b(this,e),n}}},e=new WeakMap,t),Mi=ae(Wl),es=re(Mi,0,"HtmlToken",ql,es),ne(Mi,1,es)}}),To={};le(To,{parseHtml:()=>Co});var Ul,Co,ad=I({"parser/html.ts"(){"use strict";Zn(),ld(),Ul=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Co=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const o of r){const u=Ul.exec(o),a=u==null?void 0:u[2],d=a==null?void 0:a.toLowerCase();if(!u||!t.htmlElements.has(d)){n+=`<${o}`;continue}const[,c,,f="",g,y]=u,{length:$}=s,k=new Ds(f,"html-attrs",d,t,s),_=k.hasAttr("itemprop");if(d==="meta"&&!(_&&k.hasAttr("content"))||d==="link"&&!(_&&k.hasAttr("href"))){n+=`<${o}`,s.length=$;continue}n+=`\0${s.length}x${y}`,new es(a,k,c==="/",g==="/>",t,s)}return n}}}),Ml,zl,zi,Hl,Ct,Io=I({"src/table/base.ts"(){"use strict";Jn(),G(),J(),gt(),Zn(),Ml=e=>{const t=e.childNodes.map(i=>i.type==="text"?i.data.replace(/\|\|/gu,"{{!!}}").replace(/\|/gu,"{{!}}"):i.toString()).join(""),{childNodes:s}=N.parseWithRef(t,e,2);e.safeReplaceChildren(s)},zl=[Hs(1)],Ct=class extends(Hl=z){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new Ue(t,"table-syntax",r,n),new Ds(i,"table-attrs",s,r,n))}escape(){for(const e of this.childNodes)e instanceof Ue?Ml(e):e.escape()}},zi=ae(Hl),Ct=re(zi,0,"TableBaseToken",zl,Ct),ne(zi,1,Ct)}}),Dl,Hi,$e,$s,zt,Ht,qs,No=I({"src/table/td.ts"(){"use strict";Y(),ve(),Gn(),G(),J(),Io(),qs=class extends(Hi=Ct,Dl=[Us(!1)],Hi){constructor(e,t,s,i=[]){var o;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(n)&&(r=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),ne($s,5,this),Ge(this,zt),Ge(this,$e,""),r&&([Lu(this,$e)._]=r);const l=new z(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+fe(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 pn(this,zt,Ht).call(this).subtype}afterBuild(){fe(this,$e).includes("\0")&&Te(this,$e,this.buildFromStr(fe(this,$e),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+fe(this,$e)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+fe(this,$e)+s.text()}getGaps(e){return e===1?fe(this,$e).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ge(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=N,{computeEditInfo:l,fix:o}=n,u=["td","double"].map(a=>n.getSeverity(r,a));for(const a of this.lastChild.childNodes)if(a.type==="text"){const{data:d}=a;if(d.includes("|")){const c=d.includes("||"),f=u[c?1:0];if(f){const g=Q(a,i,r,"pipe-in-table",f);if(l||o)if(c){const y={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix=Oe(g,"newline",d.replace(/\|\|/gu,`
|
|
14
|
+
${y}`))}else l&&(g.suggestions=[zn(g.startIndex,d)]);s.push(g)}}}return s}}isIndependent(){return this.firstChild.text().startsWith(`
|
|
15
|
+
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){super.escape(),this.childNodes[1].toString()&&(fe(this,$e)||Te(this,$e,"{{!}}")),fe(this,$e)==="|"&&Te(this,$e,"{{!}}")}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${fe(this,$e)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t),{rowspan:i,colspan:r}=this;return Object.assign(s,{subtype:this.subtype},i!==1&&{rowspan:i},r!==1&&{colspan:r}),s}}},$s=ae(Hi),$e=new WeakMap,zt=new WeakSet,Ht=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let i="td";if(s==="!"?i="th":s==="+"&&(i="caption"),this.isIndependent())return{subtype:i};const{previousSibling:r}=this;return{...pn(e=r,zt,Ht).call(e)}},Ht=re($s,17,"#getSyntax",Dl,zt,Ht),Pn($s,qs)}}),lr,Lo=I({"src/table/trBase.ts"(){"use strict";Y(),G(),Io(),No(),lr=class extends Ct{lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=this.childNodes.find(({type:o})=>o==="table-inter");if(!i)return s;const r=rs(i),n="fostered-content",l=r&&N.lintConfig.getSeverity(n,r===2?void 0:"transclusion");if(l){const o=Q(i,{start:e},n,"content-outside-table",l);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof qs&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),Gl,Vl,Ql,Jl,Di,_s,Rs,od=I({"src/table/index.ts"(){"use strict";Y(),Re(),ve(),Gn(),G(),Lo(),gt(),Gl=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),Vl=({type:e})=>e==="tr"||e==="table-syntax",Ql=class extends Array{},Rs=class extends(Di=lr,Jl=[Us(!1)],Di){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),ne(_s,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 ge(this,e),r=["unclosed-table","table-layout"],n=r.map(l=>N.lintConfig.getSeverity(l));if(n[0]&&!this.closed&&s.push(Q(this.firstChild,i,r[0],"unclosed-table",n[0])),n[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let u=1,a=1/0,d=0;for(;d<o;d++){const c=l[d],f=c.length;if(f<u)break;f<a&&(a=f);const g=c.indexOf(c[f-1])+1;if(g>a)break;g>u&&(u=g)}if(d<o){const c=this.getNthRow(d),f=Q(c,i,r[1],"inconsistent-table",n[1]);f.startIndex++,f.startLine++,f.startCol=0,s.push(f)}}}return s}}close(e=`
|
|
16
|
+
|}`,t){be.run(()=>{const s=new Ue(t?e:void 0,"table-syntax",this.getAttribute("config"),this.getAttribute("accum"));super.insertAt(s)})}getLayout(e){{const t=this.getAllRows(),{length:s}=t,i=Ql.from(Gl(s,()=>[]));for(let r=0;r<i.length;r++){const n=i[r];let l=0,o=0,u;for(const a of t[r].childNodes.slice(2))if(a.is("td")){if(a.isIndependent()&&(u=a.subtype!=="caption"),u){const d={row:r,column:l},{rowspan:c,colspan:f}=a;for(l++;n[o];)o++;for(let g=r;g<Math.min(r+c,s);g++)for(let y=o;y<o+f;y++)i[g][y]=d;o+=f}}else if(Vl(a))break}return i}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){{const i=super.getRowCount();if(e===0&&i)return this;i&&e--;for(const r of this.childNodes.slice(2)){const{type:n}=r;if(n==="tr"&&r.getRowCount()&&(e--,e<0))return r}return}}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t);return s.closed=this.closed,s}}},_s=ae(Di),re(_s,1,"getLayout",Jl,Rs),Pn(_s,Rs)}}),Fo,ud=I({"src/table/tr.ts"(){"use strict";Lo(),Fo=class extends lr{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),ar,Eo=I({"src/nowiki/listBase.ts"(){"use strict";ft(),ar=class extends Be{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t),{indent:i}=this;return i&&(s.indent=i),s}}}}}),or,jo=I({"src/nowiki/dd.ts"(){"use strict";Eo(),or=class extends ar{get type(){return"dd"}}}}),Ro={};le(Ro,{parseTable:()=>Po});var Xl,Gi,Po,dd=I({"parser/table.ts"(){"use strict";J(),od(),ud(),No(),jo(),Xl=e=>e.lastChild.constructor!==z,Gi=(e,t)=>e.is("td")?t.pop():e,Po=({firstChild:{data:e},type:t,name:s},i,r)=>{const n=[],l=e.split(`
|
|
17
17
|
`);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
|
|
18
|
-
${l.shift()}`,
|
|
19
|
-
${c}${
|
|
20
|
-
${
|
|
21
|
-
${
|
|
22
|
-
${c}${
|
|
23
|
-
${c}${
|
|
24
|
-
${c}${
|
|
25
|
-
`)&&(A=_e(p).trim());const{ns:T,valid:f}=N.normalizeTitle(A,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(f){if(a){if(T!==6){l+=`[[${b}`;continue}let x=!1;for(d++;d<n.length;d++){const v=n[d],h=v.split("]]");if(h.length>2){x=!0,p+=`[[${h[0]}]]${h[1]}`,m=h.slice(2).join("]]");break}else if(h.length===2)p+=`[[${h[0]}]]${h[1]}`;else{p+=`[[${v}`;break}}if(p=kn(p,t,s,i),!x){l+=`[[${u}${c}${p}`;continue}}}else{l+=`[[${b}`;continue}p&&(p=rr(p,t,s,i));let g=er;k||(T===6?(p&&(p=lr(p,t,s,!0)),g=Zn):T===14&&(g=Wa)),p===void 0&&c&&(p=""),l+=`\0${s.length}l${m}`,new g(u,p,t,s,c)}return l}}}),Ma={};oe(Ma,{parseMagicLinks:()=>za});var Vi,Qi,Ji,Xi,za,ad=C({"parser/magicLinks.ts"(){"use strict";fe(),tr(),Vi=String.raw`[${Qe}\t]| |�*160;|�*a0;`,Qi=`(?:${Vi})+`,Ji=`(?:${Vi}|-)`,Xi=String.raw`(?:RFC|PMID)${Qi}\d+\b|ISBN${Qi}(?:97[89]${Ji}?)?(?:\d${Ji}?){9}[\dx]\b`,za=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${It}${Nt})|${Xi})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${It}${Nt})|${Xi})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){let o="";const d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);d&&(o=l.slice(d.index),l=l.slice(0,d.index));const a=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=a.exec(l);if(u){let c=1;u[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,u.index))&&(c=2),o=l.slice(u.index+c)+o,l=l.slice(0,u.index+c)}return o.length>=n.length?i:(new fs(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new fs(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),Ha,ud=C({"util/html.ts"(){"use strict";Ha=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Da,dd=C({"src/nowiki/list.ts"(){"use strict";Ta(),Da=class extends ir{get type(){return"list"}}}}),Ga={};oe(Ga,{parseList:()=>Va});var Va,cd=C({"parser/list.ts"(){"use strict";ud(),dd(),Ca(),Va=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,d]=r,a=o.replace(/;/gu,":"),u=Ha(a,t.lastPrefix),c=((u>1?o.slice(u-1):o)+d).split(/(?=;)/u),p=c[0].startsWith(";");let m=c.length-(p?0:1);if(u>1){const $=o.slice(0,u-1);if(p){const L=$.split(/(?=;)/u);c.unshift(...L),m+=$.includes(";")?L.length:0}else c[0]=$+c[0]}t.lastPrefix=a;let b=l+c.map(($,L)=>`\0${i.length+L}d`).join("")+e.slice(n.length);for(const $ of c)new Da($,s,i);if(!m)return b;const{html:[_,,A]}=s,k=/:+|-\{|\0\d+[xq]\x7F/gu;let T=k,f=T.exec(b),g=0,x=!1,v=!1,h=0;const S=($,L)=>(new nr($,s,i),`${b.slice(0,L)}\0${i.length-1}d${b.slice(L+$.length)}`),y=$=>{$?g&&g--:g++};for(;f&&m;){const{0:$,index:L}=f;if($==="-{"){if(!h){const{lastIndex:I}=T;T=/-\{|\}-/gu,T.lastIndex=I}h++}else if($==="}-"){if(h--,!h){const{lastIndex:I}=T;T=k,T.lastIndex=I}}else if($.endsWith("x")){const{name:I,closing:j,selfClosing:B}=i[Number($.slice(1,-2))];(_.includes(I)||!B&&!A.includes(I))&&y(j)}else if($.endsWith("q")){const{bold:I,italic:j}=i[Number($.slice(1,-2))];I&&(y(x),x=!x),j&&(y(v),v=!v)}else if(g===0){if($.length>=m)return S($.slice(0,m),L);m-=$.length,T.lastIndex=L+4+String(i.length).length,b=S($,L)}f=T.exec(b)}return b}}}),Cs,Jl,Ki,Xl,is,hd=C({"src/converterFlags.ts"(){"use strict";var e,t;K(),me(),Ms(),G(),X(),ct(),Cs=new Set(["A","T","R","D","-","H","N"]),Jl=[xs()],is=(t=class extends(Xl=H){constructor(i,r,n=[]){super(void 0,r,n,{});P(this,e);this.safeAppend(i.map(l=>new $e(l,"converter-flag",r,n)))}get type(){return"converter-flags"}afterBuild(){F(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(w(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(w(this,e).filter(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return typeof i=="object"&&(i=i.text().trim(),r=this.getVariantFlags(),n=this.getUnknownFlags(),l=new Set(w(this,e).filter(o=>Cs.has(o)))),!!i&&!r.has(i)&&!n.has(i)&&(r.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),r){{const n=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(w(this,e).filter(A=>Cs.has(A))),d=w(this,e).filter(A=>!A).length,a=w(this,e).length-l.size-d,{lintConfig:u}=N,{computeEditInfo:c,fix:p}=u,m=super.lint(i,r);if(n.size===a||o.size===a)return m;const b="no-ignored",_=u.getSeverity(b,"conversionFlag");if(_){const A=new ce(this,i);for(let k=0;k<this.length;k++){const T=this.childNodes[k],f=T.text().trim();if(this.isInvalidFlag(f,n,l,o)){const g=J(T,A,b,"invalid-conversion-flag",_);(c||p)&&(n.size===0&&Cs.has(f.toUpperCase())?g.fix=Bn(g,f):c&&(g.suggestions=[Z(g,k&&-1)])),m.push(g)}}}return m}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Ki=ae(Xl),is=le(Ki,0,"ConverterFlagsToken",Jl,is),re(Ki,1,is)}}),Ps,gd=C({"src/converterRule.ts"(){"use strict";G(),X(),ct(),Ps=class extends H{get type(){return"converter-rule"}get variant(){var e,t;return(t=(e=this.childNodes[this.length-2])==null?void 0:e.text().trim().toLowerCase())!=null?t:""}constructor(e,t=!0,s=N.getConfig(),i=[]){super(void 0,s,i);const r=e.indexOf(":"),n=e.slice(0,r).indexOf("=>"),l=n===-1?e.slice(0,r):e.slice(n+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new $e(l,"converter-rule-variant",s,i)),super.insertAt(new $e(e.slice(r+1),"converter-rule-to",s,i)),n!==-1&&super.insertAt(new $e(e.slice(0,n),"converter-rule-from",s,i),0)):super.insertAt(new $e(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);return s.variant=this.variant,s}}}}}),Kl,Yi,Yl,ns,pd=C({"src/converter.ts"(){"use strict";fe(),Ze(),We(),X(),hd(),gd(),Kl=[Be,Ue("-{")],ns=class extends(Yl=H){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new is(e,s,i));const[r]=t,n=r.includes(":"),l=new Ps(r,n,s,i);n&&l.length===1||!n&&t.length===2&&!_e(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()}|${dt(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>`}},Yi=ae(Yl),ns=le(Yi,0,"ConverterToken",Kl,ns),re(Yi,1,ns)}}),Qa={};oe(Qa,{parseConverter:()=>Ja});var Ja,fd=C({"parser/converter.ts"(){"use strict";pd(),Ja=(e,t,s)=>{var d;(d=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:a,index:u}=o;if(a==="}-"){const c=n.pop(),{length:p}=s,m=e.slice(c.index+2,u),b=m.indexOf("|"),[_,A]=b===-1?[[],m]:[m.slice(0,b).split(";"),m.slice(b+1)],k=A.replace(/(&[#a-z\d]+);/giu,"$1"),T=k.split(t.regexConverter).map(f=>f.replace(/\x01/gu,";"));new ns(_,T,t,s),e=`${e.slice(0,c.index)}\0${p}v${e.slice(u+2)}`,n.length===0&&(l=i),l.lastIndex=c.index+3+String(p).length}else n.push(o),l=r,l.lastIndex=u+2;o=l.exec(e)}return e}}}),os={};oe(os,{Token:()=>H});var Zl,H,X=C({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,Xa,Ka,Ya,Za,eu,tu,su,iu,nu,ru,lu,ou,g;fe(),Xe(),K(),je(),G(),Iu(),Lu(),Zl=["category","html-attr#id,ext-attr#id,table-attr#id"],H=(g=class extends Qt{constructor(h,S=N.getConfig(),y=[],$){super();P(this,o);P(this,e,"plain");P(this,t,0);P(this,s);P(this,i);P(this,r);P(this,n,!1);P(this,l);typeof h=="string"&&this.insertAt(h),F(this,s,S),F(this,i,y),y.push(this)}get type(){return w(this,e)}set type(h){F(this,e,h)}parseOnce(h=w(this,t),S=!1,y){if(h<w(this,t)||this.length===0||!this.isPlain())return this;if(w(this,t)>=Ae)return this;switch(h){case 0:if(this.type==="root"){w(this,i).pop();const $=R(this,o,Xa).call(this);S&&(S=!$)}F(this,r,S),R(this,o,Ka).call(this,S);break;case 1:R(this,o,Ya).call(this);break;case 2:R(this,o,Za).call(this);break;case 3:R(this,o,eu).call(this);break;case 4:R(this,o,tu).call(this);break;case 5:R(this,o,su).call(this,y);break;case 6:R(this,o,iu).call(this,y);break;case 7:R(this,o,nu).call(this);break;case 8:R(this,o,ru).call(this);break;case 9:R(this,o,lu).call(this);break;case 10:R(this,o,ou).call(this)}if(this.type==="root")for(const $ of w(this,i))$==null||$.parseOnce(h,S,y);return ur(this,t)._++,this}buildFromStr(h,S){const y=h.split(/[\0\x7F]/u).map(($,L)=>{if(L%2===0)return new fn($);if(isNaN($.slice(-1)))return w(this,i)[Number($.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${$}`)});return S===0?y.map(String).join(""):S===1?dt(y):y}build(){F(this,t,Ae);const{length:h,firstChild:S}=this,y=S==null?void 0:S.toString();if(h===1&&S.type==="text"&&y.includes("\0")&&(ms(this,0,1,this.buildFromStr(y)),this.normalize(),this.type==="root"))for(const $ of w(this,i))$==null||$.build()}afterBuild(){if(this.type==="root")for(const h of w(this,i))h==null||h.afterBuild();F(this,n,!0)}parse(h=Ae,S,y){for(h=Math.min(h,Ae);w(this,t)<h;)this.parseOnce(w(this,t),S,y);return h&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===g}getAttribute(h){var S;switch(h){case"config":return w(this,s);case"include":return(S=w(this,r))!=null?S:!!w(this.getRootNode(),r);case"accum":return w(this,i);case"built":return w(this,n);case"stage":return w(this,t);case"invalid":return this.type==="table-inter"&&ls(this)===2;default:return super.getAttribute(h)}}setAttribute(h,S){switch(h){case"stage":w(this,t)===0&&this.type==="root"&&w(this,i).shift(),F(this,t,S);break;default:super.setAttribute(h,S)}}insertAt(h,S=this.length){const y=typeof h=="string"?new fn(h):h;super.insertAt(y,S);const{type:$}=y;return $==="root"&&(y.type="plain"),y}normalizeTitle(h,S=0,y){return N.normalizeTitle(h,S,w(this,r),w(this,s),y)}inTableAttrs(){var h,S;return((h=this.closest("table-attrs,ext"))==null?void 0:h.type)==="table-attrs"&&((S=this.closest("table-attrs,arg,magic-word,template"))!=null&&S.is("table-attrs")?2:1)}inHtmlAttrs(){var h;return(h=this.closest("html-attrs,ext"))!=null&&h.is("html-attrs")?2:this.inTableAttrs()}lint(h=this.getAbsoluteIndex(),S){var y;{const{lintConfig:$}=N,{computeEditInfo:L,fix:I,ignoreDisables:j,configurationComment:B}=$;let O=super.lint(h,S);if(this.type==="root"){const E=new Map,D="no-duplicate",W=["category","id"].map(U=>$.getSeverity(D,U)),q=this.toString(),z=Zl.filter((U,V)=>W[V]).join();if(z){for(const U of this.querySelectorAll(z)){let V;if(U.is("category"))V=U.name;else{const Q=U.getValue();Q&&Q!==!0&&(V=`#${Q}`)}if(V){const Q=E.get(V);Q?Q.add(U):E.set(V,new Set([U]))}}for(const[U,V]of E)if(V.size>1&&!U.startsWith("#mw-customcollapsible-")){const Q=!U.startsWith("#"),ie=`duplicate-${Q?"category":"id"}`,ue=W[Q?0:1];O.push(...[...V].map(he=>{const ne=Y(he,{start:he.getAbsoluteIndex()},D,ie,ue);return L&&Q&&(ne.suggestions=[Z(ne)]),ne}))}}if(!j){const U=new RegExp(String.raw`<!--\s*${B}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),V=[];let Q=U.exec(q);for(;Q;){const{1:ie,index:ue}=Q,he=(y=Q[2])==null?void 0:y.trim();V.push({line:this.posFromIndex(ue).top+(ie==="disable-line"?0:1),from:ie==="disable"?U.lastIndex:void 0,to:ie==="enable"?U.lastIndex:void 0,rules:he?new Set(he.split(",").map(ne=>ne.trim())):void 0}),Q=U.exec(q)}O=O.filter(({rule:ie,startLine:ue,startIndex:he})=>{const ne={pos:0};for(const{line:Ce,from:Ie,to:M,rules:ee}of V){if(Ce>ue+1)break;if(ee&&!ee.has(ie))continue;if(Ce===ue&&Ie===void 0&&M===void 0)return!1;Ie<=he&&Ie>ne.pos?(ne.pos=Ie,ne.type="from"):M<=he&&M>ne.pos&&(ne.pos=M,ne.type="to")}return ne.type!=="from"})}if(I&&O.some(({fix:U})=>U)){const U=O.map(({fix:ie})=>ie).filter(Boolean).sort(({range:[ie,ue]},{range:[he,ne]})=>ue===ne?he-ie:ne-ue);let V=1/0,Q=q;for(const{range:[ie,ue],text:he}of U)ue<=V&&(Q=Q.slice(0,ie)+he+Q.slice(ue),V=ie);Object.assign(O,{output:Q})}if(!L)for(const U of O)delete U.fix,delete U.suggestions}return O}}toString(h,S){return h?super.toString(!0,S):ut(w(this,l),()=>super.toString(!1,S),y=>{const $=this.getRootNode();$.type==="root"&&w($,n)&&F(this,l,y)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakSet,Xa=function(){const{parseRedirect:h}=(ju(),se(Ro)),S=this.firstChild.toString(),y=h(S,w(this,s),w(this,i));return y&&this.setText(y),!!y},Ka=function(h){const{parseCommentAndExt:S}=(Qs(),se(wa));this.setText(S(this.firstChild.toString(),w(this,s),w(this,i),h))},Ya=function(){const{parseBraces:h}=(Yn(),se(Xo)),S=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,y=h(S,w(this,s),w(this,i));this.setText(this.type==="root"?y:y.slice(1))},Za=function(){if(w(this,s).excludes.includes("html"))return;const{parseHtml:h}=(Yu(),se(ya));this.setText(h(this.firstChild.toString(),w(this,s),w(this,i)))},eu=function(){if(w(this,s).excludes.includes("table"))return;const{parseTable:h}=(td(),se(Ia));this.setText(h(this,w(this,s),w(this,i)))},tu=function(){if(w(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:h}=(nd(),se(Ea));this.setText(h(this,w(this,s),w(this,i)))},su=function(h){const{parseLinks:S}=(od(),se(Ua));this.setText(S(this.firstChild.toString(),w(this,s),w(this,i),h))},iu=function(h){if(w(this,s).excludes.includes("quote"))return;const{parseQuotes:S}=(Oa(),se(Pa)),y=this.firstChild.toString().split(`
|
|
26
|
-
`);for(let
|
|
27
|
-
`))},
|
|
28
|
-
`),
|
|
29
|
-
`))},ou=function(){if(w(this,s).variants.length>0){const{parseConverter:h}=(fd(),se(Qa));this.setText(h(this.firstChild.toString(),w(this,s),w(this,i)))}},g)}}),xe,Js,ms,je=C({"util/debug.ts"(){"use strict";xe={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(X(),se(os)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Js=e=>t=>t.type===e,ms=(e,t,s,i=[])=>{var l,o;let r=e.getChildNodes(),n;r.length===s?(n=r,r=i):n=r.splice(t,s,...i);for(let d=0;d<i.length;d++){const a=i[d];a.setAttribute("parentNode",e),a.setAttribute("nextSibling",r[t+d+1]),a.setAttribute("previousSibling",r[t+d-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(o=r[t+i.length])==null||o.setAttribute("previousSibling",r[t+i.length-1]),r===i&&e.setAttribute("childNodes",r),n}}}),xt,Zi,Is,en,eo,tn,to,$n,md=C({"lib/lintConfig.ts"(){"use strict";var e,t;jn(),xt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),Zi={"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"invalid-url":1,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Zi),Is={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(Is),en=s=>xt.has(s),eo=s=>en(s)||Array.isArray(s)&&en(s[0])&&(s.length===1||typeof s[1]=="object"),tn=(s,i,r)=>{if(as.includes(i)){if(r===void 0)return!1;if(eo(r))return s[i]=r,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(r)}`)},to=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(Zi))),!!s)for(const[i,r]of Object.entries(s))tn(this,i,r)}getSeverity(s,i){var n,l;const r=this[s];return typeof r!="object"?xt.get(r):i&&(l=xt.get((n=r[1])==null?void 0:n[i]))!=null?l:xt.get(r[0])}},$n=(t=class{constructor(s){P(this,e);if(Object.assign(this,Is),s&&!("rules"in s)&&Object.keys(s).some(i=>as.includes(i)))this.rules=s;else{const{rules:i,...r}=s!=null?s:{};this.rules=i;for(const[n,l]of Object.entries(r))l!==void 0&&Object.prototype.hasOwnProperty.call(Is,n)&&(this[n]=l)}}get rules(){return w(this,e)}set rules(s){F(this,e,new Proxy(new to(s),{set:tn,deleteProperty(){return!1}}))}getSeverity(s,i){return w(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),au={};oe(au,{Title:()=>uu});var uu,xd=C({"lib/title.ts"(){"use strict";var e,t,s,i,r,n;Ke(),fe(),uu=(n=class{constructor(l,o,d,{temporary:a,decode:u,selfLink:c}={}){P(this,e);P(this,t);P(this,s);P(this,i);P(this,r);Ne(this,"valid");Ne(this,"encoded",!1);const p=l.trim().startsWith("../");if(u&&l.includes("%"))try{const b=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(l);l=hs(l),this.encoded=b}catch{}if(l=ds(l).replace(/[_ ]+/gu," ").trim(),p)F(this,i,0);else{let b=o;l.startsWith(":")&&(b=0,l=l.slice(1).trim());const _=l.split(":");if(_.length>1){const A=Lt(_[0]),k=Object.prototype.hasOwnProperty.call(d.nsid,A)&&d.nsid[A];k&&(b=k,l=_.slice(1).join(":").trim())}F(this,i,b)}const m=l.indexOf("#");if(m!==-1){let b=l.slice(m).trim().slice(1);if(b.includes("%"))try{b=hs(b)}catch{}F(this,r,b.replace(/ /gu,"_")),l=l.slice(0,m).trim()}this.valid=!!(l||c&&this.ns===0&&w(this,r)!==void 0)&&ds(l)===l&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(p?/^(?:\.\.\/)+(.*)/u.exec(l)[1]:l),this.main=l,F(this,t,d.namespaces),F(this,s,d.articlePath||"/wiki/$1"),w(this,s).includes("$1")||F(this,s,w(this,s)+`${w(this,s).endsWith("/")?"":"/"}$1`),a||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return w(this,i)}get fragment(){return w(this,r)}get main(){return w(this,e)}set main(l){l=l.replace(/_/gu," ").trim(),F(this,e,l&&l[0].toUpperCase()+l.slice(1))}get prefix(){const l=w(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){F(this,r,l)}getUrl(l){{typeof l=="string"&&(F(this,s,l),w(this,s).includes("$1")||F(this,s,w(this,s)+`${w(this,s).endsWith("/")?"":"/"}$1`));const{title:o,fragment:d}=this;return o?w(this,s).replace("$1",encodeURIComponent(o)+(d?`#${encodeURIComponent(d)}`:"")):d===void 0?"":`#${encodeURIComponent(d)}`}throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n)}}),du={};oe(du,{LanguageService:()=>cu,isAttr:()=>Os,tasks:()=>_n});var _n,so,io,no,ro,sn,lo,oo,ao,uo,Os,co,nn,vt,rn,ze,be,ln,on,bt,wt,nt,Gt,an,ho,cu,vd=C({"lib/lsp.ts"(){"use strict";var e,t,s,i,r,n,l,o,d,a,rs,Le,Tn,Cn,In,hu,Nn,yt,T;Ke(),La(),jn(),Uo(),K(),fe(),G(),_n=new WeakMap,so=new Set(["ref"]),io=new Set(["ref","references"]),no=new Set(["name","follow"]),ro=new Set(["group"]),sn=new Set(["arg-name","template-name","link-target","parameter-key"]),lo=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...sn]),oo=new Set(["text","comment","noinclude","include"]),ao=["ext","html","table"].map(f=>`${f}-attr#style`).join(),uo=at(f=>new RegExp(`^(?:${f}|//)`,"iu")),Os=({type:f,parentNode:g,length:x,firstChild:v},h)=>f==="attr-value"&&x===1&&v.type==="text"&&(!h||g.name==="style"),co=f=>f.is("html-attr")||f.is("table-attr"),nn=f=>f.childNodes.every(({type:g})=>oo.has(g)),vt=(f,g)=>{const{top:x,left:v}=f.posFromIndex(g);return{line:x,character:v}},rn=(f,g,x)=>({start:vt(f,g),end:vt(f,x)}),ze=f=>{const{top:g,left:x,height:v,width:h}=f.getBoundingClientRect();return{start:{line:g,character:x},end:gs(g,x,v,h)}},be=(f,g,x,{line:v,character:h},S,y)=>[...new Set(f)].map($=>{var I;const L=(I=y==null?void 0:y($))==null?void 0:I.description;return{label:$,kind:g,textEdit:{range:{start:{line:v,character:h-x.length},end:{line:v,character:h}},newText:$+(S!=null?S:"")},...L&&{documentation:{kind:"markdown",value:L}}}}),ln=(f,g,{line:x,character:v})=>{const h=f.indexFromPos(x,v);return f.caretPositionFromIndex(h+Number(/\w/u.test(g.charAt(h))))},on=(f,g,x)=>{const{type:v,parentNode:h={}}=f,{name:S,tag:y}=h;return v==="attr-value"&&g.has(y)&&x.has(S)?f.toString().trim():NaN},bt=f=>on(f,so,no),wt=f=>on(f,io,ro),nt=(f,g)=>{const x=f==null?void 0:f.getAttr(g);return x!==!0&&x||!1},Gt=f=>{const{type:g,name:x,parentNode:v}=f;switch(g){case"heading":return f.level;case"heading-title":return v.level;case"parameter-key":return`${v.parentNode.name}|${v.name}`;case"ext":case"html":case"image-parameter":return x;default:return v.name}},an=(f,g,x=!1)=>({range:rn(f,...g.range),newText:g.text,title:`${x?"Fix":"Suggestion"}: ${g.desc}`,fix:x}),ho=(f,g)=>{const{lintConfig:x}=N,{rules:v,fix:h,computeEditInfo:S}=x;if(x.fix=!0,x.computeEditInfo=!1,g){x.rules=void 0;for(const $ of as)x.rules[$]=$===g?v[$]:0}const{output:y}=f.lint();return x.fix=h,x.computeEditInfo=S,g&&(x.rules=v),y===void 0?[]:[{range:ze(f),newText:y}]},cu=(T=class{constructor(f){P(this,a);P(this,e);P(this,t);P(this,s);P(this,i);P(this,r);P(this,n);P(this,l);P(this,o);P(this,d);Ne(this,"include",!0);Ne(this,"config");Ne(this,"data");_n.set(f,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(f,g,x=!0){const v=await R(this,a,Le).call(this,g);return v.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(h=>{const{type:S,childNodes:y}=h;return S!=="attr-value"&&!nn(h)?[]:y.filter($=>$.type==="text").reverse().flatMap($=>{const{data:L}=$,I=ko(L,x).filter(([,,,B])=>B);if(I.length===0)return[];const j=$.getAbsoluteIndex();return I.map(([B,O,E])=>{const D=f(B);return D.length===4&&{color:{red:D[0]/255,green:D[1]/255,blue:D[2]/255,alpha:D[3]},range:rn(v,j+O,j+E)}}).filter(Boolean)})})}provideColorPresentations(f){const{color:{red:g,green:x,blue:v,alpha:h},range:S}=f,y=[g,x,v],$=h<1?`rgba(${y.map(L=>Math.round(L*255)).join()},${h})`:`#${y.map(Ao).join("")}`;return[{label:$,textEdit:{range:S,newText:$}}]}async provideCompletionItems(f,g){var Q,ie,ue,he,ne,Ce,Ie;const{re:x,allTags:v,functions:h,switches:S,protocols:y,params:$,tags:L,ext:I}=R(this,a,hu).call(this),{line:j,character:B}=g,O=f.split(/\r?\n/u,j+1)[j],E=x.exec((Q=O==null?void 0:O.slice(0,B))!=null?Q:""),[,,D={},W={}]=this.config.doubleUnderscore;if((E==null?void 0:E[1])!==void 0){const M=E[1].startsWith("/");return be(v,"Class",E[1].slice(M?1:0),g,M&&!(O!=null&&O.slice(B).trim().startsWith(">"))?">":"")}else{if(E!=null&&E[4])return be(S,"Constant",E[4],g,"",M=>{if(this.data)return M=M.slice(2,-2),M in D?M=D[M]:M in W&&(M=W[M]),R(this,a,Nn).call(this,M.toLowerCase())});if((E==null?void 0:E[5])!==void 0)return be(y,"Reference",E[5],g)}const q=await R(this,a,Le).call(this,f);let z;if(E!=null&&E[2]){z=q.elementFromPoint(E.index+E[2].length-1,j);const M=(ie=E[3])!=null?ie:"";if(E[2]==="{{{")return be(q.querySelectorAll("arg").filter(te=>te.name&&te!==z).map(({name:te})=>te),"Variable",M,g);const[ee,ge]=this.config.parserFunction,ve=Array.isArray(ge),Te=O.charAt(B),Me=M.startsWith(":"),ye=Me?M.slice(1).trimStart():M;if(E[2]==="[[")return be(q.querySelectorAll("link,file,category,redirect-target").filter(te=>te!==z).map(({name:te})=>te),"Folder",ye,g);let ft=h;return Te===":"?ft=h.filter(te=>!te.endsWith(":")):Te===":"&&(ft=h.filter(te=>te.endsWith(":")).map(te=>te.slice(0,-1))),[...be(ft,"Function",M,g,"",te=>{if(this.data)te in ee?te=ee[te]:!ve&&te in ge&&(te=ge[te]);else return;return R(this,a,yt).call(this,te.toLowerCase())}),...M.startsWith("#")?[]:be(q.querySelectorAll("template").filter(te=>te!==z).map(te=>{const{name:et}=te;if(Me)return et;const{ns:Ot}=te.getAttribute("title");return Ot===0?`:${et}`:Ot===10?et.slice(9):et}),"Folder",ye,g)]}let U,V;if((E==null?void 0:E[7])===void 0&&(z=q.elementFromPoint(B,j),{type:U,parentNode:V}=z),(E==null?void 0:E[6])!==void 0||U==="image-parameter"){const M=q.indexFromPos(j,B),ee=(he=(ue=E==null?void 0:E[6])==null?void 0:ue.trimStart())!=null?he:w(this,e).slice(z.getAbsoluteIndex(),M).trimStart(),ge=w(this,e)[M]==="=";return[...be($,"Property",ee,g).filter(({label:ve})=>!ge||!/[= ]$/u.test(ve)),...be(q.querySelectorAll("image-parameter#width").filter(ve=>ve!==z).map(ve=>ve.text()),"Unit",ee,g)]}else if((E==null?void 0:E[7])!==void 0||U==="attr-key"){const M=(Ce=(ne=E==null?void 0:E[7])==null?void 0:ne.toLowerCase())!=null?Ce:V.tag,ee=(Ie=E==null?void 0:E[9])!=null?Ie:z.toString().slice(0,B-q.posFromIndex(z.getAbsoluteIndex()).left);if(!L.has(M))return;const ge=Vn[M],ve=Qn[M],Te=ve&&be(ve,"Field",ee,g);return I.includes(M)&&!ge?Te:[...Te!=null?Te:[],...M==="meta"||M==="link"?[]:be(Gn,"Property",ee,g),...ge?be(ge,"Property",ee,g):[],...be(["data-"],"Variable",ee,g),...be(["xmlns:"],"Interface",ee,g)]}else if(U==="parameter-key"||U==="parameter-value"&&V.anon){const M=V.parentNode,{type:ee,name:ge}=M;if(ee==="magic-word"&&ge!=="invoke")return;const ve=w(this,e).slice(z.getAbsoluteIndex(),q.indexFromPos(j,B)).trimStart(),{module:Te,function:Me}=M;return ve?be(q.querySelectorAll("parameter").filter(ye=>ye===V||ye.anon||ye.parentNode.type!==ee||ye.parentNode.name!==ge?!1:ee==="template"?!0:ye.parentNode.module===Te&&ye.parentNode.function===Me).map(({name:ye})=>ye),"Variable",ve,g,U==="parameter-value"?"=":""):void 0}else if(Os(z)&&co(V)){const M=Wn(V.tag,V.name);if(M.length===0)return;const ee=w(this,e).slice(z.getAbsoluteIndex(),q.indexFromPos(j,B)).trimStart();return be(M,"Value",ee,g)}}async provideDiagnostics(f,g=!0){const x=await R(this,a,Le).call(this,f),{lintConfig:v}=N,h=v.fix;v.fix=!1;const S=x.lint();return v.fix=h,[(g?S:S.filter(({severity:I})=>I==="error")).map(({startLine:I,startCol:j,endLine:B,endCol:O,severity:E,rule:D,message:W,fix:q,suggestions:z})=>({range:{start:{line:I,character:j},end:{line:B,character:O}},severity:E==="error"?1:2,source:"WikiLint",code:D,message:W,data:[...q?[an(x,q,!0)]:[],...z?z.map(U=>an(x,U)):[]]})),[],[]].flat(2)}resolveCodeAction(f){if(f.kind!=="source.fixAll")return f;const{rule:g}=f.data;return{...f,edit:{changes:{"":ho(w(this,r),g)}}}}async provideFoldingRanges(f){const g=await R(this,a,Le).call(this,f),{length:x}=g.getLines(),v=[],h=new Array(6),S=g.querySelectorAll("heading-title,table,template,magic-word");for(const y of[...S].reverse())y.getRelativeIndex();for(const y of S){const{offsetHeight:$}=y;if(y.type==="heading-title"||$>2){const{top:L}=g.posFromIndex(y.getAbsoluteIndex());if(y.type==="heading-title"){const{level:I}=y.parentNode;for(let j=I-1;j<6;j++){const B=h[j];B!==void 0&&B<L-1&&v.push({startLine:B,endLine:L-1,kind:"region"}),h[j]=void 0}h[I-1]=L+$-1}else v.push({startLine:L,endLine:L+$-2,kind:"region"})}}for(const y of h)y!==void 0&&y<x-1&&v.push({startLine:y,endLine:x-1,kind:"region"});return v}async provideLinks(f){var S;(S=this.config)!=null||(this.config=N.getConfig());const{articlePath:g,protocol:x}=this.config,v=g==null?void 0:g.includes("//"),h=uo(x);return(await R(this,a,Le).call(this,f)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${v?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""}`).reverse().map(y=>{let $;y.is("magic-word")&&({name:$}=y,y=y.childNodes[1].lastChild);const{type:L,parentNode:I,firstChild:j,lastChild:B,childNodes:O,length:E}=y,{tag:D}=I;if($!=null||($=I.name),!(L!=="attr-value"||$==="src"&&["templatestyles","img"].includes(D)||$==="cite"&&["blockquote","del","ins","q"].includes(D))||!nn(y))return!1;let W=O.filter(q=>q.type==="text").map(({data:q})=>q).join("").trim();if(!W)return!1;try{if(y.is("magic-link")||y.is("ext-link-url")||y.is("free-ext-link"))W=y.getUrl(g);else if(L==="link-target"&&(I.is("link")||I.is("redirect-target")||I.is("category"))){if(W.startsWith("/"))return!1;W=I.link.getUrl(g)}else if(L==="template-name")W=I.getAttribute("title").getUrl(g);else if(["link-target","invoke-module","parameter-value"].includes(L)||L==="attr-value"&&$==="src"&&D==="templatestyles"||L==="image-parameter"&&!h.test(W)){if(!v||W.startsWith("/"))return!1;let q=0;switch(L){case"attr-value":q=10;break;case"invoke-module":q=828;break;case"parameter-value":q=$==="filepath"?6:274}const z=N.normalizeTitle(W,q,!1,this.config,{temporary:!0});if(!z.valid)return!1;W=z.getUrl()}if(typeof W=="string"&&W.startsWith("//")&&(W=`https:${W}`),W=new URL(W).href,L==="image-parameter"){const q=j.getBoundingClientRect(),{top:z,left:U,height:V,width:Q}=E===1?q:B.getBoundingClientRect();return{range:{start:{line:q.top,character:q.left},end:gs(z,U,V,Q)},target:W}}return{range:ze(y),target:W}}catch{return!1}}).filter(Boolean)}async provideReferences(f,g){const x=await R(this,a,Le).call(this,f),{offsetNode:v,offset:h}=ln(x,w(this,e),g),S=v.type==="text"?v.parentNode:v,y=h===0&&(S.type==="ext-attr-dirty"||S.type==="html-attr-dirty")?S.parentNode.parentNode:S,{type:$}=y,L=bt(y),I=wt(y);if(!L&&!I&&!lo.has($))return;const j=Gt(y),B=x.querySelectorAll($==="heading-title"?"heading":$).filter(O=>$==="attr-value"?bt(O)===L||wt(O)===I:Gt(O)===j).reverse().map(O=>({range:ze(O.type==="parameter-key"?O.parentNode:O)}));return B.length===0?void 0:B}async provideDefinition(f,g){const x=await R(this,a,Le).call(this,f),v=x.elementFromPoint(g.character,g.line),h=v.is("ext")&&v.name==="ref"?v:v.closest("ext#ref"),S=nt(h,"name");if(!S)return;const y=nt(h,"group"),$=x.querySelectorAll("ext#ref").filter(L=>L.innerText&&nt(L,"name")===S&&nt(L,"group")===y).reverse().map(({lastChild:L})=>({range:ze(L)}));return $.length===0?void 0:$}async resolveRenameLocation(f,g){const x=await R(this,a,Le).call(this,f),v=x.elementFromPoint(g.character,g.line),{type:h}=v,S=bt(v),y=wt(v);return!S&&!y&&(!sn.has(h)||h==="parameter-key"&&/^[1-9]\d*$/u.test(v.parentNode.name)||h==="link-target"&&!["link","redirect-target"].includes(v.parentNode.type))?void 0:ze(v)}async provideRenameEdits(f,g,x){const v=await R(this,a,Le).call(this,f),h=v.elementFromPoint(g.character,g.line),{type:S}=h,y=bt(h),$=y&&nt(h.parentNode.parentNode,"group"),L=wt(h),I=Gt(h),j=v.querySelectorAll(S).filter(B=>{const{type:O}=B.parentNode;return S==="link-target"&&O!=="link"&&O!=="redirect-target"?!1:S==="attr-value"?wt(B)===L||bt(B)===y&&nt(B.parentNode.parentNode,"group")===$:Gt(B)===I});return j.length===0?void 0:{changes:{"":j.reverse().map(B=>({range:ze(B),newText:x}))}}}async provideHover(f,g){if(!this.data)return;const x=await R(this,a,Le).call(this,f);let{offsetNode:v,offset:h}=ln(x,w(this,e),g);v.type==="text"&&(h+=v.getRelativeIndex(),v=v.parentNode);const{type:S,parentNode:y,length:$,name:L}=v;let I,j,B,O;if(v.is("double-underscore")&&h>0)I=R(this,a,Nn).call(this,v.name);else if(S==="magic-word-name")I=R(this,a,yt).call(this,y.name),j=v.text().trim(),B=y.getAttribute("colon");else if(v.is("magic-word")&&!v.modifier&&$===1&&(h>0||x.posFromIndex(v.getAbsoluteIndex()).left===g.character))I=R(this,a,yt).call(this,L),j=v.firstChild.text().trim(),B=v.getAttribute("colon");else if((v.is("magic-word")||v.is("template"))&&v.modifier&&h>=2&&v.getRelativeIndex(0)>h&&(j=v.modifier.trim().slice(0,-1),I=R(this,a,yt).call(this,j.toLowerCase()),B=":",I)){const E=v.getAbsoluteIndex();O={start:vt(x,E+2),end:vt(x,E+v.modifier.trimEnd().length+1)}}return I&&{contents:{kind:"markdown",value:(I.signatures?`${I.signatures.map(E=>`- **{{ ${j}${E.length===0?"**":`${B}** `}${E.map(({label:D,const:W})=>W?D:`*${D}*`).join(" **|** ")} **}}**`).join(`
|
|
18
|
+
${l.shift()}`,u;const a=(d,c)=>{if(!c){o+=d;return}const{lastChild:f}=c;if(Xl(c)){const g=new z(d,i,r);g.type="table-inter",g.setAttribute("stage",3),c.insertAt(g)}else f.setText(f.toString()+d)};for(const d of l){u=n.pop();const[c]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(d),f=d.slice(c.length),g=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(f);if(g){for(;u&&!u.is("td");)u=n.pop();const[,p,h,m,x]=g;p&&new or(p,i,r),a(`
|
|
19
|
+
${c}${p&&`\0${r.length-1}d`}${h}\0${r.length}b`,u),n.push(...u?[u]:[],new Rs(m,x,i,r));continue}else if(!u){o+=`
|
|
20
|
+
${d}`;continue}const y=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(f);if(!y){a(`
|
|
21
|
+
${d}`,u),n.push(u);continue}const[,$,k,_,T]=y;if($){for(;!u.is("table");)u=n.pop();u.close(`
|
|
22
|
+
${c}${$}`,!0),a(T,n[n.length-1])}else if(k){u=Gi(u,n),u.is("tr")&&(u=n.pop());const p=new Fo(`
|
|
23
|
+
${c}${k}`,T,i,r);n.push(u,p),u.insertAt(p)}else{u=Gi(u,n);const p=_==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let h=p.exec(T),m=0,x=`
|
|
24
|
+
${c}${_}`;const S=v=>{const w=new qs(x,T.slice(m,h==null?void 0:h.index),i,r);return v.insertAt(w),w};for(;h;)S(u),{lastIndex:m}=p,[x]=h,h=p.exec(T);n.push(u,S(u))}}return o.slice(1)}}}),at,Oo=I({"../cm-util/dist/index.mjs"(){"use strict";at=e=>!/^_{2}.+_{2}$/u.test(e)}}),Bo,cd=I({"src/nowiki/hr.ts"(){"use strict";ft(),Bo=class extends Be{get type(){return"hr"}}}}),Kl,Vi,Yl,ts,hd=I({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;pt(),Ze(),ft(),Kl=[Ye(),He("__")],ts=(t=class extends(Yl=Be){constructor(i,r,n,l,o){var c,f;super(i,l,o);R(this,e);const u=i.toLowerCase(),{doubleUnderscore:[,,a,d]}=l;this.setAttribute("name",(f=r?(c=d==null?void 0:d[i])==null?void 0:c.toLowerCase():a==null?void 0:a[u])!=null?f:u),E(this,e,n)}get type(){return"double-underscore"}toString(){const i=b(this,e)?"__":"__";return i+this.innerText+i}print(){const i=b(this,e)?"__":"__";return super.print({pre:i,post:i})}},e=new WeakMap,t),Vi=ae(Yl),ts=re(Vi,0,"DoubleUnderscoreToken",Kl,ts),ne(Vi,1,ts)}}),qo={};le(qo,{parseHrAndDoubleUnderscore:()=>Wo});var Wo,gd=I({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Oo(),cd(),hd(),Za(),Wo=({firstChild:{data:e},type:t,name:s},i,r)=>{var a,d,c;const{doubleUnderscore:[n,l,o]}=i,u=[...n,...l];return(a=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(n.filter(at))),(d=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l.filter(at))),(c=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${u.filter(at).join("|")})__|_{2}(${u.filter(f=>!at(f)).map(f=>f.slice(2,-2)).join("|")})_{2}`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(f,g,y)=>(new Bo(y,i,r),`${g}\0${r.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(f,g,y)=>{var p;const $=g!=null?g:y,k=i.sensitiveDoubleUnderscore.has($),_=$.toLowerCase(),T=i.insensitiveDoubleUnderscore.has(_);return k||T?(new ts($,k,!!y,i,r),`\0${r.length-1}${T&&((p=o==null?void 0:o[_])!=null?p:_)==="toc"?"u":"n"}`):f}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(f,g,y,$,k)=>{const _=`${g}\0${r.length}h`;return new At(y.length,[$,k],i,r),_})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Uo,pd=I({"src/nowiki/quote.ts"(){"use strict";var e,t;Y(),ve(),G(),ft(),Uo=(t=class extends Be{constructor(i,r,n,l){super(i,n,l);R(this,e);E(this,e,r)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:b(this,e).bold}:void 0,...this.italic?{italic:b(this,e).italic}:void 0}}text(){const{parentNode:i,innerText:r}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":r}lint(i=this.getAbsoluteIndex()){var r;{const{previousSibling:n,bold:l,closing:o}=this,u=(n==null?void 0:n.type)==="text"?n.data:void 0,a=[],d=new ge(this,i),c=["lonely-apos","bold-header"],{lintConfig:f}=N,{computeEditInfo:g}=f,y=[void 0,"word"].map(k=>f.getSeverity(c[0],k)),$=f.getSeverity(c[1]);if(u!=null&&u.endsWith("'")){const k=y[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(u)?1:0];if(k){const _=Z(this,d,c[0],N.msg("lonely","'"),k),{startLine:T,startCol:p}=_,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(u),m=i-h,x={..._,startIndex:m,endIndex:i,endLine:T,startCol:p-h,endCol:p};g&&(x.suggestions=[Et(m,"'",h),ee(x)]),a.push(x)}}if($&&l&&((r=this.closest("heading-title,ext"))==null?void 0:r.type)==="heading-title"){const k=Z(this,d,c[1],"bold-in-header",$);g&&(k.suggestions=[ee(k)]),a.push(k)}return a}}json(i,r=this.getAbsoluteIndex()){{const n=super.json(void 0,r);return Object.assign(n,{bold:this.bold,italic:this.italic}),n}}},e=new WeakMap,t)}}),Mo={};le(Mo,{parseQuotes:()=>ur});var ur,zo=I({"parser/quotes.ts"(){"use strict";pd(),ur=(e,t,s,i)=>{var g;const r=e.split(/('{2,})/u),{length:n}=r;if(n===1)return e;let l=0,o=0,u,a,d;for(let y=1;y<n;y+=2){const $=r[y].length;switch($){case 2:o++;break;case 4:r[y-1]+="'",r[y]="'''";case 3:if(l++,u!==void 0)break;r[y-1].endsWith(" ")?a===void 0&&d===void 0&&(d=y):r[y-1].slice(-2,-1)===" "?u=y:a!=null||(a=y);break;default:r[y-1]+="'".repeat($-5),r[y]="'''''",o++,l++}}if(o%2===1&&l%2===1){const y=(g=u!=null?u:a)!=null?g:d;y!==void 0&&(r[y]="''",r[y-1]+="'")}let c=!0,f=!0;for(let y=1;y<n;y+=2){const $=r[y].length,k=$!==2,_=$!==3;k&&(c=!c),_&&(f=!f),new Uo(r[y],{bold:k&&c,italic:_&&f},t,s),r[y]=`\0${s.length-1}q`}return r.join("")}}}),Ho={};le(Ho,{parseExternalLinks:()=>dr});var dr,Do=I({"parser/externalLinks.ts"(){"use strict";me(),xo(),rr(),dr=(e,t,s,i)=>{var r;return(r=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${It}|\0\d+m\x7F)${Nt}(?=[[\]<>"\t${Je}]|\0\d)))([${Je}]*(?![${Je}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,l,o,u)=>{const{length:a}=s,d=/&[lg]t;/u.exec(l);return d&&(o="",u=l.slice(d.index)+o+u,l=l.slice(0,d.index)),i?(new ps(l,"ext-link-url",t,s),`[\0${a}f${o}${u}]`):(new $t(l,o,u,t,s),`\0${a}w`)})}}}),Go,fd=I({"src/link/category.ts"(){"use strict";me(),zs(),Go=class extends Ve{get type(){return"category"}get sortkey(){{const{childNodes:[,e]}=this;return e&&us(e.text())}}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t),{sortkey:i}=this;return i&&(s.sortkey=i),s}}}}}),Vo={};le(Vo,{parseLinks:()=>Tn});var Zl,Tn,md=I({"parser/links.ts"(){"use strict";me(),G(),zo(),Do(),mo(),uo(),fd(),Zl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,Tn=(e,t,s,i,r)=>{var u;(u=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,l=e.split("[[");let o=l.shift();for(let a=0;a<l.length;a++){let d=!1,c,f,g,y;const $=l[a],k=n.exec($);if(k)[,c,f,g,y]=k,y.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",y=y.slice(1));else{const x=Zl.exec($);x&&(d=!0,[,c,f,g]=x)}if(c===void 0||t.regexLinks.test(c)||/\0\d+[exhbru]\x7F/u.test(c)){o+=`[[${$}`;continue}let _=Ce(c).trim();const T=_.startsWith(":");if(T&&d){o+=`[[${$}`;continue}else!_&&g&&!g.includes(`
|
|
25
|
+
`)&&(_=Ce(g).trim());const{ns:p,valid:h}=N.normalizeTitle(_,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:i});if(h){if(d){if(p!==6){o+=`[[${$}`;continue}let x=!1;for(a++;a<l.length;a++){const S=l[a],v=S.split("]]");if(v.length>2){x=!0,g+=`[[${v[0]}]]${v[1]}`,y=v.slice(2).join("]]");break}else if(v.length===2)g+=`[[${v[0]}]]${v[1]}`;else{g+=`[[${S}`;break}}if(g=Tn(g,t,s,i,r),!x){o+=`[[${c}${f}${g}`;continue}}}else{o+=`[[${$}`;continue}g&&(g=ur(g,t,s,r));let m=nr;T||(p===6?(g&&(g=dr(g,t,s,!0)),m=ir):p===14&&(m=Go)),g===void 0&&f&&(g=""),o+=`\0${s.length}l${y}`,new m(c,g,t,s,f)}return o}}}),Qo={};le(Qo,{parseMagicLinks:()=>Jo});var Qi,Ji,Xi,Ki,Jo,xd=I({"parser/magicLinks.ts"(){"use strict";me(),rr(),Qi=String.raw`[${Je}\t]| |�*160;|�*a0;`,Ji=`(?:${Qi})+`,Xi=`(?:${Qi}|-)`,Ki=String.raw`(?:RFC|PMID)${Ji}\d+\b|ISBN${Ji}(?:97[89]${Xi}?)?(?:\d${Xi}?){9}[\dx]\b`,Jo=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${It}${Nt})|${Ki})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${It}${Nt})|${Ki})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){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 a=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=a.exec(l);if(d){let c=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,d.index))&&(c=2),o=l.slice(d.index+c)+o,l=l.slice(0,d.index+c)}return o.length>=n.length?i:(new ps(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new ps(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),Xo,vd=I({"util/html.ts"(){"use strict";Xo=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Ko,bd=I({"src/nowiki/list.ts"(){"use strict";Eo(),Ko=class extends ar{get type(){return"list"}}}}),Yo={};le(Yo,{parseList:()=>Zo});var Zo,yd=I({"parser/list.ts"(){"use strict";vd(),bd(),jo(),Zo=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,u]=r,a=o.replace(/;/gu,":"),d=Xo(a,t.lastPrefix),c=((d>1?o.slice(d-1):o)+u).split(/(?=;)/u),f=c[0].startsWith(";");let g=c.length-(f?0:1);if(d>1){const A=o.slice(0,d-1);if(f){const C=A.split(/(?=;)/u);c.unshift(...C),g+=A.includes(";")?C.length:0}else c[0]=A+c[0]}t.lastPrefix=a;let y=l+c.map((A,C)=>`\0${i.length+C}d`).join("")+e.slice(n.length);for(const A of c)new Ko(A,s,i);if(!g)return y;const{html:[$,,k]}=s,_=/:+|-\{|\0\d+[xq]\x7F/gu;let T=_,p=T.exec(y),h=0,m=!1,x=!1,S=0;const v=(A,C)=>(new or(A,s,i),`${y.slice(0,C)}\0${i.length-1}d${y.slice(C+A.length)}`),w=A=>{A?h&&h--:h++};for(;p&&g;){const{0:A,index:C}=p;if(A==="-{"){if(!S){const{lastIndex:L}=T;T=/-\{|\}-/gu,T.lastIndex=L}S++}else if(A==="}-"){if(S--,!S){const{lastIndex:L}=T;T=_,T.lastIndex=L}}else if(A.endsWith("x")){const{name:L,closing:B,selfClosing:q}=i[Number(A.slice(1,-2))];($.includes(L)||!q&&!k.includes(L))&&w(B)}else if(A.endsWith("q")){const{bold:L,italic:B}=i[Number(A.slice(1,-2))];L&&(w(m),m=!m),B&&(w(x),x=!x)}else if(h===0){if(A.length>=g)return v(A.slice(0,g),C);g-=A.length,T.lastIndex=C+4+String(i.length).length,y=v(A,C)}p=T.exec(y)}return y}}}),Ts,ea,Yi,ta,ss,wd=I({"src/converterFlags.ts"(){"use strict";var e,t;Y(),ve(),Ms(),G(),J(),ht(),Ts=new Set(["A","T","R","D","-","H","N"]),ea=[ms()],ss=(t=class extends(ta=z){constructor(i,r,n=[]){super(void 0,r,n,{});R(this,e);this.safeAppend(i.map(l=>new qe(l,"converter-flag",r,n)))}get type(){return"converter-flags"}afterBuild(){E(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(b(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(b(this,e).filter(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return typeof i=="object"&&(i=i.text().trim(),r=this.getVariantFlags(),n=this.getUnknownFlags(),l=new Set(b(this,e).filter(o=>Ts.has(o)))),!!i&&!r.has(i)&&!n.has(i)&&(r.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),r){{const n=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(b(this,e).filter(k=>Ts.has(k))),u=b(this,e).filter(k=>!k).length,a=b(this,e).length-l.size-u,{lintConfig:d}=N,{computeEditInfo:c,fix:f}=d,g=super.lint(i,r);if(n.size===a||o.size===a)return g;const y="no-ignored",$=d.getSeverity(y,"conversionFlag");if($){const k=new ge(this,i);for(let _=0;_<this.length;_++){const T=this.childNodes[_],p=T.text().trim();if(this.isInvalidFlag(p,n,l,o)){const h=Q(T,k,y,"invalid-conversion-flag",$);(c||f)&&(n.size===0&&Ts.has(p.toUpperCase())?h.fix=Mn(h,p):c&&(h.suggestions=[ee(h,_&&-1)])),g.push(h)}}}return g}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Yi=ae(ta),ss=re(Yi,0,"ConverterFlagsToken",ea,ss),ne(Yi,1,ss)}}),Cs,Ps,Sd=I({"src/converterRule.ts"(){"use strict";Me(),G(),J(),ht(),Cs=(e,t,s,i)=>{const r=new z(e,s,i);return r.type=`converter-rule-${t}`,r.setAttribute("stage",ke),r},Ps=class extends z{get type(){return"converter-rule"}get variant(){var e,t;return(t=(e=this.childNodes[this.length-2])==null?void 0:e.text().trim().toLowerCase())!=null?t:""}constructor(e,t=!0,s=N.getConfig(),i=[]){super(void 0,s,i,{});const r=e.indexOf(":"),n=e.slice(0,r).indexOf("=>"),l=n===-1?e.slice(0,r):e.slice(n+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new qe(l,"converter-rule-variant",s,i)),super.insertAt(Cs(e.slice(r+1),"to",s,i)),n!==-1&&super.insertAt(Cs(e.slice(0,n),"from",s,i),0)):super.insertAt(Cs(e,"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);return s.variant=this.variant,s}}}}}),sa,Zi,ia,is,Ad=I({"src/converter.ts"(){"use strict";me(),Ze(),ze(),J(),wd(),Sd(),sa=[We,He("-{")],is=class extends(ia=z){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new ss(e,s,i));const[r]=t,n=r.includes(":"),l=new Ps(r,n,s,i);n&&l.length===1||!n&&t.length===2&&!Ce(t[1]).trim()?this.insertAt(new Ps(t.join(";"),!1,s,i)):this.safeAppend([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()}|${ct(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>`}},Zi=ae(ia),is=re(Zi,0,"ConverterToken",sa,is),ne(Zi,1,is)}}),eu={};le(eu,{parseConverter:()=>tu});var tu,kd=I({"parser/converter.ts"(){"use strict";Ad(),tu=(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,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:a,index:d}=o;if(a==="}-"){const c=n.pop(),{length:f}=s,g=e.slice(c.index+2,d),y=g.indexOf("|"),[$,k]=y===-1?[[],g]:[g.slice(0,y).split(";"),g.slice(y+1)],_=k.replace(/(&[#a-z\d]+);/giu,"$1"),T=_.split(t.regexConverter).map(p=>p.replace(/\x01/gu,";"));new is($,T,t,s),e=`${e.slice(0,c.index)}\0${f}v${e.slice(d+2)}`,n.length===0&&(l=i),l.lastIndex=c.index+3+String(f).length}else n.push(o),l=r,l.lastIndex=d+2;o=l.exec(e)}return e}}}),ls={};le(ls,{Token:()=>z});var na,z,J=I({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,u,su,iu,nu,ru,lu,au,ou,uu,du,cu,hu,gu,m;me(),Me(),Y(),Re(),G(),Bu(),Wu(),na=["category","html-attr#id,ext-attr#id,table-attr#id"],z=(m=class extends Vt{constructor(v,w=N.getConfig(),A=[],C){super();R(this,u);R(this,e,"plain");R(this,t,0);R(this,s);R(this,i);R(this,r);R(this,n,!1);R(this,l);R(this,o);typeof v=="string"&&this.insertAt(v),E(this,s,w),E(this,i,A),A.push(this)}get type(){return b(this,e)}set type(v){E(this,e,v)}get pageName(){return b(this.getRootNode(),o)}set pageName(v){if(v){const w=this.normalizeTitle(v,0,{temporary:!0,page:""});E(this,o,w.valid?w.title:void 0)}else E(this,o,v===""?"":void 0)}parseOnce(v=b(this,t),w=!1,A){if(v<b(this,t)||this.length===0||!this.isPlain())return this;if(b(this,t)>=ke)return this;switch(v){case 0:if(this.type==="root"){b(this,i).pop();const C=j(this,u,su).call(this);w&&(w=!C)}E(this,r,w),j(this,u,iu).call(this,w);break;case 1:j(this,u,nu).call(this);break;case 2:j(this,u,ru).call(this);break;case 3:j(this,u,lu).call(this);break;case 4:j(this,u,au).call(this);break;case 5:j(this,u,ou).call(this,A);break;case 6:j(this,u,uu).call(this,A);break;case 7:j(this,u,du).call(this);break;case 8:j(this,u,cu).call(this);break;case 9:j(this,u,hu).call(this);break;case 10:j(this,u,gu).call(this)}if(this.type==="root")for(const C of b(this,i))C==null||C.parseOnce(v,w,A);return gr(this,t)._++,this}buildFromStr(v,w){const A=v.split(/[\0\x7F]/u).map((C,L)=>{if(L%2===0)return new vn(C);if(isNaN(C.slice(-1)))return b(this,i)[Number(C.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${C}`)});return w===0?A.map(String).join(""):w===1?ct(A):A}build(){E(this,t,ke);const{length:v,firstChild:w}=this,A=w==null?void 0:w.toString();if(v===1&&w.type==="text"&&A.includes("\0")&&(fs(this,0,1,this.buildFromStr(A)),this.normalize(),this.type==="root"))for(const C of b(this,i))C==null||C.build()}afterBuild(){if(this.type==="root")for(const v of b(this,i))v==null||v.afterBuild();E(this,n,!0)}parse(v=ke,w,A){for(v=Math.min(v,ke);b(this,t)<v;)this.parseOnce(b(this,t),w,A);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===m}getAttribute(v){var w;switch(v){case"config":return b(this,s);case"include":return(w=b(this,r))!=null?w:!!b(this.getRootNode(),r);case"accum":return b(this,i);case"built":return b(this,n);case"stage":return b(this,t);case"invalid":return this.type==="table-inter"&&rs(this)===2;default:return super.getAttribute(v)}}setAttribute(v,w){switch(v){case"stage":b(this,t)===0&&this.type==="root"&&b(this,i).shift(),E(this,t,w);break;default:super.setAttribute(v,w)}}insertAt(v,w=this.length){const A=typeof v=="string"?new vn(v):v;super.insertAt(A,w);const{type:C}=A;return C==="root"&&(A.type="plain"),A}normalizeTitle(v,w=0,A){return N.normalizeTitle(v,w,this.getAttribute("include"),b(this,s),{page:this.pageName,...A})}inTableAttrs(){var v,w;return((v=this.closest("table-attrs,ext"))==null?void 0:v.type)==="table-attrs"&&((w=this.closest("table-attrs,arg,magic-word,template"))!=null&&w.is("table-attrs")?2:1)}inHtmlAttrs(){var v;return(v=this.closest("html-attrs,ext"))!=null&&v.is("html-attrs")?2:this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),w){var A;{const{lintConfig:C}=N,{computeEditInfo:L,fix:B,ignoreDisables:q,configurationComment:O}=C;let W=super.lint(v,w);if(this.type==="root"){const F=new Map,P="no-duplicate",U=["category","id"].map(H=>C.getSeverity(P,H)),M=this.toString(),ie=na.filter((H,V)=>U[V]).join();if(ie){for(const H of this.querySelectorAll(ie)){let V;if(H.is("category"))V=H.name;else{const X=H.getValue();X&&X!==!0&&(V=`#${X}`)}if(V){const X=F.get(V);X?X.add(H):F.set(V,new Set([H]))}}for(const[H,V]of F)if(V.size>1&&!H.startsWith("#mw-customcollapsible-")){const X=!H.startsWith("#"),oe=`duplicate-${X?"category":"id"}`,de=U[X?0:1];W.push(...[...V].map(ce=>{const ue=Z(ce,{start:ce.getAbsoluteIndex()},P,oe,de);return L&&X&&(ue.suggestions=[ee(ue)]),ue}))}}if(!q){const H=new RegExp(String.raw`<!--\s*${O}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),V=[];let X=H.exec(M);for(;X;){const{1:oe,index:de}=X,ce=(A=X[2])==null?void 0:A.trim();V.push({line:this.posFromIndex(de).top+(oe==="disable-line"?0:1),from:oe==="disable"?H.lastIndex:void 0,to:oe==="enable"?H.lastIndex:void 0,rules:ce?new Set(ce.split(",").map(ue=>ue.trim())):void 0}),X=H.exec(M)}W=W.filter(({rule:oe,startLine:de,startIndex:ce})=>{const ue={pos:0};for(const{line:pe,from:ye,to:D,rules:K}of V){if(pe>de+1)break;if(K&&!K.has(oe))continue;if(pe===de&&ye===void 0&&D===void 0)return!1;ye<=ce&&ye>ue.pos?(ue.pos=ye,ue.type="from"):D<=ce&&D>ue.pos&&(ue.pos=D,ue.type="to")}return ue.type!=="from"})}if(B&&W.some(({fix:H})=>H)){const H=W.map(({fix:oe})=>oe).filter(Boolean).sort(({range:[oe,de]},{range:[ce,ue]})=>de===ue?ce-oe:ue-de);let V=1/0,X=M;for(const{range:[oe,de],text:ce}of H)de<=V&&(X=X.slice(0,oe)+ce+X.slice(de),V=oe);Object.assign(W,{output:X})}if(!L)for(const H of W)delete H.fix,delete H.suggestions}return W}}toString(v,w){return v?super.toString(!0,w):ut(b(this,l),()=>super.toString(!1,w),A=>{const C=this.getRootNode();C.type==="root"&&b(C,n)&&E(this,l,A)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakMap,u=new WeakSet,su=function(){const{parseRedirect:v}=(zu(),se(Wa)),w=this.firstChild.toString(),A=v(w,b(this,s),b(this,i));return A&&this.setText(A),!!A},iu=function(v){const{parseCommentAndExt:w}=(Qs(),se(_o));this.setText(w(this.firstChild.toString(),b(this,s),b(this,i),v))},nu=function(){const{parseBraces:v}=(sr(),se(to)),w=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,A=v(w,b(this,s),b(this,i));this.setText(this.type==="root"?A:A.slice(1))},ru=function(){if(b(this,s).excludes.includes("html"))return;const{parseHtml:v}=(ad(),se(To));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))},lu=function(){if(b(this,s).excludes.includes("table"))return;const{parseTable:v}=(dd(),se(Ro));this.setText(v(this,b(this,s),b(this,i)))},au=function(){if(b(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(gd(),se(qo));this.setText(v(this,b(this,s),b(this,i)))},ou=function(v){const{parseLinks:w}=(md(),se(Vo));this.setText(w(this.firstChild.toString(),b(this,s),b(this,i),this.pageName,v))},uu=function(v){if(b(this,s).excludes.includes("quote"))return;const{parseQuotes:w}=(zo(),se(Mo)),A=this.firstChild.toString().split(`
|
|
26
|
+
`);for(let C=0;C<A.length;C++)A[C]=w(A[C],b(this,s),b(this,i),v);this.setText(A.join(`
|
|
27
|
+
`))},du=function(){if(b(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:v}=(Do(),se(Ho));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))},cu=function(){if(b(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:v}=(xd(),se(Qo));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))},hu=function(){if(b(this,s).excludes.includes("list"))return;const{parseList:v}=(yd(),se(Yo)),{firstChild:w,type:A,name:C}=this,L=w.toString().split(`
|
|
28
|
+
`),B={lastPrefix:""};let q=A==="root"||A==="ext-inner"&&C==="poem"?0:1;for(;q<L.length;q++)L[q]=v(L[q],B,b(this,s),b(this,i));this.setText(L.join(`
|
|
29
|
+
`))},gu=function(){if(b(this,s).variants.length>0){const{parseConverter:v}=(kd(),se(eu));this.setText(v(this.firstChild.toString(),b(this,s),b(this,i)))}},m)}}),be,Js,fs,Re=I({"util/debug.ts"(){"use strict";be={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(J(),se(ls)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Js=e=>t=>t.type===e,fs=(e,t,s,i=[])=>{var l,o;let r=e.getChildNodes(),n;r.length===s?(n=r,r=i):n=Array.prototype.splice.apply(r,[t,s,...i]);for(let u=0;u<i.length;u++){const a=i[u];a.setAttribute("parentNode",e),a.setAttribute("nextSibling",r[t+u+1]),a.setAttribute("previousSibling",r[t+u-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(o=r[t+i.length])==null||o.setAttribute("previousSibling",r[t+i.length-1]),r===i&&e.setAttribute("childNodes",r),n}}}),vt,en,Is,tn,ra,sn,la,Cn,$d=I({"lib/lintConfig.ts"(){"use strict";var e,t;Bn(),vt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),en={"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"invalid-url":1,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(en),Is={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(Is),tn=s=>vt.has(s),ra=s=>tn(s)||Array.isArray(s)&&tn(s[0])&&(s.length===1||typeof s[1]=="object"),sn=(s,i,r)=>{if(as.includes(i)){if(r===void 0)return!1;if(ra(r))return s[i]=r,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(r)}`)},la=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(en))),!!s)for(const[i,r]of Object.entries(s))sn(this,i,r)}getSeverity(s,i){var n,l;const r=this[s];return typeof r!="object"?vt.get(r):i&&(l=vt.get((n=r[1])==null?void 0:n[i]))!=null?l:vt.get(r[0])}},Cn=(t=class{constructor(s){R(this,e);if(Object.assign(this,Is),s&&!("rules"in s)&&Object.keys(s).some(i=>as.includes(i)))this.rules=s;else{const{rules:i,...r}=s!=null?s:{};this.rules=i;for(const[n,l]of Object.entries(r))l!==void 0&&Object.prototype.hasOwnProperty.call(Is,n)&&(this[n]=l)}}get rules(){return b(this,e)}set rules(s){E(this,e,new Proxy(new la(s),{set:sn,deleteProperty(){return!1}}))}getSeverity(s,i){return b(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),pu={};le(pu,{Title:()=>fu});var nn,fu,_d=I({"lib/title.ts"(){"use strict";var e,t,s,i,r,n,mu,o;Ke(),me(),nn=u=>{const[,{length:a},d]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(u);return[a/3,d]},fu=(o=class{constructor(u,a,d,{temporary:c,decode:f,selfLink:g,page:y}={}){R(this,n);R(this,e);R(this,t);R(this,s);R(this,i);R(this,r);Ne(this,"page");Ne(this,"valid");Ne(this,"encoded",!1);this.page=y;const $=u.trim(),k=$.startsWith("../");if(f&&u.includes("%"))try{const h=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(u);u=cs(u),this.encoded=h}catch{}if(u=us(u).replace(/[_ ]+/gu," ").trim(),k||y&&$.startsWith("/"))E(this,i,0);else{let h=a;u.startsWith(":")&&(h=0,u=u.slice(1).trim());const m=u.split(":");if(m.length>1){const x=Lt(m[0]),S=Object.prototype.hasOwnProperty.call(d.nsid,x)&&d.nsid[x];S&&(h=S,u=m.slice(1).join(":").trim())}E(this,i,h)}const _=u.indexOf("#");if(_!==-1){let h=u.slice(_).trim().slice(1);if(h.includes("%"))try{h=cs(h)}catch{}E(this,r,h.replace(/ /gu,"_")),u=u.slice(0,_).trim()}const[T,p]=k?nn(u):[0,u];this.valid=!!(u||g&&this.ns===0&&b(this,r)!==void 0)&&us(u)===u&&(T===0||y===void 0||y.split("/",T+1).length>T)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(p),this.main=u,E(this,t,d.namespaces),E(this,s,d.articlePath||"/wiki/$1"),b(this,s).includes("$1")||E(this,s,b(this,s)+`${b(this,s).endsWith("/")?"":"/"}$1`),c||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return b(this,i)}get fragment(){return b(this,r)}get main(){return b(this,e)}set main(u){u=u.replace(/_/gu," ").trim(),E(this,e,u&&u[0].toUpperCase()+u.slice(1))}get prefix(){const u=b(this,t)[this.ns];return u+(u&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:u}=this,a=u.lastIndexOf(".");return a===-1?void 0:u.slice(a+1).toLowerCase()}getRedirection(){const{prefix:u}=this,a=u;return j(this,n,mu).call(this,a)}setFragment(u){E(this,r,u)}getUrl(u){{typeof u=="string"&&(E(this,s,u),b(this,s).includes("$1")||E(this,s,b(this,s)+`${b(this,s).endsWith("/")?"":"/"}$1`));const{title:a,fragment:d}=this;return a?b(this,s).replace("$1",encodeURIComponent(a)+(d?`#${encodeURIComponent(d)}`:"")):d===void 0?"":`#${encodeURIComponent(d)}`}throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,mu=function(u){var d,c;let a=(u+this.main).replace(/ /gu,"_");if(a.startsWith("/"))a=((d=this.page)!=null?d:"")+a.replace(/(.)\/$/u,"$1");else if(a.startsWith("../")&&((c=this.page)!=null&&c.includes("/"))){const[f,g]=nn(a),y=this.page.split("/");y.length>f&&(a=y.slice(0,-f).join("/")+(g&&"/")+g)}return[!1,a]},o)}}),xu={};le(xu,{LanguageService:()=>vu,tasks:()=>In});var In,aa,oa,ua,da,rn,ca,ha,ga,pa,ln,fa,an,bt,on,De,Se,un,dn,yt,wt,st,Dt,cn,ma,vu,Td=I({"lib/lsp.ts"(){"use strict";var e,t,s,i,r,n,l,o,u,a,ns,Fe,Nn,Ln,Fn,bu,En,St,T;Ke(),Oo(),Bn(),Ga(),Y(),me(),G(),In=new WeakMap,aa=new Set(["ref"]),oa=new Set(["ref","references"]),ua=new Set(["name","follow"]),da=new Set(["group"]),rn=new Set(["arg-name","template-name","link-target","parameter-key"]),ca=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...rn]),ha=new Set(["text","comment","noinclude","include"]),ga=["ext","html","table"].map(p=>`${p}-attr#style`).join(),pa=ot(p=>new RegExp(`^(?:${p}|//)`,"iu")),ln=({type:p,parentNode:h,length:m,firstChild:x},S)=>p==="attr-value"&&m===1&&x.type==="text"&&(!S||h.name==="style"),fa=p=>p.is("html-attr")||p.is("table-attr"),an=p=>p.childNodes.every(({type:h})=>ha.has(h)),bt=(p,h)=>{const{top:m,left:x}=p.posFromIndex(h);return{line:m,character:x}},on=(p,h,m)=>({start:bt(p,h),end:bt(p,m)}),De=p=>{const{top:h,left:m,height:x,width:S}=p.getBoundingClientRect();return{start:{line:h,character:m},end:hs(h,m,x,S)}},Se=(p,h,m,{line:x,character:S},v,w)=>[...new Set(p)].map(A=>{var L;const C=(L=w==null?void 0:w(A))==null?void 0:L.description;return{label:A,kind:h,textEdit:{range:{start:{line:x,character:S-m.length},end:{line:x,character:S}},newText:A+(v!=null?v:"")},...C&&{documentation:{kind:"markdown",value:C}}}}),un=(p,h,{line:m,character:x})=>{const S=p.indexFromPos(m,x);return p.caretPositionFromIndex(S+Number(/\w/u.test(h.charAt(S))))},dn=(p,h,m)=>{const{type:x,parentNode:S={}}=p,{name:v,tag:w}=S;return x==="attr-value"&&h.has(w)&&m.has(v)?p.toString().trim():NaN},yt=p=>dn(p,aa,ua),wt=p=>dn(p,oa,da),st=(p,h)=>{const m=p==null?void 0:p.getAttr(h);return m!==!0&&m||!1},Dt=p=>{const{type:h,name:m,parentNode:x}=p;switch(h){case"heading":return p.level;case"heading-title":return x.level;case"parameter-key":return`${x.parentNode.name}|${x.name}`;case"ext":case"html":case"image-parameter":return m;default:return x.name}},cn=(p,h,m=!1)=>({range:on(p,...h.range),newText:h.text,title:`${m?"Fix":"Suggestion"}: ${h.desc}`,fix:m}),ma=(p,h)=>{const{lintConfig:m}=N,{rules:x,fix:S,computeEditInfo:v}=m;if(m.fix=!0,m.computeEditInfo=!1,h){m.rules=void 0;for(const A of as)m.rules[A]=A===h?x[A]:0}const{output:w}=p.lint();return m.fix=S,m.computeEditInfo=v,h&&(m.rules=x),w===void 0?[]:[{range:De(p),newText:w}]},vu=(T=class{constructor(p){R(this,a);R(this,e);R(this,t);R(this,s);R(this,i);R(this,r);R(this,n);R(this,l);R(this,o);R(this,u);Ne(this,"include",!0);Ne(this,"config");Ne(this,"data");In.set(p,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(p,h,m=!0){const x=await j(this,a,Fe).call(this,h);return x.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(S=>{const{type:v,childNodes:w}=S;return v!=="attr-value"&&!an(S)?[]:w.filter(A=>A.type==="text").reverse().flatMap(A=>{const{data:C}=A,L=Ia(C,m).filter(([,,,q])=>q);if(L.length===0)return[];const B=A.getAbsoluteIndex();return L.map(([q,O,W])=>{const F=p(q);return F.length===4&&{color:{red:F[0]/255,green:F[1]/255,blue:F[2]/255,alpha:F[3]},range:on(x,B+O,B+W)}}).filter(Boolean)})})}provideColorPresentations(p){const{color:{red:h,green:m,blue:x,alpha:S},range:v}=p,w=[h,m,x],A=S<1?`rgba(${w.map(C=>Math.round(C*255)).join()},${S})`:`#${w.map(Ca).join("")}`;return[{label:A,textEdit:{range:v,newText:A}}]}async provideCompletionItems(p,h){var X,oe,de,ce,ue,pe,ye;const{re:m,allTags:x,functions:S,switches:v,jaSwitches:w,protocols:A,params:C,tags:L,ext:B}=j(this,a,bu).call(this),{line:q,character:O}=h,W=p.split(/\r?\n/u,q+1)[q],F=m.exec((X=W==null?void 0:W.slice(0,O))!=null?X:""),[,,P={},U={}]=this.config.doubleUnderscore;if((F==null?void 0:F[1])!==void 0){const D=F[1].startsWith("/");return Se(x,"Class",F[1].slice(D?1:0),h,D&&!(W!=null&&W.slice(O).trim().startsWith(">"))?">":"")}else if(F!=null&&F[4]||F!=null&&F[5]&&w.length>0){const D=F[5]!==void 0;return Se(D?w:v,"Constant",F[D?5:4],h,"",K=>{if(this.data)D||(K=K.slice(2,-2));else return;return K in P?K=P[K]:K in U&&(K=U[K]),j(this,a,En).call(this,K.toLowerCase())})}else if((F==null?void 0:F[6])!==void 0)return Se(A,"Reference",F[6],h);const M=await j(this,a,Fe).call(this,p);let ie;if(F!=null&&F[2]){ie=M.elementFromPoint(F.index+F[2].length-1,q);const D=(oe=F[3])!=null?oe:"";if(F[2]==="{{{")return Se(M.querySelectorAll("arg").filter(te=>te.name&&te!==ie).map(({name:te})=>te),"Variable",D,h);const[K,Ae]=this.config.parserFunction,we=Array.isArray(Ae),Ie=W.charAt(O),et=D.startsWith(":"),_e=et?D.slice(1).trimStart():D;if(F[2]==="[[")return Se(M.querySelectorAll("link,file,category,redirect-target").filter(te=>te!==ie).map(({name:te})=>te),"Folder",_e,h);let mt=S;return Ie===":"?mt=S.filter(te=>!te.endsWith(":")):Ie===":"&&(mt=S.filter(te=>te.endsWith(":")).map(te=>te.slice(0,-1))),[...Se(mt,"Function",D,h,"",te=>{if(this.data)te in K?te=K[te]:!we&&te in Ae&&(te=Ae[te]);else return;return j(this,a,St).call(this,te.toLowerCase())}),...D.startsWith("#")?[]:Se(M.querySelectorAll("template").filter(te=>te!==ie).map(te=>{const{name:Le}=te;if(et)return Le;const{ns:xe}=te.getAttribute("title");return xe===0?`:${Le}`:xe===10?Le.slice(9):Le}),"Folder",_e,h)]}let H,V;if((F==null?void 0:F[8])===void 0&&(ie=M.elementFromPoint(O,q),{type:H,parentNode:V}=ie),(F==null?void 0:F[7])!==void 0||H==="image-parameter"){const D=M.indexFromPos(q,O),K=(ce=(de=F==null?void 0:F[7])==null?void 0:de.trimStart())!=null?ce:b(this,e).slice(ie.getAbsoluteIndex(),D).trimStart(),Ae=b(this,e)[D]==="=";return[...Se(C,"Property",K,h).filter(({label:we})=>!Ae||!/[= ]$/u.test(we)),...Se(M.querySelectorAll("image-parameter#width").filter(we=>we!==ie).map(we=>we.text()),"Unit",K,h)]}else if((F==null?void 0:F[8])!==void 0||H==="attr-key"){const D=(pe=(ue=F==null?void 0:F[8])==null?void 0:ue.toLowerCase())!=null?pe:V.tag,K=(ye=F==null?void 0:F[10])!=null?ye:ie.toString().slice(0,O-M.posFromIndex(ie.getAbsoluteIndex()).left);if(!L.has(D))return;const Ae=Kn[D],we=Yn[D],Ie=we&&Se(we,"Field",K,h);return B.includes(D)&&!Ae?Ie:[...Ie!=null?Ie:[],...D==="meta"||D==="link"?[]:Se(Xn,"Property",K,h),...Ae?Se(Ae,"Property",K,h):[],...Se(["data-"],"Variable",K,h),...Se(["xmlns:"],"Interface",K,h)]}else if(H==="parameter-key"||H==="parameter-value"&&V.anon){const D=V.parentNode,{type:K,name:Ae}=D;if(K==="magic-word"&&Ae!=="invoke")return;const we=b(this,e).slice(ie.getAbsoluteIndex(),M.indexFromPos(q,O)).trimStart(),{module:Ie,function:et}=D;return we?Se(M.querySelectorAll("parameter").filter(_e=>_e===V||_e.anon||_e.parentNode.type!==K||_e.parentNode.name!==Ae?!1:K==="template"?!0:_e.parentNode.module===Ie&&_e.parentNode.function===et).map(({name:_e})=>_e),"Variable",we,h,H==="parameter-value"?"=":""):void 0}else if(ln(ie)&&fa(V)){const D=Hn(V.tag,V.name);if(D.length===0)return;const K=b(this,e).slice(ie.getAbsoluteIndex(),M.indexFromPos(q,O)).trimStart();return Se(D,"Value",K,h)}}async provideDiagnostics(p,h=!0){const m=await j(this,a,Fe).call(this,p),{lintConfig:x}=N,S=x.fix;x.fix=!1;const v=m.lint();return x.fix=S,[(h?v:v.filter(({severity:L})=>L==="error")).map(({startLine:L,startCol:B,endLine:q,endCol:O,severity:W,rule:F,message:P,fix:U,suggestions:M})=>({range:{start:{line:L,character:B},end:{line:q,character:O}},severity:W==="error"?1:2,source:"WikiLint",code:F,message:P,data:[...U?[cn(m,U,!0)]:[],...M?M.map(ie=>cn(m,ie)):[]]})),[],[]].flat(2)}resolveCodeAction(p){if(p.kind!=="source.fixAll")return p;const{rule:h}=p.data;return{...p,edit:{changes:{"":ma(b(this,r),h)}}}}async provideFoldingRanges(p){const h=await j(this,a,Fe).call(this,p),{length:m}=h.getLines(),x=[],S=new Array(6),v=h.querySelectorAll("heading-title,table,template,magic-word");for(const w of[...v].reverse())w.getRelativeIndex();for(const w of v){const{offsetHeight:A}=w;if(w.type==="heading-title"||A>2){const{top:C}=h.posFromIndex(w.getAbsoluteIndex());if(w.type==="heading-title"){const{level:L}=w.parentNode;for(let B=L-1;B<6;B++){const q=S[B];q!==void 0&&q<C-1&&x.push({startLine:q,endLine:C-1,kind:"region"}),S[B]=void 0}S[L-1]=C+A-1}else x.push({startLine:C,endLine:C+A-2,kind:"region"})}}for(const w of S)w!==void 0&&w<m-1&&x.push({startLine:w,endLine:m-1,kind:"region"});return x}async provideLinks(p){var v;(v=this.config)!=null||(this.config=N.getConfig());const{articlePath:h,protocol:m}=this.config,x=h==null?void 0:h.includes("//"),S=pa(m);return(await j(this,a,Fe).call(this,p)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value${x?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""},image-parameter#link,image-parameter#manualthumb`).reverse().map(w=>{let A;w.is("magic-word")?({name:A}=w,w=w.childNodes[1].lastChild):w.is("image-parameter")&&({name:A}=w);const{type:C,parentNode:L,firstChild:B,lastChild:q,childNodes:O,length:W}=w,{tag:F}=L;if(A!=null||(A=L.name),!(C!=="attr-value"||A==="cite"&&["blockquote","del","ins","q"].includes(F)||A==="src"&&["templatestyles","img"].includes(F)||A==="templatename"&&F==="rss"||A==="file"&&F==="phonos")||!an(w))return!1;let P=O.filter(U=>U.type==="text").map(({data:U})=>U).join("").trim();if(!P)return!1;try{if(w.is("magic-link")||w.is("ext-link-url")||w.is("free-ext-link"))P=w.getUrl(h);else if(C==="link-target"&&(L.is("link")||L.is("redirect-target")||L.is("category"))){if(/^(?:\.\.)?\//u.test(P))return!1;P=L.link.getUrl(h)}else if(C==="link-target"||C==="template-name")P=L.getAttribute("title").getUrl(h);else if(["invoke-module","parameter-value"].includes(C)||C==="attr-value"&&(A==="src"&&F==="templatestyles"||A==="templatename"&&F==="rss"||A==="file"&&F==="phonos")||C==="image-parameter"&&(A==="manualthumb"||!S.test(P))){if(!x||P.startsWith("/"))return!1;C==="image-parameter"&&A==="manualthumb"||C==="parameter-value"&&A==="filepath"||C==="attr-value"&&F==="phonos"?P=`File:${P}`:C==="parameter-value"?P=`Widget:${P}`:C==="invoke-module"&&(P=`Module:${P}`);const U=N.normalizeTitle(P,C==="attr-value"?10:0,!1,this.config,{temporary:!0});if(!U.valid)return!1;P=U.getUrl()}if(typeof P=="string"&&P.startsWith("//")&&(P=`https:${P}`),P=new URL(P).href,C==="image-parameter"){const U=B.getBoundingClientRect(),{top:M,left:ie,height:H,width:V}=W===1?U:q.getBoundingClientRect();return{range:{start:{line:U.top,character:U.left},end:hs(M,ie,H,V)},target:P}}return{range:De(w),target:P}}catch{return!1}}).filter(Boolean)}async provideReferences(p,h){const m=await j(this,a,Fe).call(this,p),{offsetNode:x,offset:S}=un(m,b(this,e),h),v=x.type==="text"?x.parentNode:x,w=S===0&&(v.is("ext-attr-dirty")||v.is("html-attr-dirty"))?v.parentNode.parentNode:v,{type:A}=w,C=yt(w),L=wt(w);if(!C&&!L&&!ca.has(A))return;const B=Dt(w),q=m.querySelectorAll(A==="heading-title"?"heading":A).filter(O=>A==="attr-value"?yt(O)===C||wt(O)===L:Dt(O)===B).reverse().map(O=>({range:De(O.type==="parameter-key"?O.parentNode:O)}));return q.length===0?void 0:q}async provideDefinition(p,h){const m=await j(this,a,Fe).call(this,p),x=m.elementFromPoint(h.character,h.line),S=x.is("ext")&&x.name==="ref"?x:x.closest("ext#ref"),v=st(S,"name");if(!v)return;const w=st(S,"group"),A=m.querySelectorAll("ext#ref").filter(C=>C.innerText&&st(C,"name")===v&&st(C,"group")===w).reverse().map(({lastChild:C})=>({range:De(C)}));return A.length===0?void 0:A}async resolveRenameLocation(p,h){const m=await j(this,a,Fe).call(this,p),x=m.elementFromPoint(h.character,h.line),{type:S}=x,v=yt(x),w=wt(x);return!v&&!w&&(!rn.has(S)||S==="parameter-key"&&/^[1-9]\d*$/u.test(x.parentNode.name)||S==="link-target"&&!["link","redirect-target"].includes(x.parentNode.type))?void 0:De(x)}async provideRenameEdits(p,h,m){const x=await j(this,a,Fe).call(this,p),S=x.elementFromPoint(h.character,h.line),{type:v}=S,w=yt(S),A=w&&st(S.parentNode.parentNode,"group"),C=wt(S),L=Dt(S),B=x.querySelectorAll(v).filter(q=>{const{type:O}=q.parentNode;return v==="link-target"&&O!=="link"&&O!=="redirect-target"?!1:v==="attr-value"?wt(q)===C||yt(q)===w&&st(q.parentNode.parentNode,"group")===A:Dt(q)===L});return B.length===0?void 0:{changes:{"":B.reverse().map(q=>({range:De(q),newText:m}))}}}async provideHover(p,h){if(!this.data)return;const m=await j(this,a,Fe).call(this,p);let{offsetNode:x,offset:S}=un(m,b(this,e),h);x.type==="text"&&(S+=x.getRelativeIndex(),x=x.parentNode);const{type:v,parentNode:w,length:A,name:C}=x;let L,B,q,O;if(x.is("double-underscore")&&S>0)L=j(this,a,En).call(this,x.name);else if(v==="magic-word-name")L=j(this,a,St).call(this,w.name),B=x.text().trim(),q=w.getAttribute("colon");else if(x.is("magic-word")&&!x.modifier&&A===1&&(S>0||m.posFromIndex(x.getAbsoluteIndex()).left===h.character))L=j(this,a,St).call(this,C),B=x.firstChild.text().trim(),q=x.getAttribute("colon");else if((x.is("magic-word")||x.is("template"))&&x.modifier&&S>=2&&x.getRelativeIndex(0)>S&&(B=x.modifier.trim().slice(0,-1),L=j(this,a,St).call(this,B.toLowerCase()),q=":",L)){const W=x.getAbsoluteIndex();O={start:bt(m,W+2),end:bt(m,W+x.modifier.trimEnd().length+1)}}return L&&{contents:{kind:"markdown",value:(L.signatures?`${L.signatures.map(W=>`- **{{ ${B}${W.length===0?"**":`${q}** `}${W.map(({label:F,const:P})=>P?F:`*${F}*`).join(" **|** ")} **}}**`).join(`
|
|
30
30
|
`)}
|
|
31
31
|
|
|
32
|
-
`:"")+
|
|
33
|
-
${
|
|
34
|
-
`)}${
|
|
35
|
-
`}${
|
|
36
|
-
`),
|
|
32
|
+
`:"")+L.description},range:O!=null?O:De(x)}}async provideSignatureHelp(p,h){if(!this.data)return;const{line:m,character:x}=h,S=p.split(/\r?\n/u,m+1)[m],{lastChild:v}=await j(this,a,Ln).call(this,`${S.slice(0,x+/^[^{}<]*/u.exec(S.slice(x))[0].length)}}}`);if(!v.is("magic-word")||v.length===1)return;const{name:w,childNodes:A,firstChild:C}=v,L=j(this,a,St).call(this,w);if(!(L!=null&&L.signatures))return;const B=A.length-1,q=L.signatures.filter(P=>{var U;return(P.length>=B||((U=P[P.length-1])==null?void 0:U.rest))&&P.every(({label:M,const:ie},H)=>{var X;const V=ie&&H<B&&((X=A[H+1])==null?void 0:X.text().trim());return!V||M.toLowerCase().includes(V.toLowerCase())})});if(q.length===0)return;let O=-1;for(let P=v.getAbsoluteIndex()+v.getAttribute("padding");O<B&&(P+=A[O+1].toString().length+1,!(P>x));O++);const W=C.text().trim(),F=v.getAttribute("colon");return{signatures:q.map(P=>({label:`{{${W}${P.length===0?"":F}${P.map(({label:U})=>U).join("|")}}}`,parameters:P.map(({label:U,const:M})=>({label:U,...M?{documentation:"Predefined parameter"}:void 0})),...P.length<B?{activeParameter:Math.min(O,P.length-1)}:void 0})),activeParameter:O}}async provideInlayHints(p){const h=await j(this,a,Fe).call(this,p);let m=[];for(const x of h.querySelectorAll("template,magic-word#invoke").reverse()){const{type:S,childNodes:v}=x;m=[...m,...v.slice(S==="template"?1:3).filter(({anon:w})=>w).reverse().map(w=>({position:bt(h,w.getAbsoluteIndex()),label:`${w.name}=`,kind:2}))]}return m}findStyleTokens(){return b(this,r).querySelectorAll(ga).filter(({lastChild:p})=>ln(p))}async provideRefactoringAction(p,h){let m,x;if(h){const{start:w,end:A}=h;if(w.line===A.line&&w.character===A.character)return[];m=p.split(/\r?\n/u,A.line+1),x=w.line===A.line?m[A.line].slice(w.character,A.character):`${m[w.line].slice(w.character)}
|
|
33
|
+
${m.slice(w.line+1,A.line).join(`
|
|
34
|
+
`)}${m.length===2?"":`
|
|
35
|
+
`}${m[A.line].slice(0,A.character)}`}else if(p)m=p.split(/\r?\n/u),x=m.join(`
|
|
36
|
+
`),h={start:{line:0,character:0},end:{line:m.length-1,character:m[m.length-1].length}};else return[];const S=await j(this,a,Ln).call(this,x),{viewOnly:v}=N;return N.viewOnly=!1,S.escape(),N.viewOnly=v,[{title:"Escape with magic words",kind:"refactor.rewrite",edit:{changes:{"":[{range:h,newText:S.toString()}]}}}]}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakMap,u=new WeakMap,a=new WeakSet,ns=function(){return b(this,l)===this.config&&b(this,o)===this.include},Fe=async function(p){var h;return p=os(p),!b(this,s)&&j(this,a,ns).call(this)&&b(this,e)===p?b(this,r):(E(this,e,p),(h=b(this,s))!=null||E(this,s,j(this,a,Nn).call(this)),b(this,s))},Nn=async function(){var m;(m=this.config)!=null||(this.config=N.getConfig()),E(this,l,this.config),E(this,o,this.include);const p=b(this,e),h=await N.partialParse(p,()=>b(this,e),this.include,this.config);return j(this,a,ns).call(this)&&b(this,e)===p?(E(this,r,h),E(this,s,void 0),h):(E(this,s,j(this,a,Nn).call(this)),b(this,s))},Ln=async function(p){var h;return p=os(p),!b(this,i)&&j(this,a,ns).call(this)&&b(this,t)===p?b(this,n):(E(this,t,p),(h=b(this,i))!=null||E(this,i,j(this,a,Fn).call(this)),b(this,i))},Fn=async function(){var m;(m=this.config)!=null||(this.config=N.getConfig()),E(this,l,this.config),E(this,o,this.include);const p=b(this,t),h=await N.partialParse(p,()=>b(this,t),this.include,this.config);return j(this,a,ns).call(this)&&b(this,t)===p?(E(this,n,h),E(this,i,void 0),h):(E(this,i,j(this,a,Fn).call(this)),b(this,i))},bu=function(){var p;if(!b(this,u)||b(this,u)[1]!==this.config){(p=this.config)!=null||(this.config=N.getConfig());const{nsid:h,ext:m,html:x,parserFunction:[S,v,...w],doubleUnderscore:A,protocol:C,img:L}=this.config,B=new Set([m,x].flat(2)),q=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(_(?:_(?:(?!__|_{2})[\p{L}\p{N}_])*)?)`+"|"+String.raw`(_(?:_(?:(?!__|_{2})[\p{L}\p{N}_])*)?)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(h).filter(([,W])=>W===6).map(([W])=>W).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\9))?(?=\s))*)?\s(\w*)`+")$","iu"),O=A.slice(0,2).flat();E(this,u,[{re:q,ext:m,tags:B,allTags:[...B,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(S),Array.isArray(v)?v:Object.keys(v),w].flat(2),switches:O.filter(at).map(W=>`__${W}__`),jaSwitches:O.filter(W=>!at(W)),protocols:C.split("|"),params:Object.keys(L).filter(W=>W.endsWith("$1")||!W.includes("$1")).map(W=>W.replace(/\$1$/u,""))},this.config])}return b(this,u)[0]},En=function(p){return this.data.behaviorSwitches.find(({aliases:h})=>h.includes(p))},St=function(p){return this.data.parserFunctions.find(({aliases:h})=>h.some(m=>m.replace(/^#/u,"")===p))},T)}}),yu={};le(yu,{default:()=>N});wu.exports=se(yu);var Ns,hn,xa,it,gn,va,N,G=I({"index.ts"(){Bn(),Re(),Me(),me(),$d(),Ns=!0,hn=new Cn,it={config:fn,get rules(){return as},get i18n(){return{...Ta,...xa}},set i18n(e){xa=e},get lintConfig(){return hn},set lintConfig(e){hn=new Cn(e)},get viewOnly(){return Ns},set viewOnly(e){Ns&&!e&&be.rev++,Ns=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:r,variable:n}=t;for(let l=0;l<2;l++)s.length>l+2&&s[l].length===0&&(s[l]=Object.keys(s[l+2]));return i.includes("translate")&&!n.includes("translationlanguage")&&(n.push("translationlanguage"),Array.isArray(r[1])?r[1].push("TRANSLATIONLANGUAGE"):r[1].TRANSLATIONLANGUAGE="translationlanguage"),{...fn,...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=it.getConfig(),r){const{Title:n}=(_d(),se(pu));let l;if(r!=null&&r.halfParsed)l=new n(e,t,i,r);else{const{Token:o}=(J(),se(ls));l=be.run(()=>{const u=new o(e,i);u.type="root",u.pageName=r==null?void 0:r.page,u.parseOnce(0,s).parseOnce();const a=new n(u.toString(),t,i,r);u.build();for(const d of["main","fragment"]){const c=a[d];if(c!=null&&c.includes("\0")){const f=u.buildFromStr(c,1);d==="main"?a.main=f:a.setFragment(f)}}return a})}return l},parse(e,t,s,i,r){e=os(e);let n,l,o,u;typeof t=="string"?(n=!!s,l=i,o=r,u=t):(n=!!t,l=s,o=i,u=r),l!=null||(l=ke),o!=null||(o=this.getConfig());let a;typeof l!="number"&&(a=Array.isArray(l)?l:[l],l=Math.max(...a.map(f=>$a[f]||ke)));const{Token:d}=(J(),se(ls));return be.run(()=>{const f=new d(e,o);return f.type="root",f.pageName=u,f.parse(l,n)})},parseWithRef(e,t,s,i=t.getAttribute("include")){return this.parse(e,i,s,t.getAttribute("config"),t.pageName)},async partialParse(e,t,s,i=it.getConfig()){{const{Token:r}=(J(),se(ls)),n=typeof setImmediate=="function"?setImmediate:setTimeout,{running:l}=be;be.running=!0;const o=new r(os(e),i);o.type="root";let u=0;try{await new Promise(a=>{const d=()=>{t()===e?(u++,n(c,0)):a()},c=()=>{u===ke+1?(o.afterBuild(),a()):(o[u===ke?"build":"parseOnce"](u,s),d())};n(c,0)})}catch(a){throw be.running=l,a}return be.running=l,o}},createLanguageService(e={}){var t;{const s=(Td(),se(xu)),{LanguageService:i,tasks:r}=s;return(t=r.get(e))!=null?t:new i(e)}throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},gn={},va=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in it)va.has(e)||(gn[e]={enumerable:!1});Object.defineProperties(it,gn),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:it}),N=it}});G()});Cd();})();
|
|
37
37
|
//# sourceMappingURL=bundle-lsp.min.js.map
|