1"use strict";(self.webpackChunkdrh_web=self.webpackChunkdrh_web||[]).push([[9809],{49809(e,r,s){s.r(r),s.d(r,{default:()=>w});var a=s(73216),n=s(35475),o=s(50379),t=s(43592),i=s(3453),l=s(65043);var d=s(70579);const c={[t.FO.INVALID_CREDENTIALS]:(0,o.PH)("We were unable to log you in. If your account has been approved and you've clicked the link in the email to activate it, please ensure you've typed your email and password correctly.")};function u(e){return(0,d.jsx)("p",{className:"rounded bg-red-50 px-4 py-4 text-red-600",children:(0,d.jsx)(o.qi,{children:c[e.code]})})}var m=s(89379),f=s(49974),p=s(24858),b=s(18403),h=s(80899),v=s(23111),x=s(71895);function g(e){const r=e.onSubmit,s=e.className,a=(0,o.zA)().gettext,t=h.Ik({username:h.Yj().required(a("No username or email provided")),password:h.Yj().required(a("No password provided"))}),i=(0,p.mN)({mode:"onSubmit",reValidateMode:"onChange",defaultValues:{username:"",password:""},resolver:(0,b.t)(t)}),l=i.register,c=i.handleSubmit,u=i.formState,g=u.isSubmitting,w=u.errors;return(0,d.jsxs)("form",{className:s,onSubmit:c(r),children:[(0,d.jsx)("h1",{className:"mb-6 font-serif text-5xl font-semibold",children:a("Log In")}),(0,d.jsxs)("fieldset",{className:"flex flex-col gap-y-4",disabled:g,children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"mb-1 inline-block text-gray-drh",htmlFor:"username",children:a("Username / Email")}),(0,d.jsx)(x.pd,(0,m.A)({className:"w-full",isInvalid:!(null===w||void 0===w||!w.username),id:"username",autoCorrect:"off",autoComplete:"username"},l("username"))),(0,d.jsx)(f.K,{errors:w,name:"username",as:(0,d.jsx)("p",{className:"mt-1 text-xs text-red-600"})})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{className:"mb-1 inline-block text-gray-drh",htmlFor:"password",children:a("Password")}),(0,d.jsx)(x.pd,(0,m.A)({autoComplete:"current-password",className:"w-full",isInvalid:!(null===w||void 0===w||!w.password),id:"password",type:"password"},l("password"))),(0,d.jsx)(f.K,{errors:w,name:"password",as:(0,d.jsx)("p",{className:"mt-1 text-xs text-red-600"})})]}),(0,d.jsx)("p",{className:"mb-2",children:(0,d.jsx)(n.k2,{to:"/forgot-password",className:"link text-sm",children:a("Forgot your password?")})}),(0,d.jsx)(v.b7,{className:"mr-auto w-full sm:w-auto",disabled:g,children:a(g?"Logging In\u2026":"Log In")})]})]})}function w(){const e=(0,t.iZ)(),r=function(){const e=(0,l.useState)(),r=(0,i.A)(e,2),s=r[0],a=r[1],n=(0,o.zA)().setLocale,d=(0,l.useCallback)(async e=>{await n((0,t.BH)(e))},[n]),c=(0,l.useCallback)(a,[a]),u=(0,t.R4)(d,c);return{logIn:(0,l.useCallback)(async e=>{a(void 0),await u(e)},[u,a]),failure:s}}(),s=r.logIn,c=r.failure;return(0,t.wR)(e)?(0,d.jsx)(a.C5,{to:"/",replace:!0}):(0,d.jsxs)("div",{className:"w-full px-4 py-8 sm:m-auto sm:w-[28rem] sm:px-8",children:[c&&(0,d.jsx)(u,{code:c}),(0,d.jsx)(g,{className:"mb-8",onSubmit:s}),(0,d.jsx)(o.qi,{components:{link:(0,d.jsx)(n.k2,{to:"/get-involved",className:"link"})},children:"Don't have an account? Learn how to [link]get involved[/link]."})]})}},71895(e,r,s){s.d(r,{fs:()=>f,l6:()=>p,pd:()=>m});var a=s(89379),n=s(80045),o=s(65043),t=s(98139),i=s.n(t),l=s(70579);const d=["className","inputSize","isInvalid"],c=["className","isInvalid"],u=["className","isInvalid","selectSize","children"],m=o.forwardRef((e,r)=>{const s=e.className,o=e.inputSize,t=void 0===o?"regular":o,c=e.isInvalid,u=(0,n.A)(e,d);return(0,l.jsx)("input",(0,a.A)({ref:r,className:i()("rounded border border-black/25 leading-5 transition focus:border-primary focus:shadow-[0_0_1px_4px] focus:shadow-primary/10 focus-visible:outline-none",{"px-4 py-3":"regular"===t,"px-2 py-1":"small"===t,"!z-10 border-red-600 focus:border-red-600 focus:shadow-red-600/10":c},s)},u))}),f=o.forwardRef((e,r)=>{const s=e.className,o=e.isInvalid,t=(0,n.A)(e,c);return(0,l.jsx)("textarea",(0,a.A)({ref:r,className:i()("rounded border border-black/25 px-4 py-3 leading-5 transition focus:border-primary focus:shadow-[0_0_1px_4px] focus:shadow-primary/10 focus-visible:outline-none",{"border-red-600 focus:border-red-600 focus:shadow-red-600/10":o},s)},t))}),p=o.forwardRef((e,r)=>{const s=e.className,o=e.isInvalid,t=e.selectSize,d=void 0===t?"regular":t,c=e.children,m=(0,n.A)(e,u);return(0,l.jsx)("select",(0,a.A)((0,a.A)({ref:r,className:i()("appearance-none rounded border border-black/25 bg-no-repeat leading-5 transition focus:border-primary focus:shadow-[0_0_1px_4px] focus:shadow-primary/10 focus:outline-none enabled:bg-small-arrow-down","disabled:border-black/25 disabled:bg-black/5 disabled:opacity-100",{"bg-[right_1rem_center] py-3 pl-4 pr-8":"regular"===d,"bg-[right_0.5rem_center] py-1 pl-2 pr-6":"small"===d,"border-red-600 focus:border-red-600 focus:shadow-red-600/10":o},s)},m),{},{children:c}))})},49974(e,r,s){s.d(r,{K:()=>o});var a=s(65043),n=s(24858),o=function(e){var r=e.as,s=e.errors,o=e.name,t=e.message,i=e.render,l=function(e,r){if(null==e)return{};var s,a,n={},o=Object.keys(e);for(a=0;a<o.length;a++)r.indexOf(s=o[a])>=0||(n[s]=e[s]);return n}(e,["as","errors","name","message","render"]),d=(0,n.xW)(),c=(0,n.Jt)(s||d.formState.errors,o);if(!c)return null;var u=c.message,m=c.types,f=Object.assign({},l,{children:u||t});return a.isValidElement(r)?a.cloneElement(r,f):i?i({message:u||t,messages:m}):a.createElement(r||a.Fragment,f)}},18403(e,r,s){s.d(r,{t:()=>i});var a=s(24858),n=function(e,r,s){if(e&&"reportValidity"in e){var n=(0,a.Jt)(s,r);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},o=function(e,r){var s=function(s){var a=r.fields[s];a&&a.ref&&"reportValidity"in a.ref?n(a.ref,s,e):a.refs&&a.refs.forEac
1h(function(r){return n(r,s,e)})};for(var a in r.fields)s(a)},t=function(e,r){r.shouldUseNativeValidation&&o(e,r);var s={};for(var n in e){var t=(0,a.Jt)(r.fields,n);(0,a.hZ)(s,n,Object.assign(e[n],{ref:t&&t.ref}))}return s},i=function(e,r,s){return void 0===r&&(r={}),void 0===s&&(s={}),function(i,l,d){try{return Promise.resolve(function(a,t){try{var c=(r.context,Promise.resolve(e["sync"===s.mode?"validateSync":"validate"](i,Object.assign({abortEarly:!1},r,{context:l}))).then(function(e){return d.shouldUseNativeValidation&&o({},d),{values:s.rawValues?i:e,errors:{}}}))}catch(n){return t(n)}return c&&c.then?c.then(void 0,t):c}(0,function(e){if(!e.inner)throw e;return{values:{},errors:t((r=e,s=!d.shouldUseNativeValidation&&"all"===d.criteriaMode,(r.inner||[]).reduce(function(e,r){if(e[r.path]||(e[r.path]={message:r.message,type:r.type}),s){var n=e[r.path].types,o=n&&n[r.type];e[r.path]=(0,a.Gb)(r.path,s,e,r.type,o?[].concat(o,r.message):r.message)}return e},{})),d)};var r,s}))}catch(n){return Promise.reject(n)}}}}}]); 2//# sourceMappingURL=9809.f0dffdd2.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.