{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/lBUL7hNof3LnxpMniEOE/KV5lgMfnslwC7rISy1vR/Blog.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export function withToc(Component){return props=>{const ref=useRef(null);useEffect(()=>{if(ref.current){const images=ref.current.querySelectorAll(\".framer-image\");images.forEach(img=>{img.style.display=\"block\";img.style.marginLeft=\"auto\";img.style.marginRight=\"auto\";img.style.width=\"100%\";img.style.height=\"auto\"// Maintains aspect ratio\n;// Add a smooth transition for width, height, and opacity\nimg.style.transition=\"width 0.4s cubic-bezier(0.4,0,0.2,1), height 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.4s cubic-bezier(0.4,0,0.2,1)\";// Optional: fade in effect on mount\nimg.style.opacity=\"0\";setTimeout(()=>{img.style.opacity=\"1\";},10);});}},[]);return /*#__PURE__*/_jsx(\"div\",{className:\"sj-toc-content\",style:{width:\"100%\"},ref:ref,children:/*#__PURE__*/_jsx(Component,{...props})});};}export function withInlineCTA(Component){return props=>{const containerRef=useRef(null);useEffect(()=>{const headings=containerRef.current.querySelectorAll(\"h1, h2, h3, h4, h5, h6\");if(headings.length>0){const topLevel=Math.min(...Array.from(headings).map(h=>parseInt(h.tagName[1])));const topLevelHeadings=containerRef.current.querySelectorAll(`h${topLevel}`);if(topLevelHeadings.length>=3){const target=topLevelHeadings[2];const injectDiv=document.createElement(\"div\");injectDiv.setAttribute(\"data-getsitecontrol-inline\",\"348807\");injectDiv.style.marginTop=\"20px\";injectDiv.style.marginBottom=\"20px\";target.parentNode.insertBefore(injectDiv,target);}}},[containerRef]);return /*#__PURE__*/_jsx(\"div\",{id:\"sj-cta-target\",ref:containerRef,children:/*#__PURE__*/_jsx(Component,{...props})});};}export function withDynamicContent(Component){return props=>{useEffect(()=>{// Function to fetch the embed code from Twitter's oEmbed API\nasync function fetchEmbedCode(url){const response=await fetch(`https://twp.senja.workers.dev?url=${url}`);const data=await response.json();return data.html;}// Function to find and replace plaintext Twitter URLs with embeds\nasync function replaceTwitterUrls(){const regex=/https?:\\/\\/(www\\.)?(twitter|x)\\.com\\/[a-zA-Z0-9_]{1,15}\\/status(?:es)?\\/\\d+(?:\\?[a-zA-Z0-9_=&]+)?(?:#\\w+)?/g;const elements=document.body.getElementsByTagName(\"*\");for(const element of elements){if(element.children.length===0){const text=element.textContent;const matches=text.match(regex);if(matches){const index=Array.from(elements).indexOf(element);for(const match of matches){element.style.display=\"none\";const embedCode=await fetchEmbedCode(match);const embedWrapper=document.createElement(\"div\");embedWrapper.innerHTML=embedCode;embedWrapper.classList.add(\"tw-embed-wrapper\");embedWrapper.style.display=\"flex\";embedWrapper.style.flexDirection=\"column\";setInnerHTML(element,element.innerHTML.replace(match,embedWrapper.outerHTML));element.style.display=\"block\";}}}}}function loadTwitterScript(){const script=document.createElement(\"script\");script.src=\"https://platform.twitter.com/widgets.js\";script.async=true;document.body.appendChild(script);}replaceTwitterUrls();convertBoldItalicParagraphsToBlockquotes();styleParagraphsWithTripleBang();replaceCodeBlocksWithCode();},[]);return /*#__PURE__*/_jsx(Component,{...props});};}function setInnerHTML(elm,html){elm.innerHTML=html;Array.from(elm.querySelectorAll(\"script\")).forEach(oldScriptEl=>{const newScriptEl=document.createElement(\"script\");Array.from(oldScriptEl.attributes).forEach(attr=>{newScriptEl.setAttribute(attr.name,attr.value);});const scriptText=document.createTextNode(oldScriptEl.innerHTML);newScriptEl.appendChild(scriptText);oldScriptEl.parentNode.replaceChild(newScriptEl,oldScriptEl);});}function replaceCodeBlocksWithCode(){const codeBlocks=Array.from(document.querySelectorAll(\".framer-cb\"));console.log(codeBlocks);for(const codeBlock of codeBlocks){const code=codeBlock.textContent;const codeWrapper=document.createElement(\"div\");codeBlock.replaceWith(codeWrapper);setInnerHTML(codeWrapper,code);}}function convertBoldItalicParagraphsToBlockquotes(){// Select all paragraph elements with the specific class\nconst paragraphs=document.querySelectorAll(\"p\");// Iterate through each paragraph\nparagraphs.forEach(p=>{const excluded=[\"BLOCKQUOTE\",\"LI\"];if(excluded.find(e=>p.parentNode.nodeName==e))return;// Check if the paragraph contains an <em> tag, which in turn contains a <strong> tag\n// Create a container to hold all bold and italic text\nlet combinedText=\"\";// Find all nested <em> and <strong> elements\nconst ems=p.querySelectorAll(\"em.framer-text\");ems.forEach(em=>{const strongs=em.querySelectorAll(\"strong.framer-text\");strongs.forEach(strong=>{combinedText+=strong.textContent;});});// Ensure the combined text matches the entire content of the paragraph\nif(combinedText&&combinedText===p.textContent){// Create a blockquote element\nconst blockquote=document.createElement(\"blockquote\");// Apply the styles to the blockquote\nblockquote.style.background=\"#f8fafc\";blockquote.style.padding=\"20px\";blockquote.style.borderTopRightRadius=\"4px\";blockquote.style.borderBottomRightRadius=\"4px\";blockquote.style.marginLeft=\"0px\";blockquote.style.marginRight=\"0px\";blockquote.style.borderLeft=\"2px solid #2dd4bf\";p.style.color=\"#4b5563\";p.style.marginBottom=\"0px\";// Insert the blockquote before the paragraph in the DOM\np.parentNode.insertBefore(blockquote,p);p.querySelectorAll(\"em\").forEach(em=>em.style.fontStyle=\"normal\");p.querySelectorAll(\"strong\").forEach(strong=>{strong.style.fontWeight=\"500\";strong.style.fontStyle=\"normal\";});// Move the paragraph inside the blockquote\nblockquote.appendChild(p);}});}function styleParagraphsWithTripleBang(){// Select all elements with class 'framer-text' within 'p' tags.\nconst elements=document.querySelectorAll(\"p.framer-text\");const handleTextNodes=node=>{if(node.nodeType===Node.TEXT_NODE){// Remove the triple bank from the start of the text and trim.\nnode.textContent=node.textContent?.replace(/^\\s*\\!\\!\\!/,\"\")||\"\";}else{// Recursively check for text nodes in child nodes.\nnode.childNodes.forEach(handleTextNodes);if(node.style)node.style.fontSize=\"16px\";}};// Iterate over the selected elements.\nelements.forEach(element=>{// Check if the text content starts with a triple bank '$$$'.\nif(element.textContent?.startsWith(\"!!!\")){element.style.background=\"#f3f4f6\";element.style.padding=\"20px\";element.style.borderRadius=\"4px\";element.style.marginLeft=\"0px\";element.style.fontSize=\"16px\";element.childNodes.forEach(handleTextNodes);}});}\nexport const __FramerMetadata__ = {\"exports\":{\"withInlineCTA\":{\"type\":\"reactHoc\",\"name\":\"withInlineCTA\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDynamicContent\":{\"type\":\"reactHoc\",\"name\":\"withDynamicContent\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withToc\":{\"type\":\"reactHoc\",\"name\":\"withToc\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Blog.map"],
  "mappings": "uDAAsF,SAASA,EAAQC,EAAU,CAAC,OAAOC,GAAO,CAAC,IAAMC,EAAIC,EAAO,IAAI,EAAE,OAAAC,EAAU,IAAI,CAAIF,EAAI,SAAsBA,EAAI,QAAQ,iBAAiB,eAAe,EAAS,QAAQG,GAAK,CAACA,EAAI,MAAM,QAAQ,QAAQA,EAAI,MAAM,WAAW,OAAOA,EAAI,MAAM,YAAY,OAAOA,EAAI,MAAM,MAAM,OAAOA,EAAI,MAAM,OAAO,OAElYA,EAAI,MAAM,WAAW,sHACrBA,EAAI,MAAM,QAAQ,IAAI,WAAW,IAAI,CAACA,EAAI,MAAM,QAAQ,GAAI,EAAE,EAAE,CAAE,CAAC,CAAG,EAAE,CAAC,CAAC,EAAsBC,EAAK,MAAM,CAAC,UAAU,iBAAiB,MAAM,CAAC,MAAM,MAAM,EAAE,IAAIJ,EAAI,SAAsBI,EAAKN,EAAU,CAAC,GAAGC,CAAK,CAAC,CAAC,CAAC,CAAE,CAAE,CAAiyB,SAASM,EAAmBC,EAAU,CAAC,OAAOC,IAAQC,EAAU,IAAI,CAC9jC,eAAeC,EAAeC,EAAI,CAAyG,OAAtB,MAAnE,MAAM,MAAM,qCAAqCA,CAAG,EAAE,GAA4B,KAAK,GAAc,IAAK,CAC5J,eAAeC,GAAoB,CAAC,IAAMC,EAAM,8GAAoHC,EAAS,SAAS,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IA,EAAK,WAAW,KAAK,UAC/GA,EAAK,YAAYA,EAAK,aAAa,QAAQ,aAAa,EAAE,GAAG,IAC7DA,EAAK,WAAW,QAAQD,CAAe,EAAKC,EAAK,QAAMA,EAAK,MAAM,SAAS,QAAQ,EACnF7B,EAAS,QAAQC,GAAS,CACvBA,EAAQ,aAAa,WAAW,KAAK,IAAGA,EAAQ,MAAM,WAAW,UAAUA,EAAQ,MAAM,QAAQ,OAAOA,EAAQ,MAAM,aAAa,MAAMA,EAAQ,MAAM,WAAW,MAAMA,EAAQ,MAAM,SAAS,OAAOA,EAAQ,WAAW,QAAQ2B,CAAe,EAAG,CAAC,CAAE",
  "names": ["withToc", "Component", "props", "ref", "pe", "ue", "img", "p", "withDynamicContent", "Component", "props", "ue", "fetchEmbedCode", "url", "replaceTwitterUrls", "regex", "elements", "element", "matches", "index", "match", "embedCode", "embedWrapper", "setInnerHTML", "loadTwitterScript", "script", "convertBoldItalicParagraphsToBlockquotes", "styleParagraphsWithTripleBang", "replaceCodeBlocksWithCode", "p", "elm", "html", "oldScriptEl", "newScriptEl", "attr", "scriptText", "codeBlocks", "codeBlock", "code", "codeWrapper", "combinedText", "em", "strong", "blockquote", "handleTextNodes", "node"]
}
