1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[755],{9698:function(e,t,a){"use strict";var s,r=a(7294);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e}).apply(this,arguments)}t.Z=function(e){return r.createElement("svg",n({width:"1em",height:"1em",viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=r.createElement("path",{d:"M1 0h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1Zm17 4.238-7.928 7.1L2 4.216V16h16V4.238ZM2.511 2l7.55 6.662L17.502 2H2.512Z",fill:"#000"})))}},7375:function(e,t,a){"use strict";var s,r=a(7294);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e}).apply(this,arguments)}t.Z=function(e){return r.createElement("svg",n({width:"1em",height:"1em",viewBox:"0 0 16 12",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=r.createElement("path",{d:"M5.33 9.23 1.853 5.753.671 6.93l4.658 4.659 10-10L14.154.413 5.33 9.229Z",fill:"inherit"})))}},4865:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile/info",function(){return a(6480)}])},6884:function(e,t,a){"use strict";var s=a(5893),r=a(5187);t.Z=e=>{let{errorMsg:t}=e;return(0,s.jsx)("div",{className:"grow flex items-center justify-center",children:t||(0,s.jsx)(r.Z,{height:90,width:90})})}},8707:function(e,t,a){"use strict";a.d(t,{Z:function(){return c}});var s=a(5893),r=a(1664),n=a.n(r);let i=[{text:"Profile Info",href:"/profile/info"},{text:"Users",href:"/profile/users"},{text:"Store Settings",href:"/profile/store-settings"},{text:"Metrics Definitions",href:"/profile/metrics-definitions"},{text:"Billing",href:"/profile/billing"}],l=e=>{let{children:t,href:a,isActive:r}=e;return(0,s.jsx)("li",{className:"".concat(r&&"border-b-2 pb-0.5 border-myPaleBlue border-0.5 md:font-bold"),children:(0,s.jsx)(n(),{href:a,legacyBehavior:!0,children:t})})};var o=e=>{let{activeLink:t}=e;return(0,s.jsx)("div",{className:"md:px-6 py-4 md:pt-10 border-b md:border-r border-black ",style:{minWidth:200},children:(0,s.jsx)("ul",{className:"flex mx-auto items-center max-w-[640px] px-4 md:px-0 md:items-start md:flex-col gap-10 whitespace-nowrap md:whitespace-normal overflow-auto",children:i.map(e=>(0,s.jsx)(l,{href:e.href,isActive:t===e.text,children:e.text},e.href))})})},c=e=>{let{children:t,activeNavLink:a}=e;return(0,s.jsxs)("div",{className:"flex flex-col md:flex-row grow",children:[(0,s.jsx)(o,{activeLink:a}),(0,s.jsx)("div",{className:"px-6 container pt-11 md:pt-14 md:px-20 pb-20",children:t})]})}},8133:function(e,t,a){"use strict";var s=a(7294),r=a(4965);t.Z=e=>{let t=(0,s.useContext)(r.z);(0,s.useEffect)(()=>(t&&t.updatePage(e),()=>null==t?void 0:t.updatePage("")),[t,e])}},6480:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return S}});var s,r=a(5893),n=a(4761),i=a(7294);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e}).apply(this,arguments)}var o=function(e){return i.createElement("svg",l({width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),s||(s=i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 0C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0ZM5.07 16.28c.43-.9 3.05-1.78 4.93-1.78s4.51.88 4.93 1.78A7.893 7.893 0 0 1 10 18c-1.86 0-3.57-.64-4.93-1.72ZM10 12.5c1.46 0 4.93.59 6.36 2.33A7.95 7.95 0 0 0 18 10c0-4.41-3.59-8-8-8s-8 3.59-8 8c0 1.82.62 3.49 1.64 4.83 1.43-1.74 4.9-2.33 6.36-2.33ZM10 4C8.06 4 6.5 5.56 6.5 7.5S8.06 11 10 11s3.5-1.56 3.5-3.5S11.94 4 10 4ZM8.5 7.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5S10.83 6 10 6s-1.5.67-1.5 1.5Z",fill:"#000"})))},c=a(9698),m=a(4871),u=a(9630),d=a(8707),f=a(7195),h=a(6884),p=a(9669),v=a.n(p),g=a(9580),x=a(7375),w=a(4202),b=a(8133),j=a(5187),_=a(9008),Z=a.n(_),y=a(8493),N=a(5811),S=()=>{let{user:e,isLoading:t,errorMsg:a,updateFirstName:s,updateLastName:l,updateEmail:p}=(0,f.Z)(!0);(0,b.Z)("profile");let[_,S]=(0,i.useState)(""),[E,C]=(0,i.useState)(""),[M,T]=(0,i.useState)(""),[O,L]=(0,i.useState)(""),[P,I]=(0,i.useState)(!0),[k,A]=(0,i.useState)(!1),[R,B]=(0,i.useState)(!1),[z,F]=(0,i.useState)({first_name:"",last_name:"",email:"",email_confirmation:""}),[U,q]=(0,i.useState)(""),[D,V]=(0,i.useState)(""),[W,H]=(0,i.useState)(!1),[X,J]=(0,i.useState)("");(0,i.useEffect)(()=>{e&&(S(e.firstName),C(e.lastName),T(e.email),L(e.email))},[e]),(0,i.useEffect)(()=>{(null==e?void 0:e.firstName)!==_||(null==e?void 0:e.lastName)!==E||(null==e?void 0:e.email)!==M?I(!1):I(!0),(null==e?void 0:e.email)!==M?A(!0):A(!1)},[null==e?void 0:e.firstName,_,null==e?void 0:e.lastName,E,null==e?void 0:e.email,M]);let G=async e=>{e.preventDefault();let t={first_name:"",last_name:"",email:"",email_confirmation:""};if(B(!0),F(t),q(""),V(""),_||(t.first_name="First name is required."),E||(t.last_name="Last name is required."),M||(t.email="Email is required."),_.length>255&&(t.first_name="First name should be less than 255 characters."),E.length>255&&(t.last_name="Last name should be less than 255 characters."),M.length>255&&(t.email="Email should be less than 255 characters."),M!==O&&(t.email_confirmation="Email does not match."),t.first_name||t.last_name||t.email||t.email_confirmation){F(t),B(!1);return}try{await (0,w.z)();let e=await v().post(g.z0+"/api/user/update",{first_name:_,last_name:E,email:M,email_confirmation:O},{withCredentials:!0});console.log(e),q(e.data.message),s(_),l(E),p(M),B(!1)}catch(e){if(console.log(e),(0,N.I)(e)){var a,r,n,i;if(null===(r=e.response)||void 0===r?void 0:null===(a=r.data)||void 0===a?void 0:a.errors){let t=e.response.data.errors;for(let e in console.log(t),t)console.log(e),F(a=>({...a,[e]:t[e][0]}))}else(null===(i=e.response)||void 0===i?void 0:null===(n=i.data)||void 0===n?void 0:n.message)?V(e.response.data.message):V("Whoops, something went wrong.")}B(!1)}},K=async()=>{J(""),H(!0);try{await (0,w.z)();let e=await (0,y.T)();console.log(e),window.location.assign("/auth/shopify-login")}catch(a){var e,t;console.log(a),(0,N.I)(a)&&(null===(t=a.response)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.message)?J(a.response.data.message):J("Whoops, something went wrong.")}H(!1)};return!e||t?(0,r.jsx)(h.Z,{errorMsg:a}):(0,r.jsxs)(d.Z,{activeNavLink:"Profile Info",children:[(0,r.jsx)(Z(),{children:(0,r.jsxs)("title",{children:["Profile Info | ",g.iC]})}),(0,r.jsx)("h1",{className:"mb-6 md:mb-10",children:"Profile Info"}),(0,r.jsxs)("form",{className:"md:w-[345px]",onSubmit:G,children:[(0,r.jsx)(n.Z,{inputType:"text",label:"FIRST NAME",value:_,onCh
1ange:e=>{S(e.currentTarget.value)},Svg:o,placeholder:"John",errorMsg:z.first_name,extraClasses:"mb-6"}),(0,r.jsx)(n.Z,{inputType:"text",label:"LAST NAME",value:E,onChange:e=>{C(e.currentTarget.value)},Svg:o,placeholder:"Doe",errorMsg:z.last_name,extraClasses:"mb-6"}),(0,r.jsx)(n.Z,{inputType:"email",label:"EMAIL",value:M,onChange:e=>{T(e.currentTarget.value)},Svg:c.Z,placeholder:"[email protected]",errorMsg:z.email,extraClasses:"mb-6"}),k&&(0,r.jsx)(n.Z,{inputType:"email",label:"CONFIRM EMAIL",value:O,onChange:e=>{L(e.currentTarget.value)},Svg:c.Z,errorMsg:z.email_confirmation,extraClasses:"mb-6"}),(0,r.jsx)(n.Z,{inputType:"text",label:"CURRENT STORE URL",value:e.storeUrl,Svg:u.Z,placeholder:"yourstore.myshopify.com",errorMsg:"",disabled:!0}),(0,r.jsx)(m.Z,{disabled:P,myClasses:"mt-10 md:mt-12",type:"submit",isLoading:R,Svg:x.Z,children:"Save"}),(0,r.jsx)("p",{className:"mt-5 text-green-600",children:U}),(0,r.jsx)("p",{className:"text-red-600 mt-3",children:D})]}),(0,r.jsxs)("div",{className:"flex flex-col items-start mt-20",children:[W?(0,r.jsx)("div",{children:(0,r.jsx)(j.Z,{height:25,width:25})}):(0,r.jsx)("button",{className:"underline text-sm",onClick:K,children:"Logout"}),(0,r.jsx)("p",{className:"text-red-600 mt-3 text-sm",children:X})]})]})}},8493:function(e,t,a){"use strict";a.d(t,{T:function(){return i}});var s=a(9669),r=a.n(s),n=a(9580);function i(){return r().post(n.z0+"/api/auth/logout",void 0,{withCredentials:!0})}},9008:function(e,t,a){e.exports=a(7828)}},function(e){e.O(0,[888,774,179],function(){return e(e.s=4865)}),_N_E=e.O()}]);
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.