@ozdao/prometheus-framework 0.1.28 → 0.1.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=require("./index-7ecbf72a.js"),p=require("./MenuItem-1216a99f.js"),b=require("./ButtonFollow-7c0180b3.js"),x=require("./Socials-821bd677.js"),w=require("./_plugin-vue_export-helper-f246444f.js"),k=require("./IconEdit-4cfe2115.js"),v=require("vue-router"),c=require("./auth-2f9b2dfc.js");require("./inputs.validation-24ae76b9.js");const m=require("./Button-ee08e6bf.js"),$=require("./UploadImage-33f6a9f4.js");require("./states.validation-92231934.js");const P=require("./auth.validation-30bb0efd.js");require("./globals-928eb13c.js");require("vue-i18n");const M={class:"w-100 mn-semi radius-medium pd-medium bg-main t-black"},N={__name:"ProfileCompletion",props:{user:Object,target:Object,cta:Boolean},setup(o){const{user:t,cta:d,target:f}=o,C=e.ref(0),n=_=>{let l=0,i=0;function u(s){for(let a in s)s.hasOwnProperty(a)&&(s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])?u(s[a]):(l++,s[a]!=null&&s[a]!==""&&i++))}return u(_),l===0?0:Math.round(i/l*100)};return f&&(C.value=n(f)),(_,l)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",M,[e.createElementVNode("h3",null," Profile completed at "+e.toDisplayString(C.value)+"% ",1),o.cta?(e.openBlock(),e.createBlock(i,{key:0,to:{name:"User Edit Profile",params:{_id:o.user}},class:"mn-t-regular t-black bg-white w-100 button"},{default:e.withCtx(()=>[e.createTextVNode(" Fill Profile ")]),_:1},8,["to"])):e.createCommentVNode("",!0)])}}},U={},H={width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},S=e.createElementVNode("path",{d:"M12 66V32H68V66C68 69.25 65.25 72 62 72H18C14.75 72 12 69.25 12 66ZM52 42V46C52 47.125 52.875 48 54 48H58C59.125 48 60 47.125 60 46V42C60 40.875 59.125 40 58 40H54C52.875 40 52 40.875 52 42ZM52 58V62C52 63.125 52.875 64 54 64H58C59.125 64 60 63.125 60 62V58C60 56.875 59.125 56 58 56H54C52.875 56 52 56.875 52 58ZM36 42V46C36 47.125 36.875 48 38 48H42C43.125 48 44 47.125 44 46V42C44 40.875 43.125 40 42 40H38C36.875 40 36 40.875 36 42ZM36 58V62C36 63.125 36.875 64 38 64H42C43.125 64 44 63.125 44 62V58C44 56.875 43.125 56 42 56H38C36.875 56 36 56.875 36 58ZM20 42V46C20 47.125 20.875 48 22 48H26C27.125 48 28 47.125 28 46V42C28 40.875 27.125 40 26 40H22C20.875 40 20 40.875 20 42ZM20 58V62C20 63.125 20.875 64 22 64H26C27.125 64 28 63.125 28 62V58C28 56.875 27.125 56 26 56H22C20.875 56 20 56.875 20 58ZM62 16C65.25 16 68 18.75 68 22V28H12V22C12 18.75 14.75 16 18 16H24V10C24 8.875 24.875 8 26 8H30C31.125 8 32 8.875 32 10V16H48V10C48 8.875 48.875 8 50 8H54C55.125 8 56 8.875 56 10V16H62Z",fill:"white"},null,-1),Z=[S];function q(o,t){return e.openBlock(),e.createElementBlock("svg",H,Z)}const I=w._export_sfc(U,[["render",q]]),O={},R={width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},F=e.createElementVNode("path",{d:"M9 19C9 17.1435 9.7375 15.363 11.0503 14.0503C12.363 12.7375 14.1435 12 16 12C17.8565 12 19.637 12.7375 20.9497 14.0503C22.2625 15.363 23 17.1435 23 19C23 20.8565 22.2625 22.637 20.9497 23.9497C19.637 25.2625 17.8565 26 16 26C14.1435 26 12.363 25.2625 11.0503 23.9497C9.7375 22.637 9 20.8565 9 19ZM8 38.7125C6.75 40.1125 6 41.975 6 44C6 46.025 6.75 47.8875 8 49.2875V38.7125ZM26.05 32.55C22.3375 35.8375 20 40.65 20 46C20 50.2875 21.5 54.225 24 57.3125V60C24 62.2125 22.2125 64 20 64H12C9.7875 64 8 62.2125 8 60V56.65C3.275 54.4 0 49.5875 0 44C0 36.2625 6.2625 30 14 30H18C21 30 23.775 30.9375 26.05 32.5375V32.55ZM56 60V57.3125C58.5 54.225 60 50.2875 60 46C60 40.65 57.6625 35.8375 53.95 32.5375C56.225 30.9375 59 30 62 30H66C73.7375 30 80 36.2625 80 44C80 49.5875 76.725 54.4 72 56.65V60C72 62.2125 70.2125 64 68 64H60C57.7875 64 56 62.2125 56 60ZM57 19C57 17.1435 57.7375 15.363 59.0503 14.0503C60.363 12.7375 62.1435 12 64 12C65.8565 12 67.637 12.7375 68.9497 14.0503C70.2625 15.363 71 17.1435 71 19C71 20.8565 70.2625 22.637 68.9497 23.9497C67.637 25.2625 65.8565 26 64 26C62.1435 26 60.363 25.2625 59.0503 23.9497C57.7375 22.637 57 20.8565 57 19ZM72 38.7125V49.3C73.25 47.8875 74 46.0375 74 44.0125C74 41.9875 73.25 40.125 72 38.725V38.7125ZM40 12C42.1217 12 44.1566 12.8429 45.6569 14.3431C47.1571 15.8434 48 17.8783 48 20C48 22.1217 47.1571 24.1566 45.6569 25.6569C44.1566 27.1571 42.1217 28 40 28C37.8783 28 35.8434 27.1571 34.3431 25.6569C32.8429 24.1566 32 22.1217 32 20C32 17.8783 32.8429 15.8434 34.3431 14.3431C35.8434 12.8429 37.8783 12 40 12ZM30 46C30 48.025 30.75 49.875 32 51.2875V40.7125C30.75 42.125 30 43.975 30 46ZM48 40.7125V51.3C49.25 49.8875 50 48.0375 50 46.0125C50 43.9875 49.25 42.125 48 40.725V40.7125ZM56 46C56 51.5875 52.725 56.4 48 58.65V64C48 66.2125 46.2125 68 44 68H36C33.7875 68 32 66.2125 32 64V58.65C27.275 56.4 24 51.5875 24 46C24 38.2625 30.2625 32 38 32H42C49.7375 32 56 38.2625 56 46Z",fill:"white"},null,-1),L=[F];function z(o,t){return e.openBlock(),e.createElementBlock("svg",R,L)}const D=w._export_sfc(O,[["render",z]]),A={},T={width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg"},j=e.createElementVNode("path",{d:"M28.2899 50C24.4282 50.007 20.6332 48.9927 17.2899 47.06L12.5299 49.17C11.6317 49.567 10.6307 49.6695 9.67068 49.4627C8.71061 49.2558 7.84068 48.7503 7.1856 48.0186C6.53051 47.2869 6.12391 46.3666 6.02409 45.3896C5.92426 44.4126 6.13634 43.4291 6.62991 42.58L8.96991 38.58C6.65145 34.3531 5.78562 29.4816 6.50556 24.7147C7.22549 19.9478 9.49132 15.5493 12.9546 12.1956C16.418 8.84187 20.887 6.71863 25.6747 6.15233C30.4623 5.58604 35.3034 6.60805 39.4536 9.06121C43.6037 11.5144 46.8332 15.2629 48.6454 19.7303C50.4576 24.1977 50.7522 29.1367 49.4839 33.7879C48.2155 38.4391 45.4545 42.5448 41.6254 45.4739C37.7962 48.403 33.1109 49.9932 28.2899 50ZM17.4799 42.81C17.8631 42.811 18.238 42.9221 18.5599 43.13C22.2995 45.5441 26.7982 46.4939 31.1945 45.7975C35.5908 45.1011 39.5757 42.8075 42.3861 39.3558C45.1966 35.9041 46.6349 31.537 46.4258 27.0908C46.2167 22.6446 44.3748 18.4318 41.2529 15.2591C38.1309 12.0864 33.9483 10.1769 29.5061 9.89616C25.0638 9.61544 20.6741 10.9833 17.1776 13.7377C13.6811 16.4921 11.3235 20.4396 10.5563 24.8241C9.78918 29.2086 10.6664 33.722 13.0199 37.5C13.2068 37.8111 13.3055 38.1671 13.3055 38.53C13.3055 38.8929 13.2068 39.2489 13.0199 39.56L10.0899 44.56C10.0202 44.6791 9.99023 44.8174 10.0043 44.9547C10.0184 45.0919 10.0759 45.2212 10.1683 45.3237C10.2608 45.4262 10.3834 45.4966 10.5186 45.5247C10.6537 45.5528 10.7943 45.5371 10.9199 45.48L16.6699 43C16.9236 42.8806 17.1996 42.8159 17.4799 42.81Z",fill:"white"},null,-1),G=e.createElementVNode("path",{d:"M28.2898 30C27.7594 30 27.2507 29.7893 26.8756 29.4142C26.5005 29.0391 26.2898 28.5304 26.2898 28C26.2898 27.4696 26.5005 26.9609 26.8756 26.5858C27.2507 26.2107 27.7594 26 28.2898 26C28.8202 26 29.3289 26.2107 29.704 26.5858C30.0791 26.9609 30.2898 27.4696 30.2898 28C30.2898 28.5304 30.0791 29.0391 29.704 29.4142C29.3289 29.7893 28.8202 30 28.2898 30Z",fill:"white"},null,-1),Y=e.createElementVNode("path",{d:"M20.2898 30C19.7594 30 19.2507 29.7893 18.8756 29.4142C18.5005 29.0391 18.2898 28.5304 18.2898 28C18.2898 27.4696 18.5005 26.9609 18.8756 26.5858C19.2507 26.2107 19.7594 26 20.2898 26C20.8202 26 21.3289 26.2107 21.704 26.5858C22.0791 26.9609 22.2898 27.4696 22.2898 28C22.2898 28.5304 22.0791 29.0391 21.704 29.4142C21.3289 29.7893 20.8202 30 20.2898 30Z",fill:"white"},null,-1),J=e.createElementVNode("path",{d:"M36.2898 30C35.7594 30 35.2507 29.7893 34.8756 29.4142C34.5005 29.0391 34.2898 28.5304 34.2898 28C34.2898 27.4696 34.5005 26.9609 34.8756 26.5858C35.2507 26.2107 35.7594 26 36.2898 26C36.8202 26 37.3289 26.2107 37.704 26.5858C38.0791 26.9609 38.2898 27.4696 38.2898 28C38.2898 28.5304 38.0791 29.0391 37.704 29.4142C37.3289 29.7893 36.8202 30 36.2898 30Z",fill:"white"},null,-1),K=[j,G,Y,J];function Q(o,t){return e.openBlock(),e.createElementBlock("svg",T,K)}const W=w._export_sfc(A,[["render",Q]]),V=B.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),r=e.reactive({all:[],current:{_id:"",username:"",email:"",phone:"",status:"",profile:{name:"",photo:"",description:"",birthday:""},socials:{facebook:"",twitter:"",instagram:"",telegram:""},roles:[]}}),g={async create(o){try{const t=await V.post("/api/users",o);return h.set(t.data,"current"),Promise.resolve(t.data)}catch(t){return console.error(t),Promise.reject(t)}},async read(o={}){o.params={},o._id&&(o.params._id=o._id),o.user&&(o.params.user=o.user);try{const t=await V.get("/api/users",{params:o.params});return o._id?h.set(t.data[0],"current"):h.set(t.data,"all"),Promise.resolve(t.data)}catch(t){return console.error(t),Promise.reject(t)}},async update(o){try{const t=await V.put(`/api/users/${o._id}`,o);return h.set(t.data,"current"),Promise.resolve(t.data)}catch(t){return console.error(t),Promise.reject(t)}},async delete(o){try{await V.delete(`/api/users/${o._id}`);const t=r.all.findIndex(d=>d._id===o._id);t!==-1&&r.all.splice(t,1)}catch(t){console.error(t)}}},h={set(o,t){r[t]=o},clean(){r.current={phone:"",name:"",surname:"",birthday:"",city:"",address:"",roles:[],orders:[]}}},X=Object.freeze(Object.defineProperty({__proto__:null,actions:g,mutations:h,state:r},Symbol.toStringTag,{value:"Module"}));const ee={class:"for-transition w-100"},te={key:0,class:"flex-center flex pd-medium radius-big bg-grey uppercase t-semi w-100 h-100"},re={key:1,_id:"dash",class:"pd-b-extra pd-thin w-100"},se={class:"flex-center flex flex-column t-center w-100 mn-semi radius-medium pd-medium bg-grey"},oe=["src"],ae={class:"mn-thin"},ne={class:"mn-thin t-main t-semi"},le={class:"mn-small p-medium"},ie={class:"mn-medium flex-center flex-nowrap flex"},ce={class:"t-semi mn-small"},de={key:4,class:"mn-t-small mn-thin"},ue=e.createElementVNode("span",null," Backoffice ",-1),me=e.createElementVNode("span",null,"Events",-1),pe=e.createElementVNode("span",null,"Groups",-1),_e=e.createElementVNode("span",null,"Posts",-1),fe=e.createElementVNode("span",null," Settings ",-1),Ce=e.createElementVNode("span",null," About ",-1),he=e.createElementVNode("span",{class:"t-red"}," Logout ",-1),y={__name:"Profile",setup(o){const t=v.useRoute(),d=v.useRouter(),f=e.ref(!1);e.onMounted(async()=>{await g.read({_id:t.params._id,user:c.state.user._id}),f.value=!0});const C=({membership:_,isMember:l,targetId:i})=>{b.mutations.handleMembershipUpdate(r.current,_,l,i)};function n(){c.actions.logout(),d.push({name:"Sign In"})}return(_,l)=>(e.openBlock(),e.createElementBlock("div",ee,[r.current.status==="removed"?(e.openBlock(),e.createElementBlock("div",te," Sorry, user has been removed. ")):(e.openBlock(),e.createElementBlock("div",re,[e.unref(t).params._id===c.state.user._id&&f.value?(e.openBlock(),e.createBlock(N,{key:0,user:c.state.user._id,target:r.current,cta:!0},null,8,["user","target"])):e.createCommentVNode("",!0),e.createElementVNode("section",se,[e.unref(t).params._id===c.state.user._id?(e.openBlock(),e.createBlock(k.IconEdit,{key:0,onClick:l[0]||(l[0]=i=>_.$router.push({name:"User Edit Profile",params:{_id:c.state.user._id}})),class:"pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):e.createCommentVNode("",!0),r.current.profile.photo.length>0?(e.openBlock(),e.createElementBlock("img",{key:1,src:(_.FILE_SERVER_URL||"")+r.current.profile.photo,class:"radius-extra bg-white mn-small object-fit-cover i-extra"},null,8,oe)):(e.openBlock(),e.createBlock(k.PlaceholderUserpic,{key:2,class:"radius-medium mn-small i-extra"})),e.createElementVNode("h3",ae,e.toDisplayString(r.current.profile.name?r.current.profile.name:"Not specified"),1),e.createElementVNode("p",ne," @"+e.toDisplayString(r.current.username?r.current.username:"Not specified"),1),e.createElementVNode("p",le,e.toDisplayString(r.current.profile.description?r.current.profile.description:"Not specified"),1),e.createElementVNode("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.current.roles,(i,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["pd-thin radius-small t-semi bg-white",{"mn-r-thin":u!==r.current.roles.length-1}])},e.toDisplayString(i.icon)+" "+e.toDisplayString(i.name),3))),256))]),e.createElementVNode("p",ce," 👨‍👨‍👧‍👧 "+e.toDisplayString(r.current.numberOfMemberships)+" followers ",1),c.state.user._id&&e.unref(t).params._id&&e.unref(t).params._id!==c.state.user._id?(e.openBlock(),e.createBlock(b.ButtonFollow,{key:3,type:"user",isMember:r.current.isMember,targetId:r.current._id,userId:c.state.user._id,class:"w-min mn-medium mn-r-auto mn-l-auto",onUpdateMembership:C},null,8,["isMember","targetId","userId"])):e.createCommentVNode("",!0),Object.values(r.current.socials).some(i=>i)?(e.openBlock(),e.createElementBlock("h4",de," Find Me in Socials ")):e.createCommentVNode("",!0),e.createVNode(x._sfc_main,{telegram:r.current.socials.telegram,facebook:r.current.socials.facebook,instagram:r.current.socials.instagram,twitter:r.current.socials.twitter,class:"mn-r-auto mn-l-auto"},null,8,["telegram","facebook","instagram","twitter"])]),c.state.user._id===e.unref(t).params._id&&(c.state.access.roles.includes("ROLE_MODERATOR")||c.state.access.roles.includes("ROLE_ADMIN"))?(e.openBlock(),e.createBlock(p._sfc_main,{key:1,class:"bg-black t-white"},{default:e.withCtx(()=>[e.createVNode(p._sfc_main$1,{onClick:l[1]||(l[1]=i=>e.unref(d).push({name:"Backoffice",params:{_id:e.unref(t).params._id}})),class:"cursor-pointer",theme:"white"},{default:e.withCtx(()=>[ue]),_:1})]),_:1})):e.createCommentVNode("",!0),e.createVNode(p._sfc_main,{class:"bg-grey"},{default:e.withCtx(()=>[e.createVNode(p._sfc_main$1,{onClick:l[2]||(l[2]=i=>e.unref(d).push({name:"User Events",params:{_id:e.unref(t).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(I,{class:"i-semi",icon:!0}),me]),_:1}),e.createVNode(p._sfc_main$1,{onClick:l[3]||(l[3]=i=>e.unref(d).push({name:"User Organizations",params:{_id:e.unref(t).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(D,{class:"i-semi",icon:!0}),pe]),_:1}),e.createVNode(p._sfc_main$1,{onClick:l[4]||(l[4]=i=>e.unref(d).push({name:"User Blogposts",params:{_id:e.unref(t).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(W,{class:"i-semi",icon:!0}),_e]),_:1})]),_:1}),c.state.user._id===e.unref(t).params._id?(e.openBlock(),e.createBlock(p._sfc_main,{key:2,class:"bg-grey"},{default:e.withCtx(()=>[e.createVNode(p._sfc_main$1,{onClick:l[5]||(l[5]=i=>e.unref(d).push({name:"User Edit Profile",params:{_id:e.unref(t).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[fe]),_:1}),e.createVNode(p._sfc_main$1,{onClick:l[6]||(l[6]=i=>e.unref(d).push({name:"Legal",params:{_id:e.unref(t).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[Ce]),_:1}),e.createVNode(p._sfc_main$1,{class:"cursor-pointer",onClick:l[7]||(l[7]=i=>n())},{default:e.withCtx(()=>[he]),_:1})]),_:1})):e.createCommentVNode("",!0)]))]))}},ge=Object.freeze(Object.defineProperty({__proto__:null,default:y},Symbol.toStringTag,{value:"Module"}));const Ve={class:"pd-medium for-transition w-100"},ve=e.createElementVNode("h3",{class:"mn-small"},"Username",-1),we=e.createElementVNode("p",{class:"mn-semi"},"Your username will be used for URL of profile like thecommunephuket/users/username",-1),be=e.createElementVNode("h3",{class:"mn-small"},"Profile",-1),ke={class:"mn-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},Ne=e.createElementVNode("h4",null,"Upload userpic",-1),ye=e.createElementVNode("h3",{class:"mn-small"},"Socials",-1),Ee=e.createElementVNode("p",{class:"mn-thin"},"Please provide only the username for social media profiles, without full links.",-1),Be=e.createElementVNode("h3",{class:"mn-small"},"Account",-1),E={__name:"ProfileEdit",async setup(o){let t,d;e.ref(null);const f=v.useRoute(),C=v.useRouter();[t,d]=e.withAsyncContext(()=>g.read({_id:c.state.user._id})),await t,d();const n=e.ref(r.current);async function _(){await g.update(r.current)}async function l(){window.confirm("Are you sure you want to delete your account? Restoration will be possible only with the help of an administrator.")&&(r.current.status="removed",await g.update(r.current),c.actions.logout())}function i(){C.replace({name:"User Profile",params:{_id:r.current._id}})}return(u,s)=>(e.openBlock(),e.createElementBlock("div",Ve,[e.unref(f).params._id===c.state.user._id?(e.openBlock(),e.createBlock(N,{key:0,user:c.state.user._id,target:n.value,cta:!1},null,8,["user","target"])):e.createCommentVNode("",!0),ve,e.createVNode(m.Field,{field:n.value.username,"onUpdate:field":s[0]||(s[0]=a=>n.value.username=a),label:"@",placeholder:"Not specified",class:"mn-thin w-100 bg-grey pd-medium radius-small",disabled:"true",validation:u.organizationName},null,8,["field","validation"]),we,be,e.createElementVNode("div",ke,[e.createVNode($._sfc_main,{photo:n.value.profile.photo,"onUpdate:photo":s[1]||(s[1]=a=>n.value.profile.photo=a),uploadPath:"users/"+n.value._id+"/avatars",class:"h-4r w-4r aspect-1x1 o-hidden bg-white mn-thin radius-extra"},null,8,["photo","uploadPath"]),Ne]),e.createVNode(m.Field,{field:n.value.profile.name,"onUpdate:field":s[2]||(s[2]=a=>n.value.profile.name=a),label:"Name",placeholder:"Not specified",class:"mn-thin bg-grey pd-medium radius-small",validation:u.organizationName},null,8,["field","validation"]),e.createVNode(m.Field,{field:n.value.profile.description,"onUpdate:field":s[3]||(s[3]=a=>n.value.profile.description=a),label:"Description",placeholder:"Not specified",class:"mn-semi bg-grey pd-medium radius-small",disabled:"true",validation:u.organizationName},null,8,["field","validation"]),ye,Ee,e.createVNode(m.Field,{field:n.value.socials.instagram,"onUpdate:field":s[4]||(s[4]=a=>n.value.socials.instagram=a),label:"Instagram",placeholder:"",class:"mn-thin bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(m.Field,{field:n.value.socials.twitter,"onUpdate:field":s[5]||(s[5]=a=>n.value.socials.twitter=a),label:"Twitter",placeholder:"",class:"mn-thin bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(m.Field,{field:n.value.socials.facebook,"onUpdate:field":s[6]||(s[6]=a=>n.value.socials.facebook=a),label:"Facebook",placeholder:"",class:"mn-thin bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(m.Field,{field:n.value.socials.telegram,"onUpdate:field":s[7]||(s[7]=a=>n.value.socials.telegram=a),label:"Telegram",placeholder:"",class:"mn-semi bg-grey pd-medium radius-small"},null,8,["field"]),Be,e.createVNode(m.Field,{field:n.value.phone,"onUpdate:field":s[8]||(s[8]=a=>n.value.phone=a),label:"Phone",placeholder:"Not specified",class:"mn-thin bg-grey pd-medium mn-thin radius-small",disabled:"true",validation:u.organizationName},null,8,["field","validation"]),e.createVNode(m.Field,{field:n.value.email,"onUpdate:field":s[9]||(s[9]=a=>n.value.email=a),label:"Email",placeholder:"Not specified",class:"mn-semi bg-grey pd-medium radius-small",disabled:!0,validation:u.organizationName},null,8,["field","validation"]),e.createVNode(m._sfc_main,{submit:_,callback:i,class:"mn-thin"},{default:e.withCtx(()=>[e.createTextVNode("Save")]),_:1}),e.createVNode(m._sfc_main,{submit:l,callback:u.a=()=>{e.unref(C).push({name:"Sign In"})},class:"mn-thin bg-red t-white"},{default:e.withCtx(()=>[e.createTextVNode("Delete Account")]),_:1},8,["callback"])]))}},xe=Object.freeze(Object.defineProperty({__proto__:null,default:E},Symbol.toStringTag,{value:"Module"})),$e=[{path:"profile/:_id",name:"User Profile",meta:{title:{en:"Profile",ru:"Профиль"}},component:()=>Promise.resolve().then(()=>ge)},{path:"profile/:_id/edit",name:"User Edit Profile",beforeEnter:[P.requiresAuth],meta:{title:{en:"Edit Profile",ru:"Редактировать Профиль"}},component:()=>Promise.resolve().then(()=>xe)},{path:"profile/:_id/blogposts",name:"User Blogposts",meta:{title:{en:"Posts",ru:"Посты"}},component:()=>Promise.resolve().then(()=>require("./ProfileBlogposts-f9312adf.js"))},{path:"profile/:_id/events",name:"User Events",meta:{title:{en:"Events",ru:"События"}},component:()=>Promise.resolve().then(()=>require("./ProfileEvents-996bce18.js"))},{path:"profile/:_id/organizations",name:"User Organizations",meta:{title:{en:"Groups",ru:"Группы"}},component:()=>Promise.resolve().then(()=>require("./ProfileOrganizations-769325c7.js"))}];exports.Profile=y;exports.ProfileEdit=E;exports.usersRoutes=$e;exports.usersStore=X;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=require("./index-7ecbf72a.js"),p=require("./MenuItem-1216a99f.js"),b=require("./ButtonFollow-7c0180b3.js"),x=require("./Socials-821bd677.js"),w=require("./_plugin-vue_export-helper-f246444f.js"),k=require("./IconEdit-4cfe2115.js"),v=require("vue-router"),c=require("./auth-2f9b2dfc.js");require("./inputs.validation-24ae76b9.js");const m=require("./Button-ee08e6bf.js"),$=require("./UploadImage-33f6a9f4.js");require("./states.validation-92231934.js");const P=require("./auth.validation-30bb0efd.js");require("./globals-928eb13c.js");require("vue-i18n");const M={class:"w-100 mn-semi radius-medium pd-medium bg-main t-black"},N={__name:"ProfileCompletion",props:{user:Object,target:Object,cta:Boolean},setup(o){const{user:t,cta:d,target:f}=o,C=e.ref(0),n=_=>{let l=0,i=0;function u(s){for(let a in s)s.hasOwnProperty(a)&&(s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])?u(s[a]):(l++,s[a]!=null&&s[a]!==""&&i++))}return u(_),l===0?0:Math.round(i/l*100)};return f&&(C.value=n(f)),(_,l)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",M,[e.createElementVNode("h3",null," Profile completed at "+e.toDisplayString(C.value)+"% ",1),o.cta?(e.openBlock(),e.createBlock(i,{key:0,to:{name:"User Edit Profile",params:{_id:o.user}},class:"mn-t-regular t-black bg-white w-100 button"},{default:e.withCtx(()=>[e.createTextVNode(" Fill Profile ")]),_:1},8,["to"])):e.createCommentVNode("",!0)])}}},U={},H={width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},S=e.createElementVNode("path",{d:"M12 66V32H68V66C68 69.25 65.25 72 62 72H18C14.75 72 12 69.25 12 66ZM52 42V46C52 47.125 52.875 48 54 48H58C59.125 48 60 47.125 60 46V42C60 40.875 59.125 40 58 40H54C52.875 40 52 40.875 52 42ZM52 58V62C52 63.125 52.875 64 54 64H58C59.125 64 60 63.125 60 62V58C60 56.875 59.125 56 58 56H54C52.875 56 52 56.875 52 58ZM36 42V46C36 47.125 36.875 48 38 48H42C43.125 48 44 47.125 44 46V42C44 40.875 43.125 40 42 40H38C36.875 40 36 40.875 36 42ZM36 58V62C36 63.125 36.875 64 38 64H42C43.125 64 44 63.125 44 62V58C44 56.875 43.125 56 42 56H38C36.875 56 36 56.875 36 58ZM20 42V46C20 47.125 20.875 48 22 48H26C27.125 48 28 47.125 28 46V42C28 40.875 27.125 40 26 40H22C20.875 40 20 40.875 20 42ZM20 58V62C20 63.125 20.875 64 22 64H26C27.125 64 28 63.125 28 62V58C28 56.875 27.125 56 26 56H22C20.875 56 20 56.875 20 58ZM62 16C65.25 16 68 18.75 68 22V28H12V22C12 18.75 14.75 16 18 16H24V10C24 8.875 24.875 8 26 8H30C31.125 8 32 8.875 32 10V16H48V10C48 8.875 48.875 8 50 8H54C55.125 8 56 8.875 56 10V16H62Z",fill:"white"},null,-1),Z=[S];function q(o,t){return e.openBlock(),e.createElementBlock("svg",H,Z)}const I=w._export_sfc(U,[["render",q]]),O={},R={width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},F=e.createElementVNode("path",{d:"M9 19C9 17.1435 9.7375 15.363 11.0503 14.0503C12.363 12.7375 14.1435 12 16 12C17.8565 12 19.637 12.7375 20.9497 14.0503C22.2625 15.363 23 17.1435 23 19C23 20.8565 22.2625 22.637 20.9497 23.9497C19.637 25.2625 17.8565 26 16 26C14.1435 26 12.363 25.2625 11.0503 23.9497C9.7375 22.637 9 20.8565 9 19ZM8 38.7125C6.75 40.1125 6 41.975 6 44C6 46.025 6.75 47.8875 8 49.2875V38.7125ZM26.05 32.55C22.3375 35.8375 20 40.65 20 46C20 50.2875 21.5 54.225 24 57.3125V60C24 62.2125 22.2125 64 20 64H12C9.7875 64 8 62.2125 8 60V56.65C3.275 54.4 0 49.5875 0 44C0 36.2625 6.2625 30 14 30H18C21 30 23.775 30.9375 26.05 32.5375V32.55ZM56 60V57.3125C58.5 54.225 60 50.2875 60 46C60 40.65 57.6625 35.8375 53.95 32.5375C56.225 30.9375 59 30 62 30H66C73.7375 30 80 36.2625 80 44C80 49.5875 76.725 54.4 72 56.65V60C72 62.2125 70.2125 64 68 64H60C57.7875 64 56 62.2125 56 60ZM57 19C57 17.1435 57.7375 15.363 59.0503 14.0503C60.363 12.7375 62.1435 12 64 12C65.8565 12 67.637 12.7375 68.9497 14.0503C70.2625 15.363 71 17.1435 71 19C71 20.8565 70.2625 22.637 68.9497 23.9497C67.637 25.2625 65.8565 26 64 26C62.1435 26 60.363 25.2625 59.0503 23.9497C57.7375 22.637 57 20.8565 57 19ZM72 38.7125V49.3C73.25 47.8875 74 46.0375 74 44.0125C74 41.9875 73.25 40.125 72 38.725V38.7125ZM40 12C42.1217 12 44.1566 12.8429 45.6569 14.3431C47.1571 15.8434 48 17.8783 48 20C48 22.1217 47.1571 24.1566 45.6569 25.6569C44.1566 27.1571 42.1217 28 40 28C37.8783 28 35.8434 27.1571 34.3431 25.6569C32.8429 24.1566 32 22.1217 32 20C32 17.8783 32.8429 15.8434 34.3431 14.3431C35.8434 12.8429 37.8783 12 40 12ZM30 46C30 48.025 30.75 49.875 32 51.2875V40.7125C30.75 42.125 30 43.975 30 46ZM48 40.7125V51.3C49.25 49.8875 50 48.0375 50 46.0125C50 43.9875 49.25 42.125 48 40.725V40.7125ZM56 46C56 51.5875 52.725 56.4 48 58.65V64C48 66.2125 46.2125 68 44 68H36C33.7875 68 32 66.2125 32 64V58.65C27.275 56.4 24 51.5875 24 46C24 38.2625 30.2625 32 38 32H42C49.7375 32 56 38.2625 56 46Z",fill:"white"},null,-1),L=[F];function z(o,t){return e.openBlock(),e.createElementBlock("svg",R,L)}const D=w._export_sfc(O,[["render",z]]),A={},T={width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg"},j=e.createElementVNode("path",{d:"M28.2899 50C24.4282 50.007 20.6332 48.9927 17.2899 47.06L12.5299 49.17C11.6317 49.567 10.6307 49.6695 9.67068 49.4627C8.71061 49.2558 7.84068 48.7503 7.1856 48.0186C6.53051 47.2869 6.12391 46.3666 6.02409 45.3896C5.92426 44.4126 6.13634 43.4291 6.62991 42.58L8.96991 38.58C6.65145 34.3531 5.78562 29.4816 6.50556 24.7147C7.22549 19.9478 9.49132 15.5493 12.9546 12.1956C16.418 8.84187 20.887 6.71863 25.6747 6.15233C30.4623 5.58604 35.3034 6.60805 39.4536 9.06121C43.6037 11.5144 46.8332 15.2629 48.6454 19.7303C50.4576 24.1977 50.7522 29.1367 49.4839 33.7879C48.2155 38.4391 45.4545 42.5448 41.6254 45.4739C37.7962 48.403 33.1109 49.9932 28.2899 50ZM17.4799 42.81C17.8631 42.811 18.238 42.9221 18.5599 43.13C22.2995 45.5441 26.7982 46.4939 31.1945 45.7975C35.5908 45.1011 39.5757 42.8075 42.3861 39.3558C45.1966 35.9041 46.6349 31.537 46.4258 27.0908C46.2167 22.6446 44.3748 18.4318 41.2529 15.2591C38.1309 12.0864 33.9483 10.1769 29.5061 9.89616C25.0638 9.61544 20.6741 10.9833 17.1776 13.7377C13.6811 16.4921 11.3235 20.4396 10.5563 24.8241C9.78918 29.2086 10.6664 33.722 13.0199 37.5C13.2068 37.8111 13.3055 38.1671 13.3055 38.53C13.3055 38.8929 13.2068 39.2489 13.0199 39.56L10.0899 44.56C10.0202 44.6791 9.99023 44.8174 10.0043 44.9547C10.0184 45.0919 10.0759 45.2212 10.1683 45.3237C10.2608 45.4262 10.3834 45.4966 10.5186 45.5247C10.6537 45.5528 10.7943 45.5371 10.9199 45.48L16.6699 43C16.9236 42.8806 17.1996 42.8159 17.4799 42.81Z",fill:"white"},null,-1),G=e.createElementVNode("path",{d:"M28.2898 30C27.7594 30 27.2507 29.7893 26.8756 29.4142C26.5005 29.0391 26.2898 28.5304 26.2898 28C26.2898 27.4696 26.5005 26.9609 26.8756 26.5858C27.2507 26.2107 27.7594 26 28.2898 26C28.8202 26 29.3289 26.2107 29.704 26.5858C30.0791 26.9609 30.2898 27.4696 30.2898 28C30.2898 28.5304 30.0791 29.0391 29.704 29.4142C29.3289 29.7893 28.8202 30 28.2898 30Z",fill:"white"},null,-1),Y=e.createElementVNode("path",{d:"M20.2898 30C19.7594 30 19.2507 29.7893 18.8756 29.4142C18.5005 29.0391 18.2898 28.5304 18.2898 28C18.2898 27.4696 18.5005 26.9609 18.8756 26.5858C19.2507 26.2107 19.7594 26 20.2898 26C20.8202 26 21.3289 26.2107 21.704 26.5858C22.0791 26.9609 22.2898 27.4696 22.2898 28C22.2898 28.5304 22.0791 29.0391 21.704 29.4142C21.3289 29.7893 20.8202 30 20.2898 30Z",fill:"white"},null,-1),J=e.createElementVNode("path",{d:"M36.2898 30C35.7594 30 35.2507 29.7893 34.8756 29.4142C34.5005 29.0391 34.2898 28.5304 34.2898 28C34.2898 27.4696 34.5005 26.9609 34.8756 26.5858C35.2507 26.2107 35.7594 26 36.2898 26C36.8202 26 37.3289 26.2107 37.704 26.5858C38.0791 26.9609 38.2898 27.4696 38.2898 28C38.2898 28.5304 38.0791 29.0391 37.704 29.4142C37.3289 29.7893 36.8202 30 36.2898 30Z",fill:"white"},null,-1),K=[j,G,Y,J];function Q(o,t){return e.openBlock(),e.createElementBlock("svg",T,K)}const W=w._export_sfc(A,[["render",Q]]),V=B.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),r=e.reactive({all:[],current:{_id:"",username:"",email:"",phone:"",status:"",profile:{name:"",photo:"",description:"",birthday:""},socials:{facebook:"",twitter:"",instagram:"",telegram:""},roles:[]}}),g={async create(o){try{const t=await V.post("/api/users",o);return h.set(t.data,"current"),Promise.resolve(t.data)}catch(t){return console.error(t),Promise.reject(t)}},async read(o={}){o.params={},o._id&&(o.params._id=o._id),o.user&&(o.params.user=o.user);try{const t=await V.get("/api/users",{params:o.params});return o._id?h.set(t.data[0],"current"):h.set(t.data,"all"),Promise.resolve(t.data)}catch(t){return console.error(t),Promise.reject(t)}},async update(o){try{const t=await V.put(`/api/users/${o._id}`,o);return h.set(t.data,"current"),Promise.resolve(t.data)}catch(t){return console.error(t),Promise.reject(t)}},async delete(o){try{await V.delete(`/api/users/${o._id}`);const t=r.all.findIndex(d=>d._id===o._id);t!==-1&&r.all.splice(t,1)}catch(t){console.error(t)}}},h={set(o,t){r[t]=o},clean(){r.current={phone:"",name:"",surname:"",birthday:"",city:"",address:"",roles:[],orders:[]}}},X=Object.freeze(Object.defineProperty({__proto__:null,actions:g,mutations:h,state:r},Symbol.toStringTag,{value:"Module"}));const ee={class:"for-transition w-100"},te={key:0,class:"flex-center flex pd-medium radius-big bg-grey uppercase t-semi w-100 h-100"},re={key:1,_id:"dash",class:"pd-b-extra pd-thin w-100"},se={class:"flex-center flex flex-column t-center w-100 mn-semi radius-medium pd-medium bg-grey"},oe=["src"],ae={class:"mn-thin"},ne={class:"mn-thin t-main t-semi"},le={class:"mn-small p-medium"},ie={class:"mn-medium flex-center flex-nowrap flex"},ce={class:"t-semi mn-small"},de={key:4,class:"mn-t-small mn-thin"},ue=e.createElementVNode("span",null," Backoffice ",-1),me=e.createElementVNode("span",null,"Events",-1),pe=e.createElementVNode("span",null,"Groups",-1),_e=e.createElementVNode("span",null,"Posts",-1),fe=e.createElementVNode("span",null," Settings ",-1),Ce=e.createElementVNode("span",null," About ",-1),he=e.createElementVNode("span",{class:"t-red"}," Logout ",-1),y={__name:"Profile",setup(o){const t=v.useRoute(),d=v.useRouter(),f=e.ref(!1);e.onMounted(async()=>{await g.read({_id:t.params._id,user:c.state.user._id}),f.value=!0});const C=({membership:_,isMember:l,targetId:i})=>{b.mutations.handleMembershipUpdate(r.current,_,l,i)};function n(){c.actions.logout(),d.push({name:"Sign In"})}return(_,l)=>(e.openBlock(),e.createElementBlock("div",ee,[r.current.status==="removed"?(e.openBlock(),e.createElementBlock("div",te," Sorry, user has been removed. ")):(e.openBlock(),e.createElementBlock("div",re,[e.unref(t).params._id===c.state.user._id&&f.value?(e.openBlock(),e.createBlock(N,{key:0,user:c.state.user._id,target:r.current,cta:!0},null,8,["user","target"])):e.createCommentVNode("",!0),e.createElementVNode("section",se,[e.unref(t).params._id===c.state.user._id?(e.openBlock(),e.createBlock(k.IconEdit,{key:0,onClick:l[0]||(l[0]=i=>_.$router.push({name:"User Edit Profile",params:{_id:c.state.user._id}})),class:"pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):e.createCommentVNode("",!0),r.current.profile.photo.length>0?(e.openBlock(),e.createElementBlock("img",{key:1,src:(_.FILE_SERVER_URL||"")+r.current.profile.photo,class:"radius-extra bg-white mn-small object-fit-cover i-extra"},null,8,oe)):(e.openBlock(),e.createBlock(k.PlaceholderUserpic,{key:2,class:"radius-medium mn-small i-extra"})),e.createElementVNode("h3",ae,e.toDisplayString(r.current.profile.name?r.current.profile.name:"Not specified"),1),e.createElementVNode("p",ne," @"+e.toDisplayString(r.current.username?r.current.username:"Not specified"),1),e.createElementVNode("p",le,e.toDisplayString(r.current.profile.description?r.current.profile.description:"Not specified"),1),e.createElementVNode("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.current.roles,(i,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["pd-thin radius-small t-semi bg-white",{"mn-r-thin":u!==r.current.roles.length-1}])},e.toDisplayString(i.icon)+" "+e.toDisplayString(i.name),3))),256))]),e.createElementVNode("p",ce," 👨‍👨‍👧‍👧 "+e.toDisplayString(r.current.numberOfMemberships)+" followers ",1),c.state.user._id&&e.unref(t).params._id&&e.unref(t).params._id!==c.state.user._id?(e.openBlock(),e.createBlock(b.ButtonFollow,{key:3,type:"user",isMember:r.current.isMember,targetId:r.current._id,userId:c.state.user._id,class:"w-min mn-medium mn-r-auto mn-l-auto",onUpdateMembership:C},null,8,["isMember","targetId","userId"])):e.createCommentVNode("",!0),Object.values(r.current.socials).some(i=>i)?(e.openBlock(),e.createElementBlock("h4",de," Find Me in Socials ")):e.createCommentVNode("",!0),e.createVNode(x._sfc_main,{telegram:r.current.socials.telegram,facebook:r.current.socials.facebook,instagram:r.current.socials.instagram,twitter:r.current.socials.twitter,class:"mn-r-auto mn-l-auto"},null,8,["telegram","facebook","instagram","twitter"])]),c.state.access.roles&&c.state.user._id===e.unref(t).params._id&&(c.state.access.roles.includes("ROLE_MODERATOR")||c.state.access.roles.includes("ROLE_ADMIN"))?(e.openBlock(),e.createBlock(p._sfc_main,{key:1,class:"bg-black t-white"},{default:e.withCtx(()=>[e.createVNode(p._sfc_main$1,{onClick:l[1]||(l[1]=i=>e.unref(d).push({name:"Backoffice",params:{_id:e.unref(t).params._id}})),class:"cursor-pointer",theme:"white"},{default:e.withCtx(()=>[ue]),_:1})]),_:1})):e.createCommentVNode("",!0),e.createVNode(p._sfc_main,{class:"bg-grey"},{default:e.withCtx(()=>[e.createVNode(p._sfc_main$1,{onClick:l[2]||(l[2]=i=>e.unref(d).push({name:"User Events",params:{_id:e.unref(t).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(I,{class:"i-semi",icon:!0}),me]),_:1}),e.createVNode(p._sfc_main$1,{onClick:l[3]||(l[3]=i=>e.unref(d).push({name:"User Organizations",params:{_id:e.unref(t).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(D,{class:"i-semi",icon:!0}),pe]),_:1}),e.createVNode(p._sfc_main$1,{onClick:l[4]||(l[4]=i=>e.unref(d).push({name:"User Blogposts",params:{_id:e.unref(t).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(W,{class:"i-semi",icon:!0}),_e]),_:1})]),_:1}),c.state.user._id===e.unref(t).params._id?(e.openBlock(),e.createBlock(p._sfc_main,{key:2,class:"bg-grey"},{default:e.withCtx(()=>[e.createVNode(p._sfc_main$1,{onClick:l[5]||(l[5]=i=>e.unref(d).push({name:"User Edit Profile",params:{_id:e.unref(t).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[fe]),_:1}),e.createVNode(p._sfc_main$1,{onClick:l[6]||(l[6]=i=>e.unref(d).push({name:"Legal",params:{_id:e.unref(t).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[Ce]),_:1}),e.createVNode(p._sfc_main$1,{class:"cursor-pointer",onClick:l[7]||(l[7]=i=>n())},{default:e.withCtx(()=>[he]),_:1})]),_:1})):e.createCommentVNode("",!0)]))]))}},ge=Object.freeze(Object.defineProperty({__proto__:null,default:y},Symbol.toStringTag,{value:"Module"}));const Ve={class:"pd-medium for-transition w-100"},ve=e.createElementVNode("h3",{class:"mn-small"},"Username",-1),we=e.createElementVNode("p",{class:"mn-semi"},"Your username will be used for URL of profile like thecommunephuket/users/username",-1),be=e.createElementVNode("h3",{class:"mn-small"},"Profile",-1),ke={class:"mn-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},Ne=e.createElementVNode("h4",null,"Upload userpic",-1),ye=e.createElementVNode("h3",{class:"mn-small"},"Socials",-1),Ee=e.createElementVNode("p",{class:"mn-thin"},"Please provide only the username for social media profiles, without full links.",-1),Be=e.createElementVNode("h3",{class:"mn-small"},"Account",-1),E={__name:"ProfileEdit",async setup(o){let t,d;e.ref(null);const f=v.useRoute(),C=v.useRouter();[t,d]=e.withAsyncContext(()=>g.read({_id:c.state.user._id})),await t,d();const n=e.ref(r.current);async function _(){await g.update(r.current)}async function l(){window.confirm("Are you sure you want to delete your account? Restoration will be possible only with the help of an administrator.")&&(r.current.status="removed",await g.update(r.current),c.actions.logout())}function i(){C.replace({name:"User Profile",params:{_id:r.current._id}})}return(u,s)=>(e.openBlock(),e.createElementBlock("div",Ve,[e.unref(f).params._id===c.state.user._id?(e.openBlock(),e.createBlock(N,{key:0,user:c.state.user._id,target:n.value,cta:!1},null,8,["user","target"])):e.createCommentVNode("",!0),ve,e.createVNode(m.Field,{field:n.value.username,"onUpdate:field":s[0]||(s[0]=a=>n.value.username=a),label:"@",placeholder:"Not specified",class:"mn-thin w-100 bg-grey pd-medium radius-small",disabled:"true",validation:u.organizationName},null,8,["field","validation"]),we,be,e.createElementVNode("div",ke,[e.createVNode($._sfc_main,{photo:n.value.profile.photo,"onUpdate:photo":s[1]||(s[1]=a=>n.value.profile.photo=a),uploadPath:"users/"+n.value._id+"/avatars",class:"h-4r w-4r aspect-1x1 o-hidden bg-white mn-thin radius-extra"},null,8,["photo","uploadPath"]),Ne]),e.createVNode(m.Field,{field:n.value.profile.name,"onUpdate:field":s[2]||(s[2]=a=>n.value.profile.name=a),label:"Name",placeholder:"Not specified",class:"mn-thin bg-grey pd-medium radius-small",validation:u.organizationName},null,8,["field","validation"]),e.createVNode(m.Field,{field:n.value.profile.description,"onUpdate:field":s[3]||(s[3]=a=>n.value.profile.description=a),label:"Description",placeholder:"Not specified",class:"mn-semi bg-grey pd-medium radius-small",disabled:"true",validation:u.organizationName},null,8,["field","validation"]),ye,Ee,e.createVNode(m.Field,{field:n.value.socials.instagram,"onUpdate:field":s[4]||(s[4]=a=>n.value.socials.instagram=a),label:"Instagram",placeholder:"",class:"mn-thin bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(m.Field,{field:n.value.socials.twitter,"onUpdate:field":s[5]||(s[5]=a=>n.value.socials.twitter=a),label:"Twitter",placeholder:"",class:"mn-thin bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(m.Field,{field:n.value.socials.facebook,"onUpdate:field":s[6]||(s[6]=a=>n.value.socials.facebook=a),label:"Facebook",placeholder:"",class:"mn-thin bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(m.Field,{field:n.value.socials.telegram,"onUpdate:field":s[7]||(s[7]=a=>n.value.socials.telegram=a),label:"Telegram",placeholder:"",class:"mn-semi bg-grey pd-medium radius-small"},null,8,["field"]),Be,e.createVNode(m.Field,{field:n.value.phone,"onUpdate:field":s[8]||(s[8]=a=>n.value.phone=a),label:"Phone",placeholder:"Not specified",class:"mn-thin bg-grey pd-medium mn-thin radius-small",disabled:"true",validation:u.organizationName},null,8,["field","validation"]),e.createVNode(m.Field,{field:n.value.email,"onUpdate:field":s[9]||(s[9]=a=>n.value.email=a),label:"Email",placeholder:"Not specified",class:"mn-semi bg-grey pd-medium radius-small",disabled:!0,validation:u.organizationName},null,8,["field","validation"]),e.createVNode(m._sfc_main,{submit:_,callback:i,class:"mn-thin"},{default:e.withCtx(()=>[e.createTextVNode("Save")]),_:1}),e.createVNode(m._sfc_main,{submit:l,callback:u.a=()=>{e.unref(C).push({name:"Sign In"})},class:"mn-thin bg-red t-white"},{default:e.withCtx(()=>[e.createTextVNode("Delete Account")]),_:1},8,["callback"])]))}},xe=Object.freeze(Object.defineProperty({__proto__:null,default:E},Symbol.toStringTag,{value:"Module"})),$e=[{path:"profile/:_id",name:"User Profile",meta:{title:{en:"Profile",ru:"Профиль"}},component:()=>Promise.resolve().then(()=>ge)},{path:"profile/:_id/edit",name:"User Edit Profile",beforeEnter:[P.requiresAuth],meta:{title:{en:"Edit Profile",ru:"Редактировать Профиль"}},component:()=>Promise.resolve().then(()=>xe)},{path:"profile/:_id/blogposts",name:"User Blogposts",meta:{title:{en:"Posts",ru:"Посты"}},component:()=>Promise.resolve().then(()=>require("./ProfileBlogposts-f9312adf.js"))},{path:"profile/:_id/events",name:"User Events",meta:{title:{en:"Events",ru:"События"}},component:()=>Promise.resolve().then(()=>require("./ProfileEvents-996bce18.js"))},{path:"profile/:_id/organizations",name:"User Organizations",meta:{title:{en:"Groups",ru:"Группы"}},component:()=>Promise.resolve().then(()=>require("./ProfileOrganizations-769325c7.js"))}];exports.Profile=y;exports.ProfileEdit=E;exports.usersRoutes=$e;exports.usersStore=X;
@@ -263,7 +263,7 @@ const be = { class: "for-transition w-100" }, we = {
263
263
  class: "mn-r-auto mn-l-auto"
264
264
  }, null, 8, ["telegram", "facebook", "instagram", "twitter"])
265
265
  ]),
266
- c.user._id === u(e).params._id && (c.access.roles.includes("ROLE_MODERATOR") || c.access.roles.includes("ROLE_ADMIN")) ? (m(), v(U, {
266
+ c.access.roles && c.user._id === u(e).params._id && (c.access.roles.includes("ROLE_MODERATOR") || c.access.roles.includes("ROLE_ADMIN")) ? (m(), v(U, {
267
267
  key: 1,
268
268
  class: "bg-black t-white"
269
269
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozdao/prometheus-framework",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "description": "Web3 Framework focused on user experience and ease of development.",
5
5
  "author": "OZ DAO <hello@ozdao.dev>",
6
6
  "license": "GPL-3.0-or-later",
@@ -1,4 +1,4 @@
1
- <template>
1
+ x<template>
2
2
  <div
3
3
  class="for-transition w-100"
4
4
  >
@@ -110,7 +110,7 @@
110
110
  </section>
111
111
 
112
112
  <Menu
113
- v-if="(auth.state.user._id === route.params._id) && (auth.state.access.roles.includes('ROLE_MODERATOR') || auth.state.access.roles.includes('ROLE_ADMIN'))"
113
+ v-if="(auth.state.access.roles && auth.state.user._id === route.params._id) && (auth.state.access.roles.includes('ROLE_MODERATOR') || auth.state.access.roles.includes('ROLE_ADMIN'))"
114
114
  class="bg-black t-white"
115
115
  >
116
116
  <MenuItem