{"version":3,"file":"PagePassword.Ff4N65Cg.mjs","names":["useState","useCallback"],"sources":["https:/framerusercontent.com/modules/9ELPDxdI2F3rGRzGBHFt/4yBIfvrp9eo3ChJB9LO6/PagePassword.js"],"sourcesContent":["/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useCallback}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function PasswordProtectedScreen(props){// Skip rendering in Framer editor\nconst isFramerEditor=()=>{if(typeof window===\"undefined\")return false;// Check for Framer's editor environment\nif(window.FramerDesignTimeModeEnabled!==undefined)return true;if(window.Framer&&window.Framer.CurrentContext&&window.Framer.CurrentContext.isDesignTime)return true;if(window.document&&window.document.documentElement.hasAttribute(\"data-framer-preview-mode\"))return false;// Check URL patterns that indicate we're in editor\nconst url=window.location.href;return url.includes(\"framer.com\")&&(url.includes(\"/editor\")||url.includes(\"/projects\")||!url.includes(\"/preview\"));};// Don't render in editor mode\nif(isFramerEditor()){return null;}const{password,hint,overlayType=\"color\",overlayColor=\"#ffffff\",overlayImage,inputBackground=\"#ffffff\",inputTextColor=\"#000000\",inputBorderColor=\"#dddddd\",buttonBackground=\"#000000\",buttonTextColor=\"#ffffff\",errorTextColor=\"#ff0000\"}=props;const[inputValue,setInputValue]=useState(\"\");const[isAuthenticated,setIsAuthenticated]=useState(false);const[error,setError]=useState(\"\");const handlePasswordSubmit=useCallback(()=>{if(inputValue===password){setIsAuthenticated(true);}else{setError(\"Incorrect password. Please try again.\");setInputValue(\"\");}},[inputValue,password]);const handleKeyPress=useCallback(e=>{if(e.key===\"Enter\")handlePasswordSubmit();},[handlePasswordSubmit]);const getOverlayStyle=()=>{return overlayType===\"image\"&&overlayImage?{backgroundImage:`url(${overlayImage})`,backgroundSize:\"cover\"}:{backgroundColor:overlayColor};};// Completely hide everything after authentication\nif(isAuthenticated)return null;return /*#__PURE__*/_jsx(motion.div,{initial:{opacity:1},exit:{opacity:0},transition:{duration:.3},style:{position:\"fixed\",top:0,left:0,right:0,bottom:0,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",padding:\"20px\",zIndex:9999,...getOverlayStyle()},children:/*#__PURE__*/_jsxs(motion.div,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},transition:{delay:.1},style:{maxWidth:\"400px\",width:\"100%\",textAlign:\"center\",backgroundColor:overlayType===\"image\"?\"rgba(255,255,255,0.8)\":\"transparent\",padding:\"32px\",borderRadius:\"16px\"},children:[/*#__PURE__*/_jsx(\"h2\",{style:{marginBottom:\"8px\",color:overlayType===\"image\"?\"#000000\":\"inherit\"},children:\"Enter Password\"}),hint&&/*#__PURE__*/_jsxs(\"p\",{style:{opacity:.7,marginBottom:\"24px\",color:overlayType===\"image\"?\"#000000\":\"inherit\"},children:[\"Hint: \",hint]}),/*#__PURE__*/_jsx(\"input\",{type:\"password\",value:inputValue,onChange:e=>setInputValue(e.target.value),onKeyPress:handleKeyPress,style:{padding:\"12px 16px\",borderRadius:\"8px\",border:`1px solid ${inputBorderColor}`,fontSize:\"16px\",width:\"100%\",marginBottom:\"16px\",backgroundColor:inputBackground,color:inputTextColor},placeholder:\"Enter password\",autoFocus:true}),error&&/*#__PURE__*/_jsx(motion.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},style:{color:errorTextColor,margin:\"8px 0 16px\"},children:error}),/*#__PURE__*/_jsx(motion.button,{whileHover:{scale:1.03},whileTap:{scale:.98},onClick:handlePasswordSubmit,style:{padding:\"12px 24px\",borderRadius:\"8px\",border:\"none\",backgroundColor:buttonBackground,color:buttonTextColor,fontSize:\"16px\",cursor:\"pointer\",width:\"100%\",fontWeight:\"500\"},children:\"Continue\"})]})});}PasswordProtectedScreen.defaultProps={password:\"secret123\",hint:\"\",overlayType:\"color\",overlayColor:\"#ffffff\",inputBackground:\"#ffffff\",inputTextColor:\"#000000\",inputBorderColor:\"#dddddd\",buttonBackground:\"#000000\",buttonTextColor:\"#ffffff\",errorTextColor:\"#ff0000\"};addPropertyControls(PasswordProtectedScreen,{password:{type:ControlType.String,title:\"Password\",defaultValue:\"secret123\"},hint:{type:ControlType.String,title:\"Hint\",defaultValue:\"\"},overlayType:{type:ControlType.Enum,title:\"Overlay Type\",options:[\"color\",\"image\"],optionTitles:[\"Color\",\"Image\"],defaultValue:\"color\"},overlayColor:{type:ControlType.Color,title:\"Overlay Color\",defaultValue:\"#ffffff\",hidden:props=>props.overlayType!==\"color\"},overlayImage:{type:ControlType.Image,title:\"Overlay Image\",hidden:props=>props.overlayType!==\"image\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PasswordProtectedScreen\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PagePassword.map"],"mappings":"kPAG0L,SAAwB,EAAwB,EAAM,CAIhP,QAHyB,CAAC,GAAU,IAAS,OAAY,MAAO,GACF,GAA3D,EAAO,8BAA8B,IAAA,IAAyB,EAAO,QAAQ,EAAO,OAAO,gBAAgB,EAAO,OAAO,eAAe,aAAa,MAAO,GAAK,GAAG,EAAO,UAAU,EAAO,SAAS,gBAAgB,aAAa,2BAA2B,CAAC,MAAO,GACxQ,IAAM,EAAI,EAAO,SAAS,KAAK,OAAO,EAAI,SAAS,aAAa,GAAG,EAAI,SAAS,UAAU,EAAE,EAAI,SAAS,YAAY,EAAE,CAAC,EAAI,SAAS,WAAW,KAC7H,CAAE,OAAO,KAAM,GAAK,CAAC,WAAS,OAAK,cAAY,QAAQ,eAAa,UAAU,eAAa,kBAAgB,UAAU,iBAAe,UAAU,mBAAiB,UAAU,mBAAiB,UAAU,kBAAgB,UAAU,iBAAe,WAAW,EAAW,CAAC,EAAW,GAAeA,EAAS,GAAG,CAAM,CAAC,EAAgB,GAAoBA,EAAS,GAAM,CAAM,CAAC,EAAM,GAAUA,EA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