{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/fOgfG68ese6X1aupH5rJ/3VYSa7VseI7Xv724TNKK/Markdown_table_CMS.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useStore=createStore({background:\"#F7F7FA\"});export function TableOverride(Component){return props=>{const[store]=useStore();const extractAndFormatTable=React.useCallback(()=>{const contentDivs=document.querySelectorAll('[data-framer-name=\"Content\"][data-framer-component-type=\"RichTextContainer\"]');contentDivs.forEach(contentDiv=>{const codeBlocks=contentDiv.querySelectorAll(\".framer-text.framer-text-module\");codeBlocks.forEach(codeBlock=>{if(codeBlock instanceof HTMLElement){// Get the framer-cb div to access CSS variables\nconst framerCbDiv=codeBlock.querySelector(\".framer-cb\");if(!framerCbDiv)return;// Extract CSS variables from the style attribute\nconst styleAttr=framerCbDiv.getAttribute(\"style\")||\"\";const cssVars={};styleAttr.split(\";\").forEach(pair=>{const[key,value]=pair.split(\":\").map(s=>s.trim());if(key.startsWith(\"--\")){cssVars[key]=value;}});// Determine if we're in light or dark mode\nconst colorScheme=cssVars[\"--cb-color-scheme-dark\"]===\"light\"?\"light\":\"light\";// Find the div with the border (sp-layout)\nconst borderDiv=codeBlock.querySelector(\".sp-layout\");if(!borderDiv)return;// Extract the border properties and padding from the style attribute\nconst borderStyle=window.getComputedStyle(borderDiv);const borderWidth=borderStyle.borderWidth;const borderColor=borderStyle.borderColor;const borderRadius=borderStyle.borderRadius;const padding=borderStyle.getPropertyValue(\"--cb-padding\")||\"27px\"// Default to 27px if not set\n;// Create an outer container for the border\nconst outerContainer=document.createElement(\"div\");outerContainer.style.cssText=`\n                            border: ${borderWidth} solid ${borderColor};\n                            border-radius: ${borderRadius};\n                            overflow: hidden;\n                            width: 100%;\n                            height: 100%;\n                        `;// Create an inner container for the scrollable content\nconst innerContainer=document.createElement(\"div\");innerContainer.style.cssText=`\n                            overflow: auto;\n                            width: 100%;\n                            height: 100%;\n                        `;// Create the table\nconst table=document.createElement(\"table\");table.style.cssText=`\n                            border-collapse: separate;\n                            border-spacing: 0;\n                            width: 100%;\n                        `;// Convert extracted content to HTML table\nconst codeContent=codeBlock.textContent||\"\";const tableLines=codeContent.split(/\\r?\\n/).filter(line=>line.trim()!==\"\");const tableHtml=tableLines.map((row,index)=>{const cells=row.split(\"|\").map(cell=>cell.trim()).filter(cell=>cell!==\"\");if(index===0){return`<tr>${cells.map((cell,cellIndex)=>`<th${cellIndex===0?' class=\"first-column\"':\"\"}>${cell}</th>`).join(\"\")}</tr>`;}else if(index===1){return\"\"// Skip the separator row\n;}else{while(cells.length<4){cells.push(\"\");}return`<tr>${cells.map((cell,cellIndex)=>`<td${cellIndex===0?' class=\"first-column\"':\"\"}>${cell.replace(/\\<br\\>/g,\"<br>\")}</td>`).join(\"\")}</tr>`;}}).filter(row=>row!==\"\").join(\"\");table.innerHTML=`\n                            <table style=\"width: 100%; border-collapse: separate; border-spacing: 0;\">\n                                ${tableHtml}\n                            </table>\n                        `;// Add styles\nconst style=document.createElement(\"style\");style.textContent=`\n                            table th, table td {\n                                padding: ${padding};\n                                text-align: left;\n                                background-color: ${cssVars[`--cb-colors-surface1-${colorScheme}`]};\n                                border-right: 1px solid ${borderColor};\n                                border-bottom: 1px solid ${borderColor};\n                            }\n                            table th {\n                                font-weight: regular;\n                                font-size: 14px;\n                                color: ${cssVars[`--cb-syntax-color-plain-${colorScheme}`]};\n                                position: sticky;\n                                top: 0;\n                                z-index: 1;\n                            }\n                            .first-column {\n                                white-space: nowrap;\n                                overflow: hidden;\n                                text-overflow: ellipsis;\n                            }\n                            table tr:last-child td {\n                                border-bottom: none;\n                            }\n                            table th:last-child,\n                            table td:last-child {\n                                border-right: none;\n                            }\n                        `;outerContainer.appendChild(style);// Assemble the structure\ninnerContainer.appendChild(table);outerContainer.appendChild(innerContainer);// Replace the content of the code block with the new structure\ncodeBlock.innerHTML=\"\";codeBlock.appendChild(outerContainer);}});});},[store.background]);React.useEffect(()=>{extractAndFormatTable();// Add a MutationObserver to handle dynamic content changes\nconst observer=new MutationObserver(extractAndFormatTable);const contentDivs=document.querySelectorAll('[data-framer-name=\"Content\"][data-framer-component-type=\"RichTextContainer\"]');contentDivs.forEach(contentDiv=>{observer.observe(contentDiv,{childList:true,subtree:true});});// Remove white-space: pre-wrap from the Content div and set opacity to 1\nconst style=document.createElement(\"style\");style.textContent=`\n                [data-framer-name=\"Content\"][data-framer-component-type=\"RichTextContainer\"] {\n                    white-space: normal !important;\n                    opacity: 1 !important;\n                }\n                [data-framer-name=\"Content\"][data-framer-component-type=\"RichTextContainer\"] > div {\n                    white-space: normal !important;\n                    opacity: 1 !important;\n                }\n            `;document.head.appendChild(style);return()=>{observer.disconnect();document.head.removeChild(style);};},[extractAndFormatTable]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"TableOverride\":{\"type\":\"reactHoc\",\"name\":\"TableOverride\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Markdown_table_CMS.map"],
  "mappings": "yIAA4I,IAAMA,EAASC,EAAY,CAAC,WAAW,SAAS,CAAC,EAAS,SAASC,EAAcC,EAAU,CAAC,OAAOC,GAAO,CAAC,GAAK,CAACC,CAAK,EAAEL,EAAS,EAAQM,EAA4BC,EAAY,IAAI,CAAmB,SAAS,iBAAiB,8EAA8E,EAAc,QAAQC,GAAY,CAAkBA,EAAW,iBAAiB,iCAAiC,EAAa,QAAQC,GAAW,CAAC,GAAGA,aAAqB,YAAY,CAClnB,IAAMC,EAAYD,EAAU,cAAc,YAAY,EAAE,GAAG,CAACC,EAAY,OACxE,IAAMC,EAAUD,EAAY,aAAa,OAAO,GAAG,GAASE,EAAQ,CAAC,EAAED,EAAU,MAAM,GAAG,EAAE,QAAQE,GAAM,CAAC,GAAK,CAACC,EAAIC,CAAK,EAAEF,EAAK,MA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,EAAsBgC,EAAKnC,EAAU,CAAC,GAAGC,CAAK,CAAC,CAAE,CAAE",
  "names": ["useStore", "createStore", "TableOverride", "Component", "props", "store", "extractAndFormatTable", "te", "contentDiv", "codeBlock", "framerCbDiv", "styleAttr", "cssVars", "pair", "key", "value", "s", "colorScheme", "borderDiv", "borderStyle", "window", "borderWidth", "borderColor", "borderRadius", "padding", "outerContainer", "innerContainer", "table", "tableHtml", "line", "row", "index", "cells", "cell", "cellIndex", "style", "ue", "observer", "p"]
}
