wikiparser-node 1.28.0 → 1.29.0
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 +25 -25
- package/bundle/bundle-lsp.min.js +30 -30
- package/bundle/bundle.min.js +24 -24
- package/config/default.json +15 -16
- package/config/jawiki.json +15 -16
- 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 +2 -0
- package/dist/base.mjs +3 -1
- package/dist/bin/config.js +11 -11
- 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 +7 -27
- package/dist/lib/element.js +1 -1
- package/dist/lib/lintConfig.js +4 -0
- package/dist/lib/lsp.d.ts +1 -12
- package/dist/lib/lsp.js +45 -79
- package/dist/lib/node.js +25 -25
- package/dist/lib/range.js +2 -2
- package/dist/lib/title.d.ts +3 -1
- package/dist/lib/title.js +54 -33
- package/dist/mixin/elementLike.js +14 -9
- package/dist/parser/commentAndExt.js +34 -27
- package/dist/parser/hrAndDoubleUnderscore.js +9 -8
- 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 +6 -9
- package/dist/src/attribute.js +37 -8
- package/dist/src/attributes.js +1 -1
- package/dist/src/converter.js +6 -3
- package/dist/src/converterRule.js +4 -6
- package/dist/src/extLink.js +3 -4
- package/dist/src/heading.js +1 -2
- package/dist/src/imageParameter.d.ts +4 -1
- package/dist/src/imageParameter.js +79 -26
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.js +21 -29
- package/dist/src/link/base.js +6 -8
- package/dist/src/link/file.js +10 -14
- package/dist/src/link/galleryImage.js +1 -1
- package/dist/src/link/redirectTarget.js +1 -1
- package/dist/src/magicLink.js +13 -3
- 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.d.ts +2 -1
- package/dist/src/nowiki/doubleUnderscore.js +9 -5
- package/dist/src/nowiki/index.js +58 -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 +3 -6
- 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 +3 -4
- package/dist/src/tag/tvar.js +1 -2
- package/dist/src/tagPair/ext.js +12 -5
- 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 +13 -10
- 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 +4 -0
- package/i18n/zh-hans.json +4 -0
- package/i18n/zh-hant.json +4 -0
- package/package.json +9 -7
- package/data/ext/maplink.json +0 -4
package/bundle/bundle-es8.min.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";(()=>{var Ca=Object.defineProperty,Ia=Object.defineProperties;var Na=Object.getOwnPropertyDescriptors;var Qt=Object.getOwnPropertySymbols;var En=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable;var Rn=e=>{throw TypeError(e)};var Ps=(e,t,s)=>t in e?Ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,fe=(e,t)=>{for(var s in t||(t={}))En.call(t,s)&&Ps(e,s,t[s]);if(Qt)for(var s of Qt(t))Pn.call(t,s)&&Ps(e,s,t[s]);return e},Le=(e,t)=>Ia(e,Na(t));var On=(e,t)=>{var s={};for(var i in e)En.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&Qt)for(var i of Qt(e))t.indexOf(i)<0&&Pn.call(e,i)&&(s[i]=e[i]);return s};var La=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fe=(e,t,s)=>Ps(e,typeof t!="symbol"?t+"":t,s),Rs=(e,t,s)=>t.has(e)||Rn("Cannot "+s);var m=(e,t,s)=>(Rs(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?Rn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(Rs(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),P=(e,t,s)=>(Rs(e,t,"access private method"),s);var Bn=(e,t,s,i)=>({set _(r){L(e,t,r,s)},get _(){return m(e,t,i)}});var Ou=La((ju,Ta)=>{var Fa=Object.create,bt=Object.defineProperty,Il=Object.getOwnPropertyDescriptor,tn=Object.getOwnPropertyNames,Ea=Object.prototype.hasOwnProperty,Nl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),wt=e=>{throw TypeError(e)},Ll=(e,t,s)=>t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,jn=(e,t)=>bt(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[tn(e)[0]])(e=0)),t},Fl=(e,t)=>function(){return t||(0,e[tn(e)[0]])((t={exports:{}}).exports,t),t.exports},se=(e,t)=>{for(var s in t)bt(e,s,{get:t[s],enumerable:!0})},Pa=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of tn(t))!Ea.call(e,r)&&r!==s&&bt(e,r,{get:()=>t[r],enumerable:!(i=Il(t,r))||i.enumerable});return e},Q=e=>Pa(bt({},"__esModule",{value:!0}),e),Y=e=>{var t;return[,,,Fa((t=e==null?void 0:e[Nl("metadata")])!=null?t:null)]},El=["class","method","getter","setter","accessor","field","value","get","set"],Nt=e=>e!==void 0&&typeof e!="function"?wt("Function expected"):e,Ra=(e,t,s,i,r)=>({kind:El[e],name:t,metadata:i,addInitializer:n=>s._?wt("Already initialized"):r.push(Nt(n||null))}),sn=(e,t)=>Ll(t,Nl("metadata"),e[3]),J=(e,t,s,i)=>{for(var r=0,n=e[t>>1],l=n&&n.length;r<l;r++)t&1?n[r].call(s):i=n[r].call(s,i);return i},X=(e,t,s,i,r,n)=>{var l,o,d,u,a,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,b=El[h+5],x=h>3&&(e[p-1]=[]),v=e[p]||(e[p]=[]),y=h&&(!c&&!g&&(r=r.prototype),h<5&&(h>3||!c)&&Il(h<4?r:{get[s](){return he(this,n)},set[s](w){return we(this,n,w)}},s));h?c&&h<4&&jn(n,(h>2?"set ":h>1?"get ":"")+s):jn(r,s);for(var k=i.length-1;k>=0;k--)u=Ra(h,s,d={},e[3],v),h&&(u.static=g,u.private=c,a=u.access={has:c?w=>Ba(r,w):w=>s in w},h^3&&(a.get=c?w=>(h^1?he:zi)(w,r,h^4?n:y.get):w=>w[s]),h>2&&(a.set=c?(w,A)=>we(w,r,A,h^4?n:y.set):(w,A)=>w[s]=A)),o=(0,i[k])(h?h<4?c?n:y[b]:h>4?void 0:{get:y.get,set:y.set}:r,u),d._=1,h^4||o===void 0?Nt(o)&&(h>4?x.unshift(o):h?c?n=o:y[b]=o:r=o):typeof o!="object"||o===null?wt("Object expected"):(Nt(l=o.get)&&(y.get=l),Nt(l=o.set)&&(y.set=l),Nt(l=o.init)&&x.unshift(l));return h||sn(e,r),y&&bt(r,s,y),c?h^4?n:y:r},Oa=(e,t,s)=>Ll(e,typeof t!="symbol"?t+"":t,s),nn=(e,t,s)=>t.has(e)||wt("Cannot "+s),Ba=(e,t)=>Object(t)!==t?wt('Cannot use the "in" operator on this value'):e.has(t),he=(e,t,s)=>(nn(e,t,"read from private field"),s?s.call(e):t.get(e)),Oe=(e,t,s)=>t.has(e)?wt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),we=(e,t,s,i)=>(nn(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),zi=(e,t,s)=>(nn(e,t,"access private method"),s),ja=(e,t,s,i)=>({set _(r){we(e,t,r,s)},get _(){return he(e,t,i)}}),Pl,ps,Rl=C({"base.ts"(){"use strict";Pl=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11,"list-range":11};return Object.setPrototypeOf(e,null),e})(),ps=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function ye(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,r)=>ye(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(i,r)=>t[r])}var qe,Os,pt,ft,mt,nt,Ol,ve,Ye,qn,Wn,fs,Bl,Mn,zn,zt,xt,ce=C({"util/string.ts"(){"use strict";qe=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Os=String.raw`[^[\]<>"\0-\x1F\x7F${qe}\uFFFD]`,pt=String.raw`(?:\[[\da-f:.]+\]|${Os})`,ft=String.raw`(?:${Os}|\0\d+[cn!~]\x7F)*`,mt=e=>e.trim().toLowerCase(),nt=(e,t)=>s=>s.replace(e,t),Ol=nt(/[\0\x7F]|\r$/gmu,""),ve=nt(/\0\d+[cn]\x7F/gu,""),Ye=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),qn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Wn=nt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):qn[s.toLowerCase()]),fs=e=>Wn(e),Bl=nt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Mn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},zn=e=>nt(e,t=>`&${Mn[t]};`),zt=zn(/[&<>]/gu),xt=(e,t={})=>{const{pre:s="",post:i="",sep:r=""}=t;return s+e.map(n=>n.print()).join(r)+i}}}),qa=Fl({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),Wa=Fl({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),be,jl,Ui,Me=C({"util/constants.ts"(){"use strict";be=11,jl=qa(),Ui=Wa()}});function gt(e){const t=new Map,s=new WeakMap;return i=>{const r=typeof i=="string"?t:s;if(r.has(i)){const l=r.get(i);return l.lastIndex=0,l}const n=e(i);return r.set(i,n),n}}var Ut,ql,Ze=C({"../common/dist/index.mjs"(){"use strict";Ut=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),ql=gt}}),le,de=C({"lib/rect.ts"(){"use strict";var e,t,s,i,Hi,n;le=(n=class{constructor(l,o){N(this,i);N(this,e);N(this,t);N(this,s);L(this,e,l),L(this,t,o)}get start(){return m(this,t)}get top(){return P(this,i,Hi).call(this).top}get left(){return P(this,i,Hi).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Hi=function(){var l;return(l=m(this,s))!=null||L(this,s,m(this,e).getRootNode().posFromIndex(m(this,t))),m(this,s)},n)}}),Un,Hn,Mt,Di,Bs,q,G,$e,bs,z,rn,We,ln,on,an,Ht,vt,un,Ke,Wl,M=C({"util/lint.ts"(){"use strict";Ze(),Ne(),de(),B(),Un=new Set(["tr","td","th","caption"]),Hn=new Set(["Template:!!","Template:!-"]),Mt=e=>{const t=e.childNodes.find(s=>s.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&Hn.has(t.name)||t.is("html")&&Un.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Mt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Mt);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Di=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Bs=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:o,left:d}=s instanceof le?s:new le(t,l),{offsetHeight:u,offsetWidth:a}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,o,d),{line:p,character:b}=Di(g,c,u,a);return{rule:i,message:I.msg(r),severity:n,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:b}},q=Bs((e,t,s,i)=>{const r=e.getRelativeIndex(),{top:n,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+n,startCol:n?l:i+l}}),G=Bs((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),$e=(e,t,s,i=0)=>({desc:I.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),bs=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),z=(e,t=0,s="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:s}:$e(e,"remove",s,t),rn=(e,t)=>$e(e,"decode",Ut(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),We=(e,t,s=0)=>({desc:I.msg("close"),range:[e+s,e],text:t}),ln=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),on=(e,t)=>$e(e,"comment",`<!--${t}-->`),an=(e,t)=>$e(e,"uppercase",t.toUpperCase()),Ht=(e,t=0)=>({desc:I.msg("whitespace"),range:[e,e+t],text:" "}),vt=(e,t,s=1)=>({desc:I.msg("escape"),range:[e,e+s],text:t.repeat(s)}),un=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),Ke=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===ke.rev))return e[1];const r=t();return(i||I.viewOnly)&&s([ke.rev,r]),r},Wl=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),Dn,dn,Ml=C({"parser/selector.ts"(){"use strict";Dn=(e,t,s)=>{if(e.includes("#")){const i=e.indexOf("#");return(i===0||e.slice(0,i)===t)&&e.slice(i+1)===s}return!e||e===t},dn=(e,t,s)=>{const i=e.split(",");return(({type:r,name:n})=>i.some(l=>Dn(l.trim(),r,n)))}}}),ws,hn=C({"mixin/cached.ts"(){"use strict";M(),ws=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Ke(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),zl,Ma=C({"mixin/nodeLike.ts"(){"use strict";zl=e=>{class t extends e{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return t}}}),Gn,Vn,Jt,St,kt,Xt,At,_t,$t,Je,Ul=C({"lib/node.ts"(){"use strict";M(),Ne(),hn(),Ma(),B(),Vn=[zl],Gn=[ws(!1)],Je=class{constructor(){J($t,5,this),Oa(this,"childNodes",[]),Oe(this,Jt),Oe(this,St),Oe(this,kt),Oe(this,Xt),Oe(this,At),Oe(this,_t,{})}get parentNode(){return he(this,Jt)}get nextSibling(){return he(this,St)}get previousSibling(){return he(this,kt)}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":we(this,Jt,t),t||(we(this,St,void 0),we(this,kt,void 0));break;case"nextSibling":we(this,St,t);break;case"previousSibling":we(this,kt,t);break;case"aIndex":I.viewOnly&&we(this,At,[ke.rev,t]);break;default:this[e]=t}}getRootNode(){return Ke(he(this,Xt),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&we(this,Xt,e)})}indexFromPos(e,t){this.lspError("AstNode.indexFromPos")}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=s.findIndex(([,,r])=>e<=r);return{top:i,left:e-s[i][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return Ke(he(this,_t)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)I.viewOnly&&(he(this,_t)[r]=[ke.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{he(this,_t)[e]=t})}getAbsoluteIndex(){return Ke(he(this,At),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{we(this,At,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){{const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
-
`)){const i=t+s.length;e.push([s,t,i]),t=i+1}return e}}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},$t=Y(null),Jt=new WeakMap,St=new WeakMap,kt=new WeakMap,Xt=new WeakMap,At=new WeakMap,_t=new WeakMap,X($t,1,"getLines",Gn,Je),Je=X($t,0,"AstNode",Vn,Je),J($t,1,Je)}}),Hl,za=C({"mixin/elementLike.ts"(){"use strict";Ml(),Hl=e=>{var t,Gi;{class i extends e{constructor(){super(...arguments);N(this,t)}getElementBy(l){for(const o of this.childNodes){if(o.type==="text")continue;if(l(o))return o;const d=o.getElementBy(l);if(d)return d}}querySelector(l){return this.getElementBy(P(this,t,Gi).call(this,l))}getElementsBy(l,o=[]){for(const d of this.childNodes)d.type!=="text"&&(l(d)&&o.push(d),d.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(P(this,t,Gi).call(this,l))}escape(){}}return t=new WeakSet,Gi=function(l){return dn(l,this)},i}}}}),Qn,js,Jn,Lt,Ua=C({"lib/element.ts"(){"use strict";ce(),Ne(),Ml(),Ul(),za(),Qn=[Hl],Lt=class extends(Jn=Je){get length(){return this.childNodes.length}text(e){return Ye(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,r;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(r=e[s])==null||r.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:r}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||r===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){this.lspError("AstElement.removeAt")}insertAt(e,t=this.length){return Tn(this,t,0,[e]),e}closest(e){const t=dn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,r=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",r);const l=n.lint(r,t);l.length>0&&s.push(...l),r+=n.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+xt(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){}},js=Y(Jn),Lt=X(js,0,"AstElement",Qn,Lt),J(js,1,Lt)}}),Kt,qs,Ws,Xn,Kn,Yn,Zn,Ms,er,Vi,Ha=C({"lib/text.ts"(){"use strict";var e,Dl,s;ce(),M(),B(),Ul(),Kt=String.raw`[${qe}\t]*`,qs=String.raw`[^\S\n]*`,Ws=String.raw`<${qs}(?:/${qs})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Kt}\d)|isbn(?=[-::]?${Kt}(?:\d(?:${Kt}|-)){6})`,Xn=new RegExp(String.raw`${Ws}|https?[:/]/+`,"giu"),Kn=new RegExp(Ws,"giu"),Yn=new Set(["attr-value","ext-link-text","link-text"]),Zn={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ms=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]),er=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){return/\w/u}})(),Vi=(s=class extends Je{constructor(r){super();N(this,e);Fe(this,"data","");this.data=r}get type(){return"text"}toString(r){var n;return r&&!((n=this.parentNode)!=null&&n.getAttribute("built"))?ve(this.data):this.data}text(){return this.data}lint(r=this.getAbsoluteIndex(),n){var l,o,d;{if(n===!1)return[];const{data:u,parentNode:a,nextSibling:h,previousSibling:g}=this;if(!a)throw new Error("An isolated text node cannot be linted!");const{type:c,name:p,parentNode:b}=a;if(c==="attr-value"){const{name:O,tag:re}=b;if(re==="ref"&&(O==="name"||O==="follow")||O==="group"&&(re==="ref"||re==="references")||re==="choose"&&(O==="before"||O==="after"))return[]}if(n!=null||(n=c==="free-ext-link"||c==="ext-link-url"||c==="ext-link-text"||c==="image-parameter"&&p==="link"||c==="attr-value"?Kn:Xn),u.search(n)===-1)return[];n.lastIndex=0;const x=[],v=h==null?void 0:h.type,y=h==null?void 0:h.name,k=g==null?void 0:g.type,w=this.getRootNode(),A=w.toString(),{ext:_,html:f,variants:S}=w.getAttribute("config"),{top:$,left:T}=w.posFromIndex(r),{lintConfig:F}=I,j=F.rules["tag-like"],R=typeof j=="object"&&j[1]?new Set(Object.keys(j[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,ne=new Set(["onlyinclude","noinclude","includeonly",..._,...f[0],...f[1],...f[2],...R,...F.getSeverity("tag-like","disallowed")?Ms:[]]);for(let O=n.exec(u);O;O=n.exec(u)){const[,re,pe]=O;let{index:V,0:D}=O;if(pe&&pe!=="]"){const{length:ge}=pe;V+=ge,D=D.slice(ge)}D=D.toLowerCase();const[K]=D,U=K==="r"||K==="p"||K==="i",Z=K==="{",H=K==="}",ee=K==="[",oe=K==="]";let{length:ae}=D;if(K==="<"&&!ne.has(re.toLowerCase())||ee&&c==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(u.slice(V+1))||h!=null&&h.is("ext")&&y==="nowiki"&&((l=h.innerText)!=null&&l.includes("]")))||U&&(!a.isPlain()||Yn.has(c)))continue;oe&&(V||ae>1)&&n.lastIndex--;let te=r+V,De=te+ae,ue,me;const Ce=A[De],Is=A[te-1],Ns=Z||ee,Ls=Z&&Is==="-"&&S.length>0,Fs=H&&Ce==="-"&&S.length>0,Cn=ee&&v==="free-ext-link"&&!u.slice(V+1).trim()||oe&&k==="free-ext-link"&&!u.slice(0,V).includes("]");if(U)ue="lonely-http",D=D.toUpperCase(),me=F.getSeverity(ue,D);else if(K==="<"){ue="tag-like";let ge;/^<\/?\s/u.test(D)||!/[\s/>]/u.test(Ce!=null?Ce:"")?ge="invalid":R.has(re)?ge=re:Ms.has(re)&&!_.includes(re)&&(ge="disallowed"),me=F.getSeverity(ue,ge)}else if(Ls||Fs)ue="lonely-bracket",me=F.getSeverity(ue,"converter"),Ls&&V>0?(D="-{",V--,te--,ae=2):Fs&&V<u.length-1&&(D="}-",De++,ae=2);else if(Cn)ue="lonely-bracket",me=F.getSeverity(ue,"extLink");else if(Ns||H||oe)if(ue="lonely-bracket",ae>1||Z&&Ce===K||H&&Is===K)me=F.getSeverity(ue,"double");else{if(!ee||c!=="ext-link-text"){const ge=Zn[K],Es=Ns?u.slice(V+1):u.slice(0,V);if(Z&&((o=ge.exec(Es))==null?void 0:o[0])==="}"||H&&((d=ge.exec(Es))==null?void 0:d[0])==="{")continue;if(!Es.includes(K)){const Fn=Ns?"nextSibling":"previousSibling";let Ve=this[Fn];for(;Ve&&(Ve.type!=="text"||!ge.test(Ve.data));)Ve=Ve[Fn];if(Ve&&ge.exec(Ve.data)[0]!==K)continue}}me=F.getSeverity(ue,"single")}else ue="lonely-http",me=F.getSeverity(ue);if(!me)continue;const In=this.posFromIndex(V),{line:Nn,character:Ln}=Di($,T,In.top+1,In.left),Ge={rule:ue,message:I.msg("lonely",U||K==="h"||Ls||Fs?D:K),severity:me,startIndex:te,endIndex:De,startLine:Nn,endLine:Nn,startCol:Ln,endCol:Ln+ae};if(F.computeEditInfo)if(K==="<")Ge.suggestions=[vt(te,"<")];else if(K==="h"&&c!=="link-text"&&er.test(Is||""))Ge.suggestions=[Ht(te)];else if(ee&&c==="ext-link-text"){const ge=a.getAbsoluteIndex()+a.toString().length;Ge.suggestions=[vt(ge,"]")]}else if(oe&&Cn){const ge=r-g.toString().length;Ge.suggestions=[bs(ge,"left-bracket","[")]}else U&&(Ge.suggestions=[...O[0]===D?[]:[an(Ge,D)],...Ce===":"||Ce===":"?[Ht(De,1)]:[]]);x.push(Ge)}return x}}replaceData(r){P(this,e,Dl).call(this,r)}splitText(r){this.lspError("AstText.splitText")}escape(){}print(){return zt(this.data)}},e=new WeakSet,Dl=function(r){this.setAttribute("data",r)},s)}}),ze,et=C({"mixin/hidden.ts"(){"use strict";ze=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),Ie,Ee=C({"mixin/noEscape.ts"(){"use strict";Ie=e=>{}}}),Ue,tt=C({"src/syntax.ts"(){"use strict";var e,t;W(),Ue=(t=class extends E{constructor(i,r,n,l,o){super(i,n,l,o);N(this,e);L(this,e,r)}get type(){return m(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Pe,He=C({"mixin/padded.ts"(){"use strict";Pe=({length:e})=>t=>{{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}}),xe,st=C({"src/atom.ts"(){"use strict";var e,t;W(),xe=(t=class extends E{constructor(i,r,n,l,o){super(i,n,l,o);N(this,e);L(this,e,r)}get type(){return m(this,e)}set type(i){L(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),tr,sr,zs,ir,Be,ys=C({"src/link/base.ts"(){"use strict";var e,t,s,i;M(),Me(),de(),He(),Ee(),B(),W(),st(),tr=r=>r==="redirect-target"||r==="link",sr=[Ie,Pe("[[")],Be=(i=class extends(ir=E){constructor(n,l,o,d=[],u="|"){super(void 0,o,d,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new xe(n,"link-target",o,d,{})),l!==void 0){const a=new E(l,o,d,{});a.type="link-text",a.setAttribute("stage",be-1),this.insertAt(a)}L(this,t,u)}get link(){}get fragment(){}afterBuild(){L(this,s,this.getTitle()),m(this,t).includes("\0")&&L(this,t,this.buildFromStr(m(this,t),0)),this.setAttribute("name",m(this,s).title),super.afterBuild()}setAttribute(n,l){n==="bracket"?L(this,e,l):n==="title"?L(this,s,l):super.setAttribute(n,l)}toString(n){const l=super.toString(n,m(this,t));return m(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return m(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?m(this,s):super.getAttribute(n)}getGaps(n){return n===0?m(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{childNodes:[d,u],type:a}=this,{encoded:h,fragment:g}=m(this,s),{lintConfig:c}=I,{computeEditInfo:p,fix:b}=c,x=new le(this,n);let v="unknown-page",y=c.getSeverity(v);if(y&&d.childNodes.some(({type:k})=>k==="template")&&o.push(q(d,x,v,"template-in-link",y)),v="url-encoding",y=c.getSeverity(v),y&&h){const k=q(d,x,v,"unnecessary-encoding",y);(p||b)&&(k.fix=rn(k,d)),o.push(k)}if(v="pipe-like",y=c.getSeverity(v,"link"),y&&(a==="link"||a==="category")){const k=u==null?void 0:u.childNodes.findIndex(A=>A.type==="text"&&A.data.includes("|")),w=u==null?void 0:u.childNodes[k];if(w){const A=q(u,x,v,"pipe-in-link",y);if(p){const _=A.startIndex+u.getRelativeIndex(k);A.suggestions=[un(_,w.data)]}o.push(A)}}if(v="no-ignored",y=c.getSeverity(v,"fragment"),y&&g!==void 0&&!tr(a)){const k=q(d,x,v,"useless-fragment",y);if(p||b){const w=d.childNodes.findIndex(_=>_.type==="text"&&_.data.includes("#")),A=d.childNodes[w];A&&(k.fix=z(k,d.getRelativeIndex(w)+A.data.indexOf("#")))}o.push(k)}return o}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(m(this,e)?{pre:"[[",post:"]]",sep:m(this,t)}:{sep:m(this,t)})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),zs=Y(ir),Be=X(zs,0,"LinkBaseToken",sr,Be),J(zs,1,Be)}}),nr,Us,rr,Te,it=C({"src/nowiki/base.ts"(){"use strict";Ee(),W(),nr=[Ie],Te=class extends(rr=E){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Us=Y(rr),Te=X(Us,0,"NowikiBaseToken",nr,Te),J(Us,1,Te)}}),lr,Hs,or,Se,yt=C({"src/nowiki/noinclude.ts"(){"use strict";et(),it(),lr=[ze()],Se=class extends(or=Te){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Hs=Y(or),Se=X(Hs,0,"NoincludeToken",lr,Se),J(Hs,1,Se)}}),Gl,Da=C({"src/link/redirectTarget.ts"(){"use strict";M(),B(),ys(),yt(),Gl=class extends Be{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new Se(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:i}=I,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=q(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=z(n)),t.push(n)}return t}}}}}),ar,Ds,ur,Ft,Ga=C({"src/redirect.ts"(){"use strict";var e,t,s;et(),Ee(),W(),tt(),Da(),ar=[ze(!1,!1),Ie],Ft=(s=class extends(ur=E){constructor(r,n,l,o,d,u,a=[]){super(void 0,u,a);N(this,e);N(this,t);L(this,e,r),L(this,t,d),this.append(new Ue(n,"redirect-syntax",u,a),new Gl(l,o==null?void 0:o.slice(1),u,a))}get type(){return"redirect"}getAttribute(r){return r==="padding"?m(this,e).length:super.getAttribute(r)}toString(r){return m(this,e)+super.toString(r)+m(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+m(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:m(this,e),post:m(this,t)})}},e=new WeakMap,t=new WeakMap,s),Ds=Y(ur),Ft=X(Ds,0,"RedirectToken",ar,Ft),J(Ds,1,Ft)}}),Vl={};se(Vl,{parseRedirect:()=>Ql});var Ql,Va=C({"parser/redirect.ts"(){"use strict";B(),Ga(),Ql=(e,t,s)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&I.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Ft(...i.slice(1),t,s),e):!1}}}),dr,Gs,hr,Et,Qa=C({"src/onlyinclude.ts"(){"use strict";He(),Ee(),W(),dr=[Ie,Pe("<onlyinclude>")],Et=class extends(hr=E){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}},Gs=Y(hr),Et=X(Gs,0,"OnlyincludeToken",dr,Et),J(Gs,1,Et)}}),Gt,Ss=C({"mixin/gapped.ts"(){"use strict";Gt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),cr,Vs,gr,Xe,cn=C({"src/tagPair/index.ts"(){"use strict";var e,t;Ss(),Ee(),W(),cr=[Gt(),Ie],Xe=(t=class extends(gr=E){constructor(i,r,n,l,o,d=[]){super(void 0,o);N(this,e);Fe(this,"closed");Fe(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),L(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,n);const u=typeof r=="string"?-1:d.indexOf(r);d.splice(u===-1?1/0:u,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[o,d]=m(this,e);return r?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${l.toString(i)}${this.closed?`</${d}>`:""}`}text(){const[i,r]=m(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?m(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=m(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${r}>`:""})}},e=new WeakMap,t),Vs=Y(gr),Xe=X(Vs,0,"TagPairToken",cr,Xe),J(Vs,1,Xe)}}),gn,Jl=C({"src/tag/index.ts"(){"use strict";var e,t,s,i;M(),Ne(),B(),W(),gn=(i=class extends E{constructor(n,l,o,d,u){super(void 0,d,u);N(this,e);N(this,t);N(this,s);this.insertAt(l),L(this,e,o),L(this,t,n)}get closing(){return m(this,e)}toString(n){return`<${m(this,e)?"/":""}${m(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${m(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?m(this,t).length+(m(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return Ke(m(this,s),()=>{const{type:n,name:l,parentNode:o,closing:d,selfClosing:u}=this;let a=!1,h=!1;if(n==="html"){const{html:[,v,y]}=this.getAttribute("config");a=y.includes(l),h=v.includes(l)}if(a||h&&u)return this;if(!o)return;const{childNodes:g}=o,c=g.indexOf(this),p=d?g.slice(0,c).reverse():g.slice(c+1),b=[this],{rev:x}=ke;for(const v of p)if(!(!v.is(n)||n==="html"&&(v.name!==l||h&&v.selfClosing)))if(m(v,e)===d){if(n==="tvar")return;b.push(v)}else{const y=b.pop();if(y===this)return v;I.viewOnly&&(L(y,s,[x,v]),L(v,s,[x,y]))}if(I.viewOnly)for(const v of b)L(v,s,[x,void 0])},n=>{L(this,s,n),n[1]&&n[1]!==this&&L(n[1],s,[ke.rev,this])})}print(){return super.print({pre:`<${m(this,e)?"/":""}${m(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),pr,Qs,fr,je,Ja=C({"src/tag/tvar.ts"(){"use strict";et(),Jl(),tt(),pr=[ze()],je=class extends(fr=gn){get type(){return"tvar"}constructor(e,t,s,i,r){const n=new Ue(t,"tvar-name",i,r);super(e,n,s,i,r)}},Qs=Y(fr),je=X(Qs,0,"TvarToken",pr,je),J(Qs,1,je)}}),Xl,Xa=C({"src/tagPair/translate.ts"(){"use strict";var e,Kl,s;W(),cn(),tt(),Ja(),Xl=(s=class extends Xe{constructor(r,n,l,o=[]){const d=new Ue(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(a,h,g)=>(new je("tvar",h,!1,l,o),new je("","",!0,l,o),`\0${o.length-2}n${g}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(a,h,g,c,p,b,x)=>(new je(h,g,!1,l,o),new je(b,x,!0,l,o),`\0${o.length-2}n${p}\0${o.length}n`));const u=new E(n,l,o);u.type="translate-inner";super("translate",d,u,"translate",l,o);N(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${P(this,e,Kl).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}>${this.lastChild.print({class:"ext-inner"})}</translate></span>`}},e=new WeakSet,Kl=function(){return this.firstChild.toString()===" nowrap"},s)}}),mr,Js,xr,Pt,Ka=C({"src/tagPair/include.ts"(){"use strict";M(),de(),et(),B(),cn(),mr=[ze(!1)],Pt=class extends(xr=Xe){get type(){return"include"}constructor(e,t="",s,i,r,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",r,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:r}=this,n=new le(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=I,{computeEditInfo:d}=o,u=l.map(a=>o.getSeverity(a,"include"));if(u[0]&&s.data.trim()){const a=q(s,n,l[0],"useless-attribute",u[0]);d&&(a.suggestions=[z(a)]),t.push(a)}if(u[1]&&!i){const a=G(this,n,l[1],I.msg("unclosed",`<${r}>`),u[1]);d&&(a.suggestions=[We(a.endIndex,`</${r}>`)]),t.push(a)}return t}}},Js=Y(xr),Pt=X(Js,0,"IncludeToken",mr,Pt),J(Js,1,Pt)}}),ks,pn=C({"mixin/attributesParent.ts"(){"use strict";ks=(e=0)=>t=>{var s,Yl;{class r extends t{constructor(){super(...arguments);N(this,s)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return P(this,s,Yl).call(this).getAttr(o)}}return s=new WeakSet,Yl=function(){return this.childNodes[e]},r}}}}),ie,Xs,Ks,Tt,Yt,Ys,Qe,Zs,ei,ti,Zt,si,Ae,Zl,eo,to,so,Ya=C({"util/sharable.ts"(){"use strict";ie=new Set(["align"]),Xs=new Set(["cite"]),Ks=new Set(["cite","datetime"]),Tt=new Set(["width"]),Yt=new Set(["axis","align","bgcolor","height","width","valign"]),Ys=new Set([...Yt,"abbr","headers","scope","rowspan","colspan"]),Qe=new Set(["type"]),Zs=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ei=new Set(["clear"]),ti=new Set(["bgcolor","align","valign"]),Zt=new Set(["qid","forcemathmode","type","display"]),si=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Ae=new Set,Zl=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),eo={div:ie,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,blockquote:Xs,q:Xs,p:ie,br:ei,pre:Tt,ins:Ks,del:Ks,ul:Qe,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Zs,"border"]),caption:ie,tr:ti,td:Ys,th:Ys,font:new Set(["size","color","face"]),hr:Tt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Qe,poem:ie,categorytree:ie,combooption:ie,math:Ae,chem:Ae,ce:Ae,img:new Set(["alt","src","width","height","loading","srcset"])},to={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:Ae,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Ae,inputbox:Ae,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Ae,poll:new Set(["id","show-results-before-voting"]),sm2:Qe,flashmp3:Qe,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"]),math:new Set([...Zt,"chem"]),chem:Zt,ce:Zt,hiero:Ae,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:si,syntaxhighlight:si,templatedata:Ae,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Ae},so={table:Zs,td:new Set([...Yt,"scope"]),th:Yt,br:ei,caption:ie,div:ie,hr:Tt,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,li:Qe,p:ie,pre:Tt,tr:ti,ul:Qe}}}),vr,br,wr,yr,os,Za=C({"src/attribute.ts"(){"use strict";var e,t,s,i,r,io,Qi,o;M(),ce(),Me(),Ya(),de(),B(),W(),st(),vr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,br=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,wr=new Set(["ext","arg","magic-word","template"]),yr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),os=(o=class extends E{constructor(u,a,h,g="",c,p=[],b=I.getConfig(),x=[]){const v=new xe(h,"attr-key",b,x);let y;if(h==="title"||a==="img"&&h==="alt")y=new E(c,b,x,{}),y.type="attr-value",y.setAttribute("stage",be-1);else if(a==="gallery"&&h==="caption"||a==="choose"&&(h==="before"||h==="after")){const k=Le(fe({},b),{excludes:[...b.excludes,"heading","html","table","hr","list"]});y=new E(c,k,x,{}),y.type="attr-value",y.setAttribute("stage",1)}else y=new xe(c,"attr-value",b,x,{});super(void 0,b,x);N(this,r);N(this,e);N(this,t);N(this,s);N(this,i);L(this,e,u),this.append(v,y),L(this,s,g),L(this,i,[...p]),L(this,t,a),this.setAttribute("name",mt(ve(h)))}get type(){return m(this,e)}get tag(){return m(this,t)}get balanced(){return!m(this,s)||m(this,i)[0]===m(this,i)[1]}afterBuild(){m(this,s).includes("\0")&&L(this,s,this.buildFromStr(m(this,s),0)),this.parentNode&&L(this,t,this.parentNode.name),P(this,r,io).call(this),super.afterBuild()}toString(u){const[a="",h=""]=m(this,i);return m(this,s)?super.toString(u,m(this,s)+a)+h:this.firstChild.toString(u)}text(){return m(this,s)?`${super.text(`${m(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var u,a;return m(this,s)?m(this,s).length+((a=(u=m(this,i)[0])==null?void 0:u.length)!=null?a:0):0}lint(u=this.getAbsoluteIndex(),a){var h;{const g=super.lint(u,a),{balanced:c,firstChild:p,lastChild:b,name:x,tag:v}=this,y=new le(this,u),k=["unclosed-quote","obsolete-attr"],{lintConfig:w}=I,A=k.map(f=>w.getSeverity(f,x));if(A[0]&&!c){const f=q(b,y,k[0],"unclosed-quotes",A[0]);f.startIndex--,f.startCol--,w.computeEditInfo&&(f.suggestions=[We(f.endIndex,m(this,i)[0])]),g.push(f)}const _=P(this,r,Qi).call(this,u,y);return _&&g.push(_),A[1]&&((h=so[v])!=null&&h.has(x))&&g.push(q(p,y,k[1],"obsolete-attribute",A[1])),g}}getValue(){return m(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(u){return u==="invalid"?P(this,r,Qi).call(this):super.getAttribute(u)}print(){const[u="",a=""]=m(this,i);return m(this,s)?super.print({sep:zt(m(this,s))+u,post:a}):super.print()}json(u,a=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,io=function(){this.setAttribute("name",mt(this.firstChild.text()))},Qi=function(u,a){const{firstChild:h,lastChild:g,type:c,name:p,tag:b,parentNode:x}=this,v=!g.childNodes.some(({type:$})=>wr.has($)),y=this.getValue(),k=to[b],w=eo[b],{length:A}=this.toString();let _="illegal-attr",f,S;if({lintConfig:f}=I,{computeEditInfo:S}=f,!(k!=null&&k.has(p))&&!(w!=null&&w.has(p))&&(c==="ext-attr"?k||w:!/\{\{[^{]+\}\}/u.test(p))&&(c==="ext-attr"&&!w||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(b==="meta"||b==="link"||!Zl.has(p)))||(p==="itemtype"||p==="itemid"||p==="itemref")&&!(x!=null&&x.hasAttr("itemscope"))){if(u===void 0)return!0;{const $=f.getSeverity(_,"unknown");if($){const T=q(h,a,_,"illegal-attribute-name",$);return S&&(T.suggestions=[z(u,A)]),T}}}else if(p==="style"&&typeof y=="string"&&vr.test(y)){if(u===void 0)return!0;{_="insecure-style";const $=f.getSeverity(_);return $&&q(g,a,_,"insecure-style",$)}}else if(p==="tabindex"&&typeof y=="string"&&y!=="0"){if(u===void 0)return!0;{const $=f.getSeverity(_,"tabindex");if($){const T=q(g,a,_,"nonzero-tabindex",$);return S&&(T.suggestions=[z(u,A),$e(T,"0 tabindex","0")]),T}}}else if(typeof y=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||yr.has(p))&&br.test(y)||v&&(p==="href"||b==="img"&&p==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(y))){if(u===void 0)return!0;{const $=f.getSeverity(_,"value");return $&&q(g,a,_,"illegal-attribute-value",$)}}else if(v&&c!=="ext-attr"){const $=Wl(b,p),T=String(y).toLowerCase();if($.length>0&&$.every(F=>F!==T)){if(u===void 0)return!0;{const F=f.getSeverity(_,"value");return F&&q(g,a,_,"illegal-attribute-value",F)}}}return!1},o)}}),ii,Sr,kr,As,fn=C({"src/attributes.ts"(){"use strict";var e,t,as,i;M(),ce(),de(),B(),W(),st(),Za(),ii=r=>r.slice(0,-1),Sr=r=>`${ii(r)}-dirty`,kr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(r){return/[^\W_]/u}})(),As=(i=class extends E{constructor(n,l,o,d,u=[]){super(void 0,d,u,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",o),n){const a=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let h="",g=a.exec(n),c=0;const p=(()=>{h&&(super.insertAt(new xe(h,Sr(l),d,u,{})),h="")});for(;g;){const{index:b,0:x,1:v,2:y,3:k,4:w,5:A,6:_}=g;if(h+=n.slice(c,b),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(ve(v).trim())){const f=w!=null?w:_,S=[k,A],$=new os(ii(l),o,v,y,f,S,d,u);p(),super.insertAt($)}else h+=x;({lastIndex:c}=a),g=a.exec(n)}h+=n.slice(c),p()}}get type(){return m(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof os&&(!n||l.name===mt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{parentNode:d,childNodes:u}=this,a=new Map,h=new Set,g=new le(this,n),c=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:b,fix:x}=p,v=["closingTag","invalidAttributes","nonWordAttributes"].map(k=>p.getSeverity(c[0],k));if(v[0]&&P(this,t,as).call(this)){const k=G(this,g,c[0],"attributes-of-closing-tag",v[0]);if(b){const w=d.getAbsoluteIndex();k.suggestions=[z(k),ln(w)]}o.push(k)}for(const k of u)if(k instanceof os){const{name:w}=k;a.has(w)?(h.add(w),a.get(w).push(k)):a.set(w,[k])}else{const w=k.text().trim(),A=v[kr.test(w)?1:2];if(w&&A){const _=q(k,g,c[0],"invalid-attribute",A);b&&(_.suggestions=[z(_,0," ")]),o.push(_)}}const y=p.getSeverity(c[1],"attribute");if(y&&h.size>0)for(const k of h){const w=a.get(k).map(A=>{const _=A.getValue();return[A,_===!0?"":_]});o.push(...w.map(([A,_],f)=>{const S=q(A,g,c[1],I.msg("duplicate-attribute",k),y);if(b||x){const $=z(S);!_||w.slice(0,f).some(([,T])=>T===_)?S.fix=$:b&&(S.suggestions=[$])}return S}))}return o}}getAttribute(n){return n==="invalid"?P(this,t,as).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,as).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof xe?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,as=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),no={};se(no,{PreToken:()=>ro});var ro,eu=C({"src/pre.ts"(){"use strict";Me(),W(),yt(),ro=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),d=0,u="";for(;l&&o;)new Se(l[0],t,s,!0),new Se(o[0],t,s,!0),u+=`${e.slice(d,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,d=o.index+n+1,i.lastIndex=d,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=u+e.slice(d)}super(e,t,s,{}),this.setAttribute("stage",be-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),_s,mn=C({"src/multiLine/index.ts"(){"use strict";W(),_s=class extends E{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
1
|
+
"use strict";(()=>{var jo=Object.defineProperty,Bo=Object.defineProperties;var qo=Object.getOwnPropertyDescriptors;var Xt=Object.getOwnPropertySymbols;var Bn=Object.prototype.hasOwnProperty,qn=Object.prototype.propertyIsEnumerable;var Wn=e=>{throw TypeError(e)};var Os=(e,t,s)=>t in e?jo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ge=(e,t)=>{for(var s in t||(t={}))Bn.call(t,s)&&Os(e,s,t[s]);if(Xt)for(var s of Xt(t))qn.call(t,s)&&Os(e,s,t[s]);return e},Ee=(e,t)=>Bo(e,qo(t));var Mn=(e,t)=>{var s={};for(var i in e)Bn.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&Xt)for(var i of Xt(e))t.indexOf(i)<0&&qn.call(e,i)&&(s[i]=e[i]);return s};var Wo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,s)=>Os(e,typeof t!="symbol"?t+"":t,s),js=(e,t,s)=>t.has(e)||Wn("Cannot "+s);var f=(e,t,s)=>(js(e,t,"read from private field"),s?s.call(e):t.get(e)),L=(e,t,s)=>t.has(e)?Wn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),F=(e,t,s,i)=>(js(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),P=(e,t,s)=>(js(e,t,"access private method"),s);var zn=(e,t,s,i)=>({set _(r){F(e,t,r,s)},get _(){return f(e,t,i)}});var Qu=Wo((Xu,Oo)=>{var Ol=Object.create,Ke=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,ln=Object.getOwnPropertyNames,Mo=Object.getPrototypeOf,zo=Object.prototype.hasOwnProperty,Bl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),yt=e=>{throw TypeError(e)},ql=(e,t,s)=>t in e?Ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Un=(e,t)=>Ke(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[ln(e)[0]])(e=0)),t},an=(e,t)=>function(){return t||(0,e[ln(e)[0]])((t={exports:{}}).exports,t),t.exports},se=(e,t)=>{for(var s in t)Ke(e,s,{get:t[s],enumerable:!0})},Wl=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ln(t))!zo.call(e,r)&&r!==s&&Ke(e,r,{get:()=>t[r],enumerable:!(i=jl(t,r))||i.enumerable});return e},Uo=(e,t,s)=>(s=e!=null?Ol(Mo(e)):{},Wl(t||!e||!e.__esModule?Ke(s,"default",{value:e,enumerable:!0}):s,e)),Q=e=>Wl(Ke({},"__esModule",{value:!0}),e),te=e=>{var t;return[,,,Ol((t=e==null?void 0:e[Bl("metadata")])!=null?t:null)]},Ml=["class","method","getter","setter","accessor","field","value","get","set"],Lt=e=>e!==void 0&&typeof e!="function"?yt("Function expected"):e,Ho=(e,t,s,i,r)=>({kind:Ml[e],name:t,metadata:i,addInitializer:n=>s._?yt("Already initialized"):r.push(Lt(n||null))}),on=(e,t)=>ql(t,Bl("metadata"),e[3]),Y=(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},Z=(e,t,s,i,r,n)=>{var l,o,a,u,d,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,x=Ml[h+5],m=h>3&&(e[p-1]=[]),v=e[p]||(e[p]=[]),w=h&&(!c&&!g&&(r=r.prototype),h<5&&(h>3||!c)&&jl(h<4?r:{get[s](){return de(this,n)},set[s](y){return Se(this,n,y)}},s));h?c&&h<4&&Un(n,(h>2?"set ":h>1?"get ":"")+s):Un(r,s);for(var S=i.length-1;S>=0;S--)u=Ho(h,s,a={},e[3],v),h&&(u.static=g,u.private=c,d=u.access={has:c?y=>Go(r,y):y=>s in y},h^3&&(d.get=c?y=>(h^1?de:Gi)(y,r,h^4?n:w.get):y=>y[s]),h>2&&(d.set=c?(y,A)=>Se(y,r,A,h^4?n:w.set):(y,A)=>y[s]=A)),o=(0,i[S])(h?h<4?c?n:w[x]:h>4?void 0:{get:w.get,set:w.set}:r,u),a._=1,h^4||o===void 0?Lt(o)&&(h>4?m.unshift(o):h?c?n=o:w[x]=o:r=o):typeof o!="object"||o===null?yt("Object expected"):(Lt(l=o.get)&&(w.get=l),Lt(l=o.set)&&(w.set=l),Lt(l=o.init)&&m.unshift(l));return h||on(e,r),w&&Ke(r,s,w),c?h^4?n:w:r},Do=(e,t,s)=>ql(e,typeof t!="symbol"?t+"":t,s),un=(e,t,s)=>t.has(e)||yt("Cannot "+s),Go=(e,t)=>Object(t)!==t?yt('Cannot use the "in" operator on this value'):e.has(t),de=(e,t,s)=>(un(e,t,"read from private field"),s?s.call(e):t.get(e)),Oe=(e,t,s)=>t.has(e)?yt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Se=(e,t,s,i)=>(un(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Gi=(e,t,s)=>(un(e,t,"access private method"),s),Vo=(e,t,s,i)=>({set _(r){Se(e,t,r,s)},get _(){return de(e,t,i)}}),zl,ms,Ul=C({"base.ts"(){"use strict";zl=(()=>{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})(),ms=(()=>{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 Ae(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,r)=>Ae(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(i,r)=>t[r])}var qe,Bs,ft,mt,xt,rt,Hl,ve,Ye,Hn,Dn,xs,Dl,Gn,Vn,Ht,vt,he=C({"util/string.ts"(){"use strict";qe=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Bs=String.raw`[^[\]<>"\0-\x1F\x7F${qe}\uFFFD]`,ft=String.raw`(?:\[[\da-f:.]+\]|${Bs})`,mt=String.raw`(?:${Bs}|\0\d+[cn!~]\x7F)*`,xt=e=>e.trim().toLowerCase(),rt=(e,t)=>s=>s.replace(e,t),Hl=rt(/[\0\x7F]|\r$/gmu,""),ve=rt(/\0\d+[cn]\x7F/gu,""),Ye=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),Hn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Dn=rt(/&(?:#(\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)):Hn[s.toLowerCase()]),xs=e=>Dn(e),Dl=rt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Gn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Vn=e=>rt(e,t=>`&${Gn[t]};`),Ht=Vn(/[&<>]/gu),vt=(e,t={})=>{const{pre:s="",post:i="",sep:r=""}=t;return s+e.map(n=>n.print()).join(r)+i}}}),Qo=an({"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}}}),Jo=an({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),be,Gl,Vi,Me=C({"util/constants.ts"(){"use strict";be=11,Gl=Qo(),Vi=Jo()}});function pt(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 Dt,Ze=C({"../common/dist/index.mjs"(){"use strict";Dt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25"))}}),le,ue=C({"lib/rect.ts"(){"use strict";var e,t,s,i,Qi,n;le=(n=class{constructor(l,o){L(this,i);L(this,e);L(this,t);L(this,s);F(this,e,l),F(this,t,o)}get start(){return f(this,t)}get top(){return P(this,i,Qi).call(this).top}get left(){return P(this,i,Qi).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Qi=function(){var l;return(l=f(this,s))!=null||F(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},n)}}),Qn,Jn,Ut,Ji,qs,j,M,Te,Ss,U,dn,We,hn,cn,gn,Gt,bt,pn,Xe,Vl,W=C({"util/lint.ts"(){"use strict";Ze(),Ie(),ue(),O(),Qn=new Set(["tr","td","th","caption"]),Jn=new Set(["Template:!!","Template:!-"]),Ut=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")&&Jn.has(t.name)||t.is("html")&&Qn.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Ut(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Ut);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Ji=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),qs=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:o,left:a}=s instanceof le?s:new le(t,l),{offsetHeight:u,offsetWidth:d}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,o,a),{line:p,character:x}=Ji(g,c,u,d);return{rule:i,message:I.msg(r),severity:n,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:x}},j=qs((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}}),M=qs((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),Te=(e,t,s,i=0)=>({desc:I.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),Ss=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),U=(e,t=0,s="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:s}:Te(e,"remove",s,t),dn=(e,t)=>Te(e,"decode",Dt(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),We=(e,t,s=0)=>({desc:I.msg("close"),range:[e+s,e],text:t}),hn=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),cn=(e,t)=>Te(e,"comment",`<!--${t}-->`),gn=(e,t)=>Te(e,"uppercase",t.toUpperCase()),Gt=(e,t=0)=>({desc:I.msg("whitespace"),range:[e,e+t],text:" "}),bt=(e,t,s=1)=>({desc:I.msg("escape"),range:[e,e+s],text:t.repeat(s)}),pn=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),Xe=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===ye.rev))return e[1];const r=t();return(i||I.viewOnly)&&s([ye.rev,r]),r},Vl=(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"]:[]}}),Xn,fn,Ql=C({"parser/selector.ts"(){"use strict";Xn=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},fn=(e,t,s)=>{const i=e.split(",").map(r=>Xn(r.trim()));return(({type:r,name:n})=>i.some(l=>l(r,n)))}}}),Xo=an({"../node_modules/binary-search/index.js"(e,t){t.exports=function(s,i,r,n,l){var o,a;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),a=+r(s[o],i,o,s),a<0)n=o+1;else if(a>0)l=o-1;else return o;return~n}}}),Kn,Jl,Ko=C({"util/search.ts"(){"use strict";Kn=Uo(Xo()),Jl=(e,t,s)=>{const i=(0,Kn.default)(e,t,s);return i<0?~i:i}}}),As,mn=C({"mixin/cached.ts"(){"use strict";W(),As=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Xe(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),Xl,Yo=C({"mixin/nodeLike.ts"(){"use strict";Xl=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}}}),Yn,Zn,Kt,St,At,Yt,kt,_t,$t,Qe,Kl=C({"lib/node.ts"(){"use strict";Ko(),W(),Ie(),mn(),Yo(),O(),Zn=[Xl],Yn=[As(!1)],Qe=class{constructor(){Y($t,5,this),Do(this,"childNodes",[]),Oe(this,Kt),Oe(this,St),Oe(this,At),Oe(this,Yt),Oe(this,kt),Oe(this,_t,{})}get parentNode(){return de(this,Kt)}get nextSibling(){return de(this,St)}get previousSibling(){return de(this,At)}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":Se(this,Kt,t),t||(Se(this,St,void 0),Se(this,At,void 0));break;case"nextSibling":Se(this,St,t);break;case"previousSibling":Se(this,At,t);break;case"aIndex":I.viewOnly&&Se(this,kt,[ye.rev,t]);break;default:this[e]=t}}getRootNode(){return Xe(de(this,Yt),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&Se(this,Yt,e)})}indexFromPos(e,t){this.lspError("AstNode.indexFromPos")}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=Jl(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 Xe(de(this,_t)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)I.viewOnly&&(de(this,_t)[r]=[ye.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{de(this,_t)[e]=t})}getAbsoluteIndex(){return Xe(de(this,kt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{Se(this,kt,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){{const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
+
`)){const i=t+s.length;e.push([s,t,i]),t=i+1}return e}}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},$t=te(null),Kt=new WeakMap,St=new WeakMap,At=new WeakMap,Yt=new WeakMap,kt=new WeakMap,_t=new WeakMap,Z($t,1,"getLines",Yn,Qe),Qe=Z($t,0,"AstNode",Zn,Qe),Y($t,1,Qe)}}),Yl,Zo=C({"mixin/elementLike.ts"(){"use strict";Ql(),Yl=e=>{var t,Xi;{class i extends e{constructor(){super(...arguments);L(this,t)}getElementBy(l){const o=[...this.childNodes].reverse();for(;o.length>0;){const a=o.pop(),{type:u,childNodes:d}=a;if(u!=="text"){if(l(a))return a;for(let h=d.length-1;h>=0;h--)o.push(d[h])}}}querySelector(l){return this.getElementBy(P(this,t,Xi).call(this,l))}getElementsBy(l){const o=[...this.childNodes].reverse(),a=[];for(;o.length>0;){const u=o.pop(),{type:d,childNodes:h}=u;if(d!=="text"){l(u)&&a.push(u);for(let g=h.length-1;g>=0;g--)o.push(h[g])}}return a}querySelectorAll(l){return this.getElementsBy(P(this,t,Xi).call(this,l))}escape(){}}return t=new WeakSet,Xi=function(l){return fn(l,this)},i}}}}),er,Ws,tr,Ft,eu=C({"lib/element.ts"(){"use strict";he(),Ie(),Ql(),Kl(),Zo(),er=[Yl],Ft=class extends(tr=Qe){get length(){return this.childNodes.length}text(e){return Ye(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,r;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(r=e[s])==null||r.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:r}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||r===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){this.lspError("AstElement.removeAt")}insertAt(e,t=this.length){return Fn(this,t,0,[e]),e}closest(e){const t=fn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,r=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",r);const l=n.lint(r,t);l.length>0&&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":""}">`)+vt(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){}},Ws=te(tr),Ft=Z(Ws,0,"AstElement",er,Ft),Y(Ws,1,Ft)}}),Zt,Ms,zs,sr,ir,nr,rr,Us,lr,Ki,tu=C({"lib/text.ts"(){"use strict";var e,Zl,s;he(),W(),O(),Kl(),Zt=String.raw`[${qe}\t]*`,Ms=String.raw`[^\S\n]*`,zs=String.raw`<${Ms}(?:/${Ms})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Zt}\d)|isbn(?=[-::]?${Zt}(?:\d(?:${Zt}|-)){6})`,sr=new RegExp(String.raw`${zs}|https?[:/]/+`,"giu"),ir=new RegExp(zs,"giu"),nr=new Set(["attr-value","ext-link-text","link-text"]),rr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Us=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"]),lr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){return/\w/u}})(),Ki=(s=class extends Qe{constructor(r){super();L(this,e);Ne(this,"data","");this.data=r}get type(){return"text"}toString(r){var n;return r&&!((n=this.parentNode)!=null&&n.getAttribute("built"))?ve(this.data):this.data}text(){return this.data}lint(r=this.getAbsoluteIndex(),n){var l,o,a;{if(n===!1)return[];const{data:u,parentNode:d,nextSibling:h,previousSibling:g}=this;if(!d)throw new Error("An isolated text node cannot be linted!");const{type:c,name:p,parentNode:x}=d;if(c==="attr-value"){const{name:z,tag:X}=x;if(X==="ref"&&(z==="name"||z==="follow")||z==="group"&&(X==="ref"||X==="references")||X==="choose"&&(z==="before"||z==="after"))return[]}if(n!=null||(n=c==="free-ext-link"||c==="ext-link-url"||c==="ext-link-text"||c==="image-parameter"&&p==="link"||c==="attr-value"?ir:sr),u.search(n)===-1)return[];n.lastIndex=0;const m=[],v=h==null?void 0:h.type,w=h==null?void 0:h.name,S=g==null?void 0:g.type,y=this.getRootNode(),A=y.toString(),{ext:k,html:$,variants:b}=y.getAttribute("config"),{top:_,left:T}=y.posFromIndex(r),{lintConfig:N}=I,R=N.rules["tag-like"],q=typeof R=="object"&&R[1]?new Set(Object.keys(R[1]).filter(z=>z!=="invalid"&&z!=="disallowed")):new Set,J=new Set(["onlyinclude","noinclude","includeonly",...k,...$[0],...$[1],...$[2],...q,...N.getSeverity("tag-like","disallowed")?Us:[]]);for(let z=n.exec(u);z;z=n.exec(u)){const[,X,pe]=z;let{index:G,0:V}=z;if(pe&&pe!=="]"){const{length:fe}=pe;G+=fe,V=V.slice(fe)}V=V.toLowerCase();const[K]=V,Fe=K==="r"||K==="p"||K==="i",H=K==="{",ee=K==="}",D=K==="[",ne=K==="]";let{length:ae}=V;if(K==="<"&&!J.has(X.toLowerCase())||D&&c==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(u.slice(G+1))||h!=null&&h.is("ext")&&w==="nowiki"&&((l=h.innerText)!=null&&l.includes("]")))||Fe&&(!d.isPlain()||nr.has(c)))continue;ne&&(G||ae>1)&&n.lastIndex--;let oe=r+G,re=oe+ae,ce,me;const we=A[re],nt=A[oe-1],Fs=H||D,Es=H&&nt==="-"&&b.length>0,Rs=ee&&we==="-"&&b.length>0,En=D&&v==="free-ext-link"&&!u.slice(G+1).trim()||ne&&S==="free-ext-link"&&!u.slice(0,G).includes("]");if(Fe)ce="lonely-http",V=V.toUpperCase(),me=N.getSeverity(ce,V);else if(K==="<"){ce="tag-like";let fe;/^<\/?\s/u.test(V)||!/[\s/>]/u.test(we!=null?we:"")?fe="invalid":q.has(X)?fe=X:Us.has(X)&&!k.includes(X)&&(fe="disallowed"),me=N.getSeverity(ce,fe)}else if(Es||Rs)ce="lonely-bracket",me=N.getSeverity(ce,"converter"),Es&&G>0?(V="-{",G--,oe--,ae=2):Rs&&G<u.length-1&&(V="}-",re++,ae=2);else if(En)ce="lonely-bracket",me=N.getSeverity(ce,"extLink");else if(Fs||ee||ne)if(ce="lonely-bracket",ae>1||H&&we===K||ee&&nt===K)me=N.getSeverity(ce,"double");else{if(!D||c!=="ext-link-text"){const fe=rr[K],Ps=Fs?u.slice(G+1):u.slice(0,G);if(H&&((o=fe.exec(Ps))==null?void 0:o[0])==="}"||ee&&((a=fe.exec(Ps))==null?void 0:a[0])==="{")continue;if(!Ps.includes(K)){const jn=Fs?"nextSibling":"previousSibling";let Ge=this[jn];for(;Ge&&(Ge.type!=="text"||!fe.test(Ge.data));)Ge=Ge[jn];if(Ge&&fe.exec(Ge.data)[0]!==K)continue}}me=N.getSeverity(ce,"single")}else ce="lonely-http",me=N.getSeverity(ce);if(!me)continue;const Rn=this.posFromIndex(G),{line:Pn,character:On}=Ji(_,T,Rn.top+1,Rn.left),De={rule:ce,message:I.msg("lonely",Fe||K==="h"||Es||Rs?V:K),severity:me,startIndex:oe,endIndex:re,startLine:Pn,endLine:Pn,startCol:On,endCol:On+ae};if(N.computeEditInfo)if(K==="<")De.suggestions=[bt(oe,"<")];else if(K==="h"&&c!=="link-text"&&lr.test(nt||""))De.suggestions=[Gt(oe)];else if(D&&c==="ext-link-text"){const fe=d.getAbsoluteIndex()+d.toString().length;De.suggestions=[bt(fe,"]")]}else if(ne&&En){const fe=r-g.toString().length;De.suggestions=[Ss(fe,"left-bracket","[")]}else Fe&&(De.suggestions=[...z[0]===V?[]:[gn(De,V)],...we===":"||we===":"?[Gt(re,1)]:[]]);m.push(De)}return m}}replaceData(r){P(this,e,Zl).call(this,r)}splitText(r){this.lspError("AstText.splitText")}escape(){}print(){return Ht(this.data)}},e=new WeakSet,Zl=function(r){this.setAttribute("data",r)},s)}}),ze,et=C({"mixin/hidden.ts"(){"use strict";ze=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),Le,Re=C({"mixin/noEscape.ts"(){"use strict";Le=e=>{}}}),Ue,tt=C({"src/syntax.ts"(){"use strict";var e,t;B(),Ue=(t=class extends E{constructor(i,r,n,l,o){super(i,n,l,o);L(this,e);F(this,e,r)}get type(){return f(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Pe,He=C({"mixin/padded.ts"(){"use strict";Pe=({length:e})=>t=>{{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}}),xe,st=C({"src/atom.ts"(){"use strict";var e,t;B(),xe=(t=class extends E{constructor(i,r,n,l,o){super(i,n,l,o);L(this,e);F(this,e,r)}get type(){return f(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)}}),ar,or,Hs,ur,je,ks=C({"src/link/base.ts"(){"use strict";var e,t,s,i;W(),Me(),ue(),He(),Re(),O(),B(),st(),ar=r=>r==="redirect-target"||r==="link",or=[Le,Pe("[[")],je=(i=class extends(ur=E){constructor(n,l,o,a=[],u="|"){super(void 0,o,a,{});L(this,e,!0);L(this,t);L(this,s);if(this.insertAt(new xe(n,"link-target",o,a,{})),l!==void 0){const d=new E(l,o,a,{});d.type="link-text",d.setAttribute("stage",be-1),this.insertAt(d)}F(this,t,u)}get link(){}get fragment(){}afterBuild(){F(this,s,this.getTitle()),f(this,t).includes("\0")&&F(this,t,this.buildFromStr(f(this,t),0)),this.setAttribute("name",f(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,f(this,t));return f(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return f(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?f(this,s):super.getAttribute(n)}getGaps(n){return n===0?f(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{childNodes:[a,u],type:d}=this,{encoded:h,fragment:g}=f(this,s),{lintConfig:c}=I,{computeEditInfo:p,fix:x}=c,m=new le(this,n);let v="unknown-page",w=c.getSeverity(v);if(w&&a.childNodes.some(({type:S})=>S==="template")&&o.push(j(a,m,v,"template-in-link",w)),v="url-encoding",w=c.getSeverity(v),w&&h){const S=j(a,m,v,"unnecessary-encoding",w);(p||x)&&(S.fix=dn(S,a)),o.push(S)}if(v="pipe-like",w=c.getSeverity(v,"link"),w&&(d==="link"||d==="category")){const S=u==null?void 0:u.childNodes.findIndex(A=>A.type==="text"&&A.data.includes("|")),y=u==null?void 0:u.childNodes[S];if(y){const A=j(u,m,v,"pipe-in-link",w);if(p){const k=A.startIndex+u.getRelativeIndex(S);A.suggestions=[pn(k,y.data)]}o.push(A)}}if(v="no-ignored",w=c.getSeverity(v,"fragment"),w&&g!==void 0&&!ar(d)){const S=j(a,m,v,"useless-fragment",w);if(p||x){const y=a.childNodes.findIndex(k=>k.type==="text"&&k.data.includes("#")),A=a.childNodes[y];A&&(S.fix=U(S,a.getRelativeIndex(y)+A.data.indexOf("#")))}o.push(S)}return o}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(f(this,e)?{pre:"[[",post:"]]",sep:f(this,t)}:{sep:f(this,t)})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),Hs=te(ur),je=Z(Hs,0,"LinkBaseToken",or,je),Y(Hs,1,je)}}),dr,Ds,hr,Ce,it=C({"src/nowiki/base.ts"(){"use strict";Re(),B(),dr=[Le],Ce=class extends(hr=E){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Ds=te(hr),Ce=Z(Ds,0,"NowikiBaseToken",dr,Ce),Y(Ds,1,Ce)}}),cr,Gs,gr,ke,wt=C({"src/nowiki/noinclude.ts"(){"use strict";et(),it(),cr=[ze()],ke=class extends(gr=Ce){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Gs=te(gr),ke=Z(Gs,0,"NoincludeToken",cr,ke),Y(Gs,1,ke)}}),ea,su=C({"src/link/redirectTarget.ts"(){"use strict";W(),O(),ks(),wt(),ea=class extends je{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new ke(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:i}=I,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=j(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=U(n)),t.push(n)}return t}}}}}),pr,Vs,fr,Et,iu=C({"src/redirect.ts"(){"use strict";var e,t,s;et(),Re(),B(),tt(),su(),pr=[ze(!1,!1),Le],Et=(s=class extends(fr=E){constructor(r,n,l,o,a,u,d=[]){super(void 0,u,d);L(this,e);L(this,t);F(this,e,r),F(this,t,a),this.append(new Ue(n,"redirect-syntax",u,d),new ea(l,o==null?void 0:o.slice(1),u,d))}get type(){return"redirect"}getAttribute(r){return r==="padding"?f(this,e).length:super.getAttribute(r)}toString(r){return f(this,e)+super.toString(r)+f(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+f(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:f(this,e),post:f(this,t)})}},e=new WeakMap,t=new WeakMap,s),Vs=te(fr),Et=Z(Vs,0,"RedirectToken",pr,Et),Y(Vs,1,Et)}}),ta={};se(ta,{parseRedirect:()=>sa});var sa,nu=C({"parser/redirect.ts"(){"use strict";O(),iu(),sa=(e,t,s)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&I.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Et(...i.slice(1),t,s),e):!1}}}),mr,Qs,xr,Rt,ru=C({"src/onlyinclude.ts"(){"use strict";He(),Re(),B(),mr=[Le,Pe("<onlyinclude>")],Rt=class extends(xr=E){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}},Qs=te(xr),Rt=Z(Qs,0,"OnlyincludeToken",mr,Rt),Y(Qs,1,Rt)}}),Qt,_s=C({"mixin/gapped.ts"(){"use strict";Qt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),vr,Js,br,Je,xn=C({"src/tagPair/index.ts"(){"use strict";var e,t;_s(),Re(),B(),vr=[Qt(),Le],Je=(t=class extends(br=E){constructor(i,r,n,l,o,a=[]){super(void 0,o);L(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 u=typeof r=="string"?-1:a.indexOf(r);a.splice(u===-1?1/0:u,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[o,a]=f(this,e);return r?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${l.toString(i)}${this.closed?`</${a}>`:""}`}text(){const[i,r]=f(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?f(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=f(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${r}>`:""})}},e=new WeakMap,t),Js=te(br),Je=Z(Js,0,"TagPairToken",vr,Je),Y(Js,1,Je)}}),vn,ia=C({"src/tag/index.ts"(){"use strict";var e,t,s,i;W(),Ie(),O(),B(),vn=(i=class extends E{constructor(n,l,o,a,u){super(void 0,a,u);L(this,e);L(this,t);L(this,s);this.insertAt(l),F(this,e,o),F(this,t,n)}get closing(){return f(this,e)}toString(n){return`<${f(this,e)?"/":""}${f(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${f(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?f(this,t).length+(f(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return Xe(f(this,s),()=>{const{type:n,name:l,parentNode:o,closing:a,selfClosing:u}=this;let d=!1,h=!1;if(n==="html"){const{html:[,v,w]}=this.getAttribute("config");d=w.includes(l),h=v.includes(l)}if(d||h&&u)return this;if(!o)return;const{childNodes:g}=o,c=g.indexOf(this),p=a?g.slice(0,c).reverse():g.slice(c+1),x=[this],{rev:m}=ye;for(const v of p)if(!(!v.is(n)||n==="html"&&(v.name!==l||h&&v.selfClosing)))if(f(v,e)===a){if(n==="tvar")return;x.push(v)}else{const w=x.pop();if(w===this)return v;I.viewOnly&&(F(w,s,[m,v]),F(v,s,[m,w]))}if(I.viewOnly)for(const v of x)F(v,s,[m,void 0])},n=>{F(this,s,n),n[1]&&n[1]!==this&&F(n[1],s,[ye.rev,this])})}print(){return super.print({pre:`<${f(this,e)?"/":""}${f(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),yr,Xs,wr,Be,lu=C({"src/tag/tvar.ts"(){"use strict";et(),ia(),tt(),yr=[ze()],Be=class extends(wr=vn){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)}},Xs=te(wr),Be=Z(Xs,0,"TvarToken",yr,Be),Y(Xs,1,Be)}}),na,au=C({"src/tagPair/translate.ts"(){"use strict";var e,ra,s;B(),xn(),tt(),lu(),na=(s=class extends Je{constructor(r,n,l,o=[]){const a=new Ue(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(d,h,g)=>(new Be("tvar",h,!1,l,o),new Be("","",!0,l,o),`\0${o.length-2}n${g}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(d,h,g,c,p,x,m)=>(new Be(h,g,!1,l,o),new Be(x,m,!0,l,o),`\0${o.length-2}n${p}\0${o.length}n`));const u=new E(n,l,o);u.type="translate-inner";super("translate",a,u,"translate",l,o);L(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${P(this,e,ra).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,ra=function(){return this.firstChild.toString()===" nowrap"},s)}}),Sr,Ks,Ar,Pt,ou=C({"src/tagPair/include.ts"(){"use strict";W(),ue(),et(),O(),xn(),Sr=[ze(!1)],Pt=class extends(Ar=Je){get type(){return"include"}constructor(e,t="",s,i,r,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",r,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:r}=this,n=new le(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=I,{computeEditInfo:a}=o,u=l.map(d=>o.getSeverity(d,"include"));if(u[0]&&s.data.trim()){const d=j(s,n,l[0],"useless-attribute",u[0]);a&&(d.suggestions=[U(d)]),t.push(d)}if(u[1]&&!i){const d=M(this,n,l[1],I.msg("unclosed",`<${r}>`),u[1]);a&&(d.suggestions=[We(d.endIndex,`</${r}>`)]),t.push(d)}return t}}},Ks=te(Ar),Pt=Z(Ks,0,"IncludeToken",Sr,Pt),Y(Ks,1,Pt)}}),$s,bn=C({"mixin/attributesParent.ts"(){"use strict";$s=(e=0)=>t=>{var s,la;{class r extends t{constructor(){super(...arguments);L(this,s)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return P(this,s,la).call(this).getAttr(o)}}return s=new WeakSet,la=function(){return this.childNodes[e]},r}}}}),ie,Ys,Zs,Tt,es,ei,Ct,ti,si,ii,ts,ni,ri,li,_e,aa,oa,ua,da,uu=C({"util/sharable.ts"(){"use strict";ie=new Set(["align"]),Ys=new Set(["cite"]),Zs=new Set(["cite","datetime"]),Tt=new Set(["width"]),es=new Set(["axis","align","bgcolor","height","width","valign"]),ei=new Set([...es,"abbr","headers","scope","rowspan","colspan"]),Ct=new Set(["type"]),ti=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),si=new Set(["clear"]),ii=new Set(["bgcolor","align","valign"]),ts=new Set(["qid","forcemathmode","type","display"]),ni=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),ri=new Set(["weight"]),li=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),_e=new Set,aa=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"]),oa={div:ie,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,blockquote:Ys,q:Ys,p:ie,br:si,pre:Tt,ins:Zs,del:Zs,ul:Ct,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ti,"border"]),caption:ie,tr:ii,td:ei,th:ei,font:new Set(["size","color","face"]),hr:Tt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ct,poem:ie,categorytree:ie,combooption:ie,math:_e,chem:_e,ce:_e,img:new Set(["alt","src","width","height","loading","srcset"])},ua={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:_e,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:ri,choicetemplate:ri,imagemap:_e,inputbox:_e,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:_e,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([...ts,"chem"]),chem:ts,ce:ts,hiero:_e,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:ni,syntaxhighlight:ni,templatedata:_e,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:_e,mapframe:new Set([...li,"frameless"]),maplink:new Set([...li,"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:ti,td:new Set([...es,"scope"]),th:es,br:si,caption:ie,div:ie,hr:Tt,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,li:Ct,p:ie,pre:Tt,tr:ii,ul:Ct}}}),kr,_r,$r,Tr,us,du=C({"src/attribute.ts"(){"use strict";var e,t,s,i,r,ha,Yi,o;W(),he(),Me(),uu(),ue(),O(),B(),st(),kr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,_r=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,$r=new Set(["ext","arg","magic-word","template"]),Tr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),us=(o=class extends E{constructor(u,d,h,g="",c,p=[],x=I.getConfig(),m=[]){const v=new xe(h,"attr-key",x,m);let w;if(h==="title"||d==="img"&&h==="alt")w=new E(c,x,m,{}),w.type="attr-value",w.setAttribute("stage",be-1);else if(d==="gallery"&&h==="caption"||d==="ref"&&h==="details"||(d==="mapframe"||d==="maplink")&&h==="text"||d==="choose"&&(h==="before"||h==="after")){const S=Ee(ge({},x),{excludes:[...x.excludes,"heading","html","table","hr","list"]});w=new E(c,S,m,{}),w.type="attr-value",w.setAttribute("stage",1)}else w=new xe(c,"attr-value",x,m,{});super(void 0,x,m);L(this,r);L(this,e);L(this,t);L(this,s);L(this,i);F(this,e,u),this.append(v,w),F(this,s,g),F(this,i,[...p]),F(this,t,d),this.setAttribute("name",xt(ve(h)))}get type(){return f(this,e)}get tag(){return f(this,t)}get balanced(){return!f(this,s)||f(this,i)[0]===f(this,i)[1]}afterBuild(){f(this,s).includes("\0")&&F(this,s,this.buildFromStr(f(this,s),0)),this.parentNode&&F(this,t,this.parentNode.name),P(this,r,ha).call(this),super.afterBuild()}toString(u){const[d="",h=""]=f(this,i);return f(this,s)?super.toString(u,f(this,s)+d)+h:this.firstChild.toString(u)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var u,d;return f(this,s)?f(this,s).length+((d=(u=f(this,i)[0])==null?void 0:u.length)!=null?d:0):0}lint(u=this.getAbsoluteIndex(),d){var h;{const g=super.lint(u,d),{balanced:c,firstChild:p,lastChild:x,name:m,tag:v}=this,w=new le(this,u),S=["unclosed-quote","obsolete-attr"],{lintConfig:y}=I,A=S.map($=>y.getSeverity($,m));if(A[0]&&!c){const $=j(x,w,S[0],"unclosed-quotes",A[0]);$.startIndex--,$.startCol--,y.computeEditInfo&&($.suggestions=[We($.endIndex,f(this,i)[0])]),g.push($)}const k=P(this,r,Yi).call(this,u,w);return k&&g.push(k),A[1]&&((h=da[v])!=null&&h.has(m))&&g.push(j(p,w,S[1],"obsolete-attribute",A[1])),g}}getValue(){return f(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(u){return u==="invalid"?P(this,r,Yi).call(this):super.getAttribute(u)}print(){const[u="",d=""]=f(this,i);return f(this,s)?super.print({sep:Ht(f(this,s))+u,post:d}):super.print()}json(u,d=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,ha=function(){this.setAttribute("name",xt(this.firstChild.text()))},Yi=function(u,d){const{firstChild:h,lastChild:g,type:c,name:p,tag:x,parentNode:m}=this,v=!g.childNodes.some(({type:_})=>$r.has(_)),w=this.getValue(),S=ua[x],y=oa[x],{length:A}=this.toString();let k="illegal-attr",$,b;if({lintConfig:$}=I,{computeEditInfo:b}=$,!(S!=null&&S.has(p))&&!(y!=null&&y.has(p))&&(c==="ext-attr"?S||y:!/\{\{[^{]+\}\}/u.test(p))&&(c==="ext-attr"&&!y||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(x==="meta"||x==="link"||!aa.has(p)))||(p==="itemtype"||p==="itemid"||p==="itemref")&&!(m!=null&&m.hasAttr("itemscope"))){if(u===void 0)return!0;{const _=$.getSeverity(k,"unknown");if(_){const T=j(h,d,k,"illegal-attribute-name",_);return b&&(T.suggestions=[U(u,A)]),T}}}else if(p==="style"&&typeof w=="string"&&kr.test(w)){if(u===void 0)return!0;{k="insecure-style";const _=$.getSeverity(k);return _&&j(g,d,k,"insecure-style",_)}}else if(p==="tabindex"&&typeof w=="string"&&w!=="0"){if(u===void 0)return!0;{const _=$.getSeverity(k,"tabindex");if(_){const T=j(g,d,k,"nonzero-tabindex",_);return b&&(T.suggestions=[U(u,A),Te(T,"0 tabindex","0")]),T}}}else if(typeof w=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||Tr.has(p))&&_r.test(w)||v&&(p==="href"||x==="img"&&p==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(w))){if(u===void 0)return!0;{const _=$.getSeverity(k,"value");return _&&j(g,d,k,"illegal-attribute-value",_)}}else if(v&&c!=="ext-attr"){const _=Vl(x,p),T=String(w).toLowerCase();if(_.length>0&&_.every(N=>N!==T)){if(u===void 0)return!0;{const N=$.getSeverity(k,"value");return N&&j(g,d,k,"illegal-attribute-value",N)}}}return!1},o)}}),ai,Cr,Ir,Ts,yn=C({"src/attributes.ts"(){"use strict";var e,t,ds,i;W(),he(),ue(),O(),B(),st(),du(),ai=r=>r.slice(0,-1),Cr=r=>`${ai(r)}-dirty`,Ir=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(r){return/[^\W_]/u}})(),Ts=(i=class extends E{constructor(n,l,o,a,u=[]){super(void 0,a,u,{});L(this,t);L(this,e);if(F(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 h="",g=d.exec(n),c=0;const p=(()=>{h&&(super.insertAt(new xe(h,Cr(l),a,u,{})),h="")});for(;g;){const{index:x,0:m,1:v,2:w,3:S,4:y,5:A,6:k}=g;if(h+=n.slice(c,x),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(ve(v).trim())){const $=y!=null?y:k,b=[S,A],_=new us(ai(l),o,v,w,$,b,a,u);p(),super.insertAt(_)}else h+=m;({lastIndex:c}=d),g=d.exec(n)}h+=n.slice(c),p()}}get type(){return f(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 us&&(!n||l.name===xt(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:a,childNodes:u}=this,d=new Map,h=new Set,g=new le(this,n),c=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:x,fix:m}=p,v=["closingTag","invalidAttributes","nonWordAttributes"].map(S=>p.getSeverity(c[0],S));if(v[0]&&P(this,t,ds).call(this)){const S=M(this,g,c[0],"attributes-of-closing-tag",v[0]);if(x){const y=a.getAbsoluteIndex();S.suggestions=[U(S),hn(y)]}o.push(S)}for(const S of u)if(S instanceof us){const{name:y}=S;d.has(y)?(h.add(y),d.get(y).push(S)):d.set(y,[S])}else{const y=S.text().trim(),A=v[Ir.test(y)?1:2];if(y&&A){const k=j(S,g,c[0],"invalid-attribute",A);x&&(k.suggestions=[U(k,0," ")]),o.push(k)}}const w=p.getSeverity(c[1],"attribute");if(w&&h.size>0)for(const S of h){const y=d.get(S).map(A=>{const k=A.getValue();return[A,k===!0?"":k]});Array.prototype.push.apply(o,y.map(([A,k],$)=>{const b=j(A,g,c[1],I.msg("duplicate-attribute",S),w);if(x||m){const _=U(b);!k||y.slice(0,$).some(([,T])=>T===k)?b.fix=_:x&&(b.suggestions=[_])}return b}))}return o}}getAttribute(n){return n==="invalid"?P(this,t,ds).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,ds).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof xe?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,ds=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),ca={};se(ca,{PreToken:()=>ga});var ga,hu=C({"src/pre.ts"(){"use strict";Me(),B(),wt(),ga=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),a=0,u="";for(;l&&o;)new ke(l[0],t,s,!0),new ke(o[0],t,s,!0),u+=`${e.slice(a,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,a=o.index+n+1,i.lastIndex=a,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=u+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",be-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Cs,wn=C({"src/multiLine/index.ts"(){"use strict";B(),Cs=class extends E{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
3
3
|
`)}text(){return super.text(`
|
|
4
4
|
`).replace(/\n\s*\n/gu,`
|
|
5
5
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
6
|
-
`})}}}}),
|
|
7
|
-
`).map(n=>r?n:Vt(n,s,i,e)).map(n=>new lo(n,s,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=I,i=s.getSeverity(t,this.name);if(!i)return[];const r=new le(this,e),n=I.msg("invalid-parameter",this.name),l=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const d=o.childNodes.filter(({type:u})=>u!=="comment"&&u!=="include"&&u!=="noinclude");if(d.some(({type:u})=>u==="ext"))l.push(q(o,r,t,n,i));else{const u=d.findIndex(({type:h})=>h!=="text"),a=d.slice(0,u===-1?void 0:u).map(String).join("");if(a&&!(u===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(a)){const h=q(o,r,t,n,i);s.computeEditInfo&&(h.suggestions=[z(h)]),l.push(h)}else{const h=o.lint(e,!1);h.length>0&&l.push(...h)}}e+=o.toString().length+1}return l}}}}}),Ar,ni,_r,lt,uo=C({"src/heading.ts"(){"use strict";var e,t,us,i;M(),Ne(),de(),Ee(),B(),W(),tt(),Ar=[Ie],lt=(i=class extends(_r=E){constructor(n,l,o,d=[]){super(void 0,o,d);N(this,t);N(this,e);L(this,e,n);const u=new E(l[0],o,d);u.type="heading-title",u.setAttribute("stage",2);const a=new Ue(l[1],"heading-trail",o,d);this.append(u,a)}get type(){return"heading"}get level(){return m(this,e)}toString(n){const l=P(this,t,us).call(this);return l+this.firstChild.toString(n)+l+this.lastChild.toString(n)}text(){const n=P(this,t,us).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()===2:n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{firstChild:d,level:u}=this,a=d.toString(),h=a.startsWith("="),g=h||a.endsWith("="),c=new le(this,n),p=this.inHtmlAttrs(),b=["h1","unbalanced-header","format-leakage"],{lintConfig:x}=I,{computeEditInfo:v,fix:y}=x,k=b.map(w=>x.getSeverity(w,"apostrophe"));if(k[0]&&this.level===1){const w=q(d,c,b[0],"<h1>",k[0]);v&&!g&&(w.suggestions=[$e(w,"h2",`=${a}=`)]),o.push(w)}if(k[1]&&g){const w=I.msg("unbalanced-in-section-header",'"="'),A=q(d,c,b[1],w,k[1]);if(!(!v||a==="="))if(h){const[_]=/^=+/u.exec(a),f=u+_.length;A.suggestions=[{desc:`h${u}`,range:[A.startIndex,A.startIndex+_.length],text:""}],f<7&&A.suggestions.push({desc:`h${f}`,range:[A.endIndex,A.endIndex],text:_})}else{const _=/[^=](=+)$/u.exec(a)[1],f=u+_.length;A.suggestions=[{desc:`h${u}`,range:[A.endIndex-_.length,A.endIndex],text:""}],f<7&&A.suggestions.push({desc:`h${f}`,range:[A.startIndex,A.startIndex],text:_})}o.push(A)}if(p){const w="parsing-order",A=x.getSeverity(w,p===2?"heading":"templateInTable");A&&o.push(G(this,c,w,"header-in-html",A))}if(k[2]){const w=this.getRootNode().toString(),A=d.childNodes.filter(Cs("quote")),_=A.filter(({bold:S})=>S),f=A.filter(({italic:S})=>S);if(_.length%2){const S=q(_[_.length-1],Le(fe({},c),{start:n+u,left:c.left+u}),b[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),k[2]);if(v||y){const $=n+u+a.length,T=z(S);w.slice(S.endIndex,$).trim()?v&&(S.suggestions=[T,We($,"'''")]):_.length===1&&f.length===0?S.fix=T:v&&(S.suggestions=[T])}o.push(S)}if(f.length%2){const S=q(f[f.length-1],{start:n+u},b[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),k[2]);if(v||y){const $=n+u+a.length;w.slice(S.endIndex,$).trim()?v&&(S.suggestions=[We($,"''")]):f.length===1&&_.length===0?S.fix=z(S):v&&(S.suggestions=[z(S)])}o.push(S)}}return o}}print(){const n=P(this,t,us).call(this);return super.print({pre:n,sep:n})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakSet,us=function(){return"=".repeat(this.level)},i),ni=Y(_r),lt=X(ni,0,"HeadingToken",Ar,lt),J(ni,1,lt)}}),$r,ho,su=C({"src/parameter.ts"(){"use strict";ce(),M(),B(),W(),$r=new RegExp(`https?://${pt}${ft}$`,"iu"),ho=class extends E{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new E(typeof e=="number"?void 0:e,s,i,{}),n=new E(t,s,i);r.type="parameter-key",r.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(r,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r="unescaped",{lintConfig:n}=I,l=n.getSeverity(r);if(l){const{firstChild:o}=this,d=(s=$r.exec(o.text()))==null?void 0:s[0];try{if(d&&new URL(d).search){const u=q(o,{start:e},r,"unescaped-query",l);u.startIndex=u.endIndex,u.startLine=u.endLine,u.startCol=u.endCol,u.endIndex++,u.endCol++,(n.computeEditInfo||n.fix)&&(u.fix=vt(u.startIndex,"{{=}}")),i.push(u)}}catch(u){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){}}}}),Tr,ri,Cr,ot,iu=C({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,ds,co,d;ce(),M(),Ne(),de(),Ss(),Ee(),B(),W(),su(),st(),tt(),Tr=[Ie,Gt()],ot=(d=class extends(Cr=E){constructor(a,h,g,c=[]){var T,F;let p;const b=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(a);b&&(p=Number(b[1]),a=a.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,n);Fe(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,r);const{parserFunction:[x,v],variable:y,functionHook:k}=g,w=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(a))==null?void 0:T[0];if(w)this.setAttribute("modifier",w),a=a.slice(w.length);else if(a.includes(":")){const[j,...R]=a.split(":"),[ne]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((F=R[0])!=null?F:"");this.setModifier(`${j}:${ne}`)&&(a=R.join(":").slice(ne.length))}const A=a.search(/[::]/u),_=a[A]===":",f=A!==-1;if(f||h.length===0&&!m(this,s)){const j=f?a.slice(0,A):a,R=f&&a.slice(A+1),ne=ve(j),O=f?ne.slice(ne.search(/\S/u))+(_?":":""):ne.trim(),re=O.toLowerCase(),pe=Array.isArray(v),V=pe?v.includes(O):Object.prototype.hasOwnProperty.call(v,O),D=!pe&&V?v[O]:Object.prototype.hasOwnProperty.call(x,re)&&x[re],K=pe&&V||!("functionHook"in g)||k.includes(D),U=pe&&V||y.includes(D);if(f?D&&K:U){this.setAttribute("name",D||re.replace(/^#|:$/u,"")),L(this,e,"magic-word"),_&&L(this,t,":");const Z=new Ue(j,"magic-word-name",g,c);if(super.insertAt(Z),R!==!1&&h.unshift([R]),this.name==="invoke")for(let H=0;H<2;H++){const ee=h.shift();if(!ee)break;const oe=new xe(ee.join("="),`invoke-${H?"function":"module"}`,g,c);super.insertAt(oe)}}}if(this.type==="template"){const j=ve(a).trim();if(!this.normalizeTitle(j,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const R=new xe(a,"template-name",g,c,{});super.insertAt(R)}typeof p=="number"&&(c[p]=void 0);const S=this.isTemplate();let $=1;for(let j=0;j<h.length;j++){const R=h[j];S||this.name==="switch"&&j>0||this.name==="tag"&&j>1||(R[0]=R.join("="),R.length=1),R.length===1&&(R.unshift($),$++),this.insertAt(new ho(...R,g,c))}this.seal("modifier")}get type(){return m(this,e)}get module(){}get function(){}setModifier(a){const{parserFunction:[,,h,g]}=this.getAttribute("config"),c=ve(a).trim();if(a&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),b=h.includes(p),x=g.includes(p);return m(this,s)&&b||!m(this,s)&&(x||!a)||(ke.running||this.length>1)&&(b||x||!a)?(this.setAttribute("modifier",a),L(this,s,b),!!a):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(L(this,r,P(this,n,ds).call(this)),this.setAttribute("name",m(this,r).title))}toString(a){const{childNodes:h,length:g,firstChild:c,modifier:p,type:b}=this;return`{{${p}${b==="magic-word"?c.toString(a)+(g===1?"":m(this,t))+h.slice(1).map(x=>x.toString(a)).join("|"):super.toString(a,"|")}}}`}text(){const{childNodes:a,length:h,firstChild:g,modifier:c,type:p,name:b}=this;return p==="magic-word"&&b==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(h===1?"":m(this,t))+Ye(a.slice(1),"|"):super.text("|")}}}`}getAttribute(a){switch(a){case"padding":return this.modifier.length+2;case"title":return m(this,r);case"colon":return m(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,n,ds).call(this).valid);default:return super.getAttribute(a)}}lint(a=this.getAbsoluteIndex(),h){{const g=super.lint(a,h);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:b}=this,x=new le(this,a),{lintConfig:v}=I,{computeEditInfo:y}=v,k=c==="magic-word";let w="no-ignored",A=v.getSeverity(w,"fragment");if(k&&!P(this,n,ds).call(this).valid)w="invalid-invoke",A=v.getSeverity(w,"name"),A&&g.push(q(p[1],x,w,"illegal-module",A));else if(A){const _=p[k?1:0],f=_.childNodes.findIndex($=>$.type==="text"&&fs($.data).includes("#")),S=_.childNodes[f];if(S){const $=q(_,x,w,"useless-fragment",A);y&&($.suggestions=[z($,_.getRelativeIndex(f)+S.data.indexOf("#"))]),g.push($)}}if(w="invalid-invoke",A=v.getSeverity(w,"function"),A&&k&&b===2)return g.push(G(this,x,w,"missing-function",A)),g;if(w="no-duplicate",A=v.getSeverity(w,"parameter"),A){const _=this.getDuplicatedArgs().filter(([,S])=>!S[0].querySelector("ext")),f="duplicate-parameter";for(const[,S]of _)g.push(...S.map($=>{const T=q($,x,w,f,A);return y&&(T.suggestions=[z(T,-1)]),T}))}return g}}insertAt(a,h=this.length){return super.insertAt(a,h),a.anon?P(this,n,co).call(this,a):a.name&&this.getArgs(a.name,!1,!1).add(a),a}getAllArgs(){return this.childNodes.filter(Cs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:a})=>a)}getArgs(a,h,g=!0){const c=String(a).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return m(this,i).has(c)?p=m(this,i).get(c):(p=new Set(this.getAllArgs().filter(({name:b})=>c===b)),m(this,i).set(c,p)),p}getDuplicatedArgs(){return[...m(this,i)].filter(([,{size:a}])=>a>1).map(([a,h])=>[a,[...h]])}getPossibleValues(){const{type:a,name:h,childNodes:g}=this;if(a==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(h){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const b=g.slice(2),x=b[b.length-1];p=[...b.filter(({anon:v})=>!v),...x!=null&&x.anon?[x]:[]].map(({lastChild:v})=>v);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:b})=>b));for(let b=0;b<p.length;){const{length:x,0:v}=p[b].childNodes.filter(y=>y.text().trim());if(x===0)p.splice(b,1);else if(x>1||v.type!=="magic-word")b++;else try{const y=v.getPossibleValues();p.splice(b,1,...y),b+=y.length}catch(y){b++}}return p}print(){const{childNodes:a,length:h,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?zt(c)+g.print()+(h===1?"":m(this,t))+xt(a.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${zt(c)}</span>`:"")+xt(a,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,ds=function(){const a=this.type==="template";return this.normalizeTitle(this.childNodes[a?0:1].text(),a?10:828,{temporary:!0})},co=function(a){const h=this.getAnonArgs(),g=typeof a!="number";for(let c=g?h.indexOf(a):a-1;c<h.length;c++){const p=h[c],{name:b}=p,x=String(c+1);(b!==x||p===a)&&(p.setAttribute("name",x),this.getArgs(x,!1,!1).add(p))}},d),ri=Y(Cr),ot=X(ri,0,"TranscludeToken",Tr,ot),J(ri,1,ot)}}),Ir,li,Nr,Rt,nu=C({"src/hidden.ts"(){"use strict";et(),W(),Ir=[ze()],Rt=class extends(Nr=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},li=Y(Nr),Rt=X(li,0,"HiddenToken",Ir,Rt),J(li,1,Rt)}}),Lr,oi,Fr,Ot,ru=C({"src/arg.ts"(){"use strict";var e,lu,s;ce(),M(),de(),He(),Ss(),Ee(),B(),W(),st(),nu(),Lr=[Ie,Pe("{{{"),Gt()],Ot=(s=class extends(Fr=E){constructor(r,n,l=[]){super(void 0,n,l,{});N(this,e);for(let o=0;o<r.length;o++){const d=r[o];if(o===0){const u=new xe(d,"arg-name",n,l,{});super.insertAt(u)}else if(o>1){const u=new Rt(d,n,l);super.insertAt(u)}else{const u=new E(d,n,l);u.type="arg-default",u.setAttribute("stage",2),super.insertAt(u)}}}get type(){return"arg"}get default(){}toString(r){return`{{{${super.toString(r,"|")}}}}`}text(){return`{{{${Ye(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(r=this.getAbsoluteIndex(),n){{const{childNodes:[l,o,...d]}=this;l.setAttribute("aIndex",r+3);const u=l.lint(r+3,n);if(o){const p=r+4+l.toString().length;o.setAttribute("aIndex",p);const b=o.lint(p,n);b.length>0&&u.push(...b)}const a=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=a.map(p=>h.getSeverity(p,"arg"));if(c[0]&&d.length>0){const p=new le(this,r);u.push(...d.map(b=>{const x=q(b,p,a[0],"invisible-triple-braces",c[0]);return x.startIndex--,x.startCol--,g&&(x.suggestions=[z(x),vt(x.startIndex,"{{!}}")]),x}))}if(c[1]&&!this.getAttribute("include")){const p=G(this,{start:r},a[1],"unexpected-argument",c[1]);g&&o&&(p.suggestions=[$e(p,"expand",o.text())]),u.push(p)}return u}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(r,n=this.getAbsoluteIndex()){}},e=new WeakSet,lu=function(){},s),oi=Y(Fr),Ot=X(oi,0,"ArgToken",Lr,Ot),J(oi,1,Ot)}}),go={};se(go,{parseBraces:()=>$s});var Er,ai,es,ui,di,hi,Pr,ci,$s,vn=C({"parser/braces.ts"(){"use strict";Ze(),ce(),uo(),iu(),ru(),Er={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ai=String.raw`\[(?!\[)`,es=String.raw`\n(?![=\0])`,ui=String.raw`|\{{2,}`,di=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),hi=gt(e=>new RegExp(e,"gmu")),Pr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ai}|${es})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${es})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ai}|${es})*\}-`,"gu"),ci=e=>{const t=mt(ve(e));return di.has(t)?di.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},$s=(e,t,s)=>{var p,b,x,v,y;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,n=[],l=[],o=(k,w,A,_)=>{w[w.length-1].push(ye(k.slice(A,_),l))};let d;do d!==void 0&&(e=d),d=e.replace(Pr,(k,w,A)=>{if(w!==void 0||typeof A=="string")try{const{length:_}=s,f=(w!=null?w:A).split("|");return new ot(ye(f[0],l),f.slice(1).map(S=>{const $=S.indexOf("=");return($===-1?[S]:[S.slice(0,$),S.slice($+1)]).map(T=>ye(T,l))}),t,s),`\0${_}${ci(f[0])}`}catch(_){if(!(_ instanceof SyntaxError)||_.message!=="Invalid template name")throw _}return l.push(ye(k,l)),`\0${l.length-1}`});while(d!==e);e=d;const u=e.lastIndexOf("}}")-e.length;let a=u+e.length!==-1,h=hi(i+(a?ui:"")),g=h.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((b=(p=n[n.length-1])==null?void 0:p[0])!=null&&b.startsWith("="));){if(g!=null&&g[1]){const[,{length:R}]=g;g[0]=g[0].slice(R),g.index+=R}const{0:k,index:w}=g!=null?g:{0:`
|
|
8
|
-
`,index:e.length},A=(
|
|
9
|
-
`){c=
|
|
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 u=o.indexOf("|"),a=u===-1?o:o.slice(0,u),{valid:h,ns:g}=this.normalizeTitle(a,0,{halfParsed:!0,temporary:!0});if(h&&g===6){const c=new at("imagemap",a,u===-1?void 0:o.slice(u+1),t,s);super.insertAt(c),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const u=o.indexOf("["),a=o.slice(u),h=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(a);if(h){if(this.normalizeTitle(h[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Ki(o.slice(0,u),h.slice(1),a.slice(a.indexOf("]]")+2),t,s));continue}}else if(a.startsWith("[//")||r.has(a.slice(1,a.indexOf(":")+1))||r.has(a.slice(1,a.indexOf("//")+2))){const g=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(a);if(g){super.insertAt(new Ki(o.slice(0,u),g.slice(1),a.slice(a.indexOf("]")+1),t,s));continue}}}}super.insertAt(new ms(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=I,d=o.getSeverity(l,n?"link":"image");return d&&(n?s.push(...r.filter(u=>{const a=u.toString().trim();return u.is("noinclude")&&a&&!a.startsWith("#")}).map(u=>{const a=q(u,i,l,"invalid-imagemap-link",d);return o.computeEditInfo&&(a.suggestions=[z(a,-1),$e(a,"comment","# ")]),a})):s.push(G(this,i,l,"imagemap-without-image",d))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Jr,yi,Xr,dt,Lo=C({"src/nowiki/comment.ts"(){"use strict";M(),et(),He(),B(),it(),Jr=[ze(!1),Pe("<!--")],dt=class extends(Xr=Te){constructor(t,s,i,r){super(t,i,r);Fe(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=I,r=i.getSeverity(s);if(!r)return[];const n=G(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[We(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},yi=Y(Xr),dt=X(yi,0,"CommentToken",Jr,dt),J(yi,1,dt)}}),Fo={};se(Fo,{CommentedToken:()=>Eo});var Eo,gu=C({"src/commented.ts"(){"use strict";W(),Lo(),Eo=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),r=i!==-1&&e.indexOf("-->",i+4),n=0;for(;r!==!1&&r!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new dt(e.slice(i+4,r),!0,t,s)),n=r+3,i=e.indexOf("<!--",n),r=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Po={};se(Po,{NowikiToken:()=>Ro});var Kr,Yr,Ro,pu=C({"src/nowiki/index.ts"(){"use strict";var e,Yi,s;Ze(),M(),B(),it(),Kr=gt(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),Yr=new Set(["languages","section","templatestyles"]),Ro=(s=class extends Te{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,l="void-ext",{lintConfig:o}=I,d=o.getSeverity(l,n);if(d&&P(this,e,Yi).call(this)){const u=G(this,{start:r},l,I.msg("nothing-in",n),d);return o.computeEditInfo&&(u.suggestions=[z(u)]),[u]}return super.lint(r,Kr(n))}}getAttribute(r){return r==="invalid"?P(this,e,Yi).call(this):super.getAttribute(r)}},e=new WeakSet,Yi=function(){const{name:r,firstChild:{data:n}}=this;return Yr.has(r)&&!!n},s)}}),Zr,Si,el,ht,Oo=C({"src/tagPair/ext.ts"(){"use strict";M(),de(),B(),pn(),W(),cn(),fn(),Zr=[ks()],ht=class extends(el=Xe){get type(){return"ext"}constructor(e,t,s,i,r=I.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),d=new As(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),u=Le(fe({},r),{ext:r.ext.filter(h=>h!==o),excludes:[...r.excludes],inExt:!0});let a;switch(o){case"tab":u.ext=u.ext.filter(h=>h!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&u.excludes.push("heading"),a=new E(s,u,l);break;case"pre":{const{PreToken:h}=(eu(),Q(no));a=new h(s,u,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(ao(),Q(oo));a=new h(n,s,u,l);break}case"inputbox":{const{InputboxToken:h}=(ou(),Q(po));a=new h(n,s,u,l);break}case"references":{const{NestedToken:h}=(gi(),Q(hs));u.excludes.push("heading"),a=new h(s,n,["ref"],u,l);break}case"choose":{const{NestedToken:h}=(gi(),Q(hs));a=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,l);break}case"combobox":{const{NestedToken:h}=(gi(),Q(hs));a=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,l);break}case"gallery":{const{GalleryToken:h}=(uu(),Q(Ao));a=new h(s,u,l);break}case"imagemap":{const{ImagemapToken:h}=(cu(),Q(Io));a=new h(s,u,l);break}case"hiero":{const{CommentedToken:h}=(gu(),Q(Fo));a=new h(s,u,l);break}default:{const{NowikiToken:h}=(pu(),Q(Po));a=new h(s,u,l)}}a.setAttribute("name",o),a.type==="plain"&&(a.type="ext-inner"),super(e,d,a,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,r=new le(this,e);if(this.name!=="nowiki"){const o=this.inHtmlAttrs(),d="parsing-order",u=o&&i.getSeverity(d,o===2?"ext":"templateInTable");u&&s.push(G(this,r,d,"ext-in-html",u))}const n="var-anchor",l=i.getSeverity(n,"ref");return l&&this.name==="ref"&&this.closest("heading-title")&&s.push(G(this,r,n,"variable-anchor",l)),s}}},Si=Y(el),ht=X(Si,0,"ExtToken",Zr,ht),J(Si,1,ht)}}),Bo={};se(Bo,{parseCommentAndExt:()=>Vt});var ki,tl,ts,sl,Ai,Vt,Ts=C({"parser/commentAndExt.ts"(){"use strict";Ze(),ce(),Qa(),yt(),Xa(),Ka(),Oo(),Lo(),ki="<onlyinclude>",tl="</onlyinclude>",{length:ts}=ki,sl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return ql(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Ai=e=>{const t=e.indexOf(ki);return{i:t,j:e.indexOf(tl,t+ts)}},Vt=(e,t,s,i)=>{if(i){let{i:o,j:d}=Ai(e);if(o!==-1&&d!==-1){let u="";const a=h=>{new Se(h,t,s),u+=`\0${s.length-1}n`};for(;o!==-1&&d!==-1;){const h=`\0${s.length}e`;new Et(e.slice(o+ts,d),t,s),o>0&&a(e.slice(0,o)),u+=h,e=e.slice(d+ts+1),{i:o,j:d}=Ai(e)}return e&&a(e),u}}const{ext:r}=t,n=r.filter(o=>o!=="translate"&&o!=="tvar"),l=Le(fe({},t),{ext:n});if(r.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,d=>(o.push(d),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(d,u,a)=>{const h=s.length;return new Xl(u,a&&ye(a,o),l,s),`\0${h}g`}),e=ye(e,o)}return e.replace(sl[i?1:0](n),(o,d,u,a,h,g,c,p,b)=>{const x=s.length;let v="n";if(d)v="e",new ht(d,u,a,h,l,g,s);else if(o.startsWith("<!--")){v="c";const y=o.endsWith("-->");new dt(ye(o,s,1).slice(4,y?-3:void 0),y,t,s)}else g?new Pt(g,c&&ye(c,s,1),p&&ye(p,s,1),b,t,s):new Se(o,t,s,!0);return`\0${x}${v}`})}}}),il,nl,rl,ll,_i,ol,Bt,fu=C({"src/tag/html.ts"(){"use strict";var e,t;M(),de(),pn(),B(),Jl(),il=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),nl=new Set(["b","big","center","cite","code","del","dfn","em","font","i","ins","kbd","mark","pre","q","s","samp","small","strike","strong","sub","sup","tt","u","var"]),rl=new Set(["strike","big","center","font","tt"]),ll=[ks()],Bt=(t=class extends(ol=gn){constructor(i,r,n,l,o,d){super(i,r,n,o,d);N(this,e);this.setAttribute("name",i.toLowerCase()),L(this,e,l)}get type(){return"html"}get selfClosing(){return m(this,e)}text(){const{closing:i,selfClosing:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){var n;{const l=super.lint(i,r),{name:o,parentNode:d,closing:u,selfClosing:a}=this,h=new le(this,i),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,b=this.inTableAttrs();let x="h1",v=g.getSeverity(x,"html");if(v&&o==="h1"&&!u){const f=G(this,h,x,"<h1>",v);c&&(f.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),l.push(f)}if(x="parsing-order",v=b&&g.getSeverity(x,b===2?"html":"templateInTable"),v){const f=G(this,h,x,"html-in-table",v);c&&b===2&&(f.suggestions=[z(f)]),l.push(f)}if(x="obsolete-tag",v=g.getSeverity(x,o),v&&rl.has(o)&&l.push(G(this,h,x,"obsolete-tag",v)),x="bold-header",v=g.getSeverity(x,o),v&&(o==="b"||o==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const f=G(this,h,x,"bold-in-header",v);c&&(f.suggestions=[z(f)]),l.push(f)}const{html:[,y,k]}=this.getAttribute("config"),w=k.includes(o),A=y.includes(o),_=!w&&!A;if(x="unmatched-tag",u&&(a||w)||a&&_){if(v=g.getSeverity(x,u?"both":"selfClosing"),v){const f=G(this,h,x,u?"closing-and-self-closing":"invalid-self-closing",v);if(c||p){const S=ln(i),$={desc:I.msg("no-self-closing"),range:[f.endIndex-2,f.endIndex-1],text:""};A?c&&(f.suggestions=[S,$]):u?f.fix=w?S:$:c&&(f.suggestions=[$,We(f.endIndex,`></${o}>`,-2)])}l.push(f)}}else if(!this.findMatchingTag()){const f=G(this,h,x,u?"unmatched-closing":"unclosed-tag"),S=this.closest("magic-word");if(S&&il.has(S.name))v=g.getSeverity(x,"conditional");else if(u)v=g.getSeverity(x,"closing"),f.suggestions=[z(f)];else{v=g.getSeverity(x,"opening");const $=d==null?void 0:d.childNodes;nl.has(o)&&($!=null&&$.slice(0,$.indexOf(this)).some(T=>T.type==="html"&&T.name===o&&!T.findMatchingTag())&&(f.suggestions=[We(i+1,"/")]),this.closest("heading-title")&&(f.rule="format-leakage",v=g.getSeverity("format-leakage",o)))}v&&(f.severity=v,l.push(f))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){}},e=new WeakMap,t),_i=Y(ol),Bt=X(_i,0,"HtmlToken",ll,Bt),J(_i,1,Bt)}}),jo={};se(jo,{parseHtml:()=>qo});var al,qo,mu=C({"parser/html.ts"(){"use strict";fn(),fu(),al=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,qo=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const o of r){const d=al.exec(o),u=d==null?void 0:d[2],a=u==null?void 0:u.toLowerCase();if(!d||!t.htmlElements.has(a)){n+=`<${o}`;continue}const[,h,,g="",c,p]=d,{length:b}=s,x=new As(g,"html-attrs",a,t,s),v=x.hasAttr("itemprop");if(a==="meta"&&!(v&&x.hasAttr("content"))||a==="link"&&!(v&&x.hasAttr("href"))){n+=`<${o}`,s.length=b;continue}n+=`\0${s.length}x${p}`,new Bt(u,x,h==="/",c==="/>",t,s)}return n}}}),ul,$i,dl,ct,Wo=C({"src/table/base.ts"(){"use strict";pn(),W(),tt(),fn(),ul=[ks(1)],ct=class extends(dl=E){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new Ue(t,"table-syntax",r,n),new As(i,"table-attrs",s,r,n))}escape(){}},$i=Y(dl),ct=X($i,0,"TableBaseToken",ul,ct),J($i,1,ct)}}),hl,Ti,_e,ss,Ct,It,xs,Mo=C({"src/table/td.ts"(){"use strict";M(),de(),hn(),B(),W(),Wo(),xs=class extends(Ti=ct,hl=[ws(!1)],Ti){constructor(e,t,s,i=[]){var o;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(n)&&(r=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),J(ss,5,this),Oe(this,Ct),Oe(this,_e,""),r&&([ja(this,_e)._]=r);const l=new E(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+he(this,_e).length),s,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return zi(this,Ct,It).call(this).subtype}afterBuild(){he(this,_e).includes("\0")&&we(this,_e,this.buildFromStr(he(this,_e),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+he(this,_e)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+he(this,_e)+s.text()}getGaps(e){return e===1?he(this,_e).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=I,{computeEditInfo:l,fix:o}=n,d=["td","double"].map(u=>n.getSeverity(r,u));for(const u of this.lastChild.childNodes)if(u.type==="text"){const{data:a}=u;if(a.includes("|")){const h=a.includes("||"),g=d[h?1:0];if(g){const c=q(u,i,r,"pipe-in-table",g);if(l||o)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];c.fix=$e(c,"newline",a.replace(/\|\|/gu,`
|
|
14
|
-
${p}`))}else l&&(c.suggestions=[
|
|
15
|
-
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${
|
|
16
|
-
|}`,t){
|
|
6
|
+
`})}}}}),pa,cu=C({"src/paramLine.ts"(){"use strict";B(),pa=class extends E{get type(){return"param-line"}}}}),fa={};se(fa,{ParamTagToken:()=>Sn});var Sn,ma=C({"src/multiLine/paramTag.ts"(){"use strict";W(),ue(),Ns(),O(),wn(),cu(),Sn=class extends Cs{constructor(e,t,s=I.getConfig(),i=[],r){super(void 0,s,i,{}),t&&this.safeAppend(t.split(`
|
|
7
|
+
`).map(n=>r?n:Jt(n,s,i,e)).map(n=>new pa(n,s,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=I,i=s.getSeverity(t,this.name);if(!i)return[];const r=new le(this,e),n=I.msg("invalid-parameter",this.name),l=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const a=o.childNodes.filter(({type:u})=>u!=="comment"&&u!=="include"&&u!=="noinclude");if(a.some(({type:u})=>u==="ext"))l.push(j(o,r,t,n,i));else{const u=a.findIndex(({type:h})=>h!=="text"),d=a.slice(0,u===-1?void 0:u).map(String).join("");if(d&&!(u===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(d)){const h=j(o,r,t,n,i);s.computeEditInfo&&(h.suggestions=[U(h)]),l.push(h)}else{const h=o.lint(e,!1);h.length>0&&Array.prototype.push.apply(l,h)}}e+=o.toString().length+1}return l}}}}}),Nr,oi,Lr,at,xa=C({"src/heading.ts"(){"use strict";var e,t,hs,i;W(),Ie(),ue(),Re(),O(),B(),tt(),Nr=[Le],at=(i=class extends(Lr=E){constructor(n,l,o,a=[]){super(void 0,o,a);L(this,t);L(this,e);F(this,e,n);const u=new E(l[0],o,a);u.type="heading-title",u.setAttribute("stage",2);const d=new Ue(l[1],"heading-trail",o,a);this.append(u,d)}get type(){return"heading"}get level(){return f(this,e)}toString(n){const l=P(this,t,hs).call(this);return l+this.firstChild.toString(n)+l+this.lastChild.toString(n)}text(){const n=P(this,t,hs).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:a,level:u}=this,d=a.toString(),h=d.startsWith("="),g=h||d.endsWith("="),c=new le(this,n),p=this.inHtmlAttrs(),x=["h1","unbalanced-header","format-leakage"],{lintConfig:m}=I,{computeEditInfo:v,fix:w}=m,S=x.map(y=>m.getSeverity(y,"apostrophe"));if(S[0]&&this.level===1){const y=j(a,c,x[0],"<h1>",S[0]);v&&!g&&(y.suggestions=[Te(y,"h2",`=${d}=`)]),o.push(y)}if(S[1]&&g){const y=I.msg("unbalanced-in-section-header",'"="'),A=j(a,c,x[1],y,S[1]);if(!(!v||d==="="))if(h){const[k]=/^=+/u.exec(d),$=u+k.length;A.suggestions=[{desc:`h${u}`,range:[A.startIndex,A.startIndex+k.length],text:""}],$<7&&A.suggestions.push({desc:`h${$}`,range:[A.endIndex,A.endIndex],text:k})}else{const k=/[^=](=+)$/u.exec(d)[1],$=u+k.length;A.suggestions=[{desc:`h${u}`,range:[A.endIndex-k.length,A.endIndex],text:""}],$<7&&A.suggestions.push({desc:`h${$}`,range:[A.startIndex,A.startIndex],text:k})}o.push(A)}if(p){const y="parsing-order",A=m.getSeverity(y,p===2?"heading":"templateInTable");A&&o.push(M(this,c,y,"header-in-html",A))}if(S[2]){const y=this.getRootNode().toString(),A=a.childNodes.filter(Ls("quote")),k=A.filter(({bold:b})=>b),$=A.filter(({italic:b})=>b);if(k.length%2){const b=j(k[k.length-1],Ee(ge({},c),{start:n+u,left:c.left+u}),x[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),S[2]);if(v||w){const _=n+u+d.length,T=U(b);y.slice(b.endIndex,_).trim()?v&&(b.suggestions=[T,We(_,"'''")]):k.length===1&&$.length===0?b.fix=T:v&&(b.suggestions=[T])}o.push(b)}if($.length%2){const b=j($[$.length-1],{start:n+u},x[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),S[2]);if(v||w){const _=n+u+d.length;y.slice(b.endIndex,_).trim()?v&&(b.suggestions=[We(_,"''")]):$.length===1&&k.length===0?b.fix=U(b):v&&(b.suggestions=[U(b)])}o.push(b)}}return o}}print(){const n=P(this,t,hs).call(this);return super.print({pre:n,sep:n})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakSet,hs=function(){return"=".repeat(this.level)},i),oi=te(Lr),at=Z(oi,0,"HeadingToken",Nr,at),Y(oi,1,at)}}),Fr,va,gu=C({"src/parameter.ts"(){"use strict";he(),W(),O(),B(),Fr=new RegExp(`https?://${ft}${mt}$`,"iu"),va=class extends E{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new E(typeof e=="number"?void 0:e,s,i,{}),n=new E(t,s,i);r.type="parameter-key",r.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(r,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r="unescaped",{lintConfig:n}=I,l=n.getSeverity(r);if(l){const{firstChild:o}=this,a=(s=Fr.exec(o.text()))==null?void 0:s[0];try{if(a&&new URL(a).search){const u=j(o,{start:e},r,"unescaped-query",l);u.startIndex=u.endIndex,u.startLine=u.endLine,u.startCol=u.endCol,u.endIndex++,u.endCol++,(n.computeEditInfo||n.fix)&&(u.fix=bt(u.startIndex,"{{=}}")),i.push(u)}}catch(u){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){}}}}),Er,ui,Rr,ot,pu=C({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,cs,ba,a;he(),W(),Ie(),ue(),_s(),Re(),O(),B(),gu(),st(),tt(),Er=[Le,Qt()],ot=(a=class extends(Rr=E){constructor(d,h,g,c=[]){var T,N;let p;const x=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);x&&(p=Number(x[1]),d=d.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});L(this,n);Ne(this,"modifier","");L(this,e,"template");L(this,t,":");L(this,s,!1);L(this,i,new Map);L(this,r);const{parserFunction:[m,v],variable:w,functionHook:S}=g,y=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:T[0];if(y)this.setAttribute("modifier",y),d=d.slice(y.length);else if(d.includes(":")){const[R,...q]=d.split(":"),[J]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((N=q[0])!=null?N:"");this.setModifier(`${R}:${J}`)&&(d=q.join(":").slice(J.length))}const A=d.search(/[::]/u),k=d[A]===":",$=A!==-1;if($||h.length===0&&!f(this,s)){const R=$?d.slice(0,A):d,q=$&&d.slice(A+1),J=ve(R),z=$?J.slice(J.search(/\S/u))+(k?":":""):J.trim(),X=z.toLowerCase(),pe=Array.isArray(v),G=pe?v.includes(z):Object.prototype.hasOwnProperty.call(v,z),V=!pe&&G?v[z]:Object.prototype.hasOwnProperty.call(m,X)&&m[X],K=pe&&G||!("functionHook"in g)||S.includes(V),Fe=pe&&G||w.includes(V);if($?V&&K:Fe){this.setAttribute("name",V||X.replace(/^#|:$/u,"")),F(this,e,"magic-word"),k&&F(this,t,":");const H=new Ue(R,"magic-word-name",g,c);if(super.insertAt(H),q!==!1&&h.unshift([q]),this.name==="invoke")for(let ee=0;ee<2;ee++){const D=h.shift();if(!D)break;const ne=new xe(D.join("="),`invoke-${ee?"function":"module"}`,g,c);super.insertAt(ne)}}}if(this.type==="template"){const R=ve(d).trim();if(!this.normalizeTitle(R,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const q=new xe(d,"template-name",g,c,{});super.insertAt(q)}typeof p=="number"&&(c[p]=void 0);const b=this.isTemplate();let _=1;for(let R=0;R<h.length;R++){const q=h[R];b||this.name==="switch"&&R>0||this.name==="tag"&&R>1||(q[0]=q.join("="),q.length=1),q.length===1&&(q.unshift(_),_++),this.insertAt(new va(...q,g,c))}this.seal("modifier")}get type(){return f(this,e)}get module(){}get function(){}setModifier(d){const{parserFunction:[,,h,g]}=this.getAttribute("config"),c=ve(d).trim();if(d&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),x=h.includes(p),m=g.includes(p);return f(this,s)&&x||!f(this,s)&&(m||!d)||(ye.running||this.length>1)&&(x||m||!d)?(this.setAttribute("modifier",d),F(this,s,x),!!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"&&(F(this,r,P(this,n,cs).call(this)),this.setAttribute("name",f(this,r).title))}toString(d){const{childNodes:h,length:g,firstChild:c,modifier:p,type:x}=this;return`{{${p}${x==="magic-word"?c.toString(d)+(g===1?"":f(this,t))+h.slice(1).map(m=>m.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:h,firstChild:g,modifier:c,type:p,name:x}=this;return p==="magic-word"&&x==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(h===1?"":f(this,t))+Ye(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return f(this,r);case"colon":return f(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,n,cs).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),h){{const g=super.lint(d,h);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:x}=this,m=new le(this,d),{lintConfig:v}=I,{computeEditInfo:w}=v,S=c==="magic-word";let y="no-ignored",A=v.getSeverity(y,"fragment");if(S&&!P(this,n,cs).call(this).valid)y="invalid-invoke",A=v.getSeverity(y,"name"),A&&g.push(j(p[1],m,y,"illegal-module",A));else if(A){const k=p[S?1:0],$=k.childNodes.findIndex(_=>_.type==="text"&&xs(_.data).includes("#")),b=k.childNodes[$];if(b){const _=j(k,m,y,"useless-fragment",A);w&&(_.suggestions=[U(_,k.getRelativeIndex($)+b.data.indexOf("#"))]),g.push(_)}}if(y="invalid-invoke",A=v.getSeverity(y,"function"),A&&S&&x===2)return g.push(M(this,m,y,"missing-function",A)),g;if(y="no-duplicate",A=v.getSeverity(y,"parameter"),A){const k=this.getDuplicatedArgs().filter(([,b])=>!b[0].querySelector("ext")),$="duplicate-parameter";for(const[,b]of k)Array.prototype.push.apply(g,b.map(_=>{const T=j(_,m,y,$,A);return w&&(T.suggestions=[U(T,-1)]),T}))}return g}}insertAt(d,h=this.length){return super.insertAt(d,h),d.anon?P(this,n,ba).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(Ls("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,h,g=!0){const c=String(d).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return f(this,i).has(c)?p=f(this,i).get(c):(p=new Set(this.getAllArgs().filter(({name:x})=>c===x)),f(this,i).set(c,p)),p}getDuplicatedArgs(){return[...f(this,i)].filter(([,{size:d}])=>d>1).map(([d,h])=>[d,[...h]])}getPossibleValues(){const{type:d,name:h,childNodes:g}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(h){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const x=g.slice(2),m=x[x.length-1];p=[...x.filter(({anon:v})=>!v),...m!=null&&m.anon?[m]:[]].map(({lastChild:v})=>v);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:x})=>x));for(let x=0;x<p.length;){const{length:m,0:v}=p[x].childNodes.filter(w=>w.text().trim());if(m===0)p.splice(x,1);else if(m>1||v.type!=="magic-word")x++;else try{const w=v.getPossibleValues();Array.prototype.splice.apply(p,[x,1,...w]),x+=w.length}catch(w){x++}}return p}print(){const{childNodes:d,length:h,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Ht(c)+g.print()+(h===1?"":f(this,t))+vt(d.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Ht(c)}</span>`:"")+vt(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,cs=function(){const d=this.type==="template";return this.normalizeTitle((d?"":"Module:")+this.childNodes[d?0:1].text(),10,ge({temporary:!0},!d&&{page:""}))},ba=function(d){const h=this.getAnonArgs(),g=typeof d!="number";for(let c=g?h.indexOf(d):d-1;c<h.length;c++){const p=h[c],{name:x}=p,m=String(c+1);(x!==m||p===d)&&(p.setAttribute("name",m),this.getArgs(m,!1,!1).add(p))}},a),ui=te(Rr),ot=Z(ui,0,"TranscludeToken",Er,ot),Y(ui,1,ot)}}),Pr,di,Or,Ot,fu=C({"src/hidden.ts"(){"use strict";et(),B(),Pr=[ze()],Ot=class extends(Or=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},di=te(Or),Ot=Z(di,0,"HiddenToken",Pr,Ot),Y(di,1,Ot)}}),jr,hi,Br,jt,mu=C({"src/arg.ts"(){"use strict";var e,xu,s;he(),W(),ue(),He(),_s(),Re(),O(),B(),st(),fu(),jr=[Le,Pe("{{{"),Qt()],jt=(s=class extends(Br=E){constructor(r,n,l=[]){super(void 0,n,l,{});L(this,e);for(let o=0;o<r.length;o++){const a=r[o];if(o===0){const u=new xe(a,"arg-name",n,l,{});super.insertAt(u)}else if(o>1){const u=new Ot(a,n,l);super.insertAt(u)}else{const u=new E(a,n,l);u.type="arg-default",u.setAttribute("stage",2),super.insertAt(u)}}}get type(){return"arg"}get default(){}toString(r){return`{{{${super.toString(r,"|")}}}}`}text(){return`{{{${Ye(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(r=this.getAbsoluteIndex(),n){{const{childNodes:[l,o,...a]}=this;l.setAttribute("aIndex",r+3);const u=l.lint(r+3,n);if(o){const x=r+4+l.toString().length;o.setAttribute("aIndex",x);const m=o.lint(x,n);m.length>0&&Array.prototype.push.apply(u,m)}const d=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=new le(this,r),p=d.map(x=>h.getSeverity(x,"arg"));if(p[0]&&a.length>0&&Array.prototype.push.apply(u,a.map(x=>{const m=j(x,c,d[0],"invisible-triple-braces",p[0]);return m.startIndex--,m.startCol--,g&&(m.suggestions=[U(m),bt(m.startIndex,"{{!}}")]),m})),p[1]&&!this.getAttribute("include")){const x=M(this,c,d[1],"unexpected-argument",p[1]);g&&o&&(x.suggestions=[Te(x,"expand",o.text())]),u.push(x)}return u}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(r,n=this.getAbsoluteIndex()){}},e=new WeakSet,xu=function(){},s),hi=te(Br),jt=Z(hi,0,"ArgToken",jr,jt),Y(hi,1,jt)}}),ya={};se(ya,{parseBraces:()=>Is});var qr,ci,ss,gi,pi,fi,Wr,mi,Is,An=C({"parser/braces.ts"(){"use strict";Ze(),he(),xa(),pu(),mu(),qr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ci=String.raw`\[(?!\[)`,ss=String.raw`\n(?![=\0])`,gi=String.raw`|\{{2,}`,pi=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),fi=pt(e=>new RegExp(e,"gmu")),Wr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ci}|${ss})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ss})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ci}|${ss})*\}-`,"gu"),mi=e=>{const t=xt(ve(e));return pi.has(t)?pi.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Is=(e,t,s)=>{var p,x,m,v,w;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,n=[],l=[],o=(S,y,A,k)=>{y[y.length-1].push(Ae(S.slice(A,k),l))};let a;do a!==void 0&&(e=a),a=e.replace(Wr,(S,y,A)=>{if(y!==void 0||typeof A=="string")try{const{length:k}=s,$=(y!=null?y:A).split("|");return new ot(Ae($[0],l),$.slice(1).map(b=>{const _=b.indexOf("=");return(_===-1?[b]:[b.slice(0,_),b.slice(_+1)]).map(T=>Ae(T,l))}),t,s),`\0${k}${mi($[0])}`}catch(k){if(!(k instanceof SyntaxError)||k.message!=="Invalid template name")throw k}return l.push(Ae(S,l)),`\0${l.length-1}`});while(a!==e);e=a;const u=e.lastIndexOf("}}")-e.length;let d=u+e.length!==-1,h=fi(i+(d?gi:"")),g=h.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((x=(p=n[n.length-1])==null?void 0:p[0])!=null&&x.startsWith("="));){if(g!=null&&g[1]){const[,{length:q}]=g;g[0]=g[0].slice(q),g.index+=q}const{0:S,index:y}=g!=null?g:{0:`
|
|
8
|
+
`,index:e.length},A=(m=n.pop())!=null?m:{},{0:k,index:$,parts:b,findEqual:_,pos:T}=A,N=S==="="&&_;if(S==="]]"||S==="}-")c=y+2;else if(S===`
|
|
9
|
+
`){c=y+1;const{pos:q,findEqual:J}=(v=n[n.length-1])!=null?v:{};if(q===void 0||J||ve(e.slice(q,$))!==""){const z=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice($,y));z&&(z[2]=Ae(z[2],l),z[2].includes(`
|
|
10
|
+
`)||(e=`${e.slice(0,$)}\0${s.length}h${e.slice(y)}`,c=$+4+String(s.length).length,new at(z[1].length,z.slice(2),t,s)))}}else if(S==="|"||N)c=y+1,o(e,b,T,y),S==="|"&&b.push([]),A.pos=c,A.findEqual=S==="|",n.push(A);else if(S.startsWith("}}")){const q=S.slice(0,Math.min(k.length,3)),J=k.length-q.length,{length:z}=s;c=y+q.length,o(e,b,T,y);let X=!1,pe="t";if(q.length===3){const G=b.map(K=>K.join("=")),V=G.length>1&&ve(G[1]).trim();new jt(G,t,s),V&&V.endsWith(":")&&r.includes(V.slice(0,-1).toLowerCase())&&(pe="s")}else try{new ot(b[0][0],b.slice(1),t,s),pe=mi(b[0][0])}catch(G){if(G instanceof SyntaxError&&G.message==="Invalid template name")X=!0;else throw G}X||(e=`${e.slice(0,$+J)}\0${z}${pe}${e.slice(c)}`,c=$+J+3+String(z).length,J>1?n.push({0:k.slice(0,J),index:$,pos:$+J,parts:[[]]}):J===1&&e[$-1]==="-"&&n.push({0:"-{",index:$-1,pos:$+1,parts:[[]]}))}else c=y+S.length,S.startsWith("{")&&(g.pos=c,g.parts=[[]]),n.push(..."0"in A?[A]:[],g);let R=n[n.length-1];if(d&&u+e.length<c)for(d=!1;(w=R==null?void 0:R[0])!=null&&w.startsWith("{");)n.pop(),R=n[n.length-1];h=fi(i+(d?gi:"")+(R?`|${qr[R[0][0]]}${R.findEqual?"|=":""}`:"")),h.lastIndex=c,g=h.exec(e)}return Ae(e,l)}}}),wa={};se(wa,{InputboxToken:()=>Sa});var Sa,vu=C({"src/multiLine/inputbox.ts"(){"use strict";Ns(),An(),O(),ma(),Sa=class extends Sn{constructor(e,t,s=I.getConfig(),i=[]){const r=Symbol("InputboxToken"),n=s.excludes.includes("heading")?s:Ee(ge({},s),{excludes:[...s.excludes,"heading"]}),{length:l}=i;i.push(r),t&&(t=Jt(t,n,i,e)),t&&(t=Is(t,n,i)),i.splice(l,1),super(e,t,n,i,{})}}}}),gs={};se(gs,{NestedToken:()=>Aa});var Mr,zr,Aa,xi=C({"src/nested.ts"(){"use strict";var e,t,s;W(),ue(),Ns(),An(),O(),B(),Ua(),wt(),Mr=new Set(["comment","include","arg","template","magic-word"]),zr=[!1,!0].map(i=>{const r=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),Aa=(s=class extends E{constructor(r,n,l,o,a=[]){if(typeof n=="boolean"){const u=Symbol("NestedToken"),{length:d}=a;a.push(u),r&&(r=Jt(r,o,a,n)),r&&(r=Is(r,o,a)),a.splice(d,1)}else r&&(r=r.replace(n,(u,d,h,g,c)=>{const p=`\0${a.length+1}e`;return new ct(d,h,g,c,o,!1,a),p}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(u,d,h)=>(new ke(h,o,a),`${d}\0${a.length}n`)));super(r,o,a);L(this,e);L(this,t);F(this,e,[...l]),F(this,t,n)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="no-ignored",{lintConfig:a}=I,u=a.getSeverity(o,this.name);if(!u)return l;const d=new le(this,r),h=typeof f(this,t)=="boolean"?zr[f(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(g=>{const{type:c,name:p}=g;if(c==="ext")return!f(this,e).includes(p);if(Mr.has(c))return!1;const x=g.toString().trim();return x&&!h.test(x)}).map(g=>{const c=j(g,d,o,I.msg("invalid-content",this.name),u);return a.computeEditInfo&&(c.suggestions=[U(c),cn(c,g.toString())]),c})]}}},e=new WeakMap,t=new WeakMap,s)}});function Ur(e,t,s,i,r){t=ve(t).trim();let n=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!n&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{if(n){if(ka(s.protocol).test(n))return _a(s.protocol).test(n)&&t;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const l=I.normalizeTitle(n,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0,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 ka,_a,Hr,Dr,vs,Gr,$a,bu=C({"src/imageParameter.ts"(){"use strict";var e,t,Ta,r;Ze(),he(),W(),Me(),Ie(),O(),B(),ka=pt(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),_a=pt(n=>new RegExp(String.raw`^(?:(?:${n}|//)${ft}|\0\d+m\x7F)${mt}$`,"iu")),Hr=pt(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")),Dr=new Set(["alt","link","lang","page","caption"]),vs=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Gr=n=>{if(n)n.startsWith("//")&&(n=`https:${n}`);else return n;return new URL(n).href},$a=(r=class extends E{constructor(l,o,a,u){var n=(...i)=>(super(...i),L(this,t),L(this,e,""),this);let d;const h=Object.entries(a.img).map(([c,p])=>[c,p,Hr(c)]),g=h.find(([,c,p])=>(d=p.exec(l),d&&(d.length!==4||Ur(c,d[2],a,!0,o)!==!1)));if(g&&d){d.length===3?(n(void 0,a,u),F(this,e,l)):(n(d[2],a,u,{}),F(this,e,d[1]+g[0]+d[3])),this.setAttribute("name",g[1]),g[1]==="alt"&&this.setAttribute("stage",be-1);return}n(l,a.excludes.includes("list")?a:Ee(ge({},a),{excludes:[...a.excludes,"list"]}),u),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 ye.run(()=>{const o=new E(l,this.getAttribute("config"));return o.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(o.toString())?l:Ur("link",l,this.getAttribute("config"))})}}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!Dr.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return f(this,e)?f(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return f(this,e)?f(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,f(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){{const a=super.lint(l,o),{lintConfig:u}=I,{computeEditInfo:d,fix:h}=u,{link:g,name:c}=this,p=c==="width"&&this.getValue();if(c==="invalid"||p&&p.endsWith("px")){const x="invalid-gallery",m=u.getSeverity(x,"parameter");if(m){const v=M(this,{start:l},x,"invalid-image-parameter",m);(d||h)&&(v.fix=p?U(v,0,p):U(v,-1)),a.push(v)}}else if(c==="link"){if(typeof g=="string"){const x="invalid-url",m=u.getSeverity(x);if(m&&!this.querySelector("magic-word"))try{Gr(g)}catch(v){a.push(M(this,{start:l},x,"invalid-url",m))}}else if(g.encoded){const x="url-encoding",m=u.getSeverity(x,"file");if(m){const v=M(this,{start:l},x,"unnecessary-encoding",m);(d||h)&&(v.fix=dn(v,this)),a.push(v)}}}else if(c==="manualthumb"){const x="invalid-gallery",m=u.getSeverity(x,"thumb");if(m&&!this.querySelector("arg,magic-word,template")){const{valid:v,ns:w,extension:S}=this.thumb;(!v||w!==6||!vs.has(S))&&a.push(M(this,{start:l},x,"invalid-thumb",m))}}return a}}getValue(){return this.name==="invalid"?this.text():P(this,t,Ta).call(this)||super.text()}print(){return f(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${f(this,e).replace("$1",`<span class="wpb-image-caption">${vt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,Ta=function(){return f(this,e)&&!f(this,e).includes("$1")},r)}}),vi,Vr,Qr,bi,yi,Jr,wi,kn,Ca=C({"src/link/file.ts"(){"use strict";W(),ue(),O(),ks(),bu(),vi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Vr=new Set(["arg"]),Qr=new Set(["template","magic-word"]),bi=new Set(["left","right","center","none"]),yi=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Jr=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},wi=(e,t)=>e.filter(({childNodes:s})=>!s.some(i=>i.text().trim()&&t.has(i.type))),kn=class extends je{get type(){return"file"}get extension(){}constructor(e,t,s,i=[],r="|"){super(e,void 0,s,i,r);const{extension:n}=this.getTitle(!0,!0);this.safeAppend(Jr(t).map(l=>new $a(l,n,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r=wi(this.getAllArgs(),Vr),n=[...new Set(r.map(({name:k})=>k))],l=n.filter(k=>vi.has(k)),o=n.filter(k=>bi.has(k)),a=n.filter(k=>yi.has(k)),[u]=l,d=u==="framed"||u==="manualthumb",h=new le(this,e),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,{ns:x,extension:m}=this.getAttribute("title"),{firstChild:v}=this;let w="nested-link",S=g.getSeverity(w,"file");if(S&&vs.has(m)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const k=M(this,h,w,"link-in-extlink",S);if(c||p){const $=this.getArg("link");if($){const b=e+$.getRelativeIndex();k.fix={desc:I.msg("delink"),range:[b,b+$.toString().length],text:"link="}}else k.fix=Ss(k.endIndex-2,"delink","|link=")}i.push(k)}if(w="invalid-gallery",S=g.getSeverity(w,"extension"),S&&x===6&&!m&&!v.querySelector("arg,magic-word,template")&&i.push(M(this,h,w,"missing-extension",S)),S=g.getSeverity(w,"parameter"),S&&d)for(const k of r.filter(({name:$})=>$==="width")){const $=j(k,h,w,"invalid-image-parameter",S);(c||p)&&($.fix=U($,-1)),i.push($)}if(r.length===n.length&&l.length<2&&o.length<2&&a.length<2)return i;w="no-duplicate";const y=["unknownImageParameter","imageParameter"].map(k=>g.getSeverity(w,k)),A=(k,$,b,_=!0)=>k.map(T=>{if(S=y[Number(typeof _=="function"?_(T):_)],!S)return!1;const N=j(T,h,w,I.msg(`${$}-image-parameter`,b),S);return c&&(N.suggestions=[U(N,-1)]),N}).filter(T=>T!==!1);for(const k of n){if(k==="invalid"||k==="width"&&d)continue;const $=k==="caption";let b=r.filter(({name:_})=>_===k);if($&&(b=[...b.slice(0,-1).filter(_=>_.text()),...b.slice(-1)]),b.length>1){let _=!$||!m||vs.has(m);if($&&_){const T=wi(b,Qr);_=T.length>1&&(N=>T.includes(N))}Array.prototype.push.apply(i,A(b,"duplicate",k,_))}}return l.length>1&&Array.prototype.push.apply(i,A(r.filter(({name:k})=>vi.has(k)),"conflicting","frame")),o.length>1&&Array.prototype.push.apply(i,A(r.filter(({name:k})=>bi.has(k)),"conflicting","horizontal-alignment")),a.length>1&&Array.prototype.push.apply(i,A(r.filter(({name:k})=>yi.has(k)),"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()){}}}}),Xr,Si,Kr,ut,Ia=C({"src/link/galleryImage.ts"(){"use strict";var e,Zi,s;W(),Me(),He(),O(),B(),Ca(),Xr=[Pe("")],ut=(s=class extends(Kr=kn){constructor(r,n,l,o,a=[]){let u;if(l!==void 0){const{length:d}=a;u=new E(l,o,a);for(let h=0;h<be-1;h++)u.parseOnce();a.splice(d,1)}super(n,u==null?void 0:u.toString(),o,a);L(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:a}=I,u=a.getSeverity(o,"image");if(u&&P(this,e,Zi).call(this)){const d=M(this,{start:r},o,"invalid-gallery",u);a.computeEditInfo&&(d.suggestions=[Ss(r,"prefix","File:")]),l.push(d)}return l}}getAttribute(r){return r==="invalid"?P(this,e,Zi).call(this):super.getAttribute(r)}},e=new WeakSet,Zi=function(){const{ns:r}=this.getAttribute("title");return r!==6},s),Si=te(Kr),ut=Z(Si,0,"GalleryImageToken",Xr,ut),Y(Si,1,ut)}}),bs,Na=C({"src/nowiki/commentLine.ts"(){"use strict";wt(),bs=class extends ke{}}}),La={};se(La,{GalleryToken:()=>Fa});var Fa,yu=C({"src/multiLine/gallery.ts"(){"use strict";var e,Ea,wu,i;W(),O(),wn(),Ia(),Na(),Fa=(i=class extends Cs{constructor(n,l,o=[]){var a;super(void 0,l,o,{});L(this,e);for(const u of(a=n==null?void 0:n.split(`
|
|
12
|
+
`))!=null?a:[]){const d=/^([^|]+)(?:\|(.*))?/u.exec(u);if(!d){super.insertAt(u.trim()?new bs(u,l,o):u);continue}const[,h,g]=d;P(this,e,Ea).call(this,h)?super.insertAt(new ut("gallery",h,g,l,o)):super.insertAt(new bs(u,l,o))}}get widths(){}get heights(){}lint(n=this.getAbsoluteIndex(),l){{const{top:o,left:a}=this.getRootNode().posFromIndex(n),u=[],d="no-ignored",{lintConfig:h}=I,g=["Image","NoImage","Comment"].map(c=>h.getSeverity(d,`gallery${c}`));for(let c=0;c<this.length;c++){const p=this.childNodes[c],x=p.toString(),{length:m}=x,v=x.trim(),{type:w}=p,S=o+c,y=c?0:a;if(p.setAttribute("aIndex",n),w==="noinclude"&&v&&!/^<!--.*-->$/u.test(v)){let[A]=g;if(v.startsWith("|")?[,A]=g:(v.startsWith("<!--")||v.endsWith("-->"))&&([,,A]=g),A){const k=n+m,$={rule:d,message:I.msg("invalid-content","gallery"),severity:A,startIndex:n,endIndex:k,startLine:S,endLine:S,startCol:y,endCol:y+m};h.computeEditInfo&&($.suggestions=[U($),cn($,x)]),u.push($)}}else if(w!=="noinclude"&&w!=="text"){const A=p.lint(n,l);A.length>0&&Array.prototype.push.apply(u,A)}n+=m+1}return u}}json(n,l=this.getAbsoluteIndex()){}},e=new WeakSet,Ea=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},wu=function(n){},i)}}),_n,Ra=C({"src/link/index.ts"(){"use strict";Ze(),W(),O(),ks(),_n=class extends je{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():Dt(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",{lintConfig:r}=I,n=r.getSeverity(i);if(n&&this.closest("ext-link-text")){const l=M(this,{start:e},i,"link-in-extlink",n);(r.computeEditInfo||r.fix)&&(l.fix=Te(l,"delink",this.innerText)),s.push(l)}return s}}}}}),Yr,Zr,Vt,$n=C({"src/magicLink.ts"(){"use strict";var e,t,en,i;W(),he(),ue(),O(),B(),Yr=String.raw`(?:[${qe}\t]| |�*160;|&#[xX]0*[aA]0;)`,Zr=new RegExp(`${Yr}+`,"gu"),Vt=(i=class extends E{constructor(n,l="free-ext-link",o=I.getConfig(),a){super(n,o,a,{});L(this,t);L(this,e);F(this,e,l)}get type(){return f(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let l=Ye(this.childNodes.map(o=>{const{type:a}=o,u=String(o.name);return a==="magic-word"&&n.has(u)?n.get(u):o}));return this.type==="magic-link"&&(l=l.replace(Zr," ")),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:Dl(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),a=new le(this,n),{lintConfig:u}=I,{type:d,childNodes:h}=this;if(d==="magic-link"){const x="invalid-isbn",m=u.getSeverity(x);return m&&P(this,t,en).call(this)&&o.push(M(this,a,x,"invalid-isbn",m)),o}let g="invalid-url",c=u.getSeverity(g);if(c&&!this.querySelector("magic-word"))try{this.getUrl()}catch(x){o.push(M(this,a,g,"invalid-url",c))}const p=d==="ext-link-url";if(g="unterminated-url",c=u.getSeverity(g,p?"pipe":"punctuation"),c){const x=p?/\|/u:/[,;。:!?()]+/u,m=h.find(v=>v.type==="text"&&x.test(v.data));if(m){const{data:v}=m,w=j(m,a,g,I.msg("in-url",p?'"|"':"full-width-punctuation"),c);if(u.computeEditInfo){const{index:S,0:y}=x.exec(v),A=w.startIndex+S;w.suggestions=p?[Gt(A,1)]:[Gt(A),{desc:I.msg("encode"),range:[A,A+y.length],text:encodeURI(y)}]}o.push(w)}}return o}}getUrl(n){this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?P(this,t,en).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,en=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,a,u)=>o+a*(10-u),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,a,u)=>o+a*(u%2?3:1),0)%10!==0)}}return!1},i)}}),el,Ai,tl,dt,Pa=C({"src/extLink.ts"(){"use strict";var e,t;Me(),W(),He(),O(),B(),$n(),el=[Pe("[")],dt=(t=class extends(tl=E){constructor(i,r="",n="",l,o=[]){super(void 0,l,o,{});L(this,e);const a=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new Vt(i,"ext-link-url",l,o);if(this.insertAt(a),F(this,e,r),n){const u=new E(n,l,o,{});u.type="ext-link-text",u.setAttribute("stage",be-1),this.insertAt(u)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${f(this,e)}]`:`[${super.toString(i,f(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return f(this,e).length}lint(i=this.getAbsoluteIndex(),r){{const n=super.lint(i,r),l="var-anchor",o=I.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.closest("heading-title")&&n.push(M(this,{start:i},l,"variable-anchor",o)),n}}print(){return super.print(this.length===1?{pre:"[",post:`${f(this,e)}]`}:{pre:"[",sep:f(this,e),post:"]"})}},e=new WeakMap,t),Ai=te(tl),dt=Z(Ai,0,"ExtLinkToken",el,dt),Y(Ai,1,dt)}}),tn,Su=C({"src/imagemapLink.ts"(){"use strict";B(),wt(),Ra(),Pa(),tn=class extends E{get type(){return"imagemap-link"}constructor(e,t,s,i,r=[]){super(void 0,i,r),this.append(e,t.length===2?new _n(...t,i,r):new dt(...t,i,r),new ke(s,i,r))}}}}),Oa={};se(Oa,{ImagemapToken:()=>ja});var ja,Au=C({"src/multiLine/imagemap.ts"(){"use strict";W(),Ie(),ue(),O(),wn(),Na(),Ia(),Su(),ja=class extends Cs{get image(){return this.childNodes.find(Ls("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
|
|
13
|
+
`),r=new Set(t.protocol.split("|"));let n=!0,l=!1;for(const o of i){const a=o.trim();if(!(l||!a||a.startsWith("#"))){if(n){const u=o.indexOf("|"),d=u===-1?o:o.slice(0,u),{valid:h,ns:g}=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0,page:""});if(h&&g===6){const c=new ut("imagemap",d,u===-1?void 0:o.slice(u+1),t,s);super.insertAt(c),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const u=o.indexOf("["),d=o.slice(u),h=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(d);if(h){if(this.normalizeTitle(h[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new tn(o.slice(0,u),h.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 g=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(d);if(g){super.insertAt(new tn(o.slice(0,u),g.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 le(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=I,a=o.getSeverity(l,n?"link":"image");return a&&(n?Array.prototype.push.apply(s,r.filter(u=>{const d=u.toString().trim();return u.is("noinclude")&&d&&!d.startsWith("#")}).map(u=>{const d=j(u,i,l,"invalid-imagemap-link",a);return o.computeEditInfo&&(d.suggestions=[U(d,-1),Te(d,"comment","# ")]),d})):s.push(M(this,i,l,"imagemap-without-image",a))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),sl,ki,il,ht,Ba=C({"src/nowiki/comment.ts"(){"use strict";W(),et(),He(),O(),it(),sl=[ze(!1),Pe("<!--")],ht=class extends(il=Ce){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}=I,r=i.getSeverity(s);if(!r)return[];const n=M(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[We(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},ki=te(il),ht=Z(ki,0,"CommentToken",sl,ht),Y(ki,1,ht)}}),qa={};se(qa,{CommentedToken:()=>Wa});var Wa,ku=C({"src/commented.ts"(){"use strict";B(),Ba(),Wa=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),r=i!==-1&&e.indexOf("-->",i+4),n=0;for(;r!==!1&&r!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new ht(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"))}}}}),Ma={};se(Ma,{NowikiToken:()=>za});var nl,rl,za,_u=C({"src/nowiki/index.ts"(){"use strict";var e,sn,s;Ze(),W(),O(),it(),nl=pt(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),rl=new Set(["languages","section","templatestyles"]),za=(s=class extends Ce{constructor(){super(...arguments);L(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,{lintConfig:l}=I;let o="void-ext",a=l.getSeverity(o,n);if(a&&P(this,e,sn).call(this)){const d=M(this,{start:r},o,I.msg("nothing-in",n),a);return l.computeEditInfo&&(d.suggestions=[U(d)]),[d]}return super.lint(r,nl(n))}}getAttribute(r){return r==="invalid"?P(this,e,sn).call(this):super.getAttribute(r)}},e=new WeakSet,sn=function(){const{name:r,firstChild:{data:n}}=this;return rl.has(r)&&!!n},s)}}),ll,_i,al,ct,Ua=C({"src/tagPair/ext.ts"(){"use strict";W(),ue(),O(),bn(),B(),xn(),yn(),ll=[$s()],ct=class extends(al=Je){get type(){return"ext"}constructor(e,t,s,i,r=I.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),a=new Ts(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),u=Ee(ge({},r),{ext:r.ext.filter(h=>h!==o),excludes:[...r.excludes],inExt:!0});let d;switch(o){case"tab":u.ext=u.ext.filter(h=>h!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&u.excludes.push("heading"),d=new E(s,u,l);break;case"pre":{const{PreToken:h}=(hu(),Q(ca));d=new h(s,u,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(ma(),Q(fa));d=new h(n,s,u,l);break}case"inputbox":{const{InputboxToken:h}=(vu(),Q(wa));d=new h(n,s,u,l);break}case"references":{const{NestedToken:h}=(xi(),Q(gs));u.excludes.push("heading"),d=new h(s,n,["ref"],u,l);break}case"choose":{const{NestedToken:h}=(xi(),Q(gs));d=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,l);break}case"combobox":{const{NestedToken:h}=(xi(),Q(gs));d=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,l);break}case"gallery":{const{GalleryToken:h}=(yu(),Q(La));d=new h(s,u,l);break}case"imagemap":{const{ImagemapToken:h}=(Au(),Q(Oa));d=new h(s,u,l);break}case"hiero":{const{CommentedToken:h}=(ku(),Q(qa));d=new h(s,u,l);break}default:{const{NowikiToken:h}=(_u(),Q(Ma));d=new h(s,u,l)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,a,d,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,r=new le(this,e);if(this.name!=="nowiki"){const n=this.inHtmlAttrs(),l="parsing-order",o=n&&i.getSeverity(l,n===2?"ext":"templateInTable");o&&s.push(M(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(M(this,r,n,"variable-anchor",l)),n="nested-link",l=i.getSeverity(n,"ref"),l&&this.closest("link,ext-link-text")&&s.push(M(this,r,n,"ref-in-link",l))}return s}}},_i=te(al),ct=Z(_i,0,"ExtToken",ll,ct),Y(_i,1,ct)}}),Ha={};se(Ha,{parseCommentAndExt:()=>Jt});var $i,ol,is,ul,Ti,Jt,Ns=C({"parser/commentAndExt.ts"(){"use strict";Ze(),he(),ru(),wt(),au(),ou(),Ua(),Ba(),$i="<onlyinclude>",ol="</onlyinclude>",{length:is}=$i,ul=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return pt(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Ti=e=>{const t=e.indexOf($i);return{i:t,j:e.indexOf(ol,t+is)}},Jt=(e,t,s,i)=>{if(i){let{i:a,j:u}=Ti(e);if(a!==-1&&u!==-1){let d="";const h=g=>{new ke(g,t,s),d+=`\0${s.length-1}n`};for(;a!==-1&&u!==-1;){const g=`\0${s.length}e`;new Rt(e.slice(a+is,u),t,s),a>0&&h(e.slice(0,a)),d+=g,e=e.slice(u+is+1),{i:a,j:u}=Ti(e)}return e&&h(e),d}}const{ext:r}=t;let n=r,l=t;if(r.includes("translate")){n=r.filter(u=>u!=="translate"&&u!=="tvar"),l=Ee(ge({},t),{ext:n});const a=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,u=>(a.push(u),`\0${a.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(u,d,h)=>{const g=s.length;return new na(d,h&&Ae(h,a),l,s),`\0${g}g`}),e=Ae(e,a)}const o=ul[i?1:0](n.join("|"));return o.lastIndex=0,o.test(e)?e.replace(o,(a,u,d,h,g,c,p,x,m)=>{const v=s.length;let w="n";if(u)w="e",new ct(u,d,h,g,l,c,s);else if(a.startsWith("<!--")){w="c";const S=a.endsWith("-->");new ht(Ae(a,s,1).slice(4,S?-3:void 0),S,t,s)}else c?new Pt(c,p&&Ae(p,s,1),x&&Ae(x,s,1),m,t,s):new ke(a,t,s,!0);return`\0${v}${w}`}):e}}}),dl,hl,cl,gl,Ci,pl,Bt,$u=C({"src/tag/html.ts"(){"use strict";var e,t;W(),ue(),bn(),O(),ia(),dl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),hl=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"]),cl=new Set(["strike","big","center","font","tt"]),gl=[$s()],Bt=(t=class extends(pl=vn){constructor(i,r,n,l,o,a){super(i,r,n,o,a);L(this,e);this.setAttribute("name",i.toLowerCase()),F(this,e,l)}get type(){return"html"}get selfClosing(){return f(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:a,closing:u,selfClosing:d}=this,h=new le(this,i),{lintConfig:g}=I,{computeEditInfo:c,fix:p}=g,x=this.inTableAttrs();let m="h1",v=g.getSeverity(m,"html");if(v&&o==="h1"&&!u){const $=M(this,h,m,"<h1>",v);c&&($.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),l.push($)}if(m="parsing-order",v=x&&g.getSeverity(m,x===2?"html":"templateInTable"),v){const $=M(this,h,m,"html-in-table",v);c&&x===2&&($.suggestions=[U($)]),l.push($)}if(m="obsolete-tag",v=g.getSeverity(m,o),v&&cl.has(o)&&l.push(M(this,h,m,"obsolete-tag",v)),m="bold-header",v=g.getSeverity(m,o),v&&(o==="b"||o==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const $=M(this,h,m,"bold-in-header",v);c&&($.suggestions=[U($)]),l.push($)}const{html:[,w,S]}=this.getAttribute("config"),y=S.includes(o),A=w.includes(o),k=!y&&!A;if(m="unmatched-tag",u&&(d||y)||d&&k){if(v=g.getSeverity(m,u?"both":"selfClosing"),v){const $=M(this,h,m,u?"closing-and-self-closing":"invalid-self-closing",v);if(c||p){const b=hn(i),_={desc:I.msg("no-self-closing"),range:[$.endIndex-2,$.endIndex-1],text:""};A?c&&($.suggestions=[b,_]):u?$.fix=y?b:_:c&&($.suggestions=[_,We($.endIndex,`></${o}>`,-2)])}l.push($)}}else if(!this.findMatchingTag()){const $=M(this,h,m,u?"unmatched-closing":"unclosed-tag"),b=this.closest("magic-word");if(b&&dl.has(b.name))v=g.getSeverity(m,"conditional");else if(u)v=g.getSeverity(m,"closing"),$.suggestions=[U($)];else{v=g.getSeverity(m,"opening");const _=a==null?void 0:a.childNodes;hl.has(o)&&(_!=null&&_.slice(0,_.indexOf(this)).some(T=>T.type==="html"&&T.name===o&&!T.findMatchingTag())&&($.suggestions=[We(i+1,"/")]),this.closest("heading-title")&&($.rule="format-leakage",v=g.getSeverity("format-leakage",o)))}v&&($.severity=v,l.push($))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){}},e=new WeakMap,t),Ci=te(pl),Bt=Z(Ci,0,"HtmlToken",gl,Bt),Y(Ci,1,Bt)}}),Da={};se(Da,{parseHtml:()=>Ga});var fl,Ga,Tu=C({"parser/html.ts"(){"use strict";yn(),$u(),fl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Ga=(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 a=fl.exec(o),u=a==null?void 0:a[2],d=u==null?void 0:u.toLowerCase();if(!a||!t.htmlElements.has(d)){n+=`<${o}`;continue}const[,h,,g="",c,p]=a,{length:x}=s,m=new Ts(g,"html-attrs",d,t,s),v=m.hasAttr("itemprop");if(d==="meta"&&!(v&&m.hasAttr("content"))||d==="link"&&!(v&&m.hasAttr("href"))){n+=`<${o}`,s.length=x;continue}n+=`\0${s.length}x${p}`,new Bt(u,m,h==="/",c==="/>",t,s)}return n}}}),ml,Ii,xl,gt,Va=C({"src/table/base.ts"(){"use strict";bn(),B(),tt(),yn(),ml=[$s(1)],gt=class extends(xl=E){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new Ue(t,"table-syntax",r,n),new Ts(i,"table-attrs",s,r,n))}escape(){}},Ii=te(xl),gt=Z(Ii,0,"TableBaseToken",ml,gt),Y(Ii,1,gt)}}),vl,Ni,$e,ns,It,Nt,ys,Qa=C({"src/table/td.ts"(){"use strict";W(),ue(),mn(),O(),B(),Va(),ys=class extends(Ni=gt,vl=[As(!1)],Ni){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),Y(ns,5,this),Oe(this,It),Oe(this,$e,""),r&&([Vo(this,$e)._]=r);const l=new E(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+de(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 Gi(this,It,Nt).call(this).subtype}afterBuild(){de(this,$e).includes("\0")&&Se(this,$e,this.buildFromStr(de(this,$e),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+de(this,$e)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+de(this,$e)+s.text()}getGaps(e){return e===1?de(this,$e).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=I,{computeEditInfo:l,fix:o}=n,a=["td","double"].map(u=>n.getSeverity(r,u));for(const u of this.lastChild.childNodes)if(u.type==="text"){const{data:d}=u;if(d.includes("|")){const h=d.includes("||"),g=a[h?1:0];if(g){const c=j(u,i,r,"pipe-in-table",g);if(l||o)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];c.fix=Te(c,"newline",d.replace(/\|\|/gu,`
|
|
14
|
+
${p}`))}else l&&(c.suggestions=[pn(c.startIndex,d)]);s.push(c)}}}return s}}isIndependent(){return this.firstChild.text().startsWith(`
|
|
15
|
+
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${de(this,$e)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){}},ns=te(Ni),$e=new WeakMap,It=new WeakSet,Nt=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 ge({},Gi(e=r,It,Nt).call(e))},Nt=Z(ns,17,"#getSyntax",vl,It,Nt),on(ns,ys)}}),Tn,Ja=C({"src/table/trBase.ts"(){"use strict";W(),O(),Va(),Qa(),Tn=class extends gt{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=Ut(i),n="fostered-content",l=r&&I.lintConfig.getSeverity(n,r===2?void 0:"transclusion");if(l){const o=j(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 ys&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),bl,yl,wl,Sl,Li,rs,ps,Cu=C({"src/table/index.ts"(){"use strict";W(),Ie(),ue(),mn(),O(),Ja(),tt(),bl=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),yl=({type:e})=>e==="tr"||e==="table-syntax",wl=class extends Array{},ps=class extends(Li=Tn,Sl=[As(!1)],Li){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),Y(rs,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),r=["unclosed-table","table-layout"],n=r.map(l=>I.lintConfig.getSeverity(l));if(n[0]&&!this.closed&&s.push(j(this.firstChild,i,r[0],"unclosed-table",n[0])),n[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let a=1,u=1/0,d=0;for(;d<o;d++){const h=l[d],g=h.length;if(g<a)break;g<u&&(u=g);const c=h.indexOf(h[g-1])+1;if(c>u)break;c>a&&(a=c)}if(d<o){const h=this.getNthRow(d),g=j(h,i,r[1],"inconsistent-table",n[1]);g.startIndex++,g.startLine++,g.startCol=0,s.push(g)}}}return s}}close(e=`
|
|
16
|
+
|}`,t){ye.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=wl.from(bl(s,()=>[]));for(let r=0;r<i.length;r++){const n=i[r];let l=0,o=0,a;for(const u of t[r].childNodes.slice(2))if(u.is("td")){if(u.isIndependent()&&(a=u.subtype!=="caption"),a){const d={row:r,column:l},{rowspan:h,colspan:g}=u;for(l++;n[o];)o++;for(let c=r;c<Math.min(r+h,s);c++)for(let p=o;p<o+g;p++)i[c][p]=d;o+=g}}else if(yl(u))break}return i}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){{const i=super.getRowCount();if(e===0&&i)return this;i&&e--;for(const r of this.childNodes.slice(2)){const{type:n}=r;if(n==="tr"&&r.getRowCount()&&(e--,e<0))return r}return}}json(e,t=this.getAbsoluteIndex()){}},rs=te(Li),Z(rs,1,"getLayout",Sl,ps),on(rs,ps)}}),Xa,Iu=C({"src/table/tr.ts"(){"use strict";Ja(),Xa=class extends Tn{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),Cn,Ka=C({"src/nowiki/listBase.ts"(){"use strict";it(),Cn=class extends Ce{get indent(){}json(e,t=this.getAbsoluteIndex()){}}}}),In,Ya=C({"src/nowiki/dd.ts"(){"use strict";Ka(),In=class extends Cn{get type(){return"dd"}}}}),Za={};se(Za,{parseTable:()=>eo});var Al,Fi,eo,Nu=C({"parser/table.ts"(){"use strict";B(),Cu(),Iu(),Qa(),Ya(),Al=e=>e.lastChild.constructor!==E,Fi=(e,t)=>e.is("td")?t.pop():e,eo=({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
|
-
${h}${
|
|
20
|
-
${
|
|
21
|
-
${
|
|
22
|
-
${h}${
|
|
23
|
-
${h}${
|
|
24
|
-
${h}${v}`;const
|
|
25
|
-
`)&&(x=ve(g).trim());const{ns:y,valid:k}=I.normalizeTitle(x,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(k){if(u){if(y!==6){l+=`[[${p}`;continue}let A=!1;for(d++;d<n.length;d++){const _=n[d],f=_.split("]]");if(f.length>2){A=!0,g+=`[[${f[0]}]]${f[1]}`,c=f.slice(2).join("]]");break}else if(f.length===2)g+=`[[${f[0]}]]${f[1]}`;else{g+=`[[${_}`;break}}if(g=Zi(g,t,s,i),!A){l+=`[[${a}${h}${g}`;continue}}}else{l+=`[[${p}`;continue}g&&(g=_n(g,t,s,i));let w=wn;v||(y===6?(g&&(g=$n(g,t,s,!0)),w=bn):y===14&&(w=sa)),g===void 0&&h&&(g=""),l+=`\0${s.length}l${c}`,new w(a,g,t,s,h)}return l}}}),na={};se(na,{parseMagicLinks:()=>ra});var Li,Fi,Ei,Pi,ra,$u=C({"parser/magicLinks.ts"(){"use strict";ce(),yn(),Li=String.raw`[${qe}\t]| |�*160;|�*a0;`,Fi=`(?:${Li})+`,Ei=`(?:${Li}|-)`,Pi=String.raw`(?:RFC|PMID)${Fi}\d+\b|ISBN${Fi}(?:97[89]${Ei}?)?(?:\d${Ei}?){9}[\dx]\b`,ra=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${pt}${ft})|${Pi})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${pt}${ft})|${Pi})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){let o="";const d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);d&&(o=l.slice(d.index),l=l.slice(0,d.index));const u=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,a=u.exec(l);if(a){let h=1;a[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,a.index))&&(h=2),o=l.slice(a.index+h)+o,l=l.slice(0,a.index+h)}return o.length>=n.length?i:(new Dt(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Dt(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),la,Tu=C({"util/html.ts"(){"use strict";la=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),oa,Cu=C({"src/nowiki/list.ts"(){"use strict";Ho(),oa=class extends kn{get type(){return"list"}}}}),aa={};se(aa,{parseList:()=>ua});var ua,Iu=C({"parser/list.ts"(){"use strict";Tu(),Cu(),Do(),ua=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,d]=r,u=o.replace(/;/gu,":"),a=la(u,t.lastPrefix),h=((a>1?o.slice(a-1):o)+d).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(a>1){const T=o.slice(0,a-1);if(g){const F=T.split(/(?=;)/u);h.unshift(...F),c+=T.includes(";")?F.length:0}else h[0]=T+h[0]}t.lastPrefix=u;let p=l+h.map((T,F)=>`\0${i.length+F}d`).join("")+e.slice(n.length);for(const T of h)new oa(T,s,i);if(!c)return p;const{html:[b,,x]}=s,v=/:+|-\{|\0\d+[xq]\x7F/gu;let y=v,k=y.exec(p),w=0,A=!1,_=!1,f=0;const S=(T,F)=>(new An(T,s,i),`${p.slice(0,F)}\0${i.length-1}d${p.slice(F+T.length)}`),$=T=>{T?w&&w--:w++};for(;k&&c;){const{0:T,index:F}=k;if(T==="-{"){if(!f){const{lastIndex:j}=y;y=/-\{|\}-/gu,y.lastIndex=j}f++}else if(T==="}-"){if(f--,!f){const{lastIndex:j}=y;y=v,y.lastIndex=j}}else if(T.endsWith("x")){const{name:j,closing:R,selfClosing:ne}=i[Number(T.slice(1,-2))];(b.includes(j)||!ne&&!x.includes(j))&&$(R)}else if(T.endsWith("q")){const{bold:j,italic:R}=i[Number(T.slice(1,-2))];j&&($(A),A=!A),R&&($(_),_=!_)}else if(w===0){if(T.length>=c)return S(T.slice(0,c),F);c-=T.length,y.lastIndex=F+4+String(i.length).length,p=S(T,F)}k=y.exec(p)}return p}}}),ns,wl,Ri,yl,qt,Nu=C({"src/converterFlags.ts"(){"use strict";var e,t;M(),de(),Ss(),B(),W(),st(),ns=new Set(["A","T","R","D","-","H","N"]),wl=[Gt()],qt=(t=class extends(yl=E){constructor(i,r,n=[]){super(void 0,r,n,{});N(this,e);this.safeAppend(i.map(l=>new xe(l,"converter-flag",r,n)))}get type(){return"converter-flags"}afterBuild(){L(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(m(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(m(this,e).filter(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return typeof i=="object"&&(i=i.text().trim(),r=this.getVariantFlags(),n=this.getUnknownFlags(),l=new Set(m(this,e).filter(o=>ns.has(o)))),!!i&&!r.has(i)&&!n.has(i)&&(r.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),r){{const n=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(m(this,e).filter(x=>ns.has(x))),d=m(this,e).filter(x=>!x).length,u=m(this,e).length-l.size-d,{lintConfig:a}=I,{computeEditInfo:h,fix:g}=a,c=super.lint(i,r);if(n.size===u||o.size===u)return c;const p="no-ignored",b=a.getSeverity(p,"conversionFlag");if(b){const x=new le(this,i);for(let v=0;v<this.length;v++){const y=this.childNodes[v],k=y.text().trim();if(this.isInvalidFlag(k,n,l,o)){const w=q(y,x,p,"invalid-conversion-flag",b);(h||g)&&(n.size===0&&ns.has(k.toUpperCase())?w.fix=an(w,k):h&&(w.suggestions=[z(w,v&&-1)])),c.push(w)}}}return c}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Ri=Y(yl),qt=X(Ri,0,"ConverterFlagsToken",wl,qt),J(Ri,1,qt)}}),gs,Lu=C({"src/converterRule.ts"(){"use strict";B(),W(),st(),gs=class extends E{get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i);const r=e.indexOf(":"),n=e.slice(0,r).indexOf("=>"),l=n===-1?e.slice(0,r):e.slice(n+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new xe(l,"converter-rule-variant",s,i)),super.insertAt(new xe(e.slice(r+1),"converter-rule-to",s,i)),n!==-1&&super.insertAt(new xe(e.slice(0,n),"converter-rule-from",s,i),0)):super.insertAt(new xe(e,"converter-rule-to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,i]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${i.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){}}}}),Sl,Oi,kl,Wt,Fu=C({"src/converter.ts"(){"use strict";ce(),He(),Ee(),W(),Nu(),Lu(),Sl=[Ie,Pe("-{")],Wt=class extends(kl=E){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new qt(e,s,i));const[r]=t,n=r.includes(":"),l=new gs(r,n,s,i);n&&l.length===1||!n&&t.length===2&&!ve(t[1]).trim()?this.insertAt(new gs(t.join(";"),!1,s,i)):this.append(l,...t.slice(1).map(o=>new gs(o,!0,s,i)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${Ye(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){const{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${xt(t,{sep:";"})}}-</span>`}},Oi=Y(kl),Wt=X(Oi,0,"ConverterToken",Sl,Wt),J(Oi,1,Wt)}}),da={};se(da,{parseConverter:()=>ha});var ha,Eu=C({"parser/converter.ts"(){"use strict";Fu(),ha=(e,t,s)=>{var d;(d=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:u,index:a}=o;if(u==="}-"){const h=n.pop(),{length:g}=s,c=e.slice(h.index+2,a),p=c.indexOf("|"),[b,x]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],v=x.replace(/(&[#a-z\d]+);/giu,"$1"),y=v.split(t.regexConverter).map(k=>k.replace(/\x01/gu,";"));new Wt(b,y,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(a+2)}`,n.length===0&&(l=i),l.lastIndex=h.index+3+String(g).length}else n.push(o),l=r,l.lastIndex=a+2;o=l.exec(e)}return e}}}),vs={};se(vs,{Token:()=>E});var Al,E,W=C({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,ca,ga,pa,fa,ma,xa,va,ba,wa,ya,Sa,ka,w;ce(),Me(),M(),Ne(),B(),Ua(),Ha(),Al=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(w=class extends Lt{constructor(f,S=I.getConfig(),$=[],T){super();N(this,o);N(this,e,"plain");N(this,t,0);N(this,s);N(this,i);N(this,r);N(this,n,!1);N(this,l);typeof f=="string"&&this.insertAt(f),L(this,s,S),L(this,i,$),$.push(this)}get type(){return m(this,e)}set type(f){L(this,e,f)}parseOnce(f=m(this,t),S=!1,$){if(f<m(this,t)||this.length===0||!this.isPlain())return this;if(m(this,t)>=be)return this;switch(f){case 0:if(this.type==="root"){m(this,i).pop();const T=P(this,o,ca).call(this);S&&(S=!T)}L(this,r,S),P(this,o,ga).call(this,S);break;case 1:P(this,o,pa).call(this);break;case 2:P(this,o,fa).call(this);break;case 3:P(this,o,ma).call(this);break;case 4:P(this,o,xa).call(this);break;case 5:P(this,o,va).call(this,$);break;case 6:P(this,o,ba).call(this,$);break;case 7:P(this,o,wa).call(this);break;case 8:P(this,o,ya).call(this);break;case 9:P(this,o,Sa).call(this);break;case 10:P(this,o,ka).call(this)}if(this.type==="root")for(const T of m(this,i))T==null||T.parseOnce(f,S,$);return Bn(this,t)._++,this}buildFromStr(f,S){const $=f.split(/[\0\x7F]/u).map((T,F)=>{if(F%2===0)return new Vi(T);if(isNaN(T.slice(-1)))return m(this,i)[Number(T.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${T}`)});return S===0?$.map(String).join(""):S===1?Ye($):$}build(){L(this,t,be);const{length:f,firstChild:S}=this,$=S==null?void 0:S.toString();if(f===1&&S.type==="text"&&$.includes("\0")&&(Tn(this,0,1,this.buildFromStr($)),this.normalize(),this.type==="root"))for(const T of m(this,i))T==null||T.build()}afterBuild(){if(this.type==="root")for(const f of m(this,i))f==null||f.afterBuild();L(this,n,!0)}parse(f=be,S,$){for(f=Math.min(f,be);m(this,t)<f;)this.parseOnce(m(this,t),S,$);return f&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===w}getAttribute(f){var S;switch(f){case"config":return m(this,s);case"include":return(S=m(this,r))!=null?S:!!m(this.getRootNode(),r);case"accum":return m(this,i);case"built":return m(this,n);case"stage":return m(this,t);case"invalid":return this.type==="table-inter"&&Mt(this)===2;default:return super.getAttribute(f)}}setAttribute(f,S){switch(f){case"stage":m(this,t)===0&&this.type==="root"&&m(this,i).shift(),L(this,t,S);break;default:super.setAttribute(f,S)}}insertAt(f,S=this.length){const $=typeof f=="string"?new Vi(f):f;super.insertAt($,S);const{type:T}=$;return T==="root"&&($.type="plain"),$}normalizeTitle(f,S=0,$){return I.normalizeTitle(f,S,m(this,r),m(this,s),$)}inTableAttrs(){var f,S;return((f=this.closest("table-attrs,ext"))==null?void 0:f.type)==="table-attrs"&&((S=this.closest("table-attrs,arg,magic-word,template"))!=null&&S.is("table-attrs")?2:1)}inHtmlAttrs(){var f;return(f=this.closest("html-attrs,ext"))!=null&&f.is("html-attrs")?2:this.inTableAttrs()}lint(f=this.getAbsoluteIndex(),S){var $;{const{lintConfig:T}=I,{computeEditInfo:F,fix:j,ignoreDisables:R,configurationComment:ne}=T;let O=super.lint(f,S);if(this.type==="root"){const re=new Map,pe="no-duplicate",V=["category","id"].map(U=>T.getSeverity(pe,U)),D=this.toString(),K=Al.filter((U,Z)=>V[Z]).join();if(K){for(const U of this.querySelectorAll(K)){let Z;if(U.is("category"))Z=U.name;else{const H=U.getValue();H&&H!==!0&&(Z=`#${H}`)}if(Z){const H=re.get(Z);H?H.add(U):re.set(Z,new Set([U]))}}for(const[U,Z]of re)if(Z.size>1&&!U.startsWith("#mw-customcollapsible-")){const H=!U.startsWith("#"),ee=`duplicate-${H?"category":"id"}`,oe=V[H?0:1];O.push(...[...Z].map(ae=>{const te=G(ae,{start:ae.getAbsoluteIndex()},pe,ee,oe);return F&&H&&(te.suggestions=[z(te)]),te}))}}if(!R){const U=new RegExp(String.raw`<!--\s*${ne}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Z=[];let H=U.exec(D);for(;H;){const{1:ee,index:oe}=H,ae=($=H[2])==null?void 0:$.trim();Z.push({line:this.posFromIndex(oe).top+(ee==="disable-line"?0:1),from:ee==="disable"?U.lastIndex:void 0,to:ee==="enable"?U.lastIndex:void 0,rules:ae?new Set(ae.split(",").map(te=>te.trim())):void 0}),H=U.exec(D)}O=O.filter(({rule:ee,startLine:oe,startIndex:ae})=>{const te={pos:0};for(const{line:De,from:ue,to:me,rules:Ce}of Z){if(De>oe+1)break;if(Ce&&!Ce.has(ee))continue;if(De===oe&&ue===void 0&&me===void 0)return!1;ue<=ae&&ue>te.pos?(te.pos=ue,te.type="from"):me<=ae&&me>te.pos&&(te.pos=me,te.type="to")}return te.type!=="from"})}if(j&&O.some(({fix:U})=>U)){const U=O.map(({fix:ee})=>ee).filter(Boolean).sort(({range:[ee,oe]},{range:[ae,te]})=>oe===te?ae-ee:te-oe);let Z=1/0,H=D;for(const{range:[ee,oe],text:ae}of U)oe<=Z&&(H=H.slice(0,ee)+ae+H.slice(oe),Z=ee);Object.assign(O,{output:H})}if(!F)for(const U of O)delete U.fix,delete U.suggestions}return O}}toString(f,S){return f?super.toString(!0,S):Ke(m(this,l),()=>super.toString(!1,S),$=>{const T=this.getRootNode();T.type==="root"&&m(T,n)&&L(this,l,$)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakSet,ca=function(){const{parseRedirect:f}=(Va(),Q(Vl)),S=this.firstChild.toString(),$=f(S,m(this,s),m(this,i));return $&&this.setText($),!!$},ga=function(f){const{parseCommentAndExt:S}=(Ts(),Q(Bo));this.setText(S(this.firstChild.toString(),m(this,s),m(this,i),f))},pa=function(){const{parseBraces:f}=(vn(),Q(go)),S=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,$=f(S,m(this,s),m(this,i));this.setText(this.type==="root"?$:$.slice(1))},fa=function(){if(m(this,s).excludes.includes("html"))return;const{parseHtml:f}=(mu(),Q(jo));this.setText(f(this.firstChild.toString(),m(this,s),m(this,i)))},ma=function(){if(m(this,s).excludes.includes("table"))return;const{parseTable:f}=(bu(),Q(Go));this.setText(f(this,m(this,s),m(this,i)))},xa=function(){if(m(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:f}=(Su(),Q(Jo));this.setText(f(this,m(this,s),m(this,i)))},va=function(f){const{parseLinks:S}=(_u(),Q(ia));this.setText(S(this.firstChild.toString(),m(this,s),m(this,i),f))},ba=function(f){if(m(this,s).excludes.includes("quote"))return;const{parseQuotes:S}=(Zo(),Q(Yo)),$=this.firstChild.toString().split(`
|
|
26
|
-
`);for(let
|
|
27
|
-
`))},
|
|
28
|
-
`),
|
|
29
|
-
`))},
|
|
18
|
+
${l.shift()}`,a;const u=(d,h)=>{if(!h){o+=d;return}const{lastChild:g}=h;if(Al(h)){const c=new E(d,i,r);c.type="table-inter",c.setAttribute("stage",3),h.insertAt(c)}else g.setText(g.toString()+d)};for(const d of l){a=n.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(d),g=d.slice(h.length),c=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(g);if(c){for(;a&&!a.is("td");)a=n.pop();const[,S,y,A,k]=c;S&&new In(S,i,r),u(`
|
|
19
|
+
${h}${S&&`\0${r.length-1}d`}${y}\0${r.length}b`,a),n.push(...a?[a]:[],new ps(A,k,i,r));continue}else if(!a){o+=`
|
|
20
|
+
${d}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(g);if(!p){u(`
|
|
21
|
+
${d}`,a),n.push(a);continue}const[,x,m,v,w]=p;if(x){for(;!a.is("table");)a=n.pop();a.close(`
|
|
22
|
+
${h}${x}`,!0),u(w,n[n.length-1])}else if(m){a=Fi(a,n),a.is("tr")&&(a=n.pop());const S=new Xa(`
|
|
23
|
+
${h}${m}`,w,i,r);n.push(a,S),a.insertAt(S)}else{a=Fi(a,n);const S=v==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let y=S.exec(w),A=0,k=`
|
|
24
|
+
${h}${v}`;const $=b=>{const _=new ys(k,w.slice(A,y==null?void 0:y.index),i,r);return b.insertAt(_),_};for(;y;)$(a),{lastIndex:A}=S,[k]=y,y=S.exec(w);n.push(a,$(a))}}return o.slice(1)}}}),qt,Lu=C({"../cm-util/dist/index.mjs"(){"use strict";qt=e=>!/^_{2}.+_{2}$/u.test(e)}}),to,Fu=C({"src/nowiki/hr.ts"(){"use strict";it(),to=class extends Ce{get type(){return"hr"}}}}),kl,Ei,_l,Wt,Eu=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;et(),He(),it(),kl=[ze(),Pe("__")],Wt=(t=class extends(_l=Ce){constructor(i,r,n,l,o){var h,g;super(i,l,o);L(this,e);const a=i.toLowerCase(),{doubleUnderscore:[,,u,d]}=l;this.setAttribute("name",(g=r?(h=d==null?void 0:d[i])==null?void 0:h.toLowerCase():u==null?void 0:u[a])!=null?g:a),F(this,e,n)}get type(){return"double-underscore"}toString(){const i=f(this,e)?"__":"__";return i+this.innerText+i}print(){const i=f(this,e)?"__":"__";return super.print({pre:i,post:i})}},e=new WeakMap,t),Ei=te(_l),Wt=Z(Ei,0,"DoubleUnderscoreToken",kl,Wt),Y(Ei,1,Wt)}}),so={};se(so,{parseHrAndDoubleUnderscore:()=>io});var io,Ru=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Lu(),Fu(),Eu(),xa(),io=({firstChild:{data:e},type:t,name:s},i,r)=>{var u,d,h;const{doubleUnderscore:[n,l,o]}=i,a=[...n,...l];return(u=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(n.filter(qt))),(d=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l.filter(qt))),(h=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${a.filter(qt).join("|")})__|_{2}(${a.filter(g=>!qt(g)).map(g=>g.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,(g,c,p)=>(new to(p,i,r),`${c}\0${r.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(g,c,p)=>{var S;const x=c!=null?c:p,m=i.sensitiveDoubleUnderscore.has(x),v=x.toLowerCase(),w=i.insensitiveDoubleUnderscore.has(v);return m||w?(new Wt(x,m,!!p,i,r),`\0${r.length-1}${w&&((S=o==null?void 0:o[v])!=null?S:v)==="toc"?"u":"n"}`):g}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(g,c,p,x,m)=>{const v=`${c}\0${r.length}h`;return new at(p.length,[x,m],i,r),v})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),no,Pu=C({"src/nowiki/quote.ts"(){"use strict";var e,t;W(),ue(),O(),it(),no=(t=class extends Ce{constructor(i,r,n,l){super(i,n,l);L(this,e);F(this,e,r)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return ge(ge({},this.bold?{bold:f(this,e).bold}:void 0),this.italic?{italic:f(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,a=(n==null?void 0:n.type)==="text"?n.data:void 0,u=[],d=new le(this,i),h=["lonely-apos","bold-header"],{lintConfig:g}=I,{computeEditInfo:c}=g,p=[void 0,"word"].map(m=>g.getSeverity(h[0],m)),x=g.getSeverity(h[1]);if(a!=null&&a.endsWith("'")){const m=p[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(a)?1:0];if(m){const v=M(this,d,h[0],I.msg("lonely","'"),m),{startLine:w,startCol:S}=v,[,{length:y}]=/(?:^|[^'])('+)$/u.exec(a),A=i-y,k=Ee(ge({},v),{startIndex:A,endIndex:i,endLine:w,startCol:S-y,endCol:S});c&&(k.suggestions=[bt(A,"'",y),U(k)]),u.push(k)}}if(x&&l&&((r=this.closest("heading-title,ext"))==null?void 0:r.type)==="heading-title"){const m=M(this,d,h[1],"bold-in-header",x);c&&(m.suggestions=[U(m)]),u.push(m)}return u}}json(i,r=this.getAbsoluteIndex()){}},e=new WeakMap,t)}}),ro={};se(ro,{parseQuotes:()=>Nn});var Nn,lo=C({"parser/quotes.ts"(){"use strict";Pu(),Nn=(e,t,s,i)=>{var c;const r=e.split(/('{2,})/u),{length:n}=r;if(n===1)return e;let l=0,o=0,a,u,d;for(let p=1;p<n;p+=2){const x=r[p].length;switch(x){case 2:o++;break;case 4:r[p-1]+="'",r[p]="'''";case 3:if(l++,a!==void 0)break;r[p-1].endsWith(" ")?u===void 0&&d===void 0&&(d=p):r[p-1].slice(-2,-1)===" "?a=p:u!=null||(u=p);break;default:r[p-1]+="'".repeat(x-5),r[p]="'''''",o++,l++}}if(o%2===1&&l%2===1){const p=(c=a!=null?a:u)!=null?c:d;p!==void 0&&(r[p]="''",r[p-1]+="'")}let h=!0,g=!0;for(let p=1;p<n;p+=2){const x=r[p].length,m=x!==2,v=x!==3;m&&(h=!h),v&&(g=!g),new no(r[p],{bold:m&&h,italic:v&&g},t,s),r[p]=`\0${s.length-1}q`}return r.join("")}}}),ao={};se(ao,{parseExternalLinks:()=>Ln});var Ln,oo=C({"parser/externalLinks.ts"(){"use strict";he(),Pa(),$n(),Ln=(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}|//)${ft}|\0\d+m\x7F)${mt}(?=[[\]<>"\t${qe}]|\0\d)))([${qe}]*(?![${qe}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,l,o,a)=>{const{length:u}=s,d=/&[lg]t;/u.exec(l);return d&&(o="",a=l.slice(d.index)+o+a,l=l.slice(0,d.index)),i?(new Vt(l,"ext-link-url",t,s),`[\0${u}f${o}${a}]`):(new dt(l,o,a,t,s),`\0${u}w`)})}}}),uo,Ou=C({"src/link/category.ts"(){"use strict";ks(),uo=class extends je{get type(){return"category"}get sortkey(){}json(e,t=this.getAbsoluteIndex()){}}}}),ho={};se(ho,{parseLinks:()=>nn});var $l,nn,ju=C({"parser/links.ts"(){"use strict";he(),O(),lo(),oo(),Ra(),Ca(),Ou(),$l=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,nn=(e,t,s,i,r)=>{var a;(a=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 u=0;u<l.length;u++){let d=!1,h,g,c,p;const x=l[u],m=n.exec(x);if(m)[,h,g,c,p]=m,p.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",p=p.slice(1));else{const k=$l.exec(x);k&&(d=!0,[,h,g,c]=k)}if(h===void 0||t.regexLinks.test(h)||/\0\d+[exhbru]\x7F/u.test(h)){o+=`[[${x}`;continue}let v=ve(h).trim();const w=v.startsWith(":");if(w&&d){o+=`[[${x}`;continue}else!v&&c&&!c.includes(`
|
|
25
|
+
`)&&(v=ve(c).trim());const{ns:S,valid:y}=I.normalizeTitle(v,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:i});if(y){if(d){if(S!==6){o+=`[[${x}`;continue}let k=!1;for(u++;u<l.length;u++){const $=l[u],b=$.split("]]");if(b.length>2){k=!0,c+=`[[${b[0]}]]${b[1]}`,p=b.slice(2).join("]]");break}else if(b.length===2)c+=`[[${b[0]}]]${b[1]}`;else{c+=`[[${$}`;break}}if(c=nn(c,t,s,i,r),!k){o+=`[[${h}${g}${c}`;continue}}}else{o+=`[[${x}`;continue}c&&(c=Nn(c,t,s,r));let A=_n;w||(S===6?(c&&(c=Ln(c,t,s,!0)),A=kn):S===14&&(A=uo)),c===void 0&&g&&(c=""),o+=`\0${s.length}l${p}`,new A(h,c,t,s,g)}return o}}}),co={};se(co,{parseMagicLinks:()=>go});var Ri,Pi,Oi,ji,go,Bu=C({"parser/magicLinks.ts"(){"use strict";he(),$n(),Ri=String.raw`[${qe}\t]| |�*160;|�*a0;`,Pi=`(?:${Ri})+`,Oi=`(?:${Ri}|-)`,ji=String.raw`(?:RFC|PMID)${Pi}\d+\b|ISBN${Pi}(?:97[89]${Oi}?)?(?:\d${Oi}?){9}[\dx]\b`,go=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${ft}${mt})|${ji})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${ft}${mt})|${ji})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){let o="";const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);a&&(o=l.slice(a.index),l=l.slice(0,a.index));const u=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=u.exec(l);if(d){let h=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,d.index))&&(h=2),o=l.slice(d.index+h)+o,l=l.slice(0,d.index+h)}return o.length>=n.length?i:(new Vt(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Vt(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),po,qu=C({"util/html.ts"(){"use strict";po=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),fo,Wu=C({"src/nowiki/list.ts"(){"use strict";Ka(),fo=class extends Cn{get type(){return"list"}}}}),mo={};se(mo,{parseList:()=>xo});var xo,Mu=C({"parser/list.ts"(){"use strict";qu(),Wu(),Ya(),xo=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,a]=r,u=o.replace(/;/gu,":"),d=po(u,t.lastPrefix),h=((d>1?o.slice(d-1):o)+a).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(d>1){const T=o.slice(0,d-1);if(g){const N=T.split(/(?=;)/u);h.unshift(...N),c+=T.includes(";")?N.length:0}else h[0]=T+h[0]}t.lastPrefix=u;let p=l+h.map((T,N)=>`\0${i.length+N}d`).join("")+e.slice(n.length);for(const T of h)new fo(T,s,i);if(!c)return p;const{html:[x,,m]}=s,v=/:+|-\{|\0\d+[xq]\x7F/gu;let w=v,S=w.exec(p),y=0,A=!1,k=!1,$=0;const b=(T,N)=>(new In(T,s,i),`${p.slice(0,N)}\0${i.length-1}d${p.slice(N+T.length)}`),_=T=>{T?y&&y--:y++};for(;S&&c;){const{0:T,index:N}=S;if(T==="-{"){if(!$){const{lastIndex:R}=w;w=/-\{|\}-/gu,w.lastIndex=R}$++}else if(T==="}-"){if($--,!$){const{lastIndex:R}=w;w=v,w.lastIndex=R}}else if(T.endsWith("x")){const{name:R,closing:q,selfClosing:J}=i[Number(T.slice(1,-2))];(x.includes(R)||!J&&!m.includes(R))&&_(q)}else if(T.endsWith("q")){const{bold:R,italic:q}=i[Number(T.slice(1,-2))];R&&(_(A),A=!A),q&&(_(k),k=!k)}else if(y===0){if(T.length>=c)return b(T.slice(0,c),N);c-=T.length,w.lastIndex=N+4+String(i.length).length,p=b(T,N)}S=w.exec(p)}return p}}}),ls,Tl,Bi,Cl,Mt,zu=C({"src/converterFlags.ts"(){"use strict";var e,t;W(),ue(),_s(),O(),B(),st(),ls=new Set(["A","T","R","D","-","H","N"]),Tl=[Qt()],Mt=(t=class extends(Cl=E){constructor(i,r,n=[]){super(void 0,r,n,{});L(this,e);this.safeAppend(i.map(l=>new xe(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(f(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(f(this,e).filter(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(f(this,e).filter(o=>ls.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(f(this,e).filter(m=>ls.has(m))),a=f(this,e).filter(m=>!m).length,u=f(this,e).length-l.size-a,{lintConfig:d}=I,{computeEditInfo:h,fix:g}=d,c=super.lint(i,r);if(n.size===u||o.size===u)return c;const p="no-ignored",x=d.getSeverity(p,"conversionFlag");if(x){const m=new le(this,i);for(let v=0;v<this.length;v++){const w=this.childNodes[v],S=w.text().trim();if(this.isInvalidFlag(S,n,l,o)){const y=j(w,m,p,"invalid-conversion-flag",x);(h||g)&&(n.size===0&&ls.has(S.toUpperCase())?y.fix=gn(y,S):h&&(y.suggestions=[U(y,v&&-1)])),c.push(y)}}}return c}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Bi=te(Cl),Mt=Z(Bi,0,"ConverterFlagsToken",Tl,Mt),Y(Bi,1,Mt)}}),fs,Uu=C({"src/converterRule.ts"(){"use strict";O(),B(),st(),fs=class extends E{get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i);const r=e.indexOf(":"),n=e.slice(0,r).indexOf("=>"),l=n===-1?e.slice(0,r):e.slice(n+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new xe(l,"converter-rule-variant",s,i)),super.insertAt(new xe(e.slice(r+1),"converter-rule-to",s,i)),n!==-1&&super.insertAt(new xe(e.slice(0,n),"converter-rule-from",s,i),0)):super.insertAt(new xe(e,"converter-rule-to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,i]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${i.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){}}}}),Il,qi,Nl,zt,Hu=C({"src/converter.ts"(){"use strict";he(),He(),Re(),B(),zu(),Uu(),Il=[Le,Pe("-{")],zt=class extends(Nl=E){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Mt(e,s,i));const[r]=t,n=r.includes(":"),l=new fs(r,n,s,i);n&&l.length===1||!n&&t.length===2&&!ve(t[1]).trim()?this.insertAt(new fs(t.join(";"),!1,s,i)):this.safeAppend([l,...t.slice(1).map(o=>new fs(o,!0,s,i))])}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${Ye(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){const{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${vt(t,{sep:";"})}}-</span>`}},qi=te(Nl),zt=Z(qi,0,"ConverterToken",Il,zt),Y(qi,1,zt)}}),vo={};se(vo,{parseConverter:()=>bo});var bo,Du=C({"parser/converter.ts"(){"use strict";Hu(),bo=(e,t,s)=>{var a;(a=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:u,index:d}=o;if(u==="}-"){const h=n.pop(),{length:g}=s,c=e.slice(h.index+2,d),p=c.indexOf("|"),[x,m]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],v=m.replace(/(&[#a-z\d]+);/giu,"$1"),w=v.split(t.regexConverter).map(S=>S.replace(/\x01/gu,";"));new zt(x,w,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(d+2)}`,n.length===0&&(l=i),l.lastIndex=h.index+3+String(g).length}else n.push(o),l=r,l.lastIndex=d+2;o=l.exec(e)}return e}}}),ws={};se(ws,{Token:()=>E});var Ll,E,B=C({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,a,yo,wo,So,Ao,ko,_o,$o,To,Co,Io,No,Lo,A;he(),Me(),W(),Ie(),O(),eu(),tu(),Ll=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(A=class extends Ft{constructor(b,_=I.getConfig(),T=[],N){super();L(this,a);L(this,e,"plain");L(this,t,0);L(this,s);L(this,i);L(this,r);L(this,n,!1);L(this,l);L(this,o);typeof b=="string"&&this.insertAt(b),F(this,s,_),F(this,i,T),T.push(this)}get type(){return f(this,e)}set type(b){F(this,e,b)}get pageName(){return f(this.getRootNode(),o)}set pageName(b){if(b){const _=this.normalizeTitle(b,0,{temporary:!0,page:""});F(this,o,_.valid?_.title:void 0)}else F(this,o,b===""?"":void 0)}parseOnce(b=f(this,t),_=!1,T){if(b<f(this,t)||this.length===0||!this.isPlain())return this;if(f(this,t)>=be)return this;switch(b){case 0:if(this.type==="root"){f(this,i).pop();const N=P(this,a,yo).call(this);_&&(_=!N)}F(this,r,_),P(this,a,wo).call(this,_);break;case 1:P(this,a,So).call(this);break;case 2:P(this,a,Ao).call(this);break;case 3:P(this,a,ko).call(this);break;case 4:P(this,a,_o).call(this);break;case 5:P(this,a,$o).call(this,T);break;case 6:P(this,a,To).call(this,T);break;case 7:P(this,a,Co).call(this);break;case 8:P(this,a,Io).call(this);break;case 9:P(this,a,No).call(this);break;case 10:P(this,a,Lo).call(this)}if(this.type==="root")for(const N of f(this,i))N==null||N.parseOnce(b,_,T);return zn(this,t)._++,this}buildFromStr(b,_){const T=b.split(/[\0\x7F]/u).map((N,R)=>{if(R%2===0)return new Ki(N);if(isNaN(N.slice(-1)))return f(this,i)[Number(N.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${N}`)});return _===0?T.map(String).join(""):_===1?Ye(T):T}build(){F(this,t,be);const{length:b,firstChild:_}=this,T=_==null?void 0:_.toString();if(b===1&&_.type==="text"&&T.includes("\0")&&(Fn(this,0,1,this.buildFromStr(T)),this.normalize(),this.type==="root"))for(const N of f(this,i))N==null||N.build()}afterBuild(){if(this.type==="root")for(const b of f(this,i))b==null||b.afterBuild();F(this,n,!0)}parse(b=be,_,T){for(b=Math.min(b,be);f(this,t)<b;)this.parseOnce(f(this,t),_,T);return b&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===A}getAttribute(b){var _;switch(b){case"config":return f(this,s);case"include":return(_=f(this,r))!=null?_:!!f(this.getRootNode(),r);case"accum":return f(this,i);case"built":return f(this,n);case"stage":return f(this,t);case"invalid":return this.type==="table-inter"&&Ut(this)===2;default:return super.getAttribute(b)}}setAttribute(b,_){switch(b){case"stage":f(this,t)===0&&this.type==="root"&&f(this,i).shift(),F(this,t,_);break;default:super.setAttribute(b,_)}}insertAt(b,_=this.length){const T=typeof b=="string"?new Ki(b):b;super.insertAt(T,_);const{type:N}=T;return N==="root"&&(T.type="plain"),T}normalizeTitle(b,_=0,T){return I.normalizeTitle(b,_,this.getAttribute("include"),f(this,s),ge({page:this.pageName},T))}inTableAttrs(){var b,_;return((b=this.closest("table-attrs,ext"))==null?void 0:b.type)==="table-attrs"&&((_=this.closest("table-attrs,arg,magic-word,template"))!=null&&_.is("table-attrs")?2:1)}inHtmlAttrs(){var b;return(b=this.closest("html-attrs,ext"))!=null&&b.is("html-attrs")?2:this.inTableAttrs()}lint(b=this.getAbsoluteIndex(),_){var T;{const{lintConfig:N}=I,{computeEditInfo:R,fix:q,ignoreDisables:J,configurationComment:z}=N;let X=super.lint(b,_);if(this.type==="root"){const pe=new Map,G="no-duplicate",V=["category","id"].map(H=>N.getSeverity(G,H)),K=this.toString(),Fe=Ll.filter((H,ee)=>V[ee]).join();if(Fe){for(const H of this.querySelectorAll(Fe)){let ee;if(H.is("category"))ee=H.name;else{const D=H.getValue();D&&D!==!0&&(ee=`#${D}`)}if(ee){const D=pe.get(ee);D?D.add(H):pe.set(ee,new Set([H]))}}for(const[H,ee]of pe)if(ee.size>1&&!H.startsWith("#mw-customcollapsible-")){const D=!H.startsWith("#"),ne=`duplicate-${D?"category":"id"}`,ae=V[D?0:1];X.push(...[...ee].map(oe=>{const re=M(oe,{start:oe.getAbsoluteIndex()},G,ne,ae);return R&&D&&(re.suggestions=[U(re)]),re}))}}if(!J){const H=new RegExp(String.raw`<!--\s*${z}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),ee=[];let D=H.exec(K);for(;D;){const{1:ne,index:ae}=D,oe=(T=D[2])==null?void 0:T.trim();ee.push({line:this.posFromIndex(ae).top+(ne==="disable-line"?0:1),from:ne==="disable"?H.lastIndex:void 0,to:ne==="enable"?H.lastIndex:void 0,rules:oe?new Set(oe.split(",").map(re=>re.trim())):void 0}),D=H.exec(K)}X=X.filter(({rule:ne,startLine:ae,startIndex:oe})=>{const re={pos:0};for(const{line:ce,from:me,to:we,rules:nt}of ee){if(ce>ae+1)break;if(nt&&!nt.has(ne))continue;if(ce===ae&&me===void 0&&we===void 0)return!1;me<=oe&&me>re.pos?(re.pos=me,re.type="from"):we<=oe&&we>re.pos&&(re.pos=we,re.type="to")}return re.type!=="from"})}if(q&&X.some(({fix:H})=>H)){const H=X.map(({fix:ne})=>ne).filter(Boolean).sort(({range:[ne,ae]},{range:[oe,re]})=>ae===re?oe-ne:re-ae);let ee=1/0,D=K;for(const{range:[ne,ae],text:oe}of H)ae<=ee&&(D=D.slice(0,ne)+oe+D.slice(ae),ee=ne);Object.assign(X,{output:D})}if(!R)for(const H of X)delete H.fix,delete H.suggestions}return X}}toString(b,_){return b?super.toString(!0,_):Xe(f(this,l),()=>super.toString(!1,_),T=>{const N=this.getRootNode();N.type==="root"&&f(N,n)&&F(this,l,T)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakMap,a=new WeakSet,yo=function(){const{parseRedirect:b}=(nu(),Q(ta)),_=this.firstChild.toString(),T=b(_,f(this,s),f(this,i));return T&&this.setText(T),!!T},wo=function(b){const{parseCommentAndExt:_}=(Ns(),Q(Ha));this.setText(_(this.firstChild.toString(),f(this,s),f(this,i),b))},So=function(){const{parseBraces:b}=(An(),Q(ya)),_=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,T=b(_,f(this,s),f(this,i));this.setText(this.type==="root"?T:T.slice(1))},Ao=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:b}=(Tu(),Q(Da));this.setText(b(this.firstChild.toString(),f(this,s),f(this,i)))},ko=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:b}=(Nu(),Q(Za));this.setText(b(this,f(this,s),f(this,i)))},_o=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:b}=(Ru(),Q(so));this.setText(b(this,f(this,s),f(this,i)))},$o=function(b){const{parseLinks:_}=(ju(),Q(ho));this.setText(_(this.firstChild.toString(),f(this,s),f(this,i),this.pageName,b))},To=function(b){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:_}=(lo(),Q(ro)),T=this.firstChild.toString().split(`
|
|
26
|
+
`);for(let N=0;N<T.length;N++)T[N]=_(T[N],f(this,s),f(this,i),b);this.setText(T.join(`
|
|
27
|
+
`))},Co=function(){if(f(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:b}=(oo(),Q(ao));this.setText(b(this.firstChild.toString(),f(this,s),f(this,i)))},Io=function(){if(f(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:b}=(Bu(),Q(co));this.setText(b(this.firstChild.toString(),f(this,s),f(this,i)))},No=function(){if(f(this,s).excludes.includes("list"))return;const{parseList:b}=(Mu(),Q(mo)),{firstChild:_,type:T,name:N}=this,R=_.toString().split(`
|
|
28
|
+
`),q={lastPrefix:""};let J=T==="root"||T==="ext-inner"&&N==="poem"?0:1;for(;J<R.length;J++)R[J]=b(R[J],q,f(this,s),f(this,i));this.setText(R.join(`
|
|
29
|
+
`))},Lo=function(){if(f(this,s).variants.length>0){const{parseConverter:b}=(Du(),Q(vo));this.setText(b(this.firstChild.toString(),f(this,s),f(this,i)))}},A)}}),ye,Ls,Fn,Ie=C({"util/debug.ts"(){"use strict";ye={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(B(),Q(ws)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Ls=e=>t=>t.type===e,Fn=(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 a=0;a<i.length;a++){const u=i[a];u.setAttribute("parentNode",e),u.setAttribute("nextSibling",r[t+a+1]),u.setAttribute("previousSibling",r[t+a-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}}}),lt,Wi,as,Mi,Fl,zi,El,rn,Gu=C({"lib/lintConfig.ts"(){"use strict";var e,t;Ul(),lt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),Wi={"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(Wi),as={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(as),Mi=s=>lt.has(s),Fl=s=>Mi(s)||Array.isArray(s)&&Mi(s[0])&&(s.length===1||typeof s[1]=="object"),zi=(s,i,r)=>{if(ms.includes(i)){if(r===void 0)return!1;if(Fl(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)}`)},El=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(Wi))),!!s)for(const[i,r]of Object.entries(s))zi(this,i,r)}getSeverity(s,i){var n,l;const r=this[s];return typeof r!="object"?lt.get(r):i&&(l=lt.get((n=r[1])==null?void 0:n[i]))!=null?l:lt.get(r[0])}},rn=(t=class{constructor(s){L(this,e);if(Object.assign(this,as),s&&!("rules"in s)&&Object.keys(s).some(r=>ms.includes(r)))this.rules=s;else{const i=s!=null?s:{},{rules:r}=i,n=Mn(i,["rules"]);this.rules=r;for(const[l,o]of Object.entries(n))o!==void 0&&Object.prototype.hasOwnProperty.call(as,l)&&(this[l]=o)}}get rules(){return f(this,e)}set rules(s){F(this,e,new Proxy(new El(s),{set:zi,deleteProperty(){return!1}}))}getSeverity(s,i){return f(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),Fo={};se(Fo,{Title:()=>Eo});var Ui,Eo,Vu=C({"lib/title.ts"(){"use strict";var e,t,s,i,r,n,Ro,o;Ze(),he(),Ui=a=>{const[,{length:u},d]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(a);return[u/3,d]},Eo=(o=class{constructor(a,u,d,{temporary:h,decode:g,selfLink:c,page:p}={}){L(this,n);L(this,e);L(this,t);L(this,s);L(this,i);L(this,r);Ne(this,"page");Ne(this,"valid");Ne(this,"encoded",!1);this.page=p;const x=a.trim(),m=x.startsWith("../");if(g&&a.includes("%"))try{const y=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(a);a=Dt(a),this.encoded=y}catch(y){}if(a=xs(a).replace(/[_ ]+/gu," ").trim(),m||p&&x.startsWith("/"))F(this,i,0);else{let y=u;a.startsWith(":")&&(y=0,a=a.slice(1).trim());const A=a.split(":");if(A.length>1){const k=xt(A[0]),$=Object.prototype.hasOwnProperty.call(d.nsid,k)&&d.nsid[k];$&&(y=$,a=A.slice(1).join(":").trim())}F(this,i,y)}const v=a.indexOf("#");if(v!==-1){let y=a.slice(v).trim().slice(1);if(y.includes("%"))try{y=Dt(y)}catch(A){}F(this,r,y.replace(/ /gu,"_")),a=a.slice(0,v).trim()}const[w,S]=m?Ui(a):[0,a];this.valid=!!(a||c&&this.ns===0&&f(this,r)!==void 0)&&xs(a)===a&&(w===0||p===void 0||p.split("/",w+1).length>w)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(S),this.main=a,F(this,t,d.namespaces),F(this,s,d.articlePath||"/wiki/$1"),f(this,s).includes("$1")||F(this,s,f(this,s)+`${f(this,s).endsWith("/")?"":"/"}$1`),h||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return f(this,i)}get fragment(){return f(this,r)}get main(){return f(this,e)}set main(a){a=a.replace(/_/gu," ").trim(),F(this,e,a&&a[0].toUpperCase()+a.slice(1))}get prefix(){const a=f(this,t)[this.ns];return a+(a&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:a}=this,u=a.lastIndexOf(".");return u===-1?void 0:a.slice(u+1).toLowerCase()}getRedirection(){const{prefix:a}=this,u=a;return P(this,n,Ro).call(this,u)}setFragment(a){F(this,r,a)}getUrl(a){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,Ro=function(a){var d,h;let u=(a+this.main).replace(/ /gu,"_");if(u.startsWith("/"))u=((d=this.page)!=null?d:"")+u.replace(/(.)\/$/u,"$1");else if(u.startsWith("../")&&((h=this.page)!=null&&h.includes("/"))){const[g,c]=Ui(u),p=this.page.split("/");p.length>g&&(u=p.slice(0,-g).join("/")+(c&&"/")+c)}return[!1,u]},o)}}),Po={};se(Po,{default:()=>I});Oo.exports=Q(Po);var os,Hi,Rl,Ve,Di,Pl,I,O=C({"index.ts"(){Ul(),Ie(),Me(),he(),Gu(),os=!0,Hi=new rn,Ve={config:Vi,get rules(){return ms},get i18n(){return ge(ge({},Gl),Rl)},set i18n(e){Rl=e},get lintConfig(){return Hi},set lintConfig(e){Hi=new rn(e)},get viewOnly(){return os},set viewOnly(e){os&&!e&&ye.rev++,os=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:r,variable:n}=t;for(let l=0;l<2;l++)s.length>l+2&&s[l].length===0&&(s[l]=Object.keys(s[l+2]));return i.includes("translate")&&!n.includes("translationlanguage")&&(n.push("translationlanguage"),Array.isArray(r[1])?r[1].push("TRANSLATIONLANGUAGE"):r[1].TRANSLATIONLANGUAGE="translationlanguage"),Ee(ge(ge({},Vi),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=Ve.getConfig(),r){const{Title:n}=(Vu(),Q(Fo));let l;if(r!=null&&r.halfParsed)l=new n(e,t,i,r);else{const{Token:o}=(B(),Q(ws));l=ye.run(()=>{const a=new o(e,i);a.type="root",a.pageName=r==null?void 0:r.page,a.parseOnce(0,s).parseOnce();const u=new n(a.toString(),t,i,r);a.build();for(const d of["main","fragment"]){const h=u[d];if(h!=null&&h.includes("\0")){const g=a.buildFromStr(h,1);d==="main"?u.main=g:u.setFragment(g)}}return u})}return l},parse(e,t,s,i,r){e=Hl(e);let n,l,o,a;typeof t=="string"?(n=!!s,l=i,o=r,a=t):(n=!!t,l=s,o=i,a=r),l!=null||(l=be),o!=null||(o=this.getConfig());let u;typeof l!="number"&&(u=Array.isArray(l)?l:[l],l=Math.max(...u.map(g=>zl[g]||be)));const{Token:d}=(B(),Q(ws));return ye.run(()=>{const g=new d(e,o);return g.type="root",g.pageName=a,g.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=Ve.getConfig()){},createLanguageService(e={}){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},Di={},Pl=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in Ve)Pl.has(e)||(Di[e]={enumerable:!1});Object.defineProperties(Ve,Di),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Ve}),I=Ve}});O()});Qu();})();
|