{"version":3,"file":"AuthFormSwitcher.BJoe2QOe.mjs","names":["React.useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/Yw8QPqXW07VIIM9bK6UU/AuEJNs4ONJeQ7mmFHo90/GoogleAuthButton.js","https:/framerusercontent.com/modules/XiVpi8CGD7ZxQSN5QkOd/0cvKUWpBHYAy4X3fCHGT/AuthFormSwitcher.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{SPACE}from\"https://framerusercontent.com/modules/1VwocatbFhWtgmcnhxSy/mN21nupnJUaU4603SKpy/tokens.js\";export function GoogleSignInButton(props){const{text,widthMode,width,shape,disabled,variant,link,openInNewTab}=props;const[isHovered,setHovered]=React.useState(false);const[isPressed,setPressed]=React.useState(false);const borderRadius=shape===\"pill\"?999:6;const computedWidth=widthMode===\"auto\"?\"auto\":width;const variants={white:{backgroundColor:\"#FFFFFF\",border:\"1px solid #747775\",color:\"#1f1f1f\",overlay:\"#303030\"},gray:{backgroundColor:\"#f2f2f2\",border:\"none\",color:\"#1f1f1f\",overlay:\"#001d35\"},black:{backgroundColor:\"#131314\",border:\"1px solid #8e918f\",color:\"#e3e3e3\",overlay:\"#FFFFFF\"}};const current=variants[variant];const overlayOpacity=disabled?0:isPressed?.12:isHovered?.08:0;const sharedStyles={userSelect:\"none\",appearance:\"none\",backgroundColor:current.backgroundColor,border:current.border,borderRadius:borderRadius,boxSizing:\"border-box\",color:current.color,cursor:disabled?\"default\":\"pointer\",fontFamily:\"Roboto, Arial, sans-serif\",fontSize:14,height:40,letterSpacing:.25,outline:\"none\",overflow:\"hidden\",// Google brand-spec button: colors/Roboto/dimensions/gap are locked to\n// Google's sign-in spec and intentionally NOT tokenized. Only the\n// horizontal padding maps cleanly to the scale (SPACE.s === 12, no change).\npadding:`0 ${SPACE.s}px`,position:\"relative\",textAlign:\"center\",whiteSpace:\"nowrap\",width:computedWidth,maxWidth:400,minWidth:\"min-content\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:10,opacity:disabled?.6:1,textDecoration:\"none\",transition:\"box-shadow .2s ease\",boxShadow:isHovered&&!disabled?\"0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15)\":\"none\"};const Content=/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,backgroundColor:current.overlay,opacity:overlayOpacity,transition:\"opacity .2s ease\",pointerEvents:\"none\"}}),/*#__PURE__*/_jsxs(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 48 48\",style:{position:\"relative\",zIndex:1},children:[/*#__PURE__*/_jsx(\"path\",{fill:\"#EA4335\",d:\"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z\"}),/*#__PURE__*/_jsx(\"path\",{fill:\"#4285F4\",d:\"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z\"}),/*#__PURE__*/_jsx(\"path\",{fill:\"#FBBC05\",d:\"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z\"}),/*#__PURE__*/_jsx(\"path\",{fill:\"#34A853\",d:\"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z\"})]}),/*#__PURE__*/_jsx(\"span\",{style:{fontWeight:500,overflow:\"hidden\",textOverflow:\"ellipsis\",position:\"relative\",zIndex:1},children:text})]});const commonHandlers={onMouseEnter:()=>setHovered(true),onMouseLeave:()=>{setHovered(false);setPressed(false);},onMouseDown:()=>setPressed(true),onMouseUp:()=>setPressed(false)};if(link&&!disabled){return /*#__PURE__*/_jsx(\"a\",{href:link,target:openInNewTab?\"_blank\":\"_self\",rel:openInNewTab?\"noopener noreferrer\":undefined,style:sharedStyles,...commonHandlers,children:Content});}return /*#__PURE__*/_jsx(\"button\",{disabled:disabled,style:sharedStyles,...commonHandlers,children:Content});}GoogleSignInButton.defaultProps={text:\"Continue with Google\",widthMode:\"fixed\",width:220,shape:\"pill\",disabled:false,variant:\"white\",link:\"\",openInNewTab:false};addPropertyControls(GoogleSignInButton,{text:{type:ControlType.String,title:\"Text\"},link:{type:ControlType.Link,title:\"Link\"},openInNewTab:{type:ControlType.Boolean,title:\"New Tab\",hidden:props=>!props.link},widthMode:{type:ControlType.Enum,title:\"Width\",options:[\"fixed\",\"auto\"],optionTitles:[\"Fixed\",\"Auto\"]},width:{type:ControlType.Number,title:\"Fixed Width\",min:120,max:400,unit:\"px\",hidden:props=>props.widthMode!==\"fixed\"},shape:{type:ControlType.Enum,title:\"Shape\",options:[\"rectangular\",\"pill\"],optionTitles:[\"Rectangular\",\"Pill\"]},variant:{type:ControlType.Enum,title:\"Color\",options:[\"white\",\"gray\",\"black\"],optionTitles:[\"White\",\"Gray\",\"Black\"]},disabled:{type:ControlType.Boolean,title:\"Disabled\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"GoogleSignInButton\":{\"type\":\"reactComponent\",\"name\":\"GoogleSignInButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useAuthStore}from\"https://framerusercontent.com/modules/ikWDM2j1IKcGFRD8Aoe1/xt3MZqXMwLhJsyebj2RW/authFormStore.js\";import{useProfileStore}from\"https://framerusercontent.com/modules/lgBoQxNllKFfCc4ryt8E/2rEtHbzzbNZOEE5MWkaE/profileStore.js\";import{useCrossFade}from\"https://framerusercontent.com/modules/q0nqbX11iRfI37rG7en4/HEMMWNHyLKw4GG9n2T88/transitions.js\";import{BreakpointSlot}from\"https://framerusercontent.com/modules/PBW5n8IP7UMOK4bJVd1g/uSiCveJGxIcfEuaXgBuj/BreakpointSlot.js\";/**\n * AuthFormSwitcher — drag-and-drop replacement for Auth.tsx's AuthFormVariant\n * override. Switches between the auth FORM and the \"check your email\" SUCCESS\n * view, driven by `authFormStore.flowState`.\n *\n * NOT the same as AuthSwitcher (that one is the nav login/logout swap, driven by\n * profileStore). This one hosts an auth PAGE.\n *\n * One component, used as two instances on two distinct pages:\n *   /auth/signup → drop in the signup form + the signup success message\n *   /auth/login  → drop in the login form  + the login  success message\n * Signup-vs-login is decided by what you drop into each instance, not by this\n * component — distinct pages and URLs are preserved.\n *\n * flowState mapping (authFormStore is the single source of truth):\n *   \"Default\"    → form    (resting)\n *   \"Submitting\" → form    (the Continue button shows its own loading variant —\n *                           see ContinueSignup / ContinueLogin in Auth.tsx)\n *   \"Success\"    → success\n *\n * The success message is static text inside the success layer, per page, so the\n * old dynamic StatusText was only ever needed for inline errors (which keep\n * flowState === \"Default\", i.e. stay on the form).\n *\n * BreakpointSlot handles the desktop/mobile pick (see framer/ui/BreakpointSlot.tsx).\n */export default function AuthFormSwitcher(props){const{form,success,formMobile,successMobile,transitionMs}=props;const[auth]=useAuthStore();const[profile]=useProfileStore();const isCanvas=RenderTarget.current()===RenderTarget.canvas;// Preserve AuthFormVariant's redirect: a visitor who is already authenticated\n// should not sit on the auth page — bounce them to the dashboard. (Moved here\n// from the useEffect that lived in AuthFormVariant.) Never in the Framer\n// editor — a window.location redirect on the canvas is the repo-wide no-no.\nReact.useEffect(()=>{if(isCanvas)return;if(!profile.loading&&profile.authenticated){window.location.href=\"https://importa-coffee.com/dashboard\";}},[isCanvas,profile.authenticated,profile.loading]);const activeView=auth.flowState===\"Success\"?\"success\":\"form\";const{visibleKey:visibleView,fadeStyle}=useCrossFade(activeView,transitionMs);// Until the active slot is filled, render a fixed-size placeholder instead of\n// an empty, content-less host. A bare `<div style={{height:\"100%\"}}>` with no\n// children is an intrinsically-sized void: dropped freely on a page in the\n// Framer editor it gives the canvas nothing stable to measure → measurement\n// loop → freeze. The sibling SubscriptionCreationSwitcher avoids the same trap\n// by rendering a sized skeleton in its not-ready state.\nconst activeSlotEmpty=visibleView===\"form\"?form==null:success==null;if(activeSlotEmpty){return /*#__PURE__*/_jsx(Placeholder,{label:visibleView===\"form\"?'Assign the \"Form\" layer':'Assign the \"Success\" layer'});}let content=null;if(visibleView===\"form\")content=/*#__PURE__*/_jsx(BreakpointSlot,{desktop:form,mobile:formMobile});if(visibleView===\"success\")content=/*#__PURE__*/_jsx(BreakpointSlot,{desktop:success,mobile:successMobile});// No height:100% — the host sizes to the active slot's own height. Width-wise\n// BreakpointSlot stretches the linked layers to fill, same as every other\n// switcher.\nreturn /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",display:\"block\",...fadeStyle},children:content});}function Placeholder({label}){return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",minHeight:96,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxSizing:\"border-box\",padding:16,textAlign:\"center\",border:\"1px dashed #c9c9c9\",borderRadius:8,color:\"#8a8a8a\",font:\"500 13px/1.4 -apple-system, system-ui, sans-serif\"},children:[\"AuthFormSwitcher — \",label]});}addPropertyControls(AuthFormSwitcher,{form:{type:ControlType.ComponentInstance,title:\"Form\"},success:{type:ControlType.ComponentInstance,title:\"Success\"},formMobile:{type:ControlType.ComponentInstance,title:\"Form (Mobile)\"},successMobile:{type:ControlType.ComponentInstance,title:\"Success (Mobile)\"},transitionMs:{type:ControlType.Number,title:\"Fade\",defaultValue:120,min:0,max:600,unit:\"ms\",step:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\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