{"version":3,"file":"Embed_from.BTdk-bJZ.mjs","names":["React.useRef","React.useState","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","window","ce","init_jsx_runtime","c","_e","de","addPropertyControls","init_framer_CN96F41L","ControlType","AdaptiveIframe","props","iframeRef","iframeHeight","setIframeHeight","defaultHeight","handleMessage","event","height","enableDebug","url","init_Embed_from"],"sources":["https:/framerusercontent.com/modules/wGsAKtmjosaHXp1aSRfN/3b0Bhzo2bOr1ZSC8CRZr/Embed_from.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function AdaptiveIframe(props){const{url,defaultHeight,enableDebug}=props;const iframeRef=React.useRef(null);const[iframeHeight,setIframeHeight]=React.useState(defaultHeight);// 监听来自 iframe 的 postMessage 消息\nReact.useEffect(()=>{const handleMessage=event=>{// 安全校验：只接受来自 PowerfulForm 域名的消息\nif(event.origin!==\"https://app.powerfulform.com\")return;const height=parseInt(event.data,10);if(!isNaN(height)&&height>0){if(enableDebug)console.log(`[AdaptiveIframe] 收到高度: ${height}px`);setIframeHeight(height);}};window.addEventListener(\"message\",handleMessage);return()=>window.removeEventListener(\"message\",handleMessage);},[enableDebug]);// 如果 URL 变化，重置高度为默认值（等待新消息）\nReact.useEffect(()=>{setIframeHeight(defaultHeight);},[url,defaultHeight]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",overflow:\"auto\"},children:/*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,src:url,style:{width:\"100%\",height:iframeHeight,border:\"none\",display:\"block\"},scrolling:\"no\",title:\"PowerfulForm\"})});}// 属性面板配置（让您在 Framer 中直接输入 URL 和调整参数）\naddPropertyControls(AdaptiveIframe,{url:{type:ControlType.String,title:\"表单 URL\",defaultValue:\"https://app.powerfulform.com/share/8rjr31-h0/148269?locale=zh-CN\",placeholder:\"https://...\"},defaultHeight:{type:ControlType.Number,title:\"后备高度 (px)\",defaultValue:1600,min:400,max:3e3,step:50},enableDebug:{type:ControlType.Boolean,title:\"调试日志\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"AdaptiveIframe\":{\"type\":\"reactComponent\",\"name\":\"AdaptiveIframe\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Embed_from.map"],"mappings":"A,uMAA2H,SAAgBc,EAAe,EAAM,CAAC,GAAK,CAAC,MAAI,gBAAc,eAAaC,EAAYC,EAAUhB,EAAa,IAAI,EAAO,CAACiB,EAAaC,GAAiBjB,EAAekB,CAAa,EAGpO,OAF3Eb,MAAoB,CAAC,IAAMc,EAAc,GAAO,CAChD,GAAGC,EAAM,SAAS,+BAA+B,OAAO,IAAMC,EAAO,SAASD,EAAM,KAAK,EAAE,EAAK,CAAC,MAAMC,CAAM,GAAGA,EAAO,IAAMC,GAAY,QAAQ,IAAI,0BAA0BD,EAAO,GAAG,EAAEJ,EAAgBI,CAAM,EAAG,EAAmD,OAAjDjB,EAAO,iBAAiB,UAAUe,CAAa,MAAYf,EAAO,oBAAoB,UAAUe,CAAa,CAAE,EAAE,CAACG,CAAW,CAAC,EACpVjB,MAAoB,CAACY,EAAgBC,CAAa,CAAE,EAAE,CAACK,EAAIL,CAAa,CAAC,EAAsB,gBAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,SAAS,MAAM,EAAE,SAAsB,gBAAK,SAAS,CAAC,IAAIH,EAAU,IAAIQ,EAAI,MAAM,CAAC,MAAM,OAAO,OAAOP,EAAa,OAAO,OAAO,QAAQ,OAAO,EAAE,UAAU,KAAK,MAAM,cAAc,CAAC,CAAC,CAAC,CAAE,C,8CACxUN,EAAoBG,EAAe,CAAC,IAAI,CAAC,KAAKD,EAAY,OAAO,MAAM,SAAS,aAAa,mEAAmE,YAAY,aAAa,EAAE,cAAc,CAAC,KAAKA,EAAY,OAAO,MAAM,YAAY,aAAa,KAAK,IAAI,IAAI,IAAI,IAAI,KAAK,EAAE,EAAE,YAAY,CAAC,KAAKA,EAAY,QAAQ,MAAM,OAAO,aAAa,EAAI,CAAC,CAAC,C"}