{"version":3,"sources":["webpack:///src/components/Options/OptionTimeSelector.vue","webpack:///./src/components/Options/OptionTimeSelector.vue","webpack:///./src/components/Options/OptionTimeSelector.vue?efe2","webpack:///./src/components/Options/OptionTimeSelector.vue?f5eb","webpack:///./src/components/Options/OptionTimeSelector.vue?c41d"],"names":["components","VueSlider","props","option","type","Object","default","data","_this","formatter","v","concat","$options","filters","minutesToTime","values","isSaving","mOption","computed","_objectSpread","mapState","created","Location","AvailableStart","AvailableEnd","JSON","parse","stringify","methods","mapMutations","saveOption","_this2","self","optionProvider","saveLocationOptionSettings","then","response","status","index","optionsPageState","options","findIndex","o","Id","Vue","set","setOptionsPageState","EventBus","$emit","message","catch","e","isSavingError","finally","render","_vm","_c","_self","attrs","min","max","enableCross","interval","tooltip","on","model","value","callback","$$v","expression","_e","staticRenderFns","_withStripped"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AACA;AAEA;AACA;AAEe;EACfA,UAAA;IACAC,SAAA,EAAAA;EACA;EAEAC,KAAA;IACAC,MAAA;MACAC,IAAA,EAAAC,MAAA;MACAC,OAAA;IACA;EACA;EAEAC,IAAA,WAAAA,KAAA;IAAA,IAAAC,KAAA;IACA;MACAC,SAAA,WAAAA,UAAAC,CAAA;QAAA,UAAAC,MAAA,CAAAH,KAAA,CAAAI,QAAA,CAAAC,OAAA,CAAAC,aAAA,CAAAJ,CAAA;MAAA;MACAK,MAAA;MACAC,QAAA;MACAC,OAAA;IACA;EACA;EAEAC,QAAA,EAAAC,iIAAA,KACAC,6DAAA,sCACA;EAEAC,OAAA,WAAAA,QAAA;IACA,KAAAN,MAAA,IACA,KAAAZ,MAAA,CAAAmB,QAAA,CAAAC,cAAA,EACA,KAAApB,MAAA,CAAAmB,QAAA,CAAAE,YAAA,CACA;IAEA,KAAAP,OAAA,GAAAQ,IAAA,CAAAC,KAAA,CAAAD,IAAA,CAAAE,SAAA,MAAAxB,MAAA;EACA;EAEAyB,OAAA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CAACD,EAAE;EACnB,OAAOD,GAAG,CAACpD,MAAM,GACbqD,EAAE,CACA,KAAK,EACL,CACEA,EAAE,CAAC,WAAW,EAAE;IACdE,KAAK,EAAE;MACLC,GAAG,EAAE,CAAC;MACNC,GAAG,EAAE,IAAI;MACTC,WAAW,EAAE,KAAK;MAClBC,QAAQ,EAAE,EAAE;MACZC,OAAO,EAAE,QAAQ;MACjB,mBAAmB,EAAER,GAAG,CAAC9C;IAC3B,CAAC;IACDuD,EAAE,EAAE;MAAE,UAAU,EAAET,GAAG,CAACzB;IAAW,CAAC;IAClCmC,KAAK,EAAE;MACLC,KAAK,EAAEX,GAAG,CAACxC,MAAM;MACjBoD,QAAQ,EAAE,SAAVA,QAAQA,CAAYC,GAAG,EAAE;QACvBb,GAAG,CAACxC,MAAM,GAAGqD,GAAG;MAClB,CAAC;MACDC,UAAU,EAAE;IACd;EACF,CAAC,CAAC,CACH,EACD,CACF,CAAC,GACDd,GAAG,CAACe,EAAE,CAAC,CAAC;AACd,CAAC;AACD,IAAIC,eAAe,GAAG,EAAE;AACxBjB,MAAM,CAACkB,aAAa,GAAG,IAAI;;;;;;;;;;;;;;AC/B3B;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/380.js?id=a22ffdf7d01feae90d02","sourcesContent":["<template>\n  <div v-if=\"option\">\n    <VueSlider\n      v-model=\"values\"\n      :min=\"0\"\n      :max=\"1440\"\n      :enableCross=\"false\"\n      :interval=\"30\"\n      :tooltip=\"'always'\"\n      :tooltip-formatter=\"formatter\"\n      @drag-end=\"saveOption\"\n    />\n  </div>\n</template>\n\n<script>\nimport Vue from 'vue'\nimport { mapState, mapMutations } from 'vuex'\nimport { EventBus } from '@/eventbus/event-bus'\nimport optionProvider from '@/providers/option'\n\nimport VueSlider from 'vue-slider-component'\nimport 'vue-slider-component/theme/default.css'\n\nexport default {\n  components: {\n    VueSlider,\n  },\n\n  props: {\n    option: {\n      type: Object,\n      default: null,\n    },\n  },\n\n  data() {\n    return {\n      formatter: (v) => `${this.$options.filters.minutesToTime(v)}`,\n      values: [],\n      isSaving: false,\n      mOption: null\n    }\n  },\n\n  computed: {\n    ...mapState('optionStore', ['optionsPageState']),\n  },\n\n  created() {\n    this.values = [\n      this.option.Location.AvailableStart,\n      this.option.Location.AvailableEnd,\n    ]\n\n    this.mOption = JSON.parse(JSON.stringify(this.option))\n  },\n\n  methods: {\n    ...mapMutations('optionStore', ['setOptionsPageState']),\n\n    saveOption() {\n      let self = this\n      if (!self.isSaving) {\n        self.isSaving = true\n\n        this.mOption = JSON.parse(JSON.stringify(this.mOption))\n        self.mOption.Location.AvailableStart = this.values[0]\n        self.mOption.Location.AvailableEnd = this.values[1]\n\n        optionProvider.methods\n          .saveLocationOptionSettings(this.mOption.Location)\n          .then((response) => {\n            if (response.status === 200) {\n              let index = this.optionsPageState.options.findIndex(\n                (o) => o.Id === response.data.Id\n              )\n              if (index > -1) {\n                Vue.set(this.optionsPageState.options, index, response.data)\n\n                this.setOptionsPageState(this.optionsPageState)\n              }\n\n              // Send message to display toast on screen\n              EventBus.$emit('showToast', {\n                type: 'info',\n                message: 'Time slot updated',\n              })\n            }\n          })\n          .catch((e) => {\n            self.isSavingError = true\n          })\n          .finally(() => {\n            self.isSaving = false\n          })\n      }\n    },\n  },\n}\n</script>\n\n<style></style>\n","var render = function render() {\n  var _vm = this,\n    _c = _vm._self._c\n  return _vm.option\n    ? _c(\n        \"div\",\n        [\n          _c(\"VueSlider\", {\n            attrs: {\n              min: 0,\n              max: 1440,\n              enableCross: false,\n              interval: 30,\n              tooltip: \"always\",\n              \"tooltip-formatter\": _vm.formatter,\n            },\n            on: { \"drag-end\": _vm.saveOption },\n            model: {\n              value: _vm.values,\n              callback: function ($$v) {\n                _vm.values = $$v\n              },\n              expression: \"values\",\n            },\n          }),\n        ],\n        1\n      )\n    : _vm._e()\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./OptionTimeSelector.vue?vue&type=template&id=789cab42\"\nimport script from \"./OptionTimeSelector.vue?vue&type=script&lang=js\"\nexport * from \"./OptionTimeSelector.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('789cab42')) {\n      api.createRecord('789cab42', component.options)\n    } else {\n      api.reload('789cab42', component.options)\n    }\n    module.hot.accept(\"./OptionTimeSelector.vue?vue&type=template&id=789cab42\", function () {\n      api.rerender('789cab42', {\n        render: render,\n        staticRenderFns: staticRenderFns\n      })\n    })\n  }\n}\ncomponent.options.__file = \"src/components/Options/OptionTimeSelector.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!./OptionTimeSelector.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!./OptionTimeSelector.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!./OptionTimeSelector.vue?vue&type=template&id=789cab42\""],"sourceRoot":""}