wikiparser-node 1.3.2-b → 1.3.3-b
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/bundle/bundle.min.js +27 -27
- package/extensions/dist/base.js +1 -1
- package/extensions/ui.css +1 -4
- package/package.json +1 -1
package/bundle/bundle.min.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
"use strict";(()=>{var ht=Object.defineProperty;var wi=Object.getOwnPropertyDescriptor;var Ci=Object.getOwnPropertyNames;var Ni=Object.prototype.hasOwnProperty;var Fi=(l,i,e)=>i in l?ht(l,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[i]=e;var
|
|
1
|
+
"use strict";(()=>{var ht=Object.defineProperty;var wi=Object.getOwnPropertyDescriptor;var Ci=Object.getOwnPropertyNames;var Ni=Object.prototype.hasOwnProperty;var Fi=(l,i,e)=>i in l?ht(l,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[i]=e;var x=(l,i)=>()=>(l&&(i=l(l=0)),i);var Ei=(l,i)=>()=>(i||l((i={exports:{}}).exports,i),i.exports),z=(l,i)=>{for(var e in i)ht(l,e,{get:i[e],enumerable:!0})},Li=(l,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Ci(i))!Ni.call(l,r)&&r!==e&&ht(l,r,{get:()=>i[r],enumerable:!(t=wi(i,r))||t.enumerable});return l};var R=l=>Li(ht({},"__esModule",{value:!0}),l);var f=(l,i,e)=>(Fi(l,typeof i!="symbol"?i+"":i,e),e),sr=(l,i,e)=>{if(!i.has(l))throw TypeError("Cannot "+e)};var u=(l,i,e)=>(sr(l,i,"read from private field"),e?e.call(l):i.get(l)),k=(l,i,e)=>{if(i.has(l))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(l):i.set(l,e)},S=(l,i,e,t)=>(sr(l,i,"write to private field"),t?t.call(l,e):i.set(l,e),e);var mt=(l,i,e,t)=>({set _(r){S(l,i,r,e)},get _(){return u(l,i,t)}}),F=(l,i,e)=>(sr(l,i,"access private method"),e);var rt,or=x(()=>{"use strict";rt={run(l){return l()}}});var Ur=Ei((ss,Ii)=>{Ii.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","img"]],namespaces:{},nsid:{file:6,category:14},parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"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","#regex":"regex","#related":"related","#cscore":"cscore"},["!","="],["msg","\u539F\u59CB","raw"],["\u66FF\u4EE3","subst","\u5B89\u5168\u66FF\u4EE3","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},variants:[]}});var Dr,fe=x(()=>{"use strict";Dr=Ur()});var Te,xe,J,Hr,se,ct,ft,oe,H=x(()=>{"use strict";Te='(?:\\[[\\da-f:.]+\\]|[^[\\]<>"\\0-\\x1F\\x7F\\p{Zs}\\uFFFD])',xe='(?:[^[\\]<>"\\0-\\x1F\\x7F\\p{Zs}\\uFFFD]|\\0\\d+[c!~]\\x7F)*',J=l=>l.replace(/\0\d+c\x7F/gu,""),Hr=l=>l.replace(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),se=(l,i="")=>l.map(e=>typeof e=="string"?e:e.text()).join(i),ct=l=>l.replace(/&#(\d+|x[\da-f]+);/giu,(i,e)=>String.fromCodePoint(+`${e.toLowerCase().startsWith("x")?"0":""}${e}`)),ft=l=>l.replace(/\n/gu,"\\n"),oe=(l,i={})=>{let{pre:e="",post:t="",sep:r=""}=i;return`${e}${l.map(n=>n.print()).join(r)}${t}`}});var Vr={};z(Vr,{Title:()=>ar});var ar,Xr=x(()=>{"use strict";H();y();ar=class{constructor(i,e=0,t=h.getConfig(),r=!1,n=!1){f(this,"valid");f(this,"ns");f(this,"fragment");f(this,"encoded",!1);let{nsid:s}=t;if(i=ct(i),r&&i.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(i);i=decodeURIComponent(i),this.encoded=g}catch(g){}i=i.replace(/_/gu," ").trim();let o=e;i.startsWith(":")&&(o=0,i=i.slice(1).trim());let a=i.split(":");if(a.length>1){let g=s[a[0].trim().toLowerCase()];g!==void 0&&(o=g,i=a.slice(1).join(":").trim())}this.ns=o;let d=i.indexOf("#");if(d!==-1){let g=i.slice(d+1).trim();this.fragment=g,i=i.slice(0,d).trim()}this.valid=!!(i||n&&this.fragment!==void 0)&&!/\0\d+[eh!+-]\x7F|[<>[\]{}|]|%[\da-f]{2}/iu.test(i)}}});var nt,it,lr,qe,dr=x(()=>{"use strict";qe=class{constructor(){k(this,it);f(this,"childNodes",[]);k(this,nt,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return u(this,nt)}get nextSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)+1]}get previousSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)-1]}get offsetHeight(){return F(this,it,lr).call(this).height}get offsetWidth(){return F(this,it,lr).call(this).width}getAttribute(i){return i==="padding"?0:i in this?String(this[i]):void 0}setAttribute(i,e){i==="parentNode"?S(this,nt,e):this[i]=e}getRootNode(){let{parentNode:i}=this;for(;i!=null&&i.parentNode;)({parentNode:i}=i);return i!=null?i:this}posFromIndex(i){let e=String(this);if(i>=-e.length&&i<=e.length){let t=e.slice(0,i).split(`
|
|
2
2
|
`);return{top:t.length-1,left:t[t.length-1].length}}}getGaps(i){return 0}getRelativeIndex(i){let e,t=(r,n)=>e.slice(0,r).reduce((s,o,a)=>s+String(o).length+n.getGaps(a),0)+n.getAttribute("padding");if(i===void 0){let{parentNode:r}=this;return r?({childNodes:e}=r,t(e.indexOf(this),r)):0}return{childNodes:e}=this,t(i,this)}getAbsoluteIndex(){let{parentNode:i}=this;return i?i.getAbsoluteIndex()+this.getRelativeIndex():0}};nt=new WeakMap,it=new WeakSet,lr=function(){let i=String(this).split(`
|
|
3
|
-
`);return{height:i.length,width:i[i.length-1].length}}});var Tt,Qr=
|
|
4
|
-
`),ne=Re.length+O-1,Z=Re[Re.length-1],ee=Re.length===1?w+Z.length:Z.length,{0:M,length:Ge}=j,ce=Pe+Ge,X=String(F),ie=X[ce],tt=X[Pe-1],$i=Ge>1&&(M!=="<"||/[\s/>]/u.test(ie!=null?ie:""))||M==="{"&&(ie===M||tt==="-")||M==="}"&&(tt===M||ie==="-")||M==="["&&(ie===M||a==="ext-link-text"||!t.slice(V+1).trim()&&g==="free-ext-link")||M==="]"&&(tt===M||!t.slice(0,V).trim()&&p==="free-ext-link")?"error":"warning";(M!=="<"||$.has(B.toLowerCase()))&&m.push({message:h.msg('lonely "$1"',M==="h"?j:M),severity:$i,startIndex:Pe,endIndex:ce,startLine:ne,endLine:ne,startCol:ee,endCol:ee+Ge})}return m}return[]}replaceData(e){N(this,xt,Kr).call(this,e)}print(){let e={"&":"amp","<":"lt",">":"gt"};return this.data.replace(/[&<>]/gu,t=>`&${e[t]};`)}};xt=new WeakSet,Kr=function(e){this.setAttribute("data",e)}});var bt,Jr=b(()=>{"use strict";C();bt=class extends T{constructor(){super(...arguments);f(this,"type","onlyinclude")}toString(e){return`<onlyinclude>${super.toString()}</onlyinclude>`}getAttribute(e){return e==="padding"?13:e==="plain"||super.getAttribute(e)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var ae,Be=b(()=>{"use strict";ae=l=>{class i extends l{text(){return""}lint(){return[]}}return f(i,"hidden",!0),i}});var _,Se=b(()=>{"use strict";Be();be();_=class extends ae(H){constructor(){super(...arguments);f(this,"type","noinclude")}}});var $e,ot,ke,Oe,hr=b(()=>{"use strict";y();C();Oe=class extends T{constructor(e,t,r,n,s=h.getConfig(),o=[]){super(void 0,s);k(this,$e,void 0);k(this,ot,void 0);k(this,ke,void 0);this.setAttribute("name",e.toLowerCase()),S(this,ke,[e,n||e]),S(this,$e,n===void 0),S(this,ot,n!==""),this.append(t,r);let a=typeof t=="string"?-1:o.indexOf(t);o.splice(a===-1?1/0:a,0,this)}get closed(){return u(this,ot)}toString(e){let{firstChild:t,lastChild:r}=this,[n,s]=u(this,ke);return u(this,$e)?`<${n}${t.toString(e)}/>`:`<${n}${t.toString(e)}>${r.toString(e)}${this.closed?`</${s}>`:""}`}text(){let[e,t]=u(this,ke);return u(this,$e)?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?u(this,ke)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,ke);return super.print(u(this,$e)?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};$e=new WeakMap,ot=new WeakMap,ke=new WeakMap});var kt,Yr=b(()=>{"use strict";R();Be();y();hr();kt=class extends ae(Oe){constructor(e,t="",r,n,s=h.getConfig(),o=[]){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",s,o);f(this,"type","include")}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[E(this,{start:e},h.msg("unclosed $1",`<${this.name}>`))]}}});var G,ge=b(()=>{"use strict";y();C();G=class extends T{constructor(i,e,t=h.getConfig(),r=[],n){super(i,t,r,n),this.type=e}}});var qi,ue,en,tn,rn,nn,mr,sn,yt,on,Bi,U,le,je,an=b(()=>{"use strict";R();D();fe();y();C();ge();qi=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),ue=new Set(["align"]),en=new Set(["cite"]),tn=new Set(["cite","datetime"]),rn=new Set(["width"]),nn=new Set(["align","valign","abbr","axis","headers","scope","rowspan","colspan","width","height","bgcolor"]),mr=new Set(["type"]),sn={div:ue,h1:ue,h2:ue,h3:ue,h4:ue,h5:ue,h6:ue,blockquote:en,q:en,p:ue,br:new Set(["clear"]),pre:rn,ins:tn,del:tn,ul:mr,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set(["summary","width","border","frame","rules","cellspacing","cellpadding","align","bgcolor"]),caption:ue,tr:new Set(["bgcolor","align","valign"]),td:nn,th:nn,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:rn,rt:new Set(["rbspan"]),data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails","type"]),poem:new Set(["compact","align"]),categorytree:new Set(["align","hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline","align"])},yt=new Set,on={nowiki:yt,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:yt,inputbox:yt,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:yt,poll:new Set(["id","show-results-before-voting"]),sm2:mr,flashmp3:mr,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"])},Bi=new RegExp("expression|(?:filter|accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u"),je=class extends T{constructor(e,t,r,n="",s,o=[],a=h.getConfig(),d=[]){let g=new G(r,"attr-key",a,d,{}),p;if(r==="title"||t==="img"&&r==="alt")p=new T(s,a,d,{}),p.type="attr-value",p.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let c={...a,excludes:[...a.excludes,"quote","extLink","magicLink","list"]};p=new T(s,c,d,{}),p.type="attr-value",p.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let c={...a,excludes:[...a.excludes,"heading","html","table","hr","list"]};p=new T(s,c,d,{}),p.type="attr-value",p.setAttribute("stage",1)}else p=new G(s,"attr-value",a,d,{});super(void 0,a,d);k(this,U,void 0);k(this,le,void 0);this.type=e,this.append(g,p),S(this,U,n),S(this,le,[...o]),this.tag=t,this.setAttribute("name",J(r).trim().toLowerCase())}get balanced(){return!u(this,U)||u(this,le)[0]===u(this,le)[1]}afterBuild(){u(this,U).includes("\0")&&S(this,U,this.buildFromStr(u(this,U),"string")),this.parentNode&&this.setAttribute("tag",this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(e){let[t="",r=""]=u(this,le);return u(this,U)?`${super.toString(e,`${u(this,U)}${t}`)}${r}`:this.firstChild.toString(e)}text(){return u(this,U)?`${super.text(`${u(this,U).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,U)?u(this,U).length+((t=(e=u(this,le)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex()){var c;let t=super.lint(e),{balanced:r,firstChild:n,lastChild:s,type:o,name:a,tag:d}=this,g=this.getValue(),p;if(!r){let m=this.getRootNode();p={start:e,...m.posFromIndex(e)};let x=v(s,p,h.msg("unclosed $1","quotes"),"warning");t.push({...x,startIndex:x.startIndex-1,startCol:x.startCol-1})}return on[d]&&!on[d].has(a)||(o==="ext-attr"?d in sn:!/\{\{[^{]+\}\}/u.test(a))&&!((c=sn[d])!=null&&c.has(a))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(a)&&(d==="meta"||d==="link"||!qi.has(a))?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"illegal attribute name"))):a==="style"&&typeof g=="string"&&Bi.test(g)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"insecure style"))):a==="tabindex"&&typeof g=="string"&&g.trim()!=="0"&&(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"nonzero tabindex"))),t}getValue(){if(u(this,U)){let e=this.lastChild.text();return u(this,le)[1]?e:e.trim()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,le);return u(this,U)?super.print({sep:`${u(this,U)}${e}`,post:t}):super.print()}};U=new WeakMap,le=new WeakMap});var ln,Oi,ye,At=b(()=>{"use strict";R();D();y();C();ge();an();ln=l=>l.slice(0,-1),Oi=l=>`${ln(l)}-dirty`,ye=class extends T{constructor(i,e,t,r=h.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),i){let s=new RegExp(`([^\\s/](?:(?!\0\\d+~\x7F)[^\\s/=])*)(?:((?:\\s|\0\\d+c\x7F)*(?:=|\0\\d+~\x7F)(?:\\s|\0\\d+c\x7F)*)(?:(["'])(.*?)(\\3|$)|(\\S*)))?`,"gsu"),o="",a=s.exec(i),d=0,g=()=>{o&&(super.insertAt(new G(o,Oi(e),r,n,{})),o="")};for(;a;){let{index:p,0:c,1:m,2:x,3:A,4:F,5:O,6:w}=a;if(o+=i.slice(d,p),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(J(m).trim())){let $=F!=null?F:w,I=[A,O],B=new je(ln(e),t,m,x,$,I,r,n);g(),super.insertAt(B)}else o+=c;({lastIndex:d}=s),a=s.exec(i)}o+=i.slice(d),g()}}afterBuild(){if(this.type==="table-attrs"){let{parentNode:i}=this;this.setAttribute("name",(i==null?void 0:i.type)==="td"&&i.subtype==="caption"?"caption":i==null?void 0:i.type)}}getAttrTokens(i){return this.childNodes.filter(e=>e instanceof je&&(!i||e.name===i.toLowerCase().trim()))}getAttrToken(i){let e=this.getAttrTokens(i);return e[e.length-1]}getAttr(i){var e;return(e=this.getAttrToken(i))==null?void 0:e.getValue()}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),{parentNode:t,length:r,childNodes:n}=this,s=new Map,o=new Set,a;(t==null?void 0:t.type)==="html"&&t.closing&&this.text().trim()&&(a={start:i,...this.getRootNode().posFromIndex(i)},e.push(E(this,a,"attributes of a closing tag")));for(let d=0;d<r;d++){let g=n[d];if(g instanceof G&&g.text().trim())a!=null||(a={start:i,...this.getRootNode().posFromIndex(i)}),e.push(v(g,a,"containing invalid attribute"));else if(g instanceof je){let{name:p}=g;s.has(p)?(o.add(p),s.get(p).push(g)):p!=="class"&&s.set(p,[g])}}if(o.size>0){a!=null||(a={start:i,...this.getRootNode().posFromIndex(i)});for(let d of o)e.push(...s.get(d).map(g=>v(g,a,h.msg("duplicated $1 attribute",d))))}return e}print(){return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(i=>i.print(i instanceof G&&i.text().trim()?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var dn={};z(dn,{PreToken:()=>cr});var cr,pn=b(()=>{"use strict";fe();y();C();Se();cr=class extends T{constructor(e,t=h.getConfig(),r=[]){if(e){let n="<nowiki>",s="</nowiki>",{length:o}=n,a=e.indexOf(n),d=e.indexOf(s,a+o),g="";for(;a!==-1&&d!==-1;)new _(n,t,r),new _(s,t,r),g+=`${e.slice(0,a)}\0${r.length-1}c\x7F${e.slice(a+o,d)}\0${r.length}c\x7F`,e=e.slice(d+o+1),a=e.indexOf(n),d=e.indexOf(s,a+o);e=`${g}${e}`}super(e,t,r,{});f(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}}});var gn={};z(gn,{ParamTagToken:()=>at});var at,fr=b(()=>{"use strict";R();y();C();ge();at=class extends T{constructor(e,t=h.getConfig(),r=[],n={}){super(void 0,t,r,{});f(this,"type","ext-inner");if(e){let s=G;this.append(...e.split(`
|
|
3
|
+
`);return{height:i.length,width:i[i.length-1].length}}});var Tt,Qr=x(()=>{"use strict";H();dr();Tt=class extends qe{get length(){return this.childNodes.length}text(i){return se(this.childNodes,i)}normalize(){let{childNodes:i}=this;for(let e=i.length-1;e>=0;e--){let{type:t,data:r}=i[e],n=i[e-1];t!=="text"||this.getGaps(e-1)||(r===""?i.splice(e,1):(n==null?void 0:n.type)==="text"&&(n.setAttribute("data",n.data+r),i.splice(e,1)))}}removeAt(i){let{childNodes:e}=this,[t]=e.splice(i,1);return t}insertAt(i,e=this.length){let{childNodes:t}=this;return i.setAttribute("parentNode",this),t.splice(e,0,i),i}closest(i){let{parentNode:e}=this,t,r=new Set(i.split(",").map(n=>n.trim()));for(t=n=>r.has(n.type);e;){if(t(e))return e;({parentNode:e}=e)}}append(...i){for(let e of i)this.insertAt(e)}replaceChildren(...i){this.childNodes.length=0,this.append(...i)}setText(i,e=0){let t=this.childNodes[e],{data:r}=t;return t.replaceData(i),r}toString(i,e=""){return this.childNodes.map(t=>t.toString()).join(e)}lint(i=this.getAbsoluteIndex()){let e=[];for(let t=0,r=i+this.getAttribute("padding");t<this.length;t++){let n=this.childNodes[t];e.push(...n.lint(r)),r+=String(n).length+this.getGaps(t)}return e}print(i={}){var e;return String(this)?`<span class="wpb-${(e=i.class)!=null?e:this.type}">${oe(this.childNodes,i)}</span>`:""}}});var v,L,G=x(()=>{"use strict";y();v=(l,i,e,t="error")=>{let r=l.getRelativeIndex(),{offsetHeight:n,offsetWidth:s,parentNode:o}=l,{top:a,left:d}=o.posFromIndex(r),{start:g}=i,{top:p,left:m}="top"in i?i:l.getRootNode().posFromIndex(g),c=g+r,b=p+a,A=a?d:m+d;return{message:h.msg(e),severity:t,startIndex:c,endIndex:c+String(l).length,startLine:b,endLine:b+n-1,startCol:A,endCol:n===1?A+s:s}},L=(l,i,e,t="error")=>{let{start:r}=i,{offsetHeight:n,offsetWidth:s}=l,{top:o,left:a}="top"in i?i:l.getRootNode().posFromIndex(r);return{message:h.msg(e),severity:t,startIndex:r,endIndex:r+String(l).length,startLine:o,endLine:o+n-1,startCol:a,endCol:n===1?a+s:s}}});var V,be=x(()=>{"use strict";y();C();V=class extends T{get innerText(){return this.firstChild.data}constructor(i="",e=h.getConfig(),t=[]){super(i,e,t)}}});var gr={};z(gr,{NowikiToken:()=>pr});var pr,ur=x(()=>{"use strict";G();y();be();pr=class extends V{constructor(){super(...arguments);f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let{name:t,firstChild:{data:r}}=this;return(t==="templatestyles"||t==="section")&&r?[L(this,{start:e},h.msg("nothing should be in <$1>",t))]:super.lint(e)}}});var Pi,Ri,Gi,xt,Kr,st,Zr=x(()=>{"use strict";y();dr();Pi=/<\s*\/?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+|https?[:/]\/+/giu,Ri=/<\s*\/?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+/giu,Gi=["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"],st=class extends qe{constructor(e){super();k(this,xt);f(this,"type","text");f(this,"data","");this.data=e}toString(){return this.data}text(){return this.data}lint(e=this.getAbsoluteIndex()){let{data:t,parentNode:r,nextSibling:n,previousSibling:s}=this,{NowikiToken:o}=(ur(),R(gr)),{type:a,name:d}=r,g=n==null?void 0:n.type,p=s==null?void 0:s.type,m;a==="ext-inner"&&(d==="pre"||r instanceof o)?m=new RegExp(`<\\s*\\/?(${d})\\b`,"giu"):a==="free-ext-link"||a==="ext-link-url"||a==="image-parameter"&&d==="link"||a==="attr-value"?m=Ri:m=Pi;let c=[],{ext:b,html:A}=this.getRootNode().getAttribute("config");if(t.search(m)!==-1){m.lastIndex=0;let N=this.getRootNode(),{top:P,left:w}=N.posFromIndex(e),$=new Set(["onlyinclude","noinclude","includeonly",b,A,Gi].flat(2));for(let I=m.exec(t);I;I=m.exec(t)){let[,j,E]=I,{0:O,index:U}=I;if(E&&E!=="]"){let{length:_r}=E;U+=_r,O=O.slice(_r)}let Pe=e+U,Re=t.slice(0,U).split(`
|
|
4
|
+
`),ne=Re.length+P-1,Z=Re[Re.length-1],ee=Re.length===1?w+Z.length:Z.length,{0:M,length:Ge}=O,ce=Pe+Ge,X=String(N),ie=X[ce],tt=X[Pe-1],$i=Ge>1&&(M!=="<"||/[\s/>]/u.test(ie!=null?ie:""))||M==="{"&&(ie===M||tt==="-")||M==="}"&&(tt===M||ie==="-")||M==="["&&(ie===M||a==="ext-link-text"||!t.slice(U+1).trim()&&g==="free-ext-link")||M==="]"&&(tt===M||!t.slice(0,U).trim()&&p==="free-ext-link")?"error":"warning";(M!=="<"||$.has(j.toLowerCase()))&&c.push({message:h.msg('lonely "$1"',M==="h"?O:M),severity:$i,startIndex:Pe,endIndex:ce,startLine:ne,endLine:ne,startCol:ee,endCol:ee+Ge})}return c}return[]}replaceData(e){F(this,xt,Kr).call(this,e)}print(){let e={"&":"amp","<":"lt",">":"gt"};return this.data.replace(/[&<>]/gu,t=>`&${e[t]};`)}};xt=new WeakSet,Kr=function(e){this.setAttribute("data",e)}});var bt,Jr=x(()=>{"use strict";C();bt=class extends T{constructor(){super(...arguments);f(this,"type","onlyinclude")}toString(e){return`<onlyinclude>${super.toString()}</onlyinclude>`}getAttribute(e){return e==="padding"?13:e==="plain"||super.getAttribute(e)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var ae,Be=x(()=>{"use strict";ae=l=>{class i extends l{text(){return""}lint(){return[]}}return f(i,"hidden",!0),i}});var _,Se=x(()=>{"use strict";Be();be();_=class extends ae(V){constructor(){super(...arguments);f(this,"type","noinclude")}}});var $e,ot,ke,Oe,hr=x(()=>{"use strict";y();C();Oe=class extends T{constructor(e,t,r,n,s=h.getConfig(),o=[]){super(void 0,s);k(this,$e,void 0);k(this,ot,void 0);k(this,ke,void 0);this.setAttribute("name",e.toLowerCase()),S(this,ke,[e,n||e]),S(this,$e,n===void 0),S(this,ot,n!==""),this.append(t,r);let a=typeof t=="string"?-1:o.indexOf(t);o.splice(a===-1?1/0:a,0,this)}get closed(){return u(this,ot)}toString(e){let{firstChild:t,lastChild:r}=this,[n,s]=u(this,ke);return u(this,$e)?`<${n}${t.toString(e)}/>`:`<${n}${t.toString(e)}>${r.toString(e)}${this.closed?`</${s}>`:""}`}text(){let[e,t]=u(this,ke);return u(this,$e)?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?u(this,ke)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,ke);return super.print(u(this,$e)?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};$e=new WeakMap,ot=new WeakMap,ke=new WeakMap});var kt,Yr=x(()=>{"use strict";G();Be();y();hr();kt=class extends ae(Oe){constructor(e,t="",r,n,s=h.getConfig(),o=[]){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",s,o);f(this,"type","include")}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[L(this,{start:e},h.msg("unclosed $1",`<${this.name}>`))]}}});var q,ge=x(()=>{"use strict";y();C();q=class extends T{constructor(i,e,t=h.getConfig(),r=[],n){super(i,t,r,n),this.type=e}}});var qi,ue,en,tn,rn,nn,mr,sn,yt,on,Bi,D,le,je,an=x(()=>{"use strict";G();H();fe();y();C();ge();qi=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),ue=new Set(["align"]),en=new Set(["cite"]),tn=new Set(["cite","datetime"]),rn=new Set(["width"]),nn=new Set(["align","valign","abbr","axis","headers","scope","rowspan","colspan","width","height","bgcolor"]),mr=new Set(["type"]),sn={div:ue,h1:ue,h2:ue,h3:ue,h4:ue,h5:ue,h6:ue,blockquote:en,q:en,p:ue,br:new Set(["clear"]),pre:rn,ins:tn,del:tn,ul:mr,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set(["summary","width","border","frame","rules","cellspacing","cellpadding","align","bgcolor"]),caption:ue,tr:new Set(["bgcolor","align","valign"]),td:nn,th:nn,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:rn,rt:new Set(["rbspan"]),data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails","type"]),poem:new Set(["compact","align"]),categorytree:new Set(["align","hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline","align"])},yt=new Set,on={nowiki:yt,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:yt,inputbox:yt,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:yt,poll:new Set(["id","show-results-before-voting"]),sm2:mr,flashmp3:mr,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"])},Bi=new RegExp("expression|(?:filter|accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u"),je=class extends T{constructor(e,t,r,n="",s,o=[],a=h.getConfig(),d=[]){let g=new q(r,"attr-key",a,d,{}),p;if(r==="title"||t==="img"&&r==="alt")p=new T(s,a,d,{}),p.type="attr-value",p.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let m={...a,excludes:[...a.excludes,"quote","extLink","magicLink","list"]};p=new T(s,m,d,{}),p.type="attr-value",p.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let m={...a,excludes:[...a.excludes,"heading","html","table","hr","list"]};p=new T(s,m,d,{}),p.type="attr-value",p.setAttribute("stage",1)}else p=new q(s,"attr-value",a,d,{});super(void 0,a,d);k(this,D,void 0);k(this,le,void 0);this.type=e,this.append(g,p),S(this,D,n),S(this,le,[...o]),this.tag=t,this.setAttribute("name",J(r).trim().toLowerCase())}get balanced(){return!u(this,D)||u(this,le)[0]===u(this,le)[1]}afterBuild(){u(this,D).includes("\0")&&S(this,D,this.buildFromStr(u(this,D),"string")),this.parentNode&&this.setAttribute("tag",this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(e){let[t="",r=""]=u(this,le);return u(this,D)?`${super.toString(e,`${u(this,D)}${t}`)}${r}`:this.firstChild.toString(e)}text(){return u(this,D)?`${super.text(`${u(this,D).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,D)?u(this,D).length+((t=(e=u(this,le)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex()){var m;let t=super.lint(e),{balanced:r,firstChild:n,lastChild:s,type:o,name:a,tag:d}=this,g=this.getValue(),p;if(!r){let c=this.getRootNode();p={start:e,...c.posFromIndex(e)};let b=v(s,p,h.msg("unclosed $1","quotes"),"warning");t.push({...b,startIndex:b.startIndex-1,startCol:b.startCol-1})}return on[d]&&!on[d].has(a)||(o==="ext-attr"?d in sn:!/\{\{[^{]+\}\}/u.test(a))&&!((m=sn[d])!=null&&m.has(a))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(a)&&(d==="meta"||d==="link"||!qi.has(a))?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"illegal attribute name"))):a==="style"&&typeof g=="string"&&Bi.test(g)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"insecure style"))):a==="tabindex"&&typeof g=="string"&&g.trim()!=="0"&&(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"nonzero tabindex"))),t}getValue(){if(u(this,D)){let e=this.lastChild.text();return u(this,le)[1]?e:e.trim()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,le);return u(this,D)?super.print({sep:`${u(this,D)}${e}`,post:t}):super.print()}};D=new WeakMap,le=new WeakMap});var ln,Oi,ye,At=x(()=>{"use strict";G();H();y();C();ge();an();ln=l=>l.slice(0,-1),Oi=l=>`${ln(l)}-dirty`,ye=class extends T{constructor(i,e,t,r=h.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),i){let s=new RegExp(`([^\\s/](?:(?!\0\\d+~\x7F)[^\\s/=])*)(?:((?:\\s|\0\\d+c\x7F)*(?:=|\0\\d+~\x7F)(?:\\s|\0\\d+c\x7F)*)(?:(["'])(.*?)(\\3|$)|(\\S*)))?`,"gsu"),o="",a=s.exec(i),d=0,g=()=>{o&&(super.insertAt(new q(o,Oi(e),r,n,{})),o="")};for(;a;){let{index:p,0:m,1:c,2:b,3:A,4:N,5:P,6:w}=a;if(o+=i.slice(d,p),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(J(c).trim())){let $=N!=null?N:w,I=[A,P],j=new je(ln(e),t,c,b,$,I,r,n);g(),super.insertAt(j)}else o+=m;({lastIndex:d}=s),a=s.exec(i)}o+=i.slice(d),g()}}afterBuild(){if(this.type==="table-attrs"){let{parentNode:i}=this;this.setAttribute("name",(i==null?void 0:i.type)==="td"&&i.subtype==="caption"?"caption":i==null?void 0:i.type)}}getAttrTokens(i){return this.childNodes.filter(e=>e instanceof je&&(!i||e.name===i.toLowerCase().trim()))}getAttrToken(i){let e=this.getAttrTokens(i);return e[e.length-1]}getAttr(i){var e;return(e=this.getAttrToken(i))==null?void 0:e.getValue()}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),{parentNode:t,length:r,childNodes:n}=this,s=new Map,o=new Set,a;(t==null?void 0:t.type)==="html"&&t.closing&&this.text().trim()&&(a={start:i,...this.getRootNode().posFromIndex(i)},e.push(L(this,a,"attributes of a closing tag")));for(let d=0;d<r;d++){let g=n[d];if(g instanceof q&&g.text().trim())a!=null||(a={start:i,...this.getRootNode().posFromIndex(i)}),e.push(v(g,a,"containing invalid attribute"));else if(g instanceof je){let{name:p}=g;s.has(p)?(o.add(p),s.get(p).push(g)):p!=="class"&&s.set(p,[g])}}if(o.size>0){a!=null||(a={start:i,...this.getRootNode().posFromIndex(i)});for(let d of o)e.push(...s.get(d).map(g=>v(g,a,h.msg("duplicated $1 attribute",d))))}return e}print(){return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(i=>i.print(i instanceof q&&i.text().trim()?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var dn={};z(dn,{PreToken:()=>cr});var cr,pn=x(()=>{"use strict";fe();y();C();Se();cr=class extends T{constructor(e,t=h.getConfig(),r=[]){if(e){let n="<nowiki>",s="</nowiki>",{length:o}=n,a=e.indexOf(n),d=e.indexOf(s,a+o),g="";for(;a!==-1&&d!==-1;)new _(n,t,r),new _(s,t,r),g+=`${e.slice(0,a)}\0${r.length-1}c\x7F${e.slice(a+o,d)}\0${r.length}c\x7F`,e=e.slice(d+o+1),a=e.indexOf(n),d=e.indexOf(s,a+o);e=`${g}${e}`}super(e,t,r,{});f(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}}});var gn={};z(gn,{ParamTagToken:()=>at});var at,fr=x(()=>{"use strict";G();y();C();ge();at=class extends T{constructor(e,t=h.getConfig(),r=[],n={}){super(void 0,t,r,{});f(this,"type","ext-inner");if(e){let s=q;this.append(...e.split(`
|
|
5
5
|
`).map(o=>new s(o,"param-line",t,r,{})))}}toString(e){return super.toString(e,`
|
|
6
6
|
`)}text(){return super.text(`
|
|
7
7
|
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t;return this.childNodes.filter(r=>{let{childNodes:n}=r,s=n.findIndex(({type:a})=>a!=="text"),o=(s>=0?n.slice(0,s).map(String).join(""):String(r)).trim();return o&&!(s>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(o)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,h.msg("invalid parameter of $1",this.name))))}print(){return super.print({sep:`
|
|
8
|
-
`})}}});var de,lt=
|
|
9
|
-
`,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},o=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"]]),a=new RegExp(t,"gmu"),d=a.exec(l),g=l.includes("}}"),p;for(;d||p!==void 0&&p<=l.length&&((
|
|
10
|
-
`,index:l.length},I=(A=n.pop())!=null?A:{},{0:
|
|
11
|
-
`){p=$+1;let{pos:Z,findEqual:ee}=(F=n[n.length-1])!=null?F:{};if(Z===void 0||ee||J(l.slice(Z,L))!==""){let M=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(l.slice(L,$));M&&(l=`${l.slice(0,L)}\0${e.length}h\x7F${l.slice($)}`,p=L+4+String(e.length).length,new ze(M[1].length,M.slice(2),i,e))}}else if(w==="|"||Re)p=$+1,j[j.length-1].push(l.slice(Pe,$)),w==="|"&&j.push([]),I.pos=p,I.findEqual=w==="|",n.push(I);else if(w.startsWith("}}")){let Z=w.slice(0,Math.min(B.length,3)),ee=B.length-Z.length,{length:M}=e;p=$+Z.length,j[j.length-1].push(l.slice(Pe,$));let Ge=!1,ce="t";if(Z.length===3){let X=j.map(tt=>tt.join("=")),ie=X.length>1&&J(X[1]).trim();new Ft(X,i,e),ie&&ie.endsWith(":")&&r.includes(ie.slice(0,-1).toLowerCase())&&(ce="s")}else try{new $t(j[0][0],j.slice(1),i,e);let X=J(j[0][0]).trim();o.has(X)?ce=o.get(X):/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(X)?ce="m":/^#vardefine:./iu.test(X)&&(ce="c")}catch(X){if(X instanceof SyntaxError&&X.message.startsWith("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0\uFF1A"))Ge=!0;else throw X}Ge||(l=`${l.slice(0,L+ee)}\0${M}${ce}\x7F${l.slice(p)}`,p=L+ee+3+String(M).length,ee>1?n.push({0:B.slice(0,ee),index:L,pos:L+ee,parts:[[]]}):ee===1&&l[L-1]==="-"&&n.push({0:"-{",index:L-1,pos:L+1,parts:[[]]}))}else p=$+w.length,w.startsWith("{")&&(d.pos=p,d.parts=[[]]),n.push(..."0"in I?[I]:[],d);g&&(g=l.slice(p).includes("}}"));let ne=n[n.length-1];!g&&((O=ne==null?void 0:ne[0])!=null&&O.startsWith("{"))&&(n.pop(),ne=n[n.length-1]),a=new RegExp(t+(ne?`|${s[ne[0][0]]}${ne.findEqual?"|=":""}`:""),"gmu"),a.lastIndex=p,d=a.exec(l)}return l}});var bn={};z(bn,{InputboxToken:()=>kr});var kr,kn=b(()=>{"use strict";br();y();fr();kr=class extends at{constructor(i,e=h.getConfig(),t=[]){let r=Symbol("InputboxToken");t.push(r),i&&(i=xr(i,e,t)),t.splice(t.indexOf(r),1),super(i,e,t,{})}}});var Me,yr=b(()=>{"use strict";R();Be();y();be();Me=class extends ae(H){constructor(e,t=!0,r=h.getConfig(),n=[]){super(e,r,n);f(this,"type","comment");f(this,"closed");this.closed=t}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[E(this,{start:e},h.msg("unclosed $1","HTML comment"))]}toString(e){return`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}}});var Et={};z(Et,{NestedToken:()=>Ar});var Ar,Lt=b(()=>{"use strict";R();y();C();vr();Se();yr();Ar=class extends T{constructor(e,t,r,n=h.getConfig(),s=[]){var o;e=(o=e==null?void 0:e.replace(t,(a,d,g,p,c)=>{let m=`\0${s.length+1}${d?"e":"c"}\x7F`;if(d)new _e(d,g,p,c,n,s);else{let x=a.endsWith("-->");new Me(a.slice(4,x?-3:void 0),x,n,s)}return m}))==null?void 0:o.replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(a,d,g)=>(new _(g,n,s),`${d}\0${s.length}c\x7F`));super(e,n,s,{});f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let t;return[...super.lint(e),...this.childNodes.filter(r=>{if(r.type==="ext"||r.type==="comment")return!1;let n=String(r).trim();return n&&!/^<!--.*-->$/su.test(n)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,h.msg("invalid content in <$1>",this.name))))]}}});var Ne,te,Fe,Ae,It=b(()=>{"use strict";R();fe();y();C();ge();Ae=class extends T{constructor(e,t,r=h.getConfig(),n=[],s="|"){super(void 0,r,n,{});k(this,Ne,!0);k(this,te,void 0);k(this,Fe,void 0);if(this.insertAt(new G(e,"link-target",r,n,{})),t!==void 0){let o=new T(t,r,n,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}S(this,te,s)}afterBuild(){S(this,Fe,this.getTitle()),u(this,te).includes("\0")&&S(this,te,this.buildFromStr(u(this,te),"string"))}setAttribute(e,t){e==="bracket"?S(this,Ne,!!t):e==="title"?S(this,Fe,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,u(this,te));return u(this,Ne)?`[[${t}]]`:t}text(){let e=super.text("|");return u(this,Ne)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,Fe):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,te).length:1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{childNodes:[r,n],type:s}=this,{encoded:o,fragment:a}=u(this,Fe),d;return s==="link"&&r.childNodes.some(({type:g})=>g==="template")&&(d={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,d,"template in an internal link target","warning"))),o&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"unnecessary URL encoding in an internal link"))),s==="link"&&(n!=null&&n.childNodes.some(({type:g,data:p})=>g==="text"&&p.includes("|")))?(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,d,'additional "|" in the link text',"warning"))):s!=="link"&&a!==void 0&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"useless fragment"))),t}getTitle(){return this.normalizeTitle(this.firstChild.text(),0,!1,!0,!0)}print(){return super.print(u(this,Ne)?{pre:"[[",post:"]]",sep:u(this,te)}:{sep:u(this,te)})}};Ne=new WeakMap,te=new WeakMap,Fe=new WeakMap});function yn(l,i,e=h.getConfig(),t=!1){i=i.trim();let r=i.replace(/\0\d+t\x7F/gu,"").trim();switch(l){case"width":return!r||/^(?:\d+x?|\d*x\d+)$/u.test(r);case"link":{if(!r||new RegExp(`^(?:(?:${e.protocol}|//)${Te}|\0\\d+m\x7F)${xe}$`,"iu").test(r))return i;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2));let s=h.normalizeTitle(r,0,!1,e,t,!0,!0);return s.valid&&s}case"lang":return!r||e.variants.includes(r);case"alt":case"class":case"manualthumb":return!0;default:return!Number.isNaN(Number(r))}}var Wi,K,Pt,An=b(()=>{"use strict";D();R();y();C();Wi=new Set(["alt","link","lang","page","caption"]);Pt=class extends T{constructor(e,t=h.getConfig(),r=[]){var i=(...args)=>{super(...args);f(this,"type","image-parameter");k(this,K,"")};var a;let n,s=Object.entries(t.img).map(([d,g])=>[d,g,new RegExp(`^(\\s*)${d.replace("$1","(.*)")}(\\s*)$`,"u")]),o=s.find(([,d,g])=>(n=g.exec(e),n&&(n.length!==4||yn(d,n[2],t,!0)!==!1)));if(o&&n){n.length===3?(i(void 0,t,r),S(this,K,e)):(i(n[2],t,r,{}),S(this,K,`${n[1]}${o[0]}${n[3]}`)),this.setAttribute("name",o[1]);return}i(e,{...t,excludes:[...(a=t.excludes)!=null?a:[],"list"]},r),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get link(){return this.name==="link"?yn("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Wi.has(this.name)&&this.setAttribute("name","invalid")}toString(e){return u(this,K)?u(this,K).replace("$1",super.toString(e)):super.toString(e)}text(){return u(this,K)?u(this,K).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,u(this,K).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{link:r,name:n}=this;return n==="invalid"?t.push(E(this,{start:e},"invalid gallery image parameter")):typeof r=="object"&&r.encoded&&t.push(E(this,{start:e},"unnecessary URL encoding in an internal link")),t}print(){return u(this,K)?this.name==="invalid"?`<span class="wpb-image-invalid">${u(this,K).replace("$1",oe(this.childNodes))}</span>`:`<span class="wpb-image-parameter">${u(this,K).replace("$1",`<span class="wpb-image-caption">${oe(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};K=new WeakMap});var Sr,$r,wr,zi,Ue,Rt,De,Cr=b(()=>{"use strict";D();R();y();It();An();Sr=new Set(["manualthumb","frameless","framed","thumbnail"]),$r=new Set(["left","right","center","none"]),wr=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),zi=(l,i,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[l,i,e].map(Hr).join("|")}`,"gu"),n=[],s=r.exec(t),o=0,a=0;for(;s;){let{0:d,index:g}=s;d!==e?o+=d===l?1:-1:o===0&&(n.push(t.slice(a,g)),{lastIndex:a}=r),s=r.exec(t)}return n.push(t.slice(a)),n},De=class extends Ae{constructor(e,t,r=h.getConfig(),n=[],s="|"){super(e,void 0,r,n,s);k(this,Ue);f(this,"type","file");this.append(...zi("-{","}-","|",t).map(o=>new Pt(o,r,n)))}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r=this.getAllArgs().filter(({childNodes:p})=>{let c=p.filter(m=>m.text().trim());return c.length!==1||c[0].type!=="arg"}),n=[...new Set(r.map(({name:p})=>p))].filter(p=>p!=="invalid"),s=n.filter(p=>Sr.has(p)),o=n.filter(p=>$r.has(p)),a=n.filter(p=>wr.has(p));if(r.length===n.length&&s.length<2&&o.length<2&&a.length<2)return t;let d={start:e,...this.getRootNode().posFromIndex(e)},g=(p,c)=>m=>v(m,d,h.msg(`${p} image $1 parameter`,c));for(let p of n){let c=r.filter(({name:m})=>m===p);p==="caption"&&(c=[...c.slice(0,-1).filter(m=>m.text()),...c.slice(-1)]),c.length>1&&t.push(...c.map(g("duplicated",p)))}return s.length>1&&t.push(...r.filter(({name:p})=>Sr.has(p)).map(g("conflicting","frame"))),o.length>1&&t.push(...r.filter(({name:p})=>$r.has(p)).map(g("conflicting","horizontal-alignment"))),a.length>1&&t.push(...r.filter(({name:p})=>wr.has(p)).map(g("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getFrameArgs(){return N(this,Ue,Rt).call(this,Sr,"\u6846\u67B6")}getHorizAlignArgs(){return N(this,Ue,Rt).call(this,$r,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return N(this,Ue,Rt).call(this,wr,"\u5782\u76F4\u5BF9\u9F50")}};Ue=new WeakSet,Rt=function(e,t){return this.getAllArgs().filter(({name:n})=>e.has(n))}});var Gt,vn,He,Nr=b(()=>{"use strict";R();fe();y();C();Cr();He=class extends De{constructor(e,t,r,n=h.getConfig(),s=[]){let o;if(r!==void 0){o=new T(r,n,s),o.type="plain";for(let a=1;a<11;a++)o.parseOnce();s.splice(s.indexOf(o),1)}super(t,o==null?void 0:o.toString(),n,s);k(this,Gt);this.setAttribute("bracket",!1),this.type=`${e}-image`}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(String(this.firstChild),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{ns:r}=this.getAttribute("title");return r!==6&&t.push(E(this,{start:e},"invalid gallery image")),t}afterBuild(){N(this,Gt,vn).call(this,this.getTitle())}};Gt=new WeakSet,vn=function(e){this.setAttribute("title",e)}});var $n={};z($n,{GalleryToken:()=>Fr});var qt,Sn,Fr,wn=b(()=>{"use strict";y();C();Nr();Se();Fr=class extends T{constructor(e,t=h.getConfig(),r=[]){var n;super(void 0,t,r,{});k(this,qt);f(this,"type","ext-inner");for(let s of(n=e==null?void 0:e.split(`
|
|
12
|
-
`))!=null?n:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new _(s,t):s);continue}let[,a,d]=o;
|
|
8
|
+
`})}}});var de,lt=x(()=>{"use strict";y();C();de=class extends T{constructor(i,e,t="plain",r=h.getConfig(),n=[],s){super(i,r,n,s),this.type=t}lint(){return[]}}});var dt,We,vt,ze,Tr=x(()=>{"use strict";G();y();C();lt();ze=class extends T{constructor(e,t,r=h.getConfig(),n=[]){super(void 0,r,n);k(this,We);f(this,"type","heading");k(this,dt,void 0);S(this,dt,e);let s=new T(t[0],r,n);s.type="heading-title",s.setAttribute("stage",2);let o=new de(t[1],/^[^\S\n]*$/u,"heading-trail",r,n,{});this.append(s,o)}get level(){return u(this,dt)}toString(e){let t=u(this,We,vt);return`${t}${this.firstChild.toString()}${t}${this.lastChild.toString()}`}text(){let e=u(this,We,vt);return`${e}${this.firstChild.text()}${e}`}getAttribute(e){return e==="padding"?super.getAttribute("padding")+this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{firstChild:r}=this,n=String(r),s;return this.level===1&&(s=v(r,{start:e},"<h1>"),t.push(s)),(n.startsWith("=")||n.endsWith("="))&&(s!=null||(s=v(r,{start:e},"")),t.push({...s,message:h.msg('unbalanced "=" in a section header')})),this.closest("html-attrs, table-attrs")&&t.push({...L(this,{start:e},""),message:h.msg("section header in a HTML tag")}),t}print(){let e=u(this,We,vt);return super.print({pre:e,sep:e})}};dt=new WeakMap,We=new WeakSet,vt=function(){return"=".repeat(this.level)}});var ji,St,un=x(()=>{"use strict";H();G();y();C();ji=l=>l.toString(new Set(["comment","noinclude","include"])).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),St=class extends T{constructor(e,t,r=h.getConfig(),n=[]){super(void 0,r,n);f(this,"type","parameter");let s=new T(typeof e=="number"?void 0:e,r,n,{}),o=new T(t,r,n);s.type="parameter-key",o.type="parameter-value",o.setAttribute("stage",2),this.append(s,o)}get anon(){return this.firstChild.length===0}afterBuild(){if(!this.anon){let{parentNode:e,firstChild:t}=this,r=ji(t);this.setAttribute("name",r),e&&e.getArgs(r,!1,!1).add(this)}}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex()){var s;let t=super.lint(e),{firstChild:r}=this,n=(s=new RegExp(`https?://${Te}${xe}$`,"iu").exec(r.toString(new Set(["comment","noinclude","include"]))))==null?void 0:s[0];if(n&&new URL(n).search){let o=v(r,{start:e},"unescaped query string in an anonymous parameter");t.push({...o,startIndex:o.endIndex,endIndex:o.endIndex+1,startLine:o.endLine,startCol:o.endCol,endCol:o.endCol+1})}return t}print(){return super.print({sep:this.anon?"":"="})}}});var we,Ce,wt,hn,Ct,mn,$t,cn=x(()=>{"use strict";H();G();y();C();un();ge();lt();$t=class extends T{constructor(e,t,r=h.getConfig(),n=[]){var m,c;super(void 0,r,n,{});k(this,wt);k(this,Ct);f(this,"type","template");f(this,"modifier","");k(this,we,!1);k(this,Ce,new Map);let{parserFunction:[s,o]}=r,a=(m=/^(?:\s|\0\d+c\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:m[0];if(a)this.setAttribute("modifier",a),e=e.slice(a.length);else if(e.includes(":")){let[b,...A]=e.split(":"),[N]=/^(?:\s|\0\d+c\x7F)*/u.exec((c=A[0])!=null?c:"");this.setModifier(`${b}:${N}`)&&(e=A.join(":").slice(N.length))}let d=e.includes(":");if(d||t.length===0&&!u(this,we)){let[b,...A]=e.split(":"),N=J(b),P=N.trim(),w=o.includes(P),$=d&&s[P.toLowerCase()];if(!(A.length>0&&/\s$/u.test(N))&&(w||$)){this.setAttribute("name",$||P.toLowerCase()),this.type="magic-word";let I=new RegExp(`^\\s*${P}\\s*$`,w?"u":"iu"),j=new de(b,I,"magic-word-name",r,n,{});if(super.insertAt(j),A.length>0&&t.unshift([A.join(":")]),this.name==="invoke")for(let E=0;E<2;E++){let O=t.shift();if(!O)break;let U=new q(O.join("="),`invoke-${E?"function":"module"}`,r,n);super.insertAt(U)}}}if(this.type==="template"){let b=J(ct(e)).split("#")[0].trim();if(!b||/\0\d+[eh!+-]\x7F|[<>[\]{}\n]|%[\da-f]{2}/u.test(b))throw n.pop(),new SyntaxError(`\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0\uFF1A${ft(b)}`);let A=new q(e,"template-name",r,n,{});super.insertAt(A)}let g=this.isTemplate(),p=1;for(let b=0;b<t.length;b++){let A=t[b];!g&&!(this.name==="switch"&&b>0)&&(A[0]=A.join("="),A.length=1),A.length===1&&(A.unshift(p),p++),this.insertAt(new St(...A,r,n))}}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),n=J(e).trim();if(e&&!n.endsWith(":"))return!1;let s=n.slice(0,-1).toLowerCase(),o=t.includes(s),a=r.includes(s);return u(this,we)&&o||!u(this,we)&&(a||e==="")||this.length>1&&(o||a||e==="")?(this.setAttribute("modifier",e),S(this,we,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,"string"))}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:n,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${n}${s==="magic-word"?`${r.text()}${t===1?"":":"}${se(e.slice(1),"|")}`:super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{type:r,childNodes:n,length:s}=this,o;if(!this.isTemplate())return t;let a=F(this,wt,hn).call(this);if(a)a.fragment!==void 0&&(o={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(n[r==="template"?0:1],o,"useless fragment")));else return o={start:e,...this.getRootNode().posFromIndex(e)},t.push(L(this,o,"missing module name")),t;if(a.valid||(o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n[1],o,"illegal module name"))),r==="magic-word"&&s===2)return o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),t.push(L(this,o,"missing module function")),t;let d=this.getDuplicatedArgs();return d.length>0&&(o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),t.push(...d.flatMap(([,g])=>g).map(g=>v(g,o,"duplicated parameter")))),t}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?F(this,Ct,mn).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(e=>e.type==="parameter")}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t=!1,r=!0){let n=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return u(this,Ce).has(n)?s=u(this,Ce).get(n):(s=new Set(this.getAllArgs().filter(({name:o})=>n===o)),u(this,Ce).set(n,s)),s}getDuplicatedArgs(){return this.isTemplate()?[...u(this,Ce)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]]):[]}getPossibleValues(){let{type:e,name:t,childNodes:r,constructor:{name:n}}=this;if(e==="template")throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`);let s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":s=2;break;case"ifeq":s=3;break;default:throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}let o=r.slice(s,s+2).map(({childNodes:[,a]})=>a);for(let a=0;a<o.length;){let{length:d,0:g}=o[a].childNodes.filter(p=>p.text().trim());if(d===0)o.splice(a,1);else if(d>1||g.type!=="magic-word")a++;else try{let p=g.getPossibleValues();o.splice(a,1,...p),a+=p.length}catch(p){a++}}return o}print(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s}=this;return`<span class="wpb-${s}">{{${n}${s==="magic-word"?`${r.print()}${t===1?"":":"}${oe(e.slice(1),{sep:"|"})}`:oe(e,{sep:"|"})}}}</span>`}};we=new WeakMap,Ce=new WeakMap,wt=new WeakSet,hn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return t&&this.normalizeTitle(t.text(),e?10:828)},Ct=new WeakSet,mn=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let n=r?t.indexOf(e):e-1;n<t.length;n++){let s=t[n],{name:o}=s,a=String(n+1);o!==a&&(s.setAttribute("name",a),this.getArgs(a,!1,!1).add(s))}}});var Nt,fn=x(()=>{"use strict";Be();C();Nt=class extends ae(T){constructor(){super(...arguments);f(this,"type","hidden")}}});var Ft,Tn=x(()=>{"use strict";H();G();y();C();ge();fn();Ft=class extends T{constructor(e,t=h.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","arg");for(let n=0;n<e.length;n++)if(n===0){let s=new q(e[n],"arg-name",t,r,{});super.insertAt(s)}else if(n>1){let s=new Nt(e[n],t,r,{});super.insertAt(s)}else{let s=new T(e[n],t,r);s.type="arg-default",s.setAttribute("stage",2),super.insertAt(s)}}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`{{{${se(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){if(!this.getAttribute("include"))return[L(this,{start:e},"unexpected template argument")];let{childNodes:[t,r,...n]}=this,s=t.lint(e+3);if(r&&s.push(...r.lint(e+4+String(t).length)),n.length>0){let o={start:e,...this.getRootNode().posFromIndex(e)};s.push(...n.map(a=>{let d=v(a,o,"invisible content inside triple braces");return{...d,startIndex:d.startIndex-1,startCol:d.startCol-1}}))}return s}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}}});var xn={};z(xn,{parseBraces:()=>xr});var xr,br=x(()=>{"use strict";H();y();Tr();cn();Tn();xr=(l,i=h.getConfig(),e=[])=>{var m,c,b,A,N,P;let t=`${(m=i.excludes)!=null&&m.includes("heading")?"":"^(\0\\d+c\x7F)*={1,6}|"}\\[\\[|\\{{2,}|-\\{(?!\\{)`,{parserFunction:[,,,r]}=i,n=[],s={"=":`
|
|
9
|
+
`,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},o=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"]]),a=new RegExp(t,"gmu"),d=a.exec(l),g=l.includes("}}"),p;for(;d||p!==void 0&&p<=l.length&&((b=(c=n[n.length-1])==null?void 0:c[0])!=null&&b.startsWith("="));){if(d!=null&&d[1]){let[,{length:Z}]=d;d[0]=d[0].slice(Z),d.index+=Z}let{0:w,index:$}=d!=null?d:{0:`
|
|
10
|
+
`,index:l.length},I=(A=n.pop())!=null?A:{},{0:j,index:E,parts:O,findEqual:U,pos:Pe}=I,Re=w==="="&&U;if(w==="]]"||w==="}-")p=$+2;else if(w===`
|
|
11
|
+
`){p=$+1;let{pos:Z,findEqual:ee}=(N=n[n.length-1])!=null?N:{};if(Z===void 0||ee||J(l.slice(Z,E))!==""){let M=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(l.slice(E,$));M&&(l=`${l.slice(0,E)}\0${e.length}h\x7F${l.slice($)}`,p=E+4+String(e.length).length,new ze(M[1].length,M.slice(2),i,e))}}else if(w==="|"||Re)p=$+1,O[O.length-1].push(l.slice(Pe,$)),w==="|"&&O.push([]),I.pos=p,I.findEqual=w==="|",n.push(I);else if(w.startsWith("}}")){let Z=w.slice(0,Math.min(j.length,3)),ee=j.length-Z.length,{length:M}=e;p=$+Z.length,O[O.length-1].push(l.slice(Pe,$));let Ge=!1,ce="t";if(Z.length===3){let X=O.map(tt=>tt.join("=")),ie=X.length>1&&J(X[1]).trim();new Ft(X,i,e),ie&&ie.endsWith(":")&&r.includes(ie.slice(0,-1).toLowerCase())&&(ce="s")}else try{new $t(O[0][0],O.slice(1),i,e);let X=J(O[0][0]).trim();o.has(X)?ce=o.get(X):/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(X)?ce="m":/^#vardefine:./iu.test(X)&&(ce="c")}catch(X){if(X instanceof SyntaxError&&X.message.startsWith("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0\uFF1A"))Ge=!0;else throw X}Ge||(l=`${l.slice(0,E+ee)}\0${M}${ce}\x7F${l.slice(p)}`,p=E+ee+3+String(M).length,ee>1?n.push({0:j.slice(0,ee),index:E,pos:E+ee,parts:[[]]}):ee===1&&l[E-1]==="-"&&n.push({0:"-{",index:E-1,pos:E+1,parts:[[]]}))}else p=$+w.length,w.startsWith("{")&&(d.pos=p,d.parts=[[]]),n.push(..."0"in I?[I]:[],d);g&&(g=l.slice(p).includes("}}"));let ne=n[n.length-1];!g&&((P=ne==null?void 0:ne[0])!=null&&P.startsWith("{"))&&(n.pop(),ne=n[n.length-1]),a=new RegExp(t+(ne?`|${s[ne[0][0]]}${ne.findEqual?"|=":""}`:""),"gmu"),a.lastIndex=p,d=a.exec(l)}return l}});var bn={};z(bn,{InputboxToken:()=>kr});var kr,kn=x(()=>{"use strict";br();y();fr();kr=class extends at{constructor(i,e=h.getConfig(),t=[]){let r=Symbol("InputboxToken");t.push(r),i&&(i=xr(i,e,t)),t.splice(t.indexOf(r),1),super(i,e,t,{})}}});var Me,yr=x(()=>{"use strict";G();Be();y();be();Me=class extends ae(V){constructor(e,t=!0,r=h.getConfig(),n=[]){super(e,r,n);f(this,"type","comment");f(this,"closed");this.closed=t}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[L(this,{start:e},h.msg("unclosed $1","HTML comment"))]}toString(e){return`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}}});var Et={};z(Et,{NestedToken:()=>Ar});var Ar,Lt=x(()=>{"use strict";G();y();C();vr();Se();yr();Ar=class extends T{constructor(e,t,r,n=h.getConfig(),s=[]){var o;e=(o=e==null?void 0:e.replace(t,(a,d,g,p,m)=>{let c=`\0${s.length+1}${d?"e":"c"}\x7F`;if(d)new _e(d,g,p,m,n,s);else{let b=a.endsWith("-->");new Me(a.slice(4,b?-3:void 0),b,n,s)}return c}))==null?void 0:o.replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(a,d,g)=>(new _(g,n,s),`${d}\0${s.length}c\x7F`));super(e,n,s,{});f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let t;return[...super.lint(e),...this.childNodes.filter(r=>{if(r.type==="ext"||r.type==="comment")return!1;let n=String(r).trim();return n&&!/^<!--.*-->$/su.test(n)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,h.msg("invalid content in <$1>",this.name))))]}}});var Ne,te,Fe,Ae,It=x(()=>{"use strict";G();fe();y();C();ge();Ae=class extends T{constructor(e,t,r=h.getConfig(),n=[],s="|"){super(void 0,r,n,{});k(this,Ne,!0);k(this,te,void 0);k(this,Fe,void 0);if(this.insertAt(new q(e,"link-target",r,n,{})),t!==void 0){let o=new T(t,r,n,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}S(this,te,s)}afterBuild(){S(this,Fe,this.getTitle()),u(this,te).includes("\0")&&S(this,te,this.buildFromStr(u(this,te),"string"))}setAttribute(e,t){e==="bracket"?S(this,Ne,!!t):e==="title"?S(this,Fe,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,u(this,te));return u(this,Ne)?`[[${t}]]`:t}text(){let e=super.text("|");return u(this,Ne)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,Fe):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,te).length:1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{childNodes:[r,n],type:s}=this,{encoded:o,fragment:a}=u(this,Fe),d;return s==="link"&&r.childNodes.some(({type:g})=>g==="template")&&(d={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,d,"template in an internal link target","warning"))),o&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"unnecessary URL encoding in an internal link"))),s==="link"&&(n!=null&&n.childNodes.some(({type:g,data:p})=>g==="text"&&p.includes("|")))?(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,d,'additional "|" in the link text',"warning"))):s!=="link"&&a!==void 0&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"useless fragment"))),t}getTitle(){return this.normalizeTitle(this.firstChild.text(),0,!1,!0,!0)}print(){return super.print(u(this,Ne)?{pre:"[[",post:"]]",sep:u(this,te)}:{sep:u(this,te)})}};Ne=new WeakMap,te=new WeakMap,Fe=new WeakMap});function yn(l,i,e=h.getConfig(),t=!1){i=i.trim();let r=i.replace(/\0\d+t\x7F/gu,"").trim();switch(l){case"width":return!r||/^(?:\d+x?|\d*x\d+)$/u.test(r);case"link":{if(!r||new RegExp(`^(?:(?:${e.protocol}|//)${Te}|\0\\d+m\x7F)${xe}$`,"iu").test(r))return i;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2));let s=h.normalizeTitle(r,0,!1,e,t,!0,!0);return s.valid&&s}case"lang":return!r||e.variants.includes(r);case"alt":case"class":case"manualthumb":return!0;default:return!Number.isNaN(Number(r))}}var Wi,K,Pt,An=x(()=>{"use strict";H();G();y();C();Wi=new Set(["alt","link","lang","page","caption"]);Pt=class extends T{constructor(e,t=h.getConfig(),r=[]){var i=(...args)=>{super(...args);f(this,"type","image-parameter");k(this,K,"")};var a;let n,s=Object.entries(t.img).map(([d,g])=>[d,g,new RegExp(`^(\\s*)${d.replace("$1","(.*)")}(\\s*)$`,"u")]),o=s.find(([,d,g])=>(n=g.exec(e),n&&(n.length!==4||yn(d,n[2],t,!0)!==!1)));if(o&&n){n.length===3?(i(void 0,t,r),S(this,K,e)):(i(n[2],t,r,{}),S(this,K,`${n[1]}${o[0]}${n[3]}`)),this.setAttribute("name",o[1]);return}i(e,{...t,excludes:[...(a=t.excludes)!=null?a:[],"list"]},r),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get link(){return this.name==="link"?yn("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Wi.has(this.name)&&this.setAttribute("name","invalid")}toString(e){return u(this,K)?u(this,K).replace("$1",super.toString(e)):super.toString(e)}text(){return u(this,K)?u(this,K).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,u(this,K).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{link:r,name:n}=this;return n==="invalid"?t.push(L(this,{start:e},"invalid gallery image parameter")):typeof r=="object"&&r.encoded&&t.push(L(this,{start:e},"unnecessary URL encoding in an internal link")),t}print(){return u(this,K)?this.name==="invalid"?`<span class="wpb-image-invalid">${u(this,K).replace("$1",oe(this.childNodes))}</span>`:`<span class="wpb-image-parameter">${u(this,K).replace("$1",`<span class="wpb-image-caption">${oe(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};K=new WeakMap});var Sr,$r,wr,zi,Ue,Rt,De,Cr=x(()=>{"use strict";H();G();y();It();An();Sr=new Set(["manualthumb","frameless","framed","thumbnail"]),$r=new Set(["left","right","center","none"]),wr=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),zi=(l,i,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[l,i,e].map(Hr).join("|")}`,"gu"),n=[],s=r.exec(t),o=0,a=0;for(;s;){let{0:d,index:g}=s;d!==e?o+=d===l?1:-1:o===0&&(n.push(t.slice(a,g)),{lastIndex:a}=r),s=r.exec(t)}return n.push(t.slice(a)),n},De=class extends Ae{constructor(e,t,r=h.getConfig(),n=[],s="|"){super(e,void 0,r,n,s);k(this,Ue);f(this,"type","file");this.append(...zi("-{","}-","|",t).map(o=>new Pt(o,r,n)))}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r=this.getAllArgs().filter(({childNodes:p})=>{let m=p.filter(c=>c.text().trim());return m.length!==1||m[0].type!=="arg"}),n=[...new Set(r.map(({name:p})=>p))].filter(p=>p!=="invalid"),s=n.filter(p=>Sr.has(p)),o=n.filter(p=>$r.has(p)),a=n.filter(p=>wr.has(p));if(r.length===n.length&&s.length<2&&o.length<2&&a.length<2)return t;let d={start:e,...this.getRootNode().posFromIndex(e)},g=(p,m)=>c=>v(c,d,h.msg(`${p} image $1 parameter`,m));for(let p of n){let m=r.filter(({name:c})=>c===p);p==="caption"&&(m=[...m.slice(0,-1).filter(c=>c.text()),...m.slice(-1)]),m.length>1&&t.push(...m.map(g("duplicated",p)))}return s.length>1&&t.push(...r.filter(({name:p})=>Sr.has(p)).map(g("conflicting","frame"))),o.length>1&&t.push(...r.filter(({name:p})=>$r.has(p)).map(g("conflicting","horizontal-alignment"))),a.length>1&&t.push(...r.filter(({name:p})=>wr.has(p)).map(g("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getFrameArgs(){return F(this,Ue,Rt).call(this,Sr,"\u6846\u67B6")}getHorizAlignArgs(){return F(this,Ue,Rt).call(this,$r,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return F(this,Ue,Rt).call(this,wr,"\u5782\u76F4\u5BF9\u9F50")}};Ue=new WeakSet,Rt=function(e,t){return this.getAllArgs().filter(({name:n})=>e.has(n))}});var Gt,vn,He,Nr=x(()=>{"use strict";G();fe();y();C();Cr();He=class extends De{constructor(e,t,r,n=h.getConfig(),s=[]){let o;if(r!==void 0){o=new T(r,n,s),o.type="plain";for(let a=1;a<11;a++)o.parseOnce();s.splice(s.indexOf(o),1)}super(t,o==null?void 0:o.toString(),n,s);k(this,Gt);this.setAttribute("bracket",!1),this.type=`${e}-image`}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(String(this.firstChild),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{ns:r}=this.getAttribute("title");return r!==6&&t.push(L(this,{start:e},"invalid gallery image")),t}afterBuild(){F(this,Gt,vn).call(this,this.getTitle())}};Gt=new WeakSet,vn=function(e){this.setAttribute("title",e)}});var $n={};z($n,{GalleryToken:()=>Fr});var qt,Sn,Fr,wn=x(()=>{"use strict";y();C();Nr();Se();Fr=class extends T{constructor(e,t=h.getConfig(),r=[]){var n;super(void 0,t,r,{});k(this,qt);f(this,"type","ext-inner");for(let s of(n=e==null?void 0:e.split(`
|
|
12
|
+
`))!=null?n:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new _(s,t):s);continue}let[,a,d]=o;F(this,qt,Sn).call(this,a)?super.insertAt(new He("gallery",a,d,t,r)):super.insertAt(new _(s,t))}}toString(e){return super.toString(e,`
|
|
13
13
|
`)}text(){return super.text(`
|
|
14
14
|
`).replace(/\n\s*\n/gu,`
|
|
15
|
-
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let{top:t,left:r}=this.getRootNode().posFromIndex(e),n=[];for(let s=0;s<this.length;s++){let o=this.childNodes[s],a=String(o),{length:d}=a,g=a.trim(),p=t+s,
|
|
16
|
-
`})}};qt=new WeakSet,Sn=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var Ve,Er=
|
|
17
|
-
`),{length:A}=
|
|
18
|
-
`),s=new Set(t.protocol.split("|")),o=_,a=!0,d=!1;for(let g of n){let p=g.trim();if(!(d||!p||p.startsWith("#"))){if(a){let[c
|
|
15
|
+
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let{top:t,left:r}=this.getRootNode().posFromIndex(e),n=[];for(let s=0;s<this.length;s++){let o=this.childNodes[s],a=String(o),{length:d}=a,g=a.trim(),p=t+s,m=s?0:r;o.type==="noinclude"&&g&&!/^<!--.*-->$/u.test(g)?n.push({message:h.msg("invalid content in <$1>","gallery"),severity:"error",startIndex:e,endIndex:e+d,startLine:p,endLine:p,startCol:m,endCol:m+d}):o.type!=="noinclude"&&o.type!=="text"&&n.push(...o.lint(e)),e+=d+1}return n}print(){return super.print({sep:`
|
|
16
|
+
`})}};qt=new WeakSet,Sn=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var Ve,Er=x(()=>{"use strict";It();Ve=class extends Ae{constructor(){super(...arguments);f(this,"type","link")}}});var Cn,Nn=x(()=>{"use strict";Cn=l=>{class i extends l{}return i}});var Xe,Lr=x(()=>{"use strict";G();y();C();Xe=class extends T{constructor(i,e=!1,t=h.getConfig(),r=[]){super(i,t,r,{}),this.type=e?"ext-link-url":"free-ext-link"}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),t=`[\uFF0C\uFF1B\u3002\uFF1A\uFF01\uFF1F\uFF08\uFF09]+${this.type==="ext-link-url"?"|\\|+":""}`,r=new RegExp(t,"u"),n=new RegExp(t,"gu"),s;for(let o of this.childNodes){let{type:a,data:d}=o;if(a!=="text"||!r.test(d))continue;s!=null||(s={start:i,...this.getRootNode().posFromIndex(i)});let g=v(o,s,"","warning");n.lastIndex=0;for(let p=n.exec(d);p;p=n.exec(d)){let{index:m,0:c}=p,b=d.slice(0,m).split(`
|
|
17
|
+
`),{length:A}=b,{length:N}=b[b.length-1],P=i+m,w=g.startLine+A-1,$=A===1?g.startCol+N:N;e.push({...g,message:h.msg("$1 in URL",c.startsWith("|")?'"|"':h.msg("full-width punctuation")),startIndex:P,endIndex:P+c.length,startLine:w,endLine:w,startCol:$,endCol:$+c.length})}}return e}}});var he,Qe,Ir=x(()=>{"use strict";fe();Nn();y();C();Lr();Qe=class extends Cn(T){constructor(e,t="",r="",n=h.getConfig(),s=[]){super(void 0,n,s,{});f(this,"type","ext-link");k(this,he,void 0);if(this.insertAt(new Xe(e,!0,n,s)),S(this,he,t),r){let o=new T(r,n,s,{});o.type="ext-link-text",o.setAttribute("stage",10),this.insertAt(o)}}toString(e){return this.length===1?`[${super.toString(e)}${u(this,he)}]`:`[${super.toString(e,u(this,he))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return u(this,he).length}print(){return super.print(this.length===1?{pre:"[",post:`${u(this,he)}]`}:{pre:"[",sep:u(this,he),post:"]"})}};he=new WeakMap});var pt,Fn=x(()=>{"use strict";y();C();Se();Er();Ir();pt=class extends T{constructor(e,t,r,n=h.getConfig(),s=[]){super(void 0,n,s);f(this,"type","imagemap-link");this.append(e,t.length===2?new Ve(...t,n,s):new Qe(...t,n,s),new _(r,n,s))}}});var En={};z(En,{ImagemapToken:()=>Pr});var Pr,Ln=x(()=>{"use strict";G();y();C();Se();Nr();Fn();Pr=class extends T{constructor(e,t=h.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","ext-inner");if(!e)return;let n=e.split(`
|
|
18
|
+
`),s=new Set(t.protocol.split("|")),o=_,a=!0,d=!1;for(let g of n){let p=g.trim();if(!(d||!p||p.startsWith("#"))){if(a){let[m,...c]=g.split("|"),b=this.normalizeTitle(m,0,!0);if(b.valid&&b.ns===6){let A=new He("imagemap",m,c.length>0?c.join("|"):void 0,t,r);super.insertAt(A),a=!1;continue}else d=!0}else if(g.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let m=g.indexOf("["),c=g.slice(m),b=/^\[{2}([^|]+)(?:\|([^\]]+))?\]{2}[\w\s]*$/u.exec(c);if(b){if(this.normalizeTitle(b[1],0,!0,!1,!0).valid){super.insertAt(new pt(g.slice(0,m),b.slice(1),c.slice(c.indexOf("]]")+2),t,r));continue}}else if(s.has(c.slice(1,c.indexOf(":")+1))||s.has(c.slice(1,c.indexOf("//")+2))){let A=/^\[([^\]\s]+)(?:(\s+)(\S[^\]]*)?)?\][\w\s]*$/u.exec(c);if(A){super.insertAt(new pt(g.slice(0,m),A.slice(1),c.slice(c.indexOf("]")+1),t,r));continue}}}}super.insertAt(new o(g,t,r))}}get image(){return this.childNodes.find(e=>e.type==="imagemap-image")}toString(e){return super.toString(e,`
|
|
19
19
|
`)}text(){return super.text(`
|
|
20
20
|
`).replace(/\n{2,}/gu,`
|
|
21
|
-
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r={start:e,...this.getRootNode().posFromIndex(e)};return this.image?t.push(...this.childNodes.filter(n=>{let s=String(n).trim();return n.type==="noinclude"&&s&&!s.startsWith("#")}).map(n=>v(n,r,"invalid link in <imagemap>"))):t.push(
|
|
22
|
-
`})}}});var In,_e,vr=
|
|
23
|
-
|}`,t=!1){let r=this.getAttribute("config"),n=this.getAttribute("accum"),s=[e],o=rt.run(()=>super.insertAt(new de(void 0,Di,"table-syntax",r,n,{})));this.lastChild.replaceChildren(...s)}}});var jt,jn=
|
|
21
|
+
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r={start:e,...this.getRootNode().posFromIndex(e)};return this.image?t.push(...this.childNodes.filter(n=>{let s=String(n).trim();return n.type==="noinclude"&&s&&!s.startsWith("#")}).map(n=>v(n,r,"invalid link in <imagemap>"))):t.push(L(this,r,"<imagemap> without an image")),t}print(){return super.print({sep:`
|
|
22
|
+
`})}}});var In,_e,vr=x(()=>{"use strict";G();y();C();hr();At();In=(l,i)=>{let e=new Set(l);return e.delete(i),[...e]},_e=class extends Oe{constructor(e,t,r,n,s=h.getConfig(),o=[]){var m;let a=e.toLowerCase(),d=new ye(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",a,s,o),g={...s,ext:In(s.ext,a),excludes:[...(m=s.excludes)!=null?m:[]]},p;switch(g.inExt=!0,a){case"tab":g.ext=In(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":a==="poem"&&g.excludes.push("heading"),p=new T(r,g,o);break;case"pre":{let{PreToken:c}=(pn(),R(dn));p=new c(r,g,o);break}case"dynamicpagelist":{let{ParamTagToken:c}=(fr(),R(gn));p=new c(r,g,o);break}case"inputbox":{g.excludes.push("heading");let{InputboxToken:c}=(kn(),R(bn));p=new c(r,g,o);break}case"references":{let{NestedToken:c}=(Lt(),R(Et));p=new c(r,/<!--.*?(?:-->|$)|<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],g,o);break}case"choose":{let{NestedToken:c}=(Lt(),R(Et));p=new c(r,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],g,o);break}case"combobox":{let{NestedToken:c}=(Lt(),R(Et));p=new c(r,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],g,o);break}case"gallery":{let{GalleryToken:c}=(wn(),R($n));p=new c(r,g,o);break}case"imagemap":{let{ImagemapToken:c}=(Ln(),R(En));p=new c(r,g,o);break}default:{let{NowikiToken:c}=(ur(),R(gr));p=new c(r,g)}}p.setAttribute("name",a),p.type="ext-inner";super(e,d,p,n,s,o);f(this,"type","ext")}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);if(this.name!=="nowiki"&&this.closest("html-attrs, table-attrs")){let r={start:e,...this.getRootNode().posFromIndex(e)};t.push(L(this,r,"extension tag in HTML tag attributes"))}return t}}});var Pn={};z(Pn,{parseCommentAndExt:()=>Mi});var Mi,Rn=x(()=>{"use strict";y();Jr();Se();Yr();vr();yr();Mi=(l,i=h.getConfig(),e=[],t=!1)=>{let r="<onlyinclude>",n="</onlyinclude>",{length:s}=r;if(t){let p=l.indexOf(r),m=l.indexOf(n,p+s);if(p!==-1&&m!==-1){let c="";for(;p!==-1&&m!==-1;){let b=`\0${e.length}e\x7F`;new bt(l.slice(p+s,m),i,e),p>0?(new _(l.slice(0,p),i,e),c+=`\0${e.length-1}c\x7F${b}`):c+=b,l=l.slice(m+s+1),p=l.indexOf(r),m=l.indexOf(n,p+s)}return l&&(new _(l,i,e),c+=`\0${e.length-1}c\x7F`),c}}let o=i.ext.join("|"),a=t?"includeonly":"(?:no|only)include",d=t?"noinclude":"includeonly",g=new RegExp(`<!--.*?(?:-->|$)|<${a}(?:\\s[^>]*?)?>|</${a}\\s*>|<(${o})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|<(${d})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(${d}\\s*)>|$))`,"gisu");return l.replace(g,(p,m,c,b,A,N,P,w,$)=>{let I=`\0${e.length}${m?"e":"c"}\x7F`;if(m)new _e(m,c,b,A,i,e);else if(p.startsWith("<!--")){let j=p.endsWith("-->");new Me(p.slice(4,j?-3:void 0),j,i,e)}else N?new kt(N,P,w,$,i,e):new _(p,i,e);return I})}});var _i,Ke,pe,ve,Bt,Gn=x(()=>{"use strict";G();H();y();C();_i=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Bt=class extends T{constructor(e,t,r,n,s=h.getConfig(),o=[]){super(void 0,s,o);f(this,"type","html");k(this,Ke,void 0);k(this,pe,void 0);k(this,ve,void 0);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),S(this,Ke,r),S(this,pe,n),S(this,ve,e)}get closing(){return u(this,Ke)}toString(e){return`<${this.closing?"/":""}${u(this,ve)}${super.toString()}${u(this,pe)?"/":""}>`}text(){let{closing:e,name:t}=this,r=`${u(this,ve)}${e?"":super.text()}`,{html:n}=this.getAttribute("config");return n[2].includes(t)?e&&t!=="br"?"":`<${r}>`:`<${e?"/":""}${r}${u(this,pe)&&n[1].includes(t)?"/":""}>`}getAttribute(e){return e==="padding"?u(this,ve).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r;this.name==="h1"&&!this.closing&&(r=L(this,{start:e},"<h1>"),t.push(r)),this.closest("table-attrs")&&(r!=null||(r=L(this,{start:e},"")),t.push({...r,message:h.msg("HTML tag in table attributes")}));try{this.findMatchingTag()}catch(n){if(n instanceof SyntaxError){let{message:s}=n;r!=null||(r=L(this,{start:e},""));let[o]=s.split(":"),a={...r,message:h.msg(o)};if(o==="unclosed tag")a.severity="warning";else if(o==="unmatched closing tag"){let d=this.closest("magic-word");d&&_i.has(d.name)&&(a.severity="warning")}t.push(a)}}return t}findMatchingTag(){let{html:e}=this.getAttribute("config"),{name:t,parentNode:r,closing:n}=this,s=ft(String(this));if(n&&(u(this,pe)||e[2].includes(t)))throw new SyntaxError(`tag that is both closing and self-closing: ${s}`);if(e[2].includes(t)||u(this,pe)&&e[1].includes(t))return this;if(u(this,pe)&&e[0].includes(t))throw new SyntaxError(`invalid self-closing tag: ${s}`);if(!r)return;let{childNodes:o}=r,a=o.indexOf(this),d=(n?o.slice(0,a).reverse():o.slice(a+1)).filter(p=>p.type==="html"&&p.name===t),g=n?-1:1;for(let p of d)if(u(p,Ke)?g--:g++,g===0)return p;throw new SyntaxError(`${n?"unmatched closing":"unclosed"} tag: ${s}`)}print(){let{closing:e,name:t}=this,{html:r}=this.getAttribute("config");return super.print({pre:`<${this.closing?"/":""}${u(this,ve)}`,post:`${u(this,pe)?"/":""}>`,class:e&&r[2].includes(t)&&t!=="br"?"html-invalid":"html"})}};Ke=new WeakMap,pe=new WeakMap,ve=new WeakMap});var qn={};z(qn,{parseHtml:()=>Ui});var Ui,Bn=x(()=>{"use strict";y();At();Gn();Ui=(l,i=h.getConfig(),e=[])=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,r=new Set(i.html.flat()),n=l.split("<"),s=n.shift();for(let o of n){let a=t.exec(o),d=a==null?void 0:a[2],g=d==null?void 0:d.toLowerCase();if(!a||!r.has(g)){s+=`<${o}`;continue}let[,p,,m="",c,b]=a,A=new ye(m,"html-attrs",g,i,e),N=A.getAttr("itemprop");if(g==="meta"&&(N===void 0||A.getAttr("content")===void 0)||g==="link"&&(N===void 0||A.getAttr("href")===void 0)){s+=`<${o}`,e.pop();continue}s+=`\0${e.length}x\x7F${b}`,new Bt(d,A,p==="/",c==="/>",i,e)}return s}});var Ze,Rr=x(()=>{"use strict";y();C();lt();At();Ze=class extends T{constructor(i,e,t,r=h.getConfig(),n=[],s={}){super(void 0,r,n,s),this.append(new de(e,i,"table-syntax",r,n,{}),new ye(t,"table-attrs",this.type,r,n))}}});var Je,Gr=x(()=>{"use strict";G();Rr();Je=class extends Ze{lint(i=this.getAbsoluteIndex()){let e=super.lint(i),t=this.childNodes.find(({type:d})=>d==="table-inter");if(!t)return e;let r=t.childNodes.find(d=>d.text().trim()),n=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u,s=d=>d.type==="arg",o=d=>d.type==="magic-word";if(!r||n.test(String(r))||s(r)&&n.test(r.default||""))return e;if(o(r))try{if(r.getPossibleValues().every(d=>n.test(d.text())))return e}catch(d){}let a=v(t,{start:i},"content to be moved out from the table");return e.push({...a,startIndex:a.startIndex+1,startLine:a.startLine+1,startCol:0}),e}}});var Di,Ot,On=x(()=>{"use strict";G();or();y();Gr();lt();Di=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,Ot=class extends Je{constructor(e,t,r=h.getConfig(),n=[]){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,t,r,n,{});f(this,"type","table")}get closed(){return this.lastChild.type==="table-syntax"}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);return this.closed||t.push(v(this.firstChild,{start:e},h.msg("unclosed $1","table"))),t}close(e=`
|
|
23
|
+
|}`,t=!1){let r=this.getAttribute("config"),n=this.getAttribute("accum"),s=[e],o=rt.run(()=>super.insertAt(new de(void 0,Di,"table-syntax",r,n,{})));this.lastChild.replaceChildren(...s)}}});var jt,jn=x(()=>{"use strict";y();Gr();jt=class extends Je{constructor(e,t,r=h.getConfig(),n=[]){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,t,r,n,{});f(this,"type","tr")}}});var Y,Wt,Wn,gt,zn=x(()=>{"use strict";G();y();C();Rr();gt=class extends Ze{constructor(e,t,r=h.getConfig(),n=[]){var d;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,o,r,n);k(this,Wt);f(this,"type","td");k(this,Y,"");s&&([mt(this,Y)._]=s);let a=new T(t==null?void 0:t.slice(((d=s==null?void 0:s.index)!=null?d:NaN)+u(this,Y).length),r,n);a.type="td-inner",a.setAttribute("stage",4),this.insertAt(a)}get subtype(){return F(this,Wt,Wn).call(this).subtype}afterBuild(){u(this,Y).includes("\0")&&S(this,Y,this.buildFromStr(u(this,Y),"string"))}toString(e){let{childNodes:[t,r,n]}=this;return`${t.toString()}${r.toString()}${u(this,Y)}${n.toString()}`}text(){let{childNodes:[e,t,r]}=this;return`${e.text()}${t.text()}${u(this,Y)}${r.text()}`}getGaps(e){return e===1?u(this,Y).length:0}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);e+=this.getRelativeIndex(this.length-1);for(let r of this.lastChild.childNodes)r.type==="text"&&r.data.includes("|")&&t.push(v(r,{start:e},'additional "|" in a table cell',"warning"));return t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${u(this,Y)}${r.print()}</span>`}};Y=new WeakMap,Wt=new WeakSet,Wn=function(){let e=this.firstChild.text(),t=e[e.length-1],r="td";return t==="!"?r="th":t==="+"&&(r="caption"),{subtype:r}}});var Ye,qr=x(()=>{"use strict";be();Ye=class extends V{}});var Ee,Br=x(()=>{"use strict";qr();Ee=class extends Ye{constructor(){super(...arguments);f(this,"type","dd")}}});var Mn={};z(Mn,{parseTable:()=>Vi});var Hi,Vi,_n=x(()=>{"use strict";y();C();On();jn();zn();Br();Hi=l=>l.lastChild.constructor!==T,Vi=({firstChild:{data:l},type:i,name:e},t=h.getConfig(),r=[])=>{let n=[],s=l.split(`
|
|
24
24
|
`),o=i==="root"||i==="parameter-value"||i==="ext-inner"&&e==="poem"?"":`
|
|
25
|
-
${s.shift()}`,a=(d,g)=>{if(!g){o+=d;return}let{lastChild:p}=g;if(Hi(g)){let
|
|
26
|
-
${p}${$&&`\0${r.length-1}d\x7F`}${I}\0${r.length}b\x7F`,g),n.push(...g?[g]:[],new Ot(
|
|
27
|
-
${d}`;continue}let
|
|
28
|
-
${d}`,g),n.push(g);continue}let[,A,
|
|
29
|
-
${p}${A}`,!0),a(w,n[n.length-1])}else if(
|
|
30
|
-
${p}${
|
|
31
|
-
${p}${
|
|
32
|
-
-\uFFFD]*)\\]`,"giu");return l.replace(t,(r,n,s,o)=>{let{length:a}=e,d=/&[lg]t;/u.exec(n);return d&&(n=n.slice(0,d.index),s="",o=`${n.slice(d.index)}${s}${o}`),new Qe(n,s,o,i,e),`\0${a}w\x7F`})}});var ti={};z(ti,{parseMagicLinks:()=>Zi});var Zi,ri=
|
|
33
|
-
`);for(let n=0;n<t.length;n++)t[n]=e(t[n],u(this,
|
|
34
|
-
`))},tr=new WeakSet,ki=function(){var t;if((t=u(this,
|
|
35
|
-
`),r=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;r<t.length;r++)t[r]=e(t[r],u(this,
|
|
36
|
-
`))},ir=new WeakSet,vi=function(){if(u(this,
|
|
25
|
+
${s.shift()}`,a=(d,g)=>{if(!g){o+=d;return}let{lastChild:p}=g;if(Hi(g)){let m=new T(d,t,r);m.type="table-inter",m.setAttribute("stage",3),g.insertAt(m)}else p.setText(String(p)+d)};for(let d of s){let g=n.pop(),[p]=/^(?:\s|\0\d+c\x7F)*/u.exec(d),m=d.slice(p.length),c=/^(:*)((?:\s|\0\d+c\x7F)*)(\{\||\{(?:\0\d+c\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(m);if(c){for(;g&&g.type!=="td";)g=n.pop();let[,$,I,j,E]=c;$&&new Ee($,t,r),a(`
|
|
26
|
+
${p}${$&&`\0${r.length-1}d\x7F`}${I}\0${r.length}b\x7F`,g),n.push(...g?[g]:[],new Ot(j,E,t,r));continue}else if(!g){o+=`
|
|
27
|
+
${d}`;continue}let b=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(m);if(!b){a(`
|
|
28
|
+
${d}`,g),n.push(g);continue}let[,A,N,P,w]=b;if(A){for(;g.type!=="table";)g=n.pop();g.close(`
|
|
29
|
+
${p}${A}`,!0),a(w,n[n.length-1])}else if(N){g.type==="td"&&(g=n.pop()),g.type==="tr"&&(g=n.pop());let $=new jt(`
|
|
30
|
+
${p}${N}`,w,t,r);n.push(g,$),g.insertAt($)}else{g.type==="td"&&(g=n.pop());let $=P==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,I=$.exec(w),j=0,E=`
|
|
31
|
+
${p}${P}`;for(;I;)g.insertAt(new gt(E,w.slice(j,I.index),t,r)),{lastIndex:j}=$,[E]=I,I=$.exec(w);let O=new gt(E,w.slice(j),t,r);n.push(g,O),g.insertAt(O)}}return o.slice(1)}});var zt,Un=x(()=>{"use strict";be();zt=class extends V{constructor(){super(...arguments);f(this,"type","hr")}}});var Mt,Dn=x(()=>{"use strict";Be();y();be();Mt=class extends ae(V){constructor(e,t,r=h.getConfig(),n=[]){super(e,r,n);f(this,"type","double-underscore")}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}toString(e){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}}});var Hn={};z(Hn,{parseHrAndDoubleUnderscore:()=>Xi});var Xi,Vn=x(()=>{"use strict";y();Un();Dn();Tr();Xi=({firstChild:{data:l},type:i,name:e},t=h.getConfig(),r=[])=>{let{doubleUnderscore:n}=t,s=new Set(n[0]),o=new Set(n[1]);return i!=="root"&&(i!=="ext-inner"||e!=="poem")&&(l=`\0${l}`),l=l.replace(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(a,d,g)=>(new zt(g,t,r),`${d}\0${r.length-1}r\x7F`)).replace(new RegExp(`__(${n.flat().join("|")})__`,"giu"),(a,d)=>{let g=o.has(d);return g||s.has(d.toLowerCase())?(new Mt(d,g,t,r),`\0${r.length-1}u\x7F`):a}).replace(/^((?:\0\d+c\x7F)*)(={1,6})(.+)\2((?:[^\S\n]|\0\d+c\x7F)*)$/gmu,(a,d,g,p,m)=>{let c=`${d}\0${r.length}h\x7F`;return new ze(g.length,[p,m],t,r),c}),i==="root"||i==="ext-inner"&&e==="poem"?l:l.slice(1)}});var _t,Xn=x(()=>{"use strict";It();_t=class extends Ae{constructor(){super(...arguments);f(this,"type","category")}}});var Ut,Qn=x(()=>{"use strict";G();y();be();Ut=class extends V{constructor(){super(...arguments);f(this,"type","quote")}lint(e=this.getAbsoluteIndex()){let{previousSibling:t,nextSibling:r}=this,n=h.msg('lonely "$1"',"'"),s=[],o;if((t==null?void 0:t.type)==="text"&&t.data.endsWith("'")){o=L(this,{start:e},n);let{startIndex:a,startLine:d,startCol:g}=o,[,{length:p}]=/(?:^|[^'])('+)$/u.exec(t.data),m=e-p;s.push({...o,startIndex:m,endIndex:a,startCol:g-p,endLine:d,endCol:g})}if((r==null?void 0:r.type)==="text"&&r.data.startsWith("'")){o!=null||(o=L(this,{start:e},n));let{endIndex:a,endLine:d,endCol:g}=o,[{length:p}]=/^'+/u.exec(r.data),m=a+p;s.push({...o,startIndex:a,endIndex:m,startLine:d,startCol:g,endCol:g+p})}return s}}});var Or={};z(Or,{parseQuotes:()=>Qi});var Qi,jr=x(()=>{"use strict";y();Qn();Qi=(l,i=h.getConfig(),e=[])=>{var g;let t=l.split(/('{2,})/u),{length:r}=t;if(r===1)return l;let n=0,s=0,o,a,d;for(let p=1;p<r;p+=2){let{length:m}=t[p];switch(m){case 2:s++;break;case 4:t[p-1]+="'",t[p]="'''";case 3:if(n++,o!==void 0)break;t[p-1].endsWith(" ")?a===void 0&&d===void 0&&(d=p):t[p-1].slice(-2,-1)===" "?o=p:a!=null||(a=p);break;default:t[p-1]+="'".repeat(m-5),t[p]="'''''",s++,n++}}if(s%2===1&&n%2===1){let p=(g=o!=null?o:a)!=null?g:d;p!==void 0&&(t[p]="''",t[p-1]+="'")}for(let p=1;p<r;p+=2)new Ut(t[p],i,e),t[p]=`\0${e.length-1}q\x7F`;return t.join("")}});var Zn={};z(Zn,{parseLinks:()=>Kn});var Kn,Jn=x(()=>{"use strict";y();Er();Cr();Xn();Kn=(l,i=h.getConfig(),e=[])=>{let{parseQuotes:t}=(jr(),R(Or)),r=i.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,n=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,s=new RegExp(`^\\s*(?:${i.protocol}|//)`,"iu"),o=l.split("[["),a=o.shift();for(let d=0;d<o.length;d++){let g=!1,p,m,c,b,A=o[d],N=r.exec(A);if(N)[,p,m,c,b]=N,b.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",b=b.slice(1));else{let E=n.exec(A);E&&(g=!0,[,p,m,c]=E)}if(p===void 0||s.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){a+=`[[${A}`;continue}let P=p.trim().startsWith(":");if(P&&g){a+=`[[${A}`;continue}let w=h.normalizeTitle(p,0,!1,i,!0,!0,!0),{ns:$,valid:I}=w;if(I){if(g){if($!==6){a+=`[[${A}`;continue}let E=!1;for(d++;d<o.length;d++){let O=o[d],U=O.split("]]");if(U.length>2){E=!0,c+=`[[${U[0]}]]${U[1]}`,b=U.slice(2).join("]]");break}else if(U.length===2)c+=`[[${U[0]}]]${U[1]}`;else{c+=`[[${O}`;break}}if(c=Kn(c,i,e),!E){a+=`[[${p}${m}${c}`;continue}}}else{a+=`[[${A}`;continue}c&&(c=t(c,i,e)),a+=`\0${e.length}l\x7F${b}`;let j=Ve;P||($===6?j=De:$===14&&(j=_t)),c===void 0&&m&&(c=""),new j(p,c,i,e,m)}return a}});var Yn={};z(Yn,{parseExternalLinks:()=>Ki});var Ki,ei=x(()=>{"use strict";H();y();Ir();Ki=(l,i=h.getConfig(),e=[])=>{let t=new RegExp(`\\[((?:(?:${i.protocol}|//)${Te}|\0\\d+m\x7F)${xe})(\\p{Zs}*)([^\\]-\b
|
|
32
|
+
-\uFFFD]*)\\]`,"giu");return l.replace(t,(r,n,s,o)=>{let{length:a}=e,d=/&[lg]t;/u.exec(n);return d&&(n=n.slice(0,d.index),s="",o=`${n.slice(d.index)}${s}${o}`),new Qe(n,s,o,i,e),`\0${a}w\x7F`})}});var ti={};z(ti,{parseMagicLinks:()=>Zi});var Zi,ri=x(()=>{"use strict";H();y();Lr();Zi=(l,i=h.getConfig(),e=[])=>{let t=new RegExp(`(^|[^\\p{L}\\d_])(?:${i.protocol})(${Te}${xe})`,"giu");return l.replace(t,(r,n,s)=>{let o="",a=n?r.slice(1):r,d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(a);d&&(o=a.slice(d.index),a=a.slice(0,d.index));let g=new RegExp(`[,;.:!?${a.includes("(")?"":")"}]+$`,"u"),p=g.exec(a);if(p){let m=0;p[0].startsWith(";")&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(a.slice(0,p.index))&&(m=1),o=`${a.slice(p.index+m)}${o}`,a=a.slice(0,p.index+m)}return o.length>=s.length?r:(new Xe(a,!1,i,e),`${n}\0${e.length-1}w\x7F${o}`)})}});var Dt,ni=x(()=>{"use strict";qr();Dt=class extends Ye{constructor(){super(...arguments);f(this,"type","list")}}});var ii={};z(ii,{parseList:()=>Ji});var Ji,si=x(()=>{"use strict";y();ni();Br();Ji=(l,i=h.getConfig(),e=[])=>{let t=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(l);if(!t)return l;let[r,n,s]=t,o=`${n}\0${e.length}d\x7F${l.slice(r.length)}`,a=s.split(";").length-1;if(new Dt(s,i,e),!a)return o;let d=/:+|-\{/gu,g=d.exec(o),p=0;for(;g&&a;){let{0:m,index:c}=g;if(m.startsWith(":")){if(m.length>=a)return new Ee(":".repeat(a),i,e),`${o.slice(0,c)}\0${e.length-1}d\x7F${o.slice(c+a)}`;o=`${o.slice(0,c)}\0${e.length}d\x7F${o.slice(d.lastIndex)}`,a-=m.length,d.lastIndex=c+4+String(e.length).length,new Ee(m,i,e)}else if(m==="-{"){if(!p){let{lastIndex:b}=d;d=/-\{|\}-/gu,d.lastIndex=b}p++}else if(p--,!p){let{lastIndex:b}=d;d=/:+|-\{/gu,d.lastIndex=b}g=d.exec(o)}return o}});var oi,ai=x(()=>{"use strict";oi=l=>{class i extends l{}return i}});var Yi,me,Ht,li=x(()=>{"use strict";G();y();C();ge();Yi=new Set(["A","T","R","D","-","H","N"]),Ht=class extends T{constructor(e,t=h.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","converter-flags");k(this,me,void 0);this.append(...e.map(n=>new q(n,"converter-flag",t,r)))}afterBuild(){S(this,me,this.childNodes.map(e=>e.text().trim()))}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(u(this,me).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,me).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex()){let t=this.getVariantFlags(),r=this.getUnknownFlags(),n=new Set(u(this,me).filter(m=>Yi.has(m))),{length:s}=u(this,me).filter(m=>!m),o=u(this,me).length-r.size-s,a=super.lint(e);if(t.size===o||n.size===o)return a;let d={start:e,...this.getRootNode().posFromIndex(e)},{childNodes:g,length:p}=this;for(let m=0;m<p;m++){let c=g[m],b=c.text().trim();b&&!t.has(b)&&!r.has(b)&&(t.size>0||!n.has(b))&&a.push(v(c,d,"invalid conversion flag"))}return a}print(){return super.print({sep:";"})}};me=new WeakMap});var et,di=x(()=>{"use strict";y();C();ge();et=class extends T{constructor(e,t=!0,r=h.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter-rule");let s=e.indexOf(":"),o=e.slice(0,s).indexOf("=>"),a=o===-1?e.slice(0,s):e.slice(o+2,s);t&&r.variants.includes(a.trim())?(super.insertAt(new q(a,"converter-rule-variant",r,n)),super.insertAt(new q(e.slice(s+1),"converter-rule-to",r,n)),o!==-1&&super.insertAt(new q(e.slice(0,o),"converter-rule-from",r,n),0)):super.insertAt(new q(e,"converter-rule-to",r,n))}toString(e){let{childNodes:t}=this;if(t.length===3){let[r,n,s]=t;return`${r.toString(e)}=>${n.toString(e)}:${s.toString(e)}`}return super.toString(e,":")}text(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${t.text()}=>${r.text()}:${n.text()}`}return super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${r.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var Vt,pi=x(()=>{"use strict";H();ai();y();C();li();di();Vt=class extends oi(T){constructor(e,t,r=h.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter");this.append(new Ht(e,r,n));let[s]=t,o=s.includes(":"),a=new et(s,o,r,n);o&&a.length===1?this.insertAt(new et(t.join(";"),!1,r,n)):this.append(a,...t.slice(1).map(d=>new et(d,!0,r,n)))}toString(e){let{childNodes:[t,...r]}=this;return`-{${t.toString()}${t.length>0?"|":""}${r.map(n=>n.toString()).join(";")}}-`}text(){let{childNodes:[e,...t]}=this;return`-{${e.text()}|${se(t,";")}}-`}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}getGaps(e){return e||this.firstChild.length>0?1:0}print(){let{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${oe(t,{sep:";"})}}-</span>`}}});var gi={};z(gi,{parseConverter:()=>es});var es,ui=x(()=>{"use strict";y();pi();es=(l,i=h.getConfig(),e=[])=>{let t=/-\{/gu,r=/-\{|\}-/gu,n=[],s=t,o=s.exec(l);for(;o;){let{0:a,index:d}=o;if(a==="}-"){let g=n.pop(),{length:p}=e,m=l.slice(g.index+2,d),c=m.indexOf("|"),[b,A]=c===-1?[[],m]:[m.slice(0,c).split(";"),m.slice(c+1)],N=A.replace(/(&[#a-z\d]+);/giu,"$1"),P=`(?:${i.variants.join("|")})`,w=N.split(new RegExp(`;(?=\\s*(?:${P}|[^;]*?=>\\s*${P})\\s*:)`,"u")).map($=>$.replace(/\x01/gu,";"));new Vt(b,w,i,e),l=`${l.slice(0,g.index)}\0${p}v\x7F${l.slice(d+2)}`,n.length===0&&(s=t),s.lastIndex=g.index+3+String(p).length}else n.push(o),s=r,s.lastIndex=d+2;o=s.exec(l)}return l}});var zr={};z(zr,{Token:()=>T});var re,B,W,Le,ut,Wr,Xt,hi,Qt,mi,Kt,ci,Zt,fi,Jt,Ti,Yt,xi,er,bi,tr,ki,rr,yi,nr,Ai,ir,vi,Mr,T,C=x(()=>{"use strict";H();fe();y();Qr();Zr();Mr=class Mr extends Tt{constructor(e,t=h.getConfig(),r=[],n){super();k(this,ut);k(this,Xt);k(this,Qt);k(this,Kt);k(this,Zt);k(this,Jt);k(this,Yt);k(this,er);k(this,tr);k(this,rr);k(this,nr);k(this,ir);f(this,"type","root");k(this,re,0);k(this,B,void 0);k(this,W,void 0);k(this,Le,void 0);typeof e=="string"&&this.insertAt(e),S(this,B,t),S(this,W,r),r.push(this)}parseOnce(e=u(this,re),t=!1){if(e<u(this,re)||!this.getAttribute("plain")||this.length===0)return this;switch(e){case 0:this.type==="root"&&u(this,W).shift(),S(this,Le,t),F(this,Xt,hi).call(this,t);break;case 1:F(this,Qt,mi).call(this);break;case 2:F(this,Kt,ci).call(this);break;case 3:F(this,Zt,fi).call(this);break;case 4:F(this,Jt,Ti).call(this);break;case 5:F(this,Yt,xi).call(this);break;case 6:F(this,er,bi).call(this);break;case 7:F(this,tr,ki).call(this);break;case 8:F(this,rr,yi).call(this);break;case 9:F(this,nr,Ai).call(this);break;case 10:F(this,ir,vi).call(this)}if(this.type==="root")for(let r of u(this,W))r.parseOnce(e,t);return mt(this,re)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((n,s)=>{if(s%2===0)return new st(n);if(Number.isNaN(Number(n[n.length-1])))return u(this,W)[Number(n.slice(0,-1))];throw new Error(`\u89E3\u6790\u9519\u8BEF\uFF01\u672A\u6B63\u786E\u6807\u8BB0\u7684 Token\uFF1A${n}`)});return t==="string"?r.map(String).join(""):t==="text"?se(r):r}afterBuild(){if(this.type==="root")for(let e of u(this,W))e.afterBuild()}parse(e=11,t=!1){for(;u(this,re)<e;)this.parseOnce(u(this,re),t);return e&&(F(this,ut,Wr).call(this),this.afterBuild()),this}getAttribute(e){switch(e){case"plain":return this.constructor===Mr;case"config":return JSON.parse(JSON.stringify(u(this,B)));case"accum":return u(this,W);case"include":{if(u(this,Le)!==void 0)return u(this,Le);let t=this.getRootNode();return t!==this?t.getAttribute("include"):!1}default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":u(this,re)===0&&this.type==="root"&&u(this,W).shift(),S(this,re,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new st(e):e;return super.insertAt(r,t),r.type==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r=!1,n=!1,s=!1){return h.normalizeTitle(e,t,u(this,Le),u(this,B),r,n,s)}};re=new WeakMap,B=new WeakMap,W=new WeakMap,Le=new WeakMap,ut=new WeakSet,Wr=function(){var n;S(this,re,11);let{length:e,firstChild:t}=this,r=String(t);if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let s of u(this,W))F(n=s,ut,Wr).call(n)},Xt=new WeakSet,hi=function(e){let{parseCommentAndExt:t}=(Rn(),R(Pn));this.setText(t(String(this.firstChild),u(this,B),u(this,W),e))},Qt=new WeakSet,mi=function(){let{parseBraces:e}=(br(),R(xn)),t=this.type==="root"?String(this.firstChild):`\0${String(this.firstChild)}`,r=e(t,u(this,B),u(this,W));this.setText(this.type==="root"?r:r.slice(1))},Kt=new WeakSet,ci=function(){var t;if((t=u(this,B).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(Bn(),R(qn));this.setText(e(String(this.firstChild),u(this,B),u(this,W)))},Zt=new WeakSet,fi=function(){var t;if((t=u(this,B).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(_n(),R(Mn));this.setText(e(this,u(this,B),u(this,W)))},Jt=new WeakSet,Ti=function(){var t;if((t=u(this,B).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(Vn(),R(Hn));this.setText(e(this,u(this,B),u(this,W)))},Yt=new WeakSet,xi=function(){let{parseLinks:e}=(Jn(),R(Zn));this.setText(e(String(this.firstChild),u(this,B),u(this,W)))},er=new WeakSet,bi=function(){var r;if((r=u(this,B).excludes)!=null&&r.includes("quote"))return;let{parseQuotes:e}=(jr(),R(Or)),t=String(this.firstChild).split(`
|
|
33
|
+
`);for(let n=0;n<t.length;n++)t[n]=e(t[n],u(this,B),u(this,W));this.setText(t.join(`
|
|
34
|
+
`))},tr=new WeakSet,ki=function(){var t;if((t=u(this,B).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(ei(),R(Yn));this.setText(e(String(this.firstChild),u(this,B),u(this,W)))},rr=new WeakSet,yi=function(){var t;if((t=u(this,B).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(ri(),R(ti));this.setText(e(String(this.firstChild),u(this,B),u(this,W)))},nr=new WeakSet,Ai=function(){var n;if((n=u(this,B).excludes)!=null&&n.includes("list"))return;let{parseList:e}=(si(),R(ii)),t=String(this.firstChild).split(`
|
|
35
|
+
`),r=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;r<t.length;r++)t[r]=e(t[r],u(this,B),u(this,W));this.setText(t.join(`
|
|
36
|
+
`))},ir=new WeakSet,vi=function(){if(u(this,B).variants.length>0){let{parseConverter:e}=(ui(),R(gi));this.setText(e(String(this.firstChild),u(this,B),u(this,W)))}};T=Mr});var ts,Ie,Si,rs,h,y=x(()=>{or();fe();ts=l=>l.replace(/[\0\x7F]/gu,""),Ie={i18n:void 0,getConfig(){return{...Dr,...this.config,excludes:[]}},msg(l,i=""){var e,t;return l&&((t=(e=this.i18n)==null?void 0:e[l])!=null?t:l).replace("$1",this.msg(i))},normalizeTitle(l,i=0,e=!1,t=Ie.getConfig(),r=!1,n=!1,s=!1){let{Title:o}=(Xr(),R(Vr));if(r)return new o(l,i,t,n,s);let{Token:a}=(C(),R(zr)),d=rt.run(()=>new a(l,t).parseOnce(0,e).parseOnce());return new o(String(d),i,t,n,s)},parse(l,i,e=11,t=Ie.getConfig()){let{Token:r}=(C(),R(zr));return rt.run(()=>new r(ts(l),t).parse(e,i))}},Si={},rs=new Set(["normalizeTitle","parse"]);for(let l in Ie)rs.has(l)||(Si[l]={enumerable:!1});Object.defineProperties(Ie,Si);typeof self=="object"?Object.assign(self,{Parser:Ie}):typeof globalThis=="object"&&Object.assign(globalThis,{Parser:Ie});h=Ie});y();})();
|
package/extensions/dist/base.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const workerJS = () => {
|
|
3
|
-
importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.3.
|
|
3
|
+
importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.3.3-b/bundle/bundle.min.js');
|
|
4
4
|
const entities = { '&': 'amp', '<': 'lt', '>': 'gt' };
|
|
5
5
|
self.onmessage = ({ data }) => {
|
|
6
6
|
var _a;
|
package/extensions/ui.css
CHANGED
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
font-family: monospace;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.wpb-
|
|
8
|
-
text-decoration: underline wavy #f00 1px;
|
|
9
|
-
}
|
|
10
|
-
.wpb-image-invalid, .wpb-table-inter {
|
|
7
|
+
.wpb-html-invalid, .wpb-image-invalid, .wpb-table-inter {
|
|
11
8
|
color: #f00;
|
|
12
9
|
font-weight: normal;
|
|
13
10
|
text-decoration: underline wavy 1px;
|