{"version":3,"file":"Auth.Da4gl7pQ.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/UvgqWMKb76I5s5ovTiLF/xY6hQ0Di97fkW7aSaw2R/Auth.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{addPropertyControls}from\"framer\";const SESSION_KEY=\"framer_auth_session\";// ===== CUSTOMIZATION SECTION =====\n// Edit this section to customize the password protection\n// Add or remove passwords here (case-sensitive)\nconst ALLOWED_PASSWORDS=[\"SNdesign25\"];// Customize the text content here\nconst TEXT_CONTENT={title:\"This content is private\",subtitle:\"Please enter password to continue\",errorMessage:\"Incorrect password. Please try again.\",buttonText:\"Submit\",returnButtonText:\"Return to projects\"};// Change this URL to where you want users to return when clicking the link to return\nconst RETURN_URL=\"https://snevilledesign.com/mywork\";// Customize the design here\nconst STYLE_TOKENS={colors:{background:\"#FFFFFF\",text:\"#000000\",primary:\"#000000\",secondaryText:\"#605D64\",buttonText:\"#FFFFFF\",error:\"#D8512A\",inputBorder:\"#CCCCCC\",inputBorderFocus:\"#000000\",inputBorderError:\"#D8512A\",buttonHover:\"#333333\",linkHover:\"#333333\"},fonts:{heading:\"Instrument Sans, sans-serif\",body:\"Instrument Sans, sans-serif\",button:\"Instrument Sans, sans-serif\"},fontSizes:{title:\"clamp(1.25rem, 1.586vw + 1.151rem, 2rem)\",paragraph:\"18px\",link:\"14px\",input:\"16px\",button:\"16px\",small:\"14px\"},fontWeights:{normal:\"500\",medium:\"600\",bold:\"800\"},spacing:{xs:\"4px\",sm:\"8px\",md:\"12px\",lg:\"24px\",xl:\"32px\",xxl:\"48px\",xxxl:\"56px\"},borderRadius:{small:\"8px\"},container:{maxWidth:\"400px\"}};// ===== END OF CUSTOMIZATION SECTION =====\nconst styles={container:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",minHeight:\"100vh\",backgroundColor:STYLE_TOKENS.colors.background,fontFamily:STYLE_TOKENS.fonts.body,color:STYLE_TOKENS.colors.text,padding:STYLE_TOKENS.spacing.md},header:{marginBottom:STYLE_TOKENS.spacing.lg,textAlign:\"center\"},title:{fontSize:STYLE_TOKENS.fontSizes.title,fontWeight:STYLE_TOKENS.fontWeights.bold,fontFamily:STYLE_TOKENS.fonts.heading,lineHeight:\"125%\",marginBottom:STYLE_TOKENS.spacing.xs},subtitle:{fontFamily:STYLE_TOKENS.fonts.body,fontWeight:STYLE_TOKENS.fontWeights.normal,fontSize:STYLE_TOKENS.fontSizes.paragraph,lineHeight:\"150%\",margin:\"0px\",color:STYLE_TOKENS.colors.secondaryText},link:{fontFamily:STYLE_TOKENS.fonts.body,fontWeight:STYLE_TOKENS.fontWeights.medium,fontSize:STYLE_TOKENS.fontSizes.link,lineHeight:\"150%\",margin:\"0px\",color:STYLE_TOKENS.colors.secondaryText},form:{width:\"100%\",maxWidth:STYLE_TOKENS.container.maxWidth},inputContainer:{position:\"relative\"},input:{width:\"100%\",fontFamily:STYLE_TOKENS.fonts.body,fontSize:STYLE_TOKENS.fontSizes.paragraph,fontWeight:STYLE_TOKENS.fontWeights.normal,paddingTop:STYLE_TOKENS.spacing.md,paddingBottom:STYLE_TOKENS.spacing.md,paddingLeft:STYLE_TOKENS.spacing.md,paddingRight:STYLE_TOKENS.spacing.xxxl,fontSize:STYLE_TOKENS.fontSizes.input,border:`1px solid ${STYLE_TOKENS.colors.inputBorder}`,borderRadius:STYLE_TOKENS.borderRadius.small,outline:\"none\",transition:\"border-color 0.3s\",WebkitAppearance:\"none\",MozAppearance:\"none\",appearance:\"none\"},inputError:{borderColor:STYLE_TOKENS.colors.inputBorderError},showPasswordButton:{position:\"absolute\",right:STYLE_TOKENS.spacing.md,top:\"50%\",transform:\"translateY(-50%)\",background:\"none\",border:\"none\",cursor:\"pointer\",padding:\"0\"},button:{width:\"100%\",padding:STYLE_TOKENS.spacing.md,marginTop:STYLE_TOKENS.spacing.lg,fontFamily:STYLE_TOKENS.fonts.button,fontSize:STYLE_TOKENS.fontSizes.button,fontWeight:STYLE_TOKENS.fontWeights.medium,color:STYLE_TOKENS.colors.buttonText,backgroundColor:STYLE_TOKENS.colors.primary,border:\"none\",borderRadius:STYLE_TOKENS.borderRadius.small,cursor:\"pointer\",transition:\"background-color 0.3s\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},buttonHovered:{backgroundColor:STYLE_TOKENS.colors.buttonHover},error:{color:STYLE_TOKENS.colors.error,marginTop:STYLE_TOKENS.spacing.md,fontSize:STYLE_TOKENS.fontSizes.small},returnLink:{marginTop:STYLE_TOKENS.spacing.xxl,color:STYLE_TOKENS.colors.text,textDecoration:\"none\",fontSize:STYLE_TOKENS.fontSizes.small,display:\"flex\",alignItems:\"center\"},returnLinkHovered:{color:STYLE_TOKENS.colors.linkHover}};export function requireAuth(Component){return props=>{const[authenticated,setAuthenticated]=useState(false);const[showPassword,setShowPassword]=useState(false);const[errorMessage,setErrorMessage]=useState(\"\");const[loading,setLoading]=useState(true);const[hovered,setHovered]=useState(false);const passwordRef=useRef(null);// Check for existing session on component mount\nuseEffect(()=>{const checkSession=()=>{const session=localStorage.getItem(SESSION_KEY);if(session){try{const sessionData=JSON.parse(session);const isValid=Date.now()<sessionData.expiresAt;// Check if the stored password is still valid\nconst passwordStillValid=ALLOWED_PASSWORDS.includes(sessionData.password);if(isValid&&passwordStillValid){setAuthenticated(true);}else{// Clear invalid session\nlocalStorage.removeItem(SESSION_KEY);setAuthenticated(false);}}catch(e){localStorage.removeItem(SESSION_KEY);setAuthenticated(false);}}setLoading(false);};checkSession();},[]);useEffect(()=>{if(passwordRef.current){passwordRef.current.focus();}},[]);const createSession=password=>{// Set session to expire in 24 hours\nconst expiresAt=Date.now()+24*60*60*1e3;localStorage.setItem(SESSION_KEY,JSON.stringify({authenticated:true,expiresAt,password}));};const validateAuth=e=>{e.preventDefault();const inputPassword=e.target.elements.password.value;if(ALLOWED_PASSWORDS.includes(inputPassword)){setAuthenticated(true);createSession(inputPassword)// Pass the password to createSession\n;setErrorMessage(\"\");}else{setAuthenticated(false);setErrorMessage(TEXT_CONTENT.errorMessage);}e.target.elements.password.value=\"\";};if(loading){return null// Or return a loading spinner\n;}if(!authenticated){return /*#__PURE__*/_jsxs(\"div\",{style:styles.container,children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.header,children:[/*#__PURE__*/_jsx(\"h1\",{style:styles.title,children:TEXT_CONTENT.title}),/*#__PURE__*/_jsx(\"p\",{style:styles.subtitle,children:TEXT_CONTENT.subtitle})]}),/*#__PURE__*/_jsxs(\"form\",{onSubmit:validateAuth,style:styles.form,children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.inputContainer,children:[/*#__PURE__*/_jsx(\"input\",{type:showPassword?\"text\":\"password\",name:\"password\",ref:passwordRef,style:{...styles.input,...errorMessage?styles.inputError:{}},onFocus:e=>e.target.style.borderColor=STYLE_TOKENS.colors.inputBorderFocus,onBlur:e=>e.target.style.borderColor=errorMessage?STYLE_TOKENS.colors.inputBorderError:STYLE_TOKENS.colors.inputBorder,autoComplete:\"new-password\"}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:()=>setShowPassword(!showPassword),style:styles.showPasswordButton,children:showPassword?/*#__PURE__*/_jsx(\"p\",{style:styles.link,children:\"Hide\"}):/*#__PURE__*/_jsx(\"p\",{style:styles.link,children:\"Show\"})})]}),errorMessage&&/*#__PURE__*/_jsx(\"p\",{style:styles.error,children:errorMessage}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{...styles.button,...hovered?styles.buttonHovered:{}},onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),children:/*#__PURE__*/_jsx(\"span\",{children:TEXT_CONTENT.buttonText})})]}),/*#__PURE__*/_jsx(\"a\",{href:RETURN_URL,style:styles.returnLink,onMouseEnter:e=>e.currentTarget.style.color=STYLE_TOKENS.colors.linkHover,onMouseOut:e=>e.currentTarget.style.color=STYLE_TOKENS.colors.text,children:TEXT_CONTENT.returnButtonText})]});}return /*#__PURE__*/_jsx(Component,{...props});};}// Add property controls (if needed)\naddPropertyControls(requireAuth,{});\nexport const __FramerMetadata__ = {\"exports\":{\"requireAuth\":{\"type\":\"reactHoc\",\"name\":\"requireAuth\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Auth.map"],"mappings":"wQAOklF,SAAgB,EAAY,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAc,GAAkBA,EAAS,GAAM,CAAM,CAAC,EAAa,GAAiBA,EAAS,GAAM,CAAM,CAAC,EAAa,GAAiBA,EAAS,GAAG,CAAM,CAAC,EAAQ,GAAYA,EAAS,GAAK,CAAM,CAAC,EAAQ,GAAYA,EAAS,GAAM,CAAO,EAAYC,EAAO,KAAK,CACp5F,MAAc,MAAwB,CAAC,IAAM,EAAQ,aAAa,QAAQ,EAAY,CAAC,GAAG,EAAS,GAAG,CAAC,IAAM,EAAY,KAAK,MAAM,EAAQ,CAAO,EAAQ,KAAK,KAAK,CAAC,EAAY,UAC5K,EAAmB,EAAkB,SAAS,EAAY,SAAS,CAAI,GAAS,EAAoB,EAAiB,GAAK,EAChI,aAAa,WAAW,EAAY,CAAC,EAAiB,GAAM,OAAW,CAAC,aAAa,WAAW,EAAY,CAAC,EAAiB,GAAM,CAAG,EAAW,GAAM,IAAiB,EAAG,EAAE,CAAC,CAAC,MAAc,CAAI,EAAY,SAAS,EAAY,QAAQ,OAAO,EAAI,EAAE,CAAC,CAAC,IAAM,EAAc,GAAU,CACxR,IAAM,EAAU,KAAK,KAAK,CAAC,KAAM,GAAG,IAAI,aAAa,QAAQ,EAAY,KAAK,UAAU,CAAC,cAAc,GAAK,YAAU,WAAS,CAAC,CAAC,EAEs/C,OAD/+C,EAAgB,KAClJ,EAAqoD,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,CAA5nD,EAAM,MAAM,CAAC,MAAM,EAAO,UAAU,SAAS,CAAc,E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