PageSourceSearch

https://www.euhu.co.uk/_next/static/chunks/pages/user/[[...userId]]-378131bff16f00e1.js

js euhu.co.uk collected 2026-10-04 05:21:47 UTC 25,136 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1080],{65026:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/user/[[...userId]]",function(){return t(43330)}])},47417:function(e,a,t){"use strict";t.d(a,{B:function(){return d}});var r=t(85893),s=t(29208),i=t.n(s),n=t(32866),l=t(52586),o=t(725),c=t(84849);let d=e=>{let{showSkeleton:a,id:t,name:s,register:d,rules:u,errors:m,className:h,inputClassName:x,...p}=e,v=i()(m,s),g=!!(m&&v);return(0,r.jsx)("div",{className:h,children:a?(0,r.jsx)(c.Z,{className:x,height:36}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.K,{id:t,name:s,error:g,className:x,...d&&d(s,u),...p}),(0,r.jsx)(n.B,{errors:m,name:s,render:e=>{let{message:a}=e;return(0,r.jsx)(l.J,{className:"mt-1",children:a})}})]})})}},33507:function(e,a,t){"use strict";t.d(a,{r:function(){return m}});var r=t(85893),s=t(94184),i=t.n(s),n=t(67294),l=t(90048),o=t(89453),c=t.n(o),d=t(86501),u=t(84849);function m(e){let{buttonTitle:a,showSkeleton:t,onChange:s,disabled:o=!1,className:m="gtm-lesson-dropzone",placeholder:h="Drag files here or browse your device",contentTypes:x,"data-testid":p="file-drop-zone",supportedFormats:v=["AVIF","DOC","DOCX","JPEG","PDF","PNG","PPT","PPTX","WEBP","XLS"],variant:g="normal",multiple:f,maxFileSize:j=52428800}=e,[b,y]=(0,n.useState)(!1),N=(0,n.useRef)(null);function w(e){e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?y(!0):"dragleave"===e.type&&y(!1)}return(0,r.jsxs)("div",{className:i()(m,"relative text-center"),onDragEnter:w,"data-testid":p,children:[(0,r.jsx)("input",{ref:N,type:"file",multiple:f,onChange:function(e){e.preventDefault(),e.stopPropagation(),!o&&e.target.files&&(Array.from(e.target.files).forEach(e=>{e.size<j?s(e):d.Am.error('"'.concat(e.name,'" is too large.'))}),N&&N.current&&(N.current.value=""))},className:"hidden","data-testid":"".concat(p,"-input"),accept:x.join(",")}),(0,r.jsx)("label",{className:i()("flex grow items-center justify-center","overflow-hidden rounded-md border border-dashed border-grey",{"bg-neutral-100 opacity-75":o,"bg-neutral-50":b&&!o,"cursor-pointer bg-neutral-100":!b&&!o}),children:(0,r.jsx)("div",{className:"flex flex-col gap-4 px-2 py-10",children:t?(0,r.jsx)(u.Z,{className:i()({"h-[15rem]":"normal"===g,"h-[8rem]":"compact"===g})}):(0,r.jsxs)(r.Fragment,{children:["normal"===g&&(0,r.jsx)("div",{className:"mb-2 flex justify-center",children:(0,r.jsx)(c(),{className:"h-20 w-20 text-primary"})}),(0,r.jsx)("p",{className:i()("m-0 font-black text-primary",{"text-2xl sm:text-4xl":"normal"===g,"text-xl sm:text-3xl":"compact"===g}),children:h}),(0,r.jsxs)("p",{className:i()("m-0 text-primary sm:mx-16",{"text-base sm:text-lg":"normal"===g,"text-sm sm:text-base":"compact"===g}),children:["Supported formats: ",(null==v?void 0:v.join(", "))||"any",". Max size ",Math.floor(j/1024/1024),"MB."]}),(0,r.jsx)("p",{className:"m-0",children:(0,r.jsx)(l.zx,{className:"gtm-btn-lesson-file-upload",variant:"outline",disabled:o,loader:o,onClick:()=>{!o&&N&&N.current&&N.current.click()},"data-testid":"".concat(p,"-button-upload"),children:null!=a?a:"Upload"})})]})})}),b&&(0,r.jsx)("div",{className:"absolute right-0 top-0 h-full w-full bg-transparent",onDragEnter:w,onDragLeave:w,onDragOver:w,onDrop:function(e){e.preventDefault(),e.stopPropagation(),y(!1),!o&&e.dataTransfer.files&&Array.from(e.dataTransfer.files).forEach(e=>{s(e)})}})]})}},725:function(e,a,t){"use strict";t.d(a,{K:function(){return l}});var r=t(85893),s=t(67294),i=t(94184),n=t.n(i);let l=(0,s.forwardRef)((e,a)=>{let{id:t,name:s,className:i="",error:l,...o}=e;return(0,r.jsx)("textarea",{id:t,ref:a,name:s,className:n()(i,"relative block w-full appearance-none rounded py-2 pl-2.5 pr-2 text-sm leading-none text-primary placeholder-primary/50","resize-none overflow-auto border transition-colors ease-in-out focus:outline-none focus:ring-2",l?"border-error hover:border-error focus:border-error focus:ring-error focus:ring-opacity-50":"border-grey hover:border-teal-light focus:border-teal-light focus:ring-teal-light focus:ring-opacity-30"),"data-testid":"textarea",...o})})},97480:function(e,a,t){"use strict";t.d(a,{Z:function(){return p}});var r=t(85893),s=t(64019),i=t(83421),n=t(94184),l=t.n(n),o=t(67294),c=t(38106),d=t(7920),u=t(17376),m=t(42255);let h={full:"min-h-full","fit-content":""},x={left:"mr-auto",top:"mb-auto",right:"ml-auto",bottom:"mt-auto",center:"justify-center items-center","top-left":"mb-auto mr-auto","top-right":"mb-auto ml-auto","bottom-left":"mt-auto mr-auto","bottom-right":"mt-auto ml-auto"};function p(e){let{show:a,onClose:t,title:n,modalClassName:p="max-w-lg",closeButtonClassName:v="",position:g="center",height:f="full",children:j,onCloseEnd:b}=e,y=l()("gtm-close-modal","ml-auto h-6 w-6 shrink-0","rounded-full","bg-red hover:bg-red/80 focus:bg-red/80 text-white",v);function N(){t&&t()}return(0,r.jsx)(s.u,{show:a,enter:"transition duration-100 ease-out",enterFrom:"transform scale-100 opacity-0",enterTo:"transform scale-100 opacity-100",leave:"transition duration-300 ease-out",leaveFrom:"transform scale-100 opacity-100",leaveTo:"transform scale-100 opacity-0",afterLeave:b,children:(0,r.jsxs)(i.V,{onClose:N,className:"fixed inset-0 z-50 overflow-y-auto",children:[(0,r.jsx)(s.u.Child,{enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,r.jsx)(c.Z,{})}),(0,r.jsx)(s.u.Child,{as:o.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-50",enterTo:"opacity-100 delay-100 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-50",children:(0,r.jsx)("div",{className:l()("flex",x[g],h[f]),children:(0,r.jsxs)(i.V.Panel,{as:d.s,disablePadding:!0,className:l()("relative z-10 mx-4 my-4 w-full px-6 pb-2 pt-4 sm:mx-10 sm:px-12 sm:pt-8 lg:mx-10",p),variant:t?"closable":"default",children:[(0,r.jsx)(i.V.Title,{className:"mb-6 text-h3 font-black",children:n}),t&&(0,r.jsx)(m.hU,{size:"custom",className:l()("absolute right-3 top-3",y),variant:"header",onClick:N,children:(0,r.jsx)(u.Tw,{className:"h-6 w-6"})}),(0,r.jsx)("div",{children:"function"==typeof j?j({onClose:N}):j})]})})})]})})}},55166:function(e,a,t){"use strict";t.d(a,{Z:function(){return n}});var r=t(85893),s=t(94184),i=t.n(s);function n(e){let{tag:a="h3",className:t,children:s,size:n="h3"}=e,l=i()({"text-h1":"h1"===n,"text-h2":"h2"===n,"text-h3":"h3"===n,"text-base":"p"===n},"font-black",t);return(0,r.jsx)(a,{className:l,children:s})}t(67294)},43330:function(e,a,t){"use strict";t.r(a),t.d(a,{__N_SSP:function(){return W},default:function(){return K}});var r=t(85893),s=t(2962),i=t(67294),n=t(97480),l=t(7920);let o=e=>{let{children:a,className:t}=e,s=a.split("\n");
1return(0,r.jsx)(r.Fragment,{children:s.filter(Boolean).map((e,a)=>(0,r.jsx)("p",{className:t,children:e},a))})};var c=t(55166),d=t(83913),u=t(33507);t(48764).lW;let m=e=>new Promise((a,t)=>{let r=new Image;r.addEventListener("load",()=>a(r)),r.addEventListener("error",e=>t(e)),r.setAttribute("crossOrigin","anonymous"),r.src=e});function h(e){return e*Math.PI/180}async function x(e){let{imageSrc:a,pixelCrop:t,rotation:r=0,flip:s,format:i="dataUrl",mimeType:n="image/jpeg"}=e,l=await m(a),o=document.createElement("canvas"),c=o.getContext("2d");if(!c)return null;let d=h(r),{width:u,height:x}=function(e,a,t){let r=h(t);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*a),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*a)}}(l.width,l.height,r);o.width=u,o.height=x,c.translate(u/2,x/2),c.rotate(d),c.scale((null==s?void 0:s.horizontal)?-1:1,(null==s?void 0:s.vertical)?-1:1),c.translate(-l.width/2,-l.height/2),c.drawImage(l,0,0);let p=document.createElement("canvas"),v=p.getContext("2d");return v?(p.width=t.width,p.height=t.height,v.drawImage(o,t.x,t.y,t.width,t.height,0,0,t.width,t.height),"dataUrl"===i)?p.toDataURL(n):new Promise((e,a)=>{p.toBlob(t=>{if(!t){a(Error("Canvas is empty"));return}e(t)},n)}):null}var p=t(94184),v=t.n(p),g=t(36040);function f(e){var a;let{imageDataUrl:t,imageFile:s,setImageFile:i,crop:n,setCrop:l,zoom:o,setZoom:c,rotation:m,setRotation:h,setCroppedArea:x,...p}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[!s&&(0,r.jsx)(u.r,{buttonTitle:"Select Image",contentTypes:["image/*"],onChange:e=>{null==i||i(e)},multiple:!1,variant:"compact",supportedFormats:["Images"],maxFileSize:10485760}),s&&(0,r.jsxs)("div",{className:v()("relative h-[400px]"),children:[(0,r.jsx)(g.Z,{position:"screen-center"}),t&&(0,r.jsx)(d.ZP,{classes:{containerClassName:v()(" bg-[image:repeating-conic-gradient(#bbb_0%_25%,_#fff_0%_50%)] bg-[size:20px_20px]",p.circularCrop&&"rounded")},onCropChange:l,crop:n,onCropComplete:(e,a)=>{null==x||x(a)},image:t,onZoomChange:c,aspect:null!==(a=p.aspectRatio)&&void 0!==a?a:1,cropShape:p.circularCrop?"round":"rect",zoom:o,rotation:m,onRotationChange:h,showGrid:!1})]})]})}var j=t(84534),b=t(90048),y=t(86501),N=t(83915);function w(e){let{show:a,onClose:t,onUploadSuccess:s}=e,l=function(e){let[a,t]=i.useState({x:0,y:0}),[r,s]=i.useState(null),[n,l]=i.useState(1),[o,c]=i.useState(0),[d,u]=i.useState(null),[m,h]=i.useState(null);i.useEffect(()=>{let e=new FileReader,a=!1;return d?(e.onload=e=>{var t;let r=null===(t=e.target)||void 0===t?void 0:t.result;r&&!a&&"string"==typeof r&&h(r)},e.readAsDataURL(d)):h(null),()=>{a=!0,e&&1===e.readyState&&e.abort()}},[d]);let p=i.useCallback(()=>{u(null),h(null),t({x:0,y:0}),s(null),l(1),c(0)},[]),v=i.useCallback(async e=>m&&r?await x({imageSrc:m,pixelCrop:r,rotation:o,mimeType:e.mimeType,format:e.format}):null,[r,m,o]);return{imageFile:d,setImageFile:u,crop:a,setCrop:t,croppedArea:r,setCroppedArea:s,zoom:n,setZoom:l,rotation:o,setRotation:c,imageDataUrl:m,getCroppedImageDataUrl:v,clearImage:p}}(0),o=N.h.users.setAvatar.useMutation({trpc:{context:{skipBatch:!0}},onSuccess:()=>{s&&s()}});async function c(){var e,a,r,s;let i="image/jpeg",n=await l.getCroppedImageDataUrl({format:"dataUrl",mimeType:i});await y.ZP.promise(o.mutateAsync({image:{data:n.replace(/^.*;base64,/,""),name:null===(e=l.imageFile)||void 0===e?void 0:e.name,type:i}}),{error:'Uploading "'.concat((null===(a=l.imageFile)||void 0===a?void 0:a.name)||"",'" failed'),loading:'Uploading "'.concat((null===(r=l.imageFile)||void 0===r?void 0:r.name)||"",'"...'),success:'"'.concat((null===(s=l.imageFile)||void 0===s?void 0:s.name)||"",'" uploaded')}),l.clearImage(),t()}return(0,r.jsx)(n.Z,{show:a,title:"Upload your avatar",onClose:t,modalClassName:"max-w-2xl",children:e=>{let{onClose:a}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f,{...l,circularCrop:!0,aspectRatio:1}),(0,r.jsxs)(j.q,{className:"mt-8",children:[(0,r.jsx)(b.zx,{className:"",onClick:c,disabled:!l.imageDataUrl,children:"Update Avatar"}),(0,r.jsx)(b.zx,{variant:"outline",onClick:()=>{l.clearImage(),a()},children:"Cancel"})]})]})}})}var k=t(87536),C=t(70544),S=t(47417),P=t(50867),T=t(49361),z=t(725),E=t(52586),F=t(67573),U=t(87517);function D(e){return(0,r.jsx)("div",{className:"relative max-h-[calc(80vh-10rem)] space-y-4 overflow-auto pb-8",children:e.children})}
1function A(e){let{register:a,handleSubmit:t,watch:s,control:i,formState:{errors:n,isSubmitting:l}}=(0,k.cI)({defaultValues:{biography:"",jobTitle:"",school:"",...e.profileData}}),o=N.h.users.setProfile.useMutation({onSuccess:()=>{e.onSave()}}),{fields:c,append:d,remove:u,move:m}=(0,k.Dq)({control:i,name:"experience"}),h=s("biography"),x=t(async e=>{try{await y.ZP.promise(o.mutateAsync({biography:e.biography,jobTitle:e.jobTitle,school:e.school,experiences:(e.experience||[]).map((e,a)=>({id:e.id,title:e.title,description:e.description,orderNumber:a}))}),{error:"Error",success:"Profile saved",loading:"Saving profile..."})}catch(e){}});return(0,r.jsxs)("form",{onSubmit:x,children:[(0,r.jsxs)(D,{children:[(0,r.jsxs)("fieldset",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,r.jsx)(C._,{htmlFor:"biography",required:!0,children:"Biography"}),(0,r.jsx)(T.f,{length:null==h?void 0:h.length,maxLength:1e3})]}),(0,r.jsx)(S.B,{id:"biography",name:"biography",rules:{required:{value:!0,message:"Biography is required"},maxLength:{value:1e3,message:"Biography should not exceed 1000 characters"}},errors:n,register:a,rows:8})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2 lg:gap-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(C._,{className:"mb-2",htmlFor:"jobTitle",required:!0,children:"Job Title"}),(0,r.jsx)(P.y,{id:"jobTitle",name:"jobTitle",rules:{required:{value:!0,message:"Job title is required"},maxLength:{value:100,message:"Job title should not exceed 100 characters"}},errors:n,register:a})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(C._,{className:"mb-2",htmlFor:"school",required:!0,children:"School"}),(0,r.jsx)(P.y,{id:"school",name:"school",rules:{required:{value:!0,message:"School is required"},maxLength:{value:100,message:"School should not exceed 100 characters"}},errors:n,register:a})]}),e.isOwnProfile&&(0,r.jsxs)("div",{children:[(0,r.jsx)(C._,{className:"mb-2",htmlFor:"school",children:"E-mail"}),(0,r.jsx)(P.y,{id:"email",name:"email",disabled:!0,errors:n,register:a})]})]})]}),(0,r.jsxs)("fieldset",{children:[(0,r.jsx)("legend",{className:"mb-2 block text-h3 font-black",children:"Experience"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("ol",{className:"ml-5 list-outside list-decimal marker:font-black",children:c.map((e,a)=>(0,r.jsxs)("li",{className:"mb-4 space-y-2",children:[(0,r.jsx)("div",{children:(0,r.jsx)(k.Qr,{render:e=>{var a;let{field:t,fieldState:s}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C._,{className:"mb-1",htmlFor:t.name,required:!0,children:"Title"}),(0,r.jsx)(F.I,{...t,id:t.name,error:s.invalid}),s.invalid&&(0,r.jsx)(E.J,{className:"mt-1",children:null===(a=s.error)||void 0===a?void 0:a.message})]})},rules:{required:{value:!0,message:"Title is required"},maxLength:{value:100,message:"Title should not exceed 100 characters"}},name:"experience.".concat(a,".title"),control:i})}),(0,r.jsx)("div",{children:(0,r.jsx)(k.Qr,{render:e=>{var a;let{field:t,fieldState:s}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C._,{className:"mb-1",htmlFor:t.name,required:!0,children:"Description"}),(0,r.jsx)(z.K,{...t,id:t.name,rows:5,error:s.invalid}),s.invalid&&(0,r.jsx)(E.J,{className:"mt-1",children:null===(a=s.error)||void 0===a?void 0:a.message})]})},rules:{required:{value:!0,message:"Description is required"},maxLength:{value:1e3,message:"Description should not exceed 1000 characters"}},name:"experience.".concat(a,".description"),control:i})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(U.Z,{title:"Delete?",body:"Are you sure you want to delete this experience?",confirmButtonText:"Delete",onConfirmClick:()=>u(a),children:e=>{let{open:a,handleOpen:t}=e;return(0,r.jsx)(b.zx,{variant:"outline",size:"sm",type:"button",onClick:t,disabled:a,children:"Delete"})}}),(0,r.jsx)(b.zx,{variant:"outline",size:"sm",type:"button",disabled:0===a,onClick:()=>m(a,a-1),children:"Move up"}),(0,r.jsx)(b.zx,{variant:"outline",size:"sm",type:"button",disabled:a===c.length-1,onClick:()=>m(a,a+1),children:"Move down"})]})]},e.id))}),(0,r.jsx)(b.zx,{type:"button",variant:"outline",size:"sm",onClick:()=>d({id:crypto.randomUUID(),title:"",description:""}),children:"Add experience"})]})]})]}),(0,r.jsxs)(j.q,{children:[(0,r.jsx)(b.zx,{variant:"solid",submit:!0,disabled:l,children:"Save"}),(0,r.jsx)(b.zx,{variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}var _=t(60925);function q(e){let{avatarUrl:a,onDeleteClick:t,onUploadClick:s,canEdit:i=!1}=e;return(0,r.jsx)(_.Q,{type:"image",thumbnailUrl:null!=a?a:void 0,canEdit:i,onUploadClick:s,onDeleteClick:t})}var I=t(42255),Z=t(17376),L=()=>{let[e,a]=(0,i.useState)(!1),t=async e=>{if(!navigator.share)throw Error("Web Share API not supported");try{await navigator.share(e)}catch(e){console.error("Error sharing:",e)}};return(0,i.useEffect)(()=>{var e;void 0!==(null===(e=navigator)||void 0===e?void 0:e.share)&&a(!0)},[]),{isSupported:e,share:t}},M=t(38498),B=t(19568),O=t(11163),J=t(47100);function R(e){var a;let{profile:t,onSubmitSuccess:s,show:i,onClose:l}=e,o=N.h.users.setNickname.useMutation(),{register:c,handleSubmit:d,watch:u,formState:{isSubmitting:m,errors:h,isDirty:x}}=(0,k.cI)({defaultValues:{nickname:t.nickname}}),p=d(async e=>{if(t.id)try{await y.ZP.promise(o.mutateAsync({userId:t.id,nickname:e.nickname}),{loading:"Updating nickname...",success:"Nickname updated",error:a=>{var t;return(0,N.x)(a)&&(null===(t=a.shape)||void 0===t?void 0:t.type)==="UserNicknameAlreadyExistsException"?'The nickname, "'.concat(e.nickname,'" already exists'):"Failed to update nickname"}}),s()}catch(e){}}),v=u("nickname");return(0,r.jsxs)(n.Z,{show:i,title:"Update your nickname",modalClassName:"max-w-sm",children:[(0,r.jsx)("p",{className:"mb-4",children:"Your nickname is visible to other users and must be unique. Nicknames must be between 3 and 35 characters long and can only contain letters, numbers, dots, hyphens and underscores."}),(0,r.jsx)("form",{onSubmit:p,children:(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-2",children:[(0,r.jsx)(C._,{htmlFor:"nickname",children:"Nickname"}),(0,r.jsx)(T.f,{maxLength:35,length:null!==(a=null==v?void 0:v.length)&&void 0!==a?a:0})]}),(0,r.jsx)(P.y,{autoComplete:"username",type:"text",id:"nickname",name:"nickname",register:c,rules:{required:"Nickname is required",minLength:{value:3,message:"Nickname must be at least 3 characters long"},maxLength:{value:35,message:"Nickname must be at most 35 characters long"},pattern:{value:/^[a-zA-Z0-9_\-.]+$/,message:"Nickname can only contain letters, numbers, dots, hyphens and underscores"},validate:{noDoubleSpecialChars:e=>!/[._\-]{2,}/.test(e)||"Nickname cannot contain consecutive special characters"}},errors:h}),(0,r.jsxs)(j.q,{className:"mt-8",children:[(0,r.jsx)(b.zx,{submit:!0,loader:m,disabled:m||!x,children:"Update nickname"}),(0,r.jsx)(b.zx,{variant:"outline",loader:m,disabled:m,onClick:()=>{l()},children:"Cancel"})]})]})})]})}function V(e){var a,t;let{profile:s,canEdit:n,onUploadImageClick:l,onDeleteImageClick:o,onEditClick:c}=e,d=(0,O.useRouter)(),u=L(),[m,h]=i.useState(!1),x=N.h.useContext(),p=N.h.users.addContact.useMutation({onSuccess:()=>{void 0!==s.id&&x.users.getProfile.refetch({userId:s.id})}}),v=N.h.talkJs.createOneToOneConversation.useMutation({onError:()=>{},onSuccess:e=>{d.push("/chat/messages/".concat((null==e?void 0:e.conversationId)||""))}});async function g(){if(!u.isSupported||!s.id)return;let e=new URL(window.location.href);e.pathname="/user/".concat(s.id);try{var a;await u.share({title:"Profile",text:"Check out the EuHU profile for ".concat(null!==(a=s.name)&&void 0!==a?a:"Unknown","!"),url:e.href})}catch(e){}}let f=async()=>{void 0!==s.id&&await y.ZP.promise(p.mutateAsync({contactId:s.id}),{error:"Failed to send contact request",loading:"Sending contact request...",success:"Contact request sent"})};async function j(){void 0!==s.id&&await v.mutateAsync({recipientUserId:s.id})}let w=null===(a=s.mutualContact)||void 0===a?void 0:a.status,k=w!==J.P.Accepted&&!n,C=(w===J.P.Pending||w===J.P.Requested)&&!n,S=w===J.P.Accepted&&!n,P=N.h.talkJs.getUsersPresence.useQuery({userIds:[s.id||""]}
1,{retry:!1,refetchOnWindowFocus:!0});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(B.m,{title:s.name,thumbnailArea:(0,r.jsx)(q,{canEdit:n,avatarUrl:null===(t=s.avatar)||void 0===t?void 0:t.url,onUploadClick:l,onDeleteClick:o}),titleArea:s.school||s.jobTitle||!P.isLoading?(0,r.jsxs)("dl",{className:"grid grid-cols-1 gap-x-10 gap-y-1 sm:grid-cols-2 sm:gap-y-1",children:[s.jobTitle&&(0,r.jsxs)("div",{className:"col-span-1 flex gap-2",children:[(0,r.jsx)("dt",{className:"font-black",children:"Job Title:"})," ",(0,r.jsx)("dd",{children:s.jobTitle})]}),s.school&&(0,r.jsxs)("div",{className:"col-span-1 flex gap-2",children:[(0,r.jsx)("dt",{className:"font-black",children:"School:"})," ",(0,r.jsx)("dd",{children:s.school})]}),(0,r.jsxs)("div",{className:"col-span-1 flex gap-2",children:[(0,r.jsx)("dt",{className:"font-black",children:"Status:"})," ",(0,r.jsx)("dd",{children:(()=>{var e,a;if(!P||P.isLoading||void 0===s.id)return"N/A";let t=null===(a=P.data)||void 0===a?void 0:null===(e=a.userOnlineStatuses)||void 0===e?void 0:e[s.id];return"boolean"==typeof t?t?"Online":"Offline":"N/A"})()})]}),(0,r.jsxs)("div",{className:"col-span-1 flex gap-2",children:[(0,r.jsx)("dt",{className:"font-black",children:"Nickname:"})," ",(0,r.jsxs)("dd",{children:[s.nickname," ",n&&(0,r.jsx)(b.zx,{variant:"outline",size:"custom",className:"ml-1 px-1 py-0.5 text-xs",onClick:()=>h(!0),children:s.nickname?"Change":"Add"})]})]})]}):void 0,actionArea:(0,r.jsxs)(r.Fragment,{children:[c&&n&&(0,r.jsx)(M.u,{title:"Edit profile",children:(0,r.jsx)(I.hU,{variant:"header",size:"md",onClick:c,children:(0,r.jsx)(Z.dY,{className:"h-6 w-6"})})}),k&&(0,r.jsx)(M.u,{title:"Add to contacts",children:(0,r.jsx)(I.hU,{disabled:p.isLoading||C,variant:"header",size:"md",onClick:f,children:(0,r.jsx)(Z.Gc,{className:"h-6 w-6"})})}),S&&(0,r.jsx)(M.u,{title:"Start a chat",children:(0,r.jsx)(I.hU,{variant:"header",size:"md",onClick:j,children:(0,r.jsx)(Z.kB,{className:"h-6 w-6"})})}),u.isSupported&&(0,r.jsx)(M.u,{title:"Share",children:(0,r.jsx)(I.hU,{variant:"header",size:"md",onClick:g,children:(0,r.jsx)(Z.aA,{className:"h-6 w-6"})})})]})}),(0,r.jsx)(R,{show:m,onSubmitSuccess:()=>{h(!1),x.users.getProfile.refetch()},onClose:()=>h(!1),profile:s})]})}var Q=t(35800),X=t(77783),G=t(33299),W=!0;function K(e){var a,t,d,u,m,h,x,p,v,g,f;let{canEdit:j,userId:b,profile:k}=e,C=(0,G.useSession)(),S=(0,Q.useErrorHandler)(),[P,T]=(0,i.useState)(!1),[z,E]=(0,i.useState)(!1),F=N.h.users.getProfile.useQuery({userId:b},{initialData:k,enabled:!0,retry:!1,onError:e=>{var a,t;return S(new X.FZ(null===(a=e.data)||void 0===a?void 0:a.httpStatus,null===(t=e.shape)||void 0===t?void 0:t.type))}}),U=N.h.users.deleteAvatar.useMutation({onSuccess:()=>{F.refetch(),C.update()}});async function D(){await y.ZP.promise(U.mutateAsync(),{error:"Deletion of avatar failed",loading:"Deleting avatar...",success:"Avatar deleted"})}return(0,r.jsxs)("main",{children:[(0,r.jsx)(s.PB,{title:"".concat(null!==(f=null==F?void 0:null===(a=F.data)||void 0===a?void 0:a.name)&&void 0!==f?f:"Unknown","'s Profile")}),(0,r.jsx)(V,{canEdit:j,profile:(null==F?void 0:F.data)||{},onEditClick:()=>{E(!0)},onUploadImageClick:()=>{T(!0)},onDeleteImageClick:()=>{D()}}),(0,r.jsx)(w,{show:P,onClose:()=>T(!1),onUploadSuccess:()=>{F.refetch(),C.update()}}),(0,r.jsx)(n.Z,{modalClassName:"max-w-4xl",show:z,title:"Edit Profile",onClose:()=>{E(!1)},children:(0,r.jsx)(A,{isOwnProfile:F.data.isOwnProfile,profileData:{biography:null===(t=F.data)||void 0===t?void 0:t.biography,jobTitle:null===(d=F.data)||void 0===d?void 0:d.jobTitle,school:null===(u=F.data)||void 0===u?void 0:u.school,email:F.data.email,experience:((null===(m=F.data)||void 0===m?void 0:m.experiences)||[]).map(e=>({id:e.id||"",title:e.title||"",description:e.description||""}))},onCancel:()=>{E(!1)},onSave:()=>{F.refetch(),E(!1)}})}),(0,r.jsxs)(l.s,{disablePadding:!0,variant:"bordered",className:"mb-10 overflow-hidden",children:[(0,r.jsx)(c.Z,{tag:"h2",size:"h3",className:"bg-teal px-8 py-4 text-white",children:"Overview"}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-10 p-8",children:[(0,r.jsxs)("div",{className:"col-span-2 lg:col-span-1",children:[(0,r.jsx)(c.Z,{size:"p",tag:"h3",className:"mb-0",children:"Biography"}),(null===(h=F.data)||void 0===h?void 0:h.biography)?(0,r.jsx)("div",{className:"space-y-10",children:(0,r.jsx)(o,{children:F.data.biography})}):(0,r.jsx)("p",{children:"Biography is not available"})]}),(0,r.jsxs)("div",{className:"col-span-2 grid grid-cols-2 content-start gap-x-10 gap-y-10 lg:col-span-1",children:[(0,r.jsxs)("div",{className:"col-span-2 sm:col-span-1",children:[(0,r.jsx)(c.Z,{size:"p",tag:"h3",className:"mb-0",children:"Job Title"}),(null===(x=F.data)||void 0===x?void 0:x.jobTitle)?(0,r.jsx)("p",{children:F.data.jobTitle}):(0,r.jsx)("p",{children:"Job Title is not available"})]}),(0,r.jsxs)("div",{className:"col-span-2 sm:col-span-1",children:[(0,r.jsx)(c.Z,{size:"p",tag:"h3",className:"mb-0",children:"School"}),(null===(p=F.data)||void 0===p?void 0:p.school)?(0,r.jsx)("p",{children:F.data.school}):(0,r.jsx)("p",{children:"School is not available"})]})]})]})]}),((null===(v=F.data)||void 0===v?void 0:v.experiences)||[]).length>0&&(0,r.jsxs)(l.s,{disablePadding:!0,variant:"bordered",className:"mb-10 overflow-hidden",children:[(0,r.jsx)(c.Z,{tag:"h2",size:"h3",className:"bg-teal px-8 py-4 text-white",children:"Experience"}),(0,r.jsx)("div",{className:"space-y-8 p-8",children:((null===(g=F.data)||void 0===g?void 0:g.experiences)||[]).map(e=>(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)(c.Z,{size:"p",tag:"h3",children:e.title}),e.description&&(0,r.jsx)(o,{children:e.description})]},e.id))})]})]})}}},function(e){e.O(0,[9087,2946,2888,9774,179],function(){return e(e.s=65026)}),_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.