{"version":3,"sources":["webpack:///src/components/Vouchers/ModalDeleteVoucher.vue","webpack:///./src/components/Vouchers/ModalDeleteVoucher.vue","webpack:///./src/components/Vouchers/ModalDeleteVoucher.vue?2027","webpack:///./src/components/Vouchers/ModalDeleteVoucher.vue?2438","webpack:///./src/components/Vouchers/ModalDeleteVoucher.vue?9678"],"names":["BaseCheckbox","components","props","showModal","type","Boolean","default","onClickCancel","Function","required","voucher","Object","data","isDeleting","isDeletingSuccess","isDeletingError","isDeleteConfirmed","locationId","Number","$route","params","mVoucher","computed","created","JSON","parse","stringify","methods","deleteVoucher","_this","self","voucherProvider","deleteVoucherLocation","Id","then","response","status","setTimeout","$emit","catch","error","finally","render","_vm","_c","_self","attrs","modalTitle","$t","confirmButtonCssClass","buttonLabelConfirm","isSaving","isSavingSuccess","isSavingError","hideFooterButtons","disableSaveButton","onClickSave","savingSuccessMessage","on","closeModal","scopedSlots","_u","key","fn","staticClass","_v","_s","name","Name","label","model","value","callback","$$v","expression","proxy","slot","staticRenderFns","_withStripped"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA;AACA;AACA;AACA;AAEA,IAAAA,YAAA,YAAAA,aAAA;EAAA,OACA,sXAEA;AAAA;AAEe;EACfC,UAAA;IACAD,YAAA,EAAAA;EACA;EAEAE,KAAA;IACAC,SAAA;MACAC,IAAA,EAAAC,OAAA;MACAC,OAAA;IACA;IAEAC,aAAA;MACAH,IAAA,EAAAI,QAAA;MACAC,QAAA;IACA;IAEAC,OAAA;MACAN,IAAA,EAAAO,MAAA;MACAL,OAAA;IACA;EACA;EAEAM,IAAA,WAAAA,KAAA;IACA;MACAC,UAAA;MACAC,iBAAA;MACAC,eAAA;MACAC,iBAAA;MACAC,UAAA,EAAAC,MAAA,MAAAC,MAAA,CAAAC,MAAA,CAAAH,UAAA;MACAI,QAAA;IACA;EACA;EAEAC,QAAA;EAEAC,OAAA,WAAAA,QAAA;IACA,KAAAF,QAAA,GAAAG,IAAA,CAAA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ACF,CAAC;AACH,CAAC;AACD,IAAIC,eAAe,GAAG,EAAE;AACxBnC,MAAM,CAACoC,aAAa,GAAG,IAAI;;;;;;;;;;;;;;AC/E3B;AAAA;AAAA;AAAA;AAAgG;AAC3B;AACL;;;AAGhE;AAC6F;AAC7F,gBAAgB,mHAAU;AAC1B,EAAE,+FAAM;AACR,EAAE,oGAAM;AACR,EAAE,6GAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;;ACtCf;AAA0S,CAAgB,oVAAG,EAAC,C;;;;;;;;;;;;;ACA9T;AAAA;AAAA;AAAA;AAAA","file":"js/449.js?id=456771ae3d923bc698c9","sourcesContent":["<template>\n  <ui-component-modal\n    :modalTitle=\"$t('Components.Vouchers.DeleteVoucher.Modal_Title')\"\n    confirmButtonCssClass=\"is-danger\"\n    :buttonLabelConfirm=\"$t('Form.Control.Delete')\"\n    :isSaving=\"isDeleting\"\n    :isSavingSuccess=\"isDeletingSuccess\"\n    :isSavingError=\"isDeletingError\"\n    :hideFooterButtons=\"isDeletingError || isDeletingSuccess\"\n    :disableSaveButton=\"!isDeleteConfirmed\"\n    :onClickCancel=\"onClickCancel\"\n    :onClickSave=\"deleteVoucher\"\n    :showModal=\"showModal\"\n    :savingSuccessMessage=\"$t(`Components.Vouchers.DeleteVoucher.Message_DeletingSuccess`)\"\n    @closeModal=\"onClickCancel\"\n  >\n    <template slot=\"modalTitle\"></template>\n    <template v-slot:content>\n      <div class=\"has-margin-bottom is-size-5 has-text-centered\">\n        {{\n          $t(\n            `Components.Vouchers.DeleteVoucher.Message_AreYouSureVoucherDelete`, { name: voucher.Name }\n          )\n        }}\n      </div>\n\n      <div class=\"has-text-centered\">\n        <BaseCheckbox\n          v-model=\"isDeleteConfirmed\"\n          class=\"has-text-left\"\n          :label=\"\n            $t(`Components.Vouchers.DeleteVoucher.Checkbox_Option_YesImSure`)\n          \"\n        />\n      </div>\n    </template>\n  </ui-component-modal>\n</template>\n\n<script>\nimport Vue from 'vue'\nimport { mapState, mapMutations } from 'vuex'\nimport { EventBus } from '@/eventbus/event-bus'\nimport voucherProvider from '@/providers/voucher'\n\nconst BaseCheckbox = () =>\n  import(\n    /* webpackChunkName: \"settings-options\" */ '@/components/UI/Form/BaseCheckbox'\n  )\n\nexport default {\n  components: {\n    BaseCheckbox,\n  },\n\n  props: {\n    showModal: {\n      type: Boolean,\n      default: false,\n    },\n\n    onClickCancel: {\n      type: Function,\n      required: true,\n    },\n\n    voucher: {\n      type: Object,\n      default: null,\n    },\n  },\n\n  data() {\n    return {\n      isDeleting: false,\n      isDeletingSuccess: false,\n      isDeletingError: false,\n      isDeleteConfirmed: false,\n      locationId: Number(this.$route.params.locationId),\n      mVoucher: null,\n    }\n  },\n\n  computed: {},\n\n  created() {\n    this.mVoucher = JSON.parse(JSON.stringify(this.voucher))\n  },\n\n  methods: {\n    deleteVoucher() {\n      let self = this\n\n      if (!self.isDeleting) {\n        self.isDeleting = true\n\n        voucherProvider.methods\n          .deleteVoucherLocation(this.mVoucher.Id, this.locationId)\n          .then((response) => {\n            this.isDeletingSuccess = true\n\n            if (response.status === 200) {\n              setTimeout(() => {\n                this.$emit('voucherDeleted', response.data)\n                this.onClickCancel()\n              }, 1500)\n            }\n          })\n          .catch((error) => {\n            this.isDeletingError = true\n          })\n          .finally(() => {\n            this.isDeleting = false\n          })\n      }\n    },\n  },\n}\n</script>\n","var render = function render() {\n  var _vm = this,\n    _c = _vm._self._c\n  return _c(\n    \"ui-component-modal\",\n    {\n      attrs: {\n        modalTitle: _vm.$t(\"Components.Vouchers.DeleteVoucher.Modal_Title\"),\n        confirmButtonCssClass: \"is-danger\",\n        buttonLabelConfirm: _vm.$t(\"Form.Control.Delete\"),\n        isSaving: _vm.isDeleting,\n        isSavingSuccess: _vm.isDeletingSuccess,\n        isSavingError: _vm.isDeletingError,\n        hideFooterButtons: _vm.isDeletingError || _vm.isDeletingSuccess,\n        disableSaveButton: !_vm.isDeleteConfirmed,\n        onClickCancel: _vm.onClickCancel,\n        onClickSave: _vm.deleteVoucher,\n        showModal: _vm.showModal,\n        savingSuccessMessage: _vm.$t(\n          `Components.Vouchers.DeleteVoucher.Message_DeletingSuccess`\n        ),\n      },\n      on: { closeModal: _vm.onClickCancel },\n      scopedSlots: _vm._u([\n        {\n          key: \"content\",\n          fn: function () {\n            return [\n              _c(\n                \"div\",\n                {\n                  staticClass: \"has-margin-bottom is-size-5 has-text-centered\",\n                },\n                [\n                  _vm._v(\n                    \" \" +\n                      _vm._s(\n                        _vm.$t(\n                          `Components.Vouchers.DeleteVoucher.Message_AreYouSureVoucherDelete`,\n                          { name: _vm.voucher.Name }\n                        )\n                      ) +\n                      \" \"\n                  ),\n                ]\n              ),\n              _c(\n                \"div\",\n                { staticClass: \"has-text-centered\" },\n                [\n                  _c(\"BaseCheckbox\", {\n                    staticClass: \"has-text-left\",\n                    attrs: {\n                      label: _vm.$t(\n                        `Components.Vouchers.DeleteVoucher.Checkbox_Option_YesImSure`\n                      ),\n                    },\n                    model: {\n                      value: _vm.isDeleteConfirmed,\n                      callback: function ($$v) {\n                        _vm.isDeleteConfirmed = $$v\n                      },\n                      expression: \"isDeleteConfirmed\",\n                    },\n                  }),\n                ],\n                1\n              ),\n            ]\n          },\n          proxy: true,\n        },\n      ]),\n    },\n    [_c(\"template\", { slot: \"modalTitle\" })],\n    2\n  )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./ModalDeleteVoucher.vue?vue&type=template&id=4e98b480\"\nimport script from \"./ModalDeleteVoucher.vue?vue&type=script&lang=js\"\nexport * from \"./ModalDeleteVoucher.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\n/* hot reload */\nif (module.hot) {\n  var api = require(\"/github/workspace/node_modules/vue-hot-reload-api/dist/index.js\")\n  api.install(require('vue'))\n  if (api.compatible) {\n    module.hot.accept()\n    if (!api.isRecorded('4e98b480')) {\n      api.createRecord('4e98b480', component.options)\n    } else {\n      api.reload('4e98b480', component.options)\n    }\n    module.hot.accept(\"./ModalDeleteVoucher.vue?vue&type=template&id=4e98b480\", function () {\n      api.rerender('4e98b480', {\n        render: render,\n        staticRenderFns: staticRenderFns\n      })\n    })\n  }\n}\ncomponent.options.__file = \"src/components/Vouchers/ModalDeleteVoucher.vue\"\nexport default component.exports","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../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!./ModalDeleteVoucher.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../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!./ModalDeleteVoucher.vue?vue&type=script&lang=js\"","export * from \"-!../../../node_modules/cache-loader/dist/cjs.js?{\\\"cacheDirectory\\\":\\\"node_modules/.cache/vue-loader\\\",\\\"cacheIdentifier\\\":\\\"381a4baa-vue-loader-template\\\"}!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalDeleteVoucher.vue?vue&type=template&id=4e98b480\""],"sourceRoot":""}