(function(){const a=new VueJsAsyncComponentTemplateRepository(webContext+"/kmelia/jsp/javaScript/vuejs/components/kmelia-contribution-templates.jsp");const b={mixins:[VuejsApiMixin],props:{componentInstanceId:{type:String,"default":undefined},isDescriptionVisible:{type:Boolean,required:true},isDescriptionMandatory:{type:Boolean,required:true},isKeywordsVisible:{type:Boolean,required:true},i18nContent:{type:Boolean,required:true},i18nContentLanguage:{type:String,required:true},isPublicationStateConfirmation:{type:Boolean,required:true},isVersionActive:{type:Boolean,required:true},isValidationMandatory:{type:Boolean,required:true},isSingleTargetValidation:{type:Boolean,required:true}}};SpVue.component("kmelia-file-adding-management",a.get("kmelia-file-adding-management",{mixins:[b],data:function(){return{context:undefined,addFilesPopinApi:undefined,addAttFormApi:undefined,validationPopinApi:undefined}},created:function(){this.extendApiWith({addFiles:this.openAddFiles,openValidationStep:this.openValidationStep});this.context={isVersionActive:this.isVersionActive,indexIt:true,isI18nContent:this.i18nContent,i18nContentLanguage:this.i18nContentLanguage}},methods:{openAddFiles:function(d){const c=d.callback;d.callback=function(e){return c(e).then(function(){this.addFilesPopinApi.formApi.initFormData();this.addAttFormApi.initFormData()}.bind(this))}.bind(this);this.addFilesPopinApi.open(d)},openValidationStep:function(c){this.validationPopinApi.open(c)}}}));SpVue.component("kmelia-file-upload-validation-popin",a.get("kmelia-file-upload-validation-popin",{mixins:[VuejsDefaultFormPanePopinApiMixin,b],data:function(){return{popinOptions:undefined,title:"",severalFilesToUpload:false}},methods:{open:function(c){this.title=c.title||"";this.severalFilesToUpload=!!c.severalFilesToUpload;this.popinOptions=c;this.$super(VuejsDefaultFormPanePopinApiMixin).open({callbackOnClose:this.popinOptions.callbackOnClose})},validate:function(d){const c=this.popinOptions.callback(d);if(sp.promise.isOne(c)){return c.then(function(){this.formApi.initFormData()}.bind(this))}else{this.formApi.initFormData()}}},computed:{i18nContentEnabled:function(){if(this.popinOptions&&typeof this.popinOptions.i18nContent==="boolean"){return this.popinOptions.i18nContent}return this.i18nContent},isVersionActiveEnabled:function(){if(this.popinOptions&&typeof this.popinOptions.isVersionActive==="boolean"){return this.popinOptions.isVersionActive}return this.isVersionActive}}}));SpVue.component("kmelia-file-upload-validation-form",a.get("kmelia-file-upload-validation-form",{mixins:[b,VuejsFormApiMixin,VuejsI18nTemplateMixin],props:{severalFilesToUpload:{type:Boolean,required:true}},data:function(){return{contentLanguage:undefined,creationMode:"onePerFile",publicationName:undefined,publicationDescription:undefined,publicationKeywords:undefined,publicationState:"1",versionType:"0",dropValideurId:"",dropValideurName:""}},created:function(){this.extendApiWith({initFormData:this.initFormData,isAtLeastOnMandatoryInput:this.isAtLeastOnMandatoryInput,validateForm:function(){return this.rootFormApi.errorMessage().none()},updateFormData:function(c){if(this.i18nContent){c.ContentLanguage=this.contentLanguage}if(this.isPublicationStateConfirmation){c.Draft=this.publicationState}if(this.isVersionActive){c.VersionType=this.versionType}if(this.severalFilesToUpload){if(this.publicationName){c.PublicationName=encodeURIComponent(this.publicationName.trim())}if(this.publicationDescription){c.PublicationDescription=encodeURIComponent(this.publicationDescription.trim())}if(this.publicationKeywords){c.PublicationKeywords=encodeURIComponent(this.publicationKeywords.trim())}}if(this.isValidationMandatory){c.ValidatorIds=this.dropValideurId}}});this.initFormData()},methods:{initFormData:function(){this.contentLanguage=this.i18nContentLanguage;this.creationMode="onePerFile";this.publicationName=undefined;this.publicationDescription=undefined;this.publicationKeywords=undefined;this.publicationState="1";this.versionType="0";this.dropValideurId="";this.dropValideurName=""},isAtLeastOnMandatoryInput:function(){return(this.severalFilesToUpload&&this.creationMode==="oneForAll")||this.isValidationMandatory}},computed:{validatorIconUrl:function(){return webContext+"/util/icons/"+(this.isSingleTargetValidation?"user.gif":"groupe.gif")}}}))})();