{"version":3,"file":"Button.C18flk7v.mjs","names":["useMemo","useState","useRef","useCallback","_Fragment","__esmMin","init_ssg_sandbox_shims","pe","te","init_npm_react_18_3_1","_e","de","l","ne","c","init_jsx_runtime","ce","window","addPropertyControls","init_framer_Bf4_tcb2","ControlType","readSaved","raw","STORAGE_KEY","parsed","s","writeSaved","next","SAVED_EVENT","Button","props","className","isPrimary","variant","isSecondary","isClay","done","setDone","available","setAvailable","doneTimer","action","k","saveList","slugs","handleSaveAll","current","baseStyle","fullWidth","sharedDataAttrs","href","business","label","link","savedLabel","init_Button"],"sources":["https:/framerusercontent.com/modules/xIVHh5IB6qHFmVvzDkV1/jrt76E4xAXPYkKIKssnl/Button.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{startTransition,useCallback,useEffect,useMemo,useRef,useState}from\"react\";const STORAGE_KEY=\"only-in-raleigh-saved\";const SAVED_EVENT=\"only-in-raleigh-saved-change\";function readSaved(){if(typeof window===\"undefined\")return[];try{const raw=window.localStorage.getItem(STORAGE_KEY);const parsed=raw?JSON.parse(raw):[];return Array.isArray(parsed)?parsed.filter(s=>typeof s===\"string\"):[];}catch{return[];}}function writeSaved(next){if(typeof window===\"undefined\")return false;try{window.localStorage.setItem(STORAGE_KEY,JSON.stringify(next));window.dispatchEvent(new CustomEvent(SAVED_EVENT));return true;}catch{return false;}}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function Button(props){const{label=\"Button\",variant=\"Primary\",fullWidth=false,action=\"Standard\",link=\"\",slugs=\"\",savedLabel=\"Saved to your list\",business=\"\"}=props;const className=useMemo(()=>\"oir-shared-button\",[]);const isPrimary=variant===\"Primary\";const isSecondary=variant===\"Secondary\";const isClay=variant===\"Clay\";const[done,setDone]=useState(false);const[available,setAvailable]=useState(true);const doneTimer=useRef(null);useEffect(()=>{if(action!==\"Save All\")return;if(typeof window===\"undefined\")return;try{const k=\"__oir_probe\";window.localStorage.setItem(k,\"1\");window.localStorage.removeItem(k);startTransition(()=>setAvailable(true));}catch{startTransition(()=>setAvailable(false));}},[action]);useEffect(()=>{return()=>{if(doneTimer.current!==null&&typeof window!==\"undefined\"){window.clearTimeout(doneTimer.current);}};},[]);const saveList=useMemo(()=>String(slugs).split(\",\").map(s=>s.trim()).filter(Boolean),[slugs]);const handleSaveAll=useCallback(()=>{if(saveList.length===0)return;const current=readSaved();const merged=Array.from(new Set([...current,...saveList]));if(writeSaved(merged)){startTransition(()=>setDone(true));if(typeof window!==\"undefined\"){if(doneTimer.current!==null)window.clearTimeout(doneTimer.current);doneTimer.current=window.setTimeout(()=>{startTransition(()=>setDone(false));},2e3);}}else{startTransition(()=>setAvailable(false));}},[saveList]);const baseStyle={position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",boxSizing:\"border-box\",height:48,minHeight:48,padding:\"0 22px\",borderRadius:2,cursor:\"pointer\",textDecoration:\"none\",userSelect:\"none\",WebkitTapHighlightColor:\"transparent\",touchAction:\"manipulation\",width:fullWidth?\"100%\":\"fit-content\",minWidth:fullWidth?0:\"max-content\",border:isSecondary?\"1px solid #1E3B2F\":\"none\",backgroundColor:isPrimary?\"#1E3B2F\":isClay?\"#B84D36\":isSecondary?\"transparent\":\"transparent\",color:isPrimary||isClay?\"#FAF7F2\":\"#1E3B2F\",boxShadow:\"none\",backgroundImage:\"none\",transition:\"background-color 150ms ease\",fontFamily:\"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif\",fontSize:15,fontWeight:500,lineHeight:\"1\",letterSpacing:0,textTransform:\"none\",whiteSpace:\"nowrap\",outline:\"none\",appearance:\"none\"};const sharedDataAttrs={className,\"data-variant\":variant.toLowerCase()};if(action===\"Save All\"&&!available)return null;if(action===\"Claim Listing\"){const href=\"/featured?business=\"+encodeURIComponent(String(business||\"\"));return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .${className}:focus { outline: none; }\n                .${className}:focus-visible {\n                    outline: 2px solid #B84D36;\n                    outline-offset: 2px;\n                }\n                .${className}[data-variant=\"primary\"]:hover {\n                    background-color: #16302A;\n                }\n                .${className}[data-variant=\"primary\"]:active {\n                    background-color: #16302A;\n                    transform: translateY(1px);\n                }\n                .${className}[data-variant=\"secondary\"]:hover {\n                    background-color: rgba(30, 59, 47, 0.06);\n                }\n                .${className}[data-variant=\"ghost\"]:hover {\n                    text-decoration-line: underline;\n                    text-decoration-thickness: 1px;\n                    text-underline-offset: 3px;\n                }\n                .${className}[data-variant=\"clay\"]:hover {\n                    background-color: #A3432E;\n                }\n                .${className}[data-variant=\"clay\"]:active {\n                    background-color: #A3432E;\n                    transform: translateY(1px);\n                }\n            `}),/*#__PURE__*/_jsx(\"a\",{...sharedDataAttrs,href:href,style:baseStyle,\"aria-label\":label,children:label})]});}return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .${className}:focus { outline: none; }\n                .${className}:focus-visible {\n                    outline: 2px solid #B84D36;\n                    outline-offset: 2px;\n                }\n                .${className}[data-variant=\"primary\"]:hover {\n                    background-color: #16302A;\n                }\n                .${className}[data-variant=\"primary\"]:active {\n                    background-color: #16302A;\n                    transform: translateY(1px);\n                }\n                .${className}[data-variant=\"secondary\"]:hover {\n                    background-color: rgba(30, 59, 47, 0.06);\n                }\n                .${className}[data-variant=\"ghost\"]:hover {\n                    text-decoration-line: underline;\n                    text-decoration-thickness: 1px;\n                    text-underline-offset: 3px;\n                }\n                .${className}[data-variant=\"clay\"]:hover {\n                    background-color: #A3432E;\n                }\n                .${className}[data-variant=\"clay\"]:active {\n                    background-color: #A3432E;\n                    transform: translateY(1px);\n                }\n            `}),action===\"Standard\"&&link?/*#__PURE__*/_jsx(\"a\",{...sharedDataAttrs,href:link,style:baseStyle,\"aria-label\":label,children:label}):/*#__PURE__*/_jsx(\"button\",{...sharedDataAttrs,type:action===\"Submit\"?\"submit\":\"button\",style:baseStyle,\"aria-label\":label,onClick:action===\"Save All\"?handleSaveAll:undefined,\"aria-live\":action===\"Save All\"?\"polite\":undefined,children:action===\"Save All\"&&done?savedLabel:label})]});}addPropertyControls(Button,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Button\"},variant:{type:ControlType.Enum,title:\"Variant\",options:[\"Primary\",\"Secondary\",\"Ghost\",\"Clay\"],optionTitles:[\"Primary\",\"Secondary\",\"Ghost\",\"Clay\"],defaultValue:\"Primary\"},fullWidth:{type:ControlType.Boolean,title:\"Full Width\",defaultValue:false},action:{type:ControlType.Enum,title:\"Action\",options:[\"Standard\",\"Submit\",\"Save All\",\"Claim Listing\"],optionTitles:[\"Standard\",\"Submit\",\"Save All\",\"Claim Listing\"],defaultValue:\"Standard\"},link:{type:ControlType.Link,title:\"Link\",defaultValue:\"\",hidden:props=>props.action!==\"Standard\"},slugs:{type:ControlType.String,title:\"Slugs\",defaultValue:\"\",hidden:props=>props.action!==\"Save All\"},savedLabel:{type:ControlType.String,title:\"Saved Label\",defaultValue:\"Saved to your list\",hidden:props=>props.action!==\"Save All\"},business:{type:ControlType.String,title:\"Business\",defaultValue:\"\",hidden:props=>props.action!==\"Claim Listing\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Button\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Button.map"],"mappings":"A,oOAA+S,SAASqB,GAAW,CAAC,GAAUJ,IAAS,OAAY,MAAM,CAAC,EAAE,GAAG,CAAC,IAAMK,EAAIL,EAAO,aAAa,QAAQM,CAAW,EAAQC,EAAOF,EAAI,KAAK,MAAMA,CAAG,EAAE,CAAC,EAAE,OAAO,MAAM,QAAQ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