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AACE,YAAY,eAAe,CAACL,EAAI4B,GAAG5B,EAAI6B,GAAG7B,EAAIV,GAAG4B,EAAO,QAAQlB,EAAI8B,KAAK,IAAI,MAAK,MAAS,GAAG9B,EAAI4B,GAAG,KAAKzB,EAAG,MAAM,CAACE,YAAY,kBAAkB,CAACF,EAAG,SAAS,CAACE,YAAY,qBAAqBC,MAAM,CAAC,SAAWN,EAAIvB,YAAY,CAACuB,EAAI4B,GAAG5B,EAAI6B,GAAG7B,EAAIV,GAAG,mBAAmBU,EAAI4B,GAAG,KAAKzB,EAAG,aAAa,CAACG,MAAM,CAAC,KAAO,SAAS,CAACH,EAAG,MAAM,CAACiB,WAAW,CAAC,CAACzB,KAAK,OAAO0B,QAAQ,SAASC,MAAOtB,EAAW,QAAEuB,WAAW,YAAYlB,YAAY,+BAA+BmB,MAAMxB,EAAIxB,aAAa,CAACwB,EAAI4B,GAAG,eAAe5B,EAAI6B,GAAG7B,EAAIzB,SAAS,mBAAmB,GAAG,QAAQ,EAAE,EACr6BwD,EAAkB,E","sources":["webpack:///./resources/area/web/default/js/components/NewsletterBlockWidget.vue?f3bb","webpack:///./resources/area/web/default/js/components/NewsletterBlockWidget.vue?a539","webpack:///./resources/area/web/default/js/components/NewsletterBlockWidget.vue?1e02","webpack:///./resources/area/web/default/js/components/NewsletterBlockWidget.vue?3730"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\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 {email, required} from 'vee-validate/dist/rules';\nimport {ValidationProvider, ValidationObserver, extend} from 'vee-validate';\nimport {TranslateResult} from \"vue-i18n\";\n\nextend('required', required);\nextend('email', email);\n\n@Component({\n  name: 'newsletter-block-widget',\n  components: {\n    ValidationProvider,\n    ValidationObserver\n  }\n})\n\nexport default class extends Vue {\n  @Prop() private size: string;\n\n  private userEmail: string = '';\n  private firstName: string = '';\n  private lastName: string = '';\n  private message: TranslateResult = '';\n  private messageType: string = '--success';\n  private isLoading: boolean = false;\n\n  private async addSubscriber(): Promise<void> {\n    this.isLoading = true;\n    try {\n      const {data} = await this.$mageClient.post(`/rest/V1/sellvation-newsletter/subscribe`, {\n        subscriberData: {\n          email: this.userEmail,\n          firstname: this.firstName,\n          lastname: this.lastName,\n          url: window.location.href\n        }\n      });\n      if (data === 1) {\n        this.message = this.$t('Thank you! Confirm your subscription in your email.');\n      } else {\n        this.message = this.$t('Subscription failed, please try again later.');\n        this.messageType = '--error';\n      }\n    } catch (e) {\n      this.message = this.$t('Subscription failed, please try again later.');\n      this.messageType = '--error';\n    } finally {\n      this.isLoading = false;\n      setTimeout(() => {\n        this.message = null;\n        this.messageType = '--success';\n      }, 4000);\n    }\n  }\n}\n","import { render, staticRenderFns } from \"./NewsletterBlockWidget.vue?vue&type=template&id=2f735030&scoped=true&\"\nimport script from \"./NewsletterBlockWidget.vue?vue&type=script&lang=ts&\"\nexport * from \"./NewsletterBlockWidget.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./NewsletterBlockWidget.vue?vue&type=style&index=0&id=2f735030&scoped=true&lang=css&\"\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  \"2f735030\",\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!./NewsletterBlockWidget.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!./NewsletterBlockWidget.vue?vue&type=script&lang=ts&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"newsletter__block__widget\"},[_c('ValidationObserver',{attrs:{\"slim\":\"\"},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar handleSubmit = ref.handleSubmit;\nreturn [_c('form',{attrs:{\"enctype\":\"application/x-www-form-urlencoded\"},on:{\"submit\":function($event){$event.preventDefault();$event.stopPropagation();return handleSubmit(_vm.addSubscriber)}}},[(_vm.size === 'large')?_c('div',[_c('div',{staticClass:\"field__container\"},[_c('ValidationProvider',{attrs:{\"name\":_vm.$t('First name'),\"rules\":\"required\",\"skip-if-empty\":false,\"slim\":\"\"},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar errors = ref.errors;\nvar classes = ref.classes;\nreturn [_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.firstName),expression:\"firstName\"}],class:classes,attrs:{\"type\":\"text\",\"name\":\"firstname\",\"placeholder\":_vm.$t('First name')},domProps:{\"value\":(_vm.firstName)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.firstName=$event.target.value}}}),_vm._v(\" \"),(errors.length)?_c('span',{staticClass:\"field-error\"},[_vm._v(_vm._s(_vm.$t(errors[0])))]):_vm._e()]}}],null,true)})],1),_vm._v(\" \"),_c('div',{staticClass:\"field__container\"},[_c('ValidationProvider',{attrs:{\"name\":_vm.$t('Last name'),\"rules\":\"required\",\"skip-if-empty\":false,\"slim\":\"\"},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar errors = ref.errors;\nvar classes = ref.classes;\nreturn [_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.lastName),expression:\"lastName\"}],class:classes,attrs:{\"type\":\"text\",\"name\":\"lastname\",\"placeholder\":_vm.$t('Last name')},domProps:{\"value\":(_vm.lastName)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.lastName=$event.target.value}}}),_vm._v(\" \"),(errors.length)?_c('span',{staticClass:\"field-error\"},[_vm._v(_vm._s(_vm.$t(errors[0])))]):_vm._e()]}}],null,true)})],1)]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"field__container\"},[_c('ValidationProvider',{attrs:{\"name\":_vm.$t('Email address'),\"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('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.userEmail),expression:\"userEmail\"}],class:classes,attrs:{\"type\":\"email\",\"name\":\"email\",\"placeholder\":_vm.$t('Email address')},domProps:{\"value\":(_vm.userEmail)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.userEmail=$event.target.value}}}),_vm._v(\" \"),(errors.length)?_c('span',{staticClass:\"field-error\"},[_vm._v(_vm._s(_vm.$t(errors[0])))]):_vm._e()]}}],null,true)})],1),_vm._v(\" \"),_c('div',{staticClass:\"field__actions\"},[_c('button',{staticClass:\"--button --chevron\",attrs:{\"disabled\":_vm.isLoading}},[_vm._v(_vm._s(_vm.$t('Subscribe')))])]),_vm._v(\" \"),_c('transition',{attrs:{\"name\":\"fade\"}},[_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.message),expression:\"message\"}],staticClass:\"global__message--bg --margin\",class:_vm.messageType},[_vm._v(\"\\n          \"+_vm._s(_vm.message)+\"\\n        \")])])],1)]}}])})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }"],"names":["extend","required","email","Vue","userEmail","firstName","lastName","message","messageType","isLoading","addSubscriber","this","data","$mageClient","post","subscriberData","firstname","lastname","url","window","location","href","$t","e","setTimeout","Prop","Component","name","components","ValidationProvider","ValidationObserver","render","_vm","_h","$createElement","_c","_self","staticClass","attrs","scopedSlots","_u","key","fn","ref","handleSubmit","on","$event","preventDefault","stopPropagation","size","errors","classes","directives","rawName","value","expression","class","domProps","target","composing","_v","_s","_e","staticRenderFns"],"sourceRoot":""}