1import{u as X,a as ee,x as te,n as ae,ak as se,f as m,B as re,al as ne,i as le,L as ie,b as oe,c as de,o as me}from"../chunks/chunk-BFgw_KlF.js";import{b as n,j as e}from"../chunks/chunk-ngaCJxcV.js";import{a as ue,e as S}from"../chunks/chunk-KO1ABRC5.js";import{S as y,A as ce}from"../chunks/chunk-CdfW1Bad.js";import{C as pe,a as xe}from"../chunks/chunk-Bjr1aYt7.js";import{s as _,n as P,S as fe,Y as he,i as B,h as Y,a as ge}from"../chunks/chunk-CJ7t2nCf.js";/* empty css */import{U as ye}from"../chunks/chunk-YE5B4yIH.js";import{i as G}from"../chunks/chunk-B24eoqi3.js";import"../chunks/chunk-C-IMmuvR.js";/* empty css *//* empty css */import"../chunks/chunk-Cl85btZu.js";import"../chunks/chunk-CCVQhKvN.js";import"../chunks/chunk-DAgG4ogk.js";const Se=["MR","MRS","MS","MISS","DR"],Te={nl:"nl",en:"gb",fr:"fr",ar:"ma"};function Ne(l){return Te[l||ue]??"nl"}function be(l){return l?.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(l.trim()):!1}function ve(l){if(!l)return"";const i=l.split("T")[0];return i&&/^\d{4}-\d{2}-\d{2}$/.test(i)?i:""}function je(){const i=X()?.urlPathname??"",{t:a,language:u}=ee(),[T,q]=n.useState(!1),[c,C]=n.useState(void 0),[w,A]=n.useState(!0),[L,D]=n.useState(!1),[N,b]=n.useState(null),[W,H]=n.useState(()=>Ne(u??"")),[O,M]=n.useState(""),[x,R]=n.useState(""),[f,U]=n.useState(""),[v,z]=n.useState(""),[Z,V]=n.useState(""),[j,k]=n.useState(""),[E,I]=n.useState(""),[s,J]=n.useState({}),[p,F]=n.useState({});n.useEffect(()=>{if(!te()){ae("/");return}q(!0)},[]),n.useEffect(()=>{if(!T)return;let t=!1;return A(!0),se().then(r=>{if(!t&&(C(r??null),r)){M((r.title??"").trim());const h=r.name??"",g=r.surname??"";R(_(h).trim()),U(_(g).trim()),F(o=>{const d={...o};return P(h)?d.name=a("TRAVELLERS_NameUseAlphabetic"):delete d.name,P(g)?d.surname=a("TRAVELLERS_SurnameUseAlphabetic"):delete d.surname,d}),z(ve(r.birthDate)),V((r.id1??r.id2??r.id3??"").trim()),k((r.phoneNumber??"").trim()),I((r.email??r.login??"").trim())}}).catch(()=>{t||C(null)}).finally(()=>{t||A(!1)}),()=>{t=!0}},[T,a]);function K(){const t={};return x.trim()?B(x)?Y(x)||(t.name=a("COMMON_Min2Characters")):t.name=a("COMMON_LettersOnly"):t.name=a("COMMON_Required"),f.trim()?B(f)?Y(f)||(t.surname=a("COMMON_Min2Characters")):t.surname=a("COMMON_LettersOnly"):t.surname=a("COMMON_Required"),E.trim()?be(E)||(t.email=a("COMMON_InvalidEmail")):t.email=a("COMMON_Required"),j.trim()&&!ge(j)&&(t.phone=a("COMMON_InvalidPhone")),J(t),Object.keys(t).length===0}function $(t,r){const h=_(r);t==="name"?R(h):U(h);const g=a(t==="name"?"TRAVELLERS_NameUseAlphabetic":"TRAVELLERS_SurnameUseAlphabetic");F(o=>{if(P(r))return o[t]===g?o:{...o,[t]:g};if(!(t in o))return o;const d={...o};return delete d[t],d})}async function Q(){if(b(null),!!K()&&c?.id){D(!0);try{const t={id:c.id,title:O.trim()||null,name:x.trim()||null,surname:f.trim()||null,birthDate:v?`${v}T00:00:00.000Z`:null,address:c.address??"",postCode:c.postCode??"",city:c.city??"",fax:c.fax??"",status:c.status??!0};await ne(t),b({type:"success",text:a("COMMON_Saved")})}catch(t){const r=t instanceof Error?t.message:a("COMMON_Error");b({type:"error",text:r})}finally{D(!1)}}}return T?e.jsx("div",{className:"min-h-screen bg-gray-50 pt-24 pb-12",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 py-4 flex items-center justify-between",children:e.jsxs("div",{className:"flex flex-col lg:flex-row gap-8 w-full",children:[e.jsxs("main",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h1",{className:"text-2xl md:text-3xl font-dinb text-gray-900 flex items-center gap-2",children:[e.jsx(ye,{className:"h-8 w-8 text-[#22c55e]"}),a("AUTH_MyProfile")]}),e.jsx("p",{className:"text-gray-600 mt-1",children:a("PROFILE_Subtitle")||"Bewerk uw persoonsgegevens."})]}),w&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(y,{className:"h-12 w-full rounded-lg"}),e.jsx(y,{className:"h-12 w-full rounded-lg"}),e.jsx(y,{className:"h-12 w-full rounded-lg"}),e.jsx(y,{className:"h-24 w-full rounded-lg"})]}),!w&&e.jsx(pe,{children:e.jsxs(xe,{className:"pt-6",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-dinm text-gray-700",children:a("TRAVELLERS_Fields_Title")}),e.jsxs("select",{value:O,onChange:t=>M(t.target.value),className:m("mt-1 w-full rounded-md border border-gray-300 px-3 py-2 text-sm bg-white",s.title&&"border-red-500"),children:[e.jsx("option",{value:"",children:a("TRAVELLERS_Fields_PleaseSelect")}),Se.map(t=>e.jsx("option",{value:t,children:t},t))]}),s.title&&e.jsx("p",{className:"mt-1 text-xs text-red-600",children:s.title})]}),e.jsx("div",{}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-dinm text-gray-700",children:a("TRAVELLERS_Fields_Name")}),e.jsx("input",{type:"text",value:x,onChange:t=>$("name",t.target.value),className:m("mt-1 w-full rounded-md border border-gray-300 px-3 py-2 text-sm",(s.name||p.name)&&"border-red-500")}),(s.name||p.name)&&e.jsx("p",{className:"mt-1 text-xs text-red-600",children:s.name||p.name})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-dinm text-gray-700",children:a("TRAVELLERS_Fields_Surname")}),e.jsx("input",{type:"text",value:f,onChange:t=>$("surname",t.target.value),className:m("mt-1 w-full rounded-md border border-gray-300 px-3 py-2 text-sm",(s.surname||p.surname)&&"border-red-500")}),(s.surname||p.surname)&&e.jsx("p",{className:"mt-1 text-xs text-red-600",children:s.surname||p.surname})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-dinm text-gray-700",children:a("TRAVELLERS_Fields_Dob")}
1),e.jsx(fe,{value:v,onChange:z,className:m("mt-1 w-full rounded-md border border-gray-300 px-3 py-2 text-sm bg-white",s.birthDate&&"border-red-500"),placeholder:"YYYY-MM-DD"}),s.birthDate&&e.jsx("p",{className:"mt-1 text-xs text-red-600",children:s.birthDate})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-dinm text-gray-700",children:a("PROFILE_DocumentNumber")||"Documentnummer"}),e.jsx("input",{type:"text",value:Z,onChange:t=>V(t.target.value),className:m("mt-1 w-full rounded-md border border-gray-300 px-3 py-2 text-sm",s.documentNumber&&"border-red-500")}),s.documentNumber&&e.jsx("p",{className:"mt-1 text-xs text-red-600",children:s.documentNumber})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-sm font-dinm text-gray-700",children:a("TRAVELLERS_Fields_PhoneNumber")}),e.jsx("div",{className:"mt-1",children:e.jsx(he,{defaultCountry:W,value:j,onChange:(t,r)=>{k(t),r?.country?.iso2&&H(r.country.iso2)},inputClassName:m("w-full rounded-md border border-gray-300 px-3 py-2 text-sm",s.phone&&"!border-red-500"),className:"font-dinm",forceDialCode:!0,preferredCountries:["nl","ma","gb","de","be"]})}),s.phone&&e.jsx("p",{className:"mt-1 text-xs text-red-600",children:s.phone})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-sm font-dinm text-gray-700",children:a("TRAVELLERS_Fields_Email")}),e.jsx("input",{type:"email",value:E,onChange:t=>I(t.target.value),className:m("mt-1 w-full rounded-md border border-gray-300 px-3 py-2 text-sm",s.email&&"border-red-500")}),s.email&&e.jsx("p",{className:"mt-1 text-xs text-red-600",children:s.email})]})]}),N&&e.jsx("p",{className:m("mt-4 text-sm",N.type==="success"?"text-green-600":"text-red-600"),children:N.text}),e.jsx("div",{className:"mt-6",children:e.jsx(re,{onClick:Q,disabled:L,className:"bg-[#22c55e] hover:bg-[#16a34a] text-white",children:a(L?"COMMON_Loading":"COMMON_Save")})})]})})]}),e.jsx(ce,{currentPath:i,className:"lg:shrink-0 order-first lg:order-last"})]})})}):e.jsx("div",{className:"min-h-screen bg-gray-50 pt-24 pb-12",children:e.jsx("div",{className:"max-w-7xl mx-auto px-6 py-4 flex items-center justify-between flex justify-center items-center",children:e.jsx(y,{className:"h-12 w-64 rounded-xl"})})})}const Ee=Object.freeze(Object.defineProperty({__proto__:null,default:je},Symbol.toStringTag,{value:"Module"}));function _e(l){const u=l.data?.resolver?.relationTypeData?.[0]?.mainData?.name;return u?`${u} | ${S.PAGE_TITLE}`:`${G.t("PROFILE_PAGE_Title")} | ${S.PAGE_TITLE}`}const Pe=Object.freeze(Object.defineProperty({__proto__:null,default:_e},Symbol.toStringTag,{value:"Module"}));function Ce(l){const u=l.data?.resolver?.relationTypeData?.[0]?.mainData?.name;return u?`${u} - ${S.PAGE_TITLE}`:`${G.t("REGISTER_PAGE_Description")} - ${S.PAGE_TITLE}`}const we=Object.freeze(Object.defineProperty({__proto__:null,default:Ce},Symbol.toStringTag,{value:"Module"})),Ge={hasServerOnlyHook:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:!0}},isClientRuntimeLoaded:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:!0}},onBeforeRenderEnv:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:{server:!0}}},dataEnv:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:null}},guardEnv:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:null}},onRenderClient:{type:"standard",definedAtData:{filePathToShowToUser:"vike-react/__internal/integration/onRenderClient",fileExportPathToShowToUser:[]},valueSerialized:{type:"pointer-import",value:me}},onPageTransitionStart:{type:"standard",definedAtData:{filePathToShowToUser:"/pages/+onPageTransitionStart.ts",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:de}},onPageTransitionEnd:{type:"standard",definedAtData:{filePathToShowToUser:"/pages/+onPageTransitionEnd.ts",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:oe}},Page:{type:"standard",definedAtData:{filePathToShowToUser:"/pages/profile/+Page.tsx",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:Ee}},hydrationCanBeAborted:{type:"standard",definedAtData:{filePathToShowToUser:"vike-react/config",fileExportPathToShowToUser:["default","hydrationCanBeAborted"]},valueSerialized:{type:"js-serialized",value:!0}},hooksTimeout:{type:"standard",definedAtData:{filePathToShowToUser:"/pages/+config.ts",fileExportPathToShowToUser:["default","hooksTimeout"]}
1,valueSerialized:{type:"js-serialized",value:{data:{warning:!1,error:18e4},onBeforeRender:{warning:!1,error:18e4}}}},Layout:{type:"cumulative",definedAtData:[{filePathToShowToUser:"/layouts/LayoutDefault.tsx",fileExportPathToShowToUser:[]}],valueSerialized:[{type:"pointer-import",value:ie}]},title:{type:"standard",definedAtData:{filePathToShowToUser:"/pages/profile/+title.ts",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:Pe}},description:{type:"standard",definedAtData:{filePathToShowToUser:"/pages/profile/+description.ts",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:we}},Loading:{type:"standard",definedAtData:{filePathToShowToUser:"vike-react/__internal/integration/Loading",fileExportPathToShowToUser:[]},valueSerialized:{type:"pointer-import",value:le}}};export{Ge as configValuesSerialized};
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.