{"version":3,"file":"_commonjsHelpers-CWRKB0iC.js","sources":["../../../app/javascript/src/helpers/documentHelpers.js"],"sourcesContent":["export function metaTagContent(name, fallback = '') {\n return document.querySelector(`meta[name=${name}][content]`)?.content ?? fallback;\n}\n\nexport function dataTagContent(parentId, name, fallback = \"\") {\n if (\n !parentId ||\n !document.querySelector(`#${parentId}`) ||\n !document.querySelector(`#${parentId}`).dataset[name]\n ) return fallback\n\n return document.querySelector(`#${parentId}`).dataset[name];\n}\n\n// scroll to the first visible element matching the selector, with an optional margin on top.\nexport function scrollToElement(selector, top = 0) {\n const element = [...document.querySelectorAll(selector)].filter(el => el.offsetParent !== null)[0];\n if (element) {\n const elementPosition = element.getBoundingClientRect().top + window.scrollY;\n const offsetPosition = elementPosition - top;\n window.scrollTo({ top: offsetPosition });\n }\n}\n\nexport function divTag(content) {\n return `