1import{f as o,h as r,d as u,m as f,e as _,V as d}from"./vue-vendor-BaCpWTON.js";import{U as g}from"./UI-CRrPWavA.js";import{i as h}from"./i18n-BgLvubeq.js";import{c as b}from"./createRequestConfig-C6l8KGhZ.js";import{a as C}from"./utils-C7JfesvL.js";import{C as x}from"./call-BtUyEYL6.js";import{O as w,S as y}from"./option-CLIquiHL.js";import{U as n}from"./UpperFirst-BhOF0C7k.js";import{n as i}from"./_plugin-vue2_normalizer-DftzqmJM.js";import{R as E}from"./Route-COF39lPP.js";import{G as $}from"./GoogleReviewModal-D7L95Gir.js";import"./Columns-B8s8PAxq.js";import"./Layout-Da2Kek7T.js";import"./_setToArray-CcZCQ-Zl.js";import"./isObject-BKuwTLu1.js";import"./input-Bhba1XzF.js";import"./migrating-xKNzQi8k.js";import"./merge-BgFfMhAT.js";import"./scrollbar-C3hqXgDS.js";import"./index-Bw67SgbX.js";import"./locale-DeAkDzOn.js";const R={state:{call:null,step:null,friendly:null,caring:null,committed:null,perfectEvalComment:null,comments:null,errorMessage:null,PERFECT_SCORE:2,submitting:!1,showGoogleReview:!1},getters:{isPerfectEvaluation(e){return e.friendly===e.PERFECT_SCORE&&e.caring===e.PERFECT_SCORE&&e.committed===e.PERFECT_SCORE},showPerfectEvaluationComment(e,t){return e.step==="form"&&t.isPerfectEvaluation}},mutations:{setStep(e,t){e.step=t},setCall(e,t){e.call=t},setErrorMessage(e,t){e.errorMessage=t},setFriendly(e,t){e.friendly=t},setCaring(e,t){e.caring=t},setCommitted(e,t){e.committed=t},setComments(e,t){e.comments=t},setPerfectEvalComment(e,t){e.perfectEvalComment=t},setSubmitting(e,t){e.setSubmitting=t},setShowGoogleReview(e,{value:t}){e.showGoogleReview=t}},actions:{saveUserCallEvaluation({commit:e,state:t}){const s={userCallId:t.call.userCallId,friendly:t.friendly,caring:t.caring,committed:t.committed,comments:t.comments,perfectEvalComment:t.perfectEvalComment},a=b(route("api.call-evaluation"),"POST",s);return axios.request(a).then(l=>{var m,c;e("setStep","confirmation"),(c=(m=l.data)==null?void 0:m.extra)!=null&&c.shouldShowGoogleReview&&e("setShowGoogleReview",{value:!0})}).catch(l=>{e("setErrorMessage",C(l))}).finally(()=>{e("submitting",!1)})}}},S={mixins:[n],props:{call:Object}};var M=function(){var t=this,s=t._self._c;return s("div",{staticClass:"flex flex-col items-center sm:flex-row md:h-36 sm:px-4"},[s("div",{staticClass:"w-40 flex items-center justify-center"},[s("img",{staticClass:"w-40 h-40",attrs:{src:t.call.agentProfileImageUrl,alt:"Agent profile image"}})]),s("div",{staticClass:"items-center justify-center text-base sm:text-base md:text-lg pl-4"},[s("div",{staticClass:"text-2xl"},[t._v(t._s(t.$t(`evaluation prompt.${t.call.callType} call title`)))]),s("div",[t._v(t._s(t.$t(`evaluation prompt.${t.call.callType} call description`,{date:t.call.datetimeFormatted,duration:t.call.duration,agentName:t.upperFirst(t.call.agentName)})))])])])},F=[],k=i(S,M,F,!1,null,null);const v=k.exports,P={components:{"el-select":y,"el-option":w,"call-evaluation-header":v},mixins:[n],data(){return{questions:{},commentsValue:null,options:[]}},computed:{...r({call:e=>e.main.call,friendly:e=>e.main.friendly,caring:e=>e.main.caring,committed:e=>e.main.committed,comments:e=>e.main.comments,errorMessage:e=>e.main.errorMessage,submitting:e=>e.main.submitting})},created(){this.questions=this.call.evaluationQuestions,this.options=this.call.evaluationOptions,this.commentsValue=this.comments,this.friendly!==null&&(this.questions.friendly.value=this.friendly,this.questions.caring.value=this.caring,this.questions.committed.value=this.committed,this.commentsValue=this.comments)},methods:{...o(["setFriendly","setCaring","setCommitted","setComments","setSubmitting"]),submit(){this.setSubmitting(!0),this.setFriendly(this.questions.friendly.value),this.setCaring(this.questions.caring.value),this.setCommitted(this.questions.committed.value),this.setComments(this.commentsValue),this.$emit("submit")}}};var G=function(){var t=this,s=t._self._c;return s("div",{staticClass:"bg-gray-100 rounded-xl p-4 md:p-8 w-full max-w-4xl m-auto"},[s("call-evaluation-header",{attrs:{call:t.call}}),t.errorMessage?s("div",{staticClass:"text-secondary mt-4 px-4"},[t._v(t._s(t.errorMessage))]):t._e(),s("form",{staticClass:"mt-4 p-4",on:{submit:function(a){return a.preventDefault(),t.submit.apply(null,arguments)}}},[t._l(t.questions,function(a){return s("div",{key:a.label,staticClass:"flex flex-col md:flex-row"},[s("div",{staticClass:"flex-1 break-normal md:pr-4"},[t._v(t._s(a.label))]),s("div",{staticClass:"flex-1 mb-6 md: mb-0"},[s("el-select",{staticClass:"w-full md:w-64 mt-2 md:mt-0",attrs:{placeholder:t.$t("select rating")},model:{value:a.value,callback:function(l){t.$set(a,"value",l)},expression:"question.value"}},t._l(t.options,function(l){return s("el-option",{key:l.label,attrs:{label:l.label,value:l.value}})}),1)],1)])}),s("div",[s("div",{staticClass:"mt-4"},[t._v(" "+t._s(t.$t("comments"))+" ")]),s("textarea",{directives:[{name:"model",rawName:"v-model",value:t.commentsValue,expression:"commentsValue"}],staticClass:"w-full h-32 border border-tertiary rounded p-2",domProps:{value:t.commentsValue},on:{input:function(a){a.target.composing||(t.commentsValue=a.target.value)}}})]),s("button",{staticClass:"w-3/4 btn btn-tertiary m-auto block mt-4",attrs:{type:"submit",disabled:t.submitting}},[t._v(t._s(t.$t("send")))])],2)],1)},V=[],U=i(P,G,V,!1,null,null);const q=U.exports,O={mixins:[E],methods:{backToDashboard(){window.location.href=this.route("user.dashboard")}}};var T=function(){var t=this,s=t._self._c;return s("div",{staticClass:"bg-gray-100 rounded-xl p-8 w-full max-w-4xl m-auto h-120"},[s("svg",{staticClass:"text-tertiary h-24 w-24 block text-center m-auto mt-8",attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 443 661",fill:"currentColor"}},[s("path",{attrs:{d:"M225 0a13 13 0 0 0-13 8l-70 200a12 12 0 0 0 12 17 12 12 0 0 0 7-2c99-70 89-164 74-215a13 13 0 0 0-12-9zm156 99a13 13 0 0 0-6 2L199 223a12 12 0 0 0 0 21 12 12 0 0 0 7 2c121 2 169-80 187-129a13 13 0 0 0-12-17zM142 254c-9 0-18 6-22 17L1 631c-5 16 4 29 21 29h199a30 30 0 0 0 30-30V513c0-16 13-28 30-25l76 14c16 3 40-3 52-15l22-21c12-11 10-28-3-37L155 258c-4-2-9-4-13-4zm38 78a30 30 0 0 1 31 30 30 30 0 0 1-30 29 30 30 0 0 1 0-59z"}})]),s("h2",{staticClass:"block text-center m-auto mt-8"},[t._v(t._s(t.$t("thanks")))]),s("button",{staticClass:"w-4/5 sm:w-64 btn btn-tertiary block m-auto mt-8",on:{click:t.backToDashboard}},[t._v(t._s(t.$t("back to dashboard")))])])},N=[],j=i(O,T,N,!1,null,null);const z=j.exports,L={components:{"call-evaluation-header":v},mixins:[n],data(){return{comment:null,url:"/happiness"}},computed:{...r({call:e=>e.main.call,errorMessage:e=>e.main.errorMessage,submitting:e=>e.main.submitting})},methods:{...o(["setPerfectEvalComment","setSubmitting"]),submit(){this.setSubmitting(!0),this.setPerfectEvalComment(this.comment),this.$emit("submit")}}};var D=function(){var t=this,s=t._self._c;return s("div",{staticClass:"bg-gray-100 rounded-xl p-8 w-full max-w-4xl m-auto"},[s("call-evaluation-header",{attrs:{call:t.call}}),t.errorMessage?s("div",{staticClass:"text-secondary mt-4 px-4"},[t._v(t._s(t.errorMessage))]):t._e(),s("form",{staticClass:"mt-4 px-4",on:{submit:function(a){return a.preventDefault(),t.submit.apply(null,arguments)}}},[s("h3",{staticClass:"text-2xl sm:text-3xl"},[t._v(t._s(t.$t("perfect evaluation title")))]),s("div",{staticClass:"break-normal"},[t._v(" "+t._s(t.$t("perfect evaluation text 1",{agentName:t.upperFirst(t.call.agentName)}))+" "),s("a",{attrs:{href:t.url}},[t._v(t._s(t.$t("happiness page")))]),t._v(" "+t._s(t.$t("perfect evaluation text 2",{agentName:t.upperFirst(t.call.agentName)}))+" ")]),s("textarea",{directives:[{name:"model",rawName:"v-model",value:t.comment,expression:"comment"}],staticClass:"w-full h-32 border border-tertiary rounded mt-6 p-2",domProps:{value:t.comment},on:{input:function(a){a.target.composing||(t.comment=a.target.value)}}}),s("button",{staticClass:"w-3/4 btn btn-tertiary m-auto block mt-6",attrs:{type:"submit",disabled:t.submitting}},[t._v(t._s(t.$t("send")))]),s("div",{staticClass:"w-full flex justify-center"},[s("a",{staticClass:"mt-4 text-center",attrs:{href:"javascript:void(0);"},on:{click:function(a){return t.$emit("submit")}}}
1,[t._v(" "+t._s(t.$t("skip")))])])])],1)},I=[],A=i(L,D,I,!1,null,null);const B=A.exports;d.use(u);const p=new u.Store;d.use(p);const H={components:{"call-eval-form":q,"call-eval-perfect-comment":B,"call-eval-confirmation":z,"google-review-modal":$},mixins:[g,h],store:p,computed:{...r({step:e=>e.main.step,showGoogleReview:e=>e.main.showGoogleReview}),..._(["showPerfectEvaluationComment"])},created(){this.$store.registerModule("main",R),this.setCall(this.$page.props.call),this.setStep("form"),this.addLocales(x)},methods:{...f(["saveUserCallEvaluation"]),...o(["setCall","setStep","setSubmitting","setErrorMessage","setShowGoogleReview"]),closeGoogleReview(){this.setShowGoogleReview({value:!1})},submit(){this.setErrorMessage(null),this.showPerfectEvaluationComment?(this.setStep("perfectEvaluationComment"),this.setSubmitting(!1)):this.saveUserCallEvaluation()}}};var Q=function(){var t=this,s=t._self._c;return s("div",[s("layout",{attrs:{title:"User Call Evaluation"}},[s("div",{staticClass:"p-8 md:p-12 w-full flex"},[t.step=="form"?s("call-eval-form",{on:{submit:t.submit}}):t.step=="perfectEvaluationComment"?s("call-eval-perfect-comment",{on:{submit:t.submit}}):t.step=="confirmation"?s("call-eval-confirmation"):t._e()],1)]),t.showGoogleReview?s("google-review-modal",{on:{close:t.closeGoogleReview}}):t._e()],1)},J=[],K=i(H,Q,J,!1,null,null);const gt=K.exports;export{gt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.