{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/iZkqtMPHHadx2yt7LZrE/nGmpNzyeFb936dyG3yNf/IN.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import bcrypt from\"bcryptjs\";export function withPasswordProtection(Component){const hashedCorrectPassword=\"$2y$10$uk.ODN6zq79ZLB5TrRRhbuKYgHW7H/91HMf7qvDpxgMJaoFR2X.9C\"// Encrypt your desired password using this link https://bcrypt.online than replace its value above, do not remove the double quotes\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){bcrypt.compare(userPassword,hashedCorrectPassword,(err,match)=>{if(err){console.error(\"Error comparing passwords:\",err);return;}if(match){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();bcrypt.compare(password,hashedCorrectPassword,(err,match)=>{if(err){console.error(\"Error comparing passwords:\",err);return;}if(match){setShowContent(true);console.log(\"Password validation successful\");localStorage.setItem(\"userPassword\",password);}else{console.log(\"Incorrect password\");}});};const formStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",height:\"30vh\",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:\"#474747\",color:\"#fff\",fontSize:\"16px\",cursor:\"pointer\",boxShadow:\"true\",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\"};return /*#__PURE__*/_jsx(_Fragment,{children:showContent?/*#__PURE__*/_jsx(Component,{...props}):/*#__PURE__*/_jsx(\"form\",{onSubmit:handleSubmit,style:formStyle,children:/*#__PURE__*/_jsxs(\"div\",{style:wrapperStyle,children:[/*#__PURE__*/_jsx(\"input\",{type:\"password\",placeholder:\"Skriv passord\",style:inputStyle,value:password,onChange:handlePasswordChange}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:buttonStyle,children:\"Vis innhald\"})]})})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withPasswordProtection\":{\"type\":\"reactHoc\",\"name\":\"withPasswordProtection\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./IN.map"],
  "mappings": "8GAAyJ,SAASA,EAAuBC,EAAU,CAAC,IAAMC,EAAsB,+DAC/N,OAAO,SAAgCC,EAAM,CAAC,GAAK,CAACC,EAASC,CAAW,EAAEC,EAAS,EAAE,EAAO,CAACC,EAAYC,CAAc,EAAEF,EAAS,EAAK,EAAO,CAACG,EAASC,CAAW,EAAEJ,EAAS,EAAK,EAAE,OAAAK,EAAU,IAAI,CAAC,IAAMC,EAAa,aAAa,QAAQ,cAAc,EAAKA,GAAcC,EAAO,QAAQD,EAAaV,EAAsB,CAACY,EAAIC,IAAQ,CAAC,GAAGD,EAAI,CAAC,QAAQ,MAAM,6BAA6BA,CAAG,EAAE,MAAO,CAAIC,GAAOP,EAAe,EAAI,EAAE,QAAQ,IAAI,gCAAgC,GAAQ,QAAQ,IAAI,oBAAoB,CAAG,CAAC,EAAGE,EAAY,EAAI,CAAE,EAAE,CAAC,CAAC,EAA8rCM,EAAKC,EAAU,CAAC,SAASV,EAAyBS,EAAKf,EAAU,CAAC,GAAGE,CAAK,CAAC,EAAea,EAAK,OAAO,CAAC,SAA3sCE,GAAO,CAACA,EAAM,eAAe,EAAEL,EAAO,QAAQT,EAASF,EAAsB,CAACY,EAAIC,IAAQ,CAAC,GAAGD,EAAI,CAAC,QAAQ,MAAM,6BAA6BA,CAAG,EAAE,MAAO,CAAIC,GAAOP,EAAe,EAAI,EAAE,QAAQ,IAAI,gCAAgC,EAAE,aAAa,QAAQ,eAAeJ,CAAQ,GAAQ,QAAQ,IAAI,oBAAoB,CAAG,CAAC,CAAE,EAA+5B,MAA74B,CAAC,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,OAAO,OAAO,QAAQK,EAAS,EAAE,EAAE,WAAW,kBAAkB,MAAM,MAAM,EAAqxB,SAAsBU,EAAM,MAAM,CAAC,MAAzb,CAAC,UAAU,qNAAqN,aAAa,MAAM,EAAyN,SAAS,CAAcH,EAAK,QAAQ,CAAC,KAAK,WAAW,YAAY,gBAAgB,MAAz4B,CAAC,QAAQ,OAAO,aAAa,gBAAgB,OAAO,iBAAiB,YAAY,OAAO,SAAS,OAAO,MAAM,QAAQ,SAAS,OAAO,OAAO,OAAO,QAAQ,MAAM,EAAwvB,MAAMZ,EAAS,SAAr9Cc,GAAO,CAACb,EAAYa,EAAM,OAAO,KAAK,CAAE,CAA08C,CAAC,EAAeF,EAAK,SAAS,CAAC,KAAK,SAAS,MAA7zB,CAAC,QAAQ,YAAY,aAAa,gBAAgB,OAAO,OAAO,WAAW,UAAU,MAAM,OAAO,SAAS,OAAO,OAAO,UAAU,UAAU,OAAO,OAAO,MAAM,EAA8qB,SAAS,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAE",
  "names": ["withPasswordProtection", "Component", "hashedCorrectPassword", "props", "password", "setPassword", "ye", "showContent", "setShowContent", "showForm", "setShowForm", "ue", "userPassword", "bcrypt_default", "err", "match", "p", "l", "event", "u"]
}
