trabajo-afectivo/public/assets/chat/chat.min.js

1 line
66 KiB
JavaScript
Raw Normal View History

window.zammadChatTemplates||(window.zammadChatTemplates={}),window.zammadChatTemplates.agent=function(t){function e(t){return t&&t.ecoSafe?t:void 0!==t&&null!=t?o(t):""}var s=[],n=(t=t||{}).safe,o=t.escape,o=(t.safe=function(t){if(t&&t.ecoSafe)return t;void 0!==t&&null!=t||(t="");t=new String(t);return t.ecoSafe=!0,t},o||(t.escape=function(t){return(""+t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}));return function(){!function(){this.agent.avatar&&(s.push('\n<img class="zammad-chat-agent-avatar" src="'),s.push(e(this.agent.avatar)),s.push('">\n')),s.push('\n<span class="zammad-chat-agent-sentence">\n <span class="zammad-chat-agent-name">'),s.push(e(this.agent.name)),s.push("</span>\n</span>")}.call(this)}.call(t),t.safe=n,t.escape=o,s.join("")};var bind=function(t,e){return function(){return t.apply(e,arguments)}},slice=[].slice,extend=function(t,e){for(var s in e)hasProp.call(e,s)&&(t[s]=e[s]);function n(){this.constructor=t}return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},hasProp={}.hasOwnProperty;!function(p,m){var e,s,n,t,o,i;function a(t){this.options=p.extend({},this.defaults,t),this.log=new s({debug:this.options.debug,logPrefix:this.options.logPrefix||this.logPrefix})}function r(t){this.log=bind(this.log,this),this.error=bind(this.error,this),this.notice=bind(this.notice,this),this.debug=bind(this.debug,this),this.options=p.extend({},this.defaults,t)}function l(t){this.stop=bind(this.stop,this),this.start=bind(this.start,this),l.__super__.constructor.call(this,t)}function d(t){this.ping=bind(this.ping,this),this.send=bind(this.send,this),this.reconnect=bind(this.reconnect,this),this.close=bind(this.close,this),this.connect=bind(this.connect,this),this.set=bind(this.set,this),d.__super__.constructor.call(this,t)}function c(t){return this.removeAttributes=bind(this.removeAttributes,this),this.startTimeoutObservers=bind(this.startTimeoutObservers,this),this.onCssLoaded=bind(this.onCssLoaded,this),this.setAgentOnlineState=bind(this.setAgentOnlineState,this),this.onConnectionEstablished=bind(this.onConnectionEstablished,this),this.setSessionId=bind(this.setSessionId,this),this.onConnectionReestablished=bind(this.onConnectionReestablished,this),this.reconnect=bind(this.reconnect,this),this.destroy=bind(this.destroy,this),this.onScrollHintClick=bind(this.onScrollHintClick,this),this.detectScrolledtoBottom=bind(this.detectScrolledtoBottom,this),this.onLeaveTemporary=bind(this.onLeaveTemporary,this),this.onAgentTypingEnd=bind(this.onAgentTypingEnd,this),this.onAgentTypingStart=bind(this.onAgentTypingStart,this),this.onQueue=bind(this.onQueue,this),this.onQueueScreen=bind(this.onQueueScreen,this),this.onWebSocketClose=bind(this.onWebSocketClose,this),this.onCloseAnimationEnd=bind(this.onCloseAnimationEnd,this),this.close=bind(this.close,this),this.toggle=bind(this.toggle,this),this.sessionClose=bind(this.sessionClose,this),this.onOpenAnimationEnd=bind(this.onOpenAnimationEnd,this),this.open=bind(this.open,this),this.renderMessage=bind(this.renderMessage,this),this.receiveMessage=bind(this.receiveMessage,this),this.onSubmit=bind(this.onSubmit,this),this.onFocus=bind(this.onFocus,this),this.onInput=bind(this.onInput,this),this.onReopenSession=bind(this.onReopenSession,this),this.onError=bind(this.onError,this),this.onWebSocketMessage=bind(this.onWebSocketMessage,this),this.send=bind(this.send,this),this.checkForEnter=bind(this.checkForEnter,this),this.render=bind(this.render,this),this.view=bind(this.view,this),this.T=bind(this.T,this),this.options=p.extend({},this.defaults,t),c.__super__.constructor.call(this,this.options),this.isFullscreen=m.matchMedia&&m.matchMedia("(max-width: 768px)").matches,this.scrollRoot=p(this.getScrollRoot()),p?m.WebSocket&&sessionStorage?this.options.chatId?(this.options.lang||(this.options.lang=p("html").attr("lang")),this.options.lang&&(this.translations[this.options.lang]||(this.log.debug("lang: No "+this.options.lang+" found, try first two letters"),this.options.lang=this.options.lang.replace(/-.+?$/,"")),this.log.debug(