!function(e){"object"==typeof module&&"object"==typeof module.exports?e(require,exports):"function"==typeof define&&define.amd&&define(["require","exports","tslib","remarkable","./FormDefinition"],e)}(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=e("tslib"),r=e("remarkable"),o=n.__importStar(e("./FormDefinition")),a=document.createElement("div"),i=document.createElement("div"),s=document.createTextNode("");a.appendChild(s);var c=document.createElement("span"),d=/[\\`*_{}[\]()#+\-.!>~]/g,u=/^[ ]{4}/gm,l=/^[ ]{0,3}[	]{1}/gm,m=/[ ]{2}$/gm,f=new r.Remarkable("commonmark",{html:!1,linkTarget:"_blank"});function p(e){return s.data=e,a.innerHTML}t.escapeTextForMarkdown=function(e){return e=(e=(e=(e=e.replace(d,"\\$&")).replace(u," ")).replace(l," ")).replace(m," ")},t.isMarkdown=function(e){return null!=e&&"string"==typeof e.markdown},t.isStatus=function(e){return null!=e&&"string"==typeof e.status},t.textToHtml=p;var b=["abbr","audio","b","bdo","br","button","canvas","cite","code","command","data","datalist","dfn","em","embed","i","iframe","img","input","kbd","keygen","label","mark","math","meter","noscript","object","output","progress","q","ruby","samp","script","select","small","span","strong","sub","sup","svg","textarea","time","const","video","wbr"];function g(e){var t,n,r,o="",a="";r=!1,(n=e)instanceof Text?r=""!==n.textContent.trim():n instanceof HTMLElement&&(n=n.tagName.toLowerCase(),r=-1!==b.indexOf(n)),r&&(e instanceof Text?o+=p(e.textContent):e instanceof HTMLElement&&(o+=n=(t=e.outerHTML).substring(0,t.indexOf(">")+1),a=(r=t.lastIndexOf("<"))<n.length?"":t.substring(r)));for(var i=0;i<e.childNodes.length;i++)o+=g(e.childNodes[i]);return o+=a}function T(e,t){void 0===t&&(t=o.HTMLContentCategory.Flow);e=f.render(e);return e=t===o.HTMLContentCategory.Phrasing?function(e){c.innerHTML=e;for(var t="",n=0;n<c.childNodes.length;n++)t+=g(c.childNodes[n]);return t}(e):e}t.markdownToHtml=T,t.markdownToText=function(e){return i.innerHTML=T(e,o.HTMLContentCategory.Flow),i.innerText}});