{"version":3,"file":"WithGrid.DatMdoQ5.mjs","names":["useState","React"],"sources":["https:/framerusercontent.com/modules/kK6ADXs1DmdnfhxtChFm/JanpK5x5j4M2D4Tofe7D/WithGrid.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import debounce from\"lodash/debounce\";import React from\"react\";export function withGridLine(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,transformOrigin:\"top left\"},animate:{scaleX:[0,1]},transition:{duration:2,ease:[.075,.82,.165,1]}});};}export function withGridWidth(Component){return props=>{const DEFAULT_WIDTH=25;const[width,setWidth]=useState(DEFAULT_WIDTH);useEffect(()=>{const style=document.createElement(\"style\");style.textContent=`\n                .grid-align:nth-child(2n) {\n                    justify-content: end;\n                }\n\n                .grid-align:nth-child(3n) {\n                    justify-content: center;\n                }\n            `;document.head.appendChild(style);return()=>{document.head.removeChild(style);};},[]);// 콘텐츠가 없으면 width를 0으로 설정\nconst isEmpty=!props.children||React.Children.count(props.children)===0;const dynamicWidth=isEmpty?0:width;return /*#__PURE__*/_jsx(Component,{...props,className:`${props.className} grid-align`,style:{...props.style,width:`${dynamicWidth}vw`}});useEffect(()=>{const onResize=()=>{if(window.matchMedia(\"(max-width: 609px)\").matches){setWidth(100);}else if(window.matchMedia(\"(max-width: 1100px)\").matches){setWidth(50);}else{setWidth(DEFAULT_WIDTH);}};const debouncedResize=debounce(onResize,200);window.addEventListener(\"resize\",debouncedResize);onResize();return()=>{window.removeEventListener(\"resize\",debouncedResize);};},[]);return /*#__PURE__*/_jsx(Component,{...props,className:`${props.className} grid-align`,style:{...props.style,width:`${width}vw`}});};}export function withGridWidthImage(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,width:\"75vw\",minWidth:0}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withGridLine\":{\"type\":\"reactHoc\",\"name\":\"withGridLine\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGridWidthImage\":{\"type\":\"reactHoc\",\"name\":\"withGridWidthImage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withGridWidth\":{\"type\":\"reactHoc\",\"name\":\"withGridWidth\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithGrid.map"],"mappings":"mLAAgJ,SAAgB,EAAa,EAAU,CAAC,MAAO,IAA4B,EAAK,EAAU,CAAC,GAAG,EAAM,MAAM,CAAC,GAAG,EAAM,MAAM,gBAAgB,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAI,CAAC,SAAgB,EAAc,EAAU,CAAC,MAAO,IAAO,CAAwB,GAAK,CAAC,EAAM,GAAUA,EAAS,EAAa,EAAE,MAAc,CAAC,IAAM,EAAM,SAAS,cAAc,OAAO,EAQxf,MAR0f,GAAM,YAAY;;;;;;;;cAQ7iB,SAAS,KAAK,YAAY,CAAK,MAAY,CAAC,SAAS,KAAK,YAAY,CAAK,CAAE,CAAE,EAAE,CAAC,CAAC,EACzB,IAAM,EAAhE,CAAC,EAAM,UAAUC,EAAM,SAAS,MAAM,EAAM,QAAQ,IAAI,EAA6B,EAAE,EAAM,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,UAAU,GAAG,EAAM,UAAU,aAAa,MAAM,CAAC,GAAG,EAAM,MAAM,MAAM,GAAG,EAAa,GAAG,CAAC,CAAC,CAAqgB,CAAE,qBAThtB,IAAsC,IAAsC"}