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AM/B,EAAI3B,wBAAwB,CAAC2B,EAAI0B,GAAG1B,EAAI4B,GAAG5B,EAAIgB,GAAGhB,EAAI5B,8BAA8B4B,EAAI8B,KAAK,IAAI,MAAK,MAAS,GAAG,QAAQ,EAAE,EACt2BE,EAAkB,E","sources":["webpack:///./resources/area/web/default/js/components/catalog/product/ProductOutOfStockNotification.vue?fe80","webpack:///./resources/area/web/default/js/components/catalog/product/ProductOutOfStockNotification.vue","webpack:///./resources/area/web/default/js/components/catalog/product/ProductOutOfStockNotification.vue?27f0","webpack:///./resources/area/web/default/js/components/catalog/product/ProductOutOfStockNotification.vue?fe37"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport {Component, Vue, Prop} from 'vue-property-decorator';\nimport {extend, ValidationObserver, ValidationProvider} from 'vee-validate';\nimport {email, required} from 'vee-validate/dist/rules';\n\nextend('required', required);\nextend('email', email);\n\n@Component({\n  name: 'catalog-product-out-of-stock-notification',\n  components: {\n    ValidationProvider,\n    ValidationObserver\n  }\n})\n\nexport default class extends Vue {\n  @Prop({type: String, default: ''}) private sku!: string;\n\n  private isSuccess: boolean = false;\n  private email: string = '';\n  private pending: boolean = false;\n  private stockNotificationMessage: string | null = null;\n  private stockNotificationClass: string = '--success';\n\n  private get productSku(): string {\n    return this.$store.state.CatalogProduct.productData.sku || this.sku || '';\n  }\n\n  private noSuccess() {\n    if (this.isSuccess) {\n      this.stockNotificationMessage = null;\n      this.isSuccess = false;\n    }\n  }\n\n  private async subscribe(): Promise<void> {\n    try {\n      this.pending = true;\n      await this.$solarClient.post(`/api/catalog/product/${this.productSku}/out-of-stock-notification`, {\n        email: this.email\n      }).then(response => {\n        if (response.data.success) {\n          this.stockNotificationMessage = 'You will be the first to receive an email when this product is back in stock.';\n          this.isSuccess = true;\n          this.email = '';\n          return;\n        }\n\n        this.stockNotificationClass = '--error';\n        this.stockNotificationMessage = 'Something went wrong with signing up.';\n      });\n    } catch (e) {\n      this.pending = false;\n      this.stockNotificationClass = '--error';\n      this.stockNotificationMessage = 'Something went wrong with signing up.';\n      return;\n    }\n    this.pending = false;\n  }\n}\n","import { render, staticRenderFns } from \"./ProductOutOfStockNotification.vue?vue&type=template&id=1f79fcd4&\"\nimport script from \"./ProductOutOfStockNotification.vue?vue&type=script&lang=ts&\"\nexport * from \"./ProductOutOfStockNotification.vue?vue&type=script&lang=ts&\"\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","import mod from \"-!../../../../../../../../node_modules/ts-loader/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ProductOutOfStockNotification.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../../../../../node_modules/ts-loader/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ProductOutOfStockNotification.vue?vue&type=script&lang=ts&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',[_c('ValidationObserver',{attrs:{\"slim\":\"\"},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar handleSubmit = ref.handleSubmit;\nreturn [_c('form',{on:{\"submit\":function($event){$event.stopPropagation();$event.preventDefault();return handleSubmit(_vm.subscribe)}}},[_c('ValidationProvider',{attrs:{\"name\":_vm.$t('Your email'),\"rules\":\"required|email\",\"skip-if-empty\":false,\"slim\":\"\"},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar errors = ref.errors;\nvar classes = ref.classes;\nreturn [_c('section',[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.email),expression:\"email\"}],ref:\"postcodeInput\",attrs:{\"placeholder\":_vm.$t('Your email'),\"type\":\"text\"},domProps:{\"value\":(_vm.email)},on:{\"input\":[function($event){if($event.target.composing){ return; }_vm.email=$event.target.value},_vm.noSuccess]}}),_vm._v(\" \"),_c('button',{staticClass:\"--button --chevron\",attrs:{\"type\":\"submit\",\"disabled\":_vm.pending}},[_vm._v(_vm._s(_vm.$t('Sign me up')))])]),_vm._v(\" \"),(errors.length && !_vm.isSuccess)?_c('span',{staticClass:\"global__message --error --margin--top\"},[_vm._v(_vm._s(_vm.$t(errors[0])))]):_vm._e(),_vm._v(\" \"),(_vm.stockNotificationMessage)?_c('span',{staticClass:\"global__message --margin--top\",class:_vm.stockNotificationClass},[_vm._v(_vm._s(_vm.$t(_vm.stockNotificationMessage)))]):_vm._e()]}}],null,true)})],1)]}}])})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }"],"names":["extend","required","email","Vue","isSuccess","pending","stockNotificationMessage","stockNotificationClass","productSku","this","$store","state","CatalogProduct","productData","sku","noSuccess","subscribe","$solarClient","post","then","response","data","success","e","Prop","type","String","default","Component","name","components","ValidationProvider","ValidationObserver","render","_vm","_h","$createElement","_c","_self","attrs","scopedSlots","_u","key","fn","ref","handleSubmit","on","$event","stopPropagation","preventDefault","$t","errors","classes","directives","rawName","value","expression","domProps","target","composing","_v","staticClass","_s","length","_e","class","staticRenderFns"],"sourceRoot":""}