1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25053],{136916:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/creator-marketplace/account/info/edit-profile",function(){return t(577916)}])},762982:function(e,r,t){"use strict";t.d(r,{X:function(){return d}});var n,a,o=t(671718),i=t(407108),l=t(140224),u=t(699219);function c(e,r,t,n,a,o,i){try{var l=e[o](i),u=l.value}catch(e){t(e);return}l.done?r(u):Promise.resolve(u).then(n,a)}var s=(n=function(e,r){var t,n,a,i,l,u,c=arguments;return function(e,r){var t,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(t)throw TypeError("Generator is already executing.");for(;i;)try{if(t=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=r.call(e,i)}catch(e){o=[6,e],n=0}finally{t=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}(this,function(s){switch(s.label){case 0:return n=void 0===(t=e.id)?"me":t,a=e.payload,i=e.systemCountry,l=e.locale,u=e.parentSpan,[4,(c.length>2&&void 0!==c[2]?c[2]:o.Z)("/api/customers/".concat(n),r,{method:"PATCH",headers:{"Content-Type":"application/json"},query:{country:i,locale:l},parentSpan:u,data:a,fetchSpanAttributes:{"request.backend_service":"customer-management-service","request.backend_action":"patch-customer"}})];case 1:return[2,s.sent().json()]}})},a=function(){var e=this,r=arguments;return new Promise(function(t,a){var o=n.apply(e,r);function i(e){c(o,t,a,i,l,"next",e)}function l(e){c(o,t,a,i,l,"throw",e)}i(void 0)})},function(e,r){return a.apply(this,arguments)}),d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(0,l.O)(),t=[u.Z["customer.updateById"]];return(0,i.Z)(t,function(e,n){return s(function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.forEach(function(r){var n;n=t[r],r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n})}return e}({},n,r),t,e)},e)}},577916:function(e,r,t){"use strict";t.r(r),t.d(r,{__N_SSP:function(){return C},default:function(){return I}});var n=t(687800),a=t(827378),o=t(934301),i=t(504555),l=t(888149),u=t(222579),c=t(768587),s=t(581340),d=t(224358),f=t(537850),p=t(187923),m=t(439808),h=t(671948),b=t(762982),y=t(456552),g=t(699219);function v(e,r,t,n,a,o,i){try{var l=e[o](i),u=l.value}catch(e){t(e);return}l.done?r(u):Promise.resolve(u).then(n,a)}var x=function(){var e,r,t=(0,y.useQueryClient)(),n=(0,b.X)();return{updateProfile:(e=function(e){return function(e,r){var t,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(t)throw TypeError("Generator is already executing.");for(;i;)try{if(t=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=r.call(e,i)}catch(e){o=[6,e],n=0}finally{t=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,n.mutateAsync({id:"me",payload:{customer:{firstName:e.firstName,lastName:e.lastName,email:e.email}}})];case 1:return r.sent(),[4,t.invalidateQueries([g.Z["customer.basicInfo"]])];case 2:return r.sent(),[2,!0];case 3:return r.sent(),[2,!1];case 4:return[2]}})},r=function(){var r=this,t=arguments;return new Promise(function(n,a){var o=e.apply(r,t);function i(e){v(o,n,a,i,l,"next",e)}function l(e){v(o,n,a,i,l,"throw",e)}i(void 0)})},function(e){return r.apply(this,arguments)}),isUpdating:n.isLoading}},_=function(){var e=(0,f.H)().translateRaw;return{validateForm:function(r){var t={};
1return r.firstName.trim()||(t.firstName=e("creator_marketplace.account.edit_profile.error.first_name_required")||"First name is required"),r.lastName.trim()||(t.lastName=e("creator_marketplace.account.edit_profile.error.last_name_required")||"Last name is required"),r.email.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r.email)||(t.email=e("creator_marketplace.account.edit_profile.error.email_invalid")||"Please enter a valid email address"):t.email=e("creator_marketplace.account.edit_profile.error.email_required")||"Email is required",t}}},k=t(625251),w=function(){return(0,n.tZ)(c.xu,{"data-test-id":"account-edit-profile-page",children:(0,n.BX)(c.xu,{display:"flex",flexDirection:"column",gap:"global.md-1",marginX:"auto",padding:"global.md-1",borderStyle:"solid",borderColor:"shared-alias.neutral.border.default",borderWidth:"1px",marginTop:["global.none","global.md-1"],children:[(0,n.tZ)(k.K,{width:"180px",height:"32px",backgroundColor:"neutral.300",borderRadius:"border-radius-sm"}),[1,2,3].map(function(e){return(0,n.BX)(c.xu,{display:"flex",flexDirection:"column",gap:"global.xs",children:[(0,n.tZ)(k.K,{width:"100px",height:"20px",backgroundColor:"neutral.300",borderRadius:"border-radius-sm"}),(0,n.tZ)(k.K,{width:"100%",height:"48px",backgroundColor:"neutral.200",borderRadius:"border-radius-sm"})]},e)}),(0,n.BX)(c.xu,{display:"flex",gap:"global.sm-2",marginTop:"global.md-1",children:[(0,n.tZ)(k.K,{width:"120px",height:"48px",backgroundColor:"neutral.200",borderRadius:"border-radius-sm"}),(0,n.tZ)(k.K,{width:"120px",height:"48px",backgroundColor:"neutral.200",borderRadius:"border-radius-sm"})]})]})})};function N(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function Z(e,r,t,n,a,o,i){try{var l=e[o](i),u=l.value}catch(e){t(e);return}l.done?r(u):Promise.resolve(u).then(n,a)}function S(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t,n,a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var o=[],i=!0,l=!1;try{for(a=a.call(e);!(i=(t=a.next()).done)&&(o.push(t.value),!r||o.length!==r);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw n}}return o}}(e,r)||function(e,r){if(e){if("string"==typeof e)return N(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return N(e,r)}}(e,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var T=function(){var e,r,t=(0,f.H)().translateRaw,o=(0,s.t)(),i=(0,d.H)(),u=i.data,b=i.isLoading,y=i.isError,g=x(),v=g.updateProfile,k=g.isUpdating,N=_().validateForm,T=S((0,a.useState)(""),2),P=T[0],C=T[1],I=S((0,a.useState)(""),2),E=I[0],O=I[1],q=S((0,a.useState)(""),2),R=q[0],X=q[1],j=S((0,a.useState)({}),2),A=j[0],B=j[1],F=a.useRef(!1);a.useEffect(function(){u&&!F.current&&(C(u.firstName||""),O(u.lastName||""),X(u.email||""),F.current=!0)},[u]);var z=void 0!==u&&null!==u.subscriptionStatus,D=(e=function(){var e;return function(e,r){var t,n,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(t)throw TypeError("Generator is already executing.");for(;i;)try{if(t=1,n&&(a=2&o[0]?n.return:o[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,o[1])).done)return a;switch(n=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=(a=i.trys).length>0&&a[a.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]<a[3])){i.label=o[1];break}if(6===o[0]&&i.label<a[1]){i.label=a[1],a=o;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(o);break}a[2]&&i.ops.pop(),i.trys.pop();continue}o=r.call(e,i)}catch(e){o=[6,e],n=0}finally{t=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}(this,function(r){switch(r.label){case 0:if(B(e=N({firstName:P,lastName:E,email:R})),Object.keys(e).length>0||!u)return[2];return[4,v({userId:u.userId,firstName:P,lastName:E,email:R})];case 1:return r.sent()?(0,p.Z)(o,"".concat((0,l.zk)(),"?updated=success")):(0,p.Z)(o,"".concat((0,l.zk)(),"?updated=error")),[2]}})},r=function(){var r=this,t=arguments;return new Promise(function(n,a){var o=e.apply(r,t);function i(e){Z(o,n,a,i,l,"next",e)}function l(e){Z(o,n,a,i,l,"throw",e)}i(void 0)})},function(){return r.apply(this,arguments)}),H=function(){(0,p.Z)(o,(0,l.zk)())};return b?(0,n.tZ)(w,{}):y?(0,n.tZ)(c.xu,{"data-test-id":"account-edit-profile-page",children:(0,n.tZ)(m.o,{message:t("creator_marketplace.account.edit_profile.load_error")||"Failed to load your profile. Please try again.",onBack:H,backButtonText:t("creator_marketplace.account.edit_profile.back")||"Back to Account Info"})}):(0,n.tZ)(c.xu,{"data-test-id":"account-edit-profile-page",children:(0,n.BX)(c.xu,{display:"flex",flexDirection:"column",gap:"global.md-1",marginX:"auto",padding:"global.md-1",borderStyle:"solid",borderColor:"shared-alias.neutral.border.default",borderWidth:"1px",marginTop:["global.none","global.md-1"],children:[(0,n.tZ)(c.xv,{as:"h1",styleAs:"h3",children:t("creator_marketplace.account.edit_profile.title")||"Personal info"}),z&&(0,n.tZ)(h.Z,{message:t("creator_marketplace.account.edit_profile.hf_subscriber_warning")||"This will also update your information in your HelloFresh account."}),(0,n.BX)(c.xu,{display:"flex",flexDirection:"column",gap:"global.md-1",children:[(0,n.tZ)(c.NI,{labelText:t("creator_marketplace.account.edit_profile.first_name")||"Name",isRequired:!0,children:(0,n.tZ)(c.NI.TextInput,{value:P,onChange:function(e){return C(e.target.value)},error:!!A.firstName,errorText:A.firstName,"data-test-id":"edit-profile-first-name-input"})}),(0,n.tZ)(c.NI,{labelText:t("creator_marketplace.account.edit_profile.last_name")||"Last name",isRequired:!0,children:(0,n.tZ)(c.NI.TextInput,{value:E,onChange:function(e){return O(e.target.value)},error:!!A.lastName,errorText:A.lastName,"data-test-id":"edit-profile-last-name-input"})}),(0,n.tZ)(c.NI,{labelText:t("creator_marketplace.account.edit_profile.email")||"Email",isRequired:!0,children:(0,n.tZ)(c.NI.TextInput,{type:"email",value:R,onChange:function(e){return X(e.target.value)},error:!!A.email,errorText:A.email,"data-test-id":"edit-profile-email-input"})})]}),(0,n.BX)(c.xu,{display:"flex",gap:"global.sm-2",marginTop:"global.md-1",children:[(0,n.tZ)(c.zx.Secondary,{onClick:H,disabled:k,children:t("creator_marketplace.account.edit_profile.cancel")||"Cancel"}),(0,n.tZ)(c.zx.Primary,{onClick:D,disabled:k,children:t("creator_marketplace.account.edit_profile.save")||"Save"})]})]})})},P=function(e){return e.ssrPayload,(0,n.tZ)(i.F,{redirectPathIfGuest:(0,l.sF)(),children:(0,n.tZ)(u.R,{children:(0,n.tZ)(T,{})})})};P.customLayout=o.C;var C=!0,I=P}},function(e){e.O(0,[38579,94924,10198,17925,49461,78255,24007,68368,68127,92888,49774,40179],function(){return e(e.s=136916)}),_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.