wikiparser-node 1.18.0 → 1.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/config.js +3 -1
- package/bundle/bundle-es7.min.js +22 -22
- package/bundle/bundle-lsp.min.js +26 -26
- package/bundle/bundle.min.js +22 -22
- package/config/.schema.json +1 -1
- package/data/signatures.json +141 -353
- package/dist/base.d.mts +9 -1
- package/dist/base.d.ts +9 -1
- package/dist/bin/config.js +62 -56
- package/dist/index.js +4 -4
- package/dist/lib/lsp.d.ts +20 -3
- package/dist/lib/lsp.js +211 -69
- package/dist/src/attribute.js +10 -4
- package/dist/src/index.js +2 -2
- package/dist/src/nowiki/doubleUnderscore.js +3 -2
- package/dist/util/diff.js +1 -1
- package/dist/util/lint.js +31 -1
- package/extensions/dist/base.js +1 -1
- package/extensions/es7/base.js +1 -1
- package/i18n/zh-hans.json +1 -0
- package/i18n/zh-hant.json +1 -0
- package/package.json +6 -2
package/bundle/bundle-lsp.min.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
"use strict";(()=>{var da=Object.create;var vt=Object.defineProperty;var qi=Object.getOwnPropertyDescriptor;var ga=Object.getOwnPropertyNames;var ua=Object.prototype.hasOwnProperty;var _i=(a,n)=>(n=Symbol[a])?n:Symbol.for("Symbol."+a),At=a=>{throw TypeError(a)};var Oi=(a,n,e)=>n in a?vt(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e;var Bi=(a,n)=>vt(a,"name",{value:n,configurable:!0});var k=(a,n)=>()=>(a&&(n=a(a=0)),n);var pa=(a,n)=>()=>(n||a((n={exports:{}}).exports,n),n.exports),se=(a,n)=>{for(var e in n)vt(a,e,{get:n[e],enumerable:!0})},ca=(a,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of ga(n))!ua.call(a,r)&&r!==e&&vt(a,r,{get:()=>n[r],enumerable:!(t=qi(n,r))||t.enumerable});return a};var J=a=>ca(vt({},"__esModule",{value:!0}),a);var oe=a=>{var n;return[,,,da((n=a==null?void 0:a[_i("metadata")])!=null?n:null)]},Mi=["class","method","getter","setter","accessor","field","value","get","set"],mr=a=>a!==void 0&&typeof a!="function"?At("Function expected"):a,ma=(a,n,e,t,r)=>({kind:Mi[a],name:n,metadata:t,addInitializer:i=>e._?At("Already initialized"):r.push(mr(i||null))}),ha=(a,n)=>Oi(n,_i("metadata"),a[3]),ae=(a,n,e,t)=>{for(var r=0,i=a[n>>1],s=i&&i.length;r<s;r++)n&1?i[r].call(e):t=i[r].call(e,t);return t},le=(a,n,e,t,r,i)=>{var s,o,l,u,p,d=n&7,g=!!(n&8),f=!!(n&16),h=d>3?a.length+1:d?g?1:2:0,m=Mi[d+5],x=d>3&&(a[h-1]=[]),y=a[h]||(a[h]=[]),w=d&&(!f&&!g&&(r=r.prototype),d<5&&(d>3||!f)&&qi(d<4?r:{get[e](){return c(this,i)},set[e]($){return b(this,i,$)}},e));d?f&&d<4&&Bi(i,(d>2?"set ":d>1?"get ":"")+e):Bi(r,e);for(var C=t.length-1;C>=0;C--)u=ma(d,e,l={},a[3],y),d&&(u.static=g,u.private=f,p=u.access={has:f?$=>fa(r,$):$=>e in $},d^3&&(p.get=f?$=>(d^1?c:A)($,r,d^4?i:w.get):$=>$[e]),d>2&&(p.set=f?($,L)=>b($,r,L,d^4?i:w.set):($,L)=>$[e]=L)),o=(0,t[C])(d?d<4?f?i:w[m]:d>4?void 0:{get:w.get,set:w.set}:r,u),l._=1,d^4||o===void 0?mr(o)&&(d>4?x.unshift(o):d?f?i=o:w[m]=o:r=o):typeof o!="object"||o===null?At("Object expected"):(mr(s=o.get)&&(w.get=s),mr(s=o.set)&&(w.set=s),mr(s=o.init)&&x.unshift(s));return d||ha(a,r),w&&vt(r,e,w),f?d^4?i:w:r},te=(a,n,e)=>Oi(a,typeof n!="symbol"?n+"":n,e),qn=(a,n,e)=>n.has(a)||At("Cannot "+e),fa=(a,n)=>Object(n)!==n?At('Cannot use the "in" operator on this value'):a.has(n),c=(a,n,e)=>(qn(a,n,"read from private field"),e?e.call(a):n.get(a)),T=(a,n,e)=>n.has(a)?At("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),b=(a,n,e,t)=>(qn(a,n,"write to private field"),t?t.call(a,e):n.set(a,e),e),A=(a,n,e)=>(qn(a,n,"access private method"),e);var Vr=(a,n,e,t)=>({set _(r){b(a,n,r,e)},get _(){return c(a,n,t)}});var Di,Wi,Hi=k(()=>{"use strict";Di=(()=>{let a={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};return Object.setPrototypeOf(a,null),a})(),Wi=(()=>{let a=["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(a),a})()});var Ge,hr,xa,Ui,_n=k(()=>{"use strict";Ge=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25")),hr=a=>Math.round(a*255).toString(16).padStart(2,"0"),xa=(()=>{let a=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\d_])`,n=String.raw`(?:\d*\.)?\d+%?`,e=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,t=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(n).join(String.raw`\s+`)}(?:\s*\/\s*${n})?`}|${String.raw`${new Array(3).fill(n).join(String.raw`\s*,\s*`)}(?:\s*,\s*${n})?`})\s*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${e}\s+${n}\s+${n}(?:\s*\/\s*${n})?`}|${String.raw`${e}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${n})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\d_])(${a}|${t}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\d_])(${a}|${t})`,"giu")}})(),Ui=(a,n=!0)=>{let e=[],t=xa[n?"full":"rgb"];t.lastIndex=0;let r=t.exec(a),i=0;for(;r;){let s=r.index+r[1].length;s>i&&e.push([a.slice(i,s),i,s,!1]),{lastIndex:i}=t,e.push([r[2],s,i,a.charAt(s-1)!=="&"||!/^#\d+$/u.test(r[2])]),r=t.exec(a)}return a.length>i&&e.push([a.slice(i),i,a.length,!1]),e}});var Ie,zi,je,Be,nt,St,de,Gi,ye,ba,Ta,it,Vi,Cl,ya,ka,wt,qe,Y=k(()=>{"use strict";_n();Ie=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,zi=String.raw`[^[\]<>"\0-\x1F\x7F${Ie}\uFFFD]`,je=String.raw`(?:\[[\da-f:.]+\]|${zi})`,Be=String.raw`(?:${zi}|\0\d+[cn!~]\x7F)*`,nt=(a,n)=>e=>e.replace(a,n),St=nt(/[\0\x7F]|\r$/gmu,""),de=nt(/\0\d+[cn]\x7F/gu,""),Gi=nt(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),ye=(a,n="")=>a.map(e=>typeof e=="string"?e:e.text()).join(n),ba={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Ta=nt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,n,e)=>n?String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n)):ba[e.toLowerCase()]),it=a=>Ta(a),Vi=nt(/&#(\d+|x[\da-f]+);/giu,(a,n)=>String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n))),Cl=nt(/\n/gu,String.raw`\n`),ya={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},ka=a=>nt(a,n=>`&${ya[n]};`),wt=ka(/[&<>]/gu),qe=(a,n={})=>{let{pre:e="",post:t="",sep:r=""}=n;return e+a.map(i=>i.print()).join(r)+t}});var Qi=pa((Nl,va)=>{va.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},variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#cscore":"cscore","#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","#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"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#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:|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}});var On,Xi=k(()=>{"use strict";On=Qi()});var fr,Ct,xr,br,Mn,j,ee=k(()=>{"use strict";j=class{constructor(n,e){T(this,br);T(this,fr);T(this,Ct);T(this,xr);b(this,fr,n),b(this,Ct,e)}get start(){return c(this,Ct)}get top(){return A(this,br,Mn).call(this).top}get left(){return A(this,br,Mn).call(this).left}};fr=new WeakMap,Ct=new WeakMap,xr=new WeakMap,br=new WeakSet,Mn=function(){var n;return(n=c(this,xr))!=null||b(this,xr,c(this,fr).getRootNode().posFromIndex(c(this,Ct))),c(this,xr)}});var $t,Ki,I,P,Ne,D=k(()=>{"use strict";ke();ee();W();$t=(a,n,e,t)=>({line:a+e-1,character:(e===1?n:0)+t}),Ki=a=>(n,e,t,r,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof j?e:new j(n,s),{offsetHeight:u,offsetWidth:p}=n,{startIndex:d,startLine:g,startCol:f}=a(n,s,o,l),{line:h,character:m}=$t(g,f,u,p);return{rule:t,message:v.msg(r),severity:i,startIndex:d,endIndex:d+n.toString().length,startLine:g,endLine:h,startCol:f,endCol:m}},I=Ki((a,n,e,t)=>{let r=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(r);return{startIndex:n+r,startLine:e+i,startCol:i?s:t+s}}),P=Ki((a,n,e,t)=>({startIndex:n,startLine:e,startCol:t})),Ne=(a,n,e)=>{if(a)return a[1];let t=n();return e([re.rev,t]),t}});var Aa,Qr,Ji=k(()=>{"use strict";Aa=(a,n,e)=>{let[t,...r]=a.split("#");return(!t||t===n)&&r.every(i=>i===e)},Qr=(a,n,e)=>({type:t,name:r})=>a.split(",").some(i=>Aa(i.trim(),t,r))});var Tr,It,Nt,yr,kr,Et,Lt,Ft,Xr,Pt,Dn=k(()=>{"use strict";D();ke();Pt=class{constructor(){T(this,Ft);te(this,"childNodes",[]);T(this,Tr);T(this,It);T(this,Nt);T(this,yr);T(this,kr);T(this,Et);T(this,Lt,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return c(this,Tr)}get nextSibling(){return c(this,It)}get previousSibling(){return c(this,Nt)}get offsetHeight(){return A(this,Ft,Xr).call(this).height}get offsetWidth(){return A(this,Ft,Xr).call(this).width}getChildNodes(){let{childNodes:n}=this;return Object.isFrozen(n)?[...n]:n}getAttribute(n){return n==="padding"?0:this[n]}setAttribute(n,e){switch(n){case"parentNode":b(this,Tr,e),e||(b(this,It,void 0),b(this,Nt,void 0));break;case"nextSibling":b(this,It,e);break;case"previousSibling":b(this,Nt,e);break;case"aIndex":b(this,Et,[re.rev,e]);break;default:this[n]=e}}getRootNode(){return Ne(c(this,kr),()=>{var n,e;return(e=(n=this.parentNode)==null?void 0:n.getRootNode())!=null?e:this},n=>{let[,e]=n;e.type==="root"&&b(this,kr,n)})}indexFromPos(n,e){{if(n<0||e<0)return;let t=this.getLines();if(n>=t.length)return;let[,r,i]=t[n],s=r+e;return s>i?void 0:s}}posFromIndex(n){let{length:e}=String(this);if(n+=n<0?e:0,n>=0&&n<=e){let t=this.getLines(),r=t.findIndex(([,,i])=>n<=i);return{top:r,left:n-t[r][1]}}}getGaps(n){return 0}getRelativeIndex(n){if(n===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return Ne(c(this,Lt)[n],()=>{let{childNodes:e}=this,t=n+(n<0?e.length:0),r=this.getAttribute("padding");for(let i=0;i<t;i++)c(this,Lt)[i]=[re.rev,r],r+=e[i].toString().length+this.getGaps(i);return r},e=>{c(this,Lt)[n]=e})}getAbsoluteIndex(){return Ne(c(this,Et),()=>{let{parentNode:n}=this;return n?n.getAbsoluteIndex()+this.getRelativeIndex():0},n=>{b(this,Et,n)})}getBoundingClientRect(){return{...A(this,Ft,Xr).call(this),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}seal(n,e){Object.defineProperty(this,n,{enumerable:!e&&!!this[n],configurable:!0})}is(n){return this.type===n}getLines(){return Ne(c(this,yr),()=>{let n=[],e=0;for(let t of String(this).split(`
|
|
2
|
-
`)){let r=e+t.length;n.push([t,e,r]),e=r+1}return n},n=>{b(this,yr,n)})}};Tr=new WeakMap,It=new WeakMap,Nt=new WeakMap,yr=new WeakMap,kr=new WeakMap,Et=new WeakMap,Lt=new WeakMap,Ft=new WeakSet,Xr=function(){let n=this.getLines(),e=n[n.length-1];return{height:n.length,width:e[2]-e[1]}}});var Ve,Wn,Hn,Kr,Yi=k(()=>{"use strict";Y();ke();Ji();Dn();Kr=class extends Pt{constructor(){super(...arguments);T(this,Ve)}get length(){return this.childNodes.length}text(e){return ye(this.childNodes,e)}normalize(){let e=this.getChildNodes(),t=r=>{var i,s;e.splice(r,1),(i=e[r-1])==null||i.setAttribute("nextSibling",e[r]),(s=e[r])==null||s.setAttribute("previousSibling",e[r-1])};for(let r=e.length-1;r>=0;r--){let{type:i,data:s}=e[r];i!=="text"||e.length===1||this.getGaps(r-(r&&1))||s===""&&t(r)}this.setAttribute("childNodes",e)}removeAt(e){return Un(this,e,1)[0]}insertAt(e,t=this.length){return Un(this,t,0,[e]),e}closest(e){let t=Qr(e,this),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelector(e){let t=Qr(e,this);return A(this,Ve,Wn).call(this,t)}querySelectorAll(e){let t=Qr(e,this);return A(this,Ve,Hn).call(this,t)}append(...e){for(let t of e)this.insertAt(t)}replaceChildren(...e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.append(...e)}setText(e,t=0){t+=t<0?this.length:0;let r=this.childNodes[t],{data:i}=r;return r.replaceData(e),i}toString(e,t=""){return this.childNodes.map(r=>r.toString(e)).join(t)}caretPositionFromIndex(e){{if(e===void 0)return;let{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let r=this,i=0,s=0;for(;r.type!=="text";){let{childNodes:o}=r;i+=r.getAttribute("padding");for(let l=0;i<=e&&l<o.length;l++){let u=o[l],{nextSibling:p}=u,d=u.toString(),g=d.length;if(u.setAttribute("aIndex",i),i+=g,i>e||i===e&&g>0&&(!p||p.type==="text"||u.type!=="text"&&(d.trim()||!p.toString().trim()))){r=u,i-=g,s=i;break}i+=r.getGaps(l)}if(r.childNodes===o)return{offsetNode:r,offset:e-s}}return{offsetNode:r,offset:e-s}}}elementFromIndex(e){var t;{let r=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(r==null?void 0:r.type)==="text"?r.parentNode:r}}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){let r=[];for(let i=0,s=e+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i];o.setAttribute("aIndex",s),r.push(...o.lint(s,t)),s+=o.toString().length+this.getGaps(i)}return r}print(e={}){let t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}">`)+qe(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){let r={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,s=t+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i],{length:l}=o.toString();o.setAttribute("aIndex",s),r.childNodes.push(o.type==="text"?{data:o.data,range:[s,s+l]}:o.json(void 0,s)),s+=l+this.getGaps(i)}return r}};Ve=new WeakSet,Wn=function(e){var t;for(let r of this.childNodes){if(r.type==="text")continue;if(e(r))return r;let i=A(t=r,Ve,Wn).call(t,e);if(i)return i}},Hn=function(e){var r;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t.push(...A(r=i,Ve,Hn).call(r,e)));return t}});var zn,Zi,Sa,wa,Ca,$a,Ia,Na,Gn,Jr,es,vr,ts=k(()=>{"use strict";Y();D();W();Dn();zn=String.raw`[${Ie}\t]*`,Zi=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${zn}\d)|isbn(?=[-::]?${zn}(?:\d(?:${zn}|-)){6})`,Sa=new RegExp(String.raw`${Zi}|https?[:/]/+`,"giu"),wa=new RegExp(Zi,"giu"),Ca=new Set(["attr-value","ext-link-text","link-text"]),$a={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ia={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},Na=["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"];try{Gn=new RegExp(String.raw`[\p{L}\d_]`,"u")}catch(a){Gn=/\w/u}vr=class extends Pt{constructor(e){super();T(this,Jr);te(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},data:{value:e}})}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?de(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var M,F,Q;if(t===!1)return[];let{data:r,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:u,parentNode:p}=i,d=!1;if(l==="attr-value"){let{type:R,name:H,tag:G}=p;if(R!=="ext-attr")d=!0;else if(G==="choose"&&(H==="before"||H==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="ext-link-text"||l==="image-parameter"&&u==="link"||d?wa:Sa),r.search(t)===-1)return[];t.lastIndex=0;let g=[],f=s==null?void 0:s.type,h=s==null?void 0:s.name,m=o==null?void 0:o.type,x=this.getRootNode(),y=x.toString(),{ext:w,html:C}=x.getAttribute("config"),{top:$,left:L}=x.posFromIndex(e),O=new Set(["onlyinclude","noinclude","includeonly",...w,...C[0],...C[1],...C[2],...Na]);for(let R=t.exec(r);R;R=t.exec(r)){let[,H,G]=R,{index:E}=R,_=R[0].toLowerCase();if(G&&G!=="]"){let{length:fe}=G;E+=fe,_=_.slice(fe)}let{0:N,length:ue}=_,ie=N==="r"||N==="p"||N==="i";if(N==="<"&&!O.has(H.toLowerCase())||N==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(E+1))||s!=null&&s.is("ext")&&h==="nowiki"&&((M=s.innerText)!=null&&M.includes("]")))||ie&&(!i.getAttribute("plain")||Ca.has(l)))continue;N==="]"&&(E||ue>1)&&t.lastIndex--;let me=e+E,pe=me+ue,Te=y[pe],yt=y[me-1],Rn=ue>1&&!(N==="<"&&!/[\s/>]/u.test(Te!=null?Te:"")||d&&(N==="["||N==="]")||ie&&l==="parameter-value")||N==="{"&&(Te===N||yt==="-")||N==="}"&&(yt===N||Te==="-")||N==="["&&(Te===N||l==="ext-link-text"||f==="free-ext-link"&&!r.slice(E+1).trim())||N==="]"&&(yt===N||m==="free-ext-link"&&!r.slice(0,E).includes("]"))?"error":"warning",jn=N==="{"||N==="[";if(Rn==="warning"&&(jn||(N==="]"||N==="}"))){let fe=$a[N],Bn=jn?r.slice(E+1):r.slice(0,E);if(N==="{"&&((F=fe.exec(Bn))==null?void 0:F[0])==="}"||N==="}"&&((Q=fe.exec(Bn))==null?void 0:Q[0])==="{")continue;if(!Bn.includes(N)){let ji=jn?"nextSibling":"previousSibling",rt=this[ji];for(;rt&&(rt.type!=="text"||!fe.test(rt.data));)rt=rt[ji];if(rt&&fe.exec(rt.data)[0]!==N)continue}}ie&&(_=_.toUpperCase());let Fi=this.posFromIndex(E),{line:Pi,character:Ri}=$t($,L,Fi.top+1,Fi.left),kt={rule:Ia[N],message:v.msg('lonely "$1"',ie||N==="h"?_:N),severity:Rn,startIndex:me,endIndex:pe,startLine:Pi,endLine:Pi,startCol:Ri,endCol:Ri+ue};if(N==="<")kt.suggestions=[{desc:"escape",range:[me,me+1],text:"<"}];else if(N==="h"&&l!=="link-text"&&Gn.test(yt||""))kt.suggestions=[{desc:"whitespace",range:[me,me],text:" "}];else if(N==="["&&l==="ext-link-text"){let fe=i.getAbsoluteIndex()+i.toString().length;kt.suggestions=[{desc:"escape",range:[fe,fe+1],text:"]"}]}else if(N==="]"&&m==="free-ext-link"&&Rn==="error"){let fe=e-o.toString().length;kt.fix={range:[fe,fe],text:"[",desc:"left bracket"}}else ie&&(kt.suggestions=[...R[0]===_?[]:[{desc:"uppercase",range:[me,pe],text:_}],...Te===":"||Te==="\uFF1A"?[{desc:"whitespace",range:[pe,pe+1],text:" "}]:[]]);g.push(kt)}return g}replaceData(e){A(this,Jr,es).call(this,e)}print(){return wt(this.data)}};Jr=new WeakSet,es=function(e){this.setAttribute("data",e)}});var ve,st=k(()=>{"use strict";ke();ve=(a=!0,n=!0)=>(e,t)=>{class r extends e{text(){return""}lint(s){return a?[]:super.lint(s)}}return Yr(r,e),r}});var Ar,Ae,Rt=k(()=>{"use strict";q();Ae=class extends S{constructor(e,t,r,i,s,o){super(e,i,s,o);T(this,Ar);b(this,Ar,r)}get type(){return c(this,Ar)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Ar=new WeakMap});var jt,V,_e=k(()=>{"use strict";q();V=class extends S{constructor(e,t,r,i,s){super(e,r,i,s);T(this,jt);b(this,jt,t)}get type(){return c(this,jt)}set type(e){b(this,jt,e)}};jt=new WeakMap});var Ea,ot,Ee,Le,Fe,Sr=k(()=>{"use strict";D();Y();ee();W();q();_e();Ea=a=>a==="redirect-target"||a==="link",Fe=class extends S{constructor(e,t,r=v.getConfig(),i=[],s="|"){super(void 0,r,i,{});T(this,ot,!0);T(this,Ee);T(this,Le);if(this.insertAt(new V(e,"link-target",r,i,{})),t!==void 0){let o=new S(t,r,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}b(this,Ee,s)}get link(){return c(this,Le)}get fragment(){return c(this,Le).fragment}afterBuild(){b(this,Le,this.getTitle()),c(this,Ee).includes("\0")&&b(this,Ee,this.buildFromStr(c(this,Ee),0)),this.setAttribute("name",c(this,Le).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?b(this,ot,t):e==="title"?b(this,Le,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,c(this,Ee));return c(this,ot)?`[[${t}]]`:t}text(){let e=super.text("|");return c(this,ot)?`[[${e}]]`:e}getAttribute(e){return e==="title"?c(this,Le):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?c(this,Ee).length:1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:u}=c(this,Le),p=new j(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&r.push(I(i,p,"unknown-page","template in an internal link target","warning")),l){let d=I(i,p,"url-encoding","unnecessary URL encoding in an internal link");d.suggestions=[{desc:"decode",range:[d.startIndex,d.endIndex],text:Ge(i.text())}],r.push(d)}if(o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.findIndex(f=>f.type==="text"&&f.data.includes("|")),g=s==null?void 0:s.childNodes[d];if(g){let f=I(s,p,"pipe-like",'additional "|" in the link text',"warning"),h=f.startIndex+s.getRelativeIndex(d);f.suggestions=[{desc:"escape",range:[h,h+g.data.length],text:g.data.replace(/\|/gu,"|")}],r.push(f)}}if(u!==void 0&&!Ea(o)){let d=I(i,p,"no-ignored","useless fragment"),g=i.childNodes.findIndex(h=>h.type==="text"&&h.data.includes("#")),f=i.childNodes[g];f&&(d.fix={range:[d.startIndex+i.getRelativeIndex(g)+f.data.indexOf("#"),d.endIndex],text:"",desc:"remove"}),r.push(d)}return r}getTitle(e,t){return this.normalizeTitle(this.firstChild.toString(!0),0,e,t,!0,!0)}print(){return super.print(c(this,ot)?{pre:"[[",post:"]]",sep:c(this,Ee)}:{sep:c(this,Ee)})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t),{type:i,fragment:s}=this;return s!==void 0&&(i==="link"||i==="redirect-target")&&(r.fragment=s),r}};ot=new WeakMap,Ee=new WeakMap,Le=new WeakMap});var ge,Qe=k(()=>{"use strict";q();ge=class extends S{get innerText(){return this.firstChild.data}constructor(n="",e,t){super(n,e,t)}}});var rs,Vn,La,K,Xe=k(()=>{"use strict";st();Qe();rs=[ve()];K=class extends(La=ge){get type(){return"noinclude"}toString(n){return n?"":super.toString()}};Vn=oe(La),K=le(Vn,0,"NoincludeToken",rs,K),ae(Vn,1,K)});var Zr,ns=k(()=>{"use strict";D();Sr();Xe();Zr=class extends Fe{get type(){return"redirect-target"}constructor(n,e,t,r){super(n,void 0,t,r),e!==void 0&&this.insertAt(new K(e,t,r))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!1,!0,!0)}lint(n=this.getAbsoluteIndex()){let e=super.lint(n,!1);if(this.length===2){let t=I(this.lastChild,{start:n},"no-ignored","useless link text");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:"",desc:"remove"},e.push(t)}return e}}});var is,Ke,Bt,Qn,Fa,at,ss=k(()=>{"use strict";st();q();Rt();ns();is=[ve(!1,!1)];at=class extends(Fa=S){constructor(e,t,r,i,s,o,l=[]){super(void 0,o,l);T(this,Ke);T(this,Bt);b(this,Ke,e),b(this,Bt,s);let u=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new Ae(t,u,"redirect-syntax",o,l,{}),new Zr(r,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?c(this,Ke).length:super.getAttribute(e)}toString(e){return c(this,Ke)+super.toString(e)+c(this,Bt)}lint(e=this.getAbsoluteIndex()){let t=e+c(this,Ke).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",t),this.lastChild.lint(t)}print(){return super.print({pre:c(this,Ke),post:c(this,Bt)})}};Qn=oe(Fa),Ke=new WeakMap,Bt=new WeakMap,at=le(Qn,0,"RedirectToken",is,at),ae(Qn,1,at)});var os={};se(os,{parseRedirect:()=>Pa});var Pa,as=k(()=>{"use strict";W();ss();Pa=(a,n,e)=>{var r;(r=n.regexRedirect)!=null||(n.regexRedirect=new RegExp(String.raw`^(\s*)((?:${n.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=n.regexRedirect.exec(a);return t&&v.normalizeTitle(t[3],0,!1,n,!0,!0,!0).valid?(a=`\0${e.length}o\x7F${a.slice(t[0].length)}`,new at(...t.slice(1),n,e),a):!1}});var en,ls=k(()=>{"use strict";q();en=class extends S{get type(){return"onlyinclude"}toString(n){return`<onlyinclude>${super.toString(n)}</onlyinclude>`}getAttribute(n){return n==="padding"?13:n==="plain"||super.getAttribute(n)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var Je,qt,Xn=k(()=>{"use strict";q();qt=class extends S{constructor(e,t,r,i,s,o=[]){super(void 0,s);T(this,Je);te(this,"closed");te(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),b(this,Je,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,r);let l=typeof t=="string"?-1:o.indexOf(t);o.splice(l===-1?1/0:l,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(e){let{selfClosing:t,firstChild:r,lastChild:i}=this,[s,o]=c(this,Je);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=c(this,Je);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?c(this,Je)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=c(this,Je);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Je=new WeakMap});var ds,Kn,Ra,lt,gs=k(()=>{"use strict";D();ee();st();W();Xn();ds=[ve(!1)];lt=class extends(Ra=qt){get type(){return"include"}constructor(n,e="",t,r,i,s){super(n,e,t!=null?t:"",t===void 0||r!=null?r:"",i,s)}toString(n){return n?"":super.toString()}lint(n=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:r,name:i}=this,s=new j(this,n);if(t.data.trim()){let o=I(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!r){let o=P(this,s,"unclosed-comment",v.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};Kn=oe(Ra),lt=le(Kn,0,"IncludeToken",ds,lt),ae(Kn,1,lt)});var _t,tn=k(()=>{"use strict";ke();_t=(a=0)=>(n,e)=>{var r,us;class t extends n{constructor(){super(...arguments);T(this,r)}getAttr(l){return A(this,r,us).call(this).getAttr(l)}}return r=new WeakSet,us=function(){return this.childNodes[a]},Yr(t,n),t}});var Z,ps,cs,nn,Jn,ms,Ot,hs,fs,xs,rn,sn,on,an,bs,Yn=k(()=>{"use strict";Z=new Set(["align"]),ps=new Set(["cite"]),cs=new Set(["cite","datetime"]),nn=new Set(["width"]),Jn=new Set(["axis","align","bgcolor","height","width","valign"]),ms=new Set([...Jn,"abbr","headers","scope","rowspan","colspan"]),Ot=new Set(["type"]),hs=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),fs=new Set(["clear"]),xs=new Set(["bgcolor","align","valign"]),rn=new Set,sn=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"]),on={div:Z,h1:Z,h2:Z,h3:Z,h4:Z,h5:Z,h6:Z,blockquote:ps,q:ps,p:Z,br:fs,pre:nn,ins:cs,del:cs,ul:Ot,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...hs,"border"]),caption:Z,tr:xs,td:ms,th:ms,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:nn,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ot,poem:Z,categorytree:Z,combooption:Z},an={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:rn,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:rn,inputbox:rn,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:rn,poll:new Set(["id","show-results-before-voting"]),sm2:Ot,flashmp3:Ot,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"])},bs={table:hs,td:new Set([...Jn,"scope"]),th:Jn,br:fs,caption:Z,div:Z,hr:nn,h1:Z,h2:Z,h3:Z,h4:Z,h5:Z,h6:Z,li:Ot,p:Z,pre:nn,tr:xs,ul:Ot}});var ja,wr,Mt,ne,Pe,Dt,Ts=k(()=>{"use strict";D();Y();Yn();ee();W();q();_e();ja=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Dt=class extends S{constructor(e,t,r,i="",s,o=[],l=v.getConfig(),u=[]){let p=new V(r,"attr-key",l,u),d;if(r==="title"||t==="img"&&r==="alt")d=new S(s,l,u,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"||t==="choose"&&(r==="before"||r==="after")){let g={...l,excludes:[...l.excludes,"heading","html","table","hr","list"]};d=new S(s,g,u,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new V(s,"attr-value",l,u,{});super(void 0,l,u);T(this,wr);T(this,Mt);T(this,ne);T(this,Pe);b(this,wr,e),this.append(p,d),b(this,ne,i),b(this,Pe,[...o]),b(this,Mt,t),this.setAttribute("name",de(r).trim().toLowerCase())}get type(){return c(this,wr)}get tag(){return c(this,Mt)}get balanced(){return!c(this,ne)||c(this,Pe)[0]===c(this,Pe)[1]}afterBuild(){c(this,ne).includes("\0")&&b(this,ne,this.buildFromStr(c(this,ne),0)),this.parentNode&&b(this,Mt,this.parentNode.name),this.setAttribute("name",this.firstChild.toString(!0).trim().toLowerCase()),super.afterBuild()}toString(e){let[t="",r=""]=c(this,Pe);return c(this,ne)?super.toString(e,c(this,ne)+t)+r:this.firstChild.toString(e)}text(){return c(this,ne)?`${super.text(`${c(this,ne).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return c(this,ne)?c(this,ne).length+((t=(e=c(this,Pe)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var x;let r=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:l,name:u,tag:p}=this,d=this.getValue(),g=new j(this,e);if(!i){let y=I(o,g,"unclosed-quote",v.msg("unclosed $1","quotes"),"warning");y.startIndex--,y.startCol--,y.suggestions=[{range:[y.endIndex,y.endIndex],text:c(this,Pe)[0],desc:"close"}],r.push(y)}let f=an[p],h=on[p],{length:m}=this.toString();if(!(f!=null&&f.has(u))&&!(h!=null&&h.has(u))&&(l==="ext-attr"?f||h:!/\{\{[^{]+\}\}/u.test(u))&&(l==="ext-attr"&&!h||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(u)&&(p==="meta"||p==="link"||!sn.has(u)))){let y=I(s,g,"illegal-attr","illegal attribute name");y.suggestions=[{desc:"remove",range:[e,e+m],text:""}],r.push(y)}else if((x=bs[p])!=null&&x.has(u))r.push(I(s,g,"obsolete-attr","obsolete attribute","warning"));else if(u==="style"&&typeof d=="string"&&ja.test(d))r.push(I(o,g,"insecure-style","insecure style"));else if(u==="tabindex"&&typeof d=="string"&&d!=="0"){let y=I(o,g,"illegal-attr","nonzero tabindex");y.suggestions=[{desc:"remove",range:[e,e+m],text:""},{desc:"0 tabindex",range:[y.startIndex,y.endIndex],text:"0"}],r.push(y)}return r}getValue(){return c(this,ne)?this.lastChild.text().trim():this.type==="ext-attr"||""}print(){let[e="",t=""]=c(this,Pe);return c(this,ne)?super.print({sep:wt(c(this,ne))+e,post:t}):super.print()}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.tag=this.tag,r}};wr=new WeakMap,Mt=new WeakMap,ne=new WeakMap,Pe=new WeakMap});var ys,Ba,Zn,Cr,Ye,ln=k(()=>{"use strict";D();Y();ee();W();q();_e();Ts();ys=a=>a.slice(0,-1),Ba=a=>`${ys(a)}-dirty`;try{Zn=new RegExp(String.raw`[\p{L}\d]`,"u")}catch(a){Zn=/[^\W_]/u}Ye=class extends S{constructor(e,t,r,i,s=[]){super(void 0,i,s,{});T(this,Cr);if(b(this,Cr,t),this.setAttribute("name",r),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu,l="",u=o.exec(e),p=0,d=()=>{l&&(super.insertAt(new V(l,Ba(t),i,s,{})),l="")};for(;u;){let{index:g,0:f,1:h,2:m,3:x,4:y,5:w,6:C}=u;if(l+=e.slice(p,g),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(de(h).trim())){let $=y!=null?y:C,L=[x,w],O=new Dt(ys(t),r,h,m,$,L,i,s);d(),super.insertAt(O)}else l+=f;({lastIndex:p}=o),u=o.exec(e)}l+=e.slice(p),d()}}get type(){return c(this,Cr)}afterBuild(){let{parentNode:e}=this;(e==null?void 0:e.type)==="td"&&e.subtype==="caption"&&this.setAttribute("name","caption"),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof Dt&&(!e||t.name===e.toLowerCase().trim()))}getAttrToken(e){let t=this.getAttrTokens(e);return t[t.length-1]}getAttr(e){var t;return(t=this.getAttrToken(e))==null?void 0:t.getValue()}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,l=new Set,u=new j(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let p=P(this,u,"no-ignored","attributes of a closing tag"),d=i.getAbsoluteIndex();p.suggestions=[{desc:"remove",range:[e,p.endIndex],text:""},{desc:"open",range:[d+1,d+2],text:""}],r.push(p)}for(let p of s)if(p instanceof Dt){let{name:d}=p;o.has(d)?(l.add(d),o.get(d).push(p)):o.set(d,[p])}else{let d=p.text().trim();if(d){let g=I(p,u,"no-ignored","containing invalid attribute",Zn.test(d)?"error":"warning");g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:" "}],r.push(g)}}if(l.size>0)for(let p of l){let d=o.get(p).map(g=>{let f=g.getValue();return[g,f===!0?"":f]});r.push(...d.map(([g,f],h)=>{let m=I(g,u,"no-duplicate",v.msg("duplicated $1 attribute",p)),x={desc:"remove",range:[m.startIndex,m.endIndex],text:""};return!f||d.slice(0,h).some(([,y])=>y===f)?m.fix=x:m.suggestions=[x],m}))}return r}print(){return this.toString()?`<span class="wpb-${this.type}">${this.childNodes.map(e=>e.print(e instanceof V?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};Cr=new WeakMap});var dn,ks=k(()=>{"use strict";W();q();Xe();dn=class extends S{get type(){return"ext-inner"}constructor(n,e=v.getConfig(),t=[]){if(n){let r=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=r.source,o=r.exec(n);o&&(i.lastIndex=o.index+s);let l=i.exec(n),u=0,p="";for(;o&&l;)new K(o[0],e,t),new K(l[0],e,t),p+=`${n.slice(u,o.index)}\0${t.length-1}n\x7F${n.slice(o.index+s,l.index)}\0${t.length}n\x7F`,u=l.index+s+1,r.lastIndex=u,o=r.exec(n),o&&(i.lastIndex=o.index+s),l=i.exec(n);n=p+n.slice(u)}super(n,e,t,{}),this.setAttribute("stage",10)}getAttribute(n){return n==="plain"||super.getAttribute(n)}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*\/\s*(pre)\b/giu)}}});var Wt,ei=k(()=>{"use strict";D();ee();$r();W();q();_e();Wt=class extends S{get type(){return"ext-inner"}constructor(n,e,t=v.getConfig(),r=[],i){if(super(void 0,t,r,{}),e){let s=V;this.append(...e.split(`
|
|
1
|
+
"use strict";(()=>{var ua=Object.create;var At=Object.defineProperty;var Oi=Object.getOwnPropertyDescriptor;var pa=Object.getOwnPropertyNames;var ca=Object.prototype.hasOwnProperty;var Mi=(a,n)=>(n=Symbol[a])?n:Symbol.for("Symbol."+a),St=a=>{throw TypeError(a)};var Di=(a,n,e)=>n in a?At(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e;var _i=(a,n)=>At(a,"name",{value:n,configurable:!0});var v=(a,n)=>()=>(a&&(n=a(a=0)),n);var ma=(a,n)=>()=>(n||a((n={exports:{}}).exports,n),n.exports),ae=(a,n)=>{for(var e in n)At(a,e,{get:n[e],enumerable:!0})},ha=(a,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of pa(n))!ca.call(a,r)&&r!==e&&At(a,r,{get:()=>n[r],enumerable:!(t=Oi(n,r))||t.enumerable});return a};var Y=a=>ha(At({},"__esModule",{value:!0}),a);var le=a=>{var n;return[,,,ua((n=a==null?void 0:a[Mi("metadata")])!=null?n:null)]},Wi=["class","method","getter","setter","accessor","field","value","get","set"],mr=a=>a!==void 0&&typeof a!="function"?St("Function expected"):a,fa=(a,n,e,t,r)=>({kind:Wi[a],name:n,metadata:t,addInitializer:i=>e._?St("Already initialized"):r.push(mr(i||null))}),xa=(a,n)=>Di(n,Mi("metadata"),a[3]),de=(a,n,e,t)=>{for(var r=0,i=a[n>>1],s=i&&i.length;r<s;r++)n&1?i[r].call(e):t=i[r].call(e,t);return t},ge=(a,n,e,t,r,i)=>{var s,o,l,g,p,d=n&7,u=!!(n&8),m=!!(n&16),h=d>3?a.length+1:d?u?1:2:0,f=Wi[d+5],x=d>3&&(a[h-1]=[]),b=a[h]||(a[h]=[]),k=d&&(!m&&!u&&(r=r.prototype),d<5&&(d>3||!m)&&Oi(d<4?r:{get[e](){return c(this,i)},set[e]($){return T(this,i,$)}},e));d?m&&d<4&&_i(i,(d>2?"set ":d>1?"get ":"")+e):_i(r,e);for(var C=t.length-1;C>=0;C--)g=fa(d,e,l={},a[3],b),d&&(g.static=u,g.private=m,p=g.access={has:m?$=>ba(r,$):$=>e in $},d^3&&(p.get=m?$=>(d^1?c:A)($,r,d^4?i:k.get):$=>$[e]),d>2&&(p.set=m?($,L)=>T($,r,L,d^4?i:k.set):($,L)=>$[e]=L)),o=(0,t[C])(d?d<4?m?i:k[f]:d>4?void 0:{get:k.get,set:k.set}:r,g),l._=1,d^4||o===void 0?mr(o)&&(d>4?x.unshift(o):d?m?i=o:k[f]=o:r=o):typeof o!="object"||o===null?St("Object expected"):(mr(s=o.get)&&(k.get=s),mr(s=o.set)&&(k.set=s),mr(s=o.init)&&x.unshift(s));return d||xa(a,r),k&&At(r,e,k),m?d^4?i:k:r},re=(a,n,e)=>Di(a,typeof n!="symbol"?n+"":n,e),_n=(a,n,e)=>n.has(a)||St("Cannot "+e),ba=(a,n)=>Object(n)!==n?St('Cannot use the "in" operator on this value'):a.has(n),c=(a,n,e)=>(_n(a,n,"read from private field"),e?e.call(a):n.get(a)),y=(a,n,e)=>n.has(a)?St("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),T=(a,n,e,t)=>(_n(a,n,"write to private field"),t?t.call(a,e):n.set(a,e),e),A=(a,n,e)=>(_n(a,n,"access private method"),e);var Qr=(a,n,e,t)=>({set _(r){T(a,n,r,e)},get _(){return c(a,n,t)}});var Hi,Ui,zi=v(()=>{"use strict";Hi=(()=>{let a={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};return Object.setPrototypeOf(a,null),a})(),Ui=(()=>{let a=["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(a),a})()});var Ge,hr,Ta,Gi,On=v(()=>{"use strict";Ge=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25")),hr=a=>Math.round(a*255).toString(16).padStart(2,"0"),Ta=(()=>{let a=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\d_])`,n=String.raw`(?:\d*\.)?\d+%?`,e=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,t=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(n).join(String.raw`\s+`)}(?:\s*\/\s*${n})?`}|${String.raw`${new Array(3).fill(n).join(String.raw`\s*,\s*`)}(?:\s*,\s*${n})?`})\s*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${e}\s+${n}\s+${n}(?:\s*\/\s*${n})?`}|${String.raw`${e}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${n})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\d_])(${a}|${t}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\d_])(${a}|${t})`,"giu")}})(),Gi=(a,n=!0)=>{let e=[],t=Ta[n?"full":"rgb"];t.lastIndex=0;let r=t.exec(a),i=0;for(;r;){let s=r.index+r[1].length;s>i&&e.push([a.slice(i,s),i,s,!1]),{lastIndex:i}=t,e.push([r[2],s,i,a.charAt(s-1)!=="&"||!/^#\d+$/u.test(r[2])]),r=t.exec(a)}return a.length>i&&e.push([a.slice(i),i,a.length,!1]),e}});var Ie,Vi,je,Be,nt,wt,ue,Qi,ye,ya,ka,it,Xi,El,va,Aa,Ct,qe,Z=v(()=>{"use strict";On();Ie=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Vi=String.raw`[^[\]<>"\0-\x1F\x7F${Ie}\uFFFD]`,je=String.raw`(?:\[[\da-f:.]+\]|${Vi})`,Be=String.raw`(?:${Vi}|\0\d+[cn!~]\x7F)*`,nt=(a,n)=>e=>e.replace(a,n),wt=nt(/[\0\x7F]|\r$/gmu,""),ue=nt(/\0\d+[cn]\x7F/gu,""),Qi=nt(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),ye=(a,n="")=>a.map(e=>typeof e=="string"?e:e.text()).join(n),ya={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},ka=nt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,n,e)=>n?String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n)):ya[e.toLowerCase()]),it=a=>ka(a),Xi=nt(/&#(\d+|x[\da-f]+);/giu,(a,n)=>String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n))),El=nt(/\n/gu,String.raw`\n`),va={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Aa=a=>nt(a,n=>`&${va[n]};`),Ct=Aa(/[&<>]/gu),qe=(a,n={})=>{let{pre:e="",post:t="",sep:r=""}=n;return e+a.map(i=>i.print()).join(r)+t}});var Ki=ma((Rl,Sa)=>{Sa.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},variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#cscore":"cscore","#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","#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"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#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:|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}});var Mn,Ji=v(()=>{"use strict";Mn=Ki()});var fr,$t,xr,br,Dn,j,ne=v(()=>{"use strict";j=class{constructor(n,e){y(this,br);y(this,fr);y(this,$t);y(this,xr);T(this,fr,n),T(this,$t,e)}get start(){return c(this,$t)}get top(){return A(this,br,Dn).call(this).top}get left(){return A(this,br,Dn).call(this).left}};fr=new WeakMap,$t=new WeakMap,xr=new WeakMap,br=new WeakSet,Dn=function(){var n;return(n=c(this,xr))!=null||T(this,xr,c(this,fr).getRootNode().posFromIndex(c(this,$t))),c(this,xr)}});var It,Yi,N,P,Ne,Tr,wa,W=v(()=>{"use strict";ke();ne();H();It=(a,n,e,t)=>({line:a+e-1,character:(e===1?n:0)+t}),Yi=a=>(n,e,t,r,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof j?e:new j(n,s),{offsetHeight:g,offsetWidth:p}=n,{startIndex:d,startLine:u,startCol:m}=a(n,s,o,l),{line:h,character:f}=It(u,m,g,p);return{rule:t,message:S.msg(r),severity:i,startIndex:d,endIndex:d+n.toString().length,startLine:u,endLine:h,startCol:m,endCol:f}},N=Yi((a,n,e,t)=>{let r=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(r);return{startIndex:n+r,startLine:e+i,startCol:i?s:t+s}}),P=Yi((a,n,e,t)=>({startIndex:n,startLine:e,startCol:t})),Ne=(a,n,e)=>{if(a)return a[1];let t=n();return e([ie.rev,t]),t},wa=(a,n)=>a==="ol"&&n==="type"?["1","a","A","i","I"]:a==="th"&&n==="scope"?["row","col","rowgroup","colgroup"]:n==="dir"?["ltr","rtl","auto"]:n==="aria-hidden"?["true","false"]:[];Tr={provideValues(a,n){return wa(a,n).map(e=>({name:e}))}}});var Ca,Xr,Zi=v(()=>{"use strict";Ca=(a,n,e)=>{let[t,...r]=a.split("#");return(!t||t===n)&&r.every(i=>i===e)},Xr=(a,n,e)=>({type:t,name:r})=>a.split(",").some(i=>Ca(i.trim(),t,r))});var yr,Nt,Lt,kr,vr,Et,Ft,Pt,Kr,Rt,Wn=v(()=>{"use strict";W();ke();Rt=class{constructor(){y(this,Pt);re(this,"childNodes",[]);y(this,yr);y(this,Nt);y(this,Lt);y(this,kr);y(this,vr);y(this,Et);y(this,Ft,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return c(this,yr)}get nextSibling(){return c(this,Nt)}get previousSibling(){return c(this,Lt)}get offsetHeight(){return A(this,Pt,Kr).call(this).height}get offsetWidth(){return A(this,Pt,Kr).call(this).width}getChildNodes(){let{childNodes:n}=this;return Object.isFrozen(n)?[...n]:n}getAttribute(n){return n==="padding"?0:this[n]}setAttribute(n,e){switch(n){case"parentNode":T(this,yr,e),e||(T(this,Nt,void 0),T(this,Lt,void 0));break;case"nextSibling":T(this,Nt,e);break;case"previousSibling":T(this,Lt,e);break;case"aIndex":T(this,Et,[ie.rev,e]);break;default:this[n]=e}}getRootNode(){return Ne(c(this,vr),()=>{var n,e;return(e=(n=this.parentNode)==null?void 0:n.getRootNode())!=null?e:this},n=>{let[,e]=n;e.type==="root"&&T(this,vr,n)})}indexFromPos(n,e){{if(n<0||e<0)return;let t=this.getLines();if(n>=t.length)return;let[,r,i]=t[n],s=r+e;return s>i?void 0:s}}posFromIndex(n){let{length:e}=String(this);if(n+=n<0?e:0,n>=0&&n<=e){let t=this.getLines(),r=t.findIndex(([,,i])=>n<=i);return{top:r,left:n-t[r][1]}}}getGaps(n){return 0}getRelativeIndex(n){if(n===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return Ne(c(this,Ft)[n],()=>{let{childNodes:e}=this,t=n+(n<0?e.length:0),r=this.getAttribute("padding");for(let i=0;i<t;i++)c(this,Ft)[i]=[ie.rev,r],r+=e[i].toString().length+this.getGaps(i);return r},e=>{c(this,Ft)[n]=e})}getAbsoluteIndex(){return Ne(c(this,Et),()=>{let{parentNode:n}=this;return n?n.getAbsoluteIndex()+this.getRelativeIndex():0},n=>{T(this,Et,n)})}getBoundingClientRect(){return{...A(this,Pt,Kr).call(this),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}seal(n,e){Object.defineProperty(this,n,{enumerable:!e&&!!this[n],configurable:!0})}is(n){return this.type===n}getLines(){return Ne(c(this,kr),()=>{let n=[],e=0;for(let t of String(this).split(`
|
|
2
|
+
`)){let r=e+t.length;n.push([t,e,r]),e=r+1}return n},n=>{T(this,kr,n)})}};yr=new WeakMap,Nt=new WeakMap,Lt=new WeakMap,kr=new WeakMap,vr=new WeakMap,Et=new WeakMap,Ft=new WeakMap,Pt=new WeakSet,Kr=function(){let n=this.getLines(),e=n[n.length-1];return{height:n.length,width:e[2]-e[1]}}});var Ve,Hn,Un,Jr,es=v(()=>{"use strict";Z();ke();Zi();Wn();Jr=class extends Rt{constructor(){super(...arguments);y(this,Ve)}get length(){return this.childNodes.length}text(e){return ye(this.childNodes,e)}normalize(){let e=this.getChildNodes(),t=r=>{var i,s;e.splice(r,1),(i=e[r-1])==null||i.setAttribute("nextSibling",e[r]),(s=e[r])==null||s.setAttribute("previousSibling",e[r-1])};for(let r=e.length-1;r>=0;r--){let{type:i,data:s}=e[r];i!=="text"||e.length===1||this.getGaps(r-(r&&1))||s===""&&t(r)}this.setAttribute("childNodes",e)}removeAt(e){return zn(this,e,1)[0]}insertAt(e,t=this.length){return zn(this,t,0,[e]),e}closest(e){let t=Xr(e,this),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelector(e){let t=Xr(e,this);return A(this,Ve,Hn).call(this,t)}querySelectorAll(e){let t=Xr(e,this);return A(this,Ve,Un).call(this,t)}append(...e){for(let t of e)this.insertAt(t)}replaceChildren(...e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.append(...e)}setText(e,t=0){t+=t<0?this.length:0;let r=this.childNodes[t],{data:i}=r;return r.replaceData(e),i}toString(e,t=""){return this.childNodes.map(r=>r.toString(e)).join(t)}caretPositionFromIndex(e){{if(e===void 0)return;let{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let r=this,i=0,s=0;for(;r.type!=="text";){let{childNodes:o}=r;i+=r.getAttribute("padding");for(let l=0;i<=e&&l<o.length;l++){let g=o[l],{nextSibling:p}=g,d=g.toString(),u=d.length;if(g.setAttribute("aIndex",i),i+=u,i>e||i===e&&u>0&&(!p||p.type==="text"||g.type!=="text"&&(d.trim()||!p.toString().trim()))){r=g,i-=u,s=i;break}i+=r.getGaps(l)}if(r.childNodes===o)return{offsetNode:r,offset:e-s}}return{offsetNode:r,offset:e-s}}}elementFromIndex(e){var t;{let r=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(r==null?void 0:r.type)==="text"?r.parentNode:r}}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){let r=[];for(let i=0,s=e+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i];o.setAttribute("aIndex",s),r.push(...o.lint(s,t)),s+=o.toString().length+this.getGaps(i)}return r}print(e={}){let t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}">`)+qe(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){let r={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,s=t+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i],{length:l}=o.toString();o.setAttribute("aIndex",s),r.childNodes.push(o.type==="text"?{data:o.data,range:[s,s+l]}:o.json(void 0,s)),s+=l+this.getGaps(i)}return r}};Ve=new WeakSet,Hn=function(e){var t;for(let r of this.childNodes){if(r.type==="text")continue;if(e(r))return r;let i=A(t=r,Ve,Hn).call(t,e);if(i)return i}},Un=function(e){var r;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t.push(...A(r=i,Ve,Un).call(r,e)));return t}});var Gn,ts,$a,Ia,Na,La,Ea,Fa,Vn,Yr,rs,Ar,ns=v(()=>{"use strict";Z();W();H();Wn();Gn=String.raw`[${Ie}\t]*`,ts=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Gn}\d)|isbn(?=[-::]?${Gn}(?:\d(?:${Gn}|-)){6})`,$a=new RegExp(String.raw`${ts}|https?[:/]/+`,"giu"),Ia=new RegExp(ts,"giu"),Na=new Set(["attr-value","ext-link-text","link-text"]),La={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ea={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},Fa=["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"];try{Vn=new RegExp(String.raw`[\p{L}\d_]`,"u")}catch(a){Vn=/\w/u}Ar=class extends Rt{constructor(e){super();y(this,Yr);re(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},data:{value:e}})}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?ue(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var D,F,V;if(t===!1)return[];let{data:r,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:g,parentNode:p}=i,d=!1;if(l==="attr-value"){let{type:K,name:me,tag:E}=p;if(K!=="ext-attr")d=!0;else if(E==="choose"&&(me==="before"||me==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="ext-link-text"||l==="image-parameter"&&g==="link"||d?Ia:$a),r.search(t)===-1)return[];t.lastIndex=0;let u=[],m=s==null?void 0:s.type,h=s==null?void 0:s.name,f=o==null?void 0:o.type,x=this.getRootNode(),b=x.toString(),{ext:k,html:C}=x.getAttribute("config"),{top:$,left:L}=x.posFromIndex(e),M=new Set(["onlyinclude","noinclude","includeonly",...k,...C[0],...C[1],...C[2],...Fa]);for(let K=t.exec(r);K;K=t.exec(r)){let[,me,E]=K,{index:B}=K,q=K[0].toLowerCase();if(E&&E!=="]"){let{length:be}=E;B+=be,q=q.slice(be)}let{0:I,length:Q}=q,xe=I==="r"||I==="p"||I==="i";if(I==="<"&&!M.has(me.toLowerCase())||I==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(B+1))||s!=null&&s.is("ext")&&h==="nowiki"&&((D=s.innerText)!=null&&D.includes("]")))||xe&&(!i.getAttribute("plain")||Na.has(l)))continue;I==="]"&&(B||Q>1)&&t.lastIndex--;let R=e+B,te=R+Q,se=b[te],kt=b[R-1],jn=Q>1&&!(I==="<"&&!/[\s/>]/u.test(se!=null?se:"")||d&&(I==="["||I==="]")||xe&&l==="parameter-value")||I==="{"&&(se===I||kt==="-")||I==="}"&&(kt===I||se==="-")||I==="["&&(se===I||l==="ext-link-text"||m==="free-ext-link"&&!r.slice(B+1).trim())||I==="]"&&(kt===I||f==="free-ext-link"&&!r.slice(0,B).includes("]"))?"error":"warning",Bn=I==="{"||I==="[";if(jn==="warning"&&(Bn||(I==="]"||I==="}"))){let be=La[I],qn=Bn?r.slice(B+1):r.slice(0,B);if(I==="{"&&((F=be.exec(qn))==null?void 0:F[0])==="}"||I==="}"&&((V=be.exec(qn))==null?void 0:V[0])==="{")continue;if(!qn.includes(I)){let qi=Bn?"nextSibling":"previousSibling",rt=this[qi];for(;rt&&(rt.type!=="text"||!be.test(rt.data));)rt=rt[qi];if(rt&&be.exec(rt.data)[0]!==I)continue}}xe&&(q=q.toUpperCase());let Ri=this.posFromIndex(B),{line:ji,character:Bi}=It($,L,Ri.top+1,Ri.left),vt={rule:Ea[I],message:S.msg('lonely "$1"',xe||I==="h"?q:I),severity:jn,startIndex:R,endIndex:te,startLine:ji,endLine:ji,startCol:Bi,endCol:Bi+Q};if(I==="<")vt.suggestions=[{desc:"escape",range:[R,R+1],text:"<"}];else if(I==="h"&&l!=="link-text"&&Vn.test(kt||""))vt.suggestions=[{desc:"whitespace",range:[R,R],text:" "}];else if(I==="["&&l==="ext-link-text"){let be=i.getAbsoluteIndex()+i.toString().length;vt.suggestions=[{desc:"escape",range:[be,be+1],text:"]"}]}else if(I==="]"&&f==="free-ext-link"&&jn==="error"){let be=e-o.toString().length;vt.fix={range:[be,be],text:"[",desc:"left bracket"}}else xe&&(vt.suggestions=[...K[0]===q?[]:[{desc:"uppercase",range:[R,te],text:q}],...se===":"||se==="\uFF1A"?[{desc:"whitespace",range:[te,te+1],text:" "}]:[]]);u.push(vt)}return u}replaceData(e){A(this,Yr,rs).call(this,e)}print(){return Ct(this.data)}};Yr=new WeakSet,rs=function(e){this.setAttribute("data",e)}});var ve,st=v(()=>{"use strict";ke();ve=(a=!0,n=!0)=>(e,t)=>{class r extends e{text(){return""}lint(s){return a?[]:super.lint(s)}}return Zr(r,e),r}});var Sr,Ae,jt=v(()=>{"use strict";O();Ae=class extends w{constructor(e,t,r,i,s,o){super(e,i,s,o);y(this,Sr);T(this,Sr,r)}get type(){return c(this,Sr)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Sr=new WeakMap});var Bt,G,_e=v(()=>{"use strict";O();G=class extends w{constructor(e,t,r,i,s){super(e,r,i,s);y(this,Bt);T(this,Bt,t)}get type(){return c(this,Bt)}set type(e){T(this,Bt,e)}};Bt=new WeakMap});var Pa,ot,Le,Ee,Fe,wr=v(()=>{"use strict";W();Z();ne();H();O();_e();Pa=a=>a==="redirect-target"||a==="link",Fe=class extends w{constructor(e,t,r=S.getConfig(),i=[],s="|"){super(void 0,r,i,{});y(this,ot,!0);y(this,Le);y(this,Ee);if(this.insertAt(new G(e,"link-target",r,i,{})),t!==void 0){let o=new w(t,r,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}T(this,Le,s)}get link(){return c(this,Ee)}get fragment(){return c(this,Ee).fragment}afterBuild(){T(this,Ee,this.getTitle()),c(this,Le).includes("\0")&&T(this,Le,this.buildFromStr(c(this,Le),0)),this.setAttribute("name",c(this,Ee).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?T(this,ot,t):e==="title"?T(this,Ee,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,c(this,Le));return c(this,ot)?`[[${t}]]`:t}text(){let e=super.text("|");return c(this,ot)?`[[${e}]]`:e}getAttribute(e){return e==="title"?c(this,Ee):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?c(this,Le).length:1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:g}=c(this,Ee),p=new j(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&r.push(N(i,p,"unknown-page","template in an internal link target","warning")),l){let d=N(i,p,"url-encoding","unnecessary URL encoding in an internal link");d.suggestions=[{desc:"decode",range:[d.startIndex,d.endIndex],text:Ge(i.text())}],r.push(d)}if(o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("|")),u=s==null?void 0:s.childNodes[d];if(u){let m=N(s,p,"pipe-like",'additional "|" in the link text',"warning"),h=m.startIndex+s.getRelativeIndex(d);m.suggestions=[{desc:"escape",range:[h,h+u.data.length],text:u.data.replace(/\|/gu,"|")}],r.push(m)}}if(g!==void 0&&!Pa(o)){let d=N(i,p,"no-ignored","useless fragment"),u=i.childNodes.findIndex(h=>h.type==="text"&&h.data.includes("#")),m=i.childNodes[u];m&&(d.fix={range:[d.startIndex+i.getRelativeIndex(u)+m.data.indexOf("#"),d.endIndex],text:"",desc:"remove"}),r.push(d)}return r}getTitle(e,t){return this.normalizeTitle(this.firstChild.toString(!0),0,e,t,!0,!0)}print(){return super.print(c(this,ot)?{pre:"[[",post:"]]",sep:c(this,Le)}:{sep:c(this,Le)})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t),{type:i,fragment:s}=this;return s!==void 0&&(i==="link"||i==="redirect-target")&&(r.fragment=s),r}};ot=new WeakMap,Le=new WeakMap,Ee=new WeakMap});var pe,Qe=v(()=>{"use strict";O();pe=class extends w{get innerText(){return this.firstChild.data}constructor(n="",e,t){super(n,e,t)}}});var is,Qn,Ra,J,Xe=v(()=>{"use strict";st();Qe();is=[ve()];J=class extends(Ra=pe){get type(){return"noinclude"}toString(n){return n?"":super.toString()}};Qn=le(Ra),J=ge(Qn,0,"NoincludeToken",is,J),de(Qn,1,J)});var en,ss=v(()=>{"use strict";W();wr();Xe();en=class extends Fe{get type(){return"redirect-target"}constructor(n,e,t,r){super(n,void 0,t,r),e!==void 0&&this.insertAt(new J(e,t,r))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!1,!0,!0)}lint(n=this.getAbsoluteIndex()){let e=super.lint(n,!1);if(this.length===2){let t=N(this.lastChild,{start:n},"no-ignored","useless link text");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:"",desc:"remove"},e.push(t)}return e}}});var os,Ke,qt,Xn,ja,at,as=v(()=>{"use strict";st();O();jt();ss();os=[ve(!1,!1)];at=class extends(ja=w){constructor(e,t,r,i,s,o,l=[]){super(void 0,o,l);y(this,Ke);y(this,qt);T(this,Ke,e),T(this,qt,s);let g=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new Ae(t,g,"redirect-syntax",o,l,{}),new en(r,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?c(this,Ke).length:super.getAttribute(e)}toString(e){return c(this,Ke)+super.toString(e)+c(this,qt)}lint(e=this.getAbsoluteIndex()){let t=e+c(this,Ke).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",t),this.lastChild.lint(t)}print(){return super.print({pre:c(this,Ke),post:c(this,qt)})}};Xn=le(ja),Ke=new WeakMap,qt=new WeakMap,at=ge(Xn,0,"RedirectToken",os,at),de(Xn,1,at)});var ls={};ae(ls,{parseRedirect:()=>Ba});var Ba,ds=v(()=>{"use strict";H();as();Ba=(a,n,e)=>{var r;(r=n.regexRedirect)!=null||(n.regexRedirect=new RegExp(String.raw`^(\s*)((?:${n.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=n.regexRedirect.exec(a);return t&&S.normalizeTitle(t[3],0,!1,n,!0,!0,!0).valid?(a=`\0${e.length}o\x7F${a.slice(t[0].length)}`,new at(...t.slice(1),n,e),a):!1}});var tn,gs=v(()=>{"use strict";O();tn=class extends w{get type(){return"onlyinclude"}toString(n){return`<onlyinclude>${super.toString(n)}</onlyinclude>`}getAttribute(n){return n==="padding"?13:n==="plain"||super.getAttribute(n)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var Je,_t,Kn=v(()=>{"use strict";O();_t=class extends w{constructor(e,t,r,i,s,o=[]){super(void 0,s);y(this,Je);re(this,"closed");re(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),T(this,Je,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,r);let l=typeof t=="string"?-1:o.indexOf(t);o.splice(l===-1?1/0:l,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(e){let{selfClosing:t,firstChild:r,lastChild:i}=this,[s,o]=c(this,Je);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=c(this,Je);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?c(this,Je)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=c(this,Je);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Je=new WeakMap});var us,Jn,qa,lt,ps=v(()=>{"use strict";W();ne();st();H();Kn();us=[ve(!1)];lt=class extends(qa=_t){get type(){return"include"}constructor(n,e="",t,r,i,s){super(n,e,t!=null?t:"",t===void 0||r!=null?r:"",i,s)}toString(n){return n?"":super.toString()}lint(n=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:r,name:i}=this,s=new j(this,n);if(t.data.trim()){let o=N(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!r){let o=P(this,s,"unclosed-comment",S.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};Jn=le(qa),lt=ge(Jn,0,"IncludeToken",us,lt),de(Jn,1,lt)});var Ot,rn=v(()=>{"use strict";ke();Ot=(a=0)=>(n,e)=>{var r,cs;class t extends n{constructor(){super(...arguments);y(this,r)}getAttr(l){return A(this,r,cs).call(this).getAttr(l)}}return r=new WeakSet,cs=function(){return this.childNodes[a]},Zr(t,n),t}});var ee,ms,hs,sn,Yn,fs,Mt,xs,bs,Ts,nn,on,an,ln,ys,Zn=v(()=>{"use strict";ee=new Set(["align"]),ms=new Set(["cite"]),hs=new Set(["cite","datetime"]),sn=new Set(["width"]),Yn=new Set(["axis","align","bgcolor","height","width","valign"]),fs=new Set([...Yn,"abbr","headers","scope","rowspan","colspan"]),Mt=new Set(["type"]),xs=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),bs=new Set(["clear"]),Ts=new Set(["bgcolor","align","valign"]),nn=new Set,on=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"]),an={div:ee,h1:ee,h2:ee,h3:ee,h4:ee,h5:ee,h6:ee,blockquote:ms,q:ms,p:ee,br:bs,pre:sn,ins:hs,del:hs,ul:Mt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...xs,"border"]),caption:ee,tr:Ts,td:fs,th:fs,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:sn,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Mt,poem:ee,categorytree:ee,combooption:ee},ln={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:nn,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:nn,inputbox:nn,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:nn,poll:new Set(["id","show-results-before-voting"]),sm2:Mt,flashmp3:Mt,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"])},ys={table:xs,td:new Set([...Yn,"scope"]),th:Yn,br:bs,caption:ee,div:ee,hr:sn,h1:ee,h2:ee,h3:ee,h4:ee,h5:ee,h6:ee,li:Mt,p:ee,pre:sn,tr:Ts,ul:Mt}});var _a,Oa,Cr,Dt,oe,Pe,Wt,ks=v(()=>{"use strict";W();Z();Zn();ne();H();O();_e();_a=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Oa=new Set(["ext","arg","magic-word","template"]),Wt=class extends w{constructor(e,t,r,i="",s,o=[],l=S.getConfig(),g=[]){let p=new G(r,"attr-key",l,g),d;if(r==="title"||t==="img"&&r==="alt")d=new w(s,l,g,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"||t==="choose"&&(r==="before"||r==="after")){let u={...l,excludes:[...l.excludes,"heading","html","table","hr","list"]};d=new w(s,u,g,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new G(s,"attr-value",l,g,{});super(void 0,l,g);y(this,Cr);y(this,Dt);y(this,oe);y(this,Pe);T(this,Cr,e),this.append(p,d),T(this,oe,i),T(this,Pe,[...o]),T(this,Dt,t),this.setAttribute("name",ue(r).trim().toLowerCase())}get type(){return c(this,Cr)}get tag(){return c(this,Dt)}get balanced(){return!c(this,oe)||c(this,Pe)[0]===c(this,Pe)[1]}afterBuild(){c(this,oe).includes("\0")&&T(this,oe,this.buildFromStr(c(this,oe),0)),this.parentNode&&T(this,Dt,this.parentNode.name),this.setAttribute("name",this.firstChild.toString(!0).trim().toLowerCase()),super.afterBuild()}toString(e){let[t="",r=""]=c(this,Pe);return c(this,oe)?super.toString(e,c(this,oe)+t)+r:this.firstChild.toString(e)}text(){return c(this,oe)?`${super.text(`${c(this,oe).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return c(this,oe)?c(this,oe).length+((t=(e=c(this,Pe)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var x;let r=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:l,name:g,tag:p}=this,d=this.getValue(),u=new j(this,e);if(!i){let b=N(o,u,"unclosed-quote",S.msg("unclosed $1","quotes"),"warning");b.startIndex--,b.startCol--,b.suggestions=[{range:[b.endIndex,b.endIndex],text:c(this,Pe)[0],desc:"close"}],r.push(b)}let m=ln[p],h=an[p],{length:f}=this.toString();if(!(m!=null&&m.has(g))&&!(h!=null&&h.has(g))&&(l==="ext-attr"?m||h:!/\{\{[^{]+\}\}/u.test(g))&&(l==="ext-attr"&&!h||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(g)&&(p==="meta"||p==="link"||!on.has(g)))){let b=N(s,u,"illegal-attr","illegal attribute name");b.suggestions=[{desc:"remove",range:[e,e+f],text:""}],r.push(b)}else if(g==="style"&&typeof d=="string"&&_a.test(d))r.push(N(o,u,"insecure-style","insecure style"));else if(g==="tabindex"&&typeof d=="string"&&d!=="0"){let b=N(o,u,"illegal-attr","nonzero tabindex");b.suggestions=[{desc:"remove",range:[e,e+f],text:""},{desc:"0 tabindex",range:[b.startIndex,b.endIndex],text:"0"}],r.push(b)}else if(l!=="ext-attr"&&!o.childNodes.some(({type:b})=>Oa.has(b))){let b=Tr.provideValues(p,g),k=String(d).toLowerCase();b.length>0&&b.every(({name:C})=>C!==k)&&r.push(N(o,u,"illegal-attr","illegal attribute value","warning"))}return(x=ys[p])!=null&&x.has(g)&&r.push(N(s,u,"obsolete-attr","obsolete attribute","warning")),r}getValue(){return c(this,oe)?this.lastChild.text().trim():this.type==="ext-attr"||""}print(){let[e="",t=""]=c(this,Pe);return c(this,oe)?super.print({sep:Ct(c(this,oe))+e,post:t}):super.print()}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.tag=this.tag,r}};Cr=new WeakMap,Dt=new WeakMap,oe=new WeakMap,Pe=new WeakMap});var vs,Ma,ei,$r,Ye,dn=v(()=>{"use strict";W();Z();ne();H();O();_e();ks();vs=a=>a.slice(0,-1),Ma=a=>`${vs(a)}-dirty`;try{ei=new RegExp(String.raw`[\p{L}\d]`,"u")}catch(a){ei=/[^\W_]/u}Ye=class extends w{constructor(e,t,r,i,s=[]){super(void 0,i,s,{});y(this,$r);if(T(this,$r,t),this.setAttribute("name",r),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu,l="",g=o.exec(e),p=0,d=()=>{l&&(super.insertAt(new G(l,Ma(t),i,s,{})),l="")};for(;g;){let{index:u,0:m,1:h,2:f,3:x,4:b,5:k,6:C}=g;if(l+=e.slice(p,u),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(ue(h).trim())){let $=b!=null?b:C,L=[x,k],M=new Wt(vs(t),r,h,f,$,L,i,s);d(),super.insertAt(M)}else l+=m;({lastIndex:p}=o),g=o.exec(e)}l+=e.slice(p),d()}}get type(){return c(this,$r)}afterBuild(){let{parentNode:e}=this;(e==null?void 0:e.type)==="td"&&e.subtype==="caption"&&this.setAttribute("name","caption"),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof Wt&&(!e||t.name===e.toLowerCase().trim()))}getAttrToken(e){let t=this.getAttrTokens(e);return t[t.length-1]}getAttr(e){var t;return(t=this.getAttrToken(e))==null?void 0:t.getValue()}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,l=new Set,g=new j(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let p=P(this,g,"no-ignored","attributes of a closing tag"),d=i.getAbsoluteIndex();p.suggestions=[{desc:"remove",range:[e,p.endIndex],text:""},{desc:"open",range:[d+1,d+2],text:""}],r.push(p)}for(let p of s)if(p instanceof Wt){let{name:d}=p;o.has(d)?(l.add(d),o.get(d).push(p)):o.set(d,[p])}else{let d=p.text().trim();if(d){let u=N(p,g,"no-ignored","containing invalid attribute",ei.test(d)?"error":"warning");u.suggestions=[{desc:"remove",range:[u.startIndex,u.endIndex],text:" "}],r.push(u)}}if(l.size>0)for(let p of l){let d=o.get(p).map(u=>{let m=u.getValue();return[u,m===!0?"":m]});r.push(...d.map(([u,m],h)=>{let f=N(u,g,"no-duplicate",S.msg("duplicated $1 attribute",p)),x={desc:"remove",range:[f.startIndex,f.endIndex],text:""};return!m||d.slice(0,h).some(([,b])=>b===m)?f.fix=x:f.suggestions=[x],f}))}return r}print(){return this.toString()?`<span class="wpb-${this.type}">${this.childNodes.map(e=>e.print(e instanceof G?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};$r=new WeakMap});var gn,As=v(()=>{"use strict";H();O();Xe();gn=class extends w{get type(){return"ext-inner"}constructor(n,e=S.getConfig(),t=[]){if(n){let r=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=r.source,o=r.exec(n);o&&(i.lastIndex=o.index+s);let l=i.exec(n),g=0,p="";for(;o&&l;)new J(o[0],e,t),new J(l[0],e,t),p+=`${n.slice(g,o.index)}\0${t.length-1}n\x7F${n.slice(o.index+s,l.index)}\0${t.length}n\x7F`,g=l.index+s+1,r.lastIndex=g,o=r.exec(n),o&&(i.lastIndex=o.index+s),l=i.exec(n);n=p+n.slice(g)}super(n,e,t,{}),this.setAttribute("stage",10)}getAttribute(n){return n==="plain"||super.getAttribute(n)}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*\/\s*(pre)\b/giu)}}});var Ht,ti=v(()=>{"use strict";W();ne();Ir();H();O();_e();Ht=class extends w{get type(){return"ext-inner"}constructor(n,e,t=S.getConfig(),r=[],i){if(super(void 0,t,r,{}),e){let s=G;this.append(...e.split(`
|
|
3
3
|
`).map(o=>i?o:dt(o,t,r,n)).map(o=>new s(o,"param-line",t,r,{})))}r.splice(r.indexOf(this),1),r.push(this)}toString(n){return super.toString(n,`
|
|
4
4
|
`)}text(){return super.text(`
|
|
5
|
-
`)}getGaps(){return 1}lint(n=this.getAbsoluteIndex()){let e=new j(this,n),t=
|
|
6
|
-
`})}}});var Ir,Ht,gn,Ut,ti=k(()=>{"use strict";D();ke();ee();W();q();Rt();Ut=class extends S{constructor(e,t,r,i=[]){super(void 0,r,i);T(this,Ht);T(this,Ir);b(this,Ir,e);let s=new S(t[0],r,i);s.type="heading-title",s.setAttribute("stage",2);let o=new Ae(t[1],/^\s*$/u,"heading-trail",r,i,{});this.append(s,o)}get type(){return"heading"}get level(){return c(this,Ir)}toString(e){let t=A(this,Ht,gn).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=A(this,Ht,gn).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=o.startsWith("="),u=l||o.endsWith("="),p=i.childNodes.filter(zt("quote")),d=p.filter(({bold:m})=>m),g=p.filter(({italic:m})=>m),f=new j(this,e);if(this.level===1){let m=I(i,f,"h1","<h1>");u||(m.suggestions=[{desc:"h2",range:[m.startIndex,m.endIndex],text:`=${o}=`}]),r.push(m)}if(u){let m=I(i,f,"unbalanced-header",v.msg("unbalanced $1 in a section header",'"="'));if(o!=="=")if(l){let[x]=/^=+/u.exec(o);m.suggestions=[{desc:`h${s}`,range:[m.startIndex,m.startIndex+x.length],text:""},{desc:`h${s+x.length}`,range:[m.endIndex,m.endIndex],text:x}]}else{let x=/[^=](=+)$/u.exec(o)[1];m.suggestions=[{desc:`h${s}`,range:[m.endIndex-x.length,m.endIndex],text:""},{desc:`h${s+x.length}`,range:[m.startIndex,m.startIndex],text:x}]}r.push(m)}this.closest("html-attrs,table-attrs")&&r.push(P(this,f,"parsing-order","section header in an HTML tag"));let h=this.getRootNode().toString();if(d.length%2){let m=I(d[d.length-1],{...f,start:e+s,left:f.left+s},"format-leakage",v.msg("unbalanced $1 in a section header","bold apostrophes")),x=e+s+o.length;h.slice(m.endIndex,x).trim()?m.suggestions=[{desc:"close",range:[x,x],text:"'''"}]:m.fix={desc:"remove",range:[m.startIndex,m.endIndex],text:""},r.push(m)}if(g.length%2){let m=I(g[g.length-1],{start:e+s},"format-leakage",v.msg("unbalanced $1 in a section header","italic apostrophes")),x=e+s+o.length;m.fix=h.slice(m.endIndex,x).trim()?{desc:"close",range:[x,x],text:"''"}:{desc:"remove",range:[m.startIndex,m.endIndex],text:""},r.push(m)}return r}print(){let e=A(this,Ht,gn).call(this);return super.print({pre:e,sep:e})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.level=this.level,r}};Ir=new WeakMap,Ht=new WeakSet,gn=function(){return"=".repeat(this.level)}});var qa,un,vs=k(()=>{"use strict";Y();D();W();q();qa=new RegExp(`https?://${je}${Be}$`,"iu"),un=class extends S{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var n;try{return!!((n=this.parentNode)!=null&&n.getDuplicatedArgs().some(([e])=>e===this.name))}catch(e){return!1}}constructor(n,e,t=v.getConfig(),r=[]){super(void 0,t,r);let i=new S(typeof n=="number"?void 0:n,t,r,{}),s=new S(e,t,r);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(n,e=!0){let t=(typeof n=="string"?n:n.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",t),t}afterBuild(){if(!this.anon){let{parentNode:n,firstChild:e}=this,t=this.trimName(e);n&&n.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(n){return this.anon?this.lastChild.toString(n):super.toString(n,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(n=this.getAbsoluteIndex(),e){var s;let t=super.lint(n,e),{firstChild:r}=this,i=(s=qa.exec(r.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=I(r,{start:n},"unescaped","unescaped query string in an anonymous parameter");o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,o.fix={range:[o.startIndex,o.endIndex],text:"{{=}}",desc:"escape"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{anon:this.anon,duplicated:this.duplicated}),t}}});var Er,gt,ut,Gt,Ze,pn,As,Nr,Ss=k(()=>{"use strict";Y();D();ke();ee();q();vs();_e();Rt();Nr=class extends S{constructor(e,t,r,i=[]){var m,x;let s,o=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);o&&(s=Number(o[1]),e=e.replace(`\0${s}h\x7F`,i[s].toString().replace(/^\n/u,"")));super(void 0,r,i,{});T(this,Ze);te(this,"modifier","");T(this,Er,"template");T(this,gt,!1);T(this,ut,new Map);T(this,Gt);let{parserFunction:[l,u],variable:p}=r,d=(m=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:m[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[y,...w]=e.split(":"),[C]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((x=w[0])!=null?x:"");this.setModifier(`${y}:${C}`)&&(e=w.join(":").slice(C.length))}let g=e.includes(":");if(g||t.length===0&&!c(this,gt)){let y=e.indexOf(":"),w=y===-1?e:e.slice(0,y),C=y===-1?void 0:e.slice(y+1),$=de(w),L=$[C===void 0?"trim":"trimStart"](),O=L.toLowerCase(),M=Array.isArray(u),F=M?u.includes(L):Object.prototype.hasOwnProperty.call(u,L),Q=!M&&F?u[L]:Object.prototype.hasOwnProperty.call(l,O)&&l[O];if(M&&F||p.includes(Q)||g&&Q){this.setAttribute("name",Q||O.replace(/^#/u,"")),b(this,Er,"magic-word");let H=new RegExp(String.raw`^\s*${L}\s*$`,F?"u":"iu"),G=new Ae(w,H,"magic-word-name",r,i,{});if(super.insertAt(G),C!==void 0&&t.unshift([C]),this.name==="invoke")for(let E=0;E<2;E++){let _=t.shift();if(!_)break;let N=new V(_.join("="),`invoke-${E?"function":"module"}`,r,i);super.insertAt(N)}}}if(this.type==="template"){let y=de(e).trim();if(!this.normalizeTitle(y,10,!0,!0).valid)throw i.pop(),new SyntaxError("Invalid template name");let w=new V(e,"template-name",r,i,{});super.insertAt(w)}typeof s=="number"&&(i[s]=void 0);let f=this.isTemplate(),h=1;for(let y=0;y<t.length;y++){let w=t[y];f||this.name==="switch"&&y>0||this.name==="tag"&&y>1||(w[0]=w.join("="),w.length=1),w.length===1&&(w.unshift(h),h++),this.insertAt(new un(...w,r,i))}this.seal("modifier")}get type(){return c(this,Er)}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),i=de(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=r.includes(s);return c(this,gt)&&o||!c(this,gt)&&(l||e==="")||(re.running||this.length>1)&&(o||l||e==="")?(this.setAttribute("modifier",e),b(this,gt,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}getModule(){var e;if(this.type!=="magic-word"||this.name!=="invoke")throw new Error("TranscludeToken.getModule method is only for modules!");return[A(this,Ze,pn).call(this).title,(e=this.childNodes[2])==null?void 0:e.toString(!0).trim()]}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(b(this,Gt,A(this,Ze,pn).call(this)),this.setAttribute("name",c(this,Gt).title))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(e)+(this.length===1?"":":")+this.childNodes.slice(1).map(t=>t.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?r.text()+(t===1?"":":")+ye(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return c(this,Gt);default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);if(!this.isTemplate())return r;let{type:i,childNodes:s,length:o}=this,l=new j(this,e),u=i==="magic-word";if(u&&!A(this,Ze,pn).call(this).valid)r.push(I(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[u?1:0],g=d.childNodes.findIndex(h=>h.type==="text"&&it(h.data).includes("#")),f=d.childNodes[g];if(f){let h=I(d,l,"no-ignored","useless fragment");h.fix={range:[h.startIndex+d.getRelativeIndex(g)+f.data.indexOf("#"),h.endIndex],text:"",desc:"remove"},r.push(h)}}if(u&&o===2)return r.push(P(this,l,"invalid-invoke","missing module function")),r;let p=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));if(p.length>0)for(let[,d]of p)r.push(...d.map(g=>{let f=I(g,l,"no-duplicate","duplicated parameter");return f.suggestions=[{desc:"remove",range:[f.startIndex-1,f.endIndex],text:""}],f}));return r}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?A(this,Ze,As).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(zt("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,r=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return c(this,ut).has(i)?s=c(this,ut).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),c(this,ut).set(i,s)),s}getDuplicatedArgs(){return[...c(this,ut)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:r}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}let s=r.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;o<s.length;){let{length:l,0:u}=s[o].childNodes.filter(p=>p.text().trim());if(l===0)s.splice(o,1);else if(l>1||u.type!=="magic-word")o++;else try{let p=u.getPossibleValues();s.splice(o,1,...p),o+=p.length}catch(p){o++}}return s}print(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s}=this;return`<span class="wpb-${s}">{{${wt(i)}${s==="magic-word"?r.print()+(t===1?"":":")+qe(e.slice(1),{sep:"|"}):qe(e,{sep:"|"})}}}</span>`}};Er=new WeakMap,gt=new WeakMap,ut=new WeakMap,Gt=new WeakMap,Ze=new WeakSet,pn=function(){let e=this.type==="template";return this.normalizeTitle(this.childNodes[e?0:1].toString(!0),e?10:828,!0)},As=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let i=r?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:o}=s,l=String(i+1);(o!==l||s===e)&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}}});var ws,ri,_a,pt,Cs=k(()=>{"use strict";st();q();ws=[ve()];pt=class extends(_a=S){get type(){return"hidden"}};ri=oe(_a),pt=le(ri,0,"HiddenToken",ws,pt),ae(ri,1,pt)});var mn,$s,cn,Is=k(()=>{"use strict";Y();D();ee();q();_e();Cs();cn=class extends S{constructor(e,t,r=[]){super(void 0,t,r,{});T(this,mn);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let o=new V(s,"arg-name",t,r,{});super.insertAt(o)}else if(i>1){let o=new pt(s,t,r);super.insertAt(o)}else{let o=new S(s,t,r);o.type="arg-default",o.setAttribute("stage",2),super.insertAt(o)}}}get type(){return"arg"}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${ye(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}afterBuild(){A(this,mn,$s).call(this),super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[r,i,...s]}=this;if(!this.getAttribute("include")){let l=P(this,{start:e},"no-arg","unexpected template argument");return i&&(l.suggestions=[{range:[e,l.endIndex],text:i.text(),desc:"expand"}]),[l]}r.setAttribute("aIndex",e+3);let o=r.lint(e+3,t);if(i){let l=e+4+r.toString().length;i.setAttribute("aIndex",l),o.push(...i.lint(l,t))}if(s.length>0){let l=new j(this,e);o.push(...s.map(u=>{let p=I(u,l,"no-ignored","invisible content inside triple braces");return p.startIndex--,p.startCol--,p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"escape",range:[p.startIndex,p.startIndex+1],text:"{{!}}"}],p}))}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.default=this.default,r}};mn=new WeakSet,$s=function(){this.setAttribute("name",this.firstChild.toString(!0).trim())}});var Fs={};se(Fs,{parseBraces:()=>Lr});var Oa,Ns,Es,Ls,Lr,hn=k(()=>{"use strict";Y();ti();Ss();Is();Oa={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ns=String.raw`|\{{2,}`,Es=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Ls=a=>{let n=de(a).trim().toLowerCase();return Es.has(n)?Es.get(n):/^(?:filepath|(?:full|canonical)urle?):./u.test(n)?"m":/^#vardefine:./u.test(n)?"n":"t"},Lr=(a,n,e)=>{var f,h,m,x,y,w;let t=String.raw`${(f=n.excludes)!=null&&f.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=n,i=[],s=[],o=C=>C.replace(/\0(\d+)\x7F/gu,($,L)=>s[L]);a=a.replace(/\{\{([^\n{}[]*)\}\}(?!\})|\[\[[^\n[\]{]*\]\]/gu,(C,$)=>{if($!==void 0)try{let{length:L}=e,O=$.split("|");return new Nr(O[0],O.slice(1).map(M=>{let F=M.indexOf("=");return F===-1?[M]:[M.slice(0,F),M.slice(F+1)]}),n,e),`\0${L}${Ls(O[0])}\x7F`}catch(L){if(!(L instanceof SyntaxError)||L.message!=="Invalid template name")throw L}return s.push(C),`\0${s.length-1}\x7F`});let l=a.lastIndexOf("}}")-a.length,u=l+a.length!==-1,p=new RegExp(t+(u?Ns:""),"gmu"),d=p.exec(a),g;for(;d||g!==void 0&&g<=a.length&&((m=(h=i[i.length-1])==null?void 0:h[0])!=null&&m.startsWith("="));){if(d!=null&&d[1]){let[,{length:_}]=d;d[0]=d[0].slice(_),d.index+=_}let{0:C,index:$}=d!=null?d:{0:`
|
|
7
|
-
`,index:a.length},L=(x=i.pop())!=null?x:{},{0:
|
|
8
|
-
`){
|
|
9
|
-
)`:""}(\s*)$`,"u");return[p,d,
|
|
10
|
-
`))!=null?i:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new
|
|
5
|
+
`)}getGaps(){return 1}lint(n=this.getAbsoluteIndex()){let e=new j(this,n),t=S.msg("invalid parameter of <$1>",this.name),r=[];for(let i of this.childNodes){i.setAttribute("aIndex",n);let s=i.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(s.some(({type:o})=>o==="ext"))r.push(N(i,e,"no-ignored",t));else{let o=s.findIndex(({type:g})=>g!=="text"),l=s.slice(0,o===-1?void 0:o).map(String).join("");if(l&&!(o===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(l)){let g=N(i,e,"no-ignored",t);g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""}],r.push(g)}else r.push(...i.lint(n,!1))}n+=i.toString().length+1}return r}print(){return super.print({sep:`
|
|
6
|
+
`})}}});var Nr,Ut,un,zt,ri=v(()=>{"use strict";W();ke();ne();H();O();jt();zt=class extends w{constructor(e,t,r,i=[]){super(void 0,r,i);y(this,Ut);y(this,Nr);T(this,Nr,e);let s=new w(t[0],r,i);s.type="heading-title",s.setAttribute("stage",2);let o=new Ae(t[1],/^\s*$/u,"heading-trail",r,i,{});this.append(s,o)}get type(){return"heading"}get level(){return c(this,Nr)}toString(e){let t=A(this,Ut,un).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=A(this,Ut,un).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=o.startsWith("="),g=l||o.endsWith("="),p=i.childNodes.filter(Gt("quote")),d=p.filter(({bold:f})=>f),u=p.filter(({italic:f})=>f),m=new j(this,e);if(this.level===1){let f=N(i,m,"h1","<h1>");g||(f.suggestions=[{desc:"h2",range:[f.startIndex,f.endIndex],text:`=${o}=`}]),r.push(f)}if(g){let f=N(i,m,"unbalanced-header",S.msg("unbalanced $1 in a section header",'"="'));if(o!=="=")if(l){let[x]=/^=+/u.exec(o);f.suggestions=[{desc:`h${s}`,range:[f.startIndex,f.startIndex+x.length],text:""},{desc:`h${s+x.length}`,range:[f.endIndex,f.endIndex],text:x}]}else{let x=/[^=](=+)$/u.exec(o)[1];f.suggestions=[{desc:`h${s}`,range:[f.endIndex-x.length,f.endIndex],text:""},{desc:`h${s+x.length}`,range:[f.startIndex,f.startIndex],text:x}]}r.push(f)}this.closest("html-attrs,table-attrs")&&r.push(P(this,m,"parsing-order","section header in an HTML tag"));let h=this.getRootNode().toString();if(d.length%2){let f=N(d[d.length-1],{...m,start:e+s,left:m.left+s},"format-leakage",S.msg("unbalanced $1 in a section header","bold apostrophes")),x=e+s+o.length;h.slice(f.endIndex,x).trim()?f.suggestions=[{desc:"close",range:[x,x],text:"'''"}]:f.fix={desc:"remove",range:[f.startIndex,f.endIndex],text:""},r.push(f)}if(u.length%2){let f=N(u[u.length-1],{start:e+s},"format-leakage",S.msg("unbalanced $1 in a section header","italic apostrophes")),x=e+s+o.length;f.fix=h.slice(f.endIndex,x).trim()?{desc:"close",range:[x,x],text:"''"}:{desc:"remove",range:[f.startIndex,f.endIndex],text:""},r.push(f)}return r}print(){let e=A(this,Ut,un).call(this);return super.print({pre:e,sep:e})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.level=this.level,r}};Nr=new WeakMap,Ut=new WeakSet,un=function(){return"=".repeat(this.level)}});var Da,pn,Ss=v(()=>{"use strict";Z();W();H();O();Da=new RegExp(`https?://${je}${Be}$`,"iu"),pn=class extends w{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var n;try{return!!((n=this.parentNode)!=null&&n.getDuplicatedArgs().some(([e])=>e===this.name))}catch(e){return!1}}constructor(n,e,t=S.getConfig(),r=[]){super(void 0,t,r);let i=new w(typeof n=="number"?void 0:n,t,r,{}),s=new w(e,t,r);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(n,e=!0){let t=(typeof n=="string"?n:n.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",t),t}afterBuild(){if(!this.anon){let{parentNode:n,firstChild:e}=this,t=this.trimName(e);n&&n.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(n){return this.anon?this.lastChild.toString(n):super.toString(n,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(n=this.getAbsoluteIndex(),e){var s;let t=super.lint(n,e),{firstChild:r}=this,i=(s=Da.exec(r.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=N(r,{start:n},"unescaped","unescaped query string in an anonymous parameter");o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,o.fix={range:[o.startIndex,o.endIndex],text:"{{=}}",desc:"escape"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{anon:this.anon,duplicated:this.duplicated}),t}}});var Er,gt,ut,Vt,Ze,cn,ws,Lr,Cs=v(()=>{"use strict";Z();W();ke();ne();O();Ss();_e();jt();Lr=class extends w{constructor(e,t,r,i=[]){var f,x;let s,o=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);o&&(s=Number(o[1]),e=e.replace(`\0${s}h\x7F`,i[s].toString().replace(/^\n/u,"")));super(void 0,r,i,{});y(this,Ze);re(this,"modifier","");y(this,Er,"template");y(this,gt,!1);y(this,ut,new Map);y(this,Vt);let{parserFunction:[l,g],variable:p}=r,d=(f=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:f[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[b,...k]=e.split(":"),[C]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((x=k[0])!=null?x:"");this.setModifier(`${b}:${C}`)&&(e=k.join(":").slice(C.length))}let u=e.includes(":");if(u||t.length===0&&!c(this,gt)){let b=e.indexOf(":"),k=b===-1?e:e.slice(0,b),C=b===-1?void 0:e.slice(b+1),$=ue(k),L=$[C===void 0?"trim":"trimStart"](),M=L.toLowerCase(),D=Array.isArray(g),F=D?g.includes(L):Object.prototype.hasOwnProperty.call(g,L),V=!D&&F?g[L]:Object.prototype.hasOwnProperty.call(l,M)&&l[M];if(D&&F||p.includes(V)||u&&V){this.setAttribute("name",V||M.replace(/^#/u,"")),T(this,Er,"magic-word");let me=new RegExp(String.raw`^\s*${L}\s*$`,F?"u":"iu"),E=new Ae(k,me,"magic-word-name",r,i,{});if(super.insertAt(E),C!==void 0&&t.unshift([C]),this.name==="invoke")for(let B=0;B<2;B++){let q=t.shift();if(!q)break;let I=new G(q.join("="),`invoke-${B?"function":"module"}`,r,i);super.insertAt(I)}}}if(this.type==="template"){let b=ue(e).trim();if(!this.normalizeTitle(b,10,!0,!0).valid)throw i.pop(),new SyntaxError("Invalid template name");let k=new G(e,"template-name",r,i,{});super.insertAt(k)}typeof s=="number"&&(i[s]=void 0);let m=this.isTemplate(),h=1;for(let b=0;b<t.length;b++){let k=t[b];m||this.name==="switch"&&b>0||this.name==="tag"&&b>1||(k[0]=k.join("="),k.length=1),k.length===1&&(k.unshift(h),h++),this.insertAt(new pn(...k,r,i))}this.seal("modifier")}get type(){return c(this,Er)}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),i=ue(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=r.includes(s);return c(this,gt)&&o||!c(this,gt)&&(l||e==="")||(ie.running||this.length>1)&&(o||l||e==="")?(this.setAttribute("modifier",e),T(this,gt,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}getModule(){var e;if(this.type!=="magic-word"||this.name!=="invoke")throw new Error("TranscludeToken.getModule method is only for modules!");return[A(this,Ze,cn).call(this).title,(e=this.childNodes[2])==null?void 0:e.toString(!0).trim()]}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(T(this,Vt,A(this,Ze,cn).call(this)),this.setAttribute("name",c(this,Vt).title))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(e)+(this.length===1?"":":")+this.childNodes.slice(1).map(t=>t.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?r.text()+(t===1?"":":")+ye(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return c(this,Vt);default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);if(!this.isTemplate())return r;let{type:i,childNodes:s,length:o}=this,l=new j(this,e),g=i==="magic-word";if(g&&!A(this,Ze,cn).call(this).valid)r.push(N(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[g?1:0],u=d.childNodes.findIndex(h=>h.type==="text"&&it(h.data).includes("#")),m=d.childNodes[u];if(m){let h=N(d,l,"no-ignored","useless fragment");h.fix={range:[h.startIndex+d.getRelativeIndex(u)+m.data.indexOf("#"),h.endIndex],text:"",desc:"remove"},r.push(h)}}if(g&&o===2)return r.push(P(this,l,"invalid-invoke","missing module function")),r;let p=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));if(p.length>0)for(let[,d]of p)r.push(...d.map(u=>{let m=N(u,l,"no-duplicate","duplicated parameter");return m.suggestions=[{desc:"remove",range:[m.startIndex-1,m.endIndex],text:""}],m}));return r}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?A(this,Ze,ws).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(Gt("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,r=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return c(this,ut).has(i)?s=c(this,ut).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),c(this,ut).set(i,s)),s}getDuplicatedArgs(){return[...c(this,ut)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:r}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}let s=r.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;o<s.length;){let{length:l,0:g}=s[o].childNodes.filter(p=>p.text().trim());if(l===0)s.splice(o,1);else if(l>1||g.type!=="magic-word")o++;else try{let p=g.getPossibleValues();s.splice(o,1,...p),o+=p.length}catch(p){o++}}return s}print(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s}=this;return`<span class="wpb-${s}">{{${Ct(i)}${s==="magic-word"?r.print()+(t===1?"":":")+qe(e.slice(1),{sep:"|"}):qe(e,{sep:"|"})}}}</span>`}};Er=new WeakMap,gt=new WeakMap,ut=new WeakMap,Vt=new WeakMap,Ze=new WeakSet,cn=function(){let e=this.type==="template";return this.normalizeTitle(this.childNodes[e?0:1].toString(!0),e?10:828,!0)},ws=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let i=r?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:o}=s,l=String(i+1);(o!==l||s===e)&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}}});var $s,ni,Wa,pt,Is=v(()=>{"use strict";st();O();$s=[ve()];pt=class extends(Wa=w){get type(){return"hidden"}};ni=le(Wa),pt=ge(ni,0,"HiddenToken",$s,pt),de(ni,1,pt)});var hn,Ns,mn,Ls=v(()=>{"use strict";Z();W();ne();O();_e();Is();mn=class extends w{constructor(e,t,r=[]){super(void 0,t,r,{});y(this,hn);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let o=new G(s,"arg-name",t,r,{});super.insertAt(o)}else if(i>1){let o=new pt(s,t,r);super.insertAt(o)}else{let o=new w(s,t,r);o.type="arg-default",o.setAttribute("stage",2),super.insertAt(o)}}}get type(){return"arg"}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${ye(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}afterBuild(){A(this,hn,Ns).call(this),super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[r,i,...s]}=this;if(!this.getAttribute("include")){let l=P(this,{start:e},"no-arg","unexpected template argument");return i&&(l.suggestions=[{range:[e,l.endIndex],text:i.text(),desc:"expand"}]),[l]}r.setAttribute("aIndex",e+3);let o=r.lint(e+3,t);if(i){let l=e+4+r.toString().length;i.setAttribute("aIndex",l),o.push(...i.lint(l,t))}if(s.length>0){let l=new j(this,e);o.push(...s.map(g=>{let p=N(g,l,"no-ignored","invisible content inside triple braces");return p.startIndex--,p.startCol--,p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"escape",range:[p.startIndex,p.startIndex+1],text:"{{!}}"}],p}))}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.default=this.default,r}};hn=new WeakSet,Ns=function(){this.setAttribute("name",this.firstChild.toString(!0).trim())}});var Rs={};ae(Rs,{parseBraces:()=>Fr});var Ha,Es,Fs,Ps,Fr,fn=v(()=>{"use strict";Z();ri();Cs();Ls();Ha={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Es=String.raw`|\{{2,}`,Fs=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Ps=a=>{let n=ue(a).trim().toLowerCase();return Fs.has(n)?Fs.get(n):/^(?:filepath|(?:full|canonical)urle?):./u.test(n)?"m":/^#vardefine:./u.test(n)?"n":"t"},Fr=(a,n,e)=>{var m,h,f,x,b,k;let t=String.raw`${(m=n.excludes)!=null&&m.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=n,i=[],s=[],o=C=>C.replace(/\0(\d+)\x7F/gu,($,L)=>s[L]);a=a.replace(/\{\{([^\n{}[]*)\}\}(?!\})|\[\[[^\n[\]{]*\]\]/gu,(C,$)=>{if($!==void 0)try{let{length:L}=e,M=$.split("|");return new Lr(M[0],M.slice(1).map(D=>{let F=D.indexOf("=");return F===-1?[D]:[D.slice(0,F),D.slice(F+1)]}),n,e),`\0${L}${Ps(M[0])}\x7F`}catch(L){if(!(L instanceof SyntaxError)||L.message!=="Invalid template name")throw L}return s.push(C),`\0${s.length-1}\x7F`});let l=a.lastIndexOf("}}")-a.length,g=l+a.length!==-1,p=new RegExp(t+(g?Es:""),"gmu"),d=p.exec(a),u;for(;d||u!==void 0&&u<=a.length&&((f=(h=i[i.length-1])==null?void 0:h[0])!=null&&f.startsWith("="));){if(d!=null&&d[1]){let[,{length:q}]=d;d[0]=d[0].slice(q),d.index+=q}let{0:C,index:$}=d!=null?d:{0:`
|
|
7
|
+
`,index:a.length},L=(x=i.pop())!=null?x:{},{0:M,index:D,parts:F,findEqual:V,pos:K}=L,me=C==="="&&V,E=q=>{F[F.length-1].push(o(q.slice(K,$)))};if(C==="]]"||C==="}-")u=$+2;else if(C===`
|
|
8
|
+
`){u=$+1;let{pos:q,findEqual:I}=(b=i[i.length-1])!=null?b:{};if(q===void 0||I||ue(a.slice(q,D))!==""){let Q=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(a.slice(D,$));Q&&(a=`${a.slice(0,D)}\0${e.length}h\x7F${a.slice($)}`,u=D+4+String(e.length).length,Q[2]=o(Q[2]),new zt(Q[1].length,Q.slice(2),n,e))}}else if(C==="|"||me)u=$+1,E(a),C==="|"&&F.push([]),L.pos=u,L.findEqual=C==="|",i.push(L);else if(C.startsWith("}}")){let q=C.slice(0,Math.min(M.length,3)),I=M.length-q.length,{length:Q}=e;u=$+q.length,E(a);let xe=!1,R="t";if(q.length===3){let te=F.map(kt=>kt.join("=")),se=te.length>1&&ue(te[1]).trim();new mn(te,n,e),se&&se.endsWith(":")&&r.includes(se.slice(0,-1).toLowerCase())&&(R="s")}else try{new Lr(F[0][0],F.slice(1),n,e),R=Ps(F[0][0])}catch(te){if(te instanceof SyntaxError&&te.message==="Invalid template name")xe=!0;else throw te}xe||(a=`${a.slice(0,D+I)}\0${Q}${R}\x7F${a.slice(u)}`,u=D+I+3+String(Q).length,I>1?i.push({0:M.slice(0,I),index:D,pos:D+I,parts:[[]]}):I===1&&a[D-1]==="-"&&i.push({0:"-{",index:D-1,pos:D+1,parts:[[]]}))}else u=$+C.length,C.startsWith("{")&&(d.pos=u,d.parts=[[]]),i.push(..."0"in L?[L]:[],d);let B=i[i.length-1];if(g&&l+a.length<u)for(g=!1;(k=B==null?void 0:B[0])!=null&&k.startsWith("{");)i.pop(),B=i[i.length-1];p=new RegExp(t+(g?Es:"")+(B?`|${Ha[B[0][0]]}${B.findEqual?"|=":""}`:""),"gmu"),p.lastIndex=u,d=p.exec(a)}return o(a)}});var xn,js=v(()=>{"use strict";Ir();fn();H();ti();xn=class extends Ht{constructor(n,e,t=S.getConfig(),r=[]){let i=Symbol("InputboxToken"),{length:s}=r;r.push(i),e&&(e=dt(e,t,r,n)),e&&(e=Fr(e,t,r)),r.splice(s,1),super(n,e,t,r,{})}}});function Bs(a,n,e,t,r){n=n.trim();let i=n.replace(a==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(a){case"width":return!i&&!!n||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(!i)return n;let s=new RegExp(String.raw`^(?:${e.protocol}|//|\0\d+m\x7F)`,"iu"),o=new RegExp(String.raw`^(?:(?:${e.protocol}|//)${je}|\0\d+m\x7F)${Be}$`,"iu");if(s.test(i))return o.test(i)&&n;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2));let l=S.normalizeTitle(i,0,!1,e,!1,t,!0,!0);return l.valid&&l}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var Ua,he,Tn,qs,bn,_s=v(()=>{"use strict";Z();W();H();O();Ua=new Set(["alt","link","lang","page","caption"]);bn=class extends w{constructor(e,t,r,i){var n=(...wu)=>(super(...wu),y(this,Tn),y(this,he,""),this);var g;let s,o=Object.entries(r.img).map(([p,d])=>{let u=new RegExp(String.raw`^(\s*(?!\s))${p.replace("$1","(.*)")}${p.endsWith("$1")?`(?=$|
|
|
9
|
+
)`:""}(\s*)$`,"u");return[p,d,u]}),l=o.find(([,p,d])=>(s=d.exec(e),s&&(s.length!==4||Bs(p,s[2],r,!0,t)!==!1)));if(l&&s){s.length===3?(n(void 0,r,i),T(this,he,e)):(n(s[2],r,i,{}),T(this,he,s[1]+l[0]+s[3])),this.setAttribute("name",l[1]);return}n(e,{...r,excludes:[...(g=r.excludes)!=null?g:[],"list"]},i),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Bs("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Ua.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return c(this,he)?c(this,he).replace("$1",super.toString(e)):super.toString(e)}text(){return c(this,he)?c(this,he).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,c(this,he).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{link:i,name:s}=this;if(s==="invalid"){let o=P(this,{start:e},"invalid-gallery","invalid image parameter");o.fix={range:[e-1,o.endIndex],text:"",desc:"remove"},r.push(o)}else if(typeof i=="object"&&i.encoded){let o=P(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link");o.suggestions=[{desc:"decode",range:[e,o.endIndex],text:Ge(this.text())}],r.push(o)}return r}getValue(){return this.name==="invalid"?this.text():A(this,Tn,qs).call(this)||super.text()}print(){return c(this,he)?`<span class="wpb-image-parameter">${c(this,he).replace("$1",`<span class="wpb-image-caption">${qe(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};he=new WeakMap,Tn=new WeakSet,qs=function(){return c(this,he)&&!c(this,he).includes("$1")}});var Os,Ms,Ds,za,Qt,ii=v(()=>{"use strict";Z();W();ne();H();wr();_s();Os=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Ms=new Set(["left","right","center","none"]),Ds=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),za=(a,n,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[a,n,e].map(Qi).join("|")}`,"gu"),i=[],s=r.exec(t),o=0,l=0;for(;s;){let{0:g,index:p}=s;g!==e?o+=g===a?1:-1:o===0&&(i.push(t.slice(l,p)),{lastIndex:l}=r),s=r.exec(t)}return i.push(t.slice(l)),i},Qt=class extends Fe{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(n,e,t=S.getConfig(),r=[],i="|"){super(n,void 0,t,r,i);let{extension:s}=this.getTitle(!0,!0);this.append(...za("-{","}-","|",e).map(o=>new bn(o,s,t,r)))}lint(n=this.getAbsoluteIndex(),e){var m;let t=super.lint(n,e),r=this.getAllArgs().filter(({childNodes:h})=>{let f=h.filter(x=>x.text().trim());return f.length!==1||f[0].type!=="arg"}),i=[...new Set(r.map(({name:h})=>h))],s=i.filter(h=>Os.has(h)),o=i.filter(h=>Ms.has(h)),l=i.filter(h=>Ds.has(h)),[g]=s,p=g==="framed"||g==="manualthumb",d=new j(this,n);if(this.closest("ext-link-text")&&((m=this.getValue("link"))==null?void 0:m.trim())!==""&&t.push(P(this,d,"nested-link","internal link in an external link")),p)for(let h of r.filter(({name:f})=>f==="width")){let f=N(h,d,"invalid-gallery","invalid image parameter");f.fix={range:[f.startIndex-1,f.endIndex],text:"",desc:"remove"},t.push(f)}if(r.length===i.length&&s.length<2&&o.length<2&&l.length<2)return t;let u=(h,f)=>x=>{let b=N(x,d,"no-duplicate",S.msg(`${h} image $1 parameter`,f));return b.suggestions=[{desc:"remove",range:[b.startIndex-1,b.endIndex],text:""}],b};for(let h of i){if(h==="invalid"||h==="width"&&p)continue;let f=r.filter(({name:x})=>x===h);h==="caption"&&(f=[...f.slice(0,-1).filter(x=>x.text()),...f.slice(-1)]),f.length>1&&t.push(...f.map(u("duplicated",h)))}return s.length>1&&t.push(...r.filter(({name:h})=>Os.has(h)).map(u("conflicting","frame"))),o.length>1&&t.push(...r.filter(({name:h})=>Ms.has(h)).map(u("conflicting","horizontal-alignment"))),l.length>1&&t.push(...r.filter(({name:h})=>Ds.has(h)).map(u("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(n){return this.getAllArgs().filter(({name:e})=>n===e)}getArg(n){let e=this.getArgs(n);return e[n==="manualthumb"?0:e.length-1]}getValue(n){var e;return(e=this.getArg(n))==null?void 0:e.getValue()}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{extension:r}=this;return r&&(t.extension=r),t}}});var Xt,si=v(()=>{"use strict";W();H();O();ii();Xt=class extends Qt{constructor(e,t,r,i=S.getConfig(),s=[]){let o;if(r!==void 0){let{length:l}=s;o=new w(r,i,s);for(let g=1;g<11;g++)o.parseOnce();s.splice(l,1)}super(t,o==null?void 0:o.toString(),i,s);re(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${e}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(e){let t=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),t?0:6,e,!0,!t)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{ns:i}=this.getAttribute("title");if(i!==6){let s=P(this,{start:e},"invalid-gallery","invalid gallery image");s.suggestions=[{desc:"prefix",range:[e,e],text:"File:"}],r.push(s)}return r}}});var ct,Ws,oi,yn,Hs=v(()=>{"use strict";H();O();si();Xe();yn=class extends w{constructor(e,t=S.getConfig(),r=[]){var i;super(void 0,t,r,{});y(this,ct);for(let s of(i=e==null?void 0:e.split(`
|
|
10
|
+
`))!=null?i:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new J(s,t,r):s);continue}let[,l,g]=o;A(this,ct,Ws).call(this,l)?super.insertAt(new Xt("gallery",l,g,t,r)):super.insertAt(new J(s,t,r))}}get type(){return"ext-inner"}get widths(){return A(this,ct,oi).call(this,"widths")}get heights(){return A(this,ct,oi).call(this,"heights")}toString(e){return super.toString(e,`
|
|
11
11
|
`)}text(){return super.text(`
|
|
12
12
|
`).replace(/\n\s*\n/gu,`
|
|
13
|
-
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:r,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let o=0;o<this.length;o++){let l=this.childNodes[o],
|
|
14
|
-
`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{widths:this.widths,heights:this.heights}),r}};ct=new WeakSet,
|
|
15
|
-
`),i=new Set(e.protocol.split("|")),s=
|
|
13
|
+
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:r,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let o=0;o<this.length;o++){let l=this.childNodes[o],g=l.toString(),{length:p}=g,d=g.trim(),{type:u}=l,m=r+o,h=o?0:i;if(l.setAttribute("aIndex",e),u==="noinclude"&&d&&!/^<!--.*-->$/u.test(d)){let f=e+p;s.push({rule:"no-ignored",message:S.msg("invalid content in <$1>","gallery"),severity:d.startsWith("|")?"warning":"error",startIndex:e,endIndex:f,startLine:m,endLine:m,startCol:h,endCol:h+p,suggestions:[{desc:"remove",range:[e,f],text:""},{desc:"comment",range:[e,f],text:`<!--${g}-->`}]})}else u!=="noinclude"&&u!=="text"&&s.push(...l.lint(e,t));e+=p+1}return s}print(){return super.print({sep:`
|
|
14
|
+
`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{widths:this.widths,heights:this.heights}),r}};ct=new WeakSet,Ws=function(e){return this.normalizeTitle(e,6,!0,!0,!0).valid},oi=function(e){var i,s;let t=(i=this.parentNode)==null?void 0:i.getAttr(e),r=typeof t=="string"&&((s=/^(\d+)\s*(?:px)?$/u.exec(t))==null?void 0:s[1]);return r&&Number(r)||120}});var Kt,ai=v(()=>{"use strict";W();wr();Kt=class extends Fe{get type(){return"link"}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e);return this.closest("ext-link-text")&&t.push(P(this,{start:n},"nested-link","internal link in an external link")),t}}});var Ga,Va,Pr,Oe,kn=v(()=>{"use strict";W();Z();ne();H();O();Ga=String.raw`(?:[${Ie}\t]| |�*160;|&#[xX]0*[aA]0;)`,Va=new RegExp(`${Ga}+`,"gu"),Oe=class extends w{constructor(e,t="free-ext-link",r=S.getConfig(),i){super(e,r,i,{});y(this,Pr);T(this,Pr,t)}get type(){return c(this,Pr)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=ye(this.childNodes.map(r=>{let{type:i}=r,s=String(r.name);return i==="magic-word"&&e.has(s)?e.get(s):r}));return this.type==="magic-link"&&(t=t.replace(Va," ")),t}get link(){let{innerText:e}=this;return this.type==="magic-link"?e.startsWith("ISBN")?`ISBN ${e.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:e:Xi(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new j(this,e),{type:s,childNodes:o}=this;if(s==="magic-link"){let{link:d}=this;if(d.startsWith("ISBN")){let u=[...d.slice(5)].map(m=>m==="X"?10:Number(m));(u.length===10&&u.reduce((m,h,f)=>m+h*(10-f),0)%11||u.length===13&&(u[12]===10||u.reduce((m,h,f)=>m+h*(f%2?3:1),0)%10))&&r.push(P(this,i,"invalid-isbn","invalid ISBN"))}return r}let l=s==="ext-link-url",g=l?/\|/u:/[,;。:!?()]+/u,p=o.find(d=>d.type==="text"&&g.test(d.data));if(p){let{data:d}=p,u=N(p,i,"unterminated-url",S.msg("$1 in URL",l?'"|"':"full-width punctuation"),"warning"),{index:m,0:h}=g.exec(d),f=u.startIndex+m;u.suggestions=l?[{desc:"whitespace",range:[f,f+1],text:" "}]:[{desc:"whitespace",range:[f,f],text:" "},{desc:"escape",range:[f,f+h.length],text:encodeURI(h)}],r.push(u)}return r}getUrl(e){{let{type:t}=this,{link:r}=this;if(t==="magic-link"){if(r.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${r.slice(5)}`,-1,!0).getUrl(e);r=r.startsWith("RFC")?`https://tools.ietf.org/html/rfc${r.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${r.slice(5)}`}else r.startsWith("//")&&(r=`https:${r}`);return new URL(r)}}};Pr=new WeakMap});var Me,Jt,li=v(()=>{"use strict";W();H();O();kn();Jt=class extends w{constructor(e,t="",r="",i=S.getConfig(),s=[]){super(void 0,i,s,{});y(this,Me);let o=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new Oe(e,"ext-link-url",i,s);if(this.insertAt(o),T(this,Me,t),r){let l=new w(r,i,s,{});l.type="ext-link-text",l.setAttribute("stage",10),this.insertAt(l)}}get type(){return"ext-link"}toString(e){return this.length===1?`[${super.toString(e)}${c(this,Me)}]`:`[${super.toString(e,c(this,Me))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return c(this,Me).length}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&r.push(P(this,{start:e},"var-anchor","variable anchor in a section header")),r}print(){return super.print(this.length===1?{pre:"[",post:`${c(this,Me)}]`}:{pre:"[",sep:c(this,Me),post:"]"})}};Me=new WeakMap});var Rr,Us=v(()=>{"use strict";O();Xe();ai();li();Rr=class extends w{get type(){return"imagemap-link"}constructor(n,e,t,r,i=[]){super(void 0,r,i),this.append(n,e.length===2?new Kt(...e,r,i):new Jt(...e,r,i),new J(t,r,i))}}});var vn,zs=v(()=>{"use strict";W();ke();ne();H();O();Xe();si();Us();vn=class extends w{get type(){return"ext-inner"}get image(){return this.childNodes.find(Gt("imagemap-image"))}constructor(n,e=S.getConfig(),t=[]){if(super(void 0,e,t,{}),!n)return;let r=n.split(`
|
|
15
|
+
`),i=new Set(e.protocol.split("|")),s=J,o=!0,l=!1;for(let g of r){let p=g.trim();if(!(l||!p||p.startsWith("#"))){if(o){let d=g.indexOf("|"),u=d===-1?g:g.slice(0,d),{valid:m,ns:h}=this.normalizeTitle(u,0,!0,!0);if(m&&h===6){let f=new Xt("imagemap",u,d===-1?void 0:g.slice(d+1),e,t);super.insertAt(f),o=!1;continue}else l=!0}else if(g.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let d=g.indexOf("["),u=g.slice(d),m=/^\[\[([^|]+)(?:\|([^\]]+))?\]\][\w\s]*$/u.exec(u);if(m){if(this.normalizeTitle(m[1],0,!0,!0,!1,!0).valid){super.insertAt(new Rr(g.slice(0,d),m.slice(1),u.slice(u.indexOf("]]")+2),e,t));continue}}else if(i.has(u.slice(1,u.indexOf(":")+1))||i.has(u.slice(1,u.indexOf("//")+2))){let h=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(h){super.insertAt(new Rr(g.slice(0,d),h.slice(1),u.slice(u.indexOf("]")+1),e,t));continue}}}}super.insertAt(new s(g,e,t))}}toString(n){return super.toString(n,`
|
|
16
16
|
`)}text(){return super.text(`
|
|
17
17
|
`).replace(/\n{2,}/gu,`
|
|
18
|
-
`)}getGaps(){return 1}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new j(this,n);return this.image?t.push(...this.childNodes.filter(i=>{let s=i.toString().trim();return i.type==="noinclude"&&s&&!s.startsWith("#")}).map(i=>{let s=
|
|
19
|
-
`})}}});var vn,Us=k(()=>{"use strict";D();W();Qe();vn=class extends ge{get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if((e==="templatestyles"||e==="section")&&t){let i=P(this,{start:n},"void-ext",v.msg("nothing should be in <$1>",e));return i.fix={range:[n,i.endIndex],text:"",desc:"empty"},[i]}let r=new RegExp(String.raw`<\s*(?:/\s*)${e==="nowiki"?"":"?"}(${e})\b`,"giu");return super.lint(n,r)}}});var An={};se(An,{NestedToken:()=>li});var Ua,Rr,Jt,li,Sn=k(()=>{"use strict";D();ee();$r();hn();W();q();di();Xe();Ua=new Set(["comment","include","arg","template","magic-word"]),li=class extends S{constructor(e,t,r,i,s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=dt(e,i,s,t)),e&&(e=Lr(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,u,p,d)=>{let g=`\0${s.length+1}e\x7F`;return new De(l,u,p,d,i,!1,s),g}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,u)=>(new K(u,i,s),`${l}\0${s.length}n\x7F`)));super(e,i,s);T(this,Rr);T(this,Jt);b(this,Rr,[...r]),b(this,Jt,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let r=new j(this,e),i=c(this,Jt)?"includeonly":"noinclude",s=typeof c(this,Jt)=="boolean"?new RegExp(String.raw`^(?:<${i}(?:\s[^>]*)?/?>|</${i}\s*>)$`,"iu"):/^<!--[\s\S]*-->$/u;return[...super.lint(e,t),...this.childNodes.filter(o=>{let{type:l,name:u}=o;if(l==="ext")return!c(this,Rr).includes(u);if(Ua.has(l))return!1;let p=o.toString().trim();return p&&!s.test(p)}).map(o=>{let l=I(o,r,"no-ignored",v.msg("invalid content in <$1>",this.name));return l.suggestions=[{desc:"remove",range:[l.startIndex,l.endIndex],text:""},{desc:"comment",range:[l.startIndex,l.endIndex],text:`<!--${o.toString()}-->`}],l})]}};Rr=new WeakMap,Jt=new WeakMap});var zs,Gs,gi,za,De,di=k(()=>{"use strict";D();ee();W();tn();q();Xn();ln();ks();ei();Ps();Ds();Hs();Us();zs=(a,n)=>{let e=new Set(a);return e.delete(n),[...e]};Gs=[_t()];De=class extends(za=qt){get type(){return"ext"}constructor(n,e,t,r,i=v.getConfig(),s=!1,o=[]){var g;let l=n.toLowerCase(),u=new Ye(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,o),p={...i,ext:zs(i.ext,l),excludes:[...(g=i.excludes)!=null?g:[]]},d;switch(p.inExt=!0,l){case"tab":p.ext=zs(p.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":l==="poem"&&p.excludes.push("heading"),d=new S(t,p,o);break;case"pre":d=new dn(t,p,o);break;case"dynamicpagelist":d=new Wt(s,t,p,o);break;case"inputbox":p.excludes.push("heading"),d=new fn(s,t,p,o);break;case"references":{let{NestedToken:f}=(Sn(),J(An));p.excludes.push("heading"),d=new f(t,s,["ref"],p,o);break}case"choose":{let{NestedToken:f}=(Sn(),J(An));d=new f(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],p,o);break}case"combobox":{let{NestedToken:f}=(Sn(),J(An));d=new f(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],p,o);break}case"gallery":d=new Tn(t,p,o);break;case"imagemap":d=new kn(t,p,o);break;default:d=new vn(t,p,o)}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(n,u,d,r,i,o),this.seal("closed",!0)}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new j(this,n);return this.name!=="nowiki"&&this.closest("html-attrs,table-attrs")&&t.push(P(this,r,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push(P(this,r,"var-anchor","variable anchor in a section header")),t}};gi=oe(za),De=le(gi,0,"ExtToken",Gs,De),ae(gi,1,De)});var Vs,ui,Ga,mt,Qs=k(()=>{"use strict";D();st();W();Qe();Vs=[ve(!1)];mt=class extends(Ga=ge){constructor(e,t,r,i){super(e,r,i);te(this,"closed");this.closed=t}get type(){return"comment"}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=P(this,{start:e},"unclosed-comment",v.msg("unclosed $1","HTML comment"));return t.suggestions=[{range:[t.endIndex,t.endIndex],text:"-->",desc:"close"}],[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};ui=oe(Ga),mt=le(ui,0,"CommentToken",Vs,mt),ae(ui,1,mt)});var Js={};se(Js,{parseCommentAndExt:()=>dt});var Ks,Va,pi,Qa,Xa,Ka,Xs,dt,$r=k(()=>{"use strict";ls();Xe();gs();di();Qs();Ks="<onlyinclude>",Va="</onlyinclude>",{length:pi}=Ks,Qa=new WeakMap,Xa=new WeakMap,Ka=(a,n)=>{let e=n?Qa:Xa;if(e.has(a))return e.get(a);let t=n?"includeonly":"(?:no|only)include",r=n?"noinclude":"includeonly",i=new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${a.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${r})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${r}\s*)>|$))`,"giu");return e.set(a,i),i},Xs=a=>{let n=a.indexOf(Ks);return{i:n,j:a.indexOf(Va,n+pi)}},dt=(a,n,e,t)=>{if(t){let{i:r,j:i}=Xs(a);if(r!==-1&&i!==-1){let s="",o=l=>{new K(l,n,e),s+=`\0${e.length-1}n\x7F`};for(;r!==-1&&i!==-1;){let l=`\0${e.length}e\x7F`;new en(a.slice(r+pi,i),n,e),r>0&&o(a.slice(0,r)),s+=l,a=a.slice(i+pi+1),{i:r,j:i}=Xs(a)}return a&&o(a),s}}return a.replace(Ka(n.ext,t),(r,i,s,o,l,u,p,d,g)=>{let f=e.length,h="n";if(i)h="e",new De(i,s,o,l,n,u,e);else if(r.startsWith("<!--")){h="c";let m=r.endsWith("-->");new mt(r.slice(4,m?-3:void 0),m,n,e)}else u?new lt(u,p,d,g,n,e):new K(r,n,e);return`\0${f}${h}\x7F`})}});var Ja,Ya,Za,Ys,Yt,Re,et,We,ci,el,ht,Zs=k(()=>{"use strict";D();ke();ee();tn();q();Ja=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Ya=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"]),Za=new Set(["strike","big","center","font","tt"]);Ys=[_t()];ht=class extends(el=S){constructor(e,t,r,i,s,o){super(void 0,s,o);T(this,Yt);T(this,Re);T(this,et);T(this,We);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),b(this,Yt,r),b(this,Re,i),b(this,et,e)}get type(){return"html"}get selfClosing(){return c(this,Re)}get closing(){return c(this,Yt)}toString(e){return`<${this.closing?"/":""}${c(this,et)}${super.toString(e)}${c(this,Re)?"/":""}>`}text(){let{closing:e}=this,t=c(this,et)+(e?"":super.text());return`<${e?"/":""}${t}${c(this,Re)?"/":""}>`}getAttribute(e){return e==="padding"?c(this,et).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{name:i,parentNode:s,closing:o,selfClosing:l}=this,u=new j(this,e);if(i==="h1"&&!o){let m=P(this,u,"h1","<h1>");m.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}],r.push(m)}if(this.closest("table-attrs")){let m=P(this,u,"parsing-order","HTML tag in table attributes");m.fix={desc:"remove",range:[e,m.endIndex],text:""},r.push(m)}Za.has(i)&&r.push(P(this,u,"obsolete-tag","obsolete HTML tag","warning")),(i==="b"||i==="strong")&&this.closest("heading-title")&&r.push(P(this,u,"bold-header","bold in section header","warning"));let{html:[,p,d]}=this.getAttribute("config"),g=d.includes(i),f=p.includes(i);if(o&&(l||g)||l&&(!g&&!f)){let m=P(this,u,"unmatched-tag",o?"tag that is both closing and self-closing":"invalid self-closing tag"),x={desc:"open",range:[e+1,e+2],text:""},y={desc:"no self-closing",range:[m.endIndex-2,m.endIndex-1],text:""};f?m.suggestions=[x,y]:o?m.fix=g?x:y:m.suggestions=[y,{desc:"close",range:[m.endIndex-2,m.endIndex],text:`></${i}>`}],r.push(m)}else if(!this.findMatchingTag()){let m=P(this,u,"unmatched-tag",o?"unmatched closing tag":"unclosed tag");if(o){let x=this.closest("magic-word");x&&Ja.has(x.name)?m.severity="warning":m.suggestions=[{desc:"remove",range:[e,m.endIndex],text:""}]}else{let x=s==null?void 0:s.childNodes;Ya.has(i)&&(x!=null&&x.slice(0,x.indexOf(this)).some(({type:y,name:w})=>y==="html"&&w===i))?m.suggestions=[{desc:"close",range:[e+1,e+1],text:"/"}]:this.closest("heading-title")||(m.severity="warning")}r.push(m)}return r}findMatchingTag(){return Ne(c(this,We),()=>{let{name:e,parentNode:t,closing:r,selfClosing:i}=this,{html:[,s,o]}=this.getAttribute("config"),l=o.includes(e),u=s.includes(e);if(l||u&&i)return this;if(!t)return;let{childNodes:p}=t,d=p.indexOf(this),g=r?p.slice(0,d).reverse():p.slice(d+1),f=[this],{rev:h}=re;for(let m of g)if(!(!m.is("html")||m.name!==e||u&&c(m,Re)))if(c(m,Yt)===r)f.push(m);else{let x=f.pop();if(x===this)return m;b(x,We,[h,m]),b(m,We,[h,x])}for(let m of f)b(m,We,[h,void 0])},e=>{b(this,We,e),e[1]&&e[1]!==this&&b(e[1],We,[re.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${c(this,et)}`,post:`${c(this,Re)?"/":""}>`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{closing:this.closing,selfClosing:c(this,Re)}),r}};ci=oe(el),Yt=new WeakMap,Re=new WeakMap,et=new WeakMap,We=new WeakMap,ht=le(ci,0,"HtmlToken",Ys,ht),ae(ci,1,ht)});var eo={};se(eo,{parseHtml:()=>rl});var tl,rl,to=k(()=>{"use strict";ln();Zs();tl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,rl=(a,n,e)=>{var s;let{html:t}=n;(s=n.htmlElements)!=null||(n.htmlElements=new Set([...t[0],...t[1],...t[2]]));let r=a.split("<"),i=r.shift();for(let o of r){let l=tl.exec(o),u=l==null?void 0:l[2],p=u==null?void 0:u.toLowerCase();if(!l||!n.htmlElements.has(p)){i+=`<${o}`;continue}let[,d,,g="",f,h]=l,{length:m}=e,x=new Ye(g,"html-attrs",p,n,e),y=x.getAttr("itemprop");if(p==="meta"&&(y===void 0||x.getAttr("content")===void 0)||p==="link"&&(y===void 0||x.getAttr("href")===void 0)){i+=`<${o}`,e.length=m;continue}i+=`\0${e.length}x\x7F${h}`,new ht(u,x,d==="/",f==="/>",n,e)}return i}});var Zt,mi=k(()=>{"use strict";tn();W();q();Rt();ln();Zt=class extends _t(1)(S){constructor(n,e,t,r,i=v.getConfig(),s=[],o){super(void 0,i,s,o),this.append(new Ae(e,n,"table-syntax",i,s,{}),new Ye(r,"table-attrs",t,i,s))}}});var Se,jr,Br,hi,er,fi=k(()=>{"use strict";D();ee();W();q();mi();er=class extends Zt{constructor(e,t,r=v.getConfig(),i=[]){var u;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),o=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(o)&&(s=null,o="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",o,r,i);T(this,Br);T(this,Se,"");T(this,jr);s&&([Vr(this,Se)._]=s);let l=new S(t==null?void 0:t.slice(((u=s==null?void 0:s.index)!=null?u:NaN)+c(this,Se).length),r,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 A(this,Br,hi).call(this).subtype}afterBuild(){c(this,Se).includes("\0")&&b(this,Se,this.buildFromStr(c(this,Se),0)),super.afterBuild()}toString(e){let{childNodes:[t,r,i]}=this;return t.toString(e)+r.toString(e)+c(this,Se)+i.toString(e)}text(){let{childNodes:[e,t,r]}=this;return e.text()+t.text()+c(this,Se)+r.text()}getGaps(e){return e===1?c(this,Se).length:0}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new j(this,e+this.getRelativeIndex(this.length-1));for(let s of this.lastChild.childNodes)if(s.type==="text"){let{data:o}=s;if(o.includes("|")){let l=o.includes("||"),u=I(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let p={caption:"|+",td:"|",th:"!"}[this.subtype];u.fix={range:[u.startIndex,u.endIndex],text:o.replace(/\|\|/gu,`
|
|
20
|
-
${p}`),desc:"newline"}}else
|
|
21
|
-
`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${c(this,Se)}${r.print()}</span>`}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{subtype:this.subtype,rowspan:this.rowspan,colspan:this.colspan}),r}};Se=new WeakMap,
|
|
22
|
-
|}`,e){let t=this.getAttribute("config"),r=this.getAttribute("accum"),i=e?[n]:
|
|
18
|
+
`)}getGaps(){return 1}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new j(this,n);return this.image?t.push(...this.childNodes.filter(i=>{let s=i.toString().trim();return i.type==="noinclude"&&s&&!s.startsWith("#")}).map(i=>{let s=N(i,r,"invalid-imagemap","invalid link in <imagemap>");return s.suggestions=[{desc:"remove",range:[s.startIndex-1,s.endIndex],text:""},{desc:"comment",range:[s.startIndex,s.startIndex],text:"# "}],s})):t.push(P(this,r,"invalid-imagemap","<imagemap> without an image")),t}print(){return super.print({sep:`
|
|
19
|
+
`})}}});var An,Gs=v(()=>{"use strict";W();H();Qe();An=class extends pe{get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if((e==="templatestyles"||e==="section")&&t){let i=P(this,{start:n},"void-ext",S.msg("nothing should be in <$1>",e));return i.fix={range:[n,i.endIndex],text:"",desc:"empty"},[i]}let r=new RegExp(String.raw`<\s*(?:/\s*)${e==="nowiki"?"":"?"}(${e})\b`,"giu");return super.lint(n,r)}}});var Sn={};ae(Sn,{NestedToken:()=>di});var Qa,jr,Yt,di,wn=v(()=>{"use strict";W();ne();Ir();fn();H();O();gi();Xe();Qa=new Set(["comment","include","arg","template","magic-word"]),di=class extends w{constructor(e,t,r,i,s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=dt(e,i,s,t)),e&&(e=Fr(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,g,p,d)=>{let u=`\0${s.length+1}e\x7F`;return new De(l,g,p,d,i,!1,s),u}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,g)=>(new J(g,i,s),`${l}\0${s.length}n\x7F`)));super(e,i,s);y(this,jr);y(this,Yt);T(this,jr,[...r]),T(this,Yt,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let r=new j(this,e),i=c(this,Yt)?"includeonly":"noinclude",s=typeof c(this,Yt)=="boolean"?new RegExp(String.raw`^(?:<${i}(?:\s[^>]*)?/?>|</${i}\s*>)$`,"iu"):/^<!--[\s\S]*-->$/u;return[...super.lint(e,t),...this.childNodes.filter(o=>{let{type:l,name:g}=o;if(l==="ext")return!c(this,jr).includes(g);if(Qa.has(l))return!1;let p=o.toString().trim();return p&&!s.test(p)}).map(o=>{let l=N(o,r,"no-ignored",S.msg("invalid content in <$1>",this.name));return l.suggestions=[{desc:"remove",range:[l.startIndex,l.endIndex],text:""},{desc:"comment",range:[l.startIndex,l.endIndex],text:`<!--${o.toString()}-->`}],l})]}};jr=new WeakMap,Yt=new WeakMap});var Vs,Qs,ui,Xa,De,gi=v(()=>{"use strict";W();ne();H();rn();O();Kn();dn();As();ti();js();Hs();zs();Gs();Vs=(a,n)=>{let e=new Set(a);return e.delete(n),[...e]};Qs=[Ot()];De=class extends(Xa=_t){get type(){return"ext"}constructor(n,e,t,r,i=S.getConfig(),s=!1,o=[]){var u;let l=n.toLowerCase(),g=new Ye(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,o),p={...i,ext:Vs(i.ext,l),excludes:[...(u=i.excludes)!=null?u:[]]},d;switch(p.inExt=!0,l){case"tab":p.ext=Vs(p.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":l==="poem"&&p.excludes.push("heading"),d=new w(t,p,o);break;case"pre":d=new gn(t,p,o);break;case"dynamicpagelist":d=new Ht(s,t,p,o);break;case"inputbox":p.excludes.push("heading"),d=new xn(s,t,p,o);break;case"references":{let{NestedToken:m}=(wn(),Y(Sn));p.excludes.push("heading"),d=new m(t,s,["ref"],p,o);break}case"choose":{let{NestedToken:m}=(wn(),Y(Sn));d=new m(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],p,o);break}case"combobox":{let{NestedToken:m}=(wn(),Y(Sn));d=new m(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],p,o);break}case"gallery":d=new yn(t,p,o);break;case"imagemap":d=new vn(t,p,o);break;default:d=new An(t,p,o)}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(n,g,d,r,i,o),this.seal("closed",!0)}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new j(this,n);return this.name!=="nowiki"&&this.closest("html-attrs,table-attrs")&&t.push(P(this,r,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push(P(this,r,"var-anchor","variable anchor in a section header")),t}};ui=le(Xa),De=ge(ui,0,"ExtToken",Qs,De),de(ui,1,De)});var Xs,pi,Ka,mt,Ks=v(()=>{"use strict";W();st();H();Qe();Xs=[ve(!1)];mt=class extends(Ka=pe){constructor(e,t,r,i){super(e,r,i);re(this,"closed");this.closed=t}get type(){return"comment"}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=P(this,{start:e},"unclosed-comment",S.msg("unclosed $1","HTML comment"));return t.suggestions=[{range:[t.endIndex,t.endIndex],text:"-->",desc:"close"}],[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};pi=le(Ka),mt=ge(pi,0,"CommentToken",Xs,mt),de(pi,1,mt)});var Zs={};ae(Zs,{parseCommentAndExt:()=>dt});var Ys,Ja,ci,Ya,Za,el,Js,dt,Ir=v(()=>{"use strict";gs();Xe();ps();gi();Ks();Ys="<onlyinclude>",Ja="</onlyinclude>",{length:ci}=Ys,Ya=new WeakMap,Za=new WeakMap,el=(a,n)=>{let e=n?Ya:Za;if(e.has(a))return e.get(a);let t=n?"includeonly":"(?:no|only)include",r=n?"noinclude":"includeonly",i=new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${a.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${r})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${r}\s*)>|$))`,"giu");return e.set(a,i),i},Js=a=>{let n=a.indexOf(Ys);return{i:n,j:a.indexOf(Ja,n+ci)}},dt=(a,n,e,t)=>{if(t){let{i:r,j:i}=Js(a);if(r!==-1&&i!==-1){let s="",o=l=>{new J(l,n,e),s+=`\0${e.length-1}n\x7F`};for(;r!==-1&&i!==-1;){let l=`\0${e.length}e\x7F`;new tn(a.slice(r+ci,i),n,e),r>0&&o(a.slice(0,r)),s+=l,a=a.slice(i+ci+1),{i:r,j:i}=Js(a)}return a&&o(a),s}}return a.replace(el(n.ext,t),(r,i,s,o,l,g,p,d,u)=>{let m=e.length,h="n";if(i)h="e",new De(i,s,o,l,n,g,e);else if(r.startsWith("<!--")){h="c";let f=r.endsWith("-->");new mt(r.slice(4,f?-3:void 0),f,n,e)}else g?new lt(g,p,d,u,n,e):new J(r,n,e);return`\0${m}${h}\x7F`})}});var tl,rl,nl,eo,Zt,Re,et,We,mi,il,ht,to=v(()=>{"use strict";W();ke();ne();rn();O();tl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),rl=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"]),nl=new Set(["strike","big","center","font","tt"]);eo=[Ot()];ht=class extends(il=w){constructor(e,t,r,i,s,o){super(void 0,s,o);y(this,Zt);y(this,Re);y(this,et);y(this,We);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),T(this,Zt,r),T(this,Re,i),T(this,et,e)}get type(){return"html"}get selfClosing(){return c(this,Re)}get closing(){return c(this,Zt)}toString(e){return`<${this.closing?"/":""}${c(this,et)}${super.toString(e)}${c(this,Re)?"/":""}>`}text(){let{closing:e}=this,t=c(this,et)+(e?"":super.text());return`<${e?"/":""}${t}${c(this,Re)?"/":""}>`}getAttribute(e){return e==="padding"?c(this,et).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{name:i,parentNode:s,closing:o,selfClosing:l}=this,g=new j(this,e);if(i==="h1"&&!o){let f=P(this,g,"h1","<h1>");f.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}],r.push(f)}if(this.closest("table-attrs")){let f=P(this,g,"parsing-order","HTML tag in table attributes");f.fix={desc:"remove",range:[e,f.endIndex],text:""},r.push(f)}nl.has(i)&&r.push(P(this,g,"obsolete-tag","obsolete HTML tag","warning")),(i==="b"||i==="strong")&&this.closest("heading-title")&&r.push(P(this,g,"bold-header","bold in section header","warning"));let{html:[,p,d]}=this.getAttribute("config"),u=d.includes(i),m=p.includes(i);if(o&&(l||u)||l&&(!u&&!m)){let f=P(this,g,"unmatched-tag",o?"tag that is both closing and self-closing":"invalid self-closing tag"),x={desc:"open",range:[e+1,e+2],text:""},b={desc:"no self-closing",range:[f.endIndex-2,f.endIndex-1],text:""};m?f.suggestions=[x,b]:o?f.fix=u?x:b:f.suggestions=[b,{desc:"close",range:[f.endIndex-2,f.endIndex],text:`></${i}>`}],r.push(f)}else if(!this.findMatchingTag()){let f=P(this,g,"unmatched-tag",o?"unmatched closing tag":"unclosed tag");if(o){let x=this.closest("magic-word");x&&tl.has(x.name)?f.severity="warning":f.suggestions=[{desc:"remove",range:[e,f.endIndex],text:""}]}else{let x=s==null?void 0:s.childNodes;rl.has(i)&&(x!=null&&x.slice(0,x.indexOf(this)).some(({type:b,name:k})=>b==="html"&&k===i))?f.suggestions=[{desc:"close",range:[e+1,e+1],text:"/"}]:this.closest("heading-title")||(f.severity="warning")}r.push(f)}return r}findMatchingTag(){return Ne(c(this,We),()=>{let{name:e,parentNode:t,closing:r,selfClosing:i}=this,{html:[,s,o]}=this.getAttribute("config"),l=o.includes(e),g=s.includes(e);if(l||g&&i)return this;if(!t)return;let{childNodes:p}=t,d=p.indexOf(this),u=r?p.slice(0,d).reverse():p.slice(d+1),m=[this],{rev:h}=ie;for(let f of u)if(!(!f.is("html")||f.name!==e||g&&c(f,Re)))if(c(f,Zt)===r)m.push(f);else{let x=m.pop();if(x===this)return f;T(x,We,[h,f]),T(f,We,[h,x])}for(let f of m)T(f,We,[h,void 0])},e=>{T(this,We,e),e[1]&&e[1]!==this&&T(e[1],We,[ie.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${c(this,et)}`,post:`${c(this,Re)?"/":""}>`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{closing:this.closing,selfClosing:c(this,Re)}),r}};mi=le(il),Zt=new WeakMap,Re=new WeakMap,et=new WeakMap,We=new WeakMap,ht=ge(mi,0,"HtmlToken",eo,ht),de(mi,1,ht)});var ro={};ae(ro,{parseHtml:()=>ol});var sl,ol,no=v(()=>{"use strict";dn();to();sl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,ol=(a,n,e)=>{var s;let{html:t}=n;(s=n.htmlElements)!=null||(n.htmlElements=new Set([...t[0],...t[1],...t[2]]));let r=a.split("<"),i=r.shift();for(let o of r){let l=sl.exec(o),g=l==null?void 0:l[2],p=g==null?void 0:g.toLowerCase();if(!l||!n.htmlElements.has(p)){i+=`<${o}`;continue}let[,d,,u="",m,h]=l,{length:f}=e,x=new Ye(u,"html-attrs",p,n,e),b=x.getAttr("itemprop");if(p==="meta"&&(b===void 0||x.getAttr("content")===void 0)||p==="link"&&(b===void 0||x.getAttr("href")===void 0)){i+=`<${o}`,e.length=f;continue}i+=`\0${e.length}x\x7F${h}`,new ht(g,x,d==="/",m==="/>",n,e)}return i}});var er,hi=v(()=>{"use strict";rn();H();O();jt();dn();er=class extends Ot(1)(w){constructor(n,e,t,r,i=S.getConfig(),s=[],o){super(void 0,i,s,o),this.append(new Ae(e,n,"table-syntax",i,s,{}),new Ye(r,"table-attrs",t,i,s))}}});var Se,Br,qr,fi,tr,xi=v(()=>{"use strict";W();ne();H();O();hi();tr=class extends er{constructor(e,t,r=S.getConfig(),i=[]){var g;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),o=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(o)&&(s=null,o="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",o,r,i);y(this,qr);y(this,Se,"");y(this,Br);s&&([Qr(this,Se)._]=s);let l=new w(t==null?void 0:t.slice(((g=s==null?void 0:s.index)!=null?g:NaN)+c(this,Se).length),r,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 A(this,qr,fi).call(this).subtype}afterBuild(){c(this,Se).includes("\0")&&T(this,Se,this.buildFromStr(c(this,Se),0)),super.afterBuild()}toString(e){let{childNodes:[t,r,i]}=this;return t.toString(e)+r.toString(e)+c(this,Se)+i.toString(e)}text(){let{childNodes:[e,t,r]}=this;return e.text()+t.text()+c(this,Se)+r.text()}getGaps(e){return e===1?c(this,Se).length:0}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new j(this,e+this.getRelativeIndex(this.length-1));for(let s of this.lastChild.childNodes)if(s.type==="text"){let{data:o}=s;if(o.includes("|")){let l=o.includes("||"),g=N(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let p={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix={range:[g.startIndex,g.endIndex],text:o.replace(/\|\|/gu,`
|
|
20
|
+
${p}`),desc:"newline"}}else g.suggestions=[{desc:"escape",range:[g.startIndex,g.endIndex],text:o.replace(/\|/gu,"|")}];r.push(g)}}return r}isIndependent(){return this.firstChild.text().startsWith(`
|
|
21
|
+
`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${c(this,Se)}${r.print()}</span>`}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{subtype:this.subtype,rowspan:this.rowspan,colspan:this.colspan}),r}};Se=new WeakMap,Br=new WeakMap,qr=new WeakSet,fi=function(){return Ne(c(this,Br),()=>{var o;let e=this.firstChild.text(),t=e.slice(-1),r="td";if(t==="!"?r="th":t==="+"&&(r="caption"),this.isIndependent())return{subtype:r};let{previousSibling:i}=this;return{...A(o=i,qr,fi).call(o)}},e=>{T(this,Br,e)})}});var rr,bi=v(()=>{"use strict";W();hi();xi();rr=class extends er{lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=this.childNodes.find(({type:l})=>l==="table-inter");if(!r)return t;let i=r.childNodes.find(l=>l.text().trim()),s=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u;if(!i||s.test(i.toString())||i.is("arg")&&s.test(i.default||""))return t;if(i.is("magic-word"))try{if(i.getPossibleValues().every(l=>s.test(l.text())))return t}catch(l){}let o=N(r,{start:n},"fostered-content","content to be moved out from the table");return o.severity=i.type==="template"?"warning":"error",o.startIndex++,o.startLine++,o.startCol=0,t.push(o),t}getRowCount(){return Number(this.childNodes.some(n=>n instanceof tr&&n.isIndependent()&&!n.firstChild.text().endsWith("+")))}}});var al,ll,dl,Ti,Cn,io=v(()=>{"use strict";W();ke();ne();H();bi();jt();al=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,ll=(a,n)=>new Array(a).fill(void 0).map((e,t)=>n(t)),dl=({type:a})=>a==="tr"||a==="table-syntax",Ti=class extends Array{},Cn=class extends rr{get type(){return"table"}get closed(){return this.lastChild.type==="table-syntax"}constructor(n,e,t,r){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,n,"table",e,t,r,{})}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new j(this,n);this.closed||t.push(N(this.firstChild,r,"unclosed-table",S.msg("unclosed $1","table")));let i=this.getLayout(),{length:s}=i;if(s>1){let o=1,l=1/0,g=0;for(;g<s;g++){let p=i[g],d=p.length;if(d<o)break;d<l&&(l=d);let u=p.indexOf(p[d-1])+1;if(u>l)break;u>o&&(o=u)}if(g<s){let p=N(this.getNthRow(g),r,"table-layout","inconsistent table layout","warning");p.startIndex++,p.startLine++,p.startCol=0,t.push(p)}}return t}close(n=`
|
|
22
|
+
|}`,e){let t=this.getAttribute("config"),r=this.getAttribute("accum"),i=e?[n]:S.parse(n,this.getAttribute("include"),2,t).childNodes;ie.run(()=>{let s=new Ae(void 0,al,"table-syntax",t,r);super.insertAt(s)}),this.lastChild.replaceChildren(...i)}getLayout(n){let e=this.getAllRows(),{length:t}=e,r=new Ti(...ll(t,()=>[]));for(let i=0;i<r.length;i++){let s=r[i],o=0,l=0,g;for(let p of e[i].childNodes.slice(2))if(p.type==="td"){if(p.isIndependent()&&(g=p.subtype!=="caption"),g){let d={row:i,column:o},{rowspan:u,colspan:m}=p;for(o++;s[l];)l++;for(let h=i;h<Math.min(i+u,t);h++)for(let f=l;f<l+m;f++)r[h][f]=d;l+=m}}else if(dl(p))break}return r}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(n=>n.type==="tr"&&n.getRowCount()>0)]}getNthRow(n,e,t){let r=super.getRowCount();if(n===0&&r)return this;r&&n--;for(let i of this.childNodes.slice(2)){let{type:s}=i;if(s==="tr"&&i.getRowCount()&&(n--,n<0))return i}}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.closed=this.closed,t}}});var $n,so=v(()=>{"use strict";bi();$n=class extends rr{get type(){return"tr"}constructor(n,e,t,r){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,n,"tr",e,t,r)}}});var nr,yi=v(()=>{"use strict";Qe();nr=class extends pe{get indent(){return this.innerText.split(":").length-1}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{indent:r}=this;return r&&(t.indent=r),t}}});var ir,ki=v(()=>{"use strict";yi();ir=class extends nr{get type(){return"dd"}}});var ao={};ae(ao,{parseTable:()=>ul});var gl,oo,ul,lo=v(()=>{"use strict";O();io();so();xi();ki();gl=a=>a.lastChild.constructor!==w,oo=(a,n)=>a.type==="td"?n.pop():a,ul=({firstChild:{data:a},type:n,name:e},t,r)=>{let i=[],s=a.split(`
|
|
23
23
|
`),o=n==="root"||n==="parameter-value"||n==="ext-inner"&&e==="poem"?"":`
|
|
24
|
-
${s.shift()}`,l,
|
|
25
|
-
${d}${C&&`\0${r.length-1}d\x7F`}${$}\0${r.length}b\x7F`,l),i.push(...l?[l]:[],new
|
|
26
|
-
${p}`;continue}let h=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(
|
|
27
|
-
${p}`,l),i.push(l);continue}let[,
|
|
28
|
-
${d}${
|
|
29
|
-
${d}${x}`,
|
|
30
|
-
${d}${y}`,M=F=>{let Q=new er(O,w.slice(L,$==null?void 0:$.index),t,r);return F.insertAt(Q),Q};for(;$;)M(l),{lastIndex:L}=C,[O]=$,$=C.exec(w);i.push(l,M(l))}}return o.slice(1)}});var $n,ao=k(()=>{"use strict";Qe();$n=class extends ge{get type(){return"hr"}}});var lo,ki,ll,ft,go=k(()=>{"use strict";st();Qe();lo=[ve()];ft=class extends(ll=ge){get type(){return"double-underscore"}constructor(n,e,t,r){super(n,t,r)}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};ki=oe(ll),ft=le(ki,0,"DoubleUnderscoreToken",lo,ft),ae(ki,1,ft)});var uo={};se(uo,{parseHrAndDoubleUnderscore:()=>dl});var dl,po=k(()=>{"use strict";ao();go();ti();dl=({firstChild:{data:a},type:n,name:e},t,r)=>{var l,u,p;let{doubleUnderscore:[i,s,o]}=t;return(l=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i)),(u=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s)),(p=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...s].join("|")})__`,"giu")),n!=="root"&&(n!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(d,g,f)=>(new $n(f,t,r),`${g}\0${r.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(d,g)=>{var x;let f=t.sensitiveDoubleUnderscore.has(g),h=g.toLowerCase(),m=t.insensitiveDoubleUnderscore.has(h);return f||m?(new ft(g,f,t,r),`\0${r.length-1}${m&&((x=o==null?void 0:o[h])!=null?x:h)==="toc"?"u":"n"}\x7F`):d}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(d,g,f,h,m)=>{let x=`${g}\0${r.length}h\x7F`;return new Ut(f.length,[h,m],t,r),x}),n==="root"||n==="ext-inner"&&e==="poem"?a:a.slice(1)}});var In,co=k(()=>{"use strict";D();ee();W();Qe();In=class extends ge{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:n,innerText:e}=this;return(n==null?void 0:n.type)==="image-parameter"&&n.name!=="caption"?"":e}lint(n=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:r}=this,i=v.msg('lonely "$1"',"'"),s=[],o=new j(this,n),l=(u,p,d)=>[{desc:"escape",range:[u,p],text:"'".repeat(d)},{desc:"remove",range:[u,p],text:""}];if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){let u=P(this,o,"lonely-apos",i),{startIndex:p,startLine:d,startCol:g}=u,[,{length:f}]=/(?:^|[^'])('+)$/u.exec(e.data),h=n-f;s.push({...u,startIndex:h,endIndex:p,endLine:d,startCol:g-f,endCol:g,suggestions:l(h,p,f)})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){let u=P(this,o,"lonely-apos",i),{endIndex:p,endLine:d,endCol:g}=u,[{length:f}]=/^'+/u.exec(t.data),h=p+f;s.push({...u,startIndex:p,endIndex:h,startLine:d,startCol:g,endCol:g+f,suggestions:l(p,h,f)})}if(r&&this.closest("heading-title")){let u=P(this,o,"bold-header","bold in section header","warning");u.suggestions=[{desc:"remove",range:[n,n+3],text:""}],s.push(u)}return s}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{bold:this.bold,italic:this.italic}),t}}});var mo={};se(mo,{parseQuotes:()=>vi});var vi,Ai=k(()=>{"use strict";co();vi=(a,n,e,t)=>{var d;let r=a.split(/('{2,})/u),{length:i}=r;if(i===1)return a;let s=0,o=0,l,u,p;for(let g=1;g<i;g+=2){let f=r[g].length;switch(f){case 2:o++;break;case 4:r[g-1]+="'",r[g]="'''";case 3:if(s++,l!==void 0)break;r[g-1].endsWith(" ")?u===void 0&&p===void 0&&(p=g):r[g-1].slice(-2,-1)===" "?l=g:u!=null||(u=g);break;default:r[g-1]+="'".repeat(f-5),r[g]="'''''",o++,s++}}if(o%2===1&&s%2===1){let g=(d=l!=null?l:u)!=null?d:p;g!==void 0&&(r[g]="''",r[g-1]+="'")}for(let g=1;g<i;g+=2)new In(r[g],n,e),r[g]=`\0${e.length-1}q\x7F`;return r.join("")}});var ho={};se(ho,{parseExternalLinks:()=>Si});var Si,wi=k(()=>{"use strict";Y();ai();yn();Si=(a,n,e,t)=>{var r;return(r=n.regexExternalLinks)!=null||(n.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${n.protocol}|//)${je}|\0\d+m\x7F)${Be}(?=[[\]<>"\t${Ie}]|\0\d))([${Ie}]*(?![${Ie}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(n.regexExternalLinks,(i,s,o,l)=>{let{length:u}=e,p=/&[lg]t;/u.exec(s);return p&&(o="",l=s.slice(p.index)+o+l,s=s.slice(0,p.index)),t?(new Oe(s,"ext-link-url",n,e),`[\0${u}f\x7F${o}${l}]`):(new Kt(s,o,l,n,e),`\0${u}w\x7F`)})}});var Nn,fo=k(()=>{"use strict";Y();Sr();Nn=class extends Fe{get type(){return"category"}get sortkey(){let{childNodes:[,n]}=this;return n&&it(n.text())}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{sortkey:r}=this;return r&&(t.sortkey=r),t}}});var bo={};se(bo,{parseLinks:()=>xo});var gl,xo,To=k(()=>{"use strict";W();Ai();wi();oi();ni();fo();gl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,xo=(a,n,e,t)=>{var o;(o=n.regexLinks)!=null||(n.regexLinks=new RegExp(String.raw`^\s*(?:${n.protocol}|//)`,"iu"));let r=n.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,i=a.split("[["),s=i.shift();for(let l=0;l<i.length;l++){let u=!1,p,d,g,f,h=i[l],m=r.exec(h);if(m)[,p,d,g,f]=m,f.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",f=f.slice(1));else{let $=gl.exec(h);$&&(u=!0,[,p,d,g]=$)}if(p===void 0||n.regexLinks.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){s+=`[[${h}`;continue}let x=p.trim().startsWith(":");if(x&&u){s+=`[[${h}`;continue}let{ns:y,valid:w}=v.normalizeTitle(p,0,!1,n,!0,!0,!0,!0);if(w){if(u){if(y!==6){s+=`[[${h}`;continue}let $=!1;for(l++;l<i.length;l++){let L=i[l],O=L.split("]]");if(O.length>2){$=!0,g+=`[[${O[0]}]]${O[1]}`,f=O.slice(2).join("]]");break}else if(O.length===2)g+=`[[${O[0]}]]${O[1]}`;else{g+=`[[${L}`;break}}if(g=xo(g,n,e,t),!$){s+=`[[${p}${d}${g}`;continue}}}else{s+=`[[${h}`;continue}g&&(g=vi(g,n,e,t));let C=Xt;x||(y===6?(g&&(g=Si(g,n,e,!0)),C=Vt):y===14&&(C=Nn)),g===void 0&&d&&(g=""),s+=`\0${e.length}l\x7F${f}`,new C(p,g,n,e,d)}return s}});var So={};se(So,{parseMagicLinks:()=>ul});var Ao,yo,ko,vo,ul,wo=k(()=>{"use strict";Y();yn();Ao=String.raw`[${Ie}\t]| |�*160;|�*a0;`,yo=`(?:${Ao})+`,ko=`(?:${Ao}|-)`,vo=String.raw`(?:RFC|PMID)${yo}\d+\b|ISBN${yo}(?:97[89]${ko}?)?(?:\d${ko}?){9}[\dx]\b`,ul=(a,n,e)=>{if(!n.regexMagicLinks)try{n.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${n.protocol})(${je}${Be})|${vo})`,"giu")}catch(t){n.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${n.protocol})(${je}${Be})|${vo})`,"giu")}return a.replace(n.regexMagicLinks,(t,r,i)=>{let s=r?t.slice(r.length):t;if(i){let o="",l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(s);l&&(o=s.slice(l.index),s=s.slice(0,l.index));let u=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,p=u.exec(s);if(p){let d=1;p[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,p.index))&&(d=2),o=s.slice(p.index+d)+o,s=s.slice(0,p.index+d)}return o.length>=i.length?t:(new Oe(s,void 0,n,e),`${r}\0${e.length-1}w\x7F${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Oe(s,"magic-link",n,e),`${r}\0${e.length-1}i\x7F`})}});var Co,$o=k(()=>{"use strict";Co=(a,n)=>a.startsWith(n)?n.length:[...n].findIndex((e,t)=>e!==a[t])});var En,Io=k(()=>{"use strict";Ti();En=class extends rr{get type(){return"list"}}});var No={};se(No,{parseList:()=>pl});var pl,Eo=k(()=>{"use strict";$o();Io();yi();pl=(a,n,e,t)=>{let r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!r)return n.lastPrefix="",a;let[i,s,o]=r,l=o.replace(/;/gu,":"),u=Co(l,n.lastPrefix),p=(u>1?o.slice(u-1):o).split(/(?=;)/u),d=p[0].startsWith(";"),g=p.length-(d?0:1);if(u>1){let F=o.slice(0,u-1);d?p.unshift(F):p[0]=F+p[0]}n.lastPrefix=l;let f=s+p.map((F,Q)=>`\0${t.length+Q}d\x7F`).join("")+a.slice(i.length);for(let F of p)new En(F,e,t);if(!g)return f;let{html:[h]}=e,m=/:+|-\{|\0\d+[xq]\x7F/gu,x=m,y=x.exec(f),w=0,C=!1,$=!1,L=0,O=(F,Q)=>(new nr(F,e,t),`${f.slice(0,Q)}\0${t.length-1}d\x7F${f.slice(Q+F.length)}`),M=F=>{F?w&&w--:w++};for(;y&&g;){let{0:F,index:Q}=y;if(F==="-{"){if(!L){let{lastIndex:R}=x;x=/-\{|\}-/gu,x.lastIndex=R}L++}else if(F==="}-"){if(L--,!L){let{lastIndex:R}=x;x=m,x.lastIndex=R}}else if(F.endsWith("x\x7F")){let{name:R,closing:H,selfClosing:G}=t[Number(F.slice(1,-2))];(!G||h.includes(R))&&M(H)}else if(F.endsWith("q\x7F")){let{bold:R,italic:H}=t[Number(F.slice(1,-2))];R&&(M(C),C=!C),H&&(M($),$=!$)}else if(w===0){if(F.length>=g)return O(F.slice(0,g),Q);g-=F.length,x.lastIndex=Q+4+String(t.length).length,f=O(F,Q)}y=x.exec(f)}return f}});var Lo,He,Ln,Fo=k(()=>{"use strict";D();ee();q();_e();Lo=new Set(["A","T","R","D","-","H","N"]),Ln=class extends S{constructor(e,t,r=[]){super(void 0,t,r,{});T(this,He);this.append(...e.map(i=>new V(i,"converter-flag",t,r)))}get type(){return"converter-flags"}afterBuild(){b(this,He,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(c(this,He).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(c(this,He).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(c(this,He).filter(d=>Lo.has(d))),o=c(this,He).filter(d=>!d).length,l=c(this,He).length-i.size-o,u=super.lint(e,t);if(r.size===l||s.size===l)return u;let p=new j(this,e);for(let d=0;d<this.length;d++){let g=this.childNodes[d],f=g.text().trim();if(f&&!r.has(f)&&!i.has(f)&&(r.size>0||!s.has(f))){let h=I(g,p,"no-ignored","invalid conversion flag");r.size===0&&Lo.has(f.toUpperCase())?h.fix={range:[h.startIndex,h.endIndex],text:f.toUpperCase(),desc:"uppercase"}:h.suggestions=[{desc:"remove",range:[h.startIndex-(d&&1),h.endIndex],text:""}],u.push(h)}}return u}print(){return super.print({sep:";"})}};He=new WeakMap});var ir,Po=k(()=>{"use strict";W();q();_e();ir=class extends S{get type(){return"converter-rule"}get variant(){var n,e;return(e=(n=this.childNodes[this.length-2])==null?void 0:n.text().trim())!=null?e:""}constructor(n,e=!0,t=v.getConfig(),r=[]){super(void 0,t,r);let i=n.indexOf(":"),s=n.slice(0,i).indexOf("=>"),o=s===-1?n.slice(0,i):n.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new V(o,"converter-rule-variant",t,r)),super.insertAt(new V(n.slice(i+1),"converter-rule-to",t,r)),s!==-1&&super.insertAt(new V(n.slice(0,s),"converter-rule-from",t,r),0)):super.insertAt(new V(n,"converter-rule-to",t,r))}toString(n){let{childNodes:e,firstChild:t,lastChild:r}=this;return e.length===3?`${t.toString(n)}=>${e[1].toString(n)}:${r.toString(n)}`:super.toString(n,":")}text(){let{childNodes:n,firstChild:e,lastChild:t}=this;return n.length===3?`${e.text()}=>${n[1].text()}:${t.text()}`:super.text(":")}getGaps(n){return n===0&&this.length===3?2:1}print(){let{childNodes:n}=this;if(n.length===3){let[e,t,r]=n;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${r.print()}</span>`}return super.print({sep:":"})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.variant=this.variant,t}}});var Fn,Ro=k(()=>{"use strict";Y();q();Fo();Po();Fn=class extends S{get type(){return"converter"}constructor(n,e,t,r=[]){super(void 0,t,r),this.append(new Ln(n,t,r));let[i]=e,s=i.includes(":"),o=new ir(i,s,t,r);s&&o.length===1||!s&&e.length===2&&!de(e[1]).trim()?this.insertAt(new ir(e.join(";"),!1,t,r)):this.append(o,...e.slice(1).map(l=>new ir(l,!0,t,r)))}toString(n){let{childNodes:[e,...t]}=this;return`-{${e.toString(n)}${e.length>0?"|":""}${t.map(r=>r.toString(n)).join(";")}}-`}text(){let{childNodes:[n,...e]}=this;return`-{${n.text()}|${ye(e,";")}}-`}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}getGaps(n){return n||this.firstChild.length>0?1:0}print(){let{childNodes:[n,...e]}=this;return`<span class="wpb-converter">-{${n.print()}${n.length>0?"|":""}${qe(e,{sep:";"})}}-</span>`}}});var jo={};se(jo,{parseConverter:()=>cl});var cl,Bo=k(()=>{"use strict";Ro();cl=(a,n,e)=>{var l;(l=n.regexConverter)!=null||(n.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${n.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,r=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:u,index:p}=o;if(u==="}-"){let d=i.pop(),{length:g}=e,f=a.slice(d.index+2,p),h=f.indexOf("|"),[m,x]=h===-1?[[],f]:[f.slice(0,h).split(";"),f.slice(h+1)],y=x.replace(/(&[#a-z\d]+);/giu,"$1"),w=y.split(n.regexConverter).map(C=>C.replace(/\x01/gu,";"));new Fn(m,w,n,e),a=`${a.slice(0,d.index)}\0${g}v\x7F${a.slice(p+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(g).length}else i.push(o),s=r,s.lastIndex=p+2;o=s.exec(a)}return a}});var Or={};se(Or,{Token:()=>S});var qr,we,U,X,xt,sr,_r,z,qo,_o,Oo,Mo,Do,Wo,Ho,Uo,zo,Go,Vo,Qo,Ci,S,q=k(()=>{"use strict";Y();D();W();Yi();ts();Ci=class Ci extends Kr{constructor(e,t=v.getConfig(),r=[],i){super();T(this,z);T(this,qr,"plain");T(this,we,0);T(this,U);T(this,X);T(this,xt);T(this,sr,!1);T(this,_r);typeof e=="string"&&this.insertAt(e),b(this,U,t),b(this,X,r),r.push(this)}get type(){return c(this,qr)}set type(e){b(this,qr,e)}parseOnce(e=c(this,we),t=!1,r){if(e<c(this,we)||this.length===0||!this.getAttribute("plain"))return this;if(c(this,we)>=11)return this;switch(e){case 0:if(this.type==="root"){c(this,X).pop();let i=A(this,z,qo).call(this);t&&(t=!i)}b(this,xt,t),A(this,z,_o).call(this,t);break;case 1:A(this,z,Oo).call(this);break;case 2:A(this,z,Mo).call(this);break;case 3:A(this,z,Do).call(this);break;case 4:A(this,z,Wo).call(this);break;case 5:A(this,z,Ho).call(this,r);break;case 6:A(this,z,Uo).call(this,r);break;case 7:A(this,z,zo).call(this);break;case 8:A(this,z,Go).call(this);break;case 9:A(this,z,Vo).call(this);break;case 10:A(this,z,Qo).call(this)}if(this.type==="root")for(let i of c(this,X))i==null||i.parseOnce(e,t,r);return Vr(this,we)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new vr(i);if(isNaN(i.slice(-1)))return c(this,X)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?r.map(String).join(""):t===1?ye(r):r}build(){b(this,we,11);let{length:e,firstChild:t}=this,r=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let i of c(this,X))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of c(this,X))e==null||e.afterBuild();b(this,sr,!0)}parse(e=11,t,r){for(e=Math.min(e,11);c(this,we)<e;)this.parseOnce(c(this,we),t,r);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===Ci;case"config":return c(this,U);case"include":return(t=c(this,xt))!=null?t:!!c(this.getRootNode(),xt);case"accum":return c(this,X);case"built":return c(this,sr);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":c(this,we)===0&&this.type==="root"&&c(this,X).shift(),b(this,we,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new vr(e):e;super.insertAt(r,t);let{type:i}=r;return i==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r,i,s,o){return v.normalizeTitle(e,t,c(this,xt),c(this,U),r,i,s,o)}lint(e=this.getAbsoluteIndex(),t){var i;let r=super.lint(e,t);if(this.type==="root"){let s=new Map,o="category,html-attr#id,ext-attr#id,table-attr#id";for(let g of this.querySelectorAll(o)){let f;if(g.type==="category")f=g.name;else{let h=g.getValue();h&&h!==!0&&(f=`#${h}`)}if(f){let h=s.get(f);h?h.add(g):s.set(f,new Set([g]))}}for(let[g,f]of s)if(f.size>1&&!g.startsWith("#mw-customcollapsible-")){let h=!g.startsWith("#"),m=`duplicated ${h?"category":"id"}`,x=h?"error":"warning";r.push(...[...f].map(y=>{let w=P(y,{start:y.getAbsoluteIndex()},"no-duplicate",m,x);return h&&(w.suggestions=[{desc:"remove",range:[w.startIndex,w.endIndex],text:""}]),w}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,u=this.toString(),p=[],d=l.exec(u);for(;d;){let{1:g,index:f}=d,h=(i=d[2])==null?void 0:i.trim();p.push({line:this.posFromIndex(f).top+(g==="disable-line"?0:1),from:g==="disable"?l.lastIndex:void 0,to:g==="enable"?l.lastIndex:void 0,rules:h?new Set(h.split(",").map(m=>m.trim())):void 0}),d=l.exec(u)}r=r.filter(({rule:g,startLine:f,startIndex:h})=>{let m={pos:0};for(let{line:x,from:y,to:w,rules:C}of p){if(x>f+1)break;if(C&&!C.has(g))continue;if(x===f&&y===void 0&&w===void 0)return!1;y<=h&&y>m.pos?(m.pos=y,m.type="from"):w<=h&&w>m.pos&&(m.pos=w,m.type="to")}return m.type!=="from"})}return r}toString(e,t){return e?super.toString(!0,t):Ne(c(this,_r),()=>super.toString(!1,t),r=>{let i=this.getRootNode();i.type==="root"&&c(i,sr)&&b(this,_r,r)})}};qr=new WeakMap,we=new WeakMap,U=new WeakMap,X=new WeakMap,xt=new WeakMap,sr=new WeakMap,_r=new WeakMap,z=new WeakSet,qo=function(){let{parseRedirect:e}=(as(),J(os)),t=this.firstChild.toString(),r=e(t,c(this,U),c(this,X));return r&&this.setText(r),!!r},_o=function(e){let{parseCommentAndExt:t}=($r(),J(Js));this.setText(t(this.firstChild.toString(),c(this,U),c(this,X),e))},Oo=function(){let{parseBraces:e}=(hn(),J(Fs)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,r=e(t,c(this,U),c(this,X));this.setText(this.type==="root"?r:r.slice(1))},Mo=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(to(),J(eo));this.setText(e(this.firstChild.toString(),c(this,U),c(this,X)))},Do=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(oo(),J(so));this.setText(e(this,c(this,U),c(this,X)))},Wo=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(po(),J(uo));this.setText(e(this,c(this,U),c(this,X)))},Ho=function(e){let{parseLinks:t}=(To(),J(bo));this.setText(t(this.firstChild.toString(),c(this,U),c(this,X),e))},Uo=function(e){var i;if((i=c(this,U).excludes)!=null&&i.includes("quote"))return;let{parseQuotes:t}=(Ai(),J(mo)),r=this.firstChild.toString().split(`
|
|
24
|
+
${s.shift()}`,l,g=(p,d)=>{if(!d){o+=p;return}let{lastChild:u}=d;if(gl(d)){let m=new w(p,t,r);m.type="table-inter",m.setAttribute("stage",3),d.insertAt(m)}else u.setText(u.toString()+p)};for(let p of s){l=i.pop();let[d]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(p),u=p.slice(d.length),m=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(u);if(m){for(;l&&l.type!=="td";)l=i.pop();let[,C,$,L,M]=m;C&&new ir(C,t,r),g(`
|
|
25
|
+
${d}${C&&`\0${r.length-1}d\x7F`}${$}\0${r.length}b\x7F`,l),i.push(...l?[l]:[],new Cn(L,M,t,r));continue}else if(!l){o+=`
|
|
26
|
+
${p}`;continue}let h=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(u);if(!h){g(`
|
|
27
|
+
${p}`,l),i.push(l);continue}let[,f,x,b,k]=h;if(f){for(;l.type!=="table";)l=i.pop();l.close(`
|
|
28
|
+
${d}${f}`,!0),g(k,i[i.length-1])}else if(x){l=oo(l,i),l.type==="tr"&&(l=i.pop());let C=new $n(`
|
|
29
|
+
${d}${x}`,k,t,r);i.push(l,C),l.insertAt(C)}else{l=oo(l,i);let C=b==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,$=C.exec(k),L=0,M=`
|
|
30
|
+
${d}${b}`,D=F=>{let V=new tr(M,k.slice(L,$==null?void 0:$.index),t,r);return F.insertAt(V),V};for(;$;)D(l),{lastIndex:L}=C,[M]=$,$=C.exec(k);i.push(l,D(l))}}return o.slice(1)}});var In,go=v(()=>{"use strict";Qe();In=class extends pe{get type(){return"hr"}}});var uo,vi,pl,ft,po=v(()=>{"use strict";st();Qe();uo=[ve()];ft=class extends(pl=pe){get type(){return"double-underscore"}constructor(n,e,t,r){var l,g;super(n,t,r);let i=n.toLowerCase(),{doubleUnderscore:[,,s,o]}=t;this.setAttribute("name",(g=e?(l=o==null?void 0:o[n])==null?void 0:l.toLowerCase():s==null?void 0:s[i])!=null?g:i)}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};vi=le(pl),ft=ge(vi,0,"DoubleUnderscoreToken",uo,ft),de(vi,1,ft)});var co={};ae(co,{parseHrAndDoubleUnderscore:()=>cl});var cl,mo=v(()=>{"use strict";go();po();ri();cl=({firstChild:{data:a},type:n,name:e},t,r)=>{var l,g,p;let{doubleUnderscore:[i,s,o]}=t;return(l=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i)),(g=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s)),(p=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...s].join("|")})__`,"giu")),n!=="root"&&(n!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(d,u,m)=>(new In(m,t,r),`${u}\0${r.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(d,u)=>{var x;let m=t.sensitiveDoubleUnderscore.has(u),h=u.toLowerCase(),f=t.insensitiveDoubleUnderscore.has(h);return m||f?(new ft(u,m,t,r),`\0${r.length-1}${f&&((x=o==null?void 0:o[h])!=null?x:h)==="toc"?"u":"n"}\x7F`):d}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(d,u,m,h,f)=>{let x=`${u}\0${r.length}h\x7F`;return new zt(m.length,[h,f],t,r),x}),n==="root"||n==="ext-inner"&&e==="poem"?a:a.slice(1)}});var Nn,ho=v(()=>{"use strict";W();ne();H();Qe();Nn=class extends pe{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:n,innerText:e}=this;return(n==null?void 0:n.type)==="image-parameter"&&n.name!=="caption"?"":e}lint(n=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:r}=this,i=S.msg('lonely "$1"',"'"),s=[],o=new j(this,n),l=(g,p,d)=>[{desc:"escape",range:[g,p],text:"'".repeat(d)},{desc:"remove",range:[g,p],text:""}];if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){let g=P(this,o,"lonely-apos",i),{startIndex:p,startLine:d,startCol:u}=g,[,{length:m}]=/(?:^|[^'])('+)$/u.exec(e.data),h=n-m;s.push({...g,startIndex:h,endIndex:p,endLine:d,startCol:u-m,endCol:u,suggestions:l(h,p,m)})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){let g=P(this,o,"lonely-apos",i),{endIndex:p,endLine:d,endCol:u}=g,[{length:m}]=/^'+/u.exec(t.data),h=p+m;s.push({...g,startIndex:p,endIndex:h,startLine:d,startCol:u,endCol:u+m,suggestions:l(p,h,m)})}if(r&&this.closest("heading-title")){let g=P(this,o,"bold-header","bold in section header","warning");g.suggestions=[{desc:"remove",range:[n,n+3],text:""}],s.push(g)}return s}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{bold:this.bold,italic:this.italic}),t}}});var fo={};ae(fo,{parseQuotes:()=>Ai});var Ai,Si=v(()=>{"use strict";ho();Ai=(a,n,e,t)=>{var d;let r=a.split(/('{2,})/u),{length:i}=r;if(i===1)return a;let s=0,o=0,l,g,p;for(let u=1;u<i;u+=2){let m=r[u].length;switch(m){case 2:o++;break;case 4:r[u-1]+="'",r[u]="'''";case 3:if(s++,l!==void 0)break;r[u-1].endsWith(" ")?g===void 0&&p===void 0&&(p=u):r[u-1].slice(-2,-1)===" "?l=u:g!=null||(g=u);break;default:r[u-1]+="'".repeat(m-5),r[u]="'''''",o++,s++}}if(o%2===1&&s%2===1){let u=(d=l!=null?l:g)!=null?d:p;u!==void 0&&(r[u]="''",r[u-1]+="'")}for(let u=1;u<i;u+=2)new Nn(r[u],n,e),r[u]=`\0${e.length-1}q\x7F`;return r.join("")}});var xo={};ae(xo,{parseExternalLinks:()=>wi});var wi,Ci=v(()=>{"use strict";Z();li();kn();wi=(a,n,e,t)=>{var r;return(r=n.regexExternalLinks)!=null||(n.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${n.protocol}|//)${je}|\0\d+m\x7F)${Be}(?=[[\]<>"\t${Ie}]|\0\d))([${Ie}]*(?![${Ie}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(n.regexExternalLinks,(i,s,o,l)=>{let{length:g}=e,p=/&[lg]t;/u.exec(s);return p&&(o="",l=s.slice(p.index)+o+l,s=s.slice(0,p.index)),t?(new Oe(s,"ext-link-url",n,e),`[\0${g}f\x7F${o}${l}]`):(new Jt(s,o,l,n,e),`\0${g}w\x7F`)})}});var Ln,bo=v(()=>{"use strict";Z();wr();Ln=class extends Fe{get type(){return"category"}get sortkey(){let{childNodes:[,n]}=this;return n&&it(n.text())}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{sortkey:r}=this;return r&&(t.sortkey=r),t}}});var yo={};ae(yo,{parseLinks:()=>To});var ml,To,ko=v(()=>{"use strict";H();Si();Ci();ai();ii();bo();ml=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,To=(a,n,e,t)=>{var o;(o=n.regexLinks)!=null||(n.regexLinks=new RegExp(String.raw`^\s*(?:${n.protocol}|//)`,"iu"));let r=n.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,i=a.split("[["),s=i.shift();for(let l=0;l<i.length;l++){let g=!1,p,d,u,m,h=i[l],f=r.exec(h);if(f)[,p,d,u,m]=f,m.startsWith("]")&&(u!=null&&u.includes("["))&&(u+="]",m=m.slice(1));else{let $=ml.exec(h);$&&(g=!0,[,p,d,u]=$)}if(p===void 0||n.regexLinks.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){s+=`[[${h}`;continue}let x=p.trim().startsWith(":");if(x&&g){s+=`[[${h}`;continue}let{ns:b,valid:k}=S.normalizeTitle(p,0,!1,n,!0,!0,!0,!0);if(k){if(g){if(b!==6){s+=`[[${h}`;continue}let $=!1;for(l++;l<i.length;l++){let L=i[l],M=L.split("]]");if(M.length>2){$=!0,u+=`[[${M[0]}]]${M[1]}`,m=M.slice(2).join("]]");break}else if(M.length===2)u+=`[[${M[0]}]]${M[1]}`;else{u+=`[[${L}`;break}}if(u=To(u,n,e,t),!$){s+=`[[${p}${d}${u}`;continue}}}else{s+=`[[${h}`;continue}u&&(u=Ai(u,n,e,t));let C=Kt;x||(b===6?(u&&(u=wi(u,n,e,!0)),C=Qt):b===14&&(C=Ln)),u===void 0&&d&&(u=""),s+=`\0${e.length}l\x7F${m}`,new C(p,u,n,e,d)}return s}});var Co={};ae(Co,{parseMagicLinks:()=>hl});var wo,vo,Ao,So,hl,$o=v(()=>{"use strict";Z();kn();wo=String.raw`[${Ie}\t]| |�*160;|�*a0;`,vo=`(?:${wo})+`,Ao=`(?:${wo}|-)`,So=String.raw`(?:RFC|PMID)${vo}\d+\b|ISBN${vo}(?:97[89]${Ao}?)?(?:\d${Ao}?){9}[\dx]\b`,hl=(a,n,e)=>{if(!n.regexMagicLinks)try{n.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${n.protocol})(${je}${Be})|${So})`,"giu")}catch(t){n.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${n.protocol})(${je}${Be})|${So})`,"giu")}return a.replace(n.regexMagicLinks,(t,r,i)=>{let s=r?t.slice(r.length):t;if(i){let o="",l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(s);l&&(o=s.slice(l.index),s=s.slice(0,l.index));let g=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,p=g.exec(s);if(p){let d=1;p[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,p.index))&&(d=2),o=s.slice(p.index+d)+o,s=s.slice(0,p.index+d)}return o.length>=i.length?t:(new Oe(s,void 0,n,e),`${r}\0${e.length-1}w\x7F${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Oe(s,"magic-link",n,e),`${r}\0${e.length-1}i\x7F`})}});var Io,No=v(()=>{"use strict";Io=(a,n)=>a.startsWith(n)?n.length:[...n].findIndex((e,t)=>e!==a[t])});var En,Lo=v(()=>{"use strict";yi();En=class extends nr{get type(){return"list"}}});var Eo={};ae(Eo,{parseList:()=>fl});var fl,Fo=v(()=>{"use strict";No();Lo();ki();fl=(a,n,e,t)=>{let r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!r)return n.lastPrefix="",a;let[i,s,o]=r,l=o.replace(/;/gu,":"),g=Io(l,n.lastPrefix),p=(g>1?o.slice(g-1):o).split(/(?=;)/u),d=p[0].startsWith(";"),u=p.length-(d?0:1);if(g>1){let F=o.slice(0,g-1);d?p.unshift(F):p[0]=F+p[0]}n.lastPrefix=l;let m=s+p.map((F,V)=>`\0${t.length+V}d\x7F`).join("")+a.slice(i.length);for(let F of p)new En(F,e,t);if(!u)return m;let{html:[h]}=e,f=/:+|-\{|\0\d+[xq]\x7F/gu,x=f,b=x.exec(m),k=0,C=!1,$=!1,L=0,M=(F,V)=>(new ir(F,e,t),`${m.slice(0,V)}\0${t.length-1}d\x7F${m.slice(V+F.length)}`),D=F=>{F?k&&k--:k++};for(;b&&u;){let{0:F,index:V}=b;if(F==="-{"){if(!L){let{lastIndex:K}=x;x=/-\{|\}-/gu,x.lastIndex=K}L++}else if(F==="}-"){if(L--,!L){let{lastIndex:K}=x;x=f,x.lastIndex=K}}else if(F.endsWith("x\x7F")){let{name:K,closing:me,selfClosing:E}=t[Number(F.slice(1,-2))];(!E||h.includes(K))&&D(me)}else if(F.endsWith("q\x7F")){let{bold:K,italic:me}=t[Number(F.slice(1,-2))];K&&(D(C),C=!C),me&&(D($),$=!$)}else if(k===0){if(F.length>=u)return M(F.slice(0,u),V);u-=F.length,x.lastIndex=V+4+String(t.length).length,m=M(F,V)}b=x.exec(m)}return m}});var Po,He,Fn,Ro=v(()=>{"use strict";W();ne();O();_e();Po=new Set(["A","T","R","D","-","H","N"]),Fn=class extends w{constructor(e,t,r=[]){super(void 0,t,r,{});y(this,He);this.append(...e.map(i=>new G(i,"converter-flag",t,r)))}get type(){return"converter-flags"}afterBuild(){T(this,He,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(c(this,He).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(c(this,He).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(c(this,He).filter(d=>Po.has(d))),o=c(this,He).filter(d=>!d).length,l=c(this,He).length-i.size-o,g=super.lint(e,t);if(r.size===l||s.size===l)return g;let p=new j(this,e);for(let d=0;d<this.length;d++){let u=this.childNodes[d],m=u.text().trim();if(m&&!r.has(m)&&!i.has(m)&&(r.size>0||!s.has(m))){let h=N(u,p,"no-ignored","invalid conversion flag");r.size===0&&Po.has(m.toUpperCase())?h.fix={range:[h.startIndex,h.endIndex],text:m.toUpperCase(),desc:"uppercase"}:h.suggestions=[{desc:"remove",range:[h.startIndex-(d&&1),h.endIndex],text:""}],g.push(h)}}return g}print(){return super.print({sep:";"})}};He=new WeakMap});var sr,jo=v(()=>{"use strict";H();O();_e();sr=class extends w{get type(){return"converter-rule"}get variant(){var n,e;return(e=(n=this.childNodes[this.length-2])==null?void 0:n.text().trim())!=null?e:""}constructor(n,e=!0,t=S.getConfig(),r=[]){super(void 0,t,r);let i=n.indexOf(":"),s=n.slice(0,i).indexOf("=>"),o=s===-1?n.slice(0,i):n.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new G(o,"converter-rule-variant",t,r)),super.insertAt(new G(n.slice(i+1),"converter-rule-to",t,r)),s!==-1&&super.insertAt(new G(n.slice(0,s),"converter-rule-from",t,r),0)):super.insertAt(new G(n,"converter-rule-to",t,r))}toString(n){let{childNodes:e,firstChild:t,lastChild:r}=this;return e.length===3?`${t.toString(n)}=>${e[1].toString(n)}:${r.toString(n)}`:super.toString(n,":")}text(){let{childNodes:n,firstChild:e,lastChild:t}=this;return n.length===3?`${e.text()}=>${n[1].text()}:${t.text()}`:super.text(":")}getGaps(n){return n===0&&this.length===3?2:1}print(){let{childNodes:n}=this;if(n.length===3){let[e,t,r]=n;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${r.print()}</span>`}return super.print({sep:":"})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.variant=this.variant,t}}});var Pn,Bo=v(()=>{"use strict";Z();O();Ro();jo();Pn=class extends w{get type(){return"converter"}constructor(n,e,t,r=[]){super(void 0,t,r),this.append(new Fn(n,t,r));let[i]=e,s=i.includes(":"),o=new sr(i,s,t,r);s&&o.length===1||!s&&e.length===2&&!ue(e[1]).trim()?this.insertAt(new sr(e.join(";"),!1,t,r)):this.append(o,...e.slice(1).map(l=>new sr(l,!0,t,r)))}toString(n){let{childNodes:[e,...t]}=this;return`-{${e.toString(n)}${e.length>0?"|":""}${t.map(r=>r.toString(n)).join(";")}}-`}text(){let{childNodes:[n,...e]}=this;return`-{${n.text()}|${ye(e,";")}}-`}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}getGaps(n){return n||this.firstChild.length>0?1:0}print(){let{childNodes:[n,...e]}=this;return`<span class="wpb-converter">-{${n.print()}${n.length>0?"|":""}${qe(e,{sep:";"})}}-</span>`}}});var qo={};ae(qo,{parseConverter:()=>xl});var xl,_o=v(()=>{"use strict";Bo();xl=(a,n,e)=>{var l;(l=n.regexConverter)!=null||(n.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${n.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,r=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:g,index:p}=o;if(g==="}-"){let d=i.pop(),{length:u}=e,m=a.slice(d.index+2,p),h=m.indexOf("|"),[f,x]=h===-1?[[],m]:[m.slice(0,h).split(";"),m.slice(h+1)],b=x.replace(/(&[#a-z\d]+);/giu,"$1"),k=b.split(n.regexConverter).map(C=>C.replace(/\x01/gu,";"));new Pn(f,k,n,e),a=`${a.slice(0,d.index)}\0${u}v\x7F${a.slice(p+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(u).length}else i.push(o),s=r,s.lastIndex=p+2;o=s.exec(a)}return a}});var Mr={};ae(Mr,{Token:()=>w});var _r,we,U,X,xt,or,Or,z,Oo,Mo,Do,Wo,Ho,Uo,zo,Go,Vo,Qo,Xo,Ko,$i,w,O=v(()=>{"use strict";Z();W();H();es();ns();$i=class $i extends Jr{constructor(e,t=S.getConfig(),r=[],i){super();y(this,z);y(this,_r,"plain");y(this,we,0);y(this,U);y(this,X);y(this,xt);y(this,or,!1);y(this,Or);typeof e=="string"&&this.insertAt(e),T(this,U,t),T(this,X,r),r.push(this)}get type(){return c(this,_r)}set type(e){T(this,_r,e)}parseOnce(e=c(this,we),t=!1,r){if(e<c(this,we)||this.length===0||!this.getAttribute("plain"))return this;if(c(this,we)>=11)return this;switch(e){case 0:if(this.type==="root"){c(this,X).pop();let i=A(this,z,Oo).call(this);t&&(t=!i)}T(this,xt,t),A(this,z,Mo).call(this,t);break;case 1:A(this,z,Do).call(this);break;case 2:A(this,z,Wo).call(this);break;case 3:A(this,z,Ho).call(this);break;case 4:A(this,z,Uo).call(this);break;case 5:A(this,z,zo).call(this,r);break;case 6:A(this,z,Go).call(this,r);break;case 7:A(this,z,Vo).call(this);break;case 8:A(this,z,Qo).call(this);break;case 9:A(this,z,Xo).call(this);break;case 10:A(this,z,Ko).call(this)}if(this.type==="root")for(let i of c(this,X))i==null||i.parseOnce(e,t,r);return Qr(this,we)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new Ar(i);if(isNaN(i.slice(-1)))return c(this,X)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?r.map(String).join(""):t===1?ye(r):r}build(){T(this,we,11);let{length:e,firstChild:t}=this,r=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let i of c(this,X))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of c(this,X))e==null||e.afterBuild();T(this,or,!0)}parse(e=11,t,r){for(e=Math.min(e,11);c(this,we)<e;)this.parseOnce(c(this,we),t,r);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===$i;case"config":return c(this,U);case"include":return(t=c(this,xt))!=null?t:!!c(this.getRootNode(),xt);case"accum":return c(this,X);case"built":return c(this,or);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":c(this,we)===0&&this.type==="root"&&c(this,X).shift(),T(this,we,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new Ar(e):e;super.insertAt(r,t);let{type:i}=r;return i==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r,i,s,o){return S.normalizeTitle(e,t,c(this,xt),c(this,U),r,i,s,o)}lint(e=this.getAbsoluteIndex(),t){var i;let r=super.lint(e,t);if(this.type==="root"){let s=new Map,o="category,html-attr#id,ext-attr#id,table-attr#id";for(let u of this.querySelectorAll(o)){let m;if(u.type==="category")m=u.name;else{let h=u.getValue();h&&h!==!0&&(m=`#${h}`)}if(m){let h=s.get(m);h?h.add(u):s.set(m,new Set([u]))}}for(let[u,m]of s)if(m.size>1&&!u.startsWith("#mw-customcollapsible-")){let h=!u.startsWith("#"),f=`duplicated ${h?"category":"id"}`,x=h?"error":"warning";r.push(...[...m].map(b=>{let k=P(b,{start:b.getAbsoluteIndex()},"no-duplicate",f,x);return h&&(k.suggestions=[{desc:"remove",range:[k.startIndex,k.endIndex],text:""}]),k}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,g=this.toString(),p=[],d=l.exec(g);for(;d;){let{1:u,index:m}=d,h=(i=d[2])==null?void 0:i.trim();p.push({line:this.posFromIndex(m).top+(u==="disable-line"?0:1),from:u==="disable"?l.lastIndex:void 0,to:u==="enable"?l.lastIndex:void 0,rules:h?new Set(h.split(",").map(f=>f.trim())):void 0}),d=l.exec(g)}r=r.filter(({rule:u,startLine:m,startIndex:h})=>{let f={pos:0};for(let{line:x,from:b,to:k,rules:C}of p){if(x>m+1)break;if(C&&!C.has(u))continue;if(x===m&&b===void 0&&k===void 0)return!1;b<=h&&b>f.pos?(f.pos=b,f.type="from"):k<=h&&k>f.pos&&(f.pos=k,f.type="to")}return f.type!=="from"})}return r}toString(e,t){return e?super.toString(!0,t):Ne(c(this,Or),()=>super.toString(!1,t),r=>{let i=this.getRootNode();i.type==="root"&&c(i,or)&&T(this,Or,r)})}};_r=new WeakMap,we=new WeakMap,U=new WeakMap,X=new WeakMap,xt=new WeakMap,or=new WeakMap,Or=new WeakMap,z=new WeakSet,Oo=function(){let{parseRedirect:e}=(ds(),Y(ls)),t=this.firstChild.toString(),r=e(t,c(this,U),c(this,X));return r&&this.setText(r),!!r},Mo=function(e){let{parseCommentAndExt:t}=(Ir(),Y(Zs));this.setText(t(this.firstChild.toString(),c(this,U),c(this,X),e))},Do=function(){let{parseBraces:e}=(fn(),Y(Rs)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,r=e(t,c(this,U),c(this,X));this.setText(this.type==="root"?r:r.slice(1))},Wo=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(no(),Y(ro));this.setText(e(this.firstChild.toString(),c(this,U),c(this,X)))},Ho=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(lo(),Y(ao));this.setText(e(this,c(this,U),c(this,X)))},Uo=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(mo(),Y(co));this.setText(e(this,c(this,U),c(this,X)))},zo=function(e){let{parseLinks:t}=(ko(),Y(yo));this.setText(t(this.firstChild.toString(),c(this,U),c(this,X),e))},Go=function(e){var i;if((i=c(this,U).excludes)!=null&&i.includes("quote"))return;let{parseQuotes:t}=(Si(),Y(fo)),r=this.firstChild.toString().split(`
|
|
31
31
|
`);for(let s=0;s<r.length;s++)r[s]=t(r[s],c(this,U),c(this,X),e);this.setText(r.join(`
|
|
32
|
-
`))},
|
|
32
|
+
`))},Vo=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(Ci(),Y(xo));this.setText(e(this.firstChild.toString(),c(this,U),c(this,X)))},Qo=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=($o(),Y(Co));this.setText(e(this.firstChild.toString(),c(this,U),c(this,X)))},Xo=function(){var g;if((g=c(this,U).excludes)!=null&&g.includes("list"))return;let{parseList:e}=(Fo(),Y(Eo)),{firstChild:t,type:r,name:i}=this,s=t.toString().split(`
|
|
33
33
|
`),o={lastPrefix:""},l=r==="root"||r==="ext-inner"&&i==="poem"?0:1;for(;l<s.length;l++)s[l]=e(s[l],o,c(this,U),c(this,X));this.setText(s.join(`
|
|
34
|
-
`))},Qo=function(){if(c(this,U).variants.length>0){let{parseConverter:e}=(Bo(),J(jo));this.setText(e(this.firstChild.toString(),c(this,U),c(this,X)))}};S=Ci});var re,zt,Un,Yr,ke=k(()=>{"use strict";re={running:!1,run(a){let{running:n}=this;this.running=!0;try{let{Token:e}=(q(),J(Or)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=n,t}catch(e){throw this.running=n,e}},rev:0},zt=a=>n=>n.type===a,Un=(a,n,e,t=[])=>{var s,o;let r=a.getChildNodes(),i=r.splice(n,e,...t);for(let l=0;l<t.length;l++){let u=t[l];u.setAttribute("parentNode",a),u.setAttribute("nextSibling",r[n+l+1]),u.setAttribute("previousSibling",r[n+l-1])}return(s=r[n-1])==null||s.setAttribute("nextSibling",r[n]),(o=r[n+t.length])==null||o.setAttribute("previousSibling",r[n+t.length-1]),i},Yr=(a,n)=>{Object.defineProperty(a,"name",{value:n.name})}});var Xo={};se(Xo,{Title:()=>$i});var Mr,Dr,Ce,or,bt,$i,Ko=k(()=>{"use strict";Y();$i=class{constructor(n,e,t,r,i,s){T(this,Mr);T(this,Dr);T(this,Ce);T(this,or);T(this,bt);te(this,"valid");te(this,"encoded",!1);let o=n.trim().startsWith("../");if(i&&n.includes("%"))try{let u=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(n);n=Ge(n),this.encoded=u}catch(u){}if(n=it(n).replace(/[_ ]+/gu," ").trim(),o)b(this,or,0);else{let u=e;n.startsWith(":")&&(u=0,n=n.slice(1).trim());let p=n.split(":");if(p.length>1){let d=p[0].trim().toLowerCase(),g=Object.prototype.hasOwnProperty.call(t.nsid,d)&&t.nsid[d];g&&(u=g,n=p.slice(1).join(":").trim())}b(this,or,u)}let l=n.indexOf("#");if(l!==-1){let u=n.slice(l).trim().slice(1);if(u.includes("%"))try{u=Ge(u)}catch(p){}b(this,bt,u.replace(/ /gu,"_")),n=n.slice(0,l).trim()}this.valid=!!(n||s&&this.ns===0&&c(this,bt)!==void 0)&&it(n)===n&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(o?/^(?:\.\.\/)+(.*)/u.exec(n)[1]:n),this.main=n,b(this,Dr,t.namespaces),b(this,Ce,t.articlePath||"/wiki/$1"),c(this,Ce).includes("$1")||b(this,Ce,c(this,Ce)+`${c(this,Ce).endsWith("/")?"":"/"}$1`),r||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return c(this,or)}get fragment(){return c(this,bt)}get main(){return c(this,Mr)}set main(n){n=n.replace(/_/gu," ").trim(),b(this,Mr,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){let n=c(this,Dr)[this.ns];return n+(n&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:n}=this,e=n.lastIndexOf(".");return e===-1?void 0:n.slice(e+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(n){b(this,bt,n)}getUrl(n){{typeof n=="string"&&(b(this,Ce,n||"/wiki/$1"),c(this,Ce).includes("$1")||b(this,Ce,c(this,Ce)+`${c(this,Ce).endsWith("/")?"":"/"}$1`));let{title:e,fragment:t}=this;return e?c(this,Ce).replace("$1",encodeURIComponent(e)+(t?`#${encodeURIComponent(t)}`:"")):t===void 0?"":`#${encodeURIComponent(t)}`}}};Mr=new WeakMap,Dr=new WeakMap,Ce=new WeakMap,or=new WeakMap,bt=new WeakMap});var oa={};se(oa,{LanguageService:()=>Ii,tasks:()=>ea});var ea,ml,hl,fl,xl,ta,bl,Tl,yl,Jo,zr,ra,ar,ce,Yo,na,Wr,Hr,lr,Pn,Zo,be,tt,Ue,ze,gr,Gr,ur,pr,cr,B,Ur,$e,Ni,ia,Ei,sa,Li,dr,Ii,aa=k(()=>{"use strict";_n();Yn();D();Y();W();ea=new WeakMap,ml=new Set(["ref"]),hl=new Set(["ref","references"]),fl=new Set(["name","extends","follow"]),xl=new Set(["group"]),ta=new Set(["arg-name","template-name","magic-word-name","link-target","parameter-key"]),bl=new Set(["ext","html","attr-key","image-parameter","heading-title","heading",...ta]),Tl=new Set(["text","comment","noinclude","include"]),yl=["ext","html","table"].map(a=>`${a}-attr#style`).join(),Jo=a=>a.every(({type:n})=>Tl.has(n)),zr=(a,n)=>{let{top:e,left:t}=a.posFromIndex(n);return{line:e,character:t}},ra=(a,n,e)=>({start:zr(a,n),end:zr(a,e)}),ar=a=>{let{top:n,left:e,height:t,width:r}=a.getBoundingClientRect();return{start:{line:n,character:e},end:$t(n,e,t,r)}},ce=(a,n,e,{line:t,character:r},i,s)=>[...new Set(a)].map(o=>{var u;let l=(u=s==null?void 0:s(o))==null?void 0:u.description;return{label:o,kind:n,textEdit:{range:{start:{line:t,character:r-e.length},end:{line:t,character:r}},newText:o+(i!=null?i:"")},...l&&{documentation:{kind:"markdown",value:l}}}}),Yo=(a,n,{line:e,character:t})=>{let r=a.indexFromPos(e,t);return a.caretPositionFromIndex(r+Number(/\w/u.test(n.charAt(r))))},na=(a,n,e)=>{let{type:t,parentNode:r={}}=a,{name:i,tag:s}=r;return t==="attr-value"&&n.has(s)&&e.has(i)?a.toString().trim():NaN},Wr=a=>na(a,ml,fl),Hr=a=>na(a,hl,xl),lr=(a,n)=>{let e=a==null?void 0:a.getAttr(n);return e!==!0&&e||!1},Pn=a=>{let{type:n,name:e,parentNode:t}=a;switch(n){case"heading":return a.level;case"heading-title":return t.level;case"parameter-key":return`${t.parentNode.name}|${t.name}`;case"ext":case"html":case"image-parameter":return e;default:return t.name}},Zo=(a,n,e=!1)=>({range:ra(a,...n.range),newText:n.text,title:`${e?"Fix":"Suggestion"}: ${n.desc}`,fix:e}),Ii=class{constructor(n){T(this,B);T(this,be);T(this,tt);T(this,Ue);T(this,ze);T(this,gr);T(this,Gr);T(this,ur);T(this,pr);T(this,cr);te(this,"include",!0);te(this,"data");ea.set(n,this)}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(n,e,t=!0){let r=await A(this,B,$e).call(this,e);return r.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(({type:i,childNodes:s})=>i!=="attr-value"&&!Jo(s)?[]:s.filter(o=>o.type==="text").reverse().flatMap(o=>{let l=Ui(o.data,t).filter(([,,,p])=>p);if(l.length===0)return[];let u=o.getAbsoluteIndex();return l.map(([p,d,g])=>{let f=n(p);return f.length===4&&{color:{red:f[0]/255,green:f[1]/255,blue:f[2]/255,alpha:f[3]},range:ra(r,u+d,u+g)}}).filter(Boolean)}))}provideColorPresentations(n){let{color:{red:e,green:t,blue:r,alpha:i},range:s}=n,o=`#${hr(e)}${hr(t)}${hr(r)}${i<1?hr(i):""}`;return[{label:o,textEdit:{range:s,newText:o}}]}async provideCompletionItems(n,e){var C,$,L,O,M,F,Q;let{re:t,allTags:r,functions:i,switches:s,protocols:o,params:l,tags:u,ext:p}=A(this,B,sa).call(this),{line:d,character:g}=e,f=n.split(/\r?\n/u,d+1)[d],h=t.exec((C=f==null?void 0:f.slice(0,g))!=null?C:"");if((h==null?void 0:h[1])!==void 0){let R=h[1].startsWith("/");return ce(r,"Class",h[1].slice(R?1:0),e,R&&!(f!=null&&f.slice(g).trim().startsWith(">"))?">":"")}else{if(h!=null&&h[4])return ce(s,"Constant",h[4],e,"",R=>this.data&&A(this,B,Li).call(this,R.slice(2,-2)));if((h==null?void 0:h[5])!==void 0)return ce(o,"Reference",h[5],e)}let m=await A(this,B,$e).call(this,n),x;if(h!=null&&h[2]){x=m.elementFromPoint(h.index+h[2].length-1,d);let R=($=h[3])!=null?$:"";if(h[2]==="{{{")return ce(m.querySelectorAll("arg").filter(E=>E.name&&E!==x).map(({name:E})=>E),"Variable",R,e);let H=R.startsWith(":"),G=H?R.slice(1).trimStart():R;return h[2]==="[["?ce(m.querySelectorAll("link,file,category,redirect-target").filter(E=>E!==x).map(({name:E})=>E),"Folder",G,e):[...ce(i,"Function",R,e,"",E=>this.data&&A(this,B,dr).call(this,E.replace(/^#/u,"").toLowerCase())),...R.startsWith("#")?[]:ce(m.querySelectorAll("template").filter(E=>E!==x).map(E=>{let{name:_}=E;if(H)return _;let{ns:N}=E.getAttribute("title");return N===0?`:${_}`:N===10?_.slice(9):_}),"Folder",G,e)]}let y,w;if((h==null?void 0:h[7])===void 0&&(x=m.elementFromPoint(g,d),{type:y,parentNode:w}=x),(h==null?void 0:h[6])!==void 0||y==="image-parameter"){let R=m.indexFromPos(d,g),H=(O=(L=h==null?void 0:h[6])==null?void 0:L.trimStart())!=null?O:c(this,be).slice(x.getAbsoluteIndex(),R).trimStart(),G=c(this,be).charAt(R)==="=";return[...ce(l,"Property",H,e).filter(({label:E})=>!G||!/[= ]$/u.test(E)),...ce(m.querySelectorAll("image-parameter#width").filter(E=>E!==x).map(E=>E.text()),"Unit",H,e)]}else if((h==null?void 0:h[7])!==void 0||y==="attr-key"){let R=(F=(M=h==null?void 0:h[7])==null?void 0:M.toLowerCase())!=null?F:w.tag,H=(Q=h==null?void 0:h[9])!=null?Q:x.toString().slice(0,g-m.posFromIndex(x.getAbsoluteIndex()).left);if(!u.has(R))return;let G=on[R],E=an[R],_=E&&ce(E,"Field",H,e);return p.includes(R)&&!G?_:[..._!=null?_:[],...R==="meta"||R==="link"?[]:ce(sn,"Property",H,e),...G?ce(G,"Property",H,e):[],...ce(["data-"],"Variable",H,e),...ce(["xmlns:"],"Interface",H,e)]}else if(y==="parameter-key"||y==="parameter-value"&&w.anon){let R=w.parentNode,{type:H,name:G}=R;if(H==="magic-word"&&G!=="invoke")return;let E=m.indexFromPos(d,g),_=c(this,be).slice(x.getAbsoluteIndex(),E).trimStart(),[N,ue]=H==="magic-word"?R.getModule():[];return _?ce(m.querySelectorAll("parameter").filter(ie=>{if(ie===w||ie.anon||ie.parentNode.type!==H||ie.parentNode.name!==G)return!1;if(H==="template")return!0;let[me,pe]=ie.parentNode.getModule();return me===N&&pe===ue}).map(({name:ie})=>ie),"Variable",_,e,y==="parameter-value"?"=":""):void 0}}async provideDiagnostics(n,e=!0){let t=await A(this,B,$e).call(this,n),r=t.lint();return[(e?r:r.filter(({severity:l})=>l==="error")).map(({startLine:l,startCol:u,endLine:p,endCol:d,severity:g,rule:f,message:h,fix:m,suggestions:x})=>({range:{start:{line:l,character:u},end:{line:p,character:d}},severity:g==="error"?1:2,source:"WikiLint",code:f,message:h,data:[...m?[Zo(t,m,!0)]:[],...x?x.map(y=>Zo(t,y)):[]]})),[],[]].flat(2)}async provideFoldingRanges(n){let e=await A(this,B,$e).call(this,n),{length:t}=e.getLines(),r=[],i=new Array(6),s=e.querySelectorAll("heading-title,table,template,magic-word");for(let o of[...s].reverse())o.getRelativeIndex();for(let o of s){let{offsetHeight:l}=o;if(o.type==="heading-title"||l>2){let{top:u}=e.posFromIndex(o.getAbsoluteIndex());if(o.type==="heading-title"){let{level:p}=o.parentNode;for(let d=p-1;d<6;d++){let g=i[d];g!==void 0&&g<u-1&&r.push({startLine:g,endLine:u-1,kind:"region"}),i[d]=void 0}i[p-1]=u+l-1}else r.push({startLine:u,endLine:u+l-2,kind:"region"})}}for(let o of i)o!==void 0&&o<t-1&&r.push({startLine:o,endLine:t-1,kind:"region"});return r}async provideLinks(n){let{articlePath:e,protocol:t}=v.getConfig(),r=e==null?void 0:e.includes("//"),i=new RegExp(`^(?:${t}|//)`,"iu");return(await A(this,B,$e).call(this,n)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${r?",link-target,template-name,invoke-module":""}`).reverse().map(s=>{let{type:o,parentNode:l,firstChild:u,lastChild:p,childNodes:d,length:g}=s,{name:f,tag:h}=l;if(!(o!=="attr-value"||f==="src"&&["templatestyles","img"].includes(h)||f==="cite"&&["blockquote","del","ins","q"].includes(h))||!Jo(d))return!1;let m=d.filter(x=>x.type==="text").map(({data:x})=>x).join("").trim();if(!m)return!1;try{if(s.is("magic-link")||s.is("ext-link-url")||s.is("free-ext-link"))m=s.getUrl(e);else if(o==="link-target"&&(l.is("link")||l.is("redirect-target")||l.is("category"))){if(m.startsWith("/"))return!1;m=l.link.getUrl(e)}else if(o==="template-name")m=l.getAttribute("title").getUrl(e);else if(["link-target","invoke-module"].includes(o)||o==="attr-value"&&f==="src"&&h==="templatestyles"||o==="image-parameter"&&!i.test(m)){if(!r||m.startsWith("/"))return!1;let x=0;o==="attr-value"?x=10:o==="invoke-module"&&(x=828);let y=v.normalizeTitle(m,x,!1,void 0,!0);if(!y.valid)return!1;m=y.getUrl()}if(typeof m=="string"&&m.startsWith("//")&&(m=`https:${m}`),m=new URL(m).href,o==="image-parameter"){let x=u.getBoundingClientRect(),{top:y,left:w,height:C,width:$}=g===1?x:p.getBoundingClientRect();return{range:{start:{line:x.top,character:x.left},end:$t(y,w,C,$)},target:m}}return{range:ar(s),target:m}}catch(x){return!1}}).filter(Boolean)}async provideReferences(n,e){let t=await A(this,B,$e).call(this,n),{offsetNode:r,offset:i}=Yo(t,c(this,be),e),s=r.type==="text"?r.parentNode:r,o=i===0&&(s.type==="ext-attr-dirty"||s.type==="html-attr-dirty")?s.parentNode.parentNode:s,{type:l}=o,u=Wr(o),p=Hr(o);if(!u&&!p&&!bl.has(l))return;let d=Pn(o),g=t.querySelectorAll(l==="heading-title"?"heading":l).filter(f=>l==="attr-value"?Wr(f)===u||Hr(f)===p:Pn(f)===d).reverse().map(f=>({range:ar(f.type==="parameter-key"?f.parentNode:f)}));return g.length===0?void 0:g}async provideDefinition(n,e){let t=await A(this,B,$e).call(this,n),r=t.elementFromPoint(e.character,e.line),i=r.is("ext")&&r.name==="ref"?r:r.closest("ext#ref"),s=lr(i,"name");if(!s)return;let o=lr(i,"group"),l=t.querySelectorAll("ext#ref").filter(u=>u.innerText&&lr(u,"name")===s&&lr(u,"group")===o).reverse().map(({lastChild:u})=>({range:ar(u)}));return l.length===0?void 0:l}async resolveRenameLocation(n,e){let t=await A(this,B,$e).call(this,n),r=t.elementFromPoint(e.character,e.line),{type:i}=r,s=Wr(r),o=Hr(r);return!s&&!o&&(!ta.has(i)||i==="parameter-key"&&/^[1-9]\d*$/u.test(r.parentNode.name)||i==="link-target"&&!["link","redirect-target"].includes(r.parentNode.type))?void 0:ar(r)}async provideRenameEdits(n,e,t){let r=await A(this,B,$e).call(this,n),i=r.elementFromPoint(e.character,e.line),{type:s}=i,o=Wr(i),l=o&&lr(i.parentNode.parentNode,"group"),u=Hr(i),p=Pn(i),d=r.querySelectorAll(s).filter(g=>{let{type:f}=g.parentNode;return s==="link-target"&&f!=="link"&&f!=="redirect-target"?!1:s==="attr-value"?Hr(g)===u||Wr(g)===o&&lr(g.parentNode.parentNode,"group")===l:Pn(g)===p});return d.length===0?void 0:{changes:{"":d.reverse().map(g=>({range:ar(g),newText:t}))}}}async provideHover(n,e){if(!this.data)return;let t=await A(this,B,$e).call(this,n),{offsetNode:r,offset:i}=Yo(t,c(this,be),e),s=r.type==="text"?r.parentNode:r,{type:o,parentNode:l,length:u,name:p}=s,d,g,f;if(s.is("double-underscore")&&i>0)d=A(this,B,Li).call(this,s.innerText.toLowerCase());else if(o==="magic-word-name")d=A(this,B,dr).call(this,l.name),g=s.toString(!0).trim();else if(s.is("magic-word")&&!s.modifier&&u===1&&(i>0||t.posFromIndex(s.getAbsoluteIndex()).left===e.character))d=A(this,B,dr).call(this,p),g=s.firstChild.toString(!0).trim();else if((s.is("magic-word")||s.is("template"))&&s.modifier&&i>=2&&s.getRelativeIndex(0)>i&&(g=s.modifier.trim().slice(0,-1),d=A(this,B,dr).call(this,g.toLowerCase()),d)){let h=s.getAbsoluteIndex();f={start:zr(t,h+2),end:zr(t,h+s.modifier.trimEnd().length+1)}}return d&&{contents:{kind:"markdown",value:(d.signatures?`${d.signatures.map(h=>`- **{{ ${g}${h.length===0?"**":":** "}${h.map(({label:m,const:x})=>x?m:`*${m}*`).join(" **|** ")} **}}**`).join(`
|
|
34
|
+
`))},Ko=function(){if(c(this,U).variants.length>0){let{parseConverter:e}=(_o(),Y(qo));this.setText(e(this.firstChild.toString(),c(this,U),c(this,X)))}};w=$i});var ie,Gt,zn,Zr,ke=v(()=>{"use strict";ie={running:!1,run(a){let{running:n}=this;this.running=!0;try{let{Token:e}=(O(),Y(Mr)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=n,t}catch(e){throw this.running=n,e}},rev:0},Gt=a=>n=>n.type===a,zn=(a,n,e,t=[])=>{var s,o;let r=a.getChildNodes(),i=r.splice(n,e,...t);for(let l=0;l<t.length;l++){let g=t[l];g.setAttribute("parentNode",a),g.setAttribute("nextSibling",r[n+l+1]),g.setAttribute("previousSibling",r[n+l-1])}return(s=r[n-1])==null||s.setAttribute("nextSibling",r[n]),(o=r[n+t.length])==null||o.setAttribute("previousSibling",r[n+t.length-1]),i},Zr=(a,n)=>{Object.defineProperty(a,"name",{value:n.name})}});var Jo={};ae(Jo,{Title:()=>Ii});var Dr,Wr,Ce,ar,bt,Ii,Yo=v(()=>{"use strict";Z();Ii=class{constructor(n,e,t,r,i,s){y(this,Dr);y(this,Wr);y(this,Ce);y(this,ar);y(this,bt);re(this,"valid");re(this,"encoded",!1);let o=n.trim().startsWith("../");if(i&&n.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(n);n=Ge(n),this.encoded=g}catch(g){}if(n=it(n).replace(/[_ ]+/gu," ").trim(),o)T(this,ar,0);else{let g=e;n.startsWith(":")&&(g=0,n=n.slice(1).trim());let p=n.split(":");if(p.length>1){let d=p[0].trim().toLowerCase(),u=Object.prototype.hasOwnProperty.call(t.nsid,d)&&t.nsid[d];u&&(g=u,n=p.slice(1).join(":").trim())}T(this,ar,g)}let l=n.indexOf("#");if(l!==-1){let g=n.slice(l).trim().slice(1);if(g.includes("%"))try{g=Ge(g)}catch(p){}T(this,bt,g.replace(/ /gu,"_")),n=n.slice(0,l).trim()}this.valid=!!(n||s&&this.ns===0&&c(this,bt)!==void 0)&&it(n)===n&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(o?/^(?:\.\.\/)+(.*)/u.exec(n)[1]:n),this.main=n,T(this,Wr,t.namespaces),T(this,Ce,t.articlePath||"/wiki/$1"),c(this,Ce).includes("$1")||T(this,Ce,c(this,Ce)+`${c(this,Ce).endsWith("/")?"":"/"}$1`),r||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return c(this,ar)}get fragment(){return c(this,bt)}get main(){return c(this,Dr)}set main(n){n=n.replace(/_/gu," ").trim(),T(this,Dr,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){let n=c(this,Wr)[this.ns];return n+(n&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:n}=this,e=n.lastIndexOf(".");return e===-1?void 0:n.slice(e+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(n){T(this,bt,n)}getUrl(n){{typeof n=="string"&&(T(this,Ce,n||"/wiki/$1"),c(this,Ce).includes("$1")||T(this,Ce,c(this,Ce)+`${c(this,Ce).endsWith("/")?"":"/"}$1`));let{title:e,fragment:t}=this;return e?c(this,Ce).replace("$1",encodeURIComponent(e)+(t?`#${encodeURIComponent(t)}`:"")):t===void 0?"":`#${encodeURIComponent(t)}`}}};Dr=new WeakMap,Wr=new WeakMap,Ce=new WeakMap,ar=new WeakMap,bt=new WeakMap});var la={};ae(la,{LanguageService:()=>Li,isAttr:()=>Ni,tasks:()=>ra});var ra,bl,Tl,yl,kl,na,vl,Al,Sl,Ni,wl,Zo,Gr,ia,lr,ce,ea,sa,Hr,Ur,dr,Rn,ta,fe,tt,Ue,ze,ur,Vr,pr,cr,Tt,_,zr,$e,Ei,oa,Fi,aa,Pi,gr,Li,da=v(()=>{"use strict";On();Zn();W();Z();H();ra=new WeakMap,bl=new Set(["ref"]),Tl=new Set(["ref","references"]),yl=new Set(["name","extends","follow"]),kl=new Set(["group"]),na=new Set(["arg-name","template-name","magic-word-name","link-target","parameter-key"]),vl=new Set(["ext","html","attr-key","image-parameter","heading-title","heading",...na]),Al=new Set(["text","comment","noinclude","include"]),Sl=["ext","html","table"].map(a=>`${a}-attr#style`).join(),Ni=({type:a,parentNode:n,length:e,firstChild:t},r)=>a==="attr-value"&&e===1&&t.type==="text"&&(!r||n.name==="style"),wl=a=>a.type==="html-attr"||a.type==="table-attr",Zo=a=>a.childNodes.every(({type:n})=>Al.has(n)),Gr=(a,n)=>{let{top:e,left:t}=a.posFromIndex(n);return{line:e,character:t}},ia=(a,n,e)=>({start:Gr(a,n),end:Gr(a,e)}),lr=a=>{let{top:n,left:e,height:t,width:r}=a.getBoundingClientRect();return{start:{line:n,character:e},end:It(n,e,t,r)}},ce=(a,n,e,{line:t,character:r},i,s)=>[...new Set(a)].map(o=>{var g;let l=(g=s==null?void 0:s(o))==null?void 0:g.description;return{label:o,kind:n,textEdit:{range:{start:{line:t,character:r-e.length},end:{line:t,character:r}},newText:o+(i!=null?i:"")},...l&&{documentation:{kind:"markdown",value:l}}}}),ea=(a,n,{line:e,character:t})=>{let r=a.indexFromPos(e,t);return a.caretPositionFromIndex(r+Number(/\w/u.test(n.charAt(r))))},sa=(a,n,e)=>{let{type:t,parentNode:r={}}=a,{name:i,tag:s}=r;return t==="attr-value"&&n.has(s)&&e.has(i)?a.toString().trim():NaN},Hr=a=>sa(a,bl,yl),Ur=a=>sa(a,Tl,kl),dr=(a,n)=>{let e=a==null?void 0:a.getAttr(n);return e!==!0&&e||!1},Rn=a=>{let{type:n,name:e,parentNode:t}=a;switch(n){case"heading":return a.level;case"heading-title":return t.level;case"parameter-key":return`${t.parentNode.name}|${t.name}`;case"ext":case"html":case"image-parameter":return e;default:return t.name}},ta=(a,n,e=!1)=>({range:ia(a,...n.range),newText:n.text,title:`${e?"Fix":"Suggestion"}: ${n.desc}`,fix:e}),Li=class{constructor(n){y(this,_);y(this,fe);y(this,tt);y(this,Ue);y(this,ze);y(this,ur);y(this,Vr);y(this,pr);y(this,cr);y(this,Tt);re(this,"include",!0);re(this,"config");re(this,"data");ra.set(n,this),Object.defineProperties(this,{config:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(n,e,t=!0){let r=await A(this,_,$e).call(this,e);return r.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(i=>{let{type:s,childNodes:o}=i;return s!=="attr-value"&&!Zo(i)?[]:o.filter(l=>l.type==="text").reverse().flatMap(l=>{let{data:g}=l,p=Gi(g,t).filter(([,,,u])=>u);if(p.length===0)return[];let d=l.getAbsoluteIndex();return p.map(([u,m,h])=>{let f=n(u);return f.length===4&&{color:{red:f[0]/255,green:f[1]/255,blue:f[2]/255,alpha:f[3]},range:ia(r,d+m,d+h)}}).filter(Boolean)})})}provideColorPresentations(n){let{color:{red:e,green:t,blue:r,alpha:i},range:s}=n,o=`#${hr(e)}${hr(t)}${hr(r)}${i<1?hr(i):""}`;return[{label:o,textEdit:{range:s,newText:o}}]}async provideCompletionItems(n,e){var L,M,D,F,V,K,me;let{re:t,allTags:r,functions:i,switches:s,protocols:o,params:l,tags:g,ext:p}=A(this,_,aa).call(this),{line:d,character:u}=e,m=n.split(/\r?\n/u,d+1)[d],h=t.exec((L=m==null?void 0:m.slice(0,u))!=null?L:""),[,,f={},x={}]=this.config.doubleUnderscore;if((h==null?void 0:h[1])!==void 0){let E=h[1].startsWith("/");return ce(r,"Class",h[1].slice(E?1:0),e,E&&!(m!=null&&m.slice(u).trim().startsWith(">"))?">":"")}else{if(h!=null&&h[4])return ce(s,"Constant",h[4],e,"",E=>{if(this.data)return E=E.slice(2,-2),E in f?E=f[E]:E in x&&(E=x[E]),A(this,_,Pi).call(this,E.toLowerCase())});if((h==null?void 0:h[5])!==void 0)return ce(o,"Reference",h[5],e)}let b=await A(this,_,$e).call(this,n),k;if(h!=null&&h[2]){k=b.elementFromPoint(h.index+h[2].length-1,d);let E=(M=h[3])!=null?M:"";if(h[2]==="{{{")return ce(b.querySelectorAll("arg").filter(R=>R.name&&R!==k).map(({name:R})=>R),"Variable",E,e);let[B,q]=this.config.parserFunction,I=Array.isArray(q),Q=E.startsWith(":"),xe=Q?E.slice(1).trimStart():E;return h[2]==="[["?ce(b.querySelectorAll("link,file,category,redirect-target").filter(R=>R!==k).map(({name:R})=>R),"Folder",xe,e):[...ce(i,"Function",E,e,"",R=>{if(this.data)R in B?R=B[R]:!I&&R in q&&(R=q[R]);else return;return A(this,_,gr).call(this,R.toLowerCase())}),...E.startsWith("#")?[]:ce(b.querySelectorAll("template").filter(R=>R!==k).map(R=>{let{name:te}=R;if(Q)return te;let{ns:se}=R.getAttribute("title");return se===0?`:${te}`:se===10?te.slice(9):te}),"Folder",xe,e)]}let C,$;if((h==null?void 0:h[7])===void 0&&(k=b.elementFromPoint(u,d),{type:C,parentNode:$}=k),(h==null?void 0:h[6])!==void 0||C==="image-parameter"){let E=b.indexFromPos(d,u),B=(F=(D=h==null?void 0:h[6])==null?void 0:D.trimStart())!=null?F:c(this,fe).slice(k.getAbsoluteIndex(),E).trimStart(),q=c(this,fe).charAt(E)==="=";return[...ce(l,"Property",B,e).filter(({label:I})=>!q||!/[= ]$/u.test(I)),...ce(b.querySelectorAll("image-parameter#width").filter(I=>I!==k).map(I=>I.text()),"Unit",B,e)]}else if((h==null?void 0:h[7])!==void 0||C==="attr-key"){let E=(K=(V=h==null?void 0:h[7])==null?void 0:V.toLowerCase())!=null?K:$.tag,B=(me=h==null?void 0:h[9])!=null?me:k.toString().slice(0,u-b.posFromIndex(k.getAbsoluteIndex()).left);if(!g.has(E))return;let q=an[E],I=ln[E],Q=I&&ce(I,"Field",B,e);return p.includes(E)&&!q?Q:[...Q!=null?Q:[],...E==="meta"||E==="link"?[]:ce(on,"Property",B,e),...q?ce(q,"Property",B,e):[],...ce(["data-"],"Variable",B,e),...ce(["xmlns:"],"Interface",B,e)]}else if(C==="parameter-key"||C==="parameter-value"&&$.anon){let E=$.parentNode,{type:B,name:q}=E;if(B==="magic-word"&&q!=="invoke")return;let I=c(this,fe).slice(k.getAbsoluteIndex(),b.indexFromPos(d,u)).trimStart(),[Q,xe]=B==="magic-word"?E.getModule():[];return I?ce(b.querySelectorAll("parameter").filter(R=>{if(R===$||R.anon||R.parentNode.type!==B||R.parentNode.name!==q)return!1;if(B==="template")return!0;let[te,se]=R.parentNode.getModule();return te===Q&&se===xe}).map(({name:R})=>R),"Variable",I,e,C==="parameter-value"?"=":""):void 0}else if(Ni(k)&&wl($)){let E=Tr.provideValues($.tag,$.name);if(E.length===0)return;let B=c(this,fe).slice(k.getAbsoluteIndex(),b.indexFromPos(d,u)).trimStart();return ce(E.map(({name:q})=>q),"Value",B,e)}}async provideDiagnostics(n,e=!0){let t=await A(this,_,$e).call(this,n),r=t.lint();return[(e?r:r.filter(({severity:l})=>l==="error")).map(({startLine:l,startCol:g,endLine:p,endCol:d,severity:u,rule:m,message:h,fix:f,suggestions:x})=>({range:{start:{line:l,character:g},end:{line:p,character:d}},severity:u==="error"?1:2,source:"WikiLint",code:m,message:h,data:[...f?[ta(t,f,!0)]:[],...x?x.map(b=>ta(t,b)):[]]})),[],[]].flat(2)}async provideFoldingRanges(n){let e=await A(this,_,$e).call(this,n),{length:t}=e.getLines(),r=[],i=new Array(6),s=e.querySelectorAll("heading-title,table,template,magic-word");for(let o of[...s].reverse())o.getRelativeIndex();for(let o of s){let{offsetHeight:l}=o;if(o.type==="heading-title"||l>2){let{top:g}=e.posFromIndex(o.getAbsoluteIndex());if(o.type==="heading-title"){let{level:p}=o.parentNode;for(let d=p-1;d<6;d++){let u=i[d];u!==void 0&&u<g-1&&r.push({startLine:u,endLine:g-1,kind:"region"}),i[d]=void 0}i[p-1]=g+l-1}else r.push({startLine:g,endLine:g+l-2,kind:"region"})}}for(let o of i)o!==void 0&&o<t-1&&r.push({startLine:o,endLine:t-1,kind:"region"});return r}async provideLinks(n){var s;(s=this.config)!=null||(this.config=S.getConfig());let{articlePath:e,protocol:t}=this.config,r=e==null?void 0:e.includes("//"),i=new RegExp(`^(?:${t}|//)`,"iu");return(await A(this,_,$e).call(this,n)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${r?",link-target,template-name,invoke-module":""}`).reverse().map(o=>{let{type:l,parentNode:g,firstChild:p,lastChild:d,childNodes:u,length:m}=o,{name:h,tag:f}=g;if(!(l!=="attr-value"||h==="src"&&["templatestyles","img"].includes(f)||h==="cite"&&["blockquote","del","ins","q"].includes(f))||!Zo(o))return!1;let x=u.filter(b=>b.type==="text").map(({data:b})=>b).join("").trim();if(!x)return!1;try{if(o.is("magic-link")||o.is("ext-link-url")||o.is("free-ext-link"))x=o.getUrl(e);else if(l==="link-target"&&(g.is("link")||g.is("redirect-target")||g.is("category"))){if(x.startsWith("/"))return!1;x=g.link.getUrl(e)}else if(l==="template-name")x=g.getAttribute("title").getUrl(e);else if(["link-target","invoke-module"].includes(l)||l==="attr-value"&&h==="src"&&f==="templatestyles"||l==="image-parameter"&&!i.test(x)){if(!r||x.startsWith("/"))return!1;let b=0;l==="attr-value"?b=10:l==="invoke-module"&&(b=828);let k=S.normalizeTitle(x,b,!1,this.config,!0);if(!k.valid)return!1;x=k.getUrl()}if(typeof x=="string"&&x.startsWith("//")&&(x=`https:${x}`),x=new URL(x).href,l==="image-parameter"){let b=p.getBoundingClientRect(),{top:k,left:C,height:$,width:L}=m===1?b:d.getBoundingClientRect();return{range:{start:{line:b.top,character:b.left},end:It(k,C,$,L)},target:x}}return{range:lr(o),target:x}}catch(b){return!1}}).filter(Boolean)}async provideReferences(n,e){let t=await A(this,_,$e).call(this,n),{offsetNode:r,offset:i}=ea(t,c(this,fe),e),s=r.type==="text"?r.parentNode:r,o=i===0&&(s.type==="ext-attr-dirty"||s.type==="html-attr-dirty")?s.parentNode.parentNode:s,{type:l}=o,g=Hr(o),p=Ur(o);if(!g&&!p&&!vl.has(l))return;let d=Rn(o),u=t.querySelectorAll(l==="heading-title"?"heading":l).filter(m=>l==="attr-value"?Hr(m)===g||Ur(m)===p:Rn(m)===d).reverse().map(m=>({range:lr(m.type==="parameter-key"?m.parentNode:m)}));return u.length===0?void 0:u}async provideDefinition(n,e){let t=await A(this,_,$e).call(this,n),r=t.elementFromPoint(e.character,e.line),i=r.is("ext")&&r.name==="ref"?r:r.closest("ext#ref"),s=dr(i,"name");if(!s)return;let o=dr(i,"group"),l=t.querySelectorAll("ext#ref").filter(g=>g.innerText&&dr(g,"name")===s&&dr(g,"group")===o).reverse().map(({lastChild:g})=>({range:lr(g)}));return l.length===0?void 0:l}async resolveRenameLocation(n,e){let t=await A(this,_,$e).call(this,n),r=t.elementFromPoint(e.character,e.line),{type:i}=r,s=Hr(r),o=Ur(r);return!s&&!o&&(!na.has(i)||i==="parameter-key"&&/^[1-9]\d*$/u.test(r.parentNode.name)||i==="link-target"&&!["link","redirect-target"].includes(r.parentNode.type))?void 0:lr(r)}async provideRenameEdits(n,e,t){let r=await A(this,_,$e).call(this,n),i=r.elementFromPoint(e.character,e.line),{type:s}=i,o=Hr(i),l=o&&dr(i.parentNode.parentNode,"group"),g=Ur(i),p=Rn(i),d=r.querySelectorAll(s).filter(u=>{let{type:m}=u.parentNode;return s==="link-target"&&m!=="link"&&m!=="redirect-target"?!1:s==="attr-value"?Ur(u)===g||Hr(u)===o&&dr(u.parentNode.parentNode,"group")===l:Rn(u)===p});return d.length===0?void 0:{changes:{"":d.reverse().map(u=>({range:lr(u),newText:t}))}}}async provideHover(n,e){if(!this.data)return;let t=await A(this,_,$e).call(this,n),{offsetNode:r,offset:i}=ea(t,c(this,fe),e);r.type==="text"&&(i+=r.getRelativeIndex(),r=r.parentNode);let{type:s,parentNode:o,length:l,name:g}=r,p,d,u;if(r.is("double-underscore")&&i>0)p=A(this,_,Pi).call(this,r.name);else if(s==="magic-word-name")p=A(this,_,gr).call(this,o.name),d=r.toString(!0).trim();else if(r.is("magic-word")&&!r.modifier&&l===1&&(i>0||t.posFromIndex(r.getAbsoluteIndex()).left===e.character))p=A(this,_,gr).call(this,g),d=r.firstChild.toString(!0).trim();else if((r.is("magic-word")||r.is("template"))&&r.modifier&&i>=2&&r.getRelativeIndex(0)>i&&(d=r.modifier.trim().slice(0,-1),p=A(this,_,gr).call(this,d.toLowerCase()),p)){let m=r.getAbsoluteIndex();u={start:Gr(t,m+2),end:Gr(t,m+r.modifier.trimEnd().length+1)}}return p&&{contents:{kind:"markdown",value:(p.signatures?`${p.signatures.map(m=>`- **{{ ${d}${m.length===0?"**":":** "}${m.map(({label:h,const:f})=>f?h:`*${h}*`).join(" **|** ")} **}}**`).join(`
|
|
35
35
|
`)}
|
|
36
36
|
|
|
37
|
-
`:"")+
|
|
37
|
+
`:"")+p.description},range:u!=null?u:lr(r)}}async provideSignatureHelp(n,e){if(!this.data)return;let{line:t,character:r}=e,i=n.split(/\r?\n/u,t+1)[t],{lastChild:s}=await A(this,_,oa).call(this,`${i.slice(0,r+/^[^{}<]*/u.exec(i.slice(r))[0].length)}}}`);if(!s.is("magic-word")||s.length===1)return;let{name:o,childNodes:l,firstChild:g}=s,p=A(this,_,gr).call(this,o);if(!(p!=null&&p.signatures))return;let d=l.length-1,u=p.signatures.filter(f=>{var x;return(f.length>=d||((x=f[f.length-1])==null?void 0:x.rest))&&f.every(({label:b,const:k},C)=>{var L;let $=k&&C<d&&((L=l[C+1])==null?void 0:L.toString(!0).trim());return!$||b.toLowerCase().includes($.toLowerCase())})});if(u.length===0)return;let m=-1;for(let f=s.getAbsoluteIndex()+s.getAttribute("padding");m<d&&(f+=l[m+1].toString().length+1,!(f>r));m++);let h=g.toString(!0).trim();return{signatures:u.map(f=>({label:`{{${h}${f.length===0?"":":"}${f.map(({label:x})=>x).join("|")}}}`,parameters:f.map(({label:x,const:b})=>({label:x,...b?{documentation:"Predefined parameter"}:void 0})),...f.length<d?{activeParameter:Math.min(m,f.length-1)}:void 0})),activeParameter:m}}async provideInlayHints(n){let e=[],t=await A(this,_,$e).call(this,n);for(let r of t.querySelectorAll("template,magic-word#invoke").reverse()){let{type:i,childNodes:s}=r;e.push(...s.slice(i==="template"?1:3).filter(({anon:o})=>o).reverse().map(o=>({position:Gr(t,o.getAbsoluteIndex()),label:`${o.name}=`,kind:2})))}return e}findStyleTokens(){return c(this,ur).querySelectorAll(Sl).filter(({lastChild:n})=>Ni(n))}};fe=new WeakMap,tt=new WeakMap,Ue=new WeakMap,ze=new WeakMap,ur=new WeakMap,Vr=new WeakMap,pr=new WeakMap,cr=new WeakMap,Tt=new WeakMap,_=new WeakSet,zr=function(){return c(this,pr)===this.config&&c(this,cr)===this.include},$e=async function(n){var e;return n=wt(n),!c(this,Ue)&&A(this,_,zr).call(this)&&c(this,fe)===n?c(this,ur):(T(this,fe,n),(e=c(this,Ue))!=null||T(this,Ue,A(this,_,Ei).call(this)),c(this,Ue))},Ei=async function(){var t;(t=this.config)!=null||(this.config=S.getConfig()),T(this,pr,this.config),T(this,cr,this.include);let n=c(this,fe),e=await S.partialParse(n,()=>c(this,fe),this.include,this.config);return A(this,_,zr).call(this)&&c(this,fe)===n?(T(this,ur,e),T(this,Ue,void 0),e):(T(this,Ue,A(this,_,Ei).call(this)),c(this,Ue))},oa=async function(n){var e;return n=wt(n),!c(this,ze)&&A(this,_,zr).call(this)&&c(this,tt)===n?c(this,Vr):(T(this,tt,n),(e=c(this,ze))!=null||T(this,ze,A(this,_,Fi).call(this)),c(this,ze))},Fi=async function(){var t;(t=this.config)!=null||(this.config=S.getConfig()),T(this,pr,this.config),T(this,cr,this.include);let n=c(this,tt),e=await S.partialParse(n,()=>c(this,tt),this.include,this.config);return A(this,_,zr).call(this)&&c(this,tt)===n?(T(this,Vr,e),T(this,ze,void 0),e):(T(this,ze,A(this,_,Fi).call(this)),c(this,ze))},aa=function(){var n;if(!c(this,Tt)||c(this,Tt)[1]!==this.config){(n=this.config)!=null||(this.config=S.getConfig());let{nsid:e,ext:t,html:r,parserFunction:[i,s,...o],doubleUnderscore:l,protocol:g,img:p}=this.config,d=new Set([t,r].flat(2)),u=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(__(?:(?!__)[\p{L}\d_])*)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(e).filter(([,m])=>m===6).map(([m])=>m).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");T(this,Tt,[{re:u,ext:t,tags:d,allTags:[...d,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(i),Array.isArray(s)?s:Object.keys(s),o].flat(2),switches:l.slice(0,2).flat().map(m=>`__${m}__`),protocols:g.split("|"),params:Object.keys(p).filter(m=>m.endsWith("$1")||!m.includes("$1")).map(m=>m.replace(/\$1$/u,""))},this.config])}return c(this,Tt)[0]},Pi=function(n){return this.data.behaviorSwitches.find(({aliases:e})=>e.includes(n))},gr=function(n){return this.data.parserFunctions.find(({aliases:e})=>e.some(t=>t.replace(/^#/u,"")===n))}});var yt,ga,Cl,S,H=v(()=>{zi();ke();Ji();Z();yt={config:Mn,i18n:void 0,rules:Ui,getConfig(a){let n=a!=null?a:this.config,{doubleUnderscore:e}=n;for(let t=0;t<2;t++)e.length>t+2&&e[t].length===0&&(e[t]=Object.keys(e[t+2]));return{...Mn,...n,excludes:[]}},msg(a,n=""){var e,t;return a&&((t=(e=this.i18n)==null?void 0:e[a])!=null?t:a).replace("$1",this.msg(n))},normalizeTitle(a,n=0,e,t=yt.getConfig(),r=!1,i,s=!1,o=!1){let{Title:l}=(Yo(),Y(Jo)),g;if(i)g=new l(a,n,t,r,s,o);else{let{Token:p}=(O(),Y(Mr));g=ie.run(()=>{let d=new p(a,t);d.type="root",d.parseOnce(0,e).parseOnce();let u=new l(d.toString(),n,t,r,s,o);for(let m of["main","fragment"]){let h=u[m];if(h!=null&&h.includes("\0")){let f=d.buildFromStr(h,1);m==="main"?u.main=f:u.setFragment(f)}}return u})}return g},parse(a,n,e=11,t=yt.getConfig()){if(a=wt(a),typeof e!="number"){let s=Array.isArray(e)?e:[e];e=Math.max(...s.map(o=>Hi[o]||11))}let{Token:r}=(O(),Y(Mr));return ie.run(()=>{let s=new r(a,t);return s.type="root",s.parse(e,n)})},async partialParse(a,n,e,t=yt.getConfig()){let{Token:r}=(O(),Y(Mr)),i=typeof setImmediate=="function"?setImmediate:setTimeout,{running:s}=ie;ie.running=!0;let o=new r(wt(a),t);o.type="root";let l=0;return await new Promise(g=>{let p=()=>{n()===a?(l++,i(d,0)):g()},d=()=>{l===12?(o.afterBuild(),g()):(o[l===11?"build":"parseOnce"](l,e),p())};i(d,0)}),ie.running=s,o},createLanguageService(a){var n;{let e=(da(),Y(la)),{LanguageService:t,tasks:r}=e;return(n=r.get(a))!=null?n:new t(a)}}},ga={},Cl=new Set(["normalizeTitle","parse","createLanguageService"]);for(let a in yt)Cl.has(a)||(ga[a]={enumerable:!1});Object.defineProperties(yt,ga);Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:yt});S=yt});H();})();
|
|
38
38
|
//# sourceMappingURL=bundle-lsp.min.js.map
|