(function(r){typeof define=="function"&&define.amd?define(r):r()})(function(){"use strict";var z=Object.defineProperty;var C=(r,e,t)=>e in r?z(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var R=(r,e,t)=>(C(r,typeof e!="symbol"?e+"":e,t),t);const KEYS=["if","if_any","show_when","show_when_any","unless","unless_any","hide_when","hide_when_any"],OPERATORS=["equals","not","contains","contains_any","===","!==",">",">=","<","<=","custom"],ALIASES={is:"equals","==":"equals",isnt:"not","!=":"not",includes:"contains",includes_any:"contains_any"};var VERSION="1.13.6",root=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},ArrayProto=Array.prototype,ObjProto=Object.prototype,push=ArrayProto.push,slice=ArrayProto.slice,toString=ObjProto.toString,hasOwnProperty=ObjProto.hasOwnProperty,nativeIsArray=Array.isArray,nativeKeys=Object.keys,_isNaN=isNaN,hasEnumBug=!{toString:null}.propertyIsEnumerable("toString"),nonEnumerableProps=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],MAX_ARRAY_INDEX=Math.pow(2,53)-1;function _(r){if(r instanceof _)return r;if(!(this instanceof _))return new _(r);this._wrapped=r}_.VERSION=VERSION,_.prototype.value=function(){return this._wrapped},_.prototype.valueOf=_.prototype.toJSON=_.prototype.value,_.prototype.toString=function(){return String(this._wrapped)};function identity(r){return r}function tagTester(r){var e="[object "+r+"]";return function(t){return toString.call(t)===e}}var isFunction=tagTester("Function"),nodelist=root.document&&root.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof nodelist!="function"&&(isFunction=function(r){return typeof r=="function"||!1});const isFunction$1=isFunction;function isObject(r){var e=typeof r;return e==="function"||e==="object"&&!!r}const isArray=nativeIsArray||tagTester("Array");function createAssigner(r,e){return function(t){var n=arguments.length;if(e&&(t=Object(t)),n<2||t==null)return t;for(var s=1;s=0&&t<=MAX_ARRAY_INDEX}}function shallowProperty(r){return function(e){return e==null?void 0:e[r]}}const getLength=shallowProperty("length"),isArrayLike=createSizePropertyCheck(getLength);function map(r,e,t){e=cb(e,t);for(var n=!isArrayLike(r)&&keys(r),s=(n||r).length,l=Array(s),o=0;othis.splitRhs(s,n,t))}toBlueprint(e){let t={};return each(e,n=>{t[n.field]=this.combineRhs(n)}),t}splitRhs(e,t,n=null){return{field:this.getScopedFieldHandle(e,n),operator:this.getOperatorFromRhs(t),value:this.getValueFromRhs(t)}}getScopedFieldHandle(e,t){return e.startsWith("root.")||!t?e:t+e}getOperatorFromRhs(e){let t="==";return chain(this.getOperatorsAndAliases()).filter(n=>new RegExp(`^${n} [^=]`).test(this.normalizeConditionString(e))).each(n=>t=n),this.normalizeOperator(t)}normalizeOperator(e){return ALIASES[e]?ALIASES[e]:e}getValueFromRhs(e){let t=this.normalizeConditionString(e);return chain(this.getOperatorsAndAliases()).filter(n=>new RegExp(`^${n} [^=]`).test(t)).each(n=>t=t.replace(new RegExp(`^${n}[ ]*`),"")),t}combineRhs(e){let t=e.operator?e.operator.trim():"",n=e.value.trim();return`${t} ${n}`.trim()}getOperatorsAndAliases(){return OPERATORS.concat(Object.keys(ALIASES))}normalizeConditionString(e){return e===null?"null":e===""?"empty":e.toString()}}function getDefaults(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let defaults=getDefaults();function changeDefaults(r){defaults=r}const escapeTest=/[&<>"']/,escapeReplace=new RegExp(escapeTest.source,"g"),escapeTestNoEncode=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode=new RegExp(escapeTestNoEncode.source,"g"),escapeReplacements={"&":"&","<":"<",">":">",'"':""","'":"'"},getEscapeReplacement=r=>escapeReplacements[r];function escape(r,e){if(e){if(escapeTest.test(r))return r.replace(escapeReplace,getEscapeReplacement)}else if(escapeTestNoEncode.test(r))return r.replace(escapeReplaceNoEncode,getEscapeReplacement);return r}const unescapeTest=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function unescape(r){return r.replace(unescapeTest,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const caret=/(^|[^\[])\^/g;function edit(r,e){r=typeof r=="string"?r:r.source,e=e||"";const t={replace:(n,s)=>(s=s.source||s,s=s.replace(caret,"$1"),r=r.replace(n,s),t),getRegex:()=>new RegExp(r,e)};return t}const nonWordAndColonTest=/[^\w:]/g,originIndependentUrl=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function cleanUrl(r,e,t){if(r){let n;try{n=decodeURIComponent(unescape(t)).replace(nonWordAndColonTest,"").toLowerCase()}catch{return null}if(n.indexOf("javascript:")===0||n.indexOf("vbscript:")===0||n.indexOf("data:")===0)return null}e&&!originIndependentUrl.test(t)&&(t=resolveUrl(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const baseUrls={},justDomain=/^[^:]+:\/*[^/]*$/,protocol=/^([^:]+:)[\s\S]*$/,domain=/^([^:]+:\/*[^/]*)[\s\S]*$/;function resolveUrl(r,e){baseUrls[" "+r]||(justDomain.test(r)?baseUrls[" "+r]=r+"/":baseUrls[" "+r]=rtrim(r,"/",!0)),r=baseUrls[" "+r];const t=r.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:r.replace(protocol,"$1")+e:e.charAt(0)==="/"?t?e:r.replace(domain,"$1")+e:r+e}const noopTest={exec:function(){}};function splitCells(r,e){const t=r.replace(/\|/g,(l,o,a)=>{let c=!1,p=o;for(;--p>=0&&a[p]==="\\";)c=!c;return c?"|":" |"}),n=t.split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>e)n.splice(e);else for(;n.length1;)e&1&&(t+=r),e>>=1,r+=r;return t+r}function outputLink(r,e,t,n){const s=e.href,l=e.title?escape(e.title):null,o=r[1].replace(/\\([\[\]])/g,"$1");if(r[0].charAt(0)!=="!"){n.state.inLink=!0;const a={type:"link",raw:t,href:s,title:l,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,a}return{type:"image",raw:t,href:s,title:l,text:escape(o)}}function indentCodeCompensation(r,e){const t=r.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(` `).map(s=>{const l=s.match(/^\s+/);if(l===null)return s;const[o]=l;return o.length>=n.length?s.slice(n.length):s}).join(` `)}class Tokenizer{constructor(e){this.options=e||defaults}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:rtrim(n,` `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],s=indentCodeCompensation(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:s}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const s=rtrim(n,"#");(this.options.pedantic||!s||/ $/.test(s))&&(n=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const n=t[0].replace(/^ *>[ \t]?/gm,""),s=this.lexer.state.top;this.lexer.state.top=!0;const l=this.lexer.blockTokens(n);return this.lexer.state.top=s,{type:"blockquote",raw:t[0],tokens:l,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,s,l,o,a,c,p,h,f,g,u,x,k=t[1].trim();const S=k.length>1,d={type:"list",raw:"",ordered:S,start:S?+k.slice(0,-1):"",loose:!1,items:[]};k=S?`\\d{1,9}\\${k.slice(-1)}`:`\\${k}`,this.options.pedantic&&(k=S?k:"[*+-]");const m=new RegExp(`^( {0,3}${k})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(x=!1,!(!(t=m.exec(e))||this.rules.block.hr.test(e)));){if(n=t[0],e=e.substring(n.length),h=t[2].split(` `,1)[0].replace(/^\t+/,y=>" ".repeat(3*y.length)),f=e.split(` `,1)[0],this.options.pedantic?(o=2,u=h.trimLeft()):(o=t[2].search(/[^ ]/),o=o>4?1:o,u=h.slice(o),o+=t[1].length),c=!1,!h&&/^ *$/.test(f)&&(n+=f+` `,e=e.substring(f.length+1),x=!0),!x){const y=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),b=new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),v=new RegExp(`^ {0,${Math.min(3,o-1)}}#`);for(;e&&(g=e.split(` `,1)[0],f=g,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(w.test(f)||v.test(f)||y.test(f)||b.test(e)));){if(f.search(/[^ ]/)>=o||!f.trim())u+=` `+f.slice(o);else{if(c||h.search(/[^ ]/)>=4||w.test(h)||v.test(h)||b.test(h))break;u+=` `+f}!c&&!f.trim()&&(c=!0),n+=g+` `,e=e.substring(g.length+1),h=f.slice(o)}}d.loose||(p?d.loose=!0:/\n *\n *$/.test(n)&&(p=!0)),this.options.gfm&&(s=/^\[[ xX]\] /.exec(u),s&&(l=s[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),d.items.push({type:"list_item",raw:n,task:!!s,checked:l,loose:!1,text:u}),d.raw+=n}d.items[d.items.length-1].raw=n.trimRight(),d.items[d.items.length-1].text=u.trimRight(),d.raw=d.raw.trimRight();const $=d.items.length;for(a=0;a<$;a++)if(this.lexer.state.top=!1,d.items[a].tokens=this.lexer.blockTokens(d.items[a].text,[]),!d.loose){const y=d.items[a].tokens.filter(w=>w.type==="space"),b=y.length>0&&y.some(w=>/\n.*\n/.test(w.raw));d.loose=b}if(d.loose)for(a=0;a<$;a++)d.items[a].loose=!0;return d}}html(e){const t=this.rules.block.html.exec(e);if(t){const n={type:"html",raw:t[0],pre:!this.options.sanitizer&&(t[1]==="pre"||t[1]==="script"||t[1]==="style"),text:t[0]};if(this.options.sanitize){const s=this.options.sanitizer?this.options.sanitizer(t[0]):escape(t[0]);n.type="paragraph",n.text=s,n.tokens=this.lexer.inline(s)}return n}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(/\s+/g," "),s=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",l=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:s,title:l}}}table(e){const t=this.rules.block.table.exec(e);if(t){const n={type:"table",header:splitCells(t[1]).map(s=>({text:s})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(` `):[]};if(n.header.length===n.align.length){n.raw=t[0];let s=n.align.length,l,o,a,c;for(l=0;l({text:p}));for(s=n.header.length,o=0;o/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):escape(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;const o=rtrim(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=findClosingBracket(t[2],"()");if(o>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let s=t[2],l="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);o&&(s=o[1],l=o[3])}else l=t[3]?t[3].slice(1,-1):"";return s=s.trim(),/^$/.test(n)?s=s.slice(1):s=s.slice(1,-1)),outputLink(t,{href:s&&s.replace(this.rules.inline._escapes,"$1"),title:l&&l.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let s=(n[2]||n[1]).replace(/\s+/g," ");if(s=t[s.toLowerCase()],!s){const l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return outputLink(n,s,n[0],this.lexer)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrong.lDelim.exec(e);if(!s||s[3]&&n.match(/[\p{L}\p{N}]/u))return;const l=s[1]||s[2]||"";if(!l||l&&(n===""||this.rules.inline.punctuation.exec(n))){const o=s[0].length-1;let a,c,p=o,h=0;const f=s[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+o);(s=f.exec(t))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(c=a.length,s[3]||s[4]){p+=c;continue}else if((s[5]||s[6])&&o%3&&!((o+c)%3)){h+=c;continue}if(p-=c,p>0)continue;c=Math.min(c,c+p+h);const g=e.slice(0,o+s.index+(s[0].length-a.length)+c);if(Math.min(o,c)%2){const x=g.slice(1,-1);return{type:"em",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}const u=g.slice(2,-2);return{type:"strong",raw:g,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const s=/[^ ]/.test(n),l=/^ /.test(n)&&/ $/.test(n);return s&&l&&(n=n.substring(1,n.length-1)),n=escape(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let s,l;return n[2]==="@"?(s=escape(this.options.mangle?t(n[1]):n[1]),l="mailto:"+s):(s=escape(n[1]),l=s),{type:"link",raw:n[0],text:s,href:l,tokens:[{type:"text",raw:s,text:s}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let s,l;if(n[2]==="@")s=escape(this.options.mangle?t(n[0]):n[0]),l="mailto:"+s;else{let o;do o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(o!==n[0]);s=escape(n[0]),n[1]==="www."?l="http://"+n[0]:l=n[0]}return{type:"link",raw:n[0],text:s,href:l,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let s;return this.lexer.state.inRawBlock?s=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):escape(n[0]):n[0]:s=escape(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:s}}}}const block={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:noopTest,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};block._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,block._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,block.def=edit(block.def).replace("label",block._label).replace("title",block._title).getRegex(),block.bullet=/(?:[*+-]|\d{1,9}[.)])/,block.listItemStart=edit(/^( *)(bull) */).replace("bull",block.bullet).getRegex(),block.list=edit(block.list).replace(/bull/g,block.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+block.def.source+")").getRegex(),block._tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",block._comment=/|$)/,block.html=edit(block.html,"i").replace("comment",block._comment).replace("tag",block._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),block.paragraph=edit(block._paragraph).replace("hr",block.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",block._tag).getRegex(),block.blockquote=edit(block.blockquote).replace("paragraph",block.paragraph).getRegex(),block.normal={...block},block.gfm={...block.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},block.gfm.table=edit(block.gfm.table).replace("hr",block.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",block._tag).getRegex(),block.gfm.paragraph=edit(block._paragraph).replace("hr",block.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",block.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",block._tag).getRegex(),block.pedantic={...block.normal,html:edit(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",block._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:noopTest,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:edit(block.normal._paragraph).replace("hr",block.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",block.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const inline={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:noopTest,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:noopTest,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",inline.punctuation=edit(inline.punctuation).replace(/punctuation/g,inline._punctuation).getRegex(),inline.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,inline.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,inline._comment=edit(block._comment).replace("(?:-->|$)","-->").getRegex(),inline.emStrong.lDelim=edit(inline.emStrong.lDelim).replace(/punct/g,inline._punctuation).getRegex(),inline.emStrong.rDelimAst=edit(inline.emStrong.rDelimAst,"g").replace(/punct/g,inline._punctuation).getRegex(),inline.emStrong.rDelimUnd=edit(inline.emStrong.rDelimUnd,"g").replace(/punct/g,inline._punctuation).getRegex(),inline._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,inline._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,inline._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,inline.autolink=edit(inline.autolink).replace("scheme",inline._scheme).replace("email",inline._email).getRegex(),inline._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,inline.tag=edit(inline.tag).replace("comment",inline._comment).replace("attribute",inline._attribute).getRegex(),inline._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,inline._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,inline._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,inline.link=edit(inline.link).replace("label",inline._label).replace("href",inline._href).replace("title",inline._title).getRegex(),inline.reflink=edit(inline.reflink).replace("label",inline._label).replace("ref",block._label).getRegex(),inline.nolink=edit(inline.nolink).replace("ref",block._label).getRegex(),inline.reflinkSearch=edit(inline.reflinkSearch,"g").replace("reflink",inline.reflink).replace("nolink",inline.nolink).getRegex(),inline.normal={...inline},inline.pedantic={...inline.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:edit(/^!?\[(label)\]\((.*?)\)/).replace("label",inline._label).getRegex(),reflink:edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",inline._label).getRegex()},inline.gfm={...inline.normal,escape:edit(inline.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),e+="&#"+n+";";return e}class Lexer{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||defaults,this.options.tokenizer=this.options.tokenizer||new Tokenizer,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:block.normal,inline:inline.normal};this.options.pedantic?(t.block=block.pedantic,t.inline=inline.pedantic):this.options.gfm&&(t.block=block.gfm,this.options.breaks?t.inline=inline.breaks:t.inline=inline.gfm),this.tokenizer.rules=t}static get rules(){return{block,inline}}static lex(e,t){return new Lexer(t).lex(e)}static lexInline(e,t){return new Lexer(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,` `),this.blockTokens(e,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(a,c,p)=>c+" ".repeat(p.length));let n,s,l,o;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(n=a.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=` `:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=` `+n.raw,s.text+=` `+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=` `+n.raw,s.text+=` `+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(l=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const c=e.slice(1);let p;this.options.extensions.startBlock.forEach(function(h){p=h.call({lexer:this},c),typeof p=="number"&&p>=0&&(a=Math.min(a,p))}),a<1/0&&a>=0&&(l=e.substring(0,a+1))}if(this.state.top&&(n=this.tokenizer.paragraph(l))){s=t[t.length-1],o&&s.type==="paragraph"?(s.raw+=` `+n.raw,s.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),o=l.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&s.type==="text"?(s.raw+=` `+n.raw,s.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,s,l,o=e,a,c,p;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)h.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+repeatString("a",a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+repeatString("a",a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(o))!=null;)o=o.slice(0,a.index+a[0].length-2)+"++"+o.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(c||(p=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(n=h.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),s=t[t.length-1],s&&n.type==="text"&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),s=t[t.length-1],s&&n.type==="text"&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,o,p)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e,mangle)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e,mangle))){e=e.substring(n.raw.length),t.push(n);continue}if(l=e,this.options.extensions&&this.options.extensions.startInline){let h=1/0;const f=e.slice(1);let g;this.options.extensions.startInline.forEach(function(u){g=u.call({lexer:this},f),typeof g=="number"&&g>=0&&(h=Math.min(h,g))}),h<1/0&&h>=0&&(l=e.substring(0,h+1))}if(n=this.tokenizer.inlineText(l,smartypants)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(p=n.raw.slice(-1)),c=!0,s=t[t.length-1],s&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}}class Renderer{constructor(e){this.options=e||defaults}code(e,t,n){const s=(t||"").match(/\S*/)[0];if(this.options.highlight){const l=this.options.highlight(e,s);l!=null&&l!==e&&(n=!0,e=l)}return e=e.replace(/\n$/,"")+` `,s?'
'+(n?e:escape(e,!0))+`
`:"
"+(n?e:escape(e,!0))+`
`}blockquote(e){return`
${e}
`}html(e){return e}heading(e,t,n,s){if(this.options.headerIds){const l=this.options.headerPrefix+s.slug(n);return`${e} `}return`${e} `}hr(){return this.options.xhtml?`
`:`
`}list(e,t,n){const s=t?"ol":"ul",l=t&&n!==1?' start="'+n+'"':"";return"<"+s+l+`> `+e+" `}listitem(e){return`
  • ${e}
  • `}checkbox(e){return" "}paragraph(e){return`

    ${e}

    `}table(e,t){return t&&(t=`${t}`),` `+e+` `+t+`
    `}tablerow(e){return` ${e} `}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+` `}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return this.options.xhtml?"
    ":"
    "}del(e){return`${e}`}link(e,t,n){if(e=cleanUrl(this.options.sanitize,this.options.baseUrl,e),e===null)return n;let s='",s}image(e,t,n){if(e=cleanUrl(this.options.sanitize,this.options.baseUrl,e),e===null)return n;let s=`${n}":">",s}text(e){return e}}class TextRenderer{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class Slugger{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,s=0;if(this.seen.hasOwnProperty(n)){s=this.seen[e];do s++,n=e+"-"+s;while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=s,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class Parser{constructor(e){this.options=e||defaults,this.options.renderer=this.options.renderer||new Renderer,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new TextRenderer,this.slugger=new Slugger}static parse(e,t){return new Parser(t).parse(e)}static parseInline(e,t){return new Parser(t).parseInline(e)}parse(e,t=!0){let n="",s,l,o,a,c,p,h,f,g,u,x,k,S,d,m,$,y,b,w;const v=e.length;for(s=0;s0&&m.tokens[0].type==="paragraph"?(m.tokens[0].text=b+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&m.tokens[0].tokens[0].type==="text"&&(m.tokens[0].tokens[0].text=b+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:b}):d+=b),d+=this.parse(m.tokens,S),g+=this.renderer.listitem(d,y,$);n+=this.renderer.list(g,x,k);continue}case"html":{n+=this.renderer.html(u.text);continue}case"paragraph":{n+=this.renderer.paragraph(this.parseInline(u.tokens));continue}case"text":{for(g=u.tokens?this.parseInline(u.tokens):u.text;s+1{if(n.message+=` Please report this to https://github.com/markedjs/marked.`,r){const s="

    An error occurred:

    "+escape(n.message+"",!0)+"
    ";if(e)return Promise.resolve(s);if(t){t(null,s);return}return s}if(e)return Promise.reject(n);if(t){t(n);return}throw n}}function parseMarkdown(r,e){return(t,n,s)=>{typeof n=="function"&&(s=n,n=null);const l={...n};n={...marked.defaults,...l};const o=onError(n.silent,n.async,s);if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(checkSanitizeDeprecation(n),n.hooks&&(n.hooks.options=n),s){const a=n.highlight;let c;try{n.hooks&&(t=n.hooks.preprocess(t)),c=r(t,n)}catch(f){return o(f)}const p=function(f){let g;if(!f)try{n.walkTokens&&marked.walkTokens(c,n.walkTokens),g=e(c,n),n.hooks&&(g=n.hooks.postprocess(g))}catch(u){f=u}return n.highlight=a,f?o(f):s(null,g)};if(!a||a.length<3||(delete n.highlight,!c.length))return p();let h=0;marked.walkTokens(c,function(f){f.type==="code"&&(h++,setTimeout(()=>{a(f.text,f.lang,function(g,u){if(g)return p(g);u!=null&&u!==f.text&&(f.text=u,f.escaped=!0),h--,h===0&&p()})},0))}),h===0&&p();return}if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(t):t).then(a=>r(a,n)).then(a=>n.walkTokens?Promise.all(marked.walkTokens(a,n.walkTokens)).then(()=>a):a).then(a=>e(a,n)).then(a=>n.hooks?n.hooks.postprocess(a):a).catch(o);try{n.hooks&&(t=n.hooks.preprocess(t));const a=r(t,n);n.walkTokens&&marked.walkTokens(a,n.walkTokens);let c=e(a,n);return n.hooks&&(c=n.hooks.postprocess(c)),c}catch(a){return o(a)}}}function marked(r,e,t){return parseMarkdown(Lexer.lex,Parser.parse)(r,e,t)}marked.options=marked.setOptions=function(r){return marked.defaults={...marked.defaults,...r},changeDefaults(marked.defaults),marked},marked.getDefaults=getDefaults,marked.defaults=defaults,marked.use=function(...r){const e=marked.defaults.extensions||{renderers:{},childTokens:{}};r.forEach(t=>{const n={...t};if(n.async=marked.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if(s.renderer){const l=e.renderers[s.name];l?e.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=l.apply(this,o)),a}:e.renderers[s.name]=s.renderer}if(s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[s.level]?e[s.level].unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),n.extensions=e),t.renderer){const s=marked.defaults.renderer||new Renderer;for(const l in t.renderer){const o=s[l];s[l]=(...a)=>{let c=t.renderer[l].apply(s,a);return c===!1&&(c=o.apply(s,a)),c}}n.renderer=s}if(t.tokenizer){const s=marked.defaults.tokenizer||new Tokenizer;for(const l in t.tokenizer){const o=s[l];s[l]=(...a)=>{let c=t.tokenizer[l].apply(s,a);return c===!1&&(c=o.apply(s,a)),c}}n.tokenizer=s}if(t.hooks){const s=marked.defaults.hooks||new Hooks;for(const l in t.hooks){const o=s[l];Hooks.passThroughHooks.has(l)?s[l]=a=>{if(marked.defaults.async)return Promise.resolve(t.hooks[l].call(s,a)).then(p=>o.call(s,p));const c=t.hooks[l].call(s,a);return o.call(s,c)}:s[l]=(...a)=>{let c=t.hooks[l].apply(s,a);return c===!1&&(c=o.apply(s,a)),c}}n.hooks=s}if(t.walkTokens){const s=marked.defaults.walkTokens;n.walkTokens=function(l){let o=[];return o.push(t.walkTokens.call(this,l)),s&&(o=o.concat(s.call(this,l))),o}}marked.setOptions(n)})},marked.walkTokens=function(r,e){let t=[];for(const n of r)switch(t=t.concat(e.call(marked,n)),n.type){case"table":{for(const s of n.header)t=t.concat(marked.walkTokens(s.tokens,e));for(const s of n.rows)for(const l of s)t=t.concat(marked.walkTokens(l.tokens,e));break}case"list":{t=t.concat(marked.walkTokens(n.items,e));break}default:marked.defaults.extensions&&marked.defaults.extensions.childTokens&&marked.defaults.extensions.childTokens[n.type]?marked.defaults.extensions.childTokens[n.type].forEach(function(s){t=t.concat(marked.walkTokens(n[s],e))}):n.tokens&&(t=t.concat(marked.walkTokens(n.tokens,e)))}return t},marked.parseInline=parseMarkdown(Lexer.lexInline,Parser.parseInline),marked.Parser=Parser,marked.parser=Parser.parse,marked.Renderer=Renderer,marked.TextRenderer=TextRenderer,marked.Lexer=Lexer,marked.lexer=Lexer.lex,marked.Tokenizer=Tokenizer,marked.Slugger=Slugger,marked.Hooks=Hooks,marked.parse=marked,marked.options,marked.setOptions,marked.use,marked.walkTokens,marked.parseInline,Parser.parse,Lexer.lex;function getAugmentedNamespace(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var s=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return r[n]}})}),t}function commonjsRequire(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var uniqid={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$0=getAugmentedNamespace(__viteBrowserExternal$1);var pid=typeof process<"u"&&process.pid?process.pid.toString(36):"",address="";if(typeof __webpack_require__!="function"&&typeof commonjsRequire<"u"){var mac="",os=require$$0;if(os.networkInterfaces)var networkInterfaces=os.networkInterfaces();if(networkInterfaces){e:for(let r in networkInterfaces){const e=networkInterfaces[r],t=e.length;for(var i=0;ie?r:e+1}function data_get(r,e,t=null){var n=Array.isArray(e)?e:e.split("."),s=n.reduce((l,o)=>l&&l[o],r);return s!==void 0?s:t}const isString=tagTester("String");var isArguments=tagTester("Arguments");(function(){isArguments(arguments)||(isArguments=function(r){return has(r,"callee")})})();const isArguments$1=isArguments;function isEmpty(r){if(r==null)return!0;var e=getLength(r);return typeof e=="number"&&(isArray(r)||isString(r)||isArguments$1(r))?e===0:getLength(keys(r))===0}function values(r){for(var e=keys(r),t=e.length,n=Array(t),s=0;s0?0:s-1;l>=0&&l0?o=l>=0?l:Math.max(l+a,o):a=l>=0?Math.min(l+1,a):l+a+1;else if(t&&l&&a)return l=t(n,s),n[l]===s?l:-1;if(s!==s)return l=e(slice.call(n,o,a),isNaN$1),l>=0?l+o:-1;for(l=r>0?o:a-1;l>=0&&l=0}function intersection(r){for(var e=[],t=arguments.length,n=0,s=getLength(r);n",">=","<","<="];class Validator{constructor(r,e,t,n){this.field=r,this.values=e,this.rootValues=t?t.state.publish[n].values:!1,this.store=t,this.storeName=n,this.passOnAny=!1,this.showOnPass=!0,this.converter=new Converter}passesConditions(r){let e=r||this.getConditions();if(e===void 0)return!0;if(this.isCustomConditionWithoutTarget(e))return this.passesCustomCondition(this.prepareCondition(e));let t=this.passOnAny?this.passesAnyConditions(e):this.passesAllConditions(e);return this.showOnPass?t:!t}getConditions(){let r=chain(KEYS).filter(t=>this.field[t]).first().value();if(!r)return;r.includes("any")&&(this.passOnAny=!0),(r.includes("unless")||r.includes("hide_when"))&&(this.showOnPass=!1);let e=this.field[r];return this.isCustomConditionWithoutTarget(e)?e:this.converter.fromBlueprint(e,this.field.prefix)}isCustomConditionWithoutTarget(r){return isString(r)}passesAllConditions(r){return chain(r).map(e=>this.prepareCondition(e)).reject(e=>this.passesCondition(e)).isEmpty().value()}passesAnyConditions(r){return!chain(r).map(e=>this.prepareCondition(e)).filter(e=>this.passesCondition(e)).isEmpty().value()}prepareCondition(r){if(isString(r)||r.operator==="custom")return this.prepareCustomCondition(r);let e=this.prepareOperator(r.operator),t=this.prepareLhs(r.field,e),n=this.prepareRhs(r.value,e);return{lhs:t,operator:e,rhs:n}}prepareOperator(r){switch(r){case null:case"":case"is":case"equals":return"==";case"isnt":case"not":case"¯\\_(ツ)_/¯":return"!=";case"includes":case"contains":return"includes";case"includes_any":case"contains_any":return"includes_any"}return r}prepareLhs(r,e){let t=this.getFieldValue(r);return NUMBER_SPECIFIC_COMPARISONS.includes(e)?Number(t):e==="includes"&&!isObject(t)?t?t.toString():"":(isString(t)&&isEmpty(t)&&(t=null),isString(t)?JSON.stringify(t.trim()):t)}prepareRhs(r,e){switch(r){case"null":return null;case"true":return!0;case"false":return!1}return NUMBER_SPECIFIC_COMPARISONS.includes(e)?Number(r):r==="empty"||e==="includes"||e==="includes_any"?r:isString(r)?JSON.stringify(r.trim()):r}prepareCustomCondition(r){let e=this.prepareFunctionName(r.value||r),t=this.prepareParams(r.value||r),n=r.field?this.getFieldValue(r.field):null,s=r.field;return{functionName:e,params:t,target:n,targetHandle:s}}prepareFunctionName(r){return r.replace(new RegExp("^custom "),"").split(":")[0]}prepareParams(r){let e=r.split(":")[1];return e?e.split(",").map(t=>t.trim()):[]}getFieldValue(r){return r.startsWith("root.")?data_get(this.rootValues,r.replace(new RegExp("^root."),"")):data_get(this.values,r)}passesCondition(condition){return condition.functionName?this.passesCustomCondition(condition):condition.operator==="includes"?this.passesIncludesCondition(condition):condition.operator==="includes_any"?this.passesIncludesAnyCondition(condition):(condition.rhs==="empty"&&(condition.lhs=isEmpty(condition.lhs),condition.rhs=!0),isObject(condition.lhs)?!1:eval(`${condition.lhs} ${condition.operator} ${condition.rhs}`))}passesIncludesCondition(r){return r.lhs.includes(r.rhs)}passesIncludesAnyCondition(r){let e=r.rhs.split(",").map(t=>t.trim());return Array.isArray(r.lhs)?intersection(r.lhs,e).length:new RegExp(e.join("|")).test(r.lhs)}passesCustomCondition(r){let e=data_get(this.store.state.statamic.conditions,r.functionName);if(typeof e!="function")return console.error(`Statamic field condition [${r.functionName}] was not properly defined.`),!1;let t=e({params:r.params,target:r.target,targetHandle:r.targetHandle,values:this.values,root:this.rootValues,store:this.store,storeName:this.storeName});return this.showOnPass?t:!t}passesNonRevealerConditions(r){let e=this.getConditions();if(this.isCustomConditionWithoutTarget(e))return this.passesConditions(e);let t=data_get(this.store.state.publish[this.storeName],"revealerFields",[]),n=chain(this.getConditions()).reject(s=>t.includes(this.relativeLhsToAbsoluteFieldPath(s.field,r))).value();return this.passesConditions(n)}relativeLhsToAbsoluteFieldPath(r,e){return e?r.startsWith("root.")?r.replace(/^root\./,""):e+"."+r:r}}class FieldConditions{showField(e,t){return new Validator(e,t).passesConditions()}}class Statamic{constructor(){this.$conditions=new FieldConditions}}window.Statamic=new Statamic});