import{r as t,h as i}from"./p-c1e62c18.js";import{T as e}from"./p-eb6e2a8b.js";import"./p-35c7f358.js";import{D as a}from"./p-3c3b4f3f.js";import"./p-04ac75cf.js";import"./p-d66fb38c.js";import"./p-22a0eb5c.js";import{D as s,a as p}from"./p-552063c3.js";import{S as o,a as r}from"./p-a9eda644.js";import"./p-7c81e200.js";import"./p-0f7a11a0.js";import"./p-e8956308.js";import"./p-25c0eb4f.js";import"./p-551d2360.js";import{A as n}from"./p-6279360b.js";import"./p-a8682d9e.js";import"./p-d343a062.js";import"./p-3df73e7b.js";import"./p-6f59f79b.js";import"./p-f944fe09.js";import{A as m}from"./p-8d093bbd.js";import"./p-6cf8ecf7.js";import"./p-b673f44e.js";import"./p-67db8424.js";import{g as d,m as l}from"./p-a5d71685.js";import"./p-edad6c3d.js";import"./p-15022e50.js";import{T as c}from"./p-92f74b0b.js";import"./p-0fb5fd0d.js";import{I as f,d as j}from"./p-a750de32.js";const u={applicationIsSent:"Your application is sent.",applicationFailed:"Sending the application failed.",firstName:"First name",lastName:"Last name",email:"Email",date:"Date",sendApplication:"Send Application"},h={applicationIsSent:"Başvurunuz gönderildi.",applicationFailed:"Başvuru gönderilirken hata oluştu.",firstName:"İsim",lastName:"Soyisim",email:"E-posta",date:"Tarih",sendApplication:"Başvuruyu Gönder"};class b{constructor(t,i,e,a){this.client=new n(e,a),this.organisationId=t,this.language=i}addAuthInterceptor(t){}get(t,i,e){}query(t,i){var e;const s=(null===(e=i.filter)||void 0===e?void 0:e.filters[0].value)||"mentors";return new Promise((t=>{this.client.get(`organisations/${this.organisationId}/${s}/applications`).then((i=>{t({results:i.results.map((t=>a.decode(Object.assign(Object.assign({_id:t._id,createdAt:t.createdAt,applicationStatus:t.applicationStatus},t.data||{}),{role:s,language:this.language}))))})})).catch((t=>{console.log(t)}))}))}update(t,i,e){}}const w=class{constructor(i){t(this,i),this.isProgressing=!1}onAction(t){this.listView.invalidate(t)}componentWillLoad(){const{context:{organisationId:t},headers:i}=d();this.api=new b(t,this.language,l,i)}render(){const{api:t,language:e}=this;return i("mentornity-root-wrapper",{class:"d-flex flex-column align-items-center"},i("dvn-app-view-list-view-table",{ref:t=>this.listView=t,id:f,apiData:t,view:g("tr"===e?h:u)}))}},g=t=>c.decode({_id:f,type:m.ListViewTable,base:"mentornity",title:"Applications",space:j,table:{fields:[new e("firstName",t.firstName),new e("lastName",t.lastName),new e("email",t.email),new s("createdAt",t.date).setDataType(p.Unix).setDateFormat("DD MMM YYYY")]},query:{},ui:c.decode({main:{fields:[{fieldId:"createdAt"},{fieldId:"email"},{fieldId:"firstName"},{fieldId:"lastName"},{fieldDisplay:{id:"actions"},componentTag:"mentornity-accept-application-button"}],columns:{createdAt:{width:150},email:{width:250},firstName:{width:100},lastName:{width:100},actions:{width:150}}},quickSearch:{fields:[{field:new o("role","Role",[new r("Mentor applications","mentors"),new r("Mentee applications","mentees")]).setValue("mentors")}],ui:{role:{width:"200px"}}}})});export{w as mentornity_membership_application_list_wrapper}