{"version":3,"file":"Embed_from.BXUbP3yG.mjs","names":["React.useRef","React.useState"],"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":"uMAA2H,SAAgB,EAAe,EAAM,CAAC,GAAK,CAAC,MAAI,gBAAc,eAAa,EAAY,EAAUA,EAAa,IAAI,EAAO,CAAC,EAAa,GAAiBC,EAAe,CAAa,EAGpO,OAF3E,MAAoB,CAAC,IAAM,EAAc,GAAO,CAChD,GAAG,EAAM,SAAS,+BAA+B,OAAO,IAAM,EAAO,SAAS,EAAM,KAAK,EAAE,EAAK,CAAC,MAAM,CAAM,GAAG,EAAO,IAAM,GAAY,QAAQ,IAAI,0BAA0B,EAAO,GAAG,EAAE,EAAgB,CAAM,EAAG,EAAmD,OAAjD,EAAO,iBAAiB,UAAU,CAAa,MAAY,EAAO,oBAAoB,UAAU,CAAa,CAAE,EAAE,CAAC,CAAW,CAAC,EACpV,MAAoB,CAAC,EAAgB,CAAa,CAAE,EAAE,CAAC,EAAI,CAAa,CAAC,EAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,SAAS,MAAM,EAAE,SAAsB,EAAK,SAAS,CAAC,IAAI,EAAU,IAAI,EAAI,MAAM,CAAC,MAAM,OAAO,OAAO,EAAa,OAAO,OAAO,QAAQ,OAAO,EAAE,UAAU,KAAK,MAAM,cAAc,CAAC,CAAC,CAAC,CAAE,qBAH9R,IAA4B,IAAoD,EAI1H,EAAoB,EAAe,CAAC,IAAI,CAAC,KAAK,EAAY,OAAO,MAAM,SAAS,aAAa,mEAAmE,YAAY,aAAa,EAAE,cAAc,CAAC,KAAK,EAAY,OAAO,MAAM,YAAY,aAAa,KAAK,IAAI,IAAI,IAAI,IAAI,KAAK,EAAE,EAAE,YAAY,CAAC,KAAK,EAAY,QAAQ,MAAM,OAAO,aAAa,EAAI,CAAC,CAAC"}