{"version":3,"file":"Embedheight.BiXviddA.mjs","names":[],"sources":["https:/framerusercontent.com/modules/7Yi8QIz2iT6XRYKsqphe/HS3ZbWMEQhnxCPwCHCiv/Embedheight.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect}from\"react\";export function AutoHeight(Component){return /*#__PURE__*/forwardRef((props,ref)=>{useEffect(()=>{// 检查是否在浏览器环境\nif(typeof window===\"undefined\"||typeof document===\"undefined\"){return;}function sendHeight(){const height=document.body.scrollHeight;window.parent.postMessage({iframeHeight:height},\"*\");}// 组件挂载后发送一次高度\nsendHeight();// 添加事件监听器\nwindow.addEventListener(\"resize\",sendHeight);// 使用 MutationObserver 监听 DOM 变化\nconst observer=new MutationObserver(()=>{sendHeight();});observer.observe(document.body,{childList:true,subtree:true,attributes:true,characterData:true});// 清理函数\nreturn()=>{window.removeEventListener(\"resize\",sendHeight);observer.disconnect();};},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"AutoHeight\":{\"type\":\"reactHoc\",\"name\":\"AutoHeight\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Embedheight.map"],"mappings":"uIAAmF,SAAgB,EAAW,EAAU,CAAC,OAAoB,GAAY,EAAM,KAAO,MAAc,CACpL,GAAU,IAAS,QAAa,OAAO,SAAW,IAAa,OAAQ,SAAS,GAAY,CAAC,IAAM,EAAO,SAAS,KAAK,aAAa,EAAO,OAAO,YAAY,CAAC,aAAa,CAAM,EAAE,GAAG,CAAE,CAC1L,EAAW,EACX,EAAO,iBAAiB,SAAS,CAAU,EAC3C,IAAM,EAAS,IAAI,qBAAqB,CAAC,EAAW,CAAE,CAAC,EACvD,OADyD,EAAS,QAAQ,SAAS,KAAK,CAAC,UAAU,GAAK,QAAQ,GAAK,WAAW,GAAK,cAAc,EAAI,CAAC,MAC9I,CAAC,EAAO,oBAAoB,SAAS,CAAU,EAAE,EAAS,WAAW,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,EAAU,CAAK,MAAI,GAAG,CAAK,CAAC,EAAG,CAAE,qBALzG,IAAwC"}