{"version":3,"file":"Arcade.CuAT6DXf.mjs","names":["useRef","arcadeIframe","_Fragment"],"sources":["https:/framerusercontent.com/modules/k5vdp8ZfD7bP7KKe3lL5/PvD8ryuUvWhbFshsWkZX/Arcade.js"],"sourcesContent":["// Welcome to Code in Framer\n// Get Started: https://www.framer.com/developers/\n/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/components/auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n *//*\nexport default function Arcade(props) {\n    // This is a React component containing an Example component\n    // Replace <Example /> with your own code\n\n    return <ArcadeEmbed />\n}\n\n// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst containerStyle = {\n    height: \"100%\",\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\",\n    overflow: \"hidden\",\n}\n*/import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";Arcade.defaultProps={arcadeId:\"empty\"};// Styles are written in object syntax\n// Learn more: https://reactjs.org/docs/dom-elements.html#style\nconst imgStyle={width:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};const imgContainerStyle={position:\"relative\",width:\"100%\",height:\"100%\"};addPropertyControls(Arcade,{arcadeId:{type:ControlType.String,title:\"Arcade ID\",description:\"The ID of the arcade you want to show.\"},showImage:{type:ControlType.Boolean,title:\"Show Image\",description:\"Show a starting arcade image\"},image:{type:ControlType.ResponsiveImage,title:\"Initial Image\",description:\"The resting image before the arcade starts.\"},children:{type:ControlType.ComponentInstance}});export default function Arcade(props){const arcadeIframeRef=useRef(null);const arcadeId=props.arcadeId;const showImage=props.showImage;useEffect(()=>{function onArcadeIframeMessage(e){if(e.origin!==\"https://demo.arcade.software\"||!e.isTrusted)return;const arcadeIframe=arcadeIframeRef.current;if(!arcadeIframe||!arcadeIframe.contentWindow)return;if(e.data.event===\"arcade-init\"){arcadeIframe.contentWindow.postMessage({event:\"register-popout-handler\"},\"*\");}if(e.data.event===\"arcade-popout-open\"){arcadeIframe.style[\"height\"]=\"100%\";arcadeIframe.style[\"z-index\"]=\"10\";}if(e.data.event===\"arcade-popout-close\"){arcadeIframe.style[\"height\"]=\"0\";arcadeIframe.style[\"z-index\"]=\"auto\";}}window.addEventListener(\"message\",onArcadeIframeMessage);const arcadeIframe=arcadeIframeRef.current;if(arcadeIframe&&arcadeIframe.contentWindow){arcadeIframe.contentWindow.postMessage({event:\"register-popout-handler\"},\"*\");}return()=>{if(arcadeIframe&&arcadeIframe.contentWindow){arcadeIframe.contentWindow.postMessage({event:\"unregister-popout-handler\"},\"*\");}window.removeEventListener(\"message\",onArcadeIframeMessage);};},[]);function openArcade(){const arcadeIframe=arcadeIframeRef.current;if(arcadeIframe&&arcadeIframe.contentWindow){arcadeIframe.contentWindow.postMessage({event:\"request-popout-open\"},\"*\");}}/*\n    <button\n                onClick={openArcade}\n                style={{\n                    border: \"1px solid #E5E7EB\",\n                    padding: \"8px 12px\",\n                    borderRadius: \"12px\",\n                }}\n            >\n                ✨ Your custom trigger ✨\n            </button>\n\n            <button\n                    style={{\n                        position: \"absolute\",\n                        bottom: \"8px\",\n                        right: \"8px\",\n                        padding: \"8px 16px\",\n                        borderRadius: \"8px\",\n                        border: \"1px solid #E5E7EB\",\n                        cursor: \"pointer\",\n                        top: \"50%\",\n                        left: \"50%\",\n                        height: \"30px\",\n                        transform: \"translate(-50%, -50%)\",\n                    }}\n                >\n                    Click Me\n                </button>\n        */return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"div\",{style:imgContainerStyle,onClick:openArcade,children:[showImage?/*#__PURE__*/_jsx(\"img\",{style:imgStyle,src:props.image.src,srcSet:props.image.srcSet,alt:props.image.alt}):null,/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",padding:\"0px\"},children:props.children})]}),/*#__PURE__*/_jsx(\"iframe\",{ref:arcadeIframeRef,src:`https://demo.arcade.software/${arcadeId}?embed&embed_custom&show_copy_link=true`,title:\"Agent Error Discovery\",frameBorder:\"0\",loading:\"lazy\",allowFullScreen:true,allow:\"clipboard-write\",style:{position:\"fixed\",top:0,left:0,width:\"100%\",height:0,padding:\"60px 0px 0px 0px\",colorScheme:\"light\"}})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Arcade\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Arcade.map"],"mappings":"mMA2BskB,SAAwB,EAAO,EAAM,CAAC,IAAM,EAAgBA,EAAO,KAAK,CAAO,EAAS,EAAM,SAAe,EAAU,EAAM,UAAU,MAAc,CAAC,SAAS,EAAsB,EAAE,CAAC,GAAG,EAAE,SAAS,gCAAgC,CAAC,EAAE,UAAU,OAAO,IAAMC,EAAa,EAAgB,QAAW,CAACA,GAAc,CAACA,EAAa,gBAAwB,EAAE,KAAK,QAAQ,eAAe,EAAa,cAAc,YAAY,CAAC,MAAM,0BAA0B,CAAC,IAAI,CAAK,EAAE,KAAK,QAAQ,uBAAsB,EAAa,MAAM,OAAU,OAAO,EAAa,MAAM,WAAW,MAAS,EAAE,KAAK,QAAQ,wBAAuB,EAAa,MAAM,OAAU,IAAI,EAAa,MAAM,WAAW,SAAS,EAAO,iBAAiB,UAAU,EAAsB,CAAC,IAAM,EAAa,EAAgB,QAAoI,OAAzH,GAAc,EAAa,eAAe,EAAa,cAAc,YAAY,CAAC,MAAM,0BAA0B,CAAC,IAAI,KAAY,CAAI,GAAc,EAAa,eAAe,EAAa,cAAc,YAAY,CAAC,MAAM,4BAA4B,CAAC,IAAI,CAAE,EAAO,oBAAoB,UAAU,EAAsB,GAAK,EAAE,CAAC,CAAC,SAAS,GAAY,CAAC,IAAM,EAAa,EAAgB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