PageSourceSearch

https://megapc.tn/_next/static/chunks/pages/page/profile-0df5e0072c6280c0.js

js megapc.tn collected 2026-10-06 00:54:31 UTC 6,657 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[767],{49306:function(e,s,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/page/profile",function(){return l(36490)}])},36490:function(e,s,l){"use strict";l.r(s),l.d(s,{__N_SSG:function(){return y},default:function(){return _}});var r=l(85893),i=l(42820),a=l(64071),o=l(26042),n=l(69396),t=l(65225),d=l(14685),m=l(58448),c=l(87536),u=l(94930),x=l(85945),p=l(48228),v=l(94893),f=l(40782),b={},g=function(e){var s,l,i,a,g,h,j,w,N,Z=e.user,y=e.regions,_=(0,x.NL)(),k=(0,c.cI)({defaultValues:b}),A=k.register,V=k.handleSubmit,E=k.formState.errors,T=(k.control,(0,p.D)(v.Lj,{onSuccess:function(e){e.status?(f.Am.success("Votre profil a \xe9t\xe9 mis \xe0 jour avec succ\xe8s"),_.invalidateQueries(["getUserProfile",Z._id])):f.Am.error("Une erreur s'est produite lors de la mise \xe0 jour de votre profil")},onError:function(){f.Am.error("Une erreur s'est produite lors de la mise \xe0 jour de votre profil")}})),S=T.mutate,C=T.isLoading;return(0,r.jsxs)("div",{className:"w-full flex flex-col",children:[(0,r.jsx)(m.Z,{variant:"titleLarge",className:"mb-5 md:mb-6 lg:mb-7 lg:-mt-1",children:"Informations personnelles"}),(0,r.jsxs)("form",{onSubmit:V((function(e){var s={_id:Z._id,tel:e.tel,name:e.name,region:e.region,societe:e.societe,codeTVA:e.codeTVA,dateDeNaissance:e.dateDeNaissance,gender:e.gender,email:e.email};S(s)})),className:"w-full mx-auto flex flex-col justify-center",noValidate:!0,children:[(0,r.jsx)("div",{className:"border-skin-base border-b pb-7 md:pb-8 lg:pb-10",children:(0,r.jsxs)("div",{className:"flex flex-col space-y-4 sm:space-y-5",children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row -mx-1.5 md:-mx-2.5 space-y-4 sm:space-y-0",children:[(0,r.jsx)(t.Z,(0,n.Z)((0,o.Z)({label:"Nom *"},A("name",{value:null===Z||void 0===Z?void 0:Z.name,required:"Ce champ est obligatoire"})),{variant:"solid",className:"w-full sm:w-1/2 px-1.5 md:px-2.5",error:null===(s=E.name)||void 0===s?void 0:s.message})),(0,r.jsx)(t.Z,(0,n.Z)((0,o.Z)({type:"tel",label:"T\xe9l\xe9phone/Mobile *"},A("tel",{value:null===Z||void 0===Z?void 0:Z.tel,required:"Ce champ est obligatoire",validate:function(e){return e.trim().length>=8||"Le num\xe9ro doit comporter au moins 8 caract\xe8res sans espaces"}})),{variant:"solid",className:"w-full sm:w-1/2 px-1.5 md:px-2.5",error:null===(l=E.tel)||void 0===l?void 0:l.message}))]})," ",(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row -mx-1.5 md:-mx-2.5 space-y-4 sm:space-y-0",children:[(0,r.jsx)(t.Z,(0,n.Z)((0,o.Z)({label:"Soci\xe9t\xe9 *"},A("societe",{value:null===Z||void 0===Z?void 0:Z.societe,required:"Ce champ est obligatoire"})),{variant:"solid",className:"w-full sm:w-1/2 px-1.5 md:px-2.5",error:null===(i=E.societe)||void 0===i?void 0:i.message})),(0,r.jsx)(t.Z,(0,n.Z)((0,o.Z)({label:"Code TVA *"},A("codeTVA",{value:null===Z||void 0===Z?void 0:Z.codeTVA})),{variant:"solid",className:"w-full sm:w-1/2 px-1.5 md:px-2.5",error:null===(a=E.codeTVA)||void 0===a?void 0:a.message}))]}),(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row -mx-1.5 md:-mx-2.5 space-y-4 sm:space-y-0",children:[(0,r.jsx)(t.Z,(0,n.Z)((0,o.Z)({label:"Email *"},A("email",{value:null===Z||void 0===Z?void 0:Z.email,required:"Ce champ est obligatoire"})),{variant:"solid",className:"w-full sm:w-1/2 px-1.5 md:px-2.5",error:null===(g=E.email)||void 0===g?void 0:g.message})),(0,r.jsx)(t.Z,(0,n.Z)((0,o.Z)({type:"date",label:"Date de naissance*"},A("dateDeNaissance",{value:Z?null===(j=null===(h=new Date(null===Z||void 0===Z?void 0:Z.dateDeNaissance))||void 0===h?void 0:h.toISOString())||void 0===j?void 0:j.split("T")[0]:""})),{variant:"solid",className:"w-full sm:w-1/2 px-1.5 md:px-2.5",error:null===(w=E.dateDeNaissance)||void 0===w?void 0:w.message}))]}),(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row -mx-1.5 md:-mx-2.5 space-y-4 sm:space-y-0",children:[(0,r.jsxs)("div",{className:"w-full sm:w-1/2 px-1.5 md:px-2.5",children:[(0,r.jsx)("label",{htmlFor:"genre",className:"block font-normal text-sm leading-none mb-3 cursor-pointer text-skin-base text-opacity-70",children:"Genre"}),(0,r.jsxs)("select",(0,n.Z)((0,o.Z)({},A("gender",{value:(null===Z||void 0===Z?void 0:Z.gender)||"Homme"})),{className:"py-2 px-4 w-full appearance-none transition duration-150 ease-in-out border text-input text-13px lg:text-sm font-body rounded placeholder-[#B3B3B3] min-h-12 text-skin-base bg-skin-fill border-skin-two focu
1s:border-2 focus:outline-none focus:border-skin-primary h-11 md:h-12",children:[(0,r.jsx)("option",{value:"Homme",children:"Homme"}),(0,r.jsx)("option",{value:"Femme",children:"Femme"})]}))]}),(0,r.jsxs)("div",{className:"w-full sm:w-1/2 px-1.5 md:px-2.5",children:[(0,r.jsx)("label",{htmlFor:"genre",className:"block font-normal text-sm leading-none mb-3 cursor-pointer text-skin-base text-opacity-70",children:"Region"}),(0,r.jsx)("select",(0,n.Z)((0,o.Z)({},A("region",{value:null===Z||void 0===Z?void 0:Z.region._id})),{className:"py-2 px-4 w-full appearance-none transition duration-150 ease-in-out border text-input text-13px lg:text-sm font-body rounded placeholder-[#B3B3B3] min-h-12 text-skin-base bg-skin-fill border-skin-two focus:border-2 focus:outline-none focus:border-skin-primary h-11 md:h-12",children:null===y||void 0===y?void 0:y.map((function(e){return(0,r.jsx)("option",{value:e._id,children:e.titre},e._id)}))}))]})]}),(0,r.jsx)("div",{className:"flex flex-col sm:flex-row -mx-1.5 md:-mx-2.5 space-y-4 sm:space-y-0",children:(0,r.jsx)(u.Z,(0,n.Z)((0,o.Z)({rows:5,label:"Addresse *"},A("streetAddress",{value:null===Z||void 0===Z?void 0:Z.streetAddress,required:"Ce champ est obligatoire",validate:function(e){return e.trim().length>=8||"L'adresse doit comporter au moins 8 caract\xe8res sans espaces"}})),{variant:"solid",className:"w-full px-1.5 md:px-2.5",error:null===(N=E.streetAddress)||void 0===N?void 0:N.message}))})]})}),(0,r.jsx)("div",{className:"relative flex sm:ms-auto mt-5 pb-2 lg:pb-0",children:(0,r.jsx)(d.Z,{type:"submit",loading:C,disabled:C,variant:"formButton",className:"w-full sm:w-auto",children:"Enregister"})})]})]})},h=l(89183),j=l(79965),w=l(31726),N=l(36492);var Z=(0,l(81959).Z)((function(e){var s=e.regions,l=(0,j.a)().userId,i=(0,N.a)(["getUserProfile",l],(function(){return(0,v.et)(l)}),{enabled:!!l}),o=i.data;return i.isLoading?(0,r.jsx)(w.a,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{title:"Votre profile sur MEGA",description:"Votre profile sur MEGA",path:"/page/profile"}),(0,r.jsx)(a.Z,{children:(0,r.jsx)(g,{regions:s,user:o})})]})}));Z.Layout=i.Z;var y=!0,_=Z}},function(e){e.O(0,[736,592,888,179],(function(){return s=49306,e(e.s=s);var s}));var s=e.O();_N_E=s}]);

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.