{"version":3,"file":"FundraiseUpForm.CsZLqaGm.mjs","names":["useRef","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","p","c","init_jsx_runtime","ce","de","addPropertyControls","init_framer_BkYB2Gqq","RenderTarget","ControlType","loadFundraiseUp","w","n","l","fn","t","d","s","j","a","i","account","FundraiseUpForm","props","hostRef","showLive","liveOnCanvas","code","element","host","justify","align","style","reserveHeight","formHeight","formWidth","placeholderTextColor","placeholderColor","init_FundraiseUpForm"],"sources":["https:/framerusercontent.com/modules/3l0XuIinHtulsFbVloln/igPFgNMFsjMsuSu33sLb/FundraiseUpForm.js"],"sourcesContent":["// FundraiseUpForm.tsx\n// Framer code component for a FundraiseUp embedded donation form.\n// Defaults: account ATPBNEPT, element XVKZRCJU (the form on /give).\n//\n// On the canvas it shows a placeholder the same size as the real form\n// (376 x 446), so you can lay out around it. On the published site it\n// loads the real form. If the FundraiseUp installer is already in the\n// site's head (needed for the ?form=give Give button), it is reused,\n// not loaded twice.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";// FundraiseUp's own installer snippet, unchanged apart from typing.\nfunction loadFundraiseUp(account){if(typeof window===\"undefined\"||window.FundraiseUp)return;(function(w,d,s,n,a){if(!w[n]){const l=\"call,catch,on,once,set,then,track,openCheckout\".split(\",\");const o=function(fn){return typeof fn===\"function\"?o.l.push([arguments])&&o:function(){return o.l.push([fn,arguments])&&o;};};const t=d.getElementsByTagName(s)[0];const j=d.createElement(s);j.async=true;j.src=\"https://cdn.fundraiseup.com/widget/\"+a;if(t&&t.parentNode)t.parentNode.insertBefore(j,t);else d.head.appendChild(j);o.s=Date.now();o.v=5;o.h=w.location.href;o.l=[];for(let i=0;i<8;i++)o[l[i]]=o(l[i]);w[n]=o;}})(window,document,\"script\",\"FundraiseUp\",account);}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 376\n * @framerIntrinsicHeight 446\n */export default function FundraiseUpForm(props){const{account,element,align,reserveHeight,formHeight,formWidth,liveOnCanvas,placeholderColor,placeholderTextColor,style}=props;const hostRef=useRef(null);const isCanvas=RenderTarget.current()===RenderTarget.canvas;const showLive=!isCanvas||liveOnCanvas;const code=(element||\"\").replace(/^#/,\"\").trim();useEffect(()=>{if(!showLive)return;const host=hostRef.current;if(!host||!account||!code)return;// Build the anchor outside React's control, because FundraiseUp\n// adds its own iframe next to it.\nhost.innerHTML=\"\";const a=document.createElement(\"a\");a.href=\"#\"+code;a.style.display=\"none\";host.appendChild(a);loadFundraiseUp(account.trim());return()=>{host.innerHTML=\"\";};},[showLive,account,code]);const justify=align===\"left\"?\"flex-start\":align===\"right\"?\"flex-end\":\"center\";return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",display:\"flex\",justifyContent:justify},children:showLive?/*#__PURE__*/_jsx(\"div\",{ref:hostRef,style:{display:\"flex\",justifyContent:justify,minHeight:reserveHeight?formHeight:undefined,width:\"100%\"}}):/*#__PURE__*/_jsxs(\"div\",{style:{width:formWidth,maxWidth:\"100%\",height:formHeight,boxSizing:\"border-box\",border:`2px dashed ${placeholderTextColor}`,borderRadius:12,background:placeholderColor,color:placeholderTextColor,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:8,padding:24,textAlign:\"center\",fontFamily:\"inherit\",fontSize:14,lineHeight:1.4},children:[/*#__PURE__*/_jsx(\"strong\",{style:{fontSize:16},children:\"Donation form\"}),/*#__PURE__*/_jsxs(\"span\",{children:[\"FundraiseUp #\",code||\"(no element code)\"]}),/*#__PURE__*/_jsx(\"span\",{style:{opacity:.7},children:\"Shows on the published site\"})]})});}FundraiseUpForm.defaultProps={account:\"ATPBNEPT\",element:\"XVKZRCJU\",align:\"center\",reserveHeight:true,formWidth:376,formHeight:446,liveOnCanvas:false,placeholderColor:\"rgba(52, 86, 95, 0.08)\",placeholderTextColor:\"#34565F\"};addPropertyControls(FundraiseUpForm,{account:{type:ControlType.String,title:\"Account\",defaultValue:\"ATPBNEPT\"},element:{type:ControlType.String,title:\"Element\",defaultValue:\"XVKZRCJU\",description:\"The code after # in FundraiseUp's element link.\"},align:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],displaySegmentedControl:true,defaultValue:\"center\"},reserveHeight:{type:ControlType.Boolean,title:\"Reserve space\",defaultValue:true,description:\"Holds the form's height while it loads, so the page doesn't jump.\"},formWidth:{type:ControlType.Number,title:\"Form width\",defaultValue:376,min:200,max:800,unit:\"px\"},formHeight:{type:ControlType.Number,title:\"Form height\",defaultValue:446,min:200,max:1200,unit:\"px\"},liveOnCanvas:{type:ControlType.Boolean,title:\"Live on canvas\",defaultValue:false,description:\"Try loading the real form on the canvas. FundraiseUp may block it there.\"},placeholderColor:{type:ControlType.Color,title:\"Placeholder\",defaultValue:\"rgba(52, 86, 95, 0.08)\"},placeholderTextColor:{type:ControlType.Color,title:\"Placeholder text\",defaultValue:\"#34565F\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FundraiseUpForm\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"446\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"376\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FundraiseUpForm.map"],"mappings":"A,8MAUA,SAASc,EAAgB,EAAQ,CAAWV,IAAS,QAAaA,EAAO,cAAoB,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,CAACW,EAAEC,GAAG,CAAC,IAAMC,EAAE,iDAAiD,MAAM,GAAG,EAAQ,EAAE,SAAS,EAAG,CAAC,OAAO,OAAOC,GAAK,WAAW,EAAE,EAAE,KAAK,C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