1
/*! For license information please see twk-chunk-common.js.LICENSE */
2
(window.tawkJsonp=window.tawkJsonp||[]).push([["chunk-common"],{"028e":function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return h}
3
));var i=n("5868"),o=n("7f46"),r=n("e8f9"),a=n("f0b0"),s=n("27a6");function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}
4
))),n.push.apply(n,i)}
5
return n}
6
function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{}
7
;e%2?c(Object(n),!0).forEach((function(e){l(t,e,n[e])}
8
)):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}
9
))}
10
return t}
11
function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}
12
):t[e]=n,t}
13
function d(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}
14
}
15
var h=function(){function e(t){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}
16
)(this,e),this.store=t,this.keyDownTimeout=null,this.webrtcWin=null,this.maxNumberFileUpload=5,this.maxSizeFileUpload=52428800,this.regSurvey=/\[option\](.*?)(<br\/>|$)/gm,this.regSurveyQuestion=/^(.*?)\[option\]/g,this.regOption=/\[option\]/g}
17
return function(t,e,n){e&&d(t.prototype,e),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}
18
)}
19
(e,[{key:"processHistoryMessages",value:function(t){for(var e=[],n={}
20
,r=0;r<t.length;r++){var s=void 0,c=void 0,l=void 0,d=void 0,h=!1,f=null,p=t[r],w=a.Helper.generateUUID(),g=new Date(p.co).getTime(),m={}
21
;if("WEBRTC_CALL"===p.m&&p.md&&p.md.webrtc&&(h=!0,f=p.md.clid),"n"!==p.t||"WEBRTC_CALL"===p.m){if(d=p.n,s=p.uid,"a"===p.ut){var v=n[p.md.rsc];v&&(s=v.pid,c=v.pi?"".concat("https://s3.amazonaws.com/tawk-to-pi","/").concat(v.pi):"".concat("https://embed.tawk.to/_s/v4/assets","/images/default-profile.svg"))}
22
else"s"===p.ut&&(s=a.Helper.generateUUID(),c=p.md&&p.md.pi?"".concat("https://tawk.link","/").concat(p.md.pi):"".concat("https://embed.tawk.to/_s/v4/assets","/images/default-profile.svg"));l=this.parseText(o.a.rawEncode(o.a.rawDecode(p.m)));var y=this.parseSurvey(l);p.md&&p.md.file&&(m.isUpload=!0,m.humanizeFileSize=i.a.formatFileSize(p.md.file.size),m.fileName=o.a.rawEncode(p.md.file.fileName),m.fileLink="".concat("https://tawk.link","/").concat(p.md.file.name),p.md.file.type.match(/(jpg|jpeg|png|gif)$/i)?m.fileType="image":-1!==["video/mp4","video/ogg","video/webm"].indexOf(p.md.file.mimeType)?m.fileType="video":-1!==["audio/mp3","audio/ogg","audio/mpeg","audio/wav"].indexOf(p.md.file.mimeType)&&(m.fileType="audio")),e.push(u(u({}
23
,m),{}
24
,{timeStamp:g,message:l,name:d,type:p.t,time:p.co,data:p.md,isPending:!1,senderType:p.ut,ownerId:s,profileImage:c,cver:p.cver,messageId:w,isCallView:h,callId:f,callData:null,surveyObj:y,rawMessage:p}
25
))}
26
else"AGENT_JOIN_CONVERSATION"===p.m&&p.md&&(n[p.md.rsc]=p.md)}
27
return e}
28
}
29
,{key:"parseChatMessage",value:function(e,n){var r,s,c,l,d,h=!1,f=null,p={}
30
,w=a.Helper.generateUUID(),g=new Date(e.co).getTime();if(e.n=o.a.rawDecode(e.n),"n"===e.t&&("AGENT_JOIN_CONVERSATION"===e.m||"AGENT_LEFT_CONVERSATION"===e.m))return this.updateAgentPresence(e,n),this.store.dispatch("chat/updateChatMessage",{rawMessage:e,type:"n"}
31
),null;if("n"===e.t&&"v"===e.ut){if("VISITOR_RATING"!==e.m)return;"VISITOR_RATING"===e.m&&(n&&this.changeRating(e.md.rt,!0),e.md.rt<0?(e.m="thumbs-down",e.t="c"):e.md.rt>0?(e.m="thumbs-up",e.t="c"):e.m=t.Tawk_Window.app.$i18n("chat","remove_rate"))}
32
if("v"===e.ut)r=this.store.getters["visitor/displayName"],s=e.uid;else if(r=e.n,"a"===e.ut){var m=this.store.getters["chat/agents"];m[e.md.rsc]&&(s=m[e.md.rsc].profileId);var v=this.store.getters["chat/agentProfile"](e.md.rsc);c=v?v.profileImage:null}
33
else"s"===e.ut&&(c=e.md&&e.md.pi?"".concat("https://tawk.link","/").concat(e.md.pi):"".concat("https://embed.tawk.to/_s/v4/assets","/images/default-profile.svg"));return"WEBRTC_CALL"===e.m&&e.md&&e.md.webrtc?(h=!0,f=e.md.clid):("c"===e.t&&("v"===e.ut?this.store.commit("chat/setVisitorHasMessaged",!0):"a"===e.ut?(this.store.commit("chat/setAgentHasMessaged",!0),n&&t.Tawk_Window.jsApi.triggerApiHandlers("onChatMessageAgent",e.m)):"s"===e.ut&&n&&t.Tawk_Window.jsApi.triggerApiHandlers("onChatMessageSystem",e.m)),l||(l=this.parseText(e.m),d=this.parseSurvey(l))),g>this.store.getters["session/lastMessageTimestamp"]&&("v"===e.ut?this.store.commit("session/setLastMessageTimestamp",g):(this.store.dispatch("chat/updateUnseenMessages",w),n&&t.Tawk_Window.jsApi.triggerApiHandlers("onUnreadCountChanged",this.store.getters["chat/unreadMessageCount"]))),e.md&&e.md.file&&(p.isUpload=!0,p.humanizeFileSize=i.a.formatFileSize(e.md.file.size),p.fileName=o.a.rawEncode(e.md.file.fileName),p.fileLink="".concat("https://tawk.link","/").concat(e.md.file.name),e.md.file.type.match(/(jpg|jpeg|png|gif)$/i)?p.fileType="image":-1!==["video/mp4","video/ogg","video/webm"].indexOf(e.md.file.mimeType)?p.fileType="video":-1!==["audio/mp3","audio/ogg","audio/mpeg","audio/wav"].indexOf(e.md.file.mimeType)?p.fileType="audio":p.fileType="other"),p=u(u({}
34
,p),{}
35
,{timeStamp:g,message:l,name:r,type:e.t,time:e.co,data:e.md,isPending:!g,senderType:e.ut,ownerId:s,profileImage:c,cver:e.cver,messageId:w,isCallView:h,callId:f,callData:null,surveyObj:d,rawMessage:e}
36
)}
37
}
38
,{key:"parseText",value:function(t){if(t)return t=t.replace(i.a.regLineBreaks,i.a.br),t=this.createUrl(t.split(/\s/)," ")}
39
}
40
,{key:"createUrl",value:function(t,e){var n,o,r,a=this,s=function(t){return a.parseUrl(t)}
...
</html>