{"version":3,"file":"VisitForm.Dommdiff.mjs","names":["React.useState","__esmMin","init_ssg_sandbox_shims","window","_e","p","c","init_jsx_runtime","init_npm_react_18_3_1","ce","init_framer_BWFVvmND","addPropertyControls","ControlType","ThemeFonts","CSS","useIsMobile","m","setM","on","bp","VisitForm","props","mobile","state","setState","unit","setUnit","key","accessKey","submit","data","j","projectName","field","COL","style","SANS","image","GUT","SERIF","title","text","successText","buttonLabel","init_VisitForm"],"sources":["https:/framerusercontent.com/modules/fcUUg7dMa5wS9tEVb9Pa/LmcDCh2CX62s1HVoBg8f/VisitForm.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Shared base for all Larchwood components: theme fonts, colors, scroll helpers.\n// (Inlined into every component at upload, because Framer code files can't import each other.)\n// Colours and fonts are CSS variables, so the owner can change them for the whole site in\n// Settings > Code > \"Larchwood settings (edit me)\" without touching any component.\nconst SERIF='var(--lw-serif, \"Larch Serif\", \"Erode\", Georgia, serif)';const SANS='var(--lw-sans, \"Larch Sans\", \"Supreme\", system-ui, sans-serif)';const COL={bg:\"var(--lw-page, #ECEEEA)\",surface:\"var(--lw-surface, #DFE3DC)\",dark:\"var(--lw-dark, #1F2E27)\",dark2:\"var(--lw-dark-2, #2C3F35)\",ink:\"var(--lw-text, #18201C)\",mut:\"var(--lw-muted, #5E6A63)\",timber:\"var(--lw-accent, #B98A5B)\",lake:\"var(--lw-highlight, #4F6B78)\",line:\"rgba(24,32,28,0.16)\",lineInv:\"rgba(255,255,255,0.24)\",avail:\"var(--lw-available, #7FA36E)\",reserved:\"var(--lw-reserved, #C9A15E)\",sold:\"var(--lw-sold, #9AA19C)\"};const GUT=\"clamp(16px,3.2vw,48px)\";const CSS=`\n@font-face{font-family:\"Larch Serif\";font-weight:300;font-style:normal;font-display:swap;src:url(https://framerusercontent.com/third-party-assets/fontshare/wf/SQTWW7277QQCMVLHJNNVTLBRNZY4GD2T/WOBS3DQINSMRW7W3SUWMF6MRPLXWHHXR/IV53KIDERL5VZNKHLNGO3Y3ARYXZDX7F.woff2) format(\"woff2\")}\n@font-face{font-family:\"Larch Serif\";font-weight:400;font-style:normal;font-display:swap;src:url(https://framerusercontent.com/third-party-assets/fontshare/wf/6F76RMHFNUMAWUR6FGCXVQGFZMKZHHLB/F5HOKHQFYHQHSI7YYDIPL5ZJMWQYM6CT/SMFAKKZYPUS6JMKLX3YWBR33XTVQTN5D.woff2) format(\"woff2\")}\n@font-face{font-family:\"Larch Sans\";font-weight:400;font-style:normal;font-display:swap;src:url(https://framerusercontent.com/third-party-assets/fontshare/wf/UDGUA26XVGIV6IQWMQNGGAL7FQZFY227/E6HQU6YVWTGYX3KW3DF66KAAJ224ZDU6/5ZZU4JM62PS7KOJ7BOKLPL3AEO2G76TS.woff2) format(\"woff2\")}\n@font-face{font-family:\"Larch Sans\";font-weight:500;font-style:normal;font-display:swap;src:url(https://framerusercontent.com/third-party-assets/fontshare/wf/OTYYUXNCZZI6EV6RSCAQFTGEGQ7JTD6B/45FLQUBI6DWIP6NYFVBTMKS6YPU3VYPT/GHZ524YD2KXKRX4PZ2S7DE3HKNPE2EKH.woff2) format(\"woff2\")}\n`;function ThemeFonts(){return /*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:CSS}});}function pickFont(themeFonts,control,fallback){if(themeFonts!==false||!control?.fontFamily)return fallback;return control.fontFamily;}// 0..1 progress of an element moving through the viewport. mode \"through\": 0 when its top hits the\n// bottom of the screen, 1 when its bottom leaves the top. mode \"pinned\": 0..1 while a tall section is pinned.\nfunction useScrollProgress(ref,mode=\"through\"){const[p,setP]=React.useState(0);React.useEffect(()=>{if(typeof window===\"undefined\")return;let raf=0;const on=()=>{cancelAnimationFrame(raf);raf=requestAnimationFrame(()=>{const el=ref.current;if(!el)return;const r=el.getBoundingClientRect(),h=window.innerHeight;const v=mode===\"pinned\"?-r.top/Math.max(1,r.height-h):(h-r.top)/(h+r.height);setP(Math.min(1,Math.max(0,v)));});};window.addEventListener(\"scroll\",on,{passive:true});window.addEventListener(\"resize\",on);on();return()=>{window.removeEventListener(\"scroll\",on);window.removeEventListener(\"resize\",on);cancelAnimationFrame(raf);};},[mode]);return p;}function useInView(ref,margin=\"-15%\"){const[v,setV]=React.useState(false);React.useEffect(()=>{if(typeof window===\"undefined\"||!ref.current)return;const io=new IntersectionObserver(([e])=>{if(e.isIntersecting){setV(true);io.disconnect();}},{rootMargin:`0px 0px ${margin} 0px`});io.observe(ref.current);return()=>io.disconnect();},[]);return v;}function useIsMobile(bp=810){const[m,setM]=React.useState(false);React.useEffect(()=>{if(typeof window===\"undefined\")return;const on=()=>setM(window.innerWidth<bp);on();window.addEventListener(\"resize\",on);return()=>window.removeEventListener(\"resize\",on);},[bp]);return m;}const reduceMotion=()=>typeof window!==\"undefined\"&&!!window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;const img=i=>i&&i.src?i:null;/**\n * Visit Form - full-screen photo with a short \"book a visit\" form. If the page was opened with\n * ?unit=A-3.02 the home is filled in automatically. Requests are emailed to you through Web3Forms\n * (free): paste your access key in \"Web3Forms key\" or once for the whole site in Settings > Code.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 1200\n */export default function VisitForm(props){const{image,title,text,accessKey,projectName,buttonLabel,successText,style}=props;const mobile=useIsMobile();const[state,setState]=React.useState(\"idle\");const[unit,setUnit]=React.useState(\"\");React.useEffect(()=>{if(typeof window!==\"undefined\")setUnit(new URLSearchParams(window.location.search).get(\"unit\")||\"\");},[]);const key=accessKey||(typeof window!==\"undefined\"?window.LARCHWOOD?.web3formsKey:\"\")||\"\";const submit=async e=>{e.preventDefault();if(!key){setState(\"demo\");return;}setState(\"sending\");const data=Object.fromEntries(new FormData(e.currentTarget).entries());try{const r=await fetch(\"https://api.web3forms.com/submit\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\",Accept:\"application/json\"},body:JSON.stringify({access_key:key,subject:`Visit request \\xb7 ${projectName}${data.home?\" \\xb7 \"+data.home:\"\"}`,from_name:projectName,...data})});const j=await r.json();setState(j.success?\"ok\":\"err\");}catch{setState(\"err\");}};const field={width:\"100%\",boxSizing:\"border-box\",padding:\"15px 16px\",borderRadius:10,border:`1px solid ${COL.line}`,background:\"#fff\",font:\"inherit\",fontSize:16,color:COL.ink};return /*#__PURE__*/_jsxs(\"section\",{id:\"visit\",style:{...style,position:\"relative\",width:\"100%\",minHeight:\"min(88vh, 860px)\",overflow:\"hidden\",background:COL.dark,fontFamily:SANS,display:\"flex\",alignItems:\"center\"},children:[/*#__PURE__*/_jsx(ThemeFonts,{}),image?.src&&/*#__PURE__*/_jsx(\"img\",{src:image.src,srcSet:image.srcSet,alt:image.alt||\"\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,background:\"linear-gradient(90deg, rgba(15,22,19,.66) 0%, rgba(15,22,19,.2) 60%, rgba(15,22,19,0) 100%)\"}}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",maxWidth:1360,margin:\"0 auto\",padding:`clamp(80px,10vh,120px) ${GUT}`,display:\"grid\",gridTemplateColumns:mobile?\"1fr\":\"1fr 440px\",gap:40,alignItems:\"end\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{color:\"#fff\"},children:[/*#__PURE__*/_jsx(\"h2\",{style:{fontFamily:SERIF,fontWeight:300,fontSize:\"clamp(46px,6vw,96px)\",lineHeight:.98,letterSpacing:\"-0.03em\",margin:0,maxWidth:\"14ch\",textWrap:\"balance\"},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{margin:\"20px 0 0\",fontSize:\"clamp(16px,1.3vw,19px)\",lineHeight:1.55,maxWidth:\"40ch\",color:\"rgba(255,255,255,.9)\"},children:text})]}),/*#__PURE__*/_jsx(\"div\",{style:{background:COL.bg,borderRadius:16,padding:26,color:COL.ink},children:state===\"ok\"?/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontSize:18,lineHeight:1.5},children:successText}):/*#__PURE__*/_jsxs(\"form\",{onSubmit:submit,style:{display:\"grid\",gap:12},children:[/*#__PURE__*/_jsx(\"input\",{name:\"name\",required:true,placeholder:\"Your name\",style:field}),/*#__PURE__*/_jsx(\"input\",{name:\"email\",type:\"email\",required:true,placeholder:\"Email\",style:field}),/*#__PURE__*/_jsx(\"input\",{name:\"phone\",placeholder:\"Phone (optional)\",style:field}),/*#__PURE__*/_jsx(\"input\",{name:\"home\",defaultValue:unit,placeholder:\"Home you're interested in (optional)\",style:field},unit),/*#__PURE__*/_jsxs(\"select\",{name:\"when\",style:field,defaultValue:\"Weekday\",children:[/*#__PURE__*/_jsx(\"option\",{children:\"Weekday\"}),/*#__PURE__*/_jsx(\"option\",{children:\"Weekend\"}),/*#__PURE__*/_jsx(\"option\",{children:\"Video call\"})]}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",disabled:state===\"sending\",style:{all:\"unset\",textAlign:\"center\",cursor:\"pointer\",padding:\"17px 24px\",borderRadius:999,background:COL.dark,color:\"#fff\",fontWeight:500,fontSize:16},children:state===\"sending\"?\"Sending…\":buttonLabel}),state===\"err\"&&/*#__PURE__*/_jsx(\"p\",{style:{margin:0,color:\"#B3261E\",fontSize:14},children:\"The request didn't go through. Check your connection and send it again.\"}),state===\"demo\"&&/*#__PURE__*/_jsx(\"p\",{style:{margin:0,color:COL.mut,fontSize:14},children:\"Demo: add your free Web3Forms key to receive these requests by email.\"})]})})]})]});}VisitForm.defaultProps={title:\"Come and see it\",text:\"Walk the show home, the garden and the shore. We'll meet you at the sales pavilion by the lake.\",projectName:\"Larchwood\",buttonLabel:\"Book a visit\",successText:\"Thank you. We'll call or email within one working day to confirm a time.\",accessKey:\"\"};addPropertyControls(VisitForm,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},title:{type:ControlType.String,title:\"Title\"},text:{type:ControlType.String,title:\"Text\",displayTextArea:true},buttonLabel:{type:ControlType.String,title:\"Button\"},successText:{type:ControlType.String,title:\"Thank-you text\",displayTextArea:true},projectName:{type:ControlType.String,title:\"Project name\",description:\"Used in the email subject\"},accessKey:{type:ControlType.String,title:\"Web3Forms key\",description:\"Free at web3forms.com. Or set it once in Settings > Code.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VisitForm\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"1200\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VisitForm.map"],"mappings":"A,sMASE,SAASa,GAAY,CAAC,MAAoB,gBAAK,QAAQ,CAAC,wBAAwB,CAAC,OAAOC,CAAG,CAAC,CAAC,CAAE,CAEw4B,SAASC,EAAY,EAAG,IAAI,CAAC,GAAK,CAACC,EAAEC,GAAMjB,EAAe,EAAK,EAAyM,OAAvMS,MAAoB,CAAC,GAAUN,IAAS,OAAY,OAAO,IAAMe,MAAOD,EAAKd,EAAO,WAAWgB,CAAE,EAA4C,OAA1CD,EAAG,EAAEf,EAAO,iBAAiB,SAASe,CAAE,MAAYf,EAAO,oBAAoB,SAASe,CAAE,CAAE,EAAE,CAACC,CAAE,CAAC,EAASH,CAAE,CAQvvC,SAAwBI,EAAU,EAAM,CAAC,GAAK,CAAC,QAAM,QAAM,OAAK,YAAU,cAAY,cAAY,cAAY,SAAOC,EAAYC,EAAOP,EAAY,EAAO,CAACQ,EAAMC,GAAUxB,EAAe,MAAM,EAAO,CAACyB,EAAKC,GAAS1B,EAAe,EAAE,EAAES,MAAoB,CAAWN,IAAS,QAAYuB,EAAQ,IAAI,gBAAgBvB,EAAO,SAAS,MAAM,CAAC,CAAC,IAAI,MAAM,GAAG,EAAE,CAAE,EAAE,CAAC,CA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