function chr4(){return Math.random().toString(16).slice(-4)}function getId(e){if(e===void 0){e=""}return e+"-"+chr4()+chr4()+"-"+chr4()+"-"+chr4()+chr4()+chr4()}function isEmpty(e){if(typeof e==="undefined"){return true}if(e==null){return true}if((e===null||e===void 0?void 0:e.length)===0){return true}if((e===null||e===void 0?void 0:e.length)>0){return false}for(var t in e){if(e.hasOwnProperty(t)){return false}}return JSON.stringify(e)===JSON.stringify({})}var toSnakeCase=function(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1_$2").toLowerCase()};var bracketToDot=function(e){if(isEmpty(e)){return null}return"".concat(e).replace(/\[([^\]]+)\]/g,".$1")};function filterData(e,t){if(t===void 0){t={}}if(Object.keys(t).length){return Object.keys(t).reduce((function(e,n){return e.replaceAll("{".concat(n,"}"),t[n])}),e)}return e}function filterIcon(e){return(e||"").replace(/(\:).+?(\:)/g,(function(e){return'<i class="icon-'.concat(e.replaceAll(":",""),'"></i>')}))}function filterBold(e){return(e||"").replace(/(\*).+?(\*)/g,(function(e){return"<strong>".concat(e.replaceAll("*",""),"</strong>")}))}function filterItalic(e){return(e||"").replace(/(\_).+?(\_)/g,(function(e){return"<em>".concat(e.replaceAll("_",""),"</em>")}))}function filterCode(e){return(e||"").replace(/(\`).+?(\`)/g,(function(e){return"<code>".concat(e.replaceAll("`",""),"</code>")}))}function tinyMDtoHTML(e,t){if(t===void 0){t={}}return filterData(filterIcon(filterBold(filterItalic(filterCode(e)))),t)}function getLangFromDocument(){return document.querySelector("html").getAttribute("lang")||"es"}function getLangFromBrowser(){var e=navigator.language;return e.substring(0,1)}function getLang(){var e=getLangFromDocument()||getLangFromBrowser();return["en","es"].includes(e)?e:"es"}function alertCodeByStatus(e){switch(e){case 400:return"error";case 401:case 403:return"forbidden";case 402:return"payment";case 404:case 405:return"unknown";case 406:return"no-result";case 412:case 418:return"invalid";case 422:return"missing";case 500:return"exception";default:return"failure"}}function getMeta(e){var t;return(t=document.querySelector('meta[name="'.concat(e,'"]')))===null||t===void 0?void 0:t.getAttribute("content")}function cls(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return e.reduce((function(e,t){if(typeof t==="object"&&typeof t!=="string"){e=e.concat(Object.keys(t).filter((function(e){return t[e]})))}if(typeof t!=="object"&&typeof t==="string"){e.push(t)}return e}),[]).join(" ")}function getOverlayContainer(){if(!document.querySelector("body > x-overlay-container")){var e=document.createElement("x-overlay-container");document.querySelector("body").appendChild(e);return e}else{return document.querySelector("body > x-overlay-container")}}function evaluateOverlayIndex(e){var t;var n=getOverlayContainer();var r=parseInt((t=n.dataset.lastIndex)!==null&&t!==void 0?t:"0")+1;e.style.zIndex=(9e3+r).toString();n.dataset.lastIndex=r.toString()}function getTooltipElement(){if(!getOverlayContainer().querySelector("x-tooltip-overlay")){var e=document.createElement("x-tooltip-overlay");var t=document.createElement("span");var n=document.createElement("div");e.setAttribute("role","tooltip");n.classList.add("tooltip-arrow");e.appendChild(t);e.appendChild(n);getOverlayContainer().appendChild(e);return e}else{return getOverlayContainer().querySelector("x-tooltip-overlay")}}function getNotificationContainerElement(e){if(e===void 0){e="top"}if(!getOverlayContainer().querySelector("x-notification-".concat(e))){var t=document.createElement("x-notification-".concat(e));getOverlayContainer().appendChild(t);return t}else{return getOverlayContainer().querySelector("x-notification-".concat(e))}}var prefixFileSize=function(e){if(isNaN(e)||e<0)return"0 b";var t=["b","Kb","Mb","Gb","Tb","Pb"];var n=0;while(e>=1e3&&n<t.length-1){e/=1e3;n++}return"".concat(e.toFixed(1)).concat(t[n])};var getRemPixels=function(){return parseFloat(getComputedStyle(document.documentElement).fontSize)};export{getLang as a,alertCodeByStatus as b,cls as c,getId as d,evaluateOverlayIndex as e,getOverlayContainer as f,getNotificationContainerElement as g,getTooltipElement as h,isEmpty as i,getMeta as j,toSnakeCase as k,filterData as l,bracketToDot as m,getRemPixels as n,prefixFileSize as p,tinyMDtoHTML as t};