{"version":3,"sources":["webpack:///./src/components/Reservations/ModalDeleteOption.vue","webpack:///src/components/Reservations/ModalDeleteOption.vue","webpack:///./src/components/Reservations/ModalDeleteOption.vue?2e73","webpack:///./src/components/Reservations/ModalDeleteOption.vue?e697"],"names":["render","_vm","this","_c","_self","attrs","$t","onClickCancel","showModal","deleteReservationOption","isDeleting","isDeletingError","isDeleteConfirmed","on","scopedSlots","_u","key","fn","staticClass","domProps","_s","name","option","OptionName","model","value","callback","$$v","expression","reservation","ReservationSet","length","_v","class","changeAllInSet","$event","_e","proxy","slot","staticRenderFns","BaseCheckbox","Message","components","props","type","Boolean","default","Function","required","reservationDate","Object","data","computed","_objectSpread","mapState","methods","mapMutations","_this","self","optionIndex","Options","findIndex","o","Id","splice","criteria","ChangeAllInSet","reservationProvider","Key","then","response","status","setReservation","isDeletingSuccess","EventBus","$emit","message","catch","error","finally","isSavingError","component"],"mappings":"uHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,qBAAqB,CAACE,MAAM,CAAC,WAAaJ,EAAIK,GAAG,+DAA+D,sBAAwB,YAAY,cAAgBL,EAAIM,cAAc,UAAYN,EAAIO,UAAU,mBAAqBP,EAAIK,GAAG,uBAAuB,YAAcL,EAAIQ,wBAAwB,SAAWR,EAAIS,WAAW,cAAgBT,EAAIU,gBAAgB,kBAAoBV,EAAIU,gBAAgB,mBAAqBV,EAAIW,mBAAmBC,GAAG,CAAC,WAAaZ,EAAIM,eAAeO,YAAYb,EAAIc,GAAG,CAAC,CAACC,IAAI,UAAUC,GAAG,WAAW,MAAO,CAACd,EAAG,MAAM,CAACe,YAAY,gDAAgDC,SAAS,CAAC,UAAYlB,EAAImB,GAC1rBnB,EAAIK,GAAG,uDAAwD,CAC7De,KAAMpB,EAAIqB,OAAOC,iBAEhBpB,EAAG,MAAM,CAACe,YAAY,qBAAqB,CAACf,EAAG,eAAe,CAACe,YAAY,gBAAgBb,M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C,QACAC,SAAA,GAGAvC,cAAA,CACAqC,KAAAG,SACAC,UAAA,GAGAC,gBAAA,CACAL,KAAAM,OACAJ,QAAA,KACAE,UAAA,IAIAG,KAAA,WACA,OACAjB,gBAAA,EACAtB,mBAAA,EACAF,YAAA,EACAC,iBAAA,IAIAyC,SAAAC,eAAA,GACAC,eAAA,qCAGAC,QAAAF,8BAAA,GACAG,eAAA,4CAEA/C,wBAAA,eAAAgD,EAAA,KACAC,EAAA,KAEAC,EAAAD,EAAAT,gBAAAW,QAAAC,WACA,SAAAC,GAAA,OAAAA,EAAAC,KAAAL,EAAApC,OAAAyC,MAGA,GAAAJ,GAAA,GAGA,GAFAD,EAAAT,gBAAAW,QAAAI,OAAAL,EAAA,IAEAD,EAAAhD,WAAA,CACAgD,EAAAhD,YAAA,EAEA,IAAAuD,EAAA,CACAF,GAAAL,EAAApC,OAAAyC,GACAG,eAAAR,EAAAxB,gBAGAiC,OAAAZ,QACA9C,wBAAAiD,EAAA7B,YAAAuC,IAAAH,GACAI,MAAA,SAAAC,GACA,MAAAA,EAAAC,SACAb,EAAAc,eAAAF,EAAAnB,MAEAO,EAAAe,mBAAA,EAEAC,OAAAC,MAAA,aACA/B,KAAA,OACAgC,QAAAnB,EAAAnD,GAAA,kEAGAmD,EAAAlD,oBAGAsE,OAAA,SAAAC,GACApB,EAAA/C,iBAAA,KAEAoE,SAAA,WACArB,EAAAhD,YAAA,WAIAgD,EAAAsB,eAAA,EACAtB,EAAAhD,YAAA,MCzLyW,I,YCOrWuE,EAAY,eACd,EACAjF,EACAuC,GACA,EACA,KACA,KACA,MAIa,aAAA0C,E","file":"js/chunk-2d0c8e35.js?id=c859784d043062c919f5","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('ui-component-modal',{attrs:{\"modalTitle\":_vm.$t('Components.Reservation.ModalDeleteOption.Header_ModalHeader'),\"confirmButtonCssClass\":\"is-danger\",\"onClickCancel\":_vm.onClickCancel,\"showModal\":_vm.showModal,\"buttonLabelConfirm\":_vm.$t('Form.Control.Delete'),\"onClickSave\":_vm.deleteReservationOption,\"isSaving\":_vm.isDeleting,\"isSavingError\":_vm.isDeletingError,\"hideFooterButtons\":_vm.isDeletingError,\"disableSaveButton\":!_vm.isDeleteConfirmed},on:{\"closeModal\":_vm.onClickCancel},scopedSlots:_vm._u([{key:\"content\",fn:function(){return [_c('div',{staticClass:\"has-margin-bottom is-size-5 has-text-centered\",domProps:{\"innerHTML\":_vm._s(\n        _vm.$t('Components.Reservation.ModalDeleteOption.Text_Delete', {\n          name: _vm.option.OptionName,\n        })\n      )}}),_c('div',{staticClass:\"has-text-centered\"},[_c('BaseCheckbox',{staticClass:\"has-text-left\",attrs:{\"label\":_vm.$t('Components.Reservation.ModalDeleteOption.Label_YesSure')},model:{value:(_vm.isDeleteConfirmed),callback:function ($$v) {_vm.isDeleteConfirmed=$$v},expression:\"isDeleteConfirmed\"}})],1),(_vm.reservation.ReservationSet.length > 0)?_c('div',{staticClass:\"has-margin-top\"},[_c('table',{staticClass:\"table is-fullwidth\"},[_c('tbody',[_c('tr',[_c('td',[_vm._v(\" \"+_vm._s(_vm.$t( 'Components.Reservation.ModalDeleteOption.Label_ChangeAllInSet' ))+\" \")]),_c('td',[_c('div',{staticClass:\"tabs is-toggle is-small\"},[_c('ul',[_c('li',{class:{ 'is-active': _vm.changeAllInSet === false }},[_c('a',{on:{\"click\":function($event){_vm.changeAllInSet = false}}},[_c('span',[_vm._v(_vm._s(_vm.$t( 'Components.Reservation.ModalDeleteOption.Label_No' )))])])]),_c('li',{class:{ 'is-active': _vm.changeAllInSet === true }},[_c('a',{on:{\"click\":function($event){_vm.changeAllInSet = true}}},[_c('span',[_vm._v(_vm._s(_vm.$t( 'Components.Reservation.ModalDeleteOption.Label_Yes' )))])])])])])])])])]),(_vm.changeAllInSet)?_c('Message',{attrs:{\"message\":_vm.$t(\n            'Components.Reservation.ModalDeleteOption.Message_ChangeAllInSet'\n          )}}):_vm._e()],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.Reservation.ModalDeleteOption.Header_ModalHeader')\n    \"\n    confirmButtonCssClass=\"is-danger\"\n    :onClickCancel=\"onClickCancel\"\n    :showModal=\"showModal\"\n    :buttonLabelConfirm=\"$t('Form.Control.Delete')\"\n    :onClickSave=\"deleteReservationOption\"\n    :isSaving=\"isDeleting\"\n    :isSavingError=\"isDeletingError\"\n    :hideFooterButtons=\"isDeletingError\"\n    :disableSaveButton=\"!isDeleteConfirmed\"\n    @closeModal=\"onClickCancel\"\n  >\n    <template slot=\"modalTitle\"></template>\n    <template v-slot:content>\n      <div\n        class=\"has-margin-bottom is-size-5 has-text-centered\"\n        v-html=\"\n          $t('Components.Reservation.ModalDeleteOption.Text_Delete', {\n            name: option.OptionName,\n          })\n        \"\n      ></div>\n\n      <div class=\"has-text-centered\">\n        <BaseCheckbox\n          v-model=\"isDeleteConfirmed\"\n          class=\"has-text-left\"\n          :label=\"$t('Components.Reservation.ModalDeleteOption.Label_YesSure')\"\n        />\n      </div>\n\n      <div\n        v-if=\"reservation.ReservationSet.length > 0\"\n        class=\"has-margin-top\"\n      >\n        <table class=\"table is-fullwidth\">\n          <tbody>\n            <tr>\n              <td>\n                {{\n                  $t(\n                    'Components.Reservation.ModalDeleteOption.Label_ChangeAllInSet'\n                  )\n                }}\n              </td>\n              <td>\n                <div class=\"tabs is-toggle is-small\">\n                  <ul>\n                    <li :class=\"{ 'is-active': changeAllInSet === false }\">\n                      <a @click=\"changeAllInSet = false\">\n                        <span>{{\n                          $t(\n                            'Components.Reservation.ModalDeleteOption.Label_No'\n                          )\n                        }}</span>\n                      </a>\n                    </li>\n                    <li :class=\"{ 'is-active': changeAllInSet === true }\">\n                      <a @click=\"changeAllInSet = true\">\n                        <span>{{\n                          $t(\n                            'Components.Reservation.ModalDeleteOption.Label_Yes'\n                          )\n                        }}</span>\n                      </a>\n                    </li>\n                  </ul>\n                </div>\n              </td>\n            </tr>\n          </tbody>\n        </table>\n\n        <Message\n          v-if=\"changeAllInSet\"\n          :message=\"\n            $t(\n              'Components.Reservation.ModalDeleteOption.Message_ChangeAllInSet'\n            )\n          \"\n        />\n      </div>\n    </template>\n  </ui-component-modal>\n</template>\n\n<script>\nimport { mapState, mapMutations } from 'vuex'\nimport { EventBus } from '@/eventbus/event-bus'\nimport reservationProvider from '@/providers/reservation'\n\nconst BaseCheckbox = () =>\n  import(\n    /* webpackChunkName: \"settings-options\" */ '@/components/UI/Form/BaseCheckbox'\n  )\nconst Message = () => import('@/components/UI/Message')\n\nexport default {\n  components: {\n    BaseCheckbox,\n    Message,\n  },\n\n  props: {\n    option: null,\n    showModal: {\n      type: Boolean,\n      default: false,\n    },\n\n    onClickCancel: {\n      type: Function,\n      required: true,\n    },\n\n    reservationDate: {\n      type: Object,\n      default: null,\n      required: true\n    }\n  },\n\n  data() {\n    return {\n      changeAllInSet: false,\n      isDeleteConfirmed: false,\n      isDeleting: false,\n      isDeletingError: false,\n    }\n  },\n\n  computed: {\n    ...mapState('reservationStore', ['reservation']),\n  },\n\n  methods: {\n    ...mapMutations('reservationStore', ['setReservation']),\n\n    deleteReservationOption() {\n      let self = this\n\n      let optionIndex = self.reservationDate.Options.findIndex(\n        (o) => o.Id === self.option.Id\n      )\n\n      if (optionIndex > -1) {\n        self.reservationDate.Options.splice(optionIndex, 1)\n\n        if (!self.isDeleting) {\n          self.isDeleting = true\n\n          let criteria = {\n            Id: self.option.Id,\n            ChangeAllInSet: self.changeAllInSet,\n          }\n\n          reservationProvider.methods\n            .deleteReservationOption(self.reservation.Key, criteria)\n            .then((response) => {\n              if (response.status === 200) {\n                self.setReservation(response.data)\n\n                self.isDeletingSuccess = true\n\n                EventBus.$emit('showToast', {\n                  type: 'info',\n                  message: this.$t('Components.Reservation.ModalDeleteOption.Toast_OptionDeleted'),\n                })\n\n                this.onClickCancel()\n              }\n            })\n            .catch((error) => {\n              self.isDeletingError = true\n            })\n            .finally(() => {\n              self.isDeleting = false\n            })\n        }\n      } else {\n        self.isSavingError = true\n        self.isDeleting = 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!./ModalDeleteOption.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!./ModalDeleteOption.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./ModalDeleteOption.vue?vue&type=template&id=ed426dec\"\nimport script from \"./ModalDeleteOption.vue?vue&type=script&lang=js\"\nexport * from \"./ModalDeleteOption.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":""}