"use strict";(self.webpackChunkNexoPOS_4x=self.webpackChunkNexoPOS_4x||[]).push([[8496],{8496:(e,t,s)=>{s.r(t),s.d(t,{default:()=>d});var i=s(7266),o=s(6386),l=s(8603),n=s(9671),a=s(7389);const r={name:"ns-pos-note-popup",data:function(){return{validation:new i.Z,fields:[{label:(0,a.__)("Note"),name:"note",value:"",description:(0,a.__)("More details about this order"),type:"textarea"},{label:(0,a.__)("Display On Receipt"),name:"note_visibility",value:"",options:[{label:(0,a.__)("Yes"),value:"visible"},{label:(0,a.__)("No"),value:"hidden"}],description:(0,a.__)("Will display the note on the receipt"),type:"switch"}]}},mounted:function(){var e=this;this.popupCloser(),this.fields.forEach((function(t){"note"===t.name?t.value=e.$popupParams.note:"note_visibility"===t.name&&(t.value=e.$popupParams.note_visibility)}))},methods:{__:a.__,popupResolver:o.Z,popupCloser:l.Z,closePopup:function(){this.popupResolver(!1)},saveNote:function(){if(!this.validation.validateFields(this.fields)){var e=this.validation.validateFieldsErrors(this.fields);return this.validation.triggerFieldsErrors(this.fields,e),this.$forceUpdate(),console.log(this.fields),n.kX.error((0,a.__)("Unable to proceed the form is not valid.")).subscribe()}return this.popupResolver(this.validation.extractFields(this.fields))}}};const d=(0,s(1900).Z)(r,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"shadow-lg bg-surface-tertiary w-95vw md:w-3/5-screen lg:w-2/5-screen"},[s("div",{staticClass:"p-2 flex justify-between items-center border-b border-surface-secondary"},[s("h3",{staticClass:"font-bold"},[e._v(e._s(e.__("Order Note")))]),e._v(" "),s("div",[s("ns-close-button",{on:{click:function(t){return e.closePopup()}}})],1)]),e._v(" "),s("div",{staticClass:"p-2"},e._l(e.fields,(function(e,t){return s("ns-field",{key:t,attrs:{field:e}})})),1),e._v(" "),s("div",{staticClass:"p-2 flex justify-end border-t border-surface-secondary"},[s("ns-button",{attrs:{type:"info"},on:{click:function(t){return e.saveNote()}}},[e._v("Save")])],1)])}),[],!1,null,null,null).exports}}]);