mdat 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +79 -79
- package/dist/index.js +67 -67
- package/dist/processors.d.ts +4 -3
- package/dist/utilities.d.ts +3 -0
- package/package.json +5 -3
- package/readme.md +14 -5
package/bin/cli.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var UC=Object.create;var ec=Object.defineProperty;var zC=Object.getOwnPropertyDescriptor;var $C=Object.getOwnPropertyNames;var qC=Object.getPrototypeOf,VC=Object.prototype.hasOwnProperty;var Tr=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var tc=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),GC=(t,e)=>{for(var r in e)ec(t,r,{get:e[r],enumerable:!0})},WC=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $C(e))!VC.call(t,i)&&i!==r&&ec(t,i,{get:()=>e[i],enumerable:!(n=zC(e,i))||n.enumerable});return t};var jd=(t,e,r)=>(r=t!=null?UC(qC(t)):{},WC(e||!t||!t.__esModule?ec(r,"default",{value:t,enumerable:!0}):r,t));var rm=tc((qj,pk)=>{pk.exports={addendum:"addenda",aircraft:"aircraft",alga:"algae",alumna:"alumnae",alumnus:"alumni",alveolus:"alveoli",amoeba:"amoebae",analysis:"analyses",antenna:"antennae",antithesis:"antitheses",apex:"apices",appendix:"appendices",automaton:"automata",axis:"axes",bacillus:"bacilli",bacterium:"bacteria",baculum:"bacula",barracks:"barracks",basis:"bases",beau:"beaux",bison:"bison",buffalo:"buffalo",bureau:"bureaus",cactus:"cacti",calf:"calves",carcinoma:"carcinomata",carp:"carp",census:"censuses",chassis:"chassis",cherub:"cherubim",child:"children",ch\u00E2teau:"ch\xE2teaus",cloaca:"cloacae",cod:"cod",codex:"codices",concerto:"concerti",consortium:"consortia",corpus:"corpora",crisis:"crises",criterion:"criteria",curriculum:"curricula",cystoma:"cystomata",datum:"data",deer:"deer",diagnosis:"diagnoses",die:"dice",dwarf:"dwarfs",echo:"echoes",elf:"elves",elk:"elk",ellipsis:"ellipses",embargo:"embargoes",emphasis:"emphases",erratum:"errata","faux pas":"faux pas",fez:"fezes",firmware:"firmware",fish:"fish",focus:"foci",foot:"feet",formula:"formulae",fungus:"fungi",gallows:"gallows",genus:"genera",glomerulus:"glomeruli",goose:"geese",graffito:"graffiti",grouse:"grouse",half:"halves",hamulus:"hamuli",hero:"heroes",hippopotamus:"hippopotami",hoof:"hooves",hovercraft:"hovercraft",hypothesis:"hypotheses",iliac:"ilia",incubus:"incubi",index:"indices",interstitium:"interstitia",kakapo:"kakapo",knife:"knives",larva:"larvae",leaf:"leaves",libretto:"libretti",life:"lives",loaf:"loaves",loculus:"loculi",locus:"loci",louse:"lice",man:"men",matrix:"matrices",means:"means",measles:"measles",media:"media",medium:"media",memorandum:"memoranda",millennium:"millennia",minutia:"minutiae",moose:"moose",mouse:"mice",nebula:"nebulae",nemesis:"nemeses",neurosis:"neuroses",news:"news",nucleolus:"nucleoli",nucleus:"nuclei",oasis:"oases",occiput:"occipita",offspring:"offspring",omphalos:"omphaloi",opus:"opera",ovum:"ova",ox:"oxen",paralysis:"paralyses",parenthesis:"parentheses",person:"people",phenomenon:"phenomena",phylum:"phyla",pike:"pike",polyhedron:"polyhedra",potato:"potatoes",primus:"primi",prognosis:"prognoses",quiz:"quizzes",radius:"radii",referendum:"referenda",salmon:"salmon",scarf:"scarves",scrotum:"scrota",self:"selves",seminoma:"seminomata",series:"series",sheep:"sheep",shelf:"shelves",shrimp:"shrimp",simulacrum:"simulacra",soliloquy:"soliloquies",spacecraft:"spacecraft",species:"species",spectrum:"spectra",squid:"squid",stimulus:"stimuli",stratum:"strata",swine:"swine",syconium:"syconia",syllabus:"syllabi",symposium:"symposia",synopsis:"synopses",synthesis:"syntheses",tableau:"tableaus",testis:"testes",that:"those",thesis:"theses",thief:"thieves",this:"these",thrombus:"thrombi",tomato:"tomatoes",tooth:"teeth",torus:"tori",trout:"trout",tuna:"tuna",umbilicus:"umbilici",uterus:"uteri",vertebra:"vertebrae",vertex:"vertices",veto:"vetoes",vita:"vitae",vortex:"vortices",watercraft:"watercraft",wharf:"wharves",wife:"wives",wolf:"wolves",woman:"women"}});var im=tc((Vj,nm)=>{"use strict";var dk=rm();nm.exports=new Map(Object.entries(dk))});var qg=tc((N3,$g)=>{"use strict";var uu=Object.prototype.hasOwnProperty,zg=Object.prototype.toString,Pg=Object.defineProperty,Lg=Object.getOwnPropertyDescriptor,Mg=function(e){return typeof Array.isArray=="function"?Array.isArray(e):zg.call(e)==="[object Array]"},Bg=function(e){if(!e||zg.call(e)!=="[object Object]")return!1;var r=uu.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&uu.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||uu.call(e,i)},jg=function(e,r){Pg&&r.name==="__proto__"?Pg(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},Ug=function(e,r){if(r==="__proto__")if(uu.call(e,r)){if(Lg)return Lg(e,r).value}else return;return e[r]};$g.exports=function t(){var e,r,n,i,o,s,a=arguments[0],u=1,l=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<l;++u)if(e=arguments[u],e!=null)for(r in e)n=Ug(a,r),i=Ug(e,r),a!==i&&(c&&i&&(Bg(i)||(o=Mg(i)))?(o?(o=!1,s=n&&Mg(n)?n:[]):s=n&&Bg(n)?n:{},jg(a,{name:r,newValue:t(c,s,i)})):typeof i<"u"&&jg(a,{name:r,newValue:i}));return a}});var Ud=(t=0)=>e=>`\x1B[${e+t}m`,zd=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,$d=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,We={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},yM=Object.keys(We.modifier),HC=Object.keys(We.color),KC=Object.keys(We.bgColor),bM=[...HC,...KC];function YC(){let t=new Map;for(let[e,r]of Object.entries(We)){for(let[n,i]of Object.entries(r))We[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=We[n],t.set(i[0],i[1]);Object.defineProperty(We,e,{value:r,enumerable:!1})}return Object.defineProperty(We,"codes",{value:t,enumerable:!1}),We.color.close="\x1B[39m",We.bgColor.close="\x1B[49m",We.color.ansi=Ud(),We.color.ansi256=zd(),We.color.ansi16m=$d(),We.bgColor.ansi=Ud(10),We.bgColor.ansi256=zd(10),We.bgColor.ansi16m=$d(10),Object.defineProperties(We,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>We.rgbToAnsi256(...We.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>We.ansi256ToAnsi(We.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>We.ansi256ToAnsi(We.hexToAnsi256(e)),enumerable:!1}}),We}var ZC=YC(),yr=ZC;import rc from"node:process";import XC from"node:os";import qd from"node:tty";function or(t,e=globalThis.Deno?globalThis.Deno.args:rc.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:et}=rc,pa;or("no-color")||or("no-colors")||or("color=false")||or("color=never")?pa=0:(or("color")||or("colors")||or("color=true")||or("color=always"))&&(pa=1);function JC(){if("FORCE_COLOR"in et)return et.FORCE_COLOR==="true"?1:et.FORCE_COLOR==="false"?0:et.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(et.FORCE_COLOR,10),3)}function QC(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function ew(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=JC();n!==void 0&&(pa=n);let i=r?pa:n;if(i===0)return 0;if(r){if(or("color=16m")||or("color=full")||or("color=truecolor"))return 3;if(or("color=256"))return 2}if("TF_BUILD"in et&&"AGENT_NAME"in et)return 1;if(t&&!e&&i===void 0)return 0;let o=i||0;if(et.TERM==="dumb")return o;if(rc.platform==="win32"){let s=XC.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in et)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in et)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in et)||et.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in et)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(et.TEAMCITY_VERSION)?1:0;if(et.COLORTERM==="truecolor"||et.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in et){let s=Number.parseInt((et.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(et.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(et.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(et.TERM)||"COLORTERM"in et?1:o}function Vd(t,e={}){let r=ew(t,{streamIsTTY:t&&t.isTTY,...e});return QC(r)}var tw={stdout:Vd({isTTY:qd.isatty(1)}),stderr:Vd({isTTY:qd.isatty(2)})},Gd=tw;function Wd(t,e,r){let n=t.indexOf(e);if(n===-1)return t;let i=e.length,o=0,s="";do s+=t.slice(o,n)+e+r,o=n+i,n=t.indexOf(e,o);while(n!==-1);return s+=t.slice(o),s}function Hd(t,e,r,n){let i=0,o="";do{let s=t[n-1]==="\r";o+=t.slice(i,s?n-1:n)+e+(s?`\r
|
|
3
3
|
`:`
|
|
4
4
|
`)+r,i=n+1,n=t.indexOf(`
|
|
5
|
-
`,i)}while(n!==-1);return o+=t.slice(i),o}var{stdout:Kd,stderr:Yd}=Gd,
|
|
6
|
-
`);return o!==-1&&(e=Hd(e,i,n,o)),n+e+i};Object.defineProperties(as.prototype,Hi);var
|
|
5
|
+
`,i)}while(n!==-1);return o+=t.slice(i),o}var{stdout:Kd,stderr:Yd}=Gd,nc=Symbol("GENERATOR"),Wi=Symbol("STYLER"),ss=Symbol("IS_EMPTY"),Zd=["ansi","ansi","ansi256","ansi16m"],Hi=Object.create(null),rw=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=Kd?Kd.level:0;t.level=e.level===void 0?r:e.level};var nw=t=>{let e=(...r)=>r.join(" ");return rw(e,t),Object.setPrototypeOf(e,as.prototype),e};function as(t){return nw(t)}Object.setPrototypeOf(as.prototype,Function.prototype);for(let[t,e]of Object.entries(yr))Hi[t]={get(){let r=da(this,oc(e.open,e.close,this[Wi]),this[ss]);return Object.defineProperty(this,t,{value:r}),r}};Hi.visible={get(){let t=da(this,this[Wi],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var ic=(t,e,r,...n)=>t==="rgb"?e==="ansi16m"?yr[r].ansi16m(...n):e==="ansi256"?yr[r].ansi256(yr.rgbToAnsi256(...n)):yr[r].ansi(yr.rgbToAnsi(...n)):t==="hex"?ic("rgb",e,r,...yr.hexToRgb(...n)):yr[r][t](...n),iw=["rgb","hex","ansi256"];for(let t of iw){Hi[t]={get(){let{level:r}=this;return function(...n){let i=oc(ic(t,Zd[r],"color",...n),yr.color.close,this[Wi]);return da(this,i,this[ss])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);Hi[e]={get(){let{level:r}=this;return function(...n){let i=oc(ic(t,Zd[r],"bgColor",...n),yr.bgColor.close,this[Wi]);return da(this,i,this[ss])}}}}var ow=Object.defineProperties(()=>{},{...Hi,level:{enumerable:!0,get(){return this[nc].level},set(t){this[nc].level=t}}}),oc=(t,e,r)=>{let n,i;return r===void 0?(n=t,i=e):(n=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:i,parent:r}},da=(t,e,r)=>{let n=(...i)=>sw(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,ow),n[nc]=t,n[Wi]=e,n[ss]=r,n},sw=(t,e)=>{if(t.level<=0||!e)return t[ss]?"":e;let r=t[Wi];if(r===void 0)return e;let{openAll:n,closeAll:i}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=Wd(e,r.close,r.open),r=r.parent;let o=e.indexOf(`
|
|
6
|
+
`);return o!==-1&&(e=Hd(e,i,n,o)),n+e+i};Object.defineProperties(as.prototype,Hi);var aw=as(),IM=as({level:Yd?Yd.level:0});var St=aw;var Xd=t=>Number.isFinite(t)?t:0;function uw(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Xd(t*1e3)%1e3),nanoseconds:Math.trunc(Xd(t*1e6)%1e3)}}function lw(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function sc(t){switch(typeof t){case"number":{if(Number.isFinite(t))return uw(t);break}case"bigint":return lw(t)}throw new TypeError("Expected a finite number or bigint")}var cw=t=>t===0||t===0n,fw=(t,e)=>e===1||e===1n?t:`${t}s`,pw=1e-7,dw=24n*60n*60n*1000n;function Kr(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(c,f)=>{let p=Math.floor(c*10**f+pw);return(Math.round(p)/10**f).toFixed(f)},s=(c,f,p,d)=>{if(!((i.length===0||!e.colonNotation)&&cw(c)&&!(e.colonNotation&&p==="m"))){if(d??=String(c),e.colonNotation){let m=d.includes(".")?d.split(".")[0].length:d.length,y=i.length>0?2:1;d="0".repeat(Math.max(0,y-m))+d}else d+=e.verbose?" "+fw(f,c):p;i.push(d)}},a=sc(t),u=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(u,"day","d"):(s(u/365n,"year","y"),s(u%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){let c=Number(a.seconds),f=Number(a.milliseconds),p=Number(a.microseconds),d=Number(a.nanoseconds);if(s(c,"second","s"),e.formatSubMilliseconds)s(f,"millisecond","ms"),s(p,"microsecond","\xB5s"),s(d,"nanosecond","ns");else{let m=f+p/1e3+d/1e6,y=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=y?m.toFixed(y):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let c=(r?Number(t%dw):t)/1e3%60,f=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,p=o(c,f),d=e.keepDecimalsOnWholeSeconds?p:p.replace(/\.0+$/,"");s(Number.parseFloat(d),"second","s",d)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}import{getMdatReports as gM,log as gt,reporterMdat as ts}from"remark-mdat";import Jd from"node:fs";import Qd from"node:path";import{VFile as hw}from"vfile";function ac(t,e,r){let n=uc(t);if(!r&&typeof e=="function"&&(r=e,e=void 0),!r)return new Promise(o);o(i,r);function i(s){r(void 0,s)}function o(s,a){let u;try{u=Qd.resolve(n.cwd,n.path)}catch(c){return a(c)}Jd.readFile(u,e,l);function l(c,f){c?a(c):(n.value=f,s(n))}}}function uc(t){return typeof t=="string"||t instanceof URL?t={path:t}:gw(t)&&(t={path:new TextDecoder().decode(t)}),mw(t)?t:new hw(t)}function pn(t,e,r){let n=uc(t);if(!r&&typeof e=="function"&&(r=e,e=void 0),!r)return new Promise(o);o(i,r);function i(s){r(void 0,s)}function o(s,a){let u;try{u=Qd.resolve(n.cwd,n.path)}catch(c){return a(c)}Jd.writeFile(u,n.value||"",e||void 0,l);function l(c){c?a(c):s(n)}}}function mw(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function gw(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}import{notStrictEqual as zw,strictEqual as $w}from"assert";var xw={right:Cw,center:ww},yw=0,ha=1,bw=2,ma=3,lc=class{constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(`
|
|
7
7
|
`).map(i=>i.split(" ")),n=0;return r.forEach(i=>{i.length>1&&Zt.stringWidth(i[0])>n&&(n=Math.min(Math.floor(this.width*.5),Zt.stringWidth(i[0])))}),r.forEach(i=>{this.div(...i.map((o,s)=>({text:o.trim(),padding:this.measurePadding(o),width:s===0&&i.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let r=Zt.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(`
|
|
8
|
-
`)}rowToString(e,r){return this.rasterize(e).forEach((n,i)=>{let o="";n.forEach((s,a)=>{let{width:u}=e[a],l=this.negatePadding(e[a]),c=s;if(l>Zt.stringWidth(s)&&(c+=" ".repeat(l-Zt.stringWidth(s))),e[a].align&&e[a].align!=="left"&&this.wrap){let p=
|
|
8
|
+
`)}rowToString(e,r){return this.rasterize(e).forEach((n,i)=>{let o="";n.forEach((s,a)=>{let{width:u}=e[a],l=this.negatePadding(e[a]),c=s;if(l>Zt.stringWidth(s)&&(c+=" ".repeat(l-Zt.stringWidth(s))),e[a].align&&e[a].align!=="left"&&this.wrap){let p=xw[e[a].align];c=p(c,l),Zt.stringWidth(c)<l&&(c+=" ".repeat((u||0)-Zt.stringWidth(c)-1))}let f=e[a].padding||[0,0,0,0];f[ma]&&(o+=" ".repeat(f[ma])),o+=eh(e[a],c,"| "),o+=c,o+=eh(e[a],c," |"),f[ha]&&(o+=" ".repeat(f[ha])),i===0&&r.length>0&&(o=this.renderInline(o,r[r.length-1]))}),r.push({text:o.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){let n=e.match(/^ */),i=n?n[0].length:0,o=r.text,s=Zt.stringWidth(o.trimRight());return r.span?this.wrap?i<s?e:(r.hidden=!0,o.trimRight()+" ".repeat(i-s)+e.trimLeft()):(r.hidden=!0,o+e):e}rasterize(e){let r=[],n=this.columnWidths(e),i;return e.forEach((o,s)=>{o.width=n[s],this.wrap?i=Zt.wrap(o.text,this.negatePadding(o),{hard:!0}).split(`
|
|
9
9
|
`):i=o.text.split(`
|
|
10
|
-
`),o.border&&(i.unshift("."+"-".repeat(this.negatePadding(o)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(o)+2)+"'")),o.padding&&(i.unshift(...new Array(o.padding[
|
|
11
|
-
`),i+=t.charAt(o);return r&&n&&(i=`${r}${i}${n}`),i}function cc(t){return th(t,{stringWidth:e=>[...e].length,stripAnsi:lc,wrap:nh})}import{dirname as ih,resolve as oh}from"path";import{readdirSync as Cw,statSync as ww}from"fs";function sh(t,e){let r=oh(".",t),n;for(ww(r).isDirectory()||(r=ih(r));;){if(n=e(r,Cw(r)),n)return oh(r,n);if(r=ih(n=r),n===r)break}}import{inspect as zw}from"util";import{readFileSync as $w}from"fs";import{fileURLToPath as qw}from"url";import{format as _w}from"util";import{normalize as Sw,resolve as vw}from"path";function Wn(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1,i=t.match(/^-+/);for(let o=i?i[0].length:0;o<t.length;o++){let s=t.charAt(o);n&&(n=!1,s=s.toUpperCase()),o!==0&&(s==="-"||s==="_")?n=!0:s!=="-"&&s!=="_"&&(r+=s)}return r}}function ga(t,e){let r=t.toLowerCase();e=e||"-";let n="";for(let i=0;i<t.length;i++){let o=r.charAt(i),s=t.charAt(i);o!==s&&i>0?n+=`${e}${r.charAt(i)}`:n+=s}return n}function xa(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function ah(t){if(Array.isArray(t))return t.map(s=>typeof s!="string"?s+"":s);t=t.trim();let e=0,r=null,n=null,i=null,o=[];for(let s=0;s<t.length;s++){if(r=n,n=t.charAt(s),n===" "&&!i){r!==" "&&e++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),o[e]||(o[e]=""),o[e]+=n}return o}var sr;(function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"})(sr||(sr={}));var Yr,ya=class{constructor(e){Yr=e}parse(e,r){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),i=ah(e),o=typeof e=="string",s=kw(Object.assign(Object.create(null),n.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),u=Object.assign(Object.create(null),n.default),l=n.configObjects||[],c=n.envPrefix,f=a["populate--"],p=f?"--":"_",d=Object.create(null),m=Object.create(null),y=n.__||Yr.format,g={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},b=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,w=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(A){let k=typeof A=="object"?A.key:A,M=Object.keys(A).map(function(I){return{boolean:"bools",string:"strings",number:"numbers"}[I]}).filter(Boolean).pop();M&&(g[M][k]=!0),g.arrays[k]=!0,g.keys.push(k)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(A){g.bools[A]=!0,g.keys.push(A)}),[].concat(n.string||[]).filter(Boolean).forEach(function(A){g.strings[A]=!0,g.keys.push(A)}),[].concat(n.number||[]).filter(Boolean).forEach(function(A){g.numbers[A]=!0,g.keys.push(A)}),[].concat(n.count||[]).filter(Boolean).forEach(function(A){g.counts[A]=!0,g.keys.push(A)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(A){g.normalize[A]=!0,g.keys.push(A)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([A,k])=>{typeof k=="number"&&(g.nargs[A]=k,g.keys.push(A))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([A,k])=>{typeof k=="function"&&(g.coercions[A]=k,g.keys.push(A))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(A){g.configs[A]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([A,k])=>{(typeof k=="boolean"||typeof k=="function")&&(g.configs[A]=k)})),E(n.key,s,n.default,g.arrays),Object.keys(u).forEach(function(A){(g.aliases[A]||[]).forEach(function(k){u[k]=u[A]})});let C=null;qt();let D=[],R=Object.assign(Object.create(null),{_:[]}),S={};for(let A=0;A<i.length;A++){let k=i[A],M=k.replace(/^-{3,}/,"---"),I,T,K,$,te,ft;if(k!=="--"&&/^-/.test(k)&&oe(k))de(k);else if(M.match(/^---+(=|$)/)){de(k);continue}else if(k.match(/^--.+=/)||!a["short-option-groups"]&&k.match(/^-.+=/))$=k.match(/^--?([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&(W($[1],g.arrays)?A=be(A,$[1],i,$[2]):W($[1],g.nargs)!==!1?A=ye(A,$[1],i,$[2]):_($[1],$[2],!0));else if(k.match(w)&&a["boolean-negation"])$=k.match(w),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],_(T,W(T,g.arrays)?[!1]:!1));else if(k.match(/^--.+/)||!a["short-option-groups"]&&k.match(/^-[^-]+/))$=k.match(/^--?(.+)/),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],W(T,g.arrays)?A=be(A,T,i):W(T,g.nargs)!==!1?A=ye(A,T,i):(te=i[A+1],te!==void 0&&(!te.match(/^-/)||te.match(b))&&!W(T,g.bools)&&!W(T,g.counts)||/^(true|false)$/.test(te)?(_(T,te),A++):_(T,me(T))));else if(k.match(/^-.\..+=/))$=k.match(/^-([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&_($[1],$[2]);else if(k.match(/^-.\..+/)&&!k.match(b))te=i[A+1],$=k.match(/^-(.\..+)/),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],te!==void 0&&!te.match(/^-/)&&!W(T,g.bools)&&!W(T,g.counts)?(_(T,te),A++):_(T,me(T)));else if(k.match(/^-[^-]+/)&&!k.match(b)){K=k.slice(1,-1).split(""),I=!1;for(let Tt=0;Tt<K.length;Tt++){if(te=k.slice(Tt+2),K[Tt+1]&&K[Tt+1]==="="){ft=k.slice(Tt+3),T=K[Tt],W(T,g.arrays)?A=be(A,T,i,ft):W(T,g.nargs)!==!1?A=ye(A,T,i,ft):_(T,ft),I=!0;break}if(te==="-"){_(K[Tt],te);continue}if(/[A-Za-z]/.test(K[Tt])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(te)&&W(te,g.bools)===!1){_(K[Tt],te),I=!0;break}if(K[Tt+1]&&K[Tt+1].match(/\W/)){_(K[Tt],te),I=!0;break}else _(K[Tt],me(K[Tt]))}T=k.slice(-1)[0],!I&&T!=="-"&&(W(T,g.arrays)?A=be(A,T,i):W(T,g.nargs)!==!1?A=ye(A,T,i):(te=i[A+1],te!==void 0&&(!/^(-|--)[^-]/.test(te)||te.match(b))&&!W(T,g.bools)&&!W(T,g.counts)||/^(true|false)$/.test(te)?(_(T,te),A++):_(T,me(T))))}else if(k.match(/^-[0-9]$/)&&k.match(b)&&W(k.slice(1),g.bools))T=k.slice(1),_(T,me(T));else if(k==="--"){D=i.slice(A+1);break}else if(a["halt-at-non-option"]){D=i.slice(A);break}else de(k)}ee(R,!0),ee(R,!1),P(R),ae(),x(R,g.aliases,u,!0),_e(R),a["set-placeholder-key"]&&it(R),Object.keys(g.counts).forEach(function(A){Ue(R,A.split("."))||_(A,0)}),f&&D.length&&(R[p]=[]),D.forEach(function(A){R[p].push(A)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(R).filter(A=>A!=="--"&&A.includes("-")).forEach(A=>{delete R[A]}),a["strip-aliased"]&&[].concat(...Object.keys(s).map(A=>s[A])).forEach(A=>{a["camel-case-expansion"]&&A.includes("-")&&delete R[A.split(".").map(k=>Wn(k)).join(".")],delete R[A]});function de(A){let k=v("_",A);(typeof k=="string"||typeof k=="number")&&R._.push(k)}function ye(A,k,M,I){let T,K=W(k,g.nargs);if(K=typeof K!="number"||isNaN(K)?1:K,K===0)return ze(I)||(C=Error(y("Argument unexpected for: %s",k))),_(k,me(k)),A;let $=ze(I)?0:1;if(a["nargs-eats-options"])M.length-(A+1)+$<K&&(C=Error(y("Not enough arguments following: %s",k))),$=K;else{for(T=A+1;T<M.length&&(!M[T].match(/^-[^0-9]/)||M[T].match(b)||oe(M[T]));T++)$++;$<K&&(C=Error(y("Not enough arguments following: %s",k)))}let te=Math.min($,K);for(!ze(I)&&te>0&&(_(k,I),te--),T=A+1;T<te+A+1;T++)_(k,M[T]);return A+te}function be(A,k,M,I){let T=[],K=I||M[A+1],$=W(k,g.nargs);if(W(k,g.bools)&&!/^(true|false)$/.test(K))T.push(!0);else if(ze(K)||ze(I)&&/^-/.test(K)&&!b.test(K)&&!oe(K)){if(u[k]!==void 0){let te=u[k];T=Array.isArray(te)?te:[te]}}else{ze(I)||T.push(F(k,I,!0));for(let te=A+1;te<M.length&&!(!a["greedy-arrays"]&&T.length>0||$&&typeof $=="number"&&T.length>=$||(K=M[te],/^-/.test(K)&&!b.test(K)&&!oe(K)));te++)A=te,T.push(F(k,K,o))}return typeof $=="number"&&($&&T.length<$||isNaN($)&&T.length===0)&&(C=Error(y("Not enough arguments following: %s",k))),_(k,T),A}function _(A,k,M=o){if(/-/.test(A)&&a["camel-case-expansion"]){let K=A.split(".").map(function($){return Wn($)}).join(".");L(A,K)}let I=F(A,k,M),T=A.split(".");Qe(R,T,I),g.aliases[A]&&g.aliases[A].forEach(function(K){let $=K.split(".");Qe(R,$,I)}),T.length>1&&a["dot-notation"]&&(g.aliases[T[0]]||[]).forEach(function(K){let $=K.split("."),te=[].concat(T);te.shift(),$=$.concat(te),(g.aliases[A]||[]).includes($.join("."))||Qe(R,$,I)}),W(A,g.normalize)&&!W(A,g.arrays)&&[A].concat(g.aliases[A]||[]).forEach(function($){Object.defineProperty(S,$,{enumerable:!0,get(){return k},set(te){k=typeof te=="string"?Yr.normalize(te):te}})})}function L(A,k){g.aliases[A]&&g.aliases[A].length||(g.aliases[A]=[k],d[k]=!0),g.aliases[k]&&g.aliases[k].length||L(k,A)}function F(A,k,M){M&&(k=Tw(k)),(W(A,g.bools)||W(A,g.counts))&&typeof k=="string"&&(k=k==="true");let I=Array.isArray(k)?k.map(function(T){return v(A,T)}):v(A,k);return W(A,g.counts)&&(ze(I)||typeof I=="boolean")&&(I=fc()),W(A,g.normalize)&&W(A,g.arrays)&&(Array.isArray(k)?I=k.map(T=>Yr.normalize(T)):I=Yr.normalize(k)),I}function v(A,k){return!a["parse-positional-numbers"]&&A==="_"||!W(A,g.strings)&&!W(A,g.bools)&&!Array.isArray(k)&&(xa(k)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${k}`)))||!ze(k)&&W(A,g.numbers))&&(k=Number(k)),k}function P(A){let k=Object.create(null);x(k,g.aliases,u),Object.keys(g.configs).forEach(function(M){let I=A[M]||k[M];if(I)try{let T=null,K=Yr.resolve(Yr.cwd(),I),$=g.configs[M];if(typeof $=="function"){try{T=$(K)}catch(te){T=te}if(T instanceof Error){C=T;return}}else T=Yr.require(K);j(T)}catch(T){T.name==="PermissionDenied"?C=T:A[M]&&(C=Error(y("Invalid JSON config file: %s",I)))}})}function j(A,k){Object.keys(A).forEach(function(M){let I=A[M],T=k?k+"."+M:M;typeof I=="object"&&I!==null&&!Array.isArray(I)&&a["dot-notation"]?j(I,T):(!Ue(R,T.split("."))||W(T,g.arrays)&&a["combine-arrays"])&&_(T,I)})}function ae(){typeof l<"u"&&l.forEach(function(A){j(A)})}function ee(A,k){if(typeof c>"u")return;let M=typeof c=="string"?c:"",I=Yr.env();Object.keys(I).forEach(function(T){if(M===""||T.lastIndexOf(M,0)===0){let K=T.split("__").map(function($,te){return te===0&&($=$.substring(M.length)),Wn($)});(k&&g.configs[K.join(".")]||!k)&&!Ue(A,K)&&_(K.join("."),I[T])}})}function _e(A){let k,M=new Set;Object.keys(A).forEach(function(I){if(!M.has(I)&&(k=W(I,g.coercions),typeof k=="function"))try{let T=v(I,k(A[I]));[].concat(g.aliases[I]||[],I).forEach(K=>{M.add(K),A[K]=T})}catch(T){C=T}})}function it(A){return g.keys.forEach(k=>{~k.indexOf(".")||typeof A[k]>"u"&&(A[k]=void 0)}),A}function x(A,k,M,I=!1){Object.keys(M).forEach(function(T){Ue(A,T.split("."))||(Qe(A,T.split("."),M[T]),I&&(m[T]=!0),(k[T]||[]).forEach(function(K){Ue(A,K.split("."))||Qe(A,K.split("."),M[T])}))})}function Ue(A,k){let M=A;a["dot-notation"]||(k=[k.join(".")]),k.slice(0,-1).forEach(function(T){M=M[T]||{}});let I=k[k.length-1];return typeof M!="object"?!1:I in M}function Qe(A,k,M){let I=A;a["dot-notation"]||(k=[k.join(".")]),k.slice(0,-1).forEach(function(ft){ft=uh(ft),typeof I=="object"&&I[ft]===void 0&&(I[ft]={}),typeof I[ft]!="object"||Array.isArray(I[ft])?(Array.isArray(I[ft])?I[ft].push({}):I[ft]=[I[ft],{}],I=I[ft][I[ft].length-1]):I=I[ft]});let T=uh(k[k.length-1]),K=W(k.join("."),g.arrays),$=Array.isArray(M),te=a["duplicate-arguments-array"];!te&&W(T,g.nargs)&&(te=!0,(!ze(I[T])&&g.nargs[T]===1||Array.isArray(I[T])&&I[T].length===g.nargs[T])&&(I[T]=void 0)),M===fc()?I[T]=fc(I[T]):Array.isArray(I[T])?te&&K&&$?I[T]=a["flatten-duplicate-arrays"]?I[T].concat(M):(Array.isArray(I[T][0])?I[T]:[I[T]]).concat([M]):!te&&!!K==!!$?I[T]=M:I[T]=I[T].concat([M]):I[T]===void 0&&K?I[T]=$?M:[M]:te&&!(I[T]===void 0||W(T,g.counts)||W(T,g.bools))?I[T]=[I[T],M]:I[T]=M}function E(...A){A.forEach(function(k){Object.keys(k||{}).forEach(function(M){g.aliases[M]||(g.aliases[M]=[].concat(s[M]||[]),g.aliases[M].concat(M).forEach(function(I){if(/-/.test(I)&&a["camel-case-expansion"]){let T=Wn(I);T!==M&&g.aliases[M].indexOf(T)===-1&&(g.aliases[M].push(T),d[T]=!0)}}),g.aliases[M].concat(M).forEach(function(I){if(I.length>1&&/[A-Z]/.test(I)&&a["camel-case-expansion"]){let T=ga(I,"-");T!==M&&g.aliases[M].indexOf(T)===-1&&(g.aliases[M].push(T),d[T]=!0)}}),g.aliases[M].forEach(function(I){g.aliases[I]=[M].concat(g.aliases[M].filter(function(T){return I!==T}))}))})})}function W(A,k){let M=[].concat(g.aliases[A]||[],A),I=Object.keys(k),T=M.find(K=>I.includes(K));return T?k[T]:!1}function Ye(A){let k=Object.keys(g);return[].concat(k.map(I=>g[I])).some(function(I){return Array.isArray(I)?I.includes(A):I[A]})}function ne(A,...k){return[].concat(...k).some(function(I){let T=A.match(I);return T&&Ye(T[1])})}function he(A){if(A.match(b)||!A.match(/^-[^-]+/))return!1;let k=!0,M,I=A.slice(1).split("");for(let T=0;T<I.length;T++){if(M=A.slice(T+2),!Ye(I[T])){k=!1;break}if(I[T+1]&&I[T+1]==="="||M==="-"||/[A-Za-z]/.test(I[T])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(M)||I[T+1]&&I[T+1].match(/\W/))break}return k}function oe(A){return a["unknown-options-as-args"]&&ce(A)}function ce(A){return A=A.replace(/^-{3,}/,"--"),A.match(b)||he(A)?!1:!ne(A,/^-+([^=]+?)=[\s\S]*$/,w,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function me(A){return!W(A,g.bools)&&!W(A,g.counts)&&`${A}`in u?u[A]:we(Fe(A))}function we(A){return{[sr.BOOLEAN]:!0,[sr.STRING]:"",[sr.NUMBER]:void 0,[sr.ARRAY]:[]}[A]}function Fe(A){let k=sr.BOOLEAN;return W(A,g.strings)?k=sr.STRING:W(A,g.numbers)?k=sr.NUMBER:W(A,g.bools)?k=sr.BOOLEAN:W(A,g.arrays)&&(k=sr.ARRAY),k}function ze(A){return A===void 0}function qt(){Object.keys(g.counts).find(A=>W(A,g.arrays)?(C=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",A)),!0):W(A,g.nargs)?(C=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",A)),!0):!1)}return{aliases:Object.assign({},g.aliases),argv:Object.assign(S,R),configuration:a,defaulted:Object.assign({},m),error:C,newAliases:Object.assign({},d)}}};function kw(t){let e=[],r=Object.create(null),n=!0;for(Object.keys(t).forEach(function(i){e.push([].concat(t[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let o=i+1;o<e.length;o++)if(e[i].filter(function(a){return e[o].indexOf(a)!==-1}).length){e[i]=e[i].concat(e[o]),e.splice(o,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(s,a,u){return u.indexOf(s)===a});let o=i.pop();o!==void 0&&typeof o=="string"&&(r[o]=i)}),r}function fc(t){return t!==void 0?t+1:1}function uh(t){return t==="__proto__"?"___proto___":t}function Tw(t){return typeof t=="string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}import{readFileSync as Iw}from"fs";var pc,dc,hc,lh=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,ch=(dc=(pc=process==null?void 0:process.versions)===null||pc===void 0?void 0:pc.node)!==null&&dc!==void 0?dc:(hc=process==null?void 0:process.version)===null||hc===void 0?void 0:hc.slice(1);if(ch&&Number(ch.match(/^([^.]+)/)[1])<lh)throw Error(`yargs parser supports a minimum Node.js version of ${lh}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Ow=process?process.env:{},fh=new ya({cwd:process.cwd,env:()=>Ow,format:_w,normalize:Sw,resolve:vw,require:t=>{if(typeof Tr<"u")return Tr(t);if(t.match(/\.json$/))return JSON.parse(Iw(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),us=function(e,r){return fh.parse(e.slice(),r).argv};us.detailed=function(t,e){return fh.parse(t.slice(),e)};us.camelCase=Wn;us.decamelize=ga;us.looksLikeNumber=xa;var mc=us;import{basename as Vw,dirname as Gw,extname as Ww,relative as Hw,resolve as xh}from"path";function ph(){return Dw()?0:1}function Dw(){return Rw()&&!process.defaultApp}function Rw(){return!!process.versions.electron}function gc(t){return t.slice(ph()+1)}function dh(){return process.argv[ph()]}var $e=class t extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}};import{readFileSync as Fw,statSync as Nw,writeFile as Pw}from"fs";import{format as Lw}from"util";import{resolve as Mw}from"path";var hh={fs:{readFileSync:Fw,writeFile:Pw},format:Lw,resolve:Mw,exists:t=>{try{return Nw(t).isFile()}catch{return!1}}};var br,xc=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),br.format.apply(br.format,[this.cache[this.locale][r]||r].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),i=e.shift(),o=function(){};typeof e[e.length-1]=="function"&&(o=e.pop()),this.cache[this.locale]||this._readLocaleFile();let s=i===1?r:n;this.cache[this.locale][r]&&(s=this.cache[this.locale][r][i===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:o})):o();let a=[s];return~s.indexOf("%d")&&a.push(i),br.format.apply(br.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){let n="";return e.forEach(function(i,o){let s=r[o+1];n+=i,typeof s<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,r=this.writeQueue[0],n=r.directory,i=r.locale,o=r.cb,s=this._resolveLocaleFile(n,i),a=JSON.stringify(this.cache[i],null,2);br.fs.writeFile(s,a,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),o(u)})}_readLocaleFile(){let e={},r=this._resolveLocaleFile(this.directory,this.locale);try{br.fs.readFileSync&&(e=JSON.parse(br.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=br.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let i=br.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(e){return br.exists(e)}};function mh(t,e){br=e;let r=new xc(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}var Bw=t=>mh(t,hh),gh=Bw;var Kw="require is not supported by ESM",yh="loading a directory of commands is not supported yet for ESM",ls;try{ls=qw(import.meta.url)}catch{ls=process.cwd()}var Yw=ls.substring(0,ls.lastIndexOf("node_modules")),yc={assert:{notStrictEqual:jw,strictEqual:Uw},cliui:cc,findUp:sh,getEnv:t=>process.env[t],inspect:zw,getCallerFile:()=>{throw new $e(yh)},getProcessArgvBin:dh,mainFilename:Yw||process.cwd(),Parser:mc,path:{basename:Vw,dirname:Gw,extname:Ww,relative:Hw,resolve:xh},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:$w,require:()=>{throw new $e(Kw)},requireDirectory:()=>{throw new $e(yh)},stringWidth:t=>[...t].length,y18n:gh({directory:xh(ls,"../../../locales"),updateFiles:!1})};function Nt(t,e,r,n){r.assert.notStrictEqual(t,e,n)}function bc(t,e){e.assert.strictEqual(typeof t,"string")}function Ki(t){return Object.keys(t)}function qe(t){return!!t&&!!t.then&&typeof t.then=="function"}function dn(t){let r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=r.shift();if(!i)throw new Error(`No command found in: ${t}`);let o={cmd:i.replace(n,""),demanded:[],optional:[]};return r.forEach((s,a)=>{let u=!1;s=s.replace(/\s/g,""),/\.+[\]>]/.test(s)&&a===r.length-1&&(u=!0),/^\[/.test(s)?o.optional.push({cmd:s.replace(n,"").split("|"),variadic:u}):o.demanded.push({cmd:s.replace(n,"").split("|"),variadic:u})}),o}var Zw=["first","second","third","fourth","fifth","sixth"];function H(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[dn(`cmd ${t}`),e,r]}try{let i=0,[o,s,a]=n(),u=[].slice.call(s);for(;u.length&&u[u.length-1]===void 0;)u.pop();let l=a||u.length;if(l<o.demanded.length)throw new $e(`Not enough arguments provided. Expected ${o.demanded.length} but received ${u.length}.`);let c=o.demanded.length+o.optional.length;if(l>c)throw new $e(`Too many arguments provided. Expected max ${c} but received ${l}.`);o.demanded.forEach(f=>{let p=u.shift(),d=bh(p);f.cmd.filter(y=>y===d||y==="*").length===0&&Eh(d,f.cmd,i),i+=1}),o.optional.forEach(f=>{if(u.length===0)return;let p=u.shift(),d=bh(p);f.cmd.filter(y=>y===d||y==="*").length===0&&Eh(d,f.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function bh(t){return Array.isArray(t)?"array":t===null?"null":typeof t}function Eh(t,e,r){throw new $e(`Invalid ${Zw[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}var ba=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,i=!1){if(H("<array|function> [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let o=0;o<e.length;o++){if(typeof e[o]!="function")throw Error("middleware must be a function");let s=e[o];s.applyBeforeValidation=r,s.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let o=e;o.applyBeforeValidation=r,o.global=n,o.mutates=i,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,r){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let o=[...n[r]||[],r];return i.option?!o.includes(i.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function Ah(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}function Hn(t,e,r,n){return r.reduce((i,o)=>{if(o.applyBeforeValidation!==n)return i;if(o.mutates){if(o.applied)return i;o.applied=!0}if(qe(i))return i.then(s=>Promise.all([s,o(s,e)])).then(([s,a])=>Object.assign(s,a));{let s=o(i,e);return qe(s)?s.then(a=>Object.assign(i,a)):Object.assign(i,s)}},t)}function Kn(t,e,r=n=>{throw n}){try{let n=Xw(t)?t():t;return qe(n)?n.then(i=>e(i)):e(n)}catch(n){return r(n)}}function Xw(t){return typeof t=="function"}function Ec(t){if(typeof Tr>"u")return null;for(let e=0,r=Object.keys(Tr.cache),n;e<r.length;e++)if(n=Tr.cache[r[e]],n.exports===t)return n;return null}var Yi=/(^\*)|(^\$0)/,Ac=class{constructor(e,r,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let o=typeof i.visit=="function"?i.visit:s=>s;i.visit=(s,a,u)=>{let l=o(s,a,u);if(l){if(this.requireCache.has(a))return l;this.requireCache.add(a),this.addHandler(l)}return l},this.shim.requireDirectory({require:r,filename:n},e,i)}addHandler(e,r,n,i,o,s){let a=[],u=Ah(o);if(i=i||(()=>{}),Array.isArray(e))if(Jw(e))[e,...a]=e;else for(let l of e)this.addHandler(l);else if(ek(e)){let l=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(l=[].concat(l).concat(e.aliases)),this.addHandler(l,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(Ch(n)){this.addHandler([e].concat(a),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let l=dn(e);a=a.map(p=>dn(p).cmd);let c=!1,f=[l.cmd].concat(a).filter(p=>Yi.test(p)?(c=!0,!1):!0);f.length===0&&c&&f.push("$0"),c&&(l.cmd=f[0],a=f.slice(1),e=e.replace(Yi,l.cmd)),a.forEach(p=>{this.aliasMap[p]=l.cmd}),r!==!1&&this.usage.command(e,r,c,a,s),this.handlers[l.cmd]={original:e,description:r,handler:i,builder:n||{},middlewares:u,deprecated:s,demanded:l.demanded,optional:l.optional},c&&(this.defaultCommand=this.handlers[l.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,i,o,s){let a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=r.getInternalMethods().getContext(),l=u.commands.slice(),c=!e;e&&(u.commands.push(e),u.fullCommands.push(a.original));let f=this.applyBuilderUpdateUsageAndParse(c,a,r,n.aliases,l,i,o,s);return qe(f)?f.then(p=>this.applyMiddlewareAndGetResult(c,a,p.innerArgv,u,o,p.aliases,r)):this.applyMiddlewareAndGetResult(c,a,f.innerArgv,u,o,f.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,i,o,s,a,u){let l=r.builder,c=n;if(Ea(l)){n.getInternalMethods().getUsageInstance().freeze();let f=l(n.getInternalMethods().reset(i),u);if(qe(f))return f.then(p=>(c=kh(p)?p:n,this.parseAndUpdateUsage(e,r,c,o,s,a)))}else Qw(l)&&(n.getInternalMethods().getUsageInstance().freeze(),c=n.getInternalMethods().reset(i),Object.keys(r.builder).forEach(f=>{c.option(f,l[f])}));return this.parseAndUpdateUsage(e,r,c,o,s,a)}parseAndUpdateUsage(e,r,n,i,o,s){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,r),r.description);let a=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,s);return qe(a)?a.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,r){let n=Yi.test(r.original)?r.original.replace(Yi,"").trim():r.original,i=e.filter(o=>!Yi.test(o));return i.push(n),`$0 ${i.join(" ")}`}handleValidationAndGetResult(e,r,n,i,o,s,a,u){if(!s.getInternalMethods().getHasOutput()){let l=s.getInternalMethods().runValidation(o,u,s.parsed.error,e);n=Kn(n,c=>(l(c),c))}if(r.handler&&!s.getInternalMethods().getHasOutput()){s.getInternalMethods().setHasOutput();let l=!!s.getOptions().configuration["populate--"];s.getInternalMethods().postProcess(n,l,!1,!1),n=Hn(n,s,a,!1),n=Kn(n,c=>{let f=r.handler(c);return qe(f)?f.then(()=>c):c}),e||s.getInternalMethods().getUsageInstance().cacheHelpMessage(),qe(n)&&!s.getInternalMethods().hasParseCallback()&&n.catch(c=>{try{s.getInternalMethods().getUsageInstance().fail(null,c)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,r,n,i,o,s,a){let u={};if(o)return n;a.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,i,a));let l=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),c=Hn(n,a,l,!0);return qe(c)?c.then(f=>this.handleValidationAndGetResult(e,r,f,i,s,a,l,u)):this.handleValidationAndGetResult(e,r,c,i,s,a,l,u)}populatePositionals(e,r,n,i){r._=r._.slice(n.commands.length);let o=e.demanded.slice(0),s=e.optional.slice(0),a={};for(this.validation.positionalCount(o.length,r._.length);o.length;){let u=o.shift();this.populatePositional(u,r,a)}for(;s.length;){let u=s.shift();this.populatePositional(u,r,a)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,a,this.cmdToParseOptions(e.original),i),a}populatePositional(e,r,n){let i=e.cmd[0];e.variadic?n[i]=r._.splice(0).map(String):r._.length&&(n[i]=[String(r._.shift())])}cmdToParseOptions(e){let r={array:[],default:{},alias:{},demand:{}},n=dn(e);return n.demanded.forEach(i=>{let[o,...s]=i.cmd;i.variadic&&(r.array.push(o),r.default[o]=[]),r.alias[o]=s,r.demand[o]=!0}),n.optional.forEach(i=>{let[o,...s]=i.cmd;i.variadic&&(r.array.push(o),r.default[o]=[]),r.alias[o]=s}),r}postProcessPositionals(e,r,n,i){let o=Object.assign({},i.getOptions());o.default=Object.assign(n.default,o.default);for(let l of Object.keys(n.alias))o.alias[l]=(o.alias[l]||[]).concat(n.alias[l]);o.array=o.array.concat(n.array),o.config={};let s=[];if(Object.keys(r).forEach(l=>{r[l].map(c=>{o.configuration["unknown-options-as-args"]&&(o.key[l]=!0),s.push(`--${l}`),s.push(c)})}),!s.length)return;let a=Object.assign({},o.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(s,Object.assign({},o,{configuration:a}));if(u.error)i.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let l=Object.keys(r);Object.keys(r).forEach(c=>{l.push(...u.aliases[c])}),Object.keys(u.argv).forEach(c=>{l.includes(c)&&(r[c]||(r[c]=u.argv[c]),!this.isInConfigs(i,c)&&!this.isDefaulted(i,c)&&Object.prototype.hasOwnProperty.call(e,c)&&Object.prototype.hasOwnProperty.call(u.argv,c)&&(Array.isArray(e[c])||Array.isArray(u.argv[c]))?e[c]=[].concat(e[c],u.argv[c]):e[c]=u.argv[c])})}}isDefaulted(e,r){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){let{configObjects:n}=e.getOptions();return n.some(i=>Object.prototype.hasOwnProperty.call(i,r))||n.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=Yi.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(Ea(r))return r(e,!0);Ch(r)||Object.keys(r).forEach(n=>{e.option(n,r[n])})}moduleName(e){let r=Ec(e);if(!r)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(r.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:r,desc:n}){for(let i of[e,r,n]){if(typeof i=="string"||i===!1)return i;Nt(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();Nt(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function wh(t,e,r,n){return new Ac(t,e,r,n)}function Ch(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}function Jw(t){return t.every(e=>typeof e=="string")}function Ea(t){return typeof t=="function"}function Qw(t){return typeof t=="object"}function ek(t){return typeof t=="object"&&!Array.isArray(t)}function hn(t={},e=()=>!0){let r={};return Ki(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}function mn(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}function tk(t){return typeof t=="boolean"}function _h(t,e){let r=e.y18n.__,n={},i=[];n.failFn=function(F){i.push(F)};let o=null,s=null,a=!0;n.showHelpOnFail=function(F=!0,v){let[P,j]=typeof F=="string"?[!0,F]:[F,v];return t.getInternalMethods().isGlobalContext()&&(s=j),o=j,a=P,n};let u=!1;n.fail=function(F,v){let P=t.getInternalMethods().getLoggerInstance();if(i.length)for(let j=i.length-1;j>=0;--j){let ae=i[j];if(tk(ae)){if(v)throw v;if(F)throw Error(F)}else ae(F,v,n)}else{if(t.getExitProcess()&&mn(!0),!u){u=!0,a&&(t.showHelp("error"),P.error()),(F||v)&&P.error(F||v);let j=o||s;j&&((F||v)&&P.error(""),P.error(j))}if(v=v||new $e(F),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,v);throw v}};let l=[],c=!1;n.usage=(L,F)=>L===null?(c=!0,l=[],n):(c=!1,l.push([L,F||""]),n),n.getUsage=()=>l,n.getUsageDisabled=()=>c,n.getPositionalGroupName=()=>r("Positionals:");let f=[];n.example=(L,F)=>{f.push([L,F||""])};let p=[];n.command=function(F,v,P,j,ae=!1){P&&(p=p.map(ee=>(ee[2]=!1,ee))),p.push([F,v||"",P,j,ae])},n.getCommands=()=>p;let d={};n.describe=function(F,v){Array.isArray(F)?F.forEach(P=>{n.describe(P,v)}):typeof F=="object"?Object.keys(F).forEach(P=>{n.describe(P,F[P])}):d[F]=v},n.getDescriptions=()=>d;let m=[];n.epilog=L=>{m.push(L)};let y=!1,g;n.wrap=L=>{y=!0,g=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(g=ye(),y=!0),g);let b="__yargsString__:";n.deferY18nLookup=L=>b+L,n.help=function(){if(D)return D;C();let F=t.customScriptName?t.$0:e.path.basename(t.$0),v=t.getDemandedOptions(),P=t.getDemandedCommands(),j=t.getDeprecatedOptions(),ae=t.getGroups(),ee=t.getOptions(),_e=[];_e=_e.concat(Object.keys(d)),_e=_e.concat(Object.keys(v)),_e=_e.concat(Object.keys(P)),_e=_e.concat(Object.keys(ee.default)),_e=_e.filter(S),_e=Object.keys(_e.reduce((ne,he)=>(he!=="_"&&(ne[he]=!0),ne),{}));let it=n.getWrap(),x=e.cliui({width:it,wrap:!!it});if(!c){if(l.length)l.forEach(ne=>{x.div({text:`${ne[0].replace(/\$0/g,F)}`}),ne[1]&&x.div({text:`${ne[1]}`,padding:[1,0,0,0]})}),x.div();else if(p.length){let ne=null;P._?ne=`${F} <${r("command")}>
|
|
10
|
+
`),o.border&&(i.unshift("."+"-".repeat(this.negatePadding(o)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(o)+2)+"'")),o.padding&&(i.unshift(...new Array(o.padding[yw]||0).fill("")),i.push(...new Array(o.padding[bw]||0).fill(""))),i.forEach((a,u)=>{r[u]||r.push([]);let l=r[u];for(let c=0;c<s;c++)l[c]===void 0&&l.push("");l.push(a)})}),r}negatePadding(e){let r=e.width||0;return e.padding&&(r-=(e.padding[ma]||0)+(e.padding[ha]||0)),e.border&&(r-=4),r}columnWidths(e){if(!this.wrap)return e.map(s=>s.width||Zt.stringWidth(s.text));let r=e.length,n=this.width,i=e.map(s=>{if(s.width)return r--,n-=s.width,s.width}),o=r?Math.floor(n/r):0;return i.map((s,a)=>s===void 0?Math.max(o,Ew(e[a])):s)}};function eh(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}function Ew(t){let e=t.padding||[],r=1+(e[ma]||0)+(e[ha]||0);return t.border?r+4:r}function Aw(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Cw(t,e){t=t.trim();let r=Zt.stringWidth(t);return r<e?" ".repeat(e-r)+t:t}function ww(t,e){t=t.trim();let r=Zt.stringWidth(t);return r>=e?t:" ".repeat(e-r>>1)+t}var Zt;function th(t,e){return Zt=e,new lc({width:t?.width||Aw(),wrap:t?.wrap})}var rh=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function cc(t){return t.replace(rh,"")}function nh(t,e){let[r,n]=t.match(rh)||["",""];t=cc(t);let i="";for(let o=0;o<t.length;o++)o!==0&&o%e===0&&(i+=`
|
|
11
|
+
`),i+=t.charAt(o);return r&&n&&(i=`${r}${i}${n}`),i}function fc(t){return th(t,{stringWidth:e=>[...e].length,stripAnsi:cc,wrap:nh})}import{dirname as ih,resolve as oh}from"path";import{readdirSync as kw,statSync as Tw}from"fs";function sh(t,e){let r=oh(".",t),n;for(Tw(r).isDirectory()||(r=ih(r));;){if(n=e(r,kw(r)),n)return oh(r,n);if(r=ih(n=r),n===r)break}}import{inspect as qw}from"util";import{readFileSync as Vw}from"fs";import{fileURLToPath as Gw}from"url";import{format as vw}from"util";import{normalize as Iw,resolve as Ow}from"path";function Wn(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1,i=t.match(/^-+/);for(let o=i?i[0].length:0;o<t.length;o++){let s=t.charAt(o);n&&(n=!1,s=s.toUpperCase()),o!==0&&(s==="-"||s==="_")?n=!0:s!=="-"&&s!=="_"&&(r+=s)}return r}}function ga(t,e){let r=t.toLowerCase();e=e||"-";let n="";for(let i=0;i<t.length;i++){let o=r.charAt(i),s=t.charAt(i);o!==s&&i>0?n+=`${e}${r.charAt(i)}`:n+=s}return n}function xa(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function ah(t){if(Array.isArray(t))return t.map(s=>typeof s!="string"?s+"":s);t=t.trim();let e=0,r=null,n=null,i=null,o=[];for(let s=0;s<t.length;s++){if(r=n,n=t.charAt(s),n===" "&&!i){r!==" "&&e++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),o[e]||(o[e]=""),o[e]+=n}return o}var sr;(function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"})(sr||(sr={}));var Yr,ya=class{constructor(e){Yr=e}parse(e,r){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),i=ah(e),o=typeof e=="string",s=_w(Object.assign(Object.create(null),n.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),u=Object.assign(Object.create(null),n.default),l=n.configObjects||[],c=n.envPrefix,f=a["populate--"],p=f?"--":"_",d=Object.create(null),m=Object.create(null),y=n.__||Yr.format,g={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},b=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,w=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(A){let k=typeof A=="object"?A.key:A,M=Object.keys(A).map(function(I){return{boolean:"bools",string:"strings",number:"numbers"}[I]}).filter(Boolean).pop();M&&(g[M][k]=!0),g.arrays[k]=!0,g.keys.push(k)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(A){g.bools[A]=!0,g.keys.push(A)}),[].concat(n.string||[]).filter(Boolean).forEach(function(A){g.strings[A]=!0,g.keys.push(A)}),[].concat(n.number||[]).filter(Boolean).forEach(function(A){g.numbers[A]=!0,g.keys.push(A)}),[].concat(n.count||[]).filter(Boolean).forEach(function(A){g.counts[A]=!0,g.keys.push(A)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(A){g.normalize[A]=!0,g.keys.push(A)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([A,k])=>{typeof k=="number"&&(g.nargs[A]=k,g.keys.push(A))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([A,k])=>{typeof k=="function"&&(g.coercions[A]=k,g.keys.push(A))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(A){g.configs[A]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([A,k])=>{(typeof k=="boolean"||typeof k=="function")&&(g.configs[A]=k)})),E(n.key,s,n.default,g.arrays),Object.keys(u).forEach(function(A){(g.aliases[A]||[]).forEach(function(k){u[k]=u[A]})});let C=null;qt();let D=[],R=Object.assign(Object.create(null),{_:[]}),S={};for(let A=0;A<i.length;A++){let k=i[A],M=k.replace(/^-{3,}/,"---"),I,T,K,$,te,ft;if(k!=="--"&&/^-/.test(k)&&oe(k))de(k);else if(M.match(/^---+(=|$)/)){de(k);continue}else if(k.match(/^--.+=/)||!a["short-option-groups"]&&k.match(/^-.+=/))$=k.match(/^--?([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&(W($[1],g.arrays)?A=be(A,$[1],i,$[2]):W($[1],g.nargs)!==!1?A=ye(A,$[1],i,$[2]):_($[1],$[2],!0));else if(k.match(w)&&a["boolean-negation"])$=k.match(w),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],_(T,W(T,g.arrays)?[!1]:!1));else if(k.match(/^--.+/)||!a["short-option-groups"]&&k.match(/^-[^-]+/))$=k.match(/^--?(.+)/),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],W(T,g.arrays)?A=be(A,T,i):W(T,g.nargs)!==!1?A=ye(A,T,i):(te=i[A+1],te!==void 0&&(!te.match(/^-/)||te.match(b))&&!W(T,g.bools)&&!W(T,g.counts)||/^(true|false)$/.test(te)?(_(T,te),A++):_(T,me(T))));else if(k.match(/^-.\..+=/))$=k.match(/^-([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&_($[1],$[2]);else if(k.match(/^-.\..+/)&&!k.match(b))te=i[A+1],$=k.match(/^-(.\..+)/),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],te!==void 0&&!te.match(/^-/)&&!W(T,g.bools)&&!W(T,g.counts)?(_(T,te),A++):_(T,me(T)));else if(k.match(/^-[^-]+/)&&!k.match(b)){K=k.slice(1,-1).split(""),I=!1;for(let Tt=0;Tt<K.length;Tt++){if(te=k.slice(Tt+2),K[Tt+1]&&K[Tt+1]==="="){ft=k.slice(Tt+3),T=K[Tt],W(T,g.arrays)?A=be(A,T,i,ft):W(T,g.nargs)!==!1?A=ye(A,T,i,ft):_(T,ft),I=!0;break}if(te==="-"){_(K[Tt],te);continue}if(/[A-Za-z]/.test(K[Tt])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(te)&&W(te,g.bools)===!1){_(K[Tt],te),I=!0;break}if(K[Tt+1]&&K[Tt+1].match(/\W/)){_(K[Tt],te),I=!0;break}else _(K[Tt],me(K[Tt]))}T=k.slice(-1)[0],!I&&T!=="-"&&(W(T,g.arrays)?A=be(A,T,i):W(T,g.nargs)!==!1?A=ye(A,T,i):(te=i[A+1],te!==void 0&&(!/^(-|--)[^-]/.test(te)||te.match(b))&&!W(T,g.bools)&&!W(T,g.counts)||/^(true|false)$/.test(te)?(_(T,te),A++):_(T,me(T))))}else if(k.match(/^-[0-9]$/)&&k.match(b)&&W(k.slice(1),g.bools))T=k.slice(1),_(T,me(T));else if(k==="--"){D=i.slice(A+1);break}else if(a["halt-at-non-option"]){D=i.slice(A);break}else de(k)}ee(R,!0),ee(R,!1),P(R),ae(),x(R,g.aliases,u,!0),_e(R),a["set-placeholder-key"]&&it(R),Object.keys(g.counts).forEach(function(A){Ue(R,A.split("."))||_(A,0)}),f&&D.length&&(R[p]=[]),D.forEach(function(A){R[p].push(A)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(R).filter(A=>A!=="--"&&A.includes("-")).forEach(A=>{delete R[A]}),a["strip-aliased"]&&[].concat(...Object.keys(s).map(A=>s[A])).forEach(A=>{a["camel-case-expansion"]&&A.includes("-")&&delete R[A.split(".").map(k=>Wn(k)).join(".")],delete R[A]});function de(A){let k=v("_",A);(typeof k=="string"||typeof k=="number")&&R._.push(k)}function ye(A,k,M,I){let T,K=W(k,g.nargs);if(K=typeof K!="number"||isNaN(K)?1:K,K===0)return ze(I)||(C=Error(y("Argument unexpected for: %s",k))),_(k,me(k)),A;let $=ze(I)?0:1;if(a["nargs-eats-options"])M.length-(A+1)+$<K&&(C=Error(y("Not enough arguments following: %s",k))),$=K;else{for(T=A+1;T<M.length&&(!M[T].match(/^-[^0-9]/)||M[T].match(b)||oe(M[T]));T++)$++;$<K&&(C=Error(y("Not enough arguments following: %s",k)))}let te=Math.min($,K);for(!ze(I)&&te>0&&(_(k,I),te--),T=A+1;T<te+A+1;T++)_(k,M[T]);return A+te}function be(A,k,M,I){let T=[],K=I||M[A+1],$=W(k,g.nargs);if(W(k,g.bools)&&!/^(true|false)$/.test(K))T.push(!0);else if(ze(K)||ze(I)&&/^-/.test(K)&&!b.test(K)&&!oe(K)){if(u[k]!==void 0){let te=u[k];T=Array.isArray(te)?te:[te]}}else{ze(I)||T.push(F(k,I,!0));for(let te=A+1;te<M.length&&!(!a["greedy-arrays"]&&T.length>0||$&&typeof $=="number"&&T.length>=$||(K=M[te],/^-/.test(K)&&!b.test(K)&&!oe(K)));te++)A=te,T.push(F(k,K,o))}return typeof $=="number"&&($&&T.length<$||isNaN($)&&T.length===0)&&(C=Error(y("Not enough arguments following: %s",k))),_(k,T),A}function _(A,k,M=o){if(/-/.test(A)&&a["camel-case-expansion"]){let K=A.split(".").map(function($){return Wn($)}).join(".");L(A,K)}let I=F(A,k,M),T=A.split(".");Qe(R,T,I),g.aliases[A]&&g.aliases[A].forEach(function(K){let $=K.split(".");Qe(R,$,I)}),T.length>1&&a["dot-notation"]&&(g.aliases[T[0]]||[]).forEach(function(K){let $=K.split("."),te=[].concat(T);te.shift(),$=$.concat(te),(g.aliases[A]||[]).includes($.join("."))||Qe(R,$,I)}),W(A,g.normalize)&&!W(A,g.arrays)&&[A].concat(g.aliases[A]||[]).forEach(function($){Object.defineProperty(S,$,{enumerable:!0,get(){return k},set(te){k=typeof te=="string"?Yr.normalize(te):te}})})}function L(A,k){g.aliases[A]&&g.aliases[A].length||(g.aliases[A]=[k],d[k]=!0),g.aliases[k]&&g.aliases[k].length||L(k,A)}function F(A,k,M){M&&(k=Sw(k)),(W(A,g.bools)||W(A,g.counts))&&typeof k=="string"&&(k=k==="true");let I=Array.isArray(k)?k.map(function(T){return v(A,T)}):v(A,k);return W(A,g.counts)&&(ze(I)||typeof I=="boolean")&&(I=pc()),W(A,g.normalize)&&W(A,g.arrays)&&(Array.isArray(k)?I=k.map(T=>Yr.normalize(T)):I=Yr.normalize(k)),I}function v(A,k){return!a["parse-positional-numbers"]&&A==="_"||!W(A,g.strings)&&!W(A,g.bools)&&!Array.isArray(k)&&(xa(k)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${k}`)))||!ze(k)&&W(A,g.numbers))&&(k=Number(k)),k}function P(A){let k=Object.create(null);x(k,g.aliases,u),Object.keys(g.configs).forEach(function(M){let I=A[M]||k[M];if(I)try{let T=null,K=Yr.resolve(Yr.cwd(),I),$=g.configs[M];if(typeof $=="function"){try{T=$(K)}catch(te){T=te}if(T instanceof Error){C=T;return}}else T=Yr.require(K);j(T)}catch(T){T.name==="PermissionDenied"?C=T:A[M]&&(C=Error(y("Invalid JSON config file: %s",I)))}})}function j(A,k){Object.keys(A).forEach(function(M){let I=A[M],T=k?k+"."+M:M;typeof I=="object"&&I!==null&&!Array.isArray(I)&&a["dot-notation"]?j(I,T):(!Ue(R,T.split("."))||W(T,g.arrays)&&a["combine-arrays"])&&_(T,I)})}function ae(){typeof l<"u"&&l.forEach(function(A){j(A)})}function ee(A,k){if(typeof c>"u")return;let M=typeof c=="string"?c:"",I=Yr.env();Object.keys(I).forEach(function(T){if(M===""||T.lastIndexOf(M,0)===0){let K=T.split("__").map(function($,te){return te===0&&($=$.substring(M.length)),Wn($)});(k&&g.configs[K.join(".")]||!k)&&!Ue(A,K)&&_(K.join("."),I[T])}})}function _e(A){let k,M=new Set;Object.keys(A).forEach(function(I){if(!M.has(I)&&(k=W(I,g.coercions),typeof k=="function"))try{let T=v(I,k(A[I]));[].concat(g.aliases[I]||[],I).forEach(K=>{M.add(K),A[K]=T})}catch(T){C=T}})}function it(A){return g.keys.forEach(k=>{~k.indexOf(".")||typeof A[k]>"u"&&(A[k]=void 0)}),A}function x(A,k,M,I=!1){Object.keys(M).forEach(function(T){Ue(A,T.split("."))||(Qe(A,T.split("."),M[T]),I&&(m[T]=!0),(k[T]||[]).forEach(function(K){Ue(A,K.split("."))||Qe(A,K.split("."),M[T])}))})}function Ue(A,k){let M=A;a["dot-notation"]||(k=[k.join(".")]),k.slice(0,-1).forEach(function(T){M=M[T]||{}});let I=k[k.length-1];return typeof M!="object"?!1:I in M}function Qe(A,k,M){let I=A;a["dot-notation"]||(k=[k.join(".")]),k.slice(0,-1).forEach(function(ft){ft=uh(ft),typeof I=="object"&&I[ft]===void 0&&(I[ft]={}),typeof I[ft]!="object"||Array.isArray(I[ft])?(Array.isArray(I[ft])?I[ft].push({}):I[ft]=[I[ft],{}],I=I[ft][I[ft].length-1]):I=I[ft]});let T=uh(k[k.length-1]),K=W(k.join("."),g.arrays),$=Array.isArray(M),te=a["duplicate-arguments-array"];!te&&W(T,g.nargs)&&(te=!0,(!ze(I[T])&&g.nargs[T]===1||Array.isArray(I[T])&&I[T].length===g.nargs[T])&&(I[T]=void 0)),M===pc()?I[T]=pc(I[T]):Array.isArray(I[T])?te&&K&&$?I[T]=a["flatten-duplicate-arrays"]?I[T].concat(M):(Array.isArray(I[T][0])?I[T]:[I[T]]).concat([M]):!te&&!!K==!!$?I[T]=M:I[T]=I[T].concat([M]):I[T]===void 0&&K?I[T]=$?M:[M]:te&&!(I[T]===void 0||W(T,g.counts)||W(T,g.bools))?I[T]=[I[T],M]:I[T]=M}function E(...A){A.forEach(function(k){Object.keys(k||{}).forEach(function(M){g.aliases[M]||(g.aliases[M]=[].concat(s[M]||[]),g.aliases[M].concat(M).forEach(function(I){if(/-/.test(I)&&a["camel-case-expansion"]){let T=Wn(I);T!==M&&g.aliases[M].indexOf(T)===-1&&(g.aliases[M].push(T),d[T]=!0)}}),g.aliases[M].concat(M).forEach(function(I){if(I.length>1&&/[A-Z]/.test(I)&&a["camel-case-expansion"]){let T=ga(I,"-");T!==M&&g.aliases[M].indexOf(T)===-1&&(g.aliases[M].push(T),d[T]=!0)}}),g.aliases[M].forEach(function(I){g.aliases[I]=[M].concat(g.aliases[M].filter(function(T){return I!==T}))}))})})}function W(A,k){let M=[].concat(g.aliases[A]||[],A),I=Object.keys(k),T=M.find(K=>I.includes(K));return T?k[T]:!1}function Ye(A){let k=Object.keys(g);return[].concat(k.map(I=>g[I])).some(function(I){return Array.isArray(I)?I.includes(A):I[A]})}function ne(A,...k){return[].concat(...k).some(function(I){let T=A.match(I);return T&&Ye(T[1])})}function he(A){if(A.match(b)||!A.match(/^-[^-]+/))return!1;let k=!0,M,I=A.slice(1).split("");for(let T=0;T<I.length;T++){if(M=A.slice(T+2),!Ye(I[T])){k=!1;break}if(I[T+1]&&I[T+1]==="="||M==="-"||/[A-Za-z]/.test(I[T])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(M)||I[T+1]&&I[T+1].match(/\W/))break}return k}function oe(A){return a["unknown-options-as-args"]&&ce(A)}function ce(A){return A=A.replace(/^-{3,}/,"--"),A.match(b)||he(A)?!1:!ne(A,/^-+([^=]+?)=[\s\S]*$/,w,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function me(A){return!W(A,g.bools)&&!W(A,g.counts)&&`${A}`in u?u[A]:we(Fe(A))}function we(A){return{[sr.BOOLEAN]:!0,[sr.STRING]:"",[sr.NUMBER]:void 0,[sr.ARRAY]:[]}[A]}function Fe(A){let k=sr.BOOLEAN;return W(A,g.strings)?k=sr.STRING:W(A,g.numbers)?k=sr.NUMBER:W(A,g.bools)?k=sr.BOOLEAN:W(A,g.arrays)&&(k=sr.ARRAY),k}function ze(A){return A===void 0}function qt(){Object.keys(g.counts).find(A=>W(A,g.arrays)?(C=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",A)),!0):W(A,g.nargs)?(C=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",A)),!0):!1)}return{aliases:Object.assign({},g.aliases),argv:Object.assign(S,R),configuration:a,defaulted:Object.assign({},m),error:C,newAliases:Object.assign({},d)}}};function _w(t){let e=[],r=Object.create(null),n=!0;for(Object.keys(t).forEach(function(i){e.push([].concat(t[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let o=i+1;o<e.length;o++)if(e[i].filter(function(a){return e[o].indexOf(a)!==-1}).length){e[i]=e[i].concat(e[o]),e.splice(o,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(s,a,u){return u.indexOf(s)===a});let o=i.pop();o!==void 0&&typeof o=="string"&&(r[o]=i)}),r}function pc(t){return t!==void 0?t+1:1}function uh(t){return t==="__proto__"?"___proto___":t}function Sw(t){return typeof t=="string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}import{readFileSync as Dw}from"fs";var dc,hc,mc,lh=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,ch=(hc=(dc=process==null?void 0:process.versions)===null||dc===void 0?void 0:dc.node)!==null&&hc!==void 0?hc:(mc=process==null?void 0:process.version)===null||mc===void 0?void 0:mc.slice(1);if(ch&&Number(ch.match(/^([^.]+)/)[1])<lh)throw Error(`yargs parser supports a minimum Node.js version of ${lh}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Rw=process?process.env:{},fh=new ya({cwd:process.cwd,env:()=>Rw,format:vw,normalize:Iw,resolve:Ow,require:t=>{if(typeof Tr<"u")return Tr(t);if(t.match(/\.json$/))return JSON.parse(Dw(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),us=function(e,r){return fh.parse(e.slice(),r).argv};us.detailed=function(t,e){return fh.parse(t.slice(),e)};us.camelCase=Wn;us.decamelize=ga;us.looksLikeNumber=xa;var gc=us;import{basename as Ww,dirname as Hw,extname as Kw,relative as Yw,resolve as xh}from"path";function ph(){return Fw()?0:1}function Fw(){return Nw()&&!process.defaultApp}function Nw(){return!!process.versions.electron}function xc(t){return t.slice(ph()+1)}function dh(){return process.argv[ph()]}var $e=class t extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}};import{readFileSync as Pw,statSync as Lw,writeFile as Mw}from"fs";import{format as Bw}from"util";import{resolve as jw}from"path";var hh={fs:{readFileSync:Pw,writeFile:Mw},format:Bw,resolve:jw,exists:t=>{try{return Lw(t).isFile()}catch{return!1}}};var br,yc=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),br.format.apply(br.format,[this.cache[this.locale][r]||r].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),i=e.shift(),o=function(){};typeof e[e.length-1]=="function"&&(o=e.pop()),this.cache[this.locale]||this._readLocaleFile();let s=i===1?r:n;this.cache[this.locale][r]&&(s=this.cache[this.locale][r][i===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:o})):o();let a=[s];return~s.indexOf("%d")&&a.push(i),br.format.apply(br.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){let n="";return e.forEach(function(i,o){let s=r[o+1];n+=i,typeof s<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,r=this.writeQueue[0],n=r.directory,i=r.locale,o=r.cb,s=this._resolveLocaleFile(n,i),a=JSON.stringify(this.cache[i],null,2);br.fs.writeFile(s,a,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),o(u)})}_readLocaleFile(){let e={},r=this._resolveLocaleFile(this.directory,this.locale);try{br.fs.readFileSync&&(e=JSON.parse(br.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=br.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let i=br.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(e){return br.exists(e)}};function mh(t,e){br=e;let r=new yc(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}var Uw=t=>mh(t,hh),gh=Uw;var Zw="require is not supported by ESM",yh="loading a directory of commands is not supported yet for ESM",ls;try{ls=Gw(import.meta.url)}catch{ls=process.cwd()}var Xw=ls.substring(0,ls.lastIndexOf("node_modules")),bc={assert:{notStrictEqual:zw,strictEqual:$w},cliui:fc,findUp:sh,getEnv:t=>process.env[t],inspect:qw,getCallerFile:()=>{throw new $e(yh)},getProcessArgvBin:dh,mainFilename:Xw||process.cwd(),Parser:gc,path:{basename:Ww,dirname:Hw,extname:Kw,relative:Yw,resolve:xh},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:Vw,require:()=>{throw new $e(Zw)},requireDirectory:()=>{throw new $e(yh)},stringWidth:t=>[...t].length,y18n:gh({directory:xh(ls,"../../../locales"),updateFiles:!1})};function Nt(t,e,r,n){r.assert.notStrictEqual(t,e,n)}function Ec(t,e){e.assert.strictEqual(typeof t,"string")}function Ki(t){return Object.keys(t)}function qe(t){return!!t&&!!t.then&&typeof t.then=="function"}function dn(t){let r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=r.shift();if(!i)throw new Error(`No command found in: ${t}`);let o={cmd:i.replace(n,""),demanded:[],optional:[]};return r.forEach((s,a)=>{let u=!1;s=s.replace(/\s/g,""),/\.+[\]>]/.test(s)&&a===r.length-1&&(u=!0),/^\[/.test(s)?o.optional.push({cmd:s.replace(n,"").split("|"),variadic:u}):o.demanded.push({cmd:s.replace(n,"").split("|"),variadic:u})}),o}var Jw=["first","second","third","fourth","fifth","sixth"];function H(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[dn(`cmd ${t}`),e,r]}try{let i=0,[o,s,a]=n(),u=[].slice.call(s);for(;u.length&&u[u.length-1]===void 0;)u.pop();let l=a||u.length;if(l<o.demanded.length)throw new $e(`Not enough arguments provided. Expected ${o.demanded.length} but received ${u.length}.`);let c=o.demanded.length+o.optional.length;if(l>c)throw new $e(`Too many arguments provided. Expected max ${c} but received ${l}.`);o.demanded.forEach(f=>{let p=u.shift(),d=bh(p);f.cmd.filter(y=>y===d||y==="*").length===0&&Eh(d,f.cmd,i),i+=1}),o.optional.forEach(f=>{if(u.length===0)return;let p=u.shift(),d=bh(p);f.cmd.filter(y=>y===d||y==="*").length===0&&Eh(d,f.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function bh(t){return Array.isArray(t)?"array":t===null?"null":typeof t}function Eh(t,e,r){throw new $e(`Invalid ${Jw[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}var ba=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,i=!1){if(H("<array|function> [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let o=0;o<e.length;o++){if(typeof e[o]!="function")throw Error("middleware must be a function");let s=e[o];s.applyBeforeValidation=r,s.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let o=e;o.applyBeforeValidation=r,o.global=n,o.mutates=i,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,r){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let o=[...n[r]||[],r];return i.option?!o.includes(i.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function Ah(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}function Hn(t,e,r,n){return r.reduce((i,o)=>{if(o.applyBeforeValidation!==n)return i;if(o.mutates){if(o.applied)return i;o.applied=!0}if(qe(i))return i.then(s=>Promise.all([s,o(s,e)])).then(([s,a])=>Object.assign(s,a));{let s=o(i,e);return qe(s)?s.then(a=>Object.assign(i,a)):Object.assign(i,s)}},t)}function Kn(t,e,r=n=>{throw n}){try{let n=Qw(t)?t():t;return qe(n)?n.then(i=>e(i)):e(n)}catch(n){return r(n)}}function Qw(t){return typeof t=="function"}function Ac(t){if(typeof Tr>"u")return null;for(let e=0,r=Object.keys(Tr.cache),n;e<r.length;e++)if(n=Tr.cache[r[e]],n.exports===t)return n;return null}var Yi=/(^\*)|(^\$0)/,Cc=class{constructor(e,r,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let o=typeof i.visit=="function"?i.visit:s=>s;i.visit=(s,a,u)=>{let l=o(s,a,u);if(l){if(this.requireCache.has(a))return l;this.requireCache.add(a),this.addHandler(l)}return l},this.shim.requireDirectory({require:r,filename:n},e,i)}addHandler(e,r,n,i,o,s){let a=[],u=Ah(o);if(i=i||(()=>{}),Array.isArray(e))if(ek(e))[e,...a]=e;else for(let l of e)this.addHandler(l);else if(rk(e)){let l=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(l=[].concat(l).concat(e.aliases)),this.addHandler(l,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(Ch(n)){this.addHandler([e].concat(a),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let l=dn(e);a=a.map(p=>dn(p).cmd);let c=!1,f=[l.cmd].concat(a).filter(p=>Yi.test(p)?(c=!0,!1):!0);f.length===0&&c&&f.push("$0"),c&&(l.cmd=f[0],a=f.slice(1),e=e.replace(Yi,l.cmd)),a.forEach(p=>{this.aliasMap[p]=l.cmd}),r!==!1&&this.usage.command(e,r,c,a,s),this.handlers[l.cmd]={original:e,description:r,handler:i,builder:n||{},middlewares:u,deprecated:s,demanded:l.demanded,optional:l.optional},c&&(this.defaultCommand=this.handlers[l.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,i,o,s){let a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=r.getInternalMethods().getContext(),l=u.commands.slice(),c=!e;e&&(u.commands.push(e),u.fullCommands.push(a.original));let f=this.applyBuilderUpdateUsageAndParse(c,a,r,n.aliases,l,i,o,s);return qe(f)?f.then(p=>this.applyMiddlewareAndGetResult(c,a,p.innerArgv,u,o,p.aliases,r)):this.applyMiddlewareAndGetResult(c,a,f.innerArgv,u,o,f.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,i,o,s,a,u){let l=r.builder,c=n;if(Ea(l)){n.getInternalMethods().getUsageInstance().freeze();let f=l(n.getInternalMethods().reset(i),u);if(qe(f))return f.then(p=>(c=kh(p)?p:n,this.parseAndUpdateUsage(e,r,c,o,s,a)))}else tk(l)&&(n.getInternalMethods().getUsageInstance().freeze(),c=n.getInternalMethods().reset(i),Object.keys(r.builder).forEach(f=>{c.option(f,l[f])}));return this.parseAndUpdateUsage(e,r,c,o,s,a)}parseAndUpdateUsage(e,r,n,i,o,s){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,r),r.description);let a=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,s);return qe(a)?a.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,r){let n=Yi.test(r.original)?r.original.replace(Yi,"").trim():r.original,i=e.filter(o=>!Yi.test(o));return i.push(n),`$0 ${i.join(" ")}`}handleValidationAndGetResult(e,r,n,i,o,s,a,u){if(!s.getInternalMethods().getHasOutput()){let l=s.getInternalMethods().runValidation(o,u,s.parsed.error,e);n=Kn(n,c=>(l(c),c))}if(r.handler&&!s.getInternalMethods().getHasOutput()){s.getInternalMethods().setHasOutput();let l=!!s.getOptions().configuration["populate--"];s.getInternalMethods().postProcess(n,l,!1,!1),n=Hn(n,s,a,!1),n=Kn(n,c=>{let f=r.handler(c);return qe(f)?f.then(()=>c):c}),e||s.getInternalMethods().getUsageInstance().cacheHelpMessage(),qe(n)&&!s.getInternalMethods().hasParseCallback()&&n.catch(c=>{try{s.getInternalMethods().getUsageInstance().fail(null,c)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,r,n,i,o,s,a){let u={};if(o)return n;a.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,i,a));let l=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),c=Hn(n,a,l,!0);return qe(c)?c.then(f=>this.handleValidationAndGetResult(e,r,f,i,s,a,l,u)):this.handleValidationAndGetResult(e,r,c,i,s,a,l,u)}populatePositionals(e,r,n,i){r._=r._.slice(n.commands.length);let o=e.demanded.slice(0),s=e.optional.slice(0),a={};for(this.validation.positionalCount(o.length,r._.length);o.length;){let u=o.shift();this.populatePositional(u,r,a)}for(;s.length;){let u=s.shift();this.populatePositional(u,r,a)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,a,this.cmdToParseOptions(e.original),i),a}populatePositional(e,r,n){let i=e.cmd[0];e.variadic?n[i]=r._.splice(0).map(String):r._.length&&(n[i]=[String(r._.shift())])}cmdToParseOptions(e){let r={array:[],default:{},alias:{},demand:{}},n=dn(e);return n.demanded.forEach(i=>{let[o,...s]=i.cmd;i.variadic&&(r.array.push(o),r.default[o]=[]),r.alias[o]=s,r.demand[o]=!0}),n.optional.forEach(i=>{let[o,...s]=i.cmd;i.variadic&&(r.array.push(o),r.default[o]=[]),r.alias[o]=s}),r}postProcessPositionals(e,r,n,i){let o=Object.assign({},i.getOptions());o.default=Object.assign(n.default,o.default);for(let l of Object.keys(n.alias))o.alias[l]=(o.alias[l]||[]).concat(n.alias[l]);o.array=o.array.concat(n.array),o.config={};let s=[];if(Object.keys(r).forEach(l=>{r[l].map(c=>{o.configuration["unknown-options-as-args"]&&(o.key[l]=!0),s.push(`--${l}`),s.push(c)})}),!s.length)return;let a=Object.assign({},o.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(s,Object.assign({},o,{configuration:a}));if(u.error)i.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let l=Object.keys(r);Object.keys(r).forEach(c=>{l.push(...u.aliases[c])}),Object.keys(u.argv).forEach(c=>{l.includes(c)&&(r[c]||(r[c]=u.argv[c]),!this.isInConfigs(i,c)&&!this.isDefaulted(i,c)&&Object.prototype.hasOwnProperty.call(e,c)&&Object.prototype.hasOwnProperty.call(u.argv,c)&&(Array.isArray(e[c])||Array.isArray(u.argv[c]))?e[c]=[].concat(e[c],u.argv[c]):e[c]=u.argv[c])})}}isDefaulted(e,r){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){let{configObjects:n}=e.getOptions();return n.some(i=>Object.prototype.hasOwnProperty.call(i,r))||n.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=Yi.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(Ea(r))return r(e,!0);Ch(r)||Object.keys(r).forEach(n=>{e.option(n,r[n])})}moduleName(e){let r=Ac(e);if(!r)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(r.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:r,desc:n}){for(let i of[e,r,n]){if(typeof i=="string"||i===!1)return i;Nt(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();Nt(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function wh(t,e,r,n){return new Cc(t,e,r,n)}function Ch(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}function ek(t){return t.every(e=>typeof e=="string")}function Ea(t){return typeof t=="function"}function tk(t){return typeof t=="object"}function rk(t){return typeof t=="object"&&!Array.isArray(t)}function hn(t={},e=()=>!0){let r={};return Ki(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}function mn(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}function nk(t){return typeof t=="boolean"}function _h(t,e){let r=e.y18n.__,n={},i=[];n.failFn=function(F){i.push(F)};let o=null,s=null,a=!0;n.showHelpOnFail=function(F=!0,v){let[P,j]=typeof F=="string"?[!0,F]:[F,v];return t.getInternalMethods().isGlobalContext()&&(s=j),o=j,a=P,n};let u=!1;n.fail=function(F,v){let P=t.getInternalMethods().getLoggerInstance();if(i.length)for(let j=i.length-1;j>=0;--j){let ae=i[j];if(nk(ae)){if(v)throw v;if(F)throw Error(F)}else ae(F,v,n)}else{if(t.getExitProcess()&&mn(!0),!u){u=!0,a&&(t.showHelp("error"),P.error()),(F||v)&&P.error(F||v);let j=o||s;j&&((F||v)&&P.error(""),P.error(j))}if(v=v||new $e(F),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,v);throw v}};let l=[],c=!1;n.usage=(L,F)=>L===null?(c=!0,l=[],n):(c=!1,l.push([L,F||""]),n),n.getUsage=()=>l,n.getUsageDisabled=()=>c,n.getPositionalGroupName=()=>r("Positionals:");let f=[];n.example=(L,F)=>{f.push([L,F||""])};let p=[];n.command=function(F,v,P,j,ae=!1){P&&(p=p.map(ee=>(ee[2]=!1,ee))),p.push([F,v||"",P,j,ae])},n.getCommands=()=>p;let d={};n.describe=function(F,v){Array.isArray(F)?F.forEach(P=>{n.describe(P,v)}):typeof F=="object"?Object.keys(F).forEach(P=>{n.describe(P,F[P])}):d[F]=v},n.getDescriptions=()=>d;let m=[];n.epilog=L=>{m.push(L)};let y=!1,g;n.wrap=L=>{y=!0,g=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(g=ye(),y=!0),g);let b="__yargsString__:";n.deferY18nLookup=L=>b+L,n.help=function(){if(D)return D;C();let F=t.customScriptName?t.$0:e.path.basename(t.$0),v=t.getDemandedOptions(),P=t.getDemandedCommands(),j=t.getDeprecatedOptions(),ae=t.getGroups(),ee=t.getOptions(),_e=[];_e=_e.concat(Object.keys(d)),_e=_e.concat(Object.keys(v)),_e=_e.concat(Object.keys(P)),_e=_e.concat(Object.keys(ee.default)),_e=_e.filter(S),_e=Object.keys(_e.reduce((ne,he)=>(he!=="_"&&(ne[he]=!0),ne),{}));let it=n.getWrap(),x=e.cliui({width:it,wrap:!!it});if(!c){if(l.length)l.forEach(ne=>{x.div({text:`${ne[0].replace(/\$0/g,F)}`}),ne[1]&&x.div({text:`${ne[1]}`,padding:[1,0,0,0]})}),x.div();else if(p.length){let ne=null;P._?ne=`${F} <${r("command")}>
|
|
12
12
|
`:ne=`${F} [${r("command")}]
|
|
13
|
-
`,x.div(`${ne}`)}}if(p.length>1||p.length===1&&!p[0][2]){x.div(r("Commands:"));let ne=t.getInternalMethods().getContext(),he=ne.commands.length?`${ne.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(p=p.sort((ce,me)=>ce[0].localeCompare(me[0])));let oe=F?`${F} `:"";p.forEach(ce=>{let me=`${oe}${he}${ce[0].replace(/^\$0 ?/,"")}`;x.span({text:me,padding:[0,2,0,2],width:w(p,it,`${F}${he}`)+4},{text:ce[1]});let we=[];ce[2]&&we.push(`[${r("default")}]`),ce[3]&&ce[3].length&&we.push(`[${r("aliases:")} ${ce[3].join(", ")}]`),ce[4]&&(typeof ce[4]=="string"?we.push(`[${r("deprecated: %s",ce[4])}]`):we.push(`[${r("deprecated")}]`)),we.length?x.div({text:we.join(" "),padding:[0,0,0,2],align:"right"}):x.div()}),x.div()}let Ue=(Object.keys(ee.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);_e=_e.filter(ne=>!t.parsed.newAliases[ne]&&Ue.every(he=>(ee.alias[he]||[]).indexOf(ne)===-1));let Qe=r("Options:");ae[Qe]||(ae[Qe]=[]),R(_e,ee.alias,ae,Qe);let E=ne=>/^--/.test(Aa(ne)),W=Object.keys(ae).filter(ne=>ae[ne].length>0).map(ne=>{let he=ae[ne].filter(S).map(oe=>{if(Ue.includes(oe))return oe;for(let ce=0,me;(me=Ue[ce])!==void 0;ce++)if((ee.alias[me]||[]).includes(oe))return me;return oe});return{groupName:ne,normalizedKeys:he}}).filter(({normalizedKeys:ne})=>ne.length>0).map(({groupName:ne,normalizedKeys:he})=>{let oe=he.reduce((ce,me)=>(ce[me]=[me].concat(ee.alias[me]||[]).map(we=>ne===n.getPositionalGroupName()?we:(/^[0-9]$/.test(we)?ee.boolean.includes(me)?"-":"--":we.length>1?"--":"-")+we).sort((we,Fe)=>E(we)===E(Fe)?0:E(we)?1:-1).join(", "),ce),{});return{groupName:ne,normalizedKeys:he,switches:oe}});if(W.filter(({groupName:ne})=>ne!==n.getPositionalGroupName()).some(({normalizedKeys:ne,switches:he})=>!ne.every(oe=>E(he[oe])))&&W.filter(({groupName:ne})=>ne!==n.getPositionalGroupName()).forEach(({normalizedKeys:ne,switches:he})=>{ne.forEach(oe=>{E(he[oe])&&(he[oe]=
|
|
13
|
+
`,x.div(`${ne}`)}}if(p.length>1||p.length===1&&!p[0][2]){x.div(r("Commands:"));let ne=t.getInternalMethods().getContext(),he=ne.commands.length?`${ne.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(p=p.sort((ce,me)=>ce[0].localeCompare(me[0])));let oe=F?`${F} `:"";p.forEach(ce=>{let me=`${oe}${he}${ce[0].replace(/^\$0 ?/,"")}`;x.span({text:me,padding:[0,2,0,2],width:w(p,it,`${F}${he}`)+4},{text:ce[1]});let we=[];ce[2]&&we.push(`[${r("default")}]`),ce[3]&&ce[3].length&&we.push(`[${r("aliases:")} ${ce[3].join(", ")}]`),ce[4]&&(typeof ce[4]=="string"?we.push(`[${r("deprecated: %s",ce[4])}]`):we.push(`[${r("deprecated")}]`)),we.length?x.div({text:we.join(" "),padding:[0,0,0,2],align:"right"}):x.div()}),x.div()}let Ue=(Object.keys(ee.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);_e=_e.filter(ne=>!t.parsed.newAliases[ne]&&Ue.every(he=>(ee.alias[he]||[]).indexOf(ne)===-1));let Qe=r("Options:");ae[Qe]||(ae[Qe]=[]),R(_e,ee.alias,ae,Qe);let E=ne=>/^--/.test(Aa(ne)),W=Object.keys(ae).filter(ne=>ae[ne].length>0).map(ne=>{let he=ae[ne].filter(S).map(oe=>{if(Ue.includes(oe))return oe;for(let ce=0,me;(me=Ue[ce])!==void 0;ce++)if((ee.alias[me]||[]).includes(oe))return me;return oe});return{groupName:ne,normalizedKeys:he}}).filter(({normalizedKeys:ne})=>ne.length>0).map(({groupName:ne,normalizedKeys:he})=>{let oe=he.reduce((ce,me)=>(ce[me]=[me].concat(ee.alias[me]||[]).map(we=>ne===n.getPositionalGroupName()?we:(/^[0-9]$/.test(we)?ee.boolean.includes(me)?"-":"--":we.length>1?"--":"-")+we).sort((we,Fe)=>E(we)===E(Fe)?0:E(we)?1:-1).join(", "),ce),{});return{groupName:ne,normalizedKeys:he,switches:oe}});if(W.filter(({groupName:ne})=>ne!==n.getPositionalGroupName()).some(({normalizedKeys:ne,switches:he})=>!ne.every(oe=>E(he[oe])))&&W.filter(({groupName:ne})=>ne!==n.getPositionalGroupName()).forEach(({normalizedKeys:ne,switches:he})=>{ne.forEach(oe=>{E(he[oe])&&(he[oe]=ik(he[oe],4))})}),W.forEach(({groupName:ne,normalizedKeys:he,switches:oe})=>{x.div(ne),he.forEach(ce=>{let me=oe[ce],we=d[ce]||"",Fe=null;we.includes(b)&&(we=r(we.substring(b.length))),ee.boolean.includes(ce)&&(Fe=`[${r("boolean")}]`),ee.count.includes(ce)&&(Fe=`[${r("count")}]`),ee.string.includes(ce)&&(Fe=`[${r("string")}]`),ee.normalize.includes(ce)&&(Fe=`[${r("string")}]`),ee.array.includes(ce)&&(Fe=`[${r("array")}]`),ee.number.includes(ce)&&(Fe=`[${r("number")}]`);let ze=k=>typeof k=="string"?`[${r("deprecated: %s",k)}]`:`[${r("deprecated")}]`,qt=[ce in j?ze(j[ce]):null,Fe,ce in v?`[${r("required")}]`:null,ee.choices&&ee.choices[ce]?`[${r("choices:")} ${n.stringifiedValues(ee.choices[ce])}]`:null,de(ee.default[ce],ee.defaultDescription[ce])].filter(Boolean).join(" ");x.span({text:Aa(me),padding:[0,2,0,2+Th(me)],width:w(oe,it)+4},we);let A=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;qt&&!A?x.div({text:qt,padding:[0,0,0,2],align:"right"}):x.div()}),x.div()}),f.length&&(x.div(r("Examples:")),f.forEach(ne=>{ne[0]=ne[0].replace(/\$0/g,F)}),f.forEach(ne=>{ne[1]===""?x.div({text:ne[0],padding:[0,2,0,2]}):x.div({text:ne[0],padding:[0,2,0,2],width:w(f,it)+4},{text:ne[1]})}),x.div()),m.length>0){let ne=m.map(he=>he.replace(/\$0/g,F)).join(`
|
|
14
14
|
`);x.div(`${ne}
|
|
15
|
-
`)}return x.toString().replace(/\s*$/,"")};function w(L,F,v){let P=0;return Array.isArray(L)||(L=Object.values(L).map(j=>[j])),L.forEach(j=>{P=Math.max(e.stringWidth(v?`${v} ${Aa(j[0])}`:Aa(j[0]))+Th(j[0]),P)}),F&&(P=Math.min(P,parseInt((F*.5).toString(),10))),P}function C(){let L=t.getDemandedOptions(),F=t.getOptions();(Object.keys(F.alias)||[]).forEach(v=>{F.alias[v].forEach(P=>{d[P]&&n.describe(v,d[P]),P in L&&t.demandOption(v,L[P]),F.boolean.includes(P)&&t.boolean(v),F.count.includes(P)&&t.count(v),F.string.includes(P)&&t.string(v),F.normalize.includes(P)&&t.normalize(v),F.array.includes(P)&&t.array(v),F.number.includes(P)&&t.number(v)})})}let D;n.cacheHelpMessage=function(){D=this.help()},n.clearCachedHelpMessage=function(){D=void 0},n.hasCachedHelpMessage=function(){return!!D};function R(L,F,v,P){let j=[],ae=null;return Object.keys(v).forEach(ee=>{j=j.concat(v[ee])}),L.forEach(ee=>{ae=[ee].concat(F[ee]),ae.some(_e=>j.indexOf(_e)!==-1)||v[P].push(ee)}),j}function S(L){return t.getOptions().hiddenOptions.indexOf(L)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}n.showHelp=L=>{let F=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:F[L])(n.help())},n.functionDescription=L=>["(",L.name?e.Parser.decamelize(L.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=function(F,v){let P="",j=v||", ",ae=[].concat(F);return!F||!ae.length||ae.forEach(ee=>{P.length&&(P+=j),P+=JSON.stringify(ee)}),P};function de(L,F){let v=`[${r("default:")} `;if(L===void 0&&!F)return null;if(F)v+=F;else switch(typeof L){case"string":v+=`"${L}"`;break;case"object":v+=JSON.stringify(L);break;default:v+=L}return`${v}]`}function ye(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let be=null;n.version=L=>{be=L},n.showVersion=L=>{let F=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:F[L])(be)},n.reset=function(F){return o=null,u=!1,l=[],c=!1,m=[],f=[],p=[],d=hn(d,v=>!F[v]),n};let _=[];return n.freeze=function(){_.push({failMessage:o,failureOutput:u,usages:l,usageDisabled:c,epilogs:m,examples:f,commands:p,descriptions:d})},n.unfreeze=function(F=!1){let v=_.pop();v&&(F?(d={...v.descriptions,...d},p=[...v.commands,...p],l=[...v.usages,...l],f=[...v.examples,...f],m=[...v.epilogs,...m]):{failMessage:o,failureOutput:u,usages:l,usageDisabled:c,epilogs:m,examples:f,commands:p,descriptions:d}=v)},n}function
|
|
15
|
+
`)}return x.toString().replace(/\s*$/,"")};function w(L,F,v){let P=0;return Array.isArray(L)||(L=Object.values(L).map(j=>[j])),L.forEach(j=>{P=Math.max(e.stringWidth(v?`${v} ${Aa(j[0])}`:Aa(j[0]))+Th(j[0]),P)}),F&&(P=Math.min(P,parseInt((F*.5).toString(),10))),P}function C(){let L=t.getDemandedOptions(),F=t.getOptions();(Object.keys(F.alias)||[]).forEach(v=>{F.alias[v].forEach(P=>{d[P]&&n.describe(v,d[P]),P in L&&t.demandOption(v,L[P]),F.boolean.includes(P)&&t.boolean(v),F.count.includes(P)&&t.count(v),F.string.includes(P)&&t.string(v),F.normalize.includes(P)&&t.normalize(v),F.array.includes(P)&&t.array(v),F.number.includes(P)&&t.number(v)})})}let D;n.cacheHelpMessage=function(){D=this.help()},n.clearCachedHelpMessage=function(){D=void 0},n.hasCachedHelpMessage=function(){return!!D};function R(L,F,v,P){let j=[],ae=null;return Object.keys(v).forEach(ee=>{j=j.concat(v[ee])}),L.forEach(ee=>{ae=[ee].concat(F[ee]),ae.some(_e=>j.indexOf(_e)!==-1)||v[P].push(ee)}),j}function S(L){return t.getOptions().hiddenOptions.indexOf(L)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}n.showHelp=L=>{let F=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:F[L])(n.help())},n.functionDescription=L=>["(",L.name?e.Parser.decamelize(L.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=function(F,v){let P="",j=v||", ",ae=[].concat(F);return!F||!ae.length||ae.forEach(ee=>{P.length&&(P+=j),P+=JSON.stringify(ee)}),P};function de(L,F){let v=`[${r("default:")} `;if(L===void 0&&!F)return null;if(F)v+=F;else switch(typeof L){case"string":v+=`"${L}"`;break;case"object":v+=JSON.stringify(L);break;default:v+=L}return`${v}]`}function ye(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let be=null;n.version=L=>{be=L},n.showVersion=L=>{let F=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:F[L])(be)},n.reset=function(F){return o=null,u=!1,l=[],c=!1,m=[],f=[],p=[],d=hn(d,v=>!F[v]),n};let _=[];return n.freeze=function(){_.push({failMessage:o,failureOutput:u,usages:l,usageDisabled:c,epilogs:m,examples:f,commands:p,descriptions:d})},n.unfreeze=function(F=!1){let v=_.pop();v&&(F?(d={...v.descriptions,...d},p=[...v.commands,...p],l=[...v.usages,...l],f=[...v.examples,...f],m=[...v.epilogs,...m]):{failMessage:o,failureOutput:u,usages:l,usageDisabled:c,epilogs:m,examples:f,commands:p,descriptions:d}=v)},n}function wc(t){return typeof t=="object"}function ik(t,e){return wc(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}function Th(t){return wc(t)?t.indentation:0}function Aa(t){return wc(t)?t.text:t}var Sh=`###-begin-{{app_name}}-completions-###
|
|
16
16
|
#
|
|
17
17
|
# yargs command completion script
|
|
18
18
|
#
|
|
@@ -59,71 +59,71 @@ _{{app_name}}_yargs_completions()
|
|
|
59
59
|
}
|
|
60
60
|
compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
61
61
|
###-end-{{app_name}}-completions-###
|
|
62
|
-
`;var
|
|
62
|
+
`;var kc=class{constructor(e,r,n,i){var o,s,a;this.yargs=e,this.usage=r,this.command=n,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((s=this.shim.getEnv("ZSH_NAME"))===null||s===void 0?void 0:s.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(e,r,n,i){let o=this.command.getCommandHandlers();for(let a=0,u=e.length;a<u;++a)if(o[e[a]]&&o[e[a]].builder){let l=o[e[a]].builder;if(Ea(l)){this.indexAfterLastReset=a+1;let c=this.yargs.getInternalMethods().reset();return l(c,!0),c.argv}}let s=[];this.commandCompletions(s,e,n),this.optionCompletions(s,e,r,n),this.choicesFromOptionsCompletions(s,e,r,n),this.choicesFromPositionalsCompletions(s,e,r,n),i(null,s)}commandCompletions(e,r,n){let i=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&i[i.length-1]!==n&&!this.previousArgHasChoices(r)&&this.usage.getCommands().forEach(o=>{let s=dn(o[0]).cmd;if(r.indexOf(s)===-1)if(!this.zshShell)e.push(s);else{let a=o[1]||"";e.push(s.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(e,r,n,i){if((i.match(/^-/)||i===""&&e.length===0)&&!this.previousArgHasChoices(r)){let o=this.yargs.getOptions(),s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(o.key).forEach(a=>{let u=!!o.configuration["boolean-negation"]&&o.boolean.includes(a);!s.includes(a)&&!o.hiddenOptions.includes(a)&&!this.argsContainKey(r,a,u)&&this.completeOptionKey(a,e,i,u&&!!o.default[a])})}}choicesFromOptionsCompletions(e,r,n,i){if(this.previousArgHasChoices(r)){let o=this.getPreviousArgChoices(r);o&&o.length>0&&e.push(...o.map(s=>s.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,r,n,i){if(i===""&&e.length>0&&this.previousArgHasChoices(r))return;let o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],s=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=o[n._.length-s-1];if(!a)return;let u=this.yargs.getOptions().choices[a]||[];for(let l of u)l.startsWith(i)&&e.push(l.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;let i=r.replace(/^-+/,""),o=this.yargs.getOptions(),s=[i,...this.yargs.getAliases()[i]||[]],a;for(let u of s)if(Object.prototype.hasOwnProperty.call(o.key,u)&&Array.isArray(o.choices[u])){a=o.choices[u];break}if(a)return a.filter(u=>!n||u.startsWith(n))}previousArgHasChoices(e){let r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){let i=o=>e.indexOf((/^[^0-9]$/.test(o)?"-":"--")+o)!==-1;if(i(r)||n&&i(`no-${r}`))return!0;if(this.aliases){for(let o of this.aliases[r])if(i(o))return!0}return!1}completeOptionKey(e,r,n,i){var o,s,a,u;let l=e;if(this.zshShell){let d=this.usage.getDescriptions(),m=(s=(o=this===null||this===void 0?void 0:this.aliases)===null||o===void 0?void 0:o[e])===null||s===void 0?void 0:s.find(b=>{let w=d[b];return typeof w=="string"&&w.length>0}),y=m?d[m]:void 0,g=(u=(a=d[e])!==null&&a!==void 0?a:y)!==null&&u!==void 0?u:"";l=`${e.replace(/:/g,"\\:")}:${g.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let c=d=>/^--/.test(d),f=d=>/^[^0-9]$/.test(d),p=!c(n)&&f(e)?"-":"--";r.push(p+l),i&&r.push(p+"no-"+l)}customCompletion(e,r,n,i){if(Nt(this.customCompletionFunction,null,this.shim),sk(this.customCompletionFunction)){let o=this.customCompletionFunction(n,r);return qe(o)?o.then(s=>{this.shim.process.nextTick(()=>{i(null,s)})}).catch(s=>{this.shim.process.nextTick(()=>{i(s,void 0)})}):i(null,o)}else return ak(this.customCompletionFunction)?this.customCompletionFunction(n,r,(o=i)=>this.defaultCompletion(e,r,n,o),o=>{i(null,o)}):this.customCompletionFunction(n,r,o=>{i(null,o)})}getCompletion(e,r){let n=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),o=this.customCompletionFunction?s=>this.customCompletion(e,s,n,r):s=>this.defaultCompletion(e,s,n,r);return qe(i)?i.then(o):o(i)}generateCompletionScript(e,r){let n=this.zshShell?vh:Sh,i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function Ih(t,e,r,n){return new kc(t,e,r,n)}function sk(t){return t.length<3}function ak(t){return t.length>3}function Oh(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],n;for(n=0;n<=e.length;n++)r[n]=[n];let i;for(i=0;i<=t.length;i++)r[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=t.length;i++)e.charAt(n-1)===t.charAt(i-1)?r[n][i]=r[n-1][i-1]:n>1&&i>1&&e.charAt(n-2)===t.charAt(i-1)&&e.charAt(n-1)===t.charAt(i-2)?r[n][i]=r[n-2][i-2]+1:r[n][i]=Math.min(r[n-1][i-1]+1,Math.min(r[n][i-1]+1,r[n-1][i]+1));return r[e.length][t.length]}var Dh=["$0","--","_"];function Rh(t,e,r){let n=r.y18n.__,i=r.y18n.__n,o={};o.nonOptionCount=function(f){let p=t.getDemandedCommands(),m=f._.length+(f["--"]?f["--"].length:0)-t.getInternalMethods().getContext().commands.length;p._&&(m<p._.min||m>p._.max)&&(m<p._.min?p._.minMsg!==void 0?e.fail(p._.minMsg?p._.minMsg.replace(/\$0/g,m.toString()).replace(/\$1/,p._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",m,m.toString(),p._.min.toString())):m>p._.max&&(p._.maxMsg!==void 0?e.fail(p._.maxMsg?p._.maxMsg.replace(/\$0/g,m.toString()).replace(/\$1/,p._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",m,m.toString(),p._.max.toString()))))},o.positionalCount=function(f,p){p<f&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",p,p+"",f+""))},o.requiredArguments=function(f,p){let d=null;for(let m of Object.keys(p))(!Object.prototype.hasOwnProperty.call(f,m)||typeof f[m]>"u")&&(d=d||{},d[m]=p[m]);if(d){let m=[];for(let g of Object.keys(d)){let b=d[g];b&&m.indexOf(b)<0&&m.push(b)}let y=m.length?`
|
|
63
63
|
${m.join(`
|
|
64
64
|
`)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(d).length,Object.keys(d).join(", ")+y))}},o.unknownArguments=function(f,p,d,m,y=!0){var g;let b=t.getInternalMethods().getCommandInstance().getCommands(),w=[],C=t.getInternalMethods().getContext();if(Object.keys(f).forEach(D=>{!Dh.includes(D)&&!Object.prototype.hasOwnProperty.call(d,D)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),D)&&!o.isValidAndSomeAliasIsNotNew(D,p)&&w.push(D)}),y&&(C.commands.length>0||b.length>0||m)&&f._.slice(C.commands.length).forEach(D=>{b.includes(""+D)||w.push(""+D)}),y){let R=((g=t.getDemandedCommands()._)===null||g===void 0?void 0:g.max)||0,S=C.commands.length+R;S<f._.length&&f._.slice(S).forEach(de=>{de=String(de),!C.commands.includes(de)&&!w.includes(de)&&w.push(de)})}w.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",w.length,w.map(D=>D.trim()?D:`"${D}"`).join(", ")))},o.unknownCommands=function(f){let p=t.getInternalMethods().getCommandInstance().getCommands(),d=[],m=t.getInternalMethods().getContext();return(m.commands.length>0||p.length>0)&&f._.slice(m.commands.length).forEach(y=>{p.includes(""+y)||d.push(""+y)}),d.length>0?(e.fail(i("Unknown command: %s","Unknown commands: %s",d.length,d.join(", "))),!0):!1},o.isValidAndSomeAliasIsNotNew=function(f,p){if(!Object.prototype.hasOwnProperty.call(p,f))return!1;let d=t.parsed.newAliases;return[f,...p[f]].some(m=>!Object.prototype.hasOwnProperty.call(d,m)||!d[f])},o.limitedChoices=function(f){let p=t.getOptions(),d={};if(!Object.keys(p.choices).length)return;Object.keys(f).forEach(g=>{Dh.indexOf(g)===-1&&Object.prototype.hasOwnProperty.call(p.choices,g)&&[].concat(f[g]).forEach(b=>{p.choices[g].indexOf(b)===-1&&b!==void 0&&(d[g]=(d[g]||[]).concat(b))})});let m=Object.keys(d);if(!m.length)return;let y=n("Invalid values:");m.forEach(g=>{y+=`
|
|
65
65
|
${n("Argument: %s, Given: %s, Choices: %s",g,e.stringifiedValues(d[g]),e.stringifiedValues(p.choices[g]))}`}),e.fail(y)};let s={};o.implies=function(f,p){H("<string|object> [array|number|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(d=>{o.implies(d,f[d])}):(t.global(f),s[f]||(s[f]=[]),Array.isArray(p)?p.forEach(d=>o.implies(f,d)):(Nt(p,void 0,r),s[f].push(p)))},o.getImplied=function(){return s};function a(c,f){let p=Number(f);return f=isNaN(p)?f:p,typeof f=="number"?f=c._.length>=f:f.match(/^--no-.+/)?(f=f.match(/^--no-(.+)/)[1],f=!Object.prototype.hasOwnProperty.call(c,f)):f=Object.prototype.hasOwnProperty.call(c,f),f}o.implications=function(f){let p=[];if(Object.keys(s).forEach(d=>{let m=d;(s[d]||[]).forEach(y=>{let g=m,b=y;g=a(f,g),y=a(f,y),g&&!y&&p.push(` ${m} -> ${b}`)})}),p.length){let d=`${n("Implications failed:")}
|
|
66
|
-
`;p.forEach(m=>{d+=m}),e.fail(d)}};let u={};o.conflicts=function(f,p){H("<string|object> [array|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(d=>{o.conflicts(d,f[d])}):(t.global(f),u[f]||(u[f]=[]),Array.isArray(p)?p.forEach(d=>o.conflicts(f,d)):u[f].push(p))},o.getConflicting=()=>u,o.conflicting=function(f){Object.keys(f).forEach(p=>{u[p]&&u[p].forEach(d=>{d&&f[p]!==void 0&&f[d]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",p,d))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(p=>{u[p].forEach(d=>{d&&f[r.Parser.camelCase(p)]!==void 0&&f[r.Parser.camelCase(d)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",p,d))})})},o.recommendCommands=function(f,p){p=p.sort((g,b)=>b.length-g.length);let m=null,y=1/0;for(let g=0,b;(b=p[g])!==void 0;g++){let w=Oh(f,b);w<=3&&w<y&&(y=w,m=b)}m&&e.fail(n("Did you mean %s?",m))},o.reset=function(f){return s=hn(s,p=>!f[p]),u=hn(u,p=>!f[p]),o};let l=[];return o.freeze=function(){l.push({implied:s,conflicting:u})},o.unfreeze=function(){let f=l.pop();Nt(f,void 0,r),{implied:s,conflicting:u}=f},o}var kc=[],cs;function fs(t,e,r,n){cs=n;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return i;let o=/\.json|\..*rc$/.test(t.extends),s=null;if(o)s=ak(e,t.extends);else try{s=Tr.resolve(t.extends)}catch{return t}sk(s),kc.push(s),i=o?JSON.parse(cs.readFileSync(s,"utf8")):Tr(t.extends),delete t.extends,i=fs(i,cs.path.dirname(s),r,cs)}return kc=[],r?Fh(i,t):Object.assign({},i,t)}function sk(t){if(kc.indexOf(t)>-1)throw new $e(`Circular extended configurations: '${t}'.`)}function ak(t,e){return cs.path.resolve(t,e)}function Fh(t,e){let r={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(r,t);for(let i of Object.keys(e))n(e[i])&&n(r[i])?r[i]=Fh(t[i],e[i]):r[i]=e[i];return r}var Y=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},h=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ot,Yn,ps,ar,Xt,Ca,gn,Zn,wa,ur,ka,lr,_r,Jt,cr,Ta,Zi,Ct,re,_a,Sa,Qt,Xn,Xi,Jn,xn,va,fe,Qn,ei,ti,ge,Ia,Sr,tt;function Qh(t){return(e=[],r=t.process.cwd(),n)=>{let i=new Pc(e,r,n,t);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Nh=Symbol("copyDoubleDash"),Ph=Symbol("copyDoubleDash"),Tc=Symbol("deleteFromParserHintObject"),Lh=Symbol("emitWarning"),Mh=Symbol("freeze"),Bh=Symbol("getDollarZero"),ri=Symbol("getParserConfiguration"),jh=Symbol("getUsageConfiguration"),_c=Symbol("guessLocale"),Uh=Symbol("guessVersion"),zh=Symbol("parsePositionalNumbers"),Sc=Symbol("pkgUp"),yn=Symbol("populateParserHintArray"),Ji=Symbol("populateParserHintSingleValueDictionary"),vc=Symbol("populateParserHintArrayDictionary"),Ic=Symbol("populateParserHintDictionary"),Oc=Symbol("sanitizeKey"),Dc=Symbol("setKey"),Rc=Symbol("unfreeze"),$h=Symbol("validateAsync"),qh=Symbol("getCommandInstance"),Vh=Symbol("getContext"),Gh=Symbol("getHasOutput"),Wh=Symbol("getLoggerInstance"),Hh=Symbol("getParseContext"),Kh=Symbol("getUsageInstance"),Yh=Symbol("getValidationInstance"),Oa=Symbol("hasParseCallback"),Zh=Symbol("isGlobalContext"),ni=Symbol("postProcess"),Xh=Symbol("rebase"),Fc=Symbol("reset"),ds=Symbol("runYargsParserAndExecuteCommands"),Nc=Symbol("runValidation"),Jh=Symbol("setHasOutput"),ii=Symbol("kTrackManuallySetKeys"),Pc=class{constructor(e=[],r,n,i){this.customScriptName=!1,this.parsed=!1,ot.set(this,void 0),Yn.set(this,void 0),ps.set(this,{commands:[],fullCommands:[]}),ar.set(this,null),Xt.set(this,null),Ca.set(this,"show-hidden"),gn.set(this,null),Zn.set(this,!0),wa.set(this,{}),ur.set(this,!0),ka.set(this,[]),lr.set(this,void 0),_r.set(this,{}),Jt.set(this,!1),cr.set(this,null),Ta.set(this,!0),Zi.set(this,void 0),Ct.set(this,""),re.set(this,void 0),_a.set(this,void 0),Sa.set(this,{}),Qt.set(this,null),Xn.set(this,null),Xi.set(this,{}),Jn.set(this,{}),xn.set(this,void 0),va.set(this,!1),fe.set(this,void 0),Qn.set(this,!1),ei.set(this,!1),ti.set(this,!1),ge.set(this,void 0),Ia.set(this,{}),Sr.set(this,null),tt.set(this,void 0),Y(this,fe,i,"f"),Y(this,xn,e,"f"),Y(this,Yn,r,"f"),Y(this,_a,n,"f"),Y(this,lr,new ba(this),"f"),this.$0=this[Bh](),this[Fc](),Y(this,ot,h(this,ot,"f"),"f"),Y(this,ge,h(this,ge,"f"),"f"),Y(this,tt,h(this,tt,"f"),"f"),Y(this,re,h(this,re,"f"),"f"),h(this,re,"f").showHiddenOpt=h(this,Ca,"f"),Y(this,Zi,this[Ph](),"f")}addHelpOpt(e,r){let n="help";return H("[string|boolean] [string]",[e,r],arguments.length),h(this,cr,"f")&&(this[Tc](h(this,cr,"f")),Y(this,cr,null,"f")),e===!1&&r===void 0?this:(Y(this,cr,typeof e=="string"?e:n,"f"),this.boolean(h(this,cr,"f")),this.describe(h(this,cr,"f"),r||h(this,ge,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(H("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:h(this,Ca,"f");return this.boolean(n),this.describe(n,r||h(this,ge,"f").deferY18nLookup("Show hidden options")),h(this,re,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return H("<object|string|array> [string|array]",[e,r],arguments.length),this[vc](this.alias.bind(this),"alias",e,r),this}array(e){return H("<array|string>",[e],arguments.length),this[yn]("array",e),this[ii](e),this}boolean(e){return H("<array|string>",[e],arguments.length),this[yn]("boolean",e),this[ii](e),this}check(e,r){return H("<function> [boolean]",[e,r],arguments.length),this.middleware((n,i)=>Kn(()=>e(n,i.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&h(this,ge,"f").fail(o.toString(),o):h(this,ge,"f").fail(h(this,fe,"f").y18n.__("Argument check failed: %s",e.toString())),n),o=>(h(this,ge,"f").fail(o.message?o.message:o.toString(),o),n)),!1,r),this}choices(e,r){return H("<object|string|array> [string|array]",[e,r],arguments.length),this[vc](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(H("<object|string|array> [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new $e("coerce callback must be provided");for(let n of e)this.coerce(n,r);return this}else if(typeof e=="object"){for(let n of Object.keys(e))this.coerce(n,e[n]);return this}if(!r)throw new $e("coerce callback must be provided");return h(this,re,"f").key[e]=!0,h(this,lr,"f").addCoerceMiddleware((n,i)=>{let o;return Object.prototype.hasOwnProperty.call(n,e)?Kn(()=>(o=i.getAliases(),r(n[e])),a=>{n[e]=a;let u=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(o[e]&&u!==!0)for(let l of o[e])n[l]=a;return n},a=>{throw new $e(a.message)}):n},e),this}conflicts(e,r){return H("<string|object> [string|array]",[e,r],arguments.length),h(this,tt,"f").conflicts(e,r),this}config(e="config",r,n){return H("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=fs(e,h(this,Yn,"f"),this[ri]()["deep-merge-config"]||!1,h(this,fe,"f")),h(this,re,"f").configObjects=(h(this,re,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||h(this,ge,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{h(this,re,"f").config[i]=n||!0}),this)}completion(e,r,n){return H("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Y(this,Xt,e||h(this,Xt,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(h(this,Xt,"f"),r),n&&h(this,ar,"f").registerFunction(n),this}command(e,r,n,i,o,s){return H("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,i,o,s],arguments.length),h(this,ot,"f").addHandler(e,r,n,i,o,s),this}commands(e,r,n,i,o,s){return this.command(e,r,n,i,o,s)}commandDir(e,r){H("<string> [object]",[e,r],arguments.length);let n=h(this,_a,"f")||h(this,fe,"f").require;return h(this,ot,"f").addDirectory(e,n,h(this,fe,"f").getCallerFile(),r),this}count(e){return H("<array|string>",[e],arguments.length),this[yn]("count",e),this[ii](e),this}default(e,r,n){return H("<object|string|array> [*] [string]",[e,r,n],arguments.length),n&&(bc(e,h(this,fe,"f")),h(this,re,"f").defaultDescription[e]=n),typeof r=="function"&&(bc(e,h(this,fe,"f")),h(this,re,"f").defaultDescription[e]||(h(this,re,"f").defaultDescription[e]=h(this,ge,"f").functionDescription(r)),r=r.call()),this[Ji](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,i){return H("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,i],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),h(this,re,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:i},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(i=>{Nt(n,!0,h(this,fe,"f")),this.demandOption(i,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(Nt(n,!0,h(this,fe,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(i=>{Nt(n,!0,h(this,fe,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return H("<object|string|array> [string]",[e,r],arguments.length),this[Ji](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return H("<string> [string|boolean]",[e,r],arguments.length),h(this,re,"f").deprecatedOptions[e]=r,this}describe(e,r){return H("<object|string|array> [string]",[e,r],arguments.length),this[Dc](e,!0),h(this,ge,"f").describe(e,r),this}detectLocale(e){return H("<boolean>",[e],arguments.length),Y(this,Zn,e,"f"),this}env(e){return H("[string|boolean]",[e],arguments.length),e===!1?delete h(this,re,"f").envPrefix:h(this,re,"f").envPrefix=e||"",this}epilogue(e){return H("<string>",[e],arguments.length),h(this,ge,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return H("<string|array> [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):h(this,ge,"f").example(e,r),this}exit(e,r){Y(this,Jt,!0,"f"),Y(this,gn,r,"f"),h(this,ur,"f")&&h(this,fe,"f").process.exit(e)}exitProcess(e=!0){return H("[boolean]",[e],arguments.length),Y(this,ur,e,"f"),this}fail(e){if(H("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new $e("Invalid first argument. Expected function or boolean 'false'");return h(this,ge,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return H("<array> [function]",[e,r],arguments.length),r?h(this,ar,"f").getCompletion(e,r):new Promise((n,i)=>{h(this,ar,"f").getCompletion(e,(o,s)=>{o?i(o):n(s)})})}getDemandedOptions(){return H([],0),h(this,re,"f").demandedOptions}getDemandedCommands(){return H([],0),h(this,re,"f").demandedCommands}getDeprecatedOptions(){return H([],0),h(this,re,"f").deprecatedOptions}getDetectLocale(){return h(this,Zn,"f")}getExitProcess(){return h(this,ur,"f")}getGroups(){return Object.assign({},h(this,_r,"f"),h(this,Jn,"f"))}getHelp(){if(Y(this,Jt,!0,"f"),!h(this,ge,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[ds](h(this,xn,"f"),void 0,void 0,0,!0);if(qe(r))return r.then(()=>h(this,ge,"f").help())}let e=h(this,ot,"f").runDefaultBuilderOn(this);if(qe(e))return e.then(()=>h(this,ge,"f").help())}return Promise.resolve(h(this,ge,"f").help())}getOptions(){return h(this,re,"f")}getStrict(){return h(this,Qn,"f")}getStrictCommands(){return h(this,ei,"f")}getStrictOptions(){return h(this,ti,"f")}global(e,r){return H("<string|array> [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?h(this,re,"f").local=h(this,re,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{h(this,re,"f").local.includes(n)||h(this,re,"f").local.push(n)}),this}group(e,r){H("<string|array> <string>",[e,r],arguments.length);let n=h(this,Jn,"f")[r]||h(this,_r,"f")[r];h(this,Jn,"f")[r]&&delete h(this,Jn,"f")[r];let i={};return h(this,_r,"f")[r]=(n||[]).concat(e).filter(o=>i[o]?!1:i[o]=!0),this}hide(e){return H("<string>",[e],arguments.length),h(this,re,"f").hiddenOptions.push(e),this}implies(e,r){return H("<string|object> [number|string|array]",[e,r],arguments.length),h(this,tt,"f").implies(e,r),this}locale(e){return H("[string]",[e],arguments.length),e===void 0?(this[_c](),h(this,fe,"f").y18n.getLocale()):(Y(this,Zn,!1,"f"),h(this,fe,"f").y18n.setLocale(e),this)}middleware(e,r,n){return h(this,lr,"f").addMiddleware(e,!!r,n)}nargs(e,r){return H("<string|object|array> [number]",[e,r],arguments.length),this[Ji](this.nargs.bind(this),"narg",e,r),this}normalize(e){return H("<array|string>",[e],arguments.length),this[yn]("normalize",e),this}number(e){return H("<array|string>",[e],arguments.length),this[yn]("number",e),this[ii](e),this}option(e,r){if(H("<string|object> [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[ii](e),h(this,Sr,"f")&&(e==="version"||r?.alias==="version")&&this[Lh](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
|
67
|
-
`),void 0,"versionWarning"),h(this,re,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);let i=r.demand||r.required||r.require;i&&this.demand(e,i),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global=="boolean"&&this.global(e,r.global),r.defaultDescription&&(h(this,re,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let o=r.describe||r.description||r.desc,s=h(this,ge,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(s,e)||typeof o=="string")&&this.describe(e,o),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){H("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[Mh](),typeof e>"u"&&(e=h(this,xn,"f")),typeof r=="object"&&(Y(this,Xn,r,"f"),r=n),typeof r=="function"&&(Y(this,Qt,r,"f"),r=!1),r||Y(this,xn,e,"f"),h(this,Qt,"f")&&Y(this,ur,!1,"f");let i=this[ds](e,!!r),o=this.parsed;return h(this,ar,"f").setParsed(this.parsed),qe(i)?i.then(s=>(h(this,Qt,"f")&&h(this,Qt,"f").call(this,h(this,gn,"f"),s,h(this,Ct,"f")),s)).catch(s=>{throw h(this,Qt,"f")&&h(this,Qt,"f")(s,this.parsed.argv,h(this,Ct,"f")),s}).finally(()=>{this[
|
|
66
|
+
`;p.forEach(m=>{d+=m}),e.fail(d)}};let u={};o.conflicts=function(f,p){H("<string|object> [array|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(d=>{o.conflicts(d,f[d])}):(t.global(f),u[f]||(u[f]=[]),Array.isArray(p)?p.forEach(d=>o.conflicts(f,d)):u[f].push(p))},o.getConflicting=()=>u,o.conflicting=function(f){Object.keys(f).forEach(p=>{u[p]&&u[p].forEach(d=>{d&&f[p]!==void 0&&f[d]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",p,d))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(p=>{u[p].forEach(d=>{d&&f[r.Parser.camelCase(p)]!==void 0&&f[r.Parser.camelCase(d)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",p,d))})})},o.recommendCommands=function(f,p){p=p.sort((g,b)=>b.length-g.length);let m=null,y=1/0;for(let g=0,b;(b=p[g])!==void 0;g++){let w=Oh(f,b);w<=3&&w<y&&(y=w,m=b)}m&&e.fail(n("Did you mean %s?",m))},o.reset=function(f){return s=hn(s,p=>!f[p]),u=hn(u,p=>!f[p]),o};let l=[];return o.freeze=function(){l.push({implied:s,conflicting:u})},o.unfreeze=function(){let f=l.pop();Nt(f,void 0,r),{implied:s,conflicting:u}=f},o}var Tc=[],cs;function fs(t,e,r,n){cs=n;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return i;let o=/\.json|\..*rc$/.test(t.extends),s=null;if(o)s=lk(e,t.extends);else try{s=Tr.resolve(t.extends)}catch{return t}uk(s),Tc.push(s),i=o?JSON.parse(cs.readFileSync(s,"utf8")):Tr(t.extends),delete t.extends,i=fs(i,cs.path.dirname(s),r,cs)}return Tc=[],r?Fh(i,t):Object.assign({},i,t)}function uk(t){if(Tc.indexOf(t)>-1)throw new $e(`Circular extended configurations: '${t}'.`)}function lk(t,e){return cs.path.resolve(t,e)}function Fh(t,e){let r={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(r,t);for(let i of Object.keys(e))n(e[i])&&n(r[i])?r[i]=Fh(t[i],e[i]):r[i]=e[i];return r}var Y=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},h=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ot,Yn,ps,ar,Xt,Ca,gn,Zn,wa,ur,ka,lr,_r,Jt,cr,Ta,Zi,Ct,re,_a,Sa,Qt,Xn,Xi,Jn,xn,va,fe,Qn,ei,ti,ge,Ia,Sr,tt;function Qh(t){return(e=[],r=t.process.cwd(),n)=>{let i=new Lc(e,r,n,t);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Nh=Symbol("copyDoubleDash"),Ph=Symbol("copyDoubleDash"),_c=Symbol("deleteFromParserHintObject"),Lh=Symbol("emitWarning"),Mh=Symbol("freeze"),Bh=Symbol("getDollarZero"),ri=Symbol("getParserConfiguration"),jh=Symbol("getUsageConfiguration"),Sc=Symbol("guessLocale"),Uh=Symbol("guessVersion"),zh=Symbol("parsePositionalNumbers"),vc=Symbol("pkgUp"),yn=Symbol("populateParserHintArray"),Ji=Symbol("populateParserHintSingleValueDictionary"),Ic=Symbol("populateParserHintArrayDictionary"),Oc=Symbol("populateParserHintDictionary"),Dc=Symbol("sanitizeKey"),Rc=Symbol("setKey"),Fc=Symbol("unfreeze"),$h=Symbol("validateAsync"),qh=Symbol("getCommandInstance"),Vh=Symbol("getContext"),Gh=Symbol("getHasOutput"),Wh=Symbol("getLoggerInstance"),Hh=Symbol("getParseContext"),Kh=Symbol("getUsageInstance"),Yh=Symbol("getValidationInstance"),Oa=Symbol("hasParseCallback"),Zh=Symbol("isGlobalContext"),ni=Symbol("postProcess"),Xh=Symbol("rebase"),Nc=Symbol("reset"),ds=Symbol("runYargsParserAndExecuteCommands"),Pc=Symbol("runValidation"),Jh=Symbol("setHasOutput"),ii=Symbol("kTrackManuallySetKeys"),Lc=class{constructor(e=[],r,n,i){this.customScriptName=!1,this.parsed=!1,ot.set(this,void 0),Yn.set(this,void 0),ps.set(this,{commands:[],fullCommands:[]}),ar.set(this,null),Xt.set(this,null),Ca.set(this,"show-hidden"),gn.set(this,null),Zn.set(this,!0),wa.set(this,{}),ur.set(this,!0),ka.set(this,[]),lr.set(this,void 0),_r.set(this,{}),Jt.set(this,!1),cr.set(this,null),Ta.set(this,!0),Zi.set(this,void 0),Ct.set(this,""),re.set(this,void 0),_a.set(this,void 0),Sa.set(this,{}),Qt.set(this,null),Xn.set(this,null),Xi.set(this,{}),Jn.set(this,{}),xn.set(this,void 0),va.set(this,!1),fe.set(this,void 0),Qn.set(this,!1),ei.set(this,!1),ti.set(this,!1),ge.set(this,void 0),Ia.set(this,{}),Sr.set(this,null),tt.set(this,void 0),Y(this,fe,i,"f"),Y(this,xn,e,"f"),Y(this,Yn,r,"f"),Y(this,_a,n,"f"),Y(this,lr,new ba(this),"f"),this.$0=this[Bh](),this[Nc](),Y(this,ot,h(this,ot,"f"),"f"),Y(this,ge,h(this,ge,"f"),"f"),Y(this,tt,h(this,tt,"f"),"f"),Y(this,re,h(this,re,"f"),"f"),h(this,re,"f").showHiddenOpt=h(this,Ca,"f"),Y(this,Zi,this[Ph](),"f")}addHelpOpt(e,r){let n="help";return H("[string|boolean] [string]",[e,r],arguments.length),h(this,cr,"f")&&(this[_c](h(this,cr,"f")),Y(this,cr,null,"f")),e===!1&&r===void 0?this:(Y(this,cr,typeof e=="string"?e:n,"f"),this.boolean(h(this,cr,"f")),this.describe(h(this,cr,"f"),r||h(this,ge,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(H("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:h(this,Ca,"f");return this.boolean(n),this.describe(n,r||h(this,ge,"f").deferY18nLookup("Show hidden options")),h(this,re,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return H("<object|string|array> [string|array]",[e,r],arguments.length),this[Ic](this.alias.bind(this),"alias",e,r),this}array(e){return H("<array|string>",[e],arguments.length),this[yn]("array",e),this[ii](e),this}boolean(e){return H("<array|string>",[e],arguments.length),this[yn]("boolean",e),this[ii](e),this}check(e,r){return H("<function> [boolean]",[e,r],arguments.length),this.middleware((n,i)=>Kn(()=>e(n,i.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&h(this,ge,"f").fail(o.toString(),o):h(this,ge,"f").fail(h(this,fe,"f").y18n.__("Argument check failed: %s",e.toString())),n),o=>(h(this,ge,"f").fail(o.message?o.message:o.toString(),o),n)),!1,r),this}choices(e,r){return H("<object|string|array> [string|array]",[e,r],arguments.length),this[Ic](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(H("<object|string|array> [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new $e("coerce callback must be provided");for(let n of e)this.coerce(n,r);return this}else if(typeof e=="object"){for(let n of Object.keys(e))this.coerce(n,e[n]);return this}if(!r)throw new $e("coerce callback must be provided");return h(this,re,"f").key[e]=!0,h(this,lr,"f").addCoerceMiddleware((n,i)=>{let o;return Object.prototype.hasOwnProperty.call(n,e)?Kn(()=>(o=i.getAliases(),r(n[e])),a=>{n[e]=a;let u=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(o[e]&&u!==!0)for(let l of o[e])n[l]=a;return n},a=>{throw new $e(a.message)}):n},e),this}conflicts(e,r){return H("<string|object> [string|array]",[e,r],arguments.length),h(this,tt,"f").conflicts(e,r),this}config(e="config",r,n){return H("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=fs(e,h(this,Yn,"f"),this[ri]()["deep-merge-config"]||!1,h(this,fe,"f")),h(this,re,"f").configObjects=(h(this,re,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||h(this,ge,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{h(this,re,"f").config[i]=n||!0}),this)}completion(e,r,n){return H("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Y(this,Xt,e||h(this,Xt,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(h(this,Xt,"f"),r),n&&h(this,ar,"f").registerFunction(n),this}command(e,r,n,i,o,s){return H("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,i,o,s],arguments.length),h(this,ot,"f").addHandler(e,r,n,i,o,s),this}commands(e,r,n,i,o,s){return this.command(e,r,n,i,o,s)}commandDir(e,r){H("<string> [object]",[e,r],arguments.length);let n=h(this,_a,"f")||h(this,fe,"f").require;return h(this,ot,"f").addDirectory(e,n,h(this,fe,"f").getCallerFile(),r),this}count(e){return H("<array|string>",[e],arguments.length),this[yn]("count",e),this[ii](e),this}default(e,r,n){return H("<object|string|array> [*] [string]",[e,r,n],arguments.length),n&&(Ec(e,h(this,fe,"f")),h(this,re,"f").defaultDescription[e]=n),typeof r=="function"&&(Ec(e,h(this,fe,"f")),h(this,re,"f").defaultDescription[e]||(h(this,re,"f").defaultDescription[e]=h(this,ge,"f").functionDescription(r)),r=r.call()),this[Ji](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,i){return H("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,i],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),h(this,re,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:i},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(i=>{Nt(n,!0,h(this,fe,"f")),this.demandOption(i,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(Nt(n,!0,h(this,fe,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(i=>{Nt(n,!0,h(this,fe,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return H("<object|string|array> [string]",[e,r],arguments.length),this[Ji](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return H("<string> [string|boolean]",[e,r],arguments.length),h(this,re,"f").deprecatedOptions[e]=r,this}describe(e,r){return H("<object|string|array> [string]",[e,r],arguments.length),this[Rc](e,!0),h(this,ge,"f").describe(e,r),this}detectLocale(e){return H("<boolean>",[e],arguments.length),Y(this,Zn,e,"f"),this}env(e){return H("[string|boolean]",[e],arguments.length),e===!1?delete h(this,re,"f").envPrefix:h(this,re,"f").envPrefix=e||"",this}epilogue(e){return H("<string>",[e],arguments.length),h(this,ge,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return H("<string|array> [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):h(this,ge,"f").example(e,r),this}exit(e,r){Y(this,Jt,!0,"f"),Y(this,gn,r,"f"),h(this,ur,"f")&&h(this,fe,"f").process.exit(e)}exitProcess(e=!0){return H("[boolean]",[e],arguments.length),Y(this,ur,e,"f"),this}fail(e){if(H("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new $e("Invalid first argument. Expected function or boolean 'false'");return h(this,ge,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return H("<array> [function]",[e,r],arguments.length),r?h(this,ar,"f").getCompletion(e,r):new Promise((n,i)=>{h(this,ar,"f").getCompletion(e,(o,s)=>{o?i(o):n(s)})})}getDemandedOptions(){return H([],0),h(this,re,"f").demandedOptions}getDemandedCommands(){return H([],0),h(this,re,"f").demandedCommands}getDeprecatedOptions(){return H([],0),h(this,re,"f").deprecatedOptions}getDetectLocale(){return h(this,Zn,"f")}getExitProcess(){return h(this,ur,"f")}getGroups(){return Object.assign({},h(this,_r,"f"),h(this,Jn,"f"))}getHelp(){if(Y(this,Jt,!0,"f"),!h(this,ge,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[ds](h(this,xn,"f"),void 0,void 0,0,!0);if(qe(r))return r.then(()=>h(this,ge,"f").help())}let e=h(this,ot,"f").runDefaultBuilderOn(this);if(qe(e))return e.then(()=>h(this,ge,"f").help())}return Promise.resolve(h(this,ge,"f").help())}getOptions(){return h(this,re,"f")}getStrict(){return h(this,Qn,"f")}getStrictCommands(){return h(this,ei,"f")}getStrictOptions(){return h(this,ti,"f")}global(e,r){return H("<string|array> [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?h(this,re,"f").local=h(this,re,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{h(this,re,"f").local.includes(n)||h(this,re,"f").local.push(n)}),this}group(e,r){H("<string|array> <string>",[e,r],arguments.length);let n=h(this,Jn,"f")[r]||h(this,_r,"f")[r];h(this,Jn,"f")[r]&&delete h(this,Jn,"f")[r];let i={};return h(this,_r,"f")[r]=(n||[]).concat(e).filter(o=>i[o]?!1:i[o]=!0),this}hide(e){return H("<string>",[e],arguments.length),h(this,re,"f").hiddenOptions.push(e),this}implies(e,r){return H("<string|object> [number|string|array]",[e,r],arguments.length),h(this,tt,"f").implies(e,r),this}locale(e){return H("[string]",[e],arguments.length),e===void 0?(this[Sc](),h(this,fe,"f").y18n.getLocale()):(Y(this,Zn,!1,"f"),h(this,fe,"f").y18n.setLocale(e),this)}middleware(e,r,n){return h(this,lr,"f").addMiddleware(e,!!r,n)}nargs(e,r){return H("<string|object|array> [number]",[e,r],arguments.length),this[Ji](this.nargs.bind(this),"narg",e,r),this}normalize(e){return H("<array|string>",[e],arguments.length),this[yn]("normalize",e),this}number(e){return H("<array|string>",[e],arguments.length),this[yn]("number",e),this[ii](e),this}option(e,r){if(H("<string|object> [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[ii](e),h(this,Sr,"f")&&(e==="version"||r?.alias==="version")&&this[Lh](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
|
67
|
+
`),void 0,"versionWarning"),h(this,re,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);let i=r.demand||r.required||r.require;i&&this.demand(e,i),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global=="boolean"&&this.global(e,r.global),r.defaultDescription&&(h(this,re,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let o=r.describe||r.description||r.desc,s=h(this,ge,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(s,e)||typeof o=="string")&&this.describe(e,o),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){H("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[Mh](),typeof e>"u"&&(e=h(this,xn,"f")),typeof r=="object"&&(Y(this,Xn,r,"f"),r=n),typeof r=="function"&&(Y(this,Qt,r,"f"),r=!1),r||Y(this,xn,e,"f"),h(this,Qt,"f")&&Y(this,ur,!1,"f");let i=this[ds](e,!!r),o=this.parsed;return h(this,ar,"f").setParsed(this.parsed),qe(i)?i.then(s=>(h(this,Qt,"f")&&h(this,Qt,"f").call(this,h(this,gn,"f"),s,h(this,Ct,"f")),s)).catch(s=>{throw h(this,Qt,"f")&&h(this,Qt,"f")(s,this.parsed.argv,h(this,Ct,"f")),s}).finally(()=>{this[Fc](),this.parsed=o}):(h(this,Qt,"f")&&h(this,Qt,"f").call(this,h(this,gn,"f"),i,h(this,Ct,"f")),this[Fc](),this.parsed=o,i)}parseAsync(e,r,n){let i=this.parse(e,r,n);return qe(i)?i:Promise.resolve(i)}parseSync(e,r,n){let i=this.parse(e,r,n);if(qe(i))throw new $e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return H("<object>",[e],arguments.length),Y(this,Sa,e,"f"),this}pkgConf(e,r){H("<string> [string]",[e,r],arguments.length);let n=null,i=this[vc](r||h(this,Yn,"f"));return i[e]&&typeof i[e]=="object"&&(n=fs(i[e],r||h(this,Yn,"f"),this[ri]()["deep-merge-config"]||!1,h(this,fe,"f")),h(this,re,"f").configObjects=(h(this,re,"f").configObjects||[]).concat(n)),this}positional(e,r){H("<string> <object>",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=hn(r,(s,a)=>s==="type"&&!["string","number","boolean"].includes(a)?!1:n.includes(s));let i=h(this,ps,"f").fullCommands[h(this,ps,"f").fullCommands.length-1],o=i?h(this,ot,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return Ki(o).forEach(s=>{let a=o[s];Array.isArray(a)?a.indexOf(e)!==-1&&(r[s]=!0):a[e]&&!(s in r)&&(r[s]=a[e])}),this.group(e,h(this,ge,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return H("[boolean]",[e],arguments.length),Y(this,va,e,"f"),this}required(e,r,n){return this.demand(e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return H("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&h(this,re,"f").narg[e]?this:(this[Ji](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return H("[string] [string]",[e,r],arguments.length),e=e||this.$0,h(this,Zi,"f").log(h(this,ar,"f").generateCompletionScript(e,r||h(this,Xt,"f")||"completion")),this}showHelp(e){if(H("[string|function]",[e],arguments.length),Y(this,Jt,!0,"f"),!h(this,ge,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[ds](h(this,xn,"f"),void 0,void 0,0,!0);if(qe(n))return n.then(()=>{h(this,ge,"f").showHelp(e)}),this}let r=h(this,ot,"f").runDefaultBuilderOn(this);if(qe(r))return r.then(()=>{h(this,ge,"f").showHelp(e)}),this}return h(this,ge,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return H("[boolean|string] [string]",[e,r],arguments.length),h(this,ge,"f").showHelpOnFail(e,r),this}showVersion(e){return H("[string|function]",[e],arguments.length),h(this,ge,"f").showVersion(e),this}skipValidation(e){return H("<array|string>",[e],arguments.length),this[yn]("skipValidation",e),this}strict(e){return H("[boolean]",[e],arguments.length),Y(this,Qn,e!==!1,"f"),this}strictCommands(e){return H("[boolean]",[e],arguments.length),Y(this,ei,e!==!1,"f"),this}strictOptions(e){return H("[boolean]",[e],arguments.length),Y(this,ti,e!==!1,"f"),this}string(e){return H("<array|string>",[e],arguments.length),this[yn]("string",e),this[ii](e),this}terminalWidth(){return H([],0),h(this,fe,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return H("<object>",[e],arguments.length),Y(this,Zn,!1,"f"),h(this,fe,"f").y18n.updateLocale(e),this}usage(e,r,n,i){if(H("<string|null|undefined> [string|boolean] [function|object] [function]",[e,r,n,i],arguments.length),r!==void 0){if(Nt(e,null,h(this,fe,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,i);throw new $e(".usage() description must start with $0 if being used as alias for .command()")}else return h(this,ge,"f").usage(e),this}usageConfiguration(e){return H("<object>",[e],arguments.length),Y(this,Ia,e,"f"),this}version(e,r,n){let i="version";if(H("[boolean|string] [string] [string]",[e,r,n],arguments.length),h(this,Sr,"f")&&(this[_c](h(this,Sr,"f")),h(this,ge,"f").version(void 0),Y(this,Sr,null,"f")),arguments.length===0)n=this[Uh](),e=i;else if(arguments.length===1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=r,r=void 0);return Y(this,Sr,typeof e=="string"?e:i,"f"),r=r||h(this,ge,"f").deferY18nLookup("Show version number"),h(this,ge,"f").version(n||void 0),this.boolean(h(this,Sr,"f")),this.describe(h(this,Sr,"f"),r),this}wrap(e){return H("<number|null|undefined>",[e],arguments.length),h(this,ge,"f").wrap(e),this}[(ot=new WeakMap,Yn=new WeakMap,ps=new WeakMap,ar=new WeakMap,Xt=new WeakMap,Ca=new WeakMap,gn=new WeakMap,Zn=new WeakMap,wa=new WeakMap,ur=new WeakMap,ka=new WeakMap,lr=new WeakMap,_r=new WeakMap,Jt=new WeakMap,cr=new WeakMap,Ta=new WeakMap,Zi=new WeakMap,Ct=new WeakMap,re=new WeakMap,_a=new WeakMap,Sa=new WeakMap,Qt=new WeakMap,Xn=new WeakMap,Xi=new WeakMap,Jn=new WeakMap,xn=new WeakMap,va=new WeakMap,fe=new WeakMap,Qn=new WeakMap,ei=new WeakMap,ti=new WeakMap,ge=new WeakMap,Ia=new WeakMap,Sr=new WeakMap,tt=new WeakMap,Nh)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Ph](){return{log:(...e)=>{this[Oa]()||console.log(...e),Y(this,Jt,!0,"f"),h(this,Ct,"f").length&&Y(this,Ct,h(this,Ct,"f")+`
|
|
68
68
|
`,"f"),Y(this,Ct,h(this,Ct,"f")+e.join(" "),"f")},error:(...e)=>{this[Oa]()||console.error(...e),Y(this,Jt,!0,"f"),h(this,Ct,"f").length&&Y(this,Ct,h(this,Ct,"f")+`
|
|
69
|
-
`,"f"),Y(this,Ct,h(this,Ct,"f")+e.join(" "),"f")}}}[Tc](e){Ki(h(this,re,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;let n=h(this,re,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete h(this,ge,"f").getDescriptions()[e]}[Lh](e,r,n){h(this,wa,"f")[n]||(h(this,fe,"f").process.emitWarning(e,r),h(this,wa,"f")[n]=!0)}[Mh](){h(this,ka,"f").push({options:h(this,re,"f"),configObjects:h(this,re,"f").configObjects.slice(0),exitProcess:h(this,ur,"f"),groups:h(this,_r,"f"),strict:h(this,Qn,"f"),strictCommands:h(this,ei,"f"),strictOptions:h(this,ti,"f"),completionCommand:h(this,Xt,"f"),output:h(this,Ct,"f"),exitError:h(this,gn,"f"),hasOutput:h(this,Jt,"f"),parsed:this.parsed,parseFn:h(this,Qt,"f"),parseContext:h(this,Xn,"f")}),h(this,ge,"f").freeze(),h(this,tt,"f").freeze(),h(this,ot,"f").freeze(),h(this,lr,"f").freeze()}[Bh](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(h(this,fe,"f").process.argv()[0])?r=h(this,fe,"f").process.argv().slice(1,2):r=h(this,fe,"f").process.argv().slice(0,1),e=r.map(n=>{let i=this[Xh](h(this,Yn,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),h(this,fe,"f").getEnv("_")&&h(this,fe,"f").getProcessArgvBin()===h(this,fe,"f").getEnv("_")&&(e=h(this,fe,"f").getEnv("_").replace(`${h(this,fe,"f").path.dirname(h(this,fe,"f").process.execPath())}/`,"")),e}[ri](){return h(this,Sa,"f")}[jh](){return h(this,Ia,"f")}[_c](){if(!h(this,Zn,"f"))return;let e=h(this,fe,"f").getEnv("LC_ALL")||h(this,fe,"f").getEnv("LC_MESSAGES")||h(this,fe,"f").getEnv("LANG")||h(this,fe,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Uh](){return this[Sc]().version||"unknown"}[zh](e){let r=e["--"]?e["--"]:e._;for(let n=0,i;(i=r[n])!==void 0;n++)h(this,fe,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return e}[Sc](e){let r=e||"*";if(h(this,Xi,"f")[r])return h(this,Xi,"f")[r];let n={};try{let i=e||h(this,fe,"f").mainFilename;!e&&h(this,fe,"f").path.extname(i)&&(i=h(this,fe,"f").path.dirname(i));let o=h(this,fe,"f").findUp(i,(s,a)=>{if(a.includes("package.json"))return"package.json"});Nt(o,void 0,h(this,fe,"f")),n=JSON.parse(h(this,fe,"f").readFileSync(o,"utf8"))}catch{}return h(this,Xi,"f")[r]=n||{},h(this,Xi,"f")[r]}[yn](e,r){r=[].concat(r),r.forEach(n=>{n=this[Oc](n),h(this,re,"f")[e].push(n)})}[Ji](e,r,n,i){this[Ic](e,r,n,i,(o,s,a)=>{h(this,re,"f")[o][s]=a})}[vc](e,r,n,i){this[Ic](e,r,n,i,(o,s,a)=>{h(this,re,"f")[o][s]=(h(this,re,"f")[o][s]||[]).concat(a)})}[Ic](e,r,n,i,o){if(Array.isArray(n))n.forEach(s=>{e(s,i)});else if((s=>typeof s=="object")(n))for(let s of Ki(n))e(s,n[s]);else o(r,this[Oc](n),i)}[Oc](e){return e==="__proto__"?"___proto___":e}[Dc](e,r){return this[Ji](this[Dc].bind(this),"key",e,r),this}[Rc](){var e,r,n,i,o,s,a,u,l,c,f,p;let d=h(this,ka,"f").pop();Nt(d,void 0,h(this,fe,"f"));let m;e=this,r=this,n=this,i=this,o=this,s=this,a=this,u=this,l=this,c=this,f=this,p=this,{options:{set value(y){Y(e,re,y,"f")}}.value,configObjects:m,exitProcess:{set value(y){Y(r,ur,y,"f")}}.value,groups:{set value(y){Y(n,_r,y,"f")}}.value,output:{set value(y){Y(i,Ct,y,"f")}}.value,exitError:{set value(y){Y(o,gn,y,"f")}}.value,hasOutput:{set value(y){Y(s,Jt,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Y(a,Qn,y,"f")}}.value,strictCommands:{set value(y){Y(u,ei,y,"f")}}.value,strictOptions:{set value(y){Y(l,ti,y,"f")}}.value,completionCommand:{set value(y){Y(c,Xt,y,"f")}}.value,parseFn:{set value(y){Y(f,Qt,y,"f")}}.value,parseContext:{set value(y){Y(p,Xn,y,"f")}}.value}=d,h(this,re,"f").configObjects=m,h(this,ge,"f").unfreeze(),h(this,tt,"f").unfreeze(),h(this,ot,"f").unfreeze(),h(this,lr,"f").unfreeze()}[$h](e,r){return Kn(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[qh].bind(this),getContext:this[Vh].bind(this),getHasOutput:this[Gh].bind(this),getLoggerInstance:this[Wh].bind(this),getParseContext:this[Hh].bind(this),getParserConfiguration:this[ri].bind(this),getUsageConfiguration:this[jh].bind(this),getUsageInstance:this[Kh].bind(this),getValidationInstance:this[Yh].bind(this),hasParseCallback:this[Oa].bind(this),isGlobalContext:this[Zh].bind(this),postProcess:this[ni].bind(this),reset:this[Fc].bind(this),runValidation:this[Nc].bind(this),runYargsParserAndExecuteCommands:this[ds].bind(this),setHasOutput:this[Jh].bind(this)}}[qh](){return h(this,ot,"f")}[Vh](){return h(this,ps,"f")}[Gh](){return h(this,Jt,"f")}[Wh](){return h(this,Zi,"f")}[Hh](){return h(this,Xn,"f")||{}}[Kh](){return h(this,ge,"f")}[Yh](){return h(this,tt,"f")}[Oa](){return!!h(this,Qt,"f")}[Zh](){return h(this,Ta,"f")}[ni](e,r,n,i){return n||qe(e)||(r||(e=this[Nh](e)),(this[ri]()["parse-positional-numbers"]||this[ri]()["parse-positional-numbers"]===void 0)&&(e=this[zh](e)),i&&(e=Hn(e,this,h(this,lr,"f").getMiddleware(),!1))),e}[Fc](e={}){Y(this,re,h(this,re,"f")||{},"f");let r={};r.local=h(this,re,"f").local||[],r.configObjects=h(this,re,"f").configObjects||[];let n={};r.local.forEach(s=>{n[s]=!0,(e[s]||[]).forEach(a=>{n[a]=!0})}),Object.assign(h(this,Jn,"f"),Object.keys(h(this,_r,"f")).reduce((s,a)=>{let u=h(this,_r,"f")[a].filter(l=>!(l in n));return u.length>0&&(s[a]=u),s},{})),Y(this,_r,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(s=>{r[s]=(h(this,re,"f")[s]||[]).filter(a=>!n[a])}),o.forEach(s=>{r[s]=hn(h(this,re,"f")[s],a=>!n[a])}),r.envPrefix=h(this,re,"f").envPrefix,Y(this,re,r,"f"),Y(this,ge,h(this,ge,"f")?h(this,ge,"f").reset(n):_h(this,h(this,fe,"f")),"f"),Y(this,tt,h(this,tt,"f")?h(this,tt,"f").reset(n):Rh(this,h(this,ge,"f"),h(this,fe,"f")),"f"),Y(this,ot,h(this,ot,"f")?h(this,ot,"f").reset():wh(h(this,ge,"f"),h(this,tt,"f"),h(this,lr,"f"),h(this,fe,"f")),"f"),h(this,ar,"f")||Y(this,ar,Ih(this,h(this,ge,"f"),h(this,ot,"f"),h(this,fe,"f")),"f"),h(this,lr,"f").reset(),Y(this,Xt,null,"f"),Y(this,Ct,"","f"),Y(this,gn,null,"f"),Y(this,Jt,!1,"f"),this.parsed=!1,this}[Xh](e,r){return h(this,fe,"f").path.relative(e,r)}[ds](e,r,n,i=0,o=!1){let s=!!n||o;e=e||h(this,xn,"f"),h(this,re,"f").__=h(this,fe,"f").y18n.__,h(this,re,"f").configuration=this[ri]();let a=!!h(this,re,"f").configuration["populate--"],u=Object.assign({},h(this,re,"f").configuration,{"populate--":!0}),l=h(this,fe,"f").Parser.detailed(e,Object.assign({},h(this,re,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),c=Object.assign(l.argv,h(this,Xn,"f")),f,p=l.aliases,d=!1,m=!1;Object.keys(c).forEach(y=>{y===h(this,cr,"f")&&c[y]?d=!0:y===h(this,Sr,"f")&&c[y]&&(m=!0)}),c.$0=this.$0,this.parsed=l,i===0&&h(this,ge,"f").clearCachedHelpMessage();try{if(this[_c](),r)return this[ni](c,a,!!n,!1);h(this,cr,"f")&&[h(this,cr,"f")].concat(p[h(this,cr,"f")]||[]).filter(C=>C.length>1).includes(""+c._[c._.length-1])&&(c._.pop(),d=!0),Y(this,Ta,!1,"f");let y=h(this,ot,"f").getCommands(),g=h(this,ar,"f").completionKey in c,b=d||g||o;if(c._.length){if(y.length){let w;for(let C=i||0,D;c._[C]!==void 0;C++)if(D=String(c._[C]),y.includes(D)&&D!==h(this,Xt,"f")){let R=h(this,ot,"f").runCommand(D,this,l,C+1,o,d||m||o);return this[ni](R,a,!!n,!1)}else if(!w&&D!==h(this,Xt,"f")){w=D;break}!h(this,ot,"f").hasDefaultCommand()&&h(this,va,"f")&&w&&!b&&h(this,tt,"f").recommendCommands(w,y)}h(this,Xt,"f")&&c._.includes(h(this,Xt,"f"))&&!g&&(h(this,ur,"f")&&mn(!0),this.showCompletionScript(),this.exit(0))}if(h(this,ot,"f").hasDefaultCommand()&&!b){let w=h(this,ot,"f").runCommand(null,this,l,0,o,d||m||o);return this[ni](w,a,!!n,!1)}if(g){h(this,ur,"f")&&mn(!0),e=[].concat(e);let w=e.slice(e.indexOf(`--${h(this,ar,"f").completionKey}`)+1);return h(this,ar,"f").getCompletion(w,(C,D)=>{if(C)throw new $e(C.message);(D||[]).forEach(R=>{h(this,Zi,"f").log(R)}),this.exit(0)}),this[ni](c,!a,!!n,!1)}if(h(this,Jt,"f")||(d?(h(this,ur,"f")&&mn(!0),s=!0,this.showHelp("log"),this.exit(0)):m&&(h(this,ur,"f")&&mn(!0),s=!0,h(this,ge,"f").showVersion("log"),this.exit(0))),!s&&h(this,re,"f").skipValidation.length>0&&(s=Object.keys(c).some(w=>h(this,re,"f").skipValidation.indexOf(w)>=0&&c[w]===!0)),!s){if(l.error)throw new $e(l.error.message);if(!g){let w=this[Nc](p,{},l.error);n||(f=Hn(c,this,h(this,lr,"f").getMiddleware(),!0)),f=this[$h](w,f??c),qe(f)&&!n&&(f=f.then(()=>Hn(c,this,h(this,lr,"f").getMiddleware(),!1)))}}}catch(y){if(y instanceof $e)h(this,ge,"f").fail(y.message,y);else throw y}return this[ni](f??c,a,!!n,!0)}[Nc](e,r,n,i){let o={...this.getDemandedOptions()};return s=>{if(n)throw new $e(n.message);h(this,tt,"f").nonOptionCount(s),h(this,tt,"f").requiredArguments(s,o);let a=!1;h(this,ei,"f")&&(a=h(this,tt,"f").unknownCommands(s)),h(this,Qn,"f")&&!a?h(this,tt,"f").unknownArguments(s,e,r,!!i):h(this,ti,"f")&&h(this,tt,"f").unknownArguments(s,e,{},!1,!1),h(this,tt,"f").limitedChoices(s),h(this,tt,"f").implications(s),h(this,tt,"f").conflicting(s)}}[Jh](){Y(this,Jt,!0,"f")}[ii](e){if(typeof e=="string")h(this,re,"f").key[e]=!0;else for(let r of e)h(this,re,"f").key[r]=!0}};function kh(t){return!!t&&typeof t.getInternalMethods=="function"}var uk=Qh(yc),em=uk;var tm="0.9.0";import{cosmiconfig as wm}from"cosmiconfig";import{TypeScriptLoader as km}from"cosmiconfig-typescript-loader";import RT from"node:fs/promises";import Sm from"node:path";var Lc=jd(im(),1);function Mc(t,e,r){if(typeof e=="number"&&(r=e),Lc.default.has(t.toLowerCase())){e=Lc.default.get(t.toLowerCase());let n=t.charAt(0);n===n.toUpperCase()&&(e=n+e.slice(1)),t===t.toUpperCase()&&(e=e.toUpperCase())}else typeof e!="string"&&(e=(t.replace(/(?:s|x|z|ch|sh)$/i,"$&e").replace(/([^aeiou])y$/i,"$1ie")+"s").replace(/i?e?s$/i,n=>t.slice(-1)===t.slice(-1).toLowerCase()?n.toLowerCase():n.toUpperCase()));return Math.abs(r)===1?t:e}import{readPackage as FT}from"read-pkg";import{deepMergeDefined as Kc,log as dr,optionsSchema as NT,rulesSchema as PT}from"remark-mdat";var Oe;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Oe||(Oe={}));var jc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(jc||(jc={}));var V=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xr=t=>{switch(typeof t){case"undefined":return V.undefined;case"string":return V.string;case"number":return isNaN(t)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(t)?V.array:t===null?V.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?V.promise:typeof Map<"u"&&t instanceof Map?V.map:typeof Set<"u"&&t instanceof Set?V.set:typeof Date<"u"&&t instanceof Date?V.date:V.object;default:return V.unknown}},N=Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),pk=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),er=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(o){return o.message},n={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,u=0;for(;u<s.path.length;){let l=s.path[u];u===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(s))):a[l]=a[l]||{_errors:[]},a=a[l],u++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};er.create=t=>new er(t);var to=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===V.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Oe.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${Oe.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Oe.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${Oe.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Oe.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case N.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,Oe.assertNever(t)}return{message:r}},am=to;function dk(t){am=t}function Da(){return am}var Ra=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)a=l(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},hk=[];function U(t,e){let r=Da(),n=Ra({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===to?void 0:to].filter(i=>!!i)});t.common.issues.push(n)}var vt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return pe;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return pe;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}},pe=Object.freeze({status:"aborted"}),eo=t=>({status:"dirty",value:t}),Pt=t=>({status:"valid",value:t}),Uc=t=>t.status==="aborted",zc=t=>t.status==="dirty",oi=t=>t.status==="valid",gs=t=>typeof Promise<"u"&&t instanceof Promise;function Fa(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function um(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var Q;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Q||(Q={}));var hs,ms,pr=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},om=(t,e)=>{if(oi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new er(t.common.issues);return this._error=r,this._error}}};function Ae(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{var u,l;let{message:c}=t;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(u=c??n)!==null&&u!==void 0?u:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:a.defaultError}},description:i}}var Ce=class{get description(){return this._def.description}_getType(e){return Xr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Xr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:Xr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(gs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xr(e)},o=this._parseSync({data:e,path:i.path,parent:i});return om(i,o)}"~validate"(e){var r,n;let i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xr(e)};if(!this["~standard"].async)try{let o=this._parseSync({data:e,path:[],parent:i});return oi(o)?{value:o.value}:{issues:i.common.issues}}catch(o){!((n=(r=o?.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(o=>oi(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xr(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(gs(i)?i:Promise.resolve(i));return om(n,o)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:N.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new tr({schema:this,typeName:le.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return fr.create(this,this._def)}nullable(){return Ir.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qr.create(this)}promise(){return An.create(this,this._def)}or(e){return pi.create([this,e],this._def)}and(e){return di.create(this,e,this._def)}transform(e){return new tr({...Ae(this._def),schema:this,typeName:le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new yi({...Ae(this._def),innerType:this,defaultValue:r,typeName:le.ZodDefault})}brand(){return new xs({typeName:le.ZodBranded,type:this,...Ae(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new bi({...Ae(this._def),innerType:this,catchValue:r,typeName:le.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ys.create(this,e)}readonly(){return Ei.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},mk=/^c[^\s-]{8,}$/i,gk=/^[0-9a-z]+$/,xk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,yk=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,bk=/^[a-z0-9_-]{21}$/i,Ek=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ak=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ck=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,wk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Bc,kk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Tk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,_k=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Sk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,vk=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ik=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lm="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Ok=new RegExp(`^${lm}$`);function cm(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Dk(t){return new RegExp(`^${cm(t)}$`)}function fm(t){let e=`${lm}T${cm(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Rk(t,e){return!!((e==="v4"||!e)&&kk.test(t)||(e==="v6"||!e)&&_k.test(t))}function Fk(t,e){if(!Ek.test(t))return!1;try{let[r]=t.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function Nk(t,e){return!!((e==="v4"||!e)&&Tk.test(t)||(e==="v6"||!e)&&Sk.test(t))}var bn=class t extends Ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.string,received:o.parsedType}),pe}let n=new vt,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?U(i,{code:N.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&U(i,{code:N.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Ck.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"email",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Bc||(Bc=new RegExp(wk,"u")),Bc.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"emoji",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")yk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"uuid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")bk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"nanoid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")mk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")gk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid2",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")xk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ulid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),U(i,{validation:"url",code:N.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"regex",code:N.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?fm(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Ok.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Dk(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Ak.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"duration",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Rk(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ip",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Fk(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"jwt",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Nk(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cidr",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?vk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?Ik.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64url",code:N.invalid_string,message:o.message}),n.dirty()):Oe.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:N.invalid_string,...Q.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Q.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Q.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Q.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Q.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Q.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Q.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Q.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Q.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Q.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Q.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Q.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Q.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Q.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...Q.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Q.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Q.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Q.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Q.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Q.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Q.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Q.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Q.errToObj(r)})}nonempty(e){return this.min(1,Q.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};bn.create=t=>{var e;return new bn({checks:[],typeName:le.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};function Pk(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,o=parseInt(t.toFixed(i).replace(".","")),s=parseInt(e.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}var si=class t extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==V.number){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.number,received:o.parsedType}),pe}let n,i=new vt;for(let o of this._def.checks)o.kind==="int"?Oe.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:N.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Pk(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_finite,message:o.message}),i.dirty()):Oe.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Q.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Q.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Oe.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};si.create=t=>new si({checks:[],typeName:le.ZodNumber,coerce:t?.coerce||!1,...Ae(t)});var ai=class t extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==V.bigint)return this._getInvalidInput(e);let n,i=new vt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Oe.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:V.bigint,received:r.parsedType}),pe}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ai.create=t=>{var e;return new ai({checks:[],typeName:le.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};var ui=class extends Ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.boolean,received:n.parsedType}),pe}return Pt(e.data)}};ui.create=t=>new ui({typeName:le.ZodBoolean,coerce:t?.coerce||!1,...Ae(t)});var li=class t extends Ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.date,received:o.parsedType}),pe}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_date}),pe}let n=new vt,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Oe.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Q.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Q.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};li.create=t=>new li({checks:[],coerce:t?.coerce||!1,typeName:le.ZodDate,...Ae(t)});var ro=class extends Ce{_parse(e){if(this._getType(e)!==V.symbol){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.symbol,received:n.parsedType}),pe}return Pt(e.data)}};ro.create=t=>new ro({typeName:le.ZodSymbol,...Ae(t)});var ci=class extends Ce{_parse(e){if(this._getType(e)!==V.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.undefined,received:n.parsedType}),pe}return Pt(e.data)}};ci.create=t=>new ci({typeName:le.ZodUndefined,...Ae(t)});var fi=class extends Ce{_parse(e){if(this._getType(e)!==V.null){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.null,received:n.parsedType}),pe}return Pt(e.data)}};fi.create=t=>new fi({typeName:le.ZodNull,...Ae(t)});var En=class extends Ce{constructor(){super(...arguments),this._any=!0}_parse(e){return Pt(e.data)}};En.create=t=>new En({typeName:le.ZodAny,...Ae(t)});var Jr=class extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Pt(e.data)}};Jr.create=t=>new Jr({typeName:le.ZodUnknown,...Ae(t)});var Er=class extends Ce{_parse(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:V.never,received:r.parsedType}),pe}};Er.create=t=>new Er({typeName:le.ZodNever,...Ae(t)});var no=class extends Ce{_parse(e){if(this._getType(e)!==V.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.void,received:n.parsedType}),pe}return Pt(e.data)}};no.create=t=>new no({typeName:le.ZodVoid,...Ae(t)});var Qr=class t extends Ce{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==V.array)return U(r,{code:N.invalid_type,expected:V.array,received:r.parsedType}),pe;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(s||a)&&(U(r,{code:s?N.too_big:N.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(U(r,{code:N.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(U(r,{code:N.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>i.type._parseAsync(new pr(r,s,r.path,a)))).then(s=>vt.mergeArray(n,s));let o=[...r.data].map((s,a)=>i.type._parseSync(new pr(r,s,r.path,a)));return vt.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Q.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Q.toString(r)}})}nonempty(e){return this.min(1,e)}};Qr.create=(t,e)=>new Qr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:le.ZodArray,...Ae(e)});function Qi(t){if(t instanceof Vt){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=fr.create(Qi(n))}return new Vt({...t._def,shape:()=>e})}else return t instanceof Qr?new Qr({...t._def,type:Qi(t.element)}):t instanceof fr?fr.create(Qi(t.unwrap())):t instanceof Ir?Ir.create(Qi(t.unwrap())):t instanceof vr?vr.create(t.items.map(e=>Qi(e))):t}var Vt=class t extends Ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Oe.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==V.object){let l=this._getOrReturnCtx(e);return U(l,{code:N.invalid_type,expected:V.object,received:l.parsedType}),pe}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Er&&this._def.unknownKeys==="strip"))for(let l in i.data)s.includes(l)||a.push(l);let u=[];for(let l of s){let c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new pr(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Er){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of a)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")a.length>0&&(U(i,{code:N.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of a){let f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new pr(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let f=await c.key,p=await c.value;l.push({key:f,value:p,alwaysSet:c.alwaysSet})}return l}).then(l=>vt.mergeObjectSync(n,l)):vt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return Q.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,o,s,a;let u=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,r,n).message)!==null&&s!==void 0?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Q.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:le.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return Oe.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return Qi(this)}partial(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof fr;)o=o._def.innerType;r[n]=o}}),new t({...this._def,shape:()=>r})}keyof(){return pm(Oe.objectKeys(this.shape))}};Vt.create=(t,e)=>new Vt({shape:()=>t,unknownKeys:"strip",catchall:Er.create(),typeName:le.ZodObject,...Ae(e)});Vt.strictCreate=(t,e)=>new Vt({shape:()=>t,unknownKeys:"strict",catchall:Er.create(),typeName:le.ZodObject,...Ae(e)});Vt.lazycreate=(t,e)=>new Vt({shape:t,unknownKeys:"strip",catchall:Er.create(),typeName:le.ZodObject,...Ae(e)});var pi=class extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new er(a.ctx.common.issues));return U(r,{code:N.invalid_union,unionErrors:s}),pe}if(r.common.async)return Promise.all(n.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let u of n){let l={...r,common:{...r.common,issues:[]},parent:null},c=u._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(u=>new er(u));return U(r,{code:N.invalid_union,unionErrors:a}),pe}}get options(){return this._def.options}};pi.create=(t,e)=>new pi({options:t,typeName:le.ZodUnion,...Ae(e)});var Zr=t=>t instanceof hi?Zr(t.schema):t instanceof tr?Zr(t.innerType()):t instanceof mi?[t.value]:t instanceof gi?t.options:t instanceof xi?Oe.objectValues(t.enum):t instanceof yi?Zr(t._def.innerType):t instanceof ci?[void 0]:t instanceof fi?[null]:t instanceof fr?[void 0,...Zr(t.unwrap())]:t instanceof Ir?[null,...Zr(t.unwrap())]:t instanceof xs||t instanceof Ei?Zr(t.unwrap()):t instanceof bi?Zr(t._def.innerType):[],Na=class t extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.object)return U(r,{code:N.invalid_type,expected:V.object,received:r.parsedType}),pe;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(U(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let o of r){let s=Zr(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:le.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Ae(n)})}};function $c(t,e){let r=Xr(t),n=Xr(e);if(t===e)return{valid:!0,data:t};if(r===V.object&&n===V.object){let i=Oe.objectKeys(e),o=Oe.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let u=$c(t[a],e[a]);if(!u.valid)return{valid:!1};s[a]=u.data}return{valid:!0,data:s}}else if(r===V.array&&n===V.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],u=$c(s,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===V.date&&n===V.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var di=class extends Ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(o,s)=>{if(Uc(o)||Uc(s))return pe;let a=$c(o.value,s.value);return a.valid?((zc(o)||zc(s))&&r.dirty(),{status:r.value,value:a.data}):(U(n,{code:N.invalid_intersection_types}),pe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};di.create=(t,e,r)=>new di({left:t,right:e,typeName:le.ZodIntersection,...Ae(r)});var vr=class t extends Ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.array)return U(n,{code:N.invalid_type,expected:V.array,received:n.parsedType}),pe;if(n.data.length<this._def.items.length)return U(n,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&n.data.length>this._def.items.length&&(U(n,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new pr(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>vt.mergeArray(r,s)):vt.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};vr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vr({items:t,typeName:le.ZodTuple,rest:null,...Ae(e)})};var Pa=class t extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.object)return U(n,{code:N.invalid_type,expected:V.object,received:n.parsedType}),pe;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in n.data)i.push({key:o._parse(new pr(n,a,n.path,a)),value:s._parse(new pr(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?vt.mergeObjectAsync(r,i):vt.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Ce?new t({keyType:e,valueType:r,typeName:le.ZodRecord,...Ae(n)}):new t({keyType:bn.create(),valueType:e,typeName:le.ZodRecord,...Ae(r)})}},io=class extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.map)return U(n,{code:N.invalid_type,expected:V.map,received:n.parsedType}),pe;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,u],l)=>({key:i._parse(new pr(n,a,n.path,[l,"key"])),value:o._parse(new pr(n,u,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of s){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return pe;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of s){let l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return pe;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}}}};io.create=(t,e,r)=>new io({valueType:e,keyType:t,typeName:le.ZodMap,...Ae(r)});var oo=class t extends Ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.set)return U(n,{code:N.invalid_type,expected:V.set,received:n.parsedType}),pe;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(U(n,{code:N.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(U(n,{code:N.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function s(u){let l=new Set;for(let c of u){if(c.status==="aborted")return pe;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((u,l)=>o._parse(new pr(n,u,n.path,l)));return n.common.async?Promise.all(a).then(u=>s(u)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Q.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};oo.create=(t,e)=>new oo({valueType:t,minSize:null,maxSize:null,typeName:le.ZodSet,...Ae(e)});var La=class t extends Ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.function)return U(r,{code:N.invalid_type,expected:V.function,received:r.parsedType}),pe;function n(a,u){return Ra({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Da(),to].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:u}})}function i(a,u){return Ra({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Da(),to].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:u}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof An){let a=this;return Pt(async function(...u){let l=new er([]),c=await a._def.args.parseAsync(u,o).catch(d=>{throw l.addIssue(n(u,d)),l}),f=await Reflect.apply(s,this,c);return await a._def.returns._def.type.parseAsync(f,o).catch(d=>{throw l.addIssue(i(f,d)),l})})}else{let a=this;return Pt(function(...u){let l=a._def.args.safeParse(u,o);if(!l.success)throw new er([n(u,l.error)]);let c=Reflect.apply(s,this,l.data),f=a._def.returns.safeParse(c,o);if(!f.success)throw new er([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:vr.create(e).rest(Jr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||vr.create([]).rest(Jr.create()),returns:r||Jr.create(),typeName:le.ZodFunction,...Ae(n)})}},hi=class extends Ce{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};hi.create=(t,e)=>new hi({getter:t,typeName:le.ZodLazy,...Ae(e)});var mi=class extends Ce{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return U(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}};mi.create=(t,e)=>new mi({value:t,typeName:le.ZodLiteral,...Ae(e)});function pm(t,e){return new gi({values:t,typeName:le.ZodEnum,...Ae(e)})}var gi=class t extends Ce{constructor(){super(...arguments),hs.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{expected:Oe.joinValues(n),received:r.parsedType,code:N.invalid_type}),pe}if(Fa(this,hs,"f")||um(this,hs,new Set(this._def.values),"f"),!Fa(this,hs,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{received:r.data,code:N.invalid_enum_value,options:n}),pe}return Pt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};hs=new WeakMap;gi.create=pm;var xi=class extends Ce{constructor(){super(...arguments),ms.set(this,void 0)}_parse(e){let r=Oe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==V.string&&n.parsedType!==V.number){let i=Oe.objectValues(r);return U(n,{expected:Oe.joinValues(i),received:n.parsedType,code:N.invalid_type}),pe}if(Fa(this,ms,"f")||um(this,ms,new Set(Oe.getValidEnumValues(this._def.values)),"f"),!Fa(this,ms,"f").has(e.data)){let i=Oe.objectValues(r);return U(n,{received:n.data,code:N.invalid_enum_value,options:i}),pe}return Pt(e.data)}get enum(){return this._def.values}};ms=new WeakMap;xi.create=(t,e)=>new xi({values:t,typeName:le.ZodNativeEnum,...Ae(e)});var An=class extends Ce{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.promise&&r.common.async===!1)return U(r,{code:N.invalid_type,expected:V.promise,received:r.parsedType}),pe;let n=r.parsedType===V.promise?r.data:Promise.resolve(r.data);return Pt(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};An.create=(t,e)=>new An({type:t,typeName:le.ZodPromise,...Ae(e)});var tr=class extends Ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{U(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return pe;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?pe:u.status==="dirty"||r.value==="dirty"?eo(u.value):u});{if(r.value==="aborted")return pe;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?pe:a.status==="dirty"||r.value==="dirty"?eo(a.value):a}}if(i.type==="refinement"){let s=a=>{let u=i.refinement(a,o);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?pe:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?pe:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!oi(s))return s;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>oi(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:r.value,value:a})):s);Oe.assertNever(i)}};tr.create=(t,e,r)=>new tr({schema:t,typeName:le.ZodEffects,effect:e,...Ae(r)});tr.createWithPreprocess=(t,e,r)=>new tr({schema:e,effect:{type:"preprocess",transform:t},typeName:le.ZodEffects,...Ae(r)});var fr=class extends Ce{_parse(e){return this._getType(e)===V.undefined?Pt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};fr.create=(t,e)=>new fr({innerType:t,typeName:le.ZodOptional,...Ae(e)});var Ir=class extends Ce{_parse(e){return this._getType(e)===V.null?Pt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ir.create=(t,e)=>new Ir({innerType:t,typeName:le.ZodNullable,...Ae(e)});var yi=class extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===V.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};yi.create=(t,e)=>new yi({innerType:t,typeName:le.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ae(e)});var bi=class extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return gs(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};bi.create=(t,e)=>new bi({innerType:t,typeName:le.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ae(e)});var so=class extends Ce{_parse(e){if(this._getType(e)!==V.nan){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.nan,received:n.parsedType}),pe}return{status:"valid",value:e.data}}};so.create=t=>new so({typeName:le.ZodNaN,...Ae(t)});var Lk=Symbol("zod_brand"),xs=class extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ys=class t extends Ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?pe:o.status==="dirty"?(r.dirty(),eo(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?pe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:le.ZodPipeline})}},Ei=class extends Ce{_parse(e){let r=this._def.innerType._parse(e),n=i=>(oi(i)&&(i.value=Object.freeze(i.value)),i);return gs(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};Ei.create=(t,e)=>new Ei({innerType:t,typeName:le.ZodReadonly,...Ae(e)});function dm(t,e={},r){return t?En.create().superRefine((n,i)=>{var o,s;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(s=(o=a.fatal)!==null&&o!==void 0?o:r)!==null&&s!==void 0?s:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:u})}}):En.create()}var Mk={object:Vt.lazycreate},le;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(le||(le={}));var Bk=(t,e={message:`Input not instance of ${t.name}`})=>dm(r=>r instanceof t,e),hm=bn.create,mm=si.create,jk=so.create,Uk=ai.create,gm=ui.create,zk=li.create,$k=ro.create,qk=ci.create,Vk=fi.create,Gk=En.create,Wk=Jr.create,Hk=Er.create,Kk=no.create,Yk=Qr.create,Zk=Vt.create,Xk=Vt.strictCreate,Jk=pi.create,Qk=Na.create,eT=di.create,tT=vr.create,rT=Pa.create,nT=io.create,iT=oo.create,oT=La.create,sT=hi.create,aT=mi.create,uT=gi.create,lT=xi.create,cT=An.create,sm=tr.create,fT=fr.create,pT=Ir.create,dT=tr.createWithPreprocess,hT=ys.create,mT=()=>hm().optional(),gT=()=>mm().optional(),xT=()=>gm().optional(),yT={string:t=>bn.create({...t,coerce:!0}),number:t=>si.create({...t,coerce:!0}),boolean:t=>ui.create({...t,coerce:!0}),bigint:t=>ai.create({...t,coerce:!0}),date:t=>li.create({...t,coerce:!0})},bT=pe,X=Object.freeze({__proto__:null,defaultErrorMap:to,setErrorMap:dk,getErrorMap:Da,makeIssue:Ra,EMPTY_PATH:hk,addIssueToContext:U,ParseStatus:vt,INVALID:pe,DIRTY:eo,OK:Pt,isAborted:Uc,isDirty:zc,isValid:oi,isAsync:gs,get util(){return Oe},get objectUtil(){return jc},ZodParsedType:V,getParsedType:Xr,ZodType:Ce,datetimeRegex:fm,ZodString:bn,ZodNumber:si,ZodBigInt:ai,ZodBoolean:ui,ZodDate:li,ZodSymbol:ro,ZodUndefined:ci,ZodNull:fi,ZodAny:En,ZodUnknown:Jr,ZodNever:Er,ZodVoid:no,ZodArray:Qr,ZodObject:Vt,ZodUnion:pi,ZodDiscriminatedUnion:Na,ZodIntersection:di,ZodTuple:vr,ZodRecord:Pa,ZodMap:io,ZodSet:oo,ZodFunction:La,ZodLazy:hi,ZodLiteral:mi,ZodEnum:gi,ZodNativeEnum:xi,ZodPromise:An,ZodEffects:tr,ZodTransformer:tr,ZodOptional:fr,ZodNullable:Ir,ZodDefault:yi,ZodCatch:bi,ZodNaN:so,BRAND:Lk,ZodBranded:xs,ZodPipeline:ys,ZodReadonly:Ei,custom:dm,Schema:Ce,ZodSchema:Ce,late:Mk,get ZodFirstPartyTypeKind(){return le},coerce:yT,any:Gk,array:Yk,bigint:Uk,boolean:gm,date:zk,discriminatedUnion:Qk,effect:sm,enum:uT,function:oT,instanceof:Bk,intersection:eT,lazy:sT,literal:aT,map:nT,nan:jk,nativeEnum:lT,never:Hk,null:Vk,nullable:pT,number:mm,object:Zk,oboolean:xT,onumber:gT,optional:fT,ostring:mT,pipeline:hT,preprocess:dT,promise:cT,record:rT,set:iT,strictObject:Xk,string:hm,symbol:$k,transformer:sm,tuple:tT,undefined:qk,union:Jk,unknown:Wk,void:Kk,NEVER:bT,ZodIssueCode:N,quotelessJson:pk,ZodError:er});import{defaultLoaders as ET}from"cosmiconfig";function qc(t,e){let r=ET[".json"],n=r(t,e);return xm(n)}function xm(t,e="",r={}){for(let[n,i]of Object.entries(t)){let o=e?`${e}.${n}`:n;typeof i=="object"&&i!==null&&!Array.isArray(i)?xm(i,o,r):i===null?r[o]="null":r[o]=i.toString()}return r}import IT from"node:fs";import en from"node:path";import TT from"node:process";import AT from"node:process";import CT from"node:fs/promises";import{fileURLToPath as wT}from"node:url";import ao from"node:path";var ym=t=>t instanceof URL?wT(t):t;async function Ma(t,{cwd:e=AT.cwd(),type:r="file",stopAt:n}={}){let i=ao.resolve(ym(e)??""),{root:o}=ao.parse(i);for(n=ao.resolve(i,ym(n??o));i&&i!==n&&i!==o;){let s=ao.isAbsolute(t)?t:ao.join(i,t);try{let a=await CT.stat(s);if(r==="file"&&a.isFile()||r==="directory"&&a.isDirectory())return s}catch{}i=ao.dirname(i)}}async function bm({cwd:t=TT.cwd()}={}){return Ma("package.json",{cwd:t})}import _T from"node:fs";import ST from"node:fs/promises";async function Vc(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await ST[t](r))[e]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function Gc(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return _T[t](r)[e]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}var uo=Vc.bind(void 0,"stat","isFile"),r2=Vc.bind(void 0,"stat","isDirectory"),n2=Vc.bind(void 0,"lstat","isSymbolicLink"),Wc=Gc.bind(void 0,"statSync","isFile"),i2=Gc.bind(void 0,"statSync","isDirectory"),o2=Gc.bind(void 0,"lstatSync","isSymbolicLink");import vT from"node:os";var Em=vT.homedir();function Hc(t){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return Em?t.replace(/^~(?=$|\/|\\)/,Em):t}function OT(t,e){let r=e===0?1:Math.floor(Math.log10(Math.abs(e))+1);return t.toString().padStart(r,"0")}function Cm(t,e,r,n){let i=[];for(let[o,s]of t.entries()){let a=r&&t.length>1?`-${OT(o+1,t.length+1)}`:"",u=DT(s,e,r,n,a);i.push(u)}return i}function DT(t,e,r,n,i=""){let o=Am(t),s=e?Am(e):void 0;if(!Wc(o))throw new Error(`Input file not found: "${o}"`);if(s){if(Wc(s))throw new Error(`Output path must be a directory, received a file path: "${s}"`);IT.mkdirSync(s,{recursive:!0})}let a=r?en.basename(r,en.extname(r)):en.basename(o,en.extname(o)),u=`.${n??(r&&en.extname(r)!==""?en.extname(r):en.extname(t)===""?"":en.extname(t))}`,l=`${a}${i}${u}`,c=s??en.dirname(o);return{input:o,name:l,output:c}}function Am(t){return Hc(t)}async function Ba(){return bm()}function ja(t){return t==null?[]:Array.isArray(t)?t:[t]}var Tm=NT.merge(X.object({assetsPath:X.string().optional(),packageFile:X.string().optional()})).describe("Config Extension");async function Ai(t){let{additionalConfig:e,additionalRules:r,searchFrom:n}=t??{},i={addMetaComment:!1,assetsPath:"./assets",closingPrefix:"/",keywordPrefix:"",metaCommentIdentifier:"+",packageFile:await Ba(),rules:{mdat:"Powered by the Markdown Autophagic Template system: [mdat](https://github.com/kitschpatrol/mdat)."}},o=wm("mdat",{loaders:{".ts":km()}}),s=await o.search(n);if(s){let{config:a,filepath:u}=s,l=a;if(dr.info(`Using config from "${u}"`),u.endsWith("package.json")&&typeof a=="string"){dr.info(`Detected shared config string: "${a}"`);let{default:f}=await import(a);l=f}let c=_m(l,Tm);c&&(i=Kc(i,c))}if(e!==void 0){let a=Array.isArray(e)?e:[e];for(let u of a){let l;if(typeof u=="string"){let f=await o.load(u);if(f==null)continue;let{config:p,filepath:d}=f;dr.info(`Loaded additional config from "${d}"`),l=p}else l=u;if(l===void 0)continue;dr.info("Merging configuration object");let c=_m(l,Tm);c!==void 0&&(i=Kc(i,c))}}if(r!==void 0){let a=Array.isArray(r)?r:[r],u=wm("mdat",{loaders:{".json":qc,".ts":km()}});for(let l of a){let c;if(typeof l=="string"){let p;if(Sm.basename(l).endsWith("package.json")){let y=await RT.readFile(l,"utf8");p={config:qc(l,y),filepath:l}}else p=await u.load(l);if(p==null)continue;let{config:d,filepath:m}=p;dr.info(`Loaded additional config from "${m}"`),c=d}else c=l;if(c===void 0)continue;dr.info("Merging rules into configuration object");let f=LT(c,PT);f!==void 0&&(i=Kc(i,f))}}if(i.rules){let a=Object.keys(i.rules).sort().map(u=>`"${St.bold.green(u)}"`);dr.info(`Loaded ${St.bold(a.length)} mdat comment expansion ${Mc("rule",a.length)}:`);for(let u of a)dr.info(` ${u}`)}else dr.error("No rules loaded from additional configurations or rules, using default.");return Ua=i,i}function LT(t,e){if(e.safeParse(t).success)return{rules:t};dr.error(`Rules object has the wrong shape. Ignoring and using default configuration:
|
|
70
|
-
${JSON.stringify(t,void 0,2)}`)}function
|
|
71
|
-
${JSON.stringify(t,void 0,2)}`)}var Ua;async function Or(){return Ua===void 0&&(dr.warn("getConfig(): config was undefined"),Ua??=await Ai()),Ua}var
|
|
72
|
-
`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"};var jT={}.hasOwnProperty;function lo(t){return jT.call(Zc,t)?Zc[t]:!1}function st(t,e,r,n){let i=t.length,o=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(e,r),t.splice(...s);else for(r&&t.splice(e,r);o<n.length;)s=n.slice(o,o+1e4),s.unshift(e,0),t.splice(...s),o+=1e4,e+=1e4}function Lt(t,e){return t.length>0?(st(t,t.length,0,e),t):e}var Om={}.hasOwnProperty;function za(t){let e={},r=-1;for(;++r<t.length;)UT(e,t[r]);return e}function UT(t,e){let r;for(r in e){let i=(Om.call(t,r)?t[r]:void 0)||(t[r]={}),o=e[r],s;if(o)for(s in o){Om.call(i,s)||(i[s]=[]);let a=o[s];zT(i[s],Array.isArray(a)?a:a?[a]:[])}}}function zT(t,e){let r=-1,n=[];for(;++r<e.length;)(e[r].add==="after"?t:n).push(e[r]);st(t,0,0,n)}function $a(t,e){let r=Number.parseInt(t,e);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function It(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var xt=Cn(/[A-Za-z]/),yt=Cn(/[\dA-Za-z]/),Dm=Cn(/[#-'*+\--9=?A-Z^-~]/);function Ci(t){return t!==null&&(t<32||t===127)}var bs=Cn(/\d/),Rm=Cn(/[\dA-Fa-f]/),Fm=Cn(/[!-/:-@[-`{-~]/);function z(t){return t!==null&&t<-2}function ke(t){return t!==null&&(t<0||t===32)}function se(t){return t===-2||t===-1||t===32}var wi=Cn(new RegExp("\\p{P}|\\p{S}","u")),Dr=Cn(/\s/);function Cn(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function ie(t,e,r,n){let i=n?n-1:Number.POSITIVE_INFINITY,o=0;return s;function s(u){return se(u)?(t.enter(r),a(u)):e(u)}function a(u){return se(u)&&o++<i?(t.consume(u),a):(t.exit(r),e(u))}}var Nm={tokenize:$T};function $T(t){let e=t.attempt(this.parser.constructs.contentInitial,n,i),r;return e;function n(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),ie(t,e,"linePrefix")}function i(a){return t.enter("paragraph"),o(a)}function o(a){let u=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=u),r=u,s(a)}function s(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return z(a)?(t.consume(a),t.exit("chunkText"),o):(t.consume(a),s)}}var Lm={tokenize:qT},Pm={tokenize:VT};function qT(t){let e=this,r=[],n=0,i,o,s;return a;function a(C){if(n<r.length){let D=r[n];return e.containerState=D[1],t.attempt(D[0].continuation,u,l)(C)}return l(C)}function u(C){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&w();let D=e.events.length,R=D,S;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){S=e.events[R][1].end;break}b(n);let de=D;for(;de<e.events.length;)e.events[de][1].end={...S},de++;return st(e.events,R+1,0,e.events.slice(D)),e.events.length=de,l(C)}return a(C)}function l(C){if(n===r.length){if(!i)return p(C);if(i.currentConstruct&&i.currentConstruct.concrete)return m(C);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Pm,c,f)(C)}function c(C){return i&&w(),b(n),p(C)}function f(C){return e.parser.lazy[e.now().line]=n!==r.length,s=e.now().offset,m(C)}function p(C){return e.containerState={},t.attempt(Pm,d,m)(C)}function d(C){return n++,r.push([e.currentConstruct,e.containerState]),p(C)}function m(C){if(C===null){i&&w(),b(0),t.consume(C);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),y(C)}function y(C){if(C===null){g(t.exit("chunkFlow"),!0),b(0),t.consume(C);return}return z(C)?(t.consume(C),g(t.exit("chunkFlow")),n=0,e.interrupt=void 0,a):(t.consume(C),y)}function g(C,D){let R=e.sliceStream(C);if(D&&R.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(R),e.parser.lazy[C.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;let de=e.events.length,ye=de,be,_;for(;ye--;)if(e.events[ye][0]==="exit"&&e.events[ye][1].type==="chunkFlow"){if(be){_=e.events[ye][1].end;break}be=!0}for(b(n),S=de;S<e.events.length;)e.events[S][1].end={..._},S++;st(e.events,ye+1,0,e.events.slice(de)),e.events.length=S}}function b(C){let D=r.length;for(;D-- >C;){let R=r[D];e.containerState=R[1],R[0].exit.call(e,t)}r.length=C}function w(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function VT(t,e,r){return ie(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rn(t){if(t===null||ke(t)||Dr(t))return 1;if(wi(t))return 2}function wn(t,e,r){let n=[],i=-1;for(;++i<t.length;){let o=t[i].resolveAll;o&&!n.includes(o)&&(e=o(e,r),n.push(o))}return e}var Es={name:"attention",resolveAll:GT,tokenize:WT};function GT(t,e){let r=-1,n,i,o,s,a,u,l,c;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){for(n=r;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[n][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;u=t[n][1].end.offset-t[n][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;let f={...t[n][1].end},p={...t[r][1].start};Mm(f,-u),Mm(p,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...t[n][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[r][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},t[n][1].end={...s.start},t[r][1].start={...a.end},l=[],t[n][1].end.offset-t[n][1].start.offset&&(l=Lt(l,[["enter",t[n][1],e],["exit",t[n][1],e]])),l=Lt(l,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),l=Lt(l,wn(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),l=Lt(l,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[r][1].end.offset-t[r][1].start.offset?(c=2,l=Lt(l,[["enter",t[r][1],e],["exit",t[r][1],e]])):c=0,st(t,n-1,r-n+3,l),r=n+l.length-c-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function WT(t,e){let r=this.parser.constructs.attentionMarkers.null,n=this.previous,i=rn(n),o;return s;function s(u){return o=u,t.enter("attentionSequence"),a(u)}function a(u){if(u===o)return t.consume(u),a;let l=t.exit("attentionSequence"),c=rn(u),f=!c||c===2&&i||r.includes(u),p=!i||i===2&&c||r.includes(n);return l._open=!!(o===42?f:f&&(i||!p)),l._close=!!(o===42?p:p&&(c||!f)),e(u)}}function Mm(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}var Xc={name:"autolink",tokenize:HT};function HT(t,e,r){let n=0;return i;function i(d){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(d){return xt(d)?(t.consume(d),s):d===64?r(d):l(d)}function s(d){return d===43||d===45||d===46||yt(d)?(n=1,a(d)):l(d)}function a(d){return d===58?(t.consume(d),n=0,u):(d===43||d===45||d===46||yt(d))&&n++<32?(t.consume(d),a):(n=0,l(d))}function u(d){return d===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):d===null||d===32||d===60||Ci(d)?r(d):(t.consume(d),u)}function l(d){return d===64?(t.consume(d),c):Dm(d)?(t.consume(d),l):r(d)}function c(d){return yt(d)?f(d):r(d)}function f(d){return d===46?(t.consume(d),n=0,c):d===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):p(d)}function p(d){if((d===45||yt(d))&&n++<63){let m=d===45?p:f;return t.consume(d),m}return r(d)}}var Rr={partial:!0,tokenize:KT};function KT(t,e,r){return n;function n(o){return se(o)?ie(t,i,"linePrefix")(o):i(o)}function i(o){return o===null||z(o)?e(o):r(o)}}var qa={continuation:{tokenize:ZT},exit:XT,name:"blockQuote",tokenize:YT};function YT(t,e,r){let n=this;return i;function i(s){if(s===62){let a=n.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),o}return r(s)}function o(s){return se(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function ZT(t,e,r){let n=this;return i;function i(s){return se(s)?ie(t,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return t.attempt(qa,e,r)(s)}}function XT(t){t.exit("blockQuote")}var Va={name:"characterEscape",tokenize:JT};function JT(t,e,r){return n;function n(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),i}function i(o){return Fm(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):r(o)}}var Ga={name:"characterReference",tokenize:QT};function QT(t,e,r){let n=this,i=0,o,s;return a;function a(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),u}function u(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),o=31,s=yt,c(f))}function l(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,s=Rm,c):(t.enter("characterReferenceValue"),o=7,s=bs,c(f))}function c(f){if(f===59&&i){let p=t.exit("characterReferenceValue");return s===yt&&!lo(n.sliceSerialize(p))?r(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(f)&&i++<o?(t.consume(f),c):r(f)}}var Bm={partial:!0,tokenize:t_},Wa={concrete:!0,name:"codeFenced",tokenize:e_};function e_(t,e,r){let n=this,i={partial:!0,tokenize:R},o=0,s=0,a;return u;function u(S){return l(S)}function l(S){let de=n.events[n.events.length-1];return o=de&&de[1].type==="linePrefix"?de[2].sliceSerialize(de[1],!0).length:0,a=S,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===a?(s++,t.consume(S),c):s<3?r(S):(t.exit("codeFencedFenceSequence"),se(S)?ie(t,f,"whitespace")(S):f(S))}function f(S){return S===null||z(S)?(t.exit("codeFencedFence"),n.interrupt?e(S):t.check(Bm,y,D)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||z(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(S)):se(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),ie(t,d,"whitespace")(S)):S===96&&S===a?r(S):(t.consume(S),p)}function d(S){return S===null||z(S)?f(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||z(S)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?r(S):(t.consume(S),m)}function y(S){return t.attempt(i,D,g)(S)}function g(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),b}function b(S){return o>0&&se(S)?ie(t,w,"linePrefix",o+1)(S):w(S)}function w(S){return S===null||z(S)?t.check(Bm,y,D)(S):(t.enter("codeFlowValue"),C(S))}function C(S){return S===null||z(S)?(t.exit("codeFlowValue"),w(S)):(t.consume(S),C)}function D(S){return t.exit("codeFenced"),e(S)}function R(S,de,ye){let be=0;return _;function _(j){return S.enter("lineEnding"),S.consume(j),S.exit("lineEnding"),L}function L(j){return S.enter("codeFencedFence"),se(j)?ie(S,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):F(j)}function F(j){return j===a?(S.enter("codeFencedFenceSequence"),v(j)):ye(j)}function v(j){return j===a?(be++,S.consume(j),v):be>=s?(S.exit("codeFencedFenceSequence"),se(j)?ie(S,P,"whitespace")(j):P(j)):ye(j)}function P(j){return j===null||z(j)?(S.exit("codeFencedFence"),de(j)):ye(j)}}}function t_(t,e,r){let n=this;return i;function i(s){return s===null?r(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}var As={name:"codeIndented",tokenize:n_},r_={partial:!0,tokenize:i_};function n_(t,e,r){let n=this;return i;function i(l){return t.enter("codeIndented"),ie(t,o,"linePrefix",5)(l)}function o(l){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):r(l)}function s(l){return l===null?u(l):z(l)?t.attempt(r_,s,u)(l):(t.enter("codeFlowValue"),a(l))}function a(l){return l===null||z(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),a)}function u(l){return t.exit("codeIndented"),e(l)}}function i_(t,e,r){let n=this;return i;function i(s){return n.parser.lazy[n.now().line]?r(s):z(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):ie(t,o,"linePrefix",5)(s)}function o(s){let a=n.events[n.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):z(s)?i(s):r(s)}}var Jc={name:"codeText",previous:s_,resolve:o_,tokenize:a_};function o_(t){let e=t.length-4,r=3,n,i;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n<e;)if(t[n][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[e][1].type="codeTextPadding",r+=2,e-=2;break}}for(n=r-1,e++;++n<=e;)i===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(i=n):(n===e||t[n][1].type==="lineEnding")&&(t[i][1].type="codeTextData",n!==i+2&&(t[i][1].end=t[n-1][1].end,t.splice(i+2,n-i-2),e-=n-i-2,n=i+2),i=void 0);return t}function s_(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function a_(t,e,r){let n=this,i=0,o,s;return a;function a(p){return t.enter("codeText"),t.enter("codeTextSequence"),u(p)}function u(p){return p===96?(t.consume(p),i++,u):(t.exit("codeTextSequence"),l(p))}function l(p){return p===null?r(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),l):p===96?(s=t.enter("codeTextSequence"),o=0,f(p)):z(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),l):(t.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||z(p)?(t.exit("codeTextData"),l(p)):(t.consume(p),c)}function f(p){return p===96?(t.consume(p),o++,f):o===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(s.type="codeTextData",c(p))}}var Ha=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,r){let n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,r,n){let i=r||0;this.setCursor(Math.trunc(e));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&Cs(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Cs(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Cs(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let r=this.left.splice(e,Number.POSITIVE_INFINITY);Cs(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Cs(this.left,r.reverse())}}};function Cs(t,e){let r=0;if(e.length<1e4)t.push(...e);else for(;r<e.length;)t.push(...e.slice(r,r+1e4)),r+=1e4}function Ka(t){let e={},r=-1,n,i,o,s,a,u,l,c=new Ha(t);for(;++r<c.length;){for(;r in e;)r=e[r];if(n=c.get(r),r&&n[1].type==="chunkFlow"&&c.get(r-1)[1].type==="listItemPrefix"&&(u=n[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,u_(c,r)),r=e[r],l=!0);else if(n[1]._container){for(o=r,i=void 0;o--&&(s=c.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);i&&(n[1].end={...c.get(i)[1].start},a=c.slice(i,r),a.unshift(n),c.splice(i,r-i+1,a))}}return st(t,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function u_(t,e){let r=t.get(e)[1],n=t.get(e)[2],i=e-1,o=[],s=r._tokenizer||n.parser[r.contentType](r.start),a=s.events,u=[],l={},c,f,p=-1,d=r,m=0,y=0,g=[y];for(;d;){for(;t.get(++i)[1]!==d;);o.push(i),d._tokenizer||(c=n.sliceStream(d),d.next||c.push(null),f&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=r;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(y=p+1,g.push(y),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),p=g.length;p--;){let b=a.slice(g[p],g[p+1]),w=o.pop();u.push([w,w+b.length-1]),t.splice(w,2,b)}for(u.reverse(),p=-1;++p<u.length;)l[m+u[p][0]]=m+u[p][1],m+=u[p][1]-u[p][0]-1;return l}var Qc={resolve:c_,tokenize:f_},l_={partial:!0,tokenize:p_};function c_(t){return Ka(t),t}function f_(t,e){let r;return n;function n(a){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):z(a)?t.check(l_,s,o)(a):(t.consume(a),i)}function o(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function s(a){return t.consume(a),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,i}}function p_(t,e,r){let n=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),ie(t,o,"linePrefix")}function o(s){if(s===null||z(s))return r(s);let a=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):t.interrupt(n.parser.constructs.flow,r,e)(s)}}function Ya(t,e,r,n,i,o,s,a,u){let l=u||Number.POSITIVE_INFINITY,c=0;return f;function f(b){return b===60?(t.enter(n),t.enter(i),t.enter(o),t.consume(b),t.exit(o),p):b===null||b===32||b===41||Ci(b)?r(b):(t.enter(n),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),y(b))}function p(b){return b===62?(t.enter(o),t.consume(b),t.exit(o),t.exit(i),t.exit(n),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===62?(t.exit("chunkString"),t.exit(a),p(b)):b===null||b===60||z(b)?r(b):(t.consume(b),b===92?m:d)}function m(b){return b===60||b===62||b===92?(t.consume(b),d):d(b)}function y(b){return!c&&(b===null||b===41||ke(b))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(n),e(b)):c<l&&b===40?(t.consume(b),c++,y):b===41?(t.consume(b),c--,y):b===null||b===32||b===40||Ci(b)?r(b):(t.consume(b),b===92?g:y)}function g(b){return b===40||b===41||b===92?(t.consume(b),y):y(b)}}function Za(t,e,r,n,i,o){let s=this,a=0,u;return l;function l(d){return t.enter(n),t.enter(i),t.consume(d),t.exit(i),t.enter(o),c}function c(d){return a>999||d===null||d===91||d===93&&!u||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?r(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(n),e):z(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||z(d)||a++>999?(t.exit("chunkString"),c(d)):(t.consume(d),u||(u=!se(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),a++,f):f(d)}}function Xa(t,e,r,n,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(t.enter(n),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,u):r(p)}function u(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(n),e):(t.enter(o),l(p))}function l(p){return p===s?(t.exit(o),u(s)):p===null?r(p):z(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),ie(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||z(p)?(t.exit("chunkString"),l(p)):(t.consume(p),p===92?f:c)}function f(p){return p===s||p===92?(t.consume(p),c):c(p)}}function ki(t,e){let r;return n;function n(i){return z(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r=!0,n):se(i)?ie(t,n,r?"linePrefix":"lineSuffix")(i):e(i)}}var ef={name:"definition",tokenize:h_},d_={partial:!0,tokenize:m_};function h_(t,e,r){let n=this,i;return o;function o(d){return t.enter("definition"),s(d)}function s(d){return Za.call(n,t,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=It(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),u):r(d)}function u(d){return ke(d)?ki(t,l)(d):l(d)}function l(d){return Ya(t,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt(d_,f,f)(d)}function f(d){return se(d)?ie(t,p,"whitespace")(d):p(d)}function p(d){return d===null||z(d)?(t.exit("definition"),n.parser.defined.push(i),e(d)):r(d)}}function m_(t,e,r){return n;function n(a){return ke(a)?ki(t,i)(a):r(a)}function i(a){return Xa(t,o,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return se(a)?ie(t,s,"whitespace")(a):s(a)}function s(a){return a===null||z(a)?e(a):r(a)}}var tf={name:"hardBreakEscape",tokenize:g_};function g_(t,e,r){return n;function n(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return z(o)?(t.exit("hardBreakEscape"),e(o)):r(o)}}var rf={name:"headingAtx",resolve:x_,tokenize:y_};function x_(t,e){let r=t.length-2,n=3,i,o;return t[n][1].type==="whitespace"&&(n+=2),r-2>n&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&t[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:t[n][1].start,end:t[r][1].end},o={type:"chunkText",start:t[n][1].start,end:t[r][1].end,contentType:"text"},st(t,n,r-n+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function y_(t,e,r){let n=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&n++<6?(t.consume(c),s):c===null||ke(c)?(t.exit("atxHeadingSequence"),a(c)):r(c)}function a(c){return c===35?(t.enter("atxHeadingSequence"),u(c)):c===null||z(c)?(t.exit("atxHeading"),e(c)):se(c)?ie(t,a,"whitespace")(c):(t.enter("atxHeadingText"),l(c))}function u(c){return c===35?(t.consume(c),u):(t.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||ke(c)?(t.exit("atxHeadingText"),a(c)):(t.consume(c),l)}}var jm=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],nf=["pre","script","style","textarea"];var of={concrete:!0,name:"htmlFlow",resolveTo:A_,tokenize:C_},b_={partial:!0,tokenize:k_},E_={partial:!0,tokenize:w_};function A_(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function C_(t,e,r){let n=this,i,o,s,a,u;return l;function l(E){return c(E)}function c(E){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(E),f}function f(E){return E===33?(t.consume(E),p):E===47?(t.consume(E),o=!0,y):E===63?(t.consume(E),i=3,n.interrupt?e:x):xt(E)?(t.consume(E),s=String.fromCharCode(E),g):r(E)}function p(E){return E===45?(t.consume(E),i=2,d):E===91?(t.consume(E),i=5,a=0,m):xt(E)?(t.consume(E),i=4,n.interrupt?e:x):r(E)}function d(E){return E===45?(t.consume(E),n.interrupt?e:x):r(E)}function m(E){let W="CDATA[";return E===W.charCodeAt(a++)?(t.consume(E),a===W.length?n.interrupt?e:F:m):r(E)}function y(E){return xt(E)?(t.consume(E),s=String.fromCharCode(E),g):r(E)}function g(E){if(E===null||E===47||E===62||ke(E)){let W=E===47,Ye=s.toLowerCase();return!W&&!o&&nf.includes(Ye)?(i=1,n.interrupt?e(E):F(E)):jm.includes(s.toLowerCase())?(i=6,W?(t.consume(E),b):n.interrupt?e(E):F(E)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(E):o?w(E):C(E))}return E===45||yt(E)?(t.consume(E),s+=String.fromCharCode(E),g):r(E)}function b(E){return E===62?(t.consume(E),n.interrupt?e:F):r(E)}function w(E){return se(E)?(t.consume(E),w):_(E)}function C(E){return E===47?(t.consume(E),_):E===58||E===95||xt(E)?(t.consume(E),D):se(E)?(t.consume(E),C):_(E)}function D(E){return E===45||E===46||E===58||E===95||yt(E)?(t.consume(E),D):R(E)}function R(E){return E===61?(t.consume(E),S):se(E)?(t.consume(E),R):C(E)}function S(E){return E===null||E===60||E===61||E===62||E===96?r(E):E===34||E===39?(t.consume(E),u=E,de):se(E)?(t.consume(E),S):ye(E)}function de(E){return E===u?(t.consume(E),u=null,be):E===null||z(E)?r(E):(t.consume(E),de)}function ye(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||ke(E)?R(E):(t.consume(E),ye)}function be(E){return E===47||E===62||se(E)?C(E):r(E)}function _(E){return E===62?(t.consume(E),L):r(E)}function L(E){return E===null||z(E)?F(E):se(E)?(t.consume(E),L):r(E)}function F(E){return E===45&&i===2?(t.consume(E),ae):E===60&&i===1?(t.consume(E),ee):E===62&&i===4?(t.consume(E),Ue):E===63&&i===3?(t.consume(E),x):E===93&&i===5?(t.consume(E),it):z(E)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(b_,Qe,v)(E)):E===null||z(E)?(t.exit("htmlFlowData"),v(E)):(t.consume(E),F)}function v(E){return t.check(E_,P,Qe)(E)}function P(E){return t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),j}function j(E){return E===null||z(E)?v(E):(t.enter("htmlFlowData"),F(E))}function ae(E){return E===45?(t.consume(E),x):F(E)}function ee(E){return E===47?(t.consume(E),s="",_e):F(E)}function _e(E){if(E===62){let W=s.toLowerCase();return nf.includes(W)?(t.consume(E),Ue):F(E)}return xt(E)&&s.length<8?(t.consume(E),s+=String.fromCharCode(E),_e):F(E)}function it(E){return E===93?(t.consume(E),x):F(E)}function x(E){return E===62?(t.consume(E),Ue):E===45&&i===2?(t.consume(E),x):F(E)}function Ue(E){return E===null||z(E)?(t.exit("htmlFlowData"),Qe(E)):(t.consume(E),Ue)}function Qe(E){return t.exit("htmlFlow"),e(E)}}function w_(t,e,r){let n=this;return i;function i(s){return z(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):r(s)}function o(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}function k_(t,e,r){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Rr,e,r)}}var sf={name:"htmlText",tokenize:T_};function T_(t,e,r){let n=this,i,o,s;return a;function a(x){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(x),u}function u(x){return x===33?(t.consume(x),l):x===47?(t.consume(x),R):x===63?(t.consume(x),C):xt(x)?(t.consume(x),ye):r(x)}function l(x){return x===45?(t.consume(x),c):x===91?(t.consume(x),o=0,m):xt(x)?(t.consume(x),w):r(x)}function c(x){return x===45?(t.consume(x),d):r(x)}function f(x){return x===null?r(x):x===45?(t.consume(x),p):z(x)?(s=f,ee(x)):(t.consume(x),f)}function p(x){return x===45?(t.consume(x),d):f(x)}function d(x){return x===62?ae(x):x===45?p(x):f(x)}function m(x){let Ue="CDATA[";return x===Ue.charCodeAt(o++)?(t.consume(x),o===Ue.length?y:m):r(x)}function y(x){return x===null?r(x):x===93?(t.consume(x),g):z(x)?(s=y,ee(x)):(t.consume(x),y)}function g(x){return x===93?(t.consume(x),b):y(x)}function b(x){return x===62?ae(x):x===93?(t.consume(x),b):y(x)}function w(x){return x===null||x===62?ae(x):z(x)?(s=w,ee(x)):(t.consume(x),w)}function C(x){return x===null?r(x):x===63?(t.consume(x),D):z(x)?(s=C,ee(x)):(t.consume(x),C)}function D(x){return x===62?ae(x):C(x)}function R(x){return xt(x)?(t.consume(x),S):r(x)}function S(x){return x===45||yt(x)?(t.consume(x),S):de(x)}function de(x){return z(x)?(s=de,ee(x)):se(x)?(t.consume(x),de):ae(x)}function ye(x){return x===45||yt(x)?(t.consume(x),ye):x===47||x===62||ke(x)?be(x):r(x)}function be(x){return x===47?(t.consume(x),ae):x===58||x===95||xt(x)?(t.consume(x),_):z(x)?(s=be,ee(x)):se(x)?(t.consume(x),be):ae(x)}function _(x){return x===45||x===46||x===58||x===95||yt(x)?(t.consume(x),_):L(x)}function L(x){return x===61?(t.consume(x),F):z(x)?(s=L,ee(x)):se(x)?(t.consume(x),L):be(x)}function F(x){return x===null||x===60||x===61||x===62||x===96?r(x):x===34||x===39?(t.consume(x),i=x,v):z(x)?(s=F,ee(x)):se(x)?(t.consume(x),F):(t.consume(x),P)}function v(x){return x===i?(t.consume(x),i=void 0,j):x===null?r(x):z(x)?(s=v,ee(x)):(t.consume(x),v)}function P(x){return x===null||x===34||x===39||x===60||x===61||x===96?r(x):x===47||x===62||ke(x)?be(x):(t.consume(x),P)}function j(x){return x===47||x===62||ke(x)?be(x):r(x)}function ae(x){return x===62?(t.consume(x),t.exit("htmlTextData"),t.exit("htmlText"),e):r(x)}function ee(x){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),_e}function _e(x){return se(x)?ie(t,it,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):it(x)}function it(x){return t.enter("htmlTextData"),s(x)}}var Ti={name:"labelEnd",resolveAll:I_,resolveTo:O_,tokenize:D_},__={tokenize:R_},S_={tokenize:F_},v_={tokenize:N_};function I_(t){let e=-1,r=[];for(;++e<t.length;){let n=t[e][1];if(r.push(t[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let i=n.type==="labelImage"?4:2;n.type="data",e+=i}}return t.length!==r.length&&st(t,0,t.length,r),t}function O_(t,e){let r=t.length,n=0,i,o,s,a;for(;r--;)if(i=t[r][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[r][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(t[r][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=r,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(s=r);let u={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[o][1].start},end:{...t[s][1].end}},c={type:"labelText",start:{...t[o+n+2][1].end},end:{...t[s-2][1].start}};return a=[["enter",u,e],["enter",l,e]],a=Lt(a,t.slice(o+1,o+n+3)),a=Lt(a,[["enter",c,e]]),a=Lt(a,wn(e.parser.constructs.insideSpan.null,t.slice(o+n+4,s-3),e)),a=Lt(a,[["exit",c,e],t[s-2],t[s-1],["exit",l,e]]),a=Lt(a,t.slice(s+1)),a=Lt(a,[["exit",u,e]]),st(t,o,t.length,a),t}function D_(t,e,r){let n=this,i=n.events.length,o,s;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){o=n.events[i][1];break}return a;function a(p){return o?o._inactive?f(p):(s=n.parser.defined.includes(It(n.sliceSerialize({start:o.end,end:n.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),u):r(p)}function u(p){return p===40?t.attempt(__,c,s?c:f)(p):p===91?t.attempt(S_,c,s?l:f)(p):s?c(p):f(p)}function l(p){return t.attempt(v_,c,f)(p)}function c(p){return e(p)}function f(p){return o._balanced=!0,r(p)}}function R_(t,e,r){return n;function n(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),i}function i(f){return ke(f)?ki(t,o)(f):o(f)}function o(f){return f===41?c(f):Ya(t,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return ke(f)?ki(t,u)(f):c(f)}function a(f){return r(f)}function u(f){return f===34||f===39||f===40?Xa(t,l,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function l(f){return ke(f)?ki(t,c)(f):c(f)}function c(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):r(f)}}function F_(t,e,r){let n=this;return i;function i(a){return Za.call(n,t,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return n.parser.defined.includes(It(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(a):r(a)}function s(a){return r(a)}}function N_(t,e,r){return n;function n(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),i}function i(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):r(o)}}var af={name:"labelStartImage",resolveAll:Ti.resolveAll,tokenize:P_};function P_(t,e,r){let n=this;return i;function i(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),o}function o(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),s):r(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(a):e(a)}}var uf={name:"labelStartLink",resolveAll:Ti.resolveAll,tokenize:L_};function L_(t,e,r){let n=this;return i;function i(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):e(s)}}var ws={name:"lineEnding",tokenize:M_};function M_(t,e){return r;function r(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),ie(t,e,"linePrefix")}}var _i={name:"thematicBreak",tokenize:B_};function B_(t,e,r){let n=0,i;return o;function o(l){return t.enter("thematicBreak"),s(l)}function s(l){return i=l,a(l)}function a(l){return l===i?(t.enter("thematicBreakSequence"),u(l)):n>=3&&(l===null||z(l))?(t.exit("thematicBreak"),e(l)):r(l)}function u(l){return l===i?(t.consume(l),n++,u):(t.exit("thematicBreakSequence"),se(l)?ie(t,a,"whitespace")(l):a(l))}}var Ot={continuation:{tokenize:$_},exit:V_,name:"list",tokenize:z_},j_={partial:!0,tokenize:G_},U_={partial:!0,tokenize:q_};function z_(t,e,r){let n=this,i=n.events[n.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){let m=n.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||d===n.containerState.marker:bs(d)){if(n.containerState.type||(n.containerState.type=m,t.enter(m,{_container:!0})),m==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(_i,r,l)(d):l(d);if(!n.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(d)}return r(d)}function u(d){return bs(d)&&++s<10?(t.consume(d),u):(!n.interrupt||s<2)&&(n.containerState.marker?d===n.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),l(d)):r(d)}function l(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||d,t.check(Rr,n.interrupt?r:c,t.attempt(j_,p,f))}function c(d){return n.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return se(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):r(d)}function p(d){return n.containerState.size=o+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function $_(t,e,r){let n=this;return n.containerState._closeFlow=void 0,t.check(Rr,i,o);function i(a){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ie(t,e,"listItemIndent",n.containerState.size+1)(a)}function o(a){return n.containerState.furtherBlankLines||!se(a)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(a)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(U_,e,s)(a))}function s(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,ie(t,t.attempt(Ot,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function q_(t,e,r){let n=this;return ie(t,i,"listItemIndent",n.containerState.size+1);function i(o){let s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?e(o):r(o)}}function V_(t){t.exit(this.containerState.type)}function G_(t,e,r){let n=this;return ie(t,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=n.events[n.events.length-1];return!se(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):r(o)}}var Ja={name:"setextUnderline",resolveTo:W_,tokenize:H_};function W_(t,e){let r=t.length,n,i,o;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){n=r;break}t[r][1].type==="paragraph"&&(i=r)}else t[r][1].type==="content"&&t.splice(r,1),!o&&t[r][1].type==="definition"&&(o=r);let s={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[n][1],e]),t[n][1].end={...t[o][1].end}):t[n][1]=s,t.push(["exit",s,e]),t}function H_(t,e,r){let n=this,i;return o;function o(l){let c=n.events.length,f;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){f=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||f)?(t.enter("setextHeadingLine"),i=l,s(l)):r(l)}function s(l){return t.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(t.consume(l),a):(t.exit("setextHeadingLineSequence"),se(l)?ie(t,u,"lineSuffix")(l):u(l))}function u(l){return l===null||z(l)?(t.exit("setextHeadingLine"),e(l)):r(l)}}var Um={tokenize:K_};function K_(t){let e=this,r=t.attempt(Rr,n,t.attempt(this.parser.constructs.flowInitial,i,ie(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Qc,i)),"linePrefix")));return r;function n(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,r}}var zm={resolveAll:Gm()},$m=Vm("string"),qm=Vm("text");function Vm(t){return{resolveAll:Gm(t==="text"?Y_:void 0),tokenize:e};function e(r){let n=this,i=this.parser.constructs[t],o=r.attempt(i,s,a);return s;function s(c){return l(c)?o(c):a(c)}function a(c){if(c===null){r.consume(c);return}return r.enter("data"),r.consume(c),u}function u(c){return l(c)?(r.exit("data"),o(c)):(r.consume(c),u)}function l(c){if(c===null)return!0;let f=i[c],p=-1;if(f)for(;++p<f.length;){let d=f[p];if(!d.previous||d.previous.call(n,n.previous))return!0}return!1}}}function Gm(t){return e;function e(r,n){let i=-1,o;for(;++i<=r.length;)o===void 0?r[i]&&r[i][1].type==="data"&&(o=i,i++):(!r[i]||r[i][1].type!=="data")&&(i!==o+2&&(r[o][1].end=r[i-1][1].end,r.splice(o+2,i-o-2),i=o+2),o=void 0);return t?t(r,n):r}}function Y_(t,e){let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){let n=t[r-1][1],i=e.sliceStream(n),o=i.length,s=-1,a=0,u;for(;o--;){let l=i[o];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(l===-2)u=!0,a++;else if(l!==-1){o++;break}}if(a){let l={type:r===t.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:n.start._bufferIndex+s,_index:n.start._index+o,line:n.end.line,column:n.end.column-a,offset:n.end.offset-a},end:{...n.end}};n.end={...l.start},n.start.offset===n.end.offset?Object.assign(n,l):(t.splice(r,0,["enter",l,e],["exit",l,e]),r+=2)}r++}return t}var lf={};qC(lf,{attentionMarkers:()=>nS,contentInitial:()=>X_,disable:()=>iS,document:()=>Z_,flow:()=>Q_,flowInitial:()=>J_,insideSpan:()=>rS,string:()=>eS,text:()=>tS});var Z_={42:Ot,43:Ot,45:Ot,48:Ot,49:Ot,50:Ot,51:Ot,52:Ot,53:Ot,54:Ot,55:Ot,56:Ot,57:Ot,62:qa},X_={91:ef},J_={[-2]:As,[-1]:As,32:As},Q_={35:rf,42:_i,45:[Ja,_i],60:of,61:Ja,95:_i,96:Wa,126:Wa},eS={38:Ga,92:Va},tS={[-5]:ws,[-4]:ws,[-3]:ws,33:af,38:Ga,42:Es,60:[Xc,sf],91:uf,92:[tf,Va],93:Ti,95:Es,96:Jc},rS={null:[Es,zm]},nS={null:[42,95]},iS={null:[]};function Wm(t,e,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},i={},o=[],s=[],a=[],u=!0,l={attempt:be(de),check:be(ye),consume:D,enter:R,exit:S,interrupt:be(ye,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:t,previous:null,sliceSerialize:m,sliceStream:y,write:d},f=e.tokenize.call(c,l),p;return e.resolveAll&&o.push(e),c;function d(v){return s=Lt(s,v),w(),s[s.length-1]!==null?[]:(_(e,0),c.events=wn(o,c.events,c),c.events)}function m(v,P){return sS(y(v),P)}function y(v){return oS(s,v)}function g(){let{_bufferIndex:v,_index:P,line:j,column:ae,offset:ee}=n;return{_bufferIndex:v,_index:P,line:j,column:ae,offset:ee}}function b(v){i[v.line]=v.column,F()}function w(){let v;for(;n._index<s.length;){let P=s[n._index];if(typeof P=="string")for(v=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===v&&n._bufferIndex<P.length;)C(P.charCodeAt(n._bufferIndex));else C(P)}}function C(v){u=void 0,p=v,f=f(v)}function D(v){z(v)?(n.line++,n.column=1,n.offset+=v===-3?2:1,F()):v!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=v,u=!0}function R(v,P){let j=P||{};return j.type=v,j.start=g(),c.events.push(["enter",j,c]),a.push(j),j}function S(v){let P=a.pop();return P.end=g(),c.events.push(["exit",P,c]),P}function de(v,P){_(v,P.from)}function ye(v,P){P.restore()}function be(v,P){return j;function j(ae,ee,_e){let it,x,Ue,Qe;return Array.isArray(ae)?W(ae):"tokenize"in ae?W([ae]):E(ae);function E(oe){return ce;function ce(me){let we=me!==null&&oe[me],Fe=me!==null&&oe.null,ze=[...Array.isArray(we)?we:we?[we]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return W(ze)(me)}}function W(oe){return it=oe,x=0,oe.length===0?_e:Ye(oe[x])}function Ye(oe){return ce;function ce(me){return Qe=L(),Ue=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?he(me):oe.tokenize.call(P?Object.assign(Object.create(c),P):c,l,ne,he)(me)}}function ne(oe){return u=!0,v(Ue,Qe),ee}function he(oe){return u=!0,Qe.restore(),++x<it.length?Ye(it[x]):_e}}}function _(v,P){v.resolveAll&&!o.includes(v)&&o.push(v),v.resolve&&st(c.events,P,c.events.length-P,v.resolve(c.events.slice(P),c)),v.resolveTo&&(c.events=v.resolveTo(c.events,c))}function L(){let v=g(),P=c.previous,j=c.currentConstruct,ae=c.events.length,ee=Array.from(a);return{from:ae,restore:_e};function _e(){n=v,c.previous=P,c.currentConstruct=j,c.events.length=ae,a=ee,F()}}function F(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function oS(t,e){let r=e.start._index,n=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex,s;if(r===i)s=[t[r].slice(n,o)];else{if(s=t.slice(r,i),n>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(n):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function sS(t,e){let r=-1,n=[],i;for(;++r<t.length;){let o=t[r],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
69
|
+
`,"f"),Y(this,Ct,h(this,Ct,"f")+e.join(" "),"f")}}}[_c](e){Ki(h(this,re,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;let n=h(this,re,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete h(this,ge,"f").getDescriptions()[e]}[Lh](e,r,n){h(this,wa,"f")[n]||(h(this,fe,"f").process.emitWarning(e,r),h(this,wa,"f")[n]=!0)}[Mh](){h(this,ka,"f").push({options:h(this,re,"f"),configObjects:h(this,re,"f").configObjects.slice(0),exitProcess:h(this,ur,"f"),groups:h(this,_r,"f"),strict:h(this,Qn,"f"),strictCommands:h(this,ei,"f"),strictOptions:h(this,ti,"f"),completionCommand:h(this,Xt,"f"),output:h(this,Ct,"f"),exitError:h(this,gn,"f"),hasOutput:h(this,Jt,"f"),parsed:this.parsed,parseFn:h(this,Qt,"f"),parseContext:h(this,Xn,"f")}),h(this,ge,"f").freeze(),h(this,tt,"f").freeze(),h(this,ot,"f").freeze(),h(this,lr,"f").freeze()}[Bh](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(h(this,fe,"f").process.argv()[0])?r=h(this,fe,"f").process.argv().slice(1,2):r=h(this,fe,"f").process.argv().slice(0,1),e=r.map(n=>{let i=this[Xh](h(this,Yn,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),h(this,fe,"f").getEnv("_")&&h(this,fe,"f").getProcessArgvBin()===h(this,fe,"f").getEnv("_")&&(e=h(this,fe,"f").getEnv("_").replace(`${h(this,fe,"f").path.dirname(h(this,fe,"f").process.execPath())}/`,"")),e}[ri](){return h(this,Sa,"f")}[jh](){return h(this,Ia,"f")}[Sc](){if(!h(this,Zn,"f"))return;let e=h(this,fe,"f").getEnv("LC_ALL")||h(this,fe,"f").getEnv("LC_MESSAGES")||h(this,fe,"f").getEnv("LANG")||h(this,fe,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Uh](){return this[vc]().version||"unknown"}[zh](e){let r=e["--"]?e["--"]:e._;for(let n=0,i;(i=r[n])!==void 0;n++)h(this,fe,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return e}[vc](e){let r=e||"*";if(h(this,Xi,"f")[r])return h(this,Xi,"f")[r];let n={};try{let i=e||h(this,fe,"f").mainFilename;!e&&h(this,fe,"f").path.extname(i)&&(i=h(this,fe,"f").path.dirname(i));let o=h(this,fe,"f").findUp(i,(s,a)=>{if(a.includes("package.json"))return"package.json"});Nt(o,void 0,h(this,fe,"f")),n=JSON.parse(h(this,fe,"f").readFileSync(o,"utf8"))}catch{}return h(this,Xi,"f")[r]=n||{},h(this,Xi,"f")[r]}[yn](e,r){r=[].concat(r),r.forEach(n=>{n=this[Dc](n),h(this,re,"f")[e].push(n)})}[Ji](e,r,n,i){this[Oc](e,r,n,i,(o,s,a)=>{h(this,re,"f")[o][s]=a})}[Ic](e,r,n,i){this[Oc](e,r,n,i,(o,s,a)=>{h(this,re,"f")[o][s]=(h(this,re,"f")[o][s]||[]).concat(a)})}[Oc](e,r,n,i,o){if(Array.isArray(n))n.forEach(s=>{e(s,i)});else if((s=>typeof s=="object")(n))for(let s of Ki(n))e(s,n[s]);else o(r,this[Dc](n),i)}[Dc](e){return e==="__proto__"?"___proto___":e}[Rc](e,r){return this[Ji](this[Rc].bind(this),"key",e,r),this}[Fc](){var e,r,n,i,o,s,a,u,l,c,f,p;let d=h(this,ka,"f").pop();Nt(d,void 0,h(this,fe,"f"));let m;e=this,r=this,n=this,i=this,o=this,s=this,a=this,u=this,l=this,c=this,f=this,p=this,{options:{set value(y){Y(e,re,y,"f")}}.value,configObjects:m,exitProcess:{set value(y){Y(r,ur,y,"f")}}.value,groups:{set value(y){Y(n,_r,y,"f")}}.value,output:{set value(y){Y(i,Ct,y,"f")}}.value,exitError:{set value(y){Y(o,gn,y,"f")}}.value,hasOutput:{set value(y){Y(s,Jt,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Y(a,Qn,y,"f")}}.value,strictCommands:{set value(y){Y(u,ei,y,"f")}}.value,strictOptions:{set value(y){Y(l,ti,y,"f")}}.value,completionCommand:{set value(y){Y(c,Xt,y,"f")}}.value,parseFn:{set value(y){Y(f,Qt,y,"f")}}.value,parseContext:{set value(y){Y(p,Xn,y,"f")}}.value}=d,h(this,re,"f").configObjects=m,h(this,ge,"f").unfreeze(),h(this,tt,"f").unfreeze(),h(this,ot,"f").unfreeze(),h(this,lr,"f").unfreeze()}[$h](e,r){return Kn(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[qh].bind(this),getContext:this[Vh].bind(this),getHasOutput:this[Gh].bind(this),getLoggerInstance:this[Wh].bind(this),getParseContext:this[Hh].bind(this),getParserConfiguration:this[ri].bind(this),getUsageConfiguration:this[jh].bind(this),getUsageInstance:this[Kh].bind(this),getValidationInstance:this[Yh].bind(this),hasParseCallback:this[Oa].bind(this),isGlobalContext:this[Zh].bind(this),postProcess:this[ni].bind(this),reset:this[Nc].bind(this),runValidation:this[Pc].bind(this),runYargsParserAndExecuteCommands:this[ds].bind(this),setHasOutput:this[Jh].bind(this)}}[qh](){return h(this,ot,"f")}[Vh](){return h(this,ps,"f")}[Gh](){return h(this,Jt,"f")}[Wh](){return h(this,Zi,"f")}[Hh](){return h(this,Xn,"f")||{}}[Kh](){return h(this,ge,"f")}[Yh](){return h(this,tt,"f")}[Oa](){return!!h(this,Qt,"f")}[Zh](){return h(this,Ta,"f")}[ni](e,r,n,i){return n||qe(e)||(r||(e=this[Nh](e)),(this[ri]()["parse-positional-numbers"]||this[ri]()["parse-positional-numbers"]===void 0)&&(e=this[zh](e)),i&&(e=Hn(e,this,h(this,lr,"f").getMiddleware(),!1))),e}[Nc](e={}){Y(this,re,h(this,re,"f")||{},"f");let r={};r.local=h(this,re,"f").local||[],r.configObjects=h(this,re,"f").configObjects||[];let n={};r.local.forEach(s=>{n[s]=!0,(e[s]||[]).forEach(a=>{n[a]=!0})}),Object.assign(h(this,Jn,"f"),Object.keys(h(this,_r,"f")).reduce((s,a)=>{let u=h(this,_r,"f")[a].filter(l=>!(l in n));return u.length>0&&(s[a]=u),s},{})),Y(this,_r,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(s=>{r[s]=(h(this,re,"f")[s]||[]).filter(a=>!n[a])}),o.forEach(s=>{r[s]=hn(h(this,re,"f")[s],a=>!n[a])}),r.envPrefix=h(this,re,"f").envPrefix,Y(this,re,r,"f"),Y(this,ge,h(this,ge,"f")?h(this,ge,"f").reset(n):_h(this,h(this,fe,"f")),"f"),Y(this,tt,h(this,tt,"f")?h(this,tt,"f").reset(n):Rh(this,h(this,ge,"f"),h(this,fe,"f")),"f"),Y(this,ot,h(this,ot,"f")?h(this,ot,"f").reset():wh(h(this,ge,"f"),h(this,tt,"f"),h(this,lr,"f"),h(this,fe,"f")),"f"),h(this,ar,"f")||Y(this,ar,Ih(this,h(this,ge,"f"),h(this,ot,"f"),h(this,fe,"f")),"f"),h(this,lr,"f").reset(),Y(this,Xt,null,"f"),Y(this,Ct,"","f"),Y(this,gn,null,"f"),Y(this,Jt,!1,"f"),this.parsed=!1,this}[Xh](e,r){return h(this,fe,"f").path.relative(e,r)}[ds](e,r,n,i=0,o=!1){let s=!!n||o;e=e||h(this,xn,"f"),h(this,re,"f").__=h(this,fe,"f").y18n.__,h(this,re,"f").configuration=this[ri]();let a=!!h(this,re,"f").configuration["populate--"],u=Object.assign({},h(this,re,"f").configuration,{"populate--":!0}),l=h(this,fe,"f").Parser.detailed(e,Object.assign({},h(this,re,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),c=Object.assign(l.argv,h(this,Xn,"f")),f,p=l.aliases,d=!1,m=!1;Object.keys(c).forEach(y=>{y===h(this,cr,"f")&&c[y]?d=!0:y===h(this,Sr,"f")&&c[y]&&(m=!0)}),c.$0=this.$0,this.parsed=l,i===0&&h(this,ge,"f").clearCachedHelpMessage();try{if(this[Sc](),r)return this[ni](c,a,!!n,!1);h(this,cr,"f")&&[h(this,cr,"f")].concat(p[h(this,cr,"f")]||[]).filter(C=>C.length>1).includes(""+c._[c._.length-1])&&(c._.pop(),d=!0),Y(this,Ta,!1,"f");let y=h(this,ot,"f").getCommands(),g=h(this,ar,"f").completionKey in c,b=d||g||o;if(c._.length){if(y.length){let w;for(let C=i||0,D;c._[C]!==void 0;C++)if(D=String(c._[C]),y.includes(D)&&D!==h(this,Xt,"f")){let R=h(this,ot,"f").runCommand(D,this,l,C+1,o,d||m||o);return this[ni](R,a,!!n,!1)}else if(!w&&D!==h(this,Xt,"f")){w=D;break}!h(this,ot,"f").hasDefaultCommand()&&h(this,va,"f")&&w&&!b&&h(this,tt,"f").recommendCommands(w,y)}h(this,Xt,"f")&&c._.includes(h(this,Xt,"f"))&&!g&&(h(this,ur,"f")&&mn(!0),this.showCompletionScript(),this.exit(0))}if(h(this,ot,"f").hasDefaultCommand()&&!b){let w=h(this,ot,"f").runCommand(null,this,l,0,o,d||m||o);return this[ni](w,a,!!n,!1)}if(g){h(this,ur,"f")&&mn(!0),e=[].concat(e);let w=e.slice(e.indexOf(`--${h(this,ar,"f").completionKey}`)+1);return h(this,ar,"f").getCompletion(w,(C,D)=>{if(C)throw new $e(C.message);(D||[]).forEach(R=>{h(this,Zi,"f").log(R)}),this.exit(0)}),this[ni](c,!a,!!n,!1)}if(h(this,Jt,"f")||(d?(h(this,ur,"f")&&mn(!0),s=!0,this.showHelp("log"),this.exit(0)):m&&(h(this,ur,"f")&&mn(!0),s=!0,h(this,ge,"f").showVersion("log"),this.exit(0))),!s&&h(this,re,"f").skipValidation.length>0&&(s=Object.keys(c).some(w=>h(this,re,"f").skipValidation.indexOf(w)>=0&&c[w]===!0)),!s){if(l.error)throw new $e(l.error.message);if(!g){let w=this[Pc](p,{},l.error);n||(f=Hn(c,this,h(this,lr,"f").getMiddleware(),!0)),f=this[$h](w,f??c),qe(f)&&!n&&(f=f.then(()=>Hn(c,this,h(this,lr,"f").getMiddleware(),!1)))}}}catch(y){if(y instanceof $e)h(this,ge,"f").fail(y.message,y);else throw y}return this[ni](f??c,a,!!n,!0)}[Pc](e,r,n,i){let o={...this.getDemandedOptions()};return s=>{if(n)throw new $e(n.message);h(this,tt,"f").nonOptionCount(s),h(this,tt,"f").requiredArguments(s,o);let a=!1;h(this,ei,"f")&&(a=h(this,tt,"f").unknownCommands(s)),h(this,Qn,"f")&&!a?h(this,tt,"f").unknownArguments(s,e,r,!!i):h(this,ti,"f")&&h(this,tt,"f").unknownArguments(s,e,{},!1,!1),h(this,tt,"f").limitedChoices(s),h(this,tt,"f").implications(s),h(this,tt,"f").conflicting(s)}}[Jh](){Y(this,Jt,!0,"f")}[ii](e){if(typeof e=="string")h(this,re,"f").key[e]=!0;else for(let r of e)h(this,re,"f").key[r]=!0}};function kh(t){return!!t&&typeof t.getInternalMethods=="function"}var ck=Qh(bc),em=ck;var tm="0.10.0";import{cosmiconfig as Tm}from"cosmiconfig";import{TypeScriptLoader as _m}from"cosmiconfig-typescript-loader";import PT from"node:fs/promises";import Im from"node:path";var Mc=jd(im(),1);function Bc(t,e,r){if(typeof e=="number"&&(r=e),Mc.default.has(t.toLowerCase())){e=Mc.default.get(t.toLowerCase());let n=t.charAt(0);n===n.toUpperCase()&&(e=n+e.slice(1)),t===t.toUpperCase()&&(e=e.toUpperCase())}else typeof e!="string"&&(e=(t.replace(/(?:s|x|z|ch|sh)$/i,"$&e").replace(/([^aeiou])y$/i,"$1ie")+"s").replace(/i?e?s$/i,n=>t.slice(-1)===t.slice(-1).toLowerCase()?n.toLowerCase():n.toUpperCase()));return Math.abs(r)===1?t:e}import{readPackage as LT}from"read-pkg";import{deepMergeDefined as Yc,log as dr,optionsSchema as MT,rulesSchema as BT}from"remark-mdat";var Oe;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Oe||(Oe={}));var Uc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Uc||(Uc={}));var V=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xr=t=>{switch(typeof t){case"undefined":return V.undefined;case"string":return V.string;case"number":return isNaN(t)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(t)?V.array:t===null?V.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?V.promise:typeof Map<"u"&&t instanceof Map?V.map:typeof Set<"u"&&t instanceof Set?V.set:typeof Date<"u"&&t instanceof Date?V.date:V.object;default:return V.unknown}},N=Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),hk=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),er=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(o){return o.message},n={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,u=0;for(;u<s.path.length;){let l=s.path[u];u===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(s))):a[l]=a[l]||{_errors:[]},a=a[l],u++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};er.create=t=>new er(t);var to=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===V.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Oe.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${Oe.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Oe.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${Oe.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Oe.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case N.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,Oe.assertNever(t)}return{message:r}},am=to;function mk(t){am=t}function Da(){return am}var Ra=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)a=l(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},gk=[];function U(t,e){let r=Da(),n=Ra({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===to?void 0:to].filter(i=>!!i)});t.common.issues.push(n)}var vt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return pe;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return pe;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}},pe=Object.freeze({status:"aborted"}),eo=t=>({status:"dirty",value:t}),Pt=t=>({status:"valid",value:t}),zc=t=>t.status==="aborted",$c=t=>t.status==="dirty",oi=t=>t.status==="valid",gs=t=>typeof Promise<"u"&&t instanceof Promise;function Fa(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function um(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var Q;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Q||(Q={}));var hs,ms,pr=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},om=(t,e)=>{if(oi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new er(t.common.issues);return this._error=r,this._error}}};function Ae(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{var u,l;let{message:c}=t;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(u=c??n)!==null&&u!==void 0?u:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:a.defaultError}},description:i}}var Ce=class{get description(){return this._def.description}_getType(e){return Xr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Xr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:Xr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(gs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xr(e)},o=this._parseSync({data:e,path:i.path,parent:i});return om(i,o)}"~validate"(e){var r,n;let i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xr(e)};if(!this["~standard"].async)try{let o=this._parseSync({data:e,path:[],parent:i});return oi(o)?{value:o.value}:{issues:i.common.issues}}catch(o){!((n=(r=o?.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(o=>oi(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xr(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(gs(i)?i:Promise.resolve(i));return om(n,o)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:N.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new tr({schema:this,typeName:le.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return fr.create(this,this._def)}nullable(){return Ir.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qr.create(this)}promise(){return An.create(this,this._def)}or(e){return pi.create([this,e],this._def)}and(e){return di.create(this,e,this._def)}transform(e){return new tr({...Ae(this._def),schema:this,typeName:le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new yi({...Ae(this._def),innerType:this,defaultValue:r,typeName:le.ZodDefault})}brand(){return new xs({typeName:le.ZodBranded,type:this,...Ae(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new bi({...Ae(this._def),innerType:this,catchValue:r,typeName:le.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ys.create(this,e)}readonly(){return Ei.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xk=/^c[^\s-]{8,}$/i,yk=/^[0-9a-z]+$/,bk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ek=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ak=/^[a-z0-9_-]{21}$/i,Ck=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,wk=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kk=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Tk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",jc,_k=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Sk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,vk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ik=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ok=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Dk=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lm="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Rk=new RegExp(`^${lm}$`);function cm(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Fk(t){return new RegExp(`^${cm(t)}$`)}function fm(t){let e=`${lm}T${cm(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Nk(t,e){return!!((e==="v4"||!e)&&_k.test(t)||(e==="v6"||!e)&&vk.test(t))}function Pk(t,e){if(!Ck.test(t))return!1;try{let[r]=t.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function Lk(t,e){return!!((e==="v4"||!e)&&Sk.test(t)||(e==="v6"||!e)&&Ik.test(t))}var bn=class t extends Ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.string,received:o.parsedType}),pe}let n=new vt,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?U(i,{code:N.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&U(i,{code:N.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")kk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"email",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")jc||(jc=new RegExp(Tk,"u")),jc.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"emoji",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Ek.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"uuid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Ak.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"nanoid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")xk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")yk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid2",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")bk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ulid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),U(i,{validation:"url",code:N.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"regex",code:N.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?fm(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Rk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Fk(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?wk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"duration",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Nk(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ip",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Pk(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"jwt",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Lk(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cidr",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Ok.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?Dk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64url",code:N.invalid_string,message:o.message}),n.dirty()):Oe.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:N.invalid_string,...Q.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Q.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Q.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Q.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Q.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Q.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Q.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Q.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Q.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Q.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Q.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Q.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Q.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Q.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...Q.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Q.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Q.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Q.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Q.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Q.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Q.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Q.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Q.errToObj(r)})}nonempty(e){return this.min(1,Q.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};bn.create=t=>{var e;return new bn({checks:[],typeName:le.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};function Mk(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,o=parseInt(t.toFixed(i).replace(".","")),s=parseInt(e.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}var si=class t extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==V.number){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.number,received:o.parsedType}),pe}let n,i=new vt;for(let o of this._def.checks)o.kind==="int"?Oe.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:N.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Mk(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_finite,message:o.message}),i.dirty()):Oe.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Q.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Q.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Oe.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};si.create=t=>new si({checks:[],typeName:le.ZodNumber,coerce:t?.coerce||!1,...Ae(t)});var ai=class t extends Ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==V.bigint)return this._getInvalidInput(e);let n,i=new vt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Oe.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:V.bigint,received:r.parsedType}),pe}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ai.create=t=>{var e;return new ai({checks:[],typeName:le.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};var ui=class extends Ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.boolean,received:n.parsedType}),pe}return Pt(e.data)}};ui.create=t=>new ui({typeName:le.ZodBoolean,coerce:t?.coerce||!1,...Ae(t)});var li=class t extends Ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.date,received:o.parsedType}),pe}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_date}),pe}let n=new vt,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Oe.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Q.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Q.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};li.create=t=>new li({checks:[],coerce:t?.coerce||!1,typeName:le.ZodDate,...Ae(t)});var ro=class extends Ce{_parse(e){if(this._getType(e)!==V.symbol){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.symbol,received:n.parsedType}),pe}return Pt(e.data)}};ro.create=t=>new ro({typeName:le.ZodSymbol,...Ae(t)});var ci=class extends Ce{_parse(e){if(this._getType(e)!==V.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.undefined,received:n.parsedType}),pe}return Pt(e.data)}};ci.create=t=>new ci({typeName:le.ZodUndefined,...Ae(t)});var fi=class extends Ce{_parse(e){if(this._getType(e)!==V.null){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.null,received:n.parsedType}),pe}return Pt(e.data)}};fi.create=t=>new fi({typeName:le.ZodNull,...Ae(t)});var En=class extends Ce{constructor(){super(...arguments),this._any=!0}_parse(e){return Pt(e.data)}};En.create=t=>new En({typeName:le.ZodAny,...Ae(t)});var Jr=class extends Ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Pt(e.data)}};Jr.create=t=>new Jr({typeName:le.ZodUnknown,...Ae(t)});var Er=class extends Ce{_parse(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:V.never,received:r.parsedType}),pe}};Er.create=t=>new Er({typeName:le.ZodNever,...Ae(t)});var no=class extends Ce{_parse(e){if(this._getType(e)!==V.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.void,received:n.parsedType}),pe}return Pt(e.data)}};no.create=t=>new no({typeName:le.ZodVoid,...Ae(t)});var Qr=class t extends Ce{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==V.array)return U(r,{code:N.invalid_type,expected:V.array,received:r.parsedType}),pe;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(s||a)&&(U(r,{code:s?N.too_big:N.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(U(r,{code:N.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(U(r,{code:N.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>i.type._parseAsync(new pr(r,s,r.path,a)))).then(s=>vt.mergeArray(n,s));let o=[...r.data].map((s,a)=>i.type._parseSync(new pr(r,s,r.path,a)));return vt.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Q.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Q.toString(r)}})}nonempty(e){return this.min(1,e)}};Qr.create=(t,e)=>new Qr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:le.ZodArray,...Ae(e)});function Qi(t){if(t instanceof Vt){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=fr.create(Qi(n))}return new Vt({...t._def,shape:()=>e})}else return t instanceof Qr?new Qr({...t._def,type:Qi(t.element)}):t instanceof fr?fr.create(Qi(t.unwrap())):t instanceof Ir?Ir.create(Qi(t.unwrap())):t instanceof vr?vr.create(t.items.map(e=>Qi(e))):t}var Vt=class t extends Ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Oe.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==V.object){let l=this._getOrReturnCtx(e);return U(l,{code:N.invalid_type,expected:V.object,received:l.parsedType}),pe}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Er&&this._def.unknownKeys==="strip"))for(let l in i.data)s.includes(l)||a.push(l);let u=[];for(let l of s){let c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new pr(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Er){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of a)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")a.length>0&&(U(i,{code:N.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of a){let f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new pr(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let f=await c.key,p=await c.value;l.push({key:f,value:p,alwaysSet:c.alwaysSet})}return l}).then(l=>vt.mergeObjectSync(n,l)):vt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return Q.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,o,s,a;let u=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,r,n).message)!==null&&s!==void 0?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Q.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:le.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return Oe.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return Qi(this)}partial(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof fr;)o=o._def.innerType;r[n]=o}}),new t({...this._def,shape:()=>r})}keyof(){return pm(Oe.objectKeys(this.shape))}};Vt.create=(t,e)=>new Vt({shape:()=>t,unknownKeys:"strip",catchall:Er.create(),typeName:le.ZodObject,...Ae(e)});Vt.strictCreate=(t,e)=>new Vt({shape:()=>t,unknownKeys:"strict",catchall:Er.create(),typeName:le.ZodObject,...Ae(e)});Vt.lazycreate=(t,e)=>new Vt({shape:t,unknownKeys:"strip",catchall:Er.create(),typeName:le.ZodObject,...Ae(e)});var pi=class extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new er(a.ctx.common.issues));return U(r,{code:N.invalid_union,unionErrors:s}),pe}if(r.common.async)return Promise.all(n.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let u of n){let l={...r,common:{...r.common,issues:[]},parent:null},c=u._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(u=>new er(u));return U(r,{code:N.invalid_union,unionErrors:a}),pe}}get options(){return this._def.options}};pi.create=(t,e)=>new pi({options:t,typeName:le.ZodUnion,...Ae(e)});var Zr=t=>t instanceof hi?Zr(t.schema):t instanceof tr?Zr(t.innerType()):t instanceof mi?[t.value]:t instanceof gi?t.options:t instanceof xi?Oe.objectValues(t.enum):t instanceof yi?Zr(t._def.innerType):t instanceof ci?[void 0]:t instanceof fi?[null]:t instanceof fr?[void 0,...Zr(t.unwrap())]:t instanceof Ir?[null,...Zr(t.unwrap())]:t instanceof xs||t instanceof Ei?Zr(t.unwrap()):t instanceof bi?Zr(t._def.innerType):[],Na=class t extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.object)return U(r,{code:N.invalid_type,expected:V.object,received:r.parsedType}),pe;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(U(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let o of r){let s=Zr(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:le.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Ae(n)})}};function qc(t,e){let r=Xr(t),n=Xr(e);if(t===e)return{valid:!0,data:t};if(r===V.object&&n===V.object){let i=Oe.objectKeys(e),o=Oe.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let u=qc(t[a],e[a]);if(!u.valid)return{valid:!1};s[a]=u.data}return{valid:!0,data:s}}else if(r===V.array&&n===V.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],u=qc(s,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===V.date&&n===V.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var di=class extends Ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(o,s)=>{if(zc(o)||zc(s))return pe;let a=qc(o.value,s.value);return a.valid?(($c(o)||$c(s))&&r.dirty(),{status:r.value,value:a.data}):(U(n,{code:N.invalid_intersection_types}),pe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};di.create=(t,e,r)=>new di({left:t,right:e,typeName:le.ZodIntersection,...Ae(r)});var vr=class t extends Ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.array)return U(n,{code:N.invalid_type,expected:V.array,received:n.parsedType}),pe;if(n.data.length<this._def.items.length)return U(n,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&n.data.length>this._def.items.length&&(U(n,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new pr(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>vt.mergeArray(r,s)):vt.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};vr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vr({items:t,typeName:le.ZodTuple,rest:null,...Ae(e)})};var Pa=class t extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.object)return U(n,{code:N.invalid_type,expected:V.object,received:n.parsedType}),pe;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in n.data)i.push({key:o._parse(new pr(n,a,n.path,a)),value:s._parse(new pr(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?vt.mergeObjectAsync(r,i):vt.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Ce?new t({keyType:e,valueType:r,typeName:le.ZodRecord,...Ae(n)}):new t({keyType:bn.create(),valueType:e,typeName:le.ZodRecord,...Ae(r)})}},io=class extends Ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.map)return U(n,{code:N.invalid_type,expected:V.map,received:n.parsedType}),pe;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,u],l)=>({key:i._parse(new pr(n,a,n.path,[l,"key"])),value:o._parse(new pr(n,u,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of s){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return pe;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of s){let l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return pe;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}}}};io.create=(t,e,r)=>new io({valueType:e,keyType:t,typeName:le.ZodMap,...Ae(r)});var oo=class t extends Ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.set)return U(n,{code:N.invalid_type,expected:V.set,received:n.parsedType}),pe;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(U(n,{code:N.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(U(n,{code:N.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function s(u){let l=new Set;for(let c of u){if(c.status==="aborted")return pe;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((u,l)=>o._parse(new pr(n,u,n.path,l)));return n.common.async?Promise.all(a).then(u=>s(u)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Q.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};oo.create=(t,e)=>new oo({valueType:t,minSize:null,maxSize:null,typeName:le.ZodSet,...Ae(e)});var La=class t extends Ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.function)return U(r,{code:N.invalid_type,expected:V.function,received:r.parsedType}),pe;function n(a,u){return Ra({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Da(),to].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:u}})}function i(a,u){return Ra({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Da(),to].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:u}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof An){let a=this;return Pt(async function(...u){let l=new er([]),c=await a._def.args.parseAsync(u,o).catch(d=>{throw l.addIssue(n(u,d)),l}),f=await Reflect.apply(s,this,c);return await a._def.returns._def.type.parseAsync(f,o).catch(d=>{throw l.addIssue(i(f,d)),l})})}else{let a=this;return Pt(function(...u){let l=a._def.args.safeParse(u,o);if(!l.success)throw new er([n(u,l.error)]);let c=Reflect.apply(s,this,l.data),f=a._def.returns.safeParse(c,o);if(!f.success)throw new er([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:vr.create(e).rest(Jr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||vr.create([]).rest(Jr.create()),returns:r||Jr.create(),typeName:le.ZodFunction,...Ae(n)})}},hi=class extends Ce{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};hi.create=(t,e)=>new hi({getter:t,typeName:le.ZodLazy,...Ae(e)});var mi=class extends Ce{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return U(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}};mi.create=(t,e)=>new mi({value:t,typeName:le.ZodLiteral,...Ae(e)});function pm(t,e){return new gi({values:t,typeName:le.ZodEnum,...Ae(e)})}var gi=class t extends Ce{constructor(){super(...arguments),hs.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{expected:Oe.joinValues(n),received:r.parsedType,code:N.invalid_type}),pe}if(Fa(this,hs,"f")||um(this,hs,new Set(this._def.values),"f"),!Fa(this,hs,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{received:r.data,code:N.invalid_enum_value,options:n}),pe}return Pt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};hs=new WeakMap;gi.create=pm;var xi=class extends Ce{constructor(){super(...arguments),ms.set(this,void 0)}_parse(e){let r=Oe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==V.string&&n.parsedType!==V.number){let i=Oe.objectValues(r);return U(n,{expected:Oe.joinValues(i),received:n.parsedType,code:N.invalid_type}),pe}if(Fa(this,ms,"f")||um(this,ms,new Set(Oe.getValidEnumValues(this._def.values)),"f"),!Fa(this,ms,"f").has(e.data)){let i=Oe.objectValues(r);return U(n,{received:n.data,code:N.invalid_enum_value,options:i}),pe}return Pt(e.data)}get enum(){return this._def.values}};ms=new WeakMap;xi.create=(t,e)=>new xi({values:t,typeName:le.ZodNativeEnum,...Ae(e)});var An=class extends Ce{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.promise&&r.common.async===!1)return U(r,{code:N.invalid_type,expected:V.promise,received:r.parsedType}),pe;let n=r.parsedType===V.promise?r.data:Promise.resolve(r.data);return Pt(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};An.create=(t,e)=>new An({type:t,typeName:le.ZodPromise,...Ae(e)});var tr=class extends Ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{U(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return pe;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?pe:u.status==="dirty"||r.value==="dirty"?eo(u.value):u});{if(r.value==="aborted")return pe;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?pe:a.status==="dirty"||r.value==="dirty"?eo(a.value):a}}if(i.type==="refinement"){let s=a=>{let u=i.refinement(a,o);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?pe:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?pe:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!oi(s))return s;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>oi(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:r.value,value:a})):s);Oe.assertNever(i)}};tr.create=(t,e,r)=>new tr({schema:t,typeName:le.ZodEffects,effect:e,...Ae(r)});tr.createWithPreprocess=(t,e,r)=>new tr({schema:e,effect:{type:"preprocess",transform:t},typeName:le.ZodEffects,...Ae(r)});var fr=class extends Ce{_parse(e){return this._getType(e)===V.undefined?Pt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};fr.create=(t,e)=>new fr({innerType:t,typeName:le.ZodOptional,...Ae(e)});var Ir=class extends Ce{_parse(e){return this._getType(e)===V.null?Pt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ir.create=(t,e)=>new Ir({innerType:t,typeName:le.ZodNullable,...Ae(e)});var yi=class extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===V.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};yi.create=(t,e)=>new yi({innerType:t,typeName:le.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ae(e)});var bi=class extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return gs(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new er(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};bi.create=(t,e)=>new bi({innerType:t,typeName:le.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ae(e)});var so=class extends Ce{_parse(e){if(this._getType(e)!==V.nan){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.nan,received:n.parsedType}),pe}return{status:"valid",value:e.data}}};so.create=t=>new so({typeName:le.ZodNaN,...Ae(t)});var Bk=Symbol("zod_brand"),xs=class extends Ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ys=class t extends Ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?pe:o.status==="dirty"?(r.dirty(),eo(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?pe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:le.ZodPipeline})}},Ei=class extends Ce{_parse(e){let r=this._def.innerType._parse(e),n=i=>(oi(i)&&(i.value=Object.freeze(i.value)),i);return gs(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};Ei.create=(t,e)=>new Ei({innerType:t,typeName:le.ZodReadonly,...Ae(e)});function dm(t,e={},r){return t?En.create().superRefine((n,i)=>{var o,s;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(s=(o=a.fatal)!==null&&o!==void 0?o:r)!==null&&s!==void 0?s:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:u})}}):En.create()}var jk={object:Vt.lazycreate},le;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(le||(le={}));var Uk=(t,e={message:`Input not instance of ${t.name}`})=>dm(r=>r instanceof t,e),hm=bn.create,mm=si.create,zk=so.create,$k=ai.create,gm=ui.create,qk=li.create,Vk=ro.create,Gk=ci.create,Wk=fi.create,Hk=En.create,Kk=Jr.create,Yk=Er.create,Zk=no.create,Xk=Qr.create,Jk=Vt.create,Qk=Vt.strictCreate,eT=pi.create,tT=Na.create,rT=di.create,nT=vr.create,iT=Pa.create,oT=io.create,sT=oo.create,aT=La.create,uT=hi.create,lT=mi.create,cT=gi.create,fT=xi.create,pT=An.create,sm=tr.create,dT=fr.create,hT=Ir.create,mT=tr.createWithPreprocess,gT=ys.create,xT=()=>hm().optional(),yT=()=>mm().optional(),bT=()=>gm().optional(),ET={string:t=>bn.create({...t,coerce:!0}),number:t=>si.create({...t,coerce:!0}),boolean:t=>ui.create({...t,coerce:!0}),bigint:t=>ai.create({...t,coerce:!0}),date:t=>li.create({...t,coerce:!0})},AT=pe,X=Object.freeze({__proto__:null,defaultErrorMap:to,setErrorMap:mk,getErrorMap:Da,makeIssue:Ra,EMPTY_PATH:gk,addIssueToContext:U,ParseStatus:vt,INVALID:pe,DIRTY:eo,OK:Pt,isAborted:zc,isDirty:$c,isValid:oi,isAsync:gs,get util(){return Oe},get objectUtil(){return Uc},ZodParsedType:V,getParsedType:Xr,ZodType:Ce,datetimeRegex:fm,ZodString:bn,ZodNumber:si,ZodBigInt:ai,ZodBoolean:ui,ZodDate:li,ZodSymbol:ro,ZodUndefined:ci,ZodNull:fi,ZodAny:En,ZodUnknown:Jr,ZodNever:Er,ZodVoid:no,ZodArray:Qr,ZodObject:Vt,ZodUnion:pi,ZodDiscriminatedUnion:Na,ZodIntersection:di,ZodTuple:vr,ZodRecord:Pa,ZodMap:io,ZodSet:oo,ZodFunction:La,ZodLazy:hi,ZodLiteral:mi,ZodEnum:gi,ZodNativeEnum:xi,ZodPromise:An,ZodEffects:tr,ZodTransformer:tr,ZodOptional:fr,ZodNullable:Ir,ZodDefault:yi,ZodCatch:bi,ZodNaN:so,BRAND:Bk,ZodBranded:xs,ZodPipeline:ys,ZodReadonly:Ei,custom:dm,Schema:Ce,ZodSchema:Ce,late:jk,get ZodFirstPartyTypeKind(){return le},coerce:ET,any:Hk,array:Xk,bigint:$k,boolean:gm,date:qk,discriminatedUnion:tT,effect:sm,enum:cT,function:aT,instanceof:Uk,intersection:rT,lazy:uT,literal:lT,map:oT,nan:zk,nativeEnum:fT,never:Yk,null:Wk,nullable:hT,number:mm,object:Jk,oboolean:bT,onumber:yT,optional:dT,ostring:xT,pipeline:gT,preprocess:mT,promise:pT,record:iT,set:sT,strictObject:Qk,string:hm,symbol:Vk,transformer:sm,tuple:nT,undefined:Gk,union:eT,unknown:Kk,void:Zk,NEVER:AT,ZodIssueCode:N,quotelessJson:hk,ZodError:er});import{defaultLoaders as CT}from"cosmiconfig";function Vc(t,e){let r=CT[".json"],n=r(t,e);return xm(n)}function xm(t,e="",r={}){for(let[n,i]of Object.entries(t)){let o=e?`${e}.${n}`:n;typeof i=="object"&&i!==null&&!Array.isArray(i)?xm(i,o,r):i===null?r[o]="null":r[o]=i.toString()}return r}import DT from"node:fs";import en from"node:path";import ST from"node:process";import wT from"node:process";import kT from"node:fs/promises";import{fileURLToPath as TT}from"node:url";import ao from"node:path";var ym=t=>t instanceof URL?TT(t):t;async function Ma(t,{cwd:e=wT.cwd(),type:r="file",stopAt:n}={}){let i=ao.resolve(ym(e)??""),{root:o}=ao.parse(i);for(n=ao.resolve(i,ym(n??o));i&&i!==n&&i!==o;){let s=ao.isAbsolute(t)?t:ao.join(i,t);try{let a=await kT.stat(s);if(r==="file"&&a.isFile()||r==="directory"&&a.isDirectory())return s}catch{}i=ao.dirname(i)}}async function bm({cwd:t=ST.cwd()}={}){return Ma("package.json",{cwd:t})}import vT from"node:fs";import IT from"node:fs/promises";async function Gc(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await IT[t](r))[e]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function Wc(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return vT[t](r)[e]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}var uo=Gc.bind(void 0,"stat","isFile"),o2=Gc.bind(void 0,"stat","isDirectory"),s2=Gc.bind(void 0,"lstat","isSymbolicLink"),Hc=Wc.bind(void 0,"statSync","isFile"),a2=Wc.bind(void 0,"statSync","isDirectory"),u2=Wc.bind(void 0,"lstatSync","isSymbolicLink");import{log as Am}from"remark-mdat";import{Configuration as RT}from"unified-engine";import OT from"node:os";var Em=OT.homedir();function Kc(t){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return Em?t.replace(/^~(?=$|\/|\\)/,Em):t}function FT(t,e){let r=e===0?1:Math.floor(Math.log10(Math.abs(e))+1);return t.toString().padStart(r,"0")}function wm(t,e,r,n){let i=[];for(let[o,s]of t.entries()){let a=r&&t.length>1?`-${FT(o+1,t.length+1)}`:"",u=NT(s,e,r,n,a);i.push(u)}return i}function NT(t,e,r,n,i=""){let o=Cm(t),s=e?Cm(e):void 0;if(!Hc(o))throw new Error(`Input file not found: "${o}"`);if(s){if(Hc(s))throw new Error(`Output path must be a directory, received a file path: "${s}"`);DT.mkdirSync(s,{recursive:!0})}let a=r?en.basename(r,en.extname(r)):en.basename(o,en.extname(o)),u=`.${n??(r&&en.extname(r)!==""?en.extname(r):en.extname(t)===""?"":en.extname(t))}`,l=`${a}${i}${u}`,c=s??en.dirname(o);return{input:o,name:l,output:c}}function Cm(t){return Kc(t)}async function Ba(){return bm()}function ja(t){return t==null?[]:Array.isArray(t)?t:[t]}async function km(){let t=new RT({cwd:process.cwd(),detectConfig:!0,packageField:"remarkConfig",rcName:".remarkrc"}),e=await new Promise(r=>{t.load("",(n,i)=>{if(n){console.error(n),r();return}r(i)})});if(e){let{filePath:r}=e;return r===void 0?Am.info('No ambient Remark configuration file found"'):Am.info(`Found and loaded ambient Remark configuration from "${r}"`),e}throw new Error("Failed to load ambient remark configuration")}var Sm=MT.merge(X.object({assetsPath:X.string().optional(),packageFile:X.string().optional()})).describe("Config Extension");async function Ai(t){let{additionalConfig:e,additionalRules:r,searchFrom:n}=t??{},i={addMetaComment:!1,assetsPath:"./assets",closingPrefix:"/",keywordPrefix:"",metaCommentIdentifier:"+",packageFile:await Ba(),rules:{mdat:"Powered by the Markdown Autophagic Template system: [mdat](https://github.com/kitschpatrol/mdat)."}},o=Tm("mdat",{loaders:{".ts":_m()}}),s=await o.search(n);if(s){let{config:a,filepath:u}=s,l=a;if(dr.info(`Using config from "${u}"`),u.endsWith("package.json")&&typeof a=="string"){dr.info(`Detected shared config string: "${a}"`);let{default:f}=await import(a);l=f}let c=vm(l,Sm);c&&(i=Yc(i,c))}if(e!==void 0){let a=Array.isArray(e)?e:[e];for(let u of a){let l;if(typeof u=="string"){let f=await o.load(u);if(f==null)continue;let{config:p,filepath:d}=f;dr.info(`Loaded additional config from "${d}"`),l=p}else l=u;if(l===void 0)continue;dr.info("Merging configuration object");let c=vm(l,Sm);c!==void 0&&(i=Yc(i,c))}}if(r!==void 0){let a=Array.isArray(r)?r:[r],u=Tm("mdat",{loaders:{".json":Vc,".ts":_m()}});for(let l of a){let c;if(typeof l=="string"){let p;if(Im.basename(l).endsWith("package.json")){let y=await PT.readFile(l,"utf8");p={config:Vc(l,y),filepath:l}}else p=await u.load(l);if(p==null)continue;let{config:d,filepath:m}=p;dr.info(`Loaded additional config from "${m}"`),c=d}else c=l;if(c===void 0)continue;dr.info("Merging rules into configuration object");let f=jT(c,BT);f!==void 0&&(i=Yc(i,f))}}if(i.rules){let a=Object.keys(i.rules).sort().map(u=>`"${St.bold.green(u)}"`);dr.info(`Loaded ${St.bold(a.length)} mdat comment expansion ${Bc("rule",a.length)}:`);for(let u of a)dr.info(` ${u}`)}else dr.error("No rules loaded from additional configurations or rules, using default.");return Ua=i,i}function jT(t,e){if(e.safeParse(t).success)return{rules:t};dr.error(`Rules object has the wrong shape. Ignoring and using default configuration:
|
|
70
|
+
${JSON.stringify(t,void 0,2)}`)}function vm(t,e){if(e.safeParse(t).success)return t;dr.error(`Config object has the wrong shape. Ignoring and using default configuration:
|
|
71
|
+
${JSON.stringify(t,void 0,2)}`)}var Ua;async function Or(){return Ua===void 0&&(dr.warn("getConfig(): config was undefined"),Ua??=await Ai()),Ua}var Zc;async function rr(){let{packageFile:t}=await Or();if(t===void 0)throw new Error("No packageFile found or set in config");if(Zc??=await LT({cwd:Im.dirname(t)}),Zc===void 0)throw new Error("No package.json found");return Zc}var UT={};function tn(t,e){let r=e||UT,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Dm(t,n,i)}function Dm(t,e,r){if(zT(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Om(t.children,e,r)}return Array.isArray(t)?Om(t,e,r):""}function Om(t,e,r){let n=[],i=-1;for(;++i<t.length;)n[i]=Dm(t[i],e,r);return n.join("")}function zT(t){return!!(t&&typeof t=="object")}var Xc={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
72
|
+
`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"};var $T={}.hasOwnProperty;function lo(t){return $T.call(Xc,t)?Xc[t]:!1}function st(t,e,r,n){let i=t.length,o=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(e,r),t.splice(...s);else for(r&&t.splice(e,r);o<n.length;)s=n.slice(o,o+1e4),s.unshift(e,0),t.splice(...s),o+=1e4,e+=1e4}function Lt(t,e){return t.length>0?(st(t,t.length,0,e),t):e}var Rm={}.hasOwnProperty;function za(t){let e={},r=-1;for(;++r<t.length;)qT(e,t[r]);return e}function qT(t,e){let r;for(r in e){let i=(Rm.call(t,r)?t[r]:void 0)||(t[r]={}),o=e[r],s;if(o)for(s in o){Rm.call(i,s)||(i[s]=[]);let a=o[s];VT(i[s],Array.isArray(a)?a:a?[a]:[])}}}function VT(t,e){let r=-1,n=[];for(;++r<e.length;)(e[r].add==="after"?t:n).push(e[r]);st(t,0,0,n)}function $a(t,e){let r=Number.parseInt(t,e);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function It(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var xt=Cn(/[A-Za-z]/),yt=Cn(/[\dA-Za-z]/),Fm=Cn(/[#-'*+\--9=?A-Z^-~]/);function Ci(t){return t!==null&&(t<32||t===127)}var bs=Cn(/\d/),Nm=Cn(/[\dA-Fa-f]/),Pm=Cn(/[!-/:-@[-`{-~]/);function z(t){return t!==null&&t<-2}function ke(t){return t!==null&&(t<0||t===32)}function se(t){return t===-2||t===-1||t===32}var wi=Cn(new RegExp("\\p{P}|\\p{S}","u")),Dr=Cn(/\s/);function Cn(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function ie(t,e,r,n){let i=n?n-1:Number.POSITIVE_INFINITY,o=0;return s;function s(u){return se(u)?(t.enter(r),a(u)):e(u)}function a(u){return se(u)&&o++<i?(t.consume(u),a):(t.exit(r),e(u))}}var Lm={tokenize:GT};function GT(t){let e=t.attempt(this.parser.constructs.contentInitial,n,i),r;return e;function n(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),ie(t,e,"linePrefix")}function i(a){return t.enter("paragraph"),o(a)}function o(a){let u=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=u),r=u,s(a)}function s(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return z(a)?(t.consume(a),t.exit("chunkText"),o):(t.consume(a),s)}}var Bm={tokenize:WT},Mm={tokenize:HT};function WT(t){let e=this,r=[],n=0,i,o,s;return a;function a(C){if(n<r.length){let D=r[n];return e.containerState=D[1],t.attempt(D[0].continuation,u,l)(C)}return l(C)}function u(C){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&w();let D=e.events.length,R=D,S;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){S=e.events[R][1].end;break}b(n);let de=D;for(;de<e.events.length;)e.events[de][1].end={...S},de++;return st(e.events,R+1,0,e.events.slice(D)),e.events.length=de,l(C)}return a(C)}function l(C){if(n===r.length){if(!i)return p(C);if(i.currentConstruct&&i.currentConstruct.concrete)return m(C);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Mm,c,f)(C)}function c(C){return i&&w(),b(n),p(C)}function f(C){return e.parser.lazy[e.now().line]=n!==r.length,s=e.now().offset,m(C)}function p(C){return e.containerState={},t.attempt(Mm,d,m)(C)}function d(C){return n++,r.push([e.currentConstruct,e.containerState]),p(C)}function m(C){if(C===null){i&&w(),b(0),t.consume(C);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),y(C)}function y(C){if(C===null){g(t.exit("chunkFlow"),!0),b(0),t.consume(C);return}return z(C)?(t.consume(C),g(t.exit("chunkFlow")),n=0,e.interrupt=void 0,a):(t.consume(C),y)}function g(C,D){let R=e.sliceStream(C);if(D&&R.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(R),e.parser.lazy[C.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;let de=e.events.length,ye=de,be,_;for(;ye--;)if(e.events[ye][0]==="exit"&&e.events[ye][1].type==="chunkFlow"){if(be){_=e.events[ye][1].end;break}be=!0}for(b(n),S=de;S<e.events.length;)e.events[S][1].end={..._},S++;st(e.events,ye+1,0,e.events.slice(de)),e.events.length=S}}function b(C){let D=r.length;for(;D-- >C;){let R=r[D];e.containerState=R[1],R[0].exit.call(e,t)}r.length=C}function w(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function HT(t,e,r){return ie(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rn(t){if(t===null||ke(t)||Dr(t))return 1;if(wi(t))return 2}function wn(t,e,r){let n=[],i=-1;for(;++i<t.length;){let o=t[i].resolveAll;o&&!n.includes(o)&&(e=o(e,r),n.push(o))}return e}var Es={name:"attention",resolveAll:KT,tokenize:YT};function KT(t,e){let r=-1,n,i,o,s,a,u,l,c;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){for(n=r;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[n][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;u=t[n][1].end.offset-t[n][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;let f={...t[n][1].end},p={...t[r][1].start};jm(f,-u),jm(p,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...t[n][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[r][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},t[n][1].end={...s.start},t[r][1].start={...a.end},l=[],t[n][1].end.offset-t[n][1].start.offset&&(l=Lt(l,[["enter",t[n][1],e],["exit",t[n][1],e]])),l=Lt(l,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),l=Lt(l,wn(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),l=Lt(l,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[r][1].end.offset-t[r][1].start.offset?(c=2,l=Lt(l,[["enter",t[r][1],e],["exit",t[r][1],e]])):c=0,st(t,n-1,r-n+3,l),r=n+l.length-c-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function YT(t,e){let r=this.parser.constructs.attentionMarkers.null,n=this.previous,i=rn(n),o;return s;function s(u){return o=u,t.enter("attentionSequence"),a(u)}function a(u){if(u===o)return t.consume(u),a;let l=t.exit("attentionSequence"),c=rn(u),f=!c||c===2&&i||r.includes(u),p=!i||i===2&&c||r.includes(n);return l._open=!!(o===42?f:f&&(i||!p)),l._close=!!(o===42?p:p&&(c||!f)),e(u)}}function jm(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}var Jc={name:"autolink",tokenize:ZT};function ZT(t,e,r){let n=0;return i;function i(d){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(d){return xt(d)?(t.consume(d),s):d===64?r(d):l(d)}function s(d){return d===43||d===45||d===46||yt(d)?(n=1,a(d)):l(d)}function a(d){return d===58?(t.consume(d),n=0,u):(d===43||d===45||d===46||yt(d))&&n++<32?(t.consume(d),a):(n=0,l(d))}function u(d){return d===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):d===null||d===32||d===60||Ci(d)?r(d):(t.consume(d),u)}function l(d){return d===64?(t.consume(d),c):Fm(d)?(t.consume(d),l):r(d)}function c(d){return yt(d)?f(d):r(d)}function f(d){return d===46?(t.consume(d),n=0,c):d===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):p(d)}function p(d){if((d===45||yt(d))&&n++<63){let m=d===45?p:f;return t.consume(d),m}return r(d)}}var Rr={partial:!0,tokenize:XT};function XT(t,e,r){return n;function n(o){return se(o)?ie(t,i,"linePrefix")(o):i(o)}function i(o){return o===null||z(o)?e(o):r(o)}}var qa={continuation:{tokenize:QT},exit:e_,name:"blockQuote",tokenize:JT};function JT(t,e,r){let n=this;return i;function i(s){if(s===62){let a=n.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),o}return r(s)}function o(s){return se(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function QT(t,e,r){let n=this;return i;function i(s){return se(s)?ie(t,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return t.attempt(qa,e,r)(s)}}function e_(t){t.exit("blockQuote")}var Va={name:"characterEscape",tokenize:t_};function t_(t,e,r){return n;function n(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),i}function i(o){return Pm(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):r(o)}}var Ga={name:"characterReference",tokenize:r_};function r_(t,e,r){let n=this,i=0,o,s;return a;function a(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),u}function u(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),o=31,s=yt,c(f))}function l(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,s=Nm,c):(t.enter("characterReferenceValue"),o=7,s=bs,c(f))}function c(f){if(f===59&&i){let p=t.exit("characterReferenceValue");return s===yt&&!lo(n.sliceSerialize(p))?r(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(f)&&i++<o?(t.consume(f),c):r(f)}}var Um={partial:!0,tokenize:i_},Wa={concrete:!0,name:"codeFenced",tokenize:n_};function n_(t,e,r){let n=this,i={partial:!0,tokenize:R},o=0,s=0,a;return u;function u(S){return l(S)}function l(S){let de=n.events[n.events.length-1];return o=de&&de[1].type==="linePrefix"?de[2].sliceSerialize(de[1],!0).length:0,a=S,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===a?(s++,t.consume(S),c):s<3?r(S):(t.exit("codeFencedFenceSequence"),se(S)?ie(t,f,"whitespace")(S):f(S))}function f(S){return S===null||z(S)?(t.exit("codeFencedFence"),n.interrupt?e(S):t.check(Um,y,D)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||z(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(S)):se(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),ie(t,d,"whitespace")(S)):S===96&&S===a?r(S):(t.consume(S),p)}function d(S){return S===null||z(S)?f(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||z(S)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?r(S):(t.consume(S),m)}function y(S){return t.attempt(i,D,g)(S)}function g(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),b}function b(S){return o>0&&se(S)?ie(t,w,"linePrefix",o+1)(S):w(S)}function w(S){return S===null||z(S)?t.check(Um,y,D)(S):(t.enter("codeFlowValue"),C(S))}function C(S){return S===null||z(S)?(t.exit("codeFlowValue"),w(S)):(t.consume(S),C)}function D(S){return t.exit("codeFenced"),e(S)}function R(S,de,ye){let be=0;return _;function _(j){return S.enter("lineEnding"),S.consume(j),S.exit("lineEnding"),L}function L(j){return S.enter("codeFencedFence"),se(j)?ie(S,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):F(j)}function F(j){return j===a?(S.enter("codeFencedFenceSequence"),v(j)):ye(j)}function v(j){return j===a?(be++,S.consume(j),v):be>=s?(S.exit("codeFencedFenceSequence"),se(j)?ie(S,P,"whitespace")(j):P(j)):ye(j)}function P(j){return j===null||z(j)?(S.exit("codeFencedFence"),de(j)):ye(j)}}}function i_(t,e,r){let n=this;return i;function i(s){return s===null?r(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}var As={name:"codeIndented",tokenize:s_},o_={partial:!0,tokenize:a_};function s_(t,e,r){let n=this;return i;function i(l){return t.enter("codeIndented"),ie(t,o,"linePrefix",5)(l)}function o(l){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):r(l)}function s(l){return l===null?u(l):z(l)?t.attempt(o_,s,u)(l):(t.enter("codeFlowValue"),a(l))}function a(l){return l===null||z(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),a)}function u(l){return t.exit("codeIndented"),e(l)}}function a_(t,e,r){let n=this;return i;function i(s){return n.parser.lazy[n.now().line]?r(s):z(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):ie(t,o,"linePrefix",5)(s)}function o(s){let a=n.events[n.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):z(s)?i(s):r(s)}}var Qc={name:"codeText",previous:l_,resolve:u_,tokenize:c_};function u_(t){let e=t.length-4,r=3,n,i;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n<e;)if(t[n][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[e][1].type="codeTextPadding",r+=2,e-=2;break}}for(n=r-1,e++;++n<=e;)i===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(i=n):(n===e||t[n][1].type==="lineEnding")&&(t[i][1].type="codeTextData",n!==i+2&&(t[i][1].end=t[n-1][1].end,t.splice(i+2,n-i-2),e-=n-i-2,n=i+2),i=void 0);return t}function l_(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function c_(t,e,r){let n=this,i=0,o,s;return a;function a(p){return t.enter("codeText"),t.enter("codeTextSequence"),u(p)}function u(p){return p===96?(t.consume(p),i++,u):(t.exit("codeTextSequence"),l(p))}function l(p){return p===null?r(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),l):p===96?(s=t.enter("codeTextSequence"),o=0,f(p)):z(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),l):(t.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||z(p)?(t.exit("codeTextData"),l(p)):(t.consume(p),c)}function f(p){return p===96?(t.consume(p),o++,f):o===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(s.type="codeTextData",c(p))}}var Ha=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,r){let n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,r,n){let i=r||0;this.setCursor(Math.trunc(e));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&Cs(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Cs(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Cs(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let r=this.left.splice(e,Number.POSITIVE_INFINITY);Cs(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Cs(this.left,r.reverse())}}};function Cs(t,e){let r=0;if(e.length<1e4)t.push(...e);else for(;r<e.length;)t.push(...e.slice(r,r+1e4)),r+=1e4}function Ka(t){let e={},r=-1,n,i,o,s,a,u,l,c=new Ha(t);for(;++r<c.length;){for(;r in e;)r=e[r];if(n=c.get(r),r&&n[1].type==="chunkFlow"&&c.get(r-1)[1].type==="listItemPrefix"&&(u=n[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,f_(c,r)),r=e[r],l=!0);else if(n[1]._container){for(o=r,i=void 0;o--;)if(s=c.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(s[1].type!=="linePrefix")break;i&&(n[1].end={...c.get(i)[1].start},a=c.slice(i,r),a.unshift(n),c.splice(i,r-i+1,a))}}return st(t,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function f_(t,e){let r=t.get(e)[1],n=t.get(e)[2],i=e-1,o=[],s=r._tokenizer||n.parser[r.contentType](r.start),a=s.events,u=[],l={},c,f,p=-1,d=r,m=0,y=0,g=[y];for(;d;){for(;t.get(++i)[1]!==d;);o.push(i),d._tokenizer||(c=n.sliceStream(d),d.next||c.push(null),f&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=r;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(y=p+1,g.push(y),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),p=g.length;p--;){let b=a.slice(g[p],g[p+1]),w=o.pop();u.push([w,w+b.length-1]),t.splice(w,2,b)}for(u.reverse(),p=-1;++p<u.length;)l[m+u[p][0]]=m+u[p][1],m+=u[p][1]-u[p][0]-1;return l}var ef={resolve:d_,tokenize:h_},p_={partial:!0,tokenize:m_};function d_(t){return Ka(t),t}function h_(t,e){let r;return n;function n(a){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):z(a)?t.check(p_,s,o)(a):(t.consume(a),i)}function o(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function s(a){return t.consume(a),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,i}}function m_(t,e,r){let n=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),ie(t,o,"linePrefix")}function o(s){if(s===null||z(s))return r(s);let a=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):t.interrupt(n.parser.constructs.flow,r,e)(s)}}function Ya(t,e,r,n,i,o,s,a,u){let l=u||Number.POSITIVE_INFINITY,c=0;return f;function f(b){return b===60?(t.enter(n),t.enter(i),t.enter(o),t.consume(b),t.exit(o),p):b===null||b===32||b===41||Ci(b)?r(b):(t.enter(n),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),y(b))}function p(b){return b===62?(t.enter(o),t.consume(b),t.exit(o),t.exit(i),t.exit(n),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===62?(t.exit("chunkString"),t.exit(a),p(b)):b===null||b===60||z(b)?r(b):(t.consume(b),b===92?m:d)}function m(b){return b===60||b===62||b===92?(t.consume(b),d):d(b)}function y(b){return!c&&(b===null||b===41||ke(b))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(n),e(b)):c<l&&b===40?(t.consume(b),c++,y):b===41?(t.consume(b),c--,y):b===null||b===32||b===40||Ci(b)?r(b):(t.consume(b),b===92?g:y)}function g(b){return b===40||b===41||b===92?(t.consume(b),y):y(b)}}function Za(t,e,r,n,i,o){let s=this,a=0,u;return l;function l(d){return t.enter(n),t.enter(i),t.consume(d),t.exit(i),t.enter(o),c}function c(d){return a>999||d===null||d===91||d===93&&!u||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?r(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(n),e):z(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||z(d)||a++>999?(t.exit("chunkString"),c(d)):(t.consume(d),u||(u=!se(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),a++,f):f(d)}}function Xa(t,e,r,n,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(t.enter(n),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,u):r(p)}function u(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(n),e):(t.enter(o),l(p))}function l(p){return p===s?(t.exit(o),u(s)):p===null?r(p):z(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),ie(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||z(p)?(t.exit("chunkString"),l(p)):(t.consume(p),p===92?f:c)}function f(p){return p===s||p===92?(t.consume(p),c):c(p)}}function ki(t,e){let r;return n;function n(i){return z(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r=!0,n):se(i)?ie(t,n,r?"linePrefix":"lineSuffix")(i):e(i)}}var tf={name:"definition",tokenize:x_},g_={partial:!0,tokenize:y_};function x_(t,e,r){let n=this,i;return o;function o(d){return t.enter("definition"),s(d)}function s(d){return Za.call(n,t,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=It(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),u):r(d)}function u(d){return ke(d)?ki(t,l)(d):l(d)}function l(d){return Ya(t,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt(g_,f,f)(d)}function f(d){return se(d)?ie(t,p,"whitespace")(d):p(d)}function p(d){return d===null||z(d)?(t.exit("definition"),n.parser.defined.push(i),e(d)):r(d)}}function y_(t,e,r){return n;function n(a){return ke(a)?ki(t,i)(a):r(a)}function i(a){return Xa(t,o,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return se(a)?ie(t,s,"whitespace")(a):s(a)}function s(a){return a===null||z(a)?e(a):r(a)}}var rf={name:"hardBreakEscape",tokenize:b_};function b_(t,e,r){return n;function n(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return z(o)?(t.exit("hardBreakEscape"),e(o)):r(o)}}var nf={name:"headingAtx",resolve:E_,tokenize:A_};function E_(t,e){let r=t.length-2,n=3,i,o;return t[n][1].type==="whitespace"&&(n+=2),r-2>n&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&t[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:t[n][1].start,end:t[r][1].end},o={type:"chunkText",start:t[n][1].start,end:t[r][1].end,contentType:"text"},st(t,n,r-n+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function A_(t,e,r){let n=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&n++<6?(t.consume(c),s):c===null||ke(c)?(t.exit("atxHeadingSequence"),a(c)):r(c)}function a(c){return c===35?(t.enter("atxHeadingSequence"),u(c)):c===null||z(c)?(t.exit("atxHeading"),e(c)):se(c)?ie(t,a,"whitespace")(c):(t.enter("atxHeadingText"),l(c))}function u(c){return c===35?(t.consume(c),u):(t.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||ke(c)?(t.exit("atxHeadingText"),a(c)):(t.consume(c),l)}}var zm=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],of=["pre","script","style","textarea"];var sf={concrete:!0,name:"htmlFlow",resolveTo:k_,tokenize:T_},C_={partial:!0,tokenize:S_},w_={partial:!0,tokenize:__};function k_(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function T_(t,e,r){let n=this,i,o,s,a,u;return l;function l(E){return c(E)}function c(E){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(E),f}function f(E){return E===33?(t.consume(E),p):E===47?(t.consume(E),o=!0,y):E===63?(t.consume(E),i=3,n.interrupt?e:x):xt(E)?(t.consume(E),s=String.fromCharCode(E),g):r(E)}function p(E){return E===45?(t.consume(E),i=2,d):E===91?(t.consume(E),i=5,a=0,m):xt(E)?(t.consume(E),i=4,n.interrupt?e:x):r(E)}function d(E){return E===45?(t.consume(E),n.interrupt?e:x):r(E)}function m(E){let W="CDATA[";return E===W.charCodeAt(a++)?(t.consume(E),a===W.length?n.interrupt?e:F:m):r(E)}function y(E){return xt(E)?(t.consume(E),s=String.fromCharCode(E),g):r(E)}function g(E){if(E===null||E===47||E===62||ke(E)){let W=E===47,Ye=s.toLowerCase();return!W&&!o&&of.includes(Ye)?(i=1,n.interrupt?e(E):F(E)):zm.includes(s.toLowerCase())?(i=6,W?(t.consume(E),b):n.interrupt?e(E):F(E)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(E):o?w(E):C(E))}return E===45||yt(E)?(t.consume(E),s+=String.fromCharCode(E),g):r(E)}function b(E){return E===62?(t.consume(E),n.interrupt?e:F):r(E)}function w(E){return se(E)?(t.consume(E),w):_(E)}function C(E){return E===47?(t.consume(E),_):E===58||E===95||xt(E)?(t.consume(E),D):se(E)?(t.consume(E),C):_(E)}function D(E){return E===45||E===46||E===58||E===95||yt(E)?(t.consume(E),D):R(E)}function R(E){return E===61?(t.consume(E),S):se(E)?(t.consume(E),R):C(E)}function S(E){return E===null||E===60||E===61||E===62||E===96?r(E):E===34||E===39?(t.consume(E),u=E,de):se(E)?(t.consume(E),S):ye(E)}function de(E){return E===u?(t.consume(E),u=null,be):E===null||z(E)?r(E):(t.consume(E),de)}function ye(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||ke(E)?R(E):(t.consume(E),ye)}function be(E){return E===47||E===62||se(E)?C(E):r(E)}function _(E){return E===62?(t.consume(E),L):r(E)}function L(E){return E===null||z(E)?F(E):se(E)?(t.consume(E),L):r(E)}function F(E){return E===45&&i===2?(t.consume(E),ae):E===60&&i===1?(t.consume(E),ee):E===62&&i===4?(t.consume(E),Ue):E===63&&i===3?(t.consume(E),x):E===93&&i===5?(t.consume(E),it):z(E)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(C_,Qe,v)(E)):E===null||z(E)?(t.exit("htmlFlowData"),v(E)):(t.consume(E),F)}function v(E){return t.check(w_,P,Qe)(E)}function P(E){return t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),j}function j(E){return E===null||z(E)?v(E):(t.enter("htmlFlowData"),F(E))}function ae(E){return E===45?(t.consume(E),x):F(E)}function ee(E){return E===47?(t.consume(E),s="",_e):F(E)}function _e(E){if(E===62){let W=s.toLowerCase();return of.includes(W)?(t.consume(E),Ue):F(E)}return xt(E)&&s.length<8?(t.consume(E),s+=String.fromCharCode(E),_e):F(E)}function it(E){return E===93?(t.consume(E),x):F(E)}function x(E){return E===62?(t.consume(E),Ue):E===45&&i===2?(t.consume(E),x):F(E)}function Ue(E){return E===null||z(E)?(t.exit("htmlFlowData"),Qe(E)):(t.consume(E),Ue)}function Qe(E){return t.exit("htmlFlow"),e(E)}}function __(t,e,r){let n=this;return i;function i(s){return z(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):r(s)}function o(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}function S_(t,e,r){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Rr,e,r)}}var af={name:"htmlText",tokenize:v_};function v_(t,e,r){let n=this,i,o,s;return a;function a(x){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(x),u}function u(x){return x===33?(t.consume(x),l):x===47?(t.consume(x),R):x===63?(t.consume(x),C):xt(x)?(t.consume(x),ye):r(x)}function l(x){return x===45?(t.consume(x),c):x===91?(t.consume(x),o=0,m):xt(x)?(t.consume(x),w):r(x)}function c(x){return x===45?(t.consume(x),d):r(x)}function f(x){return x===null?r(x):x===45?(t.consume(x),p):z(x)?(s=f,ee(x)):(t.consume(x),f)}function p(x){return x===45?(t.consume(x),d):f(x)}function d(x){return x===62?ae(x):x===45?p(x):f(x)}function m(x){let Ue="CDATA[";return x===Ue.charCodeAt(o++)?(t.consume(x),o===Ue.length?y:m):r(x)}function y(x){return x===null?r(x):x===93?(t.consume(x),g):z(x)?(s=y,ee(x)):(t.consume(x),y)}function g(x){return x===93?(t.consume(x),b):y(x)}function b(x){return x===62?ae(x):x===93?(t.consume(x),b):y(x)}function w(x){return x===null||x===62?ae(x):z(x)?(s=w,ee(x)):(t.consume(x),w)}function C(x){return x===null?r(x):x===63?(t.consume(x),D):z(x)?(s=C,ee(x)):(t.consume(x),C)}function D(x){return x===62?ae(x):C(x)}function R(x){return xt(x)?(t.consume(x),S):r(x)}function S(x){return x===45||yt(x)?(t.consume(x),S):de(x)}function de(x){return z(x)?(s=de,ee(x)):se(x)?(t.consume(x),de):ae(x)}function ye(x){return x===45||yt(x)?(t.consume(x),ye):x===47||x===62||ke(x)?be(x):r(x)}function be(x){return x===47?(t.consume(x),ae):x===58||x===95||xt(x)?(t.consume(x),_):z(x)?(s=be,ee(x)):se(x)?(t.consume(x),be):ae(x)}function _(x){return x===45||x===46||x===58||x===95||yt(x)?(t.consume(x),_):L(x)}function L(x){return x===61?(t.consume(x),F):z(x)?(s=L,ee(x)):se(x)?(t.consume(x),L):be(x)}function F(x){return x===null||x===60||x===61||x===62||x===96?r(x):x===34||x===39?(t.consume(x),i=x,v):z(x)?(s=F,ee(x)):se(x)?(t.consume(x),F):(t.consume(x),P)}function v(x){return x===i?(t.consume(x),i=void 0,j):x===null?r(x):z(x)?(s=v,ee(x)):(t.consume(x),v)}function P(x){return x===null||x===34||x===39||x===60||x===61||x===96?r(x):x===47||x===62||ke(x)?be(x):(t.consume(x),P)}function j(x){return x===47||x===62||ke(x)?be(x):r(x)}function ae(x){return x===62?(t.consume(x),t.exit("htmlTextData"),t.exit("htmlText"),e):r(x)}function ee(x){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),_e}function _e(x){return se(x)?ie(t,it,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):it(x)}function it(x){return t.enter("htmlTextData"),s(x)}}var Ti={name:"labelEnd",resolveAll:R_,resolveTo:F_,tokenize:N_},I_={tokenize:P_},O_={tokenize:L_},D_={tokenize:M_};function R_(t){let e=-1,r=[];for(;++e<t.length;){let n=t[e][1];if(r.push(t[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let i=n.type==="labelImage"?4:2;n.type="data",e+=i}}return t.length!==r.length&&st(t,0,t.length,r),t}function F_(t,e){let r=t.length,n=0,i,o,s,a;for(;r--;)if(i=t[r][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[r][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(t[r][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=r,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(s=r);let u={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[o][1].start},end:{...t[s][1].end}},c={type:"labelText",start:{...t[o+n+2][1].end},end:{...t[s-2][1].start}};return a=[["enter",u,e],["enter",l,e]],a=Lt(a,t.slice(o+1,o+n+3)),a=Lt(a,[["enter",c,e]]),a=Lt(a,wn(e.parser.constructs.insideSpan.null,t.slice(o+n+4,s-3),e)),a=Lt(a,[["exit",c,e],t[s-2],t[s-1],["exit",l,e]]),a=Lt(a,t.slice(s+1)),a=Lt(a,[["exit",u,e]]),st(t,o,t.length,a),t}function N_(t,e,r){let n=this,i=n.events.length,o,s;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){o=n.events[i][1];break}return a;function a(p){return o?o._inactive?f(p):(s=n.parser.defined.includes(It(n.sliceSerialize({start:o.end,end:n.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),u):r(p)}function u(p){return p===40?t.attempt(I_,c,s?c:f)(p):p===91?t.attempt(O_,c,s?l:f)(p):s?c(p):f(p)}function l(p){return t.attempt(D_,c,f)(p)}function c(p){return e(p)}function f(p){return o._balanced=!0,r(p)}}function P_(t,e,r){return n;function n(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),i}function i(f){return ke(f)?ki(t,o)(f):o(f)}function o(f){return f===41?c(f):Ya(t,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return ke(f)?ki(t,u)(f):c(f)}function a(f){return r(f)}function u(f){return f===34||f===39||f===40?Xa(t,l,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function l(f){return ke(f)?ki(t,c)(f):c(f)}function c(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):r(f)}}function L_(t,e,r){let n=this;return i;function i(a){return Za.call(n,t,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return n.parser.defined.includes(It(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(a):r(a)}function s(a){return r(a)}}function M_(t,e,r){return n;function n(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),i}function i(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):r(o)}}var uf={name:"labelStartImage",resolveAll:Ti.resolveAll,tokenize:B_};function B_(t,e,r){let n=this;return i;function i(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),o}function o(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),s):r(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(a):e(a)}}var lf={name:"labelStartLink",resolveAll:Ti.resolveAll,tokenize:j_};function j_(t,e,r){let n=this;return i;function i(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):e(s)}}var ws={name:"lineEnding",tokenize:U_};function U_(t,e){return r;function r(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),ie(t,e,"linePrefix")}}var _i={name:"thematicBreak",tokenize:z_};function z_(t,e,r){let n=0,i;return o;function o(l){return t.enter("thematicBreak"),s(l)}function s(l){return i=l,a(l)}function a(l){return l===i?(t.enter("thematicBreakSequence"),u(l)):n>=3&&(l===null||z(l))?(t.exit("thematicBreak"),e(l)):r(l)}function u(l){return l===i?(t.consume(l),n++,u):(t.exit("thematicBreakSequence"),se(l)?ie(t,a,"whitespace")(l):a(l))}}var Ot={continuation:{tokenize:G_},exit:H_,name:"list",tokenize:V_},$_={partial:!0,tokenize:K_},q_={partial:!0,tokenize:W_};function V_(t,e,r){let n=this,i=n.events[n.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){let m=n.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||d===n.containerState.marker:bs(d)){if(n.containerState.type||(n.containerState.type=m,t.enter(m,{_container:!0})),m==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(_i,r,l)(d):l(d);if(!n.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(d)}return r(d)}function u(d){return bs(d)&&++s<10?(t.consume(d),u):(!n.interrupt||s<2)&&(n.containerState.marker?d===n.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),l(d)):r(d)}function l(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||d,t.check(Rr,n.interrupt?r:c,t.attempt($_,p,f))}function c(d){return n.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return se(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):r(d)}function p(d){return n.containerState.size=o+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function G_(t,e,r){let n=this;return n.containerState._closeFlow=void 0,t.check(Rr,i,o);function i(a){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ie(t,e,"listItemIndent",n.containerState.size+1)(a)}function o(a){return n.containerState.furtherBlankLines||!se(a)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(a)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(q_,e,s)(a))}function s(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,ie(t,t.attempt(Ot,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function W_(t,e,r){let n=this;return ie(t,i,"listItemIndent",n.containerState.size+1);function i(o){let s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?e(o):r(o)}}function H_(t){t.exit(this.containerState.type)}function K_(t,e,r){let n=this;return ie(t,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=n.events[n.events.length-1];return!se(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):r(o)}}var Ja={name:"setextUnderline",resolveTo:Y_,tokenize:Z_};function Y_(t,e){let r=t.length,n,i,o;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){n=r;break}t[r][1].type==="paragraph"&&(i=r)}else t[r][1].type==="content"&&t.splice(r,1),!o&&t[r][1].type==="definition"&&(o=r);let s={type:"setextHeading",start:{...t[i][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[n][1],e]),t[n][1].end={...t[o][1].end}):t[n][1]=s,t.push(["exit",s,e]),t}function Z_(t,e,r){let n=this,i;return o;function o(l){let c=n.events.length,f;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){f=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||f)?(t.enter("setextHeadingLine"),i=l,s(l)):r(l)}function s(l){return t.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(t.consume(l),a):(t.exit("setextHeadingLineSequence"),se(l)?ie(t,u,"lineSuffix")(l):u(l))}function u(l){return l===null||z(l)?(t.exit("setextHeadingLine"),e(l)):r(l)}}var $m={tokenize:X_};function X_(t){let e=this,r=t.attempt(Rr,n,t.attempt(this.parser.constructs.flowInitial,i,ie(t,t.attempt(this.parser.constructs.flow,i,t.attempt(ef,i)),"linePrefix")));return r;function n(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,r}}var qm={resolveAll:Hm()},Vm=Wm("string"),Gm=Wm("text");function Wm(t){return{resolveAll:Hm(t==="text"?J_:void 0),tokenize:e};function e(r){let n=this,i=this.parser.constructs[t],o=r.attempt(i,s,a);return s;function s(c){return l(c)?o(c):a(c)}function a(c){if(c===null){r.consume(c);return}return r.enter("data"),r.consume(c),u}function u(c){return l(c)?(r.exit("data"),o(c)):(r.consume(c),u)}function l(c){if(c===null)return!0;let f=i[c],p=-1;if(f)for(;++p<f.length;){let d=f[p];if(!d.previous||d.previous.call(n,n.previous))return!0}return!1}}}function Hm(t){return e;function e(r,n){let i=-1,o;for(;++i<=r.length;)o===void 0?r[i]&&r[i][1].type==="data"&&(o=i,i++):(!r[i]||r[i][1].type!=="data")&&(i!==o+2&&(r[o][1].end=r[i-1][1].end,r.splice(o+2,i-o-2),i=o+2),o=void 0);return t?t(r,n):r}}function J_(t,e){let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){let n=t[r-1][1],i=e.sliceStream(n),o=i.length,s=-1,a=0,u;for(;o--;){let l=i[o];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(l===-2)u=!0,a++;else if(l!==-1){o++;break}}if(a){let l={type:r===t.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:n.start._bufferIndex+s,_index:n.start._index+o,line:n.end.line,column:n.end.column-a,offset:n.end.offset-a},end:{...n.end}};n.end={...l.start},n.start.offset===n.end.offset?Object.assign(n,l):(t.splice(r,0,["enter",l,e],["exit",l,e]),r+=2)}r++}return t}var cf={};GC(cf,{attentionMarkers:()=>sS,contentInitial:()=>eS,disable:()=>aS,document:()=>Q_,flow:()=>rS,flowInitial:()=>tS,insideSpan:()=>oS,string:()=>nS,text:()=>iS});var Q_={42:Ot,43:Ot,45:Ot,48:Ot,49:Ot,50:Ot,51:Ot,52:Ot,53:Ot,54:Ot,55:Ot,56:Ot,57:Ot,62:qa},eS={91:tf},tS={[-2]:As,[-1]:As,32:As},rS={35:nf,42:_i,45:[Ja,_i],60:sf,61:Ja,95:_i,96:Wa,126:Wa},nS={38:Ga,92:Va},iS={[-5]:ws,[-4]:ws,[-3]:ws,33:uf,38:Ga,42:Es,60:[Jc,af],91:lf,92:[rf,Va],93:Ti,95:Es,96:Qc},oS={null:[Es,qm]},sS={null:[42,95]},aS={null:[]};function Km(t,e,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},i={},o=[],s=[],a=[],u=!0,l={attempt:be(de),check:be(ye),consume:D,enter:R,exit:S,interrupt:be(ye,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:t,previous:null,sliceSerialize:m,sliceStream:y,write:d},f=e.tokenize.call(c,l),p;return e.resolveAll&&o.push(e),c;function d(v){return s=Lt(s,v),w(),s[s.length-1]!==null?[]:(_(e,0),c.events=wn(o,c.events,c),c.events)}function m(v,P){return lS(y(v),P)}function y(v){return uS(s,v)}function g(){let{_bufferIndex:v,_index:P,line:j,column:ae,offset:ee}=n;return{_bufferIndex:v,_index:P,line:j,column:ae,offset:ee}}function b(v){i[v.line]=v.column,F()}function w(){let v;for(;n._index<s.length;){let P=s[n._index];if(typeof P=="string")for(v=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===v&&n._bufferIndex<P.length;)C(P.charCodeAt(n._bufferIndex));else C(P)}}function C(v){u=void 0,p=v,f=f(v)}function D(v){z(v)?(n.line++,n.column=1,n.offset+=v===-3?2:1,F()):v!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=v,u=!0}function R(v,P){let j=P||{};return j.type=v,j.start=g(),c.events.push(["enter",j,c]),a.push(j),j}function S(v){let P=a.pop();return P.end=g(),c.events.push(["exit",P,c]),P}function de(v,P){_(v,P.from)}function ye(v,P){P.restore()}function be(v,P){return j;function j(ae,ee,_e){let it,x,Ue,Qe;return Array.isArray(ae)?W(ae):"tokenize"in ae?W([ae]):E(ae);function E(oe){return ce;function ce(me){let we=me!==null&&oe[me],Fe=me!==null&&oe.null,ze=[...Array.isArray(we)?we:we?[we]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return W(ze)(me)}}function W(oe){return it=oe,x=0,oe.length===0?_e:Ye(oe[x])}function Ye(oe){return ce;function ce(me){return Qe=L(),Ue=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?he(me):oe.tokenize.call(P?Object.assign(Object.create(c),P):c,l,ne,he)(me)}}function ne(oe){return u=!0,v(Ue,Qe),ee}function he(oe){return u=!0,Qe.restore(),++x<it.length?Ye(it[x]):_e}}}function _(v,P){v.resolveAll&&!o.includes(v)&&o.push(v),v.resolve&&st(c.events,P,c.events.length-P,v.resolve(c.events.slice(P),c)),v.resolveTo&&(c.events=v.resolveTo(c.events,c))}function L(){let v=g(),P=c.previous,j=c.currentConstruct,ae=c.events.length,ee=Array.from(a);return{from:ae,restore:_e};function _e(){n=v,c.previous=P,c.currentConstruct=j,c.events.length=ae,a=ee,F()}}function F(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function uS(t,e){let r=e.start._index,n=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex,s;if(r===i)s=[t[r].slice(n,o)];else{if(s=t.slice(r,i),n>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(n):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function lS(t,e){let r=-1,n=[],i;for(;++r<t.length;){let o=t[r],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
73
73
|
`;break}case-3:{s=`\r
|
|
74
|
-
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,n.push(s)}return n.join("")}function cf(t){let n={constructs:za([lf,...(t||{}).extensions||[]]),content:i(Nm),defined:[],document:i(Lm),flow:i(Um),lazy:{},string:i($m),text:i(qm)};return n;function i(o){return s;function s(a){return Wm(n,o,a)}}}function ff(t){for(;!Ka(t););return t}var Hm=/[\0\t\n\r]/g;function pf(){let t=1,e="",r=!0,n;return i;function i(o,s,a){let u=[],l,c,f,p,d;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,e="",r&&(o.charCodeAt(0)===65279&&f++,r=void 0);f<o.length;){if(Hm.lastIndex=f,l=Hm.exec(o),p=l&&l.index!==void 0?l.index:o.length,d=o.charCodeAt(p),!l){e=o.slice(f);break}if(d===10&&f===p&&n)u.push(-3),n=void 0;else switch(n&&(u.push(-5),n=void 0),f<p&&(u.push(o.slice(f,p)),t+=p-f),d){case 0:{u.push(65533),t++;break}case 9:{for(c=Math.ceil(t/4)*4,u.push(-2);t++<c;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:n=!0,t=1}f=p+1}return a&&(n&&u.push(-5),e&&u.push(e),u.push(null)),u}}var aS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Qa(t){return t.replace(aS,uS)}function uS(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){let i=r.charCodeAt(1),o=i===120||i===88;return $a(r.slice(o?2:1),o?16:10)}return lo(r)||t}function co(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Km(t.position):"start"in t||"end"in t?Km(t):"line"in t||"column"in t?df(t):""}function df(t){return Ym(t&&t.line)+":"+Ym(t&&t.column)}function Km(t){return df(t&&t.start)+"-"+df(t&&t.end)}function Ym(t){return t&&typeof t=="number"?t:1}var Xm={}.hasOwnProperty;function hf(t,e,r){return typeof e!="string"&&(r=e,e=void 0),lS(r)(ff(cf(r).document().write(pf()(t,e,!0))))}function lS(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(T),autolinkProtocol:be,autolinkEmail:be,atxHeading:o(A),blockQuote:o(me),characterEscape:be,characterReference:be,codeFenced:o(we),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(we,s),codeText:o(Fe,s),codeTextData:be,data:be,codeFlowValue:be,definition:o(ze),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(qt),hardBreakEscape:o(k),hardBreakTrailing:o(k),htmlFlow:o(M,s),htmlFlowData:be,htmlText:o(M,s),htmlTextData:be,image:o(I),label:s,link:o(T),listItem:o($),listItemValue:p,listOrdered:o(K,f),listUnordered:o(K),paragraph:o(te),reference:E,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(A),strong:o(ft),thematicBreak:o(MC)},exit:{atxHeading:u(),atxHeadingSequence:R,autolink:u(),autolinkEmail:ce,autolinkProtocol:oe,blockQuote:u(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:Ye,characterReferenceMarkerNumeric:Ye,characterReferenceValue:ne,characterReference:he,codeFenced:u(g),codeFencedFence:y,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:_,codeIndented:u(b),codeText:u(j),codeTextData:_,data:_,definition:u(),definitionDestinationString:D,definitionLabelString:w,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(v),htmlFlowData:_,htmlText:u(P),htmlTextData:_,image:u(ee),label:it,labelText:_e,lineEnding:L,link:u(ae),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:W,resourceDestinationString:x,resourceTitleString:Ue,resource:Qe,setextHeading:u(ye),setextHeadingLineSequence:de,setextHeadingText:S,strong:u(),thematicBreak:u()}};Jm(e,(t||{}).mdastExtensions||[]);let r={};return n;function n(O){let B={type:"root",children:[]},Ee={stack:[B],tokenStack:[],config:e,enter:a,exit:l,buffer:s,resume:c,data:r},ve=[],Ne=-1;for(;++Ne<O.length;)if(O[Ne][1].type==="listOrdered"||O[Ne][1].type==="listUnordered")if(O[Ne][0]==="enter")ve.push(Ne);else{let xr=ve.pop();Ne=i(O,xr,Ne)}for(Ne=-1;++Ne<O.length;){let xr=e[O[Ne][0]];Xm.call(xr,O[Ne][1].type)&&xr[O[Ne][1].type].call(Object.assign({sliceSerialize:O[Ne][2].sliceSerialize},Ee),O[Ne][1])}if(Ee.tokenStack.length>0){let xr=Ee.tokenStack[Ee.tokenStack.length-1];(xr[1]||Zm).call(Ee,void 0,xr[0])}for(B.position={start:kn(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:kn(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<e.transforms.length;)B=e.transforms[Ne](B)||B;return B}function i(O,B,Ee){let ve=B-1,Ne=-1,xr=!1,Gn,Wr,is,os;for(;++ve<=Ee;){let Yt=O[ve];switch(Yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Yt[0]==="enter"?Ne++:Ne--,os=void 0;break}case"lineEndingBlank":{Yt[0]==="enter"&&(Gn&&!os&&!Ne&&!is&&(is=ve),os=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:os=void 0}if(!Ne&&Yt[0]==="enter"&&Yt[1].type==="listItemPrefix"||Ne===-1&&Yt[0]==="exit"&&(Yt[1].type==="listUnordered"||Yt[1].type==="listOrdered")){if(Gn){let Gi=ve;for(Wr=void 0;Gi--;){let Hr=O[Gi];if(Hr[1].type==="lineEnding"||Hr[1].type==="lineEndingBlank"){if(Hr[0]==="exit")continue;Wr&&(O[Wr][1].type="lineEndingBlank",xr=!0),Hr[1].type="lineEnding",Wr=Gi}else if(!(Hr[1].type==="linePrefix"||Hr[1].type==="blockQuotePrefix"||Hr[1].type==="blockQuotePrefixWhitespace"||Hr[1].type==="blockQuoteMarker"||Hr[1].type==="listItemIndent"))break}is&&(!Wr||is<Wr)&&(Gn._spread=!0),Gn.end=Object.assign({},Wr?O[Wr][1].start:Yt[1].end),O.splice(Wr||ve,0,["exit",Gn,Yt[2]]),ve++,Ee++}if(Yt[1].type==="listItemPrefix"){let Gi={type:"listItem",_spread:!1,start:Object.assign({},Yt[1].start),end:void 0};Gn=Gi,O.splice(ve,0,["enter",Gi,Yt[2]]),ve++,Ee++,is=void 0,os=!0}}}return O[B][1]._spread=xr,Ee}function o(O,B){return Ee;function Ee(ve){a.call(this,O(ve),ve),B&&B.call(this,ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(O,B,Ee){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([B,Ee||void 0]),O.position={start:kn(B.start),end:void 0}}function u(O){return B;function B(Ee){O&&O.call(this,Ee),l.call(this,Ee)}}function l(O,B){let Ee=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==O.type&&(B?B.call(this,O,ve[0]):(ve[1]||Zm).call(this,O,ve[0]));else throw new Error("Cannot close `"+O.type+"` ("+co({start:O.start,end:O.end})+"): it\u2019s not open");Ee.position.end=kn(O.end)}function c(){return tn(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(O){if(this.data.expectingFirstListItemValue){let B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function d(){let O=this.resume(),B=this.stack[this.stack.length-1];B.lang=O}function m(){let O=this.resume(),B=this.stack[this.stack.length-1];B.meta=O}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/(\r?\n|\r)$/g,"")}function w(O){let B=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=B,Ee.identifier=It(this.sliceSerialize(O)).toLowerCase()}function C(){let O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function D(){let O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function R(O){let B=this.stack[this.stack.length-1];if(!B.depth){let Ee=this.sliceSerialize(O).length;B.depth=Ee}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function de(O){let B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function ye(){this.data.setextHeadingSlurpLineEnding=void 0}function be(O){let Ee=this.stack[this.stack.length-1].children,ve=Ee[Ee.length-1];(!ve||ve.type!=="text")&&(ve=Tt(),ve.position={start:kn(O.start),end:void 0},Ee.push(ve)),this.stack.push(ve)}function _(O){let B=this.stack.pop();B.value+=this.sliceSerialize(O),B.position.end=kn(O.end)}function L(O){let B=this.stack[this.stack.length-1];if(this.data.atHardBreak){let Ee=B.children[B.children.length-1];Ee.position.end=kn(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(B.type)&&(be.call(this,O),_.call(this,O))}function F(){this.data.atHardBreak=!0}function v(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function P(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function j(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function ae(){let O=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function ee(){let O=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function _e(O){let B=this.sliceSerialize(O),Ee=this.stack[this.stack.length-2];Ee.label=Qa(B),Ee.identifier=It(B).toLowerCase()}function it(){let O=this.stack[this.stack.length-1],B=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){let ve=O.children;Ee.children=ve}else Ee.alt=B}function x(){let O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function Ue(){let O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function Qe(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function W(O){let B=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=B,Ee.identifier=It(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function Ye(O){this.data.characterReferenceType=O.type}function ne(O){let B=this.sliceSerialize(O),Ee=this.data.characterReferenceType,ve;Ee?(ve=$a(B,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=lo(B);let Ne=this.stack[this.stack.length-1];Ne.value+=ve}function he(O){let B=this.stack.pop();B.position.end=kn(O.end)}function oe(O){_.call(this,O);let B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(O)}function ce(O){_.call(this,O);let B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(O)}function me(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function Fe(){return{type:"inlineCode",value:""}}function ze(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qt(){return{type:"emphasis",children:[]}}function A(){return{type:"heading",depth:0,children:[]}}function k(){return{type:"break"}}function M(){return{type:"html",value:""}}function I(){return{type:"image",title:null,url:"",alt:null}}function T(){return{type:"link",title:null,url:"",children:[]}}function K(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function $(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function te(){return{type:"paragraph",children:[]}}function ft(){return{type:"strong",children:[]}}function Tt(){return{type:"text",value:""}}function MC(){return{type:"thematicBreak"}}}function kn(t){return{line:t.line,column:t.column,offset:t.offset}}function Jm(t,e){let r=-1;for(;++r<e.length;){let n=e[r];Array.isArray(n)?Jm(t,n):cS(t,n)}}function cS(t,e){let r;for(r in e)if(Xm.call(e,r))switch(r){case"canContainEols":{let n=e[r];n&&t[r].push(...n);break}case"transforms":{let n=e[r];n&&t[r].push(...n);break}case"enter":case"exit":{let n=e[r];n&&Object.assign(t[r],n);break}}}function Zm(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+co({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+co({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+co({start:e.start,end:e.end})+") is still open")}function eu(t){let e=this;e.parser=r;function r(n){return hf(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}var Qm={}.hasOwnProperty;function eg(t,e){let r=e||{};function n(i,...o){let s=n.invalid,a=n.handlers;if(i&&Qm.call(i,t)){let u=String(i[t]);s=Qm.call(a,u)?a[u]:n.unknown}if(s)return s.call(this,i,...o)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}var fS={}.hasOwnProperty;function mf(t,e){let r=-1,n;if(e.extensions)for(;++r<e.extensions.length;)mf(t,e.extensions[r]);for(n in e)if(fS.call(e,n))switch(n){case"extensions":break;case"unsafe":{tg(t[n],e[n]);break}case"join":{tg(t[n],e[n]);break}case"handlers":{pS(t[n],e[n]);break}default:t.options[n]=e[n]}return t}function tg(t,e){e&&t.push(...e)}function pS(t,e){e&&Object.assign(t,e)}function rg(t,e,r,n){let i=r.enter("blockquote"),o=r.createTracker(n);o.move("> "),o.shift(2);let s=r.indentLines(r.containerFlow(t,o.current()),dS);return i(),s}function dS(t,e,r){return">"+(r?"":" ")+t}function tu(t,e){return ng(t,e.inConstruct,!0)&&!ng(t,e.notInConstruct,!1)}function ng(t,e,r){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return r;let n=-1;for(;++n<e.length;)if(t.includes(e[n]))return!0;return!1}function gf(t,e,r,n){let i=-1;for(;++i<r.unsafe.length;)if(r.unsafe[i].character===`
|
|
74
|
+
`;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,n.push(s)}return n.join("")}function ff(t){let n={constructs:za([cf,...(t||{}).extensions||[]]),content:i(Lm),defined:[],document:i(Bm),flow:i($m),lazy:{},string:i(Vm),text:i(Gm)};return n;function i(o){return s;function s(a){return Km(n,o,a)}}}function pf(t){for(;!Ka(t););return t}var Ym=/[\0\t\n\r]/g;function df(){let t=1,e="",r=!0,n;return i;function i(o,s,a){let u=[],l,c,f,p,d;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,e="",r&&(o.charCodeAt(0)===65279&&f++,r=void 0);f<o.length;){if(Ym.lastIndex=f,l=Ym.exec(o),p=l&&l.index!==void 0?l.index:o.length,d=o.charCodeAt(p),!l){e=o.slice(f);break}if(d===10&&f===p&&n)u.push(-3),n=void 0;else switch(n&&(u.push(-5),n=void 0),f<p&&(u.push(o.slice(f,p)),t+=p-f),d){case 0:{u.push(65533),t++;break}case 9:{for(c=Math.ceil(t/4)*4,u.push(-2);t++<c;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:n=!0,t=1}f=p+1}return a&&(n&&u.push(-5),e&&u.push(e),u.push(null)),u}}var cS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Qa(t){return t.replace(cS,fS)}function fS(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){let i=r.charCodeAt(1),o=i===120||i===88;return $a(r.slice(o?2:1),o?16:10)}return lo(r)||t}function co(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Zm(t.position):"start"in t||"end"in t?Zm(t):"line"in t||"column"in t?hf(t):""}function hf(t){return Xm(t&&t.line)+":"+Xm(t&&t.column)}function Zm(t){return hf(t&&t.start)+"-"+hf(t&&t.end)}function Xm(t){return t&&typeof t=="number"?t:1}var Qm={}.hasOwnProperty;function mf(t,e,r){return typeof e!="string"&&(r=e,e=void 0),pS(r)(pf(ff(r).document().write(df()(t,e,!0))))}function pS(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(T),autolinkProtocol:be,autolinkEmail:be,atxHeading:o(A),blockQuote:o(me),characterEscape:be,characterReference:be,codeFenced:o(we),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(we,s),codeText:o(Fe,s),codeTextData:be,data:be,codeFlowValue:be,definition:o(ze),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(qt),hardBreakEscape:o(k),hardBreakTrailing:o(k),htmlFlow:o(M,s),htmlFlowData:be,htmlText:o(M,s),htmlTextData:be,image:o(I),label:s,link:o(T),listItem:o($),listItemValue:p,listOrdered:o(K,f),listUnordered:o(K),paragraph:o(te),reference:E,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(A),strong:o(ft),thematicBreak:o(jC)},exit:{atxHeading:u(),atxHeadingSequence:R,autolink:u(),autolinkEmail:ce,autolinkProtocol:oe,blockQuote:u(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:Ye,characterReferenceMarkerNumeric:Ye,characterReferenceValue:ne,characterReference:he,codeFenced:u(g),codeFencedFence:y,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:_,codeIndented:u(b),codeText:u(j),codeTextData:_,data:_,definition:u(),definitionDestinationString:D,definitionLabelString:w,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(v),htmlFlowData:_,htmlText:u(P),htmlTextData:_,image:u(ee),label:it,labelText:_e,lineEnding:L,link:u(ae),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:W,resourceDestinationString:x,resourceTitleString:Ue,resource:Qe,setextHeading:u(ye),setextHeadingLineSequence:de,setextHeadingText:S,strong:u(),thematicBreak:u()}};eg(e,(t||{}).mdastExtensions||[]);let r={};return n;function n(O){let B={type:"root",children:[]},Ee={stack:[B],tokenStack:[],config:e,enter:a,exit:l,buffer:s,resume:c,data:r},ve=[],Ne=-1;for(;++Ne<O.length;)if(O[Ne][1].type==="listOrdered"||O[Ne][1].type==="listUnordered")if(O[Ne][0]==="enter")ve.push(Ne);else{let xr=ve.pop();Ne=i(O,xr,Ne)}for(Ne=-1;++Ne<O.length;){let xr=e[O[Ne][0]];Qm.call(xr,O[Ne][1].type)&&xr[O[Ne][1].type].call(Object.assign({sliceSerialize:O[Ne][2].sliceSerialize},Ee),O[Ne][1])}if(Ee.tokenStack.length>0){let xr=Ee.tokenStack[Ee.tokenStack.length-1];(xr[1]||Jm).call(Ee,void 0,xr[0])}for(B.position={start:kn(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:kn(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<e.transforms.length;)B=e.transforms[Ne](B)||B;return B}function i(O,B,Ee){let ve=B-1,Ne=-1,xr=!1,Gn,Wr,is,os;for(;++ve<=Ee;){let Yt=O[ve];switch(Yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Yt[0]==="enter"?Ne++:Ne--,os=void 0;break}case"lineEndingBlank":{Yt[0]==="enter"&&(Gn&&!os&&!Ne&&!is&&(is=ve),os=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:os=void 0}if(!Ne&&Yt[0]==="enter"&&Yt[1].type==="listItemPrefix"||Ne===-1&&Yt[0]==="exit"&&(Yt[1].type==="listUnordered"||Yt[1].type==="listOrdered")){if(Gn){let Gi=ve;for(Wr=void 0;Gi--;){let Hr=O[Gi];if(Hr[1].type==="lineEnding"||Hr[1].type==="lineEndingBlank"){if(Hr[0]==="exit")continue;Wr&&(O[Wr][1].type="lineEndingBlank",xr=!0),Hr[1].type="lineEnding",Wr=Gi}else if(!(Hr[1].type==="linePrefix"||Hr[1].type==="blockQuotePrefix"||Hr[1].type==="blockQuotePrefixWhitespace"||Hr[1].type==="blockQuoteMarker"||Hr[1].type==="listItemIndent"))break}is&&(!Wr||is<Wr)&&(Gn._spread=!0),Gn.end=Object.assign({},Wr?O[Wr][1].start:Yt[1].end),O.splice(Wr||ve,0,["exit",Gn,Yt[2]]),ve++,Ee++}if(Yt[1].type==="listItemPrefix"){let Gi={type:"listItem",_spread:!1,start:Object.assign({},Yt[1].start),end:void 0};Gn=Gi,O.splice(ve,0,["enter",Gi,Yt[2]]),ve++,Ee++,is=void 0,os=!0}}}return O[B][1]._spread=xr,Ee}function o(O,B){return Ee;function Ee(ve){a.call(this,O(ve),ve),B&&B.call(this,ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(O,B,Ee){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([B,Ee||void 0]),O.position={start:kn(B.start),end:void 0}}function u(O){return B;function B(Ee){O&&O.call(this,Ee),l.call(this,Ee)}}function l(O,B){let Ee=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==O.type&&(B?B.call(this,O,ve[0]):(ve[1]||Jm).call(this,O,ve[0]));else throw new Error("Cannot close `"+O.type+"` ("+co({start:O.start,end:O.end})+"): it\u2019s not open");Ee.position.end=kn(O.end)}function c(){return tn(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(O){if(this.data.expectingFirstListItemValue){let B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function d(){let O=this.resume(),B=this.stack[this.stack.length-1];B.lang=O}function m(){let O=this.resume(),B=this.stack[this.stack.length-1];B.meta=O}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/(\r?\n|\r)$/g,"")}function w(O){let B=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=B,Ee.identifier=It(this.sliceSerialize(O)).toLowerCase()}function C(){let O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function D(){let O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function R(O){let B=this.stack[this.stack.length-1];if(!B.depth){let Ee=this.sliceSerialize(O).length;B.depth=Ee}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function de(O){let B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function ye(){this.data.setextHeadingSlurpLineEnding=void 0}function be(O){let Ee=this.stack[this.stack.length-1].children,ve=Ee[Ee.length-1];(!ve||ve.type!=="text")&&(ve=Tt(),ve.position={start:kn(O.start),end:void 0},Ee.push(ve)),this.stack.push(ve)}function _(O){let B=this.stack.pop();B.value+=this.sliceSerialize(O),B.position.end=kn(O.end)}function L(O){let B=this.stack[this.stack.length-1];if(this.data.atHardBreak){let Ee=B.children[B.children.length-1];Ee.position.end=kn(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(B.type)&&(be.call(this,O),_.call(this,O))}function F(){this.data.atHardBreak=!0}function v(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function P(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function j(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function ae(){let O=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function ee(){let O=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function _e(O){let B=this.sliceSerialize(O),Ee=this.stack[this.stack.length-2];Ee.label=Qa(B),Ee.identifier=It(B).toLowerCase()}function it(){let O=this.stack[this.stack.length-1],B=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){let ve=O.children;Ee.children=ve}else Ee.alt=B}function x(){let O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function Ue(){let O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function Qe(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function W(O){let B=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=B,Ee.identifier=It(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function Ye(O){this.data.characterReferenceType=O.type}function ne(O){let B=this.sliceSerialize(O),Ee=this.data.characterReferenceType,ve;Ee?(ve=$a(B,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=lo(B);let Ne=this.stack[this.stack.length-1];Ne.value+=ve}function he(O){let B=this.stack.pop();B.position.end=kn(O.end)}function oe(O){_.call(this,O);let B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(O)}function ce(O){_.call(this,O);let B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(O)}function me(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function Fe(){return{type:"inlineCode",value:""}}function ze(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qt(){return{type:"emphasis",children:[]}}function A(){return{type:"heading",depth:0,children:[]}}function k(){return{type:"break"}}function M(){return{type:"html",value:""}}function I(){return{type:"image",title:null,url:"",alt:null}}function T(){return{type:"link",title:null,url:"",children:[]}}function K(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function $(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function te(){return{type:"paragraph",children:[]}}function ft(){return{type:"strong",children:[]}}function Tt(){return{type:"text",value:""}}function jC(){return{type:"thematicBreak"}}}function kn(t){return{line:t.line,column:t.column,offset:t.offset}}function eg(t,e){let r=-1;for(;++r<e.length;){let n=e[r];Array.isArray(n)?eg(t,n):dS(t,n)}}function dS(t,e){let r;for(r in e)if(Qm.call(e,r))switch(r){case"canContainEols":{let n=e[r];n&&t[r].push(...n);break}case"transforms":{let n=e[r];n&&t[r].push(...n);break}case"enter":case"exit":{let n=e[r];n&&Object.assign(t[r],n);break}}}function Jm(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+co({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+co({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+co({start:e.start,end:e.end})+") is still open")}function eu(t){let e=this;e.parser=r;function r(n){return mf(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}var tg={}.hasOwnProperty;function rg(t,e){let r=e||{};function n(i,...o){let s=n.invalid,a=n.handlers;if(i&&tg.call(i,t)){let u=String(i[t]);s=tg.call(a,u)?a[u]:n.unknown}if(s)return s.call(this,i,...o)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}var hS={}.hasOwnProperty;function gf(t,e){let r=-1,n;if(e.extensions)for(;++r<e.extensions.length;)gf(t,e.extensions[r]);for(n in e)if(hS.call(e,n))switch(n){case"extensions":break;case"unsafe":{ng(t[n],e[n]);break}case"join":{ng(t[n],e[n]);break}case"handlers":{mS(t[n],e[n]);break}default:t.options[n]=e[n]}return t}function ng(t,e){e&&t.push(...e)}function mS(t,e){e&&Object.assign(t,e)}function ig(t,e,r,n){let i=r.enter("blockquote"),o=r.createTracker(n);o.move("> "),o.shift(2);let s=r.indentLines(r.containerFlow(t,o.current()),gS);return i(),s}function gS(t,e,r){return">"+(r?"":" ")+t}function tu(t,e){return og(t,e.inConstruct,!0)&&!og(t,e.notInConstruct,!1)}function og(t,e,r){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return r;let n=-1;for(;++n<e.length;)if(t.includes(e[n]))return!0;return!1}function xf(t,e,r,n){let i=-1;for(;++i<r.unsafe.length;)if(r.unsafe[i].character===`
|
|
75
75
|
`&&tu(r.stack,r.unsafe[i]))return/[ \t]/.test(n.before)?"":" ";return`\\
|
|
76
|
-
`}function
|
|
76
|
+
`}function sg(t,e){let r=String(t),n=r.indexOf(e),i=n,o=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===i?++o>s&&(s=o):o=1,i=n+e.length,n=r.indexOf(e,i);return s}function ks(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function ag(t){let e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function ug(t,e,r,n){let i=ag(r),o=t.value||"",s=i==="`"?"GraveAccent":"Tilde";if(ks(t,r)){let f=r.enter("codeIndented"),p=r.indentLines(o,xS);return f(),p}let a=r.createTracker(n),u=i.repeat(Math.max(sg(o,i)+1,3)),l=r.enter("codeFenced"),c=a.move(u);if(t.lang){let f=r.enter(`codeFencedLang${s}`);c+=a.move(r.safe(t.lang,{before:c,after:" ",encode:["`"],...a.current()})),f()}if(t.lang&&t.meta){let f=r.enter(`codeFencedMeta${s}`);c+=a.move(" "),c+=a.move(r.safe(t.meta,{before:c,after:`
|
|
77
77
|
`,encode:["`"],...a.current()})),f()}return c+=a.move(`
|
|
78
78
|
`),o&&(c+=a.move(o+`
|
|
79
|
-
`)),c+=a.move(u),l(),c}function
|
|
80
|
-
`,...u.current()}))),a(),t.title&&(a=r.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(r.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),s(),l}function
|
|
79
|
+
`)),c+=a.move(u),l(),c}function xS(t,e,r){return(r?"":" ")+t}function fo(t){let e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function lg(t,e,r,n){let i=fo(r),o=i==='"'?"Quote":"Apostrophe",s=r.enter("definition"),a=r.enter("label"),u=r.createTracker(n),l=u.move("[");return l+=u.move(r.safe(r.associationId(t),{before:l,after:"]",...u.current()})),l+=u.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=r.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(r.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=r.enter("destinationRaw"),l+=u.move(r.safe(t.url,{before:l,after:t.title?" ":`
|
|
80
|
+
`,...u.current()}))),a(),t.title&&(a=r.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(r.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),s(),l}function cg(t){let e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function nr(t){return"&#x"+t.toString(16).toUpperCase()+";"}function po(t,e,r){let n=rn(t),i=rn(e);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}yf.peek=yS;function yf(t,e,r,n){let i=cg(r),o=r.enter("emphasis"),s=r.createTracker(n),a=s.move(i),u=s.move(r.containerPhrasing(t,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=po(n.before.charCodeAt(n.before.length-1),l,i);c.inside&&(u=nr(l)+u.slice(1));let f=u.charCodeAt(u.length-1),p=po(n.after.charCodeAt(0),f,i);p.inside&&(u=u.slice(0,-1)+nr(f));let d=s.move(i);return o(),r.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+u+d}function yS(t,e,r){return r.options.emphasis||"*"}var Fr=function(t){if(t==null)return CS;if(typeof t=="function")return ru(t);if(typeof t=="object")return Array.isArray(t)?bS(t):ES(t);if(typeof t=="string")return AS(t);throw new Error("Expected function, string, or object as test")};function bS(t){let e=[],r=-1;for(;++r<t.length;)e[r]=Fr(t[r]);return ru(n);function n(...i){let o=-1;for(;++o<e.length;)if(e[o].apply(this,i))return!0;return!1}}function ES(t){let e=t;return ru(r);function r(n){let i=n,o;for(o in t)if(i[o]!==e[o])return!1;return!0}}function AS(t){return ru(e);function e(r){return r&&r.type===t}}function ru(t){return e;function e(r,n,i){return!!(wS(r)&&t.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function CS(){return!0}function wS(t){return t!==null&&typeof t=="object"&&"type"in t}function fg(t){return"\x1B[33m"+t+"\x1B[39m"}var pg=[],nu=!0,Si=!1,iu="skip";function Ts(t,e,r,n){let i;typeof e=="function"&&typeof r!="function"?(n=r,r=e):i=e;let o=Fr(i),s=n?-1:1;a(t,void 0,[])();function a(u,l,c){let f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){let d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+fg(u.type+(d?"<"+d+">":""))+")"})}return p;function p(){let d=pg,m,y,g;if((!e||o(u,l,c[c.length-1]||void 0))&&(d=kS(r(u,c)),d[0]===Si))return d;if("children"in u&&u.children){let b=u;if(b.children&&d[0]!==iu)for(y=(n?b.children.length:-1)+s,g=c.concat(b);y>-1&&y<b.children.length;){let w=b.children[y];if(m=a(w,y,g)(),m[0]===Si)return m;y=typeof m[1]=="number"?m[1]:y+s}}return d}}}function kS(t){return Array.isArray(t)?t:typeof t=="number"?[nu,t]:t==null?pg:[t]}function _s(t,e,r,n){let i,o,s;typeof e=="function"&&typeof r!="function"?(o=void 0,s=e,i=r):(o=e,s=r,i=n),Ts(t,o,a,i);function a(u,l){let c=l[l.length-1],f=c?c.children.indexOf(u):void 0;return s(u,f,c)}}function ou(t,e){let r=!1;return _s(t,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,Si}),!!((!t.depth||t.depth<3)&&tn(t)&&(e.options.setext||r))}function dg(t,e,r,n){let i=Math.max(Math.min(6,t.depth||1),1),o=r.createTracker(n);if(ou(t,r)){let c=r.enter("headingSetext"),f=r.enter("phrasing"),p=r.containerPhrasing(t,{...o.current(),before:`
|
|
81
81
|
`,after:`
|
|
82
82
|
`});return f(),c(),p+`
|
|
83
83
|
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
84
84
|
`))+1))}let s="#".repeat(i),a=r.enter("headingAtx"),u=r.enter("phrasing");o.move(s+" ");let l=r.containerPhrasing(t,{before:"# ",after:`
|
|
85
|
-
`,...o.current()});return/^[\t ]/.test(l)&&(l=nr(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,r.options.closeAtx&&(l+=" "+s),u(),a(),l}
|
|
85
|
+
`,...o.current()});return/^[\t ]/.test(l)&&(l=nr(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,r.options.closeAtx&&(l+=" "+s),u(),a(),l}bf.peek=TS;function bf(t){return t.value||""}function TS(){return"<"}Ef.peek=_S;function Ef(t,e,r,n){let i=fo(r),o=i==='"'?"Quote":"Apostrophe",s=r.enter("image"),a=r.enter("label"),u=r.createTracker(n),l=u.move("![");return l+=u.move(r.safe(t.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=r.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(r.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=r.enter("destinationRaw"),l+=u.move(r.safe(t.url,{before:l,after:t.title?" ":")",...u.current()}))),a(),t.title&&(a=r.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(r.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),l+=u.move(")"),s(),l}function _S(){return"!"}Af.peek=SS;function Af(t,e,r,n){let i=t.referenceType,o=r.enter("imageReference"),s=r.enter("label"),a=r.createTracker(n),u=a.move("!["),l=r.safe(t.alt,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=r.stack;r.stack=[],s=r.enter("reference");let f=r.safe(r.associationId(t),{before:u,after:"]",...a.current()});return s(),r.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function SS(){return"!"}Cf.peek=vS;function Cf(t,e,r){let n=t.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o<r.unsafe.length;){let s=r.unsafe[o],a=r.compilePattern(s),u;if(s.atBreak)for(;u=a.exec(n);){let l=u.index;n.charCodeAt(l)===10&&n.charCodeAt(l-1)===13&&l--,n=n.slice(0,l)+" "+n.slice(u.index+1)}}return i+n+i}function vS(){return"`"}function wf(t,e){let r=tn(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}kf.peek=IS;function kf(t,e,r,n){let i=fo(r),o=i==='"'?"Quote":"Apostrophe",s=r.createTracker(n),a,u;if(wf(t,r)){let c=r.stack;r.stack=[],a=r.enter("autolink");let f=s.move("<");return f+=s.move(r.containerPhrasing(t,{before:f,after:">",...s.current()})),f+=s.move(">"),a(),r.stack=c,f}a=r.enter("link"),u=r.enter("label");let l=s.move("[");return l+=s.move(r.containerPhrasing(t,{before:l,after:"](",...s.current()})),l+=s.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=r.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(r.safe(t.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(u=r.enter("destinationRaw"),l+=s.move(r.safe(t.url,{before:l,after:t.title?" ":")",...s.current()}))),u(),t.title&&(u=r.enter(`title${o}`),l+=s.move(" "+i),l+=s.move(r.safe(t.title,{before:l,after:i,...s.current()})),l+=s.move(i),u()),l+=s.move(")"),a(),l}function IS(t,e,r){return wf(t,r)?"<":"["}Tf.peek=OS;function Tf(t,e,r,n){let i=t.referenceType,o=r.enter("linkReference"),s=r.enter("label"),a=r.createTracker(n),u=a.move("["),l=r.containerPhrasing(t,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=r.stack;r.stack=[],s=r.enter("reference");let f=r.safe(r.associationId(t),{before:u,after:"]",...a.current()});return s(),r.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function OS(){return"["}function ho(t){let e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function hg(t){let e=ho(t),r=t.options.bulletOther;if(!r)return e==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+r+"`) to be different");return r}function mg(t){let e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function su(t){let e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function gg(t,e,r,n){let i=r.enter("list"),o=r.bulletCurrent,s=t.ordered?mg(r):ho(r),a=t.ordered?s==="."?")":".":hg(r),u=e&&r.bulletLastUsed?s===r.bulletLastUsed:!1;if(!t.ordered){let c=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(u=!0),su(r)===s&&c){let f=-1;for(;++f<t.children.length;){let p=t.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),r.bulletCurrent=s;let l=r.containerFlow(t,n);return r.bulletLastUsed=s,r.bulletCurrent=o,i(),l}function xg(t){let e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function yg(t,e,r,n){let i=xg(r),o=r.bulletCurrent||ho(r);e&&e.type==="list"&&e.ordered&&(o=(typeof e.start=="number"&&e.start>-1?e.start:1)+(r.options.incrementListMarker===!1?0:e.children.indexOf(t))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);let a=r.createTracker(n);a.move(o+" ".repeat(s-o.length)),a.shift(s);let u=r.enter("listItem"),l=r.indentLines(r.containerFlow(t,a.current()),c);return u(),l;function c(f,p,d){return p?(d?"":" ".repeat(s))+f:(d?o:o+" ".repeat(s-o.length))+f}}function bg(t,e,r,n){let i=r.enter("paragraph"),o=r.enter("phrasing"),s=r.containerPhrasing(t,n);return o(),i(),s}var _f=Fr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Eg(t,e,r,n){return(t.children.some(function(s){return _f(s)})?r.containerPhrasing:r.containerFlow).call(r,t,n)}function Ag(t){let e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Sf.peek=DS;function Sf(t,e,r,n){let i=Ag(r),o=r.enter("strong"),s=r.createTracker(n),a=s.move(i+i),u=s.move(r.containerPhrasing(t,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=po(n.before.charCodeAt(n.before.length-1),l,i);c.inside&&(u=nr(l)+u.slice(1));let f=u.charCodeAt(u.length-1),p=po(n.after.charCodeAt(0),f,i);p.inside&&(u=u.slice(0,-1)+nr(f));let d=s.move(i+i);return o(),r.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+u+d}function DS(t,e,r){return r.options.strong||"*"}function Cg(t,e,r,n){return r.safe(t.value,n)}function wg(t){let e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function kg(t,e,r){let n=(su(r)+(r.options.ruleSpaces?" ":"")).repeat(wg(r));return r.options.ruleSpaces?n.slice(0,-1):n}var vi={blockquote:ig,break:xf,code:ug,definition:lg,emphasis:yf,hardBreak:xf,heading:dg,html:bf,image:Ef,imageReference:Af,inlineCode:Cf,link:kf,linkReference:Tf,list:gg,listItem:yg,paragraph:bg,root:Eg,strong:Sf,text:Cg,thematicBreak:kg};var Tg=[RS];function RS(t,e,r,n){if(e.type==="code"&&ks(e,n)&&(t.type==="list"||t.type===e.type&&ks(t,n)))return!1;if("spread"in r&&typeof r.spread=="boolean")return t.type==="paragraph"&&(t.type===e.type||e.type==="definition"||e.type==="heading"&&ou(e,n))?void 0:r.spread?1:0}var Ii=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],_g=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
|
|
86
86
|
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:Ii},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
|
|
87
87
|
]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Ii},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
|
|
88
88
|
*])`},{character:"*",inConstruct:"phrasing",notInConstruct:Ii},{atBreak:!0,character:"+",after:`(?:[ \r
|
|
89
89
|
])`},{atBreak:!0,character:"-",after:`(?:[ \r
|
|
90
90
|
-])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
|
|
91
|
-
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Ii},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Ii},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Ii},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Ii},{atBreak:!0,character:"~"}];function
|
|
92
|
-
`)&&c.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=e.createTracker(r),l.move(o.join("")));let p=e.handle(c,t,e,{...l.current(),after:f,before:a});u&&u===p.slice(0,1)&&(p=nr(u.charCodeAt(0))+p.slice(1));let d=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,u=void 0,d&&(o.length>0&&d.before&&a===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+nr(a.charCodeAt(0))),d.after&&(u=f)),l.move(p),o.push(p),a=p.slice(-1)}return n.pop(),o.join("")}function
|
|
91
|
+
]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Ii},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Ii},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Ii},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Ii},{atBreak:!0,character:"~"}];function Sg(t){return t.label||!t.identifier?t.label||"":Qa(t.identifier)}function vg(t){if(!t._compiled){let e=(t.atBreak?"[\\r\\n][\\t ]*":"")+(t.before?"(?:"+t.before+")":"");t._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(t.character)?"\\":"")+t.character+(t.after?"(?:"+t.after+")":""),"g")}return t._compiled}function Ig(t,e,r){let n=e.indexStack,i=t.children||[],o=[],s=-1,a=r.before,u;n.push(-1);let l=e.createTracker(r);for(;++s<i.length;){let c=i[s],f;if(n[n.length-1]=s,s+1<i.length){let m=e.handle.handlers[i[s+1].type];m&&m.peek&&(m=m.peek),f=m?m(i[s+1],t,e,{before:"",after:"",...l.current()}).charAt(0):""}else f=r.after;o.length>0&&(a==="\r"||a===`
|
|
92
|
+
`)&&c.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=e.createTracker(r),l.move(o.join("")));let p=e.handle(c,t,e,{...l.current(),after:f,before:a});u&&u===p.slice(0,1)&&(p=nr(u.charCodeAt(0))+p.slice(1));let d=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,u=void 0,d&&(o.length>0&&d.before&&a===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+nr(a.charCodeAt(0))),d.after&&(u=f)),l.move(p),o.push(p),a=p.slice(-1)}return n.pop(),o.join("")}function Og(t,e,r){let n=e.indexStack,i=t.children||[],o=e.createTracker(r),s=[],a=-1;for(n.push(-1);++a<i.length;){let u=i[a];n[n.length-1]=a,s.push(o.move(e.handle(u,t,e,{before:`
|
|
93
93
|
`,after:`
|
|
94
|
-
`,...o.current()}))),u.type!=="list"&&(e.bulletLastUsed=void 0),a<i.length-1&&s.push(o.move(
|
|
94
|
+
`,...o.current()}))),u.type!=="list"&&(e.bulletLastUsed=void 0),a<i.length-1&&s.push(o.move(FS(u,i[a+1],t,e)))}return n.pop(),s.join("")}function FS(t,e,r,n){let i=n.join.length;for(;i--;){let o=n.join[i](t,e,r,n);if(o===!0||o===1)break;if(typeof o=="number")return`
|
|
95
95
|
`.repeat(1+o);if(o===!1)return`
|
|
96
96
|
|
|
97
97
|
<!---->
|
|
98
98
|
|
|
99
99
|
`}return`
|
|
100
100
|
|
|
101
|
-
`}var
|
|
101
|
+
`}var NS=/\r?\n|\r/g;function Dg(t,e){let r=[],n=0,i=0,o;for(;o=NS.exec(t);)s(t.slice(n,o.index)),r.push(o[0]),n=o.index+o[0].length,i++;return s(t.slice(n)),r.join("");function s(a){r.push(e(a,i,!a))}}function Fg(t,e,r){let n=(r.before||"")+(e||"")+(r.after||""),i=[],o=[],s={},a=-1;for(;++a<t.unsafe.length;){let c=t.unsafe[a];if(!tu(t.stack,c))continue;let f=t.compilePattern(c),p;for(;p=f.exec(n);){let d="before"in c||!!c.atBreak,m="after"in c,y=p.index+(d?p[1].length:0);i.includes(y)?(s[y].before&&!d&&(s[y].before=!1),s[y].after&&!m&&(s[y].after=!1)):(i.push(y),s[y]={before:d,after:m})}}i.sort(PS);let u=r.before?r.before.length:0,l=n.length-(r.after?r.after.length:0);for(a=-1;++a<i.length;){let c=i[a];c<u||c>=l||c+1<l&&i[a+1]===c+1&&s[c].after&&!s[c+1].before&&!s[c+1].after||i[a-1]===c-1&&s[c].before&&!s[c-1].before&&!s[c-1].after||(u!==c&&o.push(Rg(n.slice(u,c),"\\")),u=c,/[!-/:-@[-`{-~]/.test(n.charAt(c))&&(!r.encode||!r.encode.includes(n.charAt(c)))?o.push("\\"):(o.push(nr(n.charCodeAt(c))),u++))}return o.push(Rg(n.slice(u,l),r.after)),o.join("")}function PS(t,e){return t-e}function Rg(t,e){let r=/\\(?=[!-/:-@[-`{-~])/g,n=[],i=[],o=t+e,s=-1,a=0,u;for(;u=r.exec(o);)n.push(u.index);for(;++s<n.length;)a!==n[s]&&i.push(t.slice(a,n[s])),i.push("\\"),a=n[s];return i.push(t.slice(a)),i.join("")}function Ng(t){let e=t||{},r=e.now||{},n=e.lineShift||0,i=r.line||1,o=r.column||1;return{move:u,current:s,shift:a};function s(){return{now:{line:i,column:o},lineShift:n}}function a(l){n+=l}function u(l){let c=l||"",f=c.split(/\r?\n|\r/g),p=f[f.length-1];return i+=f.length-1,o=f.length===1?o+p.length:1+p.length+n,c}}function vf(t,e){let r=e||{},n={associationId:Sg,containerPhrasing:jS,containerFlow:US,createTracker:Ng,compilePattern:vg,enter:o,handlers:{...vi},handle:void 0,indentLines:Dg,indexStack:[],join:[...Tg],options:{},safe:zS,stack:[],unsafe:[..._g]};gf(n,r),n.options.tightDefinitions&&n.join.push(BS),n.handle=rg("type",{invalid:LS,unknown:MS,handlers:n.handlers});let i=n.handle(t,void 0,n,{before:`
|
|
102
102
|
`,after:`
|
|
103
103
|
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
104
|
-
`),i;function o(s){return n.stack.push(s),a;function a(){n.stack.pop()}}}function FS(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function NS(t){let e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function PS(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function LS(t,e){return Sg(t,this,e)}function MS(t,e){return vg(t,this,e)}function BS(t,e){return Dg(this,t,e)}function au(t){let e=this;e.compiler=r;function r(n){return Sf(n,{...e.data("settings"),...t,extensions:e.data("toMarkdownExtensions")||[]})}}function vf(t){if(t)throw t}var cu=jd(zg(),1);function Ss(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function If(){let t=[],e={run:r,use:n};return e;function r(...i){let o=-1,s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...l){let c=t[++o],f=-1;if(u){s(u);return}for(;++f<i.length;)(l[f]===null||l[f]===void 0)&&(l[f]=i[f]);i=l,c?$g(c,a)(...l):s(null,...l)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function $g(t,e){let r;return n;function n(...s){let a=t.length>s.length,u;a&&s.push(i);try{u=t.apply(this,s)}catch(l){let c=l;if(a&&r)throw c;return i(c)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){r||(r=!0,e(s,...a))}function o(s){i(null,s)}}import{VFile as jS}from"vfile";var qg=function(t){let n=this.constructor.prototype,i=n[t],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,n),o};var US={}.hasOwnProperty,Ff=class t extends qg{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=If()}copy(){let e=new t,r=-1;for(;++r<this.attachers.length;){let n=this.attachers[r];e.use(...n)}return e.data((0,cu.default)(!0,{},this.namespace)),e}data(e,r){return typeof e=="string"?arguments.length===2?(Rf("data",this.frozen),this.namespace[e]=r,this):US.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Rf("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let i=r.call(e,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let r=lu(e),n=this.parser||this.Parser;return Of("parse",n),n(String(r),r)}process(e,r){let n=this;return this.freeze(),Of("process",this.parser||this.Parser),Df("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(o,s){let a=lu(e),u=n.parse(a);n.run(u,a,function(c,f,p){if(c||!f||!p)return l(c);let d=f,m=n.stringify(d,p);$S(m)?p.value=m:p.result=m,l(c,p)});function l(c,f){c||!f?s(c):o?o(f):r(void 0,f)}}}processSync(e){let r=!1,n;return this.freeze(),Of("processSync",this.parser||this.Parser),Df("processSync",this.compiler||this.Compiler),this.process(e,i),Gg("processSync","process",r),n;function i(o,s){r=!0,vf(o),n=s}}run(e,r,n){Vg(e),this.freeze();let i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?o(void 0,n):new Promise(o);function o(s,a){let u=lu(r);i.run(e,u,l);function l(c,f,p){let d=f||e;c?a(c):s?s(d):n(void 0,d,p)}}}runSync(e,r){let n=!1,i;return this.run(e,r,o),Gg("runSync","run",n),i;function o(s,a){vf(s),i=a,n=!0}}stringify(e,r){this.freeze();let n=lu(r),i=this.compiler||this.Compiler;return Df("stringify",i),Vg(e),i(e,n)}use(e,...r){let n=this.attachers,i=this.namespace;if(Rf("use",this.frozen),e!=null)if(typeof e=="function")u(e,r);else if(typeof e=="object")Array.isArray(e)?a(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){let[c,...f]=l;u(c,f)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(l.plugins),l.settings&&(i.settings=(0,cu.default)(!0,i.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){let f=l[c];o(f)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,c){let f=-1,p=-1;for(;++f<n.length;)if(n[f][0]===l){p=f;break}if(p===-1)n.push([l,...c]);else if(c.length>0){let[d,...m]=c,y=n[p][1];Ss(y)&&Ss(d)&&(d=(0,cu.default)(!0,y,d)),n[p]=[l,d,...m]}}}},Nf=new Ff().freeze();function Of(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Df(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Rf(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Vg(t){if(!Ss(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Gg(t,e,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function lu(t){return zS(t)?t:new jS(t)}function zS(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function $S(t){return typeof t=="string"||qS(t)}function qS(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}var mo=Nf().use(eu).use(au).freeze();function Pf(t,e){let r=String(t);if(typeof e!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(e);for(;i!==-1;)n++,i=r.indexOf(e,i+e.length);return n}function Lf(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Mf(t,e,r){let i=Fr((r||{}).ignore||[]),o=VS(e),s=-1;for(;++s<o.length;)Ts(t,"text",a);function a(l,c){let f=-1,p;for(;++f<c.length;){let d=c[f],m=p?p.children:void 0;if(i(d,m?m.indexOf(d):void 0,p))return;p=d}if(p)return u(l,c)}function u(l,c){let f=c[c.length-1],p=o[s][0],d=o[s][1],m=0,g=f.children.indexOf(l),b=!1,w=[];p.lastIndex=0;let C=p.exec(l.value);for(;C;){let D=C.index,R={index:C.index,input:C.input,stack:[...c,l]},S=d(...C,R);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?p.lastIndex=D+1:(m!==D&&w.push({type:"text",value:l.value.slice(m,D)}),Array.isArray(S)?w.push(...S):S&&w.push(S),m=D+C[0].length,b=!0),!p.global)break;C=p.exec(l.value)}return b?(m<l.value.length&&w.push({type:"text",value:l.value.slice(m)}),f.children.splice(g,1,...w)):w=[l],g+w.length}}function VS(t){let e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");let r=!t[0]||Array.isArray(t[0])?t:[t],n=-1;for(;++n<r.length;){let i=r[n];e.push([GS(i[0]),WS(i[1])])}return e}function GS(t){return typeof t=="string"?new RegExp(Lf(t),"g"):t}function WS(t){return typeof t=="function"?t:function(){return t}}var Bf="phrasing",jf=["autolink","link","image","label"];function zf(){return{transforms:[JS],enter:{literalAutolink:HS,literalAutolinkEmail:Uf,literalAutolinkHttp:Uf,literalAutolinkWww:Uf},exit:{literalAutolink:XS,literalAutolinkEmail:ZS,literalAutolinkHttp:KS,literalAutolinkWww:YS}}}function $f(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Bf,notInConstruct:jf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Bf,notInConstruct:jf},{character:":",before:"[ps]",after:"\\/",inConstruct:Bf,notInConstruct:jf}]}}function HS(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Uf(t){this.config.enter.autolinkProtocol.call(this,t)}function KS(t){this.config.exit.autolinkProtocol.call(this,t)}function YS(t){this.config.exit.data.call(this,t);let e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function ZS(t){this.config.exit.autolinkEmail.call(this,t)}function XS(t){this.exit(t)}function JS(t){Mf(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,QS],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),e0]],{ignore:["link","linkReference"]})}function QS(t,e,r,n,i){let o="";if(!Wg(i)||(/^w/i.test(e)&&(r=e+r,e="",o="http://"),!t0(r)))return!1;let s=r0(r+n);if(!s[0])return!1;let a={type:"link",title:null,url:o+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function e0(t,e,r,n){return!Wg(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function t0(t){let e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function r0(t){let e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],n=r.indexOf(")"),i=Pf(t,"("),o=Pf(t,")");for(;n!==-1&&i>o;)t+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),o++;return[t,r]}function Wg(t,e){let r=t.input.charCodeAt(t.index-1);return(t.index===0||Dr(r)||wi(r))&&(!e||r!==47)}Hg.peek=f0;function qf(){return{enter:{gfmFootnoteDefinition:n0,gfmFootnoteDefinitionLabelString:i0,gfmFootnoteCall:a0,gfmFootnoteCallString:u0},exit:{gfmFootnoteDefinition:s0,gfmFootnoteDefinitionLabelString:o0,gfmFootnoteCall:c0,gfmFootnoteCallString:l0}}}function Vf(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:p0,footnoteReference:Hg}}}function n0(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function i0(){this.buffer()}function o0(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=It(this.sliceSerialize(t)).toLowerCase()}function s0(t){this.exit(t)}function a0(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function u0(){this.buffer()}function l0(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=It(this.sliceSerialize(t)).toLowerCase()}function c0(t){this.exit(t)}function Hg(t,e,r,n){let i=r.createTracker(n),o=i.move("[^"),s=r.enter("footnoteReference"),a=r.enter("reference");return o+=i.move(r.safe(r.associationId(t),{...i.current(),before:o,after:"]"})),a(),s(),o+=i.move("]"),o}function f0(){return"["}function p0(t,e,r,n){let i=r.createTracker(n),o=i.move("[^"),s=r.enter("footnoteDefinition"),a=r.enter("label");return o+=i.move(r.safe(r.associationId(t),{...i.current(),before:o,after:"]"})),a(),o+=i.move("]:"+(t.children&&t.children.length>0?" ":"")),i.shift(4),o+=i.move(r.indentLines(r.containerFlow(t,i.current()),d0)),s(),o}function d0(t,e,r){return e===0?t:(r?"":" ")+t}var h0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Kg.peek=x0;function Gf(){return{canContainEols:["delete"],enter:{strikethrough:m0},exit:{strikethrough:g0}}}function Wf(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:h0}],handlers:{delete:Kg}}}function m0(t){this.enter({type:"delete",children:[]},t)}function g0(t){this.exit(t)}function Kg(t,e,r,n){let i=r.createTracker(n),o=r.enter("strikethrough"),s=i.move("~~");return s+=r.containerPhrasing(t,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function x0(){return"~"}function y0(t){return t.length}function Zg(t,e){let r=e||{},n=(r.align||[]).concat(),i=r.stringLength||y0,o=[],s=[],a=[],u=[],l=0,c=-1;for(;++c<t.length;){let y=[],g=[],b=-1;for(t[c].length>l&&(l=t[c].length);++b<t[c].length;){let w=b0(t[c][b]);if(r.alignDelimiters!==!1){let C=i(w);g[b]=C,(u[b]===void 0||C>u[b])&&(u[b]=C)}y.push(w)}s[c]=y,a[c]=g}let f=-1;if(typeof n=="object"&&"length"in n)for(;++f<l;)o[f]=Yg(n[f]);else{let y=Yg(n);for(;++f<l;)o[f]=y}f=-1;let p=[],d=[];for(;++f<l;){let y=o[f],g="",b="";y===99?(g=":",b=":"):y===108?g=":":y===114&&(b=":");let w=r.alignDelimiters===!1?1:Math.max(1,u[f]-g.length-b.length),C=g+"-".repeat(w)+b;r.alignDelimiters!==!1&&(w=g.length+w+b.length,w>u[f]&&(u[f]=w),d[f]=w),p[f]=C}s.splice(1,0,p),a.splice(1,0,d),c=-1;let m=[];for(;++c<s.length;){let y=s[c],g=a[c];f=-1;let b=[];for(;++f<l;){let w=y[f]||"",C="",D="";if(r.alignDelimiters!==!1){let R=u[f]-(g[f]||0),S=o[f];S===114?C=" ".repeat(R):S===99?R%2?(C=" ".repeat(R/2+.5),D=" ".repeat(R/2-.5)):(C=" ".repeat(R/2),D=C):D=" ".repeat(R)}r.delimiterStart!==!1&&!f&&b.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&w==="")&&(r.delimiterStart!==!1||f)&&b.push(" "),r.alignDelimiters!==!1&&b.push(C),b.push(w),r.alignDelimiters!==!1&&b.push(D),r.padding!==!1&&b.push(" "),(r.delimiterEnd!==!1||f!==l-1)&&b.push("|")}m.push(r.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
|
|
105
|
-
`)}function
|
|
104
|
+
`),i;function o(s){return n.stack.push(s),a;function a(){n.stack.pop()}}}function LS(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function MS(t){let e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function BS(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function jS(t,e){return Ig(t,this,e)}function US(t,e){return Og(t,this,e)}function zS(t,e){return Fg(this,t,e)}function au(t){let e=this;e.compiler=r;function r(n){return vf(n,{...e.data("settings"),...t,extensions:e.data("toMarkdownExtensions")||[]})}}function If(t){if(t)throw t}var cu=jd(qg(),1);function Ss(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Of(){let t=[],e={run:r,use:n};return e;function r(...i){let o=-1,s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...l){let c=t[++o],f=-1;if(u){s(u);return}for(;++f<i.length;)(l[f]===null||l[f]===void 0)&&(l[f]=i[f]);i=l,c?Vg(c,a)(...l):s(null,...l)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function Vg(t,e){let r;return n;function n(...s){let a=t.length>s.length,u;a&&s.push(i);try{u=t.apply(this,s)}catch(l){let c=l;if(a&&r)throw c;return i(c)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){r||(r=!0,e(s,...a))}function o(s){i(null,s)}}import{VFile as $S}from"vfile";var Gg=function(t){let n=this.constructor.prototype,i=n[t],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,n),o};var qS={}.hasOwnProperty,Nf=class t extends Gg{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Of()}copy(){let e=new t,r=-1;for(;++r<this.attachers.length;){let n=this.attachers[r];e.use(...n)}return e.data((0,cu.default)(!0,{},this.namespace)),e}data(e,r){return typeof e=="string"?arguments.length===2?(Ff("data",this.frozen),this.namespace[e]=r,this):qS.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Ff("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let i=r.call(e,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let r=lu(e),n=this.parser||this.Parser;return Df("parse",n),n(String(r),r)}process(e,r){let n=this;return this.freeze(),Df("process",this.parser||this.Parser),Rf("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(o,s){let a=lu(e),u=n.parse(a);n.run(u,a,function(c,f,p){if(c||!f||!p)return l(c);let d=f,m=n.stringify(d,p);GS(m)?p.value=m:p.result=m,l(c,p)});function l(c,f){c||!f?s(c):o?o(f):r(void 0,f)}}}processSync(e){let r=!1,n;return this.freeze(),Df("processSync",this.parser||this.Parser),Rf("processSync",this.compiler||this.Compiler),this.process(e,i),Hg("processSync","process",r),n;function i(o,s){r=!0,If(o),n=s}}run(e,r,n){Wg(e),this.freeze();let i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?o(void 0,n):new Promise(o);function o(s,a){let u=lu(r);i.run(e,u,l);function l(c,f,p){let d=f||e;c?a(c):s?s(d):n(void 0,d,p)}}}runSync(e,r){let n=!1,i;return this.run(e,r,o),Hg("runSync","run",n),i;function o(s,a){If(s),i=a,n=!0}}stringify(e,r){this.freeze();let n=lu(r),i=this.compiler||this.Compiler;return Rf("stringify",i),Wg(e),i(e,n)}use(e,...r){let n=this.attachers,i=this.namespace;if(Ff("use",this.frozen),e!=null)if(typeof e=="function")u(e,r);else if(typeof e=="object")Array.isArray(e)?a(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){let[c,...f]=l;u(c,f)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(l){if(!("plugins"in l)&&!("settings"in l))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(l.plugins),l.settings&&(i.settings=(0,cu.default)(!0,i.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){let f=l[c];o(f)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,c){let f=-1,p=-1;for(;++f<n.length;)if(n[f][0]===l){p=f;break}if(p===-1)n.push([l,...c]);else if(c.length>0){let[d,...m]=c,y=n[p][1];Ss(y)&&Ss(d)&&(d=(0,cu.default)(!0,y,d)),n[p]=[l,d,...m]}}}},Pf=new Nf().freeze();function Df(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Rf(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Ff(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Wg(t){if(!Ss(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Hg(t,e,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function lu(t){return VS(t)?t:new $S(t)}function VS(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function GS(t){return typeof t=="string"||WS(t)}function WS(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}var mo=Pf().use(eu).use(au).freeze();function Lf(t,e){let r=String(t);if(typeof e!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(e);for(;i!==-1;)n++,i=r.indexOf(e,i+e.length);return n}function Mf(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Bf(t,e,r){let i=Fr((r||{}).ignore||[]),o=HS(e),s=-1;for(;++s<o.length;)Ts(t,"text",a);function a(l,c){let f=-1,p;for(;++f<c.length;){let d=c[f],m=p?p.children:void 0;if(i(d,m?m.indexOf(d):void 0,p))return;p=d}if(p)return u(l,c)}function u(l,c){let f=c[c.length-1],p=o[s][0],d=o[s][1],m=0,g=f.children.indexOf(l),b=!1,w=[];p.lastIndex=0;let C=p.exec(l.value);for(;C;){let D=C.index,R={index:C.index,input:C.input,stack:[...c,l]},S=d(...C,R);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?p.lastIndex=D+1:(m!==D&&w.push({type:"text",value:l.value.slice(m,D)}),Array.isArray(S)?w.push(...S):S&&w.push(S),m=D+C[0].length,b=!0),!p.global)break;C=p.exec(l.value)}return b?(m<l.value.length&&w.push({type:"text",value:l.value.slice(m)}),f.children.splice(g,1,...w)):w=[l],g+w.length}}function HS(t){let e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");let r=!t[0]||Array.isArray(t[0])?t:[t],n=-1;for(;++n<r.length;){let i=r[n];e.push([KS(i[0]),YS(i[1])])}return e}function KS(t){return typeof t=="string"?new RegExp(Mf(t),"g"):t}function YS(t){return typeof t=="function"?t:function(){return t}}var jf="phrasing",Uf=["autolink","link","image","label"];function $f(){return{transforms:[t0],enter:{literalAutolink:ZS,literalAutolinkEmail:zf,literalAutolinkHttp:zf,literalAutolinkWww:zf},exit:{literalAutolink:e0,literalAutolinkEmail:QS,literalAutolinkHttp:XS,literalAutolinkWww:JS}}}function qf(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:jf,notInConstruct:Uf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:jf,notInConstruct:Uf},{character:":",before:"[ps]",after:"\\/",inConstruct:jf,notInConstruct:Uf}]}}function ZS(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function zf(t){this.config.enter.autolinkProtocol.call(this,t)}function XS(t){this.config.exit.autolinkProtocol.call(this,t)}function JS(t){this.config.exit.data.call(this,t);let e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function QS(t){this.config.exit.autolinkEmail.call(this,t)}function e0(t){this.exit(t)}function t0(t){Bf(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,r0],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),n0]],{ignore:["link","linkReference"]})}function r0(t,e,r,n,i){let o="";if(!Kg(i)||(/^w/i.test(e)&&(r=e+r,e="",o="http://"),!i0(r)))return!1;let s=o0(r+n);if(!s[0])return!1;let a={type:"link",title:null,url:o+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function n0(t,e,r,n){return!Kg(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function i0(t){let e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function o0(t){let e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],n=r.indexOf(")"),i=Lf(t,"("),o=Lf(t,")");for(;n!==-1&&i>o;)t+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),o++;return[t,r]}function Kg(t,e){let r=t.input.charCodeAt(t.index-1);return(t.index===0||Dr(r)||wi(r))&&(!e||r!==47)}Yg.peek=h0;function Vf(){return{enter:{gfmFootnoteDefinition:s0,gfmFootnoteDefinitionLabelString:a0,gfmFootnoteCall:c0,gfmFootnoteCallString:f0},exit:{gfmFootnoteDefinition:l0,gfmFootnoteDefinitionLabelString:u0,gfmFootnoteCall:d0,gfmFootnoteCallString:p0}}}function Gf(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:m0,footnoteReference:Yg}}}function s0(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function a0(){this.buffer()}function u0(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=It(this.sliceSerialize(t)).toLowerCase()}function l0(t){this.exit(t)}function c0(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function f0(){this.buffer()}function p0(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.label=e,r.identifier=It(this.sliceSerialize(t)).toLowerCase()}function d0(t){this.exit(t)}function Yg(t,e,r,n){let i=r.createTracker(n),o=i.move("[^"),s=r.enter("footnoteReference"),a=r.enter("reference");return o+=i.move(r.safe(r.associationId(t),{...i.current(),before:o,after:"]"})),a(),s(),o+=i.move("]"),o}function h0(){return"["}function m0(t,e,r,n){let i=r.createTracker(n),o=i.move("[^"),s=r.enter("footnoteDefinition"),a=r.enter("label");return o+=i.move(r.safe(r.associationId(t),{...i.current(),before:o,after:"]"})),a(),o+=i.move("]:"+(t.children&&t.children.length>0?" ":"")),i.shift(4),o+=i.move(r.indentLines(r.containerFlow(t,i.current()),g0)),s(),o}function g0(t,e,r){return e===0?t:(r?"":" ")+t}var x0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Zg.peek=E0;function Wf(){return{canContainEols:["delete"],enter:{strikethrough:y0},exit:{strikethrough:b0}}}function Hf(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:x0}],handlers:{delete:Zg}}}function y0(t){this.enter({type:"delete",children:[]},t)}function b0(t){this.exit(t)}function Zg(t,e,r,n){let i=r.createTracker(n),o=r.enter("strikethrough"),s=i.move("~~");return s+=r.containerPhrasing(t,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function E0(){return"~"}function A0(t){return t.length}function Jg(t,e){let r=e||{},n=(r.align||[]).concat(),i=r.stringLength||A0,o=[],s=[],a=[],u=[],l=0,c=-1;for(;++c<t.length;){let y=[],g=[],b=-1;for(t[c].length>l&&(l=t[c].length);++b<t[c].length;){let w=C0(t[c][b]);if(r.alignDelimiters!==!1){let C=i(w);g[b]=C,(u[b]===void 0||C>u[b])&&(u[b]=C)}y.push(w)}s[c]=y,a[c]=g}let f=-1;if(typeof n=="object"&&"length"in n)for(;++f<l;)o[f]=Xg(n[f]);else{let y=Xg(n);for(;++f<l;)o[f]=y}f=-1;let p=[],d=[];for(;++f<l;){let y=o[f],g="",b="";y===99?(g=":",b=":"):y===108?g=":":y===114&&(b=":");let w=r.alignDelimiters===!1?1:Math.max(1,u[f]-g.length-b.length),C=g+"-".repeat(w)+b;r.alignDelimiters!==!1&&(w=g.length+w+b.length,w>u[f]&&(u[f]=w),d[f]=w),p[f]=C}s.splice(1,0,p),a.splice(1,0,d),c=-1;let m=[];for(;++c<s.length;){let y=s[c],g=a[c];f=-1;let b=[];for(;++f<l;){let w=y[f]||"",C="",D="";if(r.alignDelimiters!==!1){let R=u[f]-(g[f]||0),S=o[f];S===114?C=" ".repeat(R):S===99?R%2?(C=" ".repeat(R/2+.5),D=" ".repeat(R/2-.5)):(C=" ".repeat(R/2),D=C):D=" ".repeat(R)}r.delimiterStart!==!1&&!f&&b.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&w==="")&&(r.delimiterStart!==!1||f)&&b.push(" "),r.alignDelimiters!==!1&&b.push(C),b.push(w),r.alignDelimiters!==!1&&b.push(D),r.padding!==!1&&b.push(" "),(r.delimiterEnd!==!1||f!==l-1)&&b.push("|")}m.push(r.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
|
|
105
|
+
`)}function C0(t){return t==null?"":String(t)}function Xg(t){let e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function Yf(){return{enter:{table:w0,tableData:Qg,tableHeader:Qg,tableRow:T0},exit:{codeText:_0,table:k0,tableData:Kf,tableHeader:Kf,tableRow:Kf}}}function w0(t){let e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function k0(t){this.exit(t),this.data.inTable=void 0}function T0(t){this.enter({type:"tableRow",children:[]},t)}function Kf(t){this.exit(t)}function Qg(t){this.enter({type:"tableCell",children:[]},t)}function _0(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,S0));let r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function S0(t,e){return e==="|"?e:t}function Zf(t){let e=t||{},r=e.tableCellPadding,n=e.tablePipeAlign,i=e.stringLength,o=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
106
106
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:u,tableRow:a}};function s(d,m,y,g){return l(c(d,y,g),d.align)}function a(d,m,y,g){let b=f(d,y,g),w=l([b]);return w.slice(0,w.indexOf(`
|
|
107
|
-
`))}function u(d,m,y,g){let b=y.enter("tableCell"),w=y.enter("phrasing"),C=y.containerPhrasing(d,{...g,before:o,after:o});return w(),b(),C}function l(d,m){return Zg(d,{align:m,alignDelimiters:n,padding:r,stringLength:i})}function c(d,m,y){let g=d.children,b=-1,w=[],C=m.enter("table");for(;++b<g.length;)w[b]=f(g[b],m,y);return C(),w}function f(d,m,y){let g=d.children,b=-1,w=[],C=m.enter("tableRow");for(;++b<g.length;)w[b]=u(g[b],d,m,y);return C(),w}function p(d,m,y){let g=vi.inlineCode(d,m,y);return y.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function Zf(){return{exit:{taskListCheckValueChecked:Jg,taskListCheckValueUnchecked:Jg,paragraph:T0}}}function Xf(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:_0}}}function Jg(t){let e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function T0(t){let e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){let r=this.stack[this.stack.length-1];r.type;let n=r.children[0];if(n&&n.type==="text"){let i=e.children,o=-1,s;for(;++o<i.length;){let a=i[o];if(a.type==="paragraph"){s=a;break}}s===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(t)}function _0(t,e,r,n){let i=t.children[0],o=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",a=r.createTracker(n);o&&a.move(s);let u=vi.listItem(t,e,r,{...n,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(c){return c+s}}function Jf(){return[zf(),qf(),Gf(),Kf(),Zf()]}function Qf(t){return{extensions:[$f(),Vf(),Wf(),Yf(t),Xf()]}}var S0={tokenize:R0,partial:!0},Qg={tokenize:F0,partial:!0},ex={tokenize:N0,partial:!0},tx={tokenize:P0,partial:!0},v0={tokenize:L0,partial:!0},rx={name:"wwwAutolink",tokenize:O0,previous:ix},nx={name:"protocolAutolink",tokenize:D0,previous:ox},nn={name:"emailAutolink",tokenize:I0,previous:sx},Nr={};function tp(){return{text:Nr}}var Oi=48;for(;Oi<123;)Nr[Oi]=nn,Oi++,Oi===58?Oi=65:Oi===91&&(Oi=97);Nr[43]=nn;Nr[45]=nn;Nr[46]=nn;Nr[95]=nn;Nr[72]=[nn,nx];Nr[104]=[nn,nx];Nr[87]=[nn,rx];Nr[119]=[nn,rx];function I0(t,e,r){let n=this,i,o;return s;function s(f){return!ep(f)||!sx.call(n,n.previous)||rp(n.events)?r(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(f))}function a(f){return ep(f)?(t.consume(f),a):f===64?(t.consume(f),u):r(f)}function u(f){return f===46?t.check(v0,c,l)(f):f===45||f===95||yt(f)?(o=!0,t.consume(f),u):c(f)}function l(f){return t.consume(f),i=!0,u}function c(f){return o&&i&&xt(n.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):r(f)}}function O0(t,e,r){let n=this;return i;function i(s){return s!==87&&s!==119||!ix.call(n,n.previous)||rp(n.events)?r(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(S0,t.attempt(Qg,t.attempt(ex,o),r),r)(s))}function o(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function D0(t,e,r){let n=this,i="",o=!1;return s;function s(f){return(f===72||f===104)&&ox.call(n,n.previous)&&!rp(n.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),a):r(f)}function a(f){if(xt(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),a;if(f===58){let p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(f),u}return r(f)}function u(f){return f===47?(t.consume(f),o?l:(o=!0,u)):r(f)}function l(f){return f===null||Ci(f)||ke(f)||Dr(f)||wi(f)?r(f):t.attempt(Qg,t.attempt(ex,c),r)(f)}function c(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function R0(t,e,r){let n=0;return i;function i(s){return(s===87||s===119)&&n<3?(n++,t.consume(s),i):s===46&&n===3?(t.consume(s),o):r(s)}function o(s){return s===null?r(s):e(s)}}function F0(t,e,r){let n,i,o;return s;function s(l){return l===46||l===95?t.check(tx,u,a)(l):l===null||ke(l)||Dr(l)||l!==45&&wi(l)?u(l):(o=!0,t.consume(l),s)}function a(l){return l===95?n=!0:(i=n,n=void 0),t.consume(l),s}function u(l){return i||n||!o?r(l):e(l)}}function N0(t,e){let r=0,n=0;return i;function i(s){return s===40?(r++,t.consume(s),i):s===41&&n<r?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(tx,e,o)(s):s===null||ke(s)||Dr(s)?e(s):(t.consume(s),i)}function o(s){return s===41&&n++,t.consume(s),i}}function P0(t,e,r){return n;function n(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(t.consume(a),n):a===38?(t.consume(a),o):a===93?(t.consume(a),i):a===60||a===null||ke(a)||Dr(a)?e(a):r(a)}function i(a){return a===null||a===40||a===91||ke(a)||Dr(a)?e(a):n(a)}function o(a){return xt(a)?s(a):r(a)}function s(a){return a===59?(t.consume(a),n):xt(a)?(t.consume(a),s):r(a)}}function L0(t,e,r){return n;function n(o){return t.consume(o),i}function i(o){return yt(o)?r(o):e(o)}}function ix(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ke(t)}function ox(t){return!xt(t)}function sx(t){return!(t===47||ep(t))}function ep(t){return t===43||t===45||t===46||t===95||yt(t)}function rp(t){let e=t.length,r=!1;for(;e--;){let n=t[e][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}var M0={tokenize:V0,partial:!0};function np(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:z0,continuation:{tokenize:$0},exit:q0}},text:{91:{name:"gfmFootnoteCall",tokenize:U0},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:B0,resolveTo:j0}}}}function B0(t,e,r){let n=this,i=n.events.length,o=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),s;for(;i--;){let u=n.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return r(u);let l=It(n.sliceSerialize({start:s.end,end:n.now()}));return l.codePointAt(0)!==94||!o.includes(l.slice(1))?r(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function j0(t,e){let r=t.length,n;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){n=t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[t[r+1],t[r+2],["enter",i,e],t[r+3],t[r+4],["enter",o,e],["exit",o,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",i,e]];return t.splice(r,t.length-r+1,...u),t}function U0(t,e,r){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o=0,s;return a;function a(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?r(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(f){if(o>999||f===93&&!s||f===null||f===91||ke(f))return r(f);if(f===93){t.exit("chunkString");let p=t.exit("gfmFootnoteCallString");return i.includes(It(n.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(f)}return ke(f)||(s=!0),o++,t.consume(f),f===92?c:l}function c(f){return f===91||f===92||f===93?(t.consume(f),o++,l):l(f)}}function z0(t,e,r){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o,s=0,a;return u;function u(m){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",c):r(m)}function c(m){if(s>999||m===93&&!a||m===null||m===91||ke(m))return r(m);if(m===93){t.exit("chunkString");let y=t.exit("gfmFootnoteDefinitionLabelString");return o=It(n.sliceSerialize(y)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return ke(m)||(a=!0),s++,t.consume(m),m===92?f:c}function f(m){return m===91||m===92||m===93?(t.consume(m),s++,c):c(m)}function p(m){return m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),i.includes(o)||i.push(o),ie(t,d,"gfmFootnoteDefinitionWhitespace")):r(m)}function d(m){return e(m)}}function $0(t,e,r){return t.check(Rr,e,t.attempt(M0,e,r))}function q0(t){t.exit("gfmFootnoteDefinition")}function V0(t,e,r){let n=this;return ie(t,i,"gfmFootnoteDefinitionIndent",5);function i(o){let s=n.events[n.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(o):r(o)}}function ip(t){let r=(t||{}).singleTilde,n={name:"strikethrough",tokenize:o,resolveAll:i};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let l=u;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[u][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[u][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[u][1].start)},p=[["enter",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["enter",f,a]],d=a.parser.constructs.insideSpan.null;d&&st(p,p.length,0,wn(d,s.slice(l+1,u),a)),st(p,p.length,0,[["exit",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",c,a]]),st(s,l-1,u-l+3,p),u=l+p.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){let l=this.previous,c=this.events,f=0;return p;function p(m){return l===126&&c[c.length-1][1].type!=="characterEscape"?u(m):(s.enter("strikethroughSequenceTemporary"),d(m))}function d(m){let y=rn(l);if(m===126)return f>1?u(m):(s.consume(m),f++,d);if(f<2&&!r)return u(m);let g=s.exit("strikethroughSequenceTemporary"),b=rn(m);return g._open=!b||b===2&&!!y,g._close=!y||y===2&&!!b,a(m)}}}var fu=class{constructor(){this.map=[]}add(e,r,n){G0(this,e,r,n)}consume(e){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let r=this.map.length,n=[];for(;r>0;)r-=1,n.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(let o of i)e.push(o);i=n.pop()}this.map.length=0}};function G0(t,e,r,n){let i=0;if(!(r===0&&n.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=r,t.map[i][2].push(...n);return}i+=1}t.map.push([e,r,n])}}function ax(t,e){let r=!1,n=[];for(;e<t.length;){let i=t[e];if(r){if(i[0]==="enter")i[1].type==="tableContent"&&n.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){let o=n.length-1;n[o]=n[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(r=!0);e+=1}return n}function op(){return{flow:{null:{name:"table",tokenize:W0,resolveAll:H0}}}}function W0(t,e,r){let n=this,i=0,o=0,s;return a;function a(_){let L=n.events.length-1;for(;L>-1;){let P=n.events[L][1].type;if(P==="lineEnding"||P==="linePrefix")L--;else break}let F=L>-1?n.events[L][1].type:null,v=F==="tableHead"||F==="tableRow"?S:u;return v===S&&n.parser.lazy[n.now().line]?r(_):v(_)}function u(_){return t.enter("tableHead"),t.enter("tableRow"),l(_)}function l(_){return _===124||(s=!0,o+=1),c(_)}function c(_){return _===null?r(_):z(_)?o>1?(o=0,n.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),d):r(_):se(_)?ie(t,c,"whitespace")(_):(o+=1,s&&(s=!1,i+=1),_===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),s=!0,c):(t.enter("data"),f(_)))}function f(_){return _===null||_===124||ke(_)?(t.exit("data"),c(_)):(t.consume(_),_===92?p:f)}function p(_){return _===92||_===124?(t.consume(_),f):f(_)}function d(_){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(_):(t.enter("tableDelimiterRow"),s=!1,se(_)?ie(t,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):m(_))}function m(_){return _===45||_===58?g(_):_===124?(s=!0,t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),y):R(_)}function y(_){return se(_)?ie(t,g,"whitespace")(_):g(_)}function g(_){return _===58?(o+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),b):_===45?(o+=1,b(_)):_===null||z(_)?D(_):R(_)}function b(_){return _===45?(t.enter("tableDelimiterFiller"),w(_)):R(_)}function w(_){return _===45?(t.consume(_),w):_===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),C):(t.exit("tableDelimiterFiller"),C(_))}function C(_){return se(_)?ie(t,D,"whitespace")(_):D(_)}function D(_){return _===124?m(_):_===null||z(_)?!s||i!==o?R(_):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(_)):R(_)}function R(_){return r(_)}function S(_){return t.enter("tableRow"),de(_)}function de(_){return _===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),de):_===null||z(_)?(t.exit("tableRow"),e(_)):se(_)?ie(t,de,"whitespace")(_):(t.enter("data"),ye(_))}function ye(_){return _===null||_===124||ke(_)?(t.exit("data"),de(_)):(t.consume(_),_===92?be:ye)}function be(_){return _===92||_===124?(t.consume(_),ye):ye(_)}}function H0(t,e){let r=-1,n=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,l,c,f,p=new fu;for(;++r<t.length;){let d=t[r],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,u!==0&&(ux(p,e,u,l,c),c=void 0,u=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(r,0,[["enter",l,e]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(n=!0,f=void 0,o=[0,0,0,0],s=[0,r+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(r,0,[["enter",c,e]])),i=m.type==="tableDelimiterRow"?2:c?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(n=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],f=pu(p,e,o,i,void 0,f),o=[0,0,0,0]),s[2]=r)):m.type==="tableCellDivider"&&(n?n=!1:(o[1]!==0&&(s[0]=s[1],f=pu(p,e,o,i,void 0,f)),o=s,s=[o[1],r,0,0])):m.type==="tableHead"?(a=!0,u=r):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=r,o[1]!==0?(s[0]=s[1],f=pu(p,e,o,i,r,f)):s[1]!==0&&(f=pu(p,e,s,i,r,f)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=r)}for(u!==0&&ux(p,e,u,l,c),p.consume(e.events),r=-1;++r<e.events.length;){let d=e.events[r];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=ax(e.events,r))}return t}function pu(t,e,r,n,i,o){let s=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(o.end=Object.assign({},go(e.events,r[0])),t.add(r[0],0,[["exit",o,e]]));let u=go(e.events,r[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},t.add(r[1],0,[["enter",o,e]]),r[2]!==0){let l=go(e.events,r[2]),c=go(e.events,r[3]),f={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(t.add(r[2],0,[["enter",f,e]]),n!==2){let p=e.events[r[2]],d=e.events[r[3]];if(p[1].end=Object.assign({},d[1].end),p[1].type="chunkText",p[1].contentType="text",r[3]>r[2]+1){let m=r[2]+1,y=r[3]-r[2]-1;t.add(m,y,[])}}t.add(r[3]+1,0,[["exit",f,e]])}return i!==void 0&&(o.end=Object.assign({},go(e.events,i)),t.add(i,0,[["exit",o,e]]),o=void 0),o}function ux(t,e,r,n,i){let o=[],s=go(e.events,r);i&&(i.end=Object.assign({},s),o.push(["exit",i,e])),n.end=Object.assign({},s),o.push(["exit",n,e]),t.add(r+1,0,o)}function go(t,e){let r=t[e],n=r[0]==="enter"?"start":"end";return r[1][n]}var K0={name:"tasklistCheck",tokenize:Y0};function sp(){return{text:{91:K0}}}function Y0(t,e,r){let n=this;return i;function i(u){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),o)}function o(u){return ke(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),s):r(u)}function s(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):r(u)}function a(u){return z(u)?e(u):se(u)?t.check({tokenize:Z0},e,r)(u):r(u)}}function Z0(t,e,r){return ie(t,n,"whitespace");function n(i){return i===null?r(i):e(i)}}function lx(t){return za([tp(),np(),ip(t),op(),sp()])}var X0={};function Tn(t){let e=this,r=t||X0,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(lx(r)),o.push(Jf()),s.push(Qf(r))}import{mdatCheck as J0,mdatClean as cx,mdatExpand as Q0,mdatSplit as fx}from"remark-mdat";import{VFile as R5}from"vfile";async function _n(t,e,r,n,i,o,s){let a=await e({additionalConfig:o,additionalRules:s});o=a;let u=ja(t),l=Cm(u,i,n,"md"),c=[],f=r(a);for(let{input:p,name:d,output:m}of l){let y=await sc(p),g=await f.process(y);g.dirname=m,g.basename=d,c.push(g)}return c}function du(t){return mo().use({settings:{bullet:"-",emphasis:"_"}}).use(Tn).use(()=>async function(r,n){fx(r,n),cx(r,n,t),await Q0(r,n,t)})}function hu(t){return mo().use({settings:{bullet:"-",emphasis:"_"}}).use(Tn).use(()=>function(r,n){fx(r,n),cx(r,n,t)})}function mu(t){return mo().use({settings:{bullet:"-",emphasis:"_"}}).use(Tn).use(()=>async function(r,n){await J0(r,n,{...t,paranoid:!1})})}async function px(t,e,r,n,i){return _n(t,Ai,du,e,r,n,i)}async function dx(t,e,r,n,i){return _n(t,Ai,mu,e,r,n,i)}async function hx(t,e,r,n,i){return _n(t,Ai,hu,e,r,n,i)}var gu={badges:{async content(t){let e=X.object({custom:X.record(X.object({image:X.string(),link:X.string()})).optional(),npm:X.array(X.string()).optional()}).optional().parse(t),r=await rr(),{name:n}=r,i=[];if(!r.private&&r.publishConfig?.access==="public"&&i.push(`[](https://npmjs.com/package/${n})`),e?.npm!==void 0)for(let s of e.npm)i.push(`[](https://npmjs.com/package/${s})`);let{license:o}=r;if(o!==void 0&&i.push(`[](https://opensource.org/licenses/${o})`),e?.custom!==void 0)for(let[s,{image:a,link:u}]of Object.entries(e.custom))i.push(`[](${u})`);return i.join(`
|
|
108
|
-
`)},order:3}};import{globby as
|
|
107
|
+
`))}function u(d,m,y,g){let b=y.enter("tableCell"),w=y.enter("phrasing"),C=y.containerPhrasing(d,{...g,before:o,after:o});return w(),b(),C}function l(d,m){return Jg(d,{align:m,alignDelimiters:n,padding:r,stringLength:i})}function c(d,m,y){let g=d.children,b=-1,w=[],C=m.enter("table");for(;++b<g.length;)w[b]=f(g[b],m,y);return C(),w}function f(d,m,y){let g=d.children,b=-1,w=[],C=m.enter("tableRow");for(;++b<g.length;)w[b]=u(g[b],d,m,y);return C(),w}function p(d,m,y){let g=vi.inlineCode(d,m,y);return y.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function Xf(){return{exit:{taskListCheckValueChecked:ex,taskListCheckValueUnchecked:ex,paragraph:v0}}}function Jf(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:I0}}}function ex(t){let e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function v0(t){let e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){let r=this.stack[this.stack.length-1];r.type;let n=r.children[0];if(n&&n.type==="text"){let i=e.children,o=-1,s;for(;++o<i.length;){let a=i[o];if(a.type==="paragraph"){s=a;break}}s===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(t)}function I0(t,e,r,n){let i=t.children[0],o=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",a=r.createTracker(n);o&&a.move(s);let u=vi.listItem(t,e,r,{...n,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(c){return c+s}}function Qf(){return[$f(),Vf(),Wf(),Yf(),Xf()]}function ep(t){return{extensions:[qf(),Gf(),Hf(),Zf(t),Jf()]}}var O0={tokenize:P0,partial:!0},tx={tokenize:L0,partial:!0},rx={tokenize:M0,partial:!0},nx={tokenize:B0,partial:!0},D0={tokenize:j0,partial:!0},ix={name:"wwwAutolink",tokenize:F0,previous:sx},ox={name:"protocolAutolink",tokenize:N0,previous:ax},nn={name:"emailAutolink",tokenize:R0,previous:ux},Nr={};function rp(){return{text:Nr}}var Oi=48;for(;Oi<123;)Nr[Oi]=nn,Oi++,Oi===58?Oi=65:Oi===91&&(Oi=97);Nr[43]=nn;Nr[45]=nn;Nr[46]=nn;Nr[95]=nn;Nr[72]=[nn,ox];Nr[104]=[nn,ox];Nr[87]=[nn,ix];Nr[119]=[nn,ix];function R0(t,e,r){let n=this,i,o;return s;function s(f){return!tp(f)||!ux.call(n,n.previous)||np(n.events)?r(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(f))}function a(f){return tp(f)?(t.consume(f),a):f===64?(t.consume(f),u):r(f)}function u(f){return f===46?t.check(D0,c,l)(f):f===45||f===95||yt(f)?(o=!0,t.consume(f),u):c(f)}function l(f){return t.consume(f),i=!0,u}function c(f){return o&&i&&xt(n.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):r(f)}}function F0(t,e,r){let n=this;return i;function i(s){return s!==87&&s!==119||!sx.call(n,n.previous)||np(n.events)?r(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(O0,t.attempt(tx,t.attempt(rx,o),r),r)(s))}function o(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function N0(t,e,r){let n=this,i="",o=!1;return s;function s(f){return(f===72||f===104)&&ax.call(n,n.previous)&&!np(n.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),a):r(f)}function a(f){if(xt(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),a;if(f===58){let p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(f),u}return r(f)}function u(f){return f===47?(t.consume(f),o?l:(o=!0,u)):r(f)}function l(f){return f===null||Ci(f)||ke(f)||Dr(f)||wi(f)?r(f):t.attempt(tx,t.attempt(rx,c),r)(f)}function c(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function P0(t,e,r){let n=0;return i;function i(s){return(s===87||s===119)&&n<3?(n++,t.consume(s),i):s===46&&n===3?(t.consume(s),o):r(s)}function o(s){return s===null?r(s):e(s)}}function L0(t,e,r){let n,i,o;return s;function s(l){return l===46||l===95?t.check(nx,u,a)(l):l===null||ke(l)||Dr(l)||l!==45&&wi(l)?u(l):(o=!0,t.consume(l),s)}function a(l){return l===95?n=!0:(i=n,n=void 0),t.consume(l),s}function u(l){return i||n||!o?r(l):e(l)}}function M0(t,e){let r=0,n=0;return i;function i(s){return s===40?(r++,t.consume(s),i):s===41&&n<r?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(nx,e,o)(s):s===null||ke(s)||Dr(s)?e(s):(t.consume(s),i)}function o(s){return s===41&&n++,t.consume(s),i}}function B0(t,e,r){return n;function n(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(t.consume(a),n):a===38?(t.consume(a),o):a===93?(t.consume(a),i):a===60||a===null||ke(a)||Dr(a)?e(a):r(a)}function i(a){return a===null||a===40||a===91||ke(a)||Dr(a)?e(a):n(a)}function o(a){return xt(a)?s(a):r(a)}function s(a){return a===59?(t.consume(a),n):xt(a)?(t.consume(a),s):r(a)}}function j0(t,e,r){return n;function n(o){return t.consume(o),i}function i(o){return yt(o)?r(o):e(o)}}function sx(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ke(t)}function ax(t){return!xt(t)}function ux(t){return!(t===47||tp(t))}function tp(t){return t===43||t===45||t===46||t===95||yt(t)}function np(t){let e=t.length,r=!1;for(;e--;){let n=t[e][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}var U0={tokenize:H0,partial:!0};function ip(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:V0,continuation:{tokenize:G0},exit:W0}},text:{91:{name:"gfmFootnoteCall",tokenize:q0},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:z0,resolveTo:$0}}}}function z0(t,e,r){let n=this,i=n.events.length,o=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),s;for(;i--;){let u=n.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return r(u);let l=It(n.sliceSerialize({start:s.end,end:n.now()}));return l.codePointAt(0)!==94||!o.includes(l.slice(1))?r(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function $0(t,e){let r=t.length,n;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){n=t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[t[r+1],t[r+2],["enter",i,e],t[r+3],t[r+4],["enter",o,e],["exit",o,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",i,e]];return t.splice(r,t.length-r+1,...u),t}function q0(t,e,r){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o=0,s;return a;function a(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?r(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(f){if(o>999||f===93&&!s||f===null||f===91||ke(f))return r(f);if(f===93){t.exit("chunkString");let p=t.exit("gfmFootnoteCallString");return i.includes(It(n.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(f)}return ke(f)||(s=!0),o++,t.consume(f),f===92?c:l}function c(f){return f===91||f===92||f===93?(t.consume(f),o++,l):l(f)}}function V0(t,e,r){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o,s=0,a;return u;function u(m){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",c):r(m)}function c(m){if(s>999||m===93&&!a||m===null||m===91||ke(m))return r(m);if(m===93){t.exit("chunkString");let y=t.exit("gfmFootnoteDefinitionLabelString");return o=It(n.sliceSerialize(y)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return ke(m)||(a=!0),s++,t.consume(m),m===92?f:c}function f(m){return m===91||m===92||m===93?(t.consume(m),s++,c):c(m)}function p(m){return m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),i.includes(o)||i.push(o),ie(t,d,"gfmFootnoteDefinitionWhitespace")):r(m)}function d(m){return e(m)}}function G0(t,e,r){return t.check(Rr,e,t.attempt(U0,e,r))}function W0(t){t.exit("gfmFootnoteDefinition")}function H0(t,e,r){let n=this;return ie(t,i,"gfmFootnoteDefinitionIndent",5);function i(o){let s=n.events[n.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(o):r(o)}}function op(t){let r=(t||{}).singleTilde,n={name:"strikethrough",tokenize:o,resolveAll:i};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let l=u;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[u][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[u][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[u][1].start)},p=[["enter",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["enter",f,a]],d=a.parser.constructs.insideSpan.null;d&&st(p,p.length,0,wn(d,s.slice(l+1,u),a)),st(p,p.length,0,[["exit",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",c,a]]),st(s,l-1,u-l+3,p),u=l+p.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){let l=this.previous,c=this.events,f=0;return p;function p(m){return l===126&&c[c.length-1][1].type!=="characterEscape"?u(m):(s.enter("strikethroughSequenceTemporary"),d(m))}function d(m){let y=rn(l);if(m===126)return f>1?u(m):(s.consume(m),f++,d);if(f<2&&!r)return u(m);let g=s.exit("strikethroughSequenceTemporary"),b=rn(m);return g._open=!b||b===2&&!!y,g._close=!y||y===2&&!!b,a(m)}}}var fu=class{constructor(){this.map=[]}add(e,r,n){K0(this,e,r,n)}consume(e){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let r=this.map.length,n=[];for(;r>0;)r-=1,n.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(let o of i)e.push(o);i=n.pop()}this.map.length=0}};function K0(t,e,r,n){let i=0;if(!(r===0&&n.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=r,t.map[i][2].push(...n);return}i+=1}t.map.push([e,r,n])}}function lx(t,e){let r=!1,n=[];for(;e<t.length;){let i=t[e];if(r){if(i[0]==="enter")i[1].type==="tableContent"&&n.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){let o=n.length-1;n[o]=n[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(r=!0);e+=1}return n}function sp(){return{flow:{null:{name:"table",tokenize:Y0,resolveAll:Z0}}}}function Y0(t,e,r){let n=this,i=0,o=0,s;return a;function a(_){let L=n.events.length-1;for(;L>-1;){let P=n.events[L][1].type;if(P==="lineEnding"||P==="linePrefix")L--;else break}let F=L>-1?n.events[L][1].type:null,v=F==="tableHead"||F==="tableRow"?S:u;return v===S&&n.parser.lazy[n.now().line]?r(_):v(_)}function u(_){return t.enter("tableHead"),t.enter("tableRow"),l(_)}function l(_){return _===124||(s=!0,o+=1),c(_)}function c(_){return _===null?r(_):z(_)?o>1?(o=0,n.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),d):r(_):se(_)?ie(t,c,"whitespace")(_):(o+=1,s&&(s=!1,i+=1),_===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),s=!0,c):(t.enter("data"),f(_)))}function f(_){return _===null||_===124||ke(_)?(t.exit("data"),c(_)):(t.consume(_),_===92?p:f)}function p(_){return _===92||_===124?(t.consume(_),f):f(_)}function d(_){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(_):(t.enter("tableDelimiterRow"),s=!1,se(_)?ie(t,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):m(_))}function m(_){return _===45||_===58?g(_):_===124?(s=!0,t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),y):R(_)}function y(_){return se(_)?ie(t,g,"whitespace")(_):g(_)}function g(_){return _===58?(o+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),b):_===45?(o+=1,b(_)):_===null||z(_)?D(_):R(_)}function b(_){return _===45?(t.enter("tableDelimiterFiller"),w(_)):R(_)}function w(_){return _===45?(t.consume(_),w):_===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),C):(t.exit("tableDelimiterFiller"),C(_))}function C(_){return se(_)?ie(t,D,"whitespace")(_):D(_)}function D(_){return _===124?m(_):_===null||z(_)?!s||i!==o?R(_):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(_)):R(_)}function R(_){return r(_)}function S(_){return t.enter("tableRow"),de(_)}function de(_){return _===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),de):_===null||z(_)?(t.exit("tableRow"),e(_)):se(_)?ie(t,de,"whitespace")(_):(t.enter("data"),ye(_))}function ye(_){return _===null||_===124||ke(_)?(t.exit("data"),de(_)):(t.consume(_),_===92?be:ye)}function be(_){return _===92||_===124?(t.consume(_),ye):ye(_)}}function Z0(t,e){let r=-1,n=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,l,c,f,p=new fu;for(;++r<t.length;){let d=t[r],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,u!==0&&(cx(p,e,u,l,c),c=void 0,u=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(r,0,[["enter",l,e]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(n=!0,f=void 0,o=[0,0,0,0],s=[0,r+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(r,0,[["enter",c,e]])),i=m.type==="tableDelimiterRow"?2:c?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(n=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],f=pu(p,e,o,i,void 0,f),o=[0,0,0,0]),s[2]=r)):m.type==="tableCellDivider"&&(n?n=!1:(o[1]!==0&&(s[0]=s[1],f=pu(p,e,o,i,void 0,f)),o=s,s=[o[1],r,0,0])):m.type==="tableHead"?(a=!0,u=r):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=r,o[1]!==0?(s[0]=s[1],f=pu(p,e,o,i,r,f)):s[1]!==0&&(f=pu(p,e,s,i,r,f)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=r)}for(u!==0&&cx(p,e,u,l,c),p.consume(e.events),r=-1;++r<e.events.length;){let d=e.events[r];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=lx(e.events,r))}return t}function pu(t,e,r,n,i,o){let s=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(o.end=Object.assign({},go(e.events,r[0])),t.add(r[0],0,[["exit",o,e]]));let u=go(e.events,r[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},t.add(r[1],0,[["enter",o,e]]),r[2]!==0){let l=go(e.events,r[2]),c=go(e.events,r[3]),f={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(t.add(r[2],0,[["enter",f,e]]),n!==2){let p=e.events[r[2]],d=e.events[r[3]];if(p[1].end=Object.assign({},d[1].end),p[1].type="chunkText",p[1].contentType="text",r[3]>r[2]+1){let m=r[2]+1,y=r[3]-r[2]-1;t.add(m,y,[])}}t.add(r[3]+1,0,[["exit",f,e]])}return i!==void 0&&(o.end=Object.assign({},go(e.events,i)),t.add(i,0,[["exit",o,e]]),o=void 0),o}function cx(t,e,r,n,i){let o=[],s=go(e.events,r);i&&(i.end=Object.assign({},s),o.push(["exit",i,e])),n.end=Object.assign({},s),o.push(["exit",n,e]),t.add(r+1,0,o)}function go(t,e){let r=t[e],n=r[0]==="enter"?"start":"end";return r[1][n]}var X0={name:"tasklistCheck",tokenize:J0};function ap(){return{text:{91:X0}}}function J0(t,e,r){let n=this;return i;function i(u){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),o)}function o(u){return ke(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),s):r(u)}function s(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):r(u)}function a(u){return z(u)?e(u):se(u)?t.check({tokenize:Q0},e,r)(u):r(u)}}function Q0(t,e,r){return ie(t,n,"whitespace");function n(i){return i===null?r(i):e(i)}}function fx(t){return za([rp(),ip(),op(t),sp(),ap()])}var ev={};function Tn(t){let e=this,r=t||ev,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(fx(r)),o.push(Qf()),s.push(ep(r))}import{mdatCheck as tv,mdatClean as px,mdatExpand as rv,mdatSplit as dx}from"remark-mdat";import{VFile as M5}from"vfile";async function _n(t,e,r,n,i,o,s){let a=await e({additionalConfig:o,additionalRules:s});o=a;let u=await km(),l=ja(t),c=wm(l,i,n,"md"),f=[],p=r(a,u);for(let{input:d,name:m,output:y}of c){let g=await ac(d),b=await p.process(g);b.dirname=y,b.basename=m,f.push(b)}return f}function du(t,e){return mo().use({settings:{bullet:"-",emphasis:"_"}}).use(Tn).use(e).use(()=>async function(n,i){dx(n,i),px(n,i,t),await rv(n,i,t)})}function hu(t,e){return mo().use({settings:{bullet:"-",emphasis:"_"}}).use(Tn).use(e).use(()=>function(n,i){dx(n,i),px(n,i,t)})}function mu(t,e){return mo().use({settings:{bullet:"-",emphasis:"_"}}).use(Tn).use(e).use(()=>async function(n,i){await tv(n,i,{...t,paranoid:!1})})}async function hx(t,e,r,n,i){return _n(t,Ai,du,e,r,n,i)}async function mx(t,e,r,n,i){return _n(t,Ai,mu,e,r,n,i)}async function gx(t,e,r,n,i){return _n(t,Ai,hu,e,r,n,i)}var gu={badges:{async content(t){let e=X.object({custom:X.record(X.object({image:X.string(),link:X.string()})).optional(),npm:X.array(X.string()).optional()}).optional().parse(t),r=await rr(),{name:n}=r,i=[];if(!r.private&&r.publishConfig?.access==="public"&&i.push(`[](https://npmjs.com/package/${n})`),e?.npm!==void 0)for(let s of e.npm)i.push(`[](https://npmjs.com/package/${s})`);let{license:o}=r;if(o!==void 0&&i.push(`[](https://opensource.org/licenses/${o})`),e?.custom!==void 0)for(let[s,{image:a,link:u}]of Object.entries(e.custom))i.push(`[](${u})`);return i.join(`
|
|
108
|
+
`)},order:3}};import{globby as iv}from"globby";import xu from"node:path";import{readPackage as ov}from"read-pkg";var yu={banner:{async content(t){let e=X.object({alt:X.string().optional(),src:X.string().optional()}).optional().parse(t),{assetsPath:r,packageFile:n}=await Or();if(n===void 0)throw new Error("No package.json found");let i=e?.src??await xx(r)??await xx();if(i===void 0)throw new Error("Banner image not found at any typical location, consider adding something at ./assets/banner.webp");if(!yx(i)&&!await uo(i))throw new Error(`Banner image not found at "${i}"`);let o=e?.alt??`${(await ov({cwd:xu.dirname(n)})).name} banner`;if(o===void 0||o==="undefined banner")throw new Error("Banner image alt text not available");return``},order:2}};async function xx(t){let{packageFile:e}=await Or();if(e===void 0)throw new Error("No package.json found");let r=xu.dirname(e),n=t===void 0?[".","assets","media","readme-assets","readme-media","readme","images",".github/assets"]:[t],i=["banner","cover","demo","header","hero","image","logo","overview","readme","screenshot","screenshots","splash"],o=["png","gif","jpg","jpeg","svg","webp"],s=await iv(n.map(a=>xu.join(r,a)),{deep:1,expandDirectories:{extensions:o,files:i}});if(s.length>0)return xu.relative(process.cwd(),s[0])}function yx(t,e=!0){if(typeof t!="string")throw new TypeError("Expected a string");if(t=t.trim(),t.includes(" "))return!1;try{return new URL(t),!0}catch{return e?yx(`https://${t}`,!1):!1}}import{getSoleRule as mL}from"remark-mdat";import{execaCommand as eL}from"execa";import{log as MA}from"remark-mdat";function bx(t,e=Number.MAX_SAFE_INTEGER){let r=[],n=sv(t,e);return r.push(av(n)),r.push(uv(t,n)),n.hasMultipleSubcommands&&n.canRecurse&&r.push(lv(n.fullCommandName)),n.defaultCommand?.commandName!==void 0&&r.push(cv(n)),r.push(fv(t,n)),t.positionals&&!n.commandsOnly&&r.push(up(["Positional Argument","Description","Type","Default"],t.positionals.map(i=>[i.arguments?[i.arguments.map(o=>`\`${o}\``)].join(" "):"",`${i.description??""}${i.required===void 0?"":i.required?" _(Required.)_":" _(Optional.)_"}`,i.type?`\`${i.type}\``:"",i.defaultValue?i.defaultValue.includes(" ")?i.defaultValue:`\`${i.defaultValue}\``:""]))),t.commands&&r.push(up(["Command","Argument","Description"],t.commands.map(i=>[`\`${i.commandName??(i.default?"[default]":"")}\``,i.arguments?i.arguments?.map(o=>`\`${o}\``).join(" "):"",`${i.description??""}${i.default?" _(Default command.)_":""}`]))),t.options&&!n.commandsOnly&&r.push(up(["Option","Argument","Description","Type","Default"],t.options.map(i=>[i.flags!==void 0||i.aliases!==void 0?[...i.flags??[],...i.aliases??[]].map(o=>`\`${o}\``).join("<br>"):"",i.arguments?i.arguments.map(o=>`\`${o}\``).join(" "):"",i.description??"",i.choices?i.choices.map(o=>`\`${o}\``).join(" "):i.type?`\`${i.type}\``:"",i.defaultValue?i.defaultValue.includes(" ")&&i.choices===void 0?i.defaultValue:`\`${i.defaultValue}\``:""]))),n.canRecurse&&n.hasMultipleSubcommands&&r.push("_See the sections below for more information on each subcommand._"),r.join(`
|
|
109
109
|
|
|
110
|
-
`)}function
|
|
110
|
+
`)}function sv(t,e){let r=t.subcommandName===void 0,n=t.commands?t.commands.length>1:!1,i=e>1,o=t.commands?.find(l=>l.default),s=t.commands?.find(l=>l.commandName===void 0),a=`${t.commandName}${t.subcommandName?` ${t.subcommandName}`:""}`,u=i&&n&&o?.commandName!==void 0;return{canRecurse:i,commandsOnly:u,defaultCommand:o,fullCommandName:a,hasMultipleSubcommands:n,isTopLevel:r,topLevelCommand:s}}function av(t){return`#### ${t.isTopLevel?"Command":"Subcommand"}: \`${t.fullCommandName}\``}function uv(t,e){return e.isTopLevel&&e.topLevelCommand?.description?(t.commands=t.commands?.filter(r=>r!==e.topLevelCommand),e.topLevelCommand.description):t.description??""}function lv(t){return`This section lists top-level commands for \`${t}\`.`}function cv(t){return`If no command is provided, \`${t.defaultCommand?.parentCommandName} ${t.defaultCommand?.commandName}\` is run by default.`}function fv(t,e){let r=e.topLevelCommand?.arguments?` ${e.topLevelCommand.arguments.join(" ")}`:`${t.arguments?` ${t.arguments.join(" ")}`:""}`;return`Usage:
|
|
111
111
|
|
|
112
112
|
\`\`\`txt
|
|
113
113
|
${e.fullCommandName}${r}
|
|
114
|
-
\`\`\``}function
|
|
114
|
+
\`\`\``}function up(t,e){let r=pv(e);t=t.filter((i,o)=>!r.includes(o)),e=e.map(i=>i.filter((o,s)=>!r.includes(s)));let n="";n+=`| ${t.join(" | ")} |
|
|
115
115
|
`,n+=`| ${t.map(()=>"---").join(" | ")} |
|
|
116
116
|
`;for(let i of e)n+=`| ${i.join(" | ")} |
|
|
117
|
-
`;return n}function lv(t){let e=[],r=t[0]?.length||0;for(let n=0;n<r;n++){let i=!0;for(let o of t)if(o[n]!==""){i=!1;break}i&&e.push(n)}return e}import{log as yd}from"remark-mdat";var cv=typeof global=="object"&&global&&global.Object===Object&&global,bu=cv;var fv=typeof self=="object"&&self&&self.Object===Object&&self,pv=bu||fv||Function("return this")(),pt=pv;var dv=pt.Symbol,wt=dv;var yx=Object.prototype,hv=yx.hasOwnProperty,mv=yx.toString,vs=wt?wt.toStringTag:void 0;function gv(t){var e=hv.call(t,vs),r=t[vs];try{t[vs]=void 0;var n=!0}catch{}var i=mv.call(t);return n&&(e?t[vs]=r:delete t[vs]),i}var bx=gv;var xv=Object.prototype,yv=xv.toString;function bv(t){return yv.call(t)}var Ex=bv;var Ev="[object Null]",Av="[object Undefined]",Ax=wt?wt.toStringTag:void 0;function Cv(t){return t==null?t===void 0?Av:Ev:Ax&&Ax in Object(t)?bx(t):Ex(t)}var Mt=Cv;function wv(t){return t!=null&&typeof t=="object"}var at=wv;var kv="[object Symbol]";function Tv(t){return typeof t=="symbol"||at(t)&&Mt(t)==kv}var Sn=Tv;function _v(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Pr=_v;var Sv=Array.isArray,J=Sv;var vv=1/0,Cx=wt?wt.prototype:void 0,wx=Cx?Cx.toString:void 0;function kx(t){if(typeof t=="string")return t;if(J(t))return Pr(t,kx)+"";if(Sn(t))return wx?wx.call(t):"";var e=t+"";return e=="0"&&1/t==-vv?"-0":e}var Tx=kx;var Iv=/\s/;function Ov(t){for(var e=t.length;e--&&Iv.test(t.charAt(e)););return e}var _x=Ov;var Dv=/^\s+/;function Rv(t){return t&&t.slice(0,_x(t)+1).replace(Dv,"")}var Sx=Rv;function Fv(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ze=Fv;var vx=NaN,Nv=/^[-+]0x[0-9a-f]+$/i,Pv=/^0b[01]+$/i,Lv=/^0o[0-7]+$/i,Mv=parseInt;function Bv(t){if(typeof t=="number")return t;if(Sn(t))return vx;if(Ze(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ze(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Sx(t);var r=Pv.test(t);return r||Lv.test(t)?Mv(t.slice(2),r?2:8):Nv.test(t)?vx:+t}var Ix=Bv;var Ox=1/0,jv=17976931348623157e292;function Uv(t){if(!t)return t===0?t:0;if(t=Ix(t),t===Ox||t===-Ox){var e=t<0?-1:1;return e*jv}return t===t?t:0}var Dx=Uv;function zv(t){var e=Dx(t),r=e%1;return e===e?r?e-r:e:0}var Lr=zv;function $v(t){return t}var hr=$v;var qv="[object AsyncFunction]",Vv="[object Function]",Gv="[object GeneratorFunction]",Wv="[object Proxy]";function Hv(t){if(!Ze(t))return!1;var e=Mt(t);return e==Vv||e==Gv||e==qv||e==Wv}var Bt=Hv;var Kv=pt["__core-js_shared__"],Eu=Kv;var Rx=function(){var t=/[^.]+$/.exec(Eu&&Eu.keys&&Eu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Yv(t){return!!Rx&&Rx in t}var Fx=Yv;var Zv=Function.prototype,Xv=Zv.toString;function Jv(t){if(t!=null){try{return Xv.call(t)}catch{}try{return t+""}catch{}}return""}var on=Jv;var Qv=/[\\^$.*+?()[\]{}|]/g,eI=/^\[object .+?Constructor\]$/,tI=Function.prototype,rI=Object.prototype,nI=tI.toString,iI=rI.hasOwnProperty,oI=RegExp("^"+nI.call(iI).replace(Qv,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function sI(t){if(!Ze(t)||Fx(t))return!1;var e=Bt(t)?oI:eI;return e.test(on(t))}var Nx=sI;function aI(t,e){return t?.[e]}var Px=aI;function uI(t,e){var r=Px(t,e);return Nx(r)?r:void 0}var Gt=uI;var lI=Gt(pt,"WeakMap"),Au=lI;var Lx=Object.create,cI=function(){function t(){}return function(e){if(!Ze(e))return{};if(Lx)return Lx(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),Mx=cI;function fI(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Bx=fI;function pI(){}var Xe=pI;function dI(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var jx=dI;var hI=800,mI=16,gI=Date.now;function xI(t){var e=0,r=0;return function(){var n=gI(),i=mI-(n-r);if(r=n,i>0){if(++e>=hI)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Ux=xI;function yI(t){return function(){return t}}var zx=yI;var bI=function(){try{var t=Gt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),xo=bI;var EI=xo?function(t,e){return xo(t,"toString",{configurable:!0,enumerable:!1,value:zx(e),writable:!0})}:hr,$x=EI;var AI=Ux($x),qx=AI;function CI(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var Cu=CI;function wI(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}var wu=wI;function kI(t){return t!==t}var Vx=kI;function TI(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var Gx=TI;function _I(t,e,r){return e===e?Gx(t,e,r):wu(t,Vx,r)}var yo=_I;function SI(t,e){var r=t==null?0:t.length;return!!r&&yo(t,e,0)>-1}var ku=SI;var vI=9007199254740991,II=/^(?:0|[1-9]\d*)$/;function OI(t,e){var r=typeof t;return e=e??vI,!!e&&(r=="number"||r!="symbol"&&II.test(t))&&t>-1&&t%1==0&&t<e}var vn=OI;function DI(t,e,r){e=="__proto__"&&xo?xo(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var bo=DI;function RI(t,e){return t===e||t!==t&&e!==e}var Mr=RI;var FI=Object.prototype,NI=FI.hasOwnProperty;function PI(t,e,r){var n=t[e];(!(NI.call(t,e)&&Mr(n,r))||r===void 0&&!(e in t))&&bo(t,e,r)}var In=PI;function LI(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],u=n?n(r[a],t[a],a,r,t):void 0;u===void 0&&(u=t[a]),i?bo(r,a,u):In(r,a,u)}return r}var Br=LI;var Wx=Math.max;function MI(t,e,r){return e=Wx(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=Wx(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),Bx(t,this,a)}}var Hx=MI;function BI(t,e){return qx(Hx(t,e,hr),t+"")}var Eo=BI;var jI=9007199254740991;function UI(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=jI}var Ao=UI;function zI(t){return t!=null&&Ao(t.length)&&!Bt(t)}var dt=zI;function $I(t,e,r){if(!Ze(r))return!1;var n=typeof e;return(n=="number"?dt(r)&&vn(e,r.length):n=="string"&&e in r)?Mr(r[e],t):!1}var On=$I;function qI(t){return Eo(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&On(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,o)}return e})}var Kx=qI;var VI=Object.prototype;function GI(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||VI;return t===r}var jr=GI;function WI(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Yx=WI;var HI="[object Arguments]";function KI(t){return at(t)&&Mt(t)==HI}var up=KI;var Zx=Object.prototype,YI=Zx.hasOwnProperty,ZI=Zx.propertyIsEnumerable,XI=up(function(){return arguments}())?up:function(t){return at(t)&&YI.call(t,"callee")&&!ZI.call(t,"callee")},Dn=XI;function JI(){return!1}var Xx=JI;var ey=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Jx=ey&&typeof module=="object"&&module&&!module.nodeType&&module,QI=Jx&&Jx.exports===ey,Qx=QI?pt.Buffer:void 0,eO=Qx?Qx.isBuffer:void 0,tO=eO||Xx,sn=tO;var rO="[object Arguments]",nO="[object Array]",iO="[object Boolean]",oO="[object Date]",sO="[object Error]",aO="[object Function]",uO="[object Map]",lO="[object Number]",cO="[object Object]",fO="[object RegExp]",pO="[object Set]",dO="[object String]",hO="[object WeakMap]",mO="[object ArrayBuffer]",gO="[object DataView]",xO="[object Float32Array]",yO="[object Float64Array]",bO="[object Int8Array]",EO="[object Int16Array]",AO="[object Int32Array]",CO="[object Uint8Array]",wO="[object Uint8ClampedArray]",kO="[object Uint16Array]",TO="[object Uint32Array]",Ve={};Ve[xO]=Ve[yO]=Ve[bO]=Ve[EO]=Ve[AO]=Ve[CO]=Ve[wO]=Ve[kO]=Ve[TO]=!0;Ve[rO]=Ve[nO]=Ve[mO]=Ve[iO]=Ve[gO]=Ve[oO]=Ve[sO]=Ve[aO]=Ve[uO]=Ve[lO]=Ve[cO]=Ve[fO]=Ve[pO]=Ve[dO]=Ve[hO]=!1;function _O(t){return at(t)&&Ao(t.length)&&!!Ve[Mt(t)]}var ty=_O;function SO(t){return function(e){return t(e)}}var Ur=SO;var ry=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Is=ry&&typeof module=="object"&&module&&!module.nodeType&&module,vO=Is&&Is.exports===ry,lp=vO&&bu.process,IO=function(){try{var t=Is&&Is.require&&Is.require("util").types;return t||lp&&lp.binding&&lp.binding("util")}catch{}}(),mr=IO;var ny=mr&&mr.isTypedArray,OO=ny?Ur(ny):ty,Co=OO;var DO=Object.prototype,RO=DO.hasOwnProperty;function FO(t,e){var r=J(t),n=!r&&Dn(t),i=!r&&!n&&sn(t),o=!r&&!n&&!i&&Co(t),s=r||n||i||o,a=s?Yx(t.length,String):[],u=a.length;for(var l in t)(e||RO.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||vn(l,u)))&&a.push(l);return a}var Tu=FO;function NO(t,e){return function(r){return t(e(r))}}var _u=NO;var PO=_u(Object.keys,Object),iy=PO;var LO=Object.prototype,MO=LO.hasOwnProperty;function BO(t){if(!jr(t))return iy(t);var e=[];for(var r in Object(t))MO.call(t,r)&&r!="constructor"&&e.push(r);return e}var Su=BO;function jO(t){return dt(t)?Tu(t):Su(t)}var Pe=jO;var UO=Object.prototype,zO=UO.hasOwnProperty,$O=Kx(function(t,e){if(jr(e)||dt(e)){Br(e,Pe(e),t);return}for(var r in e)zO.call(e,r)&&In(t,r,e[r])}),_t=$O;function qO(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var oy=qO;var VO=Object.prototype,GO=VO.hasOwnProperty;function WO(t){if(!Ze(t))return oy(t);var e=jr(t),r=[];for(var n in t)n=="constructor"&&(e||!GO.call(t,n))||r.push(n);return r}var sy=WO;function HO(t){return dt(t)?Tu(t,!0):sy(t)}var Rn=HO;var KO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,YO=/^\w*$/;function ZO(t,e){if(J(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Sn(t)?!0:YO.test(t)||!KO.test(t)||e!=null&&t in Object(e)}var wo=ZO;var XO=Gt(Object,"create"),an=XO;function JO(){this.__data__=an?an(null):{},this.size=0}var ay=JO;function QO(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var uy=QO;var eD="__lodash_hash_undefined__",tD=Object.prototype,rD=tD.hasOwnProperty;function nD(t){var e=this.__data__;if(an){var r=e[t];return r===eD?void 0:r}return rD.call(e,t)?e[t]:void 0}var ly=nD;var iD=Object.prototype,oD=iD.hasOwnProperty;function sD(t){var e=this.__data__;return an?e[t]!==void 0:oD.call(e,t)}var cy=sD;var aD="__lodash_hash_undefined__";function uD(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=an&&e===void 0?aD:e,this}var fy=uD;function ko(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ko.prototype.clear=ay;ko.prototype.delete=uy;ko.prototype.get=ly;ko.prototype.has=cy;ko.prototype.set=fy;var cp=ko;function lD(){this.__data__=[],this.size=0}var py=lD;function cD(t,e){for(var r=t.length;r--;)if(Mr(t[r][0],e))return r;return-1}var Fn=cD;var fD=Array.prototype,pD=fD.splice;function dD(t){var e=this.__data__,r=Fn(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():pD.call(e,r,1),--this.size,!0}var dy=dD;function hD(t){var e=this.__data__,r=Fn(e,t);return r<0?void 0:e[r][1]}var hy=hD;function mD(t){return Fn(this.__data__,t)>-1}var my=mD;function gD(t,e){var r=this.__data__,n=Fn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var gy=gD;function To(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}To.prototype.clear=py;To.prototype.delete=dy;To.prototype.get=hy;To.prototype.has=my;To.prototype.set=gy;var Nn=To;var xD=Gt(pt,"Map"),Pn=xD;function yD(){this.size=0,this.__data__={hash:new cp,map:new(Pn||Nn),string:new cp}}var xy=yD;function bD(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var yy=bD;function ED(t,e){var r=t.__data__;return yy(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Ln=ED;function AD(t){var e=Ln(this,t).delete(t);return this.size-=e?1:0,e}var by=AD;function CD(t){return Ln(this,t).get(t)}var Ey=CD;function wD(t){return Ln(this,t).has(t)}var Ay=wD;function kD(t,e){var r=Ln(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var Cy=kD;function _o(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}_o.prototype.clear=xy;_o.prototype.delete=by;_o.prototype.get=Ey;_o.prototype.has=Ay;_o.prototype.set=Cy;var Di=_o;var TD="Expected a function";function fp(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(TD);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(fp.Cache||Di),r}fp.Cache=Di;var wy=fp;var _D=500;function SD(t){var e=wy(t,function(n){return r.size===_D&&r.clear(),n}),r=e.cache;return e}var ky=SD;var vD=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ID=/\\(\\)?/g,OD=ky(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(vD,function(r,n,i,o){e.push(i?o.replace(ID,"$1"):n||r)}),e}),Ty=OD;function DD(t){return t==null?"":Tx(t)}var _y=DD;function RD(t,e){return J(t)?t:wo(t,e)?[t]:Ty(_y(t))}var Mn=RD;var FD=1/0;function ND(t){if(typeof t=="string"||Sn(t))return t;var e=t+"";return e=="0"&&1/t==-FD?"-0":e}var zr=ND;function PD(t,e){e=Mn(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[zr(e[r++])];return r&&r==n?t:void 0}var So=PD;function LD(t,e,r){var n=t==null?void 0:So(t,e);return n===void 0?r:n}var Sy=LD;function MD(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var vo=MD;var vy=wt?wt.isConcatSpreadable:void 0;function BD(t){return J(t)||Dn(t)||!!(vy&&t&&t[vy])}var Iy=BD;function Oy(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=Iy),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?Oy(a,e-1,r,n,i):vo(i,a):n||(i[i.length]=a)}return i}var Io=Oy;function jD(t){var e=t==null?0:t.length;return e?Io(t,1):[]}var bt=jD;var UD=_u(Object.getPrototypeOf,Object),vu=UD;function zD(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}var Iu=zD;function $D(t,e,r,n){var i=-1,o=t==null?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}var Dy=$D;function qD(){this.__data__=new Nn,this.size=0}var Ry=qD;function VD(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var Fy=VD;function GD(t){return this.__data__.get(t)}var Ny=GD;function WD(t){return this.__data__.has(t)}var Py=WD;var HD=200;function KD(t,e){var r=this.__data__;if(r instanceof Nn){var n=r.__data__;if(!Pn||n.length<HD-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Di(n)}return r.set(t,e),this.size=r.size,this}var Ly=KD;function Oo(t){var e=this.__data__=new Nn(t);this.size=e.size}Oo.prototype.clear=Ry;Oo.prototype.delete=Fy;Oo.prototype.get=Ny;Oo.prototype.has=Py;Oo.prototype.set=Ly;var Bn=Oo;function YD(t,e){return t&&Br(e,Pe(e),t)}var My=YD;function ZD(t,e){return t&&Br(e,Rn(e),t)}var By=ZD;var $y=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jy=$y&&typeof module=="object"&&module&&!module.nodeType&&module,XD=jy&&jy.exports===$y,Uy=XD?pt.Buffer:void 0,zy=Uy?Uy.allocUnsafe:void 0;function JD(t,e){if(e)return t.slice();var r=t.length,n=zy?zy(r):new t.constructor(r);return t.copy(n),n}var qy=JD;function QD(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}var Do=QD;function eR(){return[]}var Ou=eR;var tR=Object.prototype,rR=tR.propertyIsEnumerable,Vy=Object.getOwnPropertySymbols,nR=Vy?function(t){return t==null?[]:(t=Object(t),Do(Vy(t),function(e){return rR.call(t,e)}))}:Ou,Ro=nR;function iR(t,e){return Br(t,Ro(t),e)}var Gy=iR;var oR=Object.getOwnPropertySymbols,sR=oR?function(t){for(var e=[];t;)vo(e,Ro(t)),t=vu(t);return e}:Ou,Du=sR;function aR(t,e){return Br(t,Du(t),e)}var Wy=aR;function uR(t,e,r){var n=e(t);return J(t)?n:vo(n,r(t))}var Ru=uR;function lR(t){return Ru(t,Pe,Ro)}var Os=lR;function cR(t){return Ru(t,Rn,Du)}var Fu=cR;var fR=Gt(pt,"DataView"),Nu=fR;var pR=Gt(pt,"Promise"),Pu=pR;var dR=Gt(pt,"Set"),jn=dR;var Hy="[object Map]",hR="[object Object]",Ky="[object Promise]",Yy="[object Set]",Zy="[object WeakMap]",Xy="[object DataView]",mR=on(Nu),gR=on(Pn),xR=on(Pu),yR=on(jn),bR=on(Au),Ri=Mt;(Nu&&Ri(new Nu(new ArrayBuffer(1)))!=Xy||Pn&&Ri(new Pn)!=Hy||Pu&&Ri(Pu.resolve())!=Ky||jn&&Ri(new jn)!=Yy||Au&&Ri(new Au)!=Zy)&&(Ri=function(t){var e=Mt(t),r=e==hR?t.constructor:void 0,n=r?on(r):"";if(n)switch(n){case mR:return Xy;case gR:return Hy;case xR:return Ky;case yR:return Yy;case bR:return Zy}return e});var Ar=Ri;var ER=Object.prototype,AR=ER.hasOwnProperty;function CR(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&AR.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Jy=CR;var wR=pt.Uint8Array,Fo=wR;function kR(t){var e=new t.constructor(t.byteLength);return new Fo(e).set(new Fo(t)),e}var No=kR;function TR(t,e){var r=e?No(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Qy=TR;var _R=/\w*$/;function SR(t){var e=new t.constructor(t.source,_R.exec(t));return e.lastIndex=t.lastIndex,e}var eb=SR;var tb=wt?wt.prototype:void 0,rb=tb?tb.valueOf:void 0;function vR(t){return rb?Object(rb.call(t)):{}}var nb=vR;function IR(t,e){var r=e?No(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var ib=IR;var OR="[object Boolean]",DR="[object Date]",RR="[object Map]",FR="[object Number]",NR="[object RegExp]",PR="[object Set]",LR="[object String]",MR="[object Symbol]",BR="[object ArrayBuffer]",jR="[object DataView]",UR="[object Float32Array]",zR="[object Float64Array]",$R="[object Int8Array]",qR="[object Int16Array]",VR="[object Int32Array]",GR="[object Uint8Array]",WR="[object Uint8ClampedArray]",HR="[object Uint16Array]",KR="[object Uint32Array]";function YR(t,e,r){var n=t.constructor;switch(e){case BR:return No(t);case OR:case DR:return new n(+t);case jR:return Qy(t,r);case UR:case zR:case $R:case qR:case VR:case GR:case WR:case HR:case KR:return ib(t,r);case RR:return new n;case FR:case LR:return new n(t);case NR:return eb(t);case PR:return new n;case MR:return nb(t)}}var ob=YR;function ZR(t){return typeof t.constructor=="function"&&!jr(t)?Mx(vu(t)):{}}var sb=ZR;var XR="[object Map]";function JR(t){return at(t)&&Ar(t)==XR}var ab=JR;var ub=mr&&mr.isMap,QR=ub?Ur(ub):ab,lb=QR;var e1="[object Set]";function t1(t){return at(t)&&Ar(t)==e1}var cb=t1;var fb=mr&&mr.isSet,r1=fb?Ur(fb):cb,pb=r1;var n1=1,i1=2,o1=4,db="[object Arguments]",s1="[object Array]",a1="[object Boolean]",u1="[object Date]",l1="[object Error]",hb="[object Function]",c1="[object GeneratorFunction]",f1="[object Map]",p1="[object Number]",mb="[object Object]",d1="[object RegExp]",h1="[object Set]",m1="[object String]",g1="[object Symbol]",x1="[object WeakMap]",y1="[object ArrayBuffer]",b1="[object DataView]",E1="[object Float32Array]",A1="[object Float64Array]",C1="[object Int8Array]",w1="[object Int16Array]",k1="[object Int32Array]",T1="[object Uint8Array]",_1="[object Uint8ClampedArray]",S1="[object Uint16Array]",v1="[object Uint32Array]",Le={};Le[db]=Le[s1]=Le[y1]=Le[b1]=Le[a1]=Le[u1]=Le[E1]=Le[A1]=Le[C1]=Le[w1]=Le[k1]=Le[f1]=Le[p1]=Le[mb]=Le[d1]=Le[h1]=Le[m1]=Le[g1]=Le[T1]=Le[_1]=Le[S1]=Le[v1]=!0;Le[l1]=Le[hb]=Le[x1]=!1;function Lu(t,e,r,n,i,o){var s,a=e&n1,u=e&i1,l=e&o1;if(r&&(s=i?r(t,n,i,o):r(t)),s!==void 0)return s;if(!Ze(t))return t;var c=J(t);if(c){if(s=Jy(t),!a)return jx(t,s)}else{var f=Ar(t),p=f==hb||f==c1;if(sn(t))return qy(t,a);if(f==mb||f==db||p&&!i){if(s=u||p?{}:sb(t),!a)return u?Wy(t,By(s,t)):Gy(t,My(s,t))}else{if(!Le[f])return i?t:{};s=ob(t,f,a)}}o||(o=new Bn);var d=o.get(t);if(d)return d;o.set(t,s),pb(t)?t.forEach(function(g){s.add(Lu(g,e,r,g,t,o))}):lb(t)&&t.forEach(function(g,b){s.set(b,Lu(g,e,r,b,t,o))});var m=l?u?Fu:Os:u?Rn:Pe,y=c?void 0:m(t);return Cu(y||t,function(g,b){y&&(b=g,g=t[b]),In(s,b,Lu(g,e,r,b,t,o))}),s}var gb=Lu;var I1=4;function O1(t){return gb(t,I1)}var Me=O1;function D1(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var o=t[e];o&&(i[n++]=o)}return i}var $r=D1;var R1="__lodash_hash_undefined__";function F1(t){return this.__data__.set(t,R1),this}var xb=F1;function N1(t){return this.__data__.has(t)}var yb=N1;function Mu(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Di;++e<r;)this.add(t[e])}Mu.prototype.add=Mu.prototype.push=xb;Mu.prototype.has=yb;var Po=Mu;function P1(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var Bu=P1;function L1(t,e){return t.has(e)}var Lo=L1;var M1=1,B1=2;function j1(t,e,r,n,i,o){var s=r&M1,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t),c=o.get(e);if(l&&c)return l==e&&c==t;var f=-1,p=!0,d=r&B1?new Po:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],y=e[f];if(n)var g=s?n(y,m,f,e,t,o):n(m,y,f,t,e,o);if(g!==void 0){if(g)continue;p=!1;break}if(d){if(!Bu(e,function(b,w){if(!Lo(d,w)&&(m===b||i(m,b,r,n,o)))return d.push(w)})){p=!1;break}}else if(!(m===y||i(m,y,r,n,o))){p=!1;break}}return o.delete(t),o.delete(e),p}var ju=j1;function U1(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var bb=U1;function z1(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Mo=z1;var $1=1,q1=2,V1="[object Boolean]",G1="[object Date]",W1="[object Error]",H1="[object Map]",K1="[object Number]",Y1="[object RegExp]",Z1="[object Set]",X1="[object String]",J1="[object Symbol]",Q1="[object ArrayBuffer]",eF="[object DataView]",Eb=wt?wt.prototype:void 0,pp=Eb?Eb.valueOf:void 0;function tF(t,e,r,n,i,o,s){switch(r){case eF:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Q1:return!(t.byteLength!=e.byteLength||!o(new Fo(t),new Fo(e)));case V1:case G1:case K1:return Mr(+t,+e);case W1:return t.name==e.name&&t.message==e.message;case Y1:case X1:return t==e+"";case H1:var a=bb;case Z1:var u=n&$1;if(a||(a=Mo),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;n|=q1,s.set(t,e);var c=ju(a(t),a(e),n,i,o,s);return s.delete(t),c;case J1:if(pp)return pp.call(t)==pp.call(e)}return!1}var Ab=tF;var rF=1,nF=Object.prototype,iF=nF.hasOwnProperty;function oF(t,e,r,n,i,o){var s=r&rF,a=Os(t),u=a.length,l=Os(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var p=a[f];if(!(s?p in e:iF.call(e,p)))return!1}var d=o.get(t),m=o.get(e);if(d&&m)return d==e&&m==t;var y=!0;o.set(t,e),o.set(e,t);for(var g=s;++f<u;){p=a[f];var b=t[p],w=e[p];if(n)var C=s?n(w,b,p,e,t,o):n(b,w,p,t,e,o);if(!(C===void 0?b===w||i(b,w,r,n,o):C)){y=!1;break}g||(g=p=="constructor")}if(y&&!g){var D=t.constructor,R=e.constructor;D!=R&&"constructor"in t&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof R=="function"&&R instanceof R)&&(y=!1)}return o.delete(t),o.delete(e),y}var Cb=oF;var sF=1,wb="[object Arguments]",kb="[object Array]",Uu="[object Object]",aF=Object.prototype,Tb=aF.hasOwnProperty;function uF(t,e,r,n,i,o){var s=J(t),a=J(e),u=s?kb:Ar(t),l=a?kb:Ar(e);u=u==wb?Uu:u,l=l==wb?Uu:l;var c=u==Uu,f=l==Uu,p=u==l;if(p&&sn(t)){if(!sn(e))return!1;s=!0,c=!1}if(p&&!c)return o||(o=new Bn),s||Co(t)?ju(t,e,r,n,i,o):Ab(t,e,u,r,n,i,o);if(!(r&sF)){var d=c&&Tb.call(t,"__wrapped__"),m=f&&Tb.call(e,"__wrapped__");if(d||m){var y=d?t.value():t,g=m?e.value():e;return o||(o=new Bn),i(y,g,r,n,o)}}return p?(o||(o=new Bn),Cb(t,e,r,n,i,o)):!1}var _b=uF;function Sb(t,e,r,n,i){return t===e?!0:t==null||e==null||!at(t)&&!at(e)?t!==t&&e!==e:_b(t,e,r,n,Sb,i)}var zu=Sb;var lF=1,cF=2;function fF(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],l=t[u],c=a[1];if(s&&a[2]){if(l===void 0&&!(u in t))return!1}else{var f=new Bn;if(n)var p=n(l,c,u,t,e,f);if(!(p===void 0?zu(c,l,lF|cF,n,f):p))return!1}}return!0}var vb=fF;function pF(t){return t===t&&!Ze(t)}var $u=pF;function dF(t){for(var e=Pe(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,$u(i)]}return e}var Ib=dF;function hF(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var qu=hF;function mF(t){var e=Ib(t);return e.length==1&&e[0][2]?qu(e[0][0],e[0][1]):function(r){return r===t||vb(r,t,e)}}var Ob=mF;function gF(t,e){return t!=null&&e in Object(t)}var Db=gF;function xF(t,e,r){e=Mn(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=zr(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&Ao(i)&&vn(s,i)&&(J(t)||Dn(t)))}var Vu=xF;function yF(t,e){return t!=null&&Vu(t,e,Db)}var Rb=yF;var bF=1,EF=2;function AF(t,e){return wo(t)&&$u(e)?qu(zr(t),e):function(r){var n=Sy(r,t);return n===void 0&&n===e?Rb(r,t):zu(e,n,bF|EF)}}var Fb=AF;function CF(t){return function(e){return e?.[t]}}var Nb=CF;function wF(t){return function(e){return So(e,t)}}var Pb=wF;function kF(t){return wo(t)?Nb(zr(t)):Pb(t)}var Lb=kF;function TF(t){return typeof t=="function"?t:t==null?hr:typeof t=="object"?J(t)?Fb(t[0],t[1]):Ob(t):Lb(t)}var ht=TF;function _F(t,e,r,n){for(var i=-1,o=t==null?0:t.length;++i<o;){var s=t[i];e(n,s,r(s),t)}return n}var Mb=_F;function SF(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var u=s[t?a:++i];if(r(o[u],u,o)===!1)break}return e}}var Bb=SF;var vF=Bb(),jb=vF;function IF(t,e){return t&&jb(t,e,Pe)}var Ub=IF;function OF(t,e){return function(r,n){if(r==null)return r;if(!dt(r))return t(r,n);for(var i=r.length,o=e?i:-1,s=Object(r);(e?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}var zb=OF;var DF=zb(Ub),Wt=DF;function RF(t,e,r,n){return Wt(t,function(i,o,s){e(n,i,r(i),s)}),n}var $b=RF;function FF(t,e){return function(r,n){var i=J(r)?Mb:$b,o=e?e():{};return i(r,t,ht(n,2),o)}}var qb=FF;var Vb=Object.prototype,NF=Vb.hasOwnProperty,PF=Eo(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&On(e[0],e[1],i)&&(n=1);++r<n;)for(var o=e[r],s=Rn(o),a=-1,u=s.length;++a<u;){var l=s[a],c=t[l];(c===void 0||Mr(c,Vb[l])&&!NF.call(t,l))&&(t[l]=o[l])}return t}),Bo=PF;function LF(t){return at(t)&&dt(t)}var dp=LF;function MF(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var Gu=MF;var BF=200;function jF(t,e,r,n){var i=-1,o=ku,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;r&&(e=Pr(e,Ur(r))),n?(o=Gu,s=!1):e.length>=BF&&(o=Lo,s=!1,e=new Po(e));e:for(;++i<a;){var c=t[i],f=r==null?c:r(c);if(c=n||c!==0?c:0,s&&f===f){for(var p=l;p--;)if(e[p]===f)continue e;u.push(c)}else o(e,f,n)||u.push(c)}return u}var Gb=jF;var UF=Eo(function(t,e){return dp(t)?Gb(t,Io(e,1,dp,!0)):[]}),Un=UF;function zF(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var qr=zF;function $F(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Lr(e),Iu(t,e<0?0:e,n)):[]}var ut=$F;function qF(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Lr(e),e=n-e,Iu(t,0,e<0?0:e)):[]}var un=qF;function VF(t){return typeof t=="function"?t:hr}var Wb=VF;function GF(t,e){var r=J(t)?Cu:Wt;return r(t,Wb(e))}var G=GF;function WF(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var Hb=WF;function HF(t,e){var r=!0;return Wt(t,function(n,i,o){return r=!!e(n,i,o),r}),r}var Kb=HF;function KF(t,e,r){var n=J(t)?Hb:Kb;return r&&On(t,e,r)&&(e=void 0),n(t,ht(e,3))}var Dt=KF;function YF(t,e){var r=[];return Wt(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var Wu=YF;function ZF(t,e){var r=J(t)?Do:Wu;return r(t,ht(e,3))}var Rt=ZF;function XF(t){return function(e,r,n){var i=Object(e);if(!dt(e)){var o=ht(r,3);e=Pe(e),r=function(a){return o(i[a],a,i)}}var s=t(e,r,n);return s>-1?i[o?e[s]:s]:void 0}}var Yb=XF;var JF=Math.max;function QF(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Lr(r);return i<0&&(i=JF(n+i,0)),wu(t,ht(e,3),i)}var Zb=QF;var eN=Yb(Zb),Vr=eN;function tN(t){return t&&t.length?t[0]:void 0}var kt=tN;function rN(t,e){var r=-1,n=dt(t)?Array(t.length):[];return Wt(t,function(i,o,s){n[++r]=e(i,o,s)}),n}var Xb=rN;function nN(t,e){var r=J(t)?Pr:Xb;return r(t,ht(e,3))}var q=nN;function iN(t,e){return Io(q(t,e),1)}var jt=iN;var oN=Object.prototype,sN=oN.hasOwnProperty,aN=qb(function(t,e,r){sN.call(t,r)?t[r].push(e):bo(t,r,[e])}),hp=aN;var uN=Object.prototype,lN=uN.hasOwnProperty;function cN(t,e){return t!=null&&lN.call(t,e)}var Jb=cN;function fN(t,e){return t!=null&&Vu(t,e,Jb)}var Z=fN;var pN="[object String]";function dN(t){return typeof t=="string"||!J(t)&&at(t)&&Mt(t)==pN}var Et=dN;function hN(t,e){return Pr(e,function(r){return t[r]})}var Qb=hN;function mN(t){return t==null?[]:Qb(t,Pe(t))}var Re=mN;var gN=Math.max;function xN(t,e,r,n){t=dt(t)?t:Re(t),r=r&&!n?Lr(r):0;var i=t.length;return r<0&&(r=gN(i+r,0)),Et(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&yo(t,e,r)>-1}var He=xN;var yN=Math.max;function bN(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Lr(r);return i<0&&(i=yN(n+i,0)),yo(t,e,i)}var Hu=bN;var EN="[object Map]",AN="[object Set]",CN=Object.prototype,wN=CN.hasOwnProperty;function kN(t){if(t==null)return!0;if(dt(t)&&(J(t)||typeof t=="string"||typeof t.splice=="function"||sn(t)||Co(t)||Dn(t)))return!t.length;var e=Ar(t);if(e==EN||e==AN)return!t.size;if(jr(t))return!Su(t).length;for(var r in t)if(wN.call(t,r))return!1;return!0}var Te=kN;var TN="[object RegExp]";function _N(t){return at(t)&&Mt(t)==TN}var eE=_N;var tE=mr&&mr.isRegExp,SN=tE?Ur(tE):eE,gr=SN;function vN(t){return t===void 0}var Ft=vN;var IN="Expected a function";function ON(t){if(typeof t!="function")throw new TypeError(IN);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var rE=ON;function DN(t,e,r,n){if(!Ze(t))return t;e=Mn(e,t);for(var i=-1,o=e.length,s=o-1,a=t;a!=null&&++i<o;){var u=zr(e[i]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=s){var c=a[u];l=n?n(c,u,a):void 0,l===void 0&&(l=Ze(c)?c:vn(e[i+1])?[]:{})}In(a,u,l),a=a[u]}return t}var nE=DN;function RN(t,e,r){for(var n=-1,i=e.length,o={};++n<i;){var s=e[n],a=So(t,s);r(a,s)&&nE(o,Mn(s,t),a)}return o}var iE=RN;function FN(t,e){if(t==null)return{};var r=Pr(Fu(t),function(n){return[n]});return e=ht(e),iE(t,r,function(n,i){return e(n,i[0])})}var Ht=FN;function NN(t,e,r,n,i){return i(t,function(o,s,a){r=n?(n=!1,o):e(r,o,s,a)}),r}var oE=NN;function PN(t,e,r){var n=J(t)?Dy:oE,i=arguments.length<3;return n(t,ht(e,4),r,i,Wt)}var mt=PN;function LN(t,e){var r=J(t)?Do:Wu;return r(t,rE(ht(e,3)))}var zn=LN;function MN(t,e){var r;return Wt(t,function(n,i,o){return r=e(n,i,o),!r}),!!r}var sE=MN;function BN(t,e,r){var n=J(t)?Bu:sE;return r&&On(t,e,r)&&(e=void 0),n(t,ht(e,3))}var Ds=BN;var jN=1/0,UN=jn&&1/Mo(new jn([,-0]))[1]==jN?function(t){return new jn(t)}:Xe,aE=UN;var zN=200;function $N(t,e,r){var n=-1,i=ku,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=Gu;else if(o>=zN){var l=e?null:aE(t);if(l)return Mo(l);s=!1,i=Lo,u=new Po}else u=e?[]:a;e:for(;++n<o;){var c=t[n],f=e?e(c):c;if(c=r||c!==0?c:0,s&&f===f){for(var p=u.length;p--;)if(u[p]===f)continue e;e&&u.push(f),a.push(c)}else i(u,f,r)||(u!==a&&u.push(f),a.push(c))}return a}var uE=$N;function qN(t){return t&&t.length?uE(t):[]}var jo=qN;function Uo(t){console&&console.error&&console.error(`Error: ${t}`)}function Rs(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Fs(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Ns(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function VN(t){return GN(t)?t.LABEL:t.name}function GN(t){return Et(t.LABEL)&&t.LABEL!==""}var ir=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),G(this.definition,r=>{r.accept(e)})}},Be=class extends ir{constructor(e){super([]),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Ut=class extends ir{constructor(e){super(e.definition),this.orgText="",_t(this,Ht(e,r=>r!==void 0))}},je=class extends ir{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,_t(this,Ht(e,r=>r!==void 0))}},Ge=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},lt=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},ct=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},De=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},rt=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},nt=class extends ir{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,_t(this,Ht(e,r=>r!==void 0))}},Ie=class{constructor(e){this.idx=1,_t(this,Ht(e,r=>r!==void 0))}accept(e){e.visit(this)}};function Ku(t){return q(t,zo)}function zo(t){function e(r){return q(r,zo)}if(t instanceof Be){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Et(t.label)&&(r.label=t.label),r}else{if(t instanceof je)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ge)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof lt)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof ct)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:zo(new Ie({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof rt)return{type:"RepetitionWithSeparator",idx:t.idx,separator:zo(new Ie({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof De)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof nt)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Ie){let r={type:"Terminal",name:t.terminalType.name,label:VN(t.terminalType),idx:t.idx};Et(t.label)&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=gr(n)?n.source:n),r}else{if(t instanceof Ut)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}var zt=class{visit(e){let r=e;switch(r.constructor){case Be:return this.visitNonTerminal(r);case je:return this.visitAlternative(r);case Ge:return this.visitOption(r);case lt:return this.visitRepetitionMandatory(r);case ct:return this.visitRepetitionMandatoryWithSeparator(r);case rt:return this.visitRepetitionWithSeparator(r);case De:return this.visitRepetition(r);case nt:return this.visitAlternation(r);case Ie:return this.visitTerminal(r);case Ut:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function mp(t){return t instanceof je||t instanceof Ge||t instanceof De||t instanceof lt||t instanceof ct||t instanceof rt||t instanceof Ie||t instanceof Ut}function Fi(t,e=[]){return t instanceof Ge||t instanceof De||t instanceof rt?!0:t instanceof nt?Ds(t.definition,n=>Fi(n,e)):t instanceof Be&&He(e,t)?!1:t instanceof ir?(t instanceof Be&&e.push(t),Dt(t.definition,n=>Fi(n,e))):!1}function gp(t){return t instanceof nt}function Kt(t){if(t instanceof Be)return"SUBRULE";if(t instanceof Ge)return"OPTION";if(t instanceof nt)return"OR";if(t instanceof lt)return"AT_LEAST_ONE";if(t instanceof ct)return"AT_LEAST_ONE_SEP";if(t instanceof rt)return"MANY_SEP";if(t instanceof De)return"MANY";if(t instanceof Ie)return"CONSUME";throw Error("non exhaustive match")}var ln=class{walk(e,r=[]){G(e.definition,(n,i)=>{let o=ut(e.definition,i+1);if(n instanceof Be)this.walkProdRef(n,o,r);else if(n instanceof Ie)this.walkTerminal(n,o,r);else if(n instanceof je)this.walkFlat(n,o,r);else if(n instanceof Ge)this.walkOption(n,o,r);else if(n instanceof lt)this.walkAtLeastOne(n,o,r);else if(n instanceof ct)this.walkAtLeastOneSep(n,o,r);else if(n instanceof rt)this.walkManySep(n,o,r);else if(n instanceof De)this.walkMany(n,o,r);else if(n instanceof nt)this.walkOr(n,o,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new Ge({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=lE(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Ge({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=lE(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);G(e.definition,o=>{let s=new je({definition:[o]});this.walk(s,i)})}};function lE(t,e,r){return[new Ge({definition:[new Ie({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Ni(t){if(t instanceof Be)return Ni(t.referencedRule);if(t instanceof Ie)return KN(t);if(mp(t))return WN(t);if(gp(t))return HN(t);throw Error("non exhaustive match")}function WN(t){let e=[],r=t.definition,n=0,i=r.length>n,o,s=!0;for(;i&&s;)o=r[n],s=Fi(o),e=e.concat(Ni(o)),n=n+1,i=r.length>n;return jo(e)}function HN(t){let e=q(t.definition,r=>Ni(r));return jo(bt(e))}function KN(t){return[t.terminalType]}var Yu="_~IN~_";var xp=class extends ln{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=YN(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),s=new je({definition:o}),a=Ni(s);this.follows[i]=a}};function cE(t){let e={};return G(t,r=>{let n=new xp(r).startWalking();_t(e,n)}),e}function YN(t,e){return t.name+e+Yu}function ue(t){return t.charCodeAt(0)}function Zu(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function $o(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function Pi(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Ps(){throw Error("Internal Error - Should never get here!")}function yp(t){return t.type==="Character"}var Ls=[];for(let t=ue("0");t<=ue("9");t++)Ls.push(t);var Ms=[ue("_")].concat(Ls);for(let t=ue("a");t<=ue("z");t++)Ms.push(t);for(let t=ue("A");t<=ue("Z");t++)Ms.push(t);var bp=[ue(" "),ue("\f"),ue(`
|
|
118
|
-
`),ue("\r"),ue(" "),ue("\v"),ue(" "),ue("\xA0"),ue("\u1680"),ue("\u2000"),ue("\u2001"),ue("\u2002"),ue("\u2003"),ue("\u2004"),ue("\u2005"),ue("\u2006"),ue("\u2007"),ue("\u2008"),ue("\u2009"),ue("\u200A"),ue("\u2028"),ue("\u2029"),ue("\u202F"),ue("\u205F"),ue("\u3000"),ue("\uFEFF")];var
|
|
119
|
-
`),ue("\r"),ue("\u2028"),ue("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=Ls;break;case"D":e=Ls,r=!0;break;case"s":e=
|
|
117
|
+
`;return n}function pv(t){let e=[],r=t[0]?.length||0;for(let n=0;n<r;n++){let i=!0;for(let o of t)if(o[n]!==""){i=!1;break}i&&e.push(n)}return e}import{log as bd}from"remark-mdat";var dv=typeof global=="object"&&global&&global.Object===Object&&global,bu=dv;var hv=typeof self=="object"&&self&&self.Object===Object&&self,mv=bu||hv||Function("return this")(),pt=mv;var gv=pt.Symbol,wt=gv;var Ex=Object.prototype,xv=Ex.hasOwnProperty,yv=Ex.toString,vs=wt?wt.toStringTag:void 0;function bv(t){var e=xv.call(t,vs),r=t[vs];try{t[vs]=void 0;var n=!0}catch{}var i=yv.call(t);return n&&(e?t[vs]=r:delete t[vs]),i}var Ax=bv;var Ev=Object.prototype,Av=Ev.toString;function Cv(t){return Av.call(t)}var Cx=Cv;var wv="[object Null]",kv="[object Undefined]",wx=wt?wt.toStringTag:void 0;function Tv(t){return t==null?t===void 0?kv:wv:wx&&wx in Object(t)?Ax(t):Cx(t)}var Mt=Tv;function _v(t){return t!=null&&typeof t=="object"}var at=_v;var Sv="[object Symbol]";function vv(t){return typeof t=="symbol"||at(t)&&Mt(t)==Sv}var Sn=vv;function Iv(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Pr=Iv;var Ov=Array.isArray,J=Ov;var Dv=1/0,kx=wt?wt.prototype:void 0,Tx=kx?kx.toString:void 0;function _x(t){if(typeof t=="string")return t;if(J(t))return Pr(t,_x)+"";if(Sn(t))return Tx?Tx.call(t):"";var e=t+"";return e=="0"&&1/t==-Dv?"-0":e}var Sx=_x;var Rv=/\s/;function Fv(t){for(var e=t.length;e--&&Rv.test(t.charAt(e)););return e}var vx=Fv;var Nv=/^\s+/;function Pv(t){return t&&t.slice(0,vx(t)+1).replace(Nv,"")}var Ix=Pv;function Lv(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ze=Lv;var Ox=NaN,Mv=/^[-+]0x[0-9a-f]+$/i,Bv=/^0b[01]+$/i,jv=/^0o[0-7]+$/i,Uv=parseInt;function zv(t){if(typeof t=="number")return t;if(Sn(t))return Ox;if(Ze(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ze(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Ix(t);var r=Bv.test(t);return r||jv.test(t)?Uv(t.slice(2),r?2:8):Mv.test(t)?Ox:+t}var Dx=zv;var Rx=1/0,$v=17976931348623157e292;function qv(t){if(!t)return t===0?t:0;if(t=Dx(t),t===Rx||t===-Rx){var e=t<0?-1:1;return e*$v}return t===t?t:0}var Fx=qv;function Vv(t){var e=Fx(t),r=e%1;return e===e?r?e-r:e:0}var Lr=Vv;function Gv(t){return t}var hr=Gv;var Wv="[object AsyncFunction]",Hv="[object Function]",Kv="[object GeneratorFunction]",Yv="[object Proxy]";function Zv(t){if(!Ze(t))return!1;var e=Mt(t);return e==Hv||e==Kv||e==Wv||e==Yv}var Bt=Zv;var Xv=pt["__core-js_shared__"],Eu=Xv;var Nx=function(){var t=/[^.]+$/.exec(Eu&&Eu.keys&&Eu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Jv(t){return!!Nx&&Nx in t}var Px=Jv;var Qv=Function.prototype,eI=Qv.toString;function tI(t){if(t!=null){try{return eI.call(t)}catch{}try{return t+""}catch{}}return""}var on=tI;var rI=/[\\^$.*+?()[\]{}|]/g,nI=/^\[object .+?Constructor\]$/,iI=Function.prototype,oI=Object.prototype,sI=iI.toString,aI=oI.hasOwnProperty,uI=RegExp("^"+sI.call(aI).replace(rI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lI(t){if(!Ze(t)||Px(t))return!1;var e=Bt(t)?uI:nI;return e.test(on(t))}var Lx=lI;function cI(t,e){return t?.[e]}var Mx=cI;function fI(t,e){var r=Mx(t,e);return Lx(r)?r:void 0}var Gt=fI;var pI=Gt(pt,"WeakMap"),Au=pI;var Bx=Object.create,dI=function(){function t(){}return function(e){if(!Ze(e))return{};if(Bx)return Bx(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),jx=dI;function hI(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Ux=hI;function mI(){}var Xe=mI;function gI(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var zx=gI;var xI=800,yI=16,bI=Date.now;function EI(t){var e=0,r=0;return function(){var n=bI(),i=yI-(n-r);if(r=n,i>0){if(++e>=xI)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var $x=EI;function AI(t){return function(){return t}}var qx=AI;var CI=function(){try{var t=Gt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),xo=CI;var wI=xo?function(t,e){return xo(t,"toString",{configurable:!0,enumerable:!1,value:qx(e),writable:!0})}:hr,Vx=wI;var kI=$x(Vx),Gx=kI;function TI(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var Cu=TI;function _I(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}var wu=_I;function SI(t){return t!==t}var Wx=SI;function vI(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var Hx=vI;function II(t,e,r){return e===e?Hx(t,e,r):wu(t,Wx,r)}var yo=II;function OI(t,e){var r=t==null?0:t.length;return!!r&&yo(t,e,0)>-1}var ku=OI;var DI=9007199254740991,RI=/^(?:0|[1-9]\d*)$/;function FI(t,e){var r=typeof t;return e=e??DI,!!e&&(r=="number"||r!="symbol"&&RI.test(t))&&t>-1&&t%1==0&&t<e}var vn=FI;function NI(t,e,r){e=="__proto__"&&xo?xo(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var bo=NI;function PI(t,e){return t===e||t!==t&&e!==e}var Mr=PI;var LI=Object.prototype,MI=LI.hasOwnProperty;function BI(t,e,r){var n=t[e];(!(MI.call(t,e)&&Mr(n,r))||r===void 0&&!(e in t))&&bo(t,e,r)}var In=BI;function jI(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],u=n?n(r[a],t[a],a,r,t):void 0;u===void 0&&(u=t[a]),i?bo(r,a,u):In(r,a,u)}return r}var Br=jI;var Kx=Math.max;function UI(t,e,r){return e=Kx(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=Kx(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),Ux(t,this,a)}}var Yx=UI;function zI(t,e){return Gx(Yx(t,e,hr),t+"")}var Eo=zI;var $I=9007199254740991;function qI(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=$I}var Ao=qI;function VI(t){return t!=null&&Ao(t.length)&&!Bt(t)}var dt=VI;function GI(t,e,r){if(!Ze(r))return!1;var n=typeof e;return(n=="number"?dt(r)&&vn(e,r.length):n=="string"&&e in r)?Mr(r[e],t):!1}var On=GI;function WI(t){return Eo(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&On(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,o)}return e})}var Zx=WI;var HI=Object.prototype;function KI(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||HI;return t===r}var jr=KI;function YI(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Xx=YI;var ZI="[object Arguments]";function XI(t){return at(t)&&Mt(t)==ZI}var lp=XI;var Jx=Object.prototype,JI=Jx.hasOwnProperty,QI=Jx.propertyIsEnumerable,eO=lp(function(){return arguments}())?lp:function(t){return at(t)&&JI.call(t,"callee")&&!QI.call(t,"callee")},Dn=eO;function tO(){return!1}var Qx=tO;var ry=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ey=ry&&typeof module=="object"&&module&&!module.nodeType&&module,rO=ey&&ey.exports===ry,ty=rO?pt.Buffer:void 0,nO=ty?ty.isBuffer:void 0,iO=nO||Qx,sn=iO;var oO="[object Arguments]",sO="[object Array]",aO="[object Boolean]",uO="[object Date]",lO="[object Error]",cO="[object Function]",fO="[object Map]",pO="[object Number]",dO="[object Object]",hO="[object RegExp]",mO="[object Set]",gO="[object String]",xO="[object WeakMap]",yO="[object ArrayBuffer]",bO="[object DataView]",EO="[object Float32Array]",AO="[object Float64Array]",CO="[object Int8Array]",wO="[object Int16Array]",kO="[object Int32Array]",TO="[object Uint8Array]",_O="[object Uint8ClampedArray]",SO="[object Uint16Array]",vO="[object Uint32Array]",Ve={};Ve[EO]=Ve[AO]=Ve[CO]=Ve[wO]=Ve[kO]=Ve[TO]=Ve[_O]=Ve[SO]=Ve[vO]=!0;Ve[oO]=Ve[sO]=Ve[yO]=Ve[aO]=Ve[bO]=Ve[uO]=Ve[lO]=Ve[cO]=Ve[fO]=Ve[pO]=Ve[dO]=Ve[hO]=Ve[mO]=Ve[gO]=Ve[xO]=!1;function IO(t){return at(t)&&Ao(t.length)&&!!Ve[Mt(t)]}var ny=IO;function OO(t){return function(e){return t(e)}}var Ur=OO;var iy=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Is=iy&&typeof module=="object"&&module&&!module.nodeType&&module,DO=Is&&Is.exports===iy,cp=DO&&bu.process,RO=function(){try{var t=Is&&Is.require&&Is.require("util").types;return t||cp&&cp.binding&&cp.binding("util")}catch{}}(),mr=RO;var oy=mr&&mr.isTypedArray,FO=oy?Ur(oy):ny,Co=FO;var NO=Object.prototype,PO=NO.hasOwnProperty;function LO(t,e){var r=J(t),n=!r&&Dn(t),i=!r&&!n&&sn(t),o=!r&&!n&&!i&&Co(t),s=r||n||i||o,a=s?Xx(t.length,String):[],u=a.length;for(var l in t)(e||PO.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||vn(l,u)))&&a.push(l);return a}var Tu=LO;function MO(t,e){return function(r){return t(e(r))}}var _u=MO;var BO=_u(Object.keys,Object),sy=BO;var jO=Object.prototype,UO=jO.hasOwnProperty;function zO(t){if(!jr(t))return sy(t);var e=[];for(var r in Object(t))UO.call(t,r)&&r!="constructor"&&e.push(r);return e}var Su=zO;function $O(t){return dt(t)?Tu(t):Su(t)}var Pe=$O;var qO=Object.prototype,VO=qO.hasOwnProperty,GO=Zx(function(t,e){if(jr(e)||dt(e)){Br(e,Pe(e),t);return}for(var r in e)VO.call(e,r)&&In(t,r,e[r])}),_t=GO;function WO(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var ay=WO;var HO=Object.prototype,KO=HO.hasOwnProperty;function YO(t){if(!Ze(t))return ay(t);var e=jr(t),r=[];for(var n in t)n=="constructor"&&(e||!KO.call(t,n))||r.push(n);return r}var uy=YO;function ZO(t){return dt(t)?Tu(t,!0):uy(t)}var Rn=ZO;var XO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,JO=/^\w*$/;function QO(t,e){if(J(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Sn(t)?!0:JO.test(t)||!XO.test(t)||e!=null&&t in Object(e)}var wo=QO;var eD=Gt(Object,"create"),an=eD;function tD(){this.__data__=an?an(null):{},this.size=0}var ly=tD;function rD(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var cy=rD;var nD="__lodash_hash_undefined__",iD=Object.prototype,oD=iD.hasOwnProperty;function sD(t){var e=this.__data__;if(an){var r=e[t];return r===nD?void 0:r}return oD.call(e,t)?e[t]:void 0}var fy=sD;var aD=Object.prototype,uD=aD.hasOwnProperty;function lD(t){var e=this.__data__;return an?e[t]!==void 0:uD.call(e,t)}var py=lD;var cD="__lodash_hash_undefined__";function fD(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=an&&e===void 0?cD:e,this}var dy=fD;function ko(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ko.prototype.clear=ly;ko.prototype.delete=cy;ko.prototype.get=fy;ko.prototype.has=py;ko.prototype.set=dy;var fp=ko;function pD(){this.__data__=[],this.size=0}var hy=pD;function dD(t,e){for(var r=t.length;r--;)if(Mr(t[r][0],e))return r;return-1}var Fn=dD;var hD=Array.prototype,mD=hD.splice;function gD(t){var e=this.__data__,r=Fn(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():mD.call(e,r,1),--this.size,!0}var my=gD;function xD(t){var e=this.__data__,r=Fn(e,t);return r<0?void 0:e[r][1]}var gy=xD;function yD(t){return Fn(this.__data__,t)>-1}var xy=yD;function bD(t,e){var r=this.__data__,n=Fn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var yy=bD;function To(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}To.prototype.clear=hy;To.prototype.delete=my;To.prototype.get=gy;To.prototype.has=xy;To.prototype.set=yy;var Nn=To;var ED=Gt(pt,"Map"),Pn=ED;function AD(){this.size=0,this.__data__={hash:new fp,map:new(Pn||Nn),string:new fp}}var by=AD;function CD(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Ey=CD;function wD(t,e){var r=t.__data__;return Ey(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Ln=wD;function kD(t){var e=Ln(this,t).delete(t);return this.size-=e?1:0,e}var Ay=kD;function TD(t){return Ln(this,t).get(t)}var Cy=TD;function _D(t){return Ln(this,t).has(t)}var wy=_D;function SD(t,e){var r=Ln(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var ky=SD;function _o(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}_o.prototype.clear=by;_o.prototype.delete=Ay;_o.prototype.get=Cy;_o.prototype.has=wy;_o.prototype.set=ky;var Di=_o;var vD="Expected a function";function pp(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(vD);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(pp.Cache||Di),r}pp.Cache=Di;var Ty=pp;var ID=500;function OD(t){var e=Ty(t,function(n){return r.size===ID&&r.clear(),n}),r=e.cache;return e}var _y=OD;var DD=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,RD=/\\(\\)?/g,FD=_y(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(DD,function(r,n,i,o){e.push(i?o.replace(RD,"$1"):n||r)}),e}),Sy=FD;function ND(t){return t==null?"":Sx(t)}var vy=ND;function PD(t,e){return J(t)?t:wo(t,e)?[t]:Sy(vy(t))}var Mn=PD;var LD=1/0;function MD(t){if(typeof t=="string"||Sn(t))return t;var e=t+"";return e=="0"&&1/t==-LD?"-0":e}var zr=MD;function BD(t,e){e=Mn(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[zr(e[r++])];return r&&r==n?t:void 0}var So=BD;function jD(t,e,r){var n=t==null?void 0:So(t,e);return n===void 0?r:n}var Iy=jD;function UD(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var vo=UD;var Oy=wt?wt.isConcatSpreadable:void 0;function zD(t){return J(t)||Dn(t)||!!(Oy&&t&&t[Oy])}var Dy=zD;function Ry(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=Dy),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?Ry(a,e-1,r,n,i):vo(i,a):n||(i[i.length]=a)}return i}var Io=Ry;function $D(t){var e=t==null?0:t.length;return e?Io(t,1):[]}var bt=$D;var qD=_u(Object.getPrototypeOf,Object),vu=qD;function VD(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}var Iu=VD;function GD(t,e,r,n){var i=-1,o=t==null?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}var Fy=GD;function WD(){this.__data__=new Nn,this.size=0}var Ny=WD;function HD(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var Py=HD;function KD(t){return this.__data__.get(t)}var Ly=KD;function YD(t){return this.__data__.has(t)}var My=YD;var ZD=200;function XD(t,e){var r=this.__data__;if(r instanceof Nn){var n=r.__data__;if(!Pn||n.length<ZD-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Di(n)}return r.set(t,e),this.size=r.size,this}var By=XD;function Oo(t){var e=this.__data__=new Nn(t);this.size=e.size}Oo.prototype.clear=Ny;Oo.prototype.delete=Py;Oo.prototype.get=Ly;Oo.prototype.has=My;Oo.prototype.set=By;var Bn=Oo;function JD(t,e){return t&&Br(e,Pe(e),t)}var jy=JD;function QD(t,e){return t&&Br(e,Rn(e),t)}var Uy=QD;var Vy=typeof exports=="object"&&exports&&!exports.nodeType&&exports,zy=Vy&&typeof module=="object"&&module&&!module.nodeType&&module,eR=zy&&zy.exports===Vy,$y=eR?pt.Buffer:void 0,qy=$y?$y.allocUnsafe:void 0;function tR(t,e){if(e)return t.slice();var r=t.length,n=qy?qy(r):new t.constructor(r);return t.copy(n),n}var Gy=tR;function rR(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}var Do=rR;function nR(){return[]}var Ou=nR;var iR=Object.prototype,oR=iR.propertyIsEnumerable,Wy=Object.getOwnPropertySymbols,sR=Wy?function(t){return t==null?[]:(t=Object(t),Do(Wy(t),function(e){return oR.call(t,e)}))}:Ou,Ro=sR;function aR(t,e){return Br(t,Ro(t),e)}var Hy=aR;var uR=Object.getOwnPropertySymbols,lR=uR?function(t){for(var e=[];t;)vo(e,Ro(t)),t=vu(t);return e}:Ou,Du=lR;function cR(t,e){return Br(t,Du(t),e)}var Ky=cR;function fR(t,e,r){var n=e(t);return J(t)?n:vo(n,r(t))}var Ru=fR;function pR(t){return Ru(t,Pe,Ro)}var Os=pR;function dR(t){return Ru(t,Rn,Du)}var Fu=dR;var hR=Gt(pt,"DataView"),Nu=hR;var mR=Gt(pt,"Promise"),Pu=mR;var gR=Gt(pt,"Set"),jn=gR;var Yy="[object Map]",xR="[object Object]",Zy="[object Promise]",Xy="[object Set]",Jy="[object WeakMap]",Qy="[object DataView]",yR=on(Nu),bR=on(Pn),ER=on(Pu),AR=on(jn),CR=on(Au),Ri=Mt;(Nu&&Ri(new Nu(new ArrayBuffer(1)))!=Qy||Pn&&Ri(new Pn)!=Yy||Pu&&Ri(Pu.resolve())!=Zy||jn&&Ri(new jn)!=Xy||Au&&Ri(new Au)!=Jy)&&(Ri=function(t){var e=Mt(t),r=e==xR?t.constructor:void 0,n=r?on(r):"";if(n)switch(n){case yR:return Qy;case bR:return Yy;case ER:return Zy;case AR:return Xy;case CR:return Jy}return e});var Ar=Ri;var wR=Object.prototype,kR=wR.hasOwnProperty;function TR(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&kR.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var eb=TR;var _R=pt.Uint8Array,Fo=_R;function SR(t){var e=new t.constructor(t.byteLength);return new Fo(e).set(new Fo(t)),e}var No=SR;function vR(t,e){var r=e?No(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var tb=vR;var IR=/\w*$/;function OR(t){var e=new t.constructor(t.source,IR.exec(t));return e.lastIndex=t.lastIndex,e}var rb=OR;var nb=wt?wt.prototype:void 0,ib=nb?nb.valueOf:void 0;function DR(t){return ib?Object(ib.call(t)):{}}var ob=DR;function RR(t,e){var r=e?No(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var sb=RR;var FR="[object Boolean]",NR="[object Date]",PR="[object Map]",LR="[object Number]",MR="[object RegExp]",BR="[object Set]",jR="[object String]",UR="[object Symbol]",zR="[object ArrayBuffer]",$R="[object DataView]",qR="[object Float32Array]",VR="[object Float64Array]",GR="[object Int8Array]",WR="[object Int16Array]",HR="[object Int32Array]",KR="[object Uint8Array]",YR="[object Uint8ClampedArray]",ZR="[object Uint16Array]",XR="[object Uint32Array]";function JR(t,e,r){var n=t.constructor;switch(e){case zR:return No(t);case FR:case NR:return new n(+t);case $R:return tb(t,r);case qR:case VR:case GR:case WR:case HR:case KR:case YR:case ZR:case XR:return sb(t,r);case PR:return new n;case LR:case jR:return new n(t);case MR:return rb(t);case BR:return new n;case UR:return ob(t)}}var ab=JR;function QR(t){return typeof t.constructor=="function"&&!jr(t)?jx(vu(t)):{}}var ub=QR;var e1="[object Map]";function t1(t){return at(t)&&Ar(t)==e1}var lb=t1;var cb=mr&&mr.isMap,r1=cb?Ur(cb):lb,fb=r1;var n1="[object Set]";function i1(t){return at(t)&&Ar(t)==n1}var pb=i1;var db=mr&&mr.isSet,o1=db?Ur(db):pb,hb=o1;var s1=1,a1=2,u1=4,mb="[object Arguments]",l1="[object Array]",c1="[object Boolean]",f1="[object Date]",p1="[object Error]",gb="[object Function]",d1="[object GeneratorFunction]",h1="[object Map]",m1="[object Number]",xb="[object Object]",g1="[object RegExp]",x1="[object Set]",y1="[object String]",b1="[object Symbol]",E1="[object WeakMap]",A1="[object ArrayBuffer]",C1="[object DataView]",w1="[object Float32Array]",k1="[object Float64Array]",T1="[object Int8Array]",_1="[object Int16Array]",S1="[object Int32Array]",v1="[object Uint8Array]",I1="[object Uint8ClampedArray]",O1="[object Uint16Array]",D1="[object Uint32Array]",Le={};Le[mb]=Le[l1]=Le[A1]=Le[C1]=Le[c1]=Le[f1]=Le[w1]=Le[k1]=Le[T1]=Le[_1]=Le[S1]=Le[h1]=Le[m1]=Le[xb]=Le[g1]=Le[x1]=Le[y1]=Le[b1]=Le[v1]=Le[I1]=Le[O1]=Le[D1]=!0;Le[p1]=Le[gb]=Le[E1]=!1;function Lu(t,e,r,n,i,o){var s,a=e&s1,u=e&a1,l=e&u1;if(r&&(s=i?r(t,n,i,o):r(t)),s!==void 0)return s;if(!Ze(t))return t;var c=J(t);if(c){if(s=eb(t),!a)return zx(t,s)}else{var f=Ar(t),p=f==gb||f==d1;if(sn(t))return Gy(t,a);if(f==xb||f==mb||p&&!i){if(s=u||p?{}:ub(t),!a)return u?Ky(t,Uy(s,t)):Hy(t,jy(s,t))}else{if(!Le[f])return i?t:{};s=ab(t,f,a)}}o||(o=new Bn);var d=o.get(t);if(d)return d;o.set(t,s),hb(t)?t.forEach(function(g){s.add(Lu(g,e,r,g,t,o))}):fb(t)&&t.forEach(function(g,b){s.set(b,Lu(g,e,r,b,t,o))});var m=l?u?Fu:Os:u?Rn:Pe,y=c?void 0:m(t);return Cu(y||t,function(g,b){y&&(b=g,g=t[b]),In(s,b,Lu(g,e,r,b,t,o))}),s}var yb=Lu;var R1=4;function F1(t){return yb(t,R1)}var Me=F1;function N1(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var o=t[e];o&&(i[n++]=o)}return i}var $r=N1;var P1="__lodash_hash_undefined__";function L1(t){return this.__data__.set(t,P1),this}var bb=L1;function M1(t){return this.__data__.has(t)}var Eb=M1;function Mu(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Di;++e<r;)this.add(t[e])}Mu.prototype.add=Mu.prototype.push=bb;Mu.prototype.has=Eb;var Po=Mu;function B1(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var Bu=B1;function j1(t,e){return t.has(e)}var Lo=j1;var U1=1,z1=2;function $1(t,e,r,n,i,o){var s=r&U1,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t),c=o.get(e);if(l&&c)return l==e&&c==t;var f=-1,p=!0,d=r&z1?new Po:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],y=e[f];if(n)var g=s?n(y,m,f,e,t,o):n(m,y,f,t,e,o);if(g!==void 0){if(g)continue;p=!1;break}if(d){if(!Bu(e,function(b,w){if(!Lo(d,w)&&(m===b||i(m,b,r,n,o)))return d.push(w)})){p=!1;break}}else if(!(m===y||i(m,y,r,n,o))){p=!1;break}}return o.delete(t),o.delete(e),p}var ju=$1;function q1(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var Ab=q1;function V1(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Mo=V1;var G1=1,W1=2,H1="[object Boolean]",K1="[object Date]",Y1="[object Error]",Z1="[object Map]",X1="[object Number]",J1="[object RegExp]",Q1="[object Set]",eF="[object String]",tF="[object Symbol]",rF="[object ArrayBuffer]",nF="[object DataView]",Cb=wt?wt.prototype:void 0,dp=Cb?Cb.valueOf:void 0;function iF(t,e,r,n,i,o,s){switch(r){case nF:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case rF:return!(t.byteLength!=e.byteLength||!o(new Fo(t),new Fo(e)));case H1:case K1:case X1:return Mr(+t,+e);case Y1:return t.name==e.name&&t.message==e.message;case J1:case eF:return t==e+"";case Z1:var a=Ab;case Q1:var u=n&G1;if(a||(a=Mo),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;n|=W1,s.set(t,e);var c=ju(a(t),a(e),n,i,o,s);return s.delete(t),c;case tF:if(dp)return dp.call(t)==dp.call(e)}return!1}var wb=iF;var oF=1,sF=Object.prototype,aF=sF.hasOwnProperty;function uF(t,e,r,n,i,o){var s=r&oF,a=Os(t),u=a.length,l=Os(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var p=a[f];if(!(s?p in e:aF.call(e,p)))return!1}var d=o.get(t),m=o.get(e);if(d&&m)return d==e&&m==t;var y=!0;o.set(t,e),o.set(e,t);for(var g=s;++f<u;){p=a[f];var b=t[p],w=e[p];if(n)var C=s?n(w,b,p,e,t,o):n(b,w,p,t,e,o);if(!(C===void 0?b===w||i(b,w,r,n,o):C)){y=!1;break}g||(g=p=="constructor")}if(y&&!g){var D=t.constructor,R=e.constructor;D!=R&&"constructor"in t&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof R=="function"&&R instanceof R)&&(y=!1)}return o.delete(t),o.delete(e),y}var kb=uF;var lF=1,Tb="[object Arguments]",_b="[object Array]",Uu="[object Object]",cF=Object.prototype,Sb=cF.hasOwnProperty;function fF(t,e,r,n,i,o){var s=J(t),a=J(e),u=s?_b:Ar(t),l=a?_b:Ar(e);u=u==Tb?Uu:u,l=l==Tb?Uu:l;var c=u==Uu,f=l==Uu,p=u==l;if(p&&sn(t)){if(!sn(e))return!1;s=!0,c=!1}if(p&&!c)return o||(o=new Bn),s||Co(t)?ju(t,e,r,n,i,o):wb(t,e,u,r,n,i,o);if(!(r&lF)){var d=c&&Sb.call(t,"__wrapped__"),m=f&&Sb.call(e,"__wrapped__");if(d||m){var y=d?t.value():t,g=m?e.value():e;return o||(o=new Bn),i(y,g,r,n,o)}}return p?(o||(o=new Bn),kb(t,e,r,n,i,o)):!1}var vb=fF;function Ib(t,e,r,n,i){return t===e?!0:t==null||e==null||!at(t)&&!at(e)?t!==t&&e!==e:vb(t,e,r,n,Ib,i)}var zu=Ib;var pF=1,dF=2;function hF(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],l=t[u],c=a[1];if(s&&a[2]){if(l===void 0&&!(u in t))return!1}else{var f=new Bn;if(n)var p=n(l,c,u,t,e,f);if(!(p===void 0?zu(c,l,pF|dF,n,f):p))return!1}}return!0}var Ob=hF;function mF(t){return t===t&&!Ze(t)}var $u=mF;function gF(t){for(var e=Pe(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,$u(i)]}return e}var Db=gF;function xF(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var qu=xF;function yF(t){var e=Db(t);return e.length==1&&e[0][2]?qu(e[0][0],e[0][1]):function(r){return r===t||Ob(r,t,e)}}var Rb=yF;function bF(t,e){return t!=null&&e in Object(t)}var Fb=bF;function EF(t,e,r){e=Mn(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=zr(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&Ao(i)&&vn(s,i)&&(J(t)||Dn(t)))}var Vu=EF;function AF(t,e){return t!=null&&Vu(t,e,Fb)}var Nb=AF;var CF=1,wF=2;function kF(t,e){return wo(t)&&$u(e)?qu(zr(t),e):function(r){var n=Iy(r,t);return n===void 0&&n===e?Nb(r,t):zu(e,n,CF|wF)}}var Pb=kF;function TF(t){return function(e){return e?.[t]}}var Lb=TF;function _F(t){return function(e){return So(e,t)}}var Mb=_F;function SF(t){return wo(t)?Lb(zr(t)):Mb(t)}var Bb=SF;function vF(t){return typeof t=="function"?t:t==null?hr:typeof t=="object"?J(t)?Pb(t[0],t[1]):Rb(t):Bb(t)}var ht=vF;function IF(t,e,r,n){for(var i=-1,o=t==null?0:t.length;++i<o;){var s=t[i];e(n,s,r(s),t)}return n}var jb=IF;function OF(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var u=s[t?a:++i];if(r(o[u],u,o)===!1)break}return e}}var Ub=OF;var DF=Ub(),zb=DF;function RF(t,e){return t&&zb(t,e,Pe)}var $b=RF;function FF(t,e){return function(r,n){if(r==null)return r;if(!dt(r))return t(r,n);for(var i=r.length,o=e?i:-1,s=Object(r);(e?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}var qb=FF;var NF=qb($b),Wt=NF;function PF(t,e,r,n){return Wt(t,function(i,o,s){e(n,i,r(i),s)}),n}var Vb=PF;function LF(t,e){return function(r,n){var i=J(r)?jb:Vb,o=e?e():{};return i(r,t,ht(n,2),o)}}var Gb=LF;var Wb=Object.prototype,MF=Wb.hasOwnProperty,BF=Eo(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&On(e[0],e[1],i)&&(n=1);++r<n;)for(var o=e[r],s=Rn(o),a=-1,u=s.length;++a<u;){var l=s[a],c=t[l];(c===void 0||Mr(c,Wb[l])&&!MF.call(t,l))&&(t[l]=o[l])}return t}),Bo=BF;function jF(t){return at(t)&&dt(t)}var hp=jF;function UF(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var Gu=UF;var zF=200;function $F(t,e,r,n){var i=-1,o=ku,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;r&&(e=Pr(e,Ur(r))),n?(o=Gu,s=!1):e.length>=zF&&(o=Lo,s=!1,e=new Po(e));e:for(;++i<a;){var c=t[i],f=r==null?c:r(c);if(c=n||c!==0?c:0,s&&f===f){for(var p=l;p--;)if(e[p]===f)continue e;u.push(c)}else o(e,f,n)||u.push(c)}return u}var Hb=$F;var qF=Eo(function(t,e){return hp(t)?Hb(t,Io(e,1,hp,!0)):[]}),Un=qF;function VF(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var qr=VF;function GF(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Lr(e),Iu(t,e<0?0:e,n)):[]}var ut=GF;function WF(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Lr(e),e=n-e,Iu(t,0,e<0?0:e)):[]}var un=WF;function HF(t){return typeof t=="function"?t:hr}var Kb=HF;function KF(t,e){var r=J(t)?Cu:Wt;return r(t,Kb(e))}var G=KF;function YF(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var Yb=YF;function ZF(t,e){var r=!0;return Wt(t,function(n,i,o){return r=!!e(n,i,o),r}),r}var Zb=ZF;function XF(t,e,r){var n=J(t)?Yb:Zb;return r&&On(t,e,r)&&(e=void 0),n(t,ht(e,3))}var Dt=XF;function JF(t,e){var r=[];return Wt(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var Wu=JF;function QF(t,e){var r=J(t)?Do:Wu;return r(t,ht(e,3))}var Rt=QF;function eN(t){return function(e,r,n){var i=Object(e);if(!dt(e)){var o=ht(r,3);e=Pe(e),r=function(a){return o(i[a],a,i)}}var s=t(e,r,n);return s>-1?i[o?e[s]:s]:void 0}}var Xb=eN;var tN=Math.max;function rN(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Lr(r);return i<0&&(i=tN(n+i,0)),wu(t,ht(e,3),i)}var Jb=rN;var nN=Xb(Jb),Vr=nN;function iN(t){return t&&t.length?t[0]:void 0}var kt=iN;function oN(t,e){var r=-1,n=dt(t)?Array(t.length):[];return Wt(t,function(i,o,s){n[++r]=e(i,o,s)}),n}var Qb=oN;function sN(t,e){var r=J(t)?Pr:Qb;return r(t,ht(e,3))}var q=sN;function aN(t,e){return Io(q(t,e),1)}var jt=aN;var uN=Object.prototype,lN=uN.hasOwnProperty,cN=Gb(function(t,e,r){lN.call(t,r)?t[r].push(e):bo(t,r,[e])}),mp=cN;var fN=Object.prototype,pN=fN.hasOwnProperty;function dN(t,e){return t!=null&&pN.call(t,e)}var eE=dN;function hN(t,e){return t!=null&&Vu(t,e,eE)}var Z=hN;var mN="[object String]";function gN(t){return typeof t=="string"||!J(t)&&at(t)&&Mt(t)==mN}var Et=gN;function xN(t,e){return Pr(e,function(r){return t[r]})}var tE=xN;function yN(t){return t==null?[]:tE(t,Pe(t))}var Re=yN;var bN=Math.max;function EN(t,e,r,n){t=dt(t)?t:Re(t),r=r&&!n?Lr(r):0;var i=t.length;return r<0&&(r=bN(i+r,0)),Et(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&yo(t,e,r)>-1}var He=EN;var AN=Math.max;function CN(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Lr(r);return i<0&&(i=AN(n+i,0)),yo(t,e,i)}var Hu=CN;var wN="[object Map]",kN="[object Set]",TN=Object.prototype,_N=TN.hasOwnProperty;function SN(t){if(t==null)return!0;if(dt(t)&&(J(t)||typeof t=="string"||typeof t.splice=="function"||sn(t)||Co(t)||Dn(t)))return!t.length;var e=Ar(t);if(e==wN||e==kN)return!t.size;if(jr(t))return!Su(t).length;for(var r in t)if(_N.call(t,r))return!1;return!0}var Te=SN;var vN="[object RegExp]";function IN(t){return at(t)&&Mt(t)==vN}var rE=IN;var nE=mr&&mr.isRegExp,ON=nE?Ur(nE):rE,gr=ON;function DN(t){return t===void 0}var Ft=DN;var RN="Expected a function";function FN(t){if(typeof t!="function")throw new TypeError(RN);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var iE=FN;function NN(t,e,r,n){if(!Ze(t))return t;e=Mn(e,t);for(var i=-1,o=e.length,s=o-1,a=t;a!=null&&++i<o;){var u=zr(e[i]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=s){var c=a[u];l=n?n(c,u,a):void 0,l===void 0&&(l=Ze(c)?c:vn(e[i+1])?[]:{})}In(a,u,l),a=a[u]}return t}var oE=NN;function PN(t,e,r){for(var n=-1,i=e.length,o={};++n<i;){var s=e[n],a=So(t,s);r(a,s)&&oE(o,Mn(s,t),a)}return o}var sE=PN;function LN(t,e){if(t==null)return{};var r=Pr(Fu(t),function(n){return[n]});return e=ht(e),sE(t,r,function(n,i){return e(n,i[0])})}var Ht=LN;function MN(t,e,r,n,i){return i(t,function(o,s,a){r=n?(n=!1,o):e(r,o,s,a)}),r}var aE=MN;function BN(t,e,r){var n=J(t)?Fy:aE,i=arguments.length<3;return n(t,ht(e,4),r,i,Wt)}var mt=BN;function jN(t,e){var r=J(t)?Do:Wu;return r(t,iE(ht(e,3)))}var zn=jN;function UN(t,e){var r;return Wt(t,function(n,i,o){return r=e(n,i,o),!r}),!!r}var uE=UN;function zN(t,e,r){var n=J(t)?Bu:uE;return r&&On(t,e,r)&&(e=void 0),n(t,ht(e,3))}var Ds=zN;var $N=1/0,qN=jn&&1/Mo(new jn([,-0]))[1]==$N?function(t){return new jn(t)}:Xe,lE=qN;var VN=200;function GN(t,e,r){var n=-1,i=ku,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=Gu;else if(o>=VN){var l=e?null:lE(t);if(l)return Mo(l);s=!1,i=Lo,u=new Po}else u=e?[]:a;e:for(;++n<o;){var c=t[n],f=e?e(c):c;if(c=r||c!==0?c:0,s&&f===f){for(var p=u.length;p--;)if(u[p]===f)continue e;e&&u.push(f),a.push(c)}else i(u,f,r)||(u!==a&&u.push(f),a.push(c))}return a}var cE=GN;function WN(t){return t&&t.length?cE(t):[]}var jo=WN;function Uo(t){console&&console.error&&console.error(`Error: ${t}`)}function Rs(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Fs(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Ns(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function HN(t){return KN(t)?t.LABEL:t.name}function KN(t){return Et(t.LABEL)&&t.LABEL!==""}var ir=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),G(this.definition,r=>{r.accept(e)})}},Be=class extends ir{constructor(e){super([]),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Ut=class extends ir{constructor(e){super(e.definition),this.orgText="",_t(this,Ht(e,r=>r!==void 0))}},je=class extends ir{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,_t(this,Ht(e,r=>r!==void 0))}},Ge=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},lt=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},ct=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},De=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},rt=class extends ir{constructor(e){super(e.definition),this.idx=1,_t(this,Ht(e,r=>r!==void 0))}},nt=class extends ir{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,_t(this,Ht(e,r=>r!==void 0))}},Ie=class{constructor(e){this.idx=1,_t(this,Ht(e,r=>r!==void 0))}accept(e){e.visit(this)}};function Ku(t){return q(t,zo)}function zo(t){function e(r){return q(r,zo)}if(t instanceof Be){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Et(t.label)&&(r.label=t.label),r}else{if(t instanceof je)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ge)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof lt)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof ct)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:zo(new Ie({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof rt)return{type:"RepetitionWithSeparator",idx:t.idx,separator:zo(new Ie({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof De)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof nt)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Ie){let r={type:"Terminal",name:t.terminalType.name,label:HN(t.terminalType),idx:t.idx};Et(t.label)&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=gr(n)?n.source:n),r}else{if(t instanceof Ut)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}var zt=class{visit(e){let r=e;switch(r.constructor){case Be:return this.visitNonTerminal(r);case je:return this.visitAlternative(r);case Ge:return this.visitOption(r);case lt:return this.visitRepetitionMandatory(r);case ct:return this.visitRepetitionMandatoryWithSeparator(r);case rt:return this.visitRepetitionWithSeparator(r);case De:return this.visitRepetition(r);case nt:return this.visitAlternation(r);case Ie:return this.visitTerminal(r);case Ut:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function gp(t){return t instanceof je||t instanceof Ge||t instanceof De||t instanceof lt||t instanceof ct||t instanceof rt||t instanceof Ie||t instanceof Ut}function Fi(t,e=[]){return t instanceof Ge||t instanceof De||t instanceof rt?!0:t instanceof nt?Ds(t.definition,n=>Fi(n,e)):t instanceof Be&&He(e,t)?!1:t instanceof ir?(t instanceof Be&&e.push(t),Dt(t.definition,n=>Fi(n,e))):!1}function xp(t){return t instanceof nt}function Kt(t){if(t instanceof Be)return"SUBRULE";if(t instanceof Ge)return"OPTION";if(t instanceof nt)return"OR";if(t instanceof lt)return"AT_LEAST_ONE";if(t instanceof ct)return"AT_LEAST_ONE_SEP";if(t instanceof rt)return"MANY_SEP";if(t instanceof De)return"MANY";if(t instanceof Ie)return"CONSUME";throw Error("non exhaustive match")}var ln=class{walk(e,r=[]){G(e.definition,(n,i)=>{let o=ut(e.definition,i+1);if(n instanceof Be)this.walkProdRef(n,o,r);else if(n instanceof Ie)this.walkTerminal(n,o,r);else if(n instanceof je)this.walkFlat(n,o,r);else if(n instanceof Ge)this.walkOption(n,o,r);else if(n instanceof lt)this.walkAtLeastOne(n,o,r);else if(n instanceof ct)this.walkAtLeastOneSep(n,o,r);else if(n instanceof rt)this.walkManySep(n,o,r);else if(n instanceof De)this.walkMany(n,o,r);else if(n instanceof nt)this.walkOr(n,o,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new Ge({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=fE(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Ge({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=fE(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);G(e.definition,o=>{let s=new je({definition:[o]});this.walk(s,i)})}};function fE(t,e,r){return[new Ge({definition:[new Ie({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Ni(t){if(t instanceof Be)return Ni(t.referencedRule);if(t instanceof Ie)return XN(t);if(gp(t))return YN(t);if(xp(t))return ZN(t);throw Error("non exhaustive match")}function YN(t){let e=[],r=t.definition,n=0,i=r.length>n,o,s=!0;for(;i&&s;)o=r[n],s=Fi(o),e=e.concat(Ni(o)),n=n+1,i=r.length>n;return jo(e)}function ZN(t){let e=q(t.definition,r=>Ni(r));return jo(bt(e))}function XN(t){return[t.terminalType]}var Yu="_~IN~_";var yp=class extends ln{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=JN(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),s=new je({definition:o}),a=Ni(s);this.follows[i]=a}};function pE(t){let e={};return G(t,r=>{let n=new yp(r).startWalking();_t(e,n)}),e}function JN(t,e){return t.name+e+Yu}function ue(t){return t.charCodeAt(0)}function Zu(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function $o(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function Pi(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Ps(){throw Error("Internal Error - Should never get here!")}function bp(t){return t.type==="Character"}var Ls=[];for(let t=ue("0");t<=ue("9");t++)Ls.push(t);var Ms=[ue("_")].concat(Ls);for(let t=ue("a");t<=ue("z");t++)Ms.push(t);for(let t=ue("A");t<=ue("Z");t++)Ms.push(t);var Ep=[ue(" "),ue("\f"),ue(`
|
|
118
|
+
`),ue("\r"),ue(" "),ue("\v"),ue(" "),ue("\xA0"),ue("\u1680"),ue("\u2000"),ue("\u2001"),ue("\u2002"),ue("\u2003"),ue("\u2004"),ue("\u2005"),ue("\u2006"),ue("\u2007"),ue("\u2008"),ue("\u2009"),ue("\u200A"),ue("\u2028"),ue("\u2029"),ue("\u202F"),ue("\u205F"),ue("\u3000"),ue("\uFEFF")];var QN=/[0-9a-fA-F]/,Xu=/[0-9]/,eP=/[1-9]/,Bs=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":$o(n,"global");break;case"i":$o(n,"ignoreCase");break;case"m":$o(n,"multiLine");break;case"u":$o(n,"unicode");break;case"y":$o(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}Pi(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Ps()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),r={atLeast:i,atMost:o}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Pi(r);break}if(!(e===!0&&r===void 0)&&Pi(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Pi(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Ps()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ue(`
|
|
119
|
+
`),ue("\r"),ue("\u2028"),ue("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=Ls;break;case"D":e=Ls,r=!0;break;case"s":e=Ep;break;case"S":e=Ep,r=!0;break;case"w":e=Ms;break;case"W":e=Ms,r=!0;break}return Pi(e)?{type:"Set",value:e,complement:r}:Ps()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ue("\f");break;case"n":e=ue(`
|
|
120
120
|
`);break;case"r":e=ue("\r");break;case"t":e=ue(" ");break;case"v":e=ue("\v");break}return Pi(e)?{type:"Character",value:e}:Ps()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ue("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:ue(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
121
|
-
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:ue(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(
|
|
122
|
-
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:ue("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(
|
|
121
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:ue(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(bp(n)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),s=o.type==="Character";if(bp(o)){if(o.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:o.value})}else Zu(n.value,e),e.push(ue("-")),Zu(o.value,e)}else Zu(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
122
|
+
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:ue("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(eP.test(e)===!1)throw Error("Expecting a positive integer");for(;Xu.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Xu.test(e)===!1)throw Error("Expecting an integer");for(;Xu.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
|
|
123
123
|
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:ue(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Xu.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
|
|
124
124
|
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
125
|
-
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){let o=this.popChar();if(
|
|
126
|
-
`;function
|
|
125
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){let o=this.popChar();if(QN.test(o)===!1)throw Error("Expecting a HexDecimal digits");r+=o}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};var $n=class{visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};var Ju={},tP=new Bs;function qo(t){let e=t.toString();if(Ju.hasOwnProperty(e))return Ju[e];{let r=tP.pattern(e);return Ju[e]=r,r}}function dE(){Ju={}}var mE="Complement Sets are not supported for first char optimization",js=`Unable to use "first char" lexer optimizations:
|
|
126
|
+
`;function gE(t,e=!1){try{let r=qo(t);return Ap(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===mE)e&&Rs(`${js} Unable to optimize: < ${t.toString()} >
|
|
127
127
|
Complement Sets cannot be automatically optimized.
|
|
128
128
|
This will disable the lexer's first char optimizations.
|
|
129
129
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
|
|
@@ -131,48 +131,48 @@ ${e.fullCommandName}${r}
|
|
|
131
131
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Uo(`${js}
|
|
132
132
|
Failed parsing: < ${t.toString()} >
|
|
133
133
|
Using the @chevrotain/regexp-to-ast library
|
|
134
|
-
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function
|
|
135
|
-
`],tracer:(w,C)=>C()});let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{
|
|
134
|
+
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function Ap(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Ap(t.value[i],e,r);break;case"Alternative":let n=t.value;for(let i=0;i<n.length;i++){let o=n[i];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let s=o;switch(s.type){case"Character":Qu(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(mE);G(s.value,u=>{if(typeof u=="number")Qu(u,e,r);else{let l=u;if(r===!0)for(let c=l.from;c<=l.to;c++)Qu(c,e,r);else{for(let c=l.from;c<=l.to&&c<Vo;c++)Qu(c,e,r);if(l.to>=Vo){let c=l.from>=Vo?l.from:Vo,f=l.to,p=Gr(c),d=Gr(f);for(let m=p;m<=d;m++)e[m]=m}}}});break;case"Group":Ap(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}let a=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Cp(s)===!1||s.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Re(e)}function Qu(t,e,r){let n=Gr(t);e[n]=n,r===!0&&rP(t,e)}function rP(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=Gr(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=Gr(i.charCodeAt(0));e[o]=o}}}function hE(t,e){return Vr(t.value,r=>{if(typeof r=="number")return He(e,r);{let n=r;return Vr(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function Cp(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?J(t.value)?Dt(t.value,Cp):Cp(t.value):!1}var wp=class extends $n{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){He(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?hE(e,this.targetCharCodes)===void 0&&(this.found=!0):hE(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function el(t,e){if(e instanceof RegExp){let r=qo(e),n=new wp(t);return n.visit(r),n.found}else return Vr(e,r=>He(t,r.charCodeAt(0)))!==void 0}var Li="PATTERN",Go="defaultMode",tl="modes",Tp=typeof new RegExp("(?:)").sticky=="boolean";function bE(t,e){e=Bo(e,{useSticky:Tp,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
135
|
+
`],tracer:(w,C)=>C()});let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{EP()});let n;r("Reject Lexer.NA",()=>{n=zn(t,w=>w[Li]===Se.NA)});let i=!1,o;r("Transform Patterns",()=>{i=!1,o=q(n,w=>{let C=w[Li];if(gr(C)){let D=C.source;return D.length===1&&D!=="^"&&D!=="$"&&D!=="."&&!C.ignoreCase?D:D.length===2&&D[0]==="\\"&&!He(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],D[1])?D[1]:e.useSticky?yE(C):xE(C)}else{if(Bt(C))return i=!0,{exec:C};if(typeof C=="object")return i=!0,C;if(typeof C=="string"){if(C.length===1)return C;{let D=C.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),R=new RegExp(D);return e.useSticky?yE(R):xE(R)}}else throw Error("non exhaustive match")}})});let s,a,u,l,c;r("misc mapping",()=>{s=q(n,w=>w.tokenTypeIdx),a=q(n,w=>{let C=w.GROUP;if(C!==Se.SKIPPED){if(Et(C))return C;if(Ft(C))return!1;throw Error("non exhaustive match")}}),u=q(n,w=>{let C=w.LONGER_ALT;if(C)return J(C)?q(C,R=>Hu(n,R)):[Hu(n,C)]}),l=q(n,w=>w.PUSH_MODE),c=q(n,w=>Z(w,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{let w=SE(e.lineTerminatorCharacters);f=q(n,C=>!1),e.positionTracking!=="onlyOffset"&&(f=q(n,C=>Z(C,"LINE_BREAKS")?!!C.LINE_BREAKS:_E(C,w)===!1&&el(w,C.PATTERN)))});let p,d,m,y;r("Misc Mapping #2",()=>{p=q(n,kE),d=q(o,yP),m=mt(n,(w,C)=>{let D=C.GROUP;return Et(D)&&D!==Se.SKIPPED&&(w[D]=[]),w},{}),y=q(o,(w,C)=>({pattern:o[C],longerAlt:u[C],canLineTerminator:f[C],isCustom:p[C],short:d[C],group:a[C],push:l[C],pop:c[C],tokenTypeIdx:s[C],tokenType:n[C]}))});let g=!0,b=[];return e.safeMode||r("First Char Optimization",()=>{b=mt(n,(w,C,D)=>{if(typeof C.PATTERN=="string"){let R=C.PATTERN.charCodeAt(0),S=Gr(R);kp(w,S,y[D])}else if(J(C.START_CHARS_HINT)){let R;G(C.START_CHARS_HINT,S=>{let de=typeof S=="string"?S.charCodeAt(0):S,ye=Gr(de);R!==ye&&(R=ye,kp(w,ye,y[D]))})}else if(gr(C.PATTERN))if(C.PATTERN.unicode)g=!1,e.ensureOptimizations&&Uo(`${js} Unable to analyze < ${C.PATTERN.toString()} > pattern.
|
|
136
136
|
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
137
137
|
This will disable the lexer's first char optimizations.
|
|
138
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let R=
|
|
138
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let R=gE(C.PATTERN,e.ensureOptimizations);Te(R)&&(g=!1),G(R,S=>{kp(w,S,y[D])})}else e.ensureOptimizations&&Uo(`${js} TokenType: <${C.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
139
139
|
This will disable the lexer's first char optimizations.
|
|
140
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return w},[])}),{emptyGroups:m,patternIdxToConfig:y,charCodeToPatternIdxToConfig:b,hasCustom:i,canBeOptimized:g}}function
|
|
140
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return w},[])}),{emptyGroups:m,patternIdxToConfig:y,charCodeToPatternIdxToConfig:b,hasCustom:i,canBeOptimized:g}}function EE(t,e){let r=[],n=iP(t);r=r.concat(n.errors);let i=oP(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(nP(o)),r=r.concat(dP(o)),r=r.concat(hP(o,e)),r=r.concat(mP(o)),r}function nP(t){let e=[],r=Rt(t,n=>gr(n[Li]));return e=e.concat(aP(r)),e=e.concat(cP(r)),e=e.concat(fP(r)),e=e.concat(pP(r)),e=e.concat(uP(r)),e}function iP(t){let e=Rt(t,i=>!Z(i,Li)),r=q(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Ke.MISSING_PATTERN,tokenTypes:[i]})),n=Un(t,e);return{errors:r,valid:n}}function oP(t){let e=Rt(t,i=>{let o=i[Li];return!gr(o)&&!Bt(o)&&!Z(o,"exec")&&!Et(o)}),r=q(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Ke.INVALID_PATTERN,tokenTypes:[i]})),n=Un(t,e);return{errors:r,valid:n}}var sP=/[^\\][$]/;function aP(t){class e extends $n{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}let r=Rt(t,i=>{let o=i.PATTERN;try{let s=qo(o),a=new e;return a.visit(s),a.found}catch{return sP.test(o.source)}});return q(r,i=>({message:`Unexpected RegExp Anchor Error:
|
|
141
141
|
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
142
|
-
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ke.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function
|
|
142
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ke.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function uP(t){let e=Rt(t,n=>n.PATTERN.test(""));return q(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:Ke.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var lP=/[^\\[][\^]|^\^/;function cP(t){class e extends $n{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}let r=Rt(t,i=>{let o=i.PATTERN;try{let s=qo(o),a=new e;return a.visit(s),a.found}catch{return lP.test(o.source)}});return q(r,i=>({message:`Unexpected RegExp Anchor Error:
|
|
143
143
|
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
144
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ke.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function
|
|
144
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Ke.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function fP(t){let e=Rt(t,n=>{let i=n[Li];return i instanceof RegExp&&(i.multiline||i.global)});return q(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Ke.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function pP(t){let e=[],r=q(t,o=>mt(t,(s,a)=>(o.PATTERN.source===a.PATTERN.source&&!He(e,a)&&a.PATTERN!==Se.NA&&(e.push(a),s.push(a)),s),[]));r=$r(r);let n=Rt(r,o=>o.length>1);return q(n,o=>{let s=q(o,u=>u.name);return{message:`The same RegExp pattern ->${kt(o).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:Ke.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function dP(t){let e=Rt(t,n=>{if(!Z(n,"GROUP"))return!1;let i=n.GROUP;return i!==Se.SKIPPED&&i!==Se.NA&&!Et(i)});return q(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Ke.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function hP(t,e){let r=Rt(t,i=>i.PUSH_MODE!==void 0&&!He(e,i.PUSH_MODE));return q(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Ke.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function mP(t){let e=[],r=mt(t,(n,i,o)=>{let s=i.PATTERN;return s===Se.NA||(Et(s)?n.push({str:s,idx:o,tokenType:i}):gr(s)&&xP(s)&&n.push({str:s.source,idx:o,tokenType:i})),n},[]);return G(t,(n,i)=>{G(r,({str:o,idx:s,tokenType:a})=>{if(i<s&&gP(o,n.PATTERN)){let u=`Token: ->${a.name}<- can never be matched.
|
|
145
145
|
Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
|
|
146
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:u,type:Ke.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function
|
|
146
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:u,type:Ke.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function gP(t,e){if(gr(e)){let r=e.exec(t);return r!==null&&r.index===0}else{if(Bt(e))return e(t,0,[],{});if(Z(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function xP(t){return Vr([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function xE(t){let e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function yE(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function AE(t,e,r){let n=[];return Z(t,Go)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Go+`> property in its definition
|
|
147
147
|
`,type:Ke.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Z(t,tl)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+tl+`> property in its definition
|
|
148
148
|
`,type:Ke.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Z(t,tl)&&Z(t,Go)&&!Z(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${Go}: <${t.defaultMode}>which does not exist
|
|
149
149
|
`,type:Ke.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Z(t,tl)&&G(t.modes,(i,o)=>{G(i,(s,a)=>{if(Ft(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${o}> at index: <${a}>
|
|
150
150
|
`,type:Ke.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Z(s,"LONGER_ALT")){let u=J(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];G(u,l=>{!Ft(l)&&!He(i,l)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${s.name}> outside of mode <${o}>
|
|
151
|
-
`,type:Ke.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function
|
|
151
|
+
`,type:Ke.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function CE(t,e,r){let n=[],i=!1,o=$r(bt(Re(t.modes))),s=zn(o,u=>u[Li]===Se.NA),a=SE(r);return e&&G(s,u=>{let l=_E(u,a);if(l!==!1){let f={message:bP(u,l),type:l.issue,tokenType:u};n.push(f)}else Z(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):el(a,u.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
|
|
152
152
|
This Lexer has been defined to track line and column information,
|
|
153
153
|
But none of the Token Types can be identified as matching a line terminator.
|
|
154
154
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
155
|
-
for details.`,type:Ke.NO_LINE_BREAKS_FLAGS}),n}function
|
|
155
|
+
for details.`,type:Ke.NO_LINE_BREAKS_FLAGS}),n}function wE(t){let e={},r=Pe(t);return G(r,n=>{let i=t[n];if(J(i))e[n]=[];else throw Error("non exhaustive match")}),e}function kE(t){let e=t.PATTERN;if(gr(e))return!1;if(Bt(e))return!0;if(Z(e,"exec"))return!0;if(Et(e))return!1;throw Error("non exhaustive match")}function yP(t){return Et(t)&&t.length===1?t.charCodeAt(0):!1}var TE={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function _E(t,e){if(Z(t,"LINE_BREAKS"))return!1;if(gr(t.PATTERN)){try{el(e,t.PATTERN)}catch(r){return{issue:Ke.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(Et(t.PATTERN))return!1;if(kE(t))return{issue:Ke.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function bP(t,e){if(e.issue===Ke.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
156
156
|
The problem is in the <${t.name}> Token Type
|
|
157
157
|
Root cause: ${e.errMsg}.
|
|
158
158
|
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Ke.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
159
159
|
The problem is in the <${t.name}> Token Type
|
|
160
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function
|
|
161
|
-
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:
|
|
162
|
-
a boolean 2nd argument is no longer supported`);this.config=_t({},Us,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Us.lineTerminatorsPattern)this.config.lineTerminatorsPattern=
|
|
163
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),J(e)?i={modes:{defaultMode:Me(e)},defaultMode:Go}:(o=!1,i=Me(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(
|
|
160
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function SE(t){return q(t,r=>Et(r)?r.charCodeAt(0):r)}function kp(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var Vo=256,rl=[];function Gr(t){return t<Vo?t:rl[t]}function EP(){if(Te(rl)){rl=new Array(65536);for(let t=0;t<65536;t++)rl[t]=t>255?255+~~(t/255):t}}function cn(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function Wo(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var vE=1,OE={};function fn(t){let e=AP(t);CP(e),kP(e),wP(e),G(e,r=>{r.isParent=r.categoryMatches.length>0})}function AP(t){let e=Me(t),r=t,n=!0;for(;n;){r=$r(bt(q(r,o=>o.CATEGORIES)));let i=Un(r,e);e=e.concat(i),Te(i)?n=!1:r=i}return e}function CP(t){G(t,e=>{_p(e)||(OE[vE]=e,e.tokenTypeIdx=vE++),IE(e)&&!J(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),IE(e)||(e.CATEGORIES=[]),TP(e)||(e.categoryMatches=[]),_P(e)||(e.categoryMatchesMap={})})}function wP(t){G(t,e=>{e.categoryMatches=[],G(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(OE[n].tokenTypeIdx)})})}function kP(t){G(t,e=>{DE([],e)})}function DE(t,e){G(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),G(e.CATEGORIES,r=>{let n=t.concat(e);He(n,r)||DE(n,r)})}function _p(t){return Z(t,"tokenTypeIdx")}function IE(t){return Z(t,"CATEGORIES")}function TP(t){return Z(t,"categoryMatches")}function _P(t){return Z(t,"categoryMatchesMap")}function RE(t){return Z(t,"tokenTypeIdx")}var Sp={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var Ke;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Ke||(Ke={}));var Us={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
161
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Sp,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Us);var Se=class{constructor(e,r=Us){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);let{time:a,value:u}=Fs(o),l=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${s}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,u}else return o()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
162
|
+
a boolean 2nd argument is no longer supported`);this.config=_t({},Us,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Us.lineTerminatorsPattern)this.config.lineTerminatorsPattern=TE;else if(this.config.lineTerminatorCharacters===Us.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
163
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),J(e)?i={modes:{defaultMode:Me(e)},defaultMode:Go}:(o=!1,i=Me(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(AE(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(CE(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},G(i.modes,(a,u)=>{i.modes[u]=zn(a,l=>Ft(l))});let s=Pe(i.modes);if(G(i.modes,(a,u)=>{this.TRACE_INIT(`Mode: <${u}> processing`,()=>{if(this.modes.push(u),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(EE(a,s))}),Te(this.lexerDefinitionErrors)){fn(a);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=bE(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[u]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[u]=l.charCodeToPatternIdxToConfig,this.emptyGroups=_t({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[u]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Te(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let u=q(this.lexerDefinitionErrors,l=>l.message).join(`-----------------------
|
|
164
164
|
`);throw new Error(`Errors detected in definition of Lexer:
|
|
165
|
-
`+u)}G(this.lexerDefinitionWarning,a=>{Rs(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(
|
|
165
|
+
`+u)}G(this.lexerDefinitionWarning,a=>{Rs(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(Tp?(this.chopInput=hr,this.match=this.matchWithTest):(this.updateLastIndex=Xe,this.match=this.matchWithExec),o&&(this.handleModes=Xe),this.trackStartLines===!1&&(this.computeNewColumn=hr),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Xe),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let a=mt(this.canModeBeOptimized,(u,l,c)=>(l===!1&&u.push(c),u),[]);if(r.ensureOptimizations&&!Te(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
|
|
166
166
|
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
167
|
-
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{
|
|
167
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{dE()}),this.TRACE_INIT("toFastProperties",()=>{Ns(this)})})}tokenize(e,r=this.defaultMode){if(!Te(this.lexerDefinitionErrors)){let i=q(this.lexerDefinitionErrors,o=>o.message).join(`-----------------------
|
|
168
168
|
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
169
|
-
`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,s,a,u,l,c,f,p,d,m,y,g,b,w,C=e,D=C.length,R=0,S=0,de=this.hasCustom?0:Math.floor(e.length/10),ye=new Array(de),be=[],_=this.trackStartLines?1:void 0,L=this.trackStartLines?1:void 0,F=
|
|
170
|
-
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Z(t,
|
|
169
|
+
`+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,s,a,u,l,c,f,p,d,m,y,g,b,w,C=e,D=C.length,R=0,S=0,de=this.hasCustom?0:Math.floor(e.length/10),ye=new Array(de),be=[],_=this.trackStartLines?1:void 0,L=this.trackStartLines?1:void 0,F=wE(this.emptyGroups),v=this.trackStartLines,P=this.config.lineTerminatorsPattern,j=0,ae=[],ee=[],_e=[],it=[];Object.freeze(it);let x;function Ue(){return ae}function Qe(he){let oe=Gr(he),ce=ee[oe];return ce===void 0?it:ce}let E=he=>{if(_e.length===1&&he.tokenType.PUSH_MODE===void 0){let oe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(he);be.push({offset:he.startOffset,line:he.startLine,column:he.startColumn,length:he.image.length,message:oe})}else{_e.pop();let oe=qr(_e);ae=this.patternIdxToConfig[oe],ee=this.charCodeToPatternIdxToConfig[oe],j=ae.length;let ce=this.canModeBeOptimized[oe]&&this.config.safeMode===!1;ee&&ce?x=Qe:x=Ue}};function W(he){_e.push(he),ee=this.charCodeToPatternIdxToConfig[he],ae=this.patternIdxToConfig[he],j=ae.length,j=ae.length;let oe=this.canModeBeOptimized[he]&&this.config.safeMode===!1;ee&&oe?x=Qe:x=Ue}W.call(this,r);let Ye,ne=this.config.recoveryEnabled;for(;R<D;){u=null;let he=C.charCodeAt(R),oe=x(he),ce=oe.length;for(n=0;n<ce;n++){Ye=oe[n];let me=Ye.pattern;l=null;let we=Ye.short;if(we!==!1?he===we&&(u=me):Ye.isCustom===!0?(w=me.exec(C,R,ye,F),w!==null?(u=w[0],w.payload!==void 0&&(l=w.payload)):u=null):(this.updateLastIndex(me,R),u=this.match(me,e,R)),u!==null){if(a=Ye.longerAlt,a!==void 0){let Fe=a.length;for(o=0;o<Fe;o++){let ze=ae[a[o]],qt=ze.pattern;if(c=null,ze.isCustom===!0?(w=qt.exec(C,R,ye,F),w!==null?(s=w[0],w.payload!==void 0&&(c=w.payload)):s=null):(this.updateLastIndex(qt,R),s=this.match(qt,e,R)),s&&s.length>u.length){u=s,l=c,Ye=ze;break}}}break}}if(u!==null){if(f=u.length,p=Ye.group,p!==void 0&&(d=Ye.tokenTypeIdx,m=this.createTokenInstance(u,R,d,Ye.tokenType,_,L,f),this.handlePayload(m,l),p===!1?S=this.addToken(ye,S,m):F[p].push(m)),e=this.chopInput(e,f),R=R+f,L=this.computeNewColumn(L,f),v===!0&&Ye.canLineTerminator===!0){let me=0,we,Fe;P.lastIndex=0;do we=P.test(u),we===!0&&(Fe=P.lastIndex-1,me++);while(we===!0);me!==0&&(_=_+me,L=f-Fe,this.updateTokenEndLineColumnLocation(m,p,Fe,me,_,L,f))}this.handleModes(Ye,E,W,m)}else{let me=R,we=_,Fe=L,ze=ne===!1;for(;ze===!1&&R<D;)for(e=this.chopInput(e,1),R++,i=0;i<j;i++){let qt=ae[i],A=qt.pattern,k=qt.short;if(k!==!1?C.charCodeAt(R)===k&&(ze=!0):qt.isCustom===!0?ze=A.exec(C,R,ye,F)!==null:(this.updateLastIndex(A,R),ze=A.exec(e)!==null),ze===!0)break}if(y=R-me,L=this.computeNewColumn(L,y),b=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(C,me,y,we,Fe),be.push({offset:me,line:we,column:Fe,length:y,message:b}),ne===!1)break}}return this.hasCustom||(ye.length=S),{tokens:ye,groups:F,errors:be}}handleModes(e,r,n,i){if(e.pop===!0){let o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,r){return e.substring(r)}updateLastIndex(e,r){e.lastIndex=r}updateTokenEndLineColumnLocation(e,r,n,i,o,s,a){let u,l;r!==void 0&&(u=n===a-1,l=u?-1:0,i===1&&u===!0||(e.endLine=o+l,e.endColumn=s-1+-l))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,o,s){return{image:e,startOffset:r,startLine:o,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:r+a-1,startLine:o,endLine:o,startColumn:s,endColumn:s+a-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}matchWithTest(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchWithExec(e,r){let n=e.exec(r);return n!==null?n[0]:null}};Se.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";Se.NA=/NOT_APPLICABLE/;function Mi(t){return vp(t)?t.LABEL:t.name}function vp(t){return Et(t.LABEL)&&t.LABEL!==""}var SP="parent",FE="categories",NE="label",PE="group",LE="push_mode",ME="pop_mode",BE="longer_alt",jE="line_breaks",UE="start_chars_hint";function xe(t){return vP(t)}function vP(t){let e=t.pattern,r={};if(r.name=t.name,Ft(e)||(r.PATTERN=e),Z(t,SP))throw`The parent property is no longer supported.
|
|
170
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Z(t,FE)&&(r.CATEGORIES=t[FE]),fn([r]),Z(t,NE)&&(r.LABEL=t[NE]),Z(t,PE)&&(r.GROUP=t[PE]),Z(t,ME)&&(r.POP_MODE=t[ME]),Z(t,LE)&&(r.PUSH_MODE=t[LE]),Z(t,BE)&&(r.LONGER_ALT=t[BE]),Z(t,jE)&&(r.LINE_BREAKS=t[jE]),Z(t,UE)&&(r.START_CHARS_HINT=t[UE]),r}var Cr=xe({name:"EOF",pattern:Se.NA});fn([Cr]);function Bi(t,e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function Ip(t,e){return cn(t,e)}var nl={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${vp(t)?`--> ${Mi(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let o="Expecting: ",a=`
|
|
171
171
|
but found: '`+kt(e).image+"'";if(n)return o+n+a;{let u=mt(t,(p,d)=>p.concat(d),[]),l=q(u,p=>`[${q(p,d=>Mi(d)).join(", ")}]`),f=`one of these possible Token sequences:
|
|
172
172
|
${q(l,(p,d)=>` ${d+1}. ${p}`).join(`
|
|
173
173
|
`)}`;return o+f+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){let i="Expecting: ",s=`
|
|
174
174
|
but found: '`+kt(e).image+"'";if(r)return i+r+s;{let u=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
175
|
-
<${q(t,l=>`[${q(l,c=>Mi(c)).join(",")}]`).join(" ,")}>`;return i+u+s}}};Object.freeze(nl);var
|
|
175
|
+
<${q(t,l=>`[${q(l,c=>Mi(c)).join(",")}]`).join(" ,")}>`;return i+u+s}}};Object.freeze(nl);var zE={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
|
176
176
|
inside top level rule: ->`+t.name+"<-"}},wr={buildDuplicateFoundError(t,e){function r(c){return c instanceof Ie?c.terminalType.name:c instanceof Be?c.nonTerminalName:""}let n=t.name,i=kt(e),o=i.idx,s=Kt(i),a=r(i),u=o>0,l=`->${s}${u?o:""}<- ${a?`with argument: ->${a}<-`:""}
|
|
177
177
|
appears more than once (${e.length} times) in the top level rule: ->${n}<-.
|
|
178
178
|
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
@@ -197,51 +197,51 @@ rule: <${e}> can be invoked from itself (directly or indirectly)
|
|
|
197
197
|
without consuming any Tokens. The grammar path that causes this is:
|
|
198
198
|
${n}
|
|
199
199
|
To fix this refactor your grammar to remove the left recursion.
|
|
200
|
-
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Ut?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function UE(t,e){let r=new Ip(t,e);return r.resolveRefs(),r.errors}var Ip=class extends zt{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){G(Re(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:At.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var Op=class extends ln{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Me(this.path.ruleStack).reverse(),this.occurrenceStack=Me(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Te(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},il=class extends Op{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),o=new je({definition:i});this.possibleTokTypes=Ni(o),this.found=!0}}},Ho=class extends ln{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},ol=class extends Ho{walkMany(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},zs=class extends Ho{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},sl=class extends Ho{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},$s=class extends Ho{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function al(t,e,r=[]){r=Me(r);let n=[],i=0;function o(a){return a.concat(ut(t,i+1))}function s(a){let u=al(o(a),e,r);return n.concat(u)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof je)return s(a.definition);if(a instanceof Be)return s(a.definition);if(a instanceof Ge)n=s(a.definition);else if(a instanceof lt){let u=a.definition.concat([new De({definition:a.definition})]);return s(u)}else if(a instanceof ct){let u=[new je({definition:a.definition}),new De({definition:[new Ie({terminalType:a.separator})].concat(a.definition)})];return s(u)}else if(a instanceof rt){let u=a.definition.concat([new De({definition:[new Ie({terminalType:a.separator})].concat(a.definition)})]);n=s(u)}else if(a instanceof De){let u=a.definition.concat([new De({definition:a.definition})]);n=s(u)}else{if(a instanceof nt)return G(a.definition,u=>{Te(u.definition)===!1&&(n=s(u.definition))}),n;if(a instanceof Ie)r.push(a.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:ut(t,i)}),n}function ul(t,e,r,n){let i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE",a=!1,u=e.length,l=u-n-1,c=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Te(f);){let p=f.pop();if(p===s){a&&qr(f).idx<=l&&f.pop();continue}let d=p.def,m=p.idx,y=p.ruleStack,g=p.occurrenceStack;if(Te(d))continue;let b=d[0];if(b===i){let w={idx:m,def:ut(d),ruleStack:un(y),occurrenceStack:un(g)};f.push(w)}else if(b instanceof Ie)if(m<u-1){let w=m+1,C=e[w];if(r(C,b.terminalType)){let D={idx:w,def:ut(d),ruleStack:y,occurrenceStack:g};f.push(D)}}else if(m===u-1)c.push({nextTokenType:b.terminalType,nextTokenOccurrence:b.idx,ruleStack:y,occurrenceStack:g}),a=!0;else throw Error("non exhaustive match");else if(b instanceof Be){let w=Me(y);w.push(b.nonTerminalName);let C=Me(g);C.push(b.idx);let D={idx:m,def:b.definition.concat(o,ut(d)),ruleStack:w,occurrenceStack:C};f.push(D)}else if(b instanceof Ge){let w={idx:m,def:ut(d),ruleStack:y,occurrenceStack:g};f.push(w),f.push(s);let C={idx:m,def:b.definition.concat(ut(d)),ruleStack:y,occurrenceStack:g};f.push(C)}else if(b instanceof lt){let w=new De({definition:b.definition,idx:b.idx}),C=b.definition.concat([w],ut(d)),D={idx:m,def:C,ruleStack:y,occurrenceStack:g};f.push(D)}else if(b instanceof ct){let w=new Ie({terminalType:b.separator}),C=new De({definition:[w].concat(b.definition),idx:b.idx}),D=b.definition.concat([C],ut(d)),R={idx:m,def:D,ruleStack:y,occurrenceStack:g};f.push(R)}else if(b instanceof rt){let w={idx:m,def:ut(d),ruleStack:y,occurrenceStack:g};f.push(w),f.push(s);let C=new Ie({terminalType:b.separator}),D=new De({definition:[C].concat(b.definition),idx:b.idx}),R=b.definition.concat([D],ut(d)),S={idx:m,def:R,ruleStack:y,occurrenceStack:g};f.push(S)}else if(b instanceof De){let w={idx:m,def:ut(d),ruleStack:y,occurrenceStack:g};f.push(w),f.push(s);let C=new De({definition:b.definition,idx:b.idx}),D=b.definition.concat([C],ut(d)),R={idx:m,def:D,ruleStack:y,occurrenceStack:g};f.push(R)}else if(b instanceof nt)for(let w=b.definition.length-1;w>=0;w--){let C=b.definition[w],D={idx:m,def:C.definition.concat(ut(d)),ruleStack:y,occurrenceStack:g};f.push(D),f.push(s)}else if(b instanceof je)f.push({idx:m,def:b.definition.concat(ut(d)),ruleStack:y,occurrenceStack:g});else if(b instanceof Ut)f.push(_P(b,m,y,g));else throw Error("non exhaustive match")}return c}function _P(t,e,r,n){let i=Me(r);i.push(t.name);let o=Me(n);return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}var Je;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Je||(Je={}));function cl(t){if(t instanceof Ge||t==="Option")return Je.OPTION;if(t instanceof De||t==="Repetition")return Je.REPETITION;if(t instanceof lt||t==="RepetitionMandatory")return Je.REPETITION_MANDATORY;if(t instanceof ct||t==="RepetitionMandatoryWithSeparator")return Je.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof rt||t==="RepetitionWithSeparator")return Je.REPETITION_WITH_SEPARATOR;if(t instanceof nt||t==="Alternation")return Je.ALTERNATION;throw Error("non exhaustive match")}function $E(t,e,r,n,i,o){let s=qs(t,e,r),a=KE(s)?Wo:cn;return o(s,n,a,i)}function qE(t,e,r,n,i,o){let s=Vs(t,e,i,r),a=KE(s)?Wo:cn;return o(s[0],a,n)}function VE(t,e,r,n){let i=t.length,o=Dt(t,s=>Dt(s,a=>a.length===1));if(e)return function(s){let a=q(s,u=>u.GATE);for(let u=0;u<i;u++){let l=t[u],c=l.length,f=a[u];if(!(f!==void 0&&f.call(this)===!1))e:for(let p=0;p<c;p++){let d=l[p],m=d.length;for(let y=0;y<m;y++){let g=this.LA(y+1);if(r(g,d[y])===!1)continue e}return u}}};if(o&&!n){let s=q(t,u=>bt(u)),a=mt(s,(u,l,c)=>(G(l,f=>{Z(u,f.tokenTypeIdx)||(u[f.tokenTypeIdx]=c),G(f.categoryMatches,p=>{Z(u,p)||(u[p]=c)})}),u),{});return function(){let u=this.LA(1);return a[u.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let a=t[s],u=a.length;e:for(let l=0;l<u;l++){let c=a[l],f=c.length;for(let p=0;p<f;p++){let d=this.LA(p+1);if(r(d,c[p])===!1)continue e}return s}}}}function GE(t,e,r){let n=Dt(t,o=>o.length===1),i=t.length;if(n&&!r){let o=bt(t);if(o.length===1&&Te(o[0].categoryMatches)){let a=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{let s=mt(o,(a,u,l)=>(a[u.tokenTypeIdx]=!0,G(u.categoryMatches,c=>{a[c]=!0}),a),[]);return function(){let a=this.LA(1);return s[a.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let s=t[o],a=s.length;for(let u=0;u<a;u++){let l=this.LA(u+1);if(e(l,s[u])===!1)continue e}return!0}return!1}}var Rp=class extends ln{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,Je.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,Je.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,Je.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,Je.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,Je.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},ll=class extends zt{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Je.OPTION)}visitRepetition(e){this.checkIsTarget(e,Je.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Je.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Je.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Je.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Je.ALTERNATION)}};function zE(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function Dp(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let o=0;o<e.length;o++){let s=e[o];i.push(s+"_"+n.tokenTypeIdx);for(let a=0;a<n.categoryMatches.length;a++){let u="_"+n.categoryMatches[a];i.push(s+u)}}e=i}return e}function SP(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let o=0;o<e.length;o++){let s=e[o];if(i[s]===!0)return!1}}return!0}function WE(t,e){let r=q(t,s=>al([s],1)),n=zE(r.length),i=q(r,s=>{let a={};return G(s,u=>{let l=Dp(u.partialPath);G(l,c=>{a[c]=!0})}),a}),o=r;for(let s=1;s<=e;s++){let a=o;o=zE(a.length);for(let u=0;u<a.length;u++){let l=a[u];for(let c=0;c<l.length;c++){let f=l[c].partialPath,p=l[c].suffixDef,d=Dp(f);if(SP(i,d,u)||Te(p)||f.length===e){let y=n[u];if(fl(y,f)===!1){y.push(f);for(let g=0;g<d.length;g++){let b=d[g];i[u][b]=!0}}}else{let y=al(p,s+1,f);o[u]=o[u].concat(y),G(y,g=>{let b=Dp(g.partialPath);G(b,w=>{i[u][w]=!0})})}}}}return n}function qs(t,e,r,n){let i=new ll(t,Je.ALTERNATION,n);return e.accept(i),WE(i.result,r)}function Vs(t,e,r,n){let i=new ll(t,r);e.accept(i);let o=i.result,a=new Rp(e,t,r).startWalking(),u=new je({definition:o}),l=new je({definition:a});return WE([u,l],n)}function fl(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let o=e[i],s=n[i];if((o===s||s.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function HE(t,e){return t.length<e.length&&Dt(t,(r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function KE(t){return Dt(t,e=>Dt(e,r=>Dt(r,n=>Te(n.categoryMatches))))}function YE(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return q(e,r=>Object.assign({type:At.CUSTOM_LOOKAHEAD_VALIDATION},r))}function ZE(t,e,r,n){let i=jt(t,u=>vP(u,r)),o=NP(t,e,r),s=jt(t,u=>DP(u,r)),a=jt(t,u=>OP(u,t,n,r));return i.concat(o,s,a)}function vP(t,e){let r=new Fp;t.accept(r);let n=r.allProductions,i=hp(n,IP),o=Ht(i,a=>a.length>1);return q(Re(o),a=>{let u=kt(a),l=e.buildDuplicateFoundError(t,a),c=Kt(u),f={message:l,type:At.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:c,occurrence:u.idx},p=XE(u);return p&&(f.parameter=p),f})}function IP(t){return`${Kt(t)}_#_${t.idx}_#_${XE(t)}`}function XE(t){return t instanceof Ie?t.terminalType.name:t instanceof Be?t.nonTerminalName:""}var Fp=class extends zt{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function OP(t,e,r,n){let i=[];if(mt(e,(s,a)=>a.name===t.name?s+1:s,0)>1){let s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:At.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function JE(t,e,r){let n=[],i;return He(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:At.INVALID_RULE_OVERRIDE,ruleName:t})),n}function Pp(t,e,r,n=[]){let i=[],o=pl(e.definition);if(Te(o))return[];{let s=t.name;He(o,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:At.LEFT_RECURSION,ruleName:s});let u=Un(o,n.concat([t])),l=jt(u,c=>{let f=Me(n);return f.push(c),Pp(t,c,r,f)});return i.concat(l)}}function pl(t){let e=[];if(Te(t))return e;let r=kt(t);if(r instanceof Be)e.push(r.referencedRule);else if(r instanceof je||r instanceof Ge||r instanceof lt||r instanceof ct||r instanceof rt||r instanceof De)e=e.concat(pl(r.definition));else if(r instanceof nt)e=bt(q(r.definition,o=>pl(o.definition)));else if(!(r instanceof Ie))throw Error("non exhaustive match");let n=Fi(r),i=t.length>1;if(n&&i){let o=ut(t);return e.concat(pl(o))}else return e}var Gs=class extends zt{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function QE(t,e){let r=new Gs;t.accept(r);let n=r.alternations;return jt(n,o=>{let s=un(o.definition);return jt(s,(a,u)=>{let l=ul([a],[],cn,1);return Te(l)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:u}),type:At.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:u+1}]:[]})})}function eA(t,e,r){let n=new Gs;t.accept(n);let i=n.alternations;return i=zn(i,s=>s.ignoreAmbiguities===!0),jt(i,s=>{let a=s.idx,u=s.maxLookahead||e,l=qs(a,t,u,s),c=RP(l,s,t,r),f=FP(l,s,t,r);return c.concat(f)})}var Np=class extends zt{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function DP(t,e){let r=new Gs;t.accept(r);let n=r.alternations;return jt(n,o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:At.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function tA(t,e,r){let n=[];return G(t,i=>{let o=new Np;i.accept(o);let s=o.allProductions;G(s,a=>{let u=cl(a),l=a.maxLookahead||e,c=a.idx,p=Vs(c,i,u,l)[0];if(Te(bt(p))){let d=r.buildEmptyRepetitionError({topLevelRule:i,repetition:a});n.push({message:d,type:At.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function RP(t,e,r,n){let i=[],o=mt(t,(a,u,l)=>(e.definition[l].ignoreAmbiguities===!0||G(u,c=>{let f=[l];G(t,(p,d)=>{l!==d&&fl(p,c)&&e.definition[d].ignoreAmbiguities!==!0&&f.push(d)}),f.length>1&&!fl(i,c)&&(i.push(c),a.push({alts:f,path:c}))}),a),[]);return q(o,a=>{let u=q(a.alts,c=>c+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:u,prefixPath:a.path}),type:At.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function FP(t,e,r,n){let i=mt(t,(s,a,u)=>{let l=q(a,c=>({idx:u,path:c}));return s.concat(l)},[]);return $r(jt(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];let u=s.idx,l=s.path,c=Rt(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<u&&HE(p.path,l));return q(c,p=>{let d=[p.idx+1,u+1],m=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:d,prefixPath:p.path}),type:At.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:m,alternatives:d}})}))}function NP(t,e,r){let n=[],i=q(e,o=>o.name);return G(t,o=>{let s=o.name;if(He(i,s)){let a=r.buildNamespaceConflictError(o);n.push({message:a,type:At.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function rA(t){let e=Bo(t,{errMsgProvider:jE}),r={};return G(t.rules,n=>{r[n.name]=n}),UE(r,e.errMsgProvider)}function nA(t){return t=Bo(t,{errMsgProvider:wr}),ZE(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var iA="MismatchedTokenException",oA="NoViableAltException",sA="EarlyExitException",aA="NotAllInputParsedException",uA=[iA,oA,sA,aA];Object.freeze(uA);function qn(t){return He(uA,t.name)}var Ko=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},ji=class extends Ko{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=iA}},Ws=class extends Ko{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=oA}},Hs=class extends Ko{constructor(e,r){super(e,r),this.name=aA}},Ks=class extends Ko{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=sA}};var Lp={},Bp="InRuleRecoveryException",Mp=class extends Error{constructor(e){super(e),this.name=Bp}},dl=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Z(e,"recoveryEnabled")?e.recoveryEnabled:$t.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=PP)}getTokenToInsert(e){let r=Bi(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],u=!1,l=this.LA(1),c=this.LA(1),f=()=>{let p=this.LA(0),d=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:p,ruleName:this.getCurrRuleFullName()}),m=new ji(d,l,this.LA(0));m.resyncedTokens=un(a),this.SAVE_ERROR(m)};for(;!u;)if(this.tokenMatcher(c,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(c,o)?u=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Mp("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Te(r))return!1;let n=this.LA(1);return Vr(r,o=>this.tokenMatcher(n,o))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return He(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=Vr(e,o=>vp(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Lp;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return q(e,(n,i)=>i===0?Lp:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=q(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return bt(e)}getFollowSetFromFollowKey(e){if(e===Lp)return[Cr];let r=e.ruleName+e.idxInCallingRule+Yu+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Cr)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return un(r)}attemptInRepetitionRecovery(e,r,n,i,o,s,a){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=Me(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return q(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function PP(t,e,r,n,i,o,s){let a=this.getKeyForAutomaticLookahead(n,i),u=this.firstAfterRepMap[a];if(u===void 0){let p=this.getCurrRuleFullName(),d=this.getGAstProductions()[p];u=new o(d,i).startWalking(),this.firstAfterRepMap[a]=u}let l=u.token,c=u.occurrence,f=u.isEndOfRule;this.RULE_STACK.length===1&&f&&l===void 0&&(l=Cr,c=1),!(l===void 0||c===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,c,s)&&this.tryInRepetitionRecovery(t,e,r,l)}function hl(t,e,r){return r|e|t}var Ys=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:$t.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(Te(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...o]}return r}validateNoLeftRecursion(e){return jt(e,r=>Pp(r,r,wr))}validateEmptyOrAlternatives(e){return jt(e,r=>QE(r,wr))}validateAmbiguousAlternationAlternatives(e,r){return jt(e,n=>eA(n,r,wr))}validateSomeNonEmptyLookaheadPath(e,r){return tA(e,r,wr)}buildLookaheadForAlternation(e){return $E(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,VE)}buildLookaheadForOptional(e){return qE(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,cl(e.prodType),GE)}};var gl=class{initLooksAhead(e){this.dynamicTokensEnabled=Z(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:$t.dynamicTokensEnabled,this.maxLookahead=Z(e,"maxLookahead")?e.maxLookahead:$t.maxLookahead,this.lookaheadStrategy=Z(e,"lookaheadStrategy")?e.lookaheadStrategy:new Ys({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){G(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:o,repetitionMandatory:s,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:u}=LP(r);G(n,l=>{let c=l.idx===0?"":l.idx;this.TRACE_INIT(`${Kt(l)}${c}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=hl(this.fullRuleNameToShort[r.name],256,l.idx);this.setLaFuncCache(p,f)})}),G(i,l=>{this.computeLookaheadFunc(r,l.idx,768,"Repetition",l.maxLookahead,Kt(l))}),G(o,l=>{this.computeLookaheadFunc(r,l.idx,512,"Option",l.maxLookahead,Kt(l))}),G(s,l=>{this.computeLookaheadFunc(r,l.idx,1024,"RepetitionMandatory",l.maxLookahead,Kt(l))}),G(a,l=>{this.computeLookaheadFunc(r,l.idx,1536,"RepetitionMandatoryWithSeparator",l.maxLookahead,Kt(l))}),G(u,l=>{this.computeLookaheadFunc(r,l.idx,1280,"RepetitionWithSeparator",l.maxLookahead,Kt(l))})})})}computeLookaheadFunc(e,r,n,i,o,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),u=hl(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(u,a)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return hl(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},jp=class extends zt{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},ml=new jp;function LP(t){ml.reset(),t.accept(ml);let e=ml.dslMethods;return ml.reset(),e}function $p(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function qp(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function lA(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function cA(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var MP="name";function Vp(t,e){Object.defineProperty(t,MP,{enumerable:!1,configurable:!0,writable:!1,value:e})}function BP(t,e){let r=Pe(t),n=r.length;for(let i=0;i<n;i++){let o=r[i],s=t[o],a=s.length;for(let u=0;u<a;u++){let l=s[u];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function fA(t,e){let r=function(){};Vp(r,t+"BaseSemantics");let n={visit:function(i,o){if(J(i)&&(i=i[0]),!Ft(i))return this[i.name](i.children,o)},validateVisitor:function(){let i=jP(this,e);if(!Te(i)){let o=q(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
200
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Ut?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function $E(t,e){let r=new Op(t,e);return r.resolveRefs(),r.errors}var Op=class extends zt{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){G(Re(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:At.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var Dp=class extends ln{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Me(this.path.ruleStack).reverse(),this.occurrenceStack=Me(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Te(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},il=class extends Dp{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),o=new je({definition:i});this.possibleTokTypes=Ni(o),this.found=!0}}},Ho=class extends ln{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},ol=class extends Ho{walkMany(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},zs=class extends Ho{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},sl=class extends Ho{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},$s=class extends Ho{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function al(t,e,r=[]){r=Me(r);let n=[],i=0;function o(a){return a.concat(ut(t,i+1))}function s(a){let u=al(o(a),e,r);return n.concat(u)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof je)return s(a.definition);if(a instanceof Be)return s(a.definition);if(a instanceof Ge)n=s(a.definition);else if(a instanceof lt){let u=a.definition.concat([new De({definition:a.definition})]);return s(u)}else if(a instanceof ct){let u=[new je({definition:a.definition}),new De({definition:[new Ie({terminalType:a.separator})].concat(a.definition)})];return s(u)}else if(a instanceof rt){let u=a.definition.concat([new De({definition:[new Ie({terminalType:a.separator})].concat(a.definition)})]);n=s(u)}else if(a instanceof De){let u=a.definition.concat([new De({definition:a.definition})]);n=s(u)}else{if(a instanceof nt)return G(a.definition,u=>{Te(u.definition)===!1&&(n=s(u.definition))}),n;if(a instanceof Ie)r.push(a.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:ut(t,i)}),n}function ul(t,e,r,n){let i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE",a=!1,u=e.length,l=u-n-1,c=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Te(f);){let p=f.pop();if(p===s){a&&qr(f).idx<=l&&f.pop();continue}let d=p.def,m=p.idx,y=p.ruleStack,g=p.occurrenceStack;if(Te(d))continue;let b=d[0];if(b===i){let w={idx:m,def:ut(d),ruleStack:un(y),occurrenceStack:un(g)};f.push(w)}else if(b instanceof Ie)if(m<u-1){let w=m+1,C=e[w];if(r(C,b.terminalType)){let D={idx:w,def:ut(d),ruleStack:y,occurrenceStack:g};f.push(D)}}else if(m===u-1)c.push({nextTokenType:b.terminalType,nextTokenOccurrence:b.idx,ruleStack:y,occurrenceStack:g}),a=!0;else throw Error("non exhaustive match");else if(b instanceof Be){let w=Me(y);w.push(b.nonTerminalName);let C=Me(g);C.push(b.idx);let D={idx:m,def:b.definition.concat(o,ut(d)),ruleStack:w,occurrenceStack:C};f.push(D)}else if(b instanceof Ge){let w={idx:m,def:ut(d),ruleStack:y,occurrenceStack:g};f.push(w),f.push(s);let C={idx:m,def:b.definition.concat(ut(d)),ruleStack:y,occurrenceStack:g};f.push(C)}else if(b instanceof lt){let w=new De({definition:b.definition,idx:b.idx}),C=b.definition.concat([w],ut(d)),D={idx:m,def:C,ruleStack:y,occurrenceStack:g};f.push(D)}else if(b instanceof ct){let w=new Ie({terminalType:b.separator}),C=new De({definition:[w].concat(b.definition),idx:b.idx}),D=b.definition.concat([C],ut(d)),R={idx:m,def:D,ruleStack:y,occurrenceStack:g};f.push(R)}else if(b instanceof rt){let w={idx:m,def:ut(d),ruleStack:y,occurrenceStack:g};f.push(w),f.push(s);let C=new Ie({terminalType:b.separator}),D=new De({definition:[C].concat(b.definition),idx:b.idx}),R=b.definition.concat([D],ut(d)),S={idx:m,def:R,ruleStack:y,occurrenceStack:g};f.push(S)}else if(b instanceof De){let w={idx:m,def:ut(d),ruleStack:y,occurrenceStack:g};f.push(w),f.push(s);let C=new De({definition:b.definition,idx:b.idx}),D=b.definition.concat([C],ut(d)),R={idx:m,def:D,ruleStack:y,occurrenceStack:g};f.push(R)}else if(b instanceof nt)for(let w=b.definition.length-1;w>=0;w--){let C=b.definition[w],D={idx:m,def:C.definition.concat(ut(d)),ruleStack:y,occurrenceStack:g};f.push(D),f.push(s)}else if(b instanceof je)f.push({idx:m,def:b.definition.concat(ut(d)),ruleStack:y,occurrenceStack:g});else if(b instanceof Ut)f.push(IP(b,m,y,g));else throw Error("non exhaustive match")}return c}function IP(t,e,r,n){let i=Me(r);i.push(t.name);let o=Me(n);return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}var Je;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Je||(Je={}));function cl(t){if(t instanceof Ge||t==="Option")return Je.OPTION;if(t instanceof De||t==="Repetition")return Je.REPETITION;if(t instanceof lt||t==="RepetitionMandatory")return Je.REPETITION_MANDATORY;if(t instanceof ct||t==="RepetitionMandatoryWithSeparator")return Je.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof rt||t==="RepetitionWithSeparator")return Je.REPETITION_WITH_SEPARATOR;if(t instanceof nt||t==="Alternation")return Je.ALTERNATION;throw Error("non exhaustive match")}function VE(t,e,r,n,i,o){let s=qs(t,e,r),a=ZE(s)?Wo:cn;return o(s,n,a,i)}function GE(t,e,r,n,i,o){let s=Vs(t,e,i,r),a=ZE(s)?Wo:cn;return o(s[0],a,n)}function WE(t,e,r,n){let i=t.length,o=Dt(t,s=>Dt(s,a=>a.length===1));if(e)return function(s){let a=q(s,u=>u.GATE);for(let u=0;u<i;u++){let l=t[u],c=l.length,f=a[u];if(!(f!==void 0&&f.call(this)===!1))e:for(let p=0;p<c;p++){let d=l[p],m=d.length;for(let y=0;y<m;y++){let g=this.LA(y+1);if(r(g,d[y])===!1)continue e}return u}}};if(o&&!n){let s=q(t,u=>bt(u)),a=mt(s,(u,l,c)=>(G(l,f=>{Z(u,f.tokenTypeIdx)||(u[f.tokenTypeIdx]=c),G(f.categoryMatches,p=>{Z(u,p)||(u[p]=c)})}),u),{});return function(){let u=this.LA(1);return a[u.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let a=t[s],u=a.length;e:for(let l=0;l<u;l++){let c=a[l],f=c.length;for(let p=0;p<f;p++){let d=this.LA(p+1);if(r(d,c[p])===!1)continue e}return s}}}}function HE(t,e,r){let n=Dt(t,o=>o.length===1),i=t.length;if(n&&!r){let o=bt(t);if(o.length===1&&Te(o[0].categoryMatches)){let a=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{let s=mt(o,(a,u,l)=>(a[u.tokenTypeIdx]=!0,G(u.categoryMatches,c=>{a[c]=!0}),a),[]);return function(){let a=this.LA(1);return s[a.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let s=t[o],a=s.length;for(let u=0;u<a;u++){let l=this.LA(u+1);if(e(l,s[u])===!1)continue e}return!0}return!1}}var Fp=class extends ln{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,Je.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,Je.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,Je.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,Je.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,Je.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},ll=class extends zt{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Je.OPTION)}visitRepetition(e){this.checkIsTarget(e,Je.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Je.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Je.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Je.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Je.ALTERNATION)}};function qE(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function Rp(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let o=0;o<e.length;o++){let s=e[o];i.push(s+"_"+n.tokenTypeIdx);for(let a=0;a<n.categoryMatches.length;a++){let u="_"+n.categoryMatches[a];i.push(s+u)}}e=i}return e}function OP(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let o=0;o<e.length;o++){let s=e[o];if(i[s]===!0)return!1}}return!0}function KE(t,e){let r=q(t,s=>al([s],1)),n=qE(r.length),i=q(r,s=>{let a={};return G(s,u=>{let l=Rp(u.partialPath);G(l,c=>{a[c]=!0})}),a}),o=r;for(let s=1;s<=e;s++){let a=o;o=qE(a.length);for(let u=0;u<a.length;u++){let l=a[u];for(let c=0;c<l.length;c++){let f=l[c].partialPath,p=l[c].suffixDef,d=Rp(f);if(OP(i,d,u)||Te(p)||f.length===e){let y=n[u];if(fl(y,f)===!1){y.push(f);for(let g=0;g<d.length;g++){let b=d[g];i[u][b]=!0}}}else{let y=al(p,s+1,f);o[u]=o[u].concat(y),G(y,g=>{let b=Rp(g.partialPath);G(b,w=>{i[u][w]=!0})})}}}}return n}function qs(t,e,r,n){let i=new ll(t,Je.ALTERNATION,n);return e.accept(i),KE(i.result,r)}function Vs(t,e,r,n){let i=new ll(t,r);e.accept(i);let o=i.result,a=new Fp(e,t,r).startWalking(),u=new je({definition:o}),l=new je({definition:a});return KE([u,l],n)}function fl(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let o=e[i],s=n[i];if((o===s||s.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function YE(t,e){return t.length<e.length&&Dt(t,(r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function ZE(t){return Dt(t,e=>Dt(e,r=>Dt(r,n=>Te(n.categoryMatches))))}function XE(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return q(e,r=>Object.assign({type:At.CUSTOM_LOOKAHEAD_VALIDATION},r))}function JE(t,e,r,n){let i=jt(t,u=>DP(u,r)),o=MP(t,e,r),s=jt(t,u=>NP(u,r)),a=jt(t,u=>FP(u,t,n,r));return i.concat(o,s,a)}function DP(t,e){let r=new Np;t.accept(r);let n=r.allProductions,i=mp(n,RP),o=Ht(i,a=>a.length>1);return q(Re(o),a=>{let u=kt(a),l=e.buildDuplicateFoundError(t,a),c=Kt(u),f={message:l,type:At.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:c,occurrence:u.idx},p=QE(u);return p&&(f.parameter=p),f})}function RP(t){return`${Kt(t)}_#_${t.idx}_#_${QE(t)}`}function QE(t){return t instanceof Ie?t.terminalType.name:t instanceof Be?t.nonTerminalName:""}var Np=class extends zt{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function FP(t,e,r,n){let i=[];if(mt(e,(s,a)=>a.name===t.name?s+1:s,0)>1){let s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:At.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function eA(t,e,r){let n=[],i;return He(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:At.INVALID_RULE_OVERRIDE,ruleName:t})),n}function Lp(t,e,r,n=[]){let i=[],o=pl(e.definition);if(Te(o))return[];{let s=t.name;He(o,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:At.LEFT_RECURSION,ruleName:s});let u=Un(o,n.concat([t])),l=jt(u,c=>{let f=Me(n);return f.push(c),Lp(t,c,r,f)});return i.concat(l)}}function pl(t){let e=[];if(Te(t))return e;let r=kt(t);if(r instanceof Be)e.push(r.referencedRule);else if(r instanceof je||r instanceof Ge||r instanceof lt||r instanceof ct||r instanceof rt||r instanceof De)e=e.concat(pl(r.definition));else if(r instanceof nt)e=bt(q(r.definition,o=>pl(o.definition)));else if(!(r instanceof Ie))throw Error("non exhaustive match");let n=Fi(r),i=t.length>1;if(n&&i){let o=ut(t);return e.concat(pl(o))}else return e}var Gs=class extends zt{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function tA(t,e){let r=new Gs;t.accept(r);let n=r.alternations;return jt(n,o=>{let s=un(o.definition);return jt(s,(a,u)=>{let l=ul([a],[],cn,1);return Te(l)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:u}),type:At.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:u+1}]:[]})})}function rA(t,e,r){let n=new Gs;t.accept(n);let i=n.alternations;return i=zn(i,s=>s.ignoreAmbiguities===!0),jt(i,s=>{let a=s.idx,u=s.maxLookahead||e,l=qs(a,t,u,s),c=PP(l,s,t,r),f=LP(l,s,t,r);return c.concat(f)})}var Pp=class extends zt{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function NP(t,e){let r=new Gs;t.accept(r);let n=r.alternations;return jt(n,o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:At.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function nA(t,e,r){let n=[];return G(t,i=>{let o=new Pp;i.accept(o);let s=o.allProductions;G(s,a=>{let u=cl(a),l=a.maxLookahead||e,c=a.idx,p=Vs(c,i,u,l)[0];if(Te(bt(p))){let d=r.buildEmptyRepetitionError({topLevelRule:i,repetition:a});n.push({message:d,type:At.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function PP(t,e,r,n){let i=[],o=mt(t,(a,u,l)=>(e.definition[l].ignoreAmbiguities===!0||G(u,c=>{let f=[l];G(t,(p,d)=>{l!==d&&fl(p,c)&&e.definition[d].ignoreAmbiguities!==!0&&f.push(d)}),f.length>1&&!fl(i,c)&&(i.push(c),a.push({alts:f,path:c}))}),a),[]);return q(o,a=>{let u=q(a.alts,c=>c+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:u,prefixPath:a.path}),type:At.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function LP(t,e,r,n){let i=mt(t,(s,a,u)=>{let l=q(a,c=>({idx:u,path:c}));return s.concat(l)},[]);return $r(jt(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];let u=s.idx,l=s.path,c=Rt(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<u&&YE(p.path,l));return q(c,p=>{let d=[p.idx+1,u+1],m=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:d,prefixPath:p.path}),type:At.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:m,alternatives:d}})}))}function MP(t,e,r){let n=[],i=q(e,o=>o.name);return G(t,o=>{let s=o.name;if(He(i,s)){let a=r.buildNamespaceConflictError(o);n.push({message:a,type:At.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function iA(t){let e=Bo(t,{errMsgProvider:zE}),r={};return G(t.rules,n=>{r[n.name]=n}),$E(r,e.errMsgProvider)}function oA(t){return t=Bo(t,{errMsgProvider:wr}),JE(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var sA="MismatchedTokenException",aA="NoViableAltException",uA="EarlyExitException",lA="NotAllInputParsedException",cA=[sA,aA,uA,lA];Object.freeze(cA);function qn(t){return He(cA,t.name)}var Ko=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},ji=class extends Ko{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=sA}},Ws=class extends Ko{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=aA}},Hs=class extends Ko{constructor(e,r){super(e,r),this.name=lA}},Ks=class extends Ko{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=uA}};var Mp={},jp="InRuleRecoveryException",Bp=class extends Error{constructor(e){super(e),this.name=jp}},dl=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Z(e,"recoveryEnabled")?e.recoveryEnabled:$t.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=BP)}getTokenToInsert(e){let r=Bi(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],u=!1,l=this.LA(1),c=this.LA(1),f=()=>{let p=this.LA(0),d=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:p,ruleName:this.getCurrRuleFullName()}),m=new ji(d,l,this.LA(0));m.resyncedTokens=un(a),this.SAVE_ERROR(m)};for(;!u;)if(this.tokenMatcher(c,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(c,o)?u=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Bp("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Te(r))return!1;let n=this.LA(1);return Vr(r,o=>this.tokenMatcher(n,o))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return He(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=Vr(e,o=>Ip(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Mp;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return q(e,(n,i)=>i===0?Mp:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=q(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return bt(e)}getFollowSetFromFollowKey(e){if(e===Mp)return[Cr];let r=e.ruleName+e.idxInCallingRule+Yu+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Cr)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return un(r)}attemptInRepetitionRecovery(e,r,n,i,o,s,a){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=Me(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return q(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function BP(t,e,r,n,i,o,s){let a=this.getKeyForAutomaticLookahead(n,i),u=this.firstAfterRepMap[a];if(u===void 0){let p=this.getCurrRuleFullName(),d=this.getGAstProductions()[p];u=new o(d,i).startWalking(),this.firstAfterRepMap[a]=u}let l=u.token,c=u.occurrence,f=u.isEndOfRule;this.RULE_STACK.length===1&&f&&l===void 0&&(l=Cr,c=1),!(l===void 0||c===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,c,s)&&this.tryInRepetitionRecovery(t,e,r,l)}function hl(t,e,r){return r|e|t}var Ys=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:$t.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(Te(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...o]}return r}validateNoLeftRecursion(e){return jt(e,r=>Lp(r,r,wr))}validateEmptyOrAlternatives(e){return jt(e,r=>tA(r,wr))}validateAmbiguousAlternationAlternatives(e,r){return jt(e,n=>rA(n,r,wr))}validateSomeNonEmptyLookaheadPath(e,r){return nA(e,r,wr)}buildLookaheadForAlternation(e){return VE(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,WE)}buildLookaheadForOptional(e){return GE(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,cl(e.prodType),HE)}};var gl=class{initLooksAhead(e){this.dynamicTokensEnabled=Z(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:$t.dynamicTokensEnabled,this.maxLookahead=Z(e,"maxLookahead")?e.maxLookahead:$t.maxLookahead,this.lookaheadStrategy=Z(e,"lookaheadStrategy")?e.lookaheadStrategy:new Ys({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){G(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:o,repetitionMandatory:s,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:u}=jP(r);G(n,l=>{let c=l.idx===0?"":l.idx;this.TRACE_INIT(`${Kt(l)}${c}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=hl(this.fullRuleNameToShort[r.name],256,l.idx);this.setLaFuncCache(p,f)})}),G(i,l=>{this.computeLookaheadFunc(r,l.idx,768,"Repetition",l.maxLookahead,Kt(l))}),G(o,l=>{this.computeLookaheadFunc(r,l.idx,512,"Option",l.maxLookahead,Kt(l))}),G(s,l=>{this.computeLookaheadFunc(r,l.idx,1024,"RepetitionMandatory",l.maxLookahead,Kt(l))}),G(a,l=>{this.computeLookaheadFunc(r,l.idx,1536,"RepetitionMandatoryWithSeparator",l.maxLookahead,Kt(l))}),G(u,l=>{this.computeLookaheadFunc(r,l.idx,1280,"RepetitionWithSeparator",l.maxLookahead,Kt(l))})})})}computeLookaheadFunc(e,r,n,i,o,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),u=hl(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(u,a)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return hl(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},Up=class extends zt{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},ml=new Up;function jP(t){ml.reset(),t.accept(ml);let e=ml.dslMethods;return ml.reset(),e}function qp(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Vp(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function fA(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function pA(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var UP="name";function Gp(t,e){Object.defineProperty(t,UP,{enumerable:!1,configurable:!0,writable:!1,value:e})}function zP(t,e){let r=Pe(t),n=r.length;for(let i=0;i<n;i++){let o=r[i],s=t[o],a=s.length;for(let u=0;u<a;u++){let l=s[u];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function dA(t,e){let r=function(){};Gp(r,t+"BaseSemantics");let n={visit:function(i,o){if(J(i)&&(i=i[0]),!Ft(i))return this[i.name](i.children,o)},validateVisitor:function(){let i=$P(this,e);if(!Te(i)){let o=q(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
201
201
|
${o.join(`
|
|
202
202
|
|
|
203
203
|
`).replace(/\n/g,`
|
|
204
|
-
`)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function
|
|
204
|
+
`)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function hA(t,e,r){let n=function(){};Gp(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return G(e,o=>{i[o]=zP}),n.prototype=i,n.prototype.constructor=n,n}var Wp;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Wp||(Wp={}));function $P(t,e){return qP(t,e)}function qP(t,e){let r=Rt(e,i=>Bt(t[i])===!1),n=q(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Wp.MISSING_METHOD,methodName:i}));return $r(n)}var El=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Z(e,"nodeLocationTracking")?e.nodeLocationTracking:$t.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Xe,this.cstFinallyStateUpdate=Xe,this.cstPostTerminal=Xe,this.cstPostNonTerminal=Xe,this.cstPostRule=Xe;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Vp,this.setNodeLocationFromNode=Vp,this.cstPostRule=Xe,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Xe,this.setNodeLocationFromNode=Xe,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=qp,this.setNodeLocationFromNode=qp,this.cstPostRule=Xe,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Xe,this.setNodeLocationFromNode=Xe,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Xe,this.setNodeLocationFromNode=Xe,this.cstPostRule=Xe,this.setInitialNodeLocation=Xe;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];fA(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];pA(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Ft(this.baseCstVisitorConstructor)){let e=dA(this.className,Pe(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Ft(this.baseCstVisitorWithDefaultsConstructor)){let e=hA(this.className,Pe(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}};var Al=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Yo}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Yo:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}};var Cl=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=Zo){if(He(this.definedRulesNames,e)){let s={message:wr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:At.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=Zo){let i=eA(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(e,r,n);return this[e]=o,o}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(qn(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Ku(Re(this.gastProductionsCache))}};var wl=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Wo,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Z(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
205
205
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
206
206
|
For Further details.`);if(J(e)){if(Te(e))throw Error(`A Token Vocabulary cannot be empty.
|
|
207
207
|
Note that the first argument for the parser constructor
|
|
208
208
|
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
209
209
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
210
|
-
For Further details.`)}if(J(e))this.tokensMap=mt(e,(o,s)=>(o[s.name]=s,o),{});else if(Z(e,"modes")&&Dt(bt(Re(e.modes)),
|
|
211
|
-
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Z(n,"resyncEnabled")?n.resyncEnabled:Zo.resyncEnabled,o=Z(n,"recoveryValueFunc")?n.recoveryValueFunc:Zo.recoveryValueFunc,s=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let a;return this.outputCst===!0?a=function(...c){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c);let f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}}:a=function(...c){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c)}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if(qn(e)){let s=e;if(o){let a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(s.resyncedTokens=this.reSyncTo(a),this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return n(e);else{if(this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,s.partialCstResult=u}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof e!="function"){o=e.DEF;let s=e.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=e;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let s=r.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=r;if(i.call(this)===!0){let s=this.doSingleRepetition(o);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(e,Je.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,sl)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,$s],a,1536,e,$s)}else throw this.raiseEarlyExitException(e,Je.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let a=r.GATE;if(a!==void 0){let u=i;i=()=>a.call(this)&&u.call(this)}}else o=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,ol,s)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,zs],a,1280,e,zs)}}repetitionSepSecondInternal(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,1536,e,o)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=J(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Hs(r,e))}}subruleInternal(e,r,n){let i;try{let o=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(o){throw this.subruleInternalError(o,n,e.ruleName)}}subruleInternalError(e,r,n){throw qn(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let o=this.LA(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(o){i=this.consumeInternalRecovery(e,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new ji(i,r,o))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===
|
|
212
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(
|
|
210
|
+
For Further details.`)}if(J(e))this.tokensMap=mt(e,(o,s)=>(o[s.name]=s,o),{});else if(Z(e,"modes")&&Dt(bt(Re(e.modes)),RE)){let o=bt(Re(e.modes)),s=jo(o);this.tokensMap=mt(s,(a,u)=>(a[u.name]=u,a),{})}else if(Ze(e))this.tokensMap=Me(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=Cr;let n=Z(e,"modes")?bt(Re(e.modes)):Re(e),i=Dt(n,o=>Te(o.categoryMatches));this.tokenMatcher=i?Wo:cn,fn(Re(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
211
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Z(n,"resyncEnabled")?n.resyncEnabled:Zo.resyncEnabled,o=Z(n,"recoveryValueFunc")?n.recoveryValueFunc:Zo.recoveryValueFunc,s=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let a;return this.outputCst===!0?a=function(...c){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c);let f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}}:a=function(...c){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c)}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if(qn(e)){let s=e;if(o){let a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(s.resyncedTokens=this.reSyncTo(a),this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return n(e);else{if(this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,s.partialCstResult=u}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof e!="function"){o=e.DEF;let s=e.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=e;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let s=r.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=r;if(i.call(this)===!0){let s=this.doSingleRepetition(o);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(e,Je.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,sl)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,$s],a,1536,e,$s)}else throw this.raiseEarlyExitException(e,Je.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let a=r.GATE;if(a!==void 0){let u=i;i=()=>a.call(this)&&u.call(this)}}else o=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,ol,s)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,zs],a,1280,e,zs)}}repetitionSepSecondInternal(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,1536,e,o)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=J(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Hs(r,e))}}subruleInternal(e,r,n){let i;try{let o=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(o){throw this.subruleInternalError(o,n,e.ruleName)}}subruleInternalError(e,r,n){throw qn(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let o=this.LA(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(o){i=this.consumeInternalRecovery(e,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new ji(i,r,o))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===jp?n:o}}else throw n}saveRecogState(){let e=this.errors,r=Me(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),Cr)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var kl=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Z(e,"errorMessageProvider")?e.errorMessageProvider:$t.errorMessageProvider}SAVE_ERROR(e){if(qn(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Me(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Me(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],a=Vs(e,o,r,this.maxLookahead)[0],u=[];for(let c=1;c<=this.maxLookahead;c++)u.push(this.LA(c));let l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:u,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new Ks(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=qs(e,i,this.maxLookahead),s=[];for(let l=1;l<=this.maxLookahead;l++)s.push(this.LA(l));let a=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:s,previous:a,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Ws(u,this.LA(1),a))}};var Tl=class{initContentAssist(){}computeContentAssist(e,r){let n=this.gastProductionsCache[e];if(Ft(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return ul([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let r=kt(e.ruleStack),i=this.getGAstProductions()[r];return new il(i,e).startWalking()}};var vl={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(vl);var mA=!0,gA=Math.pow(2,8)-1,yA=xe({name:"RECORDING_PHASE_TOKEN",pattern:Se.NA});fn([yA]);var bA=Bi(yA,`This IToken indicates the Parser is in Recording Phase
|
|
212
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(bA);var GP={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
213
213
|
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},_l=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let r=0;r<10;r++){let n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return Yo}topLevelRuleRecord(e,r){try{let n=new Ut({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
|
|
214
214
|
This error was thrown during the "grammar recording phase" For more info see:
|
|
215
|
-
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Xs.call(this,Ge,e,r)}atLeastOneInternalRecord(e,r){Xs.call(this,lt,r,e)}atLeastOneSepFirstInternalRecord(e,r){Xs.call(this,ct,r,e,
|
|
216
|
-
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=qr(this.recordingProdStack),o=e.ruleName,s=new Be({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst
|
|
217
|
-
inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=qr(this.recordingProdStack),o=new Ie({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),
|
|
218
|
-
Idx value must be a none negative value smaller than ${
|
|
215
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Xs.call(this,Ge,e,r)}atLeastOneInternalRecord(e,r){Xs.call(this,lt,r,e)}atLeastOneSepFirstInternalRecord(e,r){Xs.call(this,ct,r,e,mA)}manyInternalRecord(e,r){Xs.call(this,De,r,e)}manySepFirstInternalRecord(e,r){Xs.call(this,rt,r,e,mA)}orInternalRecord(e,r){return WP.call(this,e,r)}subruleInternalRecord(e,r,n){if(Sl(r),!e||Z(e,"ruleName")===!1){let a=new Error(`<SUBRULE${xA(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
|
216
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=qr(this.recordingProdStack),o=e.ruleName,s=new Be({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?GP:vl}consumeInternalRecord(e,r,n){if(Sl(r),!_p(e)){let s=new Error(`<CONSUME${xA(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
217
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=qr(this.recordingProdStack),o=new Ie({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),bA}};function Xs(t,e,r,n=!1){Sl(r);let i=qr(this.recordingProdStack),o=Bt(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Z(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),i.definition.push(s),this.recordingProdStack.pop(),vl}function WP(t,e){Sl(e);let r=qr(this.recordingProdStack),n=J(t)===!1,i=n===!1?t:t.DEF,o=new nt({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Z(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD);let s=Ds(i,a=>Bt(a.GATE));return o.hasPredicates=s,r.definition.push(o),G(i,a=>{let u=new je({definition:[]});o.definition.push(u),Z(a,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Z(a,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),a.ALT.call(this),this.recordingProdStack.pop()}),vl}function xA(t){return t===0?"":`${t}`}function Sl(t){if(t<0||t>gA){let e=new Error(`Invalid DSL Method idx value: <${t}>
|
|
218
|
+
Idx value must be a none negative value smaller than ${gA+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var Il=class{initPerformanceTracer(e){if(Z(e,"traceInitPerf")){let r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=$t.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:i,value:o}=Fs(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,o}else return r()}};function EA(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]})})}var Yo=Bi(Cr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Yo);var $t=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:nl,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Zo=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),At;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(At||(At={}));var Js=class t{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{Ns(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),G(this.definedRulesNames,i=>{let s=this[i].originalGrammarAction,a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=iA({rules:Re(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Te(n)&&this.skipValidations===!1){let i=oA({rules:Re(this.gastProductionsCache),tokenTypes:Re(this.tokensMap),errMsgProvider:wr,grammarName:r}),o=XE({lookaheadStrategy:this.lookaheadStrategy,rules:Re(this.gastProductionsCache),tokenTypes:Re(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,o)}}),Te(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=pE(Re(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0||o.call(i,{rules:Re(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Re(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!Te(this.definitionErrors))throw e=q(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
|
|
219
219
|
${e.join(`
|
|
220
220
|
-------------------------------
|
|
221
221
|
`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),Z(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
222
222
|
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
223
223
|
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
224
|
-
For further details.`);this.skipValidations=Z(r,"skipValidations")?r.skipValidations:$t.skipValidations}};Js.DEFER_DEFINITION_ERRORS_HANDLING=!1;
|
|
224
|
+
For further details.`);this.skipValidations=Z(r,"skipValidations")?r.skipValidations:$t.skipValidations}};Js.DEFER_DEFINITION_ERRORS_HANDLING=!1;EA(Js,[dl,gl,El,Al,wl,Cl,kl,Tl,_l,Il]);var Ui=class extends Js{constructor(e,r=$t){let n=Me(r);n.outputCst=!0,super(e,n)}};var Dl=xe({name:"flag",pattern:/--[\w-_]+/}),Zp=xe({longer_alt:Dl,name:"alias",pattern:/-[A-Za-z]/}),AA=xe({group:Se.SKIPPED,name:"comma",pattern:/,/}),CA=xe({group:Se.SKIPPED,name:"dollar",pattern:/\$/}),Ol=xe({group:Se.SKIPPED,name:"whiteSpace",pattern:/ /}),wA=xe({group:Se.SKIPPED,name:"newLine",pattern:/\n/}),Xp=xe({name:"word",pattern:/\S+/}),ea=xe({name:"argument",pattern:/(<\S+>|\[.+])/}),Jp=xe({name:"programDescription",pattern:/\w.+(?=\n\n {2}Usage)/}),kA=xe({group:Se.SKIPPED,name:"startUsage",pattern:/ {2}Usage\n/,push_mode:"USAGE_MODE"}),TA=xe({group:Se.SKIPPED,name:"endUsage",pattern:/\n/,pop_mode:!0}),Qp=xe({name:"startOptions",pattern:/ {2}Options\n/,push_mode:"OPTIONS_MODE"}),ed=xe({name:"startRow",pattern:/ {4}/,push_mode:"ROW_MODE"}),td=xe({name:"rowDescription",pattern:/\w.+/}),_A=xe({group:Se.SKIPPED,name:"endRow",pattern:/\n/,pop_mode:!0}),SA=xe({group:Se.SKIPPED,name:"endOptions",pattern:/\n/,pop_mode:!0}),KP=new Se({defaultMode:"DEFAULT_MODE",modes:{DEFAULT_MODE:[kA,Qp,Jp,wA,Ol],OPTIONS_MODE:[SA,ed],ROW_MODE:[_A,Zp,Dl,AA,ea,td,Ol],USAGE_MODE:[TA,CA,ea,Xp,Ol]}}),YP=[Dl,Zp,AA,CA,Ol,wA,Xp,ea,Jp,kA,TA,Qp,ed,td,_A,SA],Kp=class extends Ui{programHelp=this.RULE("programHelp",()=>{this.CONSUME(Jp,{LABEL:"description"}),this.AT_LEAST_ONE(()=>{this.CONSUME(Xp,{LABEL:"commandName"})}),this.MANY(()=>{this.CONSUME(ea)}),this.OPTION(()=>{this.SUBRULE(this.optionsSection)})});optionsSection=this.RULE("optionsSection",()=>{this.CONSUME(Qp),this.MANY(()=>{this.SUBRULE(this.sectionRow)})});sectionRow=this.RULE("sectionRow",()=>{this.CONSUME(ed),this.MANY(()=>{this.OR([{ALT:()=>this.CONSUME(ea)},{ALT:()=>this.CONSUME(Zp)},{ALT:()=>this.CONSUME(Dl)},{ALT:()=>this.CONSUME(td,{LABEL:"description"})}])})});constructor(){super(YP),this.performSelfAnalysis()}},Qs=new Kp,Yp=class extends Qs.getBaseCstVisitorConstructor(){constructor(){super(),this.validateVisitor()}programHelp(e){let{command:r,subcommand:n}=Rl(this.getString(e.commandName));return{arguments:this.getArray(e.argument),commandName:r,description:this.getString(e.description),options:e.optionsSection?this.visit(e.optionsSection):void 0,subcommandName:n}}optionsSection(e){return e.sectionRow.map(r=>this.visit(r))}sectionRow(e){return{aliases:this.getArray(e.alias),arguments:this.getArray(e.argument),description:this.getString(e.description,!0),flags:this.getArray(e.flag)}}getString(e,r=!1){if(e!==void 0)return e.map(n=>r?this.clean(n.image):n.image).join(" ")}getArray(e){if(e!==void 0)return e.map(r=>r.image)}clean(e){return e.replaceAll(/^[\s[]*(default:)?\s*|[\s\]]*$/g,"")}},ZP=new Yp;function vA(t){let e=KP.tokenize(t);if(e.errors.length>0)throw new Error(`Errors lexing CLI command: ${JSON.stringify(e.errors,void 0,2)}`);Qs.input=e.tokens;let r=Qs.programHelp();if(Qs.errors.length>0)throw new Error(`Errors parsing CLI command help text: ${JSON.stringify(Qs.errors,void 0,2)}`);let n;try{n=ZP.visit(r)}catch(i){if(i instanceof Error)throw new TypeError(`Errors visiting CLI command help text: ${String(i)}`)}if(n===void 0)throw new Error("Could not parse help string");return n}var od=xe({name:"flag",pattern:/--[\w-_]+/}),sd=xe({name:"alias",pattern:/-[A-Za-z]/}),IA=xe({group:Se.SKIPPED,name:"comma",pattern:/,/}),Xo=xe({name:"word",pattern:/\S+/}),ra=xe({name:"argument",pattern:/<\S+>|\[\S+]/}),ad=xe({name:"type",pattern:/\[(boolean|string|array|number)]/}),ud=xe({name:"defaultInfo",pattern:/\[default]/}),ld=xe({name:"required",pattern:/\[required]/}),cd=xe({name:"defaultInfoDescription",pattern:/\[default:\s.+]/}),fd=xe({name:"choices",pattern:/\[choices:\s.+?]/}),rd=xe({group:Se.SKIPPED,name:"whiteSpace",pattern:/\s/}),OA=xe({group:Se.SKIPPED,name:"startProgramDescription",pattern:/\n\n/,push_mode:"PROGRAM_DESCRIPTION_MODE"}),pd=xe({name:"programDescription",pattern:/.+/}),DA=xe({group:Se.SKIPPED,name:"endProgramDescription",pattern:/\n\n/,pop_mode:!0}),dd=xe({name:"startOptionsSection",pattern:/Options:?\n/,push_mode:"SECTION_MODE"}),hd=xe({name:"startPositionalsSection",pattern:/Positionals:\n/,push_mode:"SECTION_MODE"}),md=xe({name:"startCommandsSection",pattern:/Commands:\n/,push_mode:"SECTION_MODE"}),gd=xe({name:"startRow",pattern:/ {2,}/,push_mode:"ROW_MODE"}),xd=xe({name:"rowDescription",pattern:/ {2}\w.+ {2}/}),yd=xe({name:"rowDescriptionTerminal",pattern:/ {2}\w.+/}),RA=xe({group:Se.SKIPPED,name:"endRow",pattern:/\n/,pop_mode:!0}),FA=xe({group:Se.SKIPPED,name:"endSection",pattern:/\n+/,pop_mode:!0}),XP=new Se({defaultMode:"DEFAULT_MODE",modes:{DEFAULT_MODE:[dd,hd,md,OA,ra,Xo,rd],PROGRAM_DESCRIPTION_MODE:[DA,pd],ROW_MODE:[RA,IA,ad,xd,yd,cd,ud,ld,fd,od,sd,ra,Xo,rd],SECTION_MODE:[gd,FA]}}),JP=[od,sd,IA,Xo,ra,ad,ud,ld,cd,fd,rd,OA,pd,DA,dd,hd,md,gd,xd,yd,RA,FA],nd=class extends Ui{programHelp=this.RULE("programHelp",()=>{this.AT_LEAST_ONE(()=>{this.CONSUME(Xo,{LABEL:"commandName"})}),this.MANY1(()=>{this.CONSUME(ra)}),this.OPTION(()=>{this.CONSUME(pd,{LABEL:"description"})}),this.OPTION1(()=>{this.SUBRULE(this.commandsSection)}),this.OPTION2(()=>{this.SUBRULE(this.positionalsSection)}),this.OPTION3(()=>{this.SUBRULE(this.optionsSection)})});positionalsSection=this.RULE("positionalsSection",()=>{this.CONSUME(hd),this.MANY(()=>{this.SUBRULE(this.sectionRow)})});commandsSection=this.RULE("commandsSection",()=>{this.CONSUME(md),this.MANY1(()=>{this.SUBRULE1(this.sectionRow)})});optionsSection=this.RULE("optionsSection",()=>{this.CONSUME(dd),this.MANY2(()=>{this.SUBRULE2(this.sectionRow)})});sectionRow=this.RULE("sectionRow",()=>{this.CONSUME(gd),this.OPTION(()=>{this.CONSUME(Xo,{LABEL:"parentCommandName"})}),this.MANY(()=>{this.CONSUME1(Xo,{LABEL:"commandName"})}),this.MANY1(()=>{this.OR([{ALT:()=>this.CONSUME(ra)},{ALT:()=>this.CONSUME(sd)},{ALT:()=>this.CONSUME(od)},{ALT:()=>this.CONSUME(xd,{LABEL:"description"})},{ALT:()=>this.CONSUME(yd,{LABEL:"description"})},{ALT:()=>this.CONSUME(ad)},{ALT:()=>this.CONSUME(ld)},{ALT:()=>this.CONSUME(cd)},{ALT:()=>this.CONSUME(ud)},{ALT:()=>this.CONSUME(fd)}])})});constructor(){super(JP),this.performSelfAnalysis()}},ta=new nd,id=class extends ta.getBaseCstVisitorConstructor(){constructor(){super(),this.validateVisitor()}programHelp(e){let{command:r,subcommand:n}=Rl(this.getString(e.commandName));return{arguments:this.getArray(e.argument),commandName:r,commands:e.commandsSection?this.visit(e.commandsSection):void 0,description:this.getString(e.description),options:e.optionsSection?this.visit(e.optionsSection):void 0,positionals:e.positionalsSection?this.visit(e.positionalsSection):void 0,subcommandName:n}}positionalsSection(e){return e.sectionRow.map(r=>this.positionalParentCommandToArguments(this.visit(r)))}commandsSection(e){return e.sectionRow.map(r=>this.visit(r))}optionsSection(e){return e.sectionRow.map(r=>this.visit(r))}sectionRow(e){return{aliases:this.getArray(e.alias),arguments:this.getArray(e.argument),choices:this.splitChoices(this.getString(e.choices)),commandName:this.getString(e.commandName),default:e.defaultInfo?!0:void 0,defaultValue:this.getString(e.defaultInfoDescription,!0),description:this.getString(e.description,!0),flags:this.getArray(e.flag),parentCommandName:this.getString(e.parentCommandName),required:e.required?!0:void 0,type:this.getString(e.type,!0)}}positionalParentCommandToArguments(e){let{arguments:r,parentCommandName:n,...i}=e;return n===void 0?e:{arguments:[n,...r??[]],...i}}getString(e,r=!1){if(e!==void 0)return e.map(n=>r?this.clean(n.image):n.image).join(" ")}getArray(e){if(e!==void 0)return e.map(r=>r.image)}clean(e){return e.endsWith("]]")?e.replaceAll(/(^\[default:\s*)|(]$)/g,""):e.replaceAll(/^[\s[]*(default:)?\s*|[\s\]]*$/g,"")}splitChoices(e){if(e!==void 0)return this.clean(e.replaceAll(/^\[choices:\s/g,"")).split(", ")}},QP=new id;function NA(t){let e=XP.tokenize(t);if(e.errors.length>0)throw new Error(`Errors lexing CLI command: ${JSON.stringify(e.errors,void 0,2)}`);ta.input=e.tokens;let r=ta.programHelp();if(ta.errors.length>0)throw new Error(`Errors parsing CLI command help text: ${JSON.stringify(ta.errors,void 0,2)}`);let n;try{n=QP.visit(r)}catch(i){if(i instanceof Error)throw new TypeError(`Errors visiting CLI command help text: ${String(i)}`)}if(n===void 0)throw new Error("Could not parse help string");return n}var PA={yargs:NA,meow:vA};function Rl(t){if(t===void 0)throw new Error('Could not find "commandName" entry in help');let e=t.split(" ");if(e.length===0&&t===void 0)throw new Error('Could not find "commandName" entry in help');if(e.length===1)return{command:e[0],subcommand:void 0};let r=e.at(-1);return{command:e.slice(0,-1).join(" "),subcommand:r}}function LA(t){for(let[e,r]of Object.entries(PA)){bd.info(`Trying to parse help string with ${e} parser...`);try{return r(t)}catch(n){n instanceof Error&&bd.info(`Error in "${e}" parser: ${String(n)}`);continue}}bd.error("Could not parse help string with any parser")}async function Ed(t,e="--help",r){let n=`${t} ${e}`,i=await nL(n),o=LA(i);return o===void 0?(MA.warn("Falling back to basic cli help text output."),rL(i)):tL(t,e,r??Number.MAX_SAFE_INTEGER,o)}async function tL(t,e,r,n){if(r<=0)return MA.info("Max CLI command help depth reached, stopping recursion"),"";let i=bx(n,r),o=t.split(" ")[0];if(n.commands)for(let s of n.commands){if(!s.parentCommandName||!s.commandName)continue;let a=await Ed(`${o} ${s.commandName}`,e,r-1);if(a==="")return i;i+=`
|
|
225
225
|
|
|
226
|
-
${a}`}return i}function
|
|
226
|
+
${a}`}return i}function rL(t){return`\`\`\`txt
|
|
227
227
|
${t}
|
|
228
|
-
\`\`\``}async function
|
|
228
|
+
\`\`\``}async function nL(t){let e;try{let{stderr:r,stdout:n}=await eL(t);e=n,(e===void 0||e==="")&&(e=r)}catch(r){if(r instanceof Error)throw new TypeError(`Error running CLI help command: "${t}"
|
|
229
229
|
${r.message}
|
|
230
230
|
`)}if(e===void 0||e==="")throw new Error(`No result from running CLI help command: "${t}"
|
|
231
|
-
`);return e}import
|
|
231
|
+
`);return e}import BA from"node:process";import iL from"node:path";import oL from"node:fs";import sL from"node:fs/promises";var jA=BA.platform==="win32",aL=jA?new Set(BA.env.PATHEXT?.split(";").map(t=>t.toLowerCase())):[];async function UA(t){try{return await sL.access(t,oL.X_OK),jA?aL.has(iL.extname(t)):!0}catch{return!1}}import uL from"node:path";import{log as lL}from"remark-mdat";import cL from"which";async function zA(t){return t??=await fL(),dL(t)}async function fL(){let t=await rr();if(t?.bin){let e=typeof t.bin=="string"?t.bin:String(Object.values(t.bin).at(0));if(pL(e))return lL.info(`Inferred <!-- cli-help --> command to run from package.json: ${e}`),e}throw new Error(`Could not infer which command to run for the <!-- cli-help --> rule. Please pass a "cliCommand" option to the expansion comment, e.g. <!-- cli-help {cliCommand: './dist/bin.js'} -->`)}function pL(t){let e=uL.parse(t);return e.root!==""||e.dir!==""}async function dL(t){let e=await cL(t,{nothrow:!0})??void 0;if(e===null&&(e=await hL(t)??void 0),e!==void 0&&await UA(e))return e;throw new Error(`The cli-help rule noticed that "${e}" is not executable.`)}async function hL(t){return(await rr())?.bin?.[t]??void 0}var Fl={"cli-help":{async content(t){let e=X.object({cliCommand:X.string().optional(),depth:X.number().optional(),helpFlag:X.string().optional()}).optional().parse(t),r=await zA(e?.cliCommand);return Ed(r,e?.helpFlag,e?.depth)}}};var $A={cli:mL(Fl)};import gL from"node:fs/promises";import qA from"node:path";var VA={code:{async content(t){let e=X.object({file:X.string(),language:X.string().optional()}).parse(t),r=(qA.extname(e.file)??"").replace(/^\./,""),n=await gL.readFile(qA.join(process.cwd(),e.file),"utf8");return`\`\`\`${r}
|
|
232
232
|
${n}
|
|
233
233
|
\`\`\``}}};var Nl={contributing:{async content(){let e=(await rr())?.bugs?.url;if(e===void 0)throw new Error('Could not find "bugs.url" entry in package.json');return`## Contributing
|
|
234
|
-
[Issues](${e}) and pull requests are welcome.`},order:15}};var Pl={description:{async content(){let t=await rr();if(t.description===void 0)throw new Error('Could not find "description" entry in package.json');return`**${t.description}**`},order:4}};import{getSoleRule as
|
|
235
|
-
[${r}](license.txt) \xA9 ${e.name}`},order:16}};var
|
|
236
|
-
`)}var XA={"size-table":{async content(t){let e=vL.parse(t),r=await Promise.all(e.files.map(async n=>{let i=ZA.join(process.cwd(),n),o=await Ul(i);return[n,o]}));return IL(r,{brotli:e.brotli,gzip:e.gzip,original:e.original,showPercentage:e.showPercentage})}}};var JA=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;var OL=Object.hasOwnProperty,na=class{constructor(){this.occurrences,this.reset()}slug(e,r){let n=this,i=DL(e,r===!0),o=i;for(;OL.call(n.occurrences,i);)n.occurrences[o]++,i=o+"-"+n.occurrences[o];return n.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}};function DL(t,e){return typeof t!="string"?"":(e||(t=t.toLowerCase()),t.replace(JA,"").replace(/ /g,"-"))}function zl(t){return new RegExp("^("+t+")$","i")}var QA=new na;function eC(t,e,r){let n="children"in t?t.children.length:0,i=r.skip?zl(r.skip):void 0,o=Fr(r.parents||function(c){return c===t}),s=[],a,u,l;return QA.reset(),_s(t,"heading",function(c,f,p){let d=tn(c,{includeImageAlt:!1}),m=c.data&&c.data.hProperties&&c.data.hProperties.id,y=QA.slug(m||d);if(o(p)){if(f!==void 0&&e&&!a&&e.test(d)){a=f+1,l=c;return}f!==void 0&&l&&!u&&c.depth<=l.depth&&(u=f),(u||!e)&&(!r.minDepth||c.depth>=r.minDepth)&&(!r.maxDepth||c.depth<=r.maxDepth)&&(!i||!i.test(d))&&s.push({depth:c.depth,children:c.children,id:y})}}),{index:a===void 0?-1:a,endIndex:a===void 0?-1:u||n,map:s}}var tC=typeof self=="object"?self:globalThis,PL=(t,e)=>{let r=(i,o)=>(t.set(o,i),i),n=i=>{if(t.has(i))return t.get(i);let[o,s]=e[i];switch(o){case 0:case-1:return r(s,i);case 1:{let a=r([],i);for(let u of s)a.push(n(u));return a}case 2:{let a=r({},i);for(let[u,l]of s)a[n(u)]=n(l);return a}case 3:return r(new Date(s),i);case 4:{let{source:a,flags:u}=s;return r(new RegExp(a,u),i)}case 5:{let a=r(new Map,i);for(let[u,l]of s)a.set(n(u),n(l));return a}case 6:{let a=r(new Set,i);for(let u of s)a.add(n(u));return a}case 7:{let{name:a,message:u}=s;return r(new tC[a](u),i)}case 8:return r(BigInt(s),i);case"BigInt":return r(Object(BigInt(s)),i)}return r(new tC[o](s),i)};return n},Td=t=>PL(new Map,t)(0);var Jo="",{toString:LL}={},{keys:ML}=Object,ia=t=>{let e=typeof t;if(e!=="object"||!t)return[0,e];let r=LL.call(t).slice(8,-1);switch(r){case"Array":return[1,Jo];case"Object":return[2,Jo];case"Date":return[3,Jo];case"RegExp":return[4,Jo];case"Map":return[5,Jo];case"Set":return[6,Jo]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},$l=([t,e])=>t===0&&(e==="function"||e==="symbol"),BL=(t,e,r,n)=>{let i=(s,a)=>{let u=n.push(s)-1;return r.set(a,u),u},o=s=>{if(r.has(s))return r.get(s);let[a,u]=ia(s);switch(a){case 0:{let c=s;switch(u){case"bigint":a=8,c=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([-1],s)}return i([a,c],s)}case 1:{if(u)return i([u,[...s]],s);let c=[],f=i([a,c],s);for(let p of s)c.push(o(p));return f}case 2:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());let c=[],f=i([a,c],s);for(let p of ML(s))(t||!$l(ia(s[p])))&&c.push([o(p),o(s[p])]);return f}case 3:return i([a,s.toISOString()],s);case 4:{let{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case 5:{let c=[],f=i([a,c],s);for(let[p,d]of s)(t||!($l(ia(p))||$l(ia(d))))&&c.push([o(p),o(d)]);return f}case 6:{let c=[],f=i([a,c],s);for(let p of s)(t||!$l(ia(p)))&&c.push(o(p));return f}}let{message:l}=s;return i([a,{name:u,message:l}],s)};return o},_d=(t,{json:e,lossy:r}={})=>{let n=[];return BL(!(e||r),!!e,new Map,n)(t),n};var Sd=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Td(_d(t,e)):structuredClone(t):(t,e)=>Td(_d(t,e));function sC(t,e){let{ordered:r=!1,tight:n=!1,prefix:i}=e,o={type:"list",ordered:r,spread:!1,children:[]},s=Number.POSITIVE_INFINITY,a=-1;for(;++a<t.length;)t[a].depth<s&&(s=t[a].depth);for(a=-1;++a<t.length;)t[a].depth-=s-1;for(a=-1;++a<t.length;)oa(t[a],o,{ordered:r,tight:n,prefix:i});return o}function oa(t,e,r){let n=-1,i=e.children[e.children.length-1];if(e.type==="list")if(t.depth===1)e.children.push({type:"listItem",spread:!1,children:[{type:"paragraph",children:[{type:"link",title:null,url:"#"+(r.prefix||"")+t.id,children:vd(t.children)}]}]});else if(e.children.length>0){let o=e.children[e.children.length-1];oa(t,o,r)}else{let o={type:"listItem",spread:!1,children:[]};e.children.push(o),oa(t,o,r)}else if(i&&i.type==="list")t.depth--,oa(t,i,r);else{let o={type:"list",ordered:r.ordered,spread:!1,children:[]};e.children.push(o),t.depth--,oa(t,o,r)}if(e.type==="list"&&!r.tight){for(e.spread=!1;++n<e.children.length;)if(e.children[n].children.length>1){e.spread=!0;break}}else e.spread=!r.tight}function vd(t){let e=[],r=-1;for(;++r<t.length;){let n=jL(t[r]);Array.isArray(n)?e.push(...n):e.push(n)}return e}function jL(t){if(t.type==="footnoteReference")return[];if(t.type==="link"||t.type==="linkReference")return vd(t.children);if("children"in t){let{children:n,position:i,...o}=t;return Object.assign(Sd(o),{children:vd(t.children)})}let{position:e,...r}=t;return Sd(r)}function Id(t,e){let r=e||{},n=r.heading?zl(r.heading):void 0,i=eC(t,n,r);return{index:n?i.index:void 0,endIndex:n?i.endIndex:void 0,map:i.map.length>0?sC(i.map,r):void 0}}var ql={"table-of-contents":{applicationOrder:1,async content(t,e){let r=X.object({depth:X.union([X.literal(1),X.literal(2),X.literal(3),X.literal(4),X.literal(5),X.literal(6)]).optional()}).optional().parse(t),n=Id(e,{heading:null,maxDepth:r?.depth??3,tight:!0}),i="## Table of contents";if(n.map===void 0)throw new Error("Could not generate table of contents");let o={children:n.map.children,type:"root"},s=mo().use(Tn).stringify(o).replaceAll(`
|
|
234
|
+
[Issues](${e}) and pull requests are welcome.`},order:15}};var Pl={description:{async content(){let t=await rr();if(t.description===void 0)throw new Error('Could not find "description" entry in package.json');return`**${t.description}**`},order:4}};import{getSoleRule as GA}from"remark-mdat";var Ll={license:{async content(){let t=await rr(),{author:e,license:r}=t;if(e?.name===void 0)throw new Error('Could not find "author.name" entry in package.json');if(r===void 0)throw new Error('Could not find "license" entry in package.json');return`## License
|
|
235
|
+
[${r}](license.txt) \xA9 ${e.name}`},order:16}};var WA={footer:{content:[GA(Nl),GA(Ll)],order:17}};import{getSoleRule as jl}from"remark-mdat";import{getSoleRule as xL}from"remark-mdat";var Ml={"short-description":xL(Pl)};var Bl={title:{applicationOrder:2,async content(t){let{postfix:e,prefix:r,titleCase:n}=X.object({postfix:X.string().optional().default(""),prefix:X.string().optional().default(""),titleCase:X.boolean().optional().default(!1)}).parse(t??{}),{name:i}=await rr();return`# ${r}${n?yL(i):i}${e}`},order:1}};function yL(t){return t.split(/[ _-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}var HA={header:{applicationOrder:2,content:[jl(Bl),jl(yu),jl(gu),jl(Ml)],order:1}};import vL from"node:path";import wL from"node:fs/promises";import{promisify as YA}from"node:util";import{brotliCompress as kL,gzip as TL}from"node:zlib";var bL=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],EL=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],AL=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],CL=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],KA=(t,e,r)=>{let n=t;return typeof e=="string"||Array.isArray(e)?n=t.toLocaleString(e,r):(e===!0||r!==void 0)&&(n=t.toLocaleString(void 0,r)),n};function Ad(t,e){if(!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);e={bits:!1,binary:!1,space:!0,...e};let r=e.bits?e.binary?CL:AL:e.binary?EL:bL,n=e.space?" ":"";if(e.signed&&t===0)return` 0${n}${r[0]}`;let i=t<0,o=i?"-":e.signed?"+":"";i&&(t=-t);let s;if(e.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:e.maximumFractionDigits,...s}),t<1){let c=KA(t,e.locale,s);return o+c+n+r[0]}let a=Math.min(Math.floor(e.binary?Math.log(t)/Math.log(1024):Math.log10(t)/3),r.length-1);t/=(e.binary?1024:1e3)**a,s||(t=t.toPrecision(3));let u=KA(Number(t),e.locale,s),l=r[a];return o+u+n+l}var _L=YA(kL),SL=YA(TL);function Cd(t,e){let r=e===0?0:(e-t)/e*100;return{bytes:t,bytesPretty:Ad(t,{maximumFractionDigits:1}),percent:r,percentPretty:`${Math.round(r)}%`}}async function Ul(t){try{let e=await wL.readFile(t),r=e.length,[n,i]=await Promise.all([_L(e),SL(e)]);return{brotli:Cd(n.length,r),gzip:Cd(i.length,r),original:Cd(r,r)}}catch(e){throw new Error(`Failed to analyze file: ${e instanceof Error?e.message:"Unknown error"}`)}}var IL=X.object({compression:X.enum(["none","brotli","gzip"]).optional().default("none"),file:X.string()});function OL(t,e){switch(e){case"brotli":return t.brotli.bytesPretty;case"gzip":return t.gzip.bytesPretty;case"none":return t.original.bytesPretty}}var ZA={size:{async content(t){let e=IL.parse(t),r=vL.join(process.cwd(),e.file),n=await Ul(r);return OL(n,e.compression)}}};import JA from"node:path";var XA=X.union([X.string(),X.array(X.string())]).transform(t=>Array.isArray(t)?t:[t]),DL=X.union([X.object({brotli:X.boolean().optional().default(!0),file:XA,gzip:X.boolean().optional().default(!0),original:X.boolean().optional().default(!0),showPercentage:X.boolean().optional().default(!1)}),X.object({brotli:X.boolean().optional().default(!0),files:XA,gzip:X.boolean().optional().default(!0),original:X.boolean().optional().default(!0),showPercentage:X.boolean().optional().default(!1)})]).transform(t=>{if("file"in t){let{file:e,...r}=t;return{files:e,...r}}return t});function RL(t,e){let r=["File"];e.original&&r.push("Original"),e.gzip&&r.push("Gzip"),e.brotli&&r.push("Brotli");let n=r.map(()=>"---"),i=t.map(([o,s])=>{let a=[JA.basename(o)];return e.original&&a.push(s.original.bytesPretty),e.gzip&&a.push(e.showPercentage?`${s.gzip.bytesPretty} (${s.gzip.percentPretty})`:s.gzip.bytesPretty),e.brotli&&a.push(e.showPercentage?`${s.brotli.bytesPretty} (${s.brotli.percentPretty})`:s.brotli.bytesPretty),a});return[`| ${r.join(" | ")} |`,`| ${n.join(" | ")} |`,...i.map(o=>`| ${o.join(" | ")} |`)].join(`
|
|
236
|
+
`)}var QA={"size-table":{async content(t){let e=DL.parse(t),r=await Promise.all(e.files.map(async n=>{let i=JA.join(process.cwd(),n),o=await Ul(i);return[n,o]}));return RL(r,{brotli:e.brotli,gzip:e.gzip,original:e.original,showPercentage:e.showPercentage})}}};var eC=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;var FL=Object.hasOwnProperty,na=class{constructor(){this.occurrences,this.reset()}slug(e,r){let n=this,i=NL(e,r===!0),o=i;for(;FL.call(n.occurrences,i);)n.occurrences[o]++,i=o+"-"+n.occurrences[o];return n.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}};function NL(t,e){return typeof t!="string"?"":(e||(t=t.toLowerCase()),t.replace(eC,"").replace(/ /g,"-"))}function zl(t){return new RegExp("^("+t+")$","i")}var tC=new na;function rC(t,e,r){let n="children"in t?t.children.length:0,i=r.skip?zl(r.skip):void 0,o=Fr(r.parents||function(c){return c===t}),s=[],a,u,l;return tC.reset(),_s(t,"heading",function(c,f,p){let d=tn(c,{includeImageAlt:!1}),m=c.data&&c.data.hProperties&&c.data.hProperties.id,y=tC.slug(m||d);if(o(p)){if(f!==void 0&&e&&!a&&e.test(d)){a=f+1,l=c;return}f!==void 0&&l&&!u&&c.depth<=l.depth&&(u=f),(u||!e)&&(!r.minDepth||c.depth>=r.minDepth)&&(!r.maxDepth||c.depth<=r.maxDepth)&&(!i||!i.test(d))&&s.push({depth:c.depth,children:c.children,id:y})}}),{index:a===void 0?-1:a,endIndex:a===void 0?-1:u||n,map:s}}var nC=typeof self=="object"?self:globalThis,BL=(t,e)=>{let r=(i,o)=>(t.set(o,i),i),n=i=>{if(t.has(i))return t.get(i);let[o,s]=e[i];switch(o){case 0:case-1:return r(s,i);case 1:{let a=r([],i);for(let u of s)a.push(n(u));return a}case 2:{let a=r({},i);for(let[u,l]of s)a[n(u)]=n(l);return a}case 3:return r(new Date(s),i);case 4:{let{source:a,flags:u}=s;return r(new RegExp(a,u),i)}case 5:{let a=r(new Map,i);for(let[u,l]of s)a.set(n(u),n(l));return a}case 6:{let a=r(new Set,i);for(let u of s)a.add(n(u));return a}case 7:{let{name:a,message:u}=s;return r(new nC[a](u),i)}case 8:return r(BigInt(s),i);case"BigInt":return r(Object(BigInt(s)),i);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:a}=new Uint8Array(s);return r(new DataView(a),s)}}return r(new nC[o](s),i)};return n},Td=t=>BL(new Map,t)(0);var Jo="",{toString:jL}={},{keys:UL}=Object,ia=t=>{let e=typeof t;if(e!=="object"||!t)return[0,e];let r=jL.call(t).slice(8,-1);switch(r){case"Array":return[1,Jo];case"Object":return[2,Jo];case"Date":return[3,Jo];case"RegExp":return[4,Jo];case"Map":return[5,Jo];case"Set":return[6,Jo];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},ql=([t,e])=>t===0&&(e==="function"||e==="symbol"),zL=(t,e,r,n)=>{let i=(s,a)=>{let u=n.push(s)-1;return r.set(a,u),u},o=s=>{if(r.has(s))return r.get(s);let[a,u]=ia(s);switch(a){case 0:{let c=s;switch(u){case"bigint":a=8,c=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([-1],s)}return i([a,c],s)}case 1:{if(u){let p=s;return u==="DataView"?p=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(s)),i([u,[...p]],s)}let c=[],f=i([a,c],s);for(let p of s)c.push(o(p));return f}case 2:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());let c=[],f=i([a,c],s);for(let p of UL(s))(t||!ql(ia(s[p])))&&c.push([o(p),o(s[p])]);return f}case 3:return i([a,s.toISOString()],s);case 4:{let{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case 5:{let c=[],f=i([a,c],s);for(let[p,d]of s)(t||!(ql(ia(p))||ql(ia(d))))&&c.push([o(p),o(d)]);return f}case 6:{let c=[],f=i([a,c],s);for(let p of s)(t||!ql(ia(p)))&&c.push(o(p));return f}}let{message:l}=s;return i([a,{name:u,message:l}],s)};return o},_d=(t,{json:e,lossy:r}={})=>{let n=[];return zL(!(e||r),!!e,new Map,n)(t),n};var Sd=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Td(_d(t,e)):structuredClone(t):(t,e)=>Td(_d(t,e));function uC(t,e){let{ordered:r=!1,tight:n=!1,prefix:i}=e,o={type:"list",ordered:r,spread:!1,children:[]},s=Number.POSITIVE_INFINITY,a=-1;for(;++a<t.length;)t[a].depth<s&&(s=t[a].depth);for(a=-1;++a<t.length;)t[a].depth-=s-1;for(a=-1;++a<t.length;)oa(t[a],o,{ordered:r,tight:n,prefix:i});return o}function oa(t,e,r){let n=-1,i=e.children[e.children.length-1];if(e.type==="list")if(t.depth===1)e.children.push({type:"listItem",spread:!1,children:[{type:"paragraph",children:[{type:"link",title:null,url:"#"+(r.prefix||"")+t.id,children:vd(t.children)}]}]});else if(e.children.length>0){let o=e.children[e.children.length-1];oa(t,o,r)}else{let o={type:"listItem",spread:!1,children:[]};e.children.push(o),oa(t,o,r)}else if(i&&i.type==="list")t.depth--,oa(t,i,r);else{let o={type:"list",ordered:r.ordered,spread:!1,children:[]};e.children.push(o),t.depth--,oa(t,o,r)}if(e.type==="list"&&!r.tight){for(e.spread=!1;++n<e.children.length;)if(e.children[n].children.length>1){e.spread=!0;break}}else e.spread=!r.tight}function vd(t){let e=[],r=-1;for(;++r<t.length;){let n=$L(t[r]);Array.isArray(n)?e.push(...n):e.push(n)}return e}function $L(t){if(t.type==="footnoteReference")return[];if(t.type==="link"||t.type==="linkReference")return vd(t.children);if("children"in t){let{children:n,position:i,...o}=t;return Object.assign(Sd(o),{children:vd(t.children)})}let{position:e,...r}=t;return Sd(r)}function Id(t,e){let r=e||{},n=r.heading?zl(r.heading):void 0,i=rC(t,n,r);return{index:n?i.index:void 0,endIndex:n?i.endIndex:void 0,map:i.map.length>0?uC(i.map,r):void 0}}var Vl={"table-of-contents":{applicationOrder:1,async content(t,e){let r=X.object({depth:X.union([X.literal(1),X.literal(2),X.literal(3),X.literal(4),X.literal(5),X.literal(6)]).optional()}).optional().parse(t),n=Id(e,{heading:null,maxDepth:r?.depth??3,tight:!0}),i="## Table of contents";if(n.map===void 0)throw new Error("Could not generate table of contents");let o={children:n.map.children,type:"root"},s=mo().use(Tn).stringify(o).replaceAll(`
|
|
237
237
|
|
|
238
238
|
`,`
|
|
239
239
|
`);return[i,s].join(`
|
|
240
|
-
`)},order:6}};import{tldrawToImage as
|
|
240
|
+
`)},order:6}};import{tldrawToImage as lC}from"@kitschpatrol/tldraw-cli";import qL from"node:crypto";import Qo from"node:fs/promises";import kr from"node:path";var dC={tldraw:{async content(t){let{alt:e="tldraw diagram",src:r}=X.object({alt:X.string().optional(),src:X.string()}).parse(t),{assetsPath:n}=await Or();if(n===void 0)throw new Error("No assets path found");await Qo.mkdir(n,{recursive:!0});let i=await uo(r)?await fC(r):void 0;if(i!==void 0){let l=kr.basename(r,kr.extname(r)),c=kr.join(n,`${l}-${i}-light.svg`),f=kr.join(n,`${l}-${i}-dark.svg`);if(await uo(c)&&await uo(f))return cC(c,f,e)}let[o]=await lC(r,{dark:!1,format:"svg",output:n,transparent:!0});i??=await fC(o);let s=`${pC(o)}-${i}-light.svg`;await Qo.rename(o,s);let[a]=await lC(r,{dark:!0,format:"svg",output:n,transparent:!0}),u=`${pC(a)}-${i}-dark.svg`;if(await Qo.rename(a,u),i!==void 0){let l=kr.basename(u),c=kr.basename(s),f=c.replace(`${i}-light.svg`,""),p=await Qo.readdir(n);for(let d of p){let m=kr.basename(d);m!==l&&m!==c&&m.startsWith(f)&&m.endsWith(".svg")&&await Qo.rm(kr.join(n,m))}}return cC(s,u,e)}}};async function cC(t,e,r){let{packageFile:n}=await Or();if(n===void 0)throw new Error("No package file found");let i=kr.dirname(n),o=kr.relative(i,t);return`<picture>
|
|
241
241
|
<source media="(prefers-color-scheme: dark)" srcset="${kr.relative(i,e)}">
|
|
242
242
|
<source media="(prefers-color-scheme: light)" srcset="${o}">
|
|
243
243
|
<img alt="${r}" src="${o}">
|
|
244
|
-
</picture>`}async function
|
|
244
|
+
</picture>`}async function fC(t){let e=await Qo.readFile(t),r=qL.createHash("sha1");return r.update(e),r.digest("hex").slice(0,8)}function pC(t){return t.replace(/\.[^./]+$/,"")}import{getSoleRule as VL}from"remark-mdat";var hC={toc:VL(Vl)};var mC={...gu,...yu,...$A,...Fl,...VA,...Nl,...Pl,...WA,...HA,...Ll,...Ml,...ZA,...QA,...Vl,...Bl,...dC,...hC};async function Gl(t){let e={addMetaComment:!0,rules:mC},{additionalConfig:r=[],...n}=t??{},i=Array.isArray(r)?r:[r],o=await Ai({additionalConfig:[e,...i],...n});if(o.packageFile===void 0)throw new Error("Package file path is required in `mdat readme` config");return o}import aa from"node:path";import HL from"node:process";import KL from"node:path";import Pse,{promises as gC}from"node:fs";import{fileURLToPath as YL}from"node:url";var Od=class{value;next;constructor(e){this.value=e}},sa=class{#e;#t;#r;constructor(){this.clear()}enqueue(e){let r=new Od(e);this.#e?(this.#t.next=r,this.#t=r):(this.#e=r,this.#t=r),this.#r++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#r--,e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#r=0}get size(){return this.#r}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}};function Wl(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=new sa,r=0,n=()=>{r--,e.size>0&&e.dequeue()()},i=async(a,u,l)=>{r++;let c=(async()=>a(...l))();u(c);try{await c}catch{}n()},o=(a,u,l)=>{e.enqueue(i.bind(void 0,a,u,l)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.dequeue()()))()},s=(a,...u)=>new Promise(l=>{o(a,l,u)});return Object.defineProperties(s,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),s}var Hl=class extends Error{constructor(e){super(),this.value=e}},GL=async(t,e)=>e(await t),WL=async t=>{let e=await Promise.all(t);if(e[1]===!0)throw new Hl(e[0]);return!1};async function Dd(t,e,{concurrency:r=Number.POSITIVE_INFINITY,preserveOrder:n=!0}={}){let i=Wl(r),o=[...t].map(a=>[a,i(GL,a,e)]),s=Wl(n?1:Number.POSITIVE_INFINITY);try{await Promise.all(o.map(a=>s(WL,a)))}catch(a){if(a instanceof Hl)return a.value;throw a}}var xC={directory:"isDirectory",file:"isFile"};function ZL(t){if(!Object.hasOwnProperty.call(xC,t))throw new Error(`Invalid type specified: ${t}`)}var XL=(t,e)=>e[xC[t]](),JL=t=>t instanceof URL?YL(t):t;async function Rd(t,{cwd:e=HL.cwd(),type:r="file",allowSymlinks:n=!0,concurrency:i,preserveOrder:o}={}){ZL(r),e=JL(e);let s=n?gC.stat:gC.lstat;return Dd(t,async a=>{try{let u=await s(KL.resolve(e,a));return XL(r,u)}catch{return!1}},{concurrency:i,preserveOrder:o})}import{fileURLToPath as QL}from"node:url";function Fd(t){return t instanceof URL?QL(t):t}var eM=Symbol("findUpStop");async function tM(t,e={}){let r=aa.resolve(Fd(e.cwd)??""),{root:n}=aa.parse(r),i=aa.resolve(r,Fd(e.stopAt??n)),o=e.limit??Number.POSITIVE_INFINITY,s=[t].flat(),a=async l=>{if(typeof t!="function")return Rd(s,l);let c=await t(l.cwd);return typeof c=="string"?Rd([c],l):c},u=[];for(;;){let l=await a({...e,cwd:r});if(l===eM||(l&&u.push(aa.resolve(r,l)),r===i||u.length>=o))break;r=aa.dirname(r)}return u}async function yC(t,e={}){return(await tM(t,{...e,limit:1}))[0]}import rM from"node:path";async function bC({cwd:t}={}){let e=await Ma("package.json",{cwd:t});return e&&rM.dirname(e)}import{log as EC}from"remark-mdat";async function Nd(){EC.info("Searching for package directory...");let t=await bC()??process.cwd(),e=await yC("readme.md",{stopAt:t,type:"file"});if(e!==void 0)return EC.info(`Found closest readme at "${e}"`),e}async function Kl(){let t=await Nd();if(t===void 0)throw new Error("No readme found");return t}async function Yl(t,e,r,n,i){return t??=await Kl(),_n(t,Gl,du,e,r,n,i)}async function AC(t,e,r,n,i){return t??=await Kl(),_n(t,Gl,mu,e,r,n,i)}async function CC(t,e,r,n,i){return t??=await Kl(),_n(t,Gl,hu,e,r,n,i)}import{confirm as IC,group as lM,intro as cM,note as OC,outro as fM,select as Pd}from"@clack/prompts";import pM from"node:fs/promises";import Zl from"node:path";import{deepMergeDefined as dM}from"remark-mdat";var wC=`<!-- title -->
|
|
245
245
|
|
|
246
246
|
<!-- banner -->
|
|
247
247
|
|
|
@@ -294,7 +294,7 @@ _State anyone or anything that significantly helped with the development of your
|
|
|
294
294
|
<!-- contributing -->
|
|
295
295
|
|
|
296
296
|
<!-- license -->
|
|
297
|
-
`;var
|
|
297
|
+
`;var kC=`<!-- header -->
|
|
298
298
|
|
|
299
299
|
<!-- table-of-contents -->
|
|
300
300
|
|
|
@@ -339,7 +339,7 @@ _List maintainer(s) for a repository, along with one way of contacting them (e.g
|
|
|
339
339
|
_State anyone or anything that significantly helped with the development of your project. State public contact hyper-links if applicable._
|
|
340
340
|
|
|
341
341
|
<!-- footer -->
|
|
342
|
-
`;var
|
|
342
|
+
`;var TC=`<!-- title -->
|
|
343
343
|
|
|
344
344
|
<!-- short-description -->
|
|
345
345
|
|
|
@@ -361,7 +361,7 @@ Consider using the <!-- code { src: "path/to/example.ts" } --> comment as well.
|
|
|
361
361
|
<!-- contributing -->
|
|
362
362
|
|
|
363
363
|
<!-- license -->
|
|
364
|
-
`;var
|
|
364
|
+
`;var _C=`<!-- header -->
|
|
365
365
|
|
|
366
366
|
## Install
|
|
367
367
|
|
|
@@ -377,7 +377,7 @@ Consider using the <!-- code { src: "path/to/example.ts" } --> comment as well.
|
|
|
377
377
|
\`\`\`
|
|
378
378
|
|
|
379
379
|
<!-- footer -->
|
|
380
|
-
`;var
|
|
380
|
+
`;var SC=`<!-- title -->
|
|
381
381
|
|
|
382
382
|
<!-- banner -->
|
|
383
383
|
|
|
@@ -448,7 +448,7 @@ _State anyone or anything that significantly helped with the development of your
|
|
|
448
448
|
<!-- contributing -->
|
|
449
449
|
|
|
450
450
|
<!-- license -->
|
|
451
|
-
`;var
|
|
451
|
+
`;var vC=`<!-- header -->
|
|
452
452
|
|
|
453
453
|
_Long description goes here._
|
|
454
454
|
|
|
@@ -511,7 +511,7 @@ _List maintainer(s) for a repository, along with one way of contacting them (e.g
|
|
|
511
511
|
_State anyone or anything that significantly helped with the development of your project. State public contact hyper-links if applicable._
|
|
512
512
|
|
|
513
513
|
<!-- footer -->
|
|
514
|
-
`;var zi={"MDAT Readme":{content:{compound:CC,explicit:AC},description:"The house style. An expansive starting point. Prune to your context and taste.",exampleLink:"https://github.com/kitschpatrol/mdat/blob/main/readme.md"},"Standard Readme Basic":{content:{compound:kC,explicit:wC},description:'Includes only the "required" sections from the Standard Readme specification.',exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/minimal-readme.md"},"Standard Readme Full":{content:{compound:_C,explicit:TC},description:"Includes all sections from the Standard Readme specification.",exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/maximal-readme.md"}};async function IC(){let t=await Nd(),e=await Ba();return{packageDirectory:e===void 0?void 0:Yl.dirname(Yl.resolve(e)),readmePath:t}}async function OC(){let{packageDirectory:t,readmePath:e}=await IC(),r=Yl.resolve(process.cwd());aM(`Running ${St.bold("mdat readme init")} interactively`);let n=await sM({overwrite:async()=>e===void 0||await SC({message:`Found an existing readme at "${St.blue(e)}". Do you want to overwrite it?`,active:"Overwrite",inactive:"Exit"})?!0:(()=>{throw new Error("`mdat readme init` was cancelled to avoid an overwrite - no changes were made")})(),output:async()=>t!==void 0&&t!==r?Pd({initialValue:t,message:"There's a root package directory nearby, do you want to create the readme there instead of the current directory?",options:[{label:`Create in the current package root: "${St.blue(t)}"`,value:t},{label:`Create in current working directory: "${St.blue(r)}"`,value:r}]}):r,template:async()=>Pd({message:"Which template would you like to use?",options:pM()}),compound:async()=>Pd({message:'Do you want to use "compound comments" where possible, which combine several expansions into a single comment block?',options:[{label:`Yes: Combine things like ${St.green("<!-- title -->")} and ${St.green("<!-- badges -->")} in a single ${St.green("<!-- header -->")} comment.`,value:!0},{label:"No: Use individual MDAT expansion comments for each section.",value:!1}]}),expand:async()=>t===void 0?!1:SC({initialValue:!0,message:"Do you want to run `mdat readme` now to expand the template with content from your package.json?"})},{onCancel(){throw new Error("`mdat readme init` was cancelled - no changes were made")}}),i=await Ld(n);return t===void 0&&vC("No package.json was found. Once you've created one, you can run `mdat readme` to expand the template with content from your package.json."),vC(`Readme created: "${St.bold.blue(i)}"`),uM("Done!"),i}async function Ld(t){let{packageDirectory:e}=await IC(),r=cM({compound:!0,output:e??process.cwd(),overwrite:!0,expand:e!==void 0,template:Object.keys(zi)[0]},t??{}),n=fM(r.template,r.compound),i=Yl.join(r.output,"readme.md");await lM.writeFile(i,n,"utf8");let[o]=await Kl(i);return await pn(o),i}function fM(t,e){let n=zi[t].content[e?"compound":"explicit"];if(n===void 0||n==="")throw new Error(`No template found for "${t}"`);return n}function pM(){return Object.entries(zi).map(([t,e])=>({label:t,hint:e.description,value:t}))}var $i={config:{defaultDescription:"Configuration is loaded if found from the usual places, or defaults are used.",description:"Path(s) to files containing MDAT configuration.",string:!0,type:"array"}},ua={meta:{alias:"m",description:"Embed an extra comment at the top of the generated Markdown warning editors that certain sections of the document have been generated dynamically.",type:"boolean"}},la={name:{alias:"n",defaultDescription:"Same name as input file. Overwrites the input file.",description:"Output file name.",type:"string"}},es={output:{alias:"o",defaultDescription:"Same directory as input file.",description:"Output file directory.",type:"string"}},qi={prefix:{description:"Require a string prefix before all comments to be considered for expansion. Useful if you have a bunch of non-MDAT comments in your Markdown file, or if you're willing to trade some verbosity for safety.",type:"string"}},ca={print:{description:"Print the expanded Markdown to stdout instead of saving to a file. Ignores `--output` and `--name` options.",type:"boolean"}},fa={rules:{alias:"r",description:"Path(s) to files containing MDAT comment expansion rules.",string:!0,type:"array"}},Vn={verbose:{describe:"Enable verbose logging. All verbose logs and prefixed with their log level and are printed to stderr for ease of redirection.",type:"boolean"}},Zl=["files",{array:!0,demandOption:!0,describe:"Markdown file(s) with MDAT placeholder comments.",type:"string"}];var Md={package:{defaultDescription:"The closest package.json file is used by default.",description:"Path to the package.json file to use to populate the readme.",string:!0}},Bd={assets:{defaultDescription:"./assets",description:"Path to find and save readme-related assets.",string:!0}},DC={interactive:{alias:"i",default:!0,description:"Run the guided interactive `init` process. Set explicitly to `false` to use default values and skip the prompt.",type:"boolean"}},RC={overwrite:{default:!1,defaultDescription:"`false`, if an existing readme is found, don't touch it.",description:"Replace an existing readme file if one is found.",type:"boolean"}},FC={expand:{alias:"e",default:!0,description:"Automatically run `mdat readme` immediately after creating the readme template.",type:"boolean"}},NC={template:{alias:"t",choices:Object.keys(zi),default:Object.keys(zi)[0],description:"Specify a template to use for the new readme.",type:"string"}},PC={compound:{alias:"c",default:!0,description:"Use compound comment version of the template to replace several individual comment placeholders where possible. This combines things like `<!-- title -->`, `<!-- badges -->`, etc. in a single `<!-- header -->` comment. It's less clutter when you're editing, but it's also less explicit. The final readme.md output is identical.",type:"boolean"}},Xl=["files",{array:!0,demandOption:!1,describe:"Readme file(s) with MDAT placeholder comments. If not provided, the closest readme.md file is used.",type:"string"}];var Vi=performance.now(),LC=em(gc(process.argv));try{await LC.scriptName("mdat").usage("$0 [command]","Work with MDAT placeholder comments in any Markdown file.").command(["$0 <files..> [options]","expand <files..> [options]"],"Expand MDAT placeholder comments.",t=>t.positional(...Zl).option($i).option(fa).option(es).option(la).option(ua).option(qi).option(ca).option(Vn),async({config:t,files:e,meta:r,name:n,output:i,prefix:o,print:s,rules:a,verbose:u})=>{gt.verbose=u??!1,Jl({name:n,output:i,print:s});let l=rs(t,{addMetaComment:r,keywordPrefix:o}),c=await px(e,n,i,l,a);for(let f of c)s?process.stdout.write(f.toString()):await pn(f);ts(c),gt.info(`Expanded comments in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(c)}).command("check <files..> [options]","Validate a Markdown file containing MDAT placeholder comments.",t=>t.positional(...Zl).option($i).option(fa).option(ua).option(qi).option(Vn),async({config:t,files:e,meta:r,prefix:n,rules:i,verbose:o})=>{gt.verbose=o??!1;let s=rs(t,{addMetaComment:r,keywordPrefix:n}),a=await dx(e,void 0,void 0,s,i);ts(a),gt.info(`Checked comments in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(a)}).command("collapse <files..> [options]","Collapse MDAT placeholder comments.",t=>t.positional(...Zl).option($i).option(es).option(la).option(qi).option(ca).option(Vn),async({config:t,files:e,name:r,output:n,prefix:i,print:o,verbose:s})=>{gt.verbose=s??!1,Jl({name:r,output:n,print:o});let a=rs(t,{keywordPrefix:i}),u=await hx(e,void 0,void 0,a);for(let l of u)o?process.stdout.write(l.toString()):await pn(l);ts(u),gt.info(`Cleaned comments in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(u)}).command("readme [command]","Work with MDAT comments in your readme.md.",t=>t.command(["$0 [files..] [options]","expand [files..] [options]"],"Expand MDAT comment placeholders in your readme.md using a collection of helpful built-in expansion rules.",e=>e.positional(...Xl).option($i).option(fa).option(es).option(la).option(Md).option(Bd).option(qi).option(ua).option(ca).option(Vn),async({assets:e,config:r,files:n,meta:i,name:o,output:s,package:a,prefix:u,print:l,rules:c,verbose:f})=>{gt.verbose=f??!1,Jl({name:o,output:s,print:l});let p=rs(r,{addMetaComment:i,assetsPath:e,keywordPrefix:u,packageFile:a}),d=await Kl(n,o,s,p,c);for(let y of d)l?process.stdout.write(y.toString()):await pn(y);ts(d);let{packageFile:m}=await Or();gt.info(`Pulled package metadata from: ${St.bold.blue(m)}`),gt.info(`Expanded readme(s) in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(d)}).command("check [files..] [options]","Validate MDAT placeholder comments in your readme.md.",e=>e.positional(...Xl).option($i).option(fa).option(Md).option(Bd).option(qi).option(ua).option(Vn),async({assets:e,config:r,files:n,meta:i,package:o,prefix:s,rules:a,verbose:u})=>{gt.verbose=u??!1;let l=rs(r,{addMetaComment:i,assetsPath:e,keywordPrefix:s,packageFile:o}),c=await bC(n,void 0,void 0,l,a);ts(c);let{packageFile:f}=await Or();gt.info(`Pulled package metadata from: ${St.bold.blue(f)}`),gt.info(`Checked readme(s) in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(c)}).command("collapse [files..] [options]","Collapse MDAT placeholder comments in your readme.md.",e=>e.positional(...Xl).option(es).option(la).option(ca).option($i).option(qi).option(Vn),async({config:e,files:r,name:n,output:i,prefix:o,print:s,verbose:a})=>{gt.verbose=a??!1,Jl({name:n,output:i,print:s});let u=rs(e,{keywordPrefix:o}),l=await EC(r,void 0,void 0,u);for(let c of l)s?process.stdout.write(c.toString()):await pn(c);ts(l),gt.info(`Cleaned readme(s) in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(l)}).command("init [options]","Interactively create a new readme.md file with sensible default MDAT comment placeholders.",e=>e.option(DC).option(RC).option(es).option(FC).option(NC).option(PC).option(Vn),async({compound:e,expand:r,interactive:n,output:i,overwrite:o,template:s,verbose:a})=>{if(gt.verbose=a??!1,n)await OC();else{let u=await Ld({compound:e,expand:r,output:i,overwrite:o,template:s});gt.info(`Created readme at "${St.blue(u)}" in ${Kr(performance.now()-Vi)}.`)}process.exitCode=0}),()=>{gt.error("Root MDAT readme command should be unreachable.")}).help().alias("h","help").version(tm).alias("v","version").wrap(process.stdout.isTTY?Math.min(120,LC.terminalWidth()):0).fail(!1).parse()}catch(t){t instanceof Error&>.error(t.message),process.exitCode=1}function Jl(t){t.print&&t.output&>.warn("Ignoring --output option because --print is set"),t.print&&t.name&>.warn("Ignoring --name option because --print is set")}function rs(t,e){return[...ja(t),e]}function ns(t){return dM(t).reduce((n,i)=>n+i.errors.length,0)>0?1:0}
|
|
514
|
+
`;var zi={"MDAT Readme":{content:{compound:kC,explicit:wC},description:"The house style. An expansive starting point. Prune to your context and taste.",exampleLink:"https://github.com/kitschpatrol/mdat/blob/main/readme.md"},"Standard Readme Basic":{content:{compound:_C,explicit:TC},description:'Includes only the "required" sections from the Standard Readme specification.',exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/minimal-readme.md"},"Standard Readme Full":{content:{compound:vC,explicit:SC},description:"Includes all sections from the Standard Readme specification.",exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/maximal-readme.md"}};async function DC(){let t=await Nd(),e=await Ba();return{packageDirectory:e===void 0?void 0:Zl.dirname(Zl.resolve(e)),readmePath:t}}async function RC(){let{packageDirectory:t,readmePath:e}=await DC(),r=Zl.resolve(process.cwd());cM(`Running ${St.bold("mdat readme init")} interactively`);let n=await lM({overwrite:async()=>e===void 0||await IC({message:`Found an existing readme at "${St.blue(e)}". Do you want to overwrite it?`,active:"Overwrite",inactive:"Exit"})?!0:(()=>{throw new Error("`mdat readme init` was cancelled to avoid an overwrite - no changes were made")})(),output:async()=>t!==void 0&&t!==r?Pd({initialValue:t,message:"There's a root package directory nearby, do you want to create the readme there instead of the current directory?",options:[{label:`Create in the current package root: "${St.blue(t)}"`,value:t},{label:`Create in current working directory: "${St.blue(r)}"`,value:r}]}):r,template:async()=>Pd({message:"Which template would you like to use?",options:mM()}),compound:async()=>Pd({message:'Do you want to use "compound comments" where possible, which combine several expansions into a single comment block?',options:[{label:`Yes: Combine things like ${St.green("<!-- title -->")} and ${St.green("<!-- badges -->")} in a single ${St.green("<!-- header -->")} comment.`,value:!0},{label:"No: Use individual MDAT expansion comments for each section.",value:!1}]}),expand:async()=>t===void 0?!1:IC({initialValue:!0,message:"Do you want to run `mdat readme` now to expand the template with content from your package.json?"})},{onCancel(){throw new Error("`mdat readme init` was cancelled - no changes were made")}}),i=await Ld(n);return t===void 0&&OC("No package.json was found. Once you've created one, you can run `mdat readme` to expand the template with content from your package.json."),OC(`Readme created: "${St.bold.blue(i)}"`),fM("Done!"),i}async function Ld(t){let{packageDirectory:e}=await DC(),r=dM({compound:!0,output:e??process.cwd(),overwrite:!0,expand:e!==void 0,template:Object.keys(zi)[0]},t??{}),n=hM(r.template,r.compound),i=Zl.join(r.output,"readme.md");await pM.writeFile(i,n,"utf8");let[o]=await Yl(i);return await pn(o),i}function hM(t,e){let n=zi[t].content[e?"compound":"explicit"];if(n===void 0||n==="")throw new Error(`No template found for "${t}"`);return n}function mM(){return Object.entries(zi).map(([t,e])=>({label:t,hint:e.description,value:t}))}var $i={config:{defaultDescription:"Configuration is loaded if found from the usual places, or defaults are used.",description:"Path(s) to files containing MDAT configuration.",string:!0,type:"array"}},ua={meta:{alias:"m",description:"Embed an extra comment at the top of the generated Markdown warning editors that certain sections of the document have been generated dynamically.",type:"boolean"}},la={name:{alias:"n",defaultDescription:"Same name as input file. Overwrites the input file.",description:"Output file name.",type:"string"}},es={output:{alias:"o",defaultDescription:"Same directory as input file.",description:"Output file directory.",type:"string"}},qi={prefix:{description:"Require a string prefix before all comments to be considered for expansion. Useful if you have a bunch of non-MDAT comments in your Markdown file, or if you're willing to trade some verbosity for safety.",type:"string"}},ca={print:{description:"Print the expanded Markdown to stdout instead of saving to a file. Ignores `--output` and `--name` options.",type:"boolean"}},fa={rules:{alias:"r",description:"Path(s) to files containing MDAT comment expansion rules.",string:!0,type:"array"}},Vn={verbose:{describe:"Enable verbose logging. All verbose logs and prefixed with their log level and are printed to stderr for ease of redirection.",type:"boolean"}},Xl=["files",{array:!0,demandOption:!0,describe:"Markdown file(s) with MDAT placeholder comments.",type:"string"}];var Md={package:{defaultDescription:"The closest package.json file is used by default.",description:"Path to the package.json file to use to populate the readme.",string:!0}},Bd={assets:{defaultDescription:"./assets",description:"Path to find and save readme-related assets.",string:!0}},FC={interactive:{alias:"i",default:!0,description:"Run the guided interactive `init` process. Set explicitly to `false` to use default values and skip the prompt.",type:"boolean"}},NC={overwrite:{default:!1,defaultDescription:"`false`, if an existing readme is found, don't touch it.",description:"Replace an existing readme file if one is found.",type:"boolean"}},PC={expand:{alias:"e",default:!0,description:"Automatically run `mdat readme` immediately after creating the readme template.",type:"boolean"}},LC={template:{alias:"t",choices:Object.keys(zi),default:Object.keys(zi)[0],description:"Specify a template to use for the new readme.",type:"string"}},MC={compound:{alias:"c",default:!0,description:"Use compound comment version of the template to replace several individual comment placeholders where possible. This combines things like `<!-- title -->`, `<!-- badges -->`, etc. in a single `<!-- header -->` comment. It's less clutter when you're editing, but it's also less explicit. The final readme.md output is identical.",type:"boolean"}},Jl=["files",{array:!0,demandOption:!1,describe:"Readme file(s) with MDAT placeholder comments. If not provided, the closest readme.md file is used.",type:"string"}];var Vi=performance.now(),BC=em(xc(process.argv));try{await BC.scriptName("mdat").usage("$0 [command]","Work with MDAT placeholder comments in any Markdown file.").command(["$0 <files..> [options]","expand <files..> [options]"],"Expand MDAT placeholder comments.",t=>t.positional(...Xl).option($i).option(fa).option(es).option(la).option(ua).option(qi).option(ca).option(Vn),async({config:t,files:e,meta:r,name:n,output:i,prefix:o,print:s,rules:a,verbose:u})=>{gt.verbose=u??!1,Ql({name:n,output:i,print:s});let l=rs(t,{addMetaComment:r,keywordPrefix:o}),c=await hx(e,n,i,l,a);for(let f of c)s?process.stdout.write(f.toString()):await pn(f);ts(c),gt.info(`Expanded comments in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(c)}).command("check <files..> [options]","Validate a Markdown file containing MDAT placeholder comments.",t=>t.positional(...Xl).option($i).option(fa).option(ua).option(qi).option(Vn),async({config:t,files:e,meta:r,prefix:n,rules:i,verbose:o})=>{gt.verbose=o??!1;let s=rs(t,{addMetaComment:r,keywordPrefix:n}),a=await mx(e,void 0,void 0,s,i);ts(a),gt.info(`Checked comments in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(a)}).command("collapse <files..> [options]","Collapse MDAT placeholder comments.",t=>t.positional(...Xl).option($i).option(es).option(la).option(qi).option(ca).option(Vn),async({config:t,files:e,name:r,output:n,prefix:i,print:o,verbose:s})=>{gt.verbose=s??!1,Ql({name:r,output:n,print:o});let a=rs(t,{keywordPrefix:i}),u=await gx(e,void 0,void 0,a);for(let l of u)o?process.stdout.write(l.toString()):await pn(l);ts(u),gt.info(`Cleaned comments in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(u)}).command("readme [command]","Work with MDAT comments in your readme.md.",t=>t.command(["$0 [files..] [options]","expand [files..] [options]"],"Expand MDAT comment placeholders in your readme.md using a collection of helpful built-in expansion rules.",e=>e.positional(...Jl).option($i).option(fa).option(es).option(la).option(Md).option(Bd).option(qi).option(ua).option(ca).option(Vn),async({assets:e,config:r,files:n,meta:i,name:o,output:s,package:a,prefix:u,print:l,rules:c,verbose:f})=>{gt.verbose=f??!1,Ql({name:o,output:s,print:l});let p=rs(r,{addMetaComment:i,assetsPath:e,keywordPrefix:u,packageFile:a}),d=await Yl(n,o,s,p,c);for(let y of d)l?process.stdout.write(y.toString()):await pn(y);ts(d);let{packageFile:m}=await Or();gt.info(`Pulled package metadata from: ${St.bold.blue(m)}`),gt.info(`Expanded readme(s) in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(d)}).command("check [files..] [options]","Validate MDAT placeholder comments in your readme.md.",e=>e.positional(...Jl).option($i).option(fa).option(Md).option(Bd).option(qi).option(ua).option(Vn),async({assets:e,config:r,files:n,meta:i,package:o,prefix:s,rules:a,verbose:u})=>{gt.verbose=u??!1;let l=rs(r,{addMetaComment:i,assetsPath:e,keywordPrefix:s,packageFile:o}),c=await AC(n,void 0,void 0,l,a);ts(c);let{packageFile:f}=await Or();gt.info(`Pulled package metadata from: ${St.bold.blue(f)}`),gt.info(`Checked readme(s) in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(c)}).command("collapse [files..] [options]","Collapse MDAT placeholder comments in your readme.md.",e=>e.positional(...Jl).option(es).option(la).option(ca).option($i).option(qi).option(Vn),async({config:e,files:r,name:n,output:i,prefix:o,print:s,verbose:a})=>{gt.verbose=a??!1,Ql({name:n,output:i,print:s});let u=rs(e,{keywordPrefix:o}),l=await CC(r,void 0,void 0,u);for(let c of l)s?process.stdout.write(c.toString()):await pn(c);ts(l),gt.info(`Cleaned readme(s) in ${Kr(performance.now()-Vi)}.`),process.exitCode=ns(l)}).command("init [options]","Interactively create a new readme.md file with sensible default MDAT comment placeholders.",e=>e.option(FC).option(NC).option(es).option(PC).option(LC).option(MC).option(Vn),async({compound:e,expand:r,interactive:n,output:i,overwrite:o,template:s,verbose:a})=>{if(gt.verbose=a??!1,n)await RC();else{let u=await Ld({compound:e,expand:r,output:i,overwrite:o,template:s});gt.info(`Created readme at "${St.blue(u)}" in ${Kr(performance.now()-Vi)}.`)}process.exitCode=0}),()=>{gt.error("Root MDAT readme command should be unreachable.")}).help().alias("h","help").version(tm).alias("v","version").wrap(process.stdout.isTTY?Math.min(120,BC.terminalWidth()):0).fail(!1).parse()}catch(t){t instanceof Error&>.error(t.message),process.exitCode=1}function Ql(t){t.print&&t.output&>.warn("Ignoring --output option because --print is set"),t.print&&t.name&>.warn("Ignoring --name option because --print is set")}function rs(t,e){return[...ja(t),e]}function ns(t){return gM(t).reduce((n,i)=>n+i.errors.length,0)>0?1:0}
|
|
515
515
|
/*! Bundled license information:
|
|
516
516
|
|
|
517
517
|
yargs-parser/build/lib/string-utils.js:
|