{"version":3,"file":"PasswordProtection.CFbjbOMk.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/cbsEuQQRlXYQyzCkbtqJ/SGF2rSrrnrLdYZvIddE4/PasswordProtection.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export function withPasswordProtection(Component){const correctPassword=\"adventure\"// Replace with your desired password\n;return function WithPasswordProtection(props){const[password,setPassword]=useState(\"\");const[showContent,setShowContent]=useState(false);const[showForm,setShowForm]=useState(false);useEffect(()=>{const userPassword=localStorage.getItem(\"userPassword\");if(userPassword===correctPassword){setShowContent(true);console.log(\"Password validation successful\");}else{console.log(\"Incorrect password\");}setShowForm(true);},[]);const handlePasswordChange=event=>{setPassword(event.target.value);};const handleSubmit=event=>{event.preventDefault();if(password===correctPassword){setShowContent(true);console.log(\"Password validation successful\");localStorage.setItem(\"userPassword\",password);}else{console.log(\"Incorrect password\");}};const formStyle={height:\"fit-content\",opacity:showForm?1:0,transition:\"opacity 1s ease\",width:\"100%\"};const inputStyle={padding:\"10px\",borderRadius:\"10px 0 0 10px\",border:\"1px solid #ccc\",borderRight:\"none\",fontSize:\"16px\",width:\"200px\",maxWidth:\"100%\",height:\"45px\",outline:\"none\"};const buttonStyle={padding:\"11px 20px\",borderRadius:\"0 10px 10px 0\",border:\"none\",background:\"#000\",color:\"#fff\",fontSize:\"16px\",cursor:\"pointer\",boxShadow:\"none\",height:\"45px\"};const wrapperStyle={boxShadow:\"rgba(0, 0, 0, 0.26) 0px 0.637473px 1.147451px -1.125px, rgba(0, 0, 0, 0.24) 0px 1.930942px 3.475695px -2.25px, rgba(0, 0, 0, 0.192) 0px 5.104227px 9.187608px -3.375px, rgba(0, 0, 0, 0.03) 0px 16px 28.8px -4.5px\",borderRadius:\"10px\",width:\"fit-content\"};const textStyle={display:\"block\",justifyContent:\"center\",alignItems:\"center\",height:\"fit-content\",opacity:showForm?1:0,transition:\"opacity 1s ease\",width:\"100%\",paddingBottom:\"20px\"};const paragraphStyle={fontWeight:\"bold\",fontSize:\"initial\",color:\"#595959\"};return /*#__PURE__*/_jsx(_Fragment,{children:showContent?/*#__PURE__*/_jsx(Component,{...props}):/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,style:formStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:textStyle,children:/*#__PURE__*/_jsx(\"p\",{style:paragraphStyle,children:\"Enter the password provided by S3 to access your Adventure KBYG:\"})}),/*#__PURE__*/_jsxs(\"div\",{style:wrapperStyle,children:[/*#__PURE__*/_jsx(\"input\",{type:\"password\",placeholder:\"Enter password\",style:inputStyle,value:password,onChange:handlePasswordChange}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:buttonStyle,children:\"Submit\"})]})]})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withPasswordProtection\":{\"type\":\"reactHoc\",\"name\":\"withPasswordProtection\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PasswordProtection.map"],"mappings":"uIAAqH,SAAgB,EAAuB,EAAU,CAAC,IAAM,EAAgB,YAC5L,OAAO,SAAgC,EAAM,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAS,GAAG,CAAM,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAM,CAA6gD,OAA5gD,MAAc,CAAoB,aAAa,QAAQ,eAAe,GAAmB,GAAiB,EAAe,GAAK,CAAC,QAAQ,IAAI,iCAAiC,EAAO,QAAQ,IAAI,qBAAqB,CAAE,EAAY,GAAK,EAAG,EAAE,CAAC,CAAmzC,EAAKC,EAAU,CAAC,SAAS,EAAyB,EAAK,EAAU,CAAC,GAAG,EAAM,CAAC,CAAc,EAAM,OAAO,CAAC,SAAl0C,GAAO,CAAC,EAAM,gBAAgB,CAAI,IAAW,GAAiB,EAAe,GAAK,CAAC,QAAQ,I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