PageSourceSearch

https://www.hellofresh.com/_next/static/chunks/pages/creator-marke…/info/edit-profile-8aa06a0fda14ad92.js

js hellofresh.com collected 2026-09-24 09:15:27 UTC 12,469 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25053],{136916:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/creator-marketplace/account/info/edit-profile",function(){return r(577916)}])},762982:function(e,t,r){"use strict";r.d(t,{X:function(){return f}});var n,a,o=r(456552),i=r(671718),l=r(447178),u=r(140224),c=r(699219);function s(e,t,r,n,a,o,i){try{var l=e[o](i),u=l.value}catch(e){r(e);return}l.done?t(u):Promise.resolve(u).then(n,a)}var d=(n=function(e,t){var r,n,a,o,l,u,c=arguments;return function(e,t){var r,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(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=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=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=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===(r=e.id)?"me":r,a=e.payload,o=e.systemCountry,l=e.locale,u=e.parentSpan,[4,(c.length>2&&void 0!==c[2]?c[2]:i.Z)("/api/customers/".concat(n),t,{method:"PATCH",headers:{"Content-Type":"application/json"},query:{country:o,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,t=arguments;return new Promise(function(r,a){var o=n.apply(e,t);function i(e){s(o,r,a,i,l,"next",e)}function l(e){s(o,r,a,i,l,"throw",e)}i(void 0)})},function(e,t){return a.apply(this,arguments)}),f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,u.O)(),r=(0,l.Z)().fetch,n=[c.Z["customer.updateById"]];return(0,o.useMutation)(function(e){return d(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e,t),n,r)},e)}},577916:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return C},default:function(){return I}});var n=r(687800),a=r(827378),o=r(934301),i=r(504555),l=r(888149),u=r(222579),c=r(768587),s=r(581340),d=r(224358),f=r(537850),p=r(187923),m=r(439808),h=r(671948),b=r(762982),y=r(456552),g=r(699219);function v(e,t,r,n,a,o,i){try{var l=e[o](i),u=l.value}catch(e){r(e);return}l.done?t(u):Promise.resolve(u).then(n,a)}var x=function(){var e,t,r=(0,y.useQueryClient)(),n=(0,b.X)();return{updateProfile:(e=function(e){return function(e,t){var r,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(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=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=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,n.mutateAsync({id:"me",payload:{customer:{firstName:e.firstName,lastName:e.lastName,email:e.email}}})];case 1:return t.sent(),[4,r.invalidateQueries([g.Z["customer.basicInfo"]])];case 2:return t.sent(),[2,!0];case 3:return t.sent(),[2,!1];case 4:return[2]}})},t=function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);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 t.apply(this,arguments)}),isUpdating:n.isLoading}},_=function(){var e=(0,f.H)().translateRaw;return{validateForm:function(t){var r={};
1return t.firstName.trim()||(r.firstName=e("creator_marketplace.account.edit_profile.error.first_name_required")||"First name is required"),t.lastName.trim()||(r.lastName=e("creator_marketplace.account.edit_profile.error.last_name_required")||"Last name is required"),t.email.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t.email)||(r.email=e("creator_marketplace.account.edit_profile.error.email_invalid")||"Please enter a valid email address"):r.email=e("creator_marketplace.account.edit_profile.error.email_required")||"Email is required",r}}},k=r(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,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Z(e,t,r,n,a,o,i){try{var l=e[o](i),u=l.value}catch(e){r(e);return}l.done?t(u):Promise.resolve(u).then(n,a)}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,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=(r=a.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){l=!0,n=e}finally{try{i||null==a.return||a.return()}finally{if(l)throw n}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return N(e,t)}}(e,t)||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,t,r=(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,t){var r,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(r)throw TypeError("Generator is already executing.");for(;i;)try{if(r=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=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=a=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}}(this,function(t){switch(t.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 t.sent()?(0,p.Z)(o,"".concat((0,l.zk)(),"?updated=success")):(0,p.Z)(o,"".concat((0,l.zk)(),"?updated=error")),[2]}})},t=function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);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 t.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:r("creator_marketplace.account.edit_profile.load_error")||"Failed to load your profile. Please try again.",onBack:H,backButtonText:r("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:r("creator_marketplace.account.edit_profile.title")||"Personal info"}),z&&(0,n.tZ)(h.Z,{message:r("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:r("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:r("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:r("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:r("creator_marketplace.account.edit_profile.cancel")||"Cancel"}),(0,n.tZ)(c.zx.Primary,{onClick:D,disabled:k,children:r("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,50693,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.