"use strict";var y=Object.create;var i=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var k=Object.getPrototypeOf;var v=Object.prototype.hasOwnProperty;var m=(s,t)=>i(s,"name",{value:t,configurable:true});var I=(s,t)=>{for(var o in t)i(s,o,{get:t[o],enumerable:true})};var h=(s,t,o,r)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let e of g(t))if(!v.call(s,e)&&e!==o)i(s,e,{get:()=>t[e],enumerable:!(r=u(t,e))||r.enumerable})}return s};var P=(s,t,o)=>(o=s!=null?y(k(s)):{},h(t||!s||!s.__esModule?i(o,"default",{value:s,enumerable:true}):o,s));var R=s=>h(i({},"__esModule",{value:true}),s);var d=(s,t,o,r)=>{var e=r>1?void 0:r?u(t,o):t;for(var l=s.length-1,c;l>=0;l--)if(c=s[l])e=(r?c(t,o,e):c(e))||e;if(r&&e)i(t,o,e);return e};var w={};I(w,{default:()=>T});module.exports=R(w);var n=require("react/jsx-runtime");var p=require("mobx-react");var f=require("react");var b=P(require("../../components/auth/Locked"));var S=require("../../helpers/password-helpers");let a=class extends f.Component{constructor(t){super(t);this.state={error:false};this.onSubmit=this.onSubmit.bind(this);this.unlock=this.unlock.bind(this)}onSubmit(t){const{password:o}=t;let r=this.props.stores.settings.all.app.lockedPassword;if(!r){r=""}if((0,S.hash)(String(o))===String(r)){this.props.actions.settings.update({type:"app",data:{locked:false}})}else{this.setState({error:true})}}unlock(){this.props.actions.settings.update({type:"app",data:{locked:false}})}render(){const{stores:t}=this.props;const{useTouchIdToUnlock:o}=this.props.stores.settings.all.app;return(0,n.jsx)("div",{className:"auth",children:(0,n.jsx)("div",{className:"auth__layout",children:(0,n.jsx)(b.default,{onSubmit:this.onSubmit,unlock:this.unlock,useTouchIdToUnlock:o,isSubmitting:t.user.loginRequest.isExecuting,error:this.state.error})})})}};m(a,"LockedScreen");a=d([(0,p.inject)("stores","actions"),p.observer],a);var T=a;
