import{r as t,h as e,H as i,g as s}from"./p-9f21f85f.js";import{C as r}from"./p-0988b316.js";import{U as a}from"./p-9c82afa0.js";import{S as o}from"./p-c2c9e896.js";import"./p-25d382ec.js";import"./p-3968aca6.js";import"./p-d343a062.js";import{g as p,k as n,m,c as d,d as c,e as l}from"./p-c44f96b9.js";import{M as f}from"./p-905285ef.js";import{a as h,b as j,c as w,s as u}from"./p-cb585cde.js";import{a as v,b}from"./p-d610a564.js";import"./p-65eb3f89.js";import"./p-814af281.js";import"./p-42939000.js";import"./p-aa5ffe14.js";import"./p-105f7627.js";import"./p-6a6f355f.js";import"./p-293acc32.js";import"./p-f2965a61.js";import"./p-0563ceba.js";import"./p-1e47e7bd.js";import"./p-31e77e7b.js";import"./p-825ab276.js";import"./p-6c8be41c.js";import"./p-1187cc7c.js";import"./p-881a2bb8.js";import"./p-968ee2ec.js";import"./p-d27cb594.js";import"./p-d6c479ab.js";import"./p-10cfccbb.js";import"./p-8d2ddf16.js";import"./p-e929429b.js";import"./p-a86d8cf2.js";import"./p-3ccedaa0.js";import"./p-9aa2fafd.js";import"./p-3d141e05.js";import"./p-d59ffc5b.js";import"./p-04951203.js";import"./p-5d192a8d.js";import"./p-9258e9db.js";import"./p-6debf4b5.js";import"./p-33c4053b.js";import"./p-bea38b23.js";const g=class{constructor(e){t(this,e),this.weekStartDay="monday"}async componentWillLoad(){const{isZoomAuthenticated:t,isGoogleAuthenticated:e,isMicrosoftBusinessAuthenticated:i,language:s,timeFormat:g,dateFormat:y,timeZone:k,viewedUserRole:C,weekStartDay:D}=this;switch(r.setTimeFormat(g),r.setTimeZone(k),r.setDateFormat(y),s){case"pt-br":r.setLocale(s,w,D);break;case"tr":r.setLocale(s,j,D);break;default:r.setLocale(s,h,D)}this.apiSozluk=(new o).setLanguage(s).setContents(u);const{context:x,headers:A}=p(this.groupId);this.mentornityCookieContext=x,this.userSettings=n(g,y,k,s,t,e,i,D),this.mentornityBridgeApi=new f(m,x,A);const S=d(m,A),z=await S.get("users",x.userId).catch((t=>this.error=t));if(!z)return;this.user=a.decode(z);const E=await S.getOrganisationConfig(x.organisationId).catch((t=>this.error=t));if(!E)return;if(this.membership=c("mentee"===x.role&&"group"===E.menteeType?"group":x.role),this.guestToPassToAvailableTimePickerAsCurrentUser=this.user,"mentee"===x.role&&"group"===E.menteeType)if(x.groupId){const t=await S.getGroup(x.groupId).catch((t=>this.error=t));t&&(this.guestToPassToAvailableTimePickerAsCurrentUser=Object.assign(Object.assign({},t),{name:t.title,initials:t.title[0]}))}else this.guestToPassToAvailableTimePickerAsCurrentUser=void 0;const T=l.decode(E);this.organisationConfig=T,this.mentornityBridgeApi.organisationConfig=T,this.userCardListViewConfig=v(x,s,T,C,{mentornityBridgeApi:this.mentornityBridgeApi,apiSozluk:this.apiSozluk,guestToPassToAvailableTimePickerAsCurrentUser:this.guestToPassToAvailableTimePickerAsCurrentUser,userSettings:this.userSettings,membership:this.membership}),this.userDetailDialogViewConfig=b(x,s,T,C)}componentDidRender(){var t,e;null===(e=null===(t=this.el.querySelector("dvn-app-view-list-view-card"))||void 0===t?void 0:t.retainPosition)||void 0===e||e.call(t)}onAction(t){const e=t.detail;switch(e.name){case"view-details":this.userToViewDetails=e.params.item;break;case"send-message":window.dispatchEvent(new CustomEvent("dvn.mentornity-user-card-list-wrapper.send-message",{detail:{user:e.params.item.user}}));break;case"go-to-profile-page":window.dispatchEvent(new CustomEvent("dvn.mentornity-user-card-list-wrapper.open-profile-page",{detail:{user:e.params.item}}));break;case"open-meeting-detail-after-creation":window.dispatchEvent(new CustomEvent("dvn.mentornity-user-card-list-wrapper.open-meeting-page",{detail:{meetingId:e.params.meetingId}}))}}render(){const{apiSozluk:t,mentornityBridgeApi:s,userCardListViewConfig:r,userToViewDetails:a,userDetailDialogViewConfig:o}=this;return r?e(i,{style:{display:"flex",flexDirection:"column",height:"100%",overflow:"hidden"}},e("mentornity-root-wrapper",null,e("div",{style:{display:"flex",overflow:"hidden",flexDirection:"column"}},this.alertMessage&&e("dvn-alert",{tint:"warning",message:this.alertMessage,extraClass:"mt-3 ml-3 mr-3"},e("dvn-card-footer",{slot:"footer","align-right":!0},e("dvn-button",{leaned:!0,tint:"secondary",view:"flat",onClick:()=>window.dispatchEvent(new CustomEvent("dvn.mentornity-user-card-list-wrapper.alert-message-click"))},this.alertActionLabel))),e("dvn-app-view-list-view-card",{apiData:s,apiSozluk:t,view:r})),a&&e("dvn-dialog",{raw:!0,shown:!0,onDismiss:()=>this.userToViewDetails=void 0},e("dvn-app-view-detail-view-card",{apiData:s,apiSozluk:t,id:"user-page",params:{itemId:a._id},view:o})))):e("div",{class:"d-flex justify-content-center pt-3"},e("dvn-progress",{indefinite:!0}))}get el(){return s(this)}};export{g as mentornity_user_card_list_wrapper}