import{r as registerInstance,h}from"./index-55faf181.js";import{i as injectNotifier}from"./index-7884b902.js";import"./kimlikApi-7350588e.js";import"./data-transfer-field-918730a3.js";import"./filter-cbaa3d7d.js";import{c as createMentornityApiInstance,b as MentornityViewConfigViewName}from"./instance-46ab1e99.js";import{g as getSessionDetails,m as mentornityApiEndpoint}from"./session-3ec0aa4c.js";import{a as getFormViewConfig,b as getFormParameters}from"./wrapper-util-0c6db53e.js";import"./state-tunnel-04c0b67a.js";import"./BaseField-461b6d0c.js";import"./FieldModelGenerator-1ee7fda2.js";import"./index-6a1cf9c1.js";import"./index-403e215e.js";import"./date-ce777316.js";import"./index-083a6906.js";import"./index-fa1db470.js";import"./membership-61c4a2f7.js";import"./data-model-f5160369.js";import"./membership-config-a51a5232.js";import"./table-config-5c917348.js";import"./string-3065a411.js";import"./User-d2ee8b71.js";import"./UserSettings-7b80b841.js";import"./cookie-93ea205f.js";import"./_commonjsHelpers-27f122dd.js";import"./index-d3bd30bd.js";import"./form-view-config-00abddd1.js";import"./InterceptorHandler-6474bcf4.js";import"./view-config-39fd369a.js";import"./ValidatorLength-f56a7c14.js";import"./mentorinty-bridge-api-946adc0d.js";import"./index-ebde6a66.js";import"./attachment-32decf79.js";import"./CalendarConfig-184230a0.js";import"./common-wrapper-util-36df331f.js";import"./models-f0bc20c6.js";import"./actions-b9a0f808.js";var MentornityMembershipSettingsWrapper=function(){function e(e){registerInstance(this,e);this.isViewConfigWrapperLoaded=false}e.prototype.onInvalidation=function(e){this.notifier.showCustomNotification(e.detail.notification)};e.prototype.componentWillLoad=function(){var e=this;var t=getSessionDetails(),i=t.context,r=i.organisationId,n=i.role,o=i.userId,a=t.headers;var s=createMentornityApiInstance(mentornityApiEndpoint,a);s.getOrganisationConfig(r).then((function(t){e.organisationConfig=t}));var p=n==="mentor"?MentornityViewConfigViewName.MentorInfoForm:MentornityViewConfigViewName.MenteeInfoForm;s.getViewConfig(r,p).then((function(t){e.viewConfigWrapper=t})).finally((function(){return e.isViewConfigWrapperLoaded=true}));s.get("users",o).then((function(t){e.user=t}));s.getMetadataOfUser(r,n==="mentor"?"mentors":"mentees",o).then((function(t){e.userMetadata=t}));if(n==="mentor"){s.getMentorshipOfUser(r,o).then((function(t){e.userMentorship=t}))}};e.prototype.render=function(){var e=this,t=e.isViewConfigWrapperLoaded,i=e.language,r=e.organisationConfig,n=e.user,o=e.userMentorship,a=e.userMetadata,s=e.viewConfigWrapper;var p=getSessionDetails().context;if(!t||!r||!n||!a||p.role==="mentor"&&!o){return h("mentornity-root-wrapper",null,h("div",{class:"d-flex justify-content-center pt-3"},h("dvn-progress",{indefinite:true})))}var m=getFormViewConfig(p,i,r,s,n,a,o);return h("mentornity-root-wrapper",null,h("dvn-card",null,h("dvn-app-view-form-view",{params:getFormParameters(p,r,n,a,o),view:m})))};return e}();injectNotifier(MentornityMembershipSettingsWrapper);export{MentornityMembershipSettingsWrapper as mentornity_membership_settings_wrapper};