(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9344],{8836:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var s=(0,n(30853).Z)("briefcase","IconBriefcase",[["path",{d:"M3 7m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v9a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M8 7v-2a2 2 0 0 1 2 -2h4a2 2 0 0 1 2 2v2",key:"svg-1"}],["path",{d:"M12 12l0 .01",key:"svg-2"}],["path",{d:"M3 13a20 20 0 0 0 18 0",key:"svg-3"}]])},62629:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var s=(0,n(30853).Z)("home-2","IconHome2",[["path",{d:"M5 12l-2 0l9 -9l9 9l-2 0",key:"svg-0"}],["path",{d:"M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7",key:"svg-1"}],["path",{d:"M10 12h4v4h-4z",key:"svg-2"}]])},17010:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var s=(0,n(30853).Z)("info-circle","IconInfoCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 9h.01",key:"svg-1"}],["path",{d:"M11 12h1v4h1",key:"svg-2"}]])},65450:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var s=(0,n(30853).Z)("location","IconLocation",[["path",{d:"M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5",key:"svg-0"}]])},22582:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var s=(0,n(30853).Z)("password","IconPassword",[["path",{d:"M12 10v4",key:"svg-0"}],["path",{d:"M10 13l4 -2",key:"svg-1"}],["path",{d:"M10 11l4 2",key:"svg-2"}],["path",{d:"M5 10v4",key:"svg-3"}],["path",{d:"M3 13l4 -2",key:"svg-4"}],["path",{d:"M3 11l4 2",key:"svg-5"}],["path",{d:"M19 10v4",key:"svg-6"}],["path",{d:"M17 13l4 -2",key:"svg-7"}],["path",{d:"M17 11l4 2",key:"svg-8"}]])},54827:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var s=(0,n(30853).Z)("phone","IconPhone",[["path",{d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5l1.5 -2.5l5 2v4a2 2 0 0 1 -2 2a16 16 0 0 1 -15 -15a2 2 0 0 1 2 -2",key:"svg-0"}]])},19962:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var s=(0,n(30853).Z)("plant-2","IconPlant2",[["path",{d:"M2 9a10 10 0 1 0 20 0",key:"svg-0"}],["path",{d:"M12 19a10 10 0 0 1 10 -10",key:"svg-1"}],["path",{d:"M2 9a10 10 0 0 1 10 10",key:"svg-2"}],["path",{d:"M12 4a9.7 9.7 0 0 1 2.99 7.5",key:"svg-3"}],["path",{d:"M9.01 11.5a9.7 9.7 0 0 1 2.99 -7.5",key:"svg-4"}]])},75381:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var s=(0,n(30853).Z)("registered","IconRegistered",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M10 15v-6h2a2 2 0 1 1 0 4h-2",key:"svg-1"}],["path",{d:"M14 15l-2 -2",key:"svg-2"}]])},13499:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var s=(0,n(30853).Z)("user-circle","IconUserCircle",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M12 10m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855",key:"svg-2"}]])},40163:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/auth/login",function(){return n(55666)}])},10631:function(e,t,n){"use strict";var s=n(85893),r=n(58278);n(67294),t.Z=e=>{let{children:t}=e;return(0,s.jsx)(r.x,{h:"1000px",style:{background:"url(/assets/images/auth-bg.jpg) 100% 100%, linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5))",backgroundPosition:"center",backgroundSize:"cover",backgroundBlendMode:"multiply",backgroundRepeat:"no-repeat",backgroundAttachment:"fixed"},children:t})}},6356:function(e,t,n){"use strict";n.d(t,{Fq:function(){return displayBulkCreateErrors},KI:function(){return loadMediaURL},Pk:function(){return getCoordinates},gh:function(){return getTheme},hP:function(){return displayErrors},kP:function(){return limitChars},rl:function(){return requestGeolocationPermission}});var s=n(79720),r=n(23676);function displayErrors(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;for(let r in t)if(t.hasOwnProperty(r)){let o=n?"".concat(n,".").concat(r):r,i=t[r];(0,s.isArray)(i)?e.setFieldError(o,null==i?void 0:i.join(", ")):(0,s.isObject)(i)&&displayErrors(e,i,o)}}function displayBulkCreateErrors(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;for(let r=0;r<t.length;r++){let o=t[r];for(let t in o){let i="".concat(n,".").concat(r,".").concat(t),a=o[t];(0,s.isArray)(a)?e.setFieldError(i,null==a?void 0:a.join(", ")):(0,s.isObject)(a)&&displayErrors(e,a,i)}}}let getTheme=e=>"dark"===e,limitChars=(e,t,n)=>e?e.length<=t?e:e.substring(0,t)+(n?"...":""):"",requestGeolocationPermission=()=>new Promise((e,t)=>{navigator.permissions?navigator.permissions.query({name:"geolocation"}).then(n=>{"granted"===n.state?e("granted"):"prompt"===n.state?navigator.geolocation.getCurrentPosition(()=>{e("prompt")},e=>{t(e.message)}):t("Geolocation permission denied.")}).catch(e=>{t(e.message)}):t("Permissions API is not supported by this browser.")}),getCoordinates=()=>new Promise((e,t)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(t=>{let{latitude:n,longitude:s}=t.coords;e({latitude:n,longitude:s})},e=>{t(e.message)}):t("Geolocation is not supported by this browser.")}),loadMediaURL=e=>e?e.startsWith("http")?e:"".concat(r.nz).concat(e):""},55666:function(e,t,n){"use strict";n.r(t);var s=n(85893),r=n(67294),o=n(9008),i=n.n(o),a=n(41674),l=n(90991),c=n(58278),d=n(43078),u=n(34124),p=n(8207),h=n(28008),g=n(54410),v=n(86414),m=n(21802),f=n(356),y=n(24920),x=n(76556),C=n(60967),b=n(81441),w=n(24998),k=n(11163),M=n(41664),j=n.n(M),Z=n(78964),_=n(97432),I=n(23676),P=n(72879),z=n(6356),E=n(8861),L=n(22582),N=n(11417),S=n(11522),A=n(10631);let Login=()=>{let[e,t]=(0,r.useState)(!1),{login:n,login_status:o}=(0,_.bp)(),M=(0,Z.a)("(max-width: 992px)"),{colorScheme:S}=(0,a.X)(),D=(0,k.useRouter)(),T=(0,b.c)({initialValues:{username:"",password:""},validate:{username:e=>""===e||null==e?"Enter username":null,password:e=>""===e||null==e?"Enter password":null}}),handleLogin=()=>{t(!0),(0,P.U)({url:I.Pn.LOGIN,method:"POST",data:T.values,useNext:!1,params:{fields:"id,email,full_name,first_name,last_name,username,profile,phone_number,avatar"}}).then(e=>{var t,s;n(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.user,null==e?void 0:null===(s=e.data)||void 0===s?void 0:s.token),D.push("/account")}).catch(e=>{(0,w.c0)({title:"Account Login",message:"Login failed, please try again with correct credentials",color:"red"});let t=null==e?void 0:e.data;"object"==typeof t&&(0,z.hP)(T,t)}).finally(()=>{t(!1)})};return(0,r.useEffect)(()=>{o&&D.push("/")},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:"Account Login ".concat(I.UD," ").concat(I.iC)}),(0,s.jsx)("meta",{name:"description",content:"Log in to your account to get started."})]}),(0,s.jsx)(A.Z,{children:(0,s.jsx)(l.M,{className:"h-100",children:(0,s.jsx)(c.x,{className:"w-100",py:"md",size:"lg",children:(0,s.jsx)(d.W,{size:"sm",children:(0,s.jsx)(u.X,{className:"h-100",style:{overflow:"hidden"},radius:"lg",p:M?20:40,children:(0,s.jsx)("form",{onSubmit:T.onSubmit(()=>{handleLogin()}),children:(0,s.jsxs)(p.K,{gap:16,children:[(0,s.jsx)(h.D,{ta:"center",order:2,children:"Login"}),(0,s.jsx)(g.x,{ta:"center",size:"sm",children:"Login to your account"}),(0,s.jsx)(v.o,{autoFocus:!0,radius:"md",label:"Username",placeholder:"Enter username",leftSection:(0,s.jsx)(E.Z,{size:16}),...T.getInputProps("username")}),(0,s.jsx)(m.W,{size:"sm",radius:"md",label:"Password",placeholder:"Enter password",leftSection:(0,s.jsx)(L.Z,{size:16}),...T.getInputProps("password")}),(0,s.jsxs)(f.Z,{justify:"space-between",style:{textAlign:"center"},children:[(0,s.jsx)(y.z,{rightSection:e?(0,s.jsx)(x.a,{color:"white",size:16}):(0,s.jsx)(N.Z,{size:16}),type:"submit",children:"Submit"}),(0,s.jsx)(C.e,{component:j(),href:"/auth/password/reset",style:{fontWeight:400},size:"sm",children:"Forgot password? Reset"})]}),(0,s.jsx)(l.M,{children:(0,s.jsx)(C.e,{component:j(),href:"/register",size:"sm",style:{fontWeight:400},children:"Don't have an account? Create a Free Farmer Account"})})]})})})})})})})]})};Login.PageLayout=S.Z,t.default=Login},60967:function(e,t,n){"use strict";n.d(t,{e:function(){return d}});var s=n(85893),r=n(90512);n(67294);var o=n(90987),i=n(43362),a=n(54410),l={root:"m_849cf0da"};let c={underline:"hover"},d=(0,i.b)((e,t)=>{let{underline:n,className:i,unstyled:d,mod:u,...p}=(0,o.w)("Anchor",c,e);return(0,s.jsx)(a.x,{component:"a",ref:t,className:(0,r.Z)({[l.root]:!d},i),...p,mod:[{underline:n},u],__staticSelector:"Anchor",unstyled:d})});d.classes=l,d.displayName="@mantine/core/Anchor"},90991:function(e,t,n){"use strict";n.d(t,{M:function(){return d}});var s=n(85893);n(67294);var r=n(90987),o=n(46976),i=n(58278),a=n(43362),l={root:"m_4451eb3a"};let c={},d=(0,a.b)((e,t)=>{let n=(0,r.w)("Center",c,e),{classNames:a,className:d,style:u,styles:p,unstyled:h,vars:g,inline:v,mod:m,...f}=n,y=(0,o.y)({name:"Center",props:n,classes:l,className:d,style:u,classNames:a,styles:p,unstyled:h,vars:g});return(0,s.jsx)(i.x,{ref:t,mod:[{inline:v},m],...y("root"),...f})});d.classes=l,d.displayName="@mantine/core/Center"},10576:function(e,t,n){"use strict";n.d(t,{i:function(){return g}});var s=n(85893);n(67294);var r=n(69429),o=n(13637),i=n(2979),a=n(90987),l=n(46976),c=n(58278),d=n(9535),u={root:"m_3eebeb36",label:"m_9e365f20"};let p={orientation:"horizontal"},h=(0,o.Z)((e,{color:t,variant:n,size:s})=>({root:{"--divider-color":t?(0,i.p)(t,e):void 0,"--divider-border-style":n,"--divider-size":(0,r.ap)(s,"divider-size")}})),g=(0,d.d)((e,t)=>{let n=(0,a.w)("Divider",p,e),{classNames:r,className:o,style:i,styles:d,unstyled:g,vars:v,color:m,orientation:f,label:y,labelPosition:x,mod:C,...b}=n,w=(0,l.y)({name:"Divider",classes:u,props:n,className:o,style:i,classNames:r,styles:d,unstyled:g,vars:v,varsResolver:h});return(0,s.jsx)(c.x,{ref:t,mod:[{orientation:f,"with-label":!!y},C],...w("root"),...b,role:"separator",children:y&&(0,s.jsx)(c.x,{component:"span",mod:{position:x},...w("label"),children:y})})});g.classes=u,g.displayName="@mantine/core/Divider"},80929:function(e,t,n){"use strict";n.d(t,{E:function(){return g}});var s=n(85893),r=n(67294),o=n(69429),i=n(13637),a=n(90987),l=n(46976),c=n(58278),d=n(43362),u={root:"m_9e117634"};let p={},h=(0,i.Z)((e,{radius:t,fit:n})=>({root:{"--image-radius":void 0===t?void 0:(0,o.H5)(t),"--image-object-fit":n}})),g=(0,d.b)((e,t)=>{let n=(0,a.w)("Image",p,e),{classNames:o,className:i,style:d,styles:g,unstyled:v,vars:m,onError:f,src:y,radius:x,fit:C,fallbackSrc:b,mod:w,...k}=n,[M,j]=(0,r.useState)(!y);(0,r.useEffect)(()=>j(!y),[y]);let Z=(0,l.y)({name:"Image",classes:u,props:n,className:i,style:d,classNames:o,styles:g,unstyled:v,vars:m,varsResolver:h});return M&&b?(0,s.jsx)(c.x,{component:"img",ref:t,src:b,...Z("root"),onError:f,mod:["fallback",w],...k}):(0,s.jsx)(c.x,{component:"img",ref:t,...Z("root"),src:y,onError:e=>{f?.(e),j(!0)},mod:w,...k})});g.classes=u,g.displayName="@mantine/core/Image"},21802:function(e,t,n){"use strict";n.d(t,{W:function(){return C}});var s=n(85893),r=n(90512),o=n(82191),i=n(28590);n(67294);var a=n(69429),l=n(13637),c=n(19784),d=n(46976),u=n(90987),p=n(95494),h=n(9535),g=n(91992),v=n(42195),m=n(12440),f={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};let y={visibilityToggleIcon:({reveal:e})=>(0,s.jsx)("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:(0,s.jsx)("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})},x=(0,l.Z)((e,{size:t})=>({root:{"--psi-icon-size":(0,a.ap)(t,"psi-icon-size"),"--psi-button-size":(0,a.ap)(t,"psi-button-size")}})),C=(0,h.d)((e,t)=>{let n=(0,u.w)("PasswordInput",y,e),{classNames:a,className:l,style:h,styles:m,unstyled:C,vars:b,required:w,error:k,leftSection:M,disabled:j,id:Z,variant:_,inputContainer:I,description:P,label:z,size:E,errorProps:L,descriptionProps:N,labelProps:S,withAsterisk:A,inputWrapperOrder:D,wrapperProps:T,radius:F,rightSection:R,rightSectionWidth:O,rightSectionPointerEvents:W,leftSectionWidth:U,visible:V,defaultVisible:B,onVisibilityChange:G,visibilityToggleIcon:q,visibilityToggleButtonProps:K,rightSectionProps:X,leftSectionProps:H,leftSectionPointerEvents:J,withErrorStyles:Q,mod:Y,...$}=n,ee=(0,o.M)(Z),[et,en]=(0,i.C)({value:V,defaultValue:B,finalValue:!1,onChange:G}),toggleVisibility=()=>en(!et),es=(0,d.y)({name:"PasswordInput",classes:f,props:n,className:l,style:h,classNames:a,styles:m,unstyled:C,vars:b,varsResolver:x}),{resolvedClassNames:er,resolvedStyles:eo}=(0,c.h)({classNames:a,styles:m,props:n}),{styleProps:ei,rest:ea}=(0,p.c)($),el=(0,s.jsx)(g.A,{...es("visibilityToggle"),disabled:j,radius:F,"aria-hidden":!K,tabIndex:-1,...K,variant:"subtle",color:"gray",unstyled:C,onMouseDown:e=>{e.preventDefault(),K?.onMouseDown?.(e),toggleVisibility()},onKeyDown:e=>{K?.onKeyDown?.(e)," "===e.key&&(e.preventDefault(),toggleVisibility())},children:(0,s.jsx)(q,{reveal:et})});return(0,s.jsx)(v.I.Wrapper,{required:w,id:ee,label:z,error:k,description:P,size:E,classNames:er,styles:eo,__staticSelector:"PasswordInput",errorProps:L,descriptionProps:N,unstyled:C,withAsterisk:A,inputWrapperOrder:D,inputContainer:I,variant:_,labelProps:{...S,htmlFor:ee},mod:Y,...es("root"),...ei,...T,children:(0,s.jsx)(v.I,{component:"div",error:k,leftSection:M,size:E,classNames:{...er,input:(0,r.Z)(f.input,er.input)},styles:eo,radius:F,disabled:j,__staticSelector:"PasswordInput",rightSectionWidth:O,rightSection:R??el,variant:_,unstyled:C,leftSectionWidth:U,rightSectionPointerEvents:W||"all",rightSectionProps:X,leftSectionProps:H,leftSectionPointerEvents:J,withAria:!1,withErrorStyles:Q,children:(0,s.jsx)("input",{required:w,"data-invalid":!!k||void 0,"data-with-left-section":!!M||void 0,...es("innerInput"),disabled:j,id:ee,ref:t,...ea,autoComplete:ea.autoComplete||"off",type:et?"text":"password"})})})});C.classes={...m.M.classes,...f},C.displayName="@mantine/core/PasswordInput"},86414:function(e,t,n){"use strict";n.d(t,{o:function(){return l}});var s=n(85893);n(67294);var r=n(90987),o=n(9535),i=n(12440);let a={},l=(0,o.d)((e,t)=>{let n=(0,r.w)("TextInput",a,e);return(0,s.jsx)(i.M,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});l.classes=i.M.classes,l.displayName="@mantine/core/TextInput"}},function(e){e.O(0,[6342,8744,1441,9720,7969,1522,9774,2888,179],function(){return e(e.s=40163)}),_N_E=e.O()}]);