{"version":3,"file":"AuthButton.DjqopccH.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/4kMOiow3EEnfYA4HjDya/lMPTbHi4CN12wUBTJzsD/AuthButton.js"],"sourcesContent":["// @ts-nocheck\n// Requested by user: AuthButton with auth-state UI, query-driven modal open, and exported openSignIn bridge.\n// Header button: explicit 16px/700 label (buttons don't inherit page font size), sign-in icon, hover + press states.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{COLORS,FONTS,callFunction,signOutUser,useAuth}from\"https://framerusercontent.com/modules/Ic26Pk7HMKmsRoy616OW/JH48rKe3hNmigtwCFgkg/firebase.js\";import{SignInModal,openSignIn as openSignInModal,closeSignIn}from\"https://framerusercontent.com/modules/Ulx5lLIudibz8Tjv1qlH/Nb1AFA94raxCFNNn4qIu/SignInModal.js\";export function openSignIn(){openSignInModal();}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function AuthButton(props){const{variant,style}=props;const{status}=useAuth();const[open,setOpen]=React.useState(false);const[hovered,setHovered]=React.useState(false);const[pressed,setPressed]=React.useState(false);React.useEffect(()=>{if(typeof window===\"undefined\")return;const params=new URLSearchParams(window.location.search);if(params.get(\"signin\")===\"1\"){React.startTransition(()=>setOpen(true));openSignInModal();}},[]);const isDark=variant===\"onDark\";const outlineColor=isDark?\"rgba(255,255,255,0.7)\":COLORS.navy;const textColor=isDark?COLORS.white:COLORS.navy;const hoverHandlers={onMouseEnter:()=>setHovered(true),onMouseLeave:()=>{setHovered(false);setPressed(false);},onPointerDown:()=>setPressed(true),onPointerUp:()=>setPressed(false)};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"max-content\",...style},children:[status===\"loading\"?/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{width:112,height:44,borderRadius:8,background:isDark?\"rgba(255,255,255,0.18)\":\"#E5E7EB\"}}):status===\"authorized\"?/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:()=>signOutUser(),...hoverHandlers,style:{...base,border:`1.5px solid ${hovered?textColor:outlineColor}`,background:hovered?isDark?\"rgba(255,255,255,0.1)\":\"rgba(30,70,52,0.06)\":\"transparent\",color:textColor,transform:pressed?\"translateY(1px)\":\"none\"},children:\"Log out\"}):/*#__PURE__*/_jsxs(\"button\",{type:\"button\",\"aria-haspopup\":\"dialog\",onClick:()=>{React.startTransition(()=>setOpen(true));openSignInModal();},...hoverHandlers,style:{...base,border:\"1.5px solid transparent\",background:hovered?\"#D9A63F\":COLORS.gold,color:COLORS.navy,boxShadow:hovered?\"0 6px 16px rgba(200,150,46,0.32)\":\"0 2px 8px rgba(200,150,46,0.22)\",transform:pressed?\"translateY(1px)\":\"none\"},children:[/*#__PURE__*/_jsxs(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 24 24\",fill:\"none\",\"aria-hidden\":\"true\",style:{flexShrink:0},children:[/*#__PURE__*/_jsx(\"path\",{d:\"M15 3h3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-3\",stroke:\"currentColor\",strokeWidth:\"2.2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M10 17l5-5-5-5M15 12H3\",stroke:\"currentColor\",strokeWidth:\"2.2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})]}),/*#__PURE__*/_jsx(\"span\",{children:\"Log in\"})]}),/*#__PURE__*/_jsx(SignInModal,{open:open,onClose:()=>{React.startTransition(()=>setOpen(false));closeSignIn();}})]});}addPropertyControls(AuthButton,{variant:{type:ControlType.Enum,options:[\"onDark\",\"onLight\"],defaultValue:\"onDark\"}});const base={display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",gap:8,minHeight:44,minWidth:112,padding:\"0 20px\",borderRadius:8,fontFamily:FONTS.body,fontSize:16,fontWeight:700,letterSpacing:\"0.01em\",lineHeight:1,whiteSpace:\"nowrap\",cursor:\"pointer\",transition:\"background 160ms ease, box-shadow 160ms ease, border-color 160ms ease, transform 80ms ease\"};// Show an element only to signed-in customers (hidden on first paint and while sign-in loads).\nexport function withSignedInOnly(Component){return props=>{const{status}=useAuth();if(RenderTarget.current()===RenderTarget.canvas)return null;return status===\"authorized\"?/*#__PURE__*/_jsx(Component,{...props}):null;};}// Show an element only to visitors who are not signed in (also shown while sign-in loads and on the canvas).\nexport function withSignedOutOnly(Component){return props=>{const{status}=useAuth();if(RenderTarget.current()===RenderTarget.canvas)return /*#__PURE__*/_jsx(Component,{...props});return status===\"authorized\"?null:/*#__PURE__*/_jsx(Component,{...props});};}// Request Account form: also save each submission for admin review (the Framer email still sends).\n// Runs alongside Framer's own submit handler and never blocks it.\nexport function withSaveAccountRequest(Component){return props=>{const onSubmitCapture=e=>{try{const form=e?.currentTarget||e?.target;if(!form||typeof FormData===\"undefined\")return;const fd=new FormData(form);const data={};fd.forEach((v,k)=>{if(typeof v===\"string\")data[k]=v;});callFunction(\"submitAccountRequest\",data).catch(()=>{});}catch{}if(typeof props.onSubmitCapture===\"function\")props.onSubmitCapture(e);};return /*#__PURE__*/_jsx(Component,{...props,onSubmitCapture:onSubmitCapture});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withSignedInOnly\":{\"type\":\"reactHoc\",\"name\":\"withSignedInOnly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"AuthButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"withSignedOutOnly\":{\"type\":\"reactHoc\",\"name\":\"withSignedOutOnly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"openSignIn\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSaveAccountRequest\":{\"type\":\"reactHoc\",\"name\":\"withSaveAccountRequest\",\"annotations\":{\"framerContractVersion\":\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