{"version":3,"file":"shared-lib.BccMFdlr.mjs","names":["useState","useRef","useCallback","useMemo"],"sources":["https:/framerusercontent.com/modules/LvjRPnsrGNr6yw8A8bph/Qb2i1y3O64SsLSpD2qyz/SitePasswordGate.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{startTransition,useCallback,useEffect,useMemo,useRef,useState}from\"react\";const SESSION_UNLOCK_KEY=\"site-password-gate-unlocked\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function SitePasswordGate(props){const{title=\"Private Preview\",message=\"Welcome to Pepper by Previsor AI. Enter the access password to continue.\",password=\"Upstat3h3alth26\",buttonLabel=\"Unlock\",incorrectPasswordMessage=\"Incorrect password. Please try again.\",surfaceColor=\"rgba(16, 14, 14, 0.92)\",backdropColor=\"rgba(6, 6, 8, 0.58)\",accentColor=\"#C87A3A\",textColor=\"#F3EBDD\",blurAmount=12,cornerRadius=16}=props;const[isLocked,setIsLocked]=useState(true);const[typedPassword,setTypedPassword]=useState(\"\");const[errorMessage,setErrorMessage]=useState(\"\");const inputRef=useRef(null);useEffect(()=>{if(typeof window===\"undefined\")return;let unlocked=false;try{unlocked=window.sessionStorage.getItem(SESSION_UNLOCK_KEY)===\"true\";}catch{unlocked=false;}if(unlocked){startTransition(()=>setIsLocked(false));}else{startTransition(()=>setIsLocked(true));}},[]);useEffect(()=>{if(!isLocked)return;if(typeof window===\"undefined\"||typeof document===\"undefined\")return;inputRef.current?.focus();},[isLocked]);const handlePasswordChange=useCallback(event=>{const nextValue=event.target.value;startTransition(()=>setTypedPassword(nextValue));if(errorMessage)startTransition(()=>setErrorMessage(\"\"));},[errorMessage]);const handleSubmit=useCallback(event=>{event.preventDefault();if(typedPassword===password){if(typeof window!==\"undefined\"){try{window.sessionStorage.setItem(SESSION_UNLOCK_KEY,\"true\");}catch{// Ignore storage write failures and still unlock current view.\n}}startTransition(()=>setErrorMessage(\"\"));startTransition(()=>setIsLocked(false));return;}startTransition(()=>setErrorMessage(incorrectPasswordMessage));},[incorrectPasswordMessage,password,typedPassword]);const overlayStyles=useMemo(()=>({position:\"fixed\",inset:0,zIndex:2147483647,display:\"flex\",alignItems:\"flex-start\",justifyContent:\"center\",padding:\"max(16px, env(safe-area-inset-top, 0px) + 12px) 16px 16px 16px\",background:backdropColor,backdropFilter:`blur(${blurAmount}px)`,WebkitBackdropFilter:`blur(${blurAmount}px)`,overflowY:\"auto\"}),[backdropColor,blurAmount]);if(!isLocked)return null;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsx(\"div\",{style:overlayStyles,role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":\"site-password-gate-title\",children:/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:{width:\"100%\",maxWidth:360,background:surfaceColor,color:textColor,borderRadius:cornerRadius,border:\"1px solid rgba(255,255,255,0.12)\",boxShadow:\"0 20px 50px rgba(0,0,0,0.45)\",padding:20,display:\"flex\",flexDirection:\"column\",gap:12},children:[/*#__PURE__*/_jsx(\"h2\",{id:\"site-password-gate-title\",style:{margin:0,fontSize:18,lineHeight:1.2,letterSpacing:\"-0.01em\"},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontSize:14,lineHeight:1.45,opacity:.92},children:message}),/*#__PURE__*/_jsx(\"label\",{htmlFor:\"site-password-gate-input\",style:{fontSize:12,opacity:.9},children:\"Password\"}),/*#__PURE__*/_jsx(\"input\",{ref:inputRef,id:\"site-password-gate-input\",type:\"password\",value:typedPassword,onChange:handlePasswordChange,autoComplete:\"current-password\",\"aria-describedby\":\"site-password-gate-feedback\",style:{width:\"100%\",borderRadius:Math.max(8,cornerRadius-6),border:\"1px solid rgba(255,255,255,0.18)\",background:\"rgba(255,255,255,0.06)\",color:textColor,padding:\"10px 12px\",outline:\"none\",fontSize:14,lineHeight:1.2,boxSizing:\"border-box\"}}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:{border:\"none\",borderRadius:Math.max(8,cornerRadius-6),background:accentColor,color:\"#1B130A\",fontSize:14,lineHeight:1,fontWeight:600,padding:\"11px 14px\",cursor:\"pointer\"},children:buttonLabel}),/*#__PURE__*/_jsx(\"span\",{id:\"site-password-gate-feedback\",\"aria-live\":\"polite\",style:{minHeight:16,fontSize:12,lineHeight:1.3,color:errorMessage?\"#FFB4A8\":\"transparent\"},children:errorMessage||\" \"})]})})});}SitePasswordGate.displayName=\"SitePasswordGate\";addPropertyControls(SitePasswordGate,{title:{type:ControlType.String,title:\"Title\",defaultValue:\"Private Preview\"},message:{type:ControlType.String,title:\"Message\",defaultValue:\"Welcome to Pepper by Previsor AI. Enter the access password to continue.\",displayTextArea:true},password:{type:ControlType.String,title:\"Password\",defaultValue:\"Upstat3h3alth26\",obscured:true},buttonLabel:{type:ControlType.String,title:\"Button\",defaultValue:\"Unlock\"},incorrectPasswordMessage:{type:ControlType.String,title:\"Error Text\",defaultValue:\"Incorrect password. Please try again.\"},surfaceColor:{type:ControlType.Color,title:\"Surface\",defaultValue:\"rgba(16, 14, 14, 0.92)\"},backdropColor:{type:ControlType.Color,title:\"Backdrop\",defaultValue:\"rgba(6, 6, 8, 0.58)\"},accentColor:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#C87A3A\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#F3EBDD\"},blurAmount:{type:ControlType.Number,title:\"Blur\",defaultValue:12,min:0,max:40,step:1,unit:\"px\"},cornerRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:16,min:0,max:40,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SitePasswordGate\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-pref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