(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5c6cbe87"],{"880a":function(e,t,n){"use strict";n.r(t);n("7f7f");var r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"card my-5"},[t("div",{staticClass:"card-header d-flex justify-content-between"},[t("h5",{staticClass:"card-title"},[e._v(e._s(e.belongTo)+" Progress Steps")])]),e.loaded?[t("div",{staticClass:"card-body"},[t("button",{staticClass:"btn btn-light mr-2 text-right",attrs:{type:"button"},on:{click:function(t){return e.$refs.notificationForm.show()}}},[e._v("\n        Add Step\n      ")]),e._l(e.progressSteps,(function(n){return t("div",{staticClass:"mt-3"},[t("label",[e._v(e._s(n.name))]),t("div",{staticClass:"d-flex"},[t("multiselect",{attrs:{placeholder:"Select option...",options:e.states,label:"status",customLabel:e.customRecipientsLabel,multiple:!0,blockKeys:["Delete"]},on:{select:function(t){e.onStatusSelect(n)},remove:function(t){e.onStatusRemove(n)}},model:{value:n.statuses,callback:function(t){e.$set(n,"statuses",t)},expression:"step.statuses"}}),t("a",{staticClass:"align-self-center",on:{click:function(t){return e.showDeleteNotificationModal(n)}}},[t("i",{staticClass:"far fa-times ml-2"})])],1)])}))],2)]:t("loading",{staticClass:"position-absolute p-0 transform-center"}),t("b-modal",{ref:"notificationForm",attrs:{"hide-footer":"","hide-header":""}},[t("div",{staticClass:"d-flex justify-content-between align-items-center"},[t("h3",[e._v("Add Step")])]),t("div",[t("b-form-group",{attrs:{label:"Step"}},[t("b-form-input",{attrs:{name:"step"},model:{value:e.currentStep.name,callback:function(t){e.$set(e.currentStep,"name",t)},expression:"currentStep.name"}})],1),t("div",{staticClass:"form-inline mt-3"},[t("button",{staticClass:"btn btn-primary",attrs:{type:"button",disabled:e.pending},on:{click:e.saveNotification}},[e.pending?t("i",{staticClass:"far fa-spinner-third fa-spin mr-2"}):e._e(),e._v("Save\n        ")]),t("a",{staticClass:"ml-3",on:{click:function(t){return e.$refs.notificationForm.hide()}}},[e._v("Cancel")])])],1)]),t("b-modal",{ref:"deleteNotificationConfirm",attrs:{title:"Delete Step"},on:{ok:e.deleteStep}},[e.stepToDelete?t("p",[e._v("\n      Are you sure you want to remove step\n      "),t("b",[e._v(e._s(e.stepToDelete.name))]),e._v("?\n    ")]):e._e()])],2)},s=[],a=(n("7514"),n("20d6"),n("96cf"),n("3b8d")),i=n("d135"),o=n("5a50"),c=o.poStates,u=o.orderStatuses,p={data:function(){return{currentStep:{belongTo:this.belongTo},progressSteps:[],pending:!1,stepToDelete:null,states:[]}},props:{belongTo:{type:String,required:!0}},created:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.states="Order"===this.belongTo?u():c,e.next=3,Object(i["c"])({belongTo:this.belongTo});case 3:this.progressSteps=e.sent,this.loaded=!0;case 5:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),methods:{customRecipientsLabel:function(e){return e},showDeleteNotificationModal:function(e){this.stepToDelete=e,this.$refs.deleteNotificationConfirm.show()},deleteStep:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(i["b"])(this.stepToDelete._id);case 2:this.progressSteps.splice(this.progressSteps.findIndex((function(e){return e._id===t.stepToDelete._id})),1),this.stepToDelete=null;case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),onStatusSelect:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(i["d"])(t);case 2:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}(),onStatusRemove:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(i["d"])(t);case 2:case"end":return e.stop()}}),e)})));function t(t){return e.apply(this,arguments)}return t}(),saveNotification:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,this.pending=!0,!this.progressSteps.find((function(e){return e.name===n.currentStep.name}))){e.next=5;break}return this.notificateError("You already have this step"),e.abrupt("return");case 5:return e.next=7,Object(i["a"])(this.currentStep);case 7:t=e.sent,this.progressSteps.push(t),this.currentStep={},this.$refs.notificationForm.hide(),e.next=16;break;case 13:e.prev=13,e.t0=e["catch"](0),console.log(e.t0);case 16:return e.prev=16,this.pending=!1,e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[0,13,16,19]])})));function t(){return e.apply(this,arguments)}return t}()}},l=p,f=n("2877"),d=Object(f["a"])(l,r,s,!1,null,null,null);t["default"]=d.exports},d135:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return u}));n("96cf");var r=n("3b8d"),s=n("dfbe"),a=n("987f"),i=function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,s["b"].get("order-progress-steps",{params:t,paramsSerializer:a["a"]});case 2:return e.abrupt("return",e.sent.data);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o=function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,s["b"].post("order-progress-steps",t);case 2:return e.abrupt("return",e.sent.data.model);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),c=function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,s["b"].delete("order-progress-steps/".concat(t));case 2:return e.abrupt("return",e.sent.data.model);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),u=function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,s["b"].put("order-progress-steps/".concat(t._id),t);case 2:return e.abrupt("return",e.sent.data.model);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}]);
//# sourceMappingURL=chunk-5c6cbe87.c1470f30.js.map