{"version":3,"file":"Responsive_postcode_checker.DZuJf5c7.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/0JfeVAozOvzcVRNEdkof/ZsWme6wLdbruoU0pMwDc/Responsive_postcode_checker.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{motion,AnimatePresence}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";const SERVICE_AREAS=[\"3043\",\"3044\",\"3046\",\"3047\",\"3048\",\"3049\",\"3059\",\"3060\",\"3061\",\"3062\",\"3063\",\"3064\",\"3073\",\"3074\",\"3075\",\"3076\",\"3082\",\"3083\",\"3750\",\"3751\",\"3752\",\"3753\",\"3754\",\"3755\"];export default function PostcodeChecker(props){const[postcode,setPostcode]=React.useState(\"\");const[status,setStatus]=React.useState(\"idle\");const checkPostcode=()=>{setStatus(\"idle\");setTimeout(()=>{const cleanedInput=postcode.trim();if(SERVICE_AREAS.includes(cleanedInput)){setStatus(\"success\");}else{setStatus(\"error\");}},100);};const handleKeyDown=e=>{if(e.key===\"Enter\")checkPostcode();};// Logic to handle smooth scrolling to the section ID\nconst handleBookClick=e=>{if(props.sectionId){// Try to find the element by ID\nconst element=document.getElementById(props.sectionId);if(element){e.preventDefault();element.scrollIntoView({behavior:\"smooth\"});}else{// If section isn't found, log a warning but don't crash\nconsole.warn(`Section with ID \"${props.sectionId}\" not found.`);}}};return /*#__PURE__*/_jsxs(\"div\",{className:\"pc-container\",children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .pc-container {\n                    display: flex;\n                    justify-content: center;\n                    align-items: center;\n                    width: 100%;\n                    height: 100%;\n                    padding: 20px;\n                    font-family: \"Inter\", sans-serif;\n                    box-sizing: border-box;\n                }\n                .pc-card {\n                    background: #ffffff;\n                    padding: 32px;\n                    border-radius: 24px;\n                    width: 100%;\n                    max-width: 450px;\n                    box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.08);\n                    border: 1px solid #EBF0F5;\n                    text-align: center;\n                    display: flex;\n                    flex-direction: column;\n                }\n                .pc-header {\n                    font-size: 22px;\n                    font-weight: 700;\n                    color: #0F172A;\n                    margin: 0 0 8px 0;\n                }\n                .pc-subheader {\n                    font-size: 14px;\n                    color: #64748B;\n                    margin: 0 0 24px 0;\n                    line-height: 1.5;\n                }\n                .pc-input-wrapper {\n                    display: flex;\n                    gap: 10px;\n                    width: 100%;\n                }\n                .pc-input {\n                    flex: 1;\n                    padding: 12px 16px;\n                    font-size: 16px;\n                    border-radius: 12px;\n                    border: 1px solid #CBD5E1;\n                    outline: none;\n                    color: #334155;\n                    background: #F8FAFC;\n                    transition: border 0.2s;\n                    -webkit-appearance: none;\n                    appearance: none;\n                }\n                .pc-input:focus {\n                    border-color: #007AFF;\n                    background: #fff;\n                }\n                .pc-button {\n                    padding: 12px 24px;\n                    font-size: 16px;\n                    font-weight: 600;\n                    border-radius: 12px;\n                    border: none;\n                    background: #007AFF;\n                    color: white;\n                    cursor: pointer;\n                    outline: none;\n                    white-space: nowrap;\n                    -webkit-appearance: none;\n                }\n                .pc-link {\n                    color: inherit;\n                    font-weight: 700;\n                    text-decoration: underline;\n                    cursor: pointer;\n                    background: none;\n                    border: none;\n                    padding: 0;\n                    font-size: inherit;\n                }\n                .pc-link:hover {\n                    opacity: 0.8;\n                }\n                \n                @media (max-width: 500px) {\n                    .pc-card { padding: 24px 20px; }\n                    .pc-input-wrapper { flex-direction: column; gap: 12px; }\n                    .pc-button { width: 100%; padding: 14px; }\n                }\n            `}),/*#__PURE__*/_jsxs(\"div\",{className:\"pc-card\",children:[/*#__PURE__*/_jsx(\"h3\",{className:\"pc-header\",children:\"Check Availability\"}),/*#__PURE__*/_jsx(\"p\",{className:\"pc-subheader\",children:\"Enter your postcode to see if we service your area.\"}),/*#__PURE__*/_jsxs(\"div\",{className:\"pc-input-wrapper\",children:[/*#__PURE__*/_jsx(\"input\",{className:\"pc-input\",type:\"text\",placeholder:\"e.g. 3064\",value:postcode,onChange:e=>setPostcode(e.target.value),onKeyDown:handleKeyDown,maxLength:4,inputMode:\"numeric\"}),/*#__PURE__*/_jsx(motion.button,{className:\"pc-button\",whileHover:{scale:1.02},whileTap:{scale:.98},onClick:checkPostcode,children:\"Check\"})]}),/*#__PURE__*/_jsx(\"div\",{style:{height:\"60px\",marginTop:\"20px\"},children:/*#__PURE__*/_jsxs(AnimatePresence,{mode:\"wait\",children:[status===\"success\"&&/*#__PURE__*/_jsxs(motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3},style:successBoxStyle,children:[/*#__PURE__*/_jsx(\"span\",{style:{marginRight:\"8px\"},children:\"✅\"}),/*#__PURE__*/_jsxs(\"span\",{children:[\"We cover your area!\",\" \",/*#__PURE__*/_jsx(\"button\",{onClick:handleBookClick,className:\"pc-link\",children:\"Book now\"})]})]},\"success\"),status===\"error\"&&/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3},style:errorBoxStyle,children:/*#__PURE__*/_jsx(\"span\",{children:\"❌ Sorry, we are not there yet.\"})},\"error\")]})})]})]});}const successBoxStyle={background:\"#ECFDF5\",color:\"#047857\",padding:\"12px\",borderRadius:\"12px\",fontSize:\"15px\",fontWeight:500,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"};const errorBoxStyle={background:\"#FEF2F2\",color:\"#B91C1C\",padding:\"12px\",borderRadius:\"12px\",fontSize:\"15px\",fontWeight:500};addPropertyControls(PostcodeChecker,{sectionId:{type:ControlType.String,title:\"Section ID\",defaultValue:\"booking\",placeholder:\"e.g. booking\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PostcodeChecker\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Responsive_postcode_checker.map"],"mappings":"yOAAyX,SAAwB,E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