var __spreadArray=this&&this.__spreadArray||function(e,i,a){if(a||arguments.length===2)for(var r=0,t=i.length,n;r<t;r++){if(n||!(r in i)){if(!n)n=Array.prototype.slice.call(i,0,r);n[r]=i[r]}}return e.concat(n||Array.prototype.slice.call(i))};import{T as TextField}from"./index-150b6a59.js";import{C as CardListViewConfig}from"./card-list-view-config-5e6591e6.js";import{D as DetailViewConfig}from"./detail-view-config-23af2b0d.js";import{T as TableConfig}from"./table-config-d73a72ab.js";import{T as TakvimAvailableTimePickerViewConfig}from"./takvim-available-time-picker-view-config-816c103b.js";import{a as getEmbeddedTranslation,g as generateCalendarConfig}from"./mentorinty-bridge-api-5ca2d652.js";import{d as getMembershipFields,e as getUserDetailViewFieldConfigs,c as convertFieldsToFieldReferences,h as getAvailableLegacyProfileFields,a as getAvailableMetadataFields}from"./common-wrapper-util-e4afa19b.js";import{I as ImagePosition,T as TitlePosition}from"./models-3a85e626.js";function getUserCardListViewConfig(e,i,a,r,t){if(!a){return null}var n=e.role;var o=getMembershipFields(i,a,r,n);var l=getUserDetailViewFieldConfigs(i,a,r,e.role,true,4);var s=__spreadArray([],l,true);var d={};var g=n==="mentee"&&r==="mentor";var f=a.menteeType==="individual"||e.groupId;if(g&&f){d=Object.assign({customViewTag:"mentornity-schedule-meeting-button-on-card",language:i},t)}var m=[];var c=__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);c.forEach((function(e){var i;var a=e.fieldId||((i=e.field)===null||i===void 0?void 0:i.id);if(a){m.push({fieldId:a,width:"200px"})}}));var u=[];if(r==="mentor"&&n!=="anonymous"){u.push({ui:{componentTag:"mentornity-follow-button"},data:{language:i,mentornityCookieContext:e,isOnUserList:true}})}if(n!=="anonymous"){u.push({ui:{label:getEmbeddedTranslation(i,"sendMessage"),name:"send-message",tint:"primary",scale:"small",view:"outline"}})}u.push.apply(u,[{ui:{label:getEmbeddedTranslation(i,"showMore"),name:"view-details",tint:"primary",scale:"small",view:"outline"}}]);return CardListViewConfig.decode({_id:"".concat(r,"-card-list"),i18nEntryId:"mentornity-".concat(r,"-card-list"),ui:{quickSearch:{fields:c,fieldUIConfigs:m},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:u},body:{fields:s},footer:d}}},table:{fields:o,roleName:r,name:"".concat(r,"-card-list")},query:{fields:s}})}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 n=getUserDetailViewFieldConfigs(i,a,r,e.role,false);var o=e.organisationId;var l=[{ui:{label:getEmbeddedTranslation(i,"goToProfilePage"),name:"go-to-profile-page"}}];return DetailViewConfig.decode({table:TableConfig.decode({fields:t,base:o,name:r==="mentee"?"mentees":"mentors"}),ui:{cardConfig:{header:{title:{fieldId:"name"},actions:l},body:{fields:n}}}})}export{getUserCardListViewConfig as a,getUserDetailDialogViewConfig as b,getAvailableTimePickerViewConfig as g};