{"version":3,"file":"LMFLTallyEmbed.FfQmZtZX.mjs","names":["w","React.useRef"],"sources":["https:/framerusercontent.com/modules/1fMcNb44BM6hM9GUoUVg/d5RyzSHpvDW8comWTJEm/LMFLTallyEmbed.js"],"sourcesContent":["// LMFL Tally Embed: shows a Tally form inside the page (no redirect to tally.so).\n// \"Form ID\" is the code at the end of the form link, e.g. tally.so/r/jadgjR → jadgjR.\n// The registration form (jadgjR) saves every booking to Airtable \"LMFL Bookings\" → Registrations.\n// Uses Tally's own embed script, so the frame always grows to fit the form: the page scrolls, never the form box.\n// When the respondent moves to the next form page, the page scrolls back up to the top of the form.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";const SCRIPT=\"https://tally.so/widgets/embed.js\";function loadTally(){if(typeof window===\"undefined\")return Promise.resolve();const w=window;if(w.Tally)return Promise.resolve();return new Promise(resolve=>{let s=document.querySelector(`script[src=\"${SCRIPT}\"]`);if(!s){s=document.createElement(\"script\");s.src=SCRIPT;s.async=true;document.body.appendChild(s);}s.addEventListener(\"load\",()=>resolve());s.addEventListener(\"error\",()=>resolve());setTimeout(resolve,4e3);});}/**\n * @framerIntrinsicWidth 760\n * @framerIntrinsicHeight 900\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function LMFLTallyEmbed(props){const{formId=\"jadgjR\",title=\"Registration form\",maxWidth=760,startHeight=900,style}=props;const ref=React.useRef(null);const id=(formId||\"\").trim();const src=`https://tally.so/embed/${id}?alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=1`;React.useEffect(()=>{if(!id)return;let cancelled=false;loadTally().then(()=>{const w=window;if(cancelled)return;if(w.Tally&&typeof w.Tally.loadEmbeds===\"function\"){w.Tally.loadEmbeds();}else if(ref.current&&!ref.current.getAttribute(\"src\")){ref.current.setAttribute(\"src\",src)// fallback: plain iframe\n;}});// Fallback height + scroll-to-top on page change, whatever format Tally's messages arrive in\nconst onMsg=e=>{if(!ref.current||e.source!==ref.current.contentWindow)return;let d=e.data;if(typeof d===\"string\"){try{d=JSON.parse(d);}catch(err){return;}}if(!d||typeof d!==\"object\")return;if(d.event===\"Tally.Resize\"&&d.payload&&d.payload.height){ref.current.style.height=`${Number(d.payload.height)}px`;}if(d.event===\"Tally.FormPageView\"&&d.payload&&d.payload.page>1){const top=ref.current.getBoundingClientRect().top+window.scrollY-120;if(window.scrollY>top)window.scrollTo({top,behavior:\"smooth\"});}};window.addEventListener(\"message\",onMsg);return()=>{cancelled=true;window.removeEventListener(\"message\",onMsg);};},[id]);return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:\"100%\",display:\"flex\",justifyContent:\"center\"},children:id?/*#__PURE__*/_jsx(\"iframe\",{ref:ref,\"data-tally-src\":src,title:title,loading:\"eager\",width:\"100%\",style:{width:\"100%\",maxWidth,height:startHeight,border:\"none\",margin:0,display:\"block\",overflow:\"hidden\"},scrolling:\"no\"}):/*#__PURE__*/_jsx(\"p\",{style:{fontFamily:\"'EB Garamond', Garamond, serif\",fontSize:17},children:\"Add a Tally form ID in the panel.\"})});}addPropertyControls(LMFLTallyEmbed,{formId:{type:ControlType.String,title:\"Form ID\",defaultValue:\"jadgjR\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Registration form\"},maxWidth:{type:ControlType.Number,title:\"Max Width\",defaultValue:760,min:320,max:1200,step:10,unit:\"px\"},startHeight:{type:ControlType.Number,title:\"Start Height\",defaultValue:900,min:300,max:3e3,step:50,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LMFLTallyEmbed\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"760\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"900\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMapp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