(function(e){function t(t){for(var i,o,a=t[0],c=t[1],u=t[2],l=0,d=[];l=300&&!e.booking.isMakeBill?n("b-icon",{staticClass:"is-angry",attrs:{icon:"alert",size:"is-small"}}):e._e(),n("span",{staticClass:"customer-name",class:{billFinished:null!=e.booking.completeBillTime}},[e._v(e._s(e.booking.customerName))])],1),n("p",{staticClass:"customer-phone"},[e.booking.totalBill?e._e():n("b",{staticClass:"new-customer-signal"},[e._v("NEW")]),e._v("\n "+e._s(e.booking.isShineMember&&new Date(e.booking.memberEndTime)-new Date>0?e.booking.memberCode+" - ":"")+e._s(e.booking.customerPhone)+"\n ")])])]),e.booking.completeBillTime?e._e():n("div",{staticClass:"level-right timer"},[e.booking&&e.booking.isCall?n("span",{staticClass:"wait-time"},[e._v(e._s(e.hour?e.hour+":":"")+e._s(e.minute>=10?e.minute:"0"+e.minute)+":"+e._s(e.second>=10?e.second:"0"+e.second))]):e._e(),e.booking.isMakeBill?e._e():n("p",[e.getPosition(e.booking)?n("span",{staticClass:"call-position"},[e._v(e._s(e.getPosition(e.booking)))]):e._e(),n("b-checkbox",{staticClass:"check-time is-small",attrs:{type:"is-white",disabled:!e.isTodaySelected},model:{value:e.isCall,callback:function(t){e.isCall=t},expression:"isCall"}})],1)])]),e.booking.note||e.booking.note1?n("span",{staticClass:"note-button",on:{click:function(t){return e.openBookingModal({bookingId:e.booking.id,type:"bookNote"})}}},[n("b-tooltip",{attrs:{label:e.booking.note||e.booking.note1,position:"is-left",multilined:!0,type:"is-info"}},[n("b-icon",{style:{color:"#ff3860"},attrs:{icon:"message-bulleted",size:"is-small"}})],1)],1):e._e(),e.booking.isMakeBill?e._e():n("button",{staticClass:"delete is-small top-right",on:{click:function(t){return e.openBookingModal({bookingId:e.booking.id,type:"deleteBookingReason"})}}}),e.cellShared?e._e():n("BookCard",{staticClass:"absolute",attrs:{booking:{subHourId:e.booking.subHourId,stylistId:e.booking.stylistId},isInsideBooked:""}})],1),e.detectedInfo?n("RecognitionPopover",{attrs:{slot:"popover",data:e.detectedInfo},on:{"evaluate-recognition":e.onEvaluate},slot:"popover"}):e._e()],1)},ut=[],lt=(n("20d6"),n("55dd"),n("c5f6"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"container"},[n("div",{staticClass:"person-container border"},[n("div",{staticClass:"detected-faces-container"},[n("b",{style:{marginBottom:"10px"}},[e._v("Ảnh nhận diện ("+e._s(Math.round(1e4*e.data["confidence"])/100)+"%)")]),n("img",{staticClass:"detected-face",style:{marginRight:"3px"},attrs:{src:"data:image/png;base64,"+e.data.detected_faces[0]}})])]),n("div",{staticClass:"cut-photo-container"},[n("b",[e._v("Ảnh trước đây ("+e._s(e.data["info"]["Name"])+", "+e._s(e.data["info"]["Phone"])+")")]),n("div",{directives:[{name:"viewer",rawName:"v-viewer",value:{toolbar:!0,url:"data-source"},expression:"{toolbar: true, url: 'data-source'}"}],staticClass:"cut-photos"},[e._l(e.data["image_urls"].slice(0,3),function(e){return[n("img",{key:e,staticClass:"cut-photo",attrs:{src:e,"data-source":e}})]})],2),n("div",{staticClass:"assessment-button-container"},[e.Evaluation?e._e():n("div",[n("b-button",{directives:[{name:"close-popover",rawName:"v-close-popover"}],staticClass:"assessment-button",attrs:{size:"is-small"},on:{click:function(t){return e.evaluateRecognition(!0)}}},[e._v("Chính xác")]),n("b-button",{staticClass:"assessment-button",attrs:{size:"is-small"},on:{click:function(t){return e.evaluateRecognition(!1)}}},[e._v("Nhầm")])],1),e.Evaluation?n("p",[e._v(e._s(e.Evaluation.IsCorrect?"Chính xác":"Nhầm"))]):e._e()])]),n("span",{staticClass:"top-right"},[n("button",{directives:[{name:"close-popover",rawName:"v-close-popover"}],staticClass:"delete is-small"})])])}),dt=[],mt={name:"RecognitionPopover",props:{data:{type:Object,default:null}},data:function(){return{Evaluation:null}},methods:{evaluateRecognition:function(e){var t={IsCorrect:e};this.$emit("evaluate-recognition",{evaluation:t,data:this.data})}},created:function(){var e=Date.now();console.log("recognition popover created at ".concat(e," with data"),this.data),console.log("info arrived on timeline after",e-1e3*this.data.first_seen)}},gt=mt,ft=(n("509a"),Object(_["a"])(gt,lt,dt,!1,null,"2f90af48",null)),ht=ft.exports,pt={name:"BookedCard",components:{BookCard:at,RecognitionPopover:ht},props:{bookingId:{type:Number,default:null},detectedInfo:{type:Object,default:null},cellShared:{type:Boolean,default:!1}},data:function(){return{isCall:!!this.booking&&this.booking.isCall,lastTime:null,hour:0,minute:0,second:0,excludeRecognitions:[]}},computed:Object(v["a"])({},Object(C["c"])(["bookings","hours","stylists","isTodaySelected","shouldDeferAction","isDragging"]),{booking:function(){var e=this.$store.getters.bookingMap[this.bookingId];return e&&(this.isCall=e.isCall),e}}),methods:Object(v["a"])({},Object(C["d"])(["openBookingModal"]),{deleteBooking:function(){},getLastCallTime:function(e){return e.isCallTimeModified||e.isCallTime},countTime:function(){if(this.booking.isCall){var e=this;setInterval(function(){var t=de()(e.lastTime).unix(),n=de()().unix(),i=n-t,o=de.a.duration(1e3*i,"milliseconds");e.minute=o.minutes(),e.second=o.seconds(),e.hour=o.hours()},1e3)}},getPosition:function(e){var t=this,n=this.bookings.filter(function(t){return t.subHourId===e.subHourId&&t.isCall&&!t.isMakeBill});n.sort(function(e,n){return new Date(t.getLastCallTime(e))-new Date(t.getLastCallTime(n))});var i=n.findIndex(function(t){return t.id==e.id});return-1!=i?i+1:null},openPrintBill:function(e){!this.isTodaySelected||e.target.className.includes("check")&&this.isCall||this.openBookingModal({bookingId:this.booking.id,type:"printBill"})},onEvaluate:function(e){e.evaluation.IsCorrect?this.isCall=!0:this.excludeRecognitions.push(e.data.recognition_id),this.$emit("evaluate-recognition",e)}}),watch:{isCall:function(){var e=Object(b["a"])(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(t!=this.booking.isCall){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.$store.dispatch("updateIsCall",{bookingId:this.booking.id,isCall:this.isCall});case 4:this.lastTime=this.getLastCallTime(this.booking),this.countTime();case 6:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),booking:{handler:function(e){e&&(this.isCall=e.isCall,this.lastTime=this.getLastCallTime(e),this.countTime())},deep:!0}},created:function(){this.lastTime=this.getLastCallTime(this.booking),this.countTime()}},bt=pt,vt=(n("2dd0"),Object(_["a"])(bt,ct,ut,!1,null,null,null)),kt=vt.exports,yt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"level-left"},[e._m(0),n("div",{staticClass:"level-item"},[this.user.listSalon?n("b-field",[n("b-autocomplete",{staticClass:"filter-input",attrs:{size:"is-small","open-on-focus":!0,placeholder:"Chọn Salon",data:e.filteredSalon,field:"salonName"},on:{select:e.onSalonSelect,focus:e.onSalonFocus},model:{value:e.salonName,callback:function(t){e.salonName=t},expression:"salonName"}})],1):e._e()],1),n("div",{staticClass:"level-item"},[n("b-datepicker",{staticClass:"filter-input",attrs:{size:"is-small",placeholder:"Chọn ngày",icon:"calendar-today","date-parser":function(e){return new Date(Date.parse(e))},readonly:!1,"min-date":e.minDate,"max-date":e.maxDate},model:{value:e.date,callback:function(t){e.date=t},expression:"date"}})],1),e.recognitionSocket?n("div",{staticClass:"level-item"},[n("div",{staticClass:"has-text-right"},[n("b-checkbox",{staticClass:"toggle-recognition",model:{value:e.enableFaceRecognition,callback:function(t){e.enableFaceRecognition=t},expression:"enableFaceRecognition"}},[e._v("Nhận diện khuôn mặt")])],1)]):e._e(),e.recognitionSocket&&e.enableFaceRecognition?n("b-select",{attrs:{placeholder:"ĐCCNN",size:"is-small"},model:{value:e.minAccuracy,callback:function(t){e.minAccuracy=t},expression:"minAccuracy"}},e._l(e.minAccuracyOptions,function(t){return n("option",{key:t.id,domProps:{value:t.value}},[e._v(e._s(t.value)+"%")])}),0):e._e(),e.recognitionSocket&&e.enableFaceRecognition&&e.recognitionError?n("div",{directives:[{name:"tooltip",rawName:"v-tooltip.bottom",value:"Hệ thống nhận diện khuôn mặt gặp lỗi, vui lòng liên hệ với nhà phát triển! Error: "+e.recognitionError,expression:"'Hệ thống nhận diện khuôn mặt gặp lỗi, vui lòng liên hệ với nhà phát triển! Error: ' + recognitionError",modifiers:{bottom:!0}}],staticClass:"recognition-error"},[n("b-icon",{attrs:{icon:"exclamation",type:"is-danger"}}),n("span",{staticStyle:{color:"red"}},[e._v("Error")])],1):e._e()],1)},Ct=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"level-item"},[n("h4",{staticClass:"is-bold is-uppercase"},[e._v("Timeline")])])}],It=(n("6b54"),{name:"FilterBar",data:function(){var e=new Date;return{salonName:"",minDate:new Date(e.getFullYear(),e.getMonth(),e.getDate()),maxDate:new Date(e.getFullYear(),e.getMonth(),e.getDate()+3),prevSalonName:""}},methods:{onSalonBlur:function(){console.log("on blur"),console.log("prev",this.prevSalonName),0==this.salonName.length&&this.prevSalonName.length>0&&(this.salonName=this.prevSalonName),this.prevSalonName=""},onSalonFocus:function(){this.prevSalonName=this.salonName,this.salonName=""},onSalonSelect:function(e){console.log("on select"),this.prevSalonName="",this.salon=e}},computed:Object(v["a"])({},Object(C["c"])(["user","timelineFilter","recognitionError","recognitionSocket"]),{salon:{get:function(){return this.timelineFilter.salon&&(this.salonName=this.timelineFilter.salon.salonName),this.timelineFilter.salon},set:function(e){this.$store.commit("updateTimelineFilter",{name:"salon",value:e})}},date:{get:function(){return this.timelineFilter.date},set:function(e){localStorage["date"]=JSON.stringify(e),this.$store.commit("updateTimelineFilter",{name:"date",value:e})}},enableFaceRecognition:{get:function(){return this.timelineFilter.enableFaceRecognition},set:function(e){localStorage["enableFaceRecognition"]=JSON.stringify(e),this.$store.commit("updateTimelineFilter",{name:"enableFaceRecognition",value:e})}},minAccuracy:{get:function(){return this.timelineFilter.minAccuracy},set:function(e){localStorage["minAccuracy"]=JSON.stringify(e),this.$store.commit("updateTimelineFilter",{name:"minAccuracy",value:e})}},filteredSalon:function(){var e=this;return this.user.listSalon.filter(function(t){return t.salonName.toString().toLowerCase().indexOf(e.salonName.toLowerCase())>=0})},minAccuracyOptions:function(){for(var e=[],t=65;t<=95;t++)e.push({value:t,id:t});return e}}),watch:{salon:function(e,t){}}}),St=It,wt=(n("2a9c"),n("f54f"),Object(_["a"])(St,yt,Ct,!1,null,"77cae6ca",null)),_t=wt.exports,Tt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"row columns is-mobile is-gapless head container",on:{mousedown:function(t){return e.$emit("mousedown")}}},[e.is20Minutes?n("div",{staticClass:"cell placeholder-cell-20-minutes"}):e._e(),e._l(e.hours,function(t,i){return n("div",{key:t.hour+i,staticClass:"cell column hour-cell",class:{"is-cell-20-minutes":e.is20Minutes},attrs:{id:"hour-"+t.hour,"data-dragscroll":"true"}},[e._v("\n "+e._s(t.hour)+"\n ")])})],2)},Bt=[],xt={name:"HourRow",props:["is20Minutes"],data:function(){return{isFirstTime:!0}},computed:{hours:function(){var e=this,t=this.$store.getters.hours;return t.filter(function(t){return e.is20Minutes?t.is20Minutes:!t.is20Minutes})}},methods:{gotoNow:function(){if(this.isFirstTime&&this.hours&&this.hours.length){var e=fe.getNearest15Minutes();this.isFirstTime=!1;var t="hour-"+this.hours[this.hours.length-1].hour;e.length==t.length&&e>t&&(e=t),this.$scrollTo(document.getElementById(e),10,{})}}},mounted:function(){this.$nextTick(function(){this.gotoNow()})}},Ot=xt,Rt=(n("98c8"),Object(_["a"])(Ot,Tt,Bt,!1,null,"3cec43f0",null)),Ht=Rt.exports,At=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.fastStylists.length||e.normalStylists.length?n("div",{staticClass:"column is-1 stylists"},[n("div",{staticClass:"data-define"},[e.fastStylists.length>0?n("div",[n("div",{staticClass:"cell section-description"},[e._v("Khung giờ 20 phút")]),e._l(e.fastStylists,function(t){return n("div",{key:t.id,staticClass:"cell stylist",class:{"is-star":t.score>2}},[n("span",{staticClass:"account-type"},[e._v(e._s(t.teamId))]),n("span",{staticClass:"account-name"},[e._v(e._s(t.fullName))]),n("span",{staticClass:"count"},[e._v(e._s(e.completedBillByStylist[t.id]||0))])])})],2):e._e(),e.normalStylists.length>0?n("div",[n("div",{staticClass:"cell section-description"},[e._v("Khung giờ 15 phút")]),e._l(e.normalStylists,function(t){return n("div",{key:t.id,staticClass:"cell stylist",class:{"is-star":t.score>2}},[n("span",{staticClass:"account-type"},[e._v(e._s(t.teamId))]),n("span",{staticClass:"account-name"},[e._v(e._s(t.fullName))]),n("span",{staticClass:"count"},[e._v(e._s(e.completedBillByStylist[t.id]||0))])])})],2):e._e()])]):e._e()},Dt=[],Et={name:"StylistColumn",computed:Object(v["a"])({},Object(C["c"])(["completedBillByStylist","fastStylists","normalStylists"])),props:["isFast"]},jt=Et,Mt=(n("d372"),Object(_["a"])(jt,At,Dt,!1,null,"567f877b",null)),Pt=Mt.exports,Nt=5678,Ft=5679,$t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Nt;return"wss://".concat(e,":").concat(t)},Lt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ft;return"wss://".concat(e,":").concat(t)},Ut={getConsumerUrl:$t,getProducerUrl:Lt},zt=n("7529"),Yt=function(){return n.e("chunk-4a01b6ce").then(n.bind(null,"a89b"))},Wt=function(){return n.e("chunk-56692b36").then(n.bind(null,"6aef"))},Vt=function(){return n.e("chunk-281cf157").then(n.bind(null,"cf2b"))},Jt={components:{BookCard:at,BookedCard:kt,CategoryList:Vt,FilterBar:_t,StylistColumn:Pt,HourRow:Ht,DifferentDayWarning:Wt,ModalContainer:Yt},name:"Home",data:function(){return{finishFirstRender:!1,isLoading:!1,draggedBooking:null,detectedCustomerPhones:[],isHourRowHovered:!1,recognition:{isProducerConnected:null,isConsumerConnected:null,producerConnection:null,consumerConnection:null,isStreaming:null,detectedCustomers:{}},socket:null}},computed:Object(v["a"])({},Object(C["c"])(["timeline","hours","stylists","bookings","user","dateNormal","timelineFilter","hourMap","stylistMap","recognitionSocket","bookingMap","isTodaySelected","fastStylists","normalStylists"]),{selectedSalon:function(){return this.timelineFilter.salon},enableFaceRecognition:function(){return this.timelineFilter.enableFaceRecognition},isDragging:{get:function(){return this.$store.getters.isDragging},set:function(e){this.$store.commit("setDragging",e)}}}),methods:Object(v["a"])({},Object(C["b"])(["setHours","getStylists","setSkinners","setBookings","setCheckins","updateBookingsToTimeline","resetTimeline","setServices","setProducts","setLinearFlowExperimentSalons"]),Object(C["d"])(["setDragging","emptyTimeline"]),{fetchData:function(){var e=Object(b["a"])(regeneratorRuntime.mark(function e(){var t,n,i=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(t=de()(this.dateNormal),!this.selectedSalon){e.next=15;break}return this.isLoading=!0,localStorage.setItem("salonId",this.selectedSalon.id),n={salonId:this.selectedSalon.id,date:t},this.emptyTimeline(),e.next=8,Promise.all([this.getStylists(n),this.setHours(this.selectedSalon.id),this.setBookings(n)]);case 8:this.isLoading=!1,this.addTimekeepingTypeChangedStylists(),this.resetTimeline(),this.bookings.forEach(function(e){i.$store.dispatch("addToTimeline",e)}),this.finishFirstRender=!0,console.log("start adding checkins, services, products"),Promise.all([this.setSkinners(n),this.setCheckins(n),this.setServices(this.selectedSalon.id),this.setProducts(this.selectedSalon.id)]).then();case 15:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),mapBooking:function(){var e=this;this.$store.dispatch("resetTimeline"),"string"!=typeof this.bookings&&this.bookings.forEach(function(t){e.$store.dispatch("addToTimeline",t)})},addTimekeepingTypeChangedStylists:function(){var e=this;this.bookings.forEach(function(t,n){var i=null,o=e.stylists[e.stylistMap[t.stylistId]];if(t.subHourId.includes("sub2")&&!o.secondSubWorkHour?i="sub2.".concat(o.id):!t.subHourId.includes("sub2")&&o.secondSubWorkHour&&(i="sub.".concat(o.id)),i){var r=Object(v["a"])({},t,{stylistId:i});if(!e.stylistMap[i]){var s=Object(v["a"])({},o,{id:i,isActive:{}});s.secondSubWorkHour=i.startsWith("sub2"),e.$store.commit("setStylists",[].concat(Object(q["a"])(e.stylists),[s]))}e.$store.commit("updateBooking",r)}})},handleDrop:function(){var e=Object(b["a"])(regeneratorRuntime.mark(function e(t){var n,i,o,r,s,a,c,u,l=this;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(n=this.hourMap[t.subHourId],i=this.stylistMap[t.stylistId],this.isDragging=!1,o=[],r=this.draggedBooking,t.stylistId!=r.stylistId||t.subHourId!=r.subHourId){e.next=7;break}return e.abrupt("return");case 7:if(this.$store.getters.isSlotOpen(t.stylistId,t.subHourId)){e.next=10;break}return zt["a"].generalError(this,"Đã kín lịch, vui lòng chọn khung giờ khác"),e.abrupt("return");case 10:if(r.completeBillTime?o.push("Bill đã hoàn thành, không thể đổi giờ!"):r.isMakeBill&&(r.hourId!==this.hours[n].hourId&&o.push("Đã in hóa đơn, không thể đổi giờ!"),s=r.subHourId.includes("sub2"),a=t.subHourId.includes("sub2"),s!=a&&(c=this.hourMap[r.subHourId],!this.hours[n].parentSubHourId==this.hours[c].parentSubHourId&&o.push("Khi đổi lịch chéo khung giờ, chỉ được phép đổi 00, 15, 20 hoặc 30, 40, 45 với nhau"))),console.log("length of message",o.length),!(o.length>0)){e.next=15;break}for(u=0;uXác nhận đổi lịch',onConfirm:function(){var e=Object(b["a"])(regeneratorRuntime.mark(function e(){var t,o,s;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return t=r.id,e.prev=1,o={customerPhone:r.customerPhone,salonId:l.selectedSalon.id,stylistId:l.stylists[i].id,hourId:l.hours[n].hourId,subHourId:l.hours[n].subHourId,isBookStylist:r.isBookStylist,dateBook:l.$store.getters.selectedMomentDate.format("YYYY-MM-DD")},l.$store.dispatch("updateBooking",{id:t,subHourId:o.subHourId,hourId:o.hourId,stylistId:o.stylistId}),l.$store.commit("setDeferAction",{bookingId:t,shouldDefer:!0}),l.draggedBooking=null,o=Y["a"].transformSubHourOut(o),console.time("updateBooking"),e.next=10,j.a.put("".concat(N["a"].MAIN_API,"/api/booking?bookingId=").concat(t),o);case 10:s=e.sent,s.data,console.timeEnd("updateBooking"),e.next=20;break;case 15:e.prev=15,e.t0=e["catch"](1),zt["a"].changeBookingError(l,e.t0.response.data),console.log(e.t0),l.$store.dispatch("updateBooking",{id:t,subHourId:r.subHourId,hourId:r.hourId,stylistId:r.stylistId});case 20:return e.prev=20,l.$store.commit("setDeferAction",{bookingId:t,shouldDefer:!1}),e.finish(20);case 23:case"end":return e.stop()}},e,null,[[1,15,20,23]])}));function t(){return e.apply(this,arguments)}return t}()});case 16:case"end":return e.stop()}},e,this)}));function t(t){return e.apply(this,arguments)}return t}(),handlePersonList:function(e){var t=this.timelineFilter.minAccuracy,n={};e.forEach(function(e){e["confidence"]>t/100&&(n[e["info"]["Phone"]]=e)}),this.recognition.detectedCustomers=n},handleMessage:function(e){switch(e.type){case"persons":this.handlePersonList(e.data);break}},listenToRecognition:function(){var e=this;if(console.log("recognitionSocket",this.recognitionSocket),this.recognitionSocket&&this.recognitionSocket.Host){var t=this.recognitionSocket.Host,n=this.recognitionSocket.ConsumerPort,i=this.recognitionSocket.ProducerPort;console.log("hostUrl is ".concat(t)),console.log("Connecting to video stream");var o=Date.now(),r={frame:Date.now(),persons:Date.now()};try{var s=new WebSocket(Ut.getConsumerUrl(t,n));s.onerror=function(t){console.log("WebSocket Consumer Error ",Object(tt["a"])(t)),console.log("Fail after",Date.now()-o),e.recognition.isConsumerConnected=!1;var n="Cannot connect to websocket";e.$store.commit("setRecognitionError",n)},s.onopen=function(t){console.log("consumer opened"),e.recognition.isConsumerConnected=!0},s.onclose=function(e){console.log("consumer closed at "+Date.now())},s.onmessage=function(t){var n=t.data,i=JSON.parse(n);r[i.type]=Date.now(),e.handleMessage(i)},this.recognition.consumerConnection=s;var a=new WebSocket(Ut.getProducerUrl(t,i));a.onopen=function(t){console.log("producer open"),a.send(JSON.stringify({type:"system",message:"Ping!"})),e.recognition.isProducerConnected=!0;var n="Cannot connect to websocket";e.$store.dispatch("setRecognitionError",n)},a.onclose=function(e){console.log("producer closed at "+Date.now())},a.onerror=function(t){console.log("WebSocket Producer Error ",t),e.recognition.isProducerConnected=!1},this.recognition.producerConnection=a;setInterval(function(){if(e.recognition.isProducerConnected&&e.recognition.isConsumerConnected){var t=Date.now();(t-r.persons>3e3||e.recognition.isStreaming&&t-r.frame>3e3)&&t-o>3e4&&console.log("Camera idle. Reloading...")}},3e3)}catch(c){console.log(JSON.stringify(c,0,2))}}},disableRecognition:function(){this.recognition.producerConnection.readyState===WebSocket.OPEN&&this.recognition.producerConnection.close(),this.recognition.consumerConnection.readyState===WebSocket.OPEN&&this.recognition.consumerConnection.close(),this.recognition={isProducerConnected:null,isConsumerConnected:null,producerConnection:null,consumerConnection:null,isStreaming:null,detectedCustomers:{},lastCloseTime:Date.now()}},onEvaluate:function(e){var t=e.evaluation,n=e.data;this.recognition.producerConnection&&(console.log(t,n),this.recognition.producerConnection.send(JSON.stringify({type:"evaluation",message:{evaluation:t,data:Object(v["a"])({},n,{detected_faces:[]})}})))},initTimelineSocket:function(e){var t=this;console.log("initing timeline socket"),this.socket=io.connect("".concat("https://timeline-socket.30shine.com","/salon/").concat(e,"?accessToken=").concat(localStorage.getItem("AccessToken"))),this.socket.on("error",function(e){console.log("Timeline websocket error",e)}),this.socket.on("booking",function(){var e=Object(b["a"])(regeneratorRuntime.mark(function e(n){var i,o;return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(i=n.event,o=n.booking,t.isTodaySelected){e.next=3;break}return e.abrupt("return");case 3:console.log(i,o),e.t0=i,e.next="post"===e.t0?7:"put"===e.t0?9:"delete"===e.t0?11:13;break;case 7:return t.$store.dispatch("addBooking",o),e.abrupt("break",13);case 9:return t.$store.dispatch("updateBooking",o),e.abrupt("break",13);case 11:return t.$store.dispatch("removeBooking",o),e.abrupt("break",13);case 13:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}())},disconnectSocket:function(){this.socket.disconnect()}}),created:function(){var e=Object(b["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:this.$store.commit("updateSelectedSalon",this.user.listSalon);case 1:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),watch:{selectedSalon:function(){var e=Object(b["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.fetchData();case 2:if(this.socket&&this.socket.connected&&this.disconnectSocket(),!this.selectedSalon||!this.selectedSalon.id){e.next=8;break}return this.initTimelineSocket(this.selectedSalon.id),e.next=7,this.$store.dispatch("setRecognitionSocket",this.selectedSalon.id);case 7:this.enableFaceRecognition&&this.listenToRecognition();case 8:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),dateNormal:function(){var e=Object(b["a"])(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.fetchData();case 2:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),enableFaceRecognition:function(e,t){e?this.recognition.lastCloseTime&&Date.now()-this.recognition.lastCloseTime<9e4?window.location.reload():this.listenToRecognition():this.disableRecognition()}}},Kt=Jt,Gt=(n("21bb"),Object(_["a"])(Kt,Ze,et,!1,null,null,null)),qt=Gt.exports,Xt=function(){return n.e("chunk-7ce8b0dc").then(n.bind(null,"c539"))};f["default"].use(Qe["a"]);var Qt=new Qe["a"]({routes:[{path:"/",name:"home",component:qt},{path:"/khach-hang/tim-kiem",name:"search-customer",component:Xt}]}),Zt=n("5b6c"),en=n.n(Zt),tn=n("289d");f["default"].use(en.a),f["default"].use(tn["a"],{css:!0,materialDesignIcons:!0,materialDesignIconsHRef:"//cdn.materialdesignicons.com/2.4.85/css/materialdesignicons.min.css"}),f["default"].use(g.a,{defaultOptions:{zIndex:999999}}),f["default"].use(o.a),f["default"].use(u["a"],{defaultBoundariesElement:document.body}),f["default"].use(s.a,{container:".data-table",duration:500,easing:"ease",offset:0,force:!0,cancelable:!0,onStart:!1,onDone:!1,onCancel:!1,x:!0,y:!1}),f["default"].use(c.a),f["default"].config.productionTip=!1,f["default"].config.errorHandler=f["default"].config.warnHandler=function(e){console.log("Exception: ",e)},f["default"].directive("autofocus",d.a),f["default"].config.performance=!1,new f["default"]({store:Xe,router:Qt,render:function(e){return e(U)}}).$mount("#app")},"5c0b":function(e,t,n){"use strict";var i=n("9ed3"),o=n.n(i);o.a},"61c9":function(e,t,n){var i={"./vi":"2921","./vi.js":"2921"};function o(e){var t=r(e);return n(t)}function r(e){var t=i[e];if(!(t+1)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return t}o.keys=function(){return Object.keys(i)},o.resolve=r,e.exports=o,o.id="61c9"},"63ca":function(e,t,n){},7529:function(e,t,n){"use strict";var i=function(e,t){e.$notify({group:"foo",type:"success",title:"Hệ thống",text:"Đặt lịch thành công cho khách hàng ".concat(t)})},o=function(e,t){e.$notify({group:"foo",type:"success",title:"Hệ thống",text:"Đổi lịch thành công cho anh ".concat(t,"!")})},r=function(e,t){e.$notify({group:"foo",type:"error",title:"Hệ thống",text:"Đổi lịch lỗi ".concat(t)})},s=function(e,t){e.$notify({group:"foo",type:"error",title:"Hệ thống",text:"Đã in bill cho anh ".concat(t,", không thể thực hiện tác vụ này!")})},a=function(e,t){return new Promise(function(n,i){e.$buefy.dialog.confirm({title:"Hệ thống",message:"Anh ".concat(t," đã đặt lịch rồi! bạn có muốn đổi lịch?"),cancelText:"Hủy",confirmText:"Đồng ý",type:"is-success",onConfirm:function(){return n(!0)},onCancel:function(){return n(!1)}})})},c=function(e,t){e.$notify({group:"foo",type:"error",title:"Hệ thống",text:"".concat(t)})};t["a"]={bookingSuccess:i,changeBookingSuccess:o,changeBookingError:r,changeBookingDenyBillPrinted:s,confirmChangeBookingTime:a,generalError:c}},"84b8":function(e,t,n){},"864c":function(e,t,n){},"8c1d":function(e,t,n){"use strict";var i=n("af37"),o=n.n(i);o.a},"922e":function(e,t,n){"use strict";var i="https://std-api-timeline.30shine.com",o=Object({NODE_ENV:"production",VUE_APP_API_CHECKOUT:"https://api-checkout-web.30shine.com",VUE_APP_CAMPAIGN_API:"https://api-campaign-v2.30shine.com",VUE_APP_CURRENT_TIMELINE:"https://erp.30shine.com",VUE_APP_MAIN_API:"https://std-api-timeline.30shine.com",VUE_APP_RECOGNITION_API:"https://std-api-linux-facerecog.30shine.com",VUE_APP_SSO_SCRIPT:"sso.min.js",VUE_APP_STAFF_SCHEDULE_URL:"http://localhost:8080/",VUE_APP_TIMELINE_SOCKET:"https://timeline-socket.30shine.com",BASE_URL:"/"}).VUE_APP_NEW_API,r="https://std-api-linux-facerecog.30shine.com",s="https://api-campaign-v2.30shine.com",a="https://api-checkout-web.30shine.com";t["a"]={MAIN_API:i,NEW_API:o,RECOGNITION_API:r,CAMPAIGN_API:s,API_CHECKOUT:a}},"98c8":function(e,t,n){"use strict";var i=n("268d"),o=n.n(i);o.a},9997:function(e,t,n){},"9ed3":function(e,t,n){},af37:function(e,t,n){},b3ec:function(e,t,n){"use strict";var i=n("84b8"),o=n.n(i);o.a},b6af:function(e,t,n){},b82d:function(e,t,n){},bcc2:function(e,t,n){"use strict";n("6762"),n("2fdb");var i=n("cebc"),o=(n("28a5"),n("a481"),function(e){return e=e.toLowerCase(),e=e.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g,"a"),e=e.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g,"e"),e=e.replace(/ì|í|ị|ỉ|ĩ/g,"i"),e=e.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g,"o"),e=e.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g,"u"),e=e.replace(/ỳ|ý|ỵ|ỷ|ỹ/g,"y"),e=e.replace(/đ/g,"d"),e=e.replace(/!|@|%|\^|\*|\(|\)|\+|\=|\<|\>|\?|\/|,|\.|\:|\;|\'|\"|\&|\#|\[|\]|~|\$|_|`|-|{|}|\||\\/g," "),e=e.replace(/ + /g," "),e=e.trim(),e}),r=function(e){return e?e.split(",").join(",
"):null},s=function(e){if(!e.secondSubHourId)return e.subHourId?Object(i["a"])({},e,{subHourId:e.subHourId+""}):e;var t=Object(i["a"])({},e,{subHourId:"sub2."+e.secondSubHourId,secondSubHourId:null,parentSubHourId:e.subHourId});return a(t)},a=function(e){return e.stylistId?Object(i["a"])({},e,{stylistId:e.stylistId+""}):e},c=function(e){if(!e.subHourId.includes("."))return e;var t=parseInt(e.subHourId.split(".")[1]),n=Math.floor(t/10),o=Object(i["a"])({},e,{subHourId:n,secondSubHourId:t});return o.parentSubHourId&&delete o.parentSubHourId,u(o)},u=function(e){if(!e.stylistId.includes("."))return e;var t=parseInt(e.stylistId.split(".")[1]);return Object(i["a"])({},e,{stylistId:t})};t["a"]={removeVietnameseAccent:o,transformNoteTooltip:r,transformSubHourIn:s,transformSubHourOut:c,transformStylistOut:u,transformStylistIn:a}},bd0b:function(e,t,n){"use strict";var i=n("b82d"),o=n.n(i);o.a},d372:function(e,t,n){"use strict";var i=n("2184"),o=n.n(i);o.a},f54f:function(e,t,n){"use strict";var i=n("105c"),o=n.n(i);o.a}}); //# sourceMappingURL=app.16b46241.js.map