@arcgis/coding-components 6.0.0-next.36 → 6.0.0-next.37
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/dist/cdn/{RJUUHFTL.js → FN3NPXWM.js} +1 -1
- package/dist/cdn/NB6DT4W5.js +73 -0
- package/dist/cdn/{QJ7TXVL7.js → SQLPOIJ4.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +8 -8
- package/dist/cdn/7QDUGUGM.js +0 -70
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as w}from"./
|
|
2
|
+
import{a as w}from"./NB6DT4W5.js";import{b as _,c as n,d as v}from"./DY7CHTGB.js";import{a as f,b}from"./33G24YP5.js";import{a as p}from"./AOSAUASU.js";import{c as m,e as r}from"./65O2GRVU.js";import"./RYQS3S5A.js";import"./BQAEB2CG.js";import"./PCJTGTU7.js";import"./GYMGKSTC.js";import"./DP5PFCNX.js";import{F as c,G as u,K as h,h as d,j as s,l,n as a}from"./O7IT7ZNK.js";import"./C3LWMJ56.js";import"./CLDFZ2JG.js";import"./TAVTDQ6S.js";function S(o){return!Array.isArray(o)||!o.length?!1:Array.isArray(o[0].suggestions)}var $=d`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}code{font-family:var(--calcite-code-family)}pre{direction:ltr;overflow-x:auto;background-color:var(--calcite-color-foreground-2);padding:var(--calcite-spacing-sm);code{font-size:var(--calcite-font-size--2)}}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}}`,g=class extends u{constructor(){super(...arguments),this._beforeBack=()=>new Promise(e=>{this._selectedSuggestion=void 0,e()}),this.messages=p(),this._shouldIgnoreDoubleClick=f(),this._colorizeStyle="",this._filterValue="",this.closed=!1,this.arcgisInternalClosePanel=a({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=a({bubbles:!1,composed:!1})}static{this.properties={_colorizeStyle:16,_filterValue:16,_selectedSuggestion:16,suggestions:0,closed:5}}static{this.styles=$}load(){this._colorizeStyle=n(),this._themeChangedListener=v(()=>this._colorizeStyle=n())}willUpdate(e){e.has("suggestions")&&this.suggestionsPropChanged()}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect(),this._themeChangedListener?.dispose()}suggestionsPropChanged(){this._selectedSuggestion=void 0}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{r(m(e.querySelector("calcite-flow-item:last-child")??e,"calcite-input"))}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_updateFilterValue(e){this._filterValue=e}_emitItemSelected(e,t){if(this._shouldIgnoreDoubleClick(e))return;let i=e;(!i.key||i.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(t.code))}_showSuggestionDetail(e,t){e.stopPropagation(),this._selectedSuggestion=t}_emitClose(){this.arcgisInternalClosePanel.emit()}_colorizeCode(e){e!==void 0&&_(e,this._selectedSuggestion.code,"arcade")}renderSuggestionGroups(){return this.suggestions===void 0?null:S(this.suggestions)?this.suggestions.map(e=>s`<calcite-list-item-group .heading=${e.label}>${this.renderSuggestionListItems(e.suggestions)}</calcite-list-item-group>`):this.renderSuggestionListItems(this.suggestions)}renderSuggestionListItems(e){return e=b(e,"label",this._filterValue),e.length?e.map(t=>s`<calcite-list-item .label=${t.label} .description=${t.description} @calciteListItemSelect=${i=>this._emitItemSelected(i,t)} @keydown=${i=>this._emitItemSelected(i,t)} data-item=${t??l}><calcite-action slot=actions-end .text=${this.messages.expand??""} scale=s icon=chevron-right icon-flip-rtl @click=${i=>this._showSuggestionDetail(i,t)} data-item=${t??l}></calcite-action></calcite-list-item>`):s`<div class="notice-container">${this.messages.noitems}</div>`}renderSuggestionFlowItem(){let e=this._selectedSuggestion;return e?s`<calcite-flow-item heading-level=2 .heading=${this.messages.suggestions} closable @calciteFlowItemClose=${this._emitClose} .beforeBack=${this._beforeBack} selected><calcite-button width=half slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${t=>this._emitItemSelected(t,e)} data-item=${e??l} ${c(r)}>${this.messages.insert}</calcite-button><calcite-block expanded .heading=${e.label} .description=${e.description}><div .innerHTML=${w(e.documentation)??""}></div><pre><code ${c(this._colorizeCode)}></code></pre></calcite-block></calcite-flow-item>`:null}render(){return this.closed?null:s`<style>${this._colorizeStyle}</style><calcite-flow ${c(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.suggestions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedSuggestion}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${e=>this._updateFilterValue(e.currentTarget.value)} class="sticky" scale=m></calcite-input><calcite-list .label=${this.messages.suggestions??"Suggestions"}>${this.renderSuggestionGroups()}</calcite-list></calcite-flow-item>${this.renderSuggestionFlowItem()}</calcite-flow>`}};h("arcgis-arcade-suggestions",g);export{g as ArcgisArcadeSuggestions};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
+
function ie(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var L=ie();function Ae(r){L=r}var C={exec:()=>null};function I(r){let e=[];return t=>{let s=Math.max(0,Math.min(3,t-1)),n=e[s];return n||(n=r(s),e[s]=n),n}}function u(r,e=""){let t=typeof r=="string"?r:r.source,s={replace:(n,l)=>{let i=typeof l=="string"?l:l.source;return i=i.replace(w.caret,"$1"),t=t.replace(n,i),s},getRegex:()=>new RegExp(t,e)};return s}var Te=((r="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+r)}catch{return!1}})(),w={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:I(r=>new RegExp(`^ {0,${r}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:I(r=>new RegExp(`^ {0,${r}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:I(r=>new RegExp(`^ {0,${r}}(?:\`\`\`|~~~)`)),headingBeginRegex:I(r=>new RegExp(`^ {0,${r}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:I(r=>new RegExp(`^ {0,${r}}#`)),htmlBeginRegex:I(r=>new RegExp(`^ {0,${r}}(?:</?(?:${N})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:I(r=>new RegExp(`^ {0,${r}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},Be=/^(?:[ \t]*(?:\n|$))+/,qe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ze=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/,H=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,De=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,le=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ze=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,_e=u(ze).replace(/bull/g,le).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Me=u(ze).replace(/bull/g,le).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ae=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Oe=/^[^\n]+/,oe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,Qe=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",oe).replace("title",/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),je=u(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,le).getRegex(),N="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ce=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,He=u("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ce).replace("tag",N).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Pe=r=>u(ae).replace("hr",H).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",r).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",N).getRegex(),Ne=Pe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Fe=Pe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Xe=u(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph",Fe).getRegex(),pe={blockquote:Xe,code:qe,def:Qe,fences:Ze,heading:De,hr:H,html:He,lheading:_e,list:je,newline:Be,paragraph:Ne,table:C,text:Oe},de=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",H).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",N).getRegex(),Ge={...pe,lheading:Me,table:de,paragraph:u(ae).replace("hr",H).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",de).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",N).getRegex()},We={...pe,html:u(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace("comment",ce).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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:C,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(ae).replace("hr",H).replace("heading",` *#{1,6} *[^
|
|
3
|
+
]`).replace("lheading",_e).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ue=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Je=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ie=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Ke=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,A=/[\p{P}\p{S}]/u,M=/[\s\p{P}\p{S}]/u,F=/[^\s\p{P}\p{S}]/u,Ve=u(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,M).getRegex(),Ye=/[\p{Pi}\p{Ps}"']/u,Ce=/(?!~)[\p{P}\p{S}]/u,et=/(?!~)[\s\p{P}\p{S}]/u,tt=/(?:[^\s\p{P}\p{S}]|~)/u,rt=u(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Te?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ee=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,nt=u(Ee,"u").replace(/punct/g,A).getRegex(),st=u(Ee,"u").replace(/punct/g,Ce).getRegex(),it=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,lt=u(it,"u").replace(/openQuote/g,Ye).replace(/punct/g,A).getRegex(),Le="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",at=u(Le,"gu").replace(/notPunctSpace/g,F).replace(/punctSpace/g,M).replace(/punct/g,A).getRegex(),ot=u(Le,"gu").replace(/notPunctSpace/g,tt).replace(/punctSpace/g,et).replace(/punct/g,Ce).getRegex(),ct="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",pt=u(ct,"gu").replace(/notPunctSpace/g,F).replace(/punctSpace/g,M).replace(/punct/g,A).getRegex(),ht=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,F).replace(/punctSpace/g,M).replace(/punct/g,A).getRegex(),ut="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",gt=u(ut,"gu").replace(/notPunctSpace/g,F).replace(/punctSpace/g,M).replace(/punct/g,A).getRegex(),kt=u(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,A).getRegex(),dt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ft=u(dt,"gu").replace(/notPunctSpace/g,F).replace(/punctSpace/g,M).replace(/punct/g,A).getRegex(),xt=u(/\\(punct)/,"gu").replace(/punct/g,A).getRegex(),bt=u(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,A).getRegex(),mt=u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(),wt=u(ce).replace("(?:-->|$)","-->").getRegex(),St=u("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",wt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ve=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,K=u(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",ve).getRegex(),$t=u(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",K).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),yt=u(/^!?\[(label)\]\[(ref)\]/).replace("label",K).replace("ref",oe).getRegex(),Rt=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",oe).getRegex(),fe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,At=u(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",ve).getRegex(),Tt=u("reflink|nolink(?!\\()","g").replace("reflink",u(/^!?\[(label)\]\[(ref)\]/).replace("label",At).replace("ref",fe).getRegex()).replace("nolink",u(/^!?\[(ref)\](?:\[\])?/).replace("ref",fe).getRegex()).getRegex(),xe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,zt=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,_t=u(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,zt).getRegex(),he={_backpedal:C,anyPunctuation:xt,anyPunctuationOutsideCode:bt,autolink:mt,blockSkip:rt,br:Ie,code:Je,del:C,delLDelim:C,delRDelim:C,emStrongLDelim:nt,emStrongRDelimAst:at,emStrongRDelimUnd:ht,escape:Ue,link:$t,nolink:Rt,punctuation:Ve,reflink:yt,reflinkSearch:Tt,tag:St,text:Ke,url:C},Pt={...he,emStrongLDelim:lt,emStrongRDelimAst:pt,emStrongRDelimUnd:gt,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",K).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",K).getRegex()},re={...he,emStrongRDelimAst:ot,emStrongLDelim:st,delLDelim:kt,delRDelim:ft,url:u(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",_t).replace("protocol",xe).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:u(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",xe).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace("wwwStart",Te?"(?<![^\\s*_~(])www\\.":"www\\.").getRegex()},It={...re,br:u(Ie).replace("{2,}","*").getRegex(),text:u(re.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},U={normal:pe,gfm:Ge,pedantic:We},Q={normal:he,gfm:re,breaks:It,pedantic:Pt},Ct={"&":"&","<":"<",">":">",'"':""","'":"'"},be=r=>Ct[r];function $(r,e){if(e){if(w.escapeTest.test(r))return r.replace(w.escapeReplace,be)}else if(w.escapeTestNoEncode.test(r))return r.replace(w.escapeReplaceNoEncode,be);return r}function Et(r){return w.numericCharacterReference.test(r)?r.replace(w.numericCharacterReferenceOrAmpersand,(e,t,s)=>{if(t===void 0&&s===void 0)return"&";let n=t===void 0?Number.parseInt(s,16):Number.parseInt(t,10);return n===0||n>1114111||n>=55296&&n<=57343?"\uFFFD":n===38?"&":String.fromCodePoint(n)}):r}function me(r){try{r=encodeURI(r).replace(w.percentDecode,"%")}catch{return null}return r}function we(r,e){let t=r.replace(w.findPipe,(l,i,a)=>{let o=!1,p=i;for(;--p>=0&&a[p]==="\\";)o=!o;return o?"|":" |"}),s=t.split(w.splitPipe),n=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;n<s.length;n++)s[n]=s[n].trim().replace(w.slashPipe,"|");return s}function z(r,e,t){let s=r.length;if(s===0)return"";let n=0;for(;n<s;){let l=r.charAt(s-n-1);if(l===e&&!t)n++;else if(l!==e&&t)n++;else break}return r.slice(0,s-n)}function Se(r){let e=r.split(`
|
|
4
|
+
`),t=e.length-1;for(;t>=0&&w.blankLine.test(e[t]);)t--;return e.length-t<=2?r:e.slice(0,t+1).join(`
|
|
5
|
+
`)}function V(r){return r.trim().replace(w.multipleSpaceGlobal," ").toLowerCase().toUpperCase().toLowerCase()}function $e(r,e){if(r.indexOf(e[0])===-1&&r.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])t++;else if(r[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}var D=new WeakMap;function ue(r){let e={"*":-1,_:-1},t=-1,s=r.length;for(let n=0;n<s;n++){let l=r[n];if(l!=="*"&&l!=="_"&&l!=="~")continue;let i=n===0?`
|
|
6
|
+
`:r[n-1],a=n+1;for(;a<s&&r[a]===l;)a++;i!==" "&&i!==" "&&i!==`
|
|
7
|
+
`&&i!=="\r"&&i!=="\f"&&(l==="~"?t=n:e[l]=n),n=a-1}return{maskedSrc:r,lastPossibleEmStrongCloserIndex:e,lastPossibleDelCloserIndex:t}}function Lt(r,e){let t=ue(e),s=D.get(r);s?s.push(t):D.set(r,[t])}function vt(r){let e=D.get(r);e&&(e.pop(),e.length===0&&D.delete(r))}function Bt(r,e,t){let s=D.get(r)?.at(-1);return s&&s.maskedSrc===e?s.lastPossibleEmStrongCloserIndex[t]:ue(e).lastPossibleEmStrongCloserIndex[t]}function qt(r,e){let t=D.get(r)?.at(-1);return t&&t.maskedSrc===e?t.lastPossibleDelCloserIndex:ue(e).lastPossibleDelCloserIndex}function J(r,e=0){let t=e,s="";for(let n of r)if(n===" "){let l=4-t%4;s+=" ".repeat(l),t+=l}else s+=n,t++;return s}function ye(r,e,t,s,n){let l=e.href,i=e.title||null,a=r[1].replace(n.other.outputLinkReplace,"$1"),o=r[0].charAt(0)==="!",p=s.state.inLink,c=s.state.linkEmitted,h=s.state.inRawBlock;s.state.inLink=!0,s.state.linkEmitted=!1;let k=s.inlineTokens(a),g=s.state.linkEmitted;if(s.state.linkEmitted=c,s.state.inLink=p,!o){if(g){s.state.inRawBlock=h;return}s.state.linkEmitted=!0}return{type:o?"image":"link",raw:t,href:l,title:i,text:a,tokens:k}}function Zt(r,e,t){let s=r.match(t.other.indentCodeCompensation);if(s===null)return e;let n=s[1];return e.split(`
|
|
8
|
+
`).map(l=>{let i=l.match(t.other.beginningSpace);if(i===null)return l;let[a]=i;return l.slice(Math.min(a.length,n.length))}).join(`
|
|
9
|
+
`)}function Re(r,e,t,s){if(!e.includes("<"))return!1;for(let n=0;n<e.length;n++){if(e[n]==="\\"){n++;continue}if(e[n]==="`"){let a=s.inline.code.exec(e.slice(n));if(a){n+=a[0].length-1;continue}}if(e[n]!=="<")continue;let l=r.slice(t+n),i=s.inline.tag.exec(l)||s.inline.autolink.exec(l);if(i){if(i[0].length>e.length-n)return!0;n+=i[0].length-1}}return!1}var Z=class{options;rules;lexer;constructor(r){this.options=r||L}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let t=this.options.pedantic?e[0]:Se(e[0]),s=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:s}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let t=e[0],s=Zt(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=z(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(t=s.trim())}return{type:"heading",raw:z(e[0],`
|
|
10
|
+
`),depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:z(e[0],`
|
|
11
|
+
`)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let t=z(e[0],`
|
|
12
|
+
`).split(`
|
|
13
|
+
`),s="",n="",l=[];for(;t.length>0;){let i=!1,a=[],o;for(o=0;o<t.length;o++)if(this.rules.other.blockquoteStart.test(t[o]))a.push(t[o]),i=!0;else if(!i)a.push(t[o]);else break;t=t.slice(o);let p=a.join(`
|
|
14
|
+
`),c=p.replace(this.rules.other.blockquoteMarkerWhitespace,(g,x,b)=>x+J(b,x.length)).replace(this.rules.other.blockquoteSetextReplace,`
|
|
15
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
16
|
+
${p}`:p,n=n?`${n}
|
|
17
|
+
${c}`:c;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,l,!0),this.lexer.state.top=h,t.length===0)break;let k=l.at(-1);if(k?.type==="code"||k?.type==="heading"||k?.type==="hr"||k?.type==="html"||k?.type==="table")break;if(k?.type==="blockquote"){let g=k,x=t.join(`
|
|
18
|
+
`),b=g.raw+`
|
|
19
|
+
`+x.replace(this.rules.other.blockquoteSetextReplace2,""),f=this.blockquote(b);l[l.length-1]=f;let S=b.substring(f.raw.length).replace(/^\n/,""),m=S?S.split(`
|
|
20
|
+
`).length:0,T=m?t.slice(0,-m):t;if(T.length>0&&(s=`${s}
|
|
21
|
+
${T.join(`
|
|
22
|
+
`)}`),n=n.substring(0,n.length-g.text.length)+f.text,t=t.slice(T.length),t.length>0&&this.rules.other.blockquoteStart.test(t[0]))continue;break}else if(k?.type==="list"){let g=k,x=g.raw+`
|
|
23
|
+
`+t.join(`
|
|
24
|
+
`),b=this.list(x);l[l.length-1]=b;let f=b.raw.length>g.raw.length?x.slice(g.raw.length+1,b.raw.length).split(`
|
|
25
|
+
`).length:0;if(f>0){let S=t.slice(0,f).join(`
|
|
26
|
+
`);s=`${s}
|
|
27
|
+
${S}`,n=`${n}
|
|
28
|
+
${S}`}t=t.slice(f);continue}}return{type:"blockquote",raw:s,tokens:l,text:n}}}list(r){let e=this.rules.block.list.exec(r);if(e){if(!this.options.pedantic&&this.lexer.state.lastToken?.type==="text"&&!this.rules.other.listInterruptsParagraph.test(r))return;let t=r,s=()=>t.length-r.length,n=e[1].trim(),l=n.length>1,i={type:"list",raw:"",ordered:l,start:l?+n.slice(0,-1):"",loose:!1,items:[]};n=l?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=l?n:"[*+-]");let a=this.rules.other.listItemRegex(n),o=!1;for(;r;){let c=!1,h="";if(!(e=a.exec(r))||this.rules.block.hr.test(r))break;let k=s();r=r.substring(e[0].length);let g=e[2].split(`
|
|
29
|
+
`,1)[0],x=e[1].length,b=this.options.pedantic?J(g,x):g.replace(this.rules.other.leadingSpaceTab,v=>J(v,x)),f=r.split(`
|
|
30
|
+
`,1)[0],S=!b.trim(),m=0;if(this.options.pedantic?(m=2,h=b.trimStart()):S?m=x+1:(m=b.search(this.rules.other.nonSpaceChar),m=m>4?1:m,h=b.slice(m),m+=x),S&&this.rules.other.blankLine.test(f)&&(r=r.substring(f.length+1),c=!0),!c){let v=this.rules.other.nextBulletRegex(m),O=this.rules.other.hrRegex(m),X=this.rules.other.fencesBeginRegex(m),G=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(m):this.rules.other.headingBeginRegex(m),P=this.rules.other.htmlBeginRegex(m),W=this.rules.other.blockquoteBeginRegex(m),B=!1;for(;r;){let ke=r.split(`
|
|
31
|
+
`,1)[0],q;if(f=ke,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),q=f):q=f.replace(this.rules.other.leadingSpaceTab,ee=>J(ee)),X.test(f)||G.test(f)||P.test(f)||W.test(f)||v.test(f)||O.test(f))break;if(q.search(this.rules.other.nonSpaceChar)>=m||!f.trim())h+=`
|
|
32
|
+
`+q.slice(m),B=!1;else{if(S||b.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||X.test(b)||G.test(b)||P.test(b)||O.test(b))break;if(!this.options.pedantic&&!B){let te=b.replace(this.rules.other.nestedContainerMarkers,"");if(this.rules.block.fences.test(te)||this.rules.block.heading.test(te)||this.rules.block.hr.test(te))break}let ee=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(f)&&this.rules.block.lheading.test(`${b}
|
|
33
|
+
${f}`)?` ${q.replace(/^ {0,3}/,"")}`:f;h+=`
|
|
34
|
+
`+ee,B=!0}S=!f.trim(),r=r.substring(ke.length+1),b=q.slice(m)}}let T=t.slice(k,s());i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(T)&&(o=!0)),i.items.push({type:"list_item",raw:T,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]})}let p=i.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;i.raw=t.slice(0,s()).trimEnd();for(let c of i.items)if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),!i.loose){let h=c.tokens.filter(g=>g.type==="space"),k=h.length>0&&h.some(g=>this.rules.other.anyLine.test(g.raw));i.loose=k}for(let c of i.items){let h=c.tokens[0];if(c.task&&(h?.type==="text"||h?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),h.raw=h.raw.replace(this.rules.other.listReplaceTask,""),h.text=h.text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}let k=this.rules.other.listTaskCheckbox.exec(c.raw);if(k){let g={type:"checkbox",raw:k[0]+" ",checked:k[0]!=="[ ]"};c.checked=g.checked,i.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=g.raw+c.tokens[0].raw,c.tokens[0].text=g.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(g)):c.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):c.tokens.unshift(g)}}else c.task&&(c.task=!1)}if(i.loose)for(let c of i.items){c.loose=!0;for(let h of c.tokens)h.type==="text"&&(h.type="paragraph")}return i}}html(r){let e=this.rules.block.html.exec(r);if(e){let t=Se(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(r){let e=this.rules.block.def.exec(r);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&$e(e[2],"()")!==-1)return;let t=V(e[1]),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:z(e[0],`
|
|
35
|
+
`),href:s,title:n}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=we(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
36
|
+
`):[],l={type:"table",raw:z(e[0],`
|
|
37
|
+
`),header:[],align:[],rows:[]};if(t.length===s.length){for(let i of s)this.rules.other.tableAlignRight.test(i)?l.align.push("right"):this.rules.other.tableAlignCenter.test(i)?l.align.push("center"):this.rules.other.tableAlignLeft.test(i)?l.align.push("left"):l.align.push(null);for(let i=0;i<t.length;i++)l.header.push({text:t[i],tokens:this.lexer.inline(t[i]),header:!0,align:l.align[i]});for(let i of n)l.rows.push(we(i,l.header.length).map((a,o)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:l.align[o]})));return l}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e){let t=e[1].trim();return{type:"heading",raw:z(e[0],`
|
|
38
|
+
`),depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
39
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(r);if(e){let t=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Re(r,e[1],t,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let a=z(s.slice(0,-1),"\\");if((s.length-a.length)%2===0)return}else{let a=$e(e[2],"()");if(a===-2)return;if(a>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let n=z(e[0].slice(0,-1),"\\");if((e[0].length-n.length)%2===0)return;let l=e[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(l);a&&(l=a[1],i=a[3])}else i=e[3]?e[3].slice(1,-1):"";return l=l.trim(),this.rules.other.startAngleBracket.test(l)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?l=l.slice(1):l=l.slice(1,-1)),ye(e,{href:l&&l.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){let s=t[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Re(r,t[1],s,this.rules))return;let n=e[V(t[2]||t[1])];if(!n){let l=t[0].charAt(0);return{type:"text",raw:l,text:l}}return ye(t,n,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!s||!s[1]&&!s[2]&&!s[3]&&!s[4])return;let n=s[0][0],l=t===n,i=e.length-r.length,a=i;for(;!this.options.pedantic&&a>0&&e[a-1]===n;)a--;let o=[...e.slice(Math.max(0,a-2),a)].at(-1)??"",p=o==="*"||o==="_"||!!this.rules.inline.punctuation.exec(o);a<i&&(t=o);let c=a<i?p:t==="*"||t==="_"||!!this.rules.inline.punctuation.exec(t);if(s[4]&&t.match(this.rules.other.unicodeAlphaNumeric))return;let h=s[1]||s[3]||"";if(!h||!t||c){let k=[...s[0]].length-1,g,x,b=k,f=0,S=i-a+k,m=!this.options.pedantic&&!!o.trim()&&(!!h||n==="*"&&!p);if(n!=="*"&&n!=="_")return;let T=n==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,v=Bt(this,e,n),O=e.length-r.length+k;if(v<O)return;e=e.slice(-1*r.length+k);let X=v-O;for(T.lastIndex=0;(s=T.exec(e))!==null&&!(s.index>X);){if(g=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!g)continue;if(x=[...g].length,s[3]||s[4]){b+=x;continue}else if(s[5]||s[6]||m){if(l&&(s[5]||s[6]))break;if(S%3&&!((S+x)%3)){f+=x;continue}}if(b-=x,b>0)continue;x=Math.min(x,x+b+f);let G=[...s[0]][0].length,P=r.slice(0,k+s.index+G+x);if(Math.min(k,x)%2){let B=P.slice(1,-1);return{type:"em",raw:P,text:B,tokens:this.lexer.inlineTokens(B)}}let W=P.slice(2,-2);return{type:"strong",raw:P,text:W,tokens:this.lexer.inlineTokens(W)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r,e,t=""){let s=this.rules.inline.delLDelim.exec(r);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let n=[...s[0]].length-1,l,i,a=n,o=this.rules.inline.delRDelim,p=qt(this,e),c=e.length-r.length+n;if(p<c)return;e=e.slice(-1*r.length+n);let h=p-c;for(o.lastIndex=0;(s=o.exec(e))!==null&&!(s.index>h);){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l||(i=[...l].length,i!==n))continue;if(s[3]||s[4]){a+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a);let k=[...s[0]][0].length,g=r.slice(0,n+s.index+k+i),x=g.slice(n,-n);return{type:"del",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,autolink:!0,tokens:[{type:"text",raw:t,text:t}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,autolink:!0,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:t?e[0]:Et(e[0]),escaped:t}}}},y=class ne{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||L,this.options.tokenizer=this.options.tokenizer||new Z,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:w,block:U.normal,inline:Q.normal};this.options.pedantic?(t.block=U.pedantic,t.inline=Q.pedantic):this.options.gfm&&(t.block=U.gfm,this.options.breaks?t.inline=Q.breaks:t.inline=Q.gfm),this.tokenizer.rules=t}static get rules(){return{block:U,inline:Q}}static lex(e,t){return new ne(t).lex(e)}static lexInline(e,t){return new ne(t).inlineTokens(e)}lex(e){e=e.replace(w.carriageReturn,`
|
|
40
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.state.inRawBlock=!1,this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){this.tokenizer.lexer=this;let n=this.state.lastToken;this.options.pedantic&&(e=e.replace(w.tabCharGlobal," ").replace(w.spaceLine,""));let l=1/0;for(;e;){if(e.length<l)l=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}this.state.lastToken=t.at(-1);let i;if(this.options.extensions?.block?.some(o=>(i=o.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let o=t.at(-1);i.raw.length===1&&o!==void 0?o.raw+=`
|
|
41
|
+
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
42
|
+
`)?"":`
|
|
43
|
+
`)+i.raw,o.text+=`
|
|
44
|
+
`+i.text,this.inlineQueue.at(-1).src=o.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
45
|
+
`)?"":`
|
|
46
|
+
`)+i.raw,o.text+=`
|
|
47
|
+
`+i.raw,this.inlineQueue.at(-1).src=o.text):(this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}),t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let o=1/0,p=e.slice(1),c;this.options.extensions.startBlock.forEach(h=>{c=h.call({lexer:this},p),typeof c=="number"&&c>=0&&(o=Math.min(o,c))}),o<1/0&&o>=0&&(a=e.substring(0,o+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let o=t.at(-1);s&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
|
|
48
|
+
`)?"":`
|
|
49
|
+
`)+i.raw,o.text+=`
|
|
50
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(i),s=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let o=t.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
51
|
+
`)?"":`
|
|
52
|
+
`)+i.raw,o.text+=`
|
|
53
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=n,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes("["))return!1;let t=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let n=s[0],l=n.lastIndexOf("[");if(!(n.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,V(n.slice(l+1,-1))))&&!(l>1&&this.linkInText(n.slice(1,l-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,t)}finally{this.state.linkParenPossible=s}}#e(e,t){let s=e.includes("*")||e.includes("_")||e.includes("~")||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==Z.prototype.emStrong||this.tokenizer.del!==Z.prototype.del?this.#n(e):e;Lt(this.tokenizer,s);try{return this.#t(e,s,t)}finally{vt(this.tokenizer)}}#t(e,t,s){let n=!1,l="",i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}n||(l=""),n=!1;let a;if(this.options.extensions?.inline?.some(p=>(a=p.call({lexer:this},e,s))?(e=e.substring(a.raw.length),s.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let p=s.at(-1);a.type==="text"&&p?.type==="text"?(p.raw+=a.raw,p.text+=a.text):s.push(a);continue}if(a=this.tokenizer.emStrong(e,t,l)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.del(e,t,l)){e=e.substring(a.raw.length),s.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),s.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),s.push(a);continue}let o=e;if(this.options.extensions?.startInline){let p=1/0,c=e.slice(1),h;this.options.extensions.startInline.forEach(k=>{h=k.call({lexer:this},c),typeof h=="number"&&h>=0&&(p=Math.min(p,h))}),p<1/0&&p>=0&&(o=e.substring(0,p+1))}if(a=this.tokenizer.inlineText(o)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(l=a.raw.slice(-1)),n=!0;let p=s.at(-1);p?.type==="text"?(p.raw+=a.raw,p.text+=a.text):s.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return s}#r(e){let{blockSkip:t,tag:s,autolink:n}=this.tokenizer.rules.inline,l="",i=0,a;for(t.lastIndex=0;a=t.exec(e);){let o=a.index+(a[2]?a[2].length:0),p=a.index+a[0].length;if(e.charAt(o)==="<"){let c=e.slice(o),h=s.exec(c)||n.exec(c);if(!h){t.lastIndex=o+1;continue}p=o+h[0].length,t.lastIndex=p}l+=e.slice(i,o)+"["+"a".repeat(p-o-2)+"]",i=p}return l+e.slice(i)}#n(e){let t=e;if(this.tokens.links&&e.includes("[")){let s=this.tokenizer.rules.inline.reflinkSearch,n=l=>{let i=l.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,V(l.slice(i+1,-1))))return l;if(i>1&&l.charAt(0)!=="!"){let a=l.slice(1,i-1);if(this.linkInText(a))return"["+a.replace(s,n)+"]["+"a".repeat(l.length-i-2)+"]"}return"["+"a".repeat(l.length-2)+"]"};t=t.replace(s,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(s,n,l)=>l?"+".repeat(s.length):n?n+s.slice(n.length,-n.length).replace(/`/g,"+")+n:s),t=this.#r(t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},Y=class{options;parser;constructor(r){this.options=r||L}space(r){return""}code({text:r,lang:e,escaped:t}){let s=(e||"").match(w.notSpaceStart)?.[0],n=r?r.replace(w.endingNewline,"")+`
|
|
54
|
+
`:"";return s?'<pre><code class="language-'+$(s)+'">'+(t?n:$(n,!0))+`</code></pre>
|
|
55
|
+
`:"<pre><code>"+(t?n:$(n,!0))+`</code></pre>
|
|
56
|
+
`}blockquote({tokens:r}){return`<blockquote>
|
|
57
|
+
${this.parser.parse(r)}</blockquote>
|
|
58
|
+
`}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
|
|
59
|
+
`}hr(r){return`<hr>
|
|
60
|
+
`}list(r){let e=r.ordered,t=r.start,s="";for(let i=0;i<r.items.length;i++){let a=r.items[i];s+=this.listitem(a)}let n=e?"ol":"ul",l=e&&t!==1?' start="'+t+'"':"";return"<"+n+l+`>
|
|
61
|
+
`+s+"</"+n+`>
|
|
62
|
+
`}listitem(r){return`<li>${this.parser.parse(r.tokens)}</li>
|
|
63
|
+
`}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
|
|
64
|
+
`}table(r){let e="",t="";for(let n=0;n<r.header.length;n++)t+=this.tablecell(r.header[n]);e+=this.tablerow({text:t});let s="";for(let n=0;n<r.rows.length;n++){let l=r.rows[n];t="";for(let i=0;i<l.length;i++)t+=this.tablecell(l[i]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
65
|
+
<thead>
|
|
66
|
+
`+e+`</thead>
|
|
67
|
+
`+s+`</table>
|
|
68
|
+
`}tablerow({text:r}){return`<tr>
|
|
69
|
+
${r}</tr>
|
|
70
|
+
`}tablecell(r){let e=this.parser.parseInline(r.tokens),t=r.header?"th":"td";return(r.align?`<${t} align="${r.align}">`:`<${t}>`)+e+`</${t}>
|
|
71
|
+
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${$(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,text:t,tokens:s,autolink:n}){let l=n?$(t,!0):this.parser.parseInline(s),i=me(r);if(i===null)return l;r=$(i,n);let a='<a href="'+r+'"';return e&&(a+=' title="'+$(e)+'"'),a+=">"+l+"</a>",a}image({href:r,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let n=me(r);if(n===null)return $(t);r=n;let l=`<img src="${$(r)}" alt="${$(t)}"`;return e&&(l+=` title="${$(e)}"`),l+=">",l}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:$(r.text)}},ge=class{parser;strong({text:r,tokens:e}){return e?this.parser.parseInline(e,this):r}em({text:r,tokens:e}){return e?this.parser.parseInline(e,this):r}codespan({text:r}){return r}del({text:r,tokens:e}){return e?this.parser.parseInline(e,this):r}html({text:r}){return r}text({text:r}){return r}link({text:r,tokens:e}){return e?this.parser.parseInline(e,this):r}image({text:r,tokens:e}){return e?this.parser.parseInline(e,this):r}br(){return`
|
|
72
|
+
`}checkbox({raw:r}){return r}},R=class se{options;renderer;textRenderer;constructor(e){this.options=e||L,this.options.renderer=this.options.renderer||new Y,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ge,this.textRenderer.parser=this}static parse(e,t){return new se(t).parse(e)}static parseInline(e,t){return new se(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let i=n,a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(i.type)){t+=a===!1?"":a??"";continue}}let l=n;switch(l.type){case"space":{t+=this.renderer.space(l);break}case"hr":{t+=this.renderer.hr(l);break}case"heading":{t+=this.renderer.heading(l);break}case"code":{t+=this.renderer.code(l);break}case"table":{t+=this.renderer.table(l);break}case"blockquote":{t+=this.renderer.blockquote(l);break}case"list":{t+=this.renderer.list(l);break}case"checkbox":{t+=this.renderer.checkbox(l);break}case"html":{t+=this.renderer.html(l);break}case"def":{t+=this.renderer.def(l);break}case"paragraph":{t+=this.renderer.paragraph(l);break}case"text":{t+=this.renderer.text(l);break}default:{let i='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let s="";for(let n=0;n<e.length;n++){let l=e[n];if(this.options.extensions?.renderers?.[l.type]){let a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(l.type)){s+=a===!1?"":a??"";continue}}let i=l;switch(i.type){case"escape":{s+=t.text(i);break}case"html":{s+=t.html(i);break}case"link":{s+=t.link(i);break}case"image":{s+=t.image(i);break}case"checkbox":{s+=t.checkbox(i);break}case"strong":{s+=t.strong(i);break}case"em":{s+=t.em(i);break}case"codespan":{s+=t.codespan(i);break}case"br":{s+=t.br(i);break}case"del":{s+=t.del(i);break}case"text":{s+=t.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},j=class{options;block;constructor(r){this.options=r||L}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(r=this.block){return r?y.lex:y.lexInline}provideParser(r=this.block){return r?R.parse:R.parseInline}};function _(r,e){if(Array.isArray(e))for(let t=0;t<e.length;t++)r.push(e[t]);else r.push(e)}var Dt=class{defaults=ie();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=R;Renderer=Y;TextRenderer=ge;Lexer=y;Tokenizer=Z;Hooks=j;constructor(...r){this.use(...r)}walkTokens(r,e){let t=[];for(let s of r)switch(_(t,e.call(this,s)),s.type){case"table":{let n=s;for(let l of n.header)_(t,this.walkTokens(l.tokens,e));for(let l of n.rows)for(let i of l)_(t,this.walkTokens(i.tokens,e));break}case"list":{let n=s;_(t,this.walkTokens(n.items,e));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(l=>{let i=n[l].flat(1/0);_(t,this.walkTokens(i,e))}):n.tokens&&_(t,this.walkTokens(n.tokens,e))}}return t}use(...r){let e=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return r.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let l=e.renderers[n.name];l?e.renderers[n.name]=function(...i){let a=n.renderer.apply(this,i);return a===!1&&(a=l.apply(this,i)),a}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[n.level];l?l.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),s.extensions=e),t.renderer){let n=this.defaults.renderer||new Y(this.defaults);for(let l in t.renderer){if(!(l in n))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let i=l,a=t.renderer[i],o=n[i];n[i]=(...p)=>{let c=a.apply(n,p);return c===!1&&(c=o.apply(n,p)),c===!1?"":c??""}}s.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new Z(this.defaults);for(let l in t.tokenizer){if(!(l in n))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let i=l,a=t.tokenizer[i],o=n[i];n[i]=(...p)=>{let c=a.apply(n,p);return c===!1&&(c=o.apply(n,p)),c}}s.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new j;for(let l in t.hooks){if(!(l in n))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let i=l,a=t.hooks[i],o=n[i];j.passThroughHooks.has(l)?n[i]=p=>{if(n.options.async&&j.passThroughHooksRespectAsync.has(l))return(async()=>{let h=await a.call(n,p);return o.call(n,h)})();let c=a.call(n,p);return o.call(n,c)}:n[i]=(...p)=>{if(n.options.async)return(async()=>{let h=await a.apply(n,p);return h===!1&&(h=await o.apply(n,p)),h})();let c=a.apply(n,p);return c===!1&&(c=o.apply(n,p)),c}}s.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,l=t.walkTokens;s.walkTokens=function(i){let a=[];return _(a,l.call(this,i)),n&&_(a,n.call(this,i)),a}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return y.lex(r,e??this.defaults)}parser(r,e){return R.parse(r,e??this.defaults)}parseMarkdown(r){return(e,t)=>{let s={...t},n={...this.defaults,...s},l=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=r),n.async)return(async()=>{let i=n.hooks?await n.hooks.preprocess(e):e,a=await(n.hooks?await n.hooks.provideLexer(r):r?y.lex:y.lexInline)(i,n),o=n.hooks?await n.hooks.processAllTokens(a):a;n.walkTokens&&await Promise.all(this.walkTokens(o,n.walkTokens));let p=await(n.hooks?await n.hooks.provideParser(r):r?R.parse:R.parseInline)(o,n);return n.hooks?await n.hooks.postprocess(p):p})().catch(l);try{n.hooks&&(e=n.hooks.preprocess(e));let i=(n.hooks?n.hooks.provideLexer(r):r?y.lex:y.lexInline)(e,n);n.hooks&&(i=n.hooks.processAllTokens(i)),n.walkTokens&&this.walkTokens(i,n.walkTokens);let a=(n.hooks?n.hooks.provideParser(r):r?R.parse:R.parseInline)(i,n);return n.hooks&&(a=n.hooks.postprocess(a)),a}catch(i){return l(i)}}}onError(r,e){return t=>{if(t.message+=`
|
|
73
|
+
Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+$(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},E=new Dt;function d(r,e){return E.parse(r,e)}d.options=d.setOptions=function(r){return E.setOptions(r),d.defaults=E.defaults,Ae(d.defaults),d};d.getDefaults=ie;d.defaults=L;function Mt(...r){return E.use(...r),d.defaults=E.defaults,Ae(d.defaults),d}d.use=Mt;d.walkTokens=function(r,e){return E.walkTokens(r,e)};d.parseInline=E.parseInline;d.Parser=R;d.parser=R.parse;d.Renderer=Y;d.TextRenderer=ge;d.Lexer=y;d.lexer=y.lex;d.Tokenizer=Z;d.Hooks=j;d.parse=d;var Ot=d.options,Qt=d.setOptions,jt=d.walkTokens,Ht=d.parseInline;var Nt=R.parse,Ft=y.lex;d.use({gfm:!0,breaks:!0,async:!1,renderer:{link({href:r,title:e,tokens:t}){let s=this.parser.parseInline(t);return`<calcite-link href="${r}" title="${e??s}" target="Arcade Help">${s}</calcite-link>`},code({lang:r,text:e}){return`<arcgis-code-viewer language="${r==="sql"?"arcgis-sql-expression":r}">${e}</arcgis-code-viewer>`}}});function Yt(r){return r==null?"":d.parse(typeof r=="string"?r:r.value,{async:!1})}export{Yt as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as d}from"./
|
|
2
|
+
import{a as d}from"./NB6DT4W5.js";import{a as b,b as I}from"./33G24YP5.js";import{a as g}from"./AOSAUASU.js";import{e as r}from"./65O2GRVU.js";import"./RYQS3S5A.js";import"./BQAEB2CG.js";import{F as a,G as p,K as f,h,j as l,l as u,n as o,s as n}from"./O7IT7ZNK.js";import"./C3LWMJ56.js";import"./TAVTDQ6S.js";var _=h`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}.container{block-size:100%;display:grid;grid-template-rows:auto 1fr;overflow:hidden}.scrollable{min-block-size:0;overflow:auto}}`,m=class extends p{constructor(){super(...arguments),this.messages=g(),this._shouldIgnoreDoubleClick=b(),this._unselectItem=async()=>{this._selectedApiItem=void 0},this._filterValue="",this.languageId="arcade",this.hideDocumentationActions=!1,this.loading=!1,this.closed=!1,this.arcgisInternalClosePanel=o({bubbles:!1,composed:!1}),this.arcgisInternalItemSelected=o({bubbles:!1,composed:!1})}static{this.properties={_filterValue:16,_selectedApiItem:16,languageId:1,apiLibrary:0,hideDocumentationActions:5,loading:5,closed:5}}static{this.styles=_}willUpdate(e){if(e.has("apiLibrary")){if(!this._selectedApiItem)return;for(let t of this.apiLibrary??[])for(let i of t.items)if(i.name===this._selectedApiItem.name){this._selectedApiItem=i;return}this._selectedApiItem=void 0}}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{let t=e.querySelector("calcite-flow-item:last-child")?.querySelector("calcite-input");t&&r(t)}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_emitItemSelected(e,t){if(!t||this._shouldIgnoreDoubleClick(e))return;let i=e;(!i.key||i.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(t.completion.insertText??""))}_emitClose(){this.arcgisInternalClosePanel.emit()}_emitItemSelectedAndClose(e,t){let i=e;(!i.key||i.key==="Enter")&&(e.preventDefault(),this.arcgisInternalItemSelected.emit(t.completion.insertText??""))}_selectItem(e,t){e.stopPropagation(),this._selectedApiItem=t}_updateFilterValue(e){this._filterValue=e.currentTarget.value??""}_elementToMarkdown(e){e!==void 0&&(e.innerHTML=d(this._selectedApiItem.examples))}renderApiCategory(e){let t=I(e.items,"name",this._filterValue);return t.length?l`<calcite-list-item-group .heading=${e.title}>${t.map(i=>l`<calcite-list-item .label=${n(i.completion.detail)} @calciteListItemSelect=${s=>this._emitItemSelected(s,i)} @keydown=${s=>this._emitItemSelected(s,i)}>${v({apiItem:i})}<calcite-action slot=actions-end .text=${this.messages.expand??""} icon=chevron-right icon-flip-rtl scale=s @click=${s=>this._selectItem(s,i)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>`:null}renderApiItemFlowItem(){let e=this._selectedApiItem;return e?l`<calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions?null:l`<calcite-button width=half slot=footer appearance=outline kind=brand scale=s .href=${e.link} target=Help icon-start=information>${this.messages.moreinformation}</calcite-button>`}<calcite-button .width=${this.hideDocumentationActions?"full":"half"} slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${t=>this._emitItemSelectedAndClose(t,e)} ${a(r)}>${this.messages.insert}</calcite-button><calcite-block expanded .heading=${n(e.completion.detail)}><div .innerHTML=${d(e.completion.documentation)??""}></div>${v({apiItem:e})}${e.examples?l`<div ${a(this._elementToMarkdown)}></div>`:null}</calcite-block></calcite-flow-item>`:null}render(){if(this.closed)return null;let e=(this.apiLibrary??[]).map(i=>this.renderApiCategory(i)),t=e.every(i=>!i);return l`<calcite-flow ${a(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><div class="container"><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} scale=m></calcite-input><div class="scrollable">${this.loading?l`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"}></calcite-loader>`:l`<calcite-list .label=${this.messages.api??"API"}>${t?l`<div class="notice-container">${this.messages.noitems}</div>`:e}</calcite-list>`}</div></div></calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`}};function v({apiItem:c,slot:e="content-start"}){return c.type==="function"&&c.consumesCredits?l`<calcite-icon icon=credits slot=${e??u} scale=s></calcite-icon>`:null}f("arcgis-language-api-panel",m);export{m as ArcgisLanguageApiPanel};
|
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{J as s,v as e}from"./O7IT7ZNK.js";import"./C3LWMJ56.js";import"./TAVTDQ6S.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./PHNV7LTJ.js"),"appVersion,closed,closePanel:,diagnostics:,disableQuestionAnswerLogging,docsConfig:,editorRef:,feedbackServiceUrl,helpBase,insertText:,isDevEnv,portalUrl,promptingEnabled,serviceUrl;destroy,openPrompt"],"arcgis-arcade-debugger-console":[()=>import("./6R4ADGEZ.js"),"debuggerStore:,modelId"],"arcgis-arcade-debugger-output":[()=>import("./UWA7I2DG.js"),"debuggerStore:,result:"],"arcgis-arcade-editor":[()=>import("./7R6OLU3K.js"),"arcadeAssistant:,customPanels:,disableAssistant,docsConfig:,editorInstance:,editorOptions:,enableDebugger,externalExecutor:,hideDocumentationActions,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,openArcadeAssistant,setFocus,testRun"],"arcgis-arcade-results":[()=>import("./H4EXVF6I.js"),"consoleLogs:,executionTiming:,hideHeader,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./
|
|
2
|
+
import{J as s,v as e}from"./O7IT7ZNK.js";import"./C3LWMJ56.js";import"./TAVTDQ6S.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./PHNV7LTJ.js"),"appVersion,closed,closePanel:,diagnostics:,disableQuestionAnswerLogging,docsConfig:,editorRef:,feedbackServiceUrl,helpBase,insertText:,isDevEnv,portalUrl,promptingEnabled,serviceUrl;destroy,openPrompt"],"arcgis-arcade-debugger-console":[()=>import("./6R4ADGEZ.js"),"debuggerStore:,modelId"],"arcgis-arcade-debugger-output":[()=>import("./UWA7I2DG.js"),"debuggerStore:,result:"],"arcgis-arcade-editor":[()=>import("./7R6OLU3K.js"),"arcadeAssistant:,customPanels:,disableAssistant,docsConfig:,editorInstance:,editorOptions:,enableDebugger,externalExecutor:,hideDocumentationActions,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,openArcadeAssistant,setFocus,testRun"],"arcgis-arcade-results":[()=>import("./H4EXVF6I.js"),"consoleLogs:,executionTiming:,hideHeader,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./FN3NPXWM.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./DYCAYWTS.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./Q65ZQT4X.js")],"arcgis-code-viewer":[()=>import("./ND57RE23.js"),"language,lineNumbers,round"],"arcgis-editor-variables":[()=>import("./EDIKES26.js"),"closed,heading,hideDescriptions,loading,messageOverrides:,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./SQLPOIJ4.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./CY6YVIEW.js"),"hideDescriptionsInFieldsPanel,hideSideBar,messageOverrides:,messages:,profile:,script;formatExpression,setFocus"],"arcgis-sql-layer-editor":[()=>import("./JXRK5LUD.js"),"editorInstance:,editorOptions:,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var r=new CSSStyleSheet;r.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor,arcgis-sql-layer-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,r];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,s)
|