{"version":3,"file":"Image_Size_Controller.CSOaHC7t.mjs","names":["useRef","__esmMin","init_npm_react_18_3_1","de","init_jsx_runtime","c","ce","withCMSOptimizedLayout","ref","applyStyles","img","html","node","originalHtml","observer","props","Component","init_Image_Size_Controller"],"sources":["https:/framerusercontent.com/modules/hoCagWWNP8vB0EULUZRX/nlrACs7zDbfSDXpOI3dS/Image_Size_Controller.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";export function withCMSOptimizedLayout(Component){return props=>{const ref=useRef(null);const applyStyles=()=>{if(!ref.current)return;// 1. 이미지 최적화 (가로 사이즈에 맞추어 이미지 자동 확대)\nconst images=ref.current.querySelectorAll(\".framer-image\");images.forEach(img=>{img.style.setProperty(\"display\",\"block\",\"important\");img.style.setProperty(\"width\",\"100%\",\"important\");img.style.setProperty(\"height\",\"auto\",\"important\");});// 2. 텍스트 색상 치환 로직 (3가지 색상 최적화)\nconst textContainers=ref.current.querySelectorAll(\"p, h1, h2, h3, h4, h5, h6, li\");textContainers.forEach(node=>{let html=node.innerHTML;const originalHtml=html;// 규칙 1: ::텍스트:: (#122699 - 진한 파랑)\nhtml=html.replace(/::([\\s\\S]+?)::/g,`<span style=\"color: #122699 !important; --framer-text-color: #122699 !important; font-style: normal !important; font-weight: inherit !important;\">$1</span>`);// 규칙 2: ##텍스트## (#ED3B72 - 분홍색)\nhtml=html.replace(/##([\\s\\S]+?)##/g,`<span style=\"color: #ED3B72 !important; --framer-text-color: #ED3B72 !important; font-style: normal !important; font-weight: inherit !important;\">$1</span>`);// 규칙 3: %%텍스트%% (#2563EB - 밝은 파랑)\nhtml=html.replace(/%%([\\s\\S]+?)%%/g,`<span style=\"color: #2563EB !important; --framer-text-color: #2563EB !important; font-style: normal !important; font-weight: inherit !important;\">$1</span>`);// 실제 변경이 있을 때만 업데이트하여 브라우저 부하 최소화\nif(html!==originalHtml){node.innerHTML=html;}});};useEffect(()=>{applyStyles();// CMS 콘텐츠 로딩 시점 대응을 위한 Observer\nconst observer=new MutationObserver(()=>applyStyles());if(ref.current){observer.observe(ref.current,{childList:true,subtree:true});}return()=>observer.disconnect();},[props.content]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{display:\"contents\"},children:/*#__PURE__*/_jsx(Component,{...props})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCMSOptimizedLayout\":{\"type\":\"reactHoc\",\"name\":\"withCMSOptimizedLayout\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Image_Size_Controller.map"],"mappings":"A,yHAA+E,SAAgBO,EAAuB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAMC,EAAIR,EAAO,IAAI,EAAQS,MAAgB,CAAKD,EAAI,UAC3IA,EAA1C,QAAQ,iBAAiB,eAAsB,CAAC,CAAC,QAAQ,GAAK,CAACE,EAAI,MAAM,YAAY,UAAU,QAAQ,WAAW,EAAEA,EAAI,MAAM,YAAY,QAAQ,OAAO,WAAW,EAAEA,EAAI,MAAM,YAAY,SAAS,OAAO,WAAW,CAAE,CAAC,EACxJF,EAA1D,QAAQ,iBAAiB,+BAA8C,CAAC,CAAC,QAAQ,GAAM,CAAC,IAAIG,EAAKC,EAAK,UAAgBC,EAAaF,EAC5J,EAAKA,EAAK,QAAQ,kBAAkB,6JAA6J,EACjM,EAAKA,EAAK,QAAQ,kBAAkB,6JAA6J,EACjM,EAAKA,EAAK,QAAQ,kBAAkB,6JAA6J,EAC9LA,IAAOE,IAAc,EAAK,UAAUF,EAAM,CAAC,EAAE,EACuI,OADrIL,MAAc,CAACG,EAAY,EAC7E,IAAMK,EAAS,IAAI,qBAAqBL,EAAY,CAAC,EAA+E,OAA1ED,EAAI,SAASM,EAAS,QAAQN,EAAI,QAAQ,CAAC,UAAU,GAAK,QAAQ,EAAI,CAAC,MAAaM,EAAS,WAAW,CAAE,EAAE,CAACC,EAAM,OAAO,CAAC,EAAsB,gBAAK,MAAM,CAAK,MAAI,MAAM,CAAC,QAAQ,UAAU,EAAE,SAAsB,gBAAKC,EAAU,CAAC,GAAGD,CAAK,CAAC,CAAC,CAAC,CAAE,CAAE,C"}