{"version":3,"file":"Password.CaZRGOVG.mjs","names":["useState","_Fragment","p"],"sources":["https:/framerusercontent.com/modules/EAxGbSyDhOleOMfXo5bn/iEbbWrD5hrC3SvrhamMj/Password.js"],"sourcesContent":["/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState}from\"react\";import{motion,AnimatePresence}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function PasswordGate(props){const{children,password=\"secret123\",// overlay / modal\noverlayType=\"color\",overlayColor=\"#ffffff\",overlayImage,modalBackground=\"#ffffff\",modalWidth=400,modalPadding=32,modalBorderRadius=16,// copy / styles\ntitleText=\"Enter Password\",titleColor=\"#000000\",inputBackground=\"#ffffff\",inputTextColor=\"#000000\",inputBorderColor=\"#dddddd\",inputBorderRadius=8,buttonBackground=\"#000000\",buttonTextColor=\"#ffffff\",buttonText=\"Continue\",buttonBorderRadius=8,errorTextColor=\"#ff0000\"}=props;const[inputValue,setInputValue]=useState(\"\");const[isUnlocked,setIsUnlocked]=useState(false);const[error,setError]=useState(\"\");/* ---------- helpers ---------- */const getOverlayStyle=()=>overlayType===\"image\"&&overlayImage?{backgroundImage:`url(${overlayImage})`,backgroundSize:\"cover\"}:{backgroundColor:overlayColor};const handleSubmit=()=>{if(inputValue===password){setIsUnlocked(true);}else{setError(\"Incorrect password, please try again.\");}};/* ---------- render ---------- */if(isUnlocked)return /*#__PURE__*/_jsx(_Fragment,{children:children});return /*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.35},style:{position:\"fixed\",inset:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:20,zIndex:9999,backdropFilter:\"blur(3px)\",pointerEvents:\"all\",...getOverlayStyle()},children:/*#__PURE__*/_jsxs(motion.div,{initial:{y:30,opacity:0},animate:{y:0,opacity:1},transition:{type:\"spring\",stiffness:260,damping:20},style:{width:\"100%\",maxWidth:modalWidth,backgroundColor:modalBackground,padding:modalPadding,borderRadius:modalBorderRadius,boxShadow:\"0 10px 30px rgba(0,0,0,0.15)\",textAlign:\"center\"},children:[/*#__PURE__*/_jsx(\"h2\",{style:{marginBottom:20,color:titleColor,fontSize:24,fontWeight:600},children:titleText}),/*#__PURE__*/_jsx(\"input\",{type:\"password\",value:inputValue,onChange:e=>{setInputValue(e.target.value);setError(\"\");},onKeyDown:e=>e.key===\"Enter\"&&handleSubmit(),placeholder:\"Password\",style:{width:\"100%\",padding:\"12px 16px\",marginBottom:16,fontSize:16,borderRadius:inputBorderRadius,border:`1px solid ${inputBorderColor}`,backgroundColor:inputBackground,color:inputTextColor,outline:\"none\",boxSizing:\"border-box\"},autoFocus:true}),error&&/*#__PURE__*/_jsx(\"p\",{style:{color:errorTextColor,margin:\"0 0 16px\",fontSize:14},children:error}),/*#__PURE__*/_jsx(motion.button,{whileHover:{scale:1.03},whileTap:{scale:.97},onClick:handleSubmit,style:{width:\"100%\",padding:\"12px 24px\",border:\"none\",borderRadius:buttonBorderRadius,backgroundColor:buttonBackground,color:buttonTextColor,fontSize:16,fontWeight:500,cursor:\"pointer\",boxShadow:\"0 2px 10px rgba(0,0,0,0.1)\"},children:buttonText})]})})});}/* ---------- default props & controls ---------- */PasswordGate.defaultProps={password:\"secret123\",overlayType:\"color\",overlayColor:\"#ffffff\",modalBackground:\"#ffffff\",modalWidth:400,modalPadding:32,modalBorderRadius:16,titleText:\"Enter Password\",titleColor:\"#000000\",inputBackground:\"#ffffff\",inputTextColor:\"#000000\",inputBorderColor:\"#dddddd\",inputBorderRadius:8,buttonBackground:\"#000000\",buttonTextColor:\"#ffffff\",buttonText:\"Continue\",buttonBorderRadius:8,errorTextColor:\"#ff0000\"};addPropertyControls(PasswordGate,{password:{type:ControlType.String,title:\"Password\",defaultValue:\"secret123\"},overlayType:{type:ControlType.Enum,title:\"Overlay\",options:[\"color\",\"image\"],optionTitles:[\"Color\",\"Image\"],defaultValue:\"color\"},overlayColor:{type:ControlType.Color,title:\"Overlay Color\",hidden:p=>p.overlayType!==\"color\"},overlayImage:{type:ControlType.Image,title:\"Overlay Image\",hidden:p=>p.overlayType!==\"image\"},modalBackground:{type:ControlType.Color,title:\"Modal BG\"},modalWidth:{type:ControlType.Number,title:\"Modal W\",min:200,max:800,unit:\"px\"},modalPadding:{type:ControlType.Number,title:\"Padding\",min:0,max:100,unit:\"px\"},modalBorderRadius:{type:ControlType.Number,title:\"Corners\",min:0,max:50,unit:\"px\"},titleText:{type:ControlType.String,title:\"Title\"},titleColor:{type:ControlType.Color,title:\"Title Color\"},inputBackground:{type:ControlType.Color,title:\"Input BG\"},inputTextColor:{type:ControlType.Color,title:\"Input Text\"},inputBorderColor:{type:ControlType.Color,title:\"Input Border\"},inputBorderRadius:{type:ControlType.Number,title:\"Input Corners\",min:0,max:20},buttonText:{type:ControlType.String,title:\"Button Label\"},buttonBackground:{type:ControlType.Color,title:\"Button BG\"},buttonTextColor:{type:ControlType.Color,title:\"Button Text\"},buttonBorderRadius:{type:ControlType.Number,title:\"Button Corners\",min:0,max:20},errorTextColor:{type:ControlType.Color,title:\"Error Color\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PasswordGate\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Password.map"],"mappings":"qXAGoN,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,WAAS,WAAS,YACxR,cAAY,QAAQ,eAAa,UAAU,eAAa,kBAAgB,UAAU,aAAW,IAAI,eAAa,GAAG,oBAAkB,GACnI,YAAU,iBAAiB,aAAW,UAAU,kBAAgB,UAAU,iBAAe,UAAU,mBAAiB,UAAU,oBAAkB,EAAE,mBAAiB,UAAU,kBAAgB,UAAU,aAAW,WAAW,qBAAmB,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