{"version":3,"sources":["webpack:///./src/components/Settings/Invoice/ModalEditInvoiceText.vue","webpack:///src/components/Settings/Invoice/ModalEditInvoiceText.vue","webpack:///./src/components/Settings/Invoice/ModalEditInvoiceText.vue?516f","webpack:///./src/components/Settings/Invoice/ModalEditInvoiceText.vue?eb03"],"names":["render","_vm","this","_c","_self","attrs","$t","isSaving","onClickCancel","saveInvoiceTexts","showModal","isSavingError","isSavingSuccess","on","scopedSlots","_u","key","fn","getFilteredTexts","length","staticClass","_l","textLanguage","index","_v","_s","LanguageId","model","value","Footer","callback","$$v","$set","expression","_e","proxy","slot","staticRenderFns","ErrorAnimation","SuccessAnimation","components","props","type","Boolean","default","Function","required","invoiceTexts","Array","mailType","String","data","mInvoiceTexts","JSON","parse","stringify","test","methods","_this","texts","filter","it","InvoiceMailType","cancelEditInvoiceTexts","$emit","_this2","invoiceProvider","updateLocationInvoiceTexts","then","response","status","catch","error","finally","component"],"mappings":"yHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,qBAAqB,CAACE,MAAM,CAAC,WAAaJ,EAAIK,GAAG,gEAAgE,UAAY,QAAQ,SAAWL,EAAIM,SAAS,cAAgBN,EAAIO,cAAc,YAAcP,EAAIQ,iBAAiB,UAAYR,EAAIS,UAAU,kBAAoBT,EAAIU,eAAiBV,EAAIW,iBAAiBC,GAAG,CAAC,WAAaZ,EAAIO,eAAeM,YAAYb,EAAIc,GAAG,CAAC,CAACC,IAAI,UAAUC,GAAG,WAAW,MAAO,CACpdhB,EAAIiB,mBAAmBC,OAAS,IAAMlB,EAAIU,gBAAkBV,EAAIW,gBAChET,EAAG,MAAM,CAACiB,YAAY,WAAWnB,EAAIoB,GAAIpB,EAAIiB,oBAAoB,SAASI,EAAaC,GAAO,OAAOpB,EAAG,MAAM,CAACa,IAAI,KAAOO,EAAMH,YAAY,UAAU,CAACjB,EAAG,MAAM,CAACiB,YAAY,cAAc,CAACnB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AAAE,UAAA,KAAAR,eACAS,KAAA,KAAAtC,qBAIAuC,QAAA,CACAvC,iBAAA,eAAAwC,EAAA,KACAC,EAAA,GAOA,OALA,KAAAP,eAAA,KAAAA,cAAAjC,OAAA,IACAwC,EAAA,KAAAP,cAAAQ,QACA,SAAAC,GAAA,OAAAA,EAAAC,kBAAAJ,EAAAT,aAGAU,GAGAI,uBAAA,WACA,KAAAC,MAAA,2BAGAvD,iBAAA,eAAAwD,EAAA,KACAC,OAAAT,QACAU,2BAAA,KAAAf,eACAgB,MAAA,SAAAC,GACA,MAAAA,EAAAC,SACAL,EAAAD,MAAA,mBAAAC,EAAAb,eAEAa,EAAAzD,oBAGA+D,OAAA,SAAAC,GACAP,EAAAtD,eAAA,KAEA8D,SAAA,WACAR,EAAA1D,UAAA,QCnJ2X,I,YCOvXmE,EAAY,eACd,EACA1E,EACAqC,GACA,EACA,KACA,KACA,MAIa,aAAAqC,E","file":"js/chunk-2d0d0b4a.js?id=22f590a3c2dda6f03fd0","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('ui-component-modal',{attrs:{\"modalTitle\":_vm.$t('Components.Settings.Invoice.ModalEditInvoiceText.Modal_Title'),\"modalSize\":\"large\",\"isSaving\":_vm.isSaving,\"onClickCancel\":_vm.onClickCancel,\"onClickSave\":_vm.saveInvoiceTexts,\"showModal\":_vm.showModal,\"hideFooterButtons\":_vm.isSavingError || _vm.isSavingSuccess},on:{\"closeModal\":_vm.onClickCancel},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [(\n        _vm.getFilteredTexts().length > 0 && !_vm.isSavingError && !_vm.isSavingSuccess\n      )?_c('div',{staticClass:\"columns\"},_vm._l((_vm.getFilteredTexts()),function(textLanguage,index){return _c('div',{key:'t_' + index,staticClass:\"column\"},[_c('div',{staticClass:\"title is-5\"},[_vm._v(\" \"+_vm._s(_vm.$t('LanguageLabels.Language' + textLanguage.LanguageId))+\" \")]),_c('div',[_c('div',{staticClass:\"control\"},[_c('ui-text-editor',{attrs:{\"id\":'editor' + index},model:{value:(textLanguage.Footer),callback:function ($$v) {_vm.$set(textLanguage, \"Footer\", $$v)},expression:\"textLanguage.Footer\"}})],1)])])}),0):_vm._e(),(_vm.isSavingSuccess)?_c('section',{staticClass:\"section\"},[_c('div',{staticClass:\"container has-text-centered\"},[_c('success-animation'),_c('div',{staticClass:\"title\"},[_vm._v(\" \"+_vm._s(_vm.$t( 'Components.Settings.Invoice.ModalEditInvoiceText.Message_Succes' ))+\" \")])],1)]):_vm._e(),(_vm.isSavingError)?_c('section',{staticClass:\"section\"},[_c('div',{staticClass:\"container has-text-centered\"},[_c('error-animation'),_c('div',{staticClass:\"title\"},[_vm._v(\" \"+_vm._s(_vm.$t( 'Components.Settings.Invoice.ModalEditInvoiceText.Message_Error' ))+\" \")])],1)]):_vm._e()]},proxy:true}])},[_c('template',{slot:\"modalTitle\"})],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n  <ui-component-modal\n    :modalTitle=\"\n      $t('Components.Settings.Invoice.ModalEditInvoiceText.Modal_Title')\n    \"\n    modalSize=\"large\"\n    :isSaving=\"isSaving\"\n    :onClickCancel=\"onClickCancel\"\n    :onClickSave=\"saveInvoiceTexts\"\n    :showModal=\"showModal\"\n    :hideFooterButtons=\"isSavingError || isSavingSuccess\"\n    @closeModal=\"onClickCancel\"\n  >\n    <template slot=\"modalTitle\"></template>\n    <template v-slot:content>\n      <div\n        class=\"columns\"\n        v-if=\"\n          getFilteredTexts().length > 0 && !isSavingError && !isSavingSuccess\n        \"\n      >\n        <div\n          class=\"column\"\n          v-for=\"(textLanguage, index) in getFilteredTexts()\"\n          :key=\"'t_' + index\"\n        >\n          <div class=\"title is-5\">\n            {{ $t('LanguageLabels.Language' + textLanguage.LanguageId) }}\n          </div>\n\n          <div>\n            <div class=\"control\">\n              <ui-text-editor\n                :id=\"'editor' + index\"\n                v-model=\"textLanguage.Footer\"\n              ></ui-text-editor>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <section v-if=\"isSavingSuccess\" class=\"section\">\n        <div class=\"container has-text-centered\">\n          <success-animation />\n\n          <div class=\"title\">\n            {{\n              $t(\n                'Components.Settings.Invoice.ModalEditInvoiceText.Message_Succes'\n              )\n            }}\n          </div>\n        </div>\n      </section>\n\n      <section v-if=\"isSavingError\" class=\"section\">\n        <div class=\"container has-text-centered\">\n          <error-animation />\n\n          <div class=\"title\">\n            {{\n              $t(\n                'Components.Settings.Invoice.ModalEditInvoiceText.Message_Error'\n              )\n            }}\n          </div>\n        </div>\n      </section>\n    </template>\n  </ui-component-modal>\n</template>\n\n<script>\nimport invoiceProvider from '@/providers/invoice'\n\nconst ErrorAnimation = () => import('@/components/UI/Components/ErrorAnimation')\nconst SuccessAnimation = () =>\n  import('@/components/UI/Components/SuccessAnimation')\n\nexport default {\n  components: {\n    'error-animation': ErrorAnimation,\n    'success-animation': SuccessAnimation,\n  },\n\n  props: {\n    showModal: {\n      type: Boolean,\n      default: false,\n    },\n    onClickCancel: {\n      type: Function,\n      required: true,\n    },\n    invoiceTexts: {\n      default: function () {\n        return []\n      },\n      type: Array,\n    },\n\n    mailType: {\n      default: 'Standard',\n      type: String,\n    },\n  },\n\n  data() {\n    return {\n      isSaving: false,\n      isSavingError: false,\n      isSavingSuccess: false,\n      mInvoiceTexts: JSON.parse(JSON.stringify(this.invoiceTexts)),\n      test: this.getFilteredTexts(),\n    }\n  },\n\n  methods: {\n    getFilteredTexts() {\n      let texts = []\n\n      if (this.mInvoiceTexts && this.mInvoiceTexts.length > 0) {\n        texts = this.mInvoiceTexts.filter(\n          (it) => it.InvoiceMailType === this.mailType\n        )\n      }\n      return texts\n    },\n\n    cancelEditInvoiceTexts() {\n      this.$emit('cancelEditInvoiceTexts')\n    },\n\n    saveInvoiceTexts() {\n      invoiceProvider.methods\n        .updateLocationInvoiceTexts(this.mInvoiceTexts)\n        .then((response) => {\n          if (response.status === 204) {\n            this.$emit('saveInvoiceTexts', this.mInvoiceTexts)\n\n            this.onClickCancel()\n          }\n        })\n        .catch((error) => {\n          this.isSavingError = true\n        })\n        .finally(() => {\n          this.isSaving = false\n        })\n    },\n  },\n}\n</script>\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalEditInvoiceText.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalEditInvoiceText.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ModalEditInvoiceText.vue?vue&type=template&id=0e92ec30\"\nimport script from \"./ModalEditInvoiceText.vue?vue&type=script&lang=js\"\nexport * from \"./ModalEditInvoiceText.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\nexport default component.exports"],"sourceRoot":""}