var __spreadArray=this&&this.__spreadArray||function(e,i,a){if(a||arguments.length===2)for(var r=0,t=i.length,o;r<t;r++){if(o||!(r in i)){if(!o)o=Array.prototype.slice.call(i,0,r);o[r]=i[r]}}return e.concat(o||Array.prototype.slice.call(i))};import{T as TextField}from"./index-150b6a59.js";import{C as CardListViewConfig}from"./card-list-view-config-56edd30b.js";import{D as DetailViewConfig}from"./detail-view-config-47244869.js";import{T as TableConfig}from"./table-config-3820fb34.js";import{T as TakvimAvailableTimePickerViewConfig}from"./takvim-available-time-picker-view-config-051fa55b.js";import{a as getEmbeddedTranslation,g as generateCalendarConfig}from"./mentorinty-bridge-api-f70621dd.js";import{d as getMembershipFields,e as getUserDetailViewFieldConfigs,c as convertFieldsToFieldReferences,h as getAvailableLegacyProfileFields,a as getAvailableMetadataFields}from"./common-wrapper-util-62bbacf2.js";import{I as ImagePosition,T as TitlePosition}from"./models-3a85e626.js";function getUserCardListViewConfig(e,i,a,r,t){if(!a){return null}var o=e.role;var n=getMembershipFields(i,a,r,o);var l=getUserDetailViewFieldConfigs(i,a,r,e.role,true,4);var d=__spreadArray([],l,true);var s={};var f=o==="mentee"&&r==="mentor";var g=a.menteeType==="individual"||e.groupId;if(f&&g){s=Object.assign({customViewTag:"mentornity-schedule-meeting-button-on-card",language:i},t)}var c=[];var m=__spreadArray([{field:new TextField("search",getEmbeddedTranslation(i,"search"))}],convertFieldsToFieldReferences(__spreadArray(__spreadArray([],getAvailableLegacyProfileFields(i,a,r).filter((function(e){return!["title","bio"].includes(e.id)})),true),getAvailableMetadataFields(e.role,r,a),true)),true);m.forEach((function(e){var i;var a=e.fieldId||((i=e.field)===null||i===void 0?void 0:i.id);if(a){c.push({fieldId:a,width:"200px"})}}));return CardListViewConfig.decode({_id:"".concat(r,"-card-list"),i18nEntryId:"mentornity-".concat(r,"-card-list"),ui:{quickSearch:{fields:m,fieldUIConfigs:c},main:{cardViewConfig:{header:{cover:{size:120},image:{fieldId:"user.imageUrl",placeholderFieldId:"user.initials",size:96,position:ImagePosition.TopLeft},title:{fieldId:"user.name",position:TitlePosition.RightOfImage},subtitleActions:[{ui:{label:getEmbeddedTranslation(i,"viewDetails"),name:"view-details",tint:"neutral"}},{ui:{label:getEmbeddedTranslation(i,"goToProfilePage"),name:"go-to-profile-page",tint:"neutral"}}]},body:{fields:d},footer:s}}},table:{fields:n,roleName:r,name:"".concat(r,"-card-list")},query:{fields:d}})}function getAvailableTimePickerViewConfig(e){if(!e){return undefined}return TakvimAvailableTimePickerViewConfig.decode({_id:"user-card-list-page-available-time-picker-view",i18nEntryId:"user-card-list-page-available-time-picker-view",table:generateCalendarConfig(e),successNavigationAction:{type:"navigation",direction:"forward",name:"open-meeting-detail-after-creation",params:{conversionConfig:{"item._id":"meetingId"}}}})}function getUserDetailDialogViewConfig(e,i,a,r){if(!a){return undefined}var t=getMembershipFields(i,a,r,e.role);var o=getUserDetailViewFieldConfigs(i,a,r,e.role,false);var n=e.organisationId;return DetailViewConfig.decode({table:TableConfig.decode({fields:t,base:n,name:r==="mentee"?"mentees":"mentors"}),ui:{cardConfig:{header:{title:{fieldId:"name"},actions:[{ui:{label:getEmbeddedTranslation(i,"goToProfilePage"),name:"go-to-profile-page"}}]},body:{fields:o}}}})}export{getUserCardListViewConfig as a,getUserDetailDialogViewConfig as b,getAvailableTimePickerViewConfig as g};