"use strict";(self["webpackChunkcarabi_x2"]=self["webpackChunkcarabi_x2"]||[]).push([[1593,6756],{4900:function(e,t,n){n.r(t),n.d(t,{default:function(){return D}});var a=function(){var e=this,t=e._self._c;return t("Files",{attrs:{documentId:e.documentId,pluginId:e.pluginId}})},l=[],i=(n(6104),{name:"CardPluginFiles",components:{Files:()=>n.e(1760).then(n.bind(n,2584))},props:{documentId:Number,info:Object,docModel:Object,pluginId:Number},data(){return{}},async mounted(){},methods:{}}),o=i,s=n(1656),d=(0,s.A)(o,a,l,!1,null,null,null),D=d.exports},6104:function(e,t,n){n.r(t);var a=n(3216);const l={10:"dictionary",9:"document",11:"dictionary"},i={5:"buttonsYesNo",17:"none",31:"dateTimeModal",32:"dateTimeModal",33:"dateTime",34:"dateTimeModal",35:"dateTimeModal",37:"dateTime",38:"dateTime",43:"weekModal"},o=["simple","phone","dateTime","buttonsYesNo"],s={simple:()=>Promise.all([n.e(588),n.e(2775)]).then(n.bind(n,5212)),dateTime:()=>Promise.all([n.e(588),n.e(430)]).then(n.bind(n,3389)),dateTimeModal:()=>Promise.all([n.e(588),n.e(7161)]).then(n.bind(n,1942)),dictionary:()=>n.e(8589).then(n.bind(n,8869)),weekModal:()=>Promise.all([n.e(588),n.e(4355),n.e(2952)]).then(n.bind(n,945)),textModal:()=>n.e(8203).then(n.bind(n,6975)),htmlModal:()=>n.e(8729).then(n.bind(n,2428)),multiPhone:()=>Promise.all([n.e(4355),n.e(5876)]).then(n.bind(n,535)),buttonsYesNo:()=>n.e(7236).then(n.bind(n,4653)),classifSimpleModal:()=>n.e(7467).then(n.bind(n,9210)),classifModal:()=>n.e(177).then(n.bind(n,8776)),document:()=>n.e(8214).then(n.bind(n,1821))};class d{getComponent(e){let t={name:null,component:null,inline:!1};return t.name=this.getComponentName(e),t.name?(t.component=s[t.name],t.inline=-1!==o.indexOf(t.name),t):t}getComponentName(e){console.log("getComponentName",e);let t=null;return 1===e.DOCPROP_KIND?(t="simple",i[e.DOCPROP_OBJECT]&&(t=i[e.DOCPROP_OBJECT]),"4"===e.DOCPROP_OBJECT&&(t="HTML"===e.DOCPROP_PRESENTATION?"htmlModal":"MULTILINE"===e.DOCPROP_PRESENTATION?"textModal":"simple"),"7"===e.DOCPROP_OBJECT&&(t="multiPhone")):20===e.DOCPROP_KIND?t="CLASSIF_OLD"===e.DOCPROP_PRESENTATION?"classifSimpleModal":"classifModal":l[e.DOCPROP_KIND]&&(t=l[e.DOCPROP_KIND]),console.log("componentName",t),t}getDataType(e){let t="single";return 9===e.DOCPROP_KIND?t="document":e.DOCPROP_MULTI&&(t="multi"),t}async checkPermission(e){let t=await a.FH.documents.getDocFieldPermission(e.DOCUMENT_ID,e.DOCPROP_DESCR);return 0===t.DOCPROP_READONY}async loadValue(e){let t=this.getDataType(e),n=null;if("document"===t)n=await a.FH.documents.getRefsByDocprop(e.DOCUMENT_ID,e.DOCPROP_DESCR),n=n.filter((e=>-1!==e.REF_ID)).map((e=>({DOCUMENT_ID:e.REF_ID,DOC_DESCR:e.DOC_DESCR?e.DOC_DESCR:""})));else if("multi"===t){let t=await a.FH.documents.getValues(e.DOCUMENT_ID,e.DOCPROP_DESCR);n=t.map((e=>e.VALUE))}else{let t=await a.FH.documents.getValue(e.DOCUMENT_ID,e.DOCPROP_DESCR);t&&(n=t.VALUE)}return n}async saveValue(e,t,n){let l=this.getDataType(e),i=null;return"document"===l?(await a.FH.cards.transactionClearRefs(n,e.DOCUMENT_ID,e.DOCPROP_DESCR),t.length&&(i=await a.FH.cards.transactionInsertRefs(n,e.DOCUMENT_ID,e.DOCPROP_DESCR,t.map((e=>e.DOCUMENT_ID))))):i="multi"===l?await a.FH.cards.transactionSetValues(n,e.DOCUMENT_ID,e.DOCPROP_DESCR,t):await a.FH.cards.transactionSetValue(n,e.DOCUMENT_ID,e.DOCPROP_DESCR,t),i}async deleteValue(e,t){let n=this.getDataType(e);"document"===n||"multi"===n?await this.saveValue(e,[],t):await this.saveValue(e,"",t)}}t["default"]=new d}}]);
//# sourceMappingURL=CardPluginFiles.afb72163.js.map