import e from"@babel/runtime/helpers/taggedTemplateLiteral";var n,t=String.raw,r=function(r){return t(n||(n=e(["<p>","</p>"])),r)},o=function(e,n){return n.reduce((function(e,n){return e.replaceAll("[".concat(n.key,"]"),"".concat(n.label))}),e)},c=function(e){return e.replace(/<[^>]+>/g,"")},a=function(e,n){return n.reduce((function(e,n){return e.replaceAll(n.label,"[".concat(n.key,"]"))}),e)},l=function(e,n){var t=o(e,n);return r(t)},i=function(e,n){var t=c(e);return a(t,n)},u=function(e){var n=c(e);return[r(n||""),!n]};function d(e){var n=0,t=window.getSelection();if(0===t.rangeCount)return n;var r=t.getRangeAt(0),o=r.cloneRange();return o.selectNodeContents(e),o.setEnd(r.endContainer,r.endOffset),n=o.toString().length}function f(e,n){if(e.childNodes[0]){var t=window.getSelection(),r=document.createRange(),o=e.childNodes[0].childNodes[0]||e.childNodes[0];r.setStart(o,n),r.collapse(!0),t.removeAllRanges(),t.addRange(r)}}export{i as convertEditorValueToString,c as convertHtmlToString,l as convertStringToEditorValue,r as convertStringToHtml,d as getCaret,u as getUpdatedHtmlValue,o as replaceStringToLabel,a as replaceStringToValue,f as setCaret};
