{"version":3,"file":"SubsplashGiving.B73ilb3G.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/qk1z3ksclmbJIsVrtKkf/0a9NDMR56xojHwsFNToI/SubsplashGiving.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const SCRIPT_SRC=\"https://dashboard.static.subsplash.com/production/web-client/external/embed-1.1.0.js\";/**\n * Subsplash giving form embed.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function SubsplashGiving(props){const{path,baseUrl,embedId,minHeight}=props;const containerRef=useRef(null);const isCanvas=RenderTarget.current()===RenderTarget.canvas;useEffect(()=>{if(isCanvas||typeof window===\"undefined\")return;const container=containerRef.current;if(!container)return;// Fresh anchor element that Subsplash targets by id\ncontainer.innerHTML=\"\";const anchor=document.createElement(\"div\");anchor.id=embedId;container.appendChild(anchor);const run=()=>{if(window.subsplashEmbed){window.subsplashEmbed(path,baseUrl,embedId);}};if(window.subsplashEmbed){run();return;}let script=document.querySelector(`script[src=\"${SCRIPT_SRC}\"]`);if(script){script.addEventListener(\"load\",run);}else{script=document.createElement(\"script\");script.type=\"text/javascript\";script.src=SCRIPT_SRC;script.onload=run;container.insertBefore(script,anchor);}return()=>{script?.removeEventListener(\"load\",run);};},[path,baseUrl,embedId,isCanvas]);if(isCanvas){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",minHeight,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",borderRadius:16,border:\"2px dashed rgba(23,23,23,0.2)\",background:\"rgba(73,188,245,0.08)\",fontFamily:\"Source Sans 3, sans-serif\",fontSize:16,color:\"rgb(23,23,23)\",textAlign:\"center\",padding:24,boxSizing:\"border-box\"},children:\"Subsplash giving form — shows in Preview and on the published site\"});}return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",minHeight}});}SubsplashGiving.defaultProps={path:\"u/-XSGVDG/give?&embed=true\",baseUrl:\"https://subsplash.com/\",embedId:\"subsplash-embed-2682\",minHeight:600};addPropertyControls(SubsplashGiving,{path:{type:ControlType.String,title:\"Path\",defaultValue:\"u/-XSGVDG/give?&embed=true\"},baseUrl:{type:ControlType.String,title:\"Base URL\",defaultValue:\"https://subsplash.com/\"},embedId:{type:ControlType.String,title:\"Embed ID\",defaultValue:\"subsplash-embed-2682\"},minHeight:{type:ControlType.Number,title:\"Min Height\",defaultValue:600,min:200,max:2e3,step:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SubsplashGiving\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SubsplashGiving.map"],"mappings":"sMAKG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,OAAK,UAAQ,UAAQ,aAAW,EAAY,EAAaA,EAAO,IAAI,EAAQ,EAAS,EAAa,QAAQ,IAAI,EAAa,OACk1B,OAD30B,MAAc,CAAC,GAAG,GAAiB,IAAS,OAAY,OAAO,IAAM,EAAU,EAAa,QAAQ,GAAG,CAAC,EAAU,OAC5S,EAAU,UAAU,GAAG,IAAM,EAAO,SAAS,cAAc,KAAK,EAAE,EAAO,GAAG,EAAQ,EAAU,YAAY,CAAM,EAAE,IAAM,MAAQ,CAAI,EAAO,gBAAgB,EAAO,eAAe,EAAK,EAAQ,CAAO,CAAG,EAAE,GAAG,EAAO,eAAe,CAAC,EAAI,EAAE,MAAO,CAAC,IAAI,EAAO,SAAS,cAAc,eAAe,EAAW,GAAG,EAA4M,OAAvM,EAAQ,EAAO,iBAAiB,OAAO,CAAG,GAAQ,EAAO,SAAS,cAAc,QAAQ,EAAE,EAAO,KAAK,kBAAkB,EAAO,IAAI,EAAW,EAAO,OAAO,EAAI,EAAU,aAAa,EAAO,CA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